admins-components 9.0.41 → 9.0.42
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 +6 -6
- package/dist/admins-components169.js +1 -1
- package/dist/admins-components172.js +1 -1
- package/dist/admins-components173.js +1 -1
- package/dist/admins-components175.js +1 -1
- package/dist/admins-components23.js +20 -187
- package/dist/admins-components23.js.map +1 -1
- package/dist/admins-components25.js +2 -2
- package/dist/admins-components25.js.map +1 -1
- package/dist/admins-components26.js +214 -70
- package/dist/admins-components26.js.map +1 -1
- package/dist/admins-components28.js +6 -51
- package/dist/admins-components28.js.map +1 -1
- package/dist/admins-components29.js +71 -67
- package/dist/admins-components29.js.map +1 -1
- package/dist/{admins-components27.js → admins-components30.js} +1 -1
- package/dist/admins-components30.js.map +1 -0
- package/dist/admins-components31.js +51 -6
- package/dist/admins-components31.js.map +1 -1
- package/dist/admins-components32.js +68 -59
- package/dist/admins-components32.js.map +1 -1
- package/dist/admins-components34.js +2 -2
- package/dist/admins-components34.js.map +1 -1
- package/dist/admins-components35.js +61 -35
- package/dist/admins-components35.js.map +1 -1
- package/dist/admins-components37.js +2 -2
- package/dist/admins-components37.js.map +1 -1
- package/dist/admins-components38.js +37 -34
- package/dist/admins-components38.js.map +1 -1
- package/dist/admins-components40.js +6 -32
- package/dist/admins-components40.js.map +1 -1
- package/dist/admins-components41.js +37 -0
- package/dist/{admins-components39.js.map → admins-components41.js.map} +1 -1
- package/dist/admins-components42.js +2 -4
- package/dist/admins-components42.js.map +1 -1
- package/dist/admins-components43.js +28 -142
- package/dist/admins-components43.js.map +1 -1
- package/dist/admins-components45.js +2 -2
- package/dist/admins-components45.js.map +1 -1
- package/dist/admins-components46.js +132 -110
- package/dist/admins-components46.js.map +1 -1
- package/dist/admins-components48.js +6 -179
- package/dist/admins-components48.js.map +1 -1
- package/dist/admins-components49.js +124 -4
- package/dist/admins-components49.js.map +1 -1
- package/dist/admins-components50.js +4 -19
- package/dist/admins-components50.js.map +1 -1
- package/dist/admins-components51.js +180 -0
- package/dist/admins-components51.js.map +1 -0
- package/dist/admins-components52.js +2 -4
- package/dist/admins-components52.js.map +1 -1
- package/dist/admins-components61.js +6 -6
- package/dist/admins-components63.js +20 -15
- package/dist/admins-components63.js.map +1 -1
- package/dist/admins-components64.js.map +1 -1
- package/dist/admins-components65.js +1 -1
- package/dist/admins-components68.js +17 -17
- package/dist/admins-components72.js +1 -1
- package/dist/admins-components81.js +1 -1
- package/dist/admins-components84.js +2 -2
- package/dist/admins-components90.js +1 -1
- package/dist/main.css +1 -1
- package/dist/main.css.map +1 -1
- package/dist/src/components/DropdownMenu.vue.d.ts +1 -0
- package/dist/src/components/DropdownSelect.vue.d.ts +3 -0
- package/dist/src/components/Loader.vue.d.ts +4 -1
- package/dist/src/styles/components/data-table/data-table.scss_vue_type_style_index_0_src_true_lang.css +1 -1
- package/dist/src/styles/components/dropdown-select.scss_vue_type_style_index_0_src_true_lang.css +1 -1
- package/dist/src/styles/components/loader.scss_vue_type_style_index_0_src_true_lang.css +1 -1
- package/package.json +1 -1
- package/dist/admins-components27.js.map +0 -1
- package/dist/admins-components39.js +0 -5
- package/dist/admins-components47.js +0 -5
- package/dist/admins-components47.js.map +0 -1
|
@@ -1,125 +1,147 @@
|
|
|
1
|
-
import e from "./admins-
|
|
2
|
-
import t from "./admins-
|
|
3
|
-
import {
|
|
4
|
-
//#region src/components/custom/
|
|
5
|
-
var
|
|
6
|
-
|
|
1
|
+
import e from "./admins-components6.js";
|
|
2
|
+
import t from "./admins-components40.js";
|
|
3
|
+
import { computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, normalizeClass as l, onMounted as u, onUnmounted as d, openBlock as f, ref as p, vModelCheckbox as m, vModelText as h, watch as g, withCtx as _, withDirectives as v } from "vue";
|
|
4
|
+
//#region src/components/custom/ImagePicker.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var y = { class: "ac-component" }, b = { class: "c-image-picker" }, x = { class: "c-image-picker__preview" }, S = ["src", "alt"], C = {
|
|
6
|
+
key: 1,
|
|
7
|
+
class: "c-image-picker__placeholder"
|
|
8
|
+
}, w = { class: "c-image-picker__buttons" }, T = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "c-image-picker__details"
|
|
11
|
+
}, E = { class: "c-input-row" }, D = ["disabled"], O = { class: "c-input-row" }, k = ["disabled"], A = { class: "flex-center gap-1" }, j = ["checked", "disabled"], M = [
|
|
12
|
+
"viewid",
|
|
13
|
+
"environment",
|
|
14
|
+
"aeurl"
|
|
15
|
+
], N = {
|
|
16
|
+
id: "",
|
|
17
|
+
url: "",
|
|
18
|
+
isAdult: !1,
|
|
19
|
+
source: "",
|
|
20
|
+
title: ""
|
|
21
|
+
}, P = /* @__PURE__ */ c({
|
|
22
|
+
__name: "ImagePicker",
|
|
7
23
|
props: {
|
|
8
|
-
modelValue: {},
|
|
9
|
-
|
|
24
|
+
modelValue: { default: void 0 },
|
|
25
|
+
details: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: !1
|
|
28
|
+
},
|
|
29
|
+
editable: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: !1
|
|
32
|
+
},
|
|
33
|
+
direction: { default: "vertical" },
|
|
10
34
|
articleEditorUrl: {},
|
|
11
35
|
environment: {},
|
|
12
36
|
searchImageWidgetUrl: {},
|
|
13
37
|
imageBaseUrl: {},
|
|
14
|
-
imageViewId: {}
|
|
15
|
-
formats: {}
|
|
38
|
+
imageViewId: {}
|
|
16
39
|
},
|
|
17
40
|
emits: ["update:modelValue"],
|
|
18
|
-
setup(
|
|
19
|
-
let
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
title: "",
|
|
25
|
-
lead: ""
|
|
26
|
-
},
|
|
27
|
-
format: ""
|
|
28
|
-
}, y = _, b = a, x = s(v), S = s({
|
|
29
|
-
id: x.value.article.imageId,
|
|
30
|
-
url: "",
|
|
31
|
-
source: "",
|
|
32
|
-
title: "",
|
|
33
|
-
isAdult: !1
|
|
34
|
-
});
|
|
35
|
-
c(() => b.modelValue, (e) => {
|
|
36
|
-
e ? x.value = e : x.value = v;
|
|
37
|
-
}, {
|
|
38
|
-
deep: !0,
|
|
39
|
-
immediate: !0
|
|
40
|
-
}), c(() => x, (e) => {
|
|
41
|
-
y("update:modelValue", x.value), S.value.id = e.value.article.imageId, S.value.url = e.value.article.imageUrl;
|
|
42
|
-
}, {
|
|
43
|
-
deep: !0,
|
|
44
|
-
immediate: !0
|
|
45
|
-
}), c(() => S.value.id, (e) => {
|
|
46
|
-
x.value.article.imageId = e;
|
|
47
|
-
}, {
|
|
48
|
-
deep: !0,
|
|
49
|
-
immediate: !0
|
|
50
|
-
}), c(() => S.value.url, (e) => {
|
|
51
|
-
x.value.article.imageUrl = e;
|
|
41
|
+
setup(c, { emit: P }) {
|
|
42
|
+
let F = c, I = P, L = p(N), R = p(!1);
|
|
43
|
+
g(() => L.value, () => {
|
|
44
|
+
I("update:modelValue", L.value);
|
|
45
|
+
}, { deep: !0 }), g(() => F.modelValue, (e) => {
|
|
46
|
+
e && (L.value = e);
|
|
52
47
|
}, {
|
|
53
48
|
deep: !0,
|
|
54
49
|
immediate: !0
|
|
55
50
|
});
|
|
56
|
-
let
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return ((e) => {
|
|
62
|
-
if (!customElements.get("hvg-search-image") && !document.querySelector(`script[src="${e}"]`)) {
|
|
63
|
-
let t = document.createElement("script");
|
|
64
|
-
t.type = "text/javascript", t.src = e, document.head.appendChild(t);
|
|
51
|
+
let z = `${typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : `ip-${Date.now()}-${Math.random().toString(36).slice(2)}`}-image-picker-causation`;
|
|
52
|
+
u(() => {
|
|
53
|
+
if (!customElements.get("hvg-search-image") && !document.querySelector(`script[src="${F.searchImageWidgetUrl}"]`)) {
|
|
54
|
+
let e = document.createElement("script");
|
|
55
|
+
e.type = "text/javascript", e.src = F.searchImageWidgetUrl, e.async = !0, document.head.appendChild(e);
|
|
65
56
|
}
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
"
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
"
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
57
|
+
});
|
|
58
|
+
let B = n(() => L.value && (L.value.url && L.value.url.length > 0 || L.value.id && L.value.id.length > 0)), V = n(() => {
|
|
59
|
+
if (B.value) return L.value.url && L.value.url.length > 0 ? L.value.url : `${F.imageBaseUrl}/${F.imageViewId}/${L.value.id}.img`;
|
|
60
|
+
}), H = n(() => F.direction === "horizontal"), U = (e) => {
|
|
61
|
+
e.preventDefault(), R.value = !0;
|
|
62
|
+
}, W = (e) => {
|
|
63
|
+
e.preventDefault(), L.value = { ...N };
|
|
64
|
+
}, G = (e) => {
|
|
65
|
+
e?.detail?.causationid === z && (R.value = !1, e.detail?.image && (L.value = {
|
|
66
|
+
id: e.detail.image.id,
|
|
67
|
+
url: "",
|
|
68
|
+
isAdult: e.detail.image.isAdult,
|
|
69
|
+
source: e.detail.image.source,
|
|
70
|
+
title: e.detail.image.title
|
|
71
|
+
}));
|
|
72
|
+
};
|
|
73
|
+
return u(() => {
|
|
74
|
+
window.addEventListener("image-selected", G);
|
|
75
|
+
}), d(() => {
|
|
76
|
+
window.removeEventListener("image-selected", G);
|
|
77
|
+
}), (n, u) => (f(), a("div", y, [o("div", b, [o("div", { class: l(["c-image-picker__container", { "c-image-picker__container--horizontal": H.value }]) }, [
|
|
78
|
+
o("div", x, [B.value ? (f(), a("img", {
|
|
79
|
+
key: 0,
|
|
80
|
+
src: V.value,
|
|
81
|
+
alt: L.value.title || "Selected image",
|
|
82
|
+
class: "c-image-picker__img"
|
|
83
|
+
}, null, 8, S)) : (f(), a("p", C, "Nincs kiválasztott kép"))]),
|
|
84
|
+
o("div", w, [s(e, {
|
|
85
|
+
type: "success",
|
|
86
|
+
label: "Kép kiválasztása",
|
|
87
|
+
class: "nowrap",
|
|
88
|
+
onClick: U,
|
|
89
|
+
icon: "fa-solid fa-image"
|
|
90
|
+
}), s(e, {
|
|
91
|
+
type: "error",
|
|
92
|
+
label: "Eltávolítás",
|
|
93
|
+
class: "nowrap",
|
|
94
|
+
onClick: W,
|
|
95
|
+
icon: "fa-solid fa-trash"
|
|
96
|
+
})]),
|
|
97
|
+
c.details && L.value.id ? (f(), a("div", T, [
|
|
98
|
+
o("div", null, [u[4] ||= o("label", {
|
|
99
|
+
for: "image-source",
|
|
100
|
+
class: "c-label"
|
|
101
|
+
}, "Forrás", -1), o("div", E, [v(o("input", {
|
|
102
|
+
"onUpdate:modelValue": u[0] ||= (e) => L.value.source = e,
|
|
103
|
+
id: "image-source",
|
|
104
|
+
type: "text",
|
|
105
|
+
class: "c-input",
|
|
106
|
+
placeholder: "Kép forrása",
|
|
107
|
+
disabled: !c.editable
|
|
108
|
+
}, null, 8, D), [[h, L.value.source]])])]),
|
|
109
|
+
o("div", null, [u[5] ||= o("label", {
|
|
110
|
+
for: "image-title",
|
|
111
|
+
class: "c-label"
|
|
112
|
+
}, "Cím / Alt szöveg", -1), o("div", O, [v(o("textarea", {
|
|
113
|
+
"onUpdate:modelValue": u[1] ||= (e) => L.value.title = e,
|
|
114
|
+
id: "image-title",
|
|
115
|
+
class: "c-input c-image-picker__textarea",
|
|
116
|
+
placeholder: "Cím vagy alt szöveg",
|
|
117
|
+
disabled: !c.editable
|
|
118
|
+
}, null, 8, k), [[h, L.value.title]])])]),
|
|
119
|
+
o("div", A, [v(o("input", {
|
|
120
|
+
id: "image-adult",
|
|
121
|
+
"onUpdate:modelValue": u[2] ||= (e) => L.value.isAdult = e,
|
|
122
|
+
type: "checkbox",
|
|
123
|
+
class: "c-checkbox",
|
|
124
|
+
checked: L.value.isAdult,
|
|
125
|
+
disabled: !c.editable
|
|
126
|
+
}, null, 8, j), [[m, L.value.isAdult]]), u[6] ||= o("label", {
|
|
127
|
+
for: "image-adult",
|
|
128
|
+
class: "c-label"
|
|
129
|
+
}, "Felnőtt tartalom", -1)])
|
|
130
|
+
])) : i("", !0)
|
|
131
|
+
], 2), R.value ? (f(), r(t, {
|
|
132
|
+
key: 0,
|
|
133
|
+
onClose: u[3] ||= (e) => R.value = !1
|
|
134
|
+
}, {
|
|
135
|
+
default: _(() => [o("hvg-search-image", {
|
|
136
|
+
causationid: z,
|
|
137
|
+
viewid: c.imageViewId,
|
|
138
|
+
environment: c.environment,
|
|
139
|
+
aeurl: c.articleEditorUrl,
|
|
140
|
+
selectonly: "true"
|
|
141
|
+
}, null, 8, M)]),
|
|
142
|
+
_: 1
|
|
143
|
+
})) : i("", !0)])]));
|
|
122
144
|
}
|
|
123
145
|
});
|
|
124
146
|
//#endregion
|
|
125
|
-
export {
|
|
147
|
+
export { P as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admins-components46.js","names":[],"sources":["../src/components/custom/
|
|
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'\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\n// Generate unique ID\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\n// Load external search image widget script\nonMounted(() => {\n // Check if custom element is already registered\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\n// Computed properties\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\n// Event handlers\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\n// Event listeners\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\">\n <div class=\"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\">\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\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 <div class=\"flex-center gap-1\">\n <input\n id=\"image-adult\"\n v-model=\"local.isAdult\"\n type=\"checkbox\"\n class=\"c-checkbox\"\n :checked=\"local.isAdult\"\n :disabled=\"!editable\"\n />\n <label for=\"image-adult\" class=\"c-label\">Felnőtt tartalom</label>\n </div>\n </div>\n </div>\n\n <!-- Image Search Modal Dialog -->\n <Modal v-if=\"showImageModal\" @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 </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;;;;;;;;;;;;;;;;;;;;;EAQA,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;EAQA,IAAM,IAAmB,GA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AA;IAU1B,EAUM,OAVN,GAUM,CAAA,EATJ,EAOE,SAAA;KANA,IAAG;8CACM,MAAM,UAAO;KACtB,MAAK;KACL,OAAM;KACL,SAAS,EAAA,MAAM;KACf,UAAQ,CAAG,EAAA;yBAJH,EAAA,MAAM,OAAO,CAAA,CAAA,GAAA,AAAA,EAAA,OAMxB,EAAiE,SAAA;KAA1D,KAAI;KAAc,OAAM;OAAU,oBAAgB,EAAA,CAAA,CAAA;;SAMlD,EAAA,SAAA,EAAA,GAAb,EAQQ,GAAA;;GARsB,SAAK,AAAA,EAAA,QAAA,MAAE,EAAA,QAAc;;oBAO/C,CANF,EAME,oBAAA;IALC,aAAa;IACb,QAAQ,EAAA;IACR,aAAa,EAAA;IACb,OAAO,EAAA;IACR,YAAW"}
|
|
@@ -1,180 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
//#region src/components/custom/InternalArticleOffer.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var g = { class: "ac-component" }, _ = { class: "d-flex flex-column gap-2" }, v = {
|
|
8
|
-
key: 0,
|
|
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 = ["id", "apiurl"], O = "00000000-0000-0000-0000-000000000000", k = /* @__PURE__ */ l({
|
|
11
|
-
__name: "InternalArticleOffer",
|
|
12
|
-
props: {
|
|
13
|
-
modelValue: {},
|
|
14
|
-
searchArticleApiUrl: {},
|
|
15
|
-
searchArticleWidgetUrl: {},
|
|
16
|
-
environment: {},
|
|
17
|
-
searchImageWidgetUrl: {},
|
|
18
|
-
imageBaseUrl: {},
|
|
19
|
-
imageViewId: {},
|
|
20
|
-
showIds: {
|
|
21
|
-
type: Boolean,
|
|
22
|
-
default: !0
|
|
23
|
-
},
|
|
24
|
-
formats: {}
|
|
25
|
-
},
|
|
26
|
-
emits: ["update:modelValue"],
|
|
27
|
-
setup(l, { emit: k }) {
|
|
28
|
-
let A = {
|
|
29
|
-
article: {
|
|
30
|
-
siteId: "",
|
|
31
|
-
id: "",
|
|
32
|
-
imageId: "",
|
|
33
|
-
title: "",
|
|
34
|
-
lead: ""
|
|
35
|
-
},
|
|
36
|
-
format: ""
|
|
37
|
-
}, j = k, M = l, N = p(A), P = p({
|
|
38
|
-
id: N.value.article.imageId || "",
|
|
39
|
-
url: "",
|
|
40
|
-
source: "",
|
|
41
|
-
title: "",
|
|
42
|
-
isAdult: !1
|
|
43
|
-
}), F = p(!1);
|
|
44
|
-
m(() => M.modelValue, (e) => {
|
|
45
|
-
e ? N.value = e : N.value = A;
|
|
46
|
-
}, {
|
|
47
|
-
deep: !0,
|
|
48
|
-
immediate: !0
|
|
49
|
-
}), m(() => N, (e) => {
|
|
50
|
-
j("update:modelValue", N.value), P.value.id = e.value.article.imageId;
|
|
51
|
-
}, {
|
|
52
|
-
deep: !0,
|
|
53
|
-
immediate: !0
|
|
54
|
-
}), m(() => P.value.id, (e) => {
|
|
55
|
-
N.value.article.imageId = e;
|
|
56
|
-
}, {
|
|
57
|
-
deep: !0,
|
|
58
|
-
immediate: !0
|
|
59
|
-
});
|
|
60
|
-
let I = p((/* @__PURE__ */ new Date()).getTime().toString() + "article");
|
|
61
|
-
d(() => {
|
|
62
|
-
window.removeEventListener("search_posts_selected", L);
|
|
63
|
-
}), u(() => {
|
|
64
|
-
window.addEventListener("search_posts_selected", L);
|
|
65
|
-
});
|
|
66
|
-
let L = (e) => {
|
|
67
|
-
if (e.detail.id == I.value) {
|
|
68
|
-
if (e.detail.result && e.detail.posts.length > 0) {
|
|
69
|
-
N.value.article.id = e.detail.posts[0].id, N.value.article.siteId = e.detail.posts[0].siteId, N.value.article.title = e.detail.posts[0].title, N.value.article.lead = e.detail.posts[0].lead;
|
|
70
|
-
let t = e.detail.posts[0].featuredImage;
|
|
71
|
-
N.value.article.imageId = t || O;
|
|
72
|
-
}
|
|
73
|
-
F.value = !1;
|
|
74
|
-
}
|
|
75
|
-
}, R = () => {
|
|
76
|
-
F.value = !0;
|
|
77
|
-
}, z = (e) => {
|
|
78
|
-
if (!customElements.get("search-posts-widget") && !document.querySelector(`script[src="${e}"]`)) {
|
|
79
|
-
let t = document.createElement("script");
|
|
80
|
-
t.type = "text/javascript", t.src = e, document.head.appendChild(t);
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
if (!customElements.get("hvg-search-image") && !document.querySelector(`script[src="${M.searchImageWidgetUrl}"]`)) {
|
|
84
|
-
let e = document.createElement("script");
|
|
85
|
-
e.type = "text/javascript", e.src = M.searchImageWidgetUrl, e.async = !0, document.head.appendChild(e);
|
|
86
|
-
}
|
|
87
|
-
return z(M.searchArticleWidgetUrl), (u, d) => (f(), o("div", g, [s("div", _, [
|
|
88
|
-
s("div", null, [c(e, {
|
|
89
|
-
type: "success",
|
|
90
|
-
label: "Cikk kiválasztása",
|
|
91
|
-
class: "nowrap",
|
|
92
|
-
onClick: R,
|
|
93
|
-
icon: "fa-solid fa-newspaper"
|
|
94
|
-
})]),
|
|
95
|
-
l.showIds ? (f(), o("div", v, [s("div", null, [d[5] ||= s("label", {
|
|
96
|
-
for: "articleId",
|
|
97
|
-
class: "c-label"
|
|
98
|
-
}, "Article ID", -1), s("div", y, [s("input", {
|
|
99
|
-
id: "articleId",
|
|
100
|
-
type: "text",
|
|
101
|
-
class: "c-input",
|
|
102
|
-
placeholder: "Article ID",
|
|
103
|
-
disabled: "",
|
|
104
|
-
value: N.value.article.id
|
|
105
|
-
}, null, 8, b)])]), s("div", null, [d[6] ||= s("label", {
|
|
106
|
-
for: "articleSiteId",
|
|
107
|
-
class: "c-label"
|
|
108
|
-
}, "Site ID", -1), s("div", x, [s("input", {
|
|
109
|
-
id: "articleSiteId",
|
|
110
|
-
type: "text",
|
|
111
|
-
class: "c-input",
|
|
112
|
-
placeholder: "Site ID",
|
|
113
|
-
disabled: "",
|
|
114
|
-
value: N.value.article.siteId
|
|
115
|
-
}, null, 8, S)])])])) : a("", !0),
|
|
116
|
-
s("div", null, [d[7] ||= s("label", {
|
|
117
|
-
for: "articleTitle",
|
|
118
|
-
class: "c-label"
|
|
119
|
-
}, "Title", -1), s("div", C, [s("textarea", {
|
|
120
|
-
id: "articleTitle",
|
|
121
|
-
class: "c-input",
|
|
122
|
-
placeholder: "Article title",
|
|
123
|
-
value: N.value.article.title,
|
|
124
|
-
onInput: d[0] ||= (e) => N.value.article.title = e.target?.value || ""
|
|
125
|
-
}, null, 40, w)])]),
|
|
126
|
-
s("div", null, [d[8] ||= s("label", {
|
|
127
|
-
for: "articleLead",
|
|
128
|
-
class: "c-label"
|
|
129
|
-
}, "Lead", -1), s("div", T, [s("textarea", {
|
|
130
|
-
id: "articleLead",
|
|
131
|
-
class: "c-input",
|
|
132
|
-
placeholder: "Article lead / description",
|
|
133
|
-
value: N.value.article.lead,
|
|
134
|
-
onInput: d[1] ||= (e) => N.value.article.lead = e.target?.value || ""
|
|
135
|
-
}, null, 40, E)])]),
|
|
136
|
-
d[10] ||= s("hr", { class: "separator" }, null, -1),
|
|
137
|
-
s("div", null, [c(r, {
|
|
138
|
-
modelValue: P.value,
|
|
139
|
-
"onUpdate:modelValue": d[2] ||= (e) => P.value = e,
|
|
140
|
-
details: !1,
|
|
141
|
-
editable: !1,
|
|
142
|
-
environment: M.environment,
|
|
143
|
-
"article-editor-url": M.searchArticleApiUrl,
|
|
144
|
-
"search-image-widget-url": M.searchImageWidgetUrl,
|
|
145
|
-
"image-base-url": M.imageBaseUrl,
|
|
146
|
-
"image-view-id": M.imageViewId
|
|
147
|
-
}, null, 8, [
|
|
148
|
-
"modelValue",
|
|
149
|
-
"environment",
|
|
150
|
-
"article-editor-url",
|
|
151
|
-
"search-image-widget-url",
|
|
152
|
-
"image-base-url",
|
|
153
|
-
"image-view-id"
|
|
154
|
-
])]),
|
|
155
|
-
s("div", null, [d[9] ||= s("label", { class: "c-label" }, "Format", -1), c(t, {
|
|
156
|
-
modelValue: N.value.format,
|
|
157
|
-
"onUpdate:modelValue": d[3] ||= (e) => N.value.format = e,
|
|
158
|
-
options: M.formats,
|
|
159
|
-
config: { placeholder: "Select format..." }
|
|
160
|
-
}, null, 8, ["modelValue", "options"])]),
|
|
161
|
-
F.value ? (f(), i(n, {
|
|
162
|
-
key: 1,
|
|
163
|
-
title: "Search Article",
|
|
164
|
-
onClose: d[4] ||= (e) => F.value = !1
|
|
165
|
-
}, {
|
|
166
|
-
default: h(() => [s("search-posts-widget", {
|
|
167
|
-
id: I.value,
|
|
168
|
-
selector: "true",
|
|
169
|
-
apiurl: M.searchArticleApiUrl,
|
|
170
|
-
wpurl: "",
|
|
171
|
-
searchurl: "",
|
|
172
|
-
style: { height: "500px" }
|
|
173
|
-
}, null, 8, D)]),
|
|
174
|
-
_: 1
|
|
175
|
-
})) : a("", !0)
|
|
176
|
-
])]));
|
|
177
|
-
}
|
|
178
|
-
});
|
|
1
|
+
import './src/styles/components/image-picker.scss_vue_type_style_index_0_src_true_lang.css';
|
|
2
|
+
import e from "./admins-components46.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region src/components/custom/ImagePicker.vue
|
|
5
|
+
var t = e;
|
|
179
6
|
//#endregion
|
|
180
|
-
export {
|
|
7
|
+
export { t as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admins-components48.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":";;;;;;;;;6MA4FM,IAAY;;;;;;;;;;;;;;;;;;EAxElB,IAAM,IAA0C;GAC9C,SAAS;IACP,QAAQ;IACR,IAAI;IACJ,SAAS;IACT,OAAO;IACP,MAAM;GACR;GACA,QAAQ;EACV,GAEM,IAAO,GAIP,IAAQ,GAiBR,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,E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Y;IACX,OAAO,EAAA,MAAW,QAAQ;IAC1B,SAAK,AAAA,EAAA,QAAA,MAAE,EAAA,MAAW,QAAQ,OAAQ,EAAO,QAAgB,SAAK;;aAKrE,EAAwB,MAAA,EAApB,OAAM,YAAW,GAAA,MAAA,EAAA;GAErB,EAWM,OAAA,MAAA,CAVJ,EASE,GAAA;gBARS,EAAA;6CAAU,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,CAAA,AAAA,EAAA,OANJ,EAAqC,SAAA,EAA9B,OAAM,UAAS,GAAC,UAAM,EAAA,GAC7B,EAIE,GAAA;gBAHS,EAAA,MAAW;6CAAX,MAAW,SAAM;IACzB,SAAS,EAAM;IACf,QAAQ,EAAA,aAAA,mBAAA;;GAIA,EAAA,SAAA,EAAA,GAAb,EASQ,GAAA;;IATuB,OAAM;IAAkB,SAAK,AAAA,EAAA,QAAA,MAAE,EAAA,QAAgB;;qBAQ1E,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-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'\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\n// Generate unique ID\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\n// Load external search image widget script\nonMounted(() => {\n // Check if custom element is already registered\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\n// Computed properties\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\n// Event handlers\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\n// Event listeners\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\">\n <div class=\"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\">\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\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 <div class=\"flex-center gap-1\">\n <input\n id=\"image-adult\"\n v-model=\"local.isAdult\"\n type=\"checkbox\"\n class=\"c-checkbox\"\n :checked=\"local.isAdult\"\n :disabled=\"!editable\"\n />\n <label for=\"image-adult\" class=\"c-label\">Felnőtt tartalom</label>\n </div>\n </div>\n </div>\n\n <!-- Image Search Modal Dialog -->\n <Modal v-if=\"showImageModal\" @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 </div>\n</template>\n\n<style lang=\"scss\" src=\"@/styles/components/image-picker.scss\"></style>\n"],"mappings":""}
|