ablok-components 0.3.57 → 0.3.59

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 (196) hide show
  1. package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
  2. package/dist/ablok-components.umd.js +2 -2
  3. package/dist/assets/img/guide.png.js +4 -0
  4. package/dist/components/atoms/base-button/base-button.vue.js +92 -0
  5. package/dist/components/atoms/base-button/base-button.vue3.js +5 -0
  6. package/dist/components/atoms/base-headline/base-headline.vue.js +30 -0
  7. package/dist/components/atoms/base-headline/base-headline.vue2.js +4 -0
  8. package/dist/components/atoms/base-image/base-image.vue.js +75 -0
  9. package/dist/components/atoms/base-image/base-image.vue3.js +5 -0
  10. package/dist/components/atoms/base-input/base-input.vue.js +181 -0
  11. package/dist/components/atoms/base-input/base-input.vue3.js +5 -0
  12. package/dist/components/atoms/base-paragraph/base-paragraph.vue.js +21 -0
  13. package/dist/components/atoms/base-paragraph/base-paragraph.vue2.js +4 -0
  14. package/dist/components/atoms/canvas-confetti/canvas-confetti.vue.js +113 -0
  15. package/dist/components/atoms/canvas-confetti/canvas-confetti.vue3.js +5 -0
  16. package/dist/components/atoms/check-group/check-group.vue.js +86 -0
  17. package/dist/components/atoms/check-group/check-group.vue3.js +5 -0
  18. package/dist/components/atoms/custom-html/custom-html.vue.js +26 -0
  19. package/dist/components/atoms/custom-html/custom-html.vue2.js +4 -0
  20. package/dist/components/atoms/input-checkbox/input-checkbox.vue.js +84 -0
  21. package/dist/components/atoms/input-checkbox/input-checkbox.vue3.js +5 -0
  22. package/dist/components/atoms/input-datetime/input-datetime.vue.js +99 -0
  23. package/dist/components/atoms/input-datetime/input-datetime.vue2.js +4 -0
  24. package/dist/components/atoms/input-file/input-file.vue.js +130 -0
  25. package/dist/components/atoms/input-file/input-file.vue2.js +4 -0
  26. package/dist/components/atoms/input-passcode/input-passcode.vue.js +149 -0
  27. package/dist/components/atoms/input-passcode/input-passcode.vue2.js +4 -0
  28. package/dist/components/atoms/input-password/input-password.vue.js +118 -0
  29. package/dist/components/atoms/input-password/input-password.vue2.js +4 -0
  30. package/dist/components/atoms/input-textarea/input-textarea.vue.js +105 -0
  31. package/dist/components/atoms/input-textarea/input-textarea.vue2.js +4 -0
  32. package/dist/components/atoms/loading-spinner/loading-spinner.vue.js +38 -0
  33. package/dist/components/atoms/loading-spinner/loading-spinner.vue3.js +5 -0
  34. package/dist/components/atoms/radio-group/radio-group.vue.js +99 -0
  35. package/dist/components/atoms/radio-group/radio-group.vue3.js +5 -0
  36. package/dist/components/atoms/svg-icon/svg-icon.vue.js +44 -0
  37. package/dist/components/atoms/svg-icon/svg-icon.vue3.js +5 -0
  38. package/dist/components/atoms/zoom-slider/zoom-slider.vue.js +59 -0
  39. package/dist/components/atoms/zoom-slider/zoom-slider.vue3.js +5 -0
  40. package/dist/components/molecules/accordion/accordion-item.vue.js +76 -0
  41. package/dist/components/molecules/accordion/accordion-item.vue3.js +5 -0
  42. package/dist/components/molecules/accordion/accordion.vue.js +12 -0
  43. package/dist/components/molecules/auto-suggest/auto-suggest.vue.js +132 -0
  44. package/dist/components/molecules/auto-suggest/auto-suggest.vue3.js +5 -0
  45. package/dist/components/molecules/base-camera/base-camera.vue.js +392 -0
  46. package/dist/components/molecules/base-camera/base-camera.vue3.js +5 -0
  47. package/dist/components/molecules/base-map/base-map.vue.js +386 -0
  48. package/dist/components/molecules/base-map/base-map.vue3.js +5 -0
  49. package/dist/components/molecules/color-palette/color-palette.vue.js +72 -0
  50. package/dist/components/molecules/color-palette/color-palette.vue3.js +5 -0
  51. package/dist/components/molecules/dom-renderer/dom-renderer.vue.js +102 -0
  52. package/dist/components/molecules/dom-renderer/dom-renderer.vue2.js +4 -0
  53. package/dist/components/molecules/file-upload/file-upload.vue.js +177 -0
  54. package/dist/components/molecules/file-upload/file-upload.vue3.js +5 -0
  55. package/dist/components/molecules/hint-system/hint-system.vue.d.ts +1 -1
  56. package/dist/components/molecules/hint-system/hint-system.vue.js +111 -0
  57. package/dist/components/molecules/hint-system/hint-system.vue3.js +5 -0
  58. package/dist/components/molecules/image-crop/image-crop.vue.js +82 -0
  59. package/dist/components/molecules/image-crop/image-crop.vue2.js +4 -0
  60. package/dist/components/molecules/image-crop-resize/image-crop-resize.vue.js +120 -0
  61. package/dist/components/molecules/image-crop-resize/image-crop-resize.vue2.js +4 -0
  62. package/dist/components/molecules/image-resize/image-resize.vue.js +143 -0
  63. package/dist/components/molecules/image-resize/image-resize.vue2.js +4 -0
  64. package/dist/components/molecules/image-upload/image-upload.vue.js +274 -0
  65. package/dist/components/molecules/image-upload/image-upload.vue3.js +5 -0
  66. package/dist/components/molecules/image-zoom/image-zoom.vue.js +209 -0
  67. package/dist/components/molecules/image-zoom/image-zoom.vue3.js +5 -0
  68. package/dist/components/molecules/input-color/input-color.vue.js +105 -0
  69. package/dist/components/molecules/input-color/input-color.vue3.js +5 -0
  70. package/dist/components/molecules/input-datepicker/input-datepicker.vue.js +263 -0
  71. package/dist/components/molecules/input-datepicker/input-datepicker.vue3.js +5 -0
  72. package/dist/components/molecules/input-dropdown/input-dropdown.vue.js +207 -0
  73. package/dist/components/molecules/input-dropdown/input-dropdown.vue3.js +5 -0
  74. package/dist/components/molecules/link-sharing/link-sharing.vue.js +177 -0
  75. package/dist/components/molecules/link-sharing/link-sharing.vue3.js +7 -0
  76. package/dist/components/molecules/location-list/location-list.vue.js +98 -0
  77. package/dist/components/molecules/location-list/location-list.vue3.js +5 -0
  78. package/dist/components/molecules/media-thumbnails/media-thumbnails.vue.js +55 -0
  79. package/dist/components/molecules/media-thumbnails/media-thumbnails.vue3.js +5 -0
  80. package/dist/components/molecules/popover-notifications/popover-notifications.vue.js +135 -0
  81. package/dist/components/molecules/popover-notifications/popover-notifications.vue3.js +5 -0
  82. package/dist/components/molecules/popover-tooltip/popover-tooltip.vue.js +134 -0
  83. package/dist/components/molecules/popover-tooltip/popover-tooltip.vue3.js +5 -0
  84. package/dist/components/molecules/progress-steps/progress-steps.vue.js +84 -0
  85. package/dist/components/molecules/progress-steps/progress-steps.vue3.js +5 -0
  86. package/dist/components/molecules/qr-code/qr-code.vue.js +103 -0
  87. package/dist/components/molecules/qr-code/qr-code.vue3.js +5 -0
  88. package/dist/components/molecules/radio-buttons/radio-buttons.vue.js +79 -0
  89. package/dist/components/molecules/radio-buttons/radio-buttons.vue3.js +5 -0
  90. package/dist/components/molecules/rte-editor/rte-editor.vue.js +455 -0
  91. package/dist/components/molecules/rte-editor/rte-editor.vue3.js +5 -0
  92. package/dist/components/molecules/select-media/select-media.vue.js +87 -0
  93. package/dist/components/molecules/select-media/select-media.vue3.js +5 -0
  94. package/dist/components/molecules/upload-group/upload-group.vue.js +178 -0
  95. package/dist/components/molecules/upload-group/upload-group.vue3.js +5 -0
  96. package/dist/components/organisms/asset-uploader/asset-uploader.vue.js +126 -0
  97. package/dist/components/organisms/asset-uploader/asset-uploader.vue3.js +5 -0
  98. package/dist/components/organisms/location-finder/location-finder.vue.js +634 -0
  99. package/dist/components/organisms/location-finder/location-finder.vue3.js +5 -0
  100. package/dist/components/templates/base-carousel/base-carousel.vue.js +94 -0
  101. package/dist/components/templates/base-carousel/base-carousel.vue3.js +5 -0
  102. package/dist/components/templates/base-form/base-form.vue.js +35 -0
  103. package/dist/components/templates/base-form/base-form.vue3.js +5 -0
  104. package/dist/components/templates/modal-dialog/modal-dialog.vue.js +123 -0
  105. package/dist/components/templates/modal-dialog/modal-dialog.vue3.js +5 -0
  106. package/dist/components/templates/popover-dialog/popover-dialog.vue.js +95 -0
  107. package/dist/components/templates/popover-dialog/popover-dialog.vue3.js +5 -0
  108. package/dist/components/templates/sortable-list/sortable-list.vue.js +158 -0
  109. package/dist/components/templates/sortable-list/sortable-list.vue3.js +5 -0
  110. package/dist/components/templates/touch-wrapper/touch-wrapper.vue.js +85 -0
  111. package/dist/components/templates/touch-wrapper/touch-wrapper.vue3.js +5 -0
  112. package/dist/composables/useCameraFilter.js +56 -0
  113. package/dist/composables/useConfetti.js +12 -0
  114. package/dist/composables/useDirections.js +62 -0
  115. package/dist/composables/useFileUpload.js +79 -0
  116. package/dist/composables/useGeocoding.js +85 -0
  117. package/dist/composables/useGeolocation.js +71 -0
  118. package/dist/composables/useSanitize.js +23 -0
  119. package/dist/i18n.d.ts +3 -0
  120. package/dist/index.js +156 -0
  121. package/dist/locales/en.d.ts +3 -0
  122. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +9 -0
  123. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +18 -0
  124. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildMatchFn.js +31 -0
  125. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +15 -0
  126. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/de/_lib/formatDistance.js +163 -0
  127. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/de/_lib/formatLong.js +37 -0
  128. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/de/_lib/formatRelative.js +11 -0
  129. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/de/_lib/localize.js +161 -0
  130. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/de/_lib/match.js +112 -0
  131. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/de.js +20 -0
  132. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +70 -0
  133. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/formatLong.js +33 -0
  134. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +11 -0
  135. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/localize.js +155 -0
  136. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/match.js +110 -0
  137. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US.js +20 -0
  138. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/fr/_lib/formatDistance.js +70 -0
  139. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/fr/_lib/formatLong.js +33 -0
  140. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/fr/_lib/formatRelative.js +11 -0
  141. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/fr/_lib/localize.js +121 -0
  142. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/fr/_lib/match.js +110 -0
  143. package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/fr.js +20 -0
  144. package/dist/utilities/helpers.js +79 -0
  145. package/package.json +80 -25
  146. package/dist/ablok-components.es.js +0 -8654
  147. package/dist/components/atoms/base-button/base-button.spec.d.ts +0 -1
  148. package/dist/components/atoms/base-headline/base-headline.spec.d.ts +0 -1
  149. package/dist/components/atoms/base-image/base-image.spec.d.ts +0 -1
  150. package/dist/components/atoms/base-input/base-input.spec.d.ts +0 -1
  151. package/dist/components/atoms/base-paragraph/base-paragraph.spec.d.ts +0 -1
  152. package/dist/components/atoms/canvas-confetti/canvas-confetti.spec.d.ts +0 -1
  153. package/dist/components/atoms/check-group/check-group.spec.d.ts +0 -1
  154. package/dist/components/atoms/custom-html/custom-html.spec.d.ts +0 -1
  155. package/dist/components/atoms/input-checkbox/input-checkbox.spec.d.ts +0 -1
  156. package/dist/components/atoms/input-file/input-file.spec.d.ts +0 -1
  157. package/dist/components/atoms/input-passcode/input-passcode.spec.d.ts +0 -1
  158. package/dist/components/atoms/input-password/input-password.spec.d.ts +0 -1
  159. package/dist/components/atoms/input-textarea/input-textarea.spec.d.ts +0 -1
  160. package/dist/components/atoms/loading-spinner/loading-spinner.spec.d.ts +0 -1
  161. package/dist/components/atoms/radio-group/radio-group.spec.d.ts +0 -1
  162. package/dist/components/atoms/svg-icon/svg-icon.spec.d.ts +0 -1
  163. package/dist/components/atoms/zoom-slider/zoom-slider.spec.d.ts +0 -1
  164. package/dist/components/molecules/accordion/accordion-item.spec.d.ts +0 -1
  165. package/dist/components/molecules/auto-suggest/auto-suggest.spec.d.ts +0 -1
  166. package/dist/components/molecules/base-map/base-map.spec.d.ts +0 -1
  167. package/dist/components/molecules/color-palette/color-palette.spec.d.ts +0 -1
  168. package/dist/components/molecules/dom-renderer/dom-renderer.spec.d.ts +0 -1
  169. package/dist/components/molecules/file-upload/file-upload.spec.d.ts +0 -1
  170. package/dist/components/molecules/hint-system/hint-system.spec.d.ts +0 -1
  171. package/dist/components/molecules/image-crop/image-crop.spec.d.ts +0 -1
  172. package/dist/components/molecules/image-crop-resize/image-crop-resize.spec.d.ts +0 -1
  173. package/dist/components/molecules/image-resize/image-resize.spec.d.ts +0 -1
  174. package/dist/components/molecules/image-upload/image-upload.spec.d.ts +0 -1
  175. package/dist/components/molecules/image-zoom/image-zoom.spec.d.ts +0 -1
  176. package/dist/components/molecules/input-color/input-color.spec.d.ts +0 -1
  177. package/dist/components/molecules/input-datepicker/input-datepicker.spec.d.ts +0 -1
  178. package/dist/components/molecules/input-dropdown/input-dropdown.spec.d.ts +0 -1
  179. package/dist/components/molecules/link-sharing/link-sharing.spec.d.ts +0 -1
  180. package/dist/components/molecules/media-thumbnails/media-thumbnails.spec.d.ts +0 -1
  181. package/dist/components/molecules/popover-notifications/popover-notifications.spec.d.ts +0 -1
  182. package/dist/components/molecules/popover-tooltip/popover-tooltip.spec.d.ts +0 -1
  183. package/dist/components/molecules/progress-steps/progress-steps.spec.d.ts +0 -1
  184. package/dist/components/molecules/qr-code/qr-code.spec.d.ts +0 -1
  185. package/dist/components/molecules/radio-buttons/radio-buttons.spec.d.ts +0 -1
  186. package/dist/components/molecules/rte-editor/rte-editor.spec.d.ts +0 -1
  187. package/dist/components/molecules/select-media/select-media.spec.d.ts +0 -1
  188. package/dist/components/molecules/upload-group/upload-group.spec.d.ts +0 -1
  189. package/dist/components/organisms/asset-uploader/asset-uploader.spec.d.ts +0 -1
  190. package/dist/components/organisms/location-finder/location-finder.spec.d.ts +0 -1
  191. package/dist/components/templates/base-carousel/base-carousel.spec.d.ts +0 -1
  192. package/dist/components/templates/base-form/base-form.spec.d.ts +0 -1
  193. package/dist/components/templates/modal-dialog/modal-dialog.spec.d.ts +0 -1
  194. package/dist/components/templates/popover-dialog/popover-dialog.spec.d.ts +0 -1
  195. package/dist/components/templates/sortable-list/sortable-list.spec.d.ts +0 -1
  196. package/dist/components/templates/touch-wrapper/touch-wrapper.spec.d.ts +0 -1
