From 1733c9489ca7ae96cc5130c99f8c456861d59d29 Mon Sep 17 00:00:00 2001 From: Manu MA Date: Fri, 26 Oct 2018 20:18:53 +0200 Subject: [PATCH] docs(): value for toggle and checkbox (#16102) * docs(): value for toggle and checkbox fixes #16074 * update docs --- core/src/components.d.ts | 8 ++++---- core/src/components/checkbox/checkbox.tsx | 7 ++++++- core/src/components/checkbox/readme.md | 16 ++++++++-------- core/src/components/toggle/readme.md | 16 ++++++++-------- core/src/components/toggle/toggle.tsx | 7 ++++++- 5 files changed, 32 insertions(+), 22 deletions(-) diff --git a/core/src/components.d.ts b/core/src/components.d.ts index e5455874cf..060cd975cd 100644 --- a/core/src/components.d.ts +++ b/core/src/components.d.ts @@ -773,7 +773,7 @@ export namespace Components { */ 'name': string; /** - * The value of the checkbox. + * The value of the toggle does not mean if it's checked or not, use the `checked` property for that. The value of a toggle is analogous to the value of a ``, it's only used when the toggle participates in a native `
`. Defaults to `on`. */ 'value': string; } @@ -815,7 +815,7 @@ export namespace Components { */ 'onIonStyle'?: (event: CustomEvent) => void; /** - * The value of the checkbox. + * The value of the toggle does not mean if it's checked or not, use the `checked` property for that. The value of a toggle is analogous to the value of a ``, it's only used when the toggle participates in a native ``. Defaults to `on`. */ 'value'?: string; } @@ -5017,7 +5017,7 @@ export namespace Components { */ 'name': string; /** - * the value of the toggle. + * The value of the toggle does not mean if it's checked or not, use the `checked` property for that. The value of a toggle is analogous to the value of a ``, it's only used when the toggle participates in a native ``. Defaults to `on`. */ 'value'?: string | null; } @@ -5059,7 +5059,7 @@ export namespace Components { */ 'onIonStyle'?: (event: CustomEvent) => void; /** - * the value of the toggle. + * The value of the toggle does not mean if it's checked or not, use the `checked` property for that. The value of a toggle is analogous to the value of a ``, it's only used when the toggle participates in a native ``. Defaults to `on`. */ 'value'?: string | null; } diff --git a/core/src/components/checkbox/checkbox.tsx b/core/src/components/checkbox/checkbox.tsx index bc2bd631d2..3309cc97b3 100644 --- a/core/src/components/checkbox/checkbox.tsx +++ b/core/src/components/checkbox/checkbox.tsx @@ -50,7 +50,12 @@ export class Checkbox implements ComponentInterface { @Prop() disabled = false; /** - * The value of the checkbox. + * The value of the toggle does not mean if it's checked or not, use the `checked` + * property for that. + * + * The value of a toggle is analogous to the value of a ``, + * it's only used when the toggle participates in a native ``. + * Defaults to `on`. */ @Prop() value = 'on'; diff --git a/core/src/components/checkbox/readme.md b/core/src/components/checkbox/readme.md index e80026716b..c2fa32b69e 100644 --- a/core/src/components/checkbox/readme.md +++ b/core/src/components/checkbox/readme.md @@ -10,14 +10,14 @@ Checkboxes allow the selection of multiple options from a set of options. They a ## Properties -| Property | Attribute | Description | Type | -| ---------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | -| `checked` | `checked` | If `true`, the checkbox is selected. Defaults to `false`. | `boolean` | -| `color` | `color` | The color to use from your application's color palette. Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`. For more information on colors, see [theming](/docs/theming/basics). | `string \| undefined` | -| `disabled` | `disabled` | If `true`, the user cannot interact with the checkbox. Defaults to `false`. | `boolean` | -| `mode` | `mode` | The mode determines which platform styles to use. Possible values are: `"ios"` or `"md"`. | `"ios" \| "md"` | -| `name` | `name` | The name of the control, which is submitted with the form data. | `string` | -| `value` | `value` | The value of the checkbox. | `string` | +| Property | Attribute | Description | Type | +| ---------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | +| `checked` | `checked` | If `true`, the checkbox is selected. Defaults to `false`. | `boolean` | +| `color` | `color` | The color to use from your application's color palette. Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`. For more information on colors, see [theming](/docs/theming/basics). | `string \| undefined` | +| `disabled` | `disabled` | If `true`, the user cannot interact with the checkbox. Defaults to `false`. | `boolean` | +| `mode` | `mode` | The mode determines which platform styles to use. Possible values are: `"ios"` or `"md"`. | `"ios" \| "md"` | +| `name` | `name` | The name of the control, which is submitted with the form data. | `string` | +| `value` | `value` | The value of the toggle does not mean if it's checked or not, use the `checked` property for that. The value of a toggle is analogous to the value of a ``, it's only used when the toggle participates in a native ``. Defaults to `on`. | `string` | ## Events diff --git a/core/src/components/toggle/readme.md b/core/src/components/toggle/readme.md index 82207e49c5..f360ccdc95 100644 --- a/core/src/components/toggle/readme.md +++ b/core/src/components/toggle/readme.md @@ -9,14 +9,14 @@ Toggles change the state of a single option. Toggles can be switched on or off b ## Properties -| Property | Attribute | Description | Type | -| ---------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- | -| `checked` | `checked` | If `true`, the toggle is selected. Defaults to `false`. | `boolean` | -| `color` | `color` | The color to use from your application's color palette. Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`. For more information on colors, see [theming](/docs/theming/basics). | `string \| undefined` | -| `disabled` | `disabled` | If `true`, the user cannot interact with the toggle. Defaults to `false`. | `boolean` | -| `mode` | `mode` | The mode determines which platform styles to use. Possible values are: `"ios"` or `"md"`. | `"ios" \| "md"` | -| `name` | `name` | The name of the control, which is submitted with the form data. | `string` | -| `value` | `value` | the value of the toggle. | `null \| string \| undefined` | +| Property | Attribute | Description | Type | +| ---------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- | +| `checked` | `checked` | If `true`, the toggle is selected. Defaults to `false`. | `boolean` | +| `color` | `color` | The color to use from your application's color palette. Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`. For more information on colors, see [theming](/docs/theming/basics). | `string \| undefined` | +| `disabled` | `disabled` | If `true`, the user cannot interact with the toggle. Defaults to `false`. | `boolean` | +| `mode` | `mode` | The mode determines which platform styles to use. Possible values are: `"ios"` or `"md"`. | `"ios" \| "md"` | +| `name` | `name` | The name of the control, which is submitted with the form data. | `string` | +| `value` | `value` | The value of the toggle does not mean if it's checked or not, use the `checked` property for that. The value of a toggle is analogous to the value of a ``, it's only used when the toggle participates in a native ``. Defaults to `on`. | `null \| string \| undefined` | ## Events diff --git a/core/src/components/toggle/toggle.tsx b/core/src/components/toggle/toggle.tsx index 824587e128..f8625930ae 100644 --- a/core/src/components/toggle/toggle.tsx +++ b/core/src/components/toggle/toggle.tsx @@ -56,7 +56,12 @@ export class Toggle implements ComponentInterface { @Prop() disabled = false; /** - * the value of the toggle. + * The value of the toggle does not mean if it's checked or not, use the `checked` + * property for that. + * + * The value of a toggle is analogous to the value of a ``, + * it's only used when the toggle participates in a native ``. + * Defaults to `on`. */ @Prop() value?: string | null = 'on';