@brightspace-ui/core 3.267.1 → 3.268.0
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-select-styles.js +30 -25
- 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/helpers/focus.js +5 -1
- package/package.json +3 -2
|
@@ -7,53 +7,48 @@ import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
|
|
7
7
|
|
|
8
8
|
class FormErrorSummary extends LocalizeCoreElement(LitElement) {
|
|
9
9
|
|
|
10
|
-
static
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
static get styles() {
|
|
20
|
-
return [linkStyles, css`
|
|
10
|
+
static properties = {
|
|
11
|
+
errors: { type: Object, attribute: false },
|
|
12
|
+
_expanded: { type: Boolean, attribute: false },
|
|
13
|
+
_hasTopMargin: { type: Boolean, attribute: '_has-top-margin', reflect: true },
|
|
14
|
+
_hasErrors: { type: Boolean, attribute: '_has-errors', reflect: true },
|
|
15
|
+
};
|
|
21
16
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
17
|
+
static styles = [linkStyles, css`
|
|
18
|
+
:host {
|
|
19
|
+
display: block;
|
|
20
|
+
}
|
|
21
|
+
:host([hidden]) {
|
|
22
|
+
display: none;
|
|
23
|
+
}
|
|
24
|
+
:host([_has-top-margin][_has-errors]) {
|
|
25
|
+
margin-block-start: 1rem;
|
|
26
|
+
}
|
|
31
27
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
28
|
+
.d2l-form-error-summary-header {
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
display: flex;
|
|
31
|
+
justify-content: space-between;
|
|
32
|
+
padding-block: 0.3rem;
|
|
33
|
+
padding-inline: 1.2rem 0.3rem;
|
|
34
|
+
}
|
|
39
35
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
.d2l-form-error-summary-text {
|
|
37
|
+
align-items: center;
|
|
38
|
+
display: flex;
|
|
39
|
+
}
|
|
44
40
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
41
|
+
.d2l-form-error-summary-error-list {
|
|
42
|
+
margin-block: 0;
|
|
43
|
+
margin-inline: 1.2rem 0;
|
|
44
|
+
padding-bottom: 0.6rem;
|
|
45
|
+
padding-top: 0.3rem;
|
|
46
|
+
}
|
|
51
47
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
48
|
+
d2l-alert {
|
|
49
|
+
max-width: none;
|
|
50
|
+
}
|
|
51
|
+
`];
|
|
57
52
|
|
|
58
53
|
constructor() {
|
|
59
54
|
super();
|
package/components/form/form.js
CHANGED
|
@@ -17,43 +17,39 @@ import { localizeFormElement } from './form-element-localize-helper.js';
|
|
|
17
17
|
*/
|
|
18
18
|
class Form extends LocalizeCoreElement(LitElement) {
|
|
19
19
|
|
|
20
|
-
static
|
|
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
|
-
margin-block-start: 1rem;
|
|
54
|
-
}
|
|
55
|
-
`;
|
|
56
|
-
}
|
|
20
|
+
static properties = {
|
|
21
|
+
/**
|
|
22
|
+
* Indicates that the form should opt-out of nesting.
|
|
23
|
+
* This means that it will not be submitted or validated if an ancestor form is submitted or validated.
|
|
24
|
+
* However, directly submitting or validating a form with `no-nesting` will still trigger submission and validation for its descendant forms unless they also opt-out using `no-nesting`.
|
|
25
|
+
* @type {boolean}
|
|
26
|
+
*/
|
|
27
|
+
noNesting: { type: Boolean, attribute: 'no-nesting', reflect: true },
|
|
28
|
+
/**
|
|
29
|
+
* Indicates that the form should interrupt and warn on navigation if the user has unsaved changes on native elements.
|
|
30
|
+
* @type {boolean}
|
|
31
|
+
*/
|
|
32
|
+
trackChanges: { type: Boolean, attribute: 'track-changes', reflect: true },
|
|
33
|
+
/**
|
|
34
|
+
* Id for an alternative error summary element
|
|
35
|
+
* @type {string}
|
|
36
|
+
*/
|
|
37
|
+
summaryId: { type: String, attribute: 'summary-id' },
|
|
38
|
+
_errors: { type: Object },
|
|
39
|
+
_hasErrors: { type: Boolean, attribute: '_has-errors', reflect: true },
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
static styles = css`
|
|
43
|
+
:host {
|
|
44
|
+
display: block;
|
|
45
|
+
}
|
|
46
|
+
:host([hidden]) {
|
|
47
|
+
display: none;
|
|
48
|
+
}
|
|
49
|
+
:host([_has-errors]) ::slotted(d2l-input-group) {
|
|
50
|
+
margin-block-start: 1rem;
|
|
51
|
+
}
|
|
52
|
+
`;
|
|
57
53
|
|
|
58
54
|
constructor() {
|
|
59
55
|
super();
|
|
@@ -8,92 +8,88 @@ const escapeKeyCode = 27;
|
|
|
8
8
|
|
|
9
9
|
export const HierarchicalViewMixin = superclass => class extends superclass {
|
|
10
10
|
|
|
11
|
-
static
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
11
|
+
static properties = {
|
|
12
|
+
/**
|
|
13
|
+
* @ignore
|
|
14
|
+
*/
|
|
15
|
+
hierarchicalView: { type: Boolean },
|
|
16
|
+
/**
|
|
17
|
+
* @ignore
|
|
18
|
+
*/
|
|
19
|
+
rootView: { type: Boolean, attribute: 'root-view' },
|
|
20
|
+
/**
|
|
21
|
+
* @ignore
|
|
22
|
+
*/
|
|
23
|
+
shown: { type: Boolean, reflect: true },
|
|
24
|
+
_childView: { type: Boolean, reflect: true, attribute: 'child-view' },
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
static styles = css`
|
|
28
|
+
:host {
|
|
29
|
+
--d2l-hierarchical-view-height-transition: height 300ms linear;
|
|
30
|
+
box-sizing: border-box;
|
|
31
|
+
display: none;
|
|
32
|
+
left: 0;
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
position: relative;
|
|
35
|
+
-webkit-transition: var(--d2l-hierarchical-view-height-transition);
|
|
36
|
+
transition: var(--d2l-hierarchical-view-height-transition);
|
|
37
|
+
width: 100%;
|
|
38
|
+
}
|
|
39
|
+
:host([child-view]) {
|
|
40
|
+
display: none;
|
|
41
|
+
left: 100%;
|
|
42
|
+
position: absolute;
|
|
43
|
+
top: 0;
|
|
44
|
+
}
|
|
45
|
+
:host([shown]) {
|
|
46
|
+
display: inline-block;
|
|
47
|
+
vertical-align: top; /* DE37329: required to prevent extra spacing caused by inline-block */
|
|
48
|
+
}
|
|
49
|
+
.d2l-hierarchical-view-content {
|
|
50
|
+
position: relative;
|
|
51
|
+
}
|
|
52
|
+
.d2l-hierarchical-view-content.d2l-child-view-show {
|
|
53
|
+
-webkit-animation: show-child-view-animation forwards 300ms linear;
|
|
54
|
+
animation: show-child-view-animation 300ms forwards linear;
|
|
55
|
+
}
|
|
56
|
+
.d2l-hierarchical-view-content.d2l-child-view-hide {
|
|
57
|
+
-webkit-animation: hide-child-view-animation forwards 300ms linear;
|
|
58
|
+
animation: hide-child-view-animation 300ms forwards linear;
|
|
59
|
+
}
|
|
60
|
+
@media (prefers-reduced-motion: reduce) {
|
|
31
61
|
:host {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
display: none;
|
|
35
|
-
left: 0;
|
|
36
|
-
overflow: hidden;
|
|
37
|
-
position: relative;
|
|
38
|
-
-webkit-transition: var(--d2l-hierarchical-view-height-transition);
|
|
39
|
-
transition: var(--d2l-hierarchical-view-height-transition);
|
|
40
|
-
width: 100%;
|
|
41
|
-
}
|
|
42
|
-
:host([child-view]) {
|
|
43
|
-
display: none;
|
|
44
|
-
left: 100%;
|
|
45
|
-
position: absolute;
|
|
46
|
-
top: 0;
|
|
47
|
-
}
|
|
48
|
-
:host([shown]) {
|
|
49
|
-
display: inline-block;
|
|
50
|
-
vertical-align: top; /* DE37329: required to prevent extra spacing caused by inline-block */
|
|
51
|
-
}
|
|
52
|
-
.d2l-hierarchical-view-content {
|
|
53
|
-
position: relative;
|
|
62
|
+
-webkit-transition: none;
|
|
63
|
+
transition: none;
|
|
54
64
|
}
|
|
55
65
|
.d2l-hierarchical-view-content.d2l-child-view-show {
|
|
56
|
-
-webkit-animation:
|
|
57
|
-
animation:
|
|
66
|
+
-webkit-animation: none;
|
|
67
|
+
animation: none;
|
|
68
|
+
left: -100%;
|
|
58
69
|
}
|
|
59
70
|
.d2l-hierarchical-view-content.d2l-child-view-hide {
|
|
60
|
-
-webkit-animation:
|
|
61
|
-
animation:
|
|
62
|
-
|
|
63
|
-
@media (prefers-reduced-motion: reduce) {
|
|
64
|
-
:host {
|
|
65
|
-
-webkit-transition: none;
|
|
66
|
-
transition: none;
|
|
67
|
-
}
|
|
68
|
-
.d2l-hierarchical-view-content.d2l-child-view-show {
|
|
69
|
-
-webkit-animation: none;
|
|
70
|
-
animation: none;
|
|
71
|
-
left: -100%;
|
|
72
|
-
}
|
|
73
|
-
.d2l-hierarchical-view-content.d2l-child-view-hide {
|
|
74
|
-
-webkit-animation: none;
|
|
75
|
-
animation: none;
|
|
76
|
-
left: 0;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
@keyframes show-child-view-animation {
|
|
80
|
-
0% { left: 0; }
|
|
81
|
-
100% { left: -100%; }
|
|
82
|
-
}
|
|
83
|
-
@-webkit-keyframes show-child-view-animation {
|
|
84
|
-
0% { left: 0; }
|
|
85
|
-
100% { left: -100%; }
|
|
86
|
-
}
|
|
87
|
-
@keyframes hide-child-view-animation {
|
|
88
|
-
0% { left: -100%; }
|
|
89
|
-
100% { left: 0; }
|
|
90
|
-
}
|
|
91
|
-
@-webkit-keyframes hide-child-view-animation {
|
|
92
|
-
0% { left: -100%; }
|
|
93
|
-
100% { left: 0; }
|
|
71
|
+
-webkit-animation: none;
|
|
72
|
+
animation: none;
|
|
73
|
+
left: 0;
|
|
94
74
|
}
|
|
95
|
-
|
|
96
|
-
|
|
75
|
+
}
|
|
76
|
+
@keyframes show-child-view-animation {
|
|
77
|
+
0% { left: 0; }
|
|
78
|
+
100% { left: -100%; }
|
|
79
|
+
}
|
|
80
|
+
@-webkit-keyframes show-child-view-animation {
|
|
81
|
+
0% { left: 0; }
|
|
82
|
+
100% { left: -100%; }
|
|
83
|
+
}
|
|
84
|
+
@keyframes hide-child-view-animation {
|
|
85
|
+
0% { left: -100%; }
|
|
86
|
+
100% { left: 0; }
|
|
87
|
+
}
|
|
88
|
+
@-webkit-keyframes hide-child-view-animation {
|
|
89
|
+
0% { left: -100%; }
|
|
90
|
+
100% { left: 0; }
|
|
91
|
+
}
|
|
92
|
+
`;
|
|
97
93
|
|
|
98
94
|
constructor() {
|
|
99
95
|
super();
|
|
@@ -10,13 +10,11 @@ import { HierarchicalViewMixin } from '../hierarchical-view/hierarchical-view-mi
|
|
|
10
10
|
*/
|
|
11
11
|
class HierarchicalView extends HierarchicalViewMixin(LitElement) {
|
|
12
12
|
|
|
13
|
-
static
|
|
14
|
-
|
|
15
|
-
:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
`];
|
|
19
|
-
}
|
|
13
|
+
static styles = [super.styles, css`
|
|
14
|
+
:host {
|
|
15
|
+
display: inline-block;
|
|
16
|
+
}
|
|
17
|
+
`];
|
|
20
18
|
|
|
21
19
|
render() {
|
|
22
20
|
return html`
|
|
@@ -188,8 +188,8 @@ const getRenderers = async() => {
|
|
|
188
188
|
if (renderers) return renderers;
|
|
189
189
|
const rendererLoader = requestInstance(document, 'html-block-renderer-loader');
|
|
190
190
|
const tempRenderers = rendererLoader ? await rendererLoader.getRenderers() : undefined;
|
|
191
|
-
const defaultRenderers = [
|
|
192
|
-
renderers = (tempRenderers ? [
|
|
191
|
+
const defaultRenderers = [createMathRenderer(), createCodeRenderer()];
|
|
192
|
+
renderers = (tempRenderers ? [...defaultRenderers, ...tempRenderers] : defaultRenderers);
|
|
193
193
|
return renderers;
|
|
194
194
|
};
|
|
195
195
|
|
|
@@ -198,53 +198,49 @@ const getRenderers = async() => {
|
|
|
198
198
|
*/
|
|
199
199
|
class HtmlBlock extends LoadingCompleteMixin(LitElement) {
|
|
200
200
|
|
|
201
|
-
static
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
:
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
display: contents;
|
|
245
|
-
}
|
|
246
|
-
`];
|
|
247
|
-
}
|
|
201
|
+
static properties = {
|
|
202
|
+
/**
|
|
203
|
+
* Whether compact styles should be applied
|
|
204
|
+
* @type {Boolean}
|
|
205
|
+
*/
|
|
206
|
+
compact: { type: Boolean },
|
|
207
|
+
/**
|
|
208
|
+
* The HTML to be rendered. Ignored if slotted content is provided.
|
|
209
|
+
* @type {String}
|
|
210
|
+
*/
|
|
211
|
+
html: { type: String },
|
|
212
|
+
/**
|
|
213
|
+
* Whether to display the HTML in inline mode
|
|
214
|
+
* @type {Boolean}
|
|
215
|
+
*/
|
|
216
|
+
inline: { type: Boolean },
|
|
217
|
+
/**
|
|
218
|
+
* Whether to disable deferred rendering of the user-authored HTML. Do *not* set this
|
|
219
|
+
* unless your HTML relies on script executions that may break upon stamping.
|
|
220
|
+
* @type {Boolean}
|
|
221
|
+
*/
|
|
222
|
+
noDeferredRendering: { type: Boolean, attribute: 'no-deferred-rendering' },
|
|
223
|
+
_context: { type: Object, state: true }
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
static styles = [htmlBlockContentStyles, css`
|
|
227
|
+
:host {
|
|
228
|
+
display: block;
|
|
229
|
+
}
|
|
230
|
+
${_generateHtmlBlockRootStyles(':host')}
|
|
231
|
+
:host([inline]),
|
|
232
|
+
:host([inline]) .d2l-html-block-rendered {
|
|
233
|
+
display: inline;
|
|
234
|
+
}
|
|
235
|
+
:host([hidden]),
|
|
236
|
+
:host([no-deferred-rendering]) .d2l-html-block-rendered,
|
|
237
|
+
slot {
|
|
238
|
+
display: none;
|
|
239
|
+
}
|
|
240
|
+
:host([no-deferred-rendering]) slot {
|
|
241
|
+
display: contents;
|
|
242
|
+
}
|
|
243
|
+
`];
|
|
248
244
|
|
|
249
245
|
constructor() {
|
|
250
246
|
super();
|
|
@@ -4,31 +4,27 @@ import { iconStyles } from './icon-styles.js';
|
|
|
4
4
|
|
|
5
5
|
class IconCustom extends LitElement {
|
|
6
6
|
|
|
7
|
-
static
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
}
|
|
7
|
+
static properties = {
|
|
8
|
+
size: {
|
|
9
|
+
type: String,
|
|
10
|
+
reflect: true
|
|
11
|
+
}
|
|
12
|
+
};
|
|
15
13
|
|
|
16
|
-
static
|
|
17
|
-
|
|
18
|
-
:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
`];
|
|
31
|
-
}
|
|
14
|
+
static styles = [iconStyles, css`
|
|
15
|
+
:host([size="tier1"]) {
|
|
16
|
+
height: var(--d2l-icon-height, 18px);
|
|
17
|
+
width: var(--d2l-icon-width, 18px);
|
|
18
|
+
}
|
|
19
|
+
:host([size="tier2"]) {
|
|
20
|
+
height: var(--d2l-icon-height, 24px);
|
|
21
|
+
width: var(--d2l-icon-width, 24px);
|
|
22
|
+
}
|
|
23
|
+
:host([size="tier3"]) {
|
|
24
|
+
height: var(--d2l-icon-height, 30px);
|
|
25
|
+
width: var(--d2l-icon-width, 30px);
|
|
26
|
+
}
|
|
27
|
+
`];
|
|
32
28
|
|
|
33
29
|
render() {
|
|
34
30
|
return html`<slot @slotchange="${this._handleSlotChange}"></slot>`;
|
package/components/icons/icon.js
CHANGED
|
@@ -9,31 +9,27 @@ import { until } from 'lit/directives/until.js';
|
|
|
9
9
|
|
|
10
10
|
class Icon extends LitElement {
|
|
11
11
|
|
|
12
|
-
static
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
}
|
|
12
|
+
static properties = {
|
|
13
|
+
icon: {
|
|
14
|
+
type: String,
|
|
15
|
+
reflect: true
|
|
16
|
+
}
|
|
17
|
+
};
|
|
20
18
|
|
|
21
|
-
static
|
|
22
|
-
|
|
23
|
-
:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
`];
|
|
36
|
-
}
|
|
19
|
+
static styles = [iconStyles, css`
|
|
20
|
+
:host([icon*="tier1:"]) {
|
|
21
|
+
height: var(--d2l-icon-height, 18px);
|
|
22
|
+
width: var(--d2l-icon-width, 18px);
|
|
23
|
+
}
|
|
24
|
+
:host([icon*="tier2:"]) {
|
|
25
|
+
height: var(--d2l-icon-height, 24px);
|
|
26
|
+
width: var(--d2l-icon-width, 24px);
|
|
27
|
+
}
|
|
28
|
+
:host([icon*="tier3:"]) {
|
|
29
|
+
height: var(--d2l-icon-height, 30px);
|
|
30
|
+
width: var(--d2l-icon-width, 30px);
|
|
31
|
+
}
|
|
32
|
+
`];
|
|
37
33
|
|
|
38
34
|
render() {
|
|
39
35
|
return guard([this.icon], () => until(this._getIcon(), noChange));
|
|
@@ -3,26 +3,24 @@ import { css, html, nothing } from 'lit';
|
|
|
3
3
|
|
|
4
4
|
export const SlottedIconMixin = superclass => class extends superclass {
|
|
5
5
|
|
|
6
|
-
static
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
}
|
|
6
|
+
static properties = {
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Preset icon key (e.g. "tier1:gear")
|
|
10
|
+
* @type {string}
|
|
11
|
+
*/
|
|
12
|
+
icon: {
|
|
13
|
+
type: String,
|
|
14
|
+
reflect: true,
|
|
15
|
+
required: {
|
|
16
|
+
validator: (_value, elem, hasValue) => hasValue || elem._hasCustomIcon || !elem._iconRequired
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
_hasCustomIcon: { state: true }
|
|
20
|
+
};
|
|
23
21
|
|
|
24
22
|
static get styles() {
|
|
25
|
-
const styles = [
|
|
23
|
+
const styles = [css`
|
|
26
24
|
slot[name="icon"]::slotted(*) {
|
|
27
25
|
display: none;
|
|
28
26
|
}
|