trimble-terra 1.1.7 → 1.1.9
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
.t2-cart-flyout{background-color:#fff;height:100%;position:fixed;top:0;right:0;width:407px;z-index:600;transform:translate(100%);transition-property:transform;transition-duration:.5s;transition-delay:0ms;transition-timing-function:ease-in;box-shadow:0 0 8px #3635454d}@media screen and (max-width:600px){.t2-cart-flyout{width:100%;max-width:407px}}.t2-cart-flyout--deployed{transform:translate(0);transition-property:transform;transition-duration:.5s;transition-delay:0ms;transition-timing-function:ease-in}.t2-cart-flyout__modal{position:fixed;inset:0;z-index:
|
|
1
|
+
.t2-cart-flyout{background-color:#fff;height:100%;position:fixed;top:0;right:0;width:407px;z-index:600;transform:translate(100%);transition-property:transform;transition-duration:.5s;transition-delay:0ms;transition-timing-function:ease-in;box-shadow:0 0 8px #3635454d}@media screen and (max-width:600px){.t2-cart-flyout{width:100%;max-width:407px}}.t2-cart-flyout--deployed{transform:translate(0);transition-property:transform;transition-duration:.5s;transition-delay:0ms;transition-timing-function:ease-in}.t2-cart-flyout__modal{position:fixed;inset:0;z-index:10;background-color:#000;opacity:.3;display:none}.t2-cart-flyout__modal--deployed{display:block}@media screen and (max-width:600px){.t2-cart-flyout__modal--deployed{display:none}}.t2-cart-flyout__header{background-color:#0063a3;padding:24px}.t2-cart-flyout__header__title{font-weight:600;font-size:1rem;line-height:1.5rem;display:flex;gap:10px;color:#fff;font-weight:700}.t2-cart-flyout__header__account{font-weight:600;font-size:1rem;line-height:1.5rem;font-weight:700;padding-left:32px;margin-top:8px;color:#fff}.t2-cart-flyout__header__account__link{font-size:.875rem;font-weight:600;color:#fff;display:flex;align-items:center}.t2-cart-flyout__header__account__link:active{font-weight:600}.t2-cart-flyout__header__close-btn{position:absolute;top:0;right:0;color:#fff;background:transparent;border:none;padding:24px}.t2-cart-flyout__header__close-btn:hover{cursor:pointer}.t2-cart-flyout__panel{background-color:#f1f1f6;height:100%;display:flex;flex-direction:column}.t2-cart-flyout__body{padding:16px 32px;background-color:#fff;flex-grow:1;overflow:auto}.t2-cart-flyout__notification{font-weight:600;font-size:1rem;line-height:1.5rem;font-weight:700;display:flex;align-items:center;gap:8px;margin-bottom:16px}.t2-cart-flyout__notification__message{text-wrap:pretty}.t2-cart-flyout__notification--fadeout{opacity:0;transition:opacity .7s ease-out}.t2-cart-flyout__items__title{font-size:1.5rem;line-height:2.25rem;font-weight:700}.t2-cart-flyout__related-items{padding:56px 0}.t2-cart-flyout__related-items__title{font-size:1.5rem;line-height:2.25rem;font-weight:700}.t2-cart-flyout__empty{padding:0 0 8px;text-align:center;display:flex;flex-direction:column}.t2-cart-flyout__empty__title{font-size:1.5rem;line-height:2.25rem;font-weight:700}.t2-cart-flyout__empty__msg{font-weight:600;font-size:1rem;line-height:1.5rem;letter-spacing:.021px;padding:0 8px;text-wrap:balance}.t2-cart-flyout__empty__btn{justify-content:center}.t2-cart-flyout__footer{padding:24px}.t2-cart-flyout__footer__subtotal{display:flex;justify-content:space-between;align-items:center}.t2-cart-flyout__footer__subtotal__label{font-size:1rem;line-height:1.75rem;font-weight:700}.t2-cart-flyout__footer__subtotal__value{font-size:1.5rem;line-height:2.25rem;font-weight:700}.t2-cart-flyout__footer__footnote{font-size:.875rem;line-height:1.125rem}.t2-cart-flyout__buttons{display:flex;flex-direction:column;gap:24px;text-align:center;padding:24px 0}.t2-cart-flyout__buttons__button{max-width:100%!important;justify-content:center!important;max-width:none;transition:background-color .2s ease-in-out,border-color .2s ease-in-out}.t2-cart-flyout__buttons__button--primary{border:2px solid #0063a3;background-color:#0063a3;color:#fff}.t2-cart-flyout__buttons__button--primary:hover{border:2px solid #0063a3;background-color:#0e416c;border-color:#0e416c}.t2-cart-flyout__buttons__button--secondary{border:2px solid #0063a3;color:#0063a3;box-shadow:none}.t2-cart-flyout__buttons__button--secondary:hover{background-color:#0063a3;color:#fff;border:2px solid #0063a3}.t2-cart-flyout__close-btn{display:inline-block;color:#fff;padding:12px 20px}.t2-cart-flyout__close-btn:hover{cursor:pointer}
|
|
@@ -4,14 +4,14 @@ import $ from "../FlyoutCartComponent/FlyoutCartComponent.js";
|
|
|
4
4
|
import { TerraLink as h } from "../TerraLink/TerraLink.js";
|
|
5
5
|
import './FlyoutCart.css';/* empty css */
|
|
6
6
|
const E = ({ message: a, timeStamp: e }) => {
|
|
7
|
-
const [c,
|
|
7
|
+
const [c, l] = v(!1), [r, n] = v(null);
|
|
8
8
|
return x(() => {
|
|
9
9
|
if (typeof a == "string" && a.length > 0) {
|
|
10
|
-
|
|
10
|
+
l(!0), r && clearTimeout(r);
|
|
11
11
|
const s = setTimeout(() => {
|
|
12
|
-
|
|
12
|
+
l(!1), n(null);
|
|
13
13
|
}, 8e3);
|
|
14
|
-
|
|
14
|
+
n(s);
|
|
15
15
|
}
|
|
16
16
|
}, [a, e]), /* @__PURE__ */ o(
|
|
17
17
|
"div",
|
|
@@ -43,25 +43,25 @@ const E = ({ message: a, timeStamp: e }) => {
|
|
|
43
43
|
items: a,
|
|
44
44
|
onRemove: e,
|
|
45
45
|
onChangeQuantity: c,
|
|
46
|
-
cartSettings:
|
|
46
|
+
cartSettings: l,
|
|
47
47
|
LinkComponent: r
|
|
48
|
-
}) => a?.map((
|
|
48
|
+
}) => a?.map((n, s) => /* @__PURE__ */ t(
|
|
49
49
|
$,
|
|
50
50
|
{
|
|
51
|
-
...
|
|
52
|
-
settings:
|
|
51
|
+
...n,
|
|
52
|
+
settings: l,
|
|
53
53
|
onRemove: e,
|
|
54
54
|
onChangeQuantity: c,
|
|
55
55
|
LinkComponent: r
|
|
56
56
|
},
|
|
57
|
-
`${
|
|
57
|
+
`${n.id}-${n.name}-${s}`
|
|
58
58
|
)), U = ({
|
|
59
59
|
cartData: a,
|
|
60
60
|
cartSettings: e,
|
|
61
61
|
isCartFlyoutActive: c,
|
|
62
|
-
setCartFlyoutActive:
|
|
62
|
+
setCartFlyoutActive: l,
|
|
63
63
|
onChangeQuantity: r,
|
|
64
|
-
onRemove:
|
|
64
|
+
onRemove: n,
|
|
65
65
|
LinkComponent: s
|
|
66
66
|
}) => {
|
|
67
67
|
if (a?.lineItems?.length > 0) {
|
|
@@ -78,7 +78,7 @@ const E = ({ message: a, timeStamp: e }) => {
|
|
|
78
78
|
{
|
|
79
79
|
items: a?.lineItems,
|
|
80
80
|
cartSettings: e,
|
|
81
|
-
onRemove:
|
|
81
|
+
onRemove: n,
|
|
82
82
|
onChangeQuantity: r,
|
|
83
83
|
LinkComponent: s
|
|
84
84
|
}
|
|
@@ -96,8 +96,8 @@ const E = ({ message: a, timeStamp: e }) => {
|
|
|
96
96
|
/* @__PURE__ */ t("div", { className: "t2-cart-flyout__buttons", children: /* @__PURE__ */ t(
|
|
97
97
|
h,
|
|
98
98
|
{
|
|
99
|
-
onClickHandler: (
|
|
100
|
-
|
|
99
|
+
onClickHandler: (m) => {
|
|
100
|
+
m.preventDefault(), l(!c);
|
|
101
101
|
},
|
|
102
102
|
className: "t2-cart-flyout__buttons__button t2-cart-flyout__buttons__button--secondary",
|
|
103
103
|
children: y
|
|
@@ -109,30 +109,30 @@ const E = ({ message: a, timeStamp: e }) => {
|
|
|
109
109
|
cartData: a,
|
|
110
110
|
cartSettings: e,
|
|
111
111
|
isAuthenticated: c,
|
|
112
|
-
LinkComponent:
|
|
112
|
+
LinkComponent: l
|
|
113
113
|
}) => {
|
|
114
114
|
if (a?.lineItems?.length > 0)
|
|
115
115
|
if (c) {
|
|
116
116
|
const {
|
|
117
117
|
checkoutBtnLabel: r = "Proceed to Checkout",
|
|
118
|
-
checkoutBtnUrl:
|
|
118
|
+
checkoutBtnUrl: n = "https://www.trimble.com"
|
|
119
119
|
} = e;
|
|
120
120
|
return /* @__PURE__ */ t(
|
|
121
121
|
h,
|
|
122
122
|
{
|
|
123
123
|
label: r,
|
|
124
|
-
destination:
|
|
125
|
-
LinkComponent:
|
|
124
|
+
destination: n,
|
|
125
|
+
LinkComponent: l,
|
|
126
126
|
internalLinkComponent: !0,
|
|
127
127
|
primary: !0,
|
|
128
128
|
className: "t2-cart-flyout__buttons__button t2-cart-flyout__buttons__button--primary",
|
|
129
|
-
|
|
129
|
+
openInSameTabExternalLink: !0
|
|
130
130
|
}
|
|
131
131
|
);
|
|
132
132
|
} else {
|
|
133
133
|
const {
|
|
134
134
|
signInBtnLabel: r = "Sign In to Checkout",
|
|
135
|
-
signInBtnMethod:
|
|
135
|
+
signInBtnMethod: n = () => {
|
|
136
136
|
}
|
|
137
137
|
} = e;
|
|
138
138
|
return /* @__PURE__ */ t(
|
|
@@ -141,9 +141,9 @@ const E = ({ message: a, timeStamp: e }) => {
|
|
|
141
141
|
label: r,
|
|
142
142
|
className: "t2-cart-flyout__buttons__button t2-cart-flyout__buttons__button--primary",
|
|
143
143
|
primary: !0,
|
|
144
|
-
onClickHandler:
|
|
145
|
-
|
|
146
|
-
LinkComponent:
|
|
144
|
+
onClickHandler: n,
|
|
145
|
+
openInSameTabExternalLink: !0,
|
|
146
|
+
LinkComponent: l
|
|
147
147
|
}
|
|
148
148
|
);
|
|
149
149
|
}
|
|
@@ -152,16 +152,16 @@ const E = ({ message: a, timeStamp: e }) => {
|
|
|
152
152
|
const {
|
|
153
153
|
cartData: e,
|
|
154
154
|
cartSettings: c,
|
|
155
|
-
isCartFlyoutActive:
|
|
155
|
+
isCartFlyoutActive: l,
|
|
156
156
|
setCartFlyoutActive: r,
|
|
157
|
-
onChangeQuantity:
|
|
157
|
+
onChangeQuantity: n,
|
|
158
158
|
onRemove: s,
|
|
159
159
|
LinkComponent: i
|
|
160
160
|
} = a, {
|
|
161
161
|
cartTitle: f = "My Cart",
|
|
162
162
|
subtotalLabel: y = "Subtotal",
|
|
163
163
|
productsRelatedTitle: b = "You may also like",
|
|
164
|
-
addedToCartMessage:
|
|
164
|
+
addedToCartMessage: m = "{Product Name} was added to cart",
|
|
165
165
|
removeFromCartMessage: w = "{Product Name} was removed from the cart",
|
|
166
166
|
viewCartBtnLabel: B = "View Cart",
|
|
167
167
|
viewCartBtnUrl: g = "https://www.trimble.com",
|
|
@@ -173,28 +173,28 @@ const E = ({ message: a, timeStamp: e }) => {
|
|
|
173
173
|
} = c || {}, [S, p] = v(null);
|
|
174
174
|
x(() => {
|
|
175
175
|
e?.itemAdded && p({
|
|
176
|
-
message:
|
|
176
|
+
message: m.replace(
|
|
177
177
|
"{Product Name}",
|
|
178
178
|
e?.itemAdded?.name
|
|
179
179
|
),
|
|
180
180
|
// Timestamp ensures the notification re-renders when the same item is added again
|
|
181
181
|
timeStamp: Date.now()
|
|
182
182
|
});
|
|
183
|
-
}, [e?.itemAdded,
|
|
183
|
+
}, [e?.itemAdded, m]);
|
|
184
184
|
const M = (u) => {
|
|
185
|
-
u.preventDefault(), r(!
|
|
185
|
+
u.preventDefault(), r(!l);
|
|
186
186
|
}, D = (u, L, d) => {
|
|
187
|
-
const
|
|
188
|
-
|
|
187
|
+
const _ = s(u, L, d);
|
|
188
|
+
_ && _.then((C) => {
|
|
189
189
|
C && p({
|
|
190
190
|
message: w.replace("{Product Name}", d),
|
|
191
191
|
timeStamp: Date.now()
|
|
192
192
|
});
|
|
193
193
|
});
|
|
194
|
-
}, Z = (u, L, d,
|
|
195
|
-
const C =
|
|
194
|
+
}, Z = (u, L, d, _) => {
|
|
195
|
+
const C = n(u, L, d, _);
|
|
196
196
|
C && C.then((R) => {
|
|
197
|
-
R &&
|
|
197
|
+
R && _ === 0 && p({
|
|
198
198
|
message: w.replace("{Product Name}", d),
|
|
199
199
|
timeStamp: Date.now()
|
|
200
200
|
});
|
|
@@ -210,14 +210,14 @@ const E = ({ message: a, timeStamp: e }) => {
|
|
|
210
210
|
/* @__PURE__ */ t(
|
|
211
211
|
"div",
|
|
212
212
|
{
|
|
213
|
-
className:
|
|
213
|
+
className: l ? "t2-cart-flyout__modal t2-cart-flyout__modal--deployed" : "t2-cart-flyout__modal",
|
|
214
214
|
onClick: M
|
|
215
215
|
}
|
|
216
216
|
),
|
|
217
217
|
/* @__PURE__ */ t(
|
|
218
218
|
"div",
|
|
219
219
|
{
|
|
220
|
-
className:
|
|
220
|
+
className: l ? "t2-cart-flyout t2-cart-flyout--deployed" : "t2-cart-flyout",
|
|
221
221
|
children: /* @__PURE__ */ o("div", { className: "t2-cart-flyout__panel", children: [
|
|
222
222
|
/* @__PURE__ */ o("div", { className: "t2-cart-flyout__header", children: [
|
|
223
223
|
/* @__PURE__ */ o("div", { className: "t2-cart-flyout__header__title", children: [
|
|
@@ -312,7 +312,7 @@ const E = ({ message: a, timeStamp: e }) => {
|
|
|
312
312
|
{
|
|
313
313
|
cartData: e,
|
|
314
314
|
cartSettings: c,
|
|
315
|
-
isCartFlyoutActive:
|
|
315
|
+
isCartFlyoutActive: l,
|
|
316
316
|
setCartFlyoutActive: r,
|
|
317
317
|
onChangeQuantity: Z,
|
|
318
318
|
onRemove: D,
|