ablok-components 0.3.85 → 0.3.86

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.
@@ -1,4 +1,4 @@
1
- import { defineComponent as q, shallowRef as G, ref as C, onMounted as H, markRaw as m, watch as S, computed as f, nextTick as J, openBlock as u, createElementBlock as k, renderSlot as K, toDisplayString as w, createCommentVNode as y, createElementVNode as Q, normalizeStyle as X, normalizeClass as ee, createBlock as d, resolveDynamicComponent as p, withCtx as h, Fragment as te, renderList as ae, createTextVNode as U } from "vue";
1
+ import { defineComponent as q, shallowRef as G, ref as C, onMounted as H, markRaw as m, watch as S, computed as y, nextTick as J, openBlock as i, createElementBlock as k, renderSlot as K, toDisplayString as w, createCommentVNode as f, createElementVNode as Q, normalizeStyle as X, normalizeClass as ee, createBlock as d, resolveDynamicComponent as p, withCtx as h, Fragment as te, renderList as ae, createTextVNode as U } from "vue";
2
2
  /* empty css */
3
3
  const le = { class: "base-map" }, ne = {
4
4
  key: 0,
@@ -149,29 +149,29 @@ const le = { class: "base-map" }, ne = {
149
149
  url: "https://{s}.basemaps.cartocdn.com/rastertiles/voyager_nolabels/{z}/{x}/{y}{r}.png",
150
150
  attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors &copy; <a href="https://carto.com/attributions">CARTO</a>'
151
151
  }
152
- }, a = n, c = $, s = G(null), L = C(null), M = C(null), z = C(a.zoom), r = C(o(a.modelValue));
152
+ }, a = n, s = $, u = G(null), L = C(null), z = C(null), R = C(a.zoom), r = C(o(a.modelValue));
153
153
  H(async () => {
154
154
  if (typeof window > "u")
155
155
  return;
156
156
  const [e, t] = await Promise.all([
157
157
  import("@vue-leaflet/vue-leaflet"),
158
158
  import("leaflet")
159
- ]), l = e.default ?? e, i = t.default ?? t;
160
- s.value = m({
161
- LCircle: m(l.LCircle),
162
- LMap: m(l.LMap),
163
- LMarker: m(l.LMarker),
164
- LPopup: m(l.LPopup),
165
- LPolyline: m(l.LPolyline),
166
- LTileLayer: m(l.LTileLayer)
159
+ ]);
160
+ u.value = m({
161
+ LCircle: m(e.LCircle),
162
+ LMap: m(e.LMap),
163
+ LMarker: m(e.LMarker),
164
+ LPopup: m(e.LPopup),
165
+ LPolyline: m(e.LPolyline),
166
+ LTileLayer: m(e.LTileLayer)
167
167
  }), L.value = {
168
- list: v("list", i.divIcon),
169
- selected: v("selected", i.divIcon),
170
- search: v("search", i.divIcon),
171
- user: v("user", i.divIcon)
168
+ list: v("list", t.divIcon),
169
+ selected: v("selected", t.divIcon),
170
+ search: v("search", t.divIcon),
171
+ user: v("user", t.divIcon)
172
172
  };
173
173
  }), S(() => a.zoom, (e) => {
174
- z.value = e;
174
+ R.value = e;
175
175
  }), S(() => a.modelValue, (e) => {
176
176
  r.value = o(e);
177
177
  }), S(() => a.center, (e) => {
@@ -194,7 +194,7 @@ const le = { class: "base-map" }, ne = {
194
194
  },
195
195
  { flush: "post" }
196
196
  );
197
- const b = f(() => o(a.userLocation)), R = f(() => o(a.selectionRadiusCenter) || r.value), B = f(() => {
197
+ const b = y(() => o(a.userLocation)), M = y(() => o(a.selectionRadiusCenter) || r.value), B = y(() => {
198
198
  const e = (a.markers || []).map((t) => {
199
199
  const l = o(t);
200
200
  return l ? {
@@ -209,15 +209,15 @@ const le = { class: "base-map" }, ne = {
209
209
  type: "search",
210
210
  ...r.value
211
211
  }), e;
212
- }), T = f(() => (a.routeCoordinates || []).map((e) => W(e)).filter((e) => !!e)), E = f(() => {
212
+ }), T = y(() => (a.routeCoordinates || []).map((e) => W(e)).filter((e) => !!e)), E = y(() => {
213
213
  const e = o(a.center) || r.value || o(a.markers[0]) || N;
214
214
  return [e.lat, e.lng];
215
- }), I = f(() => {
215
+ }), I = y(() => {
216
216
  if (a.tileLayerUrl.trim())
217
217
  return a.tileLayerUrl;
218
218
  const e = a.mapStyle === "custom" ? "streets" : a.mapStyle;
219
219
  return x[e].url;
220
- }), j = f(() => {
220
+ }), j = y(() => {
221
221
  if (a.tileLayerAttribution.trim())
222
222
  return a.tileLayerAttribution;
223
223
  const e = a.mapStyle === "custom" ? "streets" : a.mapStyle;
@@ -247,31 +247,31 @@ const le = { class: "base-map" }, ne = {
247
247
  }
248
248
  function W(e) {
249
249
  if (Array.isArray(e)) {
250
- const l = Number(e[0]), i = Number(e[1]);
251
- return Number.isFinite(l) && Number.isFinite(i) ? [l, i] : null;
250
+ const l = Number(e[0]), c = Number(e[1]);
251
+ return Number.isFinite(l) && Number.isFinite(c) ? [l, c] : null;
252
252
  }
253
253
  const t = o(e);
254
254
  return t ? [t.lat, t.lng] : null;
255
255
  }
256
256
  function P(e, t) {
257
- const l = o(e), i = o(t);
258
- return !l || !i ? !1 : Math.abs(l.lat - i.lat) < 1e-6 && Math.abs(l.lng - i.lng) < 1e-6;
257
+ const l = o(e), c = o(t);
258
+ return !l || !c ? !1 : Math.abs(l.lat - c.lat) < 1e-6 && Math.abs(l.lng - c.lng) < 1e-6;
259
259
  }
260
260
  async function V() {
261
- await J(), M.value?.invalidateSize();
261
+ await J(), z.value?.invalidateSize();
262
262
  }
263
263
  function g(e) {
264
- M.value?.panTo([e.lat, e.lng]);
264
+ z.value?.panTo([e.lat, e.lng]);
265
265
  }
266
266
  function D(e) {
267
- M.value = e, g(o(a.center) || r.value || N), V();
267
+ z.value = e, g(o(a.center) || r.value || N), V();
268
268
  }
269
269
  function Z(e) {
270
- z.value = e, c("update:zoom", e);
270
+ R.value = e, s("update:zoom", e);
271
271
  }
272
272
  function Y(e) {
273
273
  const t = o(e);
274
- t && (g(t), c("update:center", t));
274
+ t && (g(t), s("update:center", t));
275
275
  }
276
276
  function _(e) {
277
277
  if (!a.interactive || a.disabled)
@@ -280,17 +280,17 @@ const le = { class: "base-map" }, ne = {
280
280
  lat: Number(e.latlng.lat.toFixed(6)),
281
281
  lng: Number(e.latlng.lng.toFixed(6))
282
282
  };
283
- r.value = t, g(t), c("update:modelValue", t), c("update:center", t), c("map-click", t);
283
+ r.value = t, g(t), s("update:modelValue", t), s("update:center", t), s("map-click", t);
284
284
  }
285
285
  function F(e) {
286
286
  r.value = {
287
287
  lat: Number(e.lat),
288
288
  lng: Number(e.lng)
289
- }, g(r.value), c("update:modelValue", r.value), c("update:center", r.value), c("marker-click", e);
289
+ }, g(r.value), s("update:modelValue", r.value), s("update:center", r.value), s("marker-click", e);
290
290
  }
291
- return (e, t) => (u(), k("div", le, [
291
+ return (e, t) => (i(), k("div", le, [
292
292
  K(e.$slots, "label", {}, () => [
293
- n.label ? (u(), k("label", ne, w(n.label), 1)) : y("", !0)
293
+ n.label ? (i(), k("label", ne, w(n.label), 1)) : f("", !0)
294
294
  ]),
295
295
  Q("div", {
296
296
  class: ee(["base-map__frame", {
@@ -300,11 +300,11 @@ const le = { class: "base-map" }, ne = {
300
300
  style: X({ height: n.height }),
301
301
  "data-testid": "base-map"
302
302
  }, [
303
- s.value ? (u(), d(p(s.value?.LMap), {
303
+ u.value ? (i(), d(p(u.value?.LMap), {
304
304
  key: 0,
305
305
  class: "base-map__canvas",
306
306
  "use-global-leaflet": !1,
307
- zoom: z.value,
307
+ zoom: R.value,
308
308
  center: E.value,
309
309
  onReady: D,
310
310
  onClick: _,
@@ -312,46 +312,46 @@ const le = { class: "base-map" }, ne = {
312
312
  "onUpdate:center": Y
313
313
  }, {
314
314
  default: h(() => [
315
- (u(), d(p(s.value.LTileLayer), {
315
+ (i(), d(p(u.value.LTileLayer), {
316
316
  url: I.value,
317
317
  attribution: j.value,
318
318
  "layer-type": "base",
319
319
  name: "OpenStreetMap"
320
320
  }, null, 8, ["url", "attribution"])),
321
- T.value.length > 1 ? (u(), d(p(s.value.LPolyline), {
321
+ T.value.length > 1 ? (i(), d(p(u.value.LPolyline), {
322
322
  key: 0,
323
323
  "lat-lngs": T.value,
324
324
  color: n.routeColor,
325
325
  weight: n.routeWeight
326
- }, null, 8, ["lat-lngs", "color", "weight"])) : y("", !0),
327
- R.value && n.selectionRadius > 0 ? (u(), d(p(s.value.LCircle), {
326
+ }, null, 8, ["lat-lngs", "color", "weight"])) : f("", !0),
327
+ M.value && n.selectionRadius > 0 ? (i(), d(p(u.value.LCircle), {
328
328
  key: 1,
329
- "lat-lng": [R.value.lat, R.value.lng],
329
+ "lat-lng": [M.value.lat, M.value.lng],
330
330
  radius: n.selectionRadius,
331
331
  color: n.selectionRadiusColor,
332
332
  "fill-color": n.selectionRadiusFillColor,
333
333
  "fill-opacity": n.selectionRadiusFillOpacity,
334
334
  opacity: n.selectionRadiusOpacity,
335
335
  weight: n.selectionRadiusStrokeWeight
336
- }, null, 8, ["lat-lng", "radius", "color", "fill-color", "fill-opacity", "opacity", "weight"])) : y("", !0),
337
- (u(!0), k(te, null, ae(B.value, (l, i) => (u(), d(p(s.value.LMarker), {
338
- key: l.id ?? `${l.lat}-${l.lng}-${i}`,
336
+ }, null, 8, ["lat-lng", "radius", "color", "fill-color", "fill-opacity", "opacity", "weight"])) : f("", !0),
337
+ (i(!0), k(te, null, ae(B.value, (l, c) => (i(), d(p(u.value.LMarker), {
338
+ key: l.id ?? `${l.lat}-${l.lng}-${c}`,
339
339
  "lat-lng": [l.lat, l.lng],
340
340
  icon: O(l.type),
341
341
  "z-index-offset": A(l.type),
342
342
  onClick: (oe) => F(l)
343
343
  }, {
344
344
  default: h(() => [
345
- l.label ? (u(), d(p(s.value.LPopup), { key: 0 }, {
345
+ l.label ? (i(), d(p(u.value.LPopup), { key: 0 }, {
346
346
  default: h(() => [
347
347
  U(w(l.label), 1)
348
348
  ]),
349
349
  _: 2
350
- }, 1024)) : y("", !0)
350
+ }, 1024)) : f("", !0)
351
351
  ]),
352
352
  _: 2
353
353
  }, 1032, ["lat-lng", "icon", "z-index-offset", "onClick"]))), 128)),
354
- b.value ? (u(), d(p(s.value.LMarker), {
354
+ b.value ? (i(), d(p(u.value.LMarker), {
355
355
  key: `user-${b.value.lat}-${b.value.lng}`,
356
356
  "lat-lng": [b.value.lat, b.value.lng],
357
357
  icon: O("user"),
@@ -364,7 +364,7 @@ const le = { class: "base-map" }, ne = {
364
364
  }))
365
365
  }, {
366
366
  default: h(() => [
367
- (u(), d(p(s.value.LPopup), null, {
367
+ (i(), d(p(u.value.LPopup), null, {
368
368
  default: h(() => [
369
369
  U(w(n.userLocationLabel), 1)
370
370
  ]),
@@ -372,12 +372,12 @@ const le = { class: "base-map" }, ne = {
372
372
  }))
373
373
  ]),
374
374
  _: 1
375
- }, 8, ["lat-lng", "icon", "z-index-offset"])) : y("", !0)
375
+ }, 8, ["lat-lng", "icon", "z-index-offset"])) : f("", !0)
376
376
  ]),
377
377
  _: 1
378
- }, 40, ["zoom", "center"])) : y("", !0)
378
+ }, 40, ["zoom", "center"])) : f("", !0)
379
379
  ], 6),
380
- n.interactive && n.helperText ? (u(), k("p", re, w(n.helperText), 1)) : y("", !0)
380
+ n.interactive && n.helperText ? (i(), k("p", re, w(n.helperText), 1)) : f("", !0)
381
381
  ]));
382
382
  }
383
383
  });
package/package.json CHANGED
@@ -1,7 +1,23 @@
1
1
  {
2
2
  "name": "ablok-components",
3
3
  "private": false,
4
- "version": "0.3.85",
4
+ "version": "0.3.86",
5
+ "scripts": {
6
+ "dev": "vite --host",
7
+ "story:dev": "histoire dev",
8
+ "story:build": "histoire build",
9
+ "story:preview": "histoire preview",
10
+ "build": "vue-tsc --noEmit --project tsconfig.build.json && vite build",
11
+ "build:watch": "vue-tsc --noEmit --watch --project tsconfig.build.json & vite build --watch",
12
+ "preview": "vite preview",
13
+ "build-lib-bak": "vite build && vue-tsc --emitDeclarationOnly && mv dist/src dist/types",
14
+ "build-lib": "vite build && vue-tsc --emitDeclarationOnly",
15
+ "release": "bash ./scripts/release.sh",
16
+ "postrelease": "bash ./scripts/publish.sh",
17
+ "test": "vitest run",
18
+ "test:watch": "vitest",
19
+ "test:ui": "vitest --ui"
20
+ },
5
21
  "dependencies": {
6
22
  "date-fns": "^3.0.0",
7
23
  "dompurify": "^3.3.1",
@@ -120,21 +136,5 @@
120
136
  "./package.json": "./package.json"
121
137
  },
122
138
  "types": "./dist/index.d.ts",
123
- "sideEffects": false,
124
- "scripts": {
125
- "dev": "vite --host",
126
- "story:dev": "histoire dev",
127
- "story:build": "histoire build",
128
- "story:preview": "histoire preview",
129
- "build": "vue-tsc --noEmit --project tsconfig.build.json && vite build",
130
- "build:watch": "vue-tsc --noEmit --watch --project tsconfig.build.json & vite build --watch",
131
- "preview": "vite preview",
132
- "build-lib-bak": "vite build && vue-tsc --emitDeclarationOnly && mv dist/src dist/types",
133
- "build-lib": "vite build && vue-tsc --emitDeclarationOnly",
134
- "release": "bash ./scripts/release.sh",
135
- "postrelease": "bash ./scripts/publish.sh",
136
- "test": "vitest run",
137
- "test:watch": "vitest",
138
- "test:ui": "vitest --ui"
139
- }
140
- }
139
+ "sideEffects": false
140
+ }