@brightspace-ui/core 3.268.0 → 3.268.1
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/collapsible-panel/README.md +11 -15
- package/components/demo/code-view.js +6 -10
- package/components/demo/demo-page-settings.js +25 -29
- package/components/demo/demo-page.js +32 -36
- package/components/demo/demo-snippet.js +95 -99
- package/components/description-list/README.md +25 -33
- package/components/description-list/demo/description-list-test.js +36 -39
- package/components/dialog/README.md +3 -5
- package/components/form/docs/form-element-mixin.md +11 -14
- package/components/form/docs/form-element-nesting.md +4 -6
- package/components/form/docs/form-element-wrapping.md +1 -3
- package/components/hierarchical-view/README.md +8 -11
- package/components/inputs/docs/input-select-styles.md +4 -9
- package/components/inputs/docs/styling-native-inputs.md +11 -25
- package/components/link/README.md +1 -1
- package/components/list/README.md +8 -16
- package/components/menu/menu-item-checkbox.js +1 -3
- package/components/menu/menu-item-link.js +27 -33
- package/components/menu/menu-item-mixin.js +52 -54
- package/components/menu/menu-item-radio.js +1 -3
- package/components/menu/menu-item-return.js +18 -22
- package/components/menu/menu-item-selectable-mixin.js +12 -14
- package/components/menu/menu-item-separator.js +9 -11
- package/components/menu/menu-item.js +11 -15
- package/components/menu/menu.js +50 -54
- package/components/meter/meter-circle.js +3 -4
- package/components/meter/meter-linear.js +86 -88
- package/components/meter/meter-mixin.js +34 -36
- package/components/meter/meter-radial.js +3 -4
- package/components/more-less/more-less.js +57 -61
- package/components/object-property-list/object-property-list-item-link.js +18 -19
- package/components/object-property-list/object-property-list-item-tooltip-help.js +8 -9
- package/components/object-property-list/object-property-list-item.js +52 -55
- package/components/object-property-list/object-property-list.js +24 -27
- package/components/offscreen/README.md +1 -1
- package/components/offscreen/offscreen.js +13 -15
- package/components/offscreen/screen-reader-pause.js +1 -3
- package/components/overflow-group/README.md +1 -3
- package/components/overflow-group/overflow-group-mixin.js +55 -59
- package/components/overflow-group/overflow-group.js +38 -42
- package/components/page/page-header-button.js +41 -45
- package/components/page/page-header-custom.js +108 -112
- package/components/page/page-header-immersive.js +65 -69
- package/components/page/page-header-separator.js +12 -14
- package/components/paging/pageable-mixin.js +3 -5
- package/components/paging/pageable-subscriber-mixin.js +8 -10
- package/components/paging/pager-load-more.js +47 -51
- package/components/popover/popover-mixin.js +186 -190
- package/components/progress/progress.js +160 -164
- package/components/scroll-wrapper/scroll-wrapper.js +109 -113
- package/components/selection/README.md +5 -7
- package/components/selection/demo/demo-selection.js +5 -7
- package/components/selection/selection-action-dropdown.js +9 -13
- package/components/selection/selection-action-menu-item.js +11 -15
- package/components/selection/selection-action.js +20 -24
- package/components/selection/selection-controls.js +92 -96
- package/components/selection/selection-input.js +40 -44
- package/components/selection/selection-mixin.js +11 -13
- package/components/selection/selection-observer-mixin.js +14 -16
- package/components/selection/selection-select-all-pages.js +8 -10
- package/components/selection/selection-select-all.js +16 -20
- package/components/selection/selection-summary.js +18 -22
- package/components/skeleton/README.md +2 -6
- package/components/skeleton/skeleton-group-mixin.js +3 -5
- package/components/skeleton/skeleton-mixin.js +7 -9
- package/components/skip-nav/skip-nav-custom.js +33 -37
- package/components/sorting/sort.js +11 -13
- package/components/status-indicator/status-indicator.js +75 -79
- package/components/switch/switch-mixin.js +145 -149
- package/components/switch/switch-visibility.js +11 -15
- package/components/switch/switch.js +5 -7
- package/components/table/README.md +19 -37
- package/components/table/demo/table-test.js +27 -31
- package/components/table/table-col-sort-button-item.js +1 -3
- package/components/table/table-col-sort-button.js +105 -109
- package/components/table/table-controls.js +18 -21
- package/components/table/table-wrapper.js +124 -128
- package/components/tabs/tab-internal.js +72 -76
- package/components/tabs/tab-mixin.js +22 -24
- package/components/tabs/tab-panel-mixin.js +47 -51
- package/components/tabs/tab.js +7 -9
- package/components/tabs/tabs.js +171 -175
- package/components/tag-list/tag-list-item-mixin.js +103 -107
- package/components/tag-list/tag-list-item.js +13 -15
- package/components/tag-list/tag-list.js +54 -58
- package/components/tooltip/tooltip-help.js +67 -71
- package/components/tooltip/tooltip.js +103 -107
- package/components/typography/README.md +5 -7
- package/components/validation/validation-custom-mixin.js +4 -6
- package/components/view-switcher/view-switcher-button.js +42 -46
- package/components/view-switcher/view-switcher.js +26 -29
- package/controllers/subscriber/README.md +7 -11
- package/custom-elements.json +1026 -3850
- package/mixins/arrow-keys/arrow-keys-mixin.js +10 -12
- package/mixins/async-container/async-container-mixin.js +10 -12
- package/mixins/collection/collection-mixin.js +7 -9
- package/mixins/interactive/interactive-mixin.js +10 -14
- package/mixins/labelled/README.md +3 -5
- package/mixins/labelled/labelled-mixin.js +26 -30
- package/mixins/provider/README.md +5 -7
- package/mixins/rtl/README.md +5 -7
- package/mixins/rtl/rtl-mixin.js +7 -9
- package/mixins/theme/theme-mixin.js +6 -8
- package/mixins/visible-on-ancestor/README.md +1 -3
- package/mixins/visible-on-ancestor/visible-on-ancestor-mixin.js +11 -13
- package/package.json +1 -1
- package/templates/primary-secondary/primary-secondary.js +373 -377
|
@@ -21,8 +21,7 @@ The `d2l-hierarchical-view` component uses the `d2l-hierarchical-view-mixin` for
|
|
|
21
21
|
this.showParentView = this.showParentView.bind(this);
|
|
22
22
|
}
|
|
23
23
|
// <!-- docs: start hidden content -->
|
|
24
|
-
static
|
|
25
|
-
return [css`
|
|
24
|
+
static styles = [css`
|
|
26
25
|
#view1 {
|
|
27
26
|
width: 100%;
|
|
28
27
|
}
|
|
@@ -74,8 +73,8 @@ The `d2l-hierarchical-view` component uses the `d2l-hierarchical-view-mixin` for
|
|
|
74
73
|
.position-display {
|
|
75
74
|
display: flex;
|
|
76
75
|
justify-content: space-evenly;
|
|
77
|
-
}
|
|
78
|
-
|
|
76
|
+
}
|
|
77
|
+
`];
|
|
79
78
|
|
|
80
79
|
// <!-- docs: end hidden content -->
|
|
81
80
|
showSubView(id) {
|
|
@@ -208,13 +207,11 @@ This mixin allows for nested views within components. To use, apply the mixin an
|
|
|
208
207
|
```js
|
|
209
208
|
import { HierarchicalViewMixin } from '@brightspace-ui/core/components/hierarchical-view/hierarchical-view-mixin.js';
|
|
210
209
|
class MyComponent extends HierarchicalViewMixin(LitElement) {
|
|
211
|
-
static
|
|
212
|
-
|
|
213
|
-
:
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
`];
|
|
217
|
-
}
|
|
210
|
+
static styles = [super.styles, css`
|
|
211
|
+
:host {
|
|
212
|
+
display: inline-block;
|
|
213
|
+
}
|
|
214
|
+
`];
|
|
218
215
|
|
|
219
216
|
render() {
|
|
220
217
|
return html`
|
|
@@ -10,9 +10,8 @@ A Select List allows the user to select a single option out of a relatively larg
|
|
|
10
10
|
|
|
11
11
|
class MySelectElem extends LitElement {
|
|
12
12
|
|
|
13
|
-
static
|
|
14
|
-
|
|
15
|
-
}
|
|
13
|
+
static styles = selectStyles;
|
|
14
|
+
|
|
16
15
|
render() {
|
|
17
16
|
return html`
|
|
18
17
|
<select class="d2l-input-select" aria-label="Options">
|
|
@@ -61,9 +60,7 @@ When applying styles to the native element, we also recommend using the [`Skelet
|
|
|
61
60
|
import { SkeletonMixin } from '@brightspace-ui/core/components/skeleton/skeleton-mixin.js';
|
|
62
61
|
|
|
63
62
|
class TestInputSelect extends SkeletonMixin(LitElement) {
|
|
64
|
-
static
|
|
65
|
-
return [super.styles, selectStyles];
|
|
66
|
-
}
|
|
63
|
+
static styles = [super.styles, selectStyles];
|
|
67
64
|
|
|
68
65
|
render() {
|
|
69
66
|
return html`
|
|
@@ -100,9 +97,7 @@ For a visible label, import the label styles and include them in your component'
|
|
|
100
97
|
|
|
101
98
|
class TestInputSelect extends LitElement {
|
|
102
99
|
|
|
103
|
-
static
|
|
104
|
-
return [inputLabelStyles, selectStyles];
|
|
105
|
-
}
|
|
100
|
+
static styles = [inputLabelStyles, selectStyles];
|
|
106
101
|
|
|
107
102
|
render() {
|
|
108
103
|
return html`
|
|
@@ -16,9 +16,7 @@ Import `input-checkbox-styles.js` and apply the `d2l-input-checkbox` CSS class t
|
|
|
16
16
|
|
|
17
17
|
class MyCheckboxElem extends LitElement {
|
|
18
18
|
|
|
19
|
-
static
|
|
20
|
-
return checkboxStyles;
|
|
21
|
-
}
|
|
19
|
+
static styles = checkboxStyles;
|
|
22
20
|
|
|
23
21
|
render() {
|
|
24
22
|
return html`<input type="checkbox" class="d2l-input-checkbox">`;
|
|
@@ -46,9 +44,7 @@ For disabled items, add the `d2l-input-radio-label-disabled` class on the label
|
|
|
46
44
|
|
|
47
45
|
class MyRadioElem extends LitElement {
|
|
48
46
|
|
|
49
|
-
static
|
|
50
|
-
return radioStyles;
|
|
51
|
-
}
|
|
47
|
+
static styles = radioStyles;
|
|
52
48
|
|
|
53
49
|
render() {
|
|
54
50
|
return html`
|
|
@@ -85,17 +81,13 @@ If you'd like to manually link the radio input with a label, or use an ARIA labe
|
|
|
85
81
|
|
|
86
82
|
class MyRadioElem extends LitElement {
|
|
87
83
|
|
|
88
|
-
static
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
};
|
|
94
|
-
}
|
|
84
|
+
static properties = {
|
|
85
|
+
checked: { type: Boolean },
|
|
86
|
+
disabled: { type: Boolean },
|
|
87
|
+
invalid: { type: Boolean }
|
|
88
|
+
};
|
|
95
89
|
|
|
96
|
-
static
|
|
97
|
-
return radioStyles;
|
|
98
|
-
}
|
|
90
|
+
static styles = radioStyles;
|
|
99
91
|
|
|
100
92
|
render() {
|
|
101
93
|
const invalid = this.invalid ? 'true' : 'false';
|
|
@@ -130,9 +122,7 @@ To align related content below radio buttons, the `d2l-input-radio-spacer` eleme
|
|
|
130
122
|
|
|
131
123
|
class MyRadioElem extends LitElement {
|
|
132
124
|
|
|
133
|
-
static
|
|
134
|
-
return [ radioStyles, inlineHelpStyles ];
|
|
135
|
-
}
|
|
125
|
+
static styles = [ radioStyles, inlineHelpStyles ];
|
|
136
126
|
|
|
137
127
|
render() {
|
|
138
128
|
return html`
|
|
@@ -164,9 +154,7 @@ Import `input-styles.js` and apply the `d2l-input` CSS class to the native `<inp
|
|
|
164
154
|
|
|
165
155
|
class MyTextInputElem extends LitElement {
|
|
166
156
|
|
|
167
|
-
static
|
|
168
|
-
return inputStyles;
|
|
169
|
-
}
|
|
157
|
+
static styles = inputStyles;
|
|
170
158
|
|
|
171
159
|
render() {
|
|
172
160
|
return html`<input type="text" class="d2l-input">`;
|
|
@@ -189,9 +177,7 @@ Import `input-styles.js` and apply the `d2l-input` CSS class to the native `<te
|
|
|
189
177
|
import { inputStyles } from '@brightspace-ui/core/components/inputs/input-styles.js';
|
|
190
178
|
|
|
191
179
|
class MyTextareaInputElem extends LitElement {
|
|
192
|
-
static
|
|
193
|
-
return inputStyles;
|
|
194
|
-
}
|
|
180
|
+
static styles = inputStyles;
|
|
195
181
|
render() {
|
|
196
182
|
return html`
|
|
197
183
|
<textarea class="d2l-input">
|
|
@@ -403,11 +403,9 @@ If an item is draggable, the `drag-handle-text` attribute should be used to prov
|
|
|
403
403
|
import { css, html, LitElement } from 'lit';
|
|
404
404
|
|
|
405
405
|
class ListDemoDragAndDropUsage extends LitElement {
|
|
406
|
-
static
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
};
|
|
410
|
-
}
|
|
406
|
+
static properties = {
|
|
407
|
+
list: { type: Array }
|
|
408
|
+
};
|
|
411
409
|
|
|
412
410
|
constructor() {
|
|
413
411
|
super();
|
|
@@ -467,15 +465,11 @@ These scenarios can be seen in the demo below.
|
|
|
467
465
|
import { labelStyles } from '@brightspace-ui/core/components/typography/styles.js';
|
|
468
466
|
|
|
469
467
|
class ListDemoDragAndDropInteractiveUsage extends LitElement {
|
|
470
|
-
static
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
};
|
|
474
|
-
}
|
|
468
|
+
static properties = {
|
|
469
|
+
list: { type: Array }
|
|
470
|
+
};
|
|
475
471
|
|
|
476
|
-
static
|
|
477
|
-
return labelStyles;
|
|
478
|
-
}
|
|
472
|
+
static styles = labelStyles;
|
|
479
473
|
|
|
480
474
|
constructor() {
|
|
481
475
|
super();
|
|
@@ -1058,9 +1052,7 @@ class ListItem extends ListItemMixin(LitElement) {
|
|
|
1058
1052
|
|
|
1059
1053
|
How add the styles:
|
|
1060
1054
|
```javascript
|
|
1061
|
-
static
|
|
1062
|
-
return [ super.styles ];
|
|
1063
|
-
}
|
|
1055
|
+
static styles = [super.styles];
|
|
1064
1056
|
```
|
|
1065
1057
|
|
|
1066
1058
|
How to render the list item:
|
|
@@ -9,9 +9,7 @@ import { menuItemSelectableStyles } from './menu-item-selectable-styles.js';
|
|
|
9
9
|
*/
|
|
10
10
|
class MenuItemCheckbox extends MenuItemSelectableMixin(LitElement) {
|
|
11
11
|
|
|
12
|
-
static
|
|
13
|
-
return menuItemSelectableStyles;
|
|
14
|
-
}
|
|
12
|
+
static styles = menuItemSelectableStyles;
|
|
15
13
|
|
|
16
14
|
constructor() {
|
|
17
15
|
super();
|
|
@@ -10,43 +10,37 @@ import { menuItemStyles } from './menu-item-styles.js';
|
|
|
10
10
|
*/
|
|
11
11
|
class MenuItemLink extends LinkMixin(MenuItemMixin(LitElement)) {
|
|
12
12
|
|
|
13
|
-
static
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
}
|
|
13
|
+
static properties = {
|
|
14
|
+
_ariaDescription: { type: String, attribute: 'aria-description', reflect: true },
|
|
15
|
+
};
|
|
18
16
|
|
|
19
|
-
static
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
padding: 0;
|
|
25
|
-
}
|
|
17
|
+
static styles = [super.styles, menuItemStyles, css`
|
|
18
|
+
:host {
|
|
19
|
+
display: block;
|
|
20
|
+
padding: 0;
|
|
21
|
+
}
|
|
26
22
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
23
|
+
:host > a {
|
|
24
|
+
align-items: center;
|
|
25
|
+
color: inherit;
|
|
26
|
+
display: flex;
|
|
27
|
+
line-height: 1rem;
|
|
28
|
+
outline: none;
|
|
29
|
+
overflow-x: hidden;
|
|
30
|
+
padding: 0.75rem 1rem;
|
|
31
|
+
text-decoration: none;
|
|
32
|
+
}
|
|
37
33
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
34
|
+
:host([target="_blank"]) .d2l-menu-item-text {
|
|
35
|
+
align-self: baseline;
|
|
36
|
+
flex: 0 1 auto;
|
|
37
|
+
}
|
|
42
38
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
];
|
|
49
|
-
}
|
|
39
|
+
#new-window {
|
|
40
|
+
align-self: baseline;
|
|
41
|
+
flex: auto;
|
|
42
|
+
}
|
|
43
|
+
`];
|
|
50
44
|
|
|
51
45
|
constructor() {
|
|
52
46
|
super();
|
|
@@ -4,60 +4,58 @@ const defaultLines = 2;
|
|
|
4
4
|
|
|
5
5
|
export const MenuItemMixin = superclass => class extends PropertyRequiredMixin(superclass) {
|
|
6
6
|
|
|
7
|
-
static
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
};
|
|
60
|
-
}
|
|
7
|
+
static properties = {
|
|
8
|
+
/**
|
|
9
|
+
* Disables the menu item
|
|
10
|
+
* @type {boolean}
|
|
11
|
+
*/
|
|
12
|
+
disabled: { type: Boolean, reflect: true },
|
|
13
|
+
/**
|
|
14
|
+
* @ignore
|
|
15
|
+
*/
|
|
16
|
+
first: { type: Boolean, reflect: true }, // set by d2l-menu
|
|
17
|
+
/**
|
|
18
|
+
* @ignore
|
|
19
|
+
*/
|
|
20
|
+
hasChildView: { type: Boolean },
|
|
21
|
+
/**
|
|
22
|
+
* @ignore
|
|
23
|
+
*/
|
|
24
|
+
// eslint-disable-next-line lit/no-native-attributes
|
|
25
|
+
hidden: { type: Boolean, reflect: true },
|
|
26
|
+
/**
|
|
27
|
+
* @ignore
|
|
28
|
+
*/
|
|
29
|
+
last: { type: String, reflect: true }, // set by d2l-menu
|
|
30
|
+
/**
|
|
31
|
+
* The number of lines to display before truncating text with an ellipsis. Defaults to 2.
|
|
32
|
+
* @type {number}
|
|
33
|
+
*/
|
|
34
|
+
lines: { type: Number },
|
|
35
|
+
/**
|
|
36
|
+
* @ignore
|
|
37
|
+
*/
|
|
38
|
+
// eslint-disable-next-line lit/no-native-attributes
|
|
39
|
+
role: { type: String, reflect: true },
|
|
40
|
+
/**
|
|
41
|
+
* @ignore
|
|
42
|
+
*/
|
|
43
|
+
// eslint-disable-next-line lit/no-native-attributes
|
|
44
|
+
tabindex: { type: String, reflect: true },
|
|
45
|
+
/**
|
|
46
|
+
* REQUIRED: Text displayed by the menu item
|
|
47
|
+
* @type {string}
|
|
48
|
+
*/
|
|
49
|
+
text: { type: String, required: true },
|
|
50
|
+
/**
|
|
51
|
+
* ACCESSIBILITY: A description of the menu item that will be used by screen readers for additional context
|
|
52
|
+
* @type {string}
|
|
53
|
+
*/
|
|
54
|
+
description: { type: String },
|
|
55
|
+
_ariaDisabled: { type: String, attribute: 'aria-disabled', reflect: true },
|
|
56
|
+
_ariaLabel: { type: String, attribute: 'aria-label', reflect: true },
|
|
57
|
+
_letClickPropagate: { state: true }
|
|
58
|
+
};
|
|
61
59
|
|
|
62
60
|
constructor() {
|
|
63
61
|
super();
|
|
@@ -9,9 +9,7 @@ import { menuItemSelectableStyles } from './menu-item-selectable-styles.js';
|
|
|
9
9
|
*/
|
|
10
10
|
export class MenuItemRadio extends MenuItemRadioMixin(LitElement) {
|
|
11
11
|
|
|
12
|
-
static
|
|
13
|
-
return menuItemSelectableStyles;
|
|
14
|
-
}
|
|
12
|
+
static styles = menuItemSelectableStyles;
|
|
15
13
|
|
|
16
14
|
render() {
|
|
17
15
|
return html`
|
|
@@ -7,28 +7,24 @@ import { overflowEllipsisDeclarations } from '../../helpers/overflow.js';
|
|
|
7
7
|
|
|
8
8
|
class MenuItemReturn extends LocalizeCoreElement(MenuItemMixin(LitElement)) {
|
|
9
9
|
|
|
10
|
-
static
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
`
|
|
30
|
-
];
|
|
31
|
-
}
|
|
10
|
+
static styles = [menuItemStyles, css`
|
|
11
|
+
:host {
|
|
12
|
+
display: flex;
|
|
13
|
+
padding: 0.75rem 1rem;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
span {
|
|
17
|
+
flex: auto;
|
|
18
|
+
line-height: 1rem;
|
|
19
|
+
${overflowEllipsisDeclarations}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
d2l-icon {
|
|
23
|
+
flex: none;
|
|
24
|
+
margin-inline-end: 1rem;
|
|
25
|
+
margin-top: 0.1rem;
|
|
26
|
+
}
|
|
27
|
+
`];
|
|
32
28
|
|
|
33
29
|
constructor() {
|
|
34
30
|
super();
|
|
@@ -2,20 +2,18 @@ import { MenuItemMixin } from './menu-item-mixin.js';
|
|
|
2
2
|
|
|
3
3
|
export const MenuItemSelectableMixin = superclass => class extends MenuItemMixin(superclass) {
|
|
4
4
|
|
|
5
|
-
static
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
}
|
|
5
|
+
static properties = {
|
|
6
|
+
/**
|
|
7
|
+
* This will set the item to be selected by default
|
|
8
|
+
* @type {boolean}
|
|
9
|
+
*/
|
|
10
|
+
selected: { type: Boolean, reflect: true },
|
|
11
|
+
/**
|
|
12
|
+
* REQUIRED: The selectable item's value
|
|
13
|
+
* @type {string}
|
|
14
|
+
*/
|
|
15
|
+
value: { type: String }
|
|
16
|
+
};
|
|
19
17
|
|
|
20
18
|
constructor() {
|
|
21
19
|
super();
|
|
@@ -5,17 +5,15 @@ import { css, LitElement } from 'lit';
|
|
|
5
5
|
*/
|
|
6
6
|
class MenuItemSeparator extends LitElement {
|
|
7
7
|
|
|
8
|
-
static
|
|
9
|
-
|
|
10
|
-
:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
`;
|
|
18
|
-
}
|
|
8
|
+
static styles = css`
|
|
9
|
+
:host {
|
|
10
|
+
border-top: 1px solid var(--d2l-menu-separator-color);
|
|
11
|
+
display: block;
|
|
12
|
+
margin-top: -1px;
|
|
13
|
+
position: relative;
|
|
14
|
+
z-index: 1;
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
19
17
|
|
|
20
18
|
firstUpdated(changedProperties) {
|
|
21
19
|
super.firstUpdated(changedProperties);
|
|
@@ -10,21 +10,17 @@ import { menuItemStyles } from './menu-item-styles.js';
|
|
|
10
10
|
*/
|
|
11
11
|
class MenuItem extends MenuItemMixin(LitElement) {
|
|
12
12
|
|
|
13
|
-
static
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
`
|
|
26
|
-
];
|
|
27
|
-
}
|
|
13
|
+
static styles = [menuItemStyles, css`
|
|
14
|
+
:host {
|
|
15
|
+
align-items: center;
|
|
16
|
+
display: flex;
|
|
17
|
+
padding: 0.75rem 1rem;
|
|
18
|
+
}
|
|
19
|
+
d2l-icon {
|
|
20
|
+
flex: none;
|
|
21
|
+
margin-inline-start: 6px;
|
|
22
|
+
}
|
|
23
|
+
`];
|
|
28
24
|
|
|
29
25
|
render() {
|
|
30
26
|
const icon = this.hasChildView ?
|