@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,133 +0,0 @@
|
|
|
1
|
-
import '../list-item-content.js';
|
|
2
|
-
import '../list-item.js';
|
|
3
|
-
import '../list.js';
|
|
4
|
-
import '../list-controls.js';
|
|
5
|
-
import '../../selection/selection-action.js';
|
|
6
|
-
import { html, LitElement, nothing } from 'lit';
|
|
7
|
-
import { getUniqueId } from '../../../helpers/uniqueId.js';
|
|
8
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
9
|
-
import { repeat } from 'lit/directives/repeat.js';
|
|
10
|
-
|
|
11
|
-
class ListDemoNestedLazyLoad extends LitElement {
|
|
12
|
-
|
|
13
|
-
static get properties() {
|
|
14
|
-
return {
|
|
15
|
-
_items: { state: true },
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
constructor() {
|
|
20
|
-
super();
|
|
21
|
-
this._items = new Map();
|
|
22
|
-
this._items.set('a', {
|
|
23
|
-
key: 'a',
|
|
24
|
-
primaryText: 'Item 1: Click Expand To Lazy Load Item',
|
|
25
|
-
items: [],
|
|
26
|
-
expandable: true,
|
|
27
|
-
selected: false
|
|
28
|
-
});
|
|
29
|
-
this._items.set('b', {
|
|
30
|
-
key: 'b',
|
|
31
|
-
primaryText: 'Item 2: Click Expand To Lazy Load Item',
|
|
32
|
-
items: [],
|
|
33
|
-
expandable: true,
|
|
34
|
-
selected: false
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
render() {
|
|
39
|
-
return html`
|
|
40
|
-
<div>
|
|
41
|
-
${this._renderList(this._items.values(), false, true)}
|
|
42
|
-
</div>
|
|
43
|
-
`;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
_handleListItemToggle(e) {
|
|
47
|
-
const listItem = e.target;
|
|
48
|
-
const itemKey = e.target.key;
|
|
49
|
-
const previouslyCollapsed = !e.target.expanded;
|
|
50
|
-
const itemToAddChildren = this._items.get(itemKey);
|
|
51
|
-
if (!previouslyCollapsed && itemToAddChildren.items.length === 0) {
|
|
52
|
-
if (listItem.selected) {
|
|
53
|
-
itemToAddChildren.selected = true;
|
|
54
|
-
}
|
|
55
|
-
const uniqueId = getUniqueId();
|
|
56
|
-
itemToAddChildren.items = [{
|
|
57
|
-
key: uniqueId,
|
|
58
|
-
primaryText: `Lazy Loaded Item ${uniqueId}`,
|
|
59
|
-
items: [],
|
|
60
|
-
expandable: false,
|
|
61
|
-
selected: listItem.selected
|
|
62
|
-
}];
|
|
63
|
-
|
|
64
|
-
setTimeout(() => {
|
|
65
|
-
// fake lazy loading items
|
|
66
|
-
this._items.set(itemKey, itemToAddChildren);
|
|
67
|
-
this.requestUpdate();
|
|
68
|
-
}, 2000);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
_renderIllustration(item) {
|
|
73
|
-
if (!item.imgSrc) {
|
|
74
|
-
return nothing;
|
|
75
|
-
}
|
|
76
|
-
return html`<img slot="illustration" src="${item.imgSrc}">`;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
_renderItemContent(item) {
|
|
80
|
-
return html`
|
|
81
|
-
<d2l-list-item-content>
|
|
82
|
-
<div>${item.primaryText}</div>
|
|
83
|
-
<div slot="supporting-info">${item.supportingText}</div>
|
|
84
|
-
</d2l-list-item-content>`;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
_renderList(items, nested, includeHeader = false) {
|
|
88
|
-
return html`
|
|
89
|
-
<d2l-list grid drag-multiple slot="${ifDefined(nested ? 'nested' : undefined)}">
|
|
90
|
-
${ includeHeader ? this._renderListControls() : nothing }
|
|
91
|
-
${repeat(items, item => item.key, item => html`
|
|
92
|
-
${this._renderListItem(item)}
|
|
93
|
-
`)}
|
|
94
|
-
</d2l-list>
|
|
95
|
-
`;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
_renderListControls() {
|
|
99
|
-
return html`
|
|
100
|
-
<d2l-list-controls slot="controls">
|
|
101
|
-
<d2l-selection-action icon="tier1:bookmark-hollow" text="Bookmark" requires-selection></d2l-selection-action>
|
|
102
|
-
<d2l-selection-action icon="tier1:gear" text="Settings"></d2l-selection-action>
|
|
103
|
-
</d2l-list-controls>
|
|
104
|
-
`;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
_renderListItem(item) {
|
|
108
|
-
return html`
|
|
109
|
-
<d2l-list-item
|
|
110
|
-
draggable
|
|
111
|
-
selectable
|
|
112
|
-
?selected="${item.selected}"
|
|
113
|
-
drag-handle-text="${item.primaryText}"
|
|
114
|
-
key="${item.key}"
|
|
115
|
-
label="${item.primaryText}"
|
|
116
|
-
?expandable="${item.expandable}"
|
|
117
|
-
@d2l-list-item-expand-collapse-toggled="${this._handleListItemToggle}">
|
|
118
|
-
${this._renderIllustration(item)}
|
|
119
|
-
${this._renderItemContent(item)}
|
|
120
|
-
${this._renderNestedList(item)}
|
|
121
|
-
</d2l-list-item>
|
|
122
|
-
`;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
_renderNestedList(item) {
|
|
126
|
-
if (item?.items?.length <= 0) {
|
|
127
|
-
return nothing;
|
|
128
|
-
}
|
|
129
|
-
return this._renderList(item.items, true);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
customElements.define('d2l-demo-list-nested-lazy-load', ListDemoNestedLazyLoad);
|
|
@@ -1,291 +0,0 @@
|
|
|
1
|
-
import '../list-item-content.js';
|
|
2
|
-
import '../list-item.js';
|
|
3
|
-
import '../list-item-button.js';
|
|
4
|
-
import '../list.js';
|
|
5
|
-
import '../../dropdown/dropdown-menu.js';
|
|
6
|
-
import '../../dropdown/dropdown-more.js';
|
|
7
|
-
import '../../menu/menu.js';
|
|
8
|
-
import '../../menu/menu-item.js';
|
|
9
|
-
import '../../paging/pager-load-more.js';
|
|
10
|
-
import '../list-controls.js';
|
|
11
|
-
import '../../selection/selection-action.js';
|
|
12
|
-
import { css, html, LitElement, nothing } from 'lit';
|
|
13
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
14
|
-
import { listDemos } from './list-demo-scenarios.js';
|
|
15
|
-
import { moveLocations } from '../list-item-drag-drop-mixin.js';
|
|
16
|
-
import { repeat } from 'lit/directives/repeat.js';
|
|
17
|
-
|
|
18
|
-
class ListDemoNested extends LitElement {
|
|
19
|
-
|
|
20
|
-
static get properties() {
|
|
21
|
-
return {
|
|
22
|
-
addButton: { type: Boolean, attribute: 'add-button' },
|
|
23
|
-
demoItemKey: { type: String, attribute: 'demo-item-key' },
|
|
24
|
-
isDraggable: { attribute: 'is-draggable', type: Boolean },
|
|
25
|
-
selectable: { type: Boolean },
|
|
26
|
-
keyboardDragDisabled: { type: Boolean, attribute: 'keyboard-drag-disabled' },
|
|
27
|
-
disableExpandFeature: { type: Boolean, attribute: 'disable-expand-feature' },
|
|
28
|
-
dropNestedOnly: { type: Boolean, attribute: 'drop-nested-only' },
|
|
29
|
-
expanded: { type: Boolean },
|
|
30
|
-
includeSecondaryActions: { type: Boolean, attribute: 'include-secondary-actions' },
|
|
31
|
-
includeListControls: { type: Boolean, attribute: 'include-list-controls' },
|
|
32
|
-
includeActionHref: { type: Boolean, attribute: 'include-action-href' },
|
|
33
|
-
useButtonListItem: { type: Boolean, attribute: 'use-button-item' },
|
|
34
|
-
showLoadMore: { type: Boolean, attribute: 'show-load-more' },
|
|
35
|
-
noPrimaryAction: { type: Boolean, attribute: 'no-primary-action' },
|
|
36
|
-
disableListGrid: { type: Boolean, attribute: 'disable-list-grid' },
|
|
37
|
-
dragHandleShowAlways: { type: Boolean, attribute: 'drag-handle-show-always' },
|
|
38
|
-
_items: { state: true },
|
|
39
|
-
_loadedItems: { state: true },
|
|
40
|
-
_remainingItemCount: { state: true },
|
|
41
|
-
_lastItemLoadedIndex: { state: true }
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
static get styles() {
|
|
46
|
-
return [
|
|
47
|
-
css`
|
|
48
|
-
.secondary-actions {
|
|
49
|
-
padding-right: 6px;
|
|
50
|
-
}
|
|
51
|
-
`
|
|
52
|
-
];
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
constructor() {
|
|
56
|
-
super();
|
|
57
|
-
this._items = [];
|
|
58
|
-
this._loadedItems = [];
|
|
59
|
-
this._remainingItemCount = 0;
|
|
60
|
-
this._lastItemLoadedIndex = 1;
|
|
61
|
-
this._pageSize = 1;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
render() {
|
|
65
|
-
return html`
|
|
66
|
-
<div @d2l-list-items-move="${this._handleListItemsMove}">
|
|
67
|
-
${this._renderList(this._loadedItems, false, this.includeListControls, this.showLoadMore)}
|
|
68
|
-
</div>
|
|
69
|
-
`;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
willUpdate(changedProperties) {
|
|
73
|
-
super.willUpdate(changedProperties);
|
|
74
|
-
if (changedProperties.has('demoItemKey')) {
|
|
75
|
-
this._items = listDemos[this.demoItemKey] ?? [];
|
|
76
|
-
this._loadedItems = this._items;
|
|
77
|
-
}
|
|
78
|
-
if (changedProperties.has('_items') || changedProperties.has('demoItemKey') || changedProperties.has('showLoadMore') || changedProperties.has('_lastItemLoadedIndex')) {
|
|
79
|
-
this._loadedItems = this.showLoadMore ? this._items.slice(0, this._lastItemLoadedIndex + 1) : this._items;
|
|
80
|
-
this._remainingItemCount = this.showLoadMore ? this._items.length - this._loadedItems.length : 0;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
_handleButtonClick(e) {
|
|
85
|
-
// eslint-disable-next-line no-console
|
|
86
|
-
console.log('d2l-list-item-button clicked!', e);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
async _handleListItemsMove(e) {
|
|
90
|
-
|
|
91
|
-
const sourceListItems = e.detail.sourceItems;
|
|
92
|
-
const target = e.detail.target;
|
|
93
|
-
|
|
94
|
-
// helper that gets the array containing item data, the item data, and the index within the array
|
|
95
|
-
const getItemInfo = (items, key) => {
|
|
96
|
-
for (let i = 0; i < items.length; i++) {
|
|
97
|
-
if (items[i].key === key) {
|
|
98
|
-
return { owner: items, item: items[i], index: i };
|
|
99
|
-
}
|
|
100
|
-
if (items[i].items && items[i].items.length > 0) {
|
|
101
|
-
const tempItemData = getItemInfo(items[i].items, key);
|
|
102
|
-
if (tempItemData) return tempItemData;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
const dataToMove = [];
|
|
108
|
-
|
|
109
|
-
// remove data elements from original locations
|
|
110
|
-
sourceListItems.forEach(sourceListItem => {
|
|
111
|
-
const info = getItemInfo(this._items, sourceListItem.key);
|
|
112
|
-
if (info?.owner) {
|
|
113
|
-
info.owner.splice(info.index, 1);
|
|
114
|
-
}
|
|
115
|
-
if (info?.item) {
|
|
116
|
-
dataToMove.push(info.item);
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
// append data elements to new location
|
|
121
|
-
const targetInfo = getItemInfo(this._items, target.item.key);
|
|
122
|
-
let targetItems;
|
|
123
|
-
let targetIndex;
|
|
124
|
-
if (target.location === moveLocations.nest) {
|
|
125
|
-
if (!targetInfo.item.items) targetInfo.item.items = [];
|
|
126
|
-
targetItems = targetInfo.item.items;
|
|
127
|
-
targetIndex = targetItems.length;
|
|
128
|
-
} else {
|
|
129
|
-
targetItems = targetInfo?.owner;
|
|
130
|
-
if (!targetItems) return;
|
|
131
|
-
if (target.location === moveLocations.above) targetIndex = targetInfo.index;
|
|
132
|
-
else if (target.location === moveLocations.below) targetIndex = targetInfo.index + 1;
|
|
133
|
-
}
|
|
134
|
-
for (let i = dataToMove.length - 1; i >= 0; i--) {
|
|
135
|
-
targetItems.splice(targetIndex, 0, dataToMove[i]);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
this.requestUpdate();
|
|
139
|
-
await this.updateComplete;
|
|
140
|
-
|
|
141
|
-
if (e.detail.keyboardActive) {
|
|
142
|
-
setTimeout(async() => {
|
|
143
|
-
if (!this.shadowRoot) return;
|
|
144
|
-
const newItem = this.shadowRoot.querySelector('d2l-list').getListItemByKey(sourceListItems[0].key);
|
|
145
|
-
await newItem.waitForUpdateComplete();
|
|
146
|
-
newItem.activateDragHandle();
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
_handlePagerLoadMore(e) {
|
|
153
|
-
// mock delay consumers might have
|
|
154
|
-
setTimeout(() => {
|
|
155
|
-
this._lastItemLoadedIndex += this._pageSize;
|
|
156
|
-
e.detail.complete();
|
|
157
|
-
}, 1000);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
_renderIllustration(item) {
|
|
161
|
-
if (!item.imgSrc) {
|
|
162
|
-
return nothing;
|
|
163
|
-
}
|
|
164
|
-
return html`<img slot="illustration" src="${item.imgSrc}">`;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
_renderItemContent(item) {
|
|
168
|
-
return html`
|
|
169
|
-
<d2l-list-item-content>
|
|
170
|
-
<div>${item.primaryText}</div>
|
|
171
|
-
<div slot="supporting-info">${item.supportingText}</div>
|
|
172
|
-
</d2l-list-item-content>`;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
_renderList(items, nested, includeControls = false, showLoadMore = false) {
|
|
176
|
-
return html`
|
|
177
|
-
<d2l-list
|
|
178
|
-
?grid="${!this.disableListGrid}"
|
|
179
|
-
drag-multiple
|
|
180
|
-
?drag-handle-show-always="${this.dragHandleShowAlways}"
|
|
181
|
-
?drop-nested-only="${this.dropNestedOnly}"
|
|
182
|
-
slot="${ifDefined(nested ? 'nested' : undefined)}"
|
|
183
|
-
item-count="${this._items.length}"
|
|
184
|
-
?add-button="${this.addButton}">
|
|
185
|
-
${ includeControls ? this._renderListControls() : nothing }
|
|
186
|
-
${repeat(items, item => item.key, item => html`
|
|
187
|
-
${this._renderListItem(item)}
|
|
188
|
-
${this._renderListItemButton(item)}
|
|
189
|
-
`)}
|
|
190
|
-
${ showLoadMore ? this._renderShowLoadMore() : nothing }
|
|
191
|
-
</d2l-list>
|
|
192
|
-
`;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
_renderListControls() {
|
|
196
|
-
return html`
|
|
197
|
-
<d2l-list-controls slot="controls">
|
|
198
|
-
<d2l-selection-action icon="tier1:bookmark-hollow" text="Bookmark" requires-selection></d2l-selection-action>
|
|
199
|
-
<d2l-selection-action icon="tier1:gear" text="Settings"></d2l-selection-action>
|
|
200
|
-
</d2l-list-controls>
|
|
201
|
-
`;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
_renderListItem(item) {
|
|
205
|
-
if (this.useButtonListItem) {
|
|
206
|
-
return nothing;
|
|
207
|
-
}
|
|
208
|
-
const hasChildren = item?.items?.length > 0;
|
|
209
|
-
return html`
|
|
210
|
-
<d2l-list-item
|
|
211
|
-
action-href="${this.includeActionHref ? 'http://www.d2l.com' : ''}"
|
|
212
|
-
?keyboard-drag-disabled="${this.keyboardDragDisabled}"
|
|
213
|
-
?draggable="${this.isDraggable}"
|
|
214
|
-
drag-handle-text="${item.primaryText}"
|
|
215
|
-
?drop-nested="${item.dropNested}"
|
|
216
|
-
key="${item.key}"
|
|
217
|
-
label="${item.primaryText}"
|
|
218
|
-
?selectable="${this.selectable}"
|
|
219
|
-
?expandable="${this.disableExpandFeature ? false : hasChildren}"
|
|
220
|
-
?expanded="${this.expanded}"
|
|
221
|
-
?no-primary-action="${this.noPrimaryAction}">
|
|
222
|
-
${this._renderIllustration(item)}
|
|
223
|
-
${this._renderItemContent(item)}
|
|
224
|
-
${this._renderSecondaryActions()}
|
|
225
|
-
${this._renderNestedList(item)}
|
|
226
|
-
</d2l-list-item>
|
|
227
|
-
`;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
_renderListItemButton(item) {
|
|
231
|
-
if (!this.useButtonListItem) {
|
|
232
|
-
return nothing;
|
|
233
|
-
}
|
|
234
|
-
const hasChildren = item?.items?.length > 0;
|
|
235
|
-
return html`
|
|
236
|
-
<d2l-list-item-button
|
|
237
|
-
?draggable="${this.isDraggable}"
|
|
238
|
-
drag-handle-text="${item.primaryText}"
|
|
239
|
-
?drop-nested="${item.dropNested}"
|
|
240
|
-
key="${item.key}"
|
|
241
|
-
label="${item.primaryText}"
|
|
242
|
-
?selectable="${this.selectable}"
|
|
243
|
-
?expandable="${this.disableExpandFeature ? false : hasChildren}"
|
|
244
|
-
?expanded="${this.expanded}"
|
|
245
|
-
@d2l-list-item-button-click="${this._handleButtonClick}">
|
|
246
|
-
${this._renderIllustration(item)}
|
|
247
|
-
${this._renderItemContent(item)}
|
|
248
|
-
${this._renderSecondaryActions()}
|
|
249
|
-
${this._renderNestedList(item)}
|
|
250
|
-
</d2l-list-item-button>
|
|
251
|
-
`;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
_renderNestedList(item) {
|
|
255
|
-
if (item?.items?.length <= 0) {
|
|
256
|
-
return nothing;
|
|
257
|
-
}
|
|
258
|
-
return this._renderList(item.items, true);
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
_renderSecondaryActions() {
|
|
262
|
-
if (!this.includeSecondaryActions) {
|
|
263
|
-
return nothing;
|
|
264
|
-
}
|
|
265
|
-
return html`
|
|
266
|
-
<div slot="actions" class="secondary-actions">
|
|
267
|
-
<d2l-dropdown-more text="Open!">
|
|
268
|
-
<d2l-dropdown-menu>
|
|
269
|
-
<d2l-menu label="More Actions">
|
|
270
|
-
<d2l-menu-item text="Action 1"></d2l-menu-item>
|
|
271
|
-
<d2l-menu-item text="Action 2"></d2l-menu-item>
|
|
272
|
-
</d2l-menu>
|
|
273
|
-
</d2l-dropdown-menu>
|
|
274
|
-
</d2l-dropdown-more>
|
|
275
|
-
</div>
|
|
276
|
-
`;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
_renderShowLoadMore() {
|
|
280
|
-
return html`
|
|
281
|
-
<d2l-pager-load-more slot="pager"
|
|
282
|
-
@d2l-pager-load-more="${this._handlePagerLoadMore}"
|
|
283
|
-
?has-more="${this._lastItemLoadedIndex < this._items.length - 1}"
|
|
284
|
-
page-size="${this._remainingItemCount < this._pageSize ? this._remainingItemCount : this._pageSize}">
|
|
285
|
-
</d2l-pager-load-more>
|
|
286
|
-
`;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
customElements.define('d2l-demo-list-nested', ListDemoNested);
|
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
import '../../button/button-icon.js';
|
|
2
|
-
import '../../dropdown/dropdown-button-subtle.js';
|
|
3
|
-
import '../../dropdown/dropdown-menu.js';
|
|
4
|
-
import '../../dropdown/dropdown-more.js';
|
|
5
|
-
import '../../menu/menu.js';
|
|
6
|
-
import '../../menu/menu-item.js';
|
|
7
|
-
import '../../paging/pager-load-more.js';
|
|
8
|
-
import '../../selection/selection-action.js';
|
|
9
|
-
import '../../selection/selection-action-dropdown.js';
|
|
10
|
-
import '../../selection/selection-action-menu-item.js';
|
|
11
|
-
import '../../tooltip/tooltip.js';
|
|
12
|
-
import '../list-controls.js';
|
|
13
|
-
import '../list-item-content.js';
|
|
14
|
-
import '../list-item.js';
|
|
15
|
-
import '../list.js';
|
|
16
|
-
import { css, html, LitElement } from 'lit';
|
|
17
|
-
import { getUniqueId } from '../../../helpers/uniqueId.js';
|
|
18
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
19
|
-
import { repeat } from 'lit/directives/repeat.js';
|
|
20
|
-
|
|
21
|
-
const items = [{
|
|
22
|
-
key: '1',
|
|
23
|
-
primaryText: 'Introductory Earth Sciences',
|
|
24
|
-
supportingText: 'This course explores the geological process of the Earth\'s interior and surface. These include volcanism, earthquakes, mountains...',
|
|
25
|
-
imgSrc: 'https://s.brightspace.com/course-images/images/38e839b1-37fa-470c-8830-b189ce4ae134/tile-high-density-max-size.jpg',
|
|
26
|
-
dropNested: true,
|
|
27
|
-
items: [{
|
|
28
|
-
key: '1-1',
|
|
29
|
-
primaryText: 'Glaciation',
|
|
30
|
-
supportingText: 'Nesting Allowed',
|
|
31
|
-
imgSrc: 'https://s.brightspace.com/course-images/images/bf648978-6637-4fdc-815b-81572c436c0e/tile-high-density-max-size.jpg',
|
|
32
|
-
dropNested: true,
|
|
33
|
-
items: []
|
|
34
|
-
}, {
|
|
35
|
-
key: '1-2',
|
|
36
|
-
primaryText: 'Weathering',
|
|
37
|
-
supportingText: 'Nesting Allowed',
|
|
38
|
-
imgSrc: 'https://s.brightspace.com/course-images/images/50f91ba6-7c25-482a-bd71-1c4b7c8d2154/tile-high-density-min-size.jpg',
|
|
39
|
-
dropNested: true,
|
|
40
|
-
items: []
|
|
41
|
-
}, {
|
|
42
|
-
key: '1-3',
|
|
43
|
-
primaryText: 'Volcanism',
|
|
44
|
-
supportingText: 'Nesting Allowed',
|
|
45
|
-
imgSrc: 'https://s.brightspace.com/course-images/images/5eb2371d-6099-4c8d-8aad-075f357012a2/tile-high-density-min-size.jpg',
|
|
46
|
-
dropNested: true,
|
|
47
|
-
items: []
|
|
48
|
-
}]
|
|
49
|
-
}, {
|
|
50
|
-
key: '2',
|
|
51
|
-
primaryText: 'Engineering Materials for Energy Systems',
|
|
52
|
-
supportingText: 'Shiver me timbers to go on account lookout wherry doubloon chase. Belay yo-ho-ho keelhaul squiffy black spot yardarm spyglass sheet transom heave to.',
|
|
53
|
-
imgSrc: 'https://s.brightspace.com/course-images/images/c87d778f-e5f1-442b-8ac7-5d1a3d7ca725/tile-high-density-max-size.jpg',
|
|
54
|
-
items: [{
|
|
55
|
-
key: '2-1',
|
|
56
|
-
primaryText: 'Contaminant Transport',
|
|
57
|
-
supportingText: 'No Nesting Allowed',
|
|
58
|
-
imgSrc: 'https://s.brightspace.com/course-images/images/824fffa1-86a6-4489-84ba-91edfbc1dcc4/tile-high-density-min-size.jpg',
|
|
59
|
-
dropNested: false,
|
|
60
|
-
items: []
|
|
61
|
-
}, {
|
|
62
|
-
key: '2-2',
|
|
63
|
-
primaryText: 'Modelling Flow in Fractured Media',
|
|
64
|
-
supportingText: 'No Nesting Allowed',
|
|
65
|
-
imgSrc: 'https://s.brightspace.com/course-images/images/e18c92a4-b996-444f-84b5-988874feccac/tile-high-density-min-size.jpg',
|
|
66
|
-
dropNested: false,
|
|
67
|
-
items: []
|
|
68
|
-
}]
|
|
69
|
-
}, {
|
|
70
|
-
key: '3',
|
|
71
|
-
primaryText: 'Geomorphology and GIS',
|
|
72
|
-
supportingText: 'Trysail Sail ho Corsair red ensign hulk smartly boom jib rum gangway. Case shot Shiver me timbers gangplank crack Jennys tea cup ballast Blimey lee snow crow\'s nest rutters.',
|
|
73
|
-
imgSrc: 'https://s.brightspace.com/course-images/images/2f035317-5014-4095-82c8-e29f34c7f99e/tile-high-density-max-size.jpg',
|
|
74
|
-
items: [{
|
|
75
|
-
key: '3-1',
|
|
76
|
-
primaryText: 'Carbon & Nitrogen Cycling',
|
|
77
|
-
supportingText: 'Nesting Allowed',
|
|
78
|
-
imgSrc: 'https://s.brightspace.com/course-images/images/623b420b-a305-4762-8af8-598f0e72e956/tile-high-density-min-size.jpg',
|
|
79
|
-
dropNested: true,
|
|
80
|
-
items: []
|
|
81
|
-
}, {
|
|
82
|
-
key: '3-2',
|
|
83
|
-
primaryText: 'Wetland Engineering',
|
|
84
|
-
supportingText: 'Nesting Allowed',
|
|
85
|
-
imgSrc: 'https://s.brightspace.com/course-images/images/26102577-8f2a-4e24-84b5-19d76decbc7a/tile-high-density-min-size.jpg',
|
|
86
|
-
dropNested: true,
|
|
87
|
-
items: []
|
|
88
|
-
}]
|
|
89
|
-
}, {
|
|
90
|
-
key: '4',
|
|
91
|
-
primaryText: 'Pedagogy Case Studies',
|
|
92
|
-
supportingText: 'Belay yo-ho-ho keelhaul squiffy black spot yardarm spyglass sheet transom heave to. Deadlights jack lad schooner scallywag dance the hempen jig carouser broadside cable strike colors.',
|
|
93
|
-
imgSrc: 'https://s.brightspace.com/course-images/images/e5fd575a-bc14-4a80-89e1-46f349a76178/tile-high-density-max-size.jpg',
|
|
94
|
-
items: []
|
|
95
|
-
}, {
|
|
96
|
-
key: '5',
|
|
97
|
-
primaryText: 'Introduction to Painting',
|
|
98
|
-
supportingText: 'Fluke jib scourge of the seven seas boatswain schooner gaff booty Jack Tar transom spirits. Bring a spring upon her cable holystone blow the man down spanker.',
|
|
99
|
-
imgSrc: 'https://s.brightspace.com/course-images/images/63b162ab-b582-4bf9-8c1d-1dad04714121/tile-high-density-max-size.jpg',
|
|
100
|
-
items: []
|
|
101
|
-
}, {
|
|
102
|
-
key: '6',
|
|
103
|
-
primaryText: 'Analytical Chemistry',
|
|
104
|
-
supportingText: 'Trysail Sail ho Corsair red ensign hulk smartly boom jib rum gangway. Fluke jib scourge of the seven seas boatswain schooner gaff booty Jack Tar transom spirits.',
|
|
105
|
-
imgSrc: 'https://s.brightspace.com/course-images/images/85f865dd-4c73-49c5-8809-c872256f7715/tile-high-density-max-size.jpg',
|
|
106
|
-
items: []
|
|
107
|
-
}, {
|
|
108
|
-
key: '7',
|
|
109
|
-
primaryText: 'Plant Biology',
|
|
110
|
-
supportingText: '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.',
|
|
111
|
-
imgSrc: 'https://s.brightspace.com/course-images/images/61f07ae4-4686-4019-8146-1604cb8ae9bf/tile-high-density-max-size.jpg',
|
|
112
|
-
items: []
|
|
113
|
-
}];
|
|
114
|
-
|
|
115
|
-
class DemoList extends LitElement {
|
|
116
|
-
|
|
117
|
-
static get properties() {
|
|
118
|
-
return {
|
|
119
|
-
addButton: { type: Boolean, attribute: 'add-button' },
|
|
120
|
-
grid: { type: Boolean },
|
|
121
|
-
extendSeparators: { type: Boolean, attribute: 'extend-separators' },
|
|
122
|
-
_lastItemLoadedIndex: { state: true }
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
static get styles() {
|
|
127
|
-
return css`
|
|
128
|
-
:host {
|
|
129
|
-
display: block;
|
|
130
|
-
}
|
|
131
|
-
:host([hidden]) {
|
|
132
|
-
display: none;
|
|
133
|
-
}
|
|
134
|
-
img {
|
|
135
|
-
height: 500px;
|
|
136
|
-
object-fit: cover;
|
|
137
|
-
}
|
|
138
|
-
`;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
constructor() {
|
|
142
|
-
super();
|
|
143
|
-
this.extendSeparators = false;
|
|
144
|
-
this.items = JSON.parse(JSON.stringify(items));
|
|
145
|
-
this._lastItemLoadedIndex = 2;
|
|
146
|
-
this._pageSize = 2;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
render() {
|
|
150
|
-
const loadedItems = this.items.slice(0, this._lastItemLoadedIndex + 1);
|
|
151
|
-
const remainingItemCount = this.items.length - loadedItems.length;
|
|
152
|
-
const addButtonText = this.addButton ? 'Add New Item' : undefined;
|
|
153
|
-
return html`
|
|
154
|
-
<d2l-list
|
|
155
|
-
?grid="${this.grid}"
|
|
156
|
-
item-count="${this.items.length}"
|
|
157
|
-
?extend-separators="${this.extendSeparators}"
|
|
158
|
-
?add-button="${this.addButton}"
|
|
159
|
-
add-button-text="${ifDefined(addButtonText)}">
|
|
160
|
-
<d2l-list-controls slot="controls" select-all-pages-allowed>
|
|
161
|
-
<d2l-selection-action icon="tier1:plus-default" text="Add" @d2l-selection-action-click="${this._handleAddItem}"></d2l-selection-action>
|
|
162
|
-
<d2l-selection-action-dropdown text="Move To" requires-selection>
|
|
163
|
-
<d2l-dropdown-menu>
|
|
164
|
-
<d2l-menu label="Move To Options">
|
|
165
|
-
<d2l-menu-item text="Top of Quiz"></d2l-menu-item>
|
|
166
|
-
<d2l-menu-item text="Bottom of Quiz"></d2l-menu-item>
|
|
167
|
-
<d2l-menu-item text="Section">
|
|
168
|
-
<d2l-menu>
|
|
169
|
-
<d2l-menu-item text="Option 1"></d2l-menu-item>
|
|
170
|
-
<d2l-menu-item text="Option 2"></d2l-menu-item>
|
|
171
|
-
</d2l-menu>
|
|
172
|
-
</d2l-menu-item>
|
|
173
|
-
</d2l-menu>
|
|
174
|
-
</d2l-dropdown-menu>
|
|
175
|
-
</d2l-selection-action-dropdown>
|
|
176
|
-
<d2l-dropdown-button-subtle text="Actions">
|
|
177
|
-
<d2l-dropdown-menu>
|
|
178
|
-
<d2l-menu label="Actions">
|
|
179
|
-
<d2l-selection-action-menu-item text="Bookmark (requires selection)" requires-selection></d2l-selection-action-menu-item>
|
|
180
|
-
<d2l-selection-action-menu-item text="Advanced"></d2l-selection-action-menu-item>
|
|
181
|
-
</d2l-menu>
|
|
182
|
-
</d2l-dropdown-menu>
|
|
183
|
-
</d2l-dropdown-button-subtle>
|
|
184
|
-
<d2l-selection-action icon="tier1:gear" text="Settings" requires-selection></d2l-selection-action>
|
|
185
|
-
</d2l-list-controls>
|
|
186
|
-
${repeat(loadedItems, item => item.key, item => {
|
|
187
|
-
const tooltipButtonId = getUniqueId();
|
|
188
|
-
return html`
|
|
189
|
-
<d2l-list-item href="http://www.d2l.com" key="${item.key}" label="${item.primaryText}" selectable>
|
|
190
|
-
<img slot="illustration" src="${item.imgSrc}">
|
|
191
|
-
<d2l-list-item-content>
|
|
192
|
-
<div>${item.primaryText}</div>
|
|
193
|
-
<div slot="supporting-info">${item.supportingText}</div>
|
|
194
|
-
</d2l-list-item-content>
|
|
195
|
-
<div slot="actions">
|
|
196
|
-
<d2l-button-icon id="${tooltipButtonId}" text="My Button" icon="tier1:preview"></d2l-button-icon>
|
|
197
|
-
<d2l-tooltip for="${tooltipButtonId}">Preview</d2l-tooltip>
|
|
198
|
-
<d2l-dropdown-more text="Open!">
|
|
199
|
-
<d2l-dropdown-menu>
|
|
200
|
-
<d2l-menu label="Astronomy">
|
|
201
|
-
<d2l-menu-item text="Introduction"></d2l-menu-item>
|
|
202
|
-
<d2l-menu-item text="Searching for the Heavens "></d2l-menu-item>
|
|
203
|
-
</d2l-menu>
|
|
204
|
-
</d2l-dropdown-menu>
|
|
205
|
-
</d2l-dropdown-more>
|
|
206
|
-
</div>
|
|
207
|
-
</d2l-list-item>
|
|
208
|
-
`;
|
|
209
|
-
})}
|
|
210
|
-
<d2l-pager-load-more slot="pager"
|
|
211
|
-
@d2l-pager-load-more="${this._handlePagerLoadMore}"
|
|
212
|
-
?has-more="${this._lastItemLoadedIndex < this.items.length - 1}"
|
|
213
|
-
page-size="${remainingItemCount < this._pageSize ? remainingItemCount : this._pageSize}">
|
|
214
|
-
</d2l-pager-load-more>
|
|
215
|
-
</d2l-list>
|
|
216
|
-
`;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
_handleAddItem() {
|
|
220
|
-
const newKey = getUniqueId();
|
|
221
|
-
this.items.push({
|
|
222
|
-
key: newKey,
|
|
223
|
-
primaryText: `New Item ${newKey}`,
|
|
224
|
-
supportingText: 'Shiver me timbers to go on account lookout wherry doubloon chase. Belay yo-ho-ho keelhaul squiffy black spot yardarm spyglass sheet transom heave to.',
|
|
225
|
-
imgSrc: 'https://s.brightspace.com/course-images/images/38e839b1-37fa-470c-8830-b189ce4ae134/tile-high-density-max-size.jpg',
|
|
226
|
-
items: []
|
|
227
|
-
});
|
|
228
|
-
this.requestUpdate();
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
_handlePagerLoadMore(e) {
|
|
232
|
-
// mock delay consumers might have
|
|
233
|
-
setTimeout(() => {
|
|
234
|
-
this._lastItemLoadedIndex += this._pageSize;
|
|
235
|
-
e.detail.complete();
|
|
236
|
-
}, 2000);
|
|
237
|
-
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
}
|
|
241
|
-
customElements.define('d2l-demo-list', DemoList);
|