From 83cb9cac2558919a4916f57882001b623b477a85 Mon Sep 17 00:00:00 2001 From: Chao Liang Date: Wed, 27 Mar 2019 14:09:10 +1100 Subject: [PATCH] fix: update checkbox doc --- docs/examples/CheckboxExample.jsx | 104 +++++++++++++++++------------- 1 file changed, 60 insertions(+), 44 deletions(-) diff --git a/docs/examples/CheckboxExample.jsx b/docs/examples/CheckboxExample.jsx index e362a00d9..f6b97ac0d 100644 --- a/docs/examples/CheckboxExample.jsx +++ b/docs/examples/CheckboxExample.jsx @@ -36,7 +36,7 @@ const CheckboxExample = () => ( onChange={handleChange} />

Partial Selected

- + @@ -61,51 +61,67 @@ const CheckboxExample = () => ( const exampleProps = { componentName: 'Checkbox', - notes: '', + notes: ( +

+ This component supports 3 states checked, partial checked and non-checked +

+ ), exampleCodeSnippet: ` + handleChange = (nextCheckState, name, value) => { + // onChange logic + // The nextCheckState is: + // true => false false => true 'partial' => false + } +

Not selected

- - - Checked: false
Disabled -

- } - checked={false} - disabled - inline - /> -

Selected

- - - Checked: true
Disabled -

- } - checked - disabled - inline - /> -

Partial Selected

- - - Checked: 'partial'
Disabled -

- } - checked="partial" - disabled - inline - /> -

Checkboxes without labels

- - - - - - + + + Checked: false
Disabled +

+ } + checked={false} + disabled + inline + className="fix-size" + onChange={handleChange} + /> +

Selected

+ + + Checked: true
Disabled +

+ } + checked + disabled + inline + className="fix-size" + onChange={handleChange} + /> +

Partial Selected

+ + + Checked: 'partial'
Disabled +

+ } + checked="partial" + disabled + inline + className="fix-size" + onChange={handleChange} + /> +

Checkboxes without labels

+ + + + + + `, propTypeSectionArray: [ {