@brightspace-ui/core 3.227.4 → 3.227.6
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-icon.js +10 -10
- 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/components/filter/filter-dimension-set-date-time-range-value.js +2 -1
- package/components/filter/filter-dimension-set.js +1 -1
- package/components/filter/filter.js +2 -1
- 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
|
@@ -49,8 +49,8 @@ class ButtonIcon extends SlottedIconMixin(PropertyRequiredMixin(ThemeMixin(Butto
|
|
|
49
49
|
return [super.styles, buttonStyles, visibleOnAncestorStyles,
|
|
50
50
|
css`
|
|
51
51
|
:host {
|
|
52
|
-
--d2l-button-icon-background-color-default:
|
|
53
|
-
--d2l-button-icon-background-color-hover-default: var(--d2l-color-
|
|
52
|
+
--d2l-button-icon-background-color-default: var(--d2l-theme-background-color-interactive-tertiary-default);
|
|
53
|
+
--d2l-button-icon-background-color-hover-default: var(--d2l-theme-background-color-interactive-tertiary-hover);
|
|
54
54
|
--d2l-button-icon-border-radius-default: 0.3rem;
|
|
55
55
|
--d2l-button-icon-min-height-default: calc(2rem + 2px);
|
|
56
56
|
--d2l-button-icon-min-width-default: calc(2rem + 2px);
|
|
@@ -62,12 +62,12 @@ class ButtonIcon extends SlottedIconMixin(PropertyRequiredMixin(ThemeMixin(Butto
|
|
|
62
62
|
display: none;
|
|
63
63
|
}
|
|
64
64
|
:host([translucent]) {
|
|
65
|
-
--d2l-button-icon-background-color-default:
|
|
66
|
-
--d2l-button-icon-background-color-hover-default: var(--d2l-color-
|
|
67
|
-
--d2l-focus-ring-color:
|
|
65
|
+
--d2l-button-icon-background-color-default: var(--d2l-theme-background-color-interactive-translucent-default);
|
|
66
|
+
--d2l-button-icon-background-color-hover-default: var(--d2l-theme-background-color-interactive-translucent-hover);
|
|
67
|
+
--d2l-focus-ring-color: var(--d2l-theme-icon-color-inverted);
|
|
68
68
|
--d2l-focus-ring-offset: -4px;
|
|
69
|
-
--d2l-button-icon-fill-color:
|
|
70
|
-
--d2l-button-icon-fill-color-hover:
|
|
69
|
+
--d2l-button-icon-fill-color: var(--d2l-theme-icon-color-inverted);
|
|
70
|
+
--d2l-button-icon-fill-color-hover: var(--d2l-theme-icon-color-inverted);
|
|
71
71
|
}
|
|
72
72
|
:host([theme="dark"]) {
|
|
73
73
|
--d2l-button-icon-background-color-default: transparent;
|
|
@@ -103,13 +103,13 @@ class ButtonIcon extends SlottedIconMixin(PropertyRequiredMixin(ThemeMixin(Butto
|
|
|
103
103
|
button:hover:not([disabled]),
|
|
104
104
|
button:focus:not([disabled]),
|
|
105
105
|
:host([active]) button:not([disabled]) {
|
|
106
|
-
--d2l-button-icon-fill-color: var(--d2l-button-icon-fill-color-hover, var(--d2l-color-
|
|
106
|
+
--d2l-button-icon-fill-color: var(--d2l-button-icon-fill-color-hover, var(--d2l-theme-icon-color-standard));
|
|
107
107
|
background-color: var(--d2l-button-icon-background-color-hover, var(--d2l-button-icon-background-color-hover-default));
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
d2l-icon,
|
|
111
111
|
slot[name="icon"]::slotted(d2l-icon-custom) {
|
|
112
|
-
color: var(--d2l-button-icon-fill-color, var(--d2l-color-
|
|
112
|
+
color: var(--d2l-button-icon-fill-color, var(--d2l-theme-icon-color-standard));
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
:host([translucent]) button {
|
|
@@ -122,7 +122,7 @@ class ButtonIcon extends SlottedIconMixin(PropertyRequiredMixin(ThemeMixin(Butto
|
|
|
122
122
|
|
|
123
123
|
:host([disabled]) button {
|
|
124
124
|
cursor: default;
|
|
125
|
-
opacity:
|
|
125
|
+
opacity: var(--d2l-theme-opacity-disabled-control);
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -57,14 +57,14 @@ class Button extends ButtonMixin(LitElement) {
|
|
|
57
57
|
button[disabled]:hover,
|
|
58
58
|
button[disabled]:focus,
|
|
59
59
|
:host([active]) button[disabled] {
|
|
60
|
-
background-color: var(--d2l-color-
|
|
61
|
-
color: var(--d2l-color-
|
|
60
|
+
background-color: var(--d2l-theme-background-color-interactive-secondary-default);
|
|
61
|
+
color: var(--d2l-theme-text-color-static-standard);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
button:hover,
|
|
65
65
|
button:focus,
|
|
66
66
|
:host([active]) button {
|
|
67
|
-
background-color: var(--d2l-color-
|
|
67
|
+
background-color: var(--d2l-theme-background-color-interactive-secondary-hover);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
:host([disabled]) button {
|
|
@@ -72,11 +72,11 @@ class Button extends ButtonMixin(LitElement) {
|
|
|
72
72
|
position: relative;
|
|
73
73
|
}
|
|
74
74
|
:host([disabled]) button::before {
|
|
75
|
-
background-color:
|
|
75
|
+
background-color: var(--d2l-theme-background-color-base);
|
|
76
76
|
border-radius: inherit;
|
|
77
77
|
content: "";
|
|
78
78
|
inset: 0;
|
|
79
|
-
opacity:
|
|
79
|
+
opacity: var(--d2l-theme-opacity-disabled-control);
|
|
80
80
|
position: absolute;
|
|
81
81
|
}
|
|
82
82
|
|
|
@@ -84,13 +84,13 @@ class Button extends ButtonMixin(LitElement) {
|
|
|
84
84
|
:host([primary]) button[disabled]:hover,
|
|
85
85
|
:host([primary]) button[disabled]:focus,
|
|
86
86
|
:host([primary][active]) button[disabled] {
|
|
87
|
-
background-color: var(--d2l-color-
|
|
88
|
-
color:
|
|
87
|
+
background-color: var(--d2l-theme-background-color-interactive-primary-default);
|
|
88
|
+
color: var(--d2l-theme-text-color-static-inverted);
|
|
89
89
|
}
|
|
90
90
|
:host([primary]) button:hover,
|
|
91
91
|
:host([primary]) button:focus,
|
|
92
92
|
:host([primary][active]) button {
|
|
93
|
-
background-color: var(--d2l-color-
|
|
93
|
+
background-color: var(--d2l-theme-background-color-interactive-primary-hover);
|
|
94
94
|
}
|
|
95
95
|
`
|
|
96
96
|
];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import '../demo-page-settings.js';
|
|
2
|
+
|
|
3
|
+
import { expect, fixture, html, oneEvent, runConstructor } from '@brightspace-ui/testing';
|
|
4
|
+
|
|
5
|
+
describe('d2l-demo-page-settings', () => {
|
|
6
|
+
|
|
7
|
+
describe('constructor', () => {
|
|
8
|
+
it('should construct', () => {
|
|
9
|
+
runConstructor('d2l-demo-page-settings');
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
describe('language select', () => {
|
|
14
|
+
it('updates the documentElement language on change', async() => {
|
|
15
|
+
const elem = await fixture(html`<d2l-demo-page-settings></d2l-demo-page-settings>`);
|
|
16
|
+
const select = elem.shadowRoot.querySelector('select');
|
|
17
|
+
select.value = 'ko-kr';
|
|
18
|
+
setTimeout(() => select.dispatchEvent(new Event('change')));
|
|
19
|
+
await oneEvent(select, 'change');
|
|
20
|
+
expect(document.documentElement.lang).to.equal('ko-kr');
|
|
21
|
+
expect(document.documentElement.matches('*:lang(ko)')).to.be.true;
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import '../demo-page.js';
|
|
2
|
+
|
|
3
|
+
import { expect, runConstructor } from '@brightspace-ui/testing';
|
|
4
|
+
|
|
5
|
+
describe('d2l-demo-page', () => {
|
|
6
|
+
|
|
7
|
+
describe('constructor', () => {
|
|
8
|
+
it('should construct', () => {
|
|
9
|
+
runConstructor('d2l-demo-page');
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('should set isD2LDemoPage', () => {
|
|
14
|
+
expect(window.isD2LDemoPage).to.be.true;
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
});
|
|
@@ -70,7 +70,7 @@ class FilterDimensionSetDateTimeRangeValue extends LocalizeCoreElement(LitElemen
|
|
|
70
70
|
this._dispatchFilterChangeEvent = false;
|
|
71
71
|
this._enforceSingleSelection = true;
|
|
72
72
|
this._filterSetValue = true;
|
|
73
|
-
this._minWidth =
|
|
73
|
+
this._minWidth = 410;
|
|
74
74
|
this._noSearchSupport = true;
|
|
75
75
|
|
|
76
76
|
this._handleDateChange = this._handleDateChange.bind(this);
|
|
@@ -122,6 +122,7 @@ class FilterDimensionSetDateTimeRangeValue extends LocalizeCoreElement(LitElemen
|
|
|
122
122
|
selected: this.selected,
|
|
123
123
|
text: this.text,
|
|
124
124
|
valueText: this.valueText,
|
|
125
|
+
minWidth: this._minWidth,
|
|
125
126
|
additionalContent: this._getAdditionalContent.bind(this),
|
|
126
127
|
getAdditionalEventDetails: this._getAdditionalEventDetails.bind(this),
|
|
127
128
|
clearProperties: this._clearProperties.bind(this)
|
|
@@ -151,7 +151,7 @@ class FilterDimensionSet extends LitElement {
|
|
|
151
151
|
const values = valueNodes.map(value => {
|
|
152
152
|
if (value._noSearchSupport) noSearchSupport = true;
|
|
153
153
|
if (value._enforceSingleSelection) enforceSingleSelection = true;
|
|
154
|
-
if (value._minWidth) minWidth = value._minWidth;
|
|
154
|
+
if (value._minWidth) minWidth = minWidth ? Math.max(value._minWidth, minWidth) : value._minWidth;
|
|
155
155
|
|
|
156
156
|
return value.getValueDetails();
|
|
157
157
|
});
|
|
@@ -574,7 +574,7 @@ class Filter extends FocusMixin(LocalizeCoreElement(LitElement)) {
|
|
|
574
574
|
`;
|
|
575
575
|
}
|
|
576
576
|
|
|
577
|
-
if (dimension.minWidth) this._minWidth = dimension.minWidth;
|
|
577
|
+
if (dimension.minWidth) this._minWidth = Math.max(dimension.minWidth, this._minWidth);
|
|
578
578
|
if (this._isDimensionEmpty(dimension)) {
|
|
579
579
|
const emptyState = dimension.setEmptyState
|
|
580
580
|
? this._createEmptyState(dimension.setEmptyState, dimension.key)
|
|
@@ -842,6 +842,7 @@ class Filter extends FocusMixin(LocalizeCoreElement(LitElement)) {
|
|
|
842
842
|
if (dimension.searchValue || dimension.searchType === 'manual') shouldSearch = true;
|
|
843
843
|
shouldRecount = true;
|
|
844
844
|
this._activeFiltersSubscribers.updateSubscribers();
|
|
845
|
+
newValue.forEach((field) => this._minWidth = field.minWidth ? Math.max(field.minWidth, this._minWidth) : this._minWidth);
|
|
845
846
|
} else if (prop === 'text') {
|
|
846
847
|
this._activeFiltersSubscribers.updateSubscribers();
|
|
847
848
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "3.227.
|
|
3
|
+
"version": "3.227.6",
|
|
4
4
|
"description": "A collection of accessible, free, open-source web components for building Brightspace applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": "https://github.com/BrightspaceUI/core.git",
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
-
<meta charset="UTF-8">
|
|
7
|
-
<link rel="stylesheet" href="../../demo/styles.css" type="text/css">
|
|
8
|
-
<script type="module">
|
|
9
|
-
import '../../button/button.js';
|
|
10
|
-
import '../../demo/demo-page.js';
|
|
11
|
-
import '../alert-toast.js';
|
|
12
|
-
</script>
|
|
13
|
-
<style>
|
|
14
|
-
d2l-button {
|
|
15
|
-
padding-bottom: 1rem;
|
|
16
|
-
}
|
|
17
|
-
</style>
|
|
18
|
-
</head>
|
|
19
|
-
|
|
20
|
-
<body unresolved>
|
|
21
|
-
|
|
22
|
-
<d2l-demo-page page-title="d2l-alert-toast">
|
|
23
|
-
|
|
24
|
-
<h2>Default</h2>
|
|
25
|
-
<d2l-demo-snippet>
|
|
26
|
-
<template>
|
|
27
|
-
<d2l-alert-toast id="toast1">A default toast alert.</d2l-alert-toast>
|
|
28
|
-
<d2l-button primary data-toast="toast1">Open alert</d2l-button>
|
|
29
|
-
</template>
|
|
30
|
-
</d2l-demo-snippet>
|
|
31
|
-
|
|
32
|
-
<h2>Without Auto-Close</h2>
|
|
33
|
-
<d2l-demo-snippet>
|
|
34
|
-
<template>
|
|
35
|
-
<d2l-alert-toast id="toast2" no-auto-close >A default toast alert without autoclose.</d2l-alert-toast>
|
|
36
|
-
<d2l-button primary data-toast="toast2">Open alert</d2l-button>
|
|
37
|
-
</template>
|
|
38
|
-
</d2l-demo-snippet>
|
|
39
|
-
|
|
40
|
-
<h2>Without Close Button</h2>
|
|
41
|
-
<d2l-demo-snippet>
|
|
42
|
-
<template>
|
|
43
|
-
<d2l-alert-toast id="toast3" hide-close-button>A default toast alert without close button.</d2l-alert-toast>
|
|
44
|
-
<d2l-button primary data-toast="toast3">Open alert</d2l-button>
|
|
45
|
-
</template>
|
|
46
|
-
</d2l-demo-snippet>
|
|
47
|
-
|
|
48
|
-
<h2>With Subtext and Button</h2>
|
|
49
|
-
<d2l-demo-snippet>
|
|
50
|
-
<template>
|
|
51
|
-
<d2l-alert-toast id="toast4" type="success" button-text="Do it!"
|
|
52
|
-
subtext="I am subtext. I'm here to test the wrapping capabilities of adding subtext to these alerts, as well as other styling issues. Feel free to add to me!">
|
|
53
|
-
A message.
|
|
54
|
-
</d2l-alert-toast>
|
|
55
|
-
<d2l-button primary data-toast="toast4">Open alert</d2l-button>
|
|
56
|
-
</template>
|
|
57
|
-
</d2l-demo-snippet>
|
|
58
|
-
|
|
59
|
-
<h2>Multiple Alerts</h2>
|
|
60
|
-
<d2l-demo-snippet>
|
|
61
|
-
<template>
|
|
62
|
-
<d2l-alert-toast id="toast5" no-auto-close>A default toast alert.</d2l-alert-toast>
|
|
63
|
-
<d2l-button primary data-toast="toast5">Open alert</d2l-button>
|
|
64
|
-
|
|
65
|
-
<d2l-alert-toast id="toast6" no-auto-close>A default toast alert.</d2l-alert-toast>
|
|
66
|
-
<d2l-button primary data-toast="toast6">Open alert</d2l-button>
|
|
67
|
-
|
|
68
|
-
<d2l-alert-toast id="toast7" no-auto-close>A default toast alert.</d2l-alert-toast>
|
|
69
|
-
<d2l-button primary data-toast="toast7">Open alert</d2l-button>
|
|
70
|
-
|
|
71
|
-
<d2l-alert-toast id="toast8" type="success" button-text="Do it!" no-auto-close
|
|
72
|
-
subtext="I am subtext. I'm here to test the wrapping capabilities of adding subtext to these alerts, as well as other styling issues. Feel free to add to me!">
|
|
73
|
-
A message.
|
|
74
|
-
</d2l-alert-toast>
|
|
75
|
-
<d2l-button primary data-toast="toast8">Open alert</d2l-button>
|
|
76
|
-
</template>
|
|
77
|
-
</d2l-demo-snippet>
|
|
78
|
-
</d2l-demo-page>
|
|
79
|
-
|
|
80
|
-
</body>
|
|
81
|
-
<script type="module">
|
|
82
|
-
function openToast(toastId) {
|
|
83
|
-
document.getElementById(toastId).setAttribute('open', '');
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
window.requestAnimationFrame(() => {
|
|
87
|
-
const buttons = document.querySelectorAll('d2l-button');
|
|
88
|
-
buttons.forEach((button) => {
|
|
89
|
-
button.addEventListener('click', () => {
|
|
90
|
-
const toast = button.getAttribute('data-toast');
|
|
91
|
-
openToast(toast);
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
const buttonAlertToast = document.querySelector('#toast4');
|
|
97
|
-
buttonAlertToast.addEventListener('d2l-alert-toast-button-press', (e) => {
|
|
98
|
-
console.log('d2l-alert-toast-button-press', e);
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
document.body.addEventListener('d2l-alert-toast-close', (e) => {
|
|
102
|
-
console.log('d2l-alert-toast-close', e);
|
|
103
|
-
});
|
|
104
|
-
</script>
|
|
105
|
-
|
|
106
|
-
</html>
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
-
<meta charset="UTF-8">
|
|
7
|
-
<link rel="stylesheet" href="../../demo/styles.css" type="text/css">
|
|
8
|
-
<script type="module">
|
|
9
|
-
import '../../demo/demo-page.js';
|
|
10
|
-
import '../alert.js';
|
|
11
|
-
</script>
|
|
12
|
-
</head>
|
|
13
|
-
|
|
14
|
-
<body unresolved>
|
|
15
|
-
|
|
16
|
-
<d2l-demo-page page-title="d2l-alert">
|
|
17
|
-
|
|
18
|
-
<h2>Default</h2>
|
|
19
|
-
<d2l-demo-snippet>
|
|
20
|
-
<template>
|
|
21
|
-
<d2l-alert type="default">A default message.</d2l-alert>
|
|
22
|
-
</template>
|
|
23
|
-
</d2l-demo-snippet>
|
|
24
|
-
|
|
25
|
-
<h2>Success</h2>
|
|
26
|
-
<d2l-demo-snippet>
|
|
27
|
-
<template>
|
|
28
|
-
<d2l-alert type="success">A success message.</d2l-alert>
|
|
29
|
-
</template>
|
|
30
|
-
</d2l-demo-snippet>
|
|
31
|
-
|
|
32
|
-
<h2>Critical</h2>
|
|
33
|
-
<d2l-demo-snippet>
|
|
34
|
-
<template>
|
|
35
|
-
<d2l-alert type="critical">A critical message.</d2l-alert>
|
|
36
|
-
</template>
|
|
37
|
-
</d2l-demo-snippet>
|
|
38
|
-
|
|
39
|
-
<h2>Warning</h2>
|
|
40
|
-
<d2l-demo-snippet>
|
|
41
|
-
<template>
|
|
42
|
-
<d2l-alert type="warning">A warning message.</d2l-alert>
|
|
43
|
-
</template>
|
|
44
|
-
</d2l-demo-snippet>
|
|
45
|
-
|
|
46
|
-
<h2>With Close Button</h2>
|
|
47
|
-
<d2l-demo-snippet>
|
|
48
|
-
<template>
|
|
49
|
-
<d2l-alert type="default" has-close-button>A message.</d2l-alert>
|
|
50
|
-
</template>
|
|
51
|
-
</d2l-demo-snippet>
|
|
52
|
-
|
|
53
|
-
<h2>With Action Button</h2>
|
|
54
|
-
<d2l-demo-snippet>
|
|
55
|
-
<template>
|
|
56
|
-
<d2l-alert type="default" button-text="Do it!" has-close-button>A message.</d2l-alert>
|
|
57
|
-
</template>
|
|
58
|
-
</d2l-demo-snippet>
|
|
59
|
-
|
|
60
|
-
<h2>With Subtext</h2>
|
|
61
|
-
<d2l-demo-snippet>
|
|
62
|
-
<template>
|
|
63
|
-
<d2l-alert type="default" button-text="Do it!" has-close-button
|
|
64
|
-
subtext="I am subtext. I'm here to test the wrapping capabilities of adding subtext to these alerts, as well as other styling issues. Feel free to add to me!">
|
|
65
|
-
A message.
|
|
66
|
-
</d2l-alert>
|
|
67
|
-
</template>
|
|
68
|
-
</d2l-demo-snippet>
|
|
69
|
-
|
|
70
|
-
</d2l-demo-page>
|
|
71
|
-
|
|
72
|
-
<script type="module">
|
|
73
|
-
document.body.addEventListener('d2l-alert-close', (e) => {
|
|
74
|
-
console.log('d2l-alert-close', e);
|
|
75
|
-
});
|
|
76
|
-
document.body.addEventListener('d2l-alert-button-press', (e) => {
|
|
77
|
-
console.log('d2l-alert-button-press', e);
|
|
78
|
-
});
|
|
79
|
-
</script>
|
|
80
|
-
</body>
|
|
81
|
-
|
|
82
|
-
</html>
|
|
@@ -1,166 +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 '../../button/button.js';
|
|
10
|
-
import '../backdrop-loading.js';
|
|
11
|
-
</script>
|
|
12
|
-
<style>
|
|
13
|
-
th, td {
|
|
14
|
-
border-bottom: 1px solid #dddddd;
|
|
15
|
-
padding: 30px;
|
|
16
|
-
text-align: left;
|
|
17
|
-
}
|
|
18
|
-
#grade-container {
|
|
19
|
-
position: relative;
|
|
20
|
-
width: fit-content;
|
|
21
|
-
}
|
|
22
|
-
</style>
|
|
23
|
-
</head>
|
|
24
|
-
<body unresolved>
|
|
25
|
-
<d2l-demo-page page-title="d2l-backdrop">
|
|
26
|
-
<d2l-demo-snippet>
|
|
27
|
-
<template>
|
|
28
|
-
<div id="target"><d2l-button primary>Refresh Content</d2l-button></div>
|
|
29
|
-
<div id="grade-container">
|
|
30
|
-
<table>
|
|
31
|
-
<thead>
|
|
32
|
-
<th>Course</th>
|
|
33
|
-
<th>Grade</th>
|
|
34
|
-
<th>Hours Spent in Content</th>
|
|
35
|
-
</thead>
|
|
36
|
-
<tr>
|
|
37
|
-
<td>Math</td>
|
|
38
|
-
<td class="grade">85%</td>
|
|
39
|
-
<td>100</td>
|
|
40
|
-
</tr>
|
|
41
|
-
<tr>
|
|
42
|
-
<td>Math</td>
|
|
43
|
-
<td class="grade">85%</td>
|
|
44
|
-
<td>100</td>
|
|
45
|
-
</tr>
|
|
46
|
-
<tr>
|
|
47
|
-
<td>Math</td>
|
|
48
|
-
<td class="grade">85%</td>
|
|
49
|
-
<td>100</td>
|
|
50
|
-
</tr>
|
|
51
|
-
<tr>
|
|
52
|
-
<td>Math</td>
|
|
53
|
-
<td class="grade">85%</td>
|
|
54
|
-
<td>100</td>
|
|
55
|
-
</tr>
|
|
56
|
-
<tr>
|
|
57
|
-
<td>Math</td>
|
|
58
|
-
<td class="grade">85%</td>
|
|
59
|
-
<td>100</td>
|
|
60
|
-
</tr>
|
|
61
|
-
<tr>
|
|
62
|
-
<td>Math</td>
|
|
63
|
-
<td class="grade">85%</td>
|
|
64
|
-
<td>100</td>
|
|
65
|
-
</tr>
|
|
66
|
-
<tr>
|
|
67
|
-
<td>Math</td>
|
|
68
|
-
<td class="grade">85%</td>
|
|
69
|
-
<td>100</td>
|
|
70
|
-
</tr>
|
|
71
|
-
<tr>
|
|
72
|
-
<td>Math</td>
|
|
73
|
-
<td class="grade">85%</td>
|
|
74
|
-
<td>100</td>
|
|
75
|
-
</tr>
|
|
76
|
-
<tr>
|
|
77
|
-
<td>Math</td>
|
|
78
|
-
<td class="grade">85%</td>
|
|
79
|
-
<td>100</td>
|
|
80
|
-
</tr>
|
|
81
|
-
<tr>
|
|
82
|
-
<td>Math</td>
|
|
83
|
-
<td class="grade">85%</td>
|
|
84
|
-
<td>100</td>
|
|
85
|
-
</tr>
|
|
86
|
-
<tr>
|
|
87
|
-
<td>Math</td>
|
|
88
|
-
<td class="grade">85%</td>
|
|
89
|
-
<td>100</td>
|
|
90
|
-
</tr>
|
|
91
|
-
<tr>
|
|
92
|
-
<td>Math</td>
|
|
93
|
-
<td class="grade">85%</td>
|
|
94
|
-
<td>100</td>
|
|
95
|
-
</tr>
|
|
96
|
-
<tr>
|
|
97
|
-
<td>Math</td>
|
|
98
|
-
<td class="grade">85%</td>
|
|
99
|
-
<td>100</td>
|
|
100
|
-
</tr>
|
|
101
|
-
<tr>
|
|
102
|
-
<td>Math</td>
|
|
103
|
-
<td class="grade">85%</td>
|
|
104
|
-
<td>100</td>
|
|
105
|
-
</tr>
|
|
106
|
-
<tr>
|
|
107
|
-
<td>Math</td>
|
|
108
|
-
<td class="grade">85%</td>
|
|
109
|
-
<td>100</td>
|
|
110
|
-
</tr>
|
|
111
|
-
<tr>
|
|
112
|
-
<td>Math</td>
|
|
113
|
-
<td class="grade">85%</td>
|
|
114
|
-
<td>100</td>
|
|
115
|
-
</tr>
|
|
116
|
-
<tr>
|
|
117
|
-
<td>Math</td>
|
|
118
|
-
<td class="grade">85%</td>
|
|
119
|
-
<td>100</td>
|
|
120
|
-
</tr>
|
|
121
|
-
<tr>
|
|
122
|
-
<td>Math</td>
|
|
123
|
-
<td class="grade">85%</td>
|
|
124
|
-
<td>100</td>
|
|
125
|
-
</tr>
|
|
126
|
-
<tr>
|
|
127
|
-
<td>Math</td>
|
|
128
|
-
<td class="grade">85%</td>
|
|
129
|
-
<td>100</td>
|
|
130
|
-
</tr>
|
|
131
|
-
<tr>
|
|
132
|
-
<td>Math</td>
|
|
133
|
-
<td class="grade">85%</td>
|
|
134
|
-
<td>100</td>
|
|
135
|
-
</tr>
|
|
136
|
-
<tr>
|
|
137
|
-
<td>Math</td>
|
|
138
|
-
<td class="grade">85%</td>
|
|
139
|
-
<td>100</td>
|
|
140
|
-
</tr>
|
|
141
|
-
<tr>
|
|
142
|
-
<td>Art</td>
|
|
143
|
-
<td class="grade">98%</td>
|
|
144
|
-
<td>10</td>
|
|
145
|
-
</tr>
|
|
146
|
-
</table>
|
|
147
|
-
<d2l-backdrop-loading></d2l-backdrop-loading>
|
|
148
|
-
</div>
|
|
149
|
-
<script data-demo-hide>
|
|
150
|
-
const demo = document.currentScript.parentNode;
|
|
151
|
-
const loadingBackdrop = demo.querySelector('d2l-backdrop-loading');
|
|
152
|
-
demo.querySelector('#target > d2l-button').addEventListener('click', () => {
|
|
153
|
-
loadingBackdrop.shown = !loadingBackdrop.shown;
|
|
154
|
-
setTimeout(() => {
|
|
155
|
-
demo.querySelectorAll('.grade').forEach((grade) => {
|
|
156
|
-
grade.innerHTML = `${Math.round(Math.random() * 100).toString()}%`;
|
|
157
|
-
});
|
|
158
|
-
loadingBackdrop.shown = !loadingBackdrop.shown;
|
|
159
|
-
}, 5000);
|
|
160
|
-
});
|
|
161
|
-
</script>
|
|
162
|
-
</template>
|
|
163
|
-
</d2l-demo-snippet>
|
|
164
|
-
</d2l-demo-page>
|
|
165
|
-
</body>
|
|
166
|
-
</html>
|
|
@@ -1,57 +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 '../backdrop.js';
|
|
10
|
-
</script>
|
|
11
|
-
<style>
|
|
12
|
-
#target {
|
|
13
|
-
position: relative;
|
|
14
|
-
z-index: 1000;
|
|
15
|
-
}
|
|
16
|
-
</style>
|
|
17
|
-
</head>
|
|
18
|
-
<body unresolved>
|
|
19
|
-
|
|
20
|
-
<d2l-demo-page page-title="d2l-backdrop">
|
|
21
|
-
|
|
22
|
-
<h2>Backdrop</h2>
|
|
23
|
-
|
|
24
|
-
<d2l-demo-snippet>
|
|
25
|
-
<template>
|
|
26
|
-
<div id="target"><button>toggle backdrop</button></div>
|
|
27
|
-
<div>
|
|
28
|
-
<input type="checkbox" id="slow-transition" name="slow-transition">
|
|
29
|
-
<label for="slow-transition">slow transition</label>
|
|
30
|
-
</div>
|
|
31
|
-
<div>
|
|
32
|
-
<input type="checkbox" id="no-animate-hide" name="no-animate-hide">
|
|
33
|
-
<label for="no-animate-hide">no animation on hide</label>
|
|
34
|
-
</div>
|
|
35
|
-
<d2l-backdrop for-target="target"></d2l-backdrop>
|
|
36
|
-
<script>
|
|
37
|
-
const backdrop = document.querySelector('d2l-backdrop');
|
|
38
|
-
document.querySelector('#target > button').addEventListener('click', () => {
|
|
39
|
-
backdrop.shown = !backdrop.shown;
|
|
40
|
-
});
|
|
41
|
-
document.querySelector('#no-animate-hide').addEventListener('change', () => {
|
|
42
|
-
backdrop.noAnimateHide = !backdrop.noAnimateHide;
|
|
43
|
-
});
|
|
44
|
-
document.querySelector('#slow-transition').addEventListener('change', e => {
|
|
45
|
-
if (e.target.checked) {
|
|
46
|
-
backdrop.setAttribute('slow-transition', true);
|
|
47
|
-
} else {
|
|
48
|
-
backdrop.removeAttribute('slow-transition');
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
</script>
|
|
52
|
-
</template>
|
|
53
|
-
</d2l-demo-snippet>
|
|
54
|
-
|
|
55
|
-
</d2l-demo-page>
|
|
56
|
-
</body>
|
|
57
|
-
</html>
|
|
@@ -1,53 +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 '../breadcrumb.js';
|
|
10
|
-
import '../breadcrumb-current-page.js';
|
|
11
|
-
import '../breadcrumbs.js';
|
|
12
|
-
</script>
|
|
13
|
-
</head>
|
|
14
|
-
<body unresolved>
|
|
15
|
-
<d2l-demo-page page-title="d2l-breadcrumbs">
|
|
16
|
-
<h2>Basic</h2>
|
|
17
|
-
<d2l-demo-snippet>
|
|
18
|
-
<template>
|
|
19
|
-
<d2l-breadcrumbs>
|
|
20
|
-
<d2l-breadcrumb href="#" text="Basic Item 1"></d2l-breadcrumb>
|
|
21
|
-
<d2l-breadcrumb href="#" text="Basic Item 2"></d2l-breadcrumb>
|
|
22
|
-
<d2l-breadcrumb href="#" text="Basic Item 3"></d2l-breadcrumb>
|
|
23
|
-
</d2l-breadcrumbs>
|
|
24
|
-
</template>
|
|
25
|
-
</d2l-demo-snippet>
|
|
26
|
-
<h2>Ends with current page</h2>
|
|
27
|
-
<d2l-demo-snippet>
|
|
28
|
-
<template>
|
|
29
|
-
<d2l-breadcrumbs>
|
|
30
|
-
<d2l-breadcrumb href="#" text="Basic Item 1"></d2l-breadcrumb>
|
|
31
|
-
<d2l-breadcrumb href="#" text="Basic Item 2"></d2l-breadcrumb>
|
|
32
|
-
<d2l-breadcrumb-current-page text="Current Page"></d2l-breadcrumb-current-page>
|
|
33
|
-
</d2l-breadcrumbs>
|
|
34
|
-
</template>
|
|
35
|
-
</d2l-demo-snippet>
|
|
36
|
-
<h2>Basic Overflow d2l-breadcrumbs</h2>
|
|
37
|
-
<d2l-demo-snippet>
|
|
38
|
-
<d2l-breadcrumbs style="max-width: 250px;">
|
|
39
|
-
<d2l-breadcrumb href="#" text="Truncate Basic Item 1"></d2l-breadcrumb>
|
|
40
|
-
<d2l-breadcrumb href="#" text="Truncate Basic Item 2"></d2l-breadcrumb>
|
|
41
|
-
</d2l-breadcrumbs>
|
|
42
|
-
</d2l-demo-snippet>
|
|
43
|
-
<h2>Compact d2l-breadcrumbs</h2>
|
|
44
|
-
<d2l-demo-snippet>
|
|
45
|
-
<d2l-breadcrumbs compact>
|
|
46
|
-
<d2l-breadcrumb href="#" text="Compact Item 1"></d2l-breadcrumb>
|
|
47
|
-
<d2l-breadcrumb href="#" text="Compact Item 2"></d2l-breadcrumb>
|
|
48
|
-
<d2l-breadcrumb-current-page text="Current Page"></d2l-breadcrumb-current-page>
|
|
49
|
-
</d2l-breadcrumbs>
|
|
50
|
-
</d2l-demo-snippet>
|
|
51
|
-
</d2l-demo-page>
|
|
52
|
-
</body>
|
|
53
|
-
</html>
|