@nxgt/material-vue 0.20.0 → 0.21.0

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 (30) hide show
  1. package/README.md +81 -0
  2. package/dist/HoverCardTrigger-CftN4TfW.js +415 -0
  3. package/dist/{camera-D_lnXyR3.js → camera-Cfp_DpaN.js} +5 -5
  4. package/dist/{components-DPA7UcWP.js → components-Do7bPo_-.js} +11700 -12103
  5. package/dist/components.js +5 -4
  6. package/dist/lib/map/components/consts.d.ts +18 -0
  7. package/dist/lib/map/components/index.d.ts +7 -0
  8. package/dist/lib/map/components/location-field.vue.d.ts +27 -0
  9. package/dist/lib/map/components/location-form-field.vue.d.ts +7 -0
  10. package/dist/lib/map/components/map.vue.d.ts +26 -0
  11. package/dist/lib/map/components/partials/index.d.ts +7 -0
  12. package/dist/lib/map/components/partials/location-marker.vue.d.ts +22 -0
  13. package/dist/lib/map/components/partials/location-preview.vue.d.ts +18 -0
  14. package/dist/lib/map/components/partials/map-actions.vue.d.ts +10 -0
  15. package/dist/lib/map/components/partials/marker.vue.d.ts +32 -0
  16. package/dist/lib/map/index.d.ts +43 -0
  17. package/dist/lib/map/use-geolocation.d.ts +27 -0
  18. package/dist/main.js +8 -7
  19. package/dist/map.js +363 -0
  20. package/dist/material-vue.css +1 -1
  21. package/dist/{pdf-outline-sidebar-Dbt_M8u7.js → pdf-outline-sidebar-DhTW6mJ0.js} +1 -1
  22. package/dist/{pdf-page-nn1STQlN.js → pdf-page-D4x_NxiO.js} +1 -1
  23. package/dist/{pdf-page-list-BlEPfn18.js → pdf-page-list-DkhiXStw.js} +2 -2
  24. package/dist/{pdf-reader-DkuEvdE7.js → pdf-reader-CiAIsMnH.js} +25 -24
  25. package/dist/{pdf-sidebar-ClNK5Kh3.js → pdf-sidebar-1NktEcai.js} +2 -2
  26. package/dist/{pdf-thumbnail-sidebar-DT0B1gF-.js → pdf-thumbnail-sidebar-DFvXWs3_.js} +2 -2
  27. package/dist/{pdf-toolbar-DUSBLW6r.js → pdf-toolbar-mXnJfhUC.js} +50 -50
  28. package/dist/{stx-player-Djdz3NHi.js → stx-player-C6DZOTxh.js} +5 -5
  29. package/lib/map/map.css +9 -0
  30. package/package.json +25 -4
