* Get the dash props from a component path or id. * * @param componentPathOrId The path or the id of the component to get the props of. * @param propPath Additional key to get the property instead of plain props. * @returns
(componentPathOrId: DashLayoutPath | string)
| 19 | * @returns |
| 20 | */ |
| 21 | function getLayout(componentPathOrId: DashLayoutPath | string): any { |
| 22 | const ds = getStores(); |
| 23 | for (let y = 0; y < ds.length; y++) { |
| 24 | const {paths, layout} = ds[y].getState(); |
| 25 | let componentPath; |
| 26 | if (!Array.isArray(componentPathOrId)) { |
| 27 | componentPath = getPath(paths, componentPathOrId); |
| 28 | } else { |
| 29 | componentPath = componentPathOrId; |
| 30 | } |
| 31 | const props = path(componentPath, layout); |
| 32 | if (props !== undefined) { |
| 33 | return props; |
| 34 | } |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | window.dash_component_api = Object.assign(window.dash_component_api || {}, { |
| 39 | ExternalWrapper, |