admins-components 9.0.63 → 9.0.65

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.
@@ -7,8 +7,12 @@ import { createBlock as i, createSlots as a, createVNode as o, openBlock as s, r
7
7
  var m = t({
8
8
  name: "ImagePickerDetailsElement",
9
9
  components: { ImagePicker: e },
10
+ props: { direction: {
11
+ required: !1,
12
+ default: "vertical"
13
+ } },
10
14
  setup(e, t) {
11
- let { value: n } = t.element, i = t.attrs.direction ? t.attrs.direction : "vertical";
15
+ let { value: n } = t.element, i = e.direction ?? "vertical";
12
16
  return f(() => n, () => {
13
17
  n.value ||= {
14
18
  id: "00000000-0000-0000-0000-000000000000",
@@ -1 +1 @@
1
- {"version":3,"file":"admins-components176.js","names":[],"sources":["../src/vueformelements/ImagePickerDetailsElement.vue"],"sourcesContent":["<!-- eslint-disable-next-line vue/block-lang -->\n<script>\nimport { defineElement } from '@vueform/vueform'\nimport { watch } from 'vue'\nimport ImagePicker from '@/components/custom/ImagePicker.vue'\nimport { ipeConfig } from '@/vueformelements/config/ImagePickerElementConfig'\n\nexport default defineElement({\n name: 'ImagePickerDetailsElement',\n components: { ImagePicker },\n\n setup(props, context) {\n const { value } = context.element\n const direction = context.attrs.direction ? context.attrs.direction : 'vertical'\n\n watch(\n () => value,\n () => {\n if (!value.value) {\n value.value = {\n id: '00000000-0000-0000-0000-000000000000',\n source: '',\n title: '',\n isAdult: false,\n }\n }\n },\n { deep: true, immediate: true },\n )\n\n return {\n ipeConfig,\n value,\n direction,\n }\n },\n})\n</script>\n\n<template>\n <ElementLayout>\n <template #element>\n <ImagePicker\n v-model=\"value\"\n :editable=\"true\"\n :details=\"true\"\n :direction=\"direction\"\n :environment=\"ipeConfig.environment\"\n :articleEditorUrl=\"ipeConfig.articleEditorUrl\"\n :searchImageWidgetUrl=\"ipeConfig.searchImageWidgetUrl\"\n :imageBaseUrl=\"ipeConfig.imageBaseUrl\"\n :imageViewId=\"ipeConfig.imageViewId\"\n />\n </template>\n\n <template v-for=\"(component, slot) in elementSlots\" #[slot]>\n <!-- eslint-disable-next-line vue/valid-attribute-name -->\n <slot :name=\"slot\" :el$=\"el$\">\n <component :is=\"component\" :el$=\"el$\" />\n </slot>\n </template>\n </ElementLayout>\n</template>\n"],"mappings":";;;;;;AAOA,IAAK,IAAa,EAAW;CAC3B,MAAM;CACN,YAAY,EAAE,aAAA,EAAY;CAE1B,MAAM,GAAO,GAAS;EACpB,IAAM,EAAE,aAAU,EAAQ,SACpB,IAAY,EAAQ,MAAM,YAAY,EAAQ,MAAM,YAAY;EAiBtE,OAfA,QACQ,SACA;GACJ,AACE,EAAM,UAAQ;IACZ,IAAI;IACJ,QAAQ;IACR,OAAO;IACP,SAAS;GACX;EAEJ,GACA;GAAE,MAAM;GAAM,WAAW;EAAK,CAChC,GAEO;GACL;GACA;GACA;EACF;CACF;AACF,CAAC;;;aAIC,EAqBgB,GAAA,MAAA,EAAA;EApBH,SAAO,QAWd,CAVF,EAUE,GAAA;eATS,EAAA;0CAAA,EAAA,QAAK;GACb,UAAU;GACV,SAAS;GACT,WAAW,EAAA;GACX,aAAa,EAAA,UAAU;GACvB,kBAAkB,EAAA,UAAU;GAC5B,sBAAsB,EAAA,UAAU;GAChC,cAAc,EAAA,UAAU;GACxB,aAAa,EAAA,UAAU;;;;;;;;;;;OAIU,EAAA,eAApB,GAAW;QAAwB;cAI5C,CAFP,EAEO,EAAA,QAFM,GAAI,EAAG,KAAK,EAAA,IAAG,SAErB,EAAA,EAAA,GADL,EAAwC,EAAxB,CAAS,GAAA,EAAG,KAAK,EAAA,IAAG,GAAA,MAAA,GAAA,CAAA,KAAA,CAAA,EAAA,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"admins-components176.js","names":[],"sources":["../src/vueformelements/ImagePickerDetailsElement.vue"],"sourcesContent":["<!-- eslint-disable-next-line vue/block-lang -->\n<script>\nimport { defineElement } from '@vueform/vueform'\nimport { watch } from 'vue'\nimport ImagePicker from '@/components/custom/ImagePicker.vue'\nimport { ipeConfig } from '@/vueformelements/config/ImagePickerElementConfig'\n\nexport default defineElement({\n name: 'ImagePickerDetailsElement',\n components: { ImagePicker },\n props: {\n direction: {\n required: false,\n default: 'vertical',\n },\n },\n\n setup(props, context) {\n const { value } = context.element\n const direction = props.direction ?? 'vertical'\n\n watch(\n () => value,\n () => {\n if (!value.value) {\n value.value = {\n id: '00000000-0000-0000-0000-000000000000',\n source: '',\n title: '',\n isAdult: false,\n }\n }\n },\n { deep: true, immediate: true },\n )\n\n return {\n ipeConfig,\n value,\n direction,\n }\n },\n})\n</script>\n\n<template>\n <ElementLayout>\n <template #element>\n <ImagePicker\n v-model=\"value\"\n :editable=\"true\"\n :details=\"true\"\n :direction=\"direction\"\n :environment=\"ipeConfig.environment\"\n :articleEditorUrl=\"ipeConfig.articleEditorUrl\"\n :searchImageWidgetUrl=\"ipeConfig.searchImageWidgetUrl\"\n :imageBaseUrl=\"ipeConfig.imageBaseUrl\"\n :imageViewId=\"ipeConfig.imageViewId\"\n />\n </template>\n\n <template v-for=\"(component, slot) in elementSlots\" #[slot]>\n <!-- eslint-disable-next-line vue/valid-attribute-name -->\n <slot :name=\"slot\" :el$=\"el$\">\n <component :is=\"component\" :el$=\"el$\" />\n </slot>\n </template>\n </ElementLayout>\n</template>\n"],"mappings":";;;;;;AAOA,IAAK,IAAa,EAAW;CAC3B,MAAM;CACN,YAAY,EAAE,aAAA,EAAY;CAC1B,OAAO,EACL,WAAW;EACT,UAAU;EACV,SAAS;CACX,EACF;CAEA,MAAM,GAAO,GAAS;EACpB,IAAM,EAAE,aAAU,EAAQ,SACpB,IAAY,EAAM,aAAa;EAiBrC,OAfA,QACQ,SACA;GACJ,AACE,EAAM,UAAQ;IACZ,IAAI;IACJ,QAAQ;IACR,OAAO;IACP,SAAS;GACX;EAEJ,GACA;GAAE,MAAM;GAAM,WAAW;EAAK,CAChC,GAEO;GACL;GACA;GACA;EACF;CACF;AACF,CAAC;;;aAIC,EAqBgB,GAAA,MAAA,EAAA;EApBH,SAAO,QAWd,CAVF,EAUE,GAAA;eATS,EAAA;0CAAA,EAAA,QAAK;GACb,UAAU;GACV,SAAS;GACT,WAAW,EAAA;GACX,aAAa,EAAA,UAAU;GACvB,kBAAkB,EAAA,UAAU;GAC5B,sBAAsB,EAAA,UAAU;GAChC,cAAc,EAAA,UAAU;GACxB,aAAa,EAAA,UAAU;;;;;;;;;;;OAIU,EAAA,eAApB,GAAW;QAAwB;cAI5C,CAFP,EAEO,EAAA,QAFM,GAAI,EAAG,KAAK,EAAA,IAAG,SAErB,EAAA,EAAA,GADL,EAAwC,EAAxB,CAAS,GAAA,EAAG,KAAK,EAAA,IAAG,GAAA,MAAA,GAAA,CAAA,KAAA,CAAA,EAAA,CAAA,CAAA,CAAA"}
@@ -1,24 +1,25 @@
1
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";
2
+ import t from "./admins-components19.js";
3
+ import n from "./admins-components40.js";
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";
4
5
  //#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
+ var y = { class: "ac-component" }, b = { class: "c-image-picker" }, x = { class: "c-image-picker__preview-section" }, S = { class: "c-image-picker__preview" }, C = ["src", "alt"], w = {
6
7
  key: 1,
7
8
  class: "c-image-picker__placeholder"
8
- }, w = { class: "c-image-picker__buttons" }, T = {
9
+ }, T = { class: "c-image-picker__buttons" }, E = {
9
10
  key: 0,
10
11
  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
+ }, D = { class: "c-input-row" }, O = ["disabled"], k = { class: "c-input-row" }, A = ["disabled"], j = [
12
13
  "viewid",
13
14
  "environment",
14
15
  "aeurl"
15
- ], N = {
16
+ ], M = {
16
17
  id: "",
17
18
  url: "",
18
19
  isAdult: !1,
19
20
  source: "",
20
21
  title: ""
21
- }, P = /* @__PURE__ */ c({
22
+ }, N = /* @__PURE__ */ l({
22
23
  __name: "ImagePicker",
23
24
  props: {
24
25
  modelValue: { default: void 0 },
@@ -38,31 +39,31 @@ var y = { class: "ac-component" }, b = { class: "c-image-picker" }, x = { class:
38
39
  imageViewId: {}
39
40
  },
40
41
  emits: ["update:modelValue"],
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);
42
+ setup(l, { emit: N }) {
43
+ let P = l, F = N, I = m(M), L = m(!1);
44
+ g(() => I.value, () => {
45
+ F("update:modelValue", I.value);
46
+ }, { deep: !0 }), g(() => P.modelValue, (e) => {
47
+ e && (I.value = e);
47
48
  }, {
48
49
  deep: !0,
49
50
  immediate: !0
50
51
  });
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}"]`)) {
52
+ let R = `${typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : `ip-${Date.now()}-${Math.random().toString(36).slice(2)}`}-image-picker-causation`;
53
+ d(() => {
54
+ if (!customElements.get("hvg-search-image") && !document.querySelector(`script[src="${P.searchImageWidgetUrl}"]`)) {
54
55
  let e = document.createElement("script");
55
- e.type = "text/javascript", e.src = F.searchImageWidgetUrl, e.async = !0, document.head.appendChild(e);
56
+ e.type = "text/javascript", e.src = P.searchImageWidgetUrl, e.async = !0, document.head.appendChild(e);
56
57
  }
57
58
  });
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;
59
+ let z = r(() => I.value && (I.value.url && I.value.url.length > 0 || I.value.id && I.value.id.length > 0)), B = r(() => {
60
+ if (z.value) return I.value.url && I.value.url.length > 0 ? I.value.url : `${P.imageBaseUrl}/${P.imageViewId}/${I.value.id}.img`;
61
+ }), V = r(() => P.direction === "horizontal"), H = (e) => {
62
+ e.preventDefault(), L.value = !0;
63
+ }, U = (e) => {
64
+ e.preventDefault(), I.value = { ...M };
62
65
  }, 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
+ e?.detail?.causationid === R && (L.value = !1, e.detail?.image && (I.value = {
66
67
  id: e.detail.image.id,
67
68
  url: "",
68
69
  isAdult: e.detail.image.isAdult,
@@ -70,78 +71,69 @@ var y = { class: "ac-component" }, b = { class: "c-image-picker" }, x = { class:
70
71
  title: e.detail.image.title
71
72
  }));
72
73
  };
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, {
74
+ return d(() => {
75
+ window.addEventListener("image-selected", W);
76
+ }), f(() => {
77
+ window.removeEventListener("image-selected", W);
78
+ }), (r, d) => (p(), o("div", y, [s("div", b, [s("div", { class: u(["c-image-picker__container", { "c-image-picker__container--horizontal": V.value }]) }, [s("div", x, [s("div", S, [z.value ? (p(), o("img", {
132
79
  key: 0,
133
- onClose: u[3] ||= (e) => R.value = !1
80
+ src: B.value,
81
+ alt: I.value.title || "Selected image",
82
+ class: "c-image-picker__img"
83
+ }, null, 8, C)) : (p(), o("p", w, "Nincs kiválasztott kép"))]), s("div", T, [c(e, {
84
+ type: "success",
85
+ label: "Kép kiválasztása",
86
+ class: "nowrap",
87
+ onClick: H,
88
+ icon: "fa-solid fa-image"
89
+ }), c(e, {
90
+ type: "error",
91
+ label: "Eltávolítás",
92
+ class: "nowrap",
93
+ onClick: U,
94
+ icon: "fa-solid fa-trash"
95
+ })])]), l.details && I.value.id ? (p(), o("div", E, [
96
+ s("div", null, [d[4] ||= s("label", {
97
+ for: "image-source",
98
+ class: "c-label"
99
+ }, "Forrás", -1), s("div", D, [v(s("input", {
100
+ "onUpdate:modelValue": d[0] ||= (e) => I.value.source = e,
101
+ id: "image-source",
102
+ type: "text",
103
+ class: "c-input",
104
+ placeholder: "Kép forrása",
105
+ disabled: !l.editable
106
+ }, null, 8, O), [[h, I.value.source]])])]),
107
+ s("div", null, [d[5] ||= s("label", {
108
+ for: "image-title",
109
+ class: "c-label"
110
+ }, "Cím / Alt szöveg", -1), s("div", k, [v(s("textarea", {
111
+ "onUpdate:modelValue": d[1] ||= (e) => I.value.title = e,
112
+ id: "image-title",
113
+ class: "c-input c-image-picker__textarea",
114
+ placeholder: "Cím vagy alt szöveg",
115
+ disabled: !l.editable
116
+ }, null, 8, A), [[h, I.value.title]])])]),
117
+ c(t, {
118
+ modelValue: I.value.isAdult,
119
+ "onUpdate:modelValue": d[2] ||= (e) => I.value.isAdult = e,
120
+ label: "Felnőtt tartalom",
121
+ disabled: !l.editable
122
+ }, null, 8, ["modelValue", "disabled"])
123
+ ])) : a("", !0)], 2), L.value ? (p(), i(n, {
124
+ key: 0,
125
+ onClose: d[3] ||= (e) => L.value = !1
134
126
  }, {
135
- default: _(() => [o("hvg-search-image", {
136
- causationid: z,
137
- viewid: c.imageViewId,
138
- environment: c.environment,
139
- aeurl: c.articleEditorUrl,
127
+ default: _(() => [s("hvg-search-image", {
128
+ causationid: R,
129
+ viewid: l.imageViewId,
130
+ environment: l.environment,
131
+ aeurl: l.articleEditorUrl,
140
132
  selectonly: "true"
141
- }, null, 8, M)]),
133
+ }, null, 8, j)]),
142
134
  _: 1
143
- })) : i("", !0)])]));
135
+ })) : a("", !0)])]));
144
136
  }
145
137
  });
146
138
  //#endregion
147
- export { P as default };
139
+ export { N 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'\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":";;;;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;KACrB,IAAG;KACH,MAAK;KACL,OAAM;KACN,aAAY;KACX,UAAQ,CAAG,EAAA;yBALH,EAAA,MAAM,MAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;IAW3B,EAWM,OAAA,MAAA,CAAA,AAAA,EAAA,OAVJ,EAAiE,SAAA;KAA1D,KAAI;KAAc,OAAM;OAAU,oBAAgB,EAAA,GACzD,EAQM,OARN,GAQM,CAAA,EAPJ,EAME,YAAA;8CALS,MAAM,QAAK;KACpB,IAAG;KACH,OAAM;KACN,aAAY;KACX,UAAQ,CAAG,EAAA;yBAJH,EAAA,MAAM,KAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;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
+ {"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\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-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\" @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;;;;;;;;;;;;;;;;;;;;;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;EAQA,IAAM,IAAmB,GAJnB,OAAO,SAAW,OAAe,OAAO,aAAmB,OAAO,WAAW,IAC1E,MAAM,KAAK,IAAI,EAAE,GAAG,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,MAAM,CAAC,IAG1B;EAGrC,QAAgB;GAEd,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,sBACn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
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":""}
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\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-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\" @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":""}
@@ -1 +1 @@
1
- .ac-component .c-image-picker__container{flex-direction:column;gap:1rem;display:flex}.ac-component .c-image-picker__container--horizontal{flex-direction:row}.ac-component .c-image-picker__preview-section{flex-direction:column;flex-shrink:0;gap:.75rem;display:flex}.ac-component .c-image-picker__preview{aspect-ratio:4/3;border:1px solid var(--neutral-200);border-radius:var(--ac-field-border-radius);background-color:var(--neutral-50);justify-content:center;align-items:center;min-height:150px;display:flex;position:relative;overflow:hidden}.ac-component .c-image-picker__img{object-fit:cover;width:100%;height:100%}.ac-component .c-image-picker__placeholder{color:var(--ac-placeholder-color);text-align:center;margin:0;padding:1rem;font-size:.875rem}.ac-component .c-image-picker__buttons{justify-content:space-between;align-items:center;gap:.5rem;display:flex}.ac-component .c-image-picker__details{flex-direction:column;gap:1rem;display:flex}
1
+ .ac-component .c-image-picker__container{border-bottom:1px solid var(--neutral-200);flex-direction:column;gap:.5rem;padding-bottom:1rem;display:flex}.ac-component .c-image-picker__container--horizontal{flex-direction:row;align-items:flex-start}@media (width<=647px){.ac-component .c-image-picker__container--horizontal{flex-direction:column}}@media (width>=648px){.ac-component .c-image-picker__container--horizontal .c-image-picker__preview-section{max-width:18.75rem;width:unset}}.ac-component .c-image-picker__preview-section{flex-direction:column;flex-shrink:0;gap:.75rem;width:100%;display:flex}.ac-component .c-image-picker__preview{aspect-ratio:4/3;border:1px solid var(--neutral-200);border-radius:var(--ac-field-border-radius);background-color:var(--neutral-50);justify-content:center;align-items:center;max-width:100%;min-height:150px;display:flex;position:relative;overflow:hidden}.ac-component .c-image-picker__img{object-fit:cover;width:100%;height:100%}.ac-component .c-image-picker__placeholder{color:var(--ac-placeholder-color);text-align:center;margin:0;padding:1rem;font-size:.875rem}.ac-component .c-image-picker__buttons{justify-content:space-between;align-items:center;gap:.5rem;display:flex}.ac-component .c-image-picker__details{flex-direction:column;flex-grow:1;gap:1rem;width:100%;display:flex}.ac-component .vf-list-handle{background-color:var(--vf-bg-passive);border-radius:999px;top:.5rem!important;transform:translate(-50%,50%)!important}.ac-component .vf-list-handle-icon{background-color:var(--vf-color-passive);width:1.5rem!important;height:1.5rem!important;-webkit-mask-size:.75rem .75rem!important;mask-size:.75rem .75rem!important}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "admins-components",
3
- "version": "9.0.63",
3
+ "version": "9.0.65",
4
4
  "type": "module",
5
5
  "module": "./dist/admins-components.js",
6
6
  "types": "./dist/index.d.ts",