package/dist/map.js ADDED
@@ -0,0 +1,363 @@
1
+ import { t as e } from "./utils-Cy-ByIEo.js";
2
+ import { r as t, t as n } from "./icon-button-Ghucx7Ah.js";
3
+ import { a as r, c as i, d as a, f as o, i as s, n as c, o as l, r as u, s as d, t as f, u as p } from "./HoverCardTrigger-CftN4TfW.js";
4
+ import { computed as m, createBlock as h, createCommentVNode as g, createElementBlock as _, createElementVNode as v, createSlots as y, createTextVNode as b, createVNode as x, defineComponent as S, inject as C, isRef as w, mergeProps as T, normalizeClass as E, openBlock as D, ref as O, renderSlot as k, toDisplayString as A, unref as j, withCtx as M } from "vue";
5
+ import { useGeolocation as N } from "@vueuse/core";
6
+ import { MapPin as P } from "lucide-vue-next";
7
+ import { useField as F } from "vee-validate";
8
+ import { LControlZoom as I, LIcon as L, LMap as R, LMarker as z, LPopup as B, LTileLayer as V, LTooltip as H } from "@vue-leaflet/vue-leaflet";
9
+ //#region lib/map/components/consts.ts
10
+ var U = {
11
+ bottomleft: "leaflet-bottom leaflet-left",
12
+ bottomright: "leaflet-bottom leaflet-right",
13
+ topleft: "leaflet-top leaflet-left",
14
+ topright: "leaflet-top leaflet-right"
15
+ };
16
+ //#endregion
17
+ //#region lib/map/use-geolocation.ts
18
+ function W(e = {}) {
19
+ let { coords: t, locatedAt: n, error: r, resume: i, pause: a } = N({
20
+ enableHighAccuracy: e.enableHighAccuracy ?? !1,
21
+ timeout: e.timeout ?? 5e3,
22
+ maximumAge: e.maximumAge ?? 0,
23
+ immediate: e.immediate ?? !0
24
+ });
25
+ return {
26
+ coords: m(() => {
27
+ let { latitude: e, longitude: n } = t.value;
28
+ return Number.isNaN(e) || Number.isNaN(n) ? null : {
29
+ latitude: e,
30
+ longitude: n
31
+ };
32
+ }),
33
+ locatedAt: n,
34
+ error: r,
35
+ resume: i,
36
+ pause: a
37
+ };
38
+ }
39
+ //#endregion
40
+ //#region lib/map/components/map.vue
41
+ var G = /* @__PURE__ */ S({
42
+ __name: "map",
43
+ props: {
44
+ center: {},
45
+ zoom: { default: 13 },
46
+ zoomControl: {
47
+ type: Boolean,
48
+ default: !1
49
+ },
50
+ scrollWheelZoom: {
51
+ type: Boolean,
52
+ default: !1
53
+ },
54
+ class: { type: [
55
+ Boolean,
56
+ null,
57
+ String,
58
+ Object,
59
+ Array
60
+ ] }
61
+ },
62
+ setup(t) {
63
+ let n = t, { coords: r } = W(), i = m(() => n.center ?? [r.value?.latitude ?? 5.44087, r.value?.longitude ?? 10.06843]);
64
+ return (r, a) => (D(), h(j(R), {
65
+ center: i.value,
66
+ zoom: t.zoom,
67
+ "use-global-leaflet": !1,
68
+ options: {
69
+ zoomControl: t.zoomControl,
70
+ scrollWheelZoom: t.scrollWheelZoom
71
+ },
72
+ class: E(j(e)("size-full ring-1 ring-primary rounded", n.class))
73
+ }, {
74
+ default: M(() => [
75
+ x(j(V), {
76
+ url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
77
+ attribution: "© <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors",
78
+ "layer-type": "base"
79
+ }),
80
+ x(j(I), { position: "topleft" }),
81
+ k(r.$slots, "default")
82
+ ]),
83
+ _: 3
84
+ }, 8, [
85
+ "center",
86
+ "zoom",
87
+ "options",
88
+ "class"
89
+ ]));
90
+ }
91
+ }), K = /* @__PURE__ */ S({
92
+ __name: "marker",
93
+ props: {
94
+ position: {},
95
+ draggable: {
96
+ type: Boolean,
97
+ default: !1
98
+ },
99
+ reference: {
100
+ type: Boolean,
101
+ default: !1
102
+ }
103
+ },
104
+ emits: ["change"],
105
+ setup(e, { emit: t }) {
106
+ let n = t;
107
+ return (t, r) => (D(), h(j(z), {
108
+ "lat-lng": e.position,
109
+ draggable: e.draggable,
110
+ onMoveend: r[0] ||= (e) => n("change", e.target.getLatLng())
111
+ }, {
112
+ default: M(() => [
113
+ e.reference || t.$slots.icon ? (D(), h(j(L), {
114
+ key: 0,
115
+ "icon-anchor": [12, 24]
116
+ }, {
117
+ default: M(() => [k(t.$slots, "icon", {}, () => [x(j(P), {
118
+ class: "size-6 text-primary",
119
+ "aria-hidden": "true"
120
+ })])]),
121
+ _: 3
122
+ })) : g("", !0),
123
+ t.$slots.popup ? (D(), h(j(B), { key: 1 }, {
124
+ default: M(() => [k(t.$slots, "popup")]),
125
+ _: 3
126
+ })) : g("", !0),
127
+ t.$slots.tooltip ? (D(), h(j(H), { key: 2 }, {
128
+ default: M(() => [k(t.$slots, "tooltip")]),
129
+ _: 3
130
+ })) : g("", !0)
131
+ ]),
132
+ _: 3
133
+ }, 8, ["lat-lng", "draggable"]));
134
+ }
135
+ }), q = /* @__PURE__ */ S({
136
+ __name: "location-preview",
137
+ props: {
138
+ position: {},
139
+ name: {}
140
+ },
141
+ setup(e) {
142
+ let t = e;
143
+ return (r, i) => (D(), h(u, null, {
144
+ default: M(() => [x(f, { "as-child": "" }, {
145
+ default: M(() => [k(r.$slots, "default", {}, () => [x(n, {
146
+ name: "map",
147
+ "aria-label": t.name ?? "Preview location"
148
+ }, null, 8, ["aria-label"])])]),
149
+ _: 3
150
+ }), x(c, { class: "p-0 overflow-hidden w-72" }, {
151
+ default: M(() => [x(G, {
152
+ center: e.position,
153
+ zoom: 15,
154
+ class: "h-48 rounded-none ring-0"
155
+ }, {
156
+ default: M(() => [x(K, {
157
+ reference: "",
158
+ position: e.position
159
+ }, y({ _: 2 }, [t.name ? {
160
+ name: "tooltip",
161
+ fn: M(() => [b(A(t.name), 1)]),
162
+ key: "0"
163
+ } : void 0]), 1032, ["position"])]),
164
+ _: 1
165
+ }, 8, ["center"])]),
166
+ _: 1
167
+ })]),
168
+ _: 3
169
+ }));
170
+ }
171
+ }), J = /* @__PURE__ */ S({
172
+ __name: "location-field",
173
+ props: {
174
+ modelValue: {},
175
+ closeLabel: {},
176
+ dialogTitle: {},
177
+ mapClass: {},
178
+ readOnly: { type: Boolean },
179
+ label: {},
180
+ helperText: {},
181
+ error: { type: Boolean },
182
+ required: { type: Boolean },
183
+ disabled: { type: Boolean },
184
+ id: {},
185
+ name: {},
186
+ placeholder: {},
187
+ type: {},
188
+ class: { type: [
189
+ Boolean,
190
+ null,
191
+ String,
192
+ Object,
193
+ Array
194
+ ] }
195
+ },
196
+ emits: ["update:modelValue"],
197
+ setup(c, { emit: u }) {
198
+ let f = c, g = u, _ = O(!1), v = m(() => [f.modelValue?.[0] ?? 5.44087, f.modelValue?.[1] ?? 10.06843]), y = (e) => {
199
+ g("update:modelValue", [Number.parseFloat(e.lat.toFixed(7)), Number.parseFloat(e.lng.toFixed(7))]);
200
+ };
201
+ return (u, m) => (D(), h(o, T(f, {
202
+ "model-value": v.value.join(" - "),
203
+ readonly: ""
204
+ }), {
205
+ leading: M(() => [x(q, { position: v.value }, {
206
+ default: M(() => [k(u.$slots, "leading")]),
207
+ _: 3
208
+ }, 8, ["position"])]),
209
+ trailing: M(() => [x(a, {
210
+ open: _.value,
211
+ "onUpdate:open": m[1] ||= (e) => _.value = e
212
+ }, {
213
+ default: M(() => [x(s, { "as-child": "" }, {
214
+ default: M(() => [k(u.$slots, "trailing", {}, () => [x(n, {
215
+ name: "location-dot",
216
+ variant: "tonal",
217
+ "data-pw": `${f.name}-trailing`,
218
+ "aria-label": c.dialogTitle ?? "Choose a location"
219
+ }, null, 8, ["data-pw", "aria-label"])])]),
220
+ _: 3
221
+ }), x(i, null, {
222
+ default: M(() => [
223
+ x(p, {
224
+ variant: "tonal",
225
+ color: "primary"
226
+ }),
227
+ x(r, null, {
228
+ default: M(() => [b(A(c.dialogTitle ?? "Choose a location"), 1)]),
229
+ _: 1
230
+ }),
231
+ x(d, { hidden: "" }),
232
+ x(G, {
233
+ center: v.value,
234
+ class: E(j(e)(c.mapClass))
235
+ }, {
236
+ default: M(() => [x(K, {
237
+ position: v.value,
238
+ draggable: !c.disabled && !c.readOnly,
239
+ reference: !c.disabled && !c.readOnly,
240
+ onChange: y
241
+ }, null, 8, [
242
+ "position",
243
+ "draggable",
244
+ "reference"
245
+ ])]),
246
+ _: 1
247
+ }, 8, ["center", "class"]),
248
+ x(l, null, {
249
+ default: M(() => [x(t, { onClick: m[0] ||= (e) => _.value = !1 }, {
250
+ default: M(() => [b(A(c.closeLabel ?? "OK"), 1)]),
251
+ _: 1
252
+ })]),
253
+ _: 1
254
+ })
255
+ ]),
256
+ _: 1
257
+ })]),
258
+ _: 3
259
+ }, 8, ["open"])]),
260
+ _: 3
261
+ }, 16, ["model-value"]));
262
+ }
263
+ }), Y = /* @__PURE__ */ S({
264
+ __name: "location-form-field",
265
+ props: {
266
+ name: {},
267
+ closeLabel: {},
268
+ dialogTitle: {},
269
+ mapClass: {},
270
+ readOnly: { type: Boolean },
271
+ label: {},
272
+ helperText: {},
273
+ required: { type: Boolean },
274
+ disabled: { type: Boolean },
275
+ id: {},
276
+ placeholder: {},
277
+ type: {},
278
+ class: { type: [
279
+ Boolean,
280
+ null,
281
+ String,
282
+ Object,
283
+ Array
284
+ ] }
285
+ },
286
+ setup(e) {
287
+ let t = e, { value: n, errorMessage: r, meta: i } = F(() => t.name), a = m(() => !!r.value || i.touched && !i.valid);
288
+ return (i, o) => (D(), h(J, T(t, {
289
+ modelValue: j(n),
290
+ "onUpdate:modelValue": o[0] ||= (e) => w(n) ? n.value = e : null,
291
+ name: e.name,
292
+ error: a.value,
293
+ "helper-text": j(r) ?? e.helperText
294
+ }), null, 16, [
295
+ "modelValue",
296
+ "name",
297
+ "error",
298
+ "helper-text"
299
+ ]));
300
+ }
301
+ }), X = /* @__PURE__ */ S({
302
+ __name: "location-marker",
303
+ emits: ["change"],
304
+ setup(e, { emit: t }) {
305
+ let { coords: n } = W(), r = t;
306
+ return (e, t) => j(n) ? (D(), h(K, T({
307
+ key: 0,
308
+ reference: "",
309
+ position: [j(n).latitude, j(n).longitude]
310
+ }, e.$attrs, { onChange: t[0] ||= (e) => r("change", e) }), y({ _: 2 }, [
311
+ e.$slots.icon ? {
312
+ name: "icon",
313
+ fn: M(() => [k(e.$slots, "icon")]),
314
+ key: "0"
315
+ } : void 0,
316
+ e.$slots.popup ? {
317
+ name: "popup",
318
+ fn: M(() => [k(e.$slots, "popup")]),
319
+ key: "1"
320
+ } : void 0,
321
+ e.$slots.tooltip ? {
322
+ name: "tooltip",
323
+ fn: M(() => [k(e.$slots, "tooltip")]),
324
+ key: "2"
325
+ } : void 0
326
+ ]), 1040, ["position"])) : g("", !0);
327
+ }
328
+ }), Z = { class: "leaflet-control leaflet-bar border-primary flex flex-col gap-1" }, Q = /* @__PURE__ */ S({
329
+ __name: "map-actions",
330
+ props: {
331
+ position: { default: "topleft" },
332
+ class: {}
333
+ },
334
+ setup(t) {
335
+ let r = t, i = C("map", void 0), { coords: a } = W(), o = (e) => {
336
+ let t = i?.value;
337
+ t && t.setZoom(t.getZoom() + e);
338
+ }, s = () => {
339
+ let e = i?.value;
340
+ !e || !a.value || e.panTo([a.value.latitude, a.value.longitude]);
341
+ };
342
+ return (i, c) => (D(), _("div", { class: E(j(e)(j(U)[t.position], r.class)) }, [v("div", Z, [
343
+ x(n, {
344
+ name: "plus",
345
+ "aria-label": "Zoom in",
346
+ onClick: c[0] ||= (e) => o(1)
347
+ }),
348
+ x(n, {
349
+ name: "minus",
350
+ "aria-label": "Zoom out",
351
+ onClick: c[1] ||= (e) => o(-1)
352
+ }),
353
+ j(a) ? (D(), h(n, {
354
+ key: 0,
355
+ name: "location-crosshairs",
356
+ "aria-label": "My position",
357
+ onClick: s
358
+ })) : g("", !0)
359
+ ])], 2));
360
+ }
361
+ });
362
+ //#endregion
363
+ export { J as LocationField, Y as LocationFormField, X as LocationMarker, q as LocationPreview, G as Map, G as MapComponent, Q as MapActions, K as Marker, U as POSITION_CLASSES, W as useGeolocation };