@odus/checkout 1.5.1 → 1.5.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/dist/elements.es.js +13 -9
- package/dist/package.json +1 -1
- package/dist/shared.js +5 -2
- package/package.json +1 -1
package/dist/elements.es.js
CHANGED
|
@@ -238,10 +238,10 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
238
238
|
let n = j.has(t), r = j.has(e);
|
|
239
239
|
if (n && r && t !== e) {
|
|
240
240
|
let { t } = o(), n = e, r = t(n === "US" ? "address.chooseState" : "address.chooseProvince");
|
|
241
|
-
this._select?.setOptions(p(n), r), this._value = "";
|
|
241
|
+
this._select?.setOptions(p(n), r), this._value = "", this.emit("change", this._value);
|
|
242
242
|
return;
|
|
243
243
|
}
|
|
244
|
-
n !== r && (this._value = "", this.render());
|
|
244
|
+
n !== r && (this._value = "", this.render(), this.emit("change", this._value));
|
|
245
245
|
}
|
|
246
246
|
render() {
|
|
247
247
|
if (this.shadowRoot) if (this._input?.getElement().remove(), this._select?.getElement().remove(), this._input = null, this._select = null, j.has(this._country)) {
|
|
@@ -259,10 +259,11 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
259
259
|
value: this._value,
|
|
260
260
|
autocomplete: "address-level1",
|
|
261
261
|
onChange: (e) => {
|
|
262
|
-
this._value = e.target.value, this.emit("change", this._value);
|
|
262
|
+
this._value = e.target.value, this._input?.setError(!1), this.emit("change", this._value);
|
|
263
263
|
}
|
|
264
264
|
}), this._input.addEventListener("blur", () => {
|
|
265
|
-
this.
|
|
265
|
+
let e = this.getIsValid();
|
|
266
|
+
this._input?.setError(!e, this.getError() ?? void 0), this.emit("blur", this._value);
|
|
266
267
|
}), this.shadowRoot.appendChild(this._input.getElement());
|
|
267
268
|
}
|
|
268
269
|
_renderSelect(e) {
|
|
@@ -276,10 +277,11 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
276
277
|
options: n,
|
|
277
278
|
autocomplete: "address-level1",
|
|
278
279
|
onChange: (e) => {
|
|
279
|
-
this._value = e.target.value, this.emit("change", this._value);
|
|
280
|
+
this._value = e.target.value, this._select?.setError(!1), this.emit("change", this._value);
|
|
280
281
|
}
|
|
281
282
|
}), this._select.addEventListener("blur", () => {
|
|
282
|
-
this.
|
|
283
|
+
let e = this.getIsValid();
|
|
284
|
+
this._select?.setError(!e, this.getError() ?? void 0), this.emit("blur", this._value);
|
|
283
285
|
}), this.shadowRoot.appendChild(this._select.getElement());
|
|
284
286
|
}
|
|
285
287
|
getCss() {
|
|
@@ -294,10 +296,12 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
294
296
|
return this._value;
|
|
295
297
|
}
|
|
296
298
|
getIsValid() {
|
|
297
|
-
return !0;
|
|
299
|
+
return this._select ? this._value.trim().length > 0 : !0;
|
|
298
300
|
}
|
|
299
301
|
getError() {
|
|
300
|
-
return null;
|
|
302
|
+
if (this.getIsValid()) return null;
|
|
303
|
+
let { t: e } = o();
|
|
304
|
+
return e("validation.stateRequired");
|
|
301
305
|
}
|
|
302
306
|
}, N = class extends T {
|
|
303
307
|
_value = "";
|
|
@@ -659,7 +663,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
659
663
|
}
|
|
660
664
|
_reinitWithTheme() {
|
|
661
665
|
this._vgsReinitTimer && clearTimeout(this._vgsReinitTimer), this._vgsReinitTimer = setTimeout(() => {
|
|
662
|
-
this._vgsReinitTimer = null, this._vgsService.destroy(), this._vgsService = new t(), this.initVgs();
|
|
666
|
+
this._vgsReinitTimer = null, this._vgsService.destroy(), this._vgsService = new t(), this._section?.setVgsService(this._vgsService), this.initVgs();
|
|
663
667
|
}, 300);
|
|
664
668
|
}
|
|
665
669
|
_buildProfileFromTheme(e) {
|
package/dist/package.json
CHANGED
package/dist/shared.js
CHANGED
|
@@ -328,7 +328,7 @@ var e = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
328
328
|
url: ve(e.environment),
|
|
329
329
|
app: {
|
|
330
330
|
name: "odus-checkout",
|
|
331
|
-
version: "1.5.
|
|
331
|
+
version: "1.5.2",
|
|
332
332
|
environment: e.environment === "test" ? "sandbox" : "production"
|
|
333
333
|
},
|
|
334
334
|
isolate: !0,
|
|
@@ -5140,7 +5140,7 @@ var wa = (e) => {
|
|
|
5140
5140
|
addressLine1: "Address Line 1",
|
|
5141
5141
|
firstName: "First Name",
|
|
5142
5142
|
lastName: "Last Name",
|
|
5143
|
-
state: "State
|
|
5143
|
+
state: "State/Region",
|
|
5144
5144
|
city: "City",
|
|
5145
5145
|
townCity: "Town/City",
|
|
5146
5146
|
zipCode: "Zip Code",
|
|
@@ -6816,6 +6816,9 @@ var po = (e) => e.replace(/([A-Z])/g, " $1").trim(), mo = Object.fromEntries(Obj
|
|
|
6816
6816
|
_focusVgsField(e) {
|
|
6817
6817
|
this._vgsService?.focusField(e);
|
|
6818
6818
|
}
|
|
6819
|
+
setVgsService(e) {
|
|
6820
|
+
this._vgsService = e;
|
|
6821
|
+
}
|
|
6819
6822
|
setOnVgsAutoFocus(e) {
|
|
6820
6823
|
this._onVgsAutoFocus = e;
|
|
6821
6824
|
}
|