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