@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,89 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import '../../button/button-icon.js';
|
|
3
|
-
import '../../colors/colors.js';
|
|
4
|
-
import '../../expand-collapse/expand-collapse-content.js';
|
|
5
|
-
import '../../inputs/input-number.js';
|
|
6
|
-
import '../../inputs/input-text.js';
|
|
7
|
-
import '../form.js';
|
|
8
|
-
import '../../collapsible-panel/collapsible-panel.js';
|
|
9
|
-
import { css, html, LitElement } from 'lit';
|
|
10
|
-
import { heading3Styles } from '../../typography/styles.js';
|
|
11
|
-
import { inputStyles } from '../../inputs/input-styles.js';
|
|
12
|
-
|
|
13
|
-
class FormPanelDemo extends LitElement {
|
|
14
|
-
|
|
15
|
-
static get properties() {
|
|
16
|
-
return {
|
|
17
|
-
_expanded: { type: Boolean, attribute: false }
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
static get styles() {
|
|
22
|
-
return [heading3Styles, inputStyles, css`
|
|
23
|
-
:host {
|
|
24
|
-
background-color: var(--d2l-color-gypsum);
|
|
25
|
-
display: block;
|
|
26
|
-
flex-basis: 35%;
|
|
27
|
-
padding: 10px;
|
|
28
|
-
width: 100%;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
:host([hidden]) {
|
|
32
|
-
display: none;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.d2l-form-panel-demo-container {
|
|
36
|
-
margin-bottom: 10px;
|
|
37
|
-
}
|
|
38
|
-
`];
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
constructor() {
|
|
42
|
-
super();
|
|
43
|
-
this._expanded = false;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
render() {
|
|
47
|
-
return html`
|
|
48
|
-
<d2l-collapsible-panel
|
|
49
|
-
panel-title="Personal Information"
|
|
50
|
-
type="subtle"
|
|
51
|
-
?expanded=${this._expanded}
|
|
52
|
-
@d2l-collapsible-panel-expand=${this._onExpand}
|
|
53
|
-
@d2l-collapsible-panel-collapse=${this._onCollapse}>
|
|
54
|
-
<d2l-form @d2l-form-invalid=${this._onInvalid} @d2l-form-submit=${this._onSubmit}>
|
|
55
|
-
<div class="d2l-form-panel-demo-container">
|
|
56
|
-
<d2l-input-text label="First Name" name="first-name" required minlength="4" maxlength="15"></d2l-input-text>
|
|
57
|
-
</div>
|
|
58
|
-
<div class="d2l-form-panel-demo-container">
|
|
59
|
-
<d2l-input-text label="Middle Name" name="middle-name" minlength="4" maxlength="8"></d2l-input-text>
|
|
60
|
-
</div>
|
|
61
|
-
<div class="d2l-form-panel-demo-container">
|
|
62
|
-
<d2l-input-text label="Last Name" name="last-name" required minlength="4" maxlength="15"></d2l-input-text>
|
|
63
|
-
</div>
|
|
64
|
-
<div class="d2l-form-panel-demo-container">
|
|
65
|
-
<d2l-input-number label="Age" name="age" required min="18" max="23"></d2l-input-number>
|
|
66
|
-
</div>
|
|
67
|
-
</d2l-form>
|
|
68
|
-
</d2l-collapsible-panel>
|
|
69
|
-
`;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
_onCollapse() {
|
|
73
|
-
this._expanded = false;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
_onExpand() {
|
|
77
|
-
this._expanded = true;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
_onInvalid() {
|
|
81
|
-
this._expanded = true;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
_onSubmit(e) {
|
|
85
|
-
// eslint-disable-next-line no-console
|
|
86
|
-
console.log(e.detail.formData);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
customElements.define('d2l-form-panel-demo', FormPanelDemo);
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
-
<meta charset="UTF-8">
|
|
7
|
-
<link rel="stylesheet" href="../../demo/styles.css" type="text/css">
|
|
8
|
-
<script type="module">
|
|
9
|
-
import '../../demo/demo-page.js';
|
|
10
|
-
import './form-demo.js';
|
|
11
|
-
import './form-dialog-demo.js';
|
|
12
|
-
</script>
|
|
13
|
-
</head>
|
|
14
|
-
|
|
15
|
-
<body unresolved>
|
|
16
|
-
|
|
17
|
-
<d2l-demo-page page-title="d2l-form">
|
|
18
|
-
|
|
19
|
-
<h2>Nested</h2>
|
|
20
|
-
<d2l-demo-snippet>
|
|
21
|
-
<template>
|
|
22
|
-
<d2l-form-demo></d2l-form-demo>
|
|
23
|
-
</template>
|
|
24
|
-
</d2l-demo-snippet>
|
|
25
|
-
|
|
26
|
-
<h2>Dialog</h2>
|
|
27
|
-
<d2l-demo-snippet>
|
|
28
|
-
<template>
|
|
29
|
-
<d2l-form-dialog-demo></d2l-form-dialog-demo>
|
|
30
|
-
</template>
|
|
31
|
-
</d2l-demo-snippet>
|
|
32
|
-
|
|
33
|
-
</d2l-demo-page>
|
|
34
|
-
|
|
35
|
-
</body>
|
|
36
|
-
|
|
37
|
-
</html>
|
|
@@ -1,221 +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
|
-
import '../hierarchical-view.js';
|
|
10
|
-
import '../../dropdown/dropdown-menu.js';
|
|
11
|
-
import '../../dropdown/dropdown-button.js';
|
|
12
|
-
import '../../menu/menu.js';
|
|
13
|
-
import '../../menu/menu-item.js';
|
|
14
|
-
|
|
15
|
-
</script>
|
|
16
|
-
<style>
|
|
17
|
-
#view1, #view2a, #view2b, #view3, #view4 {
|
|
18
|
-
border-radius: 0.3rem;
|
|
19
|
-
box-sizing: border-box;
|
|
20
|
-
font-size: 1rem;
|
|
21
|
-
}
|
|
22
|
-
#view1 > div, #view2a > div, #view2b > div, #view3 > div, #view4 > div {
|
|
23
|
-
box-sizing: border-box;
|
|
24
|
-
padding: 1rem;
|
|
25
|
-
}
|
|
26
|
-
#view1 {
|
|
27
|
-
background-color: #c0dfd9;
|
|
28
|
-
border: 1px solid black;
|
|
29
|
-
border-radius: 0.3rem;
|
|
30
|
-
}
|
|
31
|
-
#view2a {
|
|
32
|
-
background-color: #e9ece5;
|
|
33
|
-
}
|
|
34
|
-
#view2b {
|
|
35
|
-
background-color: #b3c2bf;
|
|
36
|
-
}
|
|
37
|
-
#view3 {
|
|
38
|
-
background-color: #3b3a36;
|
|
39
|
-
color: white;
|
|
40
|
-
}
|
|
41
|
-
#view4 {
|
|
42
|
-
background-color: orange;
|
|
43
|
-
color: white;
|
|
44
|
-
}
|
|
45
|
-
#config_buttons > button {
|
|
46
|
-
margin-right: 0.5rem;
|
|
47
|
-
}
|
|
48
|
-
.content {
|
|
49
|
-
border: 1px dotted black;
|
|
50
|
-
font-size: 0.8rem;
|
|
51
|
-
}
|
|
52
|
-
.buttons {
|
|
53
|
-
float: right;
|
|
54
|
-
}
|
|
55
|
-
.info {
|
|
56
|
-
font-size: 0.7rem;
|
|
57
|
-
}
|
|
58
|
-
</style>
|
|
59
|
-
</head>
|
|
60
|
-
<body unresolved>
|
|
61
|
-
|
|
62
|
-
<d2l-demo-page page-title="d2l-hierarchical-view">
|
|
63
|
-
|
|
64
|
-
<h2>Hierarchical View</h2>
|
|
65
|
-
|
|
66
|
-
<div id="config_buttons">
|
|
67
|
-
<button id="btn-append-content">Append Content</button>
|
|
68
|
-
</div>
|
|
69
|
-
|
|
70
|
-
<d2l-demo-snippet>
|
|
71
|
-
<d2l-hierarchical-view id="view1">
|
|
72
|
-
<div style="min-height: 200px;">
|
|
73
|
-
<div class="buttons">
|
|
74
|
-
<button id="btn-view-2a">view 2a</button>
|
|
75
|
-
<button id="btn-view-2b">view 2b</button>
|
|
76
|
-
</div>
|
|
77
|
-
view 1
|
|
78
|
-
<div class="info">min-height: 200</div>
|
|
79
|
-
<div>
|
|
80
|
-
<d2l-hierarchical-view id="view2a">
|
|
81
|
-
<div style="min-height: 400px;">
|
|
82
|
-
<div class="buttons">
|
|
83
|
-
<button id="btn-parent-view-2a">view 1 (parent)</button>
|
|
84
|
-
<button id="btn-view-3">view 3</button>
|
|
85
|
-
<d2l-dropdown-button text="Open!" primary>
|
|
86
|
-
<d2l-dropdown-menu >
|
|
87
|
-
<d2l-menu label="Astronomy" root-view >
|
|
88
|
-
<d2l-menu-item text="Introduction"></d2l-menu-item>
|
|
89
|
-
<d2l-menu-item text="Searching for the Heavens "></d2l-menu-item>
|
|
90
|
-
<d2l-menu-item text="The Solar System">
|
|
91
|
-
<d2l-menu>
|
|
92
|
-
<d2l-menu-item text="Formation"></d2l-menu-item>
|
|
93
|
-
<d2l-menu-item text="Modern Solar System"></d2l-menu-item>
|
|
94
|
-
<d2l-menu-item text="Future Solar System"></d2l-menu-item>
|
|
95
|
-
<d2l-menu-item text="The Planets"></d2l-menu-item>
|
|
96
|
-
<d2l-menu-item text="The Sun"></d2l-menu-item>
|
|
97
|
-
<d2l-menu-item text="Solar & Lunar Eclipses"></d2l-menu-item>
|
|
98
|
-
<d2l-menu-item text="Meteors & Meteorites"></d2l-menu-item>
|
|
99
|
-
<d2l-menu-item text="Asteroids"></d2l-menu-item>
|
|
100
|
-
<d2l-menu-item text="Comets"></d2l-menu-item>
|
|
101
|
-
</d2l-menu>
|
|
102
|
-
</d2l-menu-item>
|
|
103
|
-
<d2l-menu-item text="Stars & Galaxies"></d2l-menu-item>
|
|
104
|
-
<d2l-menu-item text="The Night Sky"></d2l-menu-item>
|
|
105
|
-
<d2l-menu-item text="The Universe"></d2l-menu-item>
|
|
106
|
-
</d2l-menu>
|
|
107
|
-
</d2l-dropdown-menu>
|
|
108
|
-
</d2l-dropdown-button>
|
|
109
|
-
</div>
|
|
110
|
-
view 2a
|
|
111
|
-
<div class="info">min-height: 400</div>
|
|
112
|
-
<d2l-hierarchical-view id="view3">
|
|
113
|
-
<div style="min-height: 300px;">
|
|
114
|
-
<div class="buttons">
|
|
115
|
-
<button id="btn-parent-view-3">view 2a (parent)</button>
|
|
116
|
-
<button id="btn-view-4">view 4</button>
|
|
117
|
-
</div>
|
|
118
|
-
view 3
|
|
119
|
-
<div class="info">min-height: 300</div>
|
|
120
|
-
<d2l-hierarchical-view id="view4">
|
|
121
|
-
<div style="min-height: 300px;">
|
|
122
|
-
<div class="buttons">
|
|
123
|
-
<button id="btn-parent-view-4">view 3 (parent)</button>
|
|
124
|
-
</div>
|
|
125
|
-
view 4
|
|
126
|
-
<div class="info">min-height: 300</div>
|
|
127
|
-
</div>
|
|
128
|
-
</d2l-hierarchical-view>
|
|
129
|
-
</div>
|
|
130
|
-
</d2l-hierarchical-view>
|
|
131
|
-
</div>
|
|
132
|
-
</d2l-hierarchical-view>
|
|
133
|
-
<d2l-hierarchical-view id="view2b">
|
|
134
|
-
<div style="min-height: 200px;">
|
|
135
|
-
<div class="buttons">
|
|
136
|
-
<button id="btn-parent-view-2b">view 1 (parent)</button>
|
|
137
|
-
</div>
|
|
138
|
-
view 2b
|
|
139
|
-
<div class="info">min-height: 200</div>
|
|
140
|
-
</div>
|
|
141
|
-
</d2l-hierarchical-view>
|
|
142
|
-
</div>
|
|
143
|
-
</div>
|
|
144
|
-
</d2l-hierarchical-view>
|
|
145
|
-
</d2l-demo-snippet>
|
|
146
|
-
</d2l-demo-page>
|
|
147
|
-
|
|
148
|
-
<script>
|
|
149
|
-
window.requestAnimationFrame(() => {
|
|
150
|
-
const focusFirstButton = function(e) {
|
|
151
|
-
const button = e.detail.activeView.querySelector('button');
|
|
152
|
-
if (button) {
|
|
153
|
-
button.focus();
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
const rootView = document.getElementById('view1');
|
|
157
|
-
rootView.addEventListener('d2l-hierarchical-view-show-complete', (e) => {
|
|
158
|
-
focusFirstButton(e);
|
|
159
|
-
});
|
|
160
|
-
rootView.addEventListener('d2l-hierarchical-view-hide-complete', (e) => {
|
|
161
|
-
focusFirstButton(e);
|
|
162
|
-
});
|
|
163
|
-
const config_buttons = document.getElementById('config_buttons');
|
|
164
|
-
const views = document.querySelectorAll('d2l-hierarchical-view');
|
|
165
|
-
for (let i = 0; i < views.length; i++) {
|
|
166
|
-
const button = document.createElement('button');
|
|
167
|
-
button.appendChild(document.createTextNode(`show ${views[i].id}`));
|
|
168
|
-
button.setAttribute('data-view-id', views[i].id);
|
|
169
|
-
button.addEventListener('click', (e) => {
|
|
170
|
-
document.getElementById(e.target.getAttribute('data-view-id')).show();
|
|
171
|
-
});
|
|
172
|
-
config_buttons.appendChild(button);
|
|
173
|
-
}
|
|
174
|
-
document.getElementById('btn-view-2a').addEventListener('click', () => {
|
|
175
|
-
showSubView('view2a');
|
|
176
|
-
});
|
|
177
|
-
document.getElementById('btn-view-2b').addEventListener('click', () => {
|
|
178
|
-
showSubView('view2b');
|
|
179
|
-
});
|
|
180
|
-
document.getElementById('btn-view-3').addEventListener('click', () => {
|
|
181
|
-
showSubView('view3');
|
|
182
|
-
});
|
|
183
|
-
document.getElementById('btn-view-4').addEventListener('click', () => {
|
|
184
|
-
showSubView('view4');
|
|
185
|
-
});
|
|
186
|
-
document.getElementById('btn-parent-view-2a').addEventListener('click', () => {
|
|
187
|
-
showParentView('view2a');
|
|
188
|
-
});
|
|
189
|
-
document.getElementById('btn-parent-view-3').addEventListener('click', () => {
|
|
190
|
-
showParentView('view3');
|
|
191
|
-
});
|
|
192
|
-
document.getElementById('btn-parent-view-4').addEventListener('click', () => {
|
|
193
|
-
showParentView('view4');
|
|
194
|
-
});
|
|
195
|
-
document.getElementById('btn-parent-view-2b').addEventListener('click', () => {
|
|
196
|
-
showParentView('view2b');
|
|
197
|
-
});
|
|
198
|
-
document.getElementById('btn-append-content').addEventListener('click', () => {
|
|
199
|
-
appendContent('view1');
|
|
200
|
-
});
|
|
201
|
-
});
|
|
202
|
-
|
|
203
|
-
function showSubView(id) {
|
|
204
|
-
const view = document.getElementById(id);
|
|
205
|
-
view.show();
|
|
206
|
-
}
|
|
207
|
-
function showParentView(id) {
|
|
208
|
-
const view = document.getElementById(id);
|
|
209
|
-
view.hide();
|
|
210
|
-
}
|
|
211
|
-
function appendContent(id) {
|
|
212
|
-
const content = document.createElement('div');
|
|
213
|
-
content.className = 'content';
|
|
214
|
-
content.appendChild(document.createTextNode('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'));
|
|
215
|
-
const view = document.getElementById(id);
|
|
216
|
-
const activeView = view.getActiveView();
|
|
217
|
-
activeView.appendChild(content);
|
|
218
|
-
}
|
|
219
|
-
</script>
|
|
220
|
-
</body>
|
|
221
|
-
</html>
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<title>d2l-html-block (code samples)</title>
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
-
<meta charset="UTF-8">
|
|
7
|
-
<link rel="stylesheet" href="../../demo/styles.css" type="text/css">
|
|
8
|
-
<script type="module">
|
|
9
|
-
import '../../demo/demo-page.js';
|
|
10
|
-
import '../../colors/colors.js';
|
|
11
|
-
import '../../typography/typography.js';
|
|
12
|
-
import '../html-block.js';
|
|
13
|
-
</script>
|
|
14
|
-
<style>
|
|
15
|
-
html {
|
|
16
|
-
font-size: 20px;
|
|
17
|
-
}
|
|
18
|
-
body {
|
|
19
|
-
padding: 1rem;
|
|
20
|
-
}
|
|
21
|
-
</style>
|
|
22
|
-
</head>
|
|
23
|
-
<body>
|
|
24
|
-
<d2l-demo-page page-title="d2l-html-block (code)">
|
|
25
|
-
|
|
26
|
-
<h2 class="d2l-heading-3">Block Samples</h2>
|
|
27
|
-
|
|
28
|
-
<d2l-demo-snippet>
|
|
29
|
-
<template>
|
|
30
|
-
<d2l-html-block html="
|
|
31
|
-
<pre class="d2l-code d2l-code-dark"><code class="language-javascript">function helloGrumpy(name) {
|
|
32
|
-
console.log(`Hi there ${name}.`);
|
|
33
|
-
}
|
|
34
|
-
helloGrumpy('Wizard');</code></pre>
|
|
35
|
-
<br>
|
|
36
|
-
<pre class="d2l-code d2l-code-dark"><code class="language-javascript line-numbers">function helloGrumpy(name) {
|
|
37
|
-
console.log(`Hi there ${name}. Here's some really long text to test overflowing the bounding container.`);
|
|
38
|
-
}
|
|
39
|
-
helloGrumpy('Wizard');</code></pre>">
|
|
40
|
-
</d2l-html-block>
|
|
41
|
-
</template>
|
|
42
|
-
</d2l-demo-snippet>
|
|
43
|
-
|
|
44
|
-
<h2 class="d2l-heading-3">Inline Samples</h2>
|
|
45
|
-
|
|
46
|
-
<d2l-demo-snippet>
|
|
47
|
-
<template>
|
|
48
|
-
<d2l-html-block html="The best type of donuts are he kind you assign in code, for example: <code class="d2l-code d2l-code-dark language-javascript">const jelly = 'donuts';</code>. The next best type of thing you can assign in code is stuff you can ferment. <code class="d2l-code d2l-code-dark language-javascript">let beer = hopsAndWater.map(ingredients => ferment(ingredients));</code>"></d2l-html-block>
|
|
49
|
-
</template>
|
|
50
|
-
</d2l-demo-snippet>
|
|
51
|
-
|
|
52
|
-
</d2l-demo-page>
|
|
53
|
-
|
|
54
|
-
</body>
|
|
55
|
-
</html>
|