@justeattakeaway/pie-webc-core
Advanced tools
Comparing version 0.0.0-snapshot-release-20240405071915 to 0.0.0-snapshot-release-20240405110454
# Changelog | ||
## 0.0.0-snapshot-release-20240405071915 | ||
## 0.0.0-snapshot-release-20240405110454 | ||
@@ -5,0 +5,0 @@ ### Minor Changes |
import { isServer as l } from "lit"; | ||
const m = (t, e, n) => function(s, i) { | ||
const o = `#${i}`; | ||
Object.defineProperty(s, i, { | ||
const m = (t, e, n) => function(s, r) { | ||
const o = `#${r}`; | ||
Object.defineProperty(s, r, { | ||
get() { | ||
@@ -10,3 +10,3 @@ return this[o]; | ||
e.includes(a) ? this[o] = a : (console.error( | ||
`<${t}> Invalid value "${a}" provided for property "${i}".`, | ||
`<${t}> Invalid value "${a}" provided for property "${r}".`, | ||
`Must be one of: ${e.join(" | ")}.`, | ||
@@ -18,10 +18,10 @@ `Falling back to default value: "${n}"` | ||
}); | ||
}, f = (t) => function(n, r) { | ||
const s = `#${r}`; | ||
Object.defineProperty(n, r, { | ||
}, f = (t) => function(n, i) { | ||
const s = `#${i}`; | ||
Object.defineProperty(n, i, { | ||
get() { | ||
return this[s]; | ||
}, | ||
set(i) { | ||
(i == null || typeof i == "string" && i.trim() === "") && console.error(`<${t}> Missing required attribute "${r}"`), this[s] = i; | ||
set(r) { | ||
(r == null || typeof r == "string" && r.trim() === "") && console.error(`<${t}> Missing required attribute "${i}"`), this[s] = r; | ||
}, | ||
@@ -45,3 +45,3 @@ configurable: !0 | ||
e.startsWith("pie-") || console.warn("A custom event name should start with `pie-`"); | ||
const r = new CustomEvent(e, { | ||
const i = new CustomEvent(e, { | ||
bubbles: !0, | ||
@@ -51,3 +51,3 @@ composed: !0, | ||
}); | ||
t.dispatchEvent(r); | ||
t.dispatchEvent(i); | ||
} | ||
@@ -72,4 +72,6 @@ const b = (t) => { | ||
function c(t, e) { | ||
const n = t.querySelectorAll("pie-input"), r = Array.from(n).find((s) => !s.validity.valid); | ||
r && (e.preventDefault(), r.focus()); | ||
const n = t.querySelectorAll("pie-input"), i = Array.from(n).find((s) => !s.validity.valid); | ||
i && (e.preventDefault(), setTimeout(() => { | ||
i.focus(); | ||
}, 0)); | ||
} | ||
@@ -93,7 +95,7 @@ class d { | ||
return; | ||
const r = { | ||
const i = { | ||
listener: this.handleSubmit, | ||
form: e | ||
}; | ||
e.addEventListener("submit", r.listener), this._forms.set(e, r); | ||
e.addEventListener("submit", i.listener), this._forms.set(e, i); | ||
} | ||
@@ -120,4 +122,4 @@ /** | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
constructor(...r) { | ||
super(...r), this._internals = this.attachInternals(); | ||
constructor(...i) { | ||
super(...i), this._internals = this.attachInternals(); | ||
} | ||
@@ -128,4 +130,4 @@ get form() { | ||
connectedCallback() { | ||
var r; | ||
super.connectedCallback(), this.form && (window.pieFormManager || (window.pieFormManager = new d()), window.pieFormManager && (window.pieFormManager.addForm(this.form), this._managedForm = (r = window.pieFormManager.getForm(this.form)) == null ? void 0 : r.form)); | ||
var i; | ||
super.connectedCallback(), this.form && (window.pieFormManager || (window.pieFormManager = new d()), window.pieFormManager && (window.pieFormManager.addForm(this.form), this._managedForm = (i = window.pieFormManager.getForm(this.form)) == null ? void 0 : i.form)); | ||
} | ||
@@ -132,0 +134,0 @@ disconnectedCallback() { |
{ | ||
"name": "@justeattakeaway/pie-webc-core", | ||
"version": "0.0.0-snapshot-release-20240405071915", | ||
"version": "0.0.0-snapshot-release-20240405110454", | ||
"description": "PIE design system base classes, mixins and utilities for web components", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -14,3 +14,5 @@ import { PIEInputElement } from '../interfaces'; | ||
event.preventDefault(); | ||
firstInvalidInput.focus(); | ||
setTimeout(() => { | ||
firstInvalidInput.focus(); | ||
}, 0); | ||
} | ||
@@ -17,0 +19,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
62948
1278