Skip to content

Commit 0f1b299

Browse files
authored
Adding prop reorder exceptions (#1866)
* Adding prop reorder exceptions * Reworking prop order flag * Removing unnecessary variable * Reverting build:backends script changes * Adding operator * Adding default positional arg * Updating docstring function * Updated radioitems prop order * Prop order changes for dcc * Updated DataTable prop order * Update Checklist prop order * Updated DataTable prop order * Update DatePickerSingle, DatePickerRange, Input, Link prop orders * Re-running tests * Re-running tests
1 parent 03c6c8c commit 0f1b299

16 files changed

+879
-826
lines changed

components/dash-core-components/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"test:pyimport": "python -m unittest tests/test_dash_import.py",
2626
"prebuild:js": "cp node_modules/plotly.js/dist/plotly.min.js dash_core_components_base/plotly.min.js",
2727
"build:js": "webpack --mode production",
28-
"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",
28+
"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",
2929
"build": "run-s prepublishOnly build:js build:backends",
3030
"postbuild": "es-check es5 dash_core_components/*.js",
3131
"build:watch": "watch 'npm run build' src",

components/dash-core-components/src/components/Checklist.react.js

+11-11
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,11 @@ Checklist.propTypes = {
148148
),
149149

150150
/**
151-
* The ID of this component, used to identify dash components
152-
* in callbacks. The ID needs to be unique across all of the
153-
* components in an app.
151+
* Indicates whether labelStyle should be inline or not
152+
* True: Automatically set { 'display': 'inline-block' } to labelStyle
153+
* False: No additional styles are passed into labelStyle.
154154
*/
155-
id: PropTypes.string,
155+
inline: PropTypes.bool,
156156

157157
/**
158158
* The class of the container (div)
@@ -186,6 +186,13 @@ Checklist.propTypes = {
186186
*/
187187
labelClassName: PropTypes.string,
188188

189+
/**
190+
* The ID of this component, used to identify dash components
191+
* in callbacks. The ID needs to be unique across all of the
192+
* components in an app.
193+
*/
194+
id: PropTypes.string,
195+
189196
/**
190197
* Dash-assigned callback that gets fired when the value changes.
191198
*/
@@ -237,13 +244,6 @@ Checklist.propTypes = {
237244
* session: window.sessionStorage, data is cleared once the browser quit.
238245
*/
239246
persistence_type: PropTypes.oneOf(['local', 'session', 'memory']),
240-
241-
/**
242-
* Indicates whether labelStyle should be inline or not
243-
* True: Automatically set { 'display': 'inline-block' } to labelStyle
244-
* False: No additional styles are passed into labelStyle.
245-
*/
246-
inline: PropTypes.bool,
247247
};
248248

249249
Checklist.defaultProps = {

components/dash-core-components/src/components/DatePickerRange.react.js

+80-80
Original file line numberDiff line numberDiff line change
@@ -27,32 +27,13 @@ export default class DatePickerRange extends Component {
2727
}
2828

2929
DatePickerRange.propTypes = {
30-
/**
31-
* The ID of this component, used to identify dash components
32-
* in callbacks. The ID needs to be unique across all of the
33-
* components in an app.
34-
*/
35-
id: PropTypes.string,
36-
3730
/**
3831
* Specifies the starting date for the component.
3932
* Accepts datetime.datetime objects or strings
4033
* in the format 'YYYY-MM-DD'
4134
*/
4235
start_date: PropTypes.string,
4336

44-
/**
45-
* The HTML element ID of the start date input field.
46-
* Not used by Dash, only by CSS.
47-
*/
48-
start_date_id: PropTypes.string,
49-
50-
/**
51-
* The HTML element ID of the end date input field.
52-
* Not used by Dash, only by CSS.
53-
*/
54-
end_date_id: PropTypes.string,
55-
5637
/**
5738
* Specifies the ending date for the component.
5839
* Accepts datetime.datetime objects or strings
@@ -82,12 +63,20 @@ DatePickerRange.propTypes = {
8263
disabled_days: PropTypes.arrayOf(PropTypes.string),
8364

8465
/**
85-
* Specifies the month that is initially presented when the user
86-
* opens the calendar. Accepts datetime.datetime objects or strings
87-
* in the format 'YYYY-MM-DD'
88-
*
66+
* Specifies a minimum number of nights that must be selected between
67+
* the startDate and the endDate
8968
*/
90-
initial_visible_month: PropTypes.string,
69+
minimum_nights: PropTypes.number,
70+
71+
/**
72+
* Determines when the component should update
73+
* its value. If `bothdates`, then the DatePicker
74+
* will only trigger its value when the user has
75+
* finished picking both dates. If `singledate`, then
76+
* the DatePicker will update its value
77+
* as one date is picked.
78+
*/
79+
updatemode: PropTypes.oneOf(['singledate', 'bothdates']),
9180

9281
/**
9382
* Text that will be displayed in the first input
@@ -102,45 +91,43 @@ DatePickerRange.propTypes = {
10291
end_date_placeholder_text: PropTypes.string,
10392

10493
/**
105-
* Size of rendered calendar days, higher number
106-
* means bigger day size and larger calendar overall
107-
*/
108-
day_size: PropTypes.number,
109-
110-
/**
111-
* Orientation of calendar, either vertical or horizontal.
112-
* Valid options are 'vertical' or 'horizontal'.
94+
* Specifies the month that is initially presented when the user
95+
* opens the calendar. Accepts datetime.datetime objects or strings
96+
* in the format 'YYYY-MM-DD'
97+
*
11398
*/
114-
calendar_orientation: PropTypes.oneOf(['vertical', 'horizontal']),
99+
initial_visible_month: PropTypes.string,
115100

116101
/**
117-
* Determines whether the calendar and days operate
118-
* from left to right or from right to left
102+
* Whether or not the dropdown is "clearable", that is, whether or
103+
* not a small "x" appears on the right of the dropdown that removes
104+
* the selected value.
119105
*/
120-
is_RTL: PropTypes.bool,
106+
clearable: PropTypes.bool,
121107

122108
/**
123109
* If True, the calendar will automatically open when cleared
124110
*/
125111
reopen_calendar_on_clear: PropTypes.bool,
126112

127113
/**
128-
* Number of calendar months that are shown when calendar is opened
129-
*/
130-
number_of_months_shown: PropTypes.number,
131-
132-
/**
133-
* If True, calendar will open in a screen overlay portal,
134-
* not supported on vertical calendar
114+
* Specifies the format that the selected dates will be displayed
115+
* valid formats are variations of "MM YY DD". For example:
116+
* "MM YY DD" renders as '05 10 97' for May 10th 1997
117+
* "MMMM, YY" renders as 'May, 1997' for May 10th 1997
118+
* "M, D, YYYY" renders as '07, 10, 1997' for September 10th 1997
119+
* "MMMM" renders as 'May' for May 10 1997
135120
*/
136-
with_portal: PropTypes.bool,
121+
display_format: PropTypes.string,
137122

138123
/**
139-
* If True, calendar will open in a full screen overlay portal, will
140-
* take precedent over 'withPortal' if both are set to true,
141-
* not supported on vertical calendar
124+
* Specifies the format that the month will be displayed in the calendar,
125+
* valid formats are variations of "MM YY". For example:
126+
* "MM YY" renders as '05 97' for May 1997
127+
* "MMMM, YYYY" renders as 'May, 1997' for May 1997
128+
* "MMM, YY" renders as 'Sep, 97' for September 1997
142129
*/
143-
with_full_screen_portal: PropTypes.bool,
130+
month_format: PropTypes.string,
144131

145132
/**
146133
* Specifies what day is the first day of the week, values must be
@@ -149,10 +136,10 @@ DatePickerRange.propTypes = {
149136
first_day_of_week: PropTypes.oneOf([0, 1, 2, 3, 4, 5, 6]),
150137

151138
/**
152-
* Specifies a minimum number of nights that must be selected between
153-
* the startDate and the endDate
139+
* If True the calendar will display days that rollover into
140+
* the next month
154141
*/
155-
minimum_nights: PropTypes.number,
142+
show_outside_days: PropTypes.bool,
156143

157144
/**
158145
* If True the calendar will not close when the user has selected a value
@@ -161,46 +148,57 @@ DatePickerRange.propTypes = {
161148
stay_open_on_select: PropTypes.bool,
162149

163150
/**
164-
* If True the calendar will display days that rollover into
165-
* the next month
151+
* Orientation of calendar, either vertical or horizontal.
152+
* Valid options are 'vertical' or 'horizontal'.
166153
*/
167-
show_outside_days: PropTypes.bool,
154+
calendar_orientation: PropTypes.oneOf(['vertical', 'horizontal']),
168155

169156
/**
170-
* Specifies the format that the month will be displayed in the calendar,
171-
* valid formats are variations of "MM YY". For example:
172-
* "MM YY" renders as '05 97' for May 1997
173-
* "MMMM, YYYY" renders as 'May, 1997' for May 1997
174-
* "MMM, YY" renders as 'Sep, 97' for September 1997
157+
* Number of calendar months that are shown when calendar is opened
175158
*/
176-
month_format: PropTypes.string,
159+
number_of_months_shown: PropTypes.number,
177160

178161
/**
179-
* Specifies the format that the selected dates will be displayed
180-
* valid formats are variations of "MM YY DD". For example:
181-
* "MM YY DD" renders as '05 10 97' for May 10th 1997
182-
* "MMMM, YY" renders as 'May, 1997' for May 10th 1997
183-
* "M, D, YYYY" renders as '07, 10, 1997' for September 10th 1997
184-
* "MMMM" renders as 'May' for May 10 1997
162+
* If True, calendar will open in a screen overlay portal,
163+
* not supported on vertical calendar
185164
*/
186-
display_format: PropTypes.string,
165+
with_portal: PropTypes.bool,
166+
167+
/**
168+
* If True, calendar will open in a full screen overlay portal, will
169+
* take precedent over 'withPortal' if both are set to true,
170+
* not supported on vertical calendar
171+
*/
172+
with_full_screen_portal: PropTypes.bool,
173+
174+
/**
175+
* Size of rendered calendar days, higher number
176+
* means bigger day size and larger calendar overall
177+
*/
178+
day_size: PropTypes.number,
179+
180+
/**
181+
* Determines whether the calendar and days operate
182+
* from left to right or from right to left
183+
*/
184+
is_RTL: PropTypes.bool,
187185

188186
/**
189187
* If True, no dates can be selected.
190188
*/
191189
disabled: PropTypes.bool,
192190

193191
/**
194-
* Whether or not the dropdown is "clearable", that is, whether or
195-
* not a small "x" appears on the right of the dropdown that removes
196-
* the selected value.
192+
* The HTML element ID of the start date input field.
193+
* Not used by Dash, only by CSS.
197194
*/
198-
clearable: PropTypes.bool,
195+
start_date_id: PropTypes.string,
199196

200197
/**
201-
* Dash-assigned callback that gets fired when the value changes.
198+
* The HTML element ID of the end date input field.
199+
* Not used by Dash, only by CSS.
202200
*/
203-
setProps: PropTypes.func,
201+
end_date_id: PropTypes.string,
204202

205203
/**
206204
* CSS styles appended to wrapper div
@@ -213,14 +211,16 @@ DatePickerRange.propTypes = {
213211
className: PropTypes.string,
214212

215213
/**
216-
* Determines when the component should update
217-
* its value. If `bothdates`, then the DatePicker
218-
* will only trigger its value when the user has
219-
* finished picking both dates. If `singledate`, then
220-
* the DatePicker will update its value
221-
* as one date is picked.
214+
* The ID of this component, used to identify dash components
215+
* in callbacks. The ID needs to be unique across all of the
216+
* components in an app.
222217
*/
223-
updatemode: PropTypes.oneOf(['singledate', 'bothdates']),
218+
id: PropTypes.string,
219+
220+
/**
221+
* Dash-assigned callback that gets fired when the value changes.
222+
*/
223+
setProps: PropTypes.func,
224224

225225
/**
226226
* Object that holds the loading state object coming from dash-renderer

0 commit comments

Comments
 (0)