ablok-components 0.3.58 → 0.3.60

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.
Files changed (199) hide show
  1. package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
  2. package/dist/ablok-components.css +1 -1
  3. package/dist/ablok-components.umd.js +4 -4
  4. package/dist/assets/img/guide.png.js +4 -0
  5. package/dist/components/atoms/base-button/base-button.vue.js +92 -0
  6. package/dist/components/atoms/base-button/base-button.vue3.js +5 -0
  7. package/dist/components/atoms/base-headline/base-headline.vue.js +30 -0
  8. package/dist/components/atoms/base-headline/base-headline.vue2.js +4 -0
  9. package/dist/components/atoms/base-image/base-image.vue.js +75 -0
  10. package/dist/components/atoms/base-image/base-image.vue3.js +5 -0
  11. package/dist/components/atoms/base-input/base-input.vue.js +181 -0
  12. package/dist/components/atoms/base-input/base-input.vue3.js +5 -0
  13. package/dist/components/atoms/base-paragraph/base-paragraph.vue.js +21 -0
  14. package/dist/components/atoms/base-paragraph/base-paragraph.vue2.js +4 -0
  15. package/dist/components/atoms/canvas-confetti/canvas-confetti.vue.js +113 -0
  16. package/dist/components/atoms/canvas-confetti/canvas-confetti.vue3.js +5 -0
  17. package/dist/components/atoms/check-group/check-group.vue.js +86 -0
  18. package/dist/components/atoms/check-group/check-group.vue3.js +5 -0
  19. package/dist/components/atoms/custom-html/custom-html.vue.js +26 -0
  20. package/dist/components/atoms/custom-html/custom-html.vue2.js +4 -0
  21. package/dist/components/atoms/input-checkbox/input-checkbox.vue.js +84 -0
  22. package/dist/components/atoms/input-checkbox/input-checkbox.vue3.js +5 -0
  23. package/dist/components/atoms/input-datetime/input-datetime.vue.js +99 -0
  24. package/dist/components/atoms/input-datetime/input-datetime.vue2.js +4 -0
  25. package/dist/components/atoms/input-file/input-file.vue.js +130 -0
  26. package/dist/components/atoms/input-file/input-file.vue2.js +4 -0
  27. package/dist/components/atoms/input-passcode/input-passcode.vue.js +149 -0
  28. package/dist/components/atoms/input-passcode/input-passcode.vue2.js +4 -0
  29. package/dist/components/atoms/input-password/input-password.vue.js +118 -0
  30. package/dist/components/atoms/input-password/input-password.vue2.js +4 -0
  31. package/dist/components/atoms/input-textarea/input-textarea.vue.js +105 -0
  32. package/dist/components/atoms/input-textarea/input-textarea.vue2.js +4 -0
  33. package/dist/components/atoms/loading-spinner/loading-spinner.vue.js +38 -0
  34. package/dist/components/atoms/loading-spinner/loading-spinner.vue3.js +5 -0
  35. package/dist/components/atoms/radio-group/radio-group.vue.js +99 -0
  36. package/dist/components/atoms/radio-group/radio-group.vue3.js +5 -0
  37. package/dist/components/atoms/svg-icon/svg-icon.vue.js +44 -0
  38. package/dist/components/atoms/svg-icon/svg-icon.vue3.js +5 -0
  39. package/dist/components/atoms/zoom-slider/zoom-slider.vue.js +59 -0
  40. package/dist/components/atoms/zoom-slider/zoom-slider.vue3.js +5 -0
  41. package/dist/components/molecules/accordion/accordion-item.vue.js +76 -0
  42. package/dist/components/molecules/accordion/accordion-item.vue3.js +5 -0
  43. package/dist/components/molecules/accordion/accordion.vue.js +12 -0
  44. package/dist/components/molecules/auto-suggest/auto-suggest.vue.js +132 -0
  45. package/dist/components/molecules/auto-suggest/auto-suggest.vue3.js +5 -0
  46. package/dist/components/molecules/base-camera/base-camera.vue.js +392 -0
  47. package/dist/components/molecules/base-camera/base-camera.vue3.js +5 -0
  48. package/dist/components/molecules/base-map/base-map.vue.js +386 -0
  49. package/dist/components/molecules/base-map/base-map.vue3.js +5 -0
  50. package/dist/components/molecules/color-palette/color-palette.vue.js +72 -0
  51. package/dist/components/molecules/color-palette/color-palette.vue3.js +5 -0
  52. package/dist/components/molecules/dom-renderer/dom-renderer.vue.js +102 -0
  53. package/dist/components/molecules/dom-renderer/dom-renderer.vue2.js +4 -0
  54. package/dist/components/molecules/file-upload/file-upload.vue.js +177 -0
  55. package/dist/components/molecules/file-upload/file-upload.vue3.js +5 -0
  56. package/dist/components/molecules/hint-system/hint-system.vue.d.ts +1 -1
  57. package/dist/components/molecules/hint-system/hint-system.vue.js +111 -0
  58. package/dist/components/molecules/hint-system/hint-system.vue3.js +5 -0
  59. package/dist/components/molecules/image-crop/image-crop.vue.js +82 -0
  60. package/dist/components/molecules/image-crop/image-crop.vue2.js +4 -0
  61. package/dist/components/molecules/image-crop-resize/image-crop-resize.vue.js +120 -0
  62. package/dist/components/molecules/image-crop-resize/image-crop-resize.vue2.js +4 -0
  63. package/dist/components/molecules/image-resize/image-resize.vue.js +143 -0
  64. package/dist/components/molecules/image-resize/image-resize.vue2.js +4 -0
  65. package/dist/components/molecules/image-upload/image-upload.vue.js +274 -0
  66. package/dist/components/molecules/image-upload/image-upload.vue3.js +5 -0
  67. package/dist/components/molecules/image-zoom/image-zoom.vue.js +209 -0
  68. package/dist/components/molecules/image-zoom/image-zoom.vue3.js +5 -0
  69. package/dist/components/molecules/input-color/input-color.vue.js +105 -0
  70. package/dist/components/molecules/input-color/input-color.vue3.js +5 -0
  71. package/dist/components/molecules/input-datepicker/input-datepicker.vue.js +263 -0
  72. package/dist/components/molecules/input-datepicker/input-datepicker.vue3.js +5 -0
  73. package/dist/components/molecules/input-dropdown/input-dropdown.vue.js +207 -0
  74. package/dist/components/molecules/input-dropdown/input-dropdown.vue3.js +5 -0
  75. package/dist/components/molecules/link-sharing/link-sharing.vue.js +177 -0
  76. package/dist/components/molecules/link-sharing/link-sharing.vue3.js +7 -0
  77. package/dist/components/molecules/location-list/location-list.vue.js +98 -0
  78. package/dist/components/molecules/location-list/location-list.vue3.js +5 -0
  79. package/dist/components/molecules/media-thumbnails/media-thumbnails.vue.js +55 -0
  80. package/dist/components/molecules/media-thumbnails/media-thumbnails.vue3.js +5 -0
  81. package/dist/components/molecules/popover-notifications/popover-notifications.vue.js +135 -0
  82. package/dist/components/molecules/popover-notifications/popover-notifications.vue3.js +5 -0
  83. package/dist/components/molecules/popover-tooltip/popover-tooltip.vue.js +134 -0
  84. package/dist/components/molecules/popover-tooltip/popover-tooltip.vue3.js +5 -0
  85. package/dist/components/molecules/progress-steps/progress-steps.vue.js +84 -0
  86. package/dist/components/molecules/progress-steps/progress-steps.vue3.js +5 -0
  87. package/dist/components/molecules/qr-code/qr-code.vue.js +103 -0
  88. package/dist/components/molecules/qr-code/qr-code.vue3.js +5 -0
  89. package/dist/components/molecules/radio-buttons/radio-buttons.vue.js +79 -0
  90. package/dist/components/molecules/radio-buttons/radio-buttons.vue3.js +5 -0
  91. package/dist/components/molecules/rte-editor/rte-editor.vue.d.ts +1 -1
  92. package/dist/components/molecules/rte-editor/rte-editor.vue.js +472 -0
  93. package/dist/components/molecules/rte-editor/rte-editor.vue3.js +5 -0
  94. package/dist/components/molecules/select-media/select-media.vue.js +87 -0
  95. package/dist/components/molecules/select-media/select-media.vue3.js +5 -0
  96. package/dist/components/molecules/upload-group/upload-group.vue.js +178 -0
  97. package/dist/components/molecules/upload-group/upload-group.vue3.js +5 -0
  98. package/dist/components/organisms/asset-uploader/asset-uploader.vue.js +126 -0
  99. package/dist/components/organisms/asset-uploader/asset-uploader.vue3.js +5 -0
  100. package/dist/components/organisms/location-finder/location-finder.vue.js +634 -0
  101. package/dist/components/organisms/location-finder/location-finder.vue3.js +5 -0
  102. package/dist/components/templates/base-carousel/base-carousel.vue.js +94 -0
  103. package/dist/components/templates/base-carousel/base-carousel.vue3.js +5 -0
  104. package/dist/components/templates/base-form/base-form.vue.js +35 -0
  105. package/dist/components/templates/base-form/base-form.vue3.js +5 -0
  106. package/dist/components/templates/modal-dialog/modal-dialog.vue.js +123 -0
  107. package/dist/components/templates/modal-dialog/modal-dialog.vue3.js +5 -0
  108. package/dist/components/templates/popover-dialog/popover-dialog.vue.js +95 -0
  109. package/dist/components/templates/popover-dialog/popover-dialog.vue3.js +5 -0
  110. package/dist/components/templates/sortable-list/sortable-list.vue.js +160 -0
  111. package/dist/components/templates/sortable-list/sortable-list.vue3.js +5 -0
  112. package/dist/components/templates/touch-wrapper/touch-wrapper.vue.js +85 -0
  113. package/dist/components/templates/touch-wrapper/touch-wrapper.vue3.js +5 -0
  114. package/dist/composables/useCameraFilter.js +56 -0
  115. package/dist/composables/useConfetti.js +12 -0
  116. package/dist/composables/useDirections.js +62 -0
  117. package/dist/composables/useFileUpload.js +79 -0
  118. package/dist/composables/useGeocoding.js +85 -0
  119. package/dist/composables/useGeolocation.js +71 -0
  120. package/dist/composables/useSanitize.js +23 -0
  121. package/dist/i18n.d.ts +3 -0
  122. package/dist/index.js +156 -0
  123. package/dist/locales/en.d.ts +3 -0
  124. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +9 -0
  125. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +18 -0
  126. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildMatchFn.js +31 -0
  127. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +15 -0
  128. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/de/_lib/formatDistance.js +163 -0
  129. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/de/_lib/formatLong.js +37 -0
  130. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/de/_lib/formatRelative.js +11 -0
  131. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/de/_lib/localize.js +161 -0
  132. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/de/_lib/match.js +112 -0
  133. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/de.js +20 -0
  134. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +70 -0
  135. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/formatLong.js +33 -0
  136. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +11 -0
  137. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/localize.js +155 -0
  138. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/match.js +110 -0
  139. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US.js +20 -0
  140. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/fr/_lib/formatDistance.js +70 -0
  141. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/fr/_lib/formatLong.js +33 -0
  142. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/fr/_lib/formatRelative.js +11 -0
  143. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/fr/_lib/localize.js +121 -0
  144. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/fr/_lib/match.js +110 -0
  145. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/fr.js +20 -0
  146. package/dist/rte-icons-defs.svg +9 -0
  147. package/dist/utilities/helpers.js +79 -0
  148. package/package.json +80 -25
  149. package/dist/ablok-components.es.js +0 -8655
  150. package/dist/components/atoms/base-button/base-button.spec.d.ts +0 -1
  151. package/dist/components/atoms/base-headline/base-headline.spec.d.ts +0 -1
  152. package/dist/components/atoms/base-image/base-image.spec.d.ts +0 -1
  153. package/dist/components/atoms/base-input/base-input.spec.d.ts +0 -1
  154. package/dist/components/atoms/base-paragraph/base-paragraph.spec.d.ts +0 -1
  155. package/dist/components/atoms/canvas-confetti/canvas-confetti.spec.d.ts +0 -1
  156. package/dist/components/atoms/check-group/check-group.spec.d.ts +0 -1
  157. package/dist/components/atoms/custom-html/custom-html.spec.d.ts +0 -1
  158. package/dist/components/atoms/input-checkbox/input-checkbox.spec.d.ts +0 -1
  159. package/dist/components/atoms/input-file/input-file.spec.d.ts +0 -1
  160. package/dist/components/atoms/input-passcode/input-passcode.spec.d.ts +0 -1
  161. package/dist/components/atoms/input-password/input-password.spec.d.ts +0 -1
  162. package/dist/components/atoms/input-textarea/input-textarea.spec.d.ts +0 -1
  163. package/dist/components/atoms/loading-spinner/loading-spinner.spec.d.ts +0 -1
  164. package/dist/components/atoms/radio-group/radio-group.spec.d.ts +0 -1
  165. package/dist/components/atoms/svg-icon/svg-icon.spec.d.ts +0 -1
  166. package/dist/components/atoms/zoom-slider/zoom-slider.spec.d.ts +0 -1
  167. package/dist/components/molecules/accordion/accordion-item.spec.d.ts +0 -1
  168. package/dist/components/molecules/auto-suggest/auto-suggest.spec.d.ts +0 -1
  169. package/dist/components/molecules/base-map/base-map.spec.d.ts +0 -1
  170. package/dist/components/molecules/color-palette/color-palette.spec.d.ts +0 -1
  171. package/dist/components/molecules/dom-renderer/dom-renderer.spec.d.ts +0 -1
  172. package/dist/components/molecules/file-upload/file-upload.spec.d.ts +0 -1
  173. package/dist/components/molecules/hint-system/hint-system.spec.d.ts +0 -1
  174. package/dist/components/molecules/image-crop/image-crop.spec.d.ts +0 -1
  175. package/dist/components/molecules/image-crop-resize/image-crop-resize.spec.d.ts +0 -1
  176. package/dist/components/molecules/image-resize/image-resize.spec.d.ts +0 -1
  177. package/dist/components/molecules/image-upload/image-upload.spec.d.ts +0 -1
  178. package/dist/components/molecules/image-zoom/image-zoom.spec.d.ts +0 -1
  179. package/dist/components/molecules/input-color/input-color.spec.d.ts +0 -1
  180. package/dist/components/molecules/input-datepicker/input-datepicker.spec.d.ts +0 -1
  181. package/dist/components/molecules/input-dropdown/input-dropdown.spec.d.ts +0 -1
  182. package/dist/components/molecules/link-sharing/link-sharing.spec.d.ts +0 -1
  183. package/dist/components/molecules/media-thumbnails/media-thumbnails.spec.d.ts +0 -1
  184. package/dist/components/molecules/popover-notifications/popover-notifications.spec.d.ts +0 -1
  185. package/dist/components/molecules/popover-tooltip/popover-tooltip.spec.d.ts +0 -1
  186. package/dist/components/molecules/progress-steps/progress-steps.spec.d.ts +0 -1
  187. package/dist/components/molecules/qr-code/qr-code.spec.d.ts +0 -1
  188. package/dist/components/molecules/radio-buttons/radio-buttons.spec.d.ts +0 -1
  189. package/dist/components/molecules/rte-editor/rte-editor.spec.d.ts +0 -1
  190. package/dist/components/molecules/select-media/select-media.spec.d.ts +0 -1
  191. package/dist/components/molecules/upload-group/upload-group.spec.d.ts +0 -1
  192. package/dist/components/organisms/asset-uploader/asset-uploader.spec.d.ts +0 -1
  193. package/dist/components/organisms/location-finder/location-finder.spec.d.ts +0 -1
  194. package/dist/components/templates/base-carousel/base-carousel.spec.d.ts +0 -1
  195. package/dist/components/templates/base-form/base-form.spec.d.ts +0 -1
  196. package/dist/components/templates/modal-dialog/modal-dialog.spec.d.ts +0 -1
  197. package/dist/components/templates/popover-dialog/popover-dialog.spec.d.ts +0 -1
  198. package/dist/components/templates/sortable-list/sortable-list.spec.d.ts +0 -1
  199. package/dist/components/templates/touch-wrapper/touch-wrapper.spec.d.ts +0 -1
@@ -0,0 +1,274 @@
1
+ import { defineComponent as L, ref as b, computed as P, watch as v, onMounted as Q, onBeforeUnmount as q, openBlock as s, createElementBlock as m, normalizeClass as U, unref as g, Fragment as A, createVNode as r, normalizeStyle as E, isRef as D, createElementVNode as o, withModifiers as w, createCommentVNode as h, renderSlot as H, Transition as O, withCtx as $, createBlock as j, toDisplayString as G } from "vue";
2
+ import J from "../image-crop-resize/image-crop-resize.vue.js";
3
+ import K from "../../atoms/base-image/base-image.vue.js";
4
+ /* empty css */
5
+ import k from "../../atoms/svg-icon/svg-icon.vue.js";
6
+ /* empty css */
7
+ import X from "../../atoms/input-file/input-file.vue.js";
8
+ import Y from "../../templates/modal-dialog/modal-dialog.vue.js";
9
+ /* empty css */
10
+ import { useFileUpload as Z } from "../../../composables/useFileUpload.js";
11
+ import { resizeImageFileByMaxWidth as _, fileToDataUrl as R, uniqueId as W, srcToFile as ee } from "../../../utilities/helpers.js";
12
+ const te = { class: "image-upload__controls" }, ae = { class: "d-flex gap-1 align-items-center" }, le = {
13
+ key: 1,
14
+ class: "image-upload__controls"
15
+ }, ne = ["for"], ie = ["innerHTML"], oe = {
16
+ key: 0,
17
+ class: "image-upload__loading-spinner"
18
+ }, ge = /* @__PURE__ */ L({
19
+ __name: "image-upload",
20
+ props: {
21
+ modelValue: {
22
+ type: Object,
23
+ default: void 0
24
+ },
25
+ src: {
26
+ type: String
27
+ },
28
+ name: {
29
+ type: String,
30
+ default: () => W()
31
+ },
32
+ id: {
33
+ type: String,
34
+ default: () => W()
35
+ },
36
+ label: {
37
+ type: String,
38
+ default: ""
39
+ },
40
+ placeholder: {
41
+ type: String,
42
+ default: ""
43
+ },
44
+ variant: {
45
+ type: String,
46
+ default: ""
47
+ },
48
+ disabled: {
49
+ type: Boolean,
50
+ default: !1
51
+ },
52
+ readOnly: {
53
+ type: Boolean,
54
+ default: !1
55
+ },
56
+ required: {
57
+ type: Boolean,
58
+ default: !1
59
+ },
60
+ pattern: {
61
+ type: String,
62
+ default: null
63
+ },
64
+ accept: {
65
+ type: String,
66
+ default: "image/*"
67
+ },
68
+ maxFileSize: {
69
+ type: Number,
70
+ default: 0
71
+ },
72
+ endpoint: {
73
+ type: String,
74
+ default: ""
75
+ },
76
+ toDataUrl: {
77
+ type: Boolean,
78
+ default: !0
79
+ },
80
+ authToken: {
81
+ type: String,
82
+ default: ""
83
+ },
84
+ customFetch: null,
85
+ baseResponsePath: {
86
+ type: String,
87
+ default: "/api/v1/assets"
88
+ },
89
+ enablePreview: {
90
+ type: Boolean,
91
+ default: !0
92
+ },
93
+ previewWidth: {
94
+ type: Number,
95
+ default: 0
96
+ },
97
+ dropFiles: {
98
+ type: Boolean,
99
+ default: !1
100
+ },
101
+ enableReview: {
102
+ type: Boolean,
103
+ default: !0
104
+ },
105
+ maxImageWidth: {
106
+ type: Number,
107
+ default: 4096
108
+ },
109
+ aspectRatio: Number
110
+ },
111
+ emits: ["update:modelValue", "update:src"],
112
+ setup(a, { emit: z }) {
113
+ const i = a, p = z, u = b(!1), d = b(null), l = b(null), V = b(null), {
114
+ pending: C,
115
+ files: f,
116
+ // dataUrls,
117
+ imgLoaded: c,
118
+ isDragging: N,
119
+ uploadFile: F,
120
+ setupDragAndDrop: T,
121
+ cleanupDragAndDrop: x
122
+ } = Z(i, p), y = P(() => i.modelValue ? i.modelValue : i.src ? { type: "", src: i.src } : d.value);
123
+ function S() {
124
+ d.value = null, f.value = [], c.value = !1, p("update:modelValue", void 0), p("update:src", "");
125
+ }
126
+ function B() {
127
+ S();
128
+ }
129
+ v(() => f.value, async (t) => {
130
+ if (!t || !t.length || !t[0]) return;
131
+ c.value = !1;
132
+ const e = await _(t[0], i.maxImageWidth);
133
+ i.enableReview ? (l.value = {
134
+ src: await R(e),
135
+ type: e.type
136
+ }, u.value = !0) : d.value = {
137
+ src: i.toDataUrl ? await R(e) : await F(e),
138
+ type: e.type
139
+ };
140
+ }), v(() => d.value, (t) => {
141
+ p("update:modelValue", t || void 0), p("update:src", t?.src || "");
142
+ }), v(() => V.value, async (t) => {
143
+ t && (d.value = {
144
+ src: await F(t),
145
+ type: t.type
146
+ }, V.value = null);
147
+ }), v(() => u.value, (t, e) => {
148
+ !t && e && l.value && (l.value = null, B());
149
+ }), v(() => i.src, (t) => {
150
+ !t && d.value && B();
151
+ });
152
+ function M(t, e) {
153
+ l.value = { src: t, type: e }, u.value = !0;
154
+ }
155
+ async function I() {
156
+ l.value && (V.value = await ee(
157
+ l.value.src,
158
+ "file",
159
+ l.value.type
160
+ )), l.value = null, u.value = !1;
161
+ }
162
+ return Q(() => {
163
+ T();
164
+ }), q(() => {
165
+ x();
166
+ }), (t, e) => (s(), m("div", {
167
+ class: U(["image-upload", {
168
+ "has-dragging": a.dropFiles,
169
+ "is-dragging": g(N)
170
+ }])
171
+ }, [
172
+ !u.value && y.value ? (s(), m("div", {
173
+ key: 0,
174
+ class: U(["mb-2", a.enablePreview ? "image-upload__thumbnail" : "image-upload__reset"])
175
+ }, [
176
+ a.enablePreview ? (s(), m(A, { key: 0 }, [
177
+ r(K, {
178
+ src: `${y.value.src}${a.previewWidth ? `?width=${a.previewWidth}` : ""}`,
179
+ class: "img-thumbnail rounded",
180
+ ready: g(c),
181
+ "onUpdate:ready": e[0] || (e[0] = (n) => D(c) ? c.value = n : null),
182
+ animate: !1,
183
+ style: E({ maxWidth: a.previewWidth ? `${a.previewWidth}px` : "auto", height: "auto" })
184
+ }, null, 8, ["src", "ready", "style"]),
185
+ o("div", te, [
186
+ o("div", ae, [
187
+ o("button", {
188
+ type: "button",
189
+ onClick: e[1] || (e[1] = w((n) => M(y.value.src, y.value.type), ["prevent", "stop"])),
190
+ class: "btn btn--edit btn-sm btn-light"
191
+ }, [
192
+ r(k, { symbol: "edit-2" })
193
+ ]),
194
+ o("button", {
195
+ type: "button",
196
+ onClick: e[2] || (e[2] = w((n) => S(), ["prevent", "stop"])),
197
+ class: "btn btn--close btn-sm btn-light"
198
+ }, [
199
+ r(k, { symbol: "x" })
200
+ ])
201
+ ])
202
+ ])
203
+ ], 64)) : (s(), m("div", le, [
204
+ o("button", {
205
+ onClick: e[3] || (e[3] = w((n) => S(), ["prevent", "stop"])),
206
+ class: "btn btn--close btn-outline-contrast"
207
+ }, [
208
+ r(k, { symbol: "x" })
209
+ ])
210
+ ]))
211
+ ], 2)) : h("", !0),
212
+ r(X, {
213
+ modelValue: g(f),
214
+ "onUpdate:modelValue": e[4] || (e[4] = (n) => D(f) ? f.value = n : null),
215
+ id: a.id,
216
+ name: a.name,
217
+ accept: a.accept,
218
+ "max-file-size": a.maxFileSize,
219
+ class: "d-none"
220
+ }, null, 8, ["modelValue", "id", "name", "accept", "max-file-size"]),
221
+ a.src ? h("", !0) : (s(), m("label", {
222
+ key: 1,
223
+ for: a.id,
224
+ class: "image-upload__label"
225
+ }, [
226
+ H(t.$slots, "button", {}, () => [
227
+ o("span", {
228
+ class: "btn btn-outline-contrast",
229
+ innerHTML: a.label || t.$t("common.selectFile")
230
+ }, null, 8, ie)
231
+ ]),
232
+ r(O, { name: "fade" }, {
233
+ default: $(() => [
234
+ g(C) ? (s(), m("span", oe, [...e[7] || (e[7] = [
235
+ o("span", {
236
+ class: "spinner-border",
237
+ role: "status"
238
+ }, [
239
+ o("span", { class: "visually-hidden" }, "Loading...")
240
+ ], -1)
241
+ ])])) : h("", !0)
242
+ ]),
243
+ _: 1
244
+ })
245
+ ], 8, ne)),
246
+ r(Y, {
247
+ modelValue: u.value,
248
+ "onUpdate:modelValue": e[6] || (e[6] = (n) => u.value = n),
249
+ footer: !1
250
+ }, {
251
+ default: $(() => [
252
+ u.value && l.value ? (s(), j(J, {
253
+ key: 0,
254
+ modelValue: l.value.src,
255
+ "onUpdate:modelValue": e[5] || (e[5] = (n) => l.value.src = n),
256
+ "aspect-ratio": a.aspectRatio
257
+ }, {
258
+ submit: $(() => [
259
+ o("button", {
260
+ class: "btn btn-primary",
261
+ onClick: w(I, ["prevent", "stop"])
262
+ }, G(t.$t("common.save")), 1)
263
+ ]),
264
+ _: 1
265
+ }, 8, ["modelValue", "aspect-ratio"])) : h("", !0)
266
+ ]),
267
+ _: 1
268
+ }, 8, ["modelValue"])
269
+ ], 2));
270
+ }
271
+ });
272
+ export {
273
+ ge as default
274
+ };
@@ -0,0 +1,5 @@
1
+ import o from "./image-upload.vue.js";
2
+ /* empty css */
3
+ export {
4
+ o as default
5
+ };
@@ -0,0 +1,209 @@
1
+ import { defineComponent as G, ref as a, computed as d, onMounted as J, watch as K, nextTick as N, openBlock as S, createElementBlock as k, createElementVNode as z, withModifiers as Q, renderSlot as Z, createVNode as C, normalizeStyle as W, createCommentVNode as ee, normalizeClass as x, withCtx as te } from "vue";
2
+ import oe from "../../atoms/base-image/base-image.vue.js";
3
+ /* empty css */
4
+ import ae from "../../templates/popover-dialog/popover-dialog.vue.js";
5
+ /* empty css */
6
+ const le = ["popovertarget"], ie = ["src", "alt"], ve = /* @__PURE__ */ G({
7
+ __name: "image-zoom",
8
+ props: {
9
+ src: {
10
+ type: String,
11
+ required: !0
12
+ },
13
+ alt: {
14
+ type: String,
15
+ default: ""
16
+ },
17
+ spinner: {
18
+ type: Boolean,
19
+ default: !1
20
+ },
21
+ zoom: {
22
+ type: Number,
23
+ default: 2
24
+ },
25
+ focusWidth: {
26
+ type: Number,
27
+ default: 0
28
+ },
29
+ focusHeight: {
30
+ type: Number,
31
+ default: 0
32
+ },
33
+ hoverDelay: {
34
+ type: Number,
35
+ default: 150
36
+ },
37
+ closeTimeout: {
38
+ type: Number,
39
+ default: 0
40
+ },
41
+ popoverId: {
42
+ type: String,
43
+ default: () => `image-zoom-${Math.random().toString(36).substring(2, 9)}`
44
+ }
45
+ },
46
+ setup(o) {
47
+ const t = o, B = a(null), v = a(null), h = a(null), i = a(!1), l = a(!1), g = a(!1), P = a(!1), f = a(null), m = a(0), p = a(0), r = a(0), s = a(0), M = d(() => Number.isFinite(t.focusWidth) && t.focusWidth > 0 && Number.isFinite(t.focusHeight) && t.focusHeight > 0 && r.value > 0 && s.value > 0 && t.focusWidth <= r.value && t.focusHeight <= s.value), c = d(() => r.value > 0 && s.value > 0 && !M.value), F = d(() => g.value && !l.value && r.value > 0 && s.value > 0), V = d(() => c.value ? {
48
+ width: `${r.value}px`,
49
+ height: `${s.value}px`,
50
+ left: "0px",
51
+ top: "0px"
52
+ } : {
53
+ width: `${t.focusWidth}px`,
54
+ height: `${t.focusHeight}px`,
55
+ left: `${m.value}px`,
56
+ top: `${p.value}px`
57
+ }), D = d(() => {
58
+ const e = r.value * t.zoom, n = s.value * t.zoom;
59
+ return {
60
+ width: `${e}px`,
61
+ height: `${n}px`,
62
+ transform: M.value && !l.value ? `translate(${-m.value * t.zoom}px, ${-p.value * t.zoom}px)` : "none",
63
+ transformOrigin: "top left"
64
+ };
65
+ });
66
+ function w() {
67
+ if (!v.value)
68
+ return;
69
+ const e = v.value.getBoundingClientRect();
70
+ r.value = e.width, s.value = e.height;
71
+ }
72
+ function $() {
73
+ f.value && (clearTimeout(f.value), f.value = null);
74
+ }
75
+ function T() {
76
+ $(), i.value = !0;
77
+ }
78
+ function _() {
79
+ $(), f.value = setTimeout(() => {
80
+ !g.value && !P.value && !l.value && (i.value = !1), f.value = null;
81
+ }, t.hoverDelay || 100);
82
+ }
83
+ function y(e, n) {
84
+ if (!v.value)
85
+ return;
86
+ if (c.value) {
87
+ m.value = 0, p.value = 0;
88
+ return;
89
+ }
90
+ const u = v.value.getBoundingClientRect(), U = e - u.left, q = n - u.top, j = Math.min(
91
+ Math.max(U - t.focusWidth / 2, 0),
92
+ Math.max(u.width - t.focusWidth, 0)
93
+ ), A = Math.min(
94
+ Math.max(q - t.focusHeight / 2, 0),
95
+ Math.max(u.height - t.focusHeight, 0)
96
+ );
97
+ m.value = j, p.value = A;
98
+ }
99
+ function b() {
100
+ if (!h.value || !l.value || c.value)
101
+ return;
102
+ const e = h.value.getBoundingClientRect(), n = Math.max(0, m.value * t.zoom - e.width / 2 + t.focusWidth * t.zoom / 2), u = Math.max(0, p.value * t.zoom - e.height / 2 + t.focusHeight * t.zoom / 2);
103
+ h.value.scrollTo({ left: n, top: u });
104
+ }
105
+ function E(e) {
106
+ w(), y(e.clientX, e.clientY);
107
+ }
108
+ function I(e) {
109
+ g.value = !0, w(), y(e.clientX, e.clientY), l.value || T();
110
+ }
111
+ function H() {
112
+ g.value = !1, l.value || _();
113
+ }
114
+ function R(e) {
115
+ l.value && (i.value = !0, w(), y(e.clientX, e.clientY));
116
+ }
117
+ function X() {
118
+ l.value && N(b);
119
+ }
120
+ function Y() {
121
+ P.value = !0, T();
122
+ }
123
+ function L() {
124
+ P.value = !1, _();
125
+ }
126
+ function O(e) {
127
+ l.value && (i.value = !i.value, e instanceof MouseEvent && y(e.clientX, e.clientY));
128
+ }
129
+ return J(() => {
130
+ l.value = "ontouchstart" in window || navigator.maxTouchPoints > 0, w();
131
+ }), K(i, async (e) => {
132
+ e && l.value && (await N(), b());
133
+ }), (e, n) => (S(), k("span", {
134
+ class: "image-zoom",
135
+ popovertarget: o.popoverId,
136
+ ref_key: "wrapper",
137
+ ref: B
138
+ }, [
139
+ z("div", {
140
+ class: "image-zoom__target",
141
+ ref_key: "target",
142
+ ref: v,
143
+ onPointermove: E,
144
+ onPointerenter: I,
145
+ onPointerleave: H,
146
+ onPointerdown: R,
147
+ onPointerup: X,
148
+ onPointercancel: H,
149
+ onClick: Q(O, ["prevent"])
150
+ }, [
151
+ Z(e.$slots, "image", {
152
+ src: o.src,
153
+ alt: o.alt,
154
+ spinner: o.spinner,
155
+ animate: !1
156
+ }, () => [
157
+ C(oe, {
158
+ class: "image-zoom__image",
159
+ src: o.src,
160
+ alt: o.alt,
161
+ spinner: o.spinner,
162
+ animate: !1
163
+ }, null, 8, ["src", "alt", "spinner"])
164
+ ]),
165
+ F.value ? (S(), k("span", {
166
+ key: 0,
167
+ class: "image-zoom__focus",
168
+ style: W(V.value)
169
+ }, null, 4)) : ee("", !0)
170
+ ], 544),
171
+ C(ae, {
172
+ id: o.popoverId,
173
+ modelValue: i.value,
174
+ "onUpdate:modelValue": n[0] || (n[0] = (u) => i.value = u),
175
+ hover: !1,
176
+ "hover-delay": o.hoverDelay,
177
+ "close-timeout": o.closeTimeout,
178
+ class: x(["image-zoom__popover", { "image-zoom__popover--full": c.value }]),
179
+ role: "tooltip",
180
+ onMouseenter: Y,
181
+ onMouseleave: L
182
+ }, {
183
+ default: te(() => [
184
+ z("div", {
185
+ class: x(["image-zoom__preview-wrapper", { "image-zoom__preview-wrapper--full": c.value }])
186
+ }, [
187
+ z("div", {
188
+ class: x(["image-zoom__preview", { "image-zoom__preview--full": c.value }]),
189
+ ref_key: "preview",
190
+ ref: h
191
+ }, [
192
+ z("img", {
193
+ class: x(["image-zoom__preview-image", { "image-zoom__preview-image--full": c.value }]),
194
+ src: o.src,
195
+ alt: o.alt,
196
+ style: W(D.value),
197
+ draggable: "false"
198
+ }, null, 14, ie)
199
+ ], 2)
200
+ ], 2)
201
+ ]),
202
+ _: 1
203
+ }, 8, ["id", "modelValue", "hover-delay", "close-timeout", "class"])
204
+ ], 8, le));
205
+ }
206
+ });
207
+ export {
208
+ ve as default
209
+ };
@@ -0,0 +1,5 @@
1
+ import o from "./image-zoom.vue.js";
2
+ /* empty css */
3
+ export {
4
+ o as default
5
+ };
@@ -0,0 +1,105 @@
1
+ import { defineComponent as c, computed as y, openBlock as f, createElementBlock as s, createVNode as p, withCtx as b, createElementVNode as n, withDirectives as g, vModelText as h } from "vue";
2
+ import { uniqueId as o } from "../../../utilities/helpers.js";
3
+ import x from "../../atoms/base-input/base-input.vue.js";
4
+ /* empty css */
5
+ const V = { class: "input-color" }, q = { class: "base-input__color-swatch" }, v = ["name", "id", "disabled", "read-only", "required", "aria-label"], O = /* @__PURE__ */ c({
6
+ __name: "input-color",
7
+ props: {
8
+ modelValue: {
9
+ type: [String, Number, Boolean, Date],
10
+ default: ""
11
+ },
12
+ type: {
13
+ type: String,
14
+ default: "text"
15
+ },
16
+ name: {
17
+ type: String,
18
+ default: () => o()
19
+ },
20
+ id: {
21
+ type: String,
22
+ default: () => o()
23
+ },
24
+ label: {
25
+ type: String,
26
+ default: ""
27
+ },
28
+ placeholder: {
29
+ type: String,
30
+ default: ""
31
+ },
32
+ variant: {
33
+ type: String,
34
+ default: ""
35
+ },
36
+ disabled: {
37
+ type: Boolean,
38
+ default: !1
39
+ },
40
+ readOnly: {
41
+ type: Boolean,
42
+ default: !1
43
+ },
44
+ required: {
45
+ type: Boolean,
46
+ default: !1
47
+ },
48
+ maxlength: {
49
+ type: Number
50
+ },
51
+ pattern: {
52
+ type: String,
53
+ default: null
54
+ }
55
+ },
56
+ emits: ["update:modelValue"],
57
+ setup(e, { emit: i }) {
58
+ const r = e, u = i, t = y({
59
+ get() {
60
+ return r.modelValue;
61
+ },
62
+ set(a) {
63
+ u("update:modelValue", a);
64
+ }
65
+ });
66
+ return (a, l) => (f(), s("div", V, [
67
+ p(x, {
68
+ modelValue: t.value,
69
+ "onUpdate:modelValue": l[1] || (l[1] = (d) => t.value = d),
70
+ type: e.type === "color" ? "text" : e.type,
71
+ id: e.id,
72
+ name: e.name,
73
+ placeholder: e.placeholder,
74
+ pattern: e.pattern,
75
+ label: e.label,
76
+ disabled: e.disabled,
77
+ "read-only": e.readOnly,
78
+ required: e.required,
79
+ maxlength: e.maxlength
80
+ }, {
81
+ "input-append": b((d) => [
82
+ n("span", q, [
83
+ g(n("input", {
84
+ "onUpdate:modelValue": l[0] || (l[0] = (m) => t.value = m),
85
+ type: "color",
86
+ name: `${e.name}-color`,
87
+ id: `${e.id}-color`,
88
+ disabled: e.disabled,
89
+ "read-only": e.readOnly,
90
+ required: e.required,
91
+ class: "form-control",
92
+ "aria-label": e.label
93
+ }, null, 8, v), [
94
+ [h, t.value]
95
+ ])
96
+ ])
97
+ ]),
98
+ _: 1
99
+ }, 8, ["modelValue", "type", "id", "name", "placeholder", "pattern", "label", "disabled", "read-only", "required", "maxlength"])
100
+ ]));
101
+ }
102
+ });
103
+ export {
104
+ O as default
105
+ };
@@ -0,0 +1,5 @@
1
+ import o from "./input-color.vue.js";
2
+ /* empty css */
3
+ export {
4
+ o as default
5
+ };