@conectate/ct-checkbox
Advanced tools
Comparing version 3.9.0 to 3.10.0
@@ -33,2 +33,1 @@ import '@conectate/ct-icon'; | ||
} | ||
//# sourceMappingURL=ct-checkbox.d.ts.map |
@@ -15,45 +15,11 @@ import { __decorate } from "tslib"; | ||
let CtCheckbox = class CtCheckbox extends CtLit { | ||
constructor() { | ||
super(...arguments); | ||
this.disabled = false; | ||
this.checked = false; | ||
this.name = ''; | ||
this.label = ''; | ||
} | ||
render() { | ||
return html ` | ||
<input id="input" type="checkbox" @click=${this.toogleCheck} .checked=${this.checked} .disabled=${this.disabled} /> | ||
<div class="c"> | ||
<span id="box"> | ||
<ct-icon | ||
id="checkmark" | ||
class=${classMap({ rotate: this.indeterminate == false && this.checked })} | ||
icon="${this.indeterminate ? 'horizontal_rule' : `check`}" | ||
dir="ltr" | ||
></ct-icon> | ||
</span> | ||
<label id="label" for="input">${this.label}<slot></slot></label> | ||
</div> | ||
`; | ||
} | ||
updated(_changedProperties) { | ||
if (_changedProperties.has('checked') && _changedProperties.get('checked') != undefined) { | ||
this.indeterminate = false; | ||
this.change(); | ||
} | ||
} | ||
click() { | ||
this.$input.click(); | ||
} | ||
toogleCheck() { | ||
this.checked = this.$input.checked; | ||
} | ||
change() { | ||
if (this.checked) | ||
this.indeterminate = false; | ||
this.dispatchEvent(new CustomEvent('checked', { detail: { checked: this.$input.checked } })); | ||
} | ||
}; | ||
CtCheckbox.styles = [ | ||
css ` | ||
indeterminate; | ||
disabled = false; | ||
checked = false; | ||
value; | ||
name = ''; | ||
label = ''; | ||
$input; | ||
static styles = [ | ||
css ` | ||
:host { | ||
@@ -98,4 +64,4 @@ display: inline-flex; | ||
`, | ||
// Checkmark | ||
css ` | ||
// Checkmark | ||
css ` | ||
#checkmark { | ||
@@ -131,4 +97,4 @@ opacity: 0; | ||
`, | ||
// Box | ||
css ` | ||
// Box | ||
css ` | ||
#box { | ||
@@ -173,3 +139,37 @@ display: flex; | ||
` | ||
]; | ||
]; | ||
render() { | ||
return html ` | ||
<input id="input" type="checkbox" @click=${this.toogleCheck} .checked=${this.checked} .disabled=${this.disabled} /> | ||
<div class="c"> | ||
<span id="box"> | ||
<ct-icon | ||
id="checkmark" | ||
class=${classMap({ rotate: this.indeterminate == false && this.checked })} | ||
icon="${this.indeterminate ? 'horizontal_rule' : `check`}" | ||
dir="ltr" | ||
></ct-icon> | ||
</span> | ||
<label id="label" for="input">${this.label}<slot></slot></label> | ||
</div> | ||
`; | ||
} | ||
updated(_changedProperties) { | ||
if (_changedProperties.has('checked') && _changedProperties.get('checked') != undefined) { | ||
this.indeterminate = false; | ||
this.change(); | ||
} | ||
} | ||
click() { | ||
this.$input.click(); | ||
} | ||
toogleCheck() { | ||
this.checked = this.$input.checked; | ||
} | ||
change() { | ||
if (this.checked) | ||
this.indeterminate = false; | ||
this.dispatchEvent(new CustomEvent('checked', { detail: { checked: this.$input.checked } })); | ||
} | ||
}; | ||
__decorate([ | ||
@@ -200,2 +200,1 @@ property({ type: Boolean, reflect: true }) | ||
export { CtCheckbox }; | ||
//# sourceMappingURL=ct-checkbox.js.map |
{ | ||
"name": "@conectate/ct-checkbox", | ||
"version": "3.9.0", | ||
"version": "3.10.0", | ||
"description": "HTML checkbox web component based on Material design", | ||
@@ -13,4 +13,4 @@ "main": "ct-checkbox.js", | ||
"dependencies": { | ||
"@conectate/ct-icon": "^3.9.0", | ||
"@conectate/ct-lit": "^3.9.0", | ||
"@conectate/ct-icon": "^3.10.0", | ||
"@conectate/ct-lit": "^3.10.0", | ||
"lit": "^2.8.0", | ||
@@ -38,11 +38,11 @@ "tslib": "^2.6.1" | ||
".": { | ||
"development": "./src/ct-checkbox.ts", | ||
"dev": "./src/ct-checkbox.ts", | ||
"default": "./ct-checkbox.js" | ||
}, | ||
"./*": { | ||
"development": "./src/*", | ||
"dev": "./src/*", | ||
"default": "./*" | ||
} | ||
}, | ||
"gitHead": "3585c80117a1e24dd02d2645f5d2a6c2b8c15799" | ||
"gitHead": "d8992206d4f6ca934be0088596735b5414f3c984" | ||
} |
9802
5
225
Updated@conectate/ct-icon@^3.10.0
Updated@conectate/ct-lit@^3.10.0