diff --git a/components/dash-core-components/package.json b/components/dash-core-components/package.json index e0649ba66c..5e862d5740 100644 --- a/components/dash-core-components/package.json +++ b/components/dash-core-components/package.json @@ -25,7 +25,7 @@ "test:pyimport": "python -m unittest tests/test_dash_import.py", "prebuild:js": "cp node_modules/plotly.js/dist/plotly.min.js dash_core_components_base/plotly.min.js", "build:js": "webpack --mode production", - "build:backends": "dash-generate-components ./src/components dash_core_components -p package-info.json && cp dash_core_components_base/** dash_core_components/ && dash-generate-components ./src/components dash_core_components -p package-info.json --r-prefix 'dcc' --r-suggests 'dash,dashHtmlComponents,jsonlite,plotly' --jl-prefix 'dcc' && black dash_core_components", + "build:backends": "dash-generate-components ./src/components dash_core_components -p package-info.json && cp dash_core_components_base/** dash_core_components/ && dash-generate-components ./src/components dash_core_components -p package-info.json -k RangeSlider,Slider,Dropdown,RadioItems,Checklist,DatePickerSingle,DatePickerRange,Input,Link --r-prefix 'dcc' --r-suggests 'dash,dashHtmlComponents,jsonlite,plotly' --jl-prefix 'dcc' && black dash_core_components", "build": "run-s prepublishOnly build:js build:backends", "postbuild": "es-check es5 dash_core_components/*.js", "build:watch": "watch 'npm run build' src", diff --git a/components/dash-core-components/src/components/Checklist.react.js b/components/dash-core-components/src/components/Checklist.react.js index fc9a207982..f86b1c6a4b 100644 --- a/components/dash-core-components/src/components/Checklist.react.js +++ b/components/dash-core-components/src/components/Checklist.react.js @@ -148,11 +148,11 @@ Checklist.propTypes = { ), /** - * The ID of this component, used to identify dash components - * in callbacks. The ID needs to be unique across all of the - * components in an app. + * Indicates whether labelStyle should be inline or not + * True: Automatically set { 'display': 'inline-block' } to labelStyle + * False: No additional styles are passed into labelStyle. */ - id: PropTypes.string, + inline: PropTypes.bool, /** * The class of the container (div) @@ -186,6 +186,13 @@ Checklist.propTypes = { */ labelClassName: PropTypes.string, + /** + * The ID of this component, used to identify dash components + * in callbacks. The ID needs to be unique across all of the + * components in an app. + */ + id: PropTypes.string, + /** * Dash-assigned callback that gets fired when the value changes. */ @@ -237,13 +244,6 @@ Checklist.propTypes = { * session: window.sessionStorage, data is cleared once the browser quit. */ persistence_type: PropTypes.oneOf(['local', 'session', 'memory']), - - /** - * Indicates whether labelStyle should be inline or not - * True: Automatically set { 'display': 'inline-block' } to labelStyle - * False: No additional styles are passed into labelStyle. - */ - inline: PropTypes.bool, }; Checklist.defaultProps = { diff --git a/components/dash-core-components/src/components/DatePickerRange.react.js b/components/dash-core-components/src/components/DatePickerRange.react.js index 4d197653b7..e9bcdebd5b 100644 --- a/components/dash-core-components/src/components/DatePickerRange.react.js +++ b/components/dash-core-components/src/components/DatePickerRange.react.js @@ -27,13 +27,6 @@ export default class DatePickerRange extends Component { } DatePickerRange.propTypes = { - /** - * The ID of this component, used to identify dash components - * in callbacks. The ID needs to be unique across all of the - * components in an app. - */ - id: PropTypes.string, - /** * Specifies the starting date for the component. * Accepts datetime.datetime objects or strings @@ -41,18 +34,6 @@ DatePickerRange.propTypes = { */ start_date: PropTypes.string, - /** - * The HTML element ID of the start date input field. - * Not used by Dash, only by CSS. - */ - start_date_id: PropTypes.string, - - /** - * The HTML element ID of the end date input field. - * Not used by Dash, only by CSS. - */ - end_date_id: PropTypes.string, - /** * Specifies the ending date for the component. * Accepts datetime.datetime objects or strings @@ -82,12 +63,20 @@ DatePickerRange.propTypes = { disabled_days: PropTypes.arrayOf(PropTypes.string), /** - * Specifies the month that is initially presented when the user - * opens the calendar. Accepts datetime.datetime objects or strings - * in the format 'YYYY-MM-DD' - * + * Specifies a minimum number of nights that must be selected between + * the startDate and the endDate */ - initial_visible_month: PropTypes.string, + minimum_nights: PropTypes.number, + + /** + * Determines when the component should update + * its value. If `bothdates`, then the DatePicker + * will only trigger its value when the user has + * finished picking both dates. If `singledate`, then + * the DatePicker will update its value + * as one date is picked. + */ + updatemode: PropTypes.oneOf(['singledate', 'bothdates']), /** * Text that will be displayed in the first input @@ -102,22 +91,19 @@ DatePickerRange.propTypes = { end_date_placeholder_text: PropTypes.string, /** - * Size of rendered calendar days, higher number - * means bigger day size and larger calendar overall - */ - day_size: PropTypes.number, - - /** - * Orientation of calendar, either vertical or horizontal. - * Valid options are 'vertical' or 'horizontal'. + * Specifies the month that is initially presented when the user + * opens the calendar. Accepts datetime.datetime objects or strings + * in the format 'YYYY-MM-DD' + * */ - calendar_orientation: PropTypes.oneOf(['vertical', 'horizontal']), + initial_visible_month: PropTypes.string, /** - * Determines whether the calendar and days operate - * from left to right or from right to left + * Whether or not the dropdown is "clearable", that is, whether or + * not a small "x" appears on the right of the dropdown that removes + * the selected value. */ - is_RTL: PropTypes.bool, + clearable: PropTypes.bool, /** * If True, the calendar will automatically open when cleared @@ -125,22 +111,23 @@ DatePickerRange.propTypes = { reopen_calendar_on_clear: PropTypes.bool, /** - * Number of calendar months that are shown when calendar is opened - */ - number_of_months_shown: PropTypes.number, - - /** - * If True, calendar will open in a screen overlay portal, - * not supported on vertical calendar + * Specifies the format that the selected dates will be displayed + * valid formats are variations of "MM YY DD". For example: + * "MM YY DD" renders as '05 10 97' for May 10th 1997 + * "MMMM, YY" renders as 'May, 1997' for May 10th 1997 + * "M, D, YYYY" renders as '07, 10, 1997' for September 10th 1997 + * "MMMM" renders as 'May' for May 10 1997 */ - with_portal: PropTypes.bool, + display_format: PropTypes.string, /** - * If True, calendar will open in a full screen overlay portal, will - * take precedent over 'withPortal' if both are set to true, - * not supported on vertical calendar + * Specifies the format that the month will be displayed in the calendar, + * valid formats are variations of "MM YY". For example: + * "MM YY" renders as '05 97' for May 1997 + * "MMMM, YYYY" renders as 'May, 1997' for May 1997 + * "MMM, YY" renders as 'Sep, 97' for September 1997 */ - with_full_screen_portal: PropTypes.bool, + month_format: PropTypes.string, /** * Specifies what day is the first day of the week, values must be @@ -149,10 +136,10 @@ DatePickerRange.propTypes = { first_day_of_week: PropTypes.oneOf([0, 1, 2, 3, 4, 5, 6]), /** - * Specifies a minimum number of nights that must be selected between - * the startDate and the endDate + * If True the calendar will display days that rollover into + * the next month */ - minimum_nights: PropTypes.number, + show_outside_days: PropTypes.bool, /** * If True the calendar will not close when the user has selected a value @@ -161,29 +148,40 @@ DatePickerRange.propTypes = { stay_open_on_select: PropTypes.bool, /** - * If True the calendar will display days that rollover into - * the next month + * Orientation of calendar, either vertical or horizontal. + * Valid options are 'vertical' or 'horizontal'. */ - show_outside_days: PropTypes.bool, + calendar_orientation: PropTypes.oneOf(['vertical', 'horizontal']), /** - * Specifies the format that the month will be displayed in the calendar, - * valid formats are variations of "MM YY". For example: - * "MM YY" renders as '05 97' for May 1997 - * "MMMM, YYYY" renders as 'May, 1997' for May 1997 - * "MMM, YY" renders as 'Sep, 97' for September 1997 + * Number of calendar months that are shown when calendar is opened */ - month_format: PropTypes.string, + number_of_months_shown: PropTypes.number, /** - * Specifies the format that the selected dates will be displayed - * valid formats are variations of "MM YY DD". For example: - * "MM YY DD" renders as '05 10 97' for May 10th 1997 - * "MMMM, YY" renders as 'May, 1997' for May 10th 1997 - * "M, D, YYYY" renders as '07, 10, 1997' for September 10th 1997 - * "MMMM" renders as 'May' for May 10 1997 + * If True, calendar will open in a screen overlay portal, + * not supported on vertical calendar */ - display_format: PropTypes.string, + with_portal: PropTypes.bool, + + /** + * If True, calendar will open in a full screen overlay portal, will + * take precedent over 'withPortal' if both are set to true, + * not supported on vertical calendar + */ + with_full_screen_portal: PropTypes.bool, + + /** + * Size of rendered calendar days, higher number + * means bigger day size and larger calendar overall + */ + day_size: PropTypes.number, + + /** + * Determines whether the calendar and days operate + * from left to right or from right to left + */ + is_RTL: PropTypes.bool, /** * If True, no dates can be selected. @@ -191,16 +189,16 @@ DatePickerRange.propTypes = { disabled: PropTypes.bool, /** - * Whether or not the dropdown is "clearable", that is, whether or - * not a small "x" appears on the right of the dropdown that removes - * the selected value. + * The HTML element ID of the start date input field. + * Not used by Dash, only by CSS. */ - clearable: PropTypes.bool, + start_date_id: PropTypes.string, /** - * Dash-assigned callback that gets fired when the value changes. + * The HTML element ID of the end date input field. + * Not used by Dash, only by CSS. */ - setProps: PropTypes.func, + end_date_id: PropTypes.string, /** * CSS styles appended to wrapper div @@ -213,14 +211,16 @@ DatePickerRange.propTypes = { className: PropTypes.string, /** - * Determines when the component should update - * its value. If `bothdates`, then the DatePicker - * will only trigger its value when the user has - * finished picking both dates. If `singledate`, then - * the DatePicker will update its value - * as one date is picked. + * The ID of this component, used to identify dash components + * in callbacks. The ID needs to be unique across all of the + * components in an app. */ - updatemode: PropTypes.oneOf(['singledate', 'bothdates']), + id: PropTypes.string, + + /** + * Dash-assigned callback that gets fired when the value changes. + */ + setProps: PropTypes.func, /** * Object that holds the loading state object coming from dash-renderer diff --git a/components/dash-core-components/src/components/DatePickerSingle.react.js b/components/dash-core-components/src/components/DatePickerSingle.react.js index 85ef116ac8..792e9f6b75 100644 --- a/components/dash-core-components/src/components/DatePickerSingle.react.js +++ b/components/dash-core-components/src/components/DatePickerSingle.react.js @@ -27,13 +27,6 @@ export default class DatePickerSingle extends Component { } DatePickerSingle.propTypes = { - /** - * The ID of this component, used to identify dash components - * in callbacks. The ID needs to be unique across all of the - * components in an app. - */ - id: PropTypes.string, - /** * Specifies the starting date for the component, best practice is to pass * value via datetime object @@ -61,6 +54,13 @@ DatePickerSingle.propTypes = { */ disabled_days: PropTypes.arrayOf(PropTypes.string), + /** + * Text that will be displayed in the input + * box of the date picker when no date is selected. + * Default value is 'Start Date' + */ + placeholder: PropTypes.string, + /** * Specifies the month that is initially presented when the user * opens the calendar. Accepts datetime.datetime objects or strings @@ -70,88 +70,89 @@ DatePickerSingle.propTypes = { initial_visible_month: PropTypes.string, /** - * Size of rendered calendar days, higher number - * means bigger day size and larger calendar overall + * Whether or not the dropdown is "clearable", that is, whether or + * not a small "x" appears on the right of the dropdown that removes + * the selected value. */ - day_size: PropTypes.number, + clearable: PropTypes.bool, /** - * Orientation of calendar, either vertical or horizontal. - * Valid options are 'vertical' or 'horizontal'. + * If True, the calendar will automatically open when cleared */ - calendar_orientation: PropTypes.oneOf(['vertical', 'horizontal']), + reopen_calendar_on_clear: PropTypes.bool, /** - * Determines whether the calendar and days operate - * from left to right or from right to left + * Specifies the format that the selected dates will be displayed + * valid formats are variations of "MM YY DD". For example: + * "MM YY DD" renders as '05 10 97' for May 10th 1997 + * "MMMM, YY" renders as 'May, 1997' for May 10th 1997 + * "M, D, YYYY" renders as '07, 10, 1997' for September 10th 1997 + * "MMMM" renders as 'May' for May 10 1997 */ - is_RTL: PropTypes.bool, + display_format: PropTypes.string, + /** - * Text that will be displayed in the input - * box of the date picker when no date is selected. - * Default value is 'Start Date' + * Specifies the format that the month will be displayed in the calendar, + * valid formats are variations of "MM YY". For example: + * "MM YY" renders as '05 97' for May 1997 + * "MMMM, YYYY" renders as 'May, 1997' for May 1997 + * "MMM, YY" renders as 'Sep, 97' for September 1997 */ - placeholder: PropTypes.string, + month_format: PropTypes.string, /** - * If True, the calendar will automatically open when cleared + * Specifies what day is the first day of the week, values must be + * from [0, ..., 6] with 0 denoting Sunday and 6 denoting Saturday */ - reopen_calendar_on_clear: PropTypes.bool, + first_day_of_week: PropTypes.oneOf([0, 1, 2, 3, 4, 5, 6]), /** - * Number of calendar months that are shown when calendar is opened + * If True the calendar will display days that rollover into + * the next month */ - number_of_months_shown: PropTypes.number, + show_outside_days: PropTypes.bool, /** - * If True, calendar will open in a screen overlay portal, - * not supported on vertical calendar + * If True the calendar will not close when the user has selected a value + * and will wait until the user clicks off the calendar */ - with_portal: PropTypes.bool, + stay_open_on_select: PropTypes.bool, /** - * If True, calendar will open in a full screen overlay portal, will - * take precedent over 'withPortal' if both are set to True, - * not supported on vertical calendar + * Orientation of calendar, either vertical or horizontal. + * Valid options are 'vertical' or 'horizontal'. */ - with_full_screen_portal: PropTypes.bool, + calendar_orientation: PropTypes.oneOf(['vertical', 'horizontal']), /** - * Specifies what day is the first day of the week, values must be - * from [0, ..., 6] with 0 denoting Sunday and 6 denoting Saturday + * Number of calendar months that are shown when calendar is opened */ - first_day_of_week: PropTypes.oneOf([0, 1, 2, 3, 4, 5, 6]), + number_of_months_shown: PropTypes.number, /** - * If True the calendar will not close when the user has selected a value - * and will wait until the user clicks off the calendar + * If True, calendar will open in a screen overlay portal, + * not supported on vertical calendar */ - stay_open_on_select: PropTypes.bool, + with_portal: PropTypes.bool, /** - * If True the calendar will display days that rollover into - * the next month + * If True, calendar will open in a full screen overlay portal, will + * take precedent over 'withPortal' if both are set to True, + * not supported on vertical calendar */ - show_outside_days: PropTypes.bool, + with_full_screen_portal: PropTypes.bool, /** - * Specifies the format that the month will be displayed in the calendar, - * valid formats are variations of "MM YY". For example: - * "MM YY" renders as '05 97' for May 1997 - * "MMMM, YYYY" renders as 'May, 1997' for May 1997 - * "MMM, YY" renders as 'Sep, 97' for September 1997 + * Size of rendered calendar days, higher number + * means bigger day size and larger calendar overall */ - month_format: PropTypes.string, + day_size: PropTypes.number, /** - * Specifies the format that the selected dates will be displayed - * valid formats are variations of "MM YY DD". For example: - * "MM YY DD" renders as '05 10 97' for May 10th 1997 - * "MMMM, YY" renders as 'May, 1997' for May 10th 1997 - * "M, D, YYYY" renders as '07, 10, 1997' for September 10th 1997 - * "MMMM" renders as 'May' for May 10 1997 + * Determines whether the calendar and days operate + * from left to right or from right to left */ - display_format: PropTypes.string, + is_RTL: PropTypes.bool, /** * If True, no dates can be selected. @@ -159,26 +160,26 @@ DatePickerSingle.propTypes = { disabled: PropTypes.bool, /** - * Whether or not the dropdown is "clearable", that is, whether or - * not a small "x" appears on the right of the dropdown that removes - * the selected value. + * CSS styles appended to wrapper div */ - clearable: PropTypes.bool, + style: PropTypes.object, /** - * Dash-assigned callback that gets fired when the value changes. + * Appends a CSS class to the wrapper div component. */ - setProps: PropTypes.func, + className: PropTypes.string, /** - * CSS styles appended to wrapper div + * The ID of this component, used to identify dash components + * in callbacks. The ID needs to be unique across all of the + * components in an app. */ - style: PropTypes.object, + id: PropTypes.string, /** - * Appends a CSS class to the wrapper div component. + * Dash-assigned callback that gets fired when the value changes. */ - className: PropTypes.string, + setProps: PropTypes.func, /** * Object that holds the loading state object coming from dash-renderer diff --git a/components/dash-core-components/src/components/Dropdown.react.js b/components/dash-core-components/src/components/Dropdown.react.js index f329443b8d..e8187648af 100644 --- a/components/dash-core-components/src/components/Dropdown.react.js +++ b/components/dash-core-components/src/components/Dropdown.react.js @@ -107,28 +107,31 @@ Dropdown.propTypes = { ]), /** - * The ID of this component, used to identify dash components - * in callbacks. The ID needs to be unique across all of the - * components in an app. + * If true, the user can select multiple values */ - id: PropTypes.string, + multi: PropTypes.bool, /** - * height of each option. Can be increased when label lengths would wrap around + * Whether or not the dropdown is "clearable", that is, whether or + * not a small "x" appears on the right of the dropdown that removes + * the selected value. */ - optionHeight: PropTypes.number, + clearable: PropTypes.bool, /** - * className of the dropdown element + * Whether to enable the searching feature or not */ - className: PropTypes.string, + searchable: PropTypes.bool, /** - * Whether or not the dropdown is "clearable", that is, whether or - * not a small "x" appears on the right of the dropdown that removes - * the selected value. + * The value typed in the DropDown for searching. */ - clearable: PropTypes.bool, + search_value: PropTypes.string, + + /** + * The grey, default text shown when no option is selected + */ + placeholder: PropTypes.string, /** * If true, this dropdown is disabled and the selection cannot be changed. @@ -136,35 +139,32 @@ Dropdown.propTypes = { disabled: PropTypes.bool, /** - * If true, the user can select multiple values + * height of each option. Can be increased when label lengths would wrap around */ - multi: PropTypes.bool, + optionHeight: PropTypes.number, /** - * The grey, default text shown when no option is selected + * Defines CSS styles which will override styles previously set. */ - placeholder: PropTypes.string, + style: PropTypes.object, /** - * Whether to enable the searching feature or not + * className of the dropdown element */ - searchable: PropTypes.bool, + className: PropTypes.string, /** - * The value typed in the DropDown for searching. + * The ID of this component, used to identify dash components + * in callbacks. The ID needs to be unique across all of the + * components in an app. */ - search_value: PropTypes.string, + id: PropTypes.string, /** * Dash-assigned callback that gets fired when the input changes */ setProps: PropTypes.func, - /** - * Defines CSS styles which will override styles previously set. - */ - style: PropTypes.object, - /** * Object that holds the loading state object coming from dash-renderer */ diff --git a/components/dash-core-components/src/components/Input.react.js b/components/dash-core-components/src/components/Input.react.js index 99573b4935..18bf374a99 100644 --- a/components/dash-core-components/src/components/Input.react.js +++ b/components/dash-core-components/src/components/Input.react.js @@ -165,34 +165,11 @@ Input.defaultProps = { }; Input.propTypes = { - /** - * The ID of this component, used to identify dash components - * in callbacks. The ID needs to be unique across all of the - * components in an app. - */ - id: PropTypes.string, - /** * The value of the input */ value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), - /** - * The input's inline styles - */ - style: PropTypes.object, - - /** - * The class of the input element - */ - className: PropTypes.string, - - /** - * 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, - /** * The type of control to render. */ @@ -210,30 +187,24 @@ Input.propTypes = { ]), /** - * This attribute indicates whether the value of the control can be automatically completed by the browser. + * 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. */ - autoComplete: PropTypes.string, + debounce: PropTypes.bool, /** - * The element should be automatically focused after the page loaded. - * autoFocus is an HTML boolean attribute - it is enabled by a boolean or - * 'autoFocus'. Alternative capitalizations `autofocus` & `AUTOFOCUS` - * are also acccepted. + * 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