@umbraco-ui/uui-boolean-input
Advanced tools
Comparing version 1.0.0-rc.1 to 1.0.0-rc.2
@@ -21,3 +21,5 @@ import { FormControlMixin, LabelMixin } from '@umbraco-ui/uui-base/lib/mixins'; | ||
}; | ||
class UUIBooleanInputElement extends FormControlMixin(LabelMixin("", LitElement)) { | ||
class UUIBooleanInputElement extends FormControlMixin( | ||
LabelMixin("", LitElement) | ||
) { | ||
constructor(inputRole = "checkbox") { | ||
@@ -32,2 +34,3 @@ super(); | ||
this.inputRole = inputRole; | ||
this.addEventListener("keypress", this._onKeypress); | ||
} | ||
@@ -41,3 +44,5 @@ get value() { | ||
if ("ElementInternals" in window && "setFormValue" in window.ElementInternals.prototype) { | ||
this._internals.setFormValue(this._checked && this.name !== "" ? this._value : null); | ||
this._internals.setFormValue( | ||
this._checked && this.name !== "" ? this._value : null | ||
); | ||
} | ||
@@ -52,3 +57,5 @@ this.requestUpdate("value", oldValue); | ||
this._checked = newVal; | ||
this._internals.setFormValue(this._checked && this.name !== "" ? this._value ? this._value : "on" : null); | ||
this._internals.setFormValue( | ||
this._checked && this.name !== "" ? this._value ? this._value : "on" : null | ||
); | ||
this.requestUpdate("checked", oldValue); | ||
@@ -59,2 +66,7 @@ } | ||
} | ||
_onKeypress(e) { | ||
if (e.key == "Enter") { | ||
this.submit(); | ||
} | ||
} | ||
hasValue() { | ||
@@ -92,3 +104,4 @@ return this.checked; | ||
} | ||
_onInputChange() { | ||
_onInputChange(e) { | ||
e.stopPropagation(); | ||
this.pristine = false; | ||
@@ -95,0 +108,0 @@ this.checked = this._input.checked; |
@@ -43,2 +43,3 @@ import { LitElement, TemplateResult } from 'lit'; | ||
protected getFormElement(): HTMLElement; | ||
private _onKeypress; | ||
hasValue(): boolean; | ||
@@ -45,0 +46,0 @@ formResetCallback(): void; |
{ | ||
"name": "@umbraco-ui/uui-boolean-input", | ||
"version": "1.0.0-rc.1", | ||
"version": "1.0.0-rc.2", | ||
"license": "MIT", | ||
@@ -33,3 +33,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@umbraco-ui/uui-base": "1.0.0-rc.1" | ||
"@umbraco-ui/uui-base": "1.0.0-rc.2" | ||
}, | ||
@@ -45,3 +45,3 @@ "scripts": { | ||
"homepage": "https://uui.umbraco.com/?path=/story/uui-boolean-input", | ||
"gitHead": "127e036dbafa18cc37027591d6548a4cb4700d33" | ||
"gitHead": "436dd8d9fff81481feb88f06b461167c98dac91a" | ||
} |
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
10628
237
+ Added@umbraco-ui/uui-base@1.0.0-rc.2(transitive)
- Removed@umbraco-ui/uui-base@1.0.0-rc.1(transitive)