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,177 @@
1
+ import { defineComponent as C, watch as y, openBlock as a, createElementBlock as n, normalizeClass as b, unref as i, Fragment as g, renderList as U, createElementVNode as o, withModifiers as v, createVNode as u, isRef as z, renderSlot as D, Transition as N, withCtx as P, createCommentVNode as T } from "vue";
2
+ import h from "../../atoms/svg-icon/svg-icon.vue.js";
3
+ /* empty css */
4
+ import L from "../../atoms/input-file/input-file.vue.js";
5
+ import { useFileUpload as x } from "../../../composables/useFileUpload.js";
6
+ import { fileToDataUrl as M, uniqueId as S } from "../../../utilities/helpers.js";
7
+ const W = ["src"], _ = ["onClick"], q = ["onClick"], E = ["for"], H = ["innerHTML"], R = {
8
+ key: 0,
9
+ class: "file-upload__loading-spinner"
10
+ }, K = /* @__PURE__ */ C({
11
+ __name: "file-upload",
12
+ props: {
13
+ modelValue: {
14
+ type: Array,
15
+ default: []
16
+ },
17
+ src: {
18
+ type: String
19
+ },
20
+ name: {
21
+ type: String,
22
+ default: () => S()
23
+ },
24
+ id: {
25
+ type: String,
26
+ default: () => S()
27
+ },
28
+ label: {
29
+ type: String,
30
+ default: ""
31
+ },
32
+ placeholder: {
33
+ type: String,
34
+ default: ""
35
+ },
36
+ variant: {
37
+ type: String,
38
+ default: ""
39
+ },
40
+ disabled: {
41
+ type: Boolean,
42
+ default: !1
43
+ },
44
+ readOnly: {
45
+ type: Boolean,
46
+ default: !1
47
+ },
48
+ required: {
49
+ type: Boolean,
50
+ default: !1
51
+ },
52
+ pattern: {
53
+ type: String,
54
+ default: null
55
+ },
56
+ multiple: {
57
+ type: Boolean,
58
+ default: !1
59
+ },
60
+ accept: {
61
+ type: String
62
+ },
63
+ maxFileSize: {
64
+ type: Number,
65
+ default: 0
66
+ },
67
+ endpoint: {
68
+ type: String,
69
+ default: ""
70
+ },
71
+ toDataUrl: {
72
+ type: Boolean,
73
+ default: !0
74
+ },
75
+ authToken: {
76
+ type: String,
77
+ default: ""
78
+ },
79
+ customFetch: null,
80
+ baseResponsePath: {
81
+ type: String,
82
+ default: "/api/v1/assets"
83
+ },
84
+ enablePreview: {
85
+ type: Boolean,
86
+ default: !0
87
+ },
88
+ previewWidth: {
89
+ type: Number,
90
+ default: 0
91
+ },
92
+ dropFiles: {
93
+ type: Boolean,
94
+ default: !1
95
+ }
96
+ },
97
+ emits: ["update:modelValue", "update:src"],
98
+ setup(e, { emit: w }) {
99
+ const s = e, m = w, { pending: k, files: r, dataUrls: c, isDragging: F, thumbnails: B, uploadFile: V, removeFile: p } = x(s, m);
100
+ return y(() => r.value, async (l) => {
101
+ c.value = await Promise.all(
102
+ l.map(async (t) => ({
103
+ src: s.toDataUrl ? await M(t) : await V(t),
104
+ type: t.type
105
+ }))
106
+ );
107
+ }, { deep: !0 }), y(() => c.value, async (l) => {
108
+ const t = s.multiple ? l : l[0];
109
+ m("update:modelValue", t), s.multiple || m("update:src", l[0] && l[0].src);
110
+ }, { deep: !0 }), (l, t) => (a(), n("div", {
111
+ class: b(["file-upload", {
112
+ "has-dragging": e.dropFiles,
113
+ "is-dragging": i(F)
114
+ }])
115
+ }, [
116
+ (a(!0), n(g, null, U(i(B), (d, f) => (a(), n("div", {
117
+ key: d.src,
118
+ class: b(e.enablePreview ? "file-upload__thumbnail" : "file-upload__reset")
119
+ }, [
120
+ e.enablePreview ? (a(), n(g, { key: 0 }, [
121
+ o("img", {
122
+ src: `${d.src}${e.previewWidth ? `?width=${e.previewWidth}` : ""}`,
123
+ class: "img-thumbnail rounded"
124
+ }, null, 8, W),
125
+ o("button", {
126
+ onClick: v(($) => i(p)(f), ["prevent"]),
127
+ class: "btn btn--close"
128
+ }, [
129
+ u(h, { symbol: "x" })
130
+ ], 8, _)
131
+ ], 64)) : (a(), n("button", {
132
+ key: 1,
133
+ onClick: v(($) => i(p)(f), ["prevent"]),
134
+ class: "btn btn--close btn-outline-contrast"
135
+ }, [
136
+ u(h, { symbol: "x" })
137
+ ], 8, q))
138
+ ], 2))), 128)),
139
+ u(L, {
140
+ modelValue: i(r),
141
+ "onUpdate:modelValue": t[0] || (t[0] = (d) => z(r) ? r.value = d : null),
142
+ id: e.id,
143
+ name: e.name,
144
+ accept: e.accept,
145
+ "max-file-size": e.maxFileSize,
146
+ class: "d-none"
147
+ }, null, 8, ["modelValue", "id", "name", "accept", "max-file-size"]),
148
+ o("label", {
149
+ for: e.id,
150
+ class: "file-upload__label"
151
+ }, [
152
+ D(l.$slots, "button", {}, () => [
153
+ o("span", {
154
+ class: "btn btn-outline-contrast",
155
+ innerHTML: e.label || l.$t("common.selectFile")
156
+ }, null, 8, H)
157
+ ]),
158
+ u(N, { name: "fade" }, {
159
+ default: P(() => [
160
+ i(k) ? (a(), n("span", R, [...t[1] || (t[1] = [
161
+ o("span", {
162
+ class: "spinner-border",
163
+ role: "status"
164
+ }, [
165
+ o("span", { class: "visually-hidden" }, "Loading...")
166
+ ], -1)
167
+ ])])) : T("", !0)
168
+ ]),
169
+ _: 1
170
+ })
171
+ ], 8, E)
172
+ ], 2));
173
+ }
174
+ });
175
+ export {
176
+ K as default
177
+ };
@@ -0,0 +1,5 @@
1
+ import o from "./file-upload.vue.js";
2
+ /* empty css */
3
+ export {
4
+ o as default
5
+ };
@@ -9,7 +9,7 @@ declare function __VLS_template(): {
9
9
  }): any;
