@colabcommerce/elements 0.0.1 → 0.0.2
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/README.md +3 -3
- package/dist/CartForm.js +26 -26
- package/dist/{Container-BPKk2w_q.js → Container-7bFgo-eP.js} +1 -1
- package/dist/Modal-BqRDRCTs.js +863 -0
- package/dist/ProductForm.js +178 -157
- package/dist/Retailer.js +1421 -1352
- package/dist/StoreLocator.js +609 -468
- package/dist/addressComponentsToAddress-f0L6qfjZ.js +1932 -0
- package/dist/{browser-ponyfill-CAlAl1ZX.js → browser-ponyfill-BEmK0BQJ.js} +1 -1
- package/dist/{globals-D3YPIcjZ.js → globals-C3lGVSJ0.js} +710 -702
- package/dist/index-BkhS8Nlh.js +137 -0
- package/dist/index-GbXQ8qje.js +98 -0
- package/dist/style.css +1 -1
- package/package.json +3 -2
- package/vite.config.js +3 -0
- package/dist/addressComponentsToAddress-CHYXse0U.js +0 -153
- package/dist/index-BComOHrk.js +0 -1909
- package/dist/index-Dv5Y39GK.js +0 -98
- package/dist/index-Ot1CirR6.js +0 -932
package/dist/index-Dv5Y39GK.js
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { jsxs as I, jsx as L } from "react/jsx-runtime";
|
|
2
|
-
import { useState as y, useEffect as C, useCallback as x } from "react";
|
|
3
|
-
import { e as Z, A as v, a as z, g as E, M as k, c as D } from "./globals-D3YPIcjZ.js";
|
|
4
|
-
import { g as P, u as B } from "./index-BComOHrk.js";
|
|
5
|
-
const T = "lzEEu", U = {
|
|
6
|
-
label: T
|
|
7
|
-
}, _ = ({ location: t }) => {
|
|
8
|
-
var s, r, d;
|
|
9
|
-
const { storeIcons: a, storeIcon: i } = P(), { setSelectedLocationId: l, selectedLocationId: g, setShowDetails: p } = B(), [u, M] = y(!1), c = () => {
|
|
10
|
-
l(t.id);
|
|
11
|
-
}, e = () => {
|
|
12
|
-
M(!0);
|
|
13
|
-
}, h = () => {
|
|
14
|
-
M(!1);
|
|
15
|
-
}, m = Z(), w = g === t.id, S = (t == null ? void 0 : t.store_type) === "Palliser Studio", o = a == null ? void 0 : a.find((f) => f.name === t.store_type);
|
|
16
|
-
return o != null && o.url || (S ? m.studioSelected : m.standardSelected), /* @__PURE__ */ I(
|
|
17
|
-
v,
|
|
18
|
-
{
|
|
19
|
-
onClick: c,
|
|
20
|
-
onMouseEnter: e,
|
|
21
|
-
onMouseLeave: h,
|
|
22
|
-
zIndex: w ? u ? 3 : 2 : u ? 1 : 0,
|
|
23
|
-
position: { lat: ((s = t == null ? void 0 : t.address) == null ? void 0 : s.latitude) * 1, lng: ((r = t.address) == null ? void 0 : r.longitude) * 1 },
|
|
24
|
-
children: [
|
|
25
|
-
u && /* @__PURE__ */ L("div", { className: U.label, children: t.retailer_name }),
|
|
26
|
-
/* @__PURE__ */ L("img", { src: ((d = o == null ? void 0 : o.icon) == null ? void 0 : d.url) || (i == null ? void 0 : i.url), width: w ? 40 : 30 })
|
|
27
|
-
]
|
|
28
|
-
}
|
|
29
|
-
);
|
|
30
|
-
}, $ = "wdRt8", j = {
|
|
31
|
-
map: $
|
|
32
|
-
}, q = () => {
|
|
33
|
-
const {
|
|
34
|
-
locations: t,
|
|
35
|
-
selectedLocationId: a,
|
|
36
|
-
searchCenter: i,
|
|
37
|
-
mapCenter: l,
|
|
38
|
-
setMapCenter: g,
|
|
39
|
-
zoom: p,
|
|
40
|
-
setZoom: u
|
|
41
|
-
} = B(), { t: M } = z(), c = E(), [e, h] = y(null);
|
|
42
|
-
C(() => {
|
|
43
|
-
c && h(c);
|
|
44
|
-
}, [c, h]);
|
|
45
|
-
const m = x((n) => {
|
|
46
|
-
var r, d, f, b;
|
|
47
|
-
if (!e) return;
|
|
48
|
-
g({ lat: (r = e == null ? void 0 : e.getCenter()) == null ? void 0 : r.lat(), lng: (d = e == null ? void 0 : e.getCenter()) == null ? void 0 : d.lng() });
|
|
49
|
-
const s = new URLSearchParams(window.location.search);
|
|
50
|
-
s.set("lat", ((f = e == null ? void 0 : e.getCenter()) == null ? void 0 : f.lat()) * 1), s.set("lng", ((b = e == null ? void 0 : e.getCenter()) == null ? void 0 : b.lng()) * 1), window.history.replaceState({}, "", `?${s.toString()}`);
|
|
51
|
-
}, [e, g]), w = x((n) => {
|
|
52
|
-
if (!e) return;
|
|
53
|
-
u(e == null ? void 0 : e.getZoom());
|
|
54
|
-
const s = new URLSearchParams(window.location.search);
|
|
55
|
-
s.set("zoom", (e == null ? void 0 : e.getZoom()) * 1), window.history.replaceState({}, "", `?${s.toString()}`);
|
|
56
|
-
}, [e, u]), S = () => {
|
|
57
|
-
if (!e) return;
|
|
58
|
-
let n = 0;
|
|
59
|
-
if (t.forEach((r) => {
|
|
60
|
-
var d;
|
|
61
|
-
(d = e == null ? void 0 : e.getBounds()) != null && d.contains({ lat: r.address.latitude * 1, lng: r.address.longitude * 1 }) && n++;
|
|
62
|
-
}), n >= 2) return;
|
|
63
|
-
const s = new window.google.maps.LatLngBounds();
|
|
64
|
-
t.slice(0, 2).map((r) => {
|
|
65
|
-
s.extend({ lat: r.address.latitude * 1, lng: r.address.longitude * 1 });
|
|
66
|
-
}), s.extend(l), e.fitBounds(s, 15);
|
|
67
|
-
}, o = (n) => {
|
|
68
|
-
var r;
|
|
69
|
-
if (!e) return;
|
|
70
|
-
const s = new window.google.maps.LatLngBounds();
|
|
71
|
-
(r = e == null ? void 0 : e.getBounds()) != null && r.contains({ lat: n.address.latitude * 1, lng: n.address.longitude * 1 }) || (s.extend({ lat: n.address.latitude * 1, lng: n.address.longitude * 1 }), s.extend(i), e.fitBounds(s, 150));
|
|
72
|
-
};
|
|
73
|
-
return C(() => {
|
|
74
|
-
if (a && t.length > 0) {
|
|
75
|
-
const n = t.find((s) => s.id === a);
|
|
76
|
-
n && o(n);
|
|
77
|
-
} else t.length > 0 && S();
|
|
78
|
-
}, [a, t, e]), C(() => {
|
|
79
|
-
t.length > 0 && S();
|
|
80
|
-
}, [t]), !l.lat || !l.lng ? null : /* @__PURE__ */ L(
|
|
81
|
-
k,
|
|
82
|
-
{
|
|
83
|
-
className: D(j.map),
|
|
84
|
-
defaultZoom: p,
|
|
85
|
-
defaultCenter: l,
|
|
86
|
-
mapId: "fb10c7a27b297863",
|
|
87
|
-
gestureHandling: "greedy",
|
|
88
|
-
disableDefaultUI: !0,
|
|
89
|
-
zoomControl: !0,
|
|
90
|
-
onDragend: m,
|
|
91
|
-
onZoomChanged: w,
|
|
92
|
-
children: t == null ? void 0 : t.map((n) => /* @__PURE__ */ L(_, { location: n }, n.id))
|
|
93
|
-
}
|
|
94
|
-
);
|
|
95
|
-
};
|
|
96
|
-
export {
|
|
97
|
-
q as S
|
|
98
|
-
};
|