@brightspace-ui/core 2.102.0 → 2.104.0
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/README.md +7 -7
- package/components/alert/alert.js +1 -1
- package/components/breadcrumbs/breadcrumb.js +2 -2
- package/components/breadcrumbs/breadcrumbs.js +1 -1
- package/components/button/button-icon.js +3 -4
- package/components/button/button-mixin.js +1 -1
- package/components/button/button-move.js +245 -0
- package/components/button/button-subtle.js +1 -1
- package/components/button/demo/button-move.html +46 -0
- package/components/button/floating-buttons.js +1 -1
- package/components/calendar/calendar.js +1 -1
- package/components/card/card-footer-link.js +2 -2
- package/components/card/card.js +2 -2
- package/components/collapsible-panel/collapsible-panel.js +2 -2
- package/components/count-badge/count-badge-icon.js +1 -1
- package/components/count-badge/count-badge-mixin.js +1 -1
- package/components/count-badge/count-badge.js +1 -1
- package/components/dialog/dialog-mixin.js +1 -1
- package/components/dropdown/dropdown-button.js +1 -1
- package/components/dropdown/dropdown-content-mixin.js +1 -1
- package/components/dropdown/dropdown-context-menu.js +1 -1
- package/components/dropdown/dropdown-menu.js +1 -1
- package/components/dropdown/dropdown-more.js +1 -1
- package/components/empty-state/empty-state-simple.js +1 -1
- package/components/filter/filter-overflow-group.js +1 -1
- package/components/filter/filter.js +2 -2
- package/components/focus-trap/focus-trap.js +1 -1
- package/components/form/form-errory-summary.js +1 -1
- package/components/html-block/demo/html-block.html +1 -1
- package/components/html-block/html-block.js +1 -1
- package/components/icons/icon-custom.js +1 -1
- package/components/icons/icon.js +1 -1
- package/components/inputs/README.md +1 -1
- package/components/inputs/demo/input-radio-label-simple-test.js +1 -1
- package/components/inputs/demo/input-radio-label-test.js +1 -1
- package/components/inputs/demo/input-select-test.js +1 -1
- package/components/inputs/docs/input-radio.md +1 -1
- package/components/inputs/docs/input-select-styles.md +1 -1
- package/components/inputs/input-checkbox-spacer.js +1 -1
- package/components/inputs/input-checkbox.js +2 -2
- package/components/inputs/input-color.js +1 -1
- package/components/inputs/input-date-range.js +2 -2
- package/components/inputs/input-date-time-range.js +2 -2
- package/components/inputs/input-date-time.js +3 -3
- package/components/inputs/input-date.js +2 -2
- package/components/inputs/input-fieldset.js +1 -1
- package/components/inputs/input-number.js +2 -2
- package/components/inputs/input-percent.js +3 -3
- package/components/inputs/input-radio-spacer.js +1 -1
- package/components/inputs/input-search.js +2 -2
- package/components/inputs/input-text.js +3 -3
- package/components/inputs/input-textarea.js +3 -3
- package/components/inputs/input-time-range.js +2 -2
- package/components/inputs/input-time.js +2 -2
- package/components/link/link.js +1 -1
- package/components/list/list-item-drag-handle.js +94 -126
- package/components/list/list-item-drag-image.js +1 -1
- package/components/list/list-item-generic-layout.js +2 -3
- package/components/list/list-item-mixin.js +2 -2
- package/components/list/list-item-placement-marker.js +1 -1
- package/components/menu/menu-item-checkbox.js +1 -1
- package/components/menu/menu-item-radio.js +1 -1
- package/components/menu/menu-item-return.js +1 -1
- package/components/menu/menu.js +1 -1
- package/components/meter/meter-circle.js +1 -1
- package/components/meter/meter-linear.js +1 -1
- package/components/meter/meter-radial.js +1 -1
- package/components/object-property-list/object-property-list-item-link.js +1 -1
- package/components/offscreen/offscreen.js +1 -1
- package/components/overflow-group/overflow-group.js +1 -1
- package/components/paging/pager-load-more.js +1 -1
- package/components/scroll-wrapper/demo/scroll-wrapper-test.js +1 -1
- package/components/scroll-wrapper/scroll-wrapper.js +1 -1
- package/components/selection/selection-action-dropdown.js +1 -1
- package/components/selection/selection-action.js +1 -1
- package/components/selection/selection-controls.js +1 -1
- package/components/selection/selection-input.js +1 -1
- package/components/selection/selection-mixin.js +1 -1
- package/components/selection/selection-select-all-pages.js +1 -1
- package/components/selection/selection-select-all.js +1 -1
- package/components/skeleton/skeleton-mixin.js +1 -1
- package/components/switch/switch-mixin.js +2 -2
- package/components/table/demo/table-test.js +1 -1
- package/components/table/table-col-sort-button.js +1 -1
- package/components/table/table-wrapper.js +1 -1
- package/components/tabs/tab-internal.js +1 -1
- package/components/tabs/tabs.js +2 -2
- package/components/tag-list/tag-list-item-mixin.js +1 -1
- package/components/tag-list/tag-list.js +2 -2
- package/components/tooltip/tooltip-help.js +1 -1
- package/components/tooltip/tooltip.js +1 -1
- package/custom-elements.json +60 -0
- package/helpers/demo/prism.html +3 -3
- package/mixins/{arrow-keys-mixin.md → arrow-keys/README.md} +2 -2
- package/mixins/arrow-keys/arrow-keys-mixin.js +125 -0
- package/mixins/{demo → arrow-keys/demo}/arrow-keys-mixin.html +2 -2
- package/mixins/{demo → arrow-keys/demo}/arrow-keys-test.js +1 -1
- package/mixins/arrow-keys-mixin.js +1 -125
- package/mixins/{focus-mixin.md → focus/README.md} +1 -1
- package/mixins/focus/focus-mixin.js +43 -0
- package/mixins/focus-mixin.js +1 -43
- package/mixins/{interactive-mixin.md → interactive/README.md} +1 -1
- package/mixins/{interactive-mixin.js → interactive/interactive-mixin.js} +4 -4
- package/mixins/{labelled-mixin.md → labelled/README.md} +2 -2
- package/mixins/{demo → labelled/demo}/labelled-mixin.html +3 -3
- package/mixins/labelled/labelled-mixin.js +215 -0
- package/mixins/labelled-mixin.js +1 -215
- package/mixins/{provider-mixin.md → provider/README.md} +3 -3
- package/mixins/provider/provider-mixin.js +35 -0
- package/mixins/provider-mixin.js +1 -35
- package/mixins/{rtl-mixin.md → rtl/README.md} +1 -1
- package/mixins/rtl/rtl-mixin.js +40 -0
- package/mixins/rtl-mixin.js +1 -40
- package/mixins/theme/theme-mixin.js +19 -0
- package/mixins/theme-mixin.js +1 -19
- package/mixins/{visible-on-ancestor-mixin.md → visible-on-ancestor/README.md} +1 -1
- package/mixins/visible-on-ancestor/visible-on-ancestor-mixin.js +160 -0
- package/mixins/visible-on-ancestor-mixin.js +1 -160
- package/package.json +1 -1
- package/templates/primary-secondary/primary-secondary.js +1 -1
- package/tools/dom-test-helpers.js +4 -3
package/README.md
CHANGED
|
@@ -65,17 +65,17 @@ npm install @brightspace-ui/core
|
|
|
65
65
|
* Helpers
|
|
66
66
|
* [Helpers](helpers/): helpers for composed DOM, unique ids, etc.
|
|
67
67
|
* Mixins
|
|
68
|
-
* [ArrowKeysMixin](mixins/arrow-keys
|
|
68
|
+
* [ArrowKeysMixin](mixins/arrow-keys/): manage focus with arrow keys
|
|
69
69
|
* [AsyncContainerMixin](mixins/async-container/): manage collective async state
|
|
70
|
-
* [FocusMixin](mixins/focus
|
|
70
|
+
* [FocusMixin](mixins/focus/): delegate focus to a nested element when `focus()` is called
|
|
71
71
|
* [FormElementMixin](components/form/docs/form-element-mixin.md): allow components to participate in forms and validation
|
|
72
|
-
* [InteractiveMixin](mixins/interactive
|
|
73
|
-
* [LabelledMixin](mixins/labelled
|
|
72
|
+
* [InteractiveMixin](mixins/interactive/): enables toggling interactive elements inside of nested grids
|
|
73
|
+
* [LabelledMixin](mixins/labelled/): label custom elements by referencing elements across DOM scopes
|
|
74
74
|
* [LocalizeMixin](mixins/localize/): localize text in your components
|
|
75
|
-
* [ProviderMixin](mixins/provider
|
|
76
|
-
* [RtlMixin](mixins/rtl
|
|
75
|
+
* [ProviderMixin](mixins/provider/): provide and consume data across elements in a DI-like fashion
|
|
76
|
+
* [RtlMixin](mixins/rtl/): enable components to define RTL styles
|
|
77
77
|
* [SkeletonMixin](components/skeleton/): make components skeleton-aware
|
|
78
|
-
* [VisibleOnAncestorMixin](mixins/visible-on-ancestor
|
|
78
|
+
* [VisibleOnAncestorMixin](mixins/visible-on-ancestor/): display element on-hover of an ancestor
|
|
79
79
|
* Templates
|
|
80
80
|
* [PrimarySecondaryTemplate](templates/primary-secondary): Two Panel (primary and secondary) page template with header and optional footer
|
|
81
81
|
|
|
@@ -5,7 +5,7 @@ import { bodyCompactStyles, bodyStandardStyles } from '../typography/styles.js';
|
|
|
5
5
|
import { css, html, LitElement } from 'lit';
|
|
6
6
|
import { classMap } from 'lit/directives/class-map.js';
|
|
7
7
|
import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
|
8
|
-
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
8
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* A component for communicating important information relating to the state of the system and the user's work flow.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import '../icons/icon.js';
|
|
2
2
|
import { css, html, LitElement } from 'lit';
|
|
3
3
|
import { findComposedAncestor } from '../../helpers/dom.js';
|
|
4
|
-
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
4
|
+
import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
|
|
5
5
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
6
6
|
import { linkStyles } from '../link/link.js';
|
|
7
|
-
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
7
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* An entry within a <d2l-breadcrumbs> parent.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './breadcrumb.js';
|
|
2
2
|
import { css, html, LitElement } from 'lit';
|
|
3
3
|
import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
|
4
|
-
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
4
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Help users understand where they are within the application, and provide useful clues about how the space is organized. They also provide a convenient navigation mechanism.
|
|
@@ -2,14 +2,14 @@ import '../colors/colors.js';
|
|
|
2
2
|
import '../icons/icon.js';
|
|
3
3
|
import '../tooltip/tooltip.js';
|
|
4
4
|
import { css, html, LitElement, unsafeCSS } from 'lit';
|
|
5
|
-
import { VisibleOnAncestorMixin, visibleOnAncestorStyles } from '../../mixins/visible-on-ancestor-mixin.js';
|
|
5
|
+
import { VisibleOnAncestorMixin, visibleOnAncestorStyles } from '../../mixins/visible-on-ancestor/visible-on-ancestor-mixin.js';
|
|
6
6
|
import { ButtonMixin } from './button-mixin.js';
|
|
7
7
|
import { buttonStyles } from './button-styles.js';
|
|
8
8
|
import { getFocusPseudoClass } from '../../helpers/focus.js';
|
|
9
9
|
import { getUniqueId } from '../../helpers/uniqueId.js';
|
|
10
10
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
11
|
-
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
12
|
-
import { ThemeMixin } from '../../mixins/theme-mixin.js';
|
|
11
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
12
|
+
import { ThemeMixin } from '../../mixins/theme/theme-mixin.js';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* A button component that can be used just like the native button for instances where only an icon is displayed.
|
|
@@ -167,7 +167,6 @@ class ButtonIcon extends ThemeMixin(ButtonMixin(VisibleOnAncestorMixin(RtlMixin(
|
|
|
167
167
|
aria-haspopup="${ifDefined(this.ariaHaspopup)}"
|
|
168
168
|
aria-label="${this.ariaLabel ? this.ariaLabel : ifDefined(this.text)}"
|
|
169
169
|
?autofocus="${this.autofocus}"
|
|
170
|
-
class="d2l-label-text"
|
|
171
170
|
?disabled="${this.disabled && !this.disabledTooltip}"
|
|
172
171
|
form="${ifDefined(this.form)}"
|
|
173
172
|
formaction="${ifDefined(this.formaction)}"
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import '../colors/colors.js';
|
|
2
|
+
import '../icons/icon.js';
|
|
3
|
+
import '../tooltip/tooltip.js';
|
|
4
|
+
import { css, html, LitElement } from 'lit';
|
|
5
|
+
import { buttonStyles } from './button-styles.js';
|
|
6
|
+
import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
|
|
7
|
+
import { getUniqueId } from '../../helpers/uniqueId.js';
|
|
8
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
9
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
10
|
+
|
|
11
|
+
const keyCodes = Object.freeze({
|
|
12
|
+
DOWN: 40,
|
|
13
|
+
END: 35,
|
|
14
|
+
HOME: 36,
|
|
15
|
+
LEFT: 37,
|
|
16
|
+
RIGHT: 39,
|
|
17
|
+
UP: 38
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const moveActions = Object.freeze({
|
|
21
|
+
up: 'up',
|
|
22
|
+
down: 'down',
|
|
23
|
+
left: 'left',
|
|
24
|
+
right: 'right',
|
|
25
|
+
rootHome: 'root-home',
|
|
26
|
+
home: 'home',
|
|
27
|
+
rootEnd: 'root-end',
|
|
28
|
+
end: 'end'
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* A button component that provides a move action via a single button.
|
|
33
|
+
*/
|
|
34
|
+
class ButtonMove extends FocusMixin(RtlMixin(LitElement)) {
|
|
35
|
+
|
|
36
|
+
static get properties() {
|
|
37
|
+
return {
|
|
38
|
+
/**
|
|
39
|
+
* @ignore
|
|
40
|
+
*/
|
|
41
|
+
autofocus: { type: Boolean, reflect: true },
|
|
42
|
+
/**
|
|
43
|
+
* A description to be added to the button for accessibility when text on button does not provide enough context
|
|
44
|
+
* @type {string}
|
|
45
|
+
*/
|
|
46
|
+
description: { type: String },
|
|
47
|
+
/**
|
|
48
|
+
* Disables the button
|
|
49
|
+
* @type {boolean}
|
|
50
|
+
*/
|
|
51
|
+
disabled: { type: Boolean, reflect: true },
|
|
52
|
+
/**
|
|
53
|
+
* Tooltip text when disabled
|
|
54
|
+
* @type {string}
|
|
55
|
+
*/
|
|
56
|
+
disabledTooltip: { type: String, attribute: 'disabled-tooltip' },
|
|
57
|
+
/**
|
|
58
|
+
* REQUIRED: Accessible text for the button
|
|
59
|
+
* @type {string}
|
|
60
|
+
*/
|
|
61
|
+
text: { type: String, reflect: true }
|
|
62
|
+
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
static get styles() {
|
|
67
|
+
return [ buttonStyles,
|
|
68
|
+
css`
|
|
69
|
+
:host {
|
|
70
|
+
display: inline-block;
|
|
71
|
+
line-height: 0;
|
|
72
|
+
}
|
|
73
|
+
:host([hidden]) {
|
|
74
|
+
display: none;
|
|
75
|
+
}
|
|
76
|
+
button {
|
|
77
|
+
background-color: transparent;
|
|
78
|
+
display: flex;
|
|
79
|
+
flex-direction: column;
|
|
80
|
+
gap: 2px;
|
|
81
|
+
margin: 0;
|
|
82
|
+
min-height: 1.8rem;
|
|
83
|
+
padding: 0;
|
|
84
|
+
position: relative;
|
|
85
|
+
width: 0.9rem;
|
|
86
|
+
}
|
|
87
|
+
d2l-icon {
|
|
88
|
+
border-radius: 0.1rem;
|
|
89
|
+
height: 0.85rem;
|
|
90
|
+
width: 0.9rem;
|
|
91
|
+
}
|
|
92
|
+
button:focus {
|
|
93
|
+
background-color: #ffffff;
|
|
94
|
+
}
|
|
95
|
+
button:hover > d2l-icon,
|
|
96
|
+
button:focus > d2l-icon {
|
|
97
|
+
background-color: var(--d2l-color-mica);
|
|
98
|
+
}
|
|
99
|
+
.up-icon {
|
|
100
|
+
border-top-left-radius: 0.3rem;
|
|
101
|
+
border-top-right-radius: 0.3rem;
|
|
102
|
+
}
|
|
103
|
+
.down-icon {
|
|
104
|
+
border-bottom-left-radius: 0.3rem;
|
|
105
|
+
border-bottom-right-radius: 0.3rem;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.up-layer,
|
|
109
|
+
.down-layer {
|
|
110
|
+
height: 1.1rem;
|
|
111
|
+
left: -0.2rem;
|
|
112
|
+
position: absolute;
|
|
113
|
+
width: 1.3rem;
|
|
114
|
+
}
|
|
115
|
+
.up-layer {
|
|
116
|
+
top: -0.25rem;
|
|
117
|
+
}
|
|
118
|
+
.down-layer {
|
|
119
|
+
bottom: -0.25rem;
|
|
120
|
+
}
|
|
121
|
+
:host([dir="rtl"]) .up-layer,
|
|
122
|
+
:host([dir="rtl"]) .down-layer {
|
|
123
|
+
left: auto;
|
|
124
|
+
right: -0.2rem;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
/* Firefox includes a hidden border which messes up button dimensions */
|
|
129
|
+
button::-moz-focus-inner {
|
|
130
|
+
border: 0;
|
|
131
|
+
}
|
|
132
|
+
:host([disabled]) button {
|
|
133
|
+
cursor: default;
|
|
134
|
+
opacity: 0.5;
|
|
135
|
+
}
|
|
136
|
+
button[disabled]:hover > d2l-icon {
|
|
137
|
+
background-color: transparent;
|
|
138
|
+
}
|
|
139
|
+
`
|
|
140
|
+
];
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
constructor() {
|
|
144
|
+
super();
|
|
145
|
+
this.disabled = false;
|
|
146
|
+
/** @ignore */
|
|
147
|
+
this.autofocus = false;
|
|
148
|
+
/** @internal */
|
|
149
|
+
this._buttonId = getUniqueId();
|
|
150
|
+
/** @internal */
|
|
151
|
+
this._describedById = getUniqueId();
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
static get focusElementSelector() {
|
|
155
|
+
return 'button';
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
connectedCallback() {
|
|
159
|
+
super.connectedCallback();
|
|
160
|
+
this.addEventListener('click', this._handleClick, true);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
disconnectedCallback() {
|
|
164
|
+
super.disconnectedCallback();
|
|
165
|
+
this.removeEventListener('click', this._handleClick, true);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
render() {
|
|
169
|
+
return html`
|
|
170
|
+
<button
|
|
171
|
+
aria-describedby="${ifDefined(this.description ? this._describedById : undefined)}"
|
|
172
|
+
aria-disabled="${ifDefined(this.disabled && this.disabledTooltip ? 'true' : undefined)}"
|
|
173
|
+
aria-label="${ifDefined(this.text)}"
|
|
174
|
+
?autofocus="${this.autofocus}"
|
|
175
|
+
?disabled="${this.disabled && !this.disabledTooltip}"
|
|
176
|
+
id="${this._buttonId}"
|
|
177
|
+
@keydown="${this._handleKeydown}"
|
|
178
|
+
title="${ifDefined(this.text)}"
|
|
179
|
+
type="button">
|
|
180
|
+
<d2l-icon icon="tier1:arrow-toggle-up" class="up-icon"></d2l-icon>
|
|
181
|
+
<d2l-icon icon="tier1:arrow-toggle-down" class="down-icon"></d2l-icon>
|
|
182
|
+
<div class="up-layer" @click="${this._handleUpClick}"></div>
|
|
183
|
+
<div class="down-layer" @click="${this._handleDownClick}"></div>
|
|
184
|
+
</button>
|
|
185
|
+
${this.description ? html`<span id="${this._describedById}" hidden>${this.description}</span>` : null}
|
|
186
|
+
${this.disabled && this.disabledTooltip ? html`<d2l-tooltip for="${this._buttonId}">${this.disabledTooltip}</d2l-tooltip>` : ''}
|
|
187
|
+
`;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
_dispatchAction(action) {
|
|
191
|
+
if (!action) return;
|
|
192
|
+
this.dispatchEvent(new CustomEvent('d2l-button-move-action', {
|
|
193
|
+
detail: { action },
|
|
194
|
+
bubbles: false
|
|
195
|
+
}));
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
_handleClick(e) {
|
|
199
|
+
if (this.disabled) {
|
|
200
|
+
e.stopPropagation();
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
_handleDownClick() {
|
|
205
|
+
this._dispatchAction(moveActions.down);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
_handleKeydown(e) {
|
|
209
|
+
let action;
|
|
210
|
+
switch (e.keyCode) {
|
|
211
|
+
case keyCodes.UP:
|
|
212
|
+
action = moveActions.up;
|
|
213
|
+
break;
|
|
214
|
+
case keyCodes.DOWN:
|
|
215
|
+
action = moveActions.down;
|
|
216
|
+
break;
|
|
217
|
+
case keyCodes.LEFT:
|
|
218
|
+
action = moveActions.left;
|
|
219
|
+
break;
|
|
220
|
+
case keyCodes.RIGHT:
|
|
221
|
+
action = moveActions.right;
|
|
222
|
+
break;
|
|
223
|
+
case keyCodes.HOME:
|
|
224
|
+
action = (e.ctrlKey ? moveActions.rootHome : moveActions.home);
|
|
225
|
+
break;
|
|
226
|
+
case keyCodes.END:
|
|
227
|
+
action = (e.ctrlKey ? moveActions.rootEnd : moveActions.end);
|
|
228
|
+
break;
|
|
229
|
+
default:
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
this._dispatchAction(action);
|
|
234
|
+
e.preventDefault();
|
|
235
|
+
e.stopPropagation();
|
|
236
|
+
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
_handleUpClick() {
|
|
240
|
+
this._dispatchAction(moveActions.up);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
customElements.define('d2l-button-move', ButtonMove);
|
|
@@ -6,7 +6,7 @@ import { buttonStyles } from './button-styles.js';
|
|
|
6
6
|
import { getUniqueId } from '../../helpers/uniqueId.js';
|
|
7
7
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
8
8
|
import { labelStyles } from '../typography/styles.js';
|
|
9
|
-
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
9
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* A button component that can be used just like the native button, but for advanced or de-emphasized actions.
|
|
@@ -0,0 +1,46 @@
|
|
|
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-move.js';
|
|
10
|
+
</script>
|
|
11
|
+
</head>
|
|
12
|
+
<body unresolved>
|
|
13
|
+
|
|
14
|
+
<d2l-demo-page page-title="d2l-button-move">
|
|
15
|
+
|
|
16
|
+
<h2>Move Button</h2>
|
|
17
|
+
|
|
18
|
+
<d2l-demo-snippet>
|
|
19
|
+
<template>
|
|
20
|
+
<d2l-button-move id="move-button" text="Reorder Item"></d2l-button-move>
|
|
21
|
+
<script>
|
|
22
|
+
document.querySelector('#move-button').addEventListener('d2l-button-move-action', e => {
|
|
23
|
+
console.log('d2l-button-move-action', e.target, e.detail);
|
|
24
|
+
});
|
|
25
|
+
</script>
|
|
26
|
+
</template>
|
|
27
|
+
</d2l-demo-snippet>
|
|
28
|
+
|
|
29
|
+
<h2>Move Button Disabled</h2>
|
|
30
|
+
|
|
31
|
+
<d2l-demo-snippet>
|
|
32
|
+
<template>
|
|
33
|
+
<d2l-button-move text="Reorder Item" disabled></d2l-button-move>
|
|
34
|
+
</template>
|
|
35
|
+
</d2l-demo-snippet>
|
|
36
|
+
|
|
37
|
+
<h2>Move Button Disabled with Tooltip</h2>
|
|
38
|
+
|
|
39
|
+
<d2l-demo-snippet>
|
|
40
|
+
<template>
|
|
41
|
+
<d2l-button-move text="Reorder Item" disabled disabled-tooltip="Optional disabled tooltip"></d2l-button-move>
|
|
42
|
+
</template>
|
|
43
|
+
</d2l-demo-snippet>
|
|
44
|
+
|
|
45
|
+
</body>
|
|
46
|
+
</html>
|
|
@@ -3,7 +3,7 @@ import '../../helpers/requestIdleCallback.js';
|
|
|
3
3
|
import { css, html, LitElement } from 'lit';
|
|
4
4
|
import { getBoundingAncestor, getComposedParent } from '../../helpers/dom.js';
|
|
5
5
|
import { getLegacyOffsetParent } from '../../helpers/offsetParent-legacy.js';
|
|
6
|
-
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
6
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
7
7
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
8
8
|
|
|
9
9
|
const mediaQueryList = window.matchMedia('(max-height: 500px)');
|
|
@@ -10,7 +10,7 @@ import { getUniqueId } from '../../helpers/uniqueId.js';
|
|
|
10
10
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
11
11
|
import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
|
12
12
|
import { offscreenStyles } from '../offscreen/offscreen.js';
|
|
13
|
-
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
13
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
14
14
|
|
|
15
15
|
const daysInWeek = 7;
|
|
16
16
|
const keyCodes = {
|
|
@@ -2,10 +2,10 @@ import '../colors/colors.js';
|
|
|
2
2
|
import '../count-badge/count-badge-icon.js';
|
|
3
3
|
import '../icons/icon.js';
|
|
4
4
|
import { css, html, LitElement } from 'lit';
|
|
5
|
-
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
5
|
+
import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
|
|
6
6
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
7
7
|
import { offscreenStyles } from '../offscreen/offscreen.js';
|
|
8
|
-
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
8
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* An icon link that can be placed in the `footer` slot.
|
package/components/card/card.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import '../colors/colors.js';
|
|
2
2
|
import { css, html, LitElement } from 'lit';
|
|
3
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
|
-
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
4
|
+
import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
|
|
5
5
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
6
6
|
import { offscreenStyles } from '../offscreen/offscreen.js';
|
|
7
7
|
import ResizeObserver from 'resize-observer-polyfill/dist/ResizeObserver.es.js';
|
|
8
|
-
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
8
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
9
9
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -4,9 +4,9 @@ import '../expand-collapse/expand-collapse-content.js';
|
|
|
4
4
|
import { css, html, LitElement } from 'lit';
|
|
5
5
|
import { heading1Styles, heading2Styles, heading3Styles, heading4Styles } from '../typography/styles.js';
|
|
6
6
|
import { classMap } from 'lit/directives/class-map.js';
|
|
7
|
-
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
7
|
+
import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
|
|
8
8
|
import { offscreenStyles } from '../offscreen/offscreen.js';
|
|
9
|
-
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
9
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
10
10
|
|
|
11
11
|
const normalizeHeadingNumber = (number) => {
|
|
12
12
|
number = parseInt(number);
|
|
@@ -2,7 +2,7 @@ import '../colors/colors.js';
|
|
|
2
2
|
import '../icons/icon.js';
|
|
3
3
|
import { css, html, LitElement, unsafeCSS } from 'lit';
|
|
4
4
|
import { CountBadgeMixin } from './count-badge-mixin.js';
|
|
5
|
-
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
5
|
+
import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
|
|
6
6
|
import { getFocusPseudoClass } from '../../helpers/focus.js';
|
|
7
7
|
import { getUniqueId } from '../../helpers/uniqueId.js';
|
|
8
8
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
@@ -5,7 +5,7 @@ import { formatNumber } from '@brightspace-ui/intl/lib/number.js';
|
|
|
5
5
|
import { getUniqueId } from '../../helpers/uniqueId.js';
|
|
6
6
|
import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
|
7
7
|
import { offscreenStyles } from '../offscreen/offscreen.js';
|
|
8
|
-
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
8
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
9
9
|
import { SkeletonMixin } from '../skeleton/skeleton-mixin.js';
|
|
10
10
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
11
11
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '../colors/colors.js';
|
|
2
2
|
import { css, html, LitElement, unsafeCSS } from 'lit';
|
|
3
3
|
import { CountBadgeMixin } from './count-badge-mixin.js';
|
|
4
|
-
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
4
|
+
import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
|
|
5
5
|
import { getFocusPseudoClass } from '../../helpers/focus.js';
|
|
6
6
|
import { getUniqueId } from '../../helpers/uniqueId.js';
|
|
7
7
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
@@ -8,7 +8,7 @@ import { classMap } from 'lit/directives/class-map.js';
|
|
|
8
8
|
import { getUniqueId } from '../../helpers/uniqueId.js';
|
|
9
9
|
import { html } from 'lit';
|
|
10
10
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
11
|
-
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
11
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
12
12
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
13
13
|
import { tryGetIfrauBackdropService } from '../../helpers/ifrauBackdropService.js';
|
|
14
14
|
|
|
@@ -3,7 +3,7 @@ import '../icons/icon.js';
|
|
|
3
3
|
import { css, html, LitElement } from 'lit';
|
|
4
4
|
import { DropdownOpenerMixin } from './dropdown-opener-mixin.js';
|
|
5
5
|
import { dropdownOpenerStyles } from './dropdown-opener-styles.js';
|
|
6
|
-
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
6
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* A "d2l-button" opener for dropdown content.
|
|
@@ -7,7 +7,7 @@ import { getComposedActiveElement, getFirstFocusableDescendant, getPreviousFocus
|
|
|
7
7
|
import { classMap } from 'lit/directives/class-map.js';
|
|
8
8
|
import { html } from 'lit';
|
|
9
9
|
import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
|
10
|
-
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
10
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
11
11
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
12
12
|
import { tryGetIfrauBackdropService } from '../../helpers/ifrauBackdropService.js';
|
|
13
13
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../button/button-icon.js';
|
|
2
2
|
import { css, html, LitElement } from 'lit';
|
|
3
|
-
import { VisibleOnAncestorMixin, visibleOnAncestorStyles } from '../../mixins/visible-on-ancestor-mixin.js';
|
|
3
|
+
import { VisibleOnAncestorMixin, visibleOnAncestorStyles } from '../../mixins/visible-on-ancestor/visible-on-ancestor-mixin.js';
|
|
4
4
|
import { DropdownOpenerMixin } from './dropdown-opener-mixin.js';
|
|
5
5
|
import { dropdownOpenerStyles } from './dropdown-opener-styles.js';
|
|
6
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { html, LitElement } from 'lit';
|
|
2
2
|
import { DropdownContentMixin } from './dropdown-content-mixin.js';
|
|
3
3
|
import { dropdownContentStyles } from './dropdown-content-styles.js';
|
|
4
|
-
import { ThemeMixin } from '../../mixins/theme-mixin.js';
|
|
4
|
+
import { ThemeMixin } from '../../mixins/theme/theme-mixin.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* A container for a "d2l-menu". It provides additional support on top of "d2l-dropdown-content" for closing the menu when menu items are selected, resetting to the root of nested menus when reopening and automatic resizing when the menu resizes.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../button/button-icon.js';
|
|
2
2
|
import { css, html, LitElement } from 'lit';
|
|
3
|
-
import { VisibleOnAncestorMixin, visibleOnAncestorStyles } from '../../mixins/visible-on-ancestor-mixin.js';
|
|
3
|
+
import { VisibleOnAncestorMixin, visibleOnAncestorStyles } from '../../mixins/visible-on-ancestor/visible-on-ancestor-mixin.js';
|
|
4
4
|
import { DropdownOpenerMixin } from './dropdown-opener-mixin.js';
|
|
5
5
|
import { dropdownOpenerStyles } from './dropdown-opener-styles.js';
|
|
6
6
|
|
|
@@ -2,7 +2,7 @@ import '../button/button-subtle.js';
|
|
|
2
2
|
import { emptyStateSimpleStyles, emptyStateStyles } from './empty-state-styles.js';
|
|
3
3
|
import { html, LitElement } from 'lit';
|
|
4
4
|
import { bodyCompactStyles } from '../typography/styles.js';
|
|
5
|
-
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
5
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* The `d2l-empty-state-simple` component is an empty state component that displays a description. An empty state action component can be placed inside of the default slot to add an optional action.
|
|
@@ -3,7 +3,7 @@ import './filter-tags.js';
|
|
|
3
3
|
import { css, html, LitElement } from 'lit';
|
|
4
4
|
import { OVERFLOW_CLASS, OverflowGroupMixin } from '../overflow-group/overflow-group-mixin.js';
|
|
5
5
|
import { getUniqueId } from '../../helpers/uniqueId.js';
|
|
6
|
-
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
6
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
7
7
|
|
|
8
8
|
function createFilterItem(node) {
|
|
9
9
|
const dimensionSets = node.querySelectorAll('d2l-filter-dimension-set');
|
|
@@ -22,12 +22,12 @@ import { bodyCompactStyles, bodySmallStyles, bodyStandardStyles } from '../typog
|
|
|
22
22
|
import { css, html, LitElement, nothing } from 'lit';
|
|
23
23
|
import { announce } from '../../helpers/announce.js';
|
|
24
24
|
import { classMap } from 'lit/directives/class-map.js';
|
|
25
|
-
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
25
|
+
import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
|
|
26
26
|
import { formatNumber } from '@brightspace-ui/intl/lib/number.js';
|
|
27
27
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
28
28
|
import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
|
29
29
|
import { offscreenStyles } from '../offscreen/offscreen.js';
|
|
30
|
-
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
30
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
31
31
|
import { SubscriberRegistryController } from '../../controllers/subscriber/subscriberControllers.js';
|
|
32
32
|
|
|
33
33
|
const ARROWLEFT_KEY_CODE = 37;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { css, html, LitElement } from 'lit';
|
|
2
2
|
import { getNextFocusable, getPreviousFocusable } from '../../helpers/focus.js';
|
|
3
|
-
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
3
|
+
import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
|
|
4
4
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
5
5
|
import { isComposedAncestor } from '../../helpers/dom.js';
|
|
6
6
|
|
|
@@ -3,7 +3,7 @@ import '../expand-collapse/expand-collapse-content.js';
|
|
|
3
3
|
import { css, html, LitElement } from 'lit';
|
|
4
4
|
import { linkStyles } from '../link/link.js';
|
|
5
5
|
import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
|
6
|
-
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
6
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
7
7
|
|
|
8
8
|
class FormErrorSummary extends LocalizeCoreElement(RtlMixin(LitElement)) {
|
|
9
9
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import '../../demo/demo-page.js';
|
|
9
9
|
import '../html-block.js';
|
|
10
10
|
|
|
11
|
-
import { provideInstance } from '../../../mixins/provider-mixin.js';
|
|
11
|
+
import { provideInstance } from '../../../mixins/provider/provider-mixin.js';
|
|
12
12
|
|
|
13
13
|
class DemoReplacementRenderer {
|
|
14
14
|
get canRenderInline() {
|
|
@@ -6,7 +6,7 @@ import { createHtmlBlockRenderer as createMathRenderer } from '../../helpers/mat
|
|
|
6
6
|
import { getFocusPseudoClass } from '../../helpers/focus.js';
|
|
7
7
|
import { HtmlAttributeObserverController } from '../../controllers/attributeObserver/htmlAttributeObserverController.js';
|
|
8
8
|
|
|
9
|
-
import { requestInstance } from '../../mixins/provider-mixin.js';
|
|
9
|
+
import { requestInstance } from '../../mixins/provider/provider-mixin.js';
|
|
10
10
|
|
|
11
11
|
export const htmlBlockContentStyles = css`
|
|
12
12
|
.d2l-html-block-rendered {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { css, html, LitElement } from 'lit';
|
|
2
2
|
import { fixSvg } from './fix-svg.js';
|
|
3
3
|
import { iconStyles } from './icon-styles.js';
|
|
4
|
-
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
4
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
5
5
|
|
|
6
6
|
class IconCustom extends RtlMixin(LitElement) {
|
|
7
7
|
|
package/components/icons/icon.js
CHANGED
|
@@ -3,7 +3,7 @@ import { css, html, LitElement } from 'lit';
|
|
|
3
3
|
import { fixSvg } from './fix-svg.js';
|
|
4
4
|
import { iconStyles } from './icon-styles.js';
|
|
5
5
|
import { loadSvg } from '../../generated/icons/presetIconLoader.js';
|
|
6
|
-
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
6
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
7
7
|
import { runAsync } from '../../directives/run-async/run-async.js';
|
|
8
8
|
import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
|
|
9
9
|
|