Skip to content
Snippets Groups Projects
Commit f1019c95 authored by druid's avatar druid
Browse files

checked property for hy-checkbox

parent 99af8315
No related branches found
No related tags found
No related merge requests found
...@@ -221,6 +221,10 @@ export namespace Components { ...@@ -221,6 +221,10 @@ export namespace Components {
variant: ButtonVariants; variant: ButtonVariants;
} }
interface HyCheckbox { interface HyCheckbox {
/**
* Checked attribute
*/
checkboxChecked: boolean;
/** /**
* Unique id for checkbox element * Unique id for checkbox element
*/ */
...@@ -1500,6 +1504,10 @@ declare namespace LocalJSX { ...@@ -1500,6 +1504,10 @@ declare namespace LocalJSX {
variant?: ButtonVariants; variant?: ButtonVariants;
} }
interface HyCheckbox { interface HyCheckbox {
/**
* Checked attribute
*/
checkboxChecked?: boolean;
/** /**
* Unique id for checkbox element * Unique id for checkbox element
*/ */
......
...@@ -19,6 +19,10 @@ export class HyCheckbox { ...@@ -19,6 +19,10 @@ export class HyCheckbox {
* Label for input to describe * Label for input to describe
*/ */
@Prop() checkboxLabel: string; @Prop() checkboxLabel: string;
/**
* Checked attribute
*/
@Prop() checkboxChecked: boolean = false;
/** /**
* Variant to deifne what style of checkbox to use * Variant to deifne what style of checkbox to use
*/ */
...@@ -32,6 +36,7 @@ export class HyCheckbox { ...@@ -32,6 +36,7 @@ export class HyCheckbox {
<input <input
type="checkbox" type="checkbox"
class="hy-checkbox--button__checkbox" class="hy-checkbox--button__checkbox"
checked={this.checkboxChecked}
id={`${this.checkboxId}`} id={`${this.checkboxId}`}
value={`${this.checkboxValue}`} value={`${this.checkboxValue}`}
/> />
...@@ -50,6 +55,7 @@ export class HyCheckbox { ...@@ -50,6 +55,7 @@ export class HyCheckbox {
<input <input
type="checkbox" type="checkbox"
class="hy-checkbox__checkbox" class="hy-checkbox__checkbox"
checked={this.checkboxChecked}
id={`${this.checkboxId}`} id={`${this.checkboxId}`}
value={`${this.checkboxValue}`} value={`${this.checkboxValue}`}
/> />
......
...@@ -4,12 +4,13 @@ ...@@ -4,12 +4,13 @@
## Properties ## Properties
| Property | Attribute | Description | Type | Default | | Property | Attribute | Description | Type | Default |
| --------------- | ---------------- | ----------------------------------------------- | ----------------------------------------------------- | -------------------------- | | ----------------- | ------------------ | ----------------------------------------------- | ----------------------------------------------------- | -------------------------- |
| `checkboxId` | `checkbox-id` | Unique id for checkbox element | `number \| string` | `undefined` | | `checkboxChecked` | `checkbox-checked` | Checked attribute | `boolean` | `false` |
| `checkboxLabel` | `checkbox-label` | Label for input to describe | `string` | `undefined` | | `checkboxId` | `checkbox-id` | Unique id for checkbox element | `number \| string` | `undefined` |
| `checkboxValue` | `checkbox-value` | Value for input element | `number \| string` | `undefined` | | `checkboxLabel` | `checkbox-label` | Label for input to describe | `string` | `undefined` |
| `variant` | `variant` | Variant to deifne what style of checkbox to use | `CheckboxVariants.button \| CheckboxVariants.default` | `CheckboxVariants.default` | | `checkboxValue` | `checkbox-value` | Value for input element | `number \| string` | `undefined` |
| `variant` | `variant` | Variant to deifne what style of checkbox to use | `CheckboxVariants.button \| CheckboxVariants.default` | `CheckboxVariants.default` |
## Dependencies ## Dependencies
......
...@@ -408,17 +408,29 @@ Do you want to shape the future world and understand how the universe is built u ...@@ -408,17 +408,29 @@ Do you want to shape the future world and understand how the universe is built u
</hy-paragraph-text> </hy-paragraph-text>
<hy-box pt="2" pb="2" align="center"> <hy-box pt="2" pb="2" align="center">
<hy-checkbox checkbox-id="1" checkbox-value="checkbox_1" checkbox-label="Introduction course"></hy-checkbox> <hy-checkbox
<hy-checkbox checkbox-id="2" checkbox-value="checkbox_2" checkbox-label="Open online course"></hy-checkbox> checkbox-id="1"
checkbox-value="checkbox_1"
checkbox-label="Introduction course"
checkbox-checked="true"
></hy-checkbox>
<hy-checkbox
checkbox-id="2"
checkbox-value="checkbox_2"
checkbox-label="Open online course"
checkbox-checked="false"
></hy-checkbox>
<hy-checkbox checkbox-id="3" checkbox-value="checkbox_3" checkbox-label="Flexible start"></hy-checkbox> <hy-checkbox checkbox-id="3" checkbox-value="checkbox_3" checkbox-label="Flexible start"></hy-checkbox>
<hy-checkbox <hy-checkbox
checkbox-id="4" checkbox-id="4"
checkbox-checked="true"
checkbox-value="checkbox_4" checkbox-value="checkbox_4"
checkbox-label="Introduction course long text" checkbox-label="Introduction course long text"
></hy-checkbox> ></hy-checkbox>
<hy-checkbox <hy-checkbox
checkbox-id="5" checkbox-id="5"
checkbox-value="checkbox_5" checkbox-value="checkbox_5"
checkbox-checked="true"
checkbox-label="Open online course very long text" checkbox-label="Open online course very long text"
></hy-checkbox> ></hy-checkbox>
<hy-checkbox <hy-checkbox
...@@ -432,12 +444,14 @@ Do you want to shape the future world and understand how the universe is built u ...@@ -432,12 +444,14 @@ Do you want to shape the future world and understand how the universe is built u
variant="button" variant="button"
checkbox-id="3" checkbox-id="3"
checkbox-value="checkbox_3" checkbox-value="checkbox_3"
checkbox-checked="true"
checkbox-label="Web pages (204)" checkbox-label="Web pages (204)"
></hy-checkbox> ></hy-checkbox>
<hy-checkbox <hy-checkbox
variant="button" variant="button"
checkbox-id="4" checkbox-id="4"
checkbox-value="checkbox_4" checkbox-value="checkbox_4"
checkbox-checked="false"
checkbox-label="People (89)" checkbox-label="People (89)"
></hy-checkbox> ></hy-checkbox>
<hy-checkbox <hy-checkbox
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment