@stachelock/ui 0.6.15 → 0.6.17
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.
- package/dist/NavigationItem.vue_vue_type_script_setup_true_lang-a6F3LQ_P.js +56 -0
- package/dist/ScreenSizeSelector.vue_vue_type_script_setup_true_lang-FINxrVod.js +183 -0
- package/dist/UiMapAll.vue_vue_type_script_setup_true_lang-DKcK0HmT.js +501 -0
- package/dist/charts/BaseChart.js +76 -56
- package/dist/charts/chartTheme.js +199 -60
- package/dist/charts/index.js +30 -27
- package/dist/components/Button.js +109 -89
- package/dist/composables/index.js +41 -32
- package/dist/composables/useMap.js +1 -1
- package/dist/index.js +2612 -1757
- package/dist/layouts/DashboardLayout.js +218 -2
- package/dist/layouts/NavigationItem.js +1 -1
- package/dist/maps/UiMap.js +167 -150
- package/dist/maps/UiMapAll.js +1 -1
- package/dist/maps/UiMapMarker.js +227 -118
- package/dist/maps/index.js +1 -1
- package/dist/src/components/SecureHandoffCard.d.ts +88 -0
- package/dist/src/components/UiProgressBar.d.ts +1 -1
- package/dist/src/components/UiRadialProgressBar.d.ts +1 -1
- package/dist/src/components/charts/chartTheme.d.ts +53 -0
- package/dist/src/components/formatters/DateFormatter.d.ts +1 -1
- package/dist/src/components/index.d.ts +2 -0
- package/dist/src/components/inputs/DatepickerInput.d.ts +3 -3
- package/dist/src/components/layouts/DashboardLayout.d.ts +80 -18
- package/dist/src/components/layouts/ShowcaseCard.d.ts +1 -0
- package/dist/src/components/layouts/UiDetailPanel.d.ts +65 -0
- package/dist/src/components/layouts/UiSplitPanelLayout.d.ts +96 -0
- package/dist/src/components/layouts/index.d.ts +2 -0
- package/dist/src/components/maps/UiMap.d.ts +13 -2
- package/dist/src/components/maps/UiMapAll.d.ts +13 -0
- package/dist/src/components/maps/UiMapMarker.d.ts +47 -10
- package/dist/src/components/modals/UiSlideOver.d.ts +104 -0
- package/dist/src/components/modals/index.d.ts +1 -0
- package/dist/src/components/palettes/UiCommandPalette.d.ts +166 -0
- package/dist/src/components/palettes/index.d.ts +1 -0
- package/dist/src/components/wrappers/BreakpointWrapper.d.ts +36 -0
- package/dist/src/components/wrappers/ResponsivePreviewWrapper.d.ts +85 -0
- package/dist/src/components/wrappers/ScreenSizeSelector.d.ts +74 -0
- package/dist/src/components/wrappers/index.d.ts +3 -0
- package/dist/src/composables/index.d.ts +1 -0
- package/dist/src/composables/useScreenSize.d.ts +131 -0
- package/dist/src/types/index.d.ts +1 -0
- package/dist/src/types/layouts.d.ts +42 -0
- package/dist/src/types/palettes.d.ts +134 -0
- package/dist/src/views/components/index.d.ts +2 -0
- package/dist/src/views/index.d.ts +5 -1
- package/dist/src/views/layouts/index.d.ts +3 -1
- package/dist/style.css +1 -1
- package/dist/useMap-CM59TKX6.js +318 -0
- package/dist/useScreenSize-Kr6cn5Zr.js +104 -0
- package/dist/wrappers/index.js +10 -6
- package/package.json +1 -1
- package/dist/DashboardLayout.vue_vue_type_script_setup_true_lang-BAx4gKqh.js +0 -239
- package/dist/NavigationItem.vue_vue_type_script_setup_true_lang-C8aX-84Q.js +0 -56
- package/dist/UiMapAll.vue_vue_type_script_setup_true_lang-11yT7mTH.js +0 -471
- package/dist/useMap-BGg0H582.js +0 -297
package/dist/useMap-BGg0H582.js
DELETED
|
@@ -1,297 +0,0 @@
|
|
|
1
|
-
import { inject as Q, ref as g, computed as k, watch as ee } from "vue";
|
|
2
|
-
import { Loader as te } from "@googlemaps/js-api-loader";
|
|
3
|
-
import { a as P, b as j, g as le } from "./mapThemes-DFE9fZm3.js";
|
|
4
|
-
import { useTheme as ne } from "./composables/useTheme.js";
|
|
5
|
-
function ie(l) {
|
|
6
|
-
if (l._geoloc && typeof l._geoloc == "object") {
|
|
7
|
-
const n = l._geoloc;
|
|
8
|
-
if (typeof n.lat == "number" && typeof n.lng == "number")
|
|
9
|
-
return { lat: n.lat, lng: n.lng };
|
|
10
|
-
}
|
|
11
|
-
if (l.latLng && typeof l.latLng == "object") {
|
|
12
|
-
const n = l.latLng;
|
|
13
|
-
if (typeof n.lat == "number" && typeof n.lng == "number")
|
|
14
|
-
return { lat: n.lat, lng: n.lng };
|
|
15
|
-
}
|
|
16
|
-
if (l.location && typeof l.location == "object") {
|
|
17
|
-
const n = l.location;
|
|
18
|
-
if (typeof n.lat == "number" && typeof n.lng == "number")
|
|
19
|
-
return { lat: n.lat, lng: n.lng };
|
|
20
|
-
}
|
|
21
|
-
if (l.coordinates && typeof l.coordinates == "object") {
|
|
22
|
-
const n = l.coordinates;
|
|
23
|
-
if (typeof n.lat == "number" && typeof n.lng == "number")
|
|
24
|
-
return { lat: n.lat, lng: n.lng };
|
|
25
|
-
}
|
|
26
|
-
if (typeof l.lat == "number" && typeof l.lng == "number")
|
|
27
|
-
return { lat: l.lat, lng: l.lng };
|
|
28
|
-
if (typeof l.latitude == "number" && typeof l.longitude == "number")
|
|
29
|
-
return { lat: l.latitude, lng: l.longitude };
|
|
30
|
-
if (l.address && typeof l.address == "object") {
|
|
31
|
-
const n = l.address;
|
|
32
|
-
if (n.geocode && typeof n.geocode.lat == "number" && typeof n.geocode.lng == "number")
|
|
33
|
-
return { lat: n.geocode.lat, lng: n.geocode.lng };
|
|
34
|
-
}
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
function oe(l, n) {
|
|
38
|
-
if (l < -90 || l > 90 || n < -180 || n > 180 || l === 0 && n === 0)
|
|
39
|
-
return !1;
|
|
40
|
-
const d = 1e-3;
|
|
41
|
-
return !(Math.abs(l) < d && Math.abs(n) < d);
|
|
42
|
-
}
|
|
43
|
-
const ge = { lat: 39.8283, lng: -98.5795 }, ce = { lat: 0, lng: 0 };
|
|
44
|
-
let _ = null, p = null;
|
|
45
|
-
function fe(l = {}) {
|
|
46
|
-
const n = Q("googleMaps", {}), { isDark: d } = ne(), r = {
|
|
47
|
-
apiKey: l.apiKey || n?.apiKey || "",
|
|
48
|
-
version: l.version || n?.version || "weekly",
|
|
49
|
-
libraries: l.libraries || n?.libraries || ["places", "maps", "geometry", "marker"],
|
|
50
|
-
theme: l.theme || "ultraLight",
|
|
51
|
-
autoTheme: l.autoTheme ?? !0,
|
|
52
|
-
lightTheme: l.lightTheme || "ultraLight",
|
|
53
|
-
darkTheme: l.darkTheme || "dark",
|
|
54
|
-
customStyles: l.customStyles,
|
|
55
|
-
clustering: {
|
|
56
|
-
enabled: l.clustering?.enabled ?? !1,
|
|
57
|
-
minimumClusterSize: l.clustering?.minimumClusterSize ?? 2,
|
|
58
|
-
maxZoom: l.clustering?.maxZoom ?? 15,
|
|
59
|
-
gridSize: l.clustering?.gridSize ?? 60,
|
|
60
|
-
radius: l.clustering?.radius ?? 60,
|
|
61
|
-
virtualRendering: l.clustering?.virtualRendering ?? !0,
|
|
62
|
-
maxMarkersWithoutClustering: l.clustering?.maxMarkersWithoutClustering ?? 100
|
|
63
|
-
},
|
|
64
|
-
defaultCenter: l.defaultCenter || n?.defaultCenter || { lat: 39.8283, lng: -98.5795 },
|
|
65
|
-
defaultZoom: l.defaultZoom ?? n?.defaultZoom ?? 4
|
|
66
|
-
}, v = g(!1), b = g(!1), h = g(null), z = g(null), a = g(null), S = g(r.theme), w = g(r.defaultCenter), M = g(r.defaultZoom), T = g(null), u = g([]), C = g([]), K = k(() => ({
|
|
67
|
-
apiLoading: v.value,
|
|
68
|
-
apiReady: b.value,
|
|
69
|
-
apiError: h.value,
|
|
70
|
-
dataLoading: !1,
|
|
71
|
-
// Can be extended
|
|
72
|
-
dataReady: u.value.length > 0,
|
|
73
|
-
dataError: null
|
|
74
|
-
})), W = k(() => r.customStyles ? r.customStyles : r.autoTheme ? P(d.value, r.lightTheme, r.darkTheme) : j(S.value)), I = k(() => T.value ? u.value.filter((e) => {
|
|
75
|
-
const { lat: o, lng: t } = e.position, s = T.value;
|
|
76
|
-
return o >= s.south && o <= s.north && t >= s.west && t <= s.east;
|
|
77
|
-
}) : u.value), R = k(() => !r.clustering.enabled || M.value > r.clustering.maxZoom ? !1 : u.value.length > r.clustering.maxMarkersWithoutClustering);
|
|
78
|
-
async function G() {
|
|
79
|
-
if (b.value && p)
|
|
80
|
-
return p;
|
|
81
|
-
if (!r.apiKey) {
|
|
82
|
-
const e = "Google Maps API key is required";
|
|
83
|
-
throw h.value = e, new Error(e);
|
|
84
|
-
}
|
|
85
|
-
v.value = !0, h.value = null;
|
|
86
|
-
try {
|
|
87
|
-
return _ || (_ = new te({
|
|
88
|
-
apiKey: r.apiKey,
|
|
89
|
-
version: r.version,
|
|
90
|
-
id: "__googleMapsScriptId",
|
|
91
|
-
libraries: r.libraries
|
|
92
|
-
})), p || (p = _.load()), z.value = p, await p, b.value = !0, v.value = !1, console.log("[useMap] Google Maps API loaded successfully"), p;
|
|
93
|
-
} catch (e) {
|
|
94
|
-
const o = e instanceof Error ? e.message : "Failed to load Google Maps API";
|
|
95
|
-
throw h.value = o, v.value = !1, console.error("[useMap] Google Maps API loading failed:", e), e;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
function N(e) {
|
|
99
|
-
a.value = e;
|
|
100
|
-
const o = e.getCenter();
|
|
101
|
-
o && (w.value = { lat: o.lat(), lng: o.lng() });
|
|
102
|
-
const t = e.getZoom();
|
|
103
|
-
t !== void 0 && (M.value = t), E();
|
|
104
|
-
}
|
|
105
|
-
function E() {
|
|
106
|
-
if (!a.value) return;
|
|
107
|
-
const e = a.value.getBounds();
|
|
108
|
-
if (e) {
|
|
109
|
-
const o = e.getNorthEast(), t = e.getSouthWest();
|
|
110
|
-
T.value = {
|
|
111
|
-
north: o.lat(),
|
|
112
|
-
south: t.lat(),
|
|
113
|
-
east: o.lng(),
|
|
114
|
-
west: t.lng()
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
function $(e) {
|
|
119
|
-
if (S.value = e, a.value && !r.autoTheme) {
|
|
120
|
-
const o = j(e);
|
|
121
|
-
a.value.setOptions({ styles: o });
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
function B(e) {
|
|
125
|
-
a.value && (a.value.panTo(e), w.value = e);
|
|
126
|
-
}
|
|
127
|
-
function D(e) {
|
|
128
|
-
a.value && (a.value.setZoom(e), M.value = e);
|
|
129
|
-
}
|
|
130
|
-
function F(e, o) {
|
|
131
|
-
if (!a.value) return;
|
|
132
|
-
const t = new google.maps.LatLngBounds(
|
|
133
|
-
{ lat: e.south, lng: e.west },
|
|
134
|
-
{ lat: e.north, lng: e.east }
|
|
135
|
-
);
|
|
136
|
-
a.value.fitBounds(t, o), E();
|
|
137
|
-
}
|
|
138
|
-
function O(e = 50) {
|
|
139
|
-
if (!a.value || u.value.length === 0) return;
|
|
140
|
-
const o = new google.maps.LatLngBounds();
|
|
141
|
-
u.value.forEach((t) => {
|
|
142
|
-
o.extend(t.position);
|
|
143
|
-
}), a.value.fitBounds(o, e), E();
|
|
144
|
-
}
|
|
145
|
-
function U(e) {
|
|
146
|
-
u.value = [...u.value, e];
|
|
147
|
-
}
|
|
148
|
-
function q(e) {
|
|
149
|
-
u.value = u.value.filter((o) => o.id !== e);
|
|
150
|
-
}
|
|
151
|
-
function V(e, o) {
|
|
152
|
-
u.value = u.value.map(
|
|
153
|
-
(t) => t.id === e ? { ...t, ...o } : t
|
|
154
|
-
);
|
|
155
|
-
}
|
|
156
|
-
function X() {
|
|
157
|
-
u.value = [], C.value = [];
|
|
158
|
-
}
|
|
159
|
-
function Y(e) {
|
|
160
|
-
u.value = e;
|
|
161
|
-
}
|
|
162
|
-
function H(e, o) {
|
|
163
|
-
if (!r.clustering.enabled || !R.value) {
|
|
164
|
-
C.value = [];
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
const t = r.clustering.gridSize / Math.pow(2, e), s = /* @__PURE__ */ new Map();
|
|
168
|
-
(o ? u.value.filter((i) => {
|
|
169
|
-
const { lat: f, lng: m } = i.position;
|
|
170
|
-
return f >= o.south && f <= o.north && m >= o.west && m <= o.east;
|
|
171
|
-
}) : u.value).forEach((i) => {
|
|
172
|
-
const f = Math.floor(i.position.lng / t), m = Math.floor(i.position.lat / t), y = `${f}_${m}`;
|
|
173
|
-
s.has(y) || s.set(y, []), s.get(y).push(i);
|
|
174
|
-
});
|
|
175
|
-
const L = [];
|
|
176
|
-
s.forEach((i, f) => {
|
|
177
|
-
if (i.length >= r.clustering.minimumClusterSize) {
|
|
178
|
-
const m = i.reduce((x, Z) => x + Z.position.lat, 0), y = i.reduce((x, Z) => x + Z.position.lng, 0);
|
|
179
|
-
L.push({
|
|
180
|
-
id: `cluster_${f}`,
|
|
181
|
-
position: {
|
|
182
|
-
lat: m / i.length,
|
|
183
|
-
lng: y / i.length
|
|
184
|
-
},
|
|
185
|
-
size: i.length,
|
|
186
|
-
markers: i
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
}), C.value = L;
|
|
190
|
-
}
|
|
191
|
-
function A(e) {
|
|
192
|
-
const o = [
|
|
193
|
-
// _geoloc (Algolia format)
|
|
194
|
-
() => {
|
|
195
|
-
const t = e._geoloc;
|
|
196
|
-
return t && typeof t.lat == "number" && typeof t.lng == "number" ? { lat: t.lat, lng: t.lng } : null;
|
|
197
|
-
},
|
|
198
|
-
// latLng
|
|
199
|
-
() => {
|
|
200
|
-
const t = e.latLng;
|
|
201
|
-
return t && typeof t.lat == "number" && typeof t.lng == "number" ? { lat: t.lat, lng: t.lng } : null;
|
|
202
|
-
},
|
|
203
|
-
// location
|
|
204
|
-
() => {
|
|
205
|
-
const t = e.location;
|
|
206
|
-
return t && typeof t.lat == "number" && typeof t.lng == "number" ? { lat: t.lat, lng: t.lng } : null;
|
|
207
|
-
},
|
|
208
|
-
// coordinates
|
|
209
|
-
() => {
|
|
210
|
-
const t = e.coordinates;
|
|
211
|
-
return t && typeof t.lat == "number" && typeof t.lng == "number" ? { lat: t.lat, lng: t.lng } : null;
|
|
212
|
-
},
|
|
213
|
-
// Direct lat/lng
|
|
214
|
-
() => typeof e.lat == "number" && typeof e.lng == "number" ? { lat: e.lat, lng: e.lng } : null,
|
|
215
|
-
// latitude/longitude
|
|
216
|
-
() => typeof e.latitude == "number" && typeof e.longitude == "number" ? { lat: e.latitude, lng: e.longitude } : null,
|
|
217
|
-
// address.geocode
|
|
218
|
-
() => {
|
|
219
|
-
const t = e.address;
|
|
220
|
-
return t?.geocode && typeof t.geocode.lat == "number" && typeof t.geocode.lng == "number" ? { lat: t.geocode.lat, lng: t.geocode.lng } : null;
|
|
221
|
-
}
|
|
222
|
-
];
|
|
223
|
-
for (const t of o) {
|
|
224
|
-
const s = t();
|
|
225
|
-
if (s && oe(s.lat, s.lng))
|
|
226
|
-
return s;
|
|
227
|
-
}
|
|
228
|
-
return null;
|
|
229
|
-
}
|
|
230
|
-
function J(e, o, t = "id") {
|
|
231
|
-
const s = o || A;
|
|
232
|
-
return e.map((c, L) => {
|
|
233
|
-
const i = s(c);
|
|
234
|
-
if (!i) return null;
|
|
235
|
-
const f = c[t] || `marker_${L}`, m = c.name || c.title || c.displayName || "";
|
|
236
|
-
return {
|
|
237
|
-
id: f,
|
|
238
|
-
position: i,
|
|
239
|
-
title: m,
|
|
240
|
-
data: c
|
|
241
|
-
};
|
|
242
|
-
}).filter((c) => c !== null);
|
|
243
|
-
}
|
|
244
|
-
return r.autoTheme && ee(d, () => {
|
|
245
|
-
if (a.value) {
|
|
246
|
-
const e = P(d.value, r.lightTheme, r.darkTheme);
|
|
247
|
-
a.value.setOptions({ styles: e });
|
|
248
|
-
}
|
|
249
|
-
}), {
|
|
250
|
-
// Loading state
|
|
251
|
-
isApiLoading: v,
|
|
252
|
-
isApiReady: b,
|
|
253
|
-
apiError: h,
|
|
254
|
-
apiPromise: z,
|
|
255
|
-
loadingState: K,
|
|
256
|
-
// Theme
|
|
257
|
-
currentTheme: S,
|
|
258
|
-
mapStyles: W,
|
|
259
|
-
setTheme: $,
|
|
260
|
-
// Map reference
|
|
261
|
-
mapRef: a,
|
|
262
|
-
setMap: N,
|
|
263
|
-
// Position
|
|
264
|
-
center: w,
|
|
265
|
-
zoom: M,
|
|
266
|
-
bounds: T,
|
|
267
|
-
// Markers
|
|
268
|
-
markers: u,
|
|
269
|
-
visibleMarkers: I,
|
|
270
|
-
addMarker: U,
|
|
271
|
-
removeMarker: q,
|
|
272
|
-
updateMarker: V,
|
|
273
|
-
clearMarkers: X,
|
|
274
|
-
setMarkers: Y,
|
|
275
|
-
// Clustering
|
|
276
|
-
clusters: C,
|
|
277
|
-
shouldShowClusters: R,
|
|
278
|
-
processMarkers: H,
|
|
279
|
-
getClusterColor: le,
|
|
280
|
-
// Utilities
|
|
281
|
-
initializeApi: G,
|
|
282
|
-
panTo: B,
|
|
283
|
-
setZoom: D,
|
|
284
|
-
fitBounds: F,
|
|
285
|
-
fitToMarkers: O,
|
|
286
|
-
// Coordinate extraction
|
|
287
|
-
extractCoordinates: A,
|
|
288
|
-
markersFromData: J
|
|
289
|
-
};
|
|
290
|
-
}
|
|
291
|
-
export {
|
|
292
|
-
ge as U,
|
|
293
|
-
ce as W,
|
|
294
|
-
ie as d,
|
|
295
|
-
oe as i,
|
|
296
|
-
fe as u
|
|
297
|
-
};
|