@justeattakeaway/pie-checkbox
Advanced tools
Comparing version 0.0.0-snapshot-release-20240522115923 to 0.0.0-snapshot-release-20240522125118
@@ -172,2 +172,13 @@ { | ||
{ | ||
"kind": "method", | ||
"name": "formResetCallback", | ||
"privacy": "public", | ||
"return": { | ||
"type": { | ||
"text": "void" | ||
} | ||
}, | ||
"description": "Called when the form that owns this component is reset.\nResets the value to the default value." | ||
}, | ||
{ | ||
"kind": "field", | ||
@@ -174,0 +185,0 @@ "name": "handleChange", |
@@ -88,2 +88,7 @@ import { ComponentDefaultPropsGeneric } from '@justeattakeaway/pie-webc-core'; | ||
formDisabledCallback(disabled: boolean): void; | ||
/** | ||
* Called when the form that owns this component is reset. | ||
* Resets the value to the default value. | ||
*/ | ||
formResetCallback(): void; | ||
protected updated(_changedProperties: PropertyValues<this>): void; | ||
@@ -90,0 +95,0 @@ /** |
@@ -1,6 +0,6 @@ | ||
import { LitElement as b, html as y, nothing as p, unsafeCSS as f } from "lit"; | ||
import { LitElement as b, html as y, nothing as d, unsafeCSS as f } from "lit"; | ||
import { FormControlMixin as v, RtlMixin as k, wrapNativeEvent as x, defineCustomElement as g } from "@justeattakeaway/pie-webc-core"; | ||
import { property as n, query as $ } from "lit/decorators.js"; | ||
import { property as n, query as C } from "lit/decorators.js"; | ||
import { ifDefined as h } from "lit/directives/if-defined.js"; | ||
const C = `*,*:after,*:before{box-sizing:inherit} | ||
const $ = `*,*:after,*:before{box-sizing:inherit} | ||
`, u = { | ||
@@ -10,8 +10,8 @@ required: !1, | ||
}; | ||
var q = Object.defineProperty, O = Object.getOwnPropertyDescriptor, r = (c, e, l, a) => { | ||
for (var i = a > 1 ? void 0 : a ? O(e, l) : e, s = c.length - 1, d; s >= 0; s--) | ||
(d = c[s]) && (i = (a ? d(e, l, i) : d(i)) || i); | ||
return a && i && q(e, l, i), i; | ||
var _ = Object.defineProperty, q = Object.getOwnPropertyDescriptor, r = (p, e, l, a) => { | ||
for (var i = a > 1 ? void 0 : a ? q(e, l) : e, s = p.length - 1, c; s >= 0; s--) | ||
(c = p[s]) && (i = (a ? c(e, l, i) : c(i)) || i); | ||
return a && i && _(e, l, i), i; | ||
}; | ||
const _ = "pie-checkbox"; | ||
const O = "pie-checkbox"; | ||
class t extends v(k(b)) { | ||
@@ -43,2 +43,9 @@ constructor() { | ||
} | ||
/** | ||
* Called when the form that owns this component is reset. | ||
* Resets the value to the default value. | ||
*/ | ||
formResetCallback() { | ||
this._internals.setFormValue(this.value || "on"); | ||
} | ||
updated(e) { | ||
@@ -54,3 +61,3 @@ super.updated(e), this._internals.setFormValue(this.checked ? this.value || "on" : null); | ||
disabled: s, | ||
required: d, | ||
required: c, | ||
indeterminate: m, | ||
@@ -67,7 +74,7 @@ aria: o | ||
?disabled=${s} | ||
.required=${d} | ||
.required=${c} | ||
.indeterminate=${m} | ||
aria-label=${(o == null ? void 0 : o.label) || p} | ||
aria-labelledby=${i ? p : (o == null ? void 0 : o.labelledby) || p} | ||
aria-describedby= ${(o == null ? void 0 : o.describedby) || p} | ||
aria-label=${(o == null ? void 0 : o.label) || d} | ||
aria-labelledby=${i ? d : (o == null ? void 0 : o.labelledby) || d} | ||
aria-describedby= ${(o == null ? void 0 : o.describedby) || d} | ||
@click=${this.handleClick} | ||
@@ -82,3 +89,3 @@ @change=${this.handleChange} | ||
t.shadowRootOptions = { ...b.shadowRootOptions, delegatesFocus: !0 }; | ||
t.styles = f(C); | ||
t.styles = f($); | ||
r([ | ||
@@ -109,5 +116,5 @@ n({ type: String }) | ||
r([ | ||
$('input[type="checkbox"]') | ||
C('input[type="checkbox"]') | ||
], t.prototype, "checkbox", 2); | ||
g(_, t); | ||
g(O, t); | ||
export { | ||
@@ -114,0 +121,0 @@ t as PieCheckbox, |
@@ -91,2 +91,7 @@ import { ComponentDefaultPropsGeneric } from '@justeattakeaway/pie-webc-core'; | ||
formDisabledCallback(disabled: boolean): void; | ||
/** | ||
* Called when the form that owns this component is reset. | ||
* Resets the value to the default value. | ||
*/ | ||
formResetCallback(): void; | ||
protected updated(_changedProperties: PropertyValues<this>): void; | ||
@@ -93,0 +98,0 @@ /** |
{ | ||
"name": "@justeattakeaway/pie-checkbox", | ||
"description": "PIE Design System Checkbox built using Web Components", | ||
"version": "0.0.0-snapshot-release-20240522115923", | ||
"version": "0.0.0-snapshot-release-20240522125118", | ||
"type": "module", | ||
@@ -6,0 +6,0 @@ "main": "dist/index.js", |
@@ -80,2 +80,10 @@ import { | ||
/** | ||
* Called when the form that owns this component is reset. | ||
* Resets the value to the default value. | ||
*/ | ||
public formResetCallback (): void { | ||
this._internals.setFormValue(this.value || 'on'); | ||
} | ||
protected updated (_changedProperties: PropertyValues<this>): void { | ||
@@ -82,0 +90,0 @@ super.updated(_changedProperties); |
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
35002
829