@justeattakeaway/pie-switch 0.29.6 → 0.29.7
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/custom-elements.json +3 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/react.d.ts +2 -2
- package/package.json +1 -1
- package/src/index.ts +3 -3
package/custom-elements.json
CHANGED
|
@@ -166,7 +166,8 @@
|
|
|
166
166
|
},
|
|
167
167
|
{
|
|
168
168
|
"kind": "method",
|
|
169
|
-
"name": "
|
|
169
|
+
"name": "handleChange",
|
|
170
|
+
"privacy": "private",
|
|
170
171
|
"parameters": [
|
|
171
172
|
{
|
|
172
173
|
"name": "event",
|
|
@@ -176,7 +177,7 @@
|
|
|
176
177
|
"description": "This should be the change event that was listened for on an input element with `type=\"checkbox\"`."
|
|
177
178
|
}
|
|
178
179
|
],
|
|
179
|
-
"description": "The
|
|
180
|
+
"description": "The handleChange function updates the checkbox state and emits an event for consumers."
|
|
180
181
|
},
|
|
181
182
|
{
|
|
182
183
|
"kind": "method",
|
package/dist/index.d.ts
CHANGED
|
@@ -51,10 +51,10 @@ export declare class PieSwitch extends PieSwitch_base implements SwitchProps, PI
|
|
|
51
51
|
*/
|
|
52
52
|
private handleFormAssociation;
|
|
53
53
|
/**
|
|
54
|
-
* The
|
|
54
|
+
* The handleChange function updates the checkbox state and emits an event for consumers.
|
|
55
55
|
* @param {Event} event - This should be the change event that was listened for on an input element with `type="checkbox"`.
|
|
56
56
|
*/
|
|
57
|
-
|
|
57
|
+
private handleChange;
|
|
58
58
|
/**
|
|
59
59
|
* Returns a boolean value which indicates validity of the value of the component. If the value is invalid, this method also fires the invalid event on the component.
|
|
60
60
|
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/checkValidity
|
package/dist/index.js
CHANGED
|
@@ -515,10 +515,10 @@ class p extends Ie(Se(Fe)) {
|
|
|
515
515
|
!!this._internals.form && !!this.name && !!this.value && (this.disabled ? (this._internals.setFormValue(null), this._internals.setValidity({})) : this.checked ? (this._internals.setFormValue(this.value), this._internals.setValidity({})) : (this._internals.setFormValue(null), this._internals.setValidity(this.validity, this.validationMessage, this.input)));
|
|
516
516
|
}
|
|
517
517
|
/**
|
|
518
|
-
* The
|
|
518
|
+
* The handleChange function updates the checkbox state and emits an event for consumers.
|
|
519
519
|
* @param {Event} event - This should be the change event that was listened for on an input element with `type="checkbox"`.
|
|
520
520
|
*/
|
|
521
|
-
|
|
521
|
+
handleChange(n) {
|
|
522
522
|
const { checked: l } = n == null ? void 0 : n.currentTarget;
|
|
523
523
|
this.checked = l;
|
|
524
524
|
const h = Te(n);
|
|
@@ -603,7 +603,7 @@ class p extends Ie(Se(Fe)) {
|
|
|
603
603
|
.required=${c}
|
|
604
604
|
.checked="${h}"
|
|
605
605
|
.disabled="${w}"
|
|
606
|
-
@change="${this.
|
|
606
|
+
@change="${this.handleChange}"
|
|
607
607
|
aria-label="${(l == null ? void 0 : l.label) || C}"
|
|
608
608
|
aria-describedby="${l != null && l.describedBy ? M : C}">
|
|
609
609
|
<div class="c-switch-control">
|
package/dist/react.d.ts
CHANGED
|
@@ -54,10 +54,10 @@ declare class PieSwitch_2 extends PieSwitch_base implements SwitchProps, PIEInpu
|
|
|
54
54
|
*/
|
|
55
55
|
private handleFormAssociation;
|
|
56
56
|
/**
|
|
57
|
-
* The
|
|
57
|
+
* The handleChange function updates the checkbox state and emits an event for consumers.
|
|
58
58
|
* @param {Event} event - This should be the change event that was listened for on an input element with `type="checkbox"`.
|
|
59
59
|
*/
|
|
60
|
-
|
|
60
|
+
private handleChange;
|
|
61
61
|
/**
|
|
62
62
|
* Returns a boolean value which indicates validity of the value of the component. If the value is invalid, this method also fires the invalid event on the component.
|
|
63
63
|
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/checkValidity
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -91,10 +91,10 @@ export class PieSwitch extends FormControlMixin(RtlMixin(LitElement)) implements
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
/**
|
|
94
|
-
* The
|
|
94
|
+
* The handleChange function updates the checkbox state and emits an event for consumers.
|
|
95
95
|
* @param {Event} event - This should be the change event that was listened for on an input element with `type="checkbox"`.
|
|
96
96
|
*/
|
|
97
|
-
|
|
97
|
+
private handleChange (event: Event) {
|
|
98
98
|
const { checked } = event?.currentTarget as HTMLInputElement;
|
|
99
99
|
this.checked = checked;
|
|
100
100
|
const changedEvent = wrapNativeEvent(event);
|
|
@@ -196,7 +196,7 @@ export class PieSwitch extends FormControlMixin(RtlMixin(LitElement)) implements
|
|
|
196
196
|
.required=${required}
|
|
197
197
|
.checked="${checked}"
|
|
198
198
|
.disabled="${disabled}"
|
|
199
|
-
@change="${this.
|
|
199
|
+
@change="${this.handleChange}"
|
|
200
200
|
aria-label="${aria?.label || nothing}"
|
|
201
201
|
aria-describedby="${aria?.describedBy ? switchId : nothing}">
|
|
202
202
|
<div class="c-switch-control">
|