@@ -0,0 +1,634 @@
1
+ import { defineComponent as Ce, ref as V, computed as o, watch as D, onMounted as Fe, openBlock as d, createElementBlock as m, normalizeClass as te, createBlock as ae, createCommentVNode as _, createElementVNode as s, unref as E, toDisplayString as f, createVNode as Pe, createTextVNode as U, Fragment as ne, renderList as Ve } from "vue";
2
+ import { useI18n as $e } from "vue-i18n";
3
+ import Ne from "../../molecules/auto-suggest/auto-suggest.vue.js";
4
+ /* empty css */
5
+ import Ue from "../../molecules/base-map/base-map.vue.js";
6
+ /* empty css */
7
+ import Ae from "../../molecules/location-list/location-list.vue.js";
8
+ /* empty css */
9
+ import { useDirections as Ge } from "../../../composables/useDirections.js";
10
+ import { useGeocoding as He } from "../../../composables/useGeocoding.js";
11
+ import { useGeolocation as je } from "../../../composables/useGeolocation.js";
12
+ const Oe = {
13
+ class: "location-finder",
14
+ "data-testid": "location-finder"
15
+ }, qe = { class: "location-finder__actions" }, ze = ["disabled"], Ie = {
16
+ key: 1,
17
+ class: "location-finder__notice",
18
+ "data-testid": "location-finder-error"
19
+ }, Qe = { class: "location-finder__map-panel" }, We = ["aria-label"], Ke = { class: "location-finder__legend-item" }, Ye = { class: "location-finder__legend-item" }, Je = { class: "location-finder__legend-item" }, Xe = { class: "location-finder__legend-item" }, Ze = {
20
+ key: 0,
21
+ class: "location-finder__sidebar"
22
+ }, et = {
23
+ key: 1,
24
+ class: "location-finder__summary",
25
+ "data-testid": "location-finder-directions"
26
+ }, tt = { class: "location-finder__summary-title" }, at = {
27
+ key: 0,
28
+ class: "location-finder__summary-copy"
29
+ }, nt = { class: "location-finder__summary-grid" }, lt = { class: "location-finder__summary-label" }, ot = { "data-testid": "location-finder-distance" }, it = { class: "location-finder__summary-label" }, rt = { "data-testid": "location-finder-duration" }, st = {
30
+ key: 0,
31
+ class: "location-finder__steps"
32
+ }, ut = { key: 0 }, ct = {
33
+ key: 2,
34
+ class: "location-finder__summary-copy"
35
+ }, St = /* @__PURE__ */ Ce({
36
+ __name: "location-finder",
37
+ props: {
38
+ modelValue: {
39
+ type: Object,
40
+ default: null
41
+ },
42
+ locations: {
43
+ type: Array,
44
+ default: () => []
45
+ },
46
+ center: {
47
+ type: Object,
48
+ default: null
49
+ },
50
+ distance: {
51
+ type: Number,
52
+ default: null
53
+ },
54
+ userLocation: {
55
+ type: Object,
56
+ default: null
57
+ },
58
+ messages: {
59
+ type: Object,
60
+ default: () => ({})
61
+ },
62
+ mapHeight: {
63
+ type: String,
64
+ default: "26rem"
65
+ },
66
+ searchLabel: {
67
+ type: String,
68
+ default: ""
69
+ },
70
+ searchPlaceholder: {
71
+ type: String,
72
+ default: ""
73
+ },
74
+ resultsLabel: {
75
+ type: String,
76
+ default: ""
77
+ },
78
+ emptyText: {
79
+ type: String,
80
+ default: ""
81
+ },
82
+ locateButtonLabel: {
83
+ type: String,
84
+ default: ""
85
+ },
86
+ stopTrackingLabel: {
87
+ type: String,
88
+ default: ""
89
+ },
90
+ mapHelperText: {
91
+ type: String,
92
+ default: ""
93
+ },
94
+ enableGeocoding: {
95
+ type: Boolean,
96
+ default: !1
97
+ },
98
+ geocodingEndpoint: {
99
+ type: String,
100
+ default: "https://nominatim.openstreetmap.org/search"
101
+ },
102
+ reverseGeocodingEndpoint: {
103
+ type: String,
104
+ default: "https://nominatim.openstreetmap.org/reverse"
105
+ },
106
+ geocodingLimit: {
107
+ type: Number,
108
+ default: 5
109
+ },
110
+ geocodingMinQueryLength: {
111
+ type: Number,
112
+ default: 3
113
+ },
114
+ customGeocodingFetch: null,
115
+ enableDirections: {
116
+ type: Boolean,
117
+ default: !1
118
+ },
119
+ directionsEndpoint: {
120
+ type: String,
121
+ default: "https://router.project-osrm.org/route/v1"
122
+ },
123
+ routeProfile: {
124
+ type: String,
125
+ default: "driving"
126
+ },
127
+ customDirectionsFetch: null,
128
+ showDirectionsSummary: {
129
+ type: Boolean,
130
+ default: !0
131
+ },
132
+ showDirectionsSteps: {
133
+ type: Boolean,
134
+ default: !0
135
+ },
136
+ directionsTitle: {
137
+ type: String,
138
+ default: ""
139
+ },
140
+ directionsEmptyText: {
141
+ type: String,
142
+ default: ""
143
+ },
144
+ distanceLabel: {
145
+ type: String,
146
+ default: ""
147
+ },
148
+ durationLabel: {
149
+ type: String,
150
+ default: ""
151
+ },
152
+ routeColor: {
153
+ type: String,
154
+ default: "#2563eb"
155
+ },
156
+ routeWeight: {
157
+ type: Number,
158
+ default: 5
159
+ },
160
+ selectionRadius: {
161
+ type: Number,
162
+ default: 0
163
+ },
164
+ selectionRadiusColor: {
165
+ type: String,
166
+ default: "#2563eb"
167
+ },
168
+ selectionRadiusFillColor: {
169
+ type: String,
170
+ default: "#60a5fa"
171
+ },
172
+ mapStyle: {
173
+ type: String,
174
+ default: "streets"
175
+ },
176
+ tileLayerUrl: {
177
+ type: String,
178
+ default: ""
179
+ },
180
+ tileLayerAttribution: {
181
+ type: String,
182
+ default: ""
183
+ },
184
+ disabled: {
185
+ type: Boolean,
186
+ default: !1
187
+ },
188
+ interactive: {
189
+ type: Boolean,
190
+ default: !1
191
+ },
192
+ showSearch: {
193
+ type: Boolean,
194
+ default: !0
195
+ },
196
+ showLegend: {
197
+ type: Boolean,
198
+ default: !0
199
+ },
200
+ showSidebar: {
201
+ type: Boolean,
202
+ default: !0
203
+ },
204
+ showTrackButton: {
205
+ type: Boolean,
206
+ default: !0
207
+ },
208
+ trackUser: {
209
+ type: Boolean,
210
+ default: !0
211
+ },
212
+ autoLocate: {
213
+ type: Boolean,
214
+ default: !1
215
+ }
216
+ },
217
+ emits: ["update:modelValue", "update:distance", "select", "search", "track-user"],
218
+ setup(c, { emit: le }) {
219
+ const q = {
220
+ lat: 48.8566,
221
+ lng: 2.3522
222
+ }, oe = {
223
+ searchLabel: "Search locations",
224
+ searchPlaceholder: "Search by name or address",
225
+ resultsLabel: "Locations",
226
+ emptyText: "No locations found.",
227
+ locateButtonLabel: "Use my location",
228
+ stopTrackingLabel: "Stop tracking",
229
+ mapHelperText: "Select a location from the list or use the map.",
230
+ directionsTitle: "Directions",
231
+ directionsEmptyText: "Select a destination and share your location to preview a route.",
232
+ distanceLabel: "Distance",
233
+ durationLabel: "ETA",
234
+ loadingRoute: "Loading route…",
235
+ legendAriaLabel: "Map marker types",
236
+ legendLocations: "Locations",
237
+ legendSelected: "Selected",
238
+ legendSearchResult: "Search result",
239
+ userLocationLabel: "Your location",
240
+ pinnedLocationTitle: "Pinned location",
241
+ selectedLocationLabel: "Selected location"
242
+ }, n = c, p = le, { t: ie, te: re } = $e({ useScope: "global" }), b = je(), T = He(), L = Ge(), R = V(""), k = V(M(x(n.modelValue))), v = V(M(x(n.modelValue)) ? null : x(n.modelValue)), y = V(i(n.modelValue) || i(n.center) || i(n.locations[0]) || q), h = V(!1), z = o(() => i(n.userLocation)), g = o(() => b.position.value || z.value), A = o(() => i(v.value)), C = o(() => i(k.value)), I = o(() => g.value || A.value), se = o(() => !I.value || !C.value ? null : ye(I.value, C.value)), G = o(() => i(n.modelValue) || A.value || C.value), Q = o(() => b.error.value || T.error.value || L.error.value || ""), ue = o(() => n.showSearch || n.trackUser && n.showTrackButton), H = o(() => n.enableDirections && n.showDirectionsSummary), W = o(() => n.showSidebar || H.value), ce = o(() => _e(L.distanceMeters.value)), de = o(() => Se(L.durationSeconds.value)), r = o(() => ({
243
+ searchLabel: u("searchLabel", n.searchLabel),
244
+ searchPlaceholder: u("searchPlaceholder", n.searchPlaceholder),
245
+ resultsLabel: u("resultsLabel", n.resultsLabel),
246
+ emptyText: u("emptyText", n.emptyText),
247
+ locateButtonLabel: u("locateButtonLabel", n.locateButtonLabel),
248
+ stopTrackingLabel: u("stopTrackingLabel", n.stopTrackingLabel),
249
+ mapHelperText: u("mapHelperText", n.mapHelperText),
250
+ directionsTitle: u("directionsTitle", n.directionsTitle),
251
+ directionsEmptyText: u("directionsEmptyText", n.directionsEmptyText),
252
+ distanceLabel: u("distanceLabel", n.distanceLabel),
253
+ durationLabel: u("durationLabel", n.durationLabel),
254
+ loadingRoute: u("loadingRoute"),
255
+ legendAriaLabel: u("legendAriaLabel"),
256
+ legendLocations: u("legendLocations"),
257
+ legendSelected: u("legendSelected"),
258
+ legendSearchResult: u("legendSearchResult"),
259
+ userLocationLabel: u("userLocationLabel"),
260
+ pinnedLocationTitle: u("pinnedLocationTitle"),
261
+ selectedLocationLabel: u("selectedLocationLabel")
262
+ })), fe = o(() => v.value ? F(v.value) : r.value.selectedLocationLabel), me = o(() => b.isTracking.value && h.value ? r.value.stopTrackingLabel : r.value.locateButtonLabel);
263
+ D(() => n.modelValue, (e) => {
264
+ const t = x(e), a = M(t);
265
+ a ? (k.value = a, v.value = null) : t && (v.value = t);
266
+ const l = i(e);
267
+ l && (y.value = l);
268
+ }, { immediate: !0 }), D(() => n.center, (e) => {
269
+ const t = i(e);
270
+ t && (y.value = t);
271
+ }, { deep: !0 }), D(g, (e) => {
272
+ e && h.value && (y.value = e);
273
+ }, { deep: !0 }), D(se, (e) => {
274
+ p("update:distance", e);
275
+ }, { immediate: !0 }), D(R, async (e) => {
276
+ if (p("search", e), !n.enableGeocoding) {
277
+ T.clearResults();
278
+ return;
279
+ }
280
+ const t = e.trim();
281
+ if (t.length < n.geocodingMinQueryLength) {
282
+ T.clearResults();
283
+ return;
284
+ }
285
+ await T.search(t, {
286
+ endpoint: n.geocodingEndpoint,
287
+ customFetch: n.customGeocodingFetch,
288
+ limit: n.geocodingLimit
289
+ });
290
+ }), D(
291
+ () => ({
292
+ enabled: n.enableDirections,
293
+ origin: g.value,
294
+ destination: G.value,
295
+ profile: n.routeProfile
296
+ }),
297
+ async ({ enabled: e, origin: t, destination: a, profile: l }) => {
298
+ if (!e || !t || !a || P(t, a)) {
299
+ L.clearRoute();
300
+ return;
301
+ }
302
+ await L.fetchRoute(t, a, {
303
+ endpoint: n.directionsEndpoint,
304
+ profile: l,
305
+ customFetch: n.customDirectionsFetch
306
+ });
307
+ },
308
+ { immediate: !0, deep: !0 }
309
+ ), Fe(async () => {
310
+ n.autoLocate && n.trackUser && await Z();
311
+ });
312
+ const ge = o(() => {
313
+ const e = J(R.value).trim();
314
+ return e ? n.locations.filter((t) => [F(t), X(t)].filter(Boolean).some((a) => J(a).includes(e))) : n.locations;
315
+ }), ve = o(() => T.results.value.map((e) => ({
316
+ id: e.id,
317
+ title: e.title,
318
+ address: e.address,
319
+ lat: e.lat,
320
+ lng: e.lng,
321
+ source: e.source
322
+ }))), K = o(() => {
323
+ if (!R.value.trim())
324
+ return n.locations;
325
+ const e = ge.value;
326
+ return e.length ? e : n.locations;
327
+ }), w = o(() => K.value), Y = o(() => Le(
328
+ K.value,
329
+ n.enableGeocoding ? ve.value : []
330
+ )), pe = o(() => Array.from(new Set(Y.value.map((e) => j(e))))), he = o(
331
+ () => w.value.map((e) => {
332
+ const t = i(e);
333
+ return t ? {
334
+ id: S(e),
335
+ label: F(e),
336
+ ...t,
337
+ type: C.value && P(t, C.value) ? "selected" : "list"
338
+ } : null;
339
+ }).filter((e) => !!e)
340
+ ), be = o(() => h.value && g.value ? g.value : y.value || G.value || g.value || i(w.value[0]) || q);
341
+ function u(e, t) {
342
+ const a = n.messages?.[e];
343
+ if (typeof a == "string" && a.trim())
344
+ return a;
345
+ if (typeof t == "string" && t.trim())
346
+ return t;
347
+ const l = `locationFinder.${String(e)}`;
348
+ return re(l) ? String(ie(l)) : oe[e];
349
+ }
350
+ function i(e) {
351
+ if (!e)
352
+ return null;
353
+ const t = Number(e.lat), a = Number(e.lng);
354
+ return !Number.isFinite(t) || !Number.isFinite(a) ? null : { lat: t, lng: a };
355
+ }
356
+ function x(e) {
357
+ if (!e)
358
+ return null;
359
+ const t = i(e);
360
+ return t ? {
361
+ ...e,
362
+ ...t
363
+ } : null;
364
+ }
365
+ function S(e) {
366
+ return e ? typeof e != "object" ? e : e.id ?? e.value ?? j(e) : null;
367
+ }
368
+ function M(e) {
369
+ return e && n.locations.find((t) => S(t) === S(e) || P(i(t), i(e))) || null;
370
+ }
371
+ function J(e) {
372
+ return `${e ?? ""}`.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase();
373
+ }
374
+ function F(e) {
375
+ return `${e.title || e.label || e.name || "Location"}`;
376
+ }
377
+ function X(e) {
378
+ return `${e.address || e.description || e.subtitle || ""}`;
379
+ }
380
+ function j(e) {
381
+ const t = F(e), a = X(e);
382
+ return a ? `${t} — ${a}` : t;
383
+ }
384
+ function Le(e, t) {
385
+ const a = [...e];
386
+ return t.forEach((l) => {
387
+ a.some((N) => S(N) === S(l) || P(i(N), i(l))) || a.push(l);
388
+ }), a;
389
+ }
390
+ function P(e, t) {
391
+ return !e || !t ? !1 : Math.abs(e.lat - t.lat) < 1e-6 && Math.abs(e.lng - t.lng) < 1e-6;
392
+ }
393
+ function ye(e, t) {
394
+ const a = (Re) => Re * (Math.PI / 180), B = a(t.lat - e.lat), N = a(t.lng - e.lng), Be = a(e.lat), De = a(t.lat), ee = Math.sin(B / 2) ** 2 + Math.cos(Be) * Math.cos(De) * Math.sin(N / 2) ** 2, Ee = 2 * Math.atan2(Math.sqrt(ee), Math.sqrt(1 - ee));
395
+ return Math.round(6371e3 * Ee);
396
+ }
397
+ function _e(e) {
398
+ return e === null || !Number.isFinite(e) ? "—" : e >= 1e3 ? `${(e / 1e3).toFixed(1)} km` : `${Math.round(e)} m`;
399
+ }
400
+ function Se(e) {
401
+ if (e === null || !Number.isFinite(e))
402
+ return "—";
403
+ const t = Math.max(1, Math.round(e / 60));
404
+ if (t < 60)
405
+ return `${t} min`;
406
+ const a = Math.floor(t / 60), l = t % 60;
407
+ return l ? `${a} h ${l} min` : `${a} h`;
408
+ }
409
+ function $(e) {
410
+ const t = x(e), a = M(t);
411
+ if (h.value = !1, !t) {
412
+ p("update:modelValue", null);
413
+ return;
414
+ }
415
+ k.value = a || t;
416
+ const l = i(t);
417
+ l && (y.value = l), p("update:modelValue", t), p("select", t);
418
+ }
419
+ function O(e) {
420
+ const t = x(e), a = M(t);
421
+ if (h.value = !1, !t) {
422
+ p("update:modelValue", null);
423
+ return;
424
+ }
425
+ a ? (k.value = a, v.value = null) : v.value = t;
426
+ const l = i(t);
427
+ l && (y.value = l), p("update:modelValue", t), p("select", t);
428
+ }
429
+ function Te(e) {
430
+ const t = Y.value.find((a) => j(a) === e || F(a) === e);
431
+ if (t) {
432
+ if (M(t)) {
433
+ $(t), v.value = null;
434
+ return;
435
+ }
436
+ O(t);
437
+ }
438
+ }
439
+ function ke(e) {
440
+ $(e);
441
+ }
442
+ function we(e) {
443
+ if (e.id === "user-location" && g.value) {
444
+ y.value = g.value, h.value = !0, p("track-user", g.value);
445
+ return;
446
+ }
447
+ const t = w.value.find((a) => S(a) === e.id) || w.value.find((a) => {
448
+ const l = i(a);
449
+ return l && Math.abs(l.lat - e.lat) < 1e-6 && Math.abs(l.lng - e.lng) < 1e-6;
450
+ });
451
+ if (t) {
452
+ $(t);
453
+ return;
454
+ }
455
+ v.value && (S(v.value) === e.id || P(i(v.value), { lat: e.lat, lng: e.lng })) && O(v.value);
456
+ }
457
+ async function xe(e) {
458
+ if (y.value = e, h.value = !1, !n.interactive)
459
+ return;
460
+ const t = w.value.find((l) => {
461
+ const B = i(l);
462
+ return B && Math.abs(B.lat - e.lat) < 1e-6 && Math.abs(B.lng - e.lng) < 1e-6;
463
+ });
464
+ if (t) {
465
+ $(t);
466
+ return;
467
+ }
468
+ const a = await Me(e, r.value.pinnedLocationTitle);
469
+ O(a);
470
+ }
471
+ async function Me(e, t) {
472
+ if (!n.enableGeocoding)
473
+ return {
474
+ id: `pin-${e.lat}-${e.lng}`,
475
+ title: t,
476
+ lat: e.lat,
477
+ lng: e.lng
478
+ };
479
+ const a = await T.reverse(e, {
480
+ reverseEndpoint: n.reverseGeocodingEndpoint,
481
+ customFetch: n.customGeocodingFetch
482
+ });
483
+ return a ? {
484
+ id: a.id,
485
+ title: a.title || t,
486
+ address: a.address,
487
+ lat: a.lat,
488
+ lng: a.lng,
489
+ source: a.source
490
+ } : {
491
+ id: `pin-${e.lat}-${e.lng}`,
492
+ title: t,
493
+ lat: e.lat,
494
+ lng: e.lng
495
+ };
496
+ }
497
+ async function Z() {
498
+ if (b.isTracking.value && h.value) {
499
+ b.stopTracking(), h.value = !1;
500
+ return;
501
+ }
502
+ if (g.value) {
503
+ y.value = g.value, h.value = !0, p("track-user", g.value), !b.isTracking.value && !z.value && b.startTracking();
504
+ return;
505
+ }
506
+ const e = await b.locate();
507
+ e && (y.value = e, h.value = !0, p("track-user", e), b.startTracking());
508
+ }
509
+ return (e, t) => (d(), m("div", Oe, [
510
+ ue.value ? (d(), m("div", {
511
+ key: 0,
512
+ class: te(["location-finder__toolbar", { "location-finder__toolbar--actions-only": !n.showSearch }])
513
+ }, [
514
+ n.showSearch ? (d(), ae(Ne, {
515
+ key: 0,
516
+ modelValue: R.value,
517
+ "onUpdate:modelValue": t[0] || (t[0] = (a) => R.value = a),
518
+ class: "location-finder__search",
519
+ label: r.value.searchLabel,
520
+ placeholder: r.value.searchPlaceholder,
521
+ options: pe.value,
522
+ disabled: c.disabled,
523
+ "onUpdate:selection": Te
524
+ }, null, 8, ["modelValue", "label", "placeholder", "options", "disabled"])) : _("", !0),
525
+ s("div", qe, [
526
+ c.trackUser && n.showTrackButton ? (d(), m("button", {
527
+ key: 0,
528
+ type: "button",
529
+ class: "btn btn-outline-primary btn-sm location-finder__locate",
530
+ disabled: c.disabled || E(b).pending.value,
531
+ "data-testid": "location-finder-locate",
532
+ onClick: Z
533
+ }, f(me.value), 9, ze)) : _("", !0)
534
+ ])
535
+ ], 2)) : _("", !0),
536
+ Q.value ? (d(), m("p", Ie, f(Q.value), 1)) : _("", !0),
537
+ s("div", {
538
+ class: te(["location-finder__layout", {
539
+ "location-finder__layout--with-summary": H.value,
540
+ "location-finder__layout--full-width": !W.value
541
+ }])
542
+ }, [
543
+ s("div", Qe, [
544
+ Pe(Ue, {
545
+ class: "location-finder__map",
546
+ center: be.value,
547
+ markers: he.value,
548
+ "model-value": A.value,
549
+ "user-location": g.value,
550
+ "user-location-label": r.value.userLocationLabel,
551
+ "selected-location-label": fe.value,
552
+ "route-coordinates": E(L).routeCoordinates.value,
553
+ "route-color": c.routeColor,
554
+ "route-weight": c.routeWeight,
555
+ "selection-radius": c.selectionRadius,
556
+ "selection-radius-center": G.value,
557
+ "selection-radius-color": c.selectionRadiusColor,
558
+ "selection-radius-fill-color": c.selectionRadiusFillColor,
559
+ "map-style": c.mapStyle,
560
+ "tile-layer-url": c.tileLayerUrl,
561
+ "tile-layer-attribution": c.tileLayerAttribution,
562
+ height: c.mapHeight,
563
+ interactive: c.interactive,
564
+ disabled: c.disabled,
565
+ "helper-text": r.value.mapHelperText,
566
+ "onUpdate:modelValue": xe,
567
+ onMarkerClick: we
568
+ }, null, 8, ["center", "markers", "model-value", "user-location", "user-location-label", "selected-location-label", "route-coordinates", "route-color", "route-weight", "selection-radius", "selection-radius-center", "selection-radius-color", "selection-radius-fill-color", "map-style", "tile-layer-url", "tile-layer-attribution", "height", "interactive", "disabled", "helper-text"]),
569
+ n.showLegend ? (d(), m("div", {
570
+ key: 0,
571
+ class: "location-finder__legend",
572
+ "data-testid": "location-finder-legend",
573
+ "aria-label": r.value.legendAriaLabel
574
+ }, [
575
+ s("span", Ke, [
576
+ t[2] || (t[2] = s("span", { class: "location-finder__legend-swatch location-finder__legend-swatch--list" }, null, -1)),
577
+ U(" " + f(r.value.legendLocations), 1)
578
+ ]),
579
+ s("span", Ye, [
580
+ t[3] || (t[3] = s("span", { class: "location-finder__legend-swatch location-finder__legend-swatch--selected" }, null, -1)),
581
+ U(" " + f(r.value.legendSelected), 1)
582
+ ]),
583
+ s("span", Je, [
584
+ t[4] || (t[4] = s("span", { class: "location-finder__legend-swatch location-finder__legend-swatch--search" }, null, -1)),
585
+ U(" " + f(r.value.legendSearchResult), 1)
586
+ ]),
587
+ s("span", Xe, [
588
+ t[5] || (t[5] = s("span", { class: "location-finder__legend-swatch location-finder__legend-swatch--user" }, null, -1)),
589
+ U(" " + f(r.value.userLocationLabel), 1)
590
+ ])
591
+ ], 8, We)) : _("", !0)
592
+ ]),
593
+ W.value ? (d(), m("aside", Ze, [
594
+ n.showSidebar ? (d(), ae(Ae, {
595
+ key: 0,
596
+ modelValue: k.value,
597
+ "onUpdate:modelValue": t[1] || (t[1] = (a) => k.value = a),
598
+ class: "location-finder__results",
599
+ locations: w.value,
600
+ label: r.value.resultsLabel,
601
+ "empty-text": r.value.emptyText,
602
+ onSelect: ke
603
+ }, null, 8, ["modelValue", "locations", "label", "empty-text"])) : _("", !0),
604
+ H.value ? (d(), m("div", et, [
605
+ s("p", tt, f(r.value.directionsTitle), 1),
606
+ E(L).pending.value ? (d(), m("p", at, f(r.value.loadingRoute), 1)) : E(L).hasRoute.value ? (d(), m(ne, { key: 1 }, [
607
+ s("div", nt, [
608
+ s("div", null, [
609
+ s("p", lt, f(r.value.distanceLabel), 1),
610
+ s("strong", ot, f(ce.value), 1)
611
+ ]),
612
+ s("div", null, [
613
+ s("p", it, f(r.value.durationLabel), 1),
614
+ s("strong", rt, f(de.value), 1)
615
+ ])
616
+ ]),
617
+ c.showDirectionsSteps && E(L).steps.value.length ? (d(), m("ol", st, [
618
+ (d(!0), m(ne, null, Ve(E(L).steps.value.slice(0, 5), (a, l) => (d(), m("li", {
619
+ key: `${a.instruction}-${l}`
620
+ }, [
621
+ s("span", null, f(a.instruction), 1),
622
+ a.name ? (d(), m("small", ut, f(a.name), 1)) : _("", !0)
623
+ ]))), 128))
624
+ ])) : _("", !0)
625
+ ], 64)) : (d(), m("p", ct, f(r.value.directionsEmptyText), 1))
626
+ ])) : _("", !0)
627
+ ])) : _("", !0)
628
+ ], 2)
629
+ ]));
630
+ }
631
+ });
632
+ export {
633
+ St as default
634
+ };
@@ -0,0 +1,5 @@
1
+ import o from "./location-finder.vue.js";
2
+ /* empty css */
3
+ export {
4
+ o as default
5
+ };