@brightspace-ui/core 3.267.1 → 3.267.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/alert/alert-toast.js +98 -102
- package/components/alert/alert.js +109 -113
- package/components/backdrop/backdrop-dirty-overlay.js +13 -17
- package/components/backdrop/backdrop-loading.js +105 -109
- package/components/backdrop/backdrop.js +50 -54
- package/components/breadcrumbs/breadcrumb-current-page.js +19 -23
- package/components/breadcrumbs/breadcrumb.js +50 -54
- package/components/breadcrumbs/breadcrumbs.js +34 -38
- package/components/button/button-add.js +156 -164
- package/components/button/button-copy-mixin.js +9 -11
- package/components/button/button-copy.js +15 -19
- package/components/button/button-icon.js +110 -114
- package/components/button/button-move.js +153 -157
- package/components/button/button-split-item.js +16 -20
- package/components/button/button-split.js +70 -74
- package/components/button/button-subtle-copy.js +17 -19
- package/components/button/button-subtle.js +145 -149
- package/components/button/button-toggle.js +25 -29
- package/components/button/button.js +70 -74
- package/components/button/floating-buttons.js +63 -67
- package/components/calendar/calendar.js +244 -248
- package/components/card/card-content-meta.js +13 -15
- package/components/card/card-content-title.js +9 -11
- package/components/card/card-footer-link.js +76 -80
- package/components/card/card-loading-shimmer.js +35 -39
- package/components/card/card.js +188 -192
- package/components/collapsible-panel/collapsible-panel-group.js +17 -21
- package/components/collapsible-panel/collapsible-panel-summary-item.js +27 -31
- package/components/collapsible-panel/collapsible-panel.js +258 -262
- package/components/count-badge/count-badge-icon.js +12 -16
- package/components/count-badge/count-badge-mixin.js +124 -128
- package/components/count-badge/count-badge.js +2 -4
- package/components/description-list/description-list-wrapper.js +27 -31
- package/components/dialog/dialog-confirm.js +55 -59
- package/components/dialog/dialog-fullscreen.js +128 -132
- package/components/dialog/dialog-mixin.js +39 -41
- package/components/dialog/dialog.js +61 -65
- package/components/dropdown/dropdown-button-subtle.js +21 -25
- package/components/dropdown/dropdown-button.js +31 -35
- package/components/dropdown/dropdown-context-menu.js +28 -31
- package/components/dropdown/dropdown-menu.js +27 -31
- package/components/dropdown/dropdown-more.js +23 -26
- package/components/dropdown/dropdown-opener-mixin.js +44 -46
- package/components/dropdown/dropdown-popover-mixin.js +155 -159
- package/components/dropdown/dropdown-tabs.js +5 -7
- package/components/dropdown/dropdown.js +1 -3
- package/components/empty-state/empty-state-action-button.js +18 -22
- package/components/empty-state/empty-state-action-link.js +14 -18
- package/components/empty-state/empty-state-illustrated.js +21 -25
- package/components/empty-state/empty-state-simple.js +8 -12
- package/components/expand-collapse/expand-collapse-content.js +48 -52
- package/components/filter/filter-dimension-set-date-text-value.js +34 -36
- package/components/filter/filter-dimension-set-date-time-range-value.js +45 -47
- package/components/filter/filter-dimension-set-empty-state.js +17 -19
- package/components/filter/filter-dimension-set-value.js +27 -29
- package/components/filter/filter-dimension-set.js +65 -67
- package/components/filter/filter-overflow-group.js +15 -19
- package/components/filter/filter-tags.js +16 -19
- package/components/filter/filter.js +115 -119
- package/components/focus-trap/focus-trap.js +17 -21
- package/components/form/form-element-mixin.js +33 -35
- package/components/form/form-error-summary.js +37 -42
- package/components/form/form.js +33 -37
- package/components/hierarchical-view/hierarchical-view-mixin.js +76 -80
- package/components/hierarchical-view/hierarchical-view.js +5 -7
- package/components/html-block/html-block.js +45 -49
- package/components/icons/icon-custom.js +20 -24
- package/components/icons/icon.js +20 -24
- package/components/icons/slotted-icon-mixin.js +16 -18
- package/components/inputs/input-checkbox-group.js +34 -38
- package/components/inputs/input-checkbox.js +106 -110
- package/components/inputs/input-color.js +142 -148
- package/components/inputs/input-date-range.js +90 -94
- package/components/inputs/input-date-time-range-to.js +70 -74
- package/components/inputs/input-date-time-range.js +110 -115
- package/components/inputs/input-date-time.js +75 -79
- package/components/inputs/input-date.js +101 -105
- package/components/inputs/input-fieldset.js +37 -43
- package/components/inputs/input-group.js +10 -12
- package/components/inputs/input-inline-help.js +4 -6
- package/components/inputs/input-number.js +112 -118
- package/components/inputs/input-percent.js +52 -58
- package/components/inputs/input-radio-group.js +45 -49
- package/components/inputs/input-radio-spacer.js +11 -13
- package/components/inputs/input-radio.js +62 -66
- package/components/inputs/input-search.js +63 -68
- package/components/inputs/input-text.js +245 -251
- package/components/inputs/input-textarea.js +128 -132
- package/components/inputs/input-time-range.js +100 -104
- package/components/inputs/input-time.js +107 -113
- package/components/link/link-mixin.js +37 -41
- package/components/link/link.js +113 -119
- package/components/list/list-controls.js +25 -29
- package/components/list/list-item-button-mixin.js +10 -12
- package/components/list/list-item-checkbox-mixin.js +35 -37
- package/components/list/list-item-content.js +33 -35
- package/components/list/list-item-drag-drop-mixin.js +45 -47
- package/components/list/list-item-drag-handle.js +80 -84
- package/components/list/list-item-drag-image.js +77 -81
- package/components/list/list-item-expand-collapse-mixin.js +17 -19
- package/components/list/list-item-generic-layout.js +222 -226
- package/components/list/list-item-link-mixin.js +10 -12
- package/components/list/list-item-mixin.js +68 -70
- package/components/list/list-item-nav-mixin.js +17 -19
- package/components/list/list-item-placement-marker.js +65 -67
- package/components/list/list-item-role-mixin.js +9 -11
- package/components/list/list-item.js +7 -9
- package/components/list/list.js +121 -125
- package/components/loading-spinner/loading-spinner.js +93 -97
- package/custom-elements.json +1920 -6694
- package/package.json +3 -2
|
@@ -10,39 +10,36 @@ import { dropdownOpenerStyles } from './dropdown-opener-styles.js';
|
|
|
10
10
|
*/
|
|
11
11
|
class DropdownContextMenu extends DropdownOpenerMixin(VisibleOnAncestorMixin(LitElement)) {
|
|
12
12
|
|
|
13
|
-
static
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
},
|
|
13
|
+
static properties = {
|
|
14
|
+
/**
|
|
15
|
+
* REQUIRED: Label for the context-menu button
|
|
16
|
+
* @type {string}
|
|
17
|
+
*/
|
|
18
|
+
text: {
|
|
19
|
+
type: String
|
|
20
|
+
},
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Attribute for busy/rich backgrounds
|
|
24
|
+
* @type {boolean}
|
|
25
|
+
*/
|
|
26
|
+
translucent: {
|
|
27
|
+
type: Boolean
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
static styles = [dropdownOpenerStyles, visibleOnAncestorStyles, css`
|
|
32
|
+
:host {
|
|
33
|
+
--d2l-dropdown-context-menu-min-height: calc(2rem + 2px);
|
|
34
|
+
--d2l-dropdown-context-menu-min-width: calc(2rem + 2px);
|
|
35
|
+
display: inline-block;
|
|
36
|
+
}
|
|
37
|
+
d2l-button-icon {
|
|
38
|
+
--d2l-button-icon-min-height: var(--d2l-dropdown-context-menu-min-height);
|
|
39
|
+
--d2l-button-icon-min-width: var(--d2l-dropdown-context-menu-min-height);
|
|
40
|
+
}
|
|
41
|
+
`];
|
|
32
42
|
|
|
33
|
-
static get styles() {
|
|
34
|
-
return [dropdownOpenerStyles, visibleOnAncestorStyles, css`
|
|
35
|
-
:host {
|
|
36
|
-
--d2l-dropdown-context-menu-min-height: calc(2rem + 2px);
|
|
37
|
-
--d2l-dropdown-context-menu-min-width: calc(2rem + 2px);
|
|
38
|
-
display: inline-block;
|
|
39
|
-
}
|
|
40
|
-
d2l-button-icon {
|
|
41
|
-
--d2l-button-icon-min-height: var(--d2l-dropdown-context-menu-min-height);
|
|
42
|
-
--d2l-button-icon-min-width: var(--d2l-dropdown-context-menu-min-height);
|
|
43
|
-
}
|
|
44
|
-
`];
|
|
45
|
-
}
|
|
46
43
|
constructor() {
|
|
47
44
|
super();
|
|
48
45
|
this.translucent = false;
|
|
@@ -14,43 +14,39 @@ const dropdownDelay = 300;
|
|
|
14
14
|
*/
|
|
15
15
|
class DropdownMenu extends ThemeMixin(DropdownPopoverMixin(LitElement)) {
|
|
16
16
|
|
|
17
|
-
static
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
21
|
-
}
|
|
17
|
+
static properties = {
|
|
18
|
+
_closeRadio: { type: Boolean, reflect: true, attribute: '_close-radio' },
|
|
19
|
+
};
|
|
22
20
|
|
|
23
|
-
static
|
|
24
|
-
|
|
25
|
-
:
|
|
26
|
-
|
|
27
|
-
}
|
|
21
|
+
static styles = [super.styles, css`
|
|
22
|
+
:host {
|
|
23
|
+
--d2l-dropdown-close-animation-name: d2l-dropdown-close-animation;
|
|
24
|
+
}
|
|
28
25
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
:host([theme="dark"]) {
|
|
27
|
+
--d2l-dropdown-close-animation-name: d2l-dropdown-close-animation-dark;
|
|
28
|
+
}
|
|
32
29
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
:host([_close-radio]) {
|
|
31
|
+
animation: var(--d2l-dropdown-close-animation-name) ${dropdownDelay}ms ease-out;
|
|
32
|
+
animation-delay: 50ms;
|
|
33
|
+
}
|
|
37
34
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
@keyframes d2l-dropdown-close-animation {
|
|
44
|
-
0% { opacity: 1; transform: translate(0, 0); }
|
|
45
|
-
100% { opacity: 0; transform: translate(0, -10px); }
|
|
35
|
+
@media (prefers-reduced-motion: reduce) {
|
|
36
|
+
:host([_close-radio]) {
|
|
37
|
+
animation: none !important;
|
|
46
38
|
}
|
|
39
|
+
}
|
|
40
|
+
@keyframes d2l-dropdown-close-animation {
|
|
41
|
+
0% { opacity: 1; transform: translate(0, 0); }
|
|
42
|
+
100% { opacity: 0; transform: translate(0, -10px); }
|
|
43
|
+
}
|
|
47
44
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
45
|
+
@keyframes d2l-dropdown-close-animation-dark {
|
|
46
|
+
0% { opacity: 0.9; transform: translate(0, 0); }
|
|
47
|
+
100% { opacity: 0; transform: translate(0, -10px); }
|
|
48
|
+
}
|
|
49
|
+
`];
|
|
54
50
|
|
|
55
51
|
constructor() {
|
|
56
52
|
super();
|
|
@@ -10,33 +10,30 @@ import { dropdownOpenerStyles } from './dropdown-opener-styles.js';
|
|
|
10
10
|
*/
|
|
11
11
|
class DropdownMore extends DropdownOpenerMixin(VisibleOnAncestorMixin(LitElement)) {
|
|
12
12
|
|
|
13
|
-
static
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
13
|
+
static properties = {
|
|
14
|
+
/**
|
|
15
|
+
* REQUIRED: Label for the more button
|
|
16
|
+
* @type {string}
|
|
17
|
+
*/
|
|
18
|
+
text: {
|
|
19
|
+
type: String
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Attribute for busy/rich backgrounds
|
|
24
|
+
* @type {boolean}
|
|
25
|
+
*/
|
|
26
|
+
translucent: {
|
|
27
|
+
type: Boolean
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
static styles = [dropdownOpenerStyles, visibleOnAncestorStyles, css`
|
|
32
|
+
:host {
|
|
33
|
+
display: inline-block;
|
|
34
|
+
}
|
|
35
|
+
`];
|
|
32
36
|
|
|
33
|
-
static get styles() {
|
|
34
|
-
return [dropdownOpenerStyles, visibleOnAncestorStyles, css`
|
|
35
|
-
:host {
|
|
36
|
-
display: inline-block;
|
|
37
|
-
}
|
|
38
|
-
`];
|
|
39
|
-
}
|
|
40
37
|
constructor() {
|
|
41
38
|
super();
|
|
42
39
|
this.translucent = false;
|
|
@@ -3,52 +3,50 @@ import { isComposedAncestor } from '../../helpers/dom.js';
|
|
|
3
3
|
|
|
4
4
|
export const DropdownOpenerMixin = superclass => class extends superclass {
|
|
5
5
|
|
|
6
|
-
static
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
};
|
|
51
|
-
}
|
|
6
|
+
static properties = {
|
|
7
|
+
/**
|
|
8
|
+
* Disables the dropdown opener
|
|
9
|
+
* @type {boolean}
|
|
10
|
+
*/
|
|
11
|
+
disabled: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
reflect: true
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @ignore
|
|
18
|
+
*/
|
|
19
|
+
dropdownOpened: { state: true },
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @ignore
|
|
23
|
+
*/
|
|
24
|
+
dropdownOpener: {
|
|
25
|
+
type: Boolean
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Prevents the dropdown from opening automatically on or on key press
|
|
30
|
+
* @type {boolean}
|
|
31
|
+
*/
|
|
32
|
+
noAutoOpen: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
reflect: true,
|
|
35
|
+
attribute: 'no-auto-open'
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Optionally open dropdown on click or hover action
|
|
40
|
+
* @type {boolean}
|
|
41
|
+
*/
|
|
42
|
+
openOnHover: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
attribute: 'open-on-hover'
|
|
45
|
+
},
|
|
46
|
+
_isHovering: { type: Boolean },
|
|
47
|
+
_isOpenedViaClick: { type: Boolean },
|
|
48
|
+
_isFading: { type: Boolean }
|
|
49
|
+
};
|
|
52
50
|
|
|
53
51
|
constructor() {
|
|
54
52
|
super();
|
|
@@ -10,166 +10,162 @@ import { styleMap } from 'lit/directives/style-map.js';
|
|
|
10
10
|
|
|
11
11
|
export const DropdownPopoverMixin = superclass => class extends LocalizeCoreElement(PopoverMixin(superclass)) {
|
|
12
12
|
|
|
13
|
-
static
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
.dropdown-footer-scroll {
|
|
163
|
-
box-shadow: 0 -3px 3px 0 var(--d2l-popover-shadow-color, var(--d2l-popover-default-shadow-color));
|
|
164
|
-
}
|
|
13
|
+
static properties = {
|
|
14
|
+
/**
|
|
15
|
+
* Optionally align dropdown to either start or end. If not set, the dropdown will attempt to be centred.
|
|
16
|
+
* @type {'start'|'end'}
|
|
17
|
+
*/
|
|
18
|
+
align: { type: String },
|
|
19
|
+
/**
|
|
20
|
+
* Override max-height. Note that the default behaviour is to be as tall as necessary within the viewport, so this property is usually not needed.
|
|
21
|
+
* @type {number}
|
|
22
|
+
*/
|
|
23
|
+
maxHeight: { type: Number, attribute: 'max-height' },
|
|
24
|
+
/**
|
|
25
|
+
* Override default max-width (undefined). Specify a number that would be the px value.
|
|
26
|
+
* @type {number}
|
|
27
|
+
*/
|
|
28
|
+
maxWidth: { type: Number, attribute: 'max-width' },
|
|
29
|
+
/**
|
|
30
|
+
* Override default height used for required space when `no-auto-fit` is true. Specify a number that would be the px value. Note that the default behaviour is to be as tall as necessary within the viewport, so this property is usually not needed.
|
|
31
|
+
* @type {number}
|
|
32
|
+
*/
|
|
33
|
+
minHeight: { type: Number, attribute: 'min-height' },
|
|
34
|
+
/**
|
|
35
|
+
* Override default min-width (undefined). Specify a number that would be the px value.
|
|
36
|
+
* @type {number}
|
|
37
|
+
*/
|
|
38
|
+
minWidth: { type: Number, attribute: 'min-width' },
|
|
39
|
+
/**
|
|
40
|
+
* Override the breakpoint at which mobile styling is used. Defaults to 616px.
|
|
41
|
+
* @type {number}
|
|
42
|
+
*/
|
|
43
|
+
mobileBreakpointOverride: { type: Number, attribute: 'mobile-breakpoint' },
|
|
44
|
+
/**
|
|
45
|
+
* Mobile dropdown style.
|
|
46
|
+
* @type {'left'|'right'|'bottom'}
|
|
47
|
+
*/
|
|
48
|
+
mobileTray: { type: String, attribute: 'mobile-tray' },
|
|
49
|
+
/**
|
|
50
|
+
* Opt out of automatically closing on focus or click outside of the dropdown content
|
|
51
|
+
* @type {boolean}
|
|
52
|
+
*/
|
|
53
|
+
noAutoClose: { type: Boolean, attribute: 'no-auto-close' },
|
|
54
|
+
/**
|
|
55
|
+
* Opt out of auto-sizing
|
|
56
|
+
* @type {boolean}
|
|
57
|
+
*/
|
|
58
|
+
noAutoFit: { type: Boolean, attribute: 'no-auto-fit' },
|
|
59
|
+
/**
|
|
60
|
+
* Opt out of focus being automatically moved to the first focusable element in the dropdown when opened
|
|
61
|
+
* @type {boolean}
|
|
62
|
+
*/
|
|
63
|
+
noAutoFocus: { type: Boolean, attribute: 'no-auto-focus' },
|
|
64
|
+
/**
|
|
65
|
+
* Opt-out of showing a close button in the footer of tray-style mobile dropdowns.
|
|
66
|
+
* @type {boolean}
|
|
67
|
+
*/
|
|
68
|
+
noMobileCloseButton: { type: Boolean, attribute: 'no-mobile-close-button' },
|
|
69
|
+
/**
|
|
70
|
+
* Render with no padding
|
|
71
|
+
* @type {boolean}
|
|
72
|
+
*/
|
|
73
|
+
noPadding: { type: Boolean, attribute: 'no-padding' },
|
|
74
|
+
/**
|
|
75
|
+
* Render the footer with no padding (if it has content)
|
|
76
|
+
* @type {boolean}
|
|
77
|
+
*/
|
|
78
|
+
noPaddingFooter: { type: Boolean, attribute: 'no-padding-footer' },
|
|
79
|
+
/**
|
|
80
|
+
* Render the header with no padding (if it has content)
|
|
81
|
+
* @type {boolean}
|
|
82
|
+
*/
|
|
83
|
+
noPaddingHeader: { type: Boolean, attribute: 'no-padding-header' },
|
|
84
|
+
/**
|
|
85
|
+
* Render without a pointer
|
|
86
|
+
* @type {boolean}
|
|
87
|
+
*/
|
|
88
|
+
noPointer: { type: Boolean, attribute: 'no-pointer' },
|
|
89
|
+
/**
|
|
90
|
+
* Whether the dropdown is open or not
|
|
91
|
+
* @type {boolean}
|
|
92
|
+
*/
|
|
93
|
+
opened: { type: Boolean, reflect: true },
|
|
94
|
+
/**
|
|
95
|
+
* Optionally render a d2l-focus-trap around the dropdown content
|
|
96
|
+
* @type {boolean}
|
|
97
|
+
*/
|
|
98
|
+
trapFocus: { type: Boolean, attribute: 'trap-focus' },
|
|
99
|
+
/**
|
|
100
|
+
* Provide custom offset, positive or negative
|
|
101
|
+
* @type {string}
|
|
102
|
+
*/
|
|
103
|
+
verticalOffset: { type: String, attribute: 'vertical-offset' },
|
|
104
|
+
_blockEndScroll: { state: true },
|
|
105
|
+
_blockStartScroll: { state: true },
|
|
106
|
+
_dropdownContent: { type: Boolean, attribute: 'dropdown-content', reflect: true },
|
|
107
|
+
_hasFooterSlotContent: { state: true },
|
|
108
|
+
_hasHeaderSlotContent: { state: true }
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
static styles = [super.styles, css`
|
|
112
|
+
.dropdown-content-layout {
|
|
113
|
+
align-items: stretch;
|
|
114
|
+
display: flex;
|
|
115
|
+
flex-direction: column;
|
|
116
|
+
}
|
|
117
|
+
.dropdown-content {
|
|
118
|
+
box-sizing: border-box;
|
|
119
|
+
flex: auto;
|
|
120
|
+
max-width: 100%;
|
|
121
|
+
overflow-y: auto;
|
|
122
|
+
padding: 1rem;
|
|
123
|
+
}
|
|
124
|
+
.dropdown-header,
|
|
125
|
+
.dropdown-footer {
|
|
126
|
+
box-sizing: border-box;
|
|
127
|
+
flex: none;
|
|
128
|
+
max-width: 100%;
|
|
129
|
+
min-height: 5px;
|
|
130
|
+
padding: 1rem;
|
|
131
|
+
position: relative;
|
|
132
|
+
width: 100%;
|
|
133
|
+
z-index: 2;
|
|
134
|
+
}
|
|
135
|
+
.dropdown-header {
|
|
136
|
+
border-block-end: 1px solid var(--d2l-popover-border-color, var(--d2l-popover-default-border-color));
|
|
137
|
+
border-start-end-radius: var(--d2l-popover-border-radius, var(--d2l-popover-default-border-radius));
|
|
138
|
+
border-start-start-radius: var(--d2l-popover-border-radius, var(--d2l-popover-default-border-radius));
|
|
139
|
+
}
|
|
140
|
+
.dropdown-footer {
|
|
141
|
+
border-block-start: 1px solid var(--d2l-popover-border-color, var(--d2l-popover-default-border-color));
|
|
142
|
+
border-end-end-radius: var(--d2l-popover-border-radius, var(--d2l-popover-default-border-radius));
|
|
143
|
+
border-end-start-radius: var(--d2l-popover-border-radius, var(--d2l-popover-default-border-radius));
|
|
144
|
+
}
|
|
145
|
+
.dropdown-no-header {
|
|
146
|
+
border-block-end: none;
|
|
147
|
+
padding: 0;
|
|
148
|
+
}
|
|
149
|
+
.dropdown-no-footer {
|
|
150
|
+
border-block-start: none;
|
|
151
|
+
padding: 0;
|
|
152
|
+
}
|
|
153
|
+
.dropdown-no-padding {
|
|
154
|
+
padding: 0;
|
|
155
|
+
}
|
|
156
|
+
.dropdown-header-scroll {
|
|
157
|
+
box-shadow: 0 3px 3px 0 var(--d2l-popover-shadow-color, var(--d2l-popover-default-shadow-color));
|
|
158
|
+
}
|
|
159
|
+
.dropdown-footer-scroll {
|
|
160
|
+
box-shadow: 0 -3px 3px 0 var(--d2l-popover-shadow-color, var(--d2l-popover-default-shadow-color));
|
|
161
|
+
}
|
|
165
162
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}
|
|
163
|
+
:host([_mobile][_mobile-tray-location="inline-start"][opened]) .dropdown-content-layout,
|
|
164
|
+
:host([_mobile][_mobile-tray-location="inline-end"][opened]) .dropdown-content-layout {
|
|
165
|
+
height: calc(var(--d2l-vh, 1vh) * 100);
|
|
166
|
+
height: 100dvh;
|
|
167
|
+
}
|
|
168
|
+
`];
|
|
173
169
|
|
|
174
170
|
constructor() {
|
|
175
171
|
super();
|
|
@@ -10,13 +10,11 @@ import { DropdownPopoverMixin } from './dropdown-popover-mixin.js';
|
|
|
10
10
|
*/
|
|
11
11
|
class DropdownTabs extends DropdownPopoverMixin(LitElement) {
|
|
12
12
|
|
|
13
|
-
static
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
`];
|
|
19
|
-
}
|
|
13
|
+
static styles = [super.styles, css`
|
|
14
|
+
::slotted(d2l-tabs) {
|
|
15
|
+
margin-bottom: 0;
|
|
16
|
+
}
|
|
17
|
+
`];
|
|
20
18
|
|
|
21
19
|
firstUpdated(changedProperties) {
|
|
22
20
|
super.firstUpdated(changedProperties);
|
|
@@ -8,9 +8,7 @@ import { dropdownOpenerStyles } from './dropdown-opener-styles.js';
|
|
|
8
8
|
*/
|
|
9
9
|
class Dropdown extends DropdownOpenerMixin(LitElement) {
|
|
10
10
|
|
|
11
|
-
static
|
|
12
|
-
return dropdownOpenerStyles;
|
|
13
|
-
}
|
|
11
|
+
static styles = dropdownOpenerStyles;
|
|
14
12
|
|
|
15
13
|
render() {
|
|
16
14
|
return html`<slot></slot>`;
|