@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,121 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en" data-timezone='{"name":"Canada - Toronto", "identifier":"America/Toronto"}'>
|
|
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 '../input-time-range.js';
|
|
10
|
-
</script>
|
|
11
|
-
</head>
|
|
12
|
-
<body unresolved>
|
|
13
|
-
<d2l-demo-page page-title="d2l-input-time-range">
|
|
14
|
-
|
|
15
|
-
<h2>Simple</h2>
|
|
16
|
-
<d2l-demo-snippet>
|
|
17
|
-
<template>
|
|
18
|
-
<d2l-input-time-range label="Time Range"></d2l-input-time-range>
|
|
19
|
-
</template>
|
|
20
|
-
</d2l-demo-snippet>
|
|
21
|
-
|
|
22
|
-
<h2>Auto Shift Times</h2>
|
|
23
|
-
<d2l-demo-snippet>
|
|
24
|
-
<template>
|
|
25
|
-
<d2l-input-time-range label="Time Range" auto-shift-times></d2l-input-time-range>
|
|
26
|
-
</template>
|
|
27
|
-
</d2l-demo-snippet>
|
|
28
|
-
|
|
29
|
-
<h2>Custom Interval</h2>
|
|
30
|
-
<d2l-demo-snippet>
|
|
31
|
-
<template>
|
|
32
|
-
<d2l-input-time-range label="Time Range" time-interval="sixty" enforce-time-intervals></d2l-input-time-range>
|
|
33
|
-
</template>
|
|
34
|
-
</d2l-demo-snippet>
|
|
35
|
-
|
|
36
|
-
<h2>Custom Interval (Issue #1751)</h2>
|
|
37
|
-
<d2l-demo-snippet>
|
|
38
|
-
<template>
|
|
39
|
-
<d2l-input-time-range label="Time Range" start-value="15:15" time-interval="ten" enforce-time-intervals></d2l-input-time-range>
|
|
40
|
-
</template>
|
|
41
|
-
</d2l-demo-snippet>
|
|
42
|
-
|
|
43
|
-
<h2>Hidden Label</h2>
|
|
44
|
-
<d2l-demo-snippet>
|
|
45
|
-
<template>
|
|
46
|
-
<d2l-input-time-range label="Time Range" label-hidden></d2l-input-time-range>
|
|
47
|
-
</template>
|
|
48
|
-
</d2l-demo-snippet>
|
|
49
|
-
|
|
50
|
-
<h2>Inclusive</h2>
|
|
51
|
-
<d2l-demo-snippet>
|
|
52
|
-
<template>
|
|
53
|
-
<d2l-input-time-range label="Time Range" inclusive-time-range></d2l-input-time-range>
|
|
54
|
-
</template>
|
|
55
|
-
</d2l-demo-snippet>
|
|
56
|
-
|
|
57
|
-
<h2>Labels Specified</h2>
|
|
58
|
-
<d2l-demo-snippet>
|
|
59
|
-
<template>
|
|
60
|
-
<d2l-input-time-range label="Time Range" start-label="A long start time label explanation" end-label="Finish"></d2l-input-time-range>
|
|
61
|
-
</template>
|
|
62
|
-
</d2l-demo-snippet>
|
|
63
|
-
|
|
64
|
-
<h2>Required</h2>
|
|
65
|
-
<d2l-demo-snippet>
|
|
66
|
-
<template>
|
|
67
|
-
<d2l-input-time-range label="Time Range" required></d2l-input-time-range>
|
|
68
|
-
</template>
|
|
69
|
-
</d2l-demo-snippet>
|
|
70
|
-
|
|
71
|
-
<h2>Start/End Labels Hidden</h2>
|
|
72
|
-
<d2l-demo-snippet>
|
|
73
|
-
<template>
|
|
74
|
-
<d2l-input-time-range child-labels-hidden label="Time Range"></d2l-input-time-range>
|
|
75
|
-
</template>
|
|
76
|
-
</d2l-demo-snippet>
|
|
77
|
-
|
|
78
|
-
<h2>Values Specified</h2>
|
|
79
|
-
<d2l-demo-snippet>
|
|
80
|
-
<template>
|
|
81
|
-
<d2l-input-time-range label="Time Range" start-value="08:30:00" end-value="23:00:00"></d2l-input-time-range>
|
|
82
|
-
</template>
|
|
83
|
-
</d2l-demo-snippet>
|
|
84
|
-
|
|
85
|
-
<h2>Disabled</h2>
|
|
86
|
-
<d2l-demo-snippet>
|
|
87
|
-
<template>
|
|
88
|
-
<d2l-input-time-range label="Time Range" disabled></d2l-input-time-range>
|
|
89
|
-
</template>
|
|
90
|
-
</d2l-demo-snippet>
|
|
91
|
-
|
|
92
|
-
<h2>Inline Help</h2>
|
|
93
|
-
<d2l-demo-snippet>
|
|
94
|
-
<template>
|
|
95
|
-
<d2l-input-time-range label="Time Range">
|
|
96
|
-
<div slot="inline-help">
|
|
97
|
-
Help text <b>right here</b>!
|
|
98
|
-
</div>
|
|
99
|
-
</d2l-input-time-range>
|
|
100
|
-
</template>
|
|
101
|
-
</d2l-demo-snippet>
|
|
102
|
-
|
|
103
|
-
<h2>Inline Help (multiline)</h2>
|
|
104
|
-
<d2l-demo-snippet>
|
|
105
|
-
<template>
|
|
106
|
-
<d2l-input-time-range label="Time Range">
|
|
107
|
-
<div slot="inline-help">
|
|
108
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
|
|
109
|
-
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
110
|
-
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
|
|
111
|
-
nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
|
|
112
|
-
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
|
|
113
|
-
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa
|
|
114
|
-
qui officia deserunt mollit anim id est laborum.
|
|
115
|
-
</div>
|
|
116
|
-
</d2l-input-time-range>
|
|
117
|
-
</template>
|
|
118
|
-
</d2l-demo-snippet>
|
|
119
|
-
</d2l-demo-page>
|
|
120
|
-
</body>
|
|
121
|
-
</html>
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en" data-timezone='{"name":"Canada - Toronto", "identifier":"America/Toronto"}'>
|
|
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 '../input-time.js';
|
|
10
|
-
</script>
|
|
11
|
-
</head>
|
|
12
|
-
<body unresolved>
|
|
13
|
-
<d2l-demo-page page-title="d2l-input-time">
|
|
14
|
-
|
|
15
|
-
<h2>Simple</h2>
|
|
16
|
-
<d2l-demo-snippet>
|
|
17
|
-
<template>
|
|
18
|
-
<d2l-input-time label="Start Time" value="18:00:00"></d2l-input-time>
|
|
19
|
-
</template>
|
|
20
|
-
</d2l-demo-snippet>
|
|
21
|
-
|
|
22
|
-
<h2>Hidden Label</h2>
|
|
23
|
-
<d2l-demo-snippet>
|
|
24
|
-
<template>
|
|
25
|
-
<d2l-input-time label="Start Time" label-hidden></d2l-input-time>
|
|
26
|
-
</template>
|
|
27
|
-
</d2l-demo-snippet>
|
|
28
|
-
|
|
29
|
-
<h2>Disabled</h2>
|
|
30
|
-
<d2l-demo-snippet>
|
|
31
|
-
<template>
|
|
32
|
-
<d2l-input-time label="Start Time" disabled></d2l-input-time>
|
|
33
|
-
</template>
|
|
34
|
-
</d2l-demo-snippet>
|
|
35
|
-
|
|
36
|
-
<h2>Required</h2>
|
|
37
|
-
<d2l-demo-snippet>
|
|
38
|
-
<template>
|
|
39
|
-
<d2l-input-time label="Start Time" required></d2l-input-time>
|
|
40
|
-
</template>
|
|
41
|
-
</d2l-demo-snippet>
|
|
42
|
-
|
|
43
|
-
<h2>Hidden Time Zone</h2>
|
|
44
|
-
<d2l-demo-snippet>
|
|
45
|
-
<template>
|
|
46
|
-
<d2l-input-time label="Start Time" time-zone-hidden></d2l-input-time>
|
|
47
|
-
</template>
|
|
48
|
-
</d2l-demo-snippet>
|
|
49
|
-
|
|
50
|
-
<h2>Custom Time Zone</h2>
|
|
51
|
-
<d2l-demo-snippet>
|
|
52
|
-
<template>
|
|
53
|
-
<d2l-input-time label="Start Time" time-zone-id="America/Vancouver"></d2l-input-time>
|
|
54
|
-
</template>
|
|
55
|
-
</d2l-demo-snippet>
|
|
56
|
-
|
|
57
|
-
<h2>Custom Interval</h2>
|
|
58
|
-
<d2l-demo-snippet>
|
|
59
|
-
<template>
|
|
60
|
-
<d2l-input-time label="Start Time" time-interval="sixty" enforce-time-intervals></d2l-input-time>
|
|
61
|
-
</template>
|
|
62
|
-
</d2l-demo-snippet>
|
|
63
|
-
|
|
64
|
-
<h2>Custom Default Time</h2>
|
|
65
|
-
<d2l-demo-snippet>
|
|
66
|
-
<template>
|
|
67
|
-
<d2l-input-time label="Start Time" default-value="09:00:00"></d2l-input-time>
|
|
68
|
-
</template>
|
|
69
|
-
</d2l-demo-snippet>
|
|
70
|
-
|
|
71
|
-
<h2>Inline help text</h2>
|
|
72
|
-
<d2l-demo-snippet>
|
|
73
|
-
<template>
|
|
74
|
-
<d2l-input-time label="Start Time" default-value="09:00:00">
|
|
75
|
-
<div slot="inline-help">
|
|
76
|
-
<b>Inline</b> help text!
|
|
77
|
-
</div>
|
|
78
|
-
</d2l-input-time>
|
|
79
|
-
</template>
|
|
80
|
-
</d2l-demo-snippet>
|
|
81
|
-
|
|
82
|
-
<h2>Inline help text (multiline)</h2>
|
|
83
|
-
<d2l-demo-snippet>
|
|
84
|
-
<template>
|
|
85
|
-
<d2l-input-time label="Start Time" default-value="09:00:00">
|
|
86
|
-
<div slot="inline-help">
|
|
87
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
|
|
88
|
-
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
89
|
-
</div>
|
|
90
|
-
</d2l-input-time>
|
|
91
|
-
</template>
|
|
92
|
-
</d2l-demo-snippet>
|
|
93
|
-
</d2l-demo-page>
|
|
94
|
-
</body>
|
|
95
|
-
</html>
|
|
@@ -1,111 +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 '../link.js';
|
|
10
|
-
</script>
|
|
11
|
-
<style>
|
|
12
|
-
.truncate-container {
|
|
13
|
-
border: 1px solid var(--d2l-color-mica);
|
|
14
|
-
border-radius: 6px;
|
|
15
|
-
max-width: 400px;
|
|
16
|
-
padding: 0.6rem;
|
|
17
|
-
}
|
|
18
|
-
.block {
|
|
19
|
-
display: block;
|
|
20
|
-
}
|
|
21
|
-
</style>
|
|
22
|
-
</head>
|
|
23
|
-
<body unresolved>
|
|
24
|
-
<d2l-demo-page page-title="d2l-link">
|
|
25
|
-
|
|
26
|
-
<h2>Standard Link</h2>
|
|
27
|
-
<d2l-demo-snippet>
|
|
28
|
-
<template>
|
|
29
|
-
<d2l-link href="https://www.d2l.com">Standard Link</d2l-link>
|
|
30
|
-
</template>
|
|
31
|
-
</d2l-demo-snippet>
|
|
32
|
-
|
|
33
|
-
<h2>Main Link</h2>
|
|
34
|
-
<d2l-demo-snippet>
|
|
35
|
-
<template>
|
|
36
|
-
<d2l-link main href="https://www.d2l.com">Main Link</d2l-link>
|
|
37
|
-
</template>
|
|
38
|
-
</d2l-demo-snippet>
|
|
39
|
-
|
|
40
|
-
<h2>Small Link</h2>
|
|
41
|
-
<d2l-demo-snippet>
|
|
42
|
-
<template>
|
|
43
|
-
<d2l-link small href="https://www.d2l.com">Small Link</d2l-link>
|
|
44
|
-
</template>
|
|
45
|
-
</d2l-demo-snippet>
|
|
46
|
-
|
|
47
|
-
<h2>Opens in a New Window</h2>
|
|
48
|
-
<d2l-demo-snippet>
|
|
49
|
-
<template>
|
|
50
|
-
<d2l-link target="_blank" href="https://www.d2l.com">Standard New Window Link</d2l-link>
|
|
51
|
-
</template>
|
|
52
|
-
</d2l-demo-snippet>
|
|
53
|
-
|
|
54
|
-
<h2>Small Opens in a New Window</h2>
|
|
55
|
-
<d2l-demo-snippet>
|
|
56
|
-
<template>
|
|
57
|
-
<d2l-link small target="_blank" main href="https://www.d2l.com">New Window Link</d2l-link>
|
|
58
|
-
</template>
|
|
59
|
-
</d2l-demo-snippet>
|
|
60
|
-
|
|
61
|
-
<h2>Inline</h2>
|
|
62
|
-
<d2l-demo-snippet>
|
|
63
|
-
<template>
|
|
64
|
-
<p>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. <d2l-link href="https://www.d2l.com">Standard Link</d2l-link> Fluke jib scourge of the seven seas boatswain schooner gaff booty Jack Tar transom spirits.</p>
|
|
65
|
-
</template>
|
|
66
|
-
</d2l-demo-snippet>
|
|
67
|
-
|
|
68
|
-
<h2>Block Wrap</h2>
|
|
69
|
-
<d2l-demo-snippet>
|
|
70
|
-
<template>
|
|
71
|
-
<div class="truncate-container">
|
|
72
|
-
<d2l-link class="block" href="https://www.d2l.com">A really long link that will wrap in its container to the next line.</d2l-link>
|
|
73
|
-
</div>
|
|
74
|
-
</template>
|
|
75
|
-
</d2l-demo-snippet>
|
|
76
|
-
|
|
77
|
-
<h2>Clamp - One Line</h2>
|
|
78
|
-
<d2l-demo-snippet>
|
|
79
|
-
<template>
|
|
80
|
-
<div class="truncate-container">
|
|
81
|
-
<d2l-link href="https://www.d2l.com" lines="1">A really long link that will overflow its container and display an ellipsis.</d2l-link>
|
|
82
|
-
</div>
|
|
83
|
-
</template>
|
|
84
|
-
</d2l-demo-snippet>
|
|
85
|
-
|
|
86
|
-
<h2>Clamp - Two Lines</h2>
|
|
87
|
-
<d2l-demo-snippet>
|
|
88
|
-
<template>
|
|
89
|
-
<div class="truncate-container">
|
|
90
|
-
<d2l-link href="https://www.d2l.com" lines="2">A really really long link that wraps in its container and then truncates after two lines of text like this.</d2l-link>
|
|
91
|
-
</div>
|
|
92
|
-
</template>
|
|
93
|
-
</d2l-demo-snippet>
|
|
94
|
-
|
|
95
|
-
<h2>Disabled</h2>
|
|
96
|
-
<d2l-demo-snippet>
|
|
97
|
-
<template>
|
|
98
|
-
<d2l-link disabled href="https://www.d2l.com" target="_blank">Disabled Link</d2l-link>
|
|
99
|
-
</template>
|
|
100
|
-
</d2l-demo-snippet>
|
|
101
|
-
|
|
102
|
-
<h2>Disabled with Tooltip</h2>
|
|
103
|
-
<d2l-demo-snippet>
|
|
104
|
-
<template>
|
|
105
|
-
<d2l-link disabled disabled-tooltip="This link is disabled because you do not have permission" href="https://www.d2l.com" target="_blank">Disabled Link with Tooltip</d2l-link>
|
|
106
|
-
</template>
|
|
107
|
-
</d2l-demo-snippet>
|
|
108
|
-
|
|
109
|
-
</d2l-demo-page>
|
|
110
|
-
</body>
|
|
111
|
-
</html>
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import '../../icons/icon.js';
|
|
2
|
-
import '../list-item-content.js';
|
|
3
|
-
import '../list-item-nav.js';
|
|
4
|
-
import '../list.js';
|
|
5
|
-
import '../../tooltip/tooltip-help.js';
|
|
6
|
-
import { css, html, LitElement, nothing } from 'lit';
|
|
7
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
8
|
-
import { listDemos } from './list-demo-scenarios.js';
|
|
9
|
-
import { moveLocations } from '../list-item-drag-drop-mixin.js';
|
|
10
|
-
import { repeat } from 'lit/directives/repeat.js';
|
|
11
|
-
|
|
12
|
-
class ListDemoNav extends LitElement {
|
|
13
|
-
|
|
14
|
-
static get properties() {
|
|
15
|
-
return {
|
|
16
|
-
addButton: { type: Boolean, attribute: 'add-button' },
|
|
17
|
-
indentation: { type: Boolean },
|
|
18
|
-
_currentItem: { state: true }
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
static get styles() {
|
|
23
|
-
return [
|
|
24
|
-
css`
|
|
25
|
-
:host {
|
|
26
|
-
display: block;
|
|
27
|
-
max-width: 400px;
|
|
28
|
-
}
|
|
29
|
-
d2l-icon {
|
|
30
|
-
margin-right: 0.7rem;
|
|
31
|
-
}
|
|
32
|
-
d2l-tooltip-help {
|
|
33
|
-
padding: 5px;
|
|
34
|
-
}
|
|
35
|
-
`
|
|
36
|
-
];
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
constructor() {
|
|
40
|
-
super();
|
|
41
|
-
this.addButton = false;
|
|
42
|
-
this._currentItem = null;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
render() {
|
|
46
|
-
return html`
|
|
47
|
-
<div @d2l-list-items-move="${this._handleListItemsMove}">
|
|
48
|
-
<d2l-list
|
|
49
|
-
?add-button="${this.addButton}"
|
|
50
|
-
grid
|
|
51
|
-
drag-multiple
|
|
52
|
-
@d2l-list-item-link-click="${this._handleItemClick}">
|
|
53
|
-
${repeat(this.#list, (item) => item.key, (item) => this._renderItem(item))}
|
|
54
|
-
</d2l-list>
|
|
55
|
-
</div>
|
|
56
|
-
`;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
#list = listDemos.nav;
|
|
60
|
-
|
|
61
|
-
_handleItemClick(e) {
|
|
62
|
-
if (!e.target.expandable) {
|
|
63
|
-
this._currentItem = e.target;
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (this._currentItem !== e.target) {
|
|
68
|
-
e.target.expanded = true;
|
|
69
|
-
this._currentItem = e.target;
|
|
70
|
-
} else {
|
|
71
|
-
e.target.expanded = !e.target.expanded;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
async _handleListItemsMove(e) {
|
|
76
|
-
|
|
77
|
-
const sourceListItems = e.detail.sourceItems;
|
|
78
|
-
const target = e.detail.target;
|
|
79
|
-
|
|
80
|
-
// helper that gets the array containing item data, the item data, and the index within the array
|
|
81
|
-
const getItemInfo = (items, key) => {
|
|
82
|
-
for (let i = 0; i < items.length; i++) {
|
|
83
|
-
if (items[i].key === key) {
|
|
84
|
-
return { owner: items, item: items[i], index: i };
|
|
85
|
-
}
|
|
86
|
-
if (items[i].items && items[i].items.length > 0) {
|
|
87
|
-
const tempItemData = getItemInfo(items[i].items, key);
|
|
88
|
-
if (tempItemData) return tempItemData;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
const dataToMove = [];
|
|
94
|
-
|
|
95
|
-
// remove data elements from original locations
|
|
96
|
-
sourceListItems.forEach(sourceListItem => {
|
|
97
|
-
const info = getItemInfo(this.#list, sourceListItem.key);
|
|
98
|
-
if (info?.owner) {
|
|
99
|
-
info.owner.splice(info.index, 1);
|
|
100
|
-
}
|
|
101
|
-
if (info?.item) {
|
|
102
|
-
dataToMove.push(info.item);
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
// append data elements to new location
|
|
107
|
-
const targetInfo = getItemInfo(this.#list, target.item.key);
|
|
108
|
-
let targetItems;
|
|
109
|
-
let targetIndex;
|
|
110
|
-
if (target.location === moveLocations.nest) {
|
|
111
|
-
if (!targetInfo.item.items) targetInfo.item.items = [];
|
|
112
|
-
targetItems = targetInfo.item.items;
|
|
113
|
-
targetIndex = targetItems.length;
|
|
114
|
-
} else {
|
|
115
|
-
targetItems = targetInfo?.owner;
|
|
116
|
-
if (!targetItems) return;
|
|
117
|
-
if (target.location === moveLocations.above) targetIndex = targetInfo.index;
|
|
118
|
-
else if (target.location === moveLocations.below) targetIndex = targetInfo.index + 1;
|
|
119
|
-
}
|
|
120
|
-
for (let i = dataToMove.length - 1; i >= 0; i--) {
|
|
121
|
-
targetItems.splice(targetIndex, 0, dataToMove[i]);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
this.requestUpdate();
|
|
125
|
-
await this.updateComplete;
|
|
126
|
-
|
|
127
|
-
if (e.detail.keyboardActive) {
|
|
128
|
-
setTimeout(async() => {
|
|
129
|
-
if (!this.shadowRoot) return;
|
|
130
|
-
const newItem = this.shadowRoot.querySelector('d2l-list').getListItemByKey(sourceListItems[0].key);
|
|
131
|
-
await newItem.waitForUpdateComplete();
|
|
132
|
-
newItem.activateDragHandle();
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
_renderItem(item) {
|
|
138
|
-
const hasSubList = item.items && item.items.length > 0;
|
|
139
|
-
return html`
|
|
140
|
-
<d2l-list-item-nav
|
|
141
|
-
key="${ifDefined(item.key)}"
|
|
142
|
-
action-href="https://d2l.com"
|
|
143
|
-
draggable
|
|
144
|
-
drag-handle-text="${item.primaryText}"
|
|
145
|
-
color="${ifDefined(item.color)}"
|
|
146
|
-
?expandable="${hasSubList}"
|
|
147
|
-
?expanded="${hasSubList}"
|
|
148
|
-
indentation="${ifDefined(this.indentation ? '41' : undefined)}"
|
|
149
|
-
drop-nested
|
|
150
|
-
label="${item.primaryText}"
|
|
151
|
-
prevent-navigation>
|
|
152
|
-
<d2l-list-item-content>
|
|
153
|
-
<div>${item.hasIcon ? html`<d2l-icon icon="tier2:file-document"></d2l-icon>` : nothing}${item.primaryText}</div>
|
|
154
|
-
${item.tooltipOpenerText && item.tooltipText
|
|
155
|
-
? html`<div slot="secondary"><d2l-tooltip-help text="${item.tooltipOpenerText}">${item.tooltipText}</d2l-tooltip-help></div>`
|
|
156
|
-
: nothing
|
|
157
|
-
}
|
|
158
|
-
</d2l-list-item-content>
|
|
159
|
-
${hasSubList ? html`
|
|
160
|
-
<d2l-list slot="nested" grid ?add-button="${this.addButton}">
|
|
161
|
-
${repeat(item.items, (subItem) => subItem.key, (subItem) => this._renderItem(subItem))}
|
|
162
|
-
</d2l-list>`
|
|
163
|
-
: nothing
|
|
164
|
-
}
|
|
165
|
-
</d2l-list-item-nav>
|
|
166
|
-
`;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
customElements.define('d2l-demo-list-nav', ListDemoNav);
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import '../../colors/colors.js';
|
|
2
|
-
import '../list-item-content.js';
|
|
3
|
-
import '../list-item.js';
|
|
4
|
-
import '../list.js';
|
|
5
|
-
import { css, html, LitElement, nothing } from 'lit';
|
|
6
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
7
|
-
|
|
8
|
-
class ListNestedIterationsHelper extends LitElement {
|
|
9
|
-
static get properties() {
|
|
10
|
-
return {
|
|
11
|
-
isDraggable: { attribute: 'is-draggable', type: Boolean },
|
|
12
|
-
separators: { type: String }
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
static get styles() {
|
|
17
|
-
return css`
|
|
18
|
-
:host {
|
|
19
|
-
display: block;
|
|
20
|
-
}
|
|
21
|
-
table {
|
|
22
|
-
border-collapse: collapse;
|
|
23
|
-
font-size: 0.8rem;
|
|
24
|
-
table-layout: fixed;
|
|
25
|
-
width: 100%;
|
|
26
|
-
}
|
|
27
|
-
table > * > tr > * {
|
|
28
|
-
border: 1px solid var(--d2l-color-mica);
|
|
29
|
-
font-weight: 400;
|
|
30
|
-
height: 41px;
|
|
31
|
-
padding: 0.5rem 1rem;
|
|
32
|
-
text-align: start;
|
|
33
|
-
vertical-align: middle;
|
|
34
|
-
}
|
|
35
|
-
table > * > tr > td {
|
|
36
|
-
vertical-align: top;
|
|
37
|
-
}
|
|
38
|
-
table > thead > tr > th,
|
|
39
|
-
table > * > tr.header > th {
|
|
40
|
-
background-color: var(--d2l-color-regolith);
|
|
41
|
-
font-size: 0.7rem;
|
|
42
|
-
height: 27px;
|
|
43
|
-
line-height: 0.9rem;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
d2l-list:not([slot="nested"]) {
|
|
47
|
-
border: solid 1px black;
|
|
48
|
-
margin: 1rem;
|
|
49
|
-
padding: 1rem;
|
|
50
|
-
}
|
|
51
|
-
.minimize-width {
|
|
52
|
-
width: 4.5rem;
|
|
53
|
-
}
|
|
54
|
-
`;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
constructor() {
|
|
58
|
-
super();
|
|
59
|
-
this.isDraggable = false;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
render() {
|
|
63
|
-
const selectableOptions = [
|
|
64
|
-
{ name: 'All are Selectable', parent: true, child: true },
|
|
65
|
-
{ name: 'None are Selectable', parent: false, child: false },
|
|
66
|
-
{ name: 'Children Selectable (Parent Not)', parent: false, child: true },
|
|
67
|
-
{ name: 'Parent Selectable (Children Not)', parent: true, child: false }
|
|
68
|
-
];
|
|
69
|
-
|
|
70
|
-
const tableRows = selectableOptions.map(option => html`
|
|
71
|
-
<tr class="header">
|
|
72
|
-
<th rowspan="4" scope="rowgroup">${option.name}</th>
|
|
73
|
-
<th scope="row">Exp/Collapsible Children</th>
|
|
74
|
-
<td>${this._createList([option.parent, true], [option.child, true])}</td>
|
|
75
|
-
<td>${this._createList([option.parent, false], [option.child, true])}</td>
|
|
76
|
-
</tr>
|
|
77
|
-
<tr class="header">
|
|
78
|
-
<th scope="row">Non-Exp/Collapsible Children</th>
|
|
79
|
-
<td>${this._createList([option.parent, true], [option.child, false])}</td>
|
|
80
|
-
<td>${this._createList([option.parent, false], [option.child, false])}</td>
|
|
81
|
-
</tr>
|
|
82
|
-
<tr class="header">
|
|
83
|
-
<th scope="row">Color on Some</th>
|
|
84
|
-
<td>${this._createList([option.parent, true, true], [option.child, true, true])}</td>
|
|
85
|
-
<td>${this._createList([option.parent, false, true], [option.child, true, true])}</td>
|
|
86
|
-
</tr>
|
|
87
|
-
<tr class="header">
|
|
88
|
-
<th scope="row">Color on All</th>
|
|
89
|
-
<td>${this._createList([option.parent, true, false, true], [option.child, true, false, true])}</td>
|
|
90
|
-
<td>${this._createList([option.parent, false, false, true], [option.child, true, false, true])}</td>
|
|
91
|
-
</tr>
|
|
92
|
-
`);
|
|
93
|
-
|
|
94
|
-
return html`
|
|
95
|
-
<table>
|
|
96
|
-
<thead>
|
|
97
|
-
<tr>
|
|
98
|
-
<th class="minimize-width"></th>
|
|
99
|
-
<th class="minimize-width"></th>
|
|
100
|
-
<th scope="col">Exp/Collapsible Parent</th>
|
|
101
|
-
<th scope="col">Non-Exp/Collapsible Parent</th>
|
|
102
|
-
</tr>
|
|
103
|
-
</thead>
|
|
104
|
-
<tbody>
|
|
105
|
-
${tableRows}
|
|
106
|
-
</tbody>
|
|
107
|
-
</table>
|
|
108
|
-
`;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
_createList(parentOptions, childrenOptions) {
|
|
112
|
-
return html`
|
|
113
|
-
<d2l-list separators=${ifDefined(this.separators)}>
|
|
114
|
-
${this._getParentItems(parentOptions, this._getChildItems(childrenOptions))}
|
|
115
|
-
</d2l-list>
|
|
116
|
-
`;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* childOptions:
|
|
121
|
-
* - 0: Selectable
|
|
122
|
-
* - 1: Expandable
|
|
123
|
-
* - 2: Color on first items
|
|
124
|
-
* - 3: Color on all items
|
|
125
|
-
*/
|
|
126
|
-
_getChildItems(childOptions) {
|
|
127
|
-
const childL2Text = 'L2 List Item';
|
|
128
|
-
const childL3Text = 'L3 List Item';
|
|
129
|
-
const items = [];
|
|
130
|
-
|
|
131
|
-
for (let i = 0; i < 3; i++) {
|
|
132
|
-
const childKey = `child-${i}-${childOptions[0]}-${childOptions[1]}`;
|
|
133
|
-
items.push(html`
|
|
134
|
-
<d2l-list-item key="${childKey}" label="${childL2Text}" ?selectable="${!!childOptions[0]}" ?draggable="${this.isDraggable}" ?expandable="${childOptions[1] && i !== 1}" color="${ifDefined((childOptions[2] && i === 0) || childOptions[3] ? '#ff0000' : undefined)}">
|
|
135
|
-
<d2l-list-item-content>${childL2Text}</d2l-list-item-content>
|
|
136
|
-
${i === 1 || !childOptions[1] ? nothing : html`
|
|
137
|
-
<d2l-list slot="nested" separators=${ifDefined(this.separators)}>
|
|
138
|
-
<d2l-list-item key="${`${childKey}-child`}" label="${childL3Text}" ?selectable="${!!childOptions[0]}" ?draggable="${this.isDraggable}" color="${ifDefined(childOptions[3] ? '#00ff00' : undefined)}">
|
|
139
|
-
<d2l-list-item-content>${childL3Text}</d2l-list-item-content>
|
|
140
|
-
</d2l-list-item>
|
|
141
|
-
</d2l-list>
|
|
142
|
-
`}
|
|
143
|
-
</d2l-list-item>
|
|
144
|
-
`);
|
|
145
|
-
}
|
|
146
|
-
return items;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
_getParentItems(parentOptions, nested) {
|
|
150
|
-
const parentText = 'L1 List Item';
|
|
151
|
-
const items = [];
|
|
152
|
-
|
|
153
|
-
for (let i = 0; i < 3; i++) {
|
|
154
|
-
const parentKey = `parent-${i}-${parentOptions[0]}-${parentOptions[1]}`;
|
|
155
|
-
items.push(html`
|
|
156
|
-
<d2l-list-item key="${parentKey}" label="${parentText}" ?selectable="${!!parentOptions[0]}" ?draggable="${this.isDraggable}" ?expandable="${parentOptions[1] && i !== 1}" ?expanded="${parentOptions[1] && i === 0}" color="${ifDefined((parentOptions[2] && i === 0) || parentOptions[3] ? '#ff0000' : undefined)}">
|
|
157
|
-
<d2l-list-item-content>${parentText}</d2l-list-item-content>
|
|
158
|
-
${i === 1 || (i === 2 && !parentOptions[1]) ? nothing : html`
|
|
159
|
-
<d2l-list slot="nested" separators=${ifDefined(this.separators)}>${nested}</d2l-list>
|
|
160
|
-
`}
|
|
161
|
-
</d2l-list-item>
|
|
162
|
-
`);
|
|
163
|
-
}
|
|
164
|
-
return items;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
customElements.define('d2l-demo-list-nested-iterations-helper', ListNestedIterationsHelper);
|