UNPKG

3.87 kBMarkdownView Raw
1#### Public Methods
2
3| Name | Params | Description |
4| ---------------------- | ------------------------------------------------------------- | ---------------------------------------------------------------------- |
5| `show`/`hide` | `evt`: `Event` or `Element`, `callback`: `Function` | Shows/hides the menu. |
6| `changeState` | `state`: `string`, `detail`: `Object`, `callback`: `Function` | Changes the shown/hidden state. |
7| `shouldStateBeChanged` | `state`: `string` | Returns `true` if the given state is different from the current state. |
8| `release` | | Deletes the instance and removes resize event listeners. |
9
10#### Options
11
12| Option | Default value | Description |
13| ------------------- | -------------------------------- | --------------------------------------------------------------------------------------------------------- |
14| `selectorContainer` | `[data-floating-menu-container]` | The CSS selector to find the element you wish the append the menu contents to. |
15| `attribDirection` | `data-floating-menu-direction` | The attribute name to specify menu placement direction (top/right/bottom/left). |
16| `classShown` | None | The CSS class for shown state, for the menu. Should be provided via component creation options. |
17| `classRefShown` | None | The CSS class for shown state, for the trigger button. Should be provided via component creation options. |
18| `eventBeforeShown` | `floating-menu-beingshown` | The name of the custom event fired before a menu is opened. |
19| `eventAfterShown` | `floating-menu-shown` | The name of the custom event fired after a menu is opened. |
20| `eventBeforeHidden` | `floating-menu-beinghidden` | The name of the custom event fired before a menu is closed. |
21| `eventAfterHidden` | `floating-menu-hidden` | The name of the custom event fired after a menu is closed. |
22| `refNode` | None | The trigger button. Should be provided via component creation options. |
23| `offset` | `{ top: 0, left: 0}` | An object containing the top and left offset values in px. |
24
25#### Events
26
27| Event Name | Description |
28| --------------------------- | -------------------------------------------------------------------------------------------------------- |
29| `floating-menu-beingshown` | The name of the custom event fired before a menu is opened. Cancellation of this event stops it opening. |
30| `floating-menu-shown` | The name of the custom event fired after a menu is opened. |
31| `floating-menu-beinghidden` | The name of the custom event fired before a menu is closed. Cancellation of this event stops it closing. |
32| `floating-menu-hidden` | The name of the custom event fired after a menu is closed. |