@colabcommerce/elements 0.0.3 → 0.0.4
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/CartForm.js +4 -4
- package/dist/{Container-7bFgo-eP.js → Container-CU_WrBOi.js} +1 -1
- package/dist/{Modal-BqRDRCTs.js → Modal-DTBKy_6d.js} +1 -1
- package/dist/ProductForm.js +113 -118
- package/dist/Retailer.js +3 -3
- package/dist/StoreLocator.js +183 -179
- package/dist/{addressComponentsToAddress-CNK2WJ24.js → addressComponentsToAddress-DCL-K8mn.js} +51 -51
- package/dist/{browser-ponyfill-BEmK0BQJ.js → browser-ponyfill-DcK7_cJB.js} +1 -1
- package/dist/{globals-C3lGVSJ0.js → globals-B8-hYoIU.js} +1208 -1210
- package/dist/{index-DqABFy0O.js → index-CqSfhXDd.js} +2 -2
- package/dist/index-FM02Uq_P.js +100 -0
- package/package.json +1 -1
- package/dist/index-TPy0P4tu.js +0 -98
package/dist/CartForm.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as t, Fragment as H, jsxs as f } from "react/jsx-runtime";
|
|
2
2
|
import * as b from "react";
|
|
3
3
|
import { useRef as ae, useState as E, useCallback as re, useContext as j, useMemo as Y, useEffect as q } from "react";
|
|
4
|
-
import { C as ce, u as I, L as ie, d as le, g as de, b as ue, f as me, A as he, c as pe, w as fe, h as ge, e as _e } from "./addressComponentsToAddress-
|
|
5
|
-
import { L as ye, F as ve, a as Ce, Q as Ne } from "./index-
|
|
6
|
-
import { _ as be, p as B, q as k, j as we, A as Se, a as x, k as Ie, M as Le, c as y, Q as K, e as xe, h as F, i as Ae, F as v, R as qe, C as L, O as P, B as G, l as Q, I as Be, m as ke } from "./globals-
|
|
7
|
-
import { C as Me } from "./Container-
|
|
4
|
+
import { C as ce, u as I, L as ie, d as le, g as de, b as ue, f as me, A as he, c as pe, w as fe, h as ge, e as _e } from "./addressComponentsToAddress-DCL-K8mn.js";
|
|
5
|
+
import { L as ye, F as ve, a as Ce, Q as Ne } from "./index-CqSfhXDd.js";
|
|
6
|
+
import { _ as be, p as B, q as k, j as we, A as Se, a as x, k as Ie, M as Le, c as y, Q as K, e as xe, h as F, i as Ae, F as v, R as qe, C as L, O as P, B as G, l as Q, I as Be, m as ke } from "./globals-B8-hYoIU.js";
|
|
7
|
+
import { C as Me } from "./Container-CU_WrBOi.js";
|
|
8
8
|
function W() {
|
|
9
9
|
return W = Object.assign ? Object.assign.bind() : function(e) {
|
|
10
10
|
for (var n = 1; n < arguments.length; n++) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { w as Z, x as be, y as Q, r as de, z as Se, D as lt, G as ct, T as dt, t as ut, q as v, v as ft, E as ht, p as U, P as Ee, H as mt, J as gt, K as De, L as pt, N as Et } from "./globals-
|
|
1
|
+
import { w as Z, x as be, y as Q, r as de, z as Se, D as lt, G as ct, T as dt, t as ut, q as v, v as ft, E as ht, p as U, P as Ee, H as mt, J as gt, K as De, L as pt, N as Et } from "./globals-B8-hYoIU.js";
|
|
2
2
|
import * as E from "react";
|
|
3
3
|
import { useState as H, useRef as h, useEffect as R, useCallback as y, useContext as Ke, createContext as yt, useMemo as Ge, useLayoutEffect as Rt, cloneElement as Ne, forwardRef as vt, useImperativeHandle as Tt } from "react";
|
|
4
4
|
import wt from "react-dom";
|
package/dist/ProductForm.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect as j, useState as E, Suspense as z } from "react";
|
|
3
|
-
import { u as F, L as H, g as
|
|
4
|
-
import { L as ee, F as te, Q as
|
|
5
|
-
import { a as
|
|
6
|
-
import { S as
|
|
7
|
-
const
|
|
3
|
+
import { u as F, L as H, g as R, d as D, S as Q, b as U, k as J, f as V, A as K, c as G, w as X, h as Y, e as Z } from "./addressComponentsToAddress-DCL-K8mn.js";
|
|
4
|
+
import { L as ee, F as te, Q as oe } from "./index-CqSfhXDd.js";
|
|
5
|
+
import { a as W, c as k, e as ae, h as b, i as ne, F as d, R as se, C as _, O as y, B as re, l as M, I as ie, m as le } from "./globals-B8-hYoIU.js";
|
|
6
|
+
import { S as ce } from "./index-FM02Uq_P.js";
|
|
7
|
+
const de = () => {
|
|
8
8
|
const { locationName: m, setLocationName: l, setSearchCenter: c, setMapCenter: t, setLoadingGeo: f, getPosition: n } = F();
|
|
9
9
|
return /* @__PURE__ */ e(
|
|
10
10
|
H,
|
|
@@ -18,16 +18,16 @@ const ce = () => {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
);
|
|
21
|
-
},
|
|
22
|
-
loading:
|
|
23
|
-
itemWrapper:
|
|
24
|
-
selected:
|
|
25
|
-
wrapper:
|
|
26
|
-
},
|
|
27
|
-
const { t: m } =
|
|
28
|
-
function f(n,
|
|
29
|
-
if (!n || !
|
|
30
|
-
const
|
|
21
|
+
}, me = "_5BvSp", ue = "NnCF-", he = "OxA-3", pe = "fIWeh", C = {
|
|
22
|
+
loading: me,
|
|
23
|
+
itemWrapper: ue,
|
|
24
|
+
selected: he,
|
|
25
|
+
wrapper: pe
|
|
26
|
+
}, fe = () => {
|
|
27
|
+
const { t: m } = W(), { locations: l, isLoading: c, focusedLocationId: t } = F();
|
|
28
|
+
function f(n, h) {
|
|
29
|
+
if (!n || !h) return;
|
|
30
|
+
const p = n.getBoundingClientRect(), i = h.getBoundingClientRect().top - p.top + n.scrollTop;
|
|
31
31
|
n.scrollTo({
|
|
32
32
|
top: i,
|
|
33
33
|
behavior: "smooth"
|
|
@@ -36,62 +36,61 @@ const ce = () => {
|
|
|
36
36
|
return j(() => {
|
|
37
37
|
const n = document.getElementById(`location-${t}`);
|
|
38
38
|
if (n) {
|
|
39
|
-
const
|
|
40
|
-
f(
|
|
39
|
+
const h = document.getElementById("llw");
|
|
40
|
+
f(h, n);
|
|
41
41
|
}
|
|
42
42
|
}, [t]), c ? /* @__PURE__ */ e("div", { className: k(C.loading), children: /* @__PURE__ */ e("img", { src: "https://images.sofasandsectionals.com/cc/pal-loader.svg", width: "50", height: "50", alt: m("store_locator.loading") }) }) : /* @__PURE__ */ e("div", { className: k(C.wrapper), id: "llw", children: l.map((n) => /* @__PURE__ */ e("div", { className: t === n.id ? k(C.itemWrapper, C.selected) : k(C.itemWrapper), id: `location-${n.id}`, children: /* @__PURE__ */ e(ee, { id: n.id, location: n }) }, n.id)) });
|
|
43
|
-
},
|
|
44
|
-
wrapper:
|
|
45
|
-
name:
|
|
46
|
-
address:
|
|
47
|
-
},
|
|
48
|
-
var I, q, x, w,
|
|
49
|
-
const { cc_company_retailer_location_id: m } =
|
|
43
|
+
}, _e = "NQ6-h", ge = "_4wmyC", ve = "_9dVCP", P = {
|
|
44
|
+
wrapper: _e,
|
|
45
|
+
name: ge,
|
|
46
|
+
address: ve
|
|
47
|
+
}, Ne = () => {
|
|
48
|
+
var S, I, q, x, w, B, o;
|
|
49
|
+
const { cc_company_retailer_location_id: m } = R(), { distanceUnit: l, searchCenter: c, selectedLocation: t, setSelectedLocationId: f, selectedLocationId: n, setMessageModalOpen: h, setShowMap: p, setShowDetails: N } = F(), i = D({ lat: (S = t == null ? void 0 : t.address) == null ? void 0 : S.latitude, lng: (I = t == null ? void 0 : t.address) == null ? void 0 : I.longitude }, c), L = l === "km" ? i : J(i), a = Math.round(L * 10) / 10, g = (q = t == null ? void 0 : t.store_type) != null && q.includes("Studio") ? "studio" : "retailer";
|
|
50
50
|
return !t || t.location_id === m ? null : /* @__PURE__ */ e("div", { children: /* @__PURE__ */ s("div", { className: P.wrapper, children: [
|
|
51
51
|
/* @__PURE__ */ s("div", { className: "d-flex align-items-center justify-content-between", children: [
|
|
52
52
|
/* @__PURE__ */ e("h3", { className: P.name, children: t == null ? void 0 : t.retailer_name }),
|
|
53
|
-
/* @__PURE__ */ e("div", { className: "text-end", children: /* @__PURE__ */ e(Q, { type:
|
|
53
|
+
/* @__PURE__ */ e("div", { className: "text-end", children: /* @__PURE__ */ e(Q, { type: g }) })
|
|
54
54
|
] }),
|
|
55
55
|
/* @__PURE__ */ s("div", { className: "text-muted fs-6 fw-normal mt-1", children: [
|
|
56
|
-
|
|
56
|
+
a,
|
|
57
57
|
" ",
|
|
58
58
|
l
|
|
59
59
|
] }),
|
|
60
60
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(U, { hours: t == null ? void 0 : t.retailer_location_hours }) }),
|
|
61
61
|
/* @__PURE__ */ s("address", { className: P.address, children: [
|
|
62
|
-
/* @__PURE__ */ e("div", { children: (
|
|
62
|
+
/* @__PURE__ */ e("div", { children: (x = t == null ? void 0 : t.address) == null ? void 0 : x.street_line_one }),
|
|
63
63
|
/* @__PURE__ */ s("div", { children: [
|
|
64
|
-
(
|
|
64
|
+
(w = t == null ? void 0 : t.address) == null ? void 0 : w.city,
|
|
65
65
|
", ",
|
|
66
|
-
(
|
|
66
|
+
(B = t == null ? void 0 : t.address) == null ? void 0 : B.province,
|
|
67
67
|
" ",
|
|
68
|
-
(
|
|
68
|
+
(o = t == null ? void 0 : t.address) == null ? void 0 : o.postal_code
|
|
69
69
|
] })
|
|
70
70
|
] })
|
|
71
71
|
] }) });
|
|
72
|
-
},
|
|
73
|
-
changeLocationBtn:
|
|
74
|
-
submitButton:
|
|
75
|
-
successContainer:
|
|
76
|
-
successBtn: Ce
|
|
72
|
+
}, be = "KsfpB", ye = "t-v-7", Ce = "UFm9T", v = {
|
|
73
|
+
changeLocationBtn: be,
|
|
74
|
+
submitButton: ye,
|
|
75
|
+
successContainer: Ce
|
|
77
76
|
}, Se = ({ id: m, product: l = null, onSuccess: c, onCancel: t, onClose: f, optInText: n }) => {
|
|
78
77
|
l || console.warn("Colab Commerce: No product(s) provided to the ProductForm component.");
|
|
79
|
-
const { cc_company_retailer_location_id:
|
|
78
|
+
const { cc_company_retailer_location_id: h } = R(), { selectedLocationId: p, setSelectedLocationId: N, searchCenter: i, setFocusedLocationId: L } = F(), { t: a } = W("default"), [g, S] = E(!1), [I, q] = E(!1), x = {
|
|
80
79
|
firstName: "",
|
|
81
80
|
lastName: "",
|
|
82
81
|
email: "",
|
|
83
82
|
phone: "",
|
|
84
83
|
notes: ""
|
|
85
|
-
}, w =
|
|
86
|
-
firstName: b().required(
|
|
87
|
-
lastName: b().required(
|
|
88
|
-
email: b().email(
|
|
89
|
-
phone: b().required(
|
|
84
|
+
}, w = ae().shape({
|
|
85
|
+
firstName: b().required(a("quote_form.first_name_required")),
|
|
86
|
+
lastName: b().required(a("quote_form.last_name_required")),
|
|
87
|
+
email: b().email(a("quote_form.invalid_email")).required(a("quote_form.email_required")),
|
|
88
|
+
phone: b().required(a("quote_form.phone_required")),
|
|
90
89
|
notes: b()
|
|
91
|
-
}),
|
|
90
|
+
}), o = ne({
|
|
92
91
|
initialValues: x,
|
|
93
92
|
validationSchema: w,
|
|
94
|
-
onSubmit: async (
|
|
93
|
+
onSubmit: async (u) => {
|
|
95
94
|
X("AIzaSyAnJmWEU1r63DiRWHkjczxzHyIEq3dhj4M");
|
|
96
95
|
const T = await K(i == null ? void 0 : i.lat, i == null ? void 0 : i.lng), r = G(T.results[0].address_components), A = await fetch("https://api.colabcommerce.com/widget_api/leads", {
|
|
97
96
|
method: "POST",
|
|
@@ -101,11 +100,11 @@ const ce = () => {
|
|
|
101
100
|
body: JSON.stringify({
|
|
102
101
|
id: m,
|
|
103
102
|
lead: {
|
|
104
|
-
name: `${
|
|
105
|
-
emails_attributes: [{ email:
|
|
106
|
-
phone_numbers_attributes: [{ phone_number:
|
|
107
|
-
message:
|
|
108
|
-
opt_in:
|
|
103
|
+
name: `${u.firstName} ${u.lastName}`,
|
|
104
|
+
emails_attributes: [{ email: u.email }],
|
|
105
|
+
phone_numbers_attributes: [{ phone_number: u.phone, country_code: "US" }],
|
|
106
|
+
message: u.message,
|
|
107
|
+
opt_in: u.optIn,
|
|
109
108
|
location_attributes: {
|
|
110
109
|
street_line_one: r == null ? void 0 : r.addressLine1,
|
|
111
110
|
street_line_two: r == null ? void 0 : r.addressLine2,
|
|
@@ -116,12 +115,12 @@ const ce = () => {
|
|
|
116
115
|
latitude: (i == null ? void 0 : i.lat) || null,
|
|
117
116
|
longitude: (i == null ? void 0 : i.lng) || null
|
|
118
117
|
},
|
|
119
|
-
assignee_id:
|
|
118
|
+
assignee_id: p || null,
|
|
120
119
|
assignee_type: "CompanyRetailerLocation",
|
|
121
120
|
lead_activities_attributes: [{
|
|
122
121
|
type: "LeadActivity::QuoteRequest",
|
|
123
122
|
products: [l],
|
|
124
|
-
notes:
|
|
123
|
+
notes: u.notes,
|
|
125
124
|
source_type: "Company",
|
|
126
125
|
source_id: m
|
|
127
126
|
}]
|
|
@@ -137,42 +136,38 @@ const ce = () => {
|
|
|
137
136
|
}
|
|
138
137
|
});
|
|
139
138
|
j(() => {
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
}, [
|
|
143
|
-
const
|
|
144
|
-
|
|
139
|
+
const u = document.getElementById("cc-accordion-anchor");
|
|
140
|
+
u && u.scrollIntoView({ behavior: "instant" });
|
|
141
|
+
}, [p]);
|
|
142
|
+
const $ = (u) => {
|
|
143
|
+
L(u.id);
|
|
145
144
|
};
|
|
146
145
|
return /* @__PURE__ */ s("div", { className: "cc", children: [
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
/* @__PURE__ */
|
|
150
|
-
|
|
151
|
-
] }) }),
|
|
152
|
-
!N && /* @__PURE__ */ s("div", { id: "cc-accordion-anchor", children: [
|
|
153
|
-
!h && /* @__PURE__ */ s("div", { children: [
|
|
154
|
-
/* @__PURE__ */ e("div", { className: "mb-3", children: /* @__PURE__ */ e(ce, {}) }),
|
|
146
|
+
g && /* @__PURE__ */ e("div", { className: v.successContainer, children: /* @__PURE__ */ e("div", { className: "text-center", children: /* @__PURE__ */ e("h2", { className: "fw-bold fs-2", style: { marginBottom: "3.2rem" }, children: a("cart_form.success_title") }) }) }),
|
|
147
|
+
!g && /* @__PURE__ */ s("div", { id: "cc-accordion-anchor", children: [
|
|
148
|
+
!p && /* @__PURE__ */ s("div", { children: [
|
|
149
|
+
/* @__PURE__ */ e("div", { className: "mb-3", children: /* @__PURE__ */ e(de, {}) }),
|
|
155
150
|
/* @__PURE__ */ s("div", { className: "position-relative", children: [
|
|
156
151
|
/* @__PURE__ */ e(V, {}),
|
|
157
|
-
/* @__PURE__ */ e(
|
|
152
|
+
/* @__PURE__ */ e(ce, { onMarkerClick: $ })
|
|
158
153
|
] }),
|
|
159
154
|
/* @__PURE__ */ e(te, {}),
|
|
160
|
-
/* @__PURE__ */ e(
|
|
155
|
+
/* @__PURE__ */ e(fe, {})
|
|
161
156
|
] }),
|
|
162
|
-
|
|
157
|
+
p && /* @__PURE__ */ s("div", { children: [
|
|
163
158
|
/* @__PURE__ */ s("div", { children: [
|
|
164
159
|
/* @__PURE__ */ s("div", { className: "d-flex align-items-center justify-content-between px-3 mb-2 fs-6", children: [
|
|
165
|
-
/* @__PURE__ */ e("span", { className: "fw-bold", children:
|
|
166
|
-
/* @__PURE__ */ e("button", { onClick: () =>
|
|
160
|
+
/* @__PURE__ */ e("span", { className: "fw-bold", children: h === p ? "" : a("quote.selected_location.title") }),
|
|
161
|
+
/* @__PURE__ */ e("button", { onClick: () => N(null), className: v.changeLocationBtn, children: a("quote.change_location") })
|
|
167
162
|
] }),
|
|
168
|
-
/* @__PURE__ */ e("div", { className:
|
|
163
|
+
/* @__PURE__ */ e("div", { className: v.selectedLocation, children: /* @__PURE__ */ e(Ne, {}) })
|
|
169
164
|
] }),
|
|
170
|
-
/* @__PURE__ */ e("div", { className: "p-3", children: /* @__PURE__ */ e(d, { onSubmit:
|
|
165
|
+
/* @__PURE__ */ e("div", { className: "p-3", children: /* @__PURE__ */ e(d, { onSubmit: o.handleSubmit, className: v.form, children: /* @__PURE__ */ s(se, { children: [
|
|
171
166
|
/* @__PURE__ */ e(_, { xs: 12, md: 12, children: /* @__PURE__ */ s(
|
|
172
167
|
y,
|
|
173
168
|
{
|
|
174
169
|
controlId: "floatingInput",
|
|
175
|
-
label:
|
|
170
|
+
label: a("quote_form.first_name"),
|
|
176
171
|
className: "mb-3",
|
|
177
172
|
children: [
|
|
178
173
|
/* @__PURE__ */ e(
|
|
@@ -180,14 +175,14 @@ const ce = () => {
|
|
|
180
175
|
{
|
|
181
176
|
type: "text",
|
|
182
177
|
name: "firstName",
|
|
183
|
-
placeholder:
|
|
184
|
-
onChange:
|
|
185
|
-
value:
|
|
178
|
+
placeholder: a("quote_form.first_name_placeholder"),
|
|
179
|
+
onChange: o.handleChange,
|
|
180
|
+
value: o.values.firstName,
|
|
186
181
|
className: "rounded-0",
|
|
187
|
-
isInvalid: !!
|
|
182
|
+
isInvalid: !!o.errors.firstName
|
|
188
183
|
}
|
|
189
184
|
),
|
|
190
|
-
/* @__PURE__ */ e(d.Control.Feedback, { type: "invalid", children:
|
|
185
|
+
/* @__PURE__ */ e(d.Control.Feedback, { type: "invalid", children: o.errors.firstName })
|
|
191
186
|
]
|
|
192
187
|
}
|
|
193
188
|
) }),
|
|
@@ -195,7 +190,7 @@ const ce = () => {
|
|
|
195
190
|
y,
|
|
196
191
|
{
|
|
197
192
|
controlId: "floatingInput",
|
|
198
|
-
label:
|
|
193
|
+
label: a("quote_form.last_name"),
|
|
199
194
|
className: "mb-3",
|
|
200
195
|
children: [
|
|
201
196
|
/* @__PURE__ */ e(
|
|
@@ -204,13 +199,13 @@ const ce = () => {
|
|
|
204
199
|
type: "text",
|
|
205
200
|
name: "lastName",
|
|
206
201
|
className: "rounded-0",
|
|
207
|
-
placeholder:
|
|
208
|
-
onChange:
|
|
209
|
-
value:
|
|
210
|
-
isInvalid: !!
|
|
202
|
+
placeholder: a("quote_form.last_name_placeholder"),
|
|
203
|
+
onChange: o.handleChange,
|
|
204
|
+
value: o.values.lastName,
|
|
205
|
+
isInvalid: !!o.errors.lastName
|
|
211
206
|
}
|
|
212
207
|
),
|
|
213
|
-
/* @__PURE__ */ e(d.Control.Feedback, { type: "invalid", children:
|
|
208
|
+
/* @__PURE__ */ e(d.Control.Feedback, { type: "invalid", children: o.errors.lastName })
|
|
214
209
|
]
|
|
215
210
|
}
|
|
216
211
|
) }),
|
|
@@ -218,7 +213,7 @@ const ce = () => {
|
|
|
218
213
|
y,
|
|
219
214
|
{
|
|
220
215
|
controlId: "floatingInput",
|
|
221
|
-
label:
|
|
216
|
+
label: a("quote_form.email"),
|
|
222
217
|
className: "mb-3",
|
|
223
218
|
children: [
|
|
224
219
|
/* @__PURE__ */ e(
|
|
@@ -227,13 +222,13 @@ const ce = () => {
|
|
|
227
222
|
type: "email",
|
|
228
223
|
name: "email",
|
|
229
224
|
className: "rounded-0",
|
|
230
|
-
placeholder:
|
|
231
|
-
onChange:
|
|
232
|
-
value:
|
|
233
|
-
isInvalid: !!
|
|
225
|
+
placeholder: a("quote_form.email_placeholder"),
|
|
226
|
+
onChange: o.handleChange,
|
|
227
|
+
value: o.values.email,
|
|
228
|
+
isInvalid: !!o.errors.email
|
|
234
229
|
}
|
|
235
230
|
),
|
|
236
|
-
/* @__PURE__ */ e(d.Control.Feedback, { type: "invalid", children:
|
|
231
|
+
/* @__PURE__ */ e(d.Control.Feedback, { type: "invalid", children: o.errors.email })
|
|
237
232
|
]
|
|
238
233
|
}
|
|
239
234
|
) }),
|
|
@@ -241,7 +236,7 @@ const ce = () => {
|
|
|
241
236
|
y,
|
|
242
237
|
{
|
|
243
238
|
controlId: "floatingInput",
|
|
244
|
-
label:
|
|
239
|
+
label: a("quote_form.phone"),
|
|
245
240
|
className: "mb-3",
|
|
246
241
|
children: [
|
|
247
242
|
/* @__PURE__ */ e(
|
|
@@ -250,13 +245,13 @@ const ce = () => {
|
|
|
250
245
|
type: "text",
|
|
251
246
|
name: "phone",
|
|
252
247
|
className: "rounded-0",
|
|
253
|
-
placeholder:
|
|
254
|
-
onChange:
|
|
255
|
-
value:
|
|
256
|
-
isInvalid: !!
|
|
248
|
+
placeholder: a("quote_form.phone_placeholder"),
|
|
249
|
+
onChange: o.handleChange,
|
|
250
|
+
value: o.values.phone,
|
|
251
|
+
isInvalid: !!o.errors.phone
|
|
257
252
|
}
|
|
258
253
|
),
|
|
259
|
-
/* @__PURE__ */ e(d.Control.Feedback, { type: "invalid", children:
|
|
254
|
+
/* @__PURE__ */ e(d.Control.Feedback, { type: "invalid", children: o.errors.phone })
|
|
260
255
|
]
|
|
261
256
|
}
|
|
262
257
|
) }),
|
|
@@ -264,8 +259,8 @@ const ce = () => {
|
|
|
264
259
|
y,
|
|
265
260
|
{
|
|
266
261
|
controlId: "floatingTextarea",
|
|
267
|
-
label:
|
|
268
|
-
className: ["mb-3",
|
|
262
|
+
label: a("quote_form.notes"),
|
|
263
|
+
className: ["mb-3", v.textarea].join(" "),
|
|
269
264
|
children: [
|
|
270
265
|
/* @__PURE__ */ e(
|
|
271
266
|
d.Control,
|
|
@@ -273,14 +268,14 @@ const ce = () => {
|
|
|
273
268
|
as: "textarea",
|
|
274
269
|
name: "notes",
|
|
275
270
|
className: "rounded-0",
|
|
276
|
-
placeholder:
|
|
277
|
-
onChange:
|
|
278
|
-
value:
|
|
279
|
-
isInvalid: !!
|
|
271
|
+
placeholder: a("quote_form.notes_placeholder"),
|
|
272
|
+
onChange: o.handleChange,
|
|
273
|
+
value: o.values.notes,
|
|
274
|
+
isInvalid: !!o.errors.notes,
|
|
280
275
|
style: { height: "100px" }
|
|
281
276
|
}
|
|
282
277
|
),
|
|
283
|
-
/* @__PURE__ */ e(d.Control.Feedback, { type: "invalid", children:
|
|
278
|
+
/* @__PURE__ */ e(d.Control.Feedback, { type: "invalid", children: o.errors.notes })
|
|
284
279
|
]
|
|
285
280
|
}
|
|
286
281
|
) }),
|
|
@@ -292,22 +287,22 @@ const ce = () => {
|
|
|
292
287
|
type: "checkbox",
|
|
293
288
|
label: n,
|
|
294
289
|
className: "mb-3 fs-6",
|
|
295
|
-
onChange:
|
|
296
|
-
isInvalid: !!
|
|
290
|
+
onChange: o.handleChange,
|
|
291
|
+
isInvalid: !!o.errors.optIn
|
|
297
292
|
}
|
|
298
293
|
),
|
|
299
|
-
/* @__PURE__ */ e(d.Control.Feedback, { type: "invalid", children:
|
|
294
|
+
/* @__PURE__ */ e(d.Control.Feedback, { type: "invalid", children: o.errors.optIn })
|
|
300
295
|
] }),
|
|
301
296
|
/* @__PURE__ */ s(_, { xs: 12, className: "text-start d-flex align-items-center", children: [
|
|
302
|
-
/* @__PURE__ */ e(
|
|
303
|
-
I && /* @__PURE__ */ e("div", { className: "text-danger ms-2", children:
|
|
304
|
-
|
|
297
|
+
/* @__PURE__ */ e(re, { type: "submit", variant: "dark", className: v.submitButton, disabled: g, children: o.isSubmitting ? a("quote.submitting") : a("quote_form.submit") }),
|
|
298
|
+
I && /* @__PURE__ */ e("div", { className: "text-danger ms-2", children: a("quote_form.error") }),
|
|
299
|
+
g && /* @__PURE__ */ e("div", { className: "text-success ms-2", children: a("quote_form.success") })
|
|
305
300
|
] })
|
|
306
301
|
] }) }) })
|
|
307
302
|
] })
|
|
308
303
|
] })
|
|
309
304
|
] });
|
|
310
|
-
},
|
|
305
|
+
}, Le = ({
|
|
311
306
|
id: m,
|
|
312
307
|
// The entity ID for the Store Locator.
|
|
313
308
|
locale: l,
|
|
@@ -315,12 +310,12 @@ const ce = () => {
|
|
|
315
310
|
filterRetailerByStockedProduct: t = !1,
|
|
316
311
|
filterRetailerByAvailableProduct: f = !1,
|
|
317
312
|
optInText: n = null,
|
|
318
|
-
onCancel:
|
|
319
|
-
onClose:
|
|
320
|
-
onSuccess:
|
|
313
|
+
onCancel: h,
|
|
314
|
+
onClose: p,
|
|
315
|
+
onSuccess: N
|
|
321
316
|
}) => (j(() => {
|
|
322
|
-
|
|
323
|
-
}, [l]), c || (console.warn("Colab Commerce: No product(s) provided to the ProductForm component."), c = []), /* @__PURE__ */ e(z, { children: /* @__PURE__ */ e(
|
|
317
|
+
M.changeLanguage(l);
|
|
318
|
+
}, [l]), c || (console.warn("Colab Commerce: No product(s) provided to the ProductForm component."), c = []), /* @__PURE__ */ e(z, { children: /* @__PURE__ */ e(ie, { i18n: M, children: /* @__PURE__ */ e(le, { apiKey: "AIzaSyAnJmWEU1r63DiRWHkjczxzHyIEq3dhj4M", libraries: ["places"], children: /* @__PURE__ */ e(Y, { id: m, children: /* @__PURE__ */ e(
|
|
324
319
|
Z,
|
|
325
320
|
{
|
|
326
321
|
id: m,
|
|
@@ -330,19 +325,19 @@ const ce = () => {
|
|
|
330
325
|
optInText: n,
|
|
331
326
|
autoLocate: !0,
|
|
332
327
|
products: [c],
|
|
333
|
-
children: /* @__PURE__ */ e(
|
|
328
|
+
children: /* @__PURE__ */ e(oe, { children: /* @__PURE__ */ e(
|
|
334
329
|
Se,
|
|
335
330
|
{
|
|
336
331
|
id: m,
|
|
337
332
|
product: c,
|
|
338
|
-
onSuccess:
|
|
333
|
+
onSuccess: N,
|
|
339
334
|
optInText: n,
|
|
340
|
-
onCancel:
|
|
341
|
-
onClose:
|
|
335
|
+
onCancel: h,
|
|
336
|
+
onClose: p
|
|
342
337
|
}
|
|
343
338
|
) })
|
|
344
339
|
}
|
|
345
340
|
) }) }) }) }));
|
|
346
341
|
export {
|
|
347
|
-
|
|
342
|
+
Le as default
|
|
348
343
|
};
|
package/dist/Retailer.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as v, jsxs as N, Fragment as Ze } from "react/jsx-runtime";
|
|
2
2
|
import k, { createContext as Be, useState as X, useEffect as re, useContext as xt, forwardRef as Qe, useRef as U, useLayoutEffect as Tt } from "react";
|
|
3
|
-
import { u as Et, f as Ct, a as se, b as Pt, c as L, d as Ve, B as Ae, R as Z, C as q, e as Mt, g as It, h as pe, i as Lt, F as D, j as _t, A as Ot, k as Nt, M as zt, l as Re, I as At, m as $t } from "./globals-
|
|
4
|
-
import { C as $e } from "./Container-
|
|
5
|
-
import { M as me } from "./Modal-
|
|
3
|
+
import { u as Et, f as Ct, a as se, b as Pt, c as L, d as Ve, B as Ae, R as Z, C as q, e as Mt, g as It, h as pe, i as Lt, F as D, j as _t, A as Ot, k as Nt, M as zt, l as Re, I as At, m as $t } from "./globals-B8-hYoIU.js";
|
|
4
|
+
import { C as $e } from "./Container-CU_WrBOi.js";
|
|
5
|
+
import { M as me } from "./Modal-DTBKy_6d.js";
|
|
6
6
|
const Je = Be(), kt = ({ id: t, lng: e, children: i }) => {
|
|
7
7
|
const [s, n] = X(e), [r, l] = X(!1);
|
|
8
8
|
re(() => {
|