10
10
  trigger?(_: {
11
11
  revealNext: typeof revealNext;
12
- canReveal: true;
12
+ canReveal: boolean;
13
13
  revealedCount: number;
14
14
  total: number;
15
15
  }): any;
@@ -0,0 +1,111 @@
1
+ import { defineComponent as g, ref as k, watch as H, computed as u, openBlock as l, createElementBlock as a, unref as v, createCommentVNode as y, createBlock as C, TransitionGroup as N, withCtx as V, Fragment as x, renderList as T, renderSlot as p, toDisplayString as _, createElementVNode as w } from "vue";
2
+ import { sanitizeHtml as f } from "../../../composables/useSanitize.js";
3
+ const L = { class: "hint-system" }, S = ["innerHTML"], B = ["innerHTML"], M = {
4
+ key: 1,
5
+ class: "hint-system__hint-content"
6
+ }, R = ["disabled"], A = /* @__PURE__ */ g({
7
+ __name: "hint-system",
8
+ props: {
9
+ modelValue: {
10
+ type: Number,
11
+ default: 0
12
+ },
13
+ hints: {
14
+ type: Array,
15
+ default: () => []
16
+ },
17
+ penalty: {
18
+ type: Number,
19
+ default: 1
20
+ },
21
+ maxHints: {
22
+ type: Number,
23
+ default: void 0
24
+ },
25
+ htmlContent: {
26
+ type: Boolean,
27
+ default: !1
28
+ },
29
+ label: {
30
+ type: String,
31
+ default: "Show hint"
32
+ },
33
+ description: {
34
+ type: String,
35
+ default: ""
36
+ }
37
+ },
38
+ emits: ["update:modelValue", "hint-revealed"],
39
+ setup(s, { emit: b }) {
40
+ const t = s, c = b, e = k(t.modelValue);
41
+ H(
42
+ () => t.modelValue,
43
+ (n) => {
44
+ e.value = n;
45
+ }
46
+ );
47
+ const d = u(
48
+ () => t.maxHints !== void 0 ? t.maxHints : t.hints.length
49
+ ), i = u(() => e.value < d.value), m = u(
50
+ () => t.hints.slice(0, e.value)
51
+ );
52
+ function h() {
53
+ if (!i.value) return;
54
+ const n = e.value;
55
+ e.value++, c("update:modelValue", e.value), c("hint-revealed", {
56
+ hint: t.hints[n],
57
+ index: n,
58
+ penaltyTotal: e.value * t.penalty
59
+ });
60
+ }
61
+ return (n, E) => (l(), a("div", L, [
62
+ s.description ? (l(), a("div", {
63
+ key: 0,
64
+ innerHTML: v(f)(s.description),
65
+ class: "hint-system__description"
66
+ }, null, 8, S)) : y("", !0),
67
+ m.value.length ? (l(), C(N, {
68
+ key: 1,
69
+ name: "hint-reveal",
70
+ tag: "ol",
71
+ class: "hint-system__list"
72
+ }, {
73
+ default: V(() => [
74
+ (l(!0), a(x, null, T(m.value, (o, r) => (l(), a("li", {
75
+ key: r,
76
+ class: "hint-system__hint"
77
+ }, [
78
+ p(n.$slots, "hint", {
79
+ hint: o,
80
+ index: r,
81
+ isNew: r === e.value - 1
82
+ }, () => [
83
+ s.htmlContent ? (l(), a("div", {
84
+ key: 0,
85
+ class: "hint-system__hint-content",
86
+ innerHTML: v(f)(o.content || "")
87
+ }, null, 8, B)) : (l(), a("div", M, _(o.content), 1))
88
+ ])
89
+ ]))), 128))
90
+ ]),
91
+ _: 3
92
+ })) : y("", !0),
93
+ p(n.$slots, "trigger", {
94
+ revealNext: h,
95
+ canReveal: i.value,
96
+ revealedCount: e.value,
97
+ total: d.value
98
+ }, () => [
99
+ w("button", {
100
+ type: "button",
101
+ class: "hint-system__trigger d-block w-100 text-center",
102
+ disabled: !i.value,
103
+ onClick: h
104
+ }, _(s.label), 9, R)
105
+ ])
106
+ ]));
107
+ }
108
+ });
109
+ export {
110
+ A as default
111
+ };
@@ -0,0 +1,5 @@
1
+ import o from "./hint-system.vue.js";
2
+ /* empty css */
3
+ export {
4
+ o as default
5
+ };
@@ -0,0 +1,82 @@
1
+ import { defineComponent as m, useTemplateRef as d, ref as f, onBeforeMount as v, openBlock as g, createElementBlock as y, createElementVNode as t, createVNode as l, unref as V, renderSlot as R, withModifiers as x, toDisplayString as b, createCommentVNode as w } from "vue";
2
+ import { Cropper as _ } from "vue-advanced-cropper";
3
+ import h from "../input-dropdown/input-dropdown.vue.js";
4
+ /* empty css */
5
+ /* empty css */
6
+ const B = {
7
+ key: 0,
8
+ class: "image-crop"
9
+ }, k = { class: "row mb-4" }, C = { class: "col" }, N = { class: "row" }, A = { class: "col d-flex gap-2 justify-content-end gap-2" }, O = /* @__PURE__ */ m({
10
+ __name: "image-crop",
11
+ props: {
12
+ modelValue: {
13
+ type: String,
14
+ default: 'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg"/>',
15
+ required: !0
16
+ },
17
+ spinner: {
18
+ type: Boolean,
19
+ default: !1
20
+ },
21
+ ready: {
22
+ type: Boolean,
23
+ default: !1
24
+ },
25
+ aspectRatioOptions: {
26
+ type: Array,
27
+ default: () => [
28
+ { value: 0, text: "Free" },
29
+ { value: 1, text: "1:1" },
30
+ { value: 4 / 3, text: "4:3" },
31
+ { value: 16 / 9, text: "16:9" },
32
+ { value: 3 / 4, text: "3:4" },
33
+ { value: 9 / 16, text: "9:16" }
34
+ ]
35
+ },
36
+ suggestedAspectRatio: Number
37
+ },
38
+ emits: ["update:modelValue"],
39
+ setup(a, { emit: n }) {
40
+ const r = a, p = n, i = d("cropper"), o = f(0);
41
+ function u() {
42
+ const { canvas: s } = i.value?.getResult(), e = s.toDataURL();
43
+ p("update:modelValue", e);
44
+ }
45
+ return v(() => {
46
+ o.value = r.suggestedAspectRatio || 0;
47
+ }), (s, e) => a.modelValue ? (g(), y("div", B, [
48
+ t("div", k, [
49
+ t("div", C, [
50
+ l(V(_), {
51
+ ref: "cropper",
52
+ class: "cropper",
53
+ src: a.modelValue,
54
+ "stencil-props": {
55
+ ...o.value !== 0 ? { aspectRatio: o.value } : {}
56
+ },
57
+ "resize-image": !1
58
+ }, null, 8, ["src", "stencil-props"])
59
+ ])
60
+ ]),
61
+ e[1] || (e[1] = t("hr", null, null, -1)),
62
+ t("div", N, [
63
+ t("div", A, [
64
+ l(h, {
65
+ modelValue: o.value,
66
+ "onUpdate:modelValue": e[0] || (e[0] = (c) => o.value = c),
67
+ options: a.aspectRatioOptions,
68
+ class: "mb-0"
69
+ }, null, 8, ["modelValue", "options"]),
70
+ R(s.$slots, "actions"),
71
+ t("button", {
72
+ class: "btn btn-sm btn-primary",
73
+ onClick: x(u, ["prevent", "stop"])
74
+ }, b(s.$t("common.apply")), 1)
75
+ ])
76
+ ])
77
+ ])) : w("", !0);
78
+ }
79
+ });
80
+ export {
81
+ O as default
82
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./image-crop.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,120 @@
1
+ import { defineComponent as h, ref as f, computed as g, watch as b, onMounted as C, openBlock as l, createElementBlock as m, createElementVNode as o, createBlock as v, withCtx as y, withModifiers as c, toDisplayString as r, createCommentVNode as u, createVNode as V, renderSlot as B } from "vue";
2
+ import z from "../image-resize/image-resize.vue.js";
3
+ import N from "../image-crop/image-crop.vue.js";
4
+ import S from "../../atoms/base-image/base-image.vue.js";
5
+ /* empty css */
6
+ import _ from "../../atoms/svg-icon/svg-icon.vue.js";
7
+ /* empty css */
8
+ const x = {
9
+ key: 0,
10
+ class: "image-crop-resize position-relative"
11
+ }, E = { class: "row" }, M = { class: "col" }, R = {
12
+ key: 3,
13
+ class: "alert alert-warning mt-4 small p-2"
14
+ }, U = { key: 4 }, W = { class: "row" }, q = { class: "col-12" }, D = { class: "d-flex" }, I = {
15
+ key: 0,
16
+ class: "d-flex gap-3"
17
+ }, j = { class: "caption" }, A = { class: "caption" }, F = {
18
+ key: 1,
19
+ class: "ms-auto"
20
+ }, Q = /* @__PURE__ */ h({
21
+ __name: "image-crop-resize",
22
+ props: {
23
+ modelValue: {
24
+ type: String,
25
+ default: 'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg"/>',
26
+ required: !0
27
+ },
28
+ spinner: {
29
+ type: Boolean,
30
+ default: !1
31
+ },
32
+ ready: {
33
+ type: Boolean,
34
+ default: !1
35
+ },
36
+ aspectRatio: Number
37
+ },
38
+ emits: ["update:modelValue"],
39
+ setup(d, { emit: k }) {
40
+ const p = d, $ = k, s = f(!1), a = f(!1), i = g({
41
+ get: () => p.modelValue,
42
+ set: (t) => $("update:modelValue", t)
43
+ }), w = g(() => p.modelValue.startsWith("data:image/svg+xml"));
44
+ return b(() => [s.value, i.value], (t, e) => {
45
+ t[0] && t[0] === e[0] && (s.value = !1);
46
+ }), b(() => [a.value, i.value], (t, e) => {
47
+ t[0] && t[0] === e[0] && (a.value = !1);
48
+ }), C(() => {
49
+ }), (t, e) => d.modelValue ? (l(), m("div", x, [
50
+ o("div", E, [
51
+ o("div", M, [
52
+ s.value || a.value ? s.value ? (l(), v(z, {
53
+ key: 1,
54
+ modelValue: i.value,
55
+ "onUpdate:modelValue": e[1] || (e[1] = (n) => i.value = n)
56
+ }, {
57
+ actions: y(() => [
58
+ o("button", {
59
+ class: "btn btn-outline-ccontrast",
60
+ onClick: e[0] || (e[0] = c((n) => s.value = !1, ["prevent", "stop"]))
61
+ }, r(t.$t("common.cancel")), 1)
62
+ ]),
63
+ _: 1
64
+ }, 8, ["modelValue"])) : a.value ? (l(), v(N, {
65
+ key: 2,
66
+ modelValue: i.value,
67
+ "onUpdate:modelValue": e[3] || (e[3] = (n) => i.value = n),
68
+ "suggested-aspect-ratio": d.aspectRatio
69
+ }, {
70
+ actions: y(() => [
71
+ o("button", {
72
+ class: "btn btn-sm btn-outline-ccontrast",
73
+ onClick: e[2] || (e[2] = c((n) => a.value = !1, ["prevent", "stop"]))
74
+ }, r(t.$t("common.cancel")), 1)
75
+ ]),
76
+ _: 1
77
+ }, 8, ["modelValue", "suggested-aspect-ratio"])) : u("", !0) : (l(), v(S, {
78
+ key: 0,
79
+ ref: "targetImage",
80
+ class: "",
81
+ animate: !1,
82
+ src: d.modelValue
83
+ }, null, 8, ["src"])),
84
+ w.value ? (l(), m("div", R, r(t.$t("common.svgWarning")), 1)) : u("", !0),
85
+ !a.value && !s.value ? (l(), m("hr", U)) : u("", !0),
86
+ o("div", W, [
87
+ o("div", q, [
88
+ o("div", D, [
89
+ !a.value && !s.value ? (l(), m("div", I, [
90
+ o("button", {
91
+ type: "button",
92
+ class: "btn btn-light",
93
+ onClick: e[4] || (e[4] = c((n) => a.value = !a.value, ["prevent", "stop"]))
94
+ }, [
95
+ V(_, { symbol: "crop" }),
96
+ o("span", j, r(t.$t("common.crop")), 1)
97
+ ]),
98
+ o("button", {
99
+ type: "button",
100
+ class: "btn btn-light",
101
+ onClick: e[5] || (e[5] = c((n) => s.value = !s.value, ["prevent", "stop"]))
102
+ }, [
103
+ V(_, { symbol: "image-upscale" }),
104
+ o("span", A, r(t.$t("common.resize")), 1)
105
+ ])
106
+ ])) : u("", !0),
107
+ !a.value && !s.value ? (l(), m("div", F, [
108
+ B(t.$slots, "submit")
109
+ ])) : u("", !0)
110
+ ])
111
+ ])
112
+ ])
113
+ ])
114
+ ])
115
+ ])) : u("", !0);
116
+ }
117
+ });
118
+ export {
119
+ Q as default
120
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./image-crop-resize.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,143 @@
1
+ import { defineComponent as x, useTemplateRef as E, ref as d, watch as v, onMounted as k, openBlock as h, createElementBlock as R, createElementVNode as t, createVNode as p, createBlock as S, createCommentVNode as _, withDirectives as $, vModelText as B, renderSlot as I, withModifiers as N, toDisplayString as z } from "vue";
2
+ import { debounce as C } from "lodash";
3
+ import { resizeImageElementToDataUrl as U } from "../../../utilities/helpers.js";
4
+ import b from "../../atoms/base-image/base-image.vue.js";
5
+ /* empty css */
6
+ import y from "../../atoms/base-input/base-input.vue.js";
7
+ /* empty css */
8
+ const q = {
9
+ key: 0,
10
+ class: "image-editor position-relative"
11
+ }, D = { class: "row mb-3" }, H = { class: "col" }, T = { class: "row gap-2 mb-4" }, W = { class: "col-12" }, A = { class: "input mb-2" }, F = { class: "col" }, L = { class: "input mb-0" }, j = { class: "col" }, G = { class: "input mb-0" }, J = { class: "row" }, K = { class: "col d-flex justify-content-end gap-2" }, O = ["disabled"], ae = /* @__PURE__ */ x({
12
+ __name: "image-resize",
13
+ props: {
14
+ modelValue: {
15
+ type: String,
16
+ default: 'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg"/>',
17
+ required: !0
18
+ },
19
+ spinner: {
20
+ type: Boolean,
21
+ default: !1
22
+ },
23
+ ready: {
24
+ type: Boolean,
25
+ default: !1
26
+ }
27
+ },
28
+ emits: ["update:modelValue"],
29
+ setup(f, { emit: V }) {
30
+ const w = V, m = E("image"), n = d(1), l = d(0), i = d(0), r = d(null), s = d(0), u = d(0);
31
+ function M() {
32
+ r.value && (w("update:modelValue", r.value), n.value = 1);
33
+ }
34
+ const g = () => {
35
+ if (!s.value || !u.value) return;
36
+ l.value = Math.round(s.value * n.value);
37
+ const a = u.value / s.value;
38
+ i.value = Math.round(l.value * a);
39
+ const e = m.value?.$el;
40
+ if (!e) return;
41
+ const o = e.querySelector("img");
42
+ o && (r.value = U(o, l.value, i.value, "image/png"));
43
+ }, c = C(g, 300);
44
+ return v(n, () => {
45
+ s.value && (l.value = Math.round(s.value * n.value), c());
46
+ }), v(l, () => {
47
+ if (!s.value || l.value === 0) return;
48
+ const a = l.value / s.value;
49
+ Math.abs(a - n.value) > 1e-4 && (n.value = Number(a.toFixed(4)));
50
+ const e = u.value / s.value;
51
+ i.value = Math.round(l.value * e), c();
52
+ }), v(i, () => {
53
+ if (!u.value || i.value === 0) return;
54
+ const a = i.value / u.value;
55
+ Math.abs(a - n.value) > 1e-4 && (n.value = Number(a.toFixed(4)));
56
+ const e = s.value / u.value;
57
+ l.value = Math.round(i.value * e), c();
58
+ }), k(() => {
59
+ const a = m.value?.$el;
60
+ if (!a) return;
61
+ const e = a.querySelector("img");
62
+ if (!e) return;
63
+ const o = () => {
64
+ s.value = e.naturalWidth, u.value = e.naturalHeight, g();
65
+ };
66
+ e.complete ? o() : e.addEventListener("load", o);
67
+ }), (a, e) => f.modelValue ? (h(), R("div", q, [
68
+ t("div", D, [
69
+ t("div", H, [
70
+ p(b, {
71
+ ref_key: "image",
72
+ ref: m,
73
+ class: "d-none",
74
+ src: f.modelValue,
75
+ animate: !1
76
+ }, null, 8, ["src"]),
77
+ r.value ? (h(), S(b, {
78
+ key: 0,
79
+ ref: "targetImage",
80
+ class: "",
81
+ src: r.value,
82
+ animate: !1
83
+ }, null, 8, ["src"])) : _("", !0)
84
+ ])
85
+ ]),
86
+ t("div", T, [
87
+ t("div", W, [
88
+ t("div", A, [
89
+ $(t("input", {
90
+ type: "range",
91
+ class: "form-range",
92
+ id: "scaleRange",
93
+ "onUpdate:modelValue": e[0] || (e[0] = (o) => n.value = o),
94
+ min: "0",
95
+ max: "2",
96
+ step: "0.0001"
97
+ }, null, 512), [
98
+ [B, n.value]
99
+ ])
100
+ ])
101
+ ]),
102
+ t("div", F, [
103
+ t("div", L, [
104
+ p(y, {
105
+ type: "number",
106
+ class: "form-input mb-0",
107
+ id: "targetWidth",
108
+ modelValue: l.value,
109
+ "onUpdate:modelValue": e[1] || (e[1] = (o) => l.value = o)
110
+ }, null, 8, ["modelValue"])
111
+ ])
112
+ ]),
113
+ e[3] || (e[3] = t("div", { class: "col-auto d-flex align-items-center" }, [
114
+ t("output", null, "×")
115
+ ], -1)),
116
+ t("div", j, [
117
+ t("div", G, [
118
+ p(y, {
119
+ type: "number",
120
+ class: "form-input mb-0",
121
+ id: "targetHeight",
122
+ modelValue: i.value,
123
+ "onUpdate:modelValue": e[2] || (e[2] = (o) => i.value = o)
124
+ }, null, 8, ["modelValue"])
125
+ ])
126
+ ])
127
+ ]),
128
+ t("div", J, [
129
+ t("div", K, [
130
+ I(a.$slots, "actions"),
131
+ t("button", {
132
+ class: "btn btn-sm btn-primary",
133
+ disabled: !r.value,
134
+ onClick: N(M, ["prevent", "stop"])
135
+ }, z(a.$t("common.apply")), 9, O)
136
+ ])
137
+ ])
138
+ ])) : _("", !0);
139
+ }
140
+ });
141
+ export {
142
+ ae as default
143
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./image-resize.vue.js";
2
+ export {
3
+ f as default
4
+ };