Skip to content

Commit a4dc60b

Browse files
committed
Keep doc-string order for shape or exact props
1 parent 9323c28 commit a4dc60b

File tree

3 files changed

+53
-2
lines changed

3 files changed

+53
-2
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import React from 'react';
2+
import PropTypes from 'prop-types';
3+
4+
const ShapeOrExactKeepOrderComponent = (props) => {
5+
const { id } = props;
6+
7+
return (
8+
<div id={id} />
9+
);
10+
}
11+
ShapeOrExactKeepOrderComponent.propTypes = {
12+
id: PropTypes.string,
13+
/**
14+
* test prop for shape
15+
*/
16+
shape_test_prop: PropTypes.shape({
17+
/**
18+
* z
19+
*/
20+
z: PropTypes.string,
21+
/**
22+
* a
23+
*/
24+
a: PropTypes.string,
25+
/**
26+
* y
27+
*/
28+
y: PropTypes.string
29+
}),
30+
/**
31+
* test prop for exact
32+
*/
33+
exact_test_prop: PropTypes.exact({
34+
/**
35+
* z
36+
*/
37+
z: PropTypes.string,
38+
/**
39+
* a
40+
*/
41+
a: PropTypes.string,
42+
/**
43+
* y
44+
*/
45+
y: PropTypes.string
46+
}),
47+
}
48+
49+
export default ShapeOrExactKeepOrderComponent;

@plotly/dash-test-components/src/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import ComponentAsProp from './components/ComponentAsProp';
1111
import DrawCounter from './components/DrawCounter';
1212
import AddPropsComponent from "./components/AddPropsComponent";
1313
import ReceivePropsComponent from "./components/ReceivePropsComponent";
14+
import ShapeOrExactKeepOrderComponent from "./components/ShapeOrExactKeepOrderComponent";
1415

1516

1617
export {
@@ -25,5 +26,6 @@ export {
2526
ComponentAsProp,
2627
DrawCounter,
2728
AddPropsComponent,
28-
ReceivePropsComponent
29+
ReceivePropsComponent,
30+
ShapeOrExactKeepOrderComponent
2931
};

dash/development/_py_components_generation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ def shape_or_exact():
557557
default=prop.get("defaultValue"),
558558
indent_num=indent_num + 2,
559559
)
560-
for prop_name, prop in sorted(list(type_object["value"].items()))
560+
for prop_name, prop in list(type_object["value"].items())
561561
)
562562

563563
def array_of():

0 commit comments

Comments
 (0)