@brightspace-ui/core 3.227.4 → 3.227.5
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/button/button.js +8 -8
- package/components/demo/test/demo-page-settings.test.js +25 -0
- package/components/demo/test/demo-page.test.js +17 -0
- package/package.json +1 -1
- package/components/alert/demo/alert-toast.html +0 -106
- package/components/alert/demo/alert.html +0 -82
- package/components/backdrop/demo/backdrop-loading.html +0 -166
- package/components/backdrop/demo/backdrop.html +0 -57
- package/components/breadcrumbs/demo/breadcrumbs.html +0 -53
- package/components/button/demo/button-add.html +0 -55
- package/components/button/demo/button-copy.html +0 -122
- package/components/button/demo/button-icon.html +0 -174
- package/components/button/demo/button-move.html +0 -38
- package/components/button/demo/button-split.html +0 -76
- package/components/button/demo/button-subtle.html +0 -132
- package/components/button/demo/button-toggle.html +0 -80
- package/components/button/demo/button.html +0 -67
- package/components/button/demo/floating-buttons-in-frame.html +0 -44
- package/components/button/demo/floating-buttons-in-tabs.html +0 -244
- package/components/button/demo/floating-buttons-page.html +0 -100
- package/components/button/demo/floating-buttons.html +0 -101
- package/components/calendar/demo/calendar.html +0 -76
- package/components/card/demo/card.html +0 -304
- package/components/collapsible-panel/demo/collapsible-panel.html +0 -218
- package/components/colors/demo/color-swatch.js +0 -240
- package/components/colors/demo/colors.html +0 -139
- package/components/count-badge/demo/count-badge-icon.html +0 -48
- package/components/count-badge/demo/count-badge.html +0 -73
- package/components/demo/demo/demo-snippet.html +0 -71
- package/components/description-list/demo/description-list-test.js +0 -142
- package/components/description-list/demo/description-list.html +0 -48
- package/components/dialog/demo/dialog-async-content-until.js +0 -89
- package/components/dialog/demo/dialog-async-content.js +0 -72
- package/components/dialog/demo/dialog-confirm.html +0 -102
- package/components/dialog/demo/dialog-container.js +0 -40
- package/components/dialog/demo/dialog-fullscreen.html +0 -273
- package/components/dialog/demo/dialog-nested.html +0 -94
- package/components/dialog/demo/dialog.html +0 -398
- package/components/dropdown/demo/dropdown-button.html +0 -102
- package/components/dropdown/demo/dropdown-context-menu.html +0 -129
- package/components/dropdown/demo/dropdown-flicker-inner.html +0 -70
- package/components/dropdown/demo/dropdown-flicker.html +0 -142
- package/components/dropdown/demo/dropdown-menu-demo-view.js +0 -37
- package/components/dropdown/demo/dropdown-menu.html +0 -227
- package/components/dropdown/demo/dropdown-more.html +0 -160
- package/components/dropdown/demo/dropdown-positioning.html +0 -127
- package/components/dropdown/demo/dropdown-tabs.html +0 -87
- package/components/dropdown/demo/dropdown.html +0 -217
- package/components/empty-state/demo/empty-state.html +0 -94
- package/components/expand-collapse/demo/expand-collapse-content.html +0 -58
- package/components/filter/demo/filter-load-more-demo.js +0 -182
- package/components/filter/demo/filter-overflow-group.html +0 -246
- package/components/filter/demo/filter-search-demo.js +0 -135
- package/components/filter/demo/filter-tags.html +0 -115
- package/components/filter/demo/filter.html +0 -230
- package/components/focus-trap/demo/focus-trap.html +0 -75
- package/components/form/demo/form-demo.js +0 -105
- package/components/form/demo/form-dialog-demo.js +0 -94
- package/components/form/demo/form-panel-demo.js +0 -89
- package/components/form/demo/form.html +0 -37
- package/components/hierarchical-view/demo/hierarchical-view.html +0 -221
- package/components/html-block/demo/html-block-code.html +0 -55
- package/components/html-block/demo/html-block.html +0 -696
- package/components/icons/demo/icon-color-override.js +0 -23
- package/components/icons/demo/icon-custom.html +0 -112
- package/components/icons/demo/icon-size-override.js +0 -24
- package/components/icons/demo/icon.html +0 -52
- package/components/inputs/demo/input-checkbox.html +0 -118
- package/components/inputs/demo/input-color-palette.js +0 -67
- package/components/inputs/demo/input-color.html +0 -110
- package/components/inputs/demo/input-date-range.html +0 -114
- package/components/inputs/demo/input-date-time-range.html +0 -128
- package/components/inputs/demo/input-date-time.html +0 -100
- package/components/inputs/demo/input-date.html +0 -81
- package/components/inputs/demo/input-group.html +0 -56
- package/components/inputs/demo/input-number.html +0 -136
- package/components/inputs/demo/input-percent.html +0 -99
- package/components/inputs/demo/input-radio-label-test.js +0 -45
- package/components/inputs/demo/input-radio-solo-test.js +0 -47
- package/components/inputs/demo/input-radio.html +0 -119
- package/components/inputs/demo/input-search.html +0 -75
- package/components/inputs/demo/input-select-test.js +0 -60
- package/components/inputs/demo/input-select.html +0 -45
- package/components/inputs/demo/input-text.html +0 -163
- package/components/inputs/demo/input-textarea.html +0 -124
- package/components/inputs/demo/input-time-range.html +0 -121
- package/components/inputs/demo/input-time.html +0 -95
- package/components/link/demo/link.html +0 -111
- package/components/list/demo/demo-list-nav.js +0 -170
- package/components/list/demo/demo-list-nested-iterations-helper.js +0 -168
- package/components/list/demo/demo-list-nested-lazy-load.js +0 -133
- package/components/list/demo/demo-list-nested.js +0 -291
- package/components/list/demo/demo-list.js +0 -241
- package/components/list/demo/list-color.html +0 -423
- package/components/list/demo/list-demo-scenarios.js +0 -380
- package/components/list/demo/list-drag-and-drop-position.js +0 -102
- package/components/list/demo/list-drag-and-drop.html +0 -82
- package/components/list/demo/list-expand-collapse.html +0 -136
- package/components/list/demo/list-item-actions.html +0 -371
- package/components/list/demo/list-item-custom.js +0 -204
- package/components/list/demo/list-item-layouts.html +0 -331
- package/components/list/demo/list-item-scroll.html +0 -122
- package/components/list/demo/list-layout.html +0 -575
- package/components/list/demo/list-nav.html +0 -110
- package/components/list/demo/list-nested.html +0 -270
- package/components/list/demo/list-selection.html +0 -301
- package/components/list/demo/list.html +0 -319
- package/components/loading-spinner/demo/loading-spinner-override.js +0 -34
- package/components/loading-spinner/demo/loading-spinner.html +0 -63
- package/components/menu/demo/checkbox-menu.html +0 -52
- package/components/menu/demo/custom-menu-item.js +0 -37
- package/components/menu/demo/custom-view.js +0 -63
- package/components/menu/demo/menu.html +0 -211
- package/components/menu/demo/radio-menu.html +0 -52
- package/components/meter/demo/meter.html +0 -115
- package/components/more-less/demo/more-less-test.js +0 -67
- package/components/more-less/demo/more-less.html +0 -71
- package/components/object-property-list/demo/object-property-list.html +0 -99
- package/components/offscreen/demo/offscreen-demo.js +0 -16
- package/components/offscreen/demo/offscreen.html +0 -44
- package/components/overflow-group/demo/demo-overflow-group.js +0 -29
- package/components/overflow-group/demo/overflow-group.html +0 -110
- package/components/paging/demo/pager-load-more.html +0 -120
- package/components/popover/demo/popover.html +0 -309
- package/components/progress/demo/progress.html +0 -104
- package/components/scroll-wrapper/demo/scroll-wrapper-test.js +0 -108
- package/components/scroll-wrapper/demo/scroll-wrapper.html +0 -52
- package/components/selection/demo/demo-selection.js +0 -35
- package/components/selection/demo/selection.html +0 -198
- package/components/skeleton/demo/skeleton-group-nested-test.js +0 -71
- package/components/skeleton/demo/skeleton-group-test-wrapper.js +0 -18
- package/components/skeleton/demo/skeleton-group-test.js +0 -91
- package/components/skeleton/demo/skeleton-mixin.html +0 -78
- package/components/skeleton/demo/skeleton-test-box.js +0 -34
- package/components/skeleton/demo/skeleton-test-container.js +0 -45
- package/components/skeleton/demo/skeleton-test-heading.js +0 -44
- package/components/skeleton/demo/skeleton-test-link.js +0 -47
- package/components/skeleton/demo/skeleton-test-paragraph.js +0 -54
- package/components/skeleton/demo/skeleton-test-stack.js +0 -38
- package/components/skeleton/demo/skeleton-test-width.js +0 -20
- package/components/sorting/demo/sort.html +0 -37
- package/components/status-indicator/demo/status-indicator.html +0 -99
- package/components/switch/demo/switch.html +0 -95
- package/components/table/demo/table-test.js +0 -271
- package/components/table/demo/table.html +0 -107
- package/components/tabs/demo/tab-custom.js +0 -39
- package/components/tabs/demo/tabs-array.js +0 -43
- package/components/tabs/demo/tabs.html +0 -558
- package/components/tag-list/demo/tag-list.html +0 -117
- package/components/tooltip/demo/tooltip.html +0 -275
- package/components/typography/demo/typography.html +0 -93
- package/components/view-switcher/demo/demo-table-view.js +0 -41
- package/components/view-switcher/demo/view-switcher.html +0 -71
- package/directives/animate/demo/animate-test.js +0 -98
- package/directives/animate/demo/index.html +0 -23
- package/helpers/demo/announce-test.js +0 -37
- package/helpers/demo/announce.html +0 -19
- package/helpers/demo/dismissible-test.js +0 -66
- package/helpers/demo/dismissible.html +0 -38
- package/helpers/demo/gestures.html +0 -58
- package/helpers/demo/prism.html +0 -694
- package/helpers/demo/template-tags.html +0 -118
- package/mixins/arrow-keys/demo/arrow-keys-mixin.html +0 -29
- package/mixins/arrow-keys/demo/arrow-keys-test.js +0 -38
- package/mixins/async-container/demo/async-container.html +0 -109
- package/mixins/async-container/demo/async-container.js +0 -27
- package/mixins/async-container/demo/async-item.js +0 -80
- package/mixins/labelled/demo/labelled-mixin.html +0 -90
- package/mixins/localize/demo/localize-mixin-greeting.js +0 -39
- package/mixins/localize/demo/localize-mixin-mission.js +0 -25
- package/mixins/localize/demo/localize-mixin.html +0 -28
- package/templates/primary-secondary/demo/form.html +0 -55
- package/templates/primary-secondary/demo/index.html +0 -27
- package/templates/primary-secondary/demo/integration.html +0 -457
- package/templates/primary-secondary/demo/overflow-hidden.html +0 -22
- package/templates/primary-secondary/demo/width-type-normal.html +0 -26
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import '../../colors/colors.js';
|
|
2
|
-
import { css, html, LitElement } from 'lit';
|
|
3
|
-
import { descriptionListStyles } from '../description-list-wrapper.js';
|
|
4
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
5
|
-
|
|
6
|
-
class TestDescriptionList extends LitElement {
|
|
7
|
-
static get properties() {
|
|
8
|
-
return {
|
|
9
|
-
/**
|
|
10
|
-
* Width for component to use a stacked layout
|
|
11
|
-
* @type {number}
|
|
12
|
-
*/
|
|
13
|
-
breakpoint: { type: Number, reflect: true },
|
|
14
|
-
/**
|
|
15
|
-
* Force the component to always use a stacked layout; will override breakpoint attribute
|
|
16
|
-
* @type {boolean}
|
|
17
|
-
*/
|
|
18
|
-
forceStacked: { type: Boolean, reflect: true, attribute: 'force-stacked' },
|
|
19
|
-
/**
|
|
20
|
-
* @ignore
|
|
21
|
-
*/
|
|
22
|
-
type: { type: String, reflect: true },
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
static get styles() {
|
|
27
|
-
return [descriptionListStyles, css`
|
|
28
|
-
.user {
|
|
29
|
-
align-items: center;
|
|
30
|
-
display: flex;
|
|
31
|
-
gap: 0.5rem;
|
|
32
|
-
}
|
|
33
|
-
.avatar {
|
|
34
|
-
align-items: center;
|
|
35
|
-
background-color: var(--d2l-color-cinnabar-minus-1);
|
|
36
|
-
border-radius: 0.25rem;
|
|
37
|
-
color: white;
|
|
38
|
-
display: flex;
|
|
39
|
-
font-size: 0.7rem;
|
|
40
|
-
font-weight: 700;
|
|
41
|
-
height: 1.5rem;
|
|
42
|
-
justify-content: center;
|
|
43
|
-
width: 1.5rem;
|
|
44
|
-
}
|
|
45
|
-
`];
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
constructor() {
|
|
49
|
-
super();
|
|
50
|
-
this.type = 'default';
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
render() {
|
|
54
|
-
return html`
|
|
55
|
-
<d2l-dl-wrapper
|
|
56
|
-
breakpoint="${ifDefined(this.breakpoint)}"
|
|
57
|
-
?force-stacked="${this.forceStacked}"
|
|
58
|
-
>
|
|
59
|
-
${this._renderExample()}
|
|
60
|
-
</d2l-dl-wrapper>
|
|
61
|
-
`;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
_renderExample() {
|
|
65
|
-
if (this.type === 'default') {
|
|
66
|
-
return html`
|
|
67
|
-
<dl>
|
|
68
|
-
<dt>Course Name</dt>
|
|
69
|
-
<dd>Brightspace 101B</dd>
|
|
70
|
-
|
|
71
|
-
<dt>Course Code</dt>
|
|
72
|
-
<dd>BSPC 101B</dd>
|
|
73
|
-
|
|
74
|
-
<dt>Start Date</dt>
|
|
75
|
-
<dd>June 14 2022</dd>
|
|
76
|
-
|
|
77
|
-
<dt>Semester</dt>
|
|
78
|
-
<dd>2022 Summer</dd>
|
|
79
|
-
</dl>
|
|
80
|
-
`;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
if (this.type === 'long') {
|
|
84
|
-
return html`
|
|
85
|
-
<dl>
|
|
86
|
-
<dt>Course Code That Represents The Course as a Short String</dt>
|
|
87
|
-
<dd>A short string that represents the course, often with important information such as section or room number.</dd>
|
|
88
|
-
|
|
89
|
-
<dt>Availability Dates</dt>
|
|
90
|
-
<dd>The start and end date for the course. Learners can't access courses outside these dates.</dd>
|
|
91
|
-
</dl>
|
|
92
|
-
`;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
if (this.type === 'activity-display') {
|
|
96
|
-
return html`
|
|
97
|
-
<dl>
|
|
98
|
-
<dt>Submission type</dt>
|
|
99
|
-
<dd>File submission</dd>
|
|
100
|
-
|
|
101
|
-
<dt>Files allowed per submission</dt>
|
|
102
|
-
<dd>Unlimited</dd>
|
|
103
|
-
|
|
104
|
-
<dt>File extension</dt>
|
|
105
|
-
<dd>PDF</dd>
|
|
106
|
-
|
|
107
|
-
<dt>Allowed Submissions</dt>
|
|
108
|
-
<dd>Only one submission allowed</dd>
|
|
109
|
-
</dl>
|
|
110
|
-
`;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
if (this.type === 'bulk-course-import') {
|
|
114
|
-
return html`
|
|
115
|
-
<dl>
|
|
116
|
-
<dt>Course code</dt>
|
|
117
|
-
<dd>fd6b9fd8-29bd-44ef-8322-d6b379b71411</dd>
|
|
118
|
-
|
|
119
|
-
<dt>Course name</dt>
|
|
120
|
-
<dd>Telkom MOMP Course 1</dd>
|
|
121
|
-
|
|
122
|
-
<dt>Course ID</dt>
|
|
123
|
-
<dd>250003</dd>
|
|
124
|
-
</dl>
|
|
125
|
-
`;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
if (this.type === 'slotted') {
|
|
129
|
-
return html`
|
|
130
|
-
<dl style="align-items: center">
|
|
131
|
-
<dt>User</dt>
|
|
132
|
-
<dd><div class="user"><div class="avatar">JS</div>John Smith</div></dd>
|
|
133
|
-
|
|
134
|
-
<dt>Submitted</dt>
|
|
135
|
-
<dd>Dec 30, 2021 5:34 PM</dd>
|
|
136
|
-
</dl>
|
|
137
|
-
`;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
customElements.define('d2l-test-dl', TestDescriptionList);
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
5
|
-
<meta charset="UTF-8">
|
|
6
|
-
<link rel="stylesheet" href="../../demo/styles.css" type="text/css">
|
|
7
|
-
<script type="module">
|
|
8
|
-
import '../../demo/demo-page.js';
|
|
9
|
-
|
|
10
|
-
import './description-list-test.js';
|
|
11
|
-
</script>
|
|
12
|
-
</head>
|
|
13
|
-
<body unresolved>
|
|
14
|
-
<d2l-demo-page page-title="d2l-description-list">
|
|
15
|
-
|
|
16
|
-
<h2>Short</h2>
|
|
17
|
-
<d2l-demo-snippet full-width>
|
|
18
|
-
<d2l-test-dl></d2l-test-dl>
|
|
19
|
-
</d2l-demo-snippet>
|
|
20
|
-
|
|
21
|
-
<h2>Long</h2>
|
|
22
|
-
<d2l-demo-snippet full-width>
|
|
23
|
-
<d2l-test-dl type="long" breakpoint="300"></d2l-test-dl>
|
|
24
|
-
</d2l-demo-snippet>
|
|
25
|
-
|
|
26
|
-
<h2>Stacked</h2>
|
|
27
|
-
<d2l-demo-snippet fullscreen>
|
|
28
|
-
<d2l-test-dl type="long" force-stacked></d2l-test-dl>
|
|
29
|
-
</d2l-demo-snippet>
|
|
30
|
-
|
|
31
|
-
<h2>Activity Display</h2>
|
|
32
|
-
<d2l-demo-snippet full-width>
|
|
33
|
-
<d2l-test-dl type="activity-display"></d2l-test-dl>
|
|
34
|
-
</d2l-demo-snippet>
|
|
35
|
-
|
|
36
|
-
<h2>Bulk Course Import</h2>
|
|
37
|
-
<d2l-demo-snippet full-width>
|
|
38
|
-
<d2l-test-dl type="bulk-course-import"></d2l-test-dl>
|
|
39
|
-
</d2l-demo-snippet>
|
|
40
|
-
|
|
41
|
-
<h2>Slotted content</h2>
|
|
42
|
-
<d2l-demo-snippet full-width>
|
|
43
|
-
<d2l-test-dl type="slotted"></d2l-test-dl>
|
|
44
|
-
</d2l-demo-snippet>
|
|
45
|
-
|
|
46
|
-
</d2l-demo-page>
|
|
47
|
-
</body>
|
|
48
|
-
</html>
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import '../../button/button.js';
|
|
2
|
-
import '../../list/list.js';
|
|
3
|
-
import '../../list/list-item.js';
|
|
4
|
-
import '../../list/list-item-content.js';
|
|
5
|
-
import '../../loading-spinner/loading-spinner.js';
|
|
6
|
-
import { css, html, LitElement, noChange } from 'lit';
|
|
7
|
-
import { guard } from 'lit/directives/guard.js';
|
|
8
|
-
import { LoadingCompleteMixin } from '../../../mixins/loading-complete/loading-complete-mixin.js';
|
|
9
|
-
import { until } from 'lit/directives/until.js';
|
|
10
|
-
|
|
11
|
-
class DialogAsyncContentUntil extends LoadingCompleteMixin(LitElement) {
|
|
12
|
-
|
|
13
|
-
static get properties() {
|
|
14
|
-
return {
|
|
15
|
-
href: { type: String }
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
static get styles() {
|
|
20
|
-
return css`
|
|
21
|
-
.content-button {
|
|
22
|
-
padding-block: 1rem;
|
|
23
|
-
}
|
|
24
|
-
.d2l-dialog-content-loading {
|
|
25
|
-
text-align: center;
|
|
26
|
-
}
|
|
27
|
-
`;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
constructor() {
|
|
31
|
-
super();
|
|
32
|
-
this.href = null;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
render() {
|
|
36
|
-
const loadingSpinner = html`
|
|
37
|
-
<div class="d2l-dialog-content-loading">
|
|
38
|
-
<d2l-loading-spinner size="100"></d2l-loading-spinner>
|
|
39
|
-
</div>
|
|
40
|
-
`;
|
|
41
|
-
return html`${guard([this.href], () => until(this._getContent(this.href), loadingSpinner, noChange))}`;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
_getContent(href) {
|
|
45
|
-
return new Promise((resolve) => {
|
|
46
|
-
if (!href) return;
|
|
47
|
-
setTimeout(() => {
|
|
48
|
-
resolve(html`
|
|
49
|
-
<d2l-button class="content-button">Focus on me!</d2l-button>
|
|
50
|
-
<d2l-list>
|
|
51
|
-
<d2l-list-item>
|
|
52
|
-
<img slot="illustration" src="https://s.brightspace.com/course-images/images/38e839b1-37fa-470c-8830-b189ce4ae134/tile-high-density-max-size.jpg" @load="${this.#handleImageLoad}">
|
|
53
|
-
<d2l-list-item-content>
|
|
54
|
-
<div>Introductory Earth Sciences</div>
|
|
55
|
-
<div slot="supporting-info">This course explores the geological process of the Earth's interior and surface. These include volcanism, earthquakes, mountains...</div>
|
|
56
|
-
</d2l-list-item-content>
|
|
57
|
-
</d2l-list-item>
|
|
58
|
-
<d2l-list-item>
|
|
59
|
-
<img slot="illustration" src="https://s.brightspace.com/course-images/images/e5fd575a-bc14-4a80-89e1-46f349a76178/tile-high-density-max-size.jpg" @load="${this.#handleImageLoad}">
|
|
60
|
-
<d2l-list-item-content>
|
|
61
|
-
<div>Engineering Materials for Energy Systems</div>
|
|
62
|
-
<div slot="supporting-info">This course explores the geological processes of the Earth's interior and surface. These include volcanism, earthquakes, mountain...</div>
|
|
63
|
-
</d2l-list-item-content>
|
|
64
|
-
</d2l-list-item>
|
|
65
|
-
<d2l-list-item>
|
|
66
|
-
<img slot="illustration" src="https://s.brightspace.com/course-images/images/63b162ab-b582-4bf9-8c1d-1dad04714121/tile-high-density-max-size.jpg" @load="${this.#handleImageLoad}">
|
|
67
|
-
<d2l-list-item-content>
|
|
68
|
-
<div>Geomorphology and GIS </div>
|
|
69
|
-
<div slot="supporting-info">This course explores the geological processes of the Earth's interior and surface. These include volcanism, earthquakes, mountain...</div>
|
|
70
|
-
</d2l-list-item-content>
|
|
71
|
-
</d2l-list-item>
|
|
72
|
-
</d2l-list>
|
|
73
|
-
`);
|
|
74
|
-
}, 1000);
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
#handleImageLoad() {
|
|
79
|
-
const images = this.shadowRoot.querySelectorAll('img');
|
|
80
|
-
for (const image of images) {
|
|
81
|
-
if (!image.complete) return;
|
|
82
|
-
}
|
|
83
|
-
this.shadowRoot.querySelector('.content-button').focus();
|
|
84
|
-
this.resolveLoadingComplete();
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
customElements.define('d2l-dialog-demo-async-content-until', DialogAsyncContentUntil);
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import '../../list/list.js';
|
|
2
|
-
import '../../list/list-item.js';
|
|
3
|
-
import '../../list/list-item-content.js';
|
|
4
|
-
import { html, LitElement } from 'lit';
|
|
5
|
-
import { InitialStateError, runAsync } from '../../../directives/run-async/run-async.js';
|
|
6
|
-
import { LoadingCompleteMixin } from '../../../mixins/loading-complete/loading-complete-mixin.js';
|
|
7
|
-
|
|
8
|
-
class DialogAsyncContent extends LoadingCompleteMixin(LitElement) {
|
|
9
|
-
|
|
10
|
-
static get properties() {
|
|
11
|
-
return {
|
|
12
|
-
href: { type: String }
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
constructor() {
|
|
17
|
-
super();
|
|
18
|
-
this.href = null;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
render() {
|
|
22
|
-
return html`${runAsync(this.href, (href) => this._getContent(href), {
|
|
23
|
-
success: (content) => content
|
|
24
|
-
})}`;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
_getContent(href) {
|
|
28
|
-
return new Promise((resolve) => {
|
|
29
|
-
if (!href) {
|
|
30
|
-
throw new InitialStateError();
|
|
31
|
-
}
|
|
32
|
-
setTimeout(() => {
|
|
33
|
-
resolve(html`
|
|
34
|
-
<d2l-list>
|
|
35
|
-
<d2l-list-item>
|
|
36
|
-
<img slot="illustration" src="https://s.brightspace.com/course-images/images/38e839b1-37fa-470c-8830-b189ce4ae134/tile-high-density-max-size.jpg" @load="${this.#handleImageLoad}">
|
|
37
|
-
<d2l-list-item-content>
|
|
38
|
-
<div>Introductory Earth Sciences</div>
|
|
39
|
-
<div slot="supporting-info">This course explores the geological process of the Earth's interior and surface. These include volcanism, earthquakes, mountains...</div>
|
|
40
|
-
</d2l-list-item-content>
|
|
41
|
-
</d2l-list-item>
|
|
42
|
-
<d2l-list-item>
|
|
43
|
-
<img slot="illustration" src="https://s.brightspace.com/course-images/images/e5fd575a-bc14-4a80-89e1-46f349a76178/tile-high-density-max-size.jpg" @load="${this.#handleImageLoad}">
|
|
44
|
-
<d2l-list-item-content>
|
|
45
|
-
<div>Engineering Materials for Energy Systems</div>
|
|
46
|
-
<div slot="supporting-info">This course explores the geological processes of the Earth's interior and surface. These include volcanism, earthquakes, mountain...</div>
|
|
47
|
-
</d2l-list-item-content>
|
|
48
|
-
</d2l-list-item>
|
|
49
|
-
<d2l-list-item>
|
|
50
|
-
<img slot="illustration" src="https://s.brightspace.com/course-images/images/63b162ab-b582-4bf9-8c1d-1dad04714121/tile-high-density-max-size.jpg" @load="${this.#handleImageLoad}">
|
|
51
|
-
<d2l-list-item-content>
|
|
52
|
-
<div>Geomorphology and GIS </div>
|
|
53
|
-
<div slot="supporting-info">This course explores the geological processes of the Earth's interior and surface. These include volcanism, earthquakes, mountain...</div>
|
|
54
|
-
</d2l-list-item-content>
|
|
55
|
-
</d2l-list-item>
|
|
56
|
-
</d2l-list>
|
|
57
|
-
`);
|
|
58
|
-
}, 5000);
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
#handleImageLoad() {
|
|
63
|
-
const images = this.shadowRoot.querySelectorAll('img');
|
|
64
|
-
for (const image of images) {
|
|
65
|
-
if (!image.complete) return;
|
|
66
|
-
}
|
|
67
|
-
this.resolveLoadingComplete();
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
customElements.define('d2l-dialog-demo-async-content', DialogAsyncContent);
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
5
|
-
<meta charset="UTF-8">
|
|
6
|
-
<link rel="stylesheet" href="../../demo/styles.css" type="text/css">
|
|
7
|
-
<script>
|
|
8
|
-
//window.D2L = { DialogMixin: { preferNative: false } };
|
|
9
|
-
</script>
|
|
10
|
-
<script type="module">
|
|
11
|
-
import '../../demo/demo-page.js';
|
|
12
|
-
import '../../button/button.js';
|
|
13
|
-
import '../dialog-confirm.js';
|
|
14
|
-
</script>
|
|
15
|
-
</head>
|
|
16
|
-
<body unresolved>
|
|
17
|
-
|
|
18
|
-
<d2l-demo-page page-title="d2l-dialog-confirm">
|
|
19
|
-
|
|
20
|
-
<h2>Confirm Dialog</h2>
|
|
21
|
-
|
|
22
|
-
<d2l-demo-snippet>
|
|
23
|
-
<template>
|
|
24
|
-
<d2l-button id="openConfirm">Show Confirm</d2l-button>
|
|
25
|
-
<d2l-dialog-confirm id="confirm" title-text="Confirm Title" text="Are you sure you want more cookies?">
|
|
26
|
-
<d2l-button slot="footer" primary data-dialog-action="ok">Yes</d2l-button>
|
|
27
|
-
<d2l-button slot="footer" data-dialog-action>No</d2l-button>
|
|
28
|
-
</d2l-dialog-confirm>
|
|
29
|
-
<script>
|
|
30
|
-
document.querySelector('#openConfirm').addEventListener('click', () => {
|
|
31
|
-
document.querySelector('#confirm').opened = true;
|
|
32
|
-
});
|
|
33
|
-
document.querySelector('#confirm').addEventListener('d2l-dialog-close', (e) => {
|
|
34
|
-
console.log('confirm action:', e.detail.action);
|
|
35
|
-
});
|
|
36
|
-
</script>
|
|
37
|
-
</template>
|
|
38
|
-
</d2l-demo-snippet>
|
|
39
|
-
|
|
40
|
-
<h2>Confirm Dialog (critical)</h2>
|
|
41
|
-
|
|
42
|
-
<d2l-demo-snippet>
|
|
43
|
-
<template>
|
|
44
|
-
<d2l-button id="openConfirmCritical">Show Confirm</d2l-button>
|
|
45
|
-
<d2l-dialog-confirm id="confirmCritical" title-text="Confirm Title" text="Are you sure you want more cookies?" critical>
|
|
46
|
-
<d2l-button slot="footer" primary data-dialog-action="ok">Yes</d2l-button>
|
|
47
|
-
<d2l-button slot="footer" data-dialog-action>No</d2l-button>
|
|
48
|
-
</d2l-dialog-confirm>
|
|
49
|
-
<script>
|
|
50
|
-
document.querySelector('#openConfirmCritical').addEventListener('click', () => {
|
|
51
|
-
document.querySelector('#confirmCritical').opened = true;
|
|
52
|
-
});
|
|
53
|
-
document.querySelector('#confirmCritical').addEventListener('d2l-dialog-close', (e) => {
|
|
54
|
-
console.log('confirm action:', e.detail.action);
|
|
55
|
-
});
|
|
56
|
-
</script>
|
|
57
|
-
</template>
|
|
58
|
-
</d2l-demo-snippet>
|
|
59
|
-
|
|
60
|
-
<h2>Confirm Dialog (Multi Paragraph)</h2>
|
|
61
|
-
|
|
62
|
-
<d2l-demo-snippet>
|
|
63
|
-
<template>
|
|
64
|
-
<d2l-button id="openConfirmMultiParagraph">Show Confirm</d2l-button>
|
|
65
|
-
<d2l-dialog-confirm id="confirmMultiParagraph" title-text="Confirm Title" text="Are you sure you want more cookies? Are you sure you want more donuts?">
|
|
66
|
-
<d2l-button slot="footer" primary data-dialog-action="ok">Yes</d2l-button>
|
|
67
|
-
<d2l-button slot="footer" data-dialog-action>No</d2l-button>
|
|
68
|
-
</d2l-dialog-confirm>
|
|
69
|
-
<script>
|
|
70
|
-
document.querySelector('#openConfirmMultiParagraph').addEventListener('click', () => {
|
|
71
|
-
document.querySelector('#confirmMultiParagraph').opened = true;
|
|
72
|
-
});
|
|
73
|
-
document.querySelector('#confirmMultiParagraph').addEventListener('d2l-dialog-close', (e) => {
|
|
74
|
-
console.log('confirm action:', e.detail.action);
|
|
75
|
-
});
|
|
76
|
-
</script>
|
|
77
|
-
</template>
|
|
78
|
-
</d2l-demo-snippet>
|
|
79
|
-
|
|
80
|
-
<h2>Confirm Dialog (No Title)</h2>
|
|
81
|
-
|
|
82
|
-
<d2l-demo-snippet>
|
|
83
|
-
<template>
|
|
84
|
-
<d2l-button id="openConfirmNoTitle">Show Confirm</d2l-button>
|
|
85
|
-
<d2l-dialog-confirm id="confirmNoTitle" text="Are you sure you want more cookies?">
|
|
86
|
-
<d2l-button slot="footer" primary data-dialog-action="ok">Yes</d2l-button>
|
|
87
|
-
<d2l-button slot="footer" data-dialog-action>No</d2l-button>
|
|
88
|
-
</d2l-dialog-confirm>
|
|
89
|
-
<script>
|
|
90
|
-
document.querySelector('#openConfirmNoTitle').addEventListener('click', () => {
|
|
91
|
-
document.querySelector('#confirmNoTitle').opened = true;
|
|
92
|
-
});
|
|
93
|
-
document.querySelector('#confirmNoTitle').addEventListener('d2l-dialog-close', (e) => {
|
|
94
|
-
console.log('confirm action:', e.detail.action);
|
|
95
|
-
});
|
|
96
|
-
</script>
|
|
97
|
-
</template>
|
|
98
|
-
</d2l-demo-snippet>
|
|
99
|
-
|
|
100
|
-
</d2l-demo-page>
|
|
101
|
-
</body>
|
|
102
|
-
</html>
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import '../../button/button.js';
|
|
2
|
-
import '../dialog.js';
|
|
3
|
-
import { html, LitElement } from 'lit';
|
|
4
|
-
|
|
5
|
-
class DialogContainer extends LitElement {
|
|
6
|
-
|
|
7
|
-
static get properties() {
|
|
8
|
-
return {
|
|
9
|
-
opened: { type: Boolean }
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
constructor() {
|
|
14
|
-
super();
|
|
15
|
-
this.opened = false;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
render() {
|
|
19
|
-
return html`
|
|
20
|
-
<d2l-button @click="${this._open}">Show Dialog</d2l-button>
|
|
21
|
-
<d2l-dialog title-text="Dialog Title" ?opened="${this.opened}" @d2l-dialog-close="${this._handleClose}">
|
|
22
|
-
<div>Deadlights jack lad schooner scallywag dance the hempen jig carouser broadside cable strike colors. Bring a spring upon her cable holystone blow the man down spanker.</div>
|
|
23
|
-
<d2l-button slot="footer" primary data-dialog-action="ok">Click Me!</d2l-button>
|
|
24
|
-
<d2l-button slot="footer" data-dialog-action>Cancel</d2l-button>
|
|
25
|
-
</d2l-dialog>
|
|
26
|
-
`;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
_handleClose() {
|
|
30
|
-
// dialog may have closed in several ways, so we need to make sure state is in sync
|
|
31
|
-
this.opened = false;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
_open() {
|
|
35
|
-
this.opened = true;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
customElements.define('d2l-dialog-demo-container', DialogContainer);
|