@brightspace-ui/core 3.266.1 → 3.267.1
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/inputs/input-styles.js +140 -3
- package/components/list/list-item-checkbox-mixin.js +9 -1
- package/components/list/list-item-drag-drop-mixin.js +30 -0
- package/components/list/list-item-drag-handle.js +41 -6
- package/components/list/list-item-generic-layout.js +27 -6
- package/components/list/list-item-link-mixin.js +4 -0
- package/components/list/list-item-mixin.js +29 -2
- package/components/list/list-item-placement-marker.js +53 -2
- package/components/page/page-divider-internal.js +154 -0
- package/components/page/page.js +137 -13
- package/custom-elements.json +107 -5
- package/lang/ar.js +5 -0
- package/lang/ca.js +5 -0
- package/lang/cy.js +5 -0
- package/lang/da.js +5 -0
- package/lang/de.js +5 -0
- package/lang/en-gb.js +5 -0
- package/lang/en.js +5 -0
- package/lang/es-es.js +5 -0
- package/lang/es.js +5 -0
- package/lang/fr-fr.js +5 -0
- package/lang/fr.js +5 -0
- package/lang/haw.js +5 -0
- package/lang/hi.js +5 -0
- package/lang/ja.js +5 -0
- package/lang/ko.js +5 -0
- package/lang/mi.js +5 -0
- package/lang/nl.js +5 -0
- package/lang/pt.js +5 -0
- package/lang/sv.js +5 -0
- package/lang/th.js +5 -0
- package/lang/tr.js +5 -0
- package/lang/vi.js +5 -0
- package/lang/zh-cn.js +5 -0
- package/lang/zh-tw.js +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import '../colors/colors.js';
|
|
2
|
+
import { css, html, LitElement } from 'lit';
|
|
3
|
+
import { formatPercent } from '@brightspace-ui/intl';
|
|
4
|
+
import { PropertyRequiredMixin } from '../../mixins/property-required/property-required-mixin.js';
|
|
5
|
+
|
|
6
|
+
export const DIVIDER_WIDTH = 4;
|
|
7
|
+
const KEYBOARD_STEP = 20; // TO DO: Confirm
|
|
8
|
+
const KEYBOARD_STEP_LARGE = 80; // TO DO: Confirm
|
|
9
|
+
|
|
10
|
+
const clampedSize = (size, min, max) => Math.max(min, Math.min(size, max));
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Internal divider used by d2l-page to resize its side-nav and supporting panels.
|
|
14
|
+
*/
|
|
15
|
+
class PageDivider extends PropertyRequiredMixin(LitElement) {
|
|
16
|
+
|
|
17
|
+
static properties = {
|
|
18
|
+
/**
|
|
19
|
+
* Current size of the panel/drawer the divider controls
|
|
20
|
+
* @type {number}
|
|
21
|
+
*/
|
|
22
|
+
currentSize: { type: Number, attribute: 'current-size' },
|
|
23
|
+
/**
|
|
24
|
+
* REQUIRED: label for the divider
|
|
25
|
+
* @type {string}
|
|
26
|
+
*/
|
|
27
|
+
label: { type: String, required: true },
|
|
28
|
+
/**
|
|
29
|
+
* Maximum size of the panel/drawer the divider controls
|
|
30
|
+
* @type {number}
|
|
31
|
+
*/
|
|
32
|
+
maxSize: { type: Number, attribute: 'max-size' },
|
|
33
|
+
/**
|
|
34
|
+
* Minimum size of the panel/drawer the divider controls
|
|
35
|
+
* @type {number}
|
|
36
|
+
*/
|
|
37
|
+
minSize: { type: Number, attribute: 'min-size' },
|
|
38
|
+
/**
|
|
39
|
+
* Inline position of the panel the divider controls
|
|
40
|
+
* @type {'start'|'end'}
|
|
41
|
+
*/
|
|
42
|
+
panelPosition: { type: String, attribute: 'panel-position' },
|
|
43
|
+
/**
|
|
44
|
+
* Whether the divider is controlling a left/right panel or a bottom drawer
|
|
45
|
+
* @type {'panel'|'drawer'}
|
|
46
|
+
*/
|
|
47
|
+
panelType: { type: String, attribute: 'panel-type' }
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
static styles = css`
|
|
51
|
+
:host {
|
|
52
|
+
flex: none;
|
|
53
|
+
}
|
|
54
|
+
.divider {
|
|
55
|
+
background-color: var(--d2l-color-gypsum);
|
|
56
|
+
cursor: ew-resize;
|
|
57
|
+
height: 100%;
|
|
58
|
+
outline: none;
|
|
59
|
+
width: ${DIVIDER_WIDTH}px;
|
|
60
|
+
}
|
|
61
|
+
.divider:hover {
|
|
62
|
+
background-color: var(--d2l-color-mica);
|
|
63
|
+
}
|
|
64
|
+
.divider:focus {
|
|
65
|
+
background-color: var(--d2l-color-celestine);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
:host([panel-type="drawer"]) .divider {
|
|
69
|
+
background-color: var(--d2l-color-celestine);
|
|
70
|
+
cursor: ns-resize;
|
|
71
|
+
height: ${DIVIDER_WIDTH}px;
|
|
72
|
+
width: 100%;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* TO DO: Lots more divider styling to come */
|
|
76
|
+
|
|
77
|
+
`;
|
|
78
|
+
|
|
79
|
+
constructor() {
|
|
80
|
+
super();
|
|
81
|
+
|
|
82
|
+
this.currentSize = 0;
|
|
83
|
+
this.label = '';
|
|
84
|
+
this.maxSize = 0;
|
|
85
|
+
this.minSize = 0;
|
|
86
|
+
this.panelPosition = 'start';
|
|
87
|
+
this.panelType = 'panel';
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
render() {
|
|
91
|
+
const currentSizePercent = formatPercent(Math.round(this.currentSize / this.maxSize) || 0);
|
|
92
|
+
|
|
93
|
+
return html`
|
|
94
|
+
<div
|
|
95
|
+
class="divider"
|
|
96
|
+
role="slider"
|
|
97
|
+
tabindex="0"
|
|
98
|
+
aria-label="${this.label}"
|
|
99
|
+
aria-orientation="${this.panelType === 'panel' ? 'horizontal' : 'vertical'}"
|
|
100
|
+
aria-valuemax="${this.maxSize}"
|
|
101
|
+
aria-valuemin="0"
|
|
102
|
+
aria-valuenow="${this.currentSize}"
|
|
103
|
+
aria-valuetext="${currentSizePercent}"
|
|
104
|
+
@keydown="${this.#handleKeyDown}">
|
|
105
|
+
</div>
|
|
106
|
+
`;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
#handleKeyDown(e) {
|
|
110
|
+
if (!['Enter', ' ', 'ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Home', 'End', 'PageUp', 'PageDown'].includes(e.key)) return;
|
|
111
|
+
e.preventDefault();
|
|
112
|
+
|
|
113
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
114
|
+
/** @ignore */
|
|
115
|
+
this.dispatchEvent(new CustomEvent('d2l-page-divider-toggle'));
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (e.key === 'Home' || e.key === 'End') {
|
|
120
|
+
this.#sendResizeEvent(e.key === 'Home' ? this.minSize : this.maxSize);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if (e.key === 'PageUp' || e.key === 'PageDown') {
|
|
125
|
+
this.#sendResizeEvent(this.currentSize + (e.key === 'PageUp' ? 1 : -1) * KEYBOARD_STEP_LARGE);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
let positiveStepKey;
|
|
130
|
+
if (this.panelType === 'panel') {
|
|
131
|
+
if (e.key !== 'ArrowLeft' && e.key !== 'ArrowRight') return;
|
|
132
|
+
const isRtl = (document.documentElement.getAttribute('dir') === 'rtl');
|
|
133
|
+
positiveStepKey = (this.panelPosition === 'start') !== isRtl ? 'ArrowRight' : 'ArrowLeft';
|
|
134
|
+
} else if (this.panelType === 'drawer') {
|
|
135
|
+
if (e.key !== 'ArrowUp' && e.key !== 'ArrowDown') return;
|
|
136
|
+
positiveStepKey = 'ArrowUp';
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const step = (e.key === positiveStepKey ? 1 : -1) * KEYBOARD_STEP;
|
|
140
|
+
const requestedSize = this.currentSize + step;
|
|
141
|
+
this.#sendResizeEvent(requestedSize);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
#sendResizeEvent(requestedSize) {
|
|
145
|
+
const clampedRequestedSize = clampedSize(requestedSize, this.minSize, this.maxSize);
|
|
146
|
+
/** @ignore */
|
|
147
|
+
this.dispatchEvent(new CustomEvent('d2l-page-divider-resize', { detail: {
|
|
148
|
+
requestedSize: clampedRequestedSize
|
|
149
|
+
} }));
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
customElements.define('d2l-page-divider-internal', PageDivider);
|
package/components/page/page.js
CHANGED
|
@@ -1,9 +1,49 @@
|
|
|
1
|
-
import '../colors/colors.js';
|
|
2
1
|
import '../button/floating-buttons.js';
|
|
3
2
|
import { css, html, LitElement, nothing } from 'lit';
|
|
4
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
|
+
import { DIVIDER_WIDTH } from './page-divider-internal.js';
|
|
5
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
5
6
|
import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
|
6
7
|
import { ProviderMixin } from '../../mixins/provider/provider-mixin.js';
|
|
8
|
+
import { styleMap } from 'lit/directives/style-map.js';
|
|
9
|
+
|
|
10
|
+
const DRAWER_MIN_HEIGHT = 200; // TO DO: Confirm
|
|
11
|
+
const MAIN_MIN_WIDTH = 600; // TO DO: Confirm
|
|
12
|
+
const PANEL_MIN_WIDTH = 320;
|
|
13
|
+
|
|
14
|
+
class PanelStateController {
|
|
15
|
+
constructor(host, panelConfigs) {
|
|
16
|
+
this.#host = host;
|
|
17
|
+
this.#panels = {};
|
|
18
|
+
for (const [key, config] of Object.entries(panelConfigs)) {
|
|
19
|
+
this.#panels[key] = { collapsed: false, size: 0, minSize: config.minSize, maxSize: config.minSize };
|
|
20
|
+
}
|
|
21
|
+
host.addController(this);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
getMaxSize(key) { return this.#panels[key].maxSize; }
|
|
25
|
+
getMinSize(key) { return this.#panels[key].minSize; }
|
|
26
|
+
getSize(key) { return this.#panels[key].size; }
|
|
27
|
+
|
|
28
|
+
resize(key, requestedSize) {
|
|
29
|
+
const panel = this.#panels[key];
|
|
30
|
+
// Clamp requested size to min and max bounds
|
|
31
|
+
panel.size = Math.max(panel.minSize, Math.min(requestedSize, panel.maxSize));
|
|
32
|
+
this.#host.requestUpdate();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
updateMaxSize(key, newMaxSize) {
|
|
36
|
+
const panel = this.#panels[key];
|
|
37
|
+
panel.maxSize = newMaxSize;
|
|
38
|
+
|
|
39
|
+
if (panel.size > newMaxSize) {
|
|
40
|
+
this.resize(key, panel.size);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
#host;
|
|
45
|
+
#panels;
|
|
46
|
+
}
|
|
7
47
|
|
|
8
48
|
/**
|
|
9
49
|
* Component for laying out a page, with header, optional footer and optional navigation or supporting panels
|
|
@@ -21,7 +61,10 @@ class Page extends ProviderMixin(LocalizeCoreElement(LitElement)) {
|
|
|
21
61
|
* @type {'normal'|'wide'|'fullscreen'}
|
|
22
62
|
*/
|
|
23
63
|
widthType: { type: String, attribute: 'width-type' },
|
|
64
|
+
_contentWidth: { state: true },
|
|
65
|
+
_headerHeight: { state: true },
|
|
24
66
|
_headerIsSticky: { state: true },
|
|
67
|
+
_footerHeight: { state: true },
|
|
25
68
|
_slotVisibility: { state: true }
|
|
26
69
|
};
|
|
27
70
|
|
|
@@ -76,7 +119,7 @@ class Page extends ProviderMixin(LocalizeCoreElement(LitElement)) {
|
|
|
76
119
|
|
|
77
120
|
main {
|
|
78
121
|
flex: 1;
|
|
79
|
-
min-width: min(
|
|
122
|
+
min-width: min(${MAIN_MIN_WIDTH}px, 100%);
|
|
80
123
|
}
|
|
81
124
|
|
|
82
125
|
.side-nav-panel,
|
|
@@ -87,12 +130,6 @@ class Page extends ProviderMixin(LocalizeCoreElement(LitElement)) {
|
|
|
87
130
|
top: var(--d2l-page-header-height, 0);
|
|
88
131
|
}
|
|
89
132
|
|
|
90
|
-
.divider {
|
|
91
|
-
background-color: var(--d2l-color-gypsum);
|
|
92
|
-
flex: none;
|
|
93
|
-
width: 4px;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
133
|
.footer:not([hidden]),
|
|
97
134
|
.floating-buttons-container {
|
|
98
135
|
display: inline;
|
|
@@ -115,16 +152,38 @@ class Page extends ProviderMixin(LocalizeCoreElement(LitElement)) {
|
|
|
115
152
|
super();
|
|
116
153
|
|
|
117
154
|
this.widthType = 'normal';
|
|
155
|
+
this._contentWidth = 0;
|
|
156
|
+
this._headerHeight = 0;
|
|
118
157
|
this._headerIsSticky = false;
|
|
158
|
+
this._footerHeight = 0;
|
|
159
|
+
this._panelState = new PanelStateController(this, {
|
|
160
|
+
'side-nav': { minSize: PANEL_MIN_WIDTH },
|
|
161
|
+
'supporting': { minSize: PANEL_MIN_WIDTH },
|
|
162
|
+
'supporting-mobile': { minSize: DRAWER_MIN_HEIGHT }
|
|
163
|
+
});
|
|
119
164
|
this._slotVisibility = {};
|
|
165
|
+
this.#handleWindowResizeBound = this.#handleWindowResize.bind(this);
|
|
120
166
|
this.#resizeObserver = new ResizeObserver(entries => {
|
|
121
167
|
for (const entry of entries) {
|
|
122
168
|
if (entry.target.classList.contains('header')) {
|
|
123
|
-
|
|
169
|
+
this._headerHeight = entry.target.offsetHeight;
|
|
170
|
+
|
|
171
|
+
const height = this._headerIsSticky ? this._headerHeight : 0;
|
|
124
172
|
this.style.setProperty('--d2l-page-header-height', `${height}px`);
|
|
173
|
+
this._panelState.updateMaxSize('supporting-mobile', this.#getMaxDrawerHeight());
|
|
125
174
|
} else if (entry.target.classList.contains('footer')) {
|
|
126
|
-
|
|
127
|
-
|
|
175
|
+
this._footerHeight = entry.target.classList.contains('fixed-footer') ? entry.target.offsetHeight : 0;
|
|
176
|
+
|
|
177
|
+
this.style.setProperty('--d2l-page-footer-height', `${this._footerHeight}px`);
|
|
178
|
+
this._panelState.updateMaxSize('supporting-mobile', this.#getMaxDrawerHeight());
|
|
179
|
+
} else if (entry.target.classList.contains('content')) {
|
|
180
|
+
this._contentWidth = entry.contentRect.width;
|
|
181
|
+
|
|
182
|
+
const newMaxWidth = this.#getMaxPanelWidth();
|
|
183
|
+
this._panelState.updateMaxSize('side-nav', newMaxWidth);
|
|
184
|
+
this._panelState.updateMaxSize('supporting', newMaxWidth);
|
|
185
|
+
|
|
186
|
+
// TO DO: Collapse panel if needed
|
|
128
187
|
}
|
|
129
188
|
}
|
|
130
189
|
});
|
|
@@ -133,16 +192,24 @@ class Page extends ProviderMixin(LocalizeCoreElement(LitElement)) {
|
|
|
133
192
|
});
|
|
134
193
|
}
|
|
135
194
|
|
|
195
|
+
connectedCallback() {
|
|
196
|
+
super.connectedCallback();
|
|
197
|
+
window.addEventListener('resize', this.#handleWindowResizeBound);
|
|
198
|
+
}
|
|
199
|
+
|
|
136
200
|
disconnectedCallback() {
|
|
137
201
|
super.disconnectedCallback();
|
|
138
202
|
this.#resizeObserver.disconnect();
|
|
203
|
+
window.removeEventListener('resize', this.#handleWindowResizeBound);
|
|
139
204
|
}
|
|
140
205
|
|
|
141
206
|
firstUpdated() {
|
|
142
207
|
const header = this.shadowRoot.querySelector('.header');
|
|
143
208
|
const footer = this.shadowRoot.querySelector('.footer');
|
|
209
|
+
const content = this.shadowRoot.querySelector('.content');
|
|
144
210
|
if (header) this.#resizeObserver.observe(header);
|
|
145
211
|
if (footer) this.#resizeObserver.observe(footer);
|
|
212
|
+
if (content) this.#resizeObserver.observe(content);
|
|
146
213
|
}
|
|
147
214
|
|
|
148
215
|
render() {
|
|
@@ -164,14 +231,69 @@ class Page extends ProviderMixin(LocalizeCoreElement(LitElement)) {
|
|
|
164
231
|
`;
|
|
165
232
|
}
|
|
166
233
|
|
|
234
|
+
willUpdate(changedProperties) {
|
|
235
|
+
super.willUpdate(changedProperties);
|
|
236
|
+
if (changedProperties.has('_contentWidth') && changedProperties.get('_contentWidth') === 0 && this._contentWidth > 0) {
|
|
237
|
+
this.#initializePanelSizes();
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
#handleWindowResizeBound;
|
|
167
242
|
#resizeObserver;
|
|
168
243
|
|
|
244
|
+
#getMaxDrawerHeight() {
|
|
245
|
+
const reservedSpace = this._headerHeight + this._footerHeight + DIVIDER_WIDTH;
|
|
246
|
+
return Math.max(DRAWER_MIN_HEIGHT, window.innerHeight - reservedSpace);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
#getMaxPanelWidth() {
|
|
250
|
+
const reservedSpace = MAIN_MIN_WIDTH + DIVIDER_WIDTH;
|
|
251
|
+
return Math.max(PANEL_MIN_WIDTH, this._contentWidth - reservedSpace);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
#handleDividerResize(e) {
|
|
255
|
+
const panelKey = e.target.dataset.panelKey;
|
|
256
|
+
this._panelState.resize(panelKey, e.detail.requestedSize);
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
#handleDividerToggle() {
|
|
260
|
+
// TO DO
|
|
261
|
+
};
|
|
262
|
+
|
|
169
263
|
#handleSlotVisibilityChange(e) {
|
|
170
264
|
const key = e.target.name;
|
|
171
265
|
const nodes = e.target.assignedNodes();
|
|
172
266
|
this._slotVisibility = { ...this._slotVisibility, [key]: nodes.length !== 0 };
|
|
173
267
|
}
|
|
174
268
|
|
|
269
|
+
#handleWindowResize() {
|
|
270
|
+
this._panelState.updateMaxSize('supporting-mobile', this.#getMaxDrawerHeight());
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
#initializePanelSizes() {
|
|
274
|
+
const defaultWidth = Math.floor(this._contentWidth / 3);
|
|
275
|
+
const defaultHeight = Math.floor(window.innerHeight / 2);
|
|
276
|
+
|
|
277
|
+
this._panelState.resize('side-nav', defaultWidth);
|
|
278
|
+
this._panelState.resize('supporting', defaultWidth);
|
|
279
|
+
this._panelState.resize('supporting-mobile', defaultHeight);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
#renderDivider(panelKey, label, panelPosition) {
|
|
283
|
+
return html`
|
|
284
|
+
<d2l-page-divider-internal
|
|
285
|
+
data-panel-key="${panelKey}"
|
|
286
|
+
label="${label}"
|
|
287
|
+
current-size="${this._panelState.getSize(panelKey)}"
|
|
288
|
+
max-size="${this._panelState.getMaxSize(panelKey)}"
|
|
289
|
+
min-size="${this._panelState.getMinSize(panelKey)}"
|
|
290
|
+
panel-position="${ifDefined(panelPosition)}"
|
|
291
|
+
@d2l-page-divider-resize="${this.#handleDividerResize}"
|
|
292
|
+
@d2l-page-divider-toggle="${this.#handleDividerToggle}"
|
|
293
|
+
></d2l-page-divider-internal>
|
|
294
|
+
`;
|
|
295
|
+
}
|
|
296
|
+
|
|
175
297
|
#renderFloatingButtons(footerContents) {
|
|
176
298
|
// Floating buttons needs to be wrapped as it spawns a sibling element that should be cleaned up as one by Lit
|
|
177
299
|
return html`
|
|
@@ -208,21 +330,23 @@ class Page extends ProviderMixin(LocalizeCoreElement(LitElement)) {
|
|
|
208
330
|
return html`
|
|
209
331
|
<nav
|
|
210
332
|
class="side-nav-panel"
|
|
333
|
+
style=${styleMap({ width: `${this._panelState.getSize('side-nav')}px` })}
|
|
211
334
|
?hidden="${!this._slotVisibility['side-nav']}"
|
|
212
335
|
aria-label="${this.localize('components.page.side-nav-label')}">
|
|
213
336
|
<slot name="side-nav" @slotchange="${this.#handleSlotVisibilityChange}"></slot>
|
|
214
337
|
</nav>
|
|
215
338
|
${!this._slotVisibility['side-nav'] ? nothing :
|
|
216
|
-
|
|
339
|
+
this.#renderDivider('side-nav', this.localize('components.page.side-nav-divider-label'), 'start')}
|
|
217
340
|
`;
|
|
218
341
|
}
|
|
219
342
|
|
|
220
343
|
#renderSupportingPanel() {
|
|
221
344
|
return html`
|
|
222
345
|
${!this._slotVisibility['supporting'] ? nothing :
|
|
223
|
-
|
|
346
|
+
this.#renderDivider('supporting', this.localize('components.page.supporting-divider-label'), 'end')}
|
|
224
347
|
<aside
|
|
225
348
|
class="supporting-panel"
|
|
349
|
+
style=${styleMap({ width: `${this._panelState.getSize('supporting')}px` })}
|
|
226
350
|
?hidden="${!this._slotVisibility['supporting']}"
|
|
227
351
|
aria-label="${this.localize('components.page.supporting-panel-label')}">
|
|
228
352
|
<slot name="supporting" @slotchange="${this.#handleSlotVisibilityChange}"></slot>
|
package/custom-elements.json
CHANGED
|
@@ -4984,7 +4984,7 @@
|
|
|
4984
4984
|
"properties": [
|
|
4985
4985
|
{
|
|
4986
4986
|
"name": "styles",
|
|
4987
|
-
"type": "CSSResult[]",
|
|
4987
|
+
"type": "(string | CSSResult)[]",
|
|
4988
4988
|
"default": "[\"inputStyles\",\"inputLabelStyles\"]"
|
|
4989
4989
|
},
|
|
4990
4990
|
{
|
|
@@ -9056,6 +9056,18 @@
|
|
|
9056
9056
|
"name": "selectable",
|
|
9057
9057
|
"type": "boolean"
|
|
9058
9058
|
},
|
|
9059
|
+
{
|
|
9060
|
+
"name": "tiles",
|
|
9061
|
+
"type": "boolean"
|
|
9062
|
+
},
|
|
9063
|
+
{
|
|
9064
|
+
"name": "tile-header",
|
|
9065
|
+
"type": "boolean"
|
|
9066
|
+
},
|
|
9067
|
+
{
|
|
9068
|
+
"name": "actions",
|
|
9069
|
+
"type": "boolean"
|
|
9070
|
+
},
|
|
9059
9071
|
{
|
|
9060
9072
|
"name": "list",
|
|
9061
9073
|
"type": "array",
|
|
@@ -9083,6 +9095,26 @@
|
|
|
9083
9095
|
"attribute": "selectable",
|
|
9084
9096
|
"type": "boolean"
|
|
9085
9097
|
},
|
|
9098
|
+
{
|
|
9099
|
+
"name": "tiles",
|
|
9100
|
+
"attribute": "tiles",
|
|
9101
|
+
"type": "boolean"
|
|
9102
|
+
},
|
|
9103
|
+
{
|
|
9104
|
+
"name": "tileHeader",
|
|
9105
|
+
"attribute": "tile-header",
|
|
9106
|
+
"type": "boolean"
|
|
9107
|
+
},
|
|
9108
|
+
{
|
|
9109
|
+
"name": "actions",
|
|
9110
|
+
"attribute": "actions",
|
|
9111
|
+
"type": "boolean"
|
|
9112
|
+
},
|
|
9113
|
+
{
|
|
9114
|
+
"name": "styles",
|
|
9115
|
+
"type": "CSSResult",
|
|
9116
|
+
"default": "\"css`\\n\\t\\t.actions-containter {\\n\\t\\t\\talign-items: center;\\n\\t\\t\\tdisplay: flex;\\n\\t\\t\\theight: 100%;\\n\\t\\t}\\n\\t`\""
|
|
9117
|
+
},
|
|
9086
9118
|
{
|
|
9087
9119
|
"name": "list",
|
|
9088
9120
|
"attribute": "list",
|
|
@@ -9862,6 +9894,11 @@
|
|
|
9862
9894
|
"description": "The drag-handle label for assistive technology",
|
|
9863
9895
|
"type": "string"
|
|
9864
9896
|
},
|
|
9897
|
+
{
|
|
9898
|
+
"name": "layout",
|
|
9899
|
+
"description": "When layout = tile, the drag handle become horizontal",
|
|
9900
|
+
"type": "string"
|
|
9901
|
+
},
|
|
9865
9902
|
{
|
|
9866
9903
|
"name": "disabled",
|
|
9867
9904
|
"description": "Disables the handle",
|
|
@@ -9882,6 +9919,12 @@
|
|
|
9882
9919
|
"description": "The drag-handle label for assistive technology",
|
|
9883
9920
|
"type": "string"
|
|
9884
9921
|
},
|
|
9922
|
+
{
|
|
9923
|
+
"name": "layout",
|
|
9924
|
+
"attribute": "layout",
|
|
9925
|
+
"description": "When layout = tile, the drag handle become horizontal",
|
|
9926
|
+
"type": "string"
|
|
9927
|
+
},
|
|
9885
9928
|
{
|
|
9886
9929
|
"name": "disabled",
|
|
9887
9930
|
"attribute": "disabled",
|
|
@@ -10386,7 +10429,19 @@
|
|
|
10386
10429
|
},
|
|
10387
10430
|
{
|
|
10388
10431
|
"name": "d2l-list-item-placement-marker",
|
|
10389
|
-
"path": "./components/list/list-item-placement-marker.js"
|
|
10432
|
+
"path": "./components/list/list-item-placement-marker.js",
|
|
10433
|
+
"properties": [
|
|
10434
|
+
{
|
|
10435
|
+
"name": "properties",
|
|
10436
|
+
"type": "{ vertical: { type: BooleanConstructor; reflect: boolean; }; }",
|
|
10437
|
+
"default": "{\"vertical\":{\"type\":\"Boolean\",\"reflect\":true}}"
|
|
10438
|
+
},
|
|
10439
|
+
{
|
|
10440
|
+
"name": "vertical",
|
|
10441
|
+
"type": "boolean",
|
|
10442
|
+
"default": "false"
|
|
10443
|
+
}
|
|
10444
|
+
]
|
|
10390
10445
|
},
|
|
10391
10446
|
{
|
|
10392
10447
|
"name": "d2l-list-item",
|
|
@@ -12352,6 +12407,53 @@
|
|
|
12352
12407
|
}
|
|
12353
12408
|
]
|
|
12354
12409
|
},
|
|
12410
|
+
{
|
|
12411
|
+
"name": "d2l-page-divider-internal",
|
|
12412
|
+
"path": "./components/page/page-divider-internal.js",
|
|
12413
|
+
"description": "Internal divider used by d2l-page to resize its side-nav and supporting panels.",
|
|
12414
|
+
"properties": [
|
|
12415
|
+
{
|
|
12416
|
+
"name": "properties",
|
|
12417
|
+
"type": "{ currentSize: number; label: string; maxSize: number; minSize: number; panelPosition: \"start\" | \"end\"; panelType: \"panel\" | \"drawer\"; }",
|
|
12418
|
+
"default": "{\"currentSize\":{\"type\":\"Number\",\"attribute\":\"current-size\"},\"label\":{\"type\":\"String\",\"required\":true},\"maxSize\":{\"type\":\"Number\",\"attribute\":\"max-size\"},\"minSize\":{\"type\":\"Number\",\"attribute\":\"min-size\"},\"panelPosition\":{\"type\":\"String\",\"attribute\":\"panel-position\"},\"panelType\":{\"type\":\"String\",\"attribute\":\"panel-type\"}}"
|
|
12419
|
+
},
|
|
12420
|
+
{
|
|
12421
|
+
"name": "styles",
|
|
12422
|
+
"type": "CSSResult",
|
|
12423
|
+
"default": "\"css`\\n\\t\\t:host {\\n\\t\\t\\tflex: none;\\n\\t\\t}\\n\\t\\t.divider {\\n\\t\\t\\tbackground-color: var(--d2l-color-gypsum);\\n\\t\\t\\tcursor: ew-resize;\\n\\t\\t\\theight: 100%;\\n\\t\\t\\toutline: none;\\n\\t\\t\\twidth: ${DIVIDER_WIDTH}px;\\n\\t\\t}\\n\\t\\t.divider:hover {\\n\\t\\t\\tbackground-color: var(--d2l-color-mica);\\n\\t\\t}\\n\\t\\t.divider:focus {\\n\\t\\t\\tbackground-color: var(--d2l-color-celestine);\\n\\t\\t}\\n\\n\\t\\t:host([panel-type=\\\"drawer\\\"]) .divider {\\n\\t\\t\\tbackground-color: var(--d2l-color-celestine);\\n\\t\\t\\tcursor: ns-resize;\\n\\t\\t\\theight: ${DIVIDER_WIDTH}px;\\n\\t\\t\\twidth: 100%;\\n\\t\\t}\\n\\n\\t\\t/* TO DO: Lots more divider styling to come */\\n\\n\\t`\""
|
|
12424
|
+
},
|
|
12425
|
+
{
|
|
12426
|
+
"name": "currentSize",
|
|
12427
|
+
"type": "number",
|
|
12428
|
+
"default": "0"
|
|
12429
|
+
},
|
|
12430
|
+
{
|
|
12431
|
+
"name": "label",
|
|
12432
|
+
"type": "string",
|
|
12433
|
+
"default": "\"\""
|
|
12434
|
+
},
|
|
12435
|
+
{
|
|
12436
|
+
"name": "maxSize",
|
|
12437
|
+
"type": "number",
|
|
12438
|
+
"default": "0"
|
|
12439
|
+
},
|
|
12440
|
+
{
|
|
12441
|
+
"name": "minSize",
|
|
12442
|
+
"type": "number",
|
|
12443
|
+
"default": "0"
|
|
12444
|
+
},
|
|
12445
|
+
{
|
|
12446
|
+
"name": "panelPosition",
|
|
12447
|
+
"type": "string",
|
|
12448
|
+
"default": "\"start\""
|
|
12449
|
+
},
|
|
12450
|
+
{
|
|
12451
|
+
"name": "panelType",
|
|
12452
|
+
"type": "string",
|
|
12453
|
+
"default": "\"panel\""
|
|
12454
|
+
}
|
|
12455
|
+
]
|
|
12456
|
+
},
|
|
12355
12457
|
{
|
|
12356
12458
|
"name": "d2l-page-footer",
|
|
12357
12459
|
"path": "./components/page/page-footer.js",
|
|
@@ -12663,13 +12765,13 @@
|
|
|
12663
12765
|
"properties": [
|
|
12664
12766
|
{
|
|
12665
12767
|
"name": "properties",
|
|
12666
|
-
"type": "{ widthType: \"normal\" | \"wide\" | \"fullscreen\"; _headerIsSticky: { state: boolean; };
|
|
12667
|
-
"default": "{\"widthType\":{\"type\":\"String\",\"attribute\":\"width-type\"},\"_headerIsSticky\":{\"state\":true},\"_slotVisibility\":{\"state\":true}}"
|
|
12768
|
+
"type": "{ widthType: \"normal\" | \"wide\" | \"fullscreen\"; _contentWidth: { state: boolean; }; _headerHeight: { state: boolean; }; _headerIsSticky: { state: boolean; }; _footerHeight: { state: boolean; }; _slotVisibility: { ...; }; }",
|
|
12769
|
+
"default": "{\"widthType\":{\"type\":\"String\",\"attribute\":\"width-type\"},\"_contentWidth\":{\"state\":true},\"_headerHeight\":{\"state\":true},\"_headerIsSticky\":{\"state\":true},\"_footerHeight\":{\"state\":true},\"_slotVisibility\":{\"state\":true}}"
|
|
12668
12770
|
},
|
|
12669
12771
|
{
|
|
12670
12772
|
"name": "styles",
|
|
12671
12773
|
"type": "CSSResult",
|
|
12672
|
-
"default": "\"css`\\n\\t\\t:host {\\n\\t\\t\\t--d2l-page-header-max-width: 1230px;\\n\\t\\t\\t--d2l-page-content-max-width: 1230px;\\n\\t\\t\\t--d2l-page-footer-max-width: 1230px;\\n\\t\\t\\t--d2l-page-margin-inline: auto;\\n\\t\\t\\t--d2l-page-padding: 30px;\\n\\t\\t}\\n\\n\\t\\t:host([width-type=\\\"wide\\\"]) {\\n\\t\\t\\t--d2l-page-header-max-width: 1440px;\\n\\t\\t\\t--d2l-page-content-max-width: 1440px;\\n\\t\\t\\t--d2l-page-footer-max-width: 1440px;\\n\\t\\t}\\n\\n\\t\\t:host([width-type=\\\"fullscreen\\\"]) {\\n\\t\\t\\t--d2l-page-header-max-width: 100%;\\n\\t\\t\\t--d2l-page-content-max-width: 100%;\\n\\t\\t\\t--d2l-page-footer-max-width: 100%;\\n\\t\\t}\\n\\n\\t\\t@media (max-width: 929px) {\\n\\t\\t\\t:host {\\n\\t\\t\\t\\t--d2l-page-padding: 24px;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t@media (max-width: 767px) {\\n\\t\\t\\t:host {\\n\\t\\t\\t\\t--d2l-page-padding: 18px;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t.header {\\n\\t\\t\\tposition: relative;\\n\\t\\t\\tz-index: 15; /* To be over sticky content of our core components */\\n\\t\\t}\\n\\n\\t\\t.page.header-sticky .header {\\n\\t\\t\\tposition: sticky;\\n\\t\\t\\ttop: 0;\\n\\t\\t}\\n\\n\\t\\t.content {\\n\\t\\t\\tdisplay: flex;\\n\\t\\t\\tmargin-inline: var(--d2l-page-margin-inline, 0);\\n\\t\\t\\tmax-width: var(--d2l-page-content-max-width, 100%);\\n\\t\\t\\tpadding-bottom: var(--d2l-page-footer-height, 0); /* Reserve space for fixed footer */\\n\\t\\t}\\n\\n\\t\\tmain {\\n\\t\\t\\tflex: 1;\\n\\t\\t\\tmin-width: min(
|
|
12774
|
+
"default": "\"css`\\n\\t\\t:host {\\n\\t\\t\\t--d2l-page-header-max-width: 1230px;\\n\\t\\t\\t--d2l-page-content-max-width: 1230px;\\n\\t\\t\\t--d2l-page-footer-max-width: 1230px;\\n\\t\\t\\t--d2l-page-margin-inline: auto;\\n\\t\\t\\t--d2l-page-padding: 30px;\\n\\t\\t}\\n\\n\\t\\t:host([width-type=\\\"wide\\\"]) {\\n\\t\\t\\t--d2l-page-header-max-width: 1440px;\\n\\t\\t\\t--d2l-page-content-max-width: 1440px;\\n\\t\\t\\t--d2l-page-footer-max-width: 1440px;\\n\\t\\t}\\n\\n\\t\\t:host([width-type=\\\"fullscreen\\\"]) {\\n\\t\\t\\t--d2l-page-header-max-width: 100%;\\n\\t\\t\\t--d2l-page-content-max-width: 100%;\\n\\t\\t\\t--d2l-page-footer-max-width: 100%;\\n\\t\\t}\\n\\n\\t\\t@media (max-width: 929px) {\\n\\t\\t\\t:host {\\n\\t\\t\\t\\t--d2l-page-padding: 24px;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t@media (max-width: 767px) {\\n\\t\\t\\t:host {\\n\\t\\t\\t\\t--d2l-page-padding: 18px;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t.header {\\n\\t\\t\\tposition: relative;\\n\\t\\t\\tz-index: 15; /* To be over sticky content of our core components */\\n\\t\\t}\\n\\n\\t\\t.page.header-sticky .header {\\n\\t\\t\\tposition: sticky;\\n\\t\\t\\ttop: 0;\\n\\t\\t}\\n\\n\\t\\t.content {\\n\\t\\t\\tdisplay: flex;\\n\\t\\t\\tmargin-inline: var(--d2l-page-margin-inline, 0);\\n\\t\\t\\tmax-width: var(--d2l-page-content-max-width, 100%);\\n\\t\\t\\tpadding-bottom: var(--d2l-page-footer-height, 0); /* Reserve space for fixed footer */\\n\\t\\t}\\n\\n\\t\\tmain {\\n\\t\\t\\tflex: 1;\\n\\t\\t\\tmin-width: min(${MAIN_MIN_WIDTH}px, 100%);\\n\\t\\t}\\n\\n\\t\\t.side-nav-panel,\\n\\t\\t.supporting-panel {\\n\\t\\t\\theight: calc(100vh - var(--d2l-page-header-height, 0) - var(--d2l-page-footer-height, 0));\\n\\t\\t\\toverflow: clip auto;\\n\\t\\t\\tposition: sticky;\\n\\t\\t\\ttop: var(--d2l-page-header-height, 0);\\n\\t\\t}\\n\\n\\t\\t.footer:not([hidden]),\\n\\t\\t.floating-buttons-container {\\n\\t\\t\\tdisplay: inline;\\n\\t\\t}\\n\\t\\t.fixed-footer {\\n\\t\\t\\tbackground-color: white;\\n\\t\\t\\tbox-shadow: 0 -2px 4px rgba(32, 33, 34, 0.2); /* ferrite */\\n\\t\\t\\tinset: auto 0 0;\\n\\t\\t\\tpadding-block-start: 0.75rem;\\n\\t\\t\\tposition: fixed;\\n\\t\\t\\tz-index: 10; /* To be over sticky content of our core components */\\n\\t\\t}\\n\\t\\t.footer-contents {\\n\\t\\t\\tmargin-inline: var(--d2l-page-margin-inline, 0);\\n\\t\\t\\tmax-width: var(--d2l-page-footer-max-width, 100%);\\n\\t\\t}\\n\\t`\""
|
|
12673
12775
|
},
|
|
12674
12776
|
{
|
|
12675
12777
|
"name": "widthType",
|
package/lang/ar.js
CHANGED
|
@@ -135,10 +135,13 @@ export default {
|
|
|
135
135
|
"components.list-item.addItem": "إضافة عنصر",
|
|
136
136
|
"components.list-item-drag-handle.default": "إعادة ترتيب إجراء المادة لـ {name}",
|
|
137
137
|
"components.list-item-drag-handle.keyboard": "قم بإعادة ترتيب العنصر، الموضع الحالي {currentPosition} من {size}. لنقل هذا العنصر، اضغط على سهما لأعلى أو لأسفل.",
|
|
138
|
+
"components.list-item-drag-handle.side-to-side.keyboard": "Reorder item, current position {currentPosition} out of {size}. To move this item, press left or right arrows.",
|
|
138
139
|
"components.list-item-drag-handle-tooltip.enter-desc": "تبديل وضع إعادة ترتيب لوحة المفاتيح.",
|
|
139
140
|
"components.list-item-drag-handle-tooltip.enter-key": "إدخال",
|
|
140
141
|
"components.list-item-drag-handle-tooltip.left-right-desc": "غيِّر مستوى التداخل.",
|
|
141
142
|
"components.list-item-drag-handle-tooltip.left-right-key": "يسار/يمين",
|
|
143
|
+
"components.list-item-drag-handle-tooltip.side-to-side.left-right-desc": "Move item left or right in the list.",
|
|
144
|
+
"components.list-item-drag-handle-tooltip.side-to-side.up-down-desc": "Move item left or right in the list.",
|
|
142
145
|
"components.list-item-drag-handle-tooltip.title": "عناصر التحكم بلوحة المفاتيح لإعادة الترتيب:",
|
|
143
146
|
"components.list-item-drag-handle-tooltip.up-down-desc": "نقل المادة إلى الأعلى أو الأسفل في القائمة.",
|
|
144
147
|
"components.list-item-drag-handle-tooltip.up-down-key": "أعلى/أسفل",
|
|
@@ -153,7 +156,9 @@ export default {
|
|
|
153
156
|
"components.object-property-list.item-placeholder-text": "عنصر نائب",
|
|
154
157
|
"components.overflow-group.moreActions": "مزيد من الإجراءات",
|
|
155
158
|
"components.page.header-nav-label": "الرئيسية",
|
|
159
|
+
"components.page.side-nav-divider-label": "Side Navigation Divider",
|
|
156
160
|
"components.page.side-nav-label": "جانبية",
|
|
161
|
+
"components.page.supporting-divider-label": "Supporting Panel Divider",
|
|
157
162
|
"components.page.supporting-panel-label": "Supporting",
|
|
158
163
|
"components.pageable.info":
|
|
159
164
|
`{count, plural,
|
package/lang/ca.js
CHANGED
|
@@ -135,10 +135,13 @@ export default {
|
|
|
135
135
|
"components.list-item.addItem": "Afegeix element",
|
|
136
136
|
"components.list-item-drag-handle.default": "Acció de reordenar l’element per a {name}",
|
|
137
137
|
"components.list-item-drag-handle.keyboard": "Reordenar element, posició actual {currentPosition} de {size}. Per moure aquest element, premeu les fletxes amunt o avall.",
|
|
138
|
+
"components.list-item-drag-handle.side-to-side.keyboard": "Reorder item, current position {currentPosition} out of {size}. To move this item, press left or right arrows.",
|
|
138
139
|
"components.list-item-drag-handle-tooltip.enter-desc": "Canviar el mode de reordenació del teclat.",
|
|
139
140
|
"components.list-item-drag-handle-tooltip.enter-key": "Introduir",
|
|
140
141
|
"components.list-item-drag-handle-tooltip.left-right-desc": "Canviar el nivell d’anidament.",
|
|
141
142
|
"components.list-item-drag-handle-tooltip.left-right-key": "Esquerra/Dreta",
|
|
143
|
+
"components.list-item-drag-handle-tooltip.side-to-side.left-right-desc": "Move item left or right in the list.",
|
|
144
|
+
"components.list-item-drag-handle-tooltip.side-to-side.up-down-desc": "Move item left or right in the list.",
|
|
142
145
|
"components.list-item-drag-handle-tooltip.title": "Controls del teclat per reordenar:",
|
|
143
146
|
"components.list-item-drag-handle-tooltip.up-down-desc": "Mou l’element amunt o avall a la llista.",
|
|
144
147
|
"components.list-item-drag-handle-tooltip.up-down-key": "Amunt/Avall",
|
|
@@ -153,7 +156,9 @@ export default {
|
|
|
153
156
|
"components.object-property-list.item-placeholder-text": "Element de marcador de posició",
|
|
154
157
|
"components.overflow-group.moreActions": "Més accions",
|
|
155
158
|
"components.page.header-nav-label": "Principal",
|
|
159
|
+
"components.page.side-nav-divider-label": "Side Navigation Divider",
|
|
156
160
|
"components.page.side-nav-label": "Lateral",
|
|
161
|
+
"components.page.supporting-divider-label": "Supporting Panel Divider",
|
|
157
162
|
"components.page.supporting-panel-label": "Supporting",
|
|
158
163
|
"components.pageable.info":
|
|
159
164
|
`{count, plural,
|
package/lang/cy.js
CHANGED
|
@@ -135,10 +135,13 @@ export default {
|
|
|
135
135
|
"components.list-item.addItem": "Ychwanegu Eitem",
|
|
136
136
|
"components.list-item-drag-handle.default": "Aildrefnu gweithred eitem ar gyfer {name}",
|
|
137
137
|
"components.list-item-drag-handle.keyboard": "Aildrefnu eitemau, safle presennol {currentPosition} allan o {size}. I symud yr eitem hon, pwyswch y saeth i fyny neu’r saeth i lawr.",
|
|
138
|
+
"components.list-item-drag-handle.side-to-side.keyboard": "Reorder item, current position {currentPosition} out of {size}. To move this item, press left or right arrows.",
|
|
138
139
|
"components.list-item-drag-handle-tooltip.enter-desc": "Toglo’r modd aildrefnu bysellfwrdd.",
|
|
139
140
|
"components.list-item-drag-handle-tooltip.enter-key": "Nodi",
|
|
140
141
|
"components.list-item-drag-handle-tooltip.left-right-desc": "Newid y lefel nythu.",
|
|
141
142
|
"components.list-item-drag-handle-tooltip.left-right-key": "Chwith/De",
|
|
143
|
+
"components.list-item-drag-handle-tooltip.side-to-side.left-right-desc": "Move item left or right in the list.",
|
|
144
|
+
"components.list-item-drag-handle-tooltip.side-to-side.up-down-desc": "Move item left or right in the list.",
|
|
142
145
|
"components.list-item-drag-handle-tooltip.title": "Rheolaethau bysellfwrdd ar gyfer aildrefnu:",
|
|
143
146
|
"components.list-item-drag-handle-tooltip.up-down-desc": "Symud yr eitem i fyny neu i lawr yn y rhestr.",
|
|
144
147
|
"components.list-item-drag-handle-tooltip.up-down-key": "I Fyny/I Lawr",
|
|
@@ -153,7 +156,9 @@ export default {
|
|
|
153
156
|
"components.object-property-list.item-placeholder-text": "Eitem Dalfan",
|
|
154
157
|
"components.overflow-group.moreActions": "Rhagor o Gamau Gweithredu",
|
|
155
158
|
"components.page.header-nav-label": "Prif",
|
|
159
|
+
"components.page.side-nav-divider-label": "Side Navigation Divider",
|
|
156
160
|
"components.page.side-nav-label": "Ochr",
|
|
161
|
+
"components.page.supporting-divider-label": "Supporting Panel Divider",
|
|
157
162
|
"components.page.supporting-panel-label": "Supporting",
|
|
158
163
|
"components.pageable.info":
|
|
159
164
|
`{count, plural,
|