From f2e648e63c1513487f50746522f1dff7b603d0b1 Mon Sep 17 00:00:00 2001 From: Chris P Date: Thu, 11 Apr 2019 20:12:21 -0700 Subject: [PATCH 01/49] label & value are required in options --- src/components/Checklist.react.js | 4 ++-- src/components/Dropdown.react.js | 4 ++-- src/components/RadioItems.react.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/Checklist.react.js b/src/components/Checklist.react.js index d19d7cc37..8b2c48de0 100644 --- a/src/components/Checklist.react.js +++ b/src/components/Checklist.react.js @@ -86,14 +86,14 @@ Checklist.propTypes = { /** * The checkbox's label */ - label: PropTypes.string, + label: PropTypes.string.isRequired, /** * The value of the checkbox. This value * corresponds to the items specified in the * `values` property. */ - value: PropTypes.string, + value: PropTypes.string.isRequired, /** * If true, this checkbox is disabled and can't be clicked on. diff --git a/src/components/Dropdown.react.js b/src/components/Dropdown.react.js index 6ea44ee4c..528e571c1 100644 --- a/src/components/Dropdown.react.js +++ b/src/components/Dropdown.react.js @@ -118,14 +118,14 @@ Dropdown.propTypes = { /** * The dropdown's label */ - label: PropTypes.string, + label: PropTypes.string.isRequired, /** * The value of the dropdown. This value * corresponds to the items specified in the * `values` property. */ - value: PropTypes.string, + value: PropTypes.string.isRequired, /** * If true, this dropdown is disabled and items can't be selected. diff --git a/src/components/RadioItems.react.js b/src/components/RadioItems.react.js index 0c92f12cd..5ff147081 100644 --- a/src/components/RadioItems.react.js +++ b/src/components/RadioItems.react.js @@ -85,14 +85,14 @@ RadioItems.propTypes = { /** * The radio item's label */ - label: PropTypes.string, + label: PropTypes.string.isRequired, /** * The value of the radio item. This value * corresponds to the items specified in the * `values` property. */ - value: PropTypes.string, + value: PropTypes.string.isRequired, /** * If true, this radio item is disabled and can't be clicked on. From 6f6d4f4eb49917d52be2d0b3a3eb3cfc8b3f9a27 Mon Sep 17 00:00:00 2001 From: Chris P Date: Thu, 11 Apr 2019 20:12:31 -0700 Subject: [PATCH 02/49] extend data is an array i think? --- src/components/Graph.react.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Graph.react.js b/src/components/Graph.react.js index 82372ab91..190a37806 100644 --- a/src/components/Graph.react.js +++ b/src/components/Graph.react.js @@ -319,7 +319,7 @@ const graphPropTypes = { * Reference the Plotly.extendTraces API for full usage: * https://plot.ly/javascript/plotlyjs-function-reference/#plotlyextendtraces */ - extendData: PropTypes.object, + extendData: PropTypes.array, /** * Data from latest restyle event which occurs From c1aae2990a27c331cf5d143aeae689c1408773cc Mon Sep 17 00:00:00 2001 From: Chris P Date: Thu, 11 Apr 2019 20:12:39 -0700 Subject: [PATCH 03/49] simple figure validation --- src/components/Graph.react.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/Graph.react.js b/src/components/Graph.react.js index 190a37806..0cda78b35 100644 --- a/src/components/Graph.react.js +++ b/src/components/Graph.react.js @@ -339,7 +339,10 @@ const graphPropTypes = { * `config` is set separately by the `config` property, * and `frames` is not supported. */ - figure: PropTypes.object, + figure: PropTypes.shape({ + data: PropTypes.array, + layout: PropTypes.object, + }), /** * Generic style overrides on the plot div From d7687ac52c050d9da33a5a4d0bfd903de0a513e7 Mon Sep 17 00:00:00 2001 From: Chris P Date: Thu, 11 Apr 2019 20:13:45 -0700 Subject: [PATCH 04/49] html property handling - boolean props - can be bools or strings, right? - number props - can be numbers or stringified numbers, right? --- src/components/Input.react.js | 45 +++++++++++++++++++++++++------- src/components/Textarea.react.js | 45 +++++++++++++++++++++++++------- 2 files changed, 72 insertions(+), 18 deletions(-) diff --git a/src/components/Input.react.js b/src/components/Input.react.js index 03dfed8a5..f00dff6c9 100644 --- a/src/components/Input.react.js +++ b/src/components/Input.react.js @@ -141,7 +141,10 @@ Input.propTypes = { * If true, changes to input will be sent back to the Dash server only on enter or when losing focus. * If it's false, it will sent the value back on every change. */ - debounce: PropTypes.bool, + debounce: PropTypes.oneOfType([ + PropTypes.string, + PropTypes.bool + ]), /** * The type of control to render. @@ -162,17 +165,26 @@ Input.propTypes = { /** * This attribute indicates whether the value of the control can be automatically completed by the browser. */ - autocomplete: PropTypes.string, + autocomplete: PropTypes.oneOfType([ + PropTypes.string, + PropTypes.bool + ]), /** * The element should be automatically focused after the page loaded. */ - autofocus: PropTypes.string, + autofocus: PropTypes.oneOfType([ + PropTypes.string, + PropTypes.bool + ]), /** * If true, the input is disabled and can't be clicked on. */ - disabled: PropTypes.bool, + disabled: PropTypes.oneOfType([ + PropTypes.string, + PropTypes.bool + ]), inputmode: PropTypes.oneOf([ /** @@ -249,7 +261,10 @@ Input.propTypes = { /** * If the value of the type attribute is text, email, search, password, tel, or url, this attribute specifies the maximum number of characters (in UTF-16 code units) that the user can enter. For other control types, it is ignored. It can exceed the value of the size attribute. If it is not specified, the user can enter an unlimited number of characters. Specifying a negative number results in the default behavior (i.e. the user can enter an unlimited number of characters). The constraint is evaluated only when the value of the attribute has been changed. */ - maxlength: PropTypes.string, + maxlength: PropTypes.oneOfType([ + PropTypes.string, + PropTypes.number + ]), /** * The minimum (numeric or date-time) value for this item, which must not be greater than its maximum (max attribute) value. @@ -259,7 +274,10 @@ Input.propTypes = { /** * If the value of the type attribute is text, email, search, password, tel, or url, this attribute specifies the minimum number of characters (in Unicode code points) that the user can enter. For other control types, it is ignored. */ - minlength: PropTypes.string, + minlength: PropTypes.oneOfType([ + PropTypes.string, + PropTypes.number + ]), /** * This Boolean attribute indicates whether the user can enter more than one value. This attribute applies when the type attribute is set to email or file, otherwise it is ignored. @@ -279,12 +297,18 @@ Input.propTypes = { /** * A hint to the user of what can be entered in the control . The placeholder text must not contain carriage returns or line-feeds. Note: Do not use the placeholder attribute instead of a