|
5 | 5 |
|
6 | 6 | class Scrollspy(Component):
|
7 | 7 | """A Scrollspy component.
|
8 |
| -
|
| 8 | +Component for building in-page navigation menus with scrollspy functionality |
9 | 9 |
|
10 | 10 | Keyword arguments:
|
11 |
| -- className (string; optional) |
12 |
| -- menuGroups (list; optional) |
13 |
| -- activeItemClassName (string; optional) |
14 |
| -- offset (number; optional) |
15 |
| -- menuLabelClassName (string; optional) |
16 |
| -- menuContainerClassName (string; optional) |
17 |
| -- menuItemClassName (string; optional)""" |
| 11 | +- menuGroups (list; optional): An array of MenuGroup items that is used to build the menu and its links. |
| 12 | +Each MenuGroup has an optional label and a required 'items' array of MenuItems. |
| 13 | +Each MenuItem has a label that is rendered in the menu and a targetId that is the id of the element it should link to. |
| 14 | +Do not include '#' in targetId. |
| 15 | +example: |
| 16 | + [ |
| 17 | + {label: '...', items: [ |
| 18 | + {label: '...', targetId: '...'}, |
| 19 | + {label: '...', targetId: '...', items: [ |
| 20 | + {label: '...', targetId: '...'} |
| 21 | + }] |
| 22 | + ]} |
| 23 | + ] |
| 24 | +- activeClassName (string; optional): Class name applied to active links in the menu (default: 'is-active') |
| 25 | +- menuClassName (string; optional): Class name applied to the <aside> that contains the whole menu (default: 'menu') |
| 26 | +- menuGroupLabelClassName (string; optional): Class name applied to all menu group labels (default: 'menu-label') |
| 27 | +- menuItemContainerClassName (string; optional): Class name applied to each <ul> of menu items (default: 'menu-list') |
| 28 | +- menuItemClassName (string; optional): Class name applied to the <li> of each menu item (default: '') |
| 29 | +- offset (number; optional): An integer to determine the scroll offset from an item that will trigger it active (default: -20)""" |
18 | 30 | @_explicitize_args
|
19 |
| - def __init__(self, className=Component.UNDEFINED, menuGroups=Component.UNDEFINED, activeItemClassName=Component.UNDEFINED, offset=Component.UNDEFINED, menuLabelClassName=Component.UNDEFINED, menuContainerClassName=Component.UNDEFINED, menuItemClassName=Component.UNDEFINED, **kwargs): |
20 |
| - self._prop_names = ['className', 'menuGroups', 'activeItemClassName', 'offset', 'menuLabelClassName', 'menuContainerClassName', 'menuItemClassName'] |
| 31 | + def __init__(self, menuGroups=Component.UNDEFINED, activeClassName=Component.UNDEFINED, menuClassName=Component.UNDEFINED, menuGroupLabelClassName=Component.UNDEFINED, menuItemContainerClassName=Component.UNDEFINED, menuItemClassName=Component.UNDEFINED, offset=Component.UNDEFINED, **kwargs): |
| 32 | + self._prop_names = ['menuGroups', 'activeClassName', 'menuClassName', 'menuGroupLabelClassName', 'menuItemContainerClassName', 'menuItemClassName', 'offset'] |
21 | 33 | self._type = 'Scrollspy'
|
22 | 34 | self._namespace = 'dash_mp_components'
|
23 | 35 | self._valid_wildcard_attributes = []
|
24 |
| - self.available_properties = ['className', 'menuGroups', 'activeItemClassName', 'offset', 'menuLabelClassName', 'menuContainerClassName', 'menuItemClassName'] |
| 36 | + self.available_properties = ['menuGroups', 'activeClassName', 'menuClassName', 'menuGroupLabelClassName', 'menuItemContainerClassName', 'menuItemClassName', 'offset'] |
25 | 37 | self.available_wildcard_properties = []
|
26 | 38 |
|
27 | 39 | _explicit_args = kwargs.pop('_explicit_args')
|
|
0 commit comments