@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,98 +0,0 @@
|
|
|
1
|
-
import '../../../components/button/button.js';
|
|
2
|
-
import '../../../components/inputs/input-checkbox.js';
|
|
3
|
-
import '../../../components/list/list.js';
|
|
4
|
-
import '../../../components/list/list-item.js';
|
|
5
|
-
import { css, html, LitElement } from 'lit';
|
|
6
|
-
import { hide, show } from '../animate.js';
|
|
7
|
-
|
|
8
|
-
export class AnimateTest extends LitElement {
|
|
9
|
-
|
|
10
|
-
static get properties() {
|
|
11
|
-
return {
|
|
12
|
-
_listVisibility: { type: Boolean, reflect: false },
|
|
13
|
-
_renderCount: { type: Number, reflect: false }
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
static get styles() {
|
|
18
|
-
return css`
|
|
19
|
-
:host {
|
|
20
|
-
display: block;
|
|
21
|
-
}
|
|
22
|
-
d2l-list {
|
|
23
|
-
margin-bottom: 0.9rem;
|
|
24
|
-
max-width: 400px;
|
|
25
|
-
}
|
|
26
|
-
`;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
constructor() {
|
|
30
|
-
super();
|
|
31
|
-
this._counter = 3;
|
|
32
|
-
this._doAnimate = false;
|
|
33
|
-
this._items = [
|
|
34
|
-
{ number: 1, state: 'existing' },
|
|
35
|
-
{ number: 2, state: 'existing' },
|
|
36
|
-
{ number: 3, state: 'existing' }
|
|
37
|
-
];
|
|
38
|
-
this._listVisibility = true;
|
|
39
|
-
this._renderCount = 0;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
render() {
|
|
43
|
-
const animateAction = this._listVisibility ?
|
|
44
|
-
show({ skip: !this._doAnimate }) :
|
|
45
|
-
hide({ skip: !this._doAnimate });
|
|
46
|
-
const items = this._items.map((item) => {
|
|
47
|
-
let animateAction = undefined;
|
|
48
|
-
let showItem = false;
|
|
49
|
-
if (item.state === 'remove') {
|
|
50
|
-
item.state = 'removed';
|
|
51
|
-
animateAction = hide();
|
|
52
|
-
showItem = true;
|
|
53
|
-
} else if (item.state === 'new') {
|
|
54
|
-
item.state = 'existing';
|
|
55
|
-
animateAction = show();
|
|
56
|
-
showItem = true;
|
|
57
|
-
} else if (item.state === 'existing') {
|
|
58
|
-
showItem = true;
|
|
59
|
-
}
|
|
60
|
-
return showItem ? html`<d2l-list-item .animate="${animateAction}">
|
|
61
|
-
Item ${item.number}
|
|
62
|
-
<d2l-button-icon slot="actions" icon="tier1:delete" text="Remove" @click="${this._handleRemove}" data-number="${item.number}"></d2l-button-icon>
|
|
63
|
-
</d2l-list-item>` : null;
|
|
64
|
-
});
|
|
65
|
-
return html`
|
|
66
|
-
<d2l-input-checkbox .checked="${this._listVisibility}" @change="${this._handleToggleList}" label="Show items"></d2l-input-checkbox>
|
|
67
|
-
<d2l-list .animate="${animateAction}">${items}</d2l-list>
|
|
68
|
-
<d2l-button @click="${this._handleAddItem}" ?disabled="${!this._listVisibility}">Add Item</d2l-button>
|
|
69
|
-
<d2l-button @click="${this._handleReRender}">Re-render (${this._renderCount})</d2l-button>
|
|
70
|
-
`;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
_handleAddItem() {
|
|
74
|
-
this._counter++;
|
|
75
|
-
this._items.push({ number: this._counter, state: 'new' });
|
|
76
|
-
this.requestUpdate();
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
_handleRemove(e) {
|
|
80
|
-
const removeItem = this._items.find(item => item.number === parseInt(e.target.getAttribute('data-number')));
|
|
81
|
-
if (removeItem) {
|
|
82
|
-
removeItem.state = 'remove';
|
|
83
|
-
this.requestUpdate();
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
_handleReRender() {
|
|
88
|
-
this._renderCount++;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
_handleToggleList(e) {
|
|
92
|
-
this._listVisibility = e.target.checked;
|
|
93
|
-
this._doAnimate = true;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
customElements.define('d2l-animate-test', AnimateTest);
|
|
@@ -1,23 +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="../../../components/demo/styles.css" type="text/css">
|
|
7
|
-
<script type="module">
|
|
8
|
-
import '../../../components/demo/demo-page.js';
|
|
9
|
-
import './animate-test.js';
|
|
10
|
-
</script>
|
|
11
|
-
</head>
|
|
12
|
-
<body unresolved>
|
|
13
|
-
<d2l-demo-page page-title="animate-directive">
|
|
14
|
-
|
|
15
|
-
<d2l-demo-snippet>
|
|
16
|
-
<template>
|
|
17
|
-
<d2l-animate-test></d2l-animate-test>
|
|
18
|
-
</template>
|
|
19
|
-
</d2l-demo-snippet>
|
|
20
|
-
|
|
21
|
-
</d2l-demo-page>
|
|
22
|
-
</body>
|
|
23
|
-
</html>
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import '../../components/inputs/input-text.js';
|
|
2
|
-
import '../../components/button/button.js';
|
|
3
|
-
import { css, html, LitElement } from 'lit';
|
|
4
|
-
import { announce } from '../announce.js';
|
|
5
|
-
|
|
6
|
-
class AnnounceTest extends LitElement {
|
|
7
|
-
|
|
8
|
-
static get styles() {
|
|
9
|
-
return css`
|
|
10
|
-
:host {
|
|
11
|
-
display: block;
|
|
12
|
-
width: 400px;
|
|
13
|
-
}
|
|
14
|
-
d2l-input-text {
|
|
15
|
-
margin-bottom: 10px;
|
|
16
|
-
}
|
|
17
|
-
`;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
render() {
|
|
21
|
-
return html`
|
|
22
|
-
<d2l-input-text id="msg1" type="text" value="I like cookies but I also like donuts and many other really yummy things." aria-label="first message to announce"></d2l-input-text>
|
|
23
|
-
<d2l-input-text id="msg2" type="text" value="I also like cake." aria-label="second message to announce"></d2l-input-text>
|
|
24
|
-
<d2l-button @click=${this._handleAnnounce}>Announce</d2l-button>`;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
_handleAnnounce() {
|
|
28
|
-
if (!this.shadowRoot) return;
|
|
29
|
-
const value1 = this.shadowRoot.querySelector('#msg1').value;
|
|
30
|
-
if (value1.length > 0) announce(value1);
|
|
31
|
-
const value2 = this.shadowRoot.querySelector('#msg2').value;
|
|
32
|
-
if (value2.length > 0) announce(value2);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
customElements.define('d2l-test-announce', AnnounceTest);
|
|
@@ -1,19 +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="../../components/demo/styles.css" type="text/css">
|
|
7
|
-
<script type="module">
|
|
8
|
-
import '../../components/demo/demo-page.js';
|
|
9
|
-
import './announce-test.js';
|
|
10
|
-
</script>
|
|
11
|
-
</head>
|
|
12
|
-
<body unresolved>
|
|
13
|
-
<d2l-demo-page page-title="announce">
|
|
14
|
-
|
|
15
|
-
<d2l-test-announce></d2l-test-announce>
|
|
16
|
-
|
|
17
|
-
</d2l-demo-page>
|
|
18
|
-
</body>
|
|
19
|
-
</html>
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import '../../components/colors/colors.js';
|
|
2
|
-
import { clearDismissible, setDismissible } from '../../helpers/dismissible.js';
|
|
3
|
-
import { css, html, LitElement } from 'lit';
|
|
4
|
-
|
|
5
|
-
class DismissibleTest extends LitElement {
|
|
6
|
-
|
|
7
|
-
static get properties() {
|
|
8
|
-
return {
|
|
9
|
-
opened: { type: Boolean, reflect: true }
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
static get styles() {
|
|
14
|
-
return css`
|
|
15
|
-
:host {
|
|
16
|
-
background-color: #ffffff;
|
|
17
|
-
border: 1px solid var(--d2l-color-chromite);
|
|
18
|
-
display: none;
|
|
19
|
-
padding: 1rem;
|
|
20
|
-
position: absolute;
|
|
21
|
-
}
|
|
22
|
-
:host([opened]) {
|
|
23
|
-
display: block;
|
|
24
|
-
}
|
|
25
|
-
`;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
constructor() {
|
|
29
|
-
super();
|
|
30
|
-
this.opened = false;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
disconnectedCallback() {
|
|
34
|
-
clearDismissible(this.__dismissibleId);
|
|
35
|
-
super.disconnectedCallback();
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
render() {
|
|
39
|
-
return html`<slot></slot>
|
|
40
|
-
<button @click=${this.__handleClose} type="button">Close</button>
|
|
41
|
-
<button @click=${this.__handleRemove} type="button">Remove</button>`;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
updated(changedProperties) {
|
|
45
|
-
changedProperties.forEach((oldValue, propName) => {
|
|
46
|
-
if (propName === 'opened') {
|
|
47
|
-
if (this.opened) {
|
|
48
|
-
this.__dismissibleId = setDismissible(() => this.opened = false);
|
|
49
|
-
} else {
|
|
50
|
-
clearDismissible(this.__dismissibleId);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
__handleClose() {
|
|
57
|
-
this.opened = false;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
__handleRemove() {
|
|
61
|
-
this.parentNode.removeChild(this);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
customElements.define('d2l-test-dismissible', DismissibleTest);
|
|
@@ -1,38 +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="../../components/demo/styles.css" type="text/css">
|
|
7
|
-
<script type="module">
|
|
8
|
-
import '../../components/demo/demo-page.js';
|
|
9
|
-
import './dismissible-test.js';
|
|
10
|
-
</script>
|
|
11
|
-
</head>
|
|
12
|
-
<body unresolved>
|
|
13
|
-
<d2l-demo-page page-title="dismissible">
|
|
14
|
-
|
|
15
|
-
<p>
|
|
16
|
-
This helper is for components which should be "dismissable"
|
|
17
|
-
when the user presses the ESC key. It will keep track of the order
|
|
18
|
-
these components are displayed, and notifies them when they
|
|
19
|
-
should be dismissed.
|
|
20
|
-
</p>
|
|
21
|
-
|
|
22
|
-
<button id="create" type="button">Create</button>
|
|
23
|
-
|
|
24
|
-
</d2l-demo-page>
|
|
25
|
-
<script>
|
|
26
|
-
let count = 0;
|
|
27
|
-
document.getElementById('create').addEventListener('click', () => {
|
|
28
|
-
count++;
|
|
29
|
-
const elem = document.createElement('d2l-test-dismissible');
|
|
30
|
-
elem.appendChild(document.createTextNode(`Box ${count}`));
|
|
31
|
-
elem.setAttribute('opened', 'opened');
|
|
32
|
-
elem.style.top = `${175 + count * 50}px`;
|
|
33
|
-
elem.style.left = `${count * 50}px`;
|
|
34
|
-
document.body.appendChild(elem);
|
|
35
|
-
});
|
|
36
|
-
</script>
|
|
37
|
-
</body>
|
|
38
|
-
</html>
|
|
@@ -1,58 +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="../../components/demo/styles.css" type="text/css">
|
|
7
|
-
<script type="module">
|
|
8
|
-
import '../../components/demo/demo-page.js';
|
|
9
|
-
</script>
|
|
10
|
-
<style>
|
|
11
|
-
#container {
|
|
12
|
-
height: 300px;
|
|
13
|
-
padding: 100px 1rem 1rem 1rem;
|
|
14
|
-
padding-top: 100px;
|
|
15
|
-
text-align: center;
|
|
16
|
-
}
|
|
17
|
-
#container > :first-child {
|
|
18
|
-
color: var(--d2l-color-galena);
|
|
19
|
-
margin-bottom: 1rem;
|
|
20
|
-
}
|
|
21
|
-
</style>
|
|
22
|
-
</head>
|
|
23
|
-
<body unresolved>
|
|
24
|
-
<d2l-demo-page page-title="gestures">
|
|
25
|
-
|
|
26
|
-
<h2>Swipe</h2>
|
|
27
|
-
|
|
28
|
-
<d2l-demo-snippet>
|
|
29
|
-
<template>
|
|
30
|
-
<div id="container">
|
|
31
|
-
<div>swipe while using emulator or touch enabled device</div>
|
|
32
|
-
<div id="distance"></div>
|
|
33
|
-
<div id="direction"></div>
|
|
34
|
-
<div id="duration"></div>
|
|
35
|
-
</div>
|
|
36
|
-
<script type="module">
|
|
37
|
-
import { registerGestureSwipe } from '../gestures.js';
|
|
38
|
-
|
|
39
|
-
const container = document.querySelector('#container');
|
|
40
|
-
registerGestureSwipe(container);
|
|
41
|
-
|
|
42
|
-
container.addEventListener('d2l-gesture-swipe', (e) => {
|
|
43
|
-
document.querySelector('#distance').textContent =
|
|
44
|
-
JSON.stringify(e.detail.distance);
|
|
45
|
-
document.querySelector('#direction').textContent =
|
|
46
|
-
JSON.stringify(e.detail.direction);
|
|
47
|
-
document.querySelector('#duration').textContent =
|
|
48
|
-
JSON.stringify(e.detail.duration);
|
|
49
|
-
console.log('d2l-gesture-swipe', e.detail);
|
|
50
|
-
});
|
|
51
|
-
</script>
|
|
52
|
-
</template>
|
|
53
|
-
</d2l-demo-snippet>
|
|
54
|
-
|
|
55
|
-
</d2l-demo-page>
|
|
56
|
-
|
|
57
|
-
</body>
|
|
58
|
-
</html>
|