Skip to content

Commit

Permalink
refactor: toggle inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
mlmoravek committed Oct 7, 2023
1 parent b35c339 commit 15199c5
Show file tree
Hide file tree
Showing 12 changed files with 649 additions and 466 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,8 @@ const checkboxCustom = ref("Yes");
<o-field>
<o-checkbox label="Disabled" disabled />
</o-field>
<o-field>
<o-checkbox label="Required" required />
</o-field>
</section>
</template>
43 changes: 23 additions & 20 deletions packages/docs-next/components/Checkbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,29 +36,32 @@ title: Checkbox

### Props

| Prop name | Description | Type | Values | Default |
| -------------- | ------------------------------------------------------------------------------------ | ------------------------------ | ------------------------------------------------------------------------------- | ----------------------------------------------------------- |
| ariaLabelledby | Accessibility label to establish relationship between the checkbox and control label | string | - | <code style='white-space: nowrap; padding: 0;'></code> |
| autocomplete | | string | - | <code style='white-space: nowrap; padding: 0;'></code> |
| disabled | Same as native disabled | boolean | - | <code style='white-space: nowrap; padding: 0;'></code> |
| falseValue | Overrides the returned value when it's not checked | string\|number\|boolean | - | <code style='white-space: nowrap; padding: 0;'>false</code> |
| indeterminate | Same as native indeterminate | boolean | - | <code style='white-space: nowrap; padding: 0;'>false</code> |
| label | Input label, unnecessary when default slot is used | string | - | |
| name | Same as native name | string | - | <code style='white-space: nowrap; padding: 0;'></code> |
| nativeValue | Same as native value | string\|number\|boolean\|array | - | <code style='white-space: nowrap; padding: 0;'></code> |
| override | | boolean | - | <code style='white-space: nowrap; padding: 0;'></code> |
| required | | boolean | - | <code style='white-space: nowrap; padding: 0;'></code> |
| size | Size of the control, optional | string | `small`, `medium`, `large` | <code style='white-space: nowrap; padding: 0;'></code> |
| trueValue | Overrides the returned value when it's checked | string\|number\|boolean | - | <code style='white-space: nowrap; padding: 0;'>true</code> |
| v-model | | string\|number\|boolean\|array | - | <code style='white-space: nowrap; padding: 0;'></code> |
| variant | Color of the control, optional | string | `primary`, `info`, `success`, `warning`, `danger`, `and any other custom color` | <code style='white-space: nowrap; padding: 0;'></code> |
| Prop name | Description | Type | Values | Default |
| ------------------ | ------------------------------------------------------------------------------------ | ------------------------------ | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| ariaLabelledby | Accessibility label to establish relationship between the checkbox and control label | string | - | Default function (see source code) |
| autocomplete | Same as native autocomplete options to use in HTML5 validation | string | - | <div><small>From <b>config</b>:</small></div><code style='white-space: nowrap; padding: 0;'>checkbox: {<br>&nbsp;&nbsp;autocomplete: "off"<br>}</code> |
| disabled | Same as native disabled | boolean | - | <code style='white-space: nowrap; padding: 0;'>false</code> |
| falseValue | Overrides the returned value when it's not checked | string\|number\|boolean | - | <code style='white-space: nowrap; padding: 0;'>false</code> |
| indeterminate | Same as native indeterminate | boolean | - | <code style='white-space: nowrap; padding: 0;'>false</code> |
| label | Input label, unnecessary when default slot is used | string | - | |
| name | Same as native name | string | - | |
| nativeValue | Same as native value | string\|number\|boolean | - | |
| required | Same as native required | boolean | - | <code style='white-space: nowrap; padding: 0;'>false</code> |
| size | Size of the control | string | `small`, `medium`, `large` | <div><small>From <b>config</b>:</small></div><code style='white-space: nowrap; padding: 0;'>checkbox: {<br>&nbsp;&nbsp;size: undefined<br>}</code> |
| trueValue | Overrides the returned value when it's checked | string\|number\|boolean | - | <code style='white-space: nowrap; padding: 0;'>true</code> |
| useHtml5Validation | Enable html 5 native validation | boolean | - | <div><small>From <b>config</b>:</small></div><code style='white-space: nowrap; padding: 0;'>{<br>&nbsp;&nbsp;useHtml5Validation: true<br>}</code> |
| v-model | | string\|number\|boolean\|array | - | |
| variant | Color of the control, optional | string | `primary`, `info`, `success`, `warning`, `danger`, `and any other custom color` | <div><small>From <b>config</b>:</small></div><code style='white-space: nowrap; padding: 0;'>checkbox: {<br>&nbsp;&nbsp;variant: undefined<br>}</code> |

### Events

| Event name | Properties | Description |
| ----------------- | ---------- | ----------- |
| update:modelValue | |
| input | |
| Event name | Properties | Description |
| -------------------- | -------------------------------------------------------------------- | ---------------------------------- |
| update:modelValue | **value** `string, number, boolean, array` - updated modelValue prop | modelValue prop two-way binding |
| update:indeterminate | **value** `boolean` - updated indeterminate prop | indeterminate prop two-way binding |
| focus | **event** `Event` - native event | on input focus event |
| blur | **event** `Event` - native event | on input blur event |
| invalid | **event** `Event` - native event | on input invalid event |

### Slots

Expand Down
Loading

0 comments on commit 15199c5

Please sign in to comment.