-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathdropdown-content.js
40 lines (32 loc) · 1.56 KB
/
dropdown-content.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { DropdownPopoverMixin, usePopoverMixin } from './dropdown-popover-mixin.js';
import { DropdownContentMixin } from './dropdown-content-mixin.js';
import { dropdownContentStyles } from './dropdown-content-styles.js';
import { LitElement } from 'lit';
if (usePopoverMixin) {
/**
* A generic container for dropdown content. It provides behavior such as sizing, positioning, and managing focus gain/loss.
* @slot - Anything inside of "d2l-dropdown-content" that isn't in the "header" or "footer" slots appears as regular content
* @slot header - Sticky container at the top of the dropdown
* @slot footer - Sticky container at the bottom of the dropdown
* @fires d2l-dropdown-open - Dispatched when the dropdown is opened
*/
class DropdownContent extends DropdownPopoverMixin(LitElement) { }
customElements.define('d2l-dropdown-content', DropdownContent);
} else {
/**
* A generic container for dropdown content. It provides behavior such as sizing, positioning, and managing focus gain/loss.
* @slot - Anything inside of "d2l-dropdown-content" that isn't in the "header" or "footer" slots appears as regular content
* @slot header - Sticky container at the top of the dropdown
* @slot footer - Sticky container at the bottom of the dropdown
* @fires d2l-dropdown-open - Dispatched when the dropdown is opened
*/
class DropdownContent extends DropdownContentMixin(LitElement) {
static get styles() {
return dropdownContentStyles;
}
render() {
return this._renderContent();
}
}
customElements.define('d2l-dropdown-content', DropdownContent);
}