@brightspace-ui/core 3.285.0 → 3.286.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/page/page.js +14 -2
- package/custom-elements.json +4 -4
- package/helpers/README.md +8 -8
- package/helpers/dom.js +26 -16
- package/helpers/focus.js +22 -5
- package/package.json +1 -1
package/components/page/page.js
CHANGED
|
@@ -7,11 +7,12 @@ import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
|
|
7
7
|
import { ProviderMixin } from '../../mixins/provider/provider-mixin.js';
|
|
8
8
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
9
9
|
|
|
10
|
+
const VALID_STATE_STORAGE_KEY = /^[a-z0-9_-]+$/i;
|
|
10
11
|
export const panelStateStorageKey = key => `d2l-page-panel-state-${key}`;
|
|
11
12
|
|
|
12
13
|
const DRAWER_MIN_HEIGHT = 200; // TO DO: Confirm
|
|
13
|
-
const MAIN_MIN_WIDTH = 600; // TO DO: Confirm
|
|
14
|
-
const PANEL_MIN_WIDTH = 320;
|
|
14
|
+
export const MAIN_MIN_WIDTH = 600; // TO DO: Confirm
|
|
15
|
+
export const PANEL_MIN_WIDTH = 320;
|
|
15
16
|
|
|
16
17
|
export const SIDE_NAV_DEFAULT_WIDTH = 334;
|
|
17
18
|
export const supportingDefaultWidth = contentWidth => Math.floor(contentWidth / 3);
|
|
@@ -348,6 +349,16 @@ class Page extends ProviderMixin(LocalizeCoreElement(LitElement)) {
|
|
|
348
349
|
});
|
|
349
350
|
}
|
|
350
351
|
|
|
352
|
+
get stateStorageKey() { return this.#stateStorageKey; }
|
|
353
|
+
set stateStorageKey(value) {
|
|
354
|
+
if (value && !VALID_STATE_STORAGE_KEY.test(value)) {
|
|
355
|
+
this.#stateStorageKey = undefined;
|
|
356
|
+
throw new Error(`d2l-page: invalid state-storage-key "${value}". Keys may only contain alphanumeric characters, dashes, and underscores.`);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
this.#stateStorageKey = value;
|
|
360
|
+
}
|
|
361
|
+
|
|
351
362
|
connectedCallback() {
|
|
352
363
|
super.connectedCallback();
|
|
353
364
|
window.addEventListener('resize', this.#handleWindowResize);
|
|
@@ -399,6 +410,7 @@ class Page extends ProviderMixin(LocalizeCoreElement(LitElement)) {
|
|
|
399
410
|
}
|
|
400
411
|
|
|
401
412
|
#resizeObserver;
|
|
413
|
+
#stateStorageKey;
|
|
402
414
|
|
|
403
415
|
#handleWindowResize = () => {
|
|
404
416
|
this._panelState.updateMaxSize('supporting-mobile', this.#getMaxDrawerHeight());
|
package/custom-elements.json
CHANGED
|
@@ -13587,16 +13587,16 @@
|
|
|
13587
13587
|
}
|
|
13588
13588
|
],
|
|
13589
13589
|
"properties": [
|
|
13590
|
+
{
|
|
13591
|
+
"name": "styles",
|
|
13592
|
+
"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: 16; /* To be over sticky content of our core components and the divider */\\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\\tbox-sizing: border-box;\\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\\t\\t.content.has-panels {\\n\\t\\t\\tmin-height: calc(100vh - var(--d2l-page-header-height-measured, 0px));\\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,\\n\\t\\t.supporting {\\n\\t\\t\\tdisplay: contents;\\n\\t\\t}\\n\\n\\t\\t.side-nav-panel,\\n\\t\\t.supporting-panel {\\n\\t\\t\\toverflow: hidden;\\n\\t\\t}\\n\\n\\t\\t.side-nav-panel,\\n\\t\\t.supporting-panel,\\n\\t\\t.divider {\\n\\t\\t\\tposition: sticky;\\n\\t\\t\\ttop: var(--d2l-page-header-height, 0);\\n\\t\\t}\\n\\n\\t\\t.side-nav-panel,\\n\\t\\t.supporting-panel,\\n\\t\\t.side-nav-panel-content,\\n\\t\\t.supporting-panel-content,\\n\\t\\t.divider {\\n\\t\\t\\tmax-height: calc(100vh - var(--d2l-page-header-height, 0) - var(--d2l-page-footer-height, 0));\\n\\t\\t}\\n\\n\\t\\t.side-nav-panel-content,\\n\\t\\t.supporting-panel-content {\\n\\t\\t\\tbox-sizing: border-box;\\n\\t\\t\\toverflow: clip auto;\\n\\t\\t}\\n\\t\\t.side-nav-panel-content {\\n\\t\\t\\tfloat: inline-end;\\n\\t\\t}\\n\\t\\t.supporting-panel-content {\\n\\t\\t\\tfloat: inline-start;\\n\\t\\t}\\n\\n\\t\\t.divider {\\n\\t\\t\\tz-index: 15; /* To be over d2l-page-* panel headers */\\n\\t\\t}\\n\\n\\t\\t.side-nav .divider[collapsed] {\\n\\t\\t\\tmargin-inline-start: 18px;\\n\\t\\t}\\n\\t\\t.supporting .divider[collapsed] {\\n\\t\\t\\tmargin-inline-end: 18px;\\n\\t\\t}\\n\\t\\t.side-nav-panel.collapsed,\\n\\t\\t.supporting-panel.collapsed {\\n\\t\\t\\tvisibility: hidden;\\n\\t\\t}\\n\\t\\t@media (prefers-reduced-motion: no-preference) {\\n\\t\\t\\t.side-nav-panel.animate,\\n\\t\\t\\t.supporting-panel.animate,\\n\\t\\t\\t.side-nav-panel.animate .side-nav-panel-content,\\n\\t\\t\\t.supporting-panel.animate .supporting-panel-content {\\n\\t\\t\\t\\ttransition: width 400ms cubic-bezier(0, 0.7, 0.5, 1);\\n\\t\\t\\t}\\n\\t\\t\\t.divider.animate {\\n\\t\\t\\t\\ttransition: margin 400ms cubic-bezier(0, 0.7, 0.5, 1);\\n\\t\\t\\t}\\n\\t\\t\\t.side-nav-panel.animate.collapsed,\\n\\t\\t\\t.supporting-panel.animate.collapsed {\\n\\t\\t\\t\\ttransition: width 400ms cubic-bezier(0, 0.7, 0.5, 1), visibility 0s 400ms;\\n\\t\\t\\t}\\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: 15; /* To be over sticky content of our core components and divider */\\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`\""
|
|
13593
|
+
},
|
|
13590
13594
|
{
|
|
13591
13595
|
"name": "stateStorageKey",
|
|
13592
13596
|
"attribute": "state-storage-key",
|
|
13593
13597
|
"description": "Key used to optionally store page state across reloads (using localStorage). Different pages should use different keys.\nCurrently, this includes panel state info.",
|
|
13594
13598
|
"type": "string"
|
|
13595
13599
|
},
|
|
13596
|
-
{
|
|
13597
|
-
"name": "styles",
|
|
13598
|
-
"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: 16; /* To be over sticky content of our core components and the divider */\\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\\tbox-sizing: border-box;\\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\\t\\t.content.has-panels {\\n\\t\\t\\tmin-height: calc(100vh - var(--d2l-page-header-height-measured, 0px));\\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,\\n\\t\\t.supporting {\\n\\t\\t\\tdisplay: contents;\\n\\t\\t}\\n\\n\\t\\t.side-nav-panel,\\n\\t\\t.supporting-panel {\\n\\t\\t\\toverflow: hidden;\\n\\t\\t}\\n\\n\\t\\t.side-nav-panel,\\n\\t\\t.supporting-panel,\\n\\t\\t.divider {\\n\\t\\t\\tposition: sticky;\\n\\t\\t\\ttop: var(--d2l-page-header-height, 0);\\n\\t\\t}\\n\\n\\t\\t.side-nav-panel,\\n\\t\\t.supporting-panel,\\n\\t\\t.side-nav-panel-content,\\n\\t\\t.supporting-panel-content,\\n\\t\\t.divider {\\n\\t\\t\\tmax-height: calc(100vh - var(--d2l-page-header-height, 0) - var(--d2l-page-footer-height, 0));\\n\\t\\t}\\n\\n\\t\\t.side-nav-panel-content,\\n\\t\\t.supporting-panel-content {\\n\\t\\t\\tbox-sizing: border-box;\\n\\t\\t\\toverflow: clip auto;\\n\\t\\t}\\n\\t\\t.side-nav-panel-content {\\n\\t\\t\\tfloat: inline-end;\\n\\t\\t}\\n\\t\\t.supporting-panel-content {\\n\\t\\t\\tfloat: inline-start;\\n\\t\\t}\\n\\n\\t\\t.divider {\\n\\t\\t\\tz-index: 15; /* To be over d2l-page-* panel headers */\\n\\t\\t}\\n\\n\\t\\t.side-nav .divider[collapsed] {\\n\\t\\t\\tmargin-inline-start: 18px;\\n\\t\\t}\\n\\t\\t.supporting .divider[collapsed] {\\n\\t\\t\\tmargin-inline-end: 18px;\\n\\t\\t}\\n\\t\\t.side-nav-panel.collapsed,\\n\\t\\t.supporting-panel.collapsed {\\n\\t\\t\\tvisibility: hidden;\\n\\t\\t}\\n\\t\\t@media (prefers-reduced-motion: no-preference) {\\n\\t\\t\\t.side-nav-panel.animate,\\n\\t\\t\\t.supporting-panel.animate,\\n\\t\\t\\t.side-nav-panel.animate .side-nav-panel-content,\\n\\t\\t\\t.supporting-panel.animate .supporting-panel-content {\\n\\t\\t\\t\\ttransition: width 400ms cubic-bezier(0, 0.7, 0.5, 1);\\n\\t\\t\\t}\\n\\t\\t\\t.divider.animate {\\n\\t\\t\\t\\ttransition: margin 400ms cubic-bezier(0, 0.7, 0.5, 1);\\n\\t\\t\\t}\\n\\t\\t\\t.side-nav-panel.animate.collapsed,\\n\\t\\t\\t.supporting-panel.animate.collapsed {\\n\\t\\t\\t\\ttransition: width 400ms cubic-bezier(0, 0.7, 0.5, 1), visibility 0s 400ms;\\n\\t\\t\\t}\\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: 15; /* To be over sticky content of our core components and divider */\\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`\""
|
|
13599
|
-
},
|
|
13600
13600
|
{
|
|
13601
13601
|
"name": "widthType",
|
|
13602
13602
|
"attribute": "width-type",
|
package/helpers/README.md
CHANGED
|
@@ -89,6 +89,10 @@ findComposedAncestor(node, predicate);
|
|
|
89
89
|
// includes optional predicate for filtering child elements
|
|
90
90
|
getComposedChildren(element, predicate = () => true);
|
|
91
91
|
|
|
92
|
+
//gets the composed next ancestor sibling by walking the composed ancestors
|
|
93
|
+
// includes optional predicate for filtering elements
|
|
94
|
+
getComposedNextAncestorElementSibling(node, { predicate });
|
|
95
|
+
|
|
92
96
|
// gets the composed next element sibling considing how children are distributed into slots
|
|
93
97
|
// includes optional predicate for filtering elements
|
|
94
98
|
getComposedNextElementSibling(node, { predicate });
|
|
@@ -96,6 +100,10 @@ getComposedNextElementSibling(node, { predicate });
|
|
|
96
100
|
// gets the composed parent (including shadow host & insertion points)
|
|
97
101
|
getComposedParent(node);
|
|
98
102
|
|
|
103
|
+
//gets the composed previous ancestor sibling by walking the composed ancestors
|
|
104
|
+
// includes optional predicate for filtering elements
|
|
105
|
+
getComposedPreviousAncestorElementSibling(node, { predicate });
|
|
106
|
+
|
|
99
107
|
// gets the composed previous element sibling considing how children are distributed into slots
|
|
100
108
|
// includes optional predicate for filtering elements
|
|
101
109
|
getComposedPreviousElementSibling(node, { predicate });
|
|
@@ -103,14 +111,6 @@ getComposedPreviousElementSibling(node, { predicate });
|
|
|
103
111
|
// returns the first visible ancestor of the given node
|
|
104
112
|
getFirstVisibleAncestor(node)
|
|
105
113
|
|
|
106
|
-
// returns the next composed sibling at least one dom level up
|
|
107
|
-
// includes optional predicate for filtering elements
|
|
108
|
-
getNextAncestorSibling(node, predicate = () => true);
|
|
109
|
-
|
|
110
|
-
// returns the previous composed sibling at least one dom level up
|
|
111
|
-
// includes optional predicate for filtering elements
|
|
112
|
-
getPreviousAncestorSibling(node, predicate = () => true);
|
|
113
|
-
|
|
114
114
|
// browser consistent implementation of HTMLElement.offsetParent
|
|
115
115
|
getOffsetParent(node);
|
|
116
116
|
|
package/helpers/dom.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { getFlag } from './flags.js';
|
|
2
|
+
|
|
1
3
|
// needed for legacy-Edge, after it's removed use CSS.escape directly
|
|
2
4
|
export function cssEscape(val) {
|
|
3
5
|
if (window.CSS && window.CSS.escape) {
|
|
@@ -148,6 +150,22 @@ function getComposedElementSibling(node, { direction = 'next', predicate } = {})
|
|
|
148
150
|
return null;
|
|
149
151
|
}
|
|
150
152
|
|
|
153
|
+
export function getComposedNextAncestorElementSibling(node, { predicate } = {}) {
|
|
154
|
+
|
|
155
|
+
const focusableFixFlag = getFlag('GAUD-10260-get-focusable-fix', true);
|
|
156
|
+
|
|
157
|
+
let parentNode = getComposedParent(node);
|
|
158
|
+
|
|
159
|
+
while (parentNode) {
|
|
160
|
+
// Clean-up this next line when cleaning up GAUD-10260-get-focusable-fix
|
|
161
|
+
const nextParentSibling = focusableFixFlag ? getComposedNextElementSibling(parentNode, { predicate }) : parentNode.nextElementSibling;
|
|
162
|
+
if (nextParentSibling) return nextParentSibling;
|
|
163
|
+
parentNode = getComposedParent(parentNode);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
return null;
|
|
167
|
+
}
|
|
168
|
+
|
|
151
169
|
export function getComposedNextElementSibling(node, { predicate } = {}) {
|
|
152
170
|
return getComposedElementSibling(node, { direction: 'next', predicate });
|
|
153
171
|
}
|
|
@@ -175,32 +193,24 @@ export function getComposedParent(node) {
|
|
|
175
193
|
|
|
176
194
|
}
|
|
177
195
|
|
|
178
|
-
export function
|
|
179
|
-
|
|
180
|
-
|
|
196
|
+
export function getComposedPreviousAncestorElementSibling(node, { predicate } = {}) {
|
|
197
|
+
|
|
198
|
+
const focusableFixFlag = getFlag('GAUD-10260-get-focusable-fix', true);
|
|
181
199
|
|
|
182
|
-
export function getNextAncestorSibling(node, predicate = () => true) {
|
|
183
200
|
let parentNode = getComposedParent(node);
|
|
184
201
|
|
|
185
202
|
while (parentNode) {
|
|
186
|
-
|
|
187
|
-
|
|
203
|
+
// Clean-up this next line when cleaning up GAUD-10260-get-focusable-fix
|
|
204
|
+
const previousParentSibling = focusableFixFlag ? getComposedPreviousElementSibling(parentNode, { predicate }) : parentNode.previousElementSibling;
|
|
205
|
+
if (previousParentSibling) return previousParentSibling;
|
|
188
206
|
parentNode = getComposedParent(parentNode);
|
|
189
207
|
}
|
|
190
208
|
|
|
191
209
|
return null;
|
|
192
210
|
}
|
|
193
211
|
|
|
194
|
-
export function
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
while (parentNode) {
|
|
198
|
-
const previousParentSibling = parentNode.previousElementSibling;
|
|
199
|
-
if (previousParentSibling && predicate(previousParentSibling)) return previousParentSibling;
|
|
200
|
-
parentNode = getComposedParent(parentNode);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
return null;
|
|
212
|
+
export function getComposedPreviousElementSibling(node, { predicate } = {}) {
|
|
213
|
+
return getComposedElementSibling(node, { direction: 'previous', predicate });
|
|
204
214
|
}
|
|
205
215
|
|
|
206
216
|
export function getOffsetParent(node) {
|
package/helpers/focus.js
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { css, unsafeCSS } from 'lit';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
getComposedChildren,
|
|
4
|
+
getComposedNextAncestorElementSibling,
|
|
5
|
+
getComposedNextElementSibling,
|
|
6
|
+
getComposedParent,
|
|
7
|
+
getComposedPreviousAncestorElementSibling,
|
|
8
|
+
getComposedPreviousElementSibling,
|
|
9
|
+
getFirstVisibleAncestor,
|
|
10
|
+
isVisible
|
|
11
|
+
} from './dom.js';
|
|
12
|
+
import { getFlag } from './flags.js';
|
|
3
13
|
|
|
4
14
|
const focusableElements = {
|
|
5
15
|
a: true,
|
|
@@ -123,6 +133,9 @@ export function getLastFocusableDescendant(node, includeHidden) {
|
|
|
123
133
|
}
|
|
124
134
|
|
|
125
135
|
export function getPreviousFocusable(node, includeHidden) {
|
|
136
|
+
|
|
137
|
+
const focusableFixFlag = getFlag('GAUD-10260-get-focusable-fix', true);
|
|
138
|
+
|
|
126
139
|
if (!node) return null;
|
|
127
140
|
|
|
128
141
|
if (includeHidden === undefined) includeHidden = false;
|
|
@@ -135,14 +148,15 @@ export function getPreviousFocusable(node, includeHidden) {
|
|
|
135
148
|
if (focusable) return focusable;
|
|
136
149
|
}
|
|
137
150
|
|
|
138
|
-
|
|
151
|
+
// Clean-up this next line when cleaning up GAUD-10260-get-focusable-fix
|
|
152
|
+
const previousSibling = focusableFixFlag ? getComposedPreviousElementSibling(node) : node.previousElementSibling;
|
|
139
153
|
if (previousSibling) {
|
|
140
154
|
const siblingFocusable = _getPreviousFocusable(previousSibling, false, false);
|
|
141
155
|
if (siblingFocusable) return siblingFocusable;
|
|
142
156
|
return null;
|
|
143
157
|
}
|
|
144
158
|
|
|
145
|
-
const previousAncestorSibling =
|
|
159
|
+
const previousAncestorSibling = getComposedPreviousAncestorElementSibling(node);
|
|
146
160
|
if (previousAncestorSibling) {
|
|
147
161
|
const parentSibingFocusable = _getPreviousFocusable(previousAncestorSibling, false, false);
|
|
148
162
|
if (parentSibingFocusable) return parentSibingFocusable;
|
|
@@ -157,6 +171,8 @@ export function getPreviousFocusable(node, includeHidden) {
|
|
|
157
171
|
|
|
158
172
|
export function getNextFocusable(node, includeHidden, ignore, ignoreChildren) {
|
|
159
173
|
|
|
174
|
+
const focusableFixFlag = getFlag('GAUD-10260-get-focusable-fix', true);
|
|
175
|
+
|
|
160
176
|
if (!node) return null;
|
|
161
177
|
|
|
162
178
|
if (includeHidden === undefined) includeHidden = false;
|
|
@@ -171,14 +187,15 @@ export function getNextFocusable(node, includeHidden, ignore, ignoreChildren) {
|
|
|
171
187
|
if (focusable) return focusable;
|
|
172
188
|
}
|
|
173
189
|
|
|
174
|
-
|
|
190
|
+
// Clean-up this next line when cleaning up GAUD-10260-get-focusable-fix
|
|
191
|
+
const nextSibling = focusableFixFlag ? getComposedNextElementSibling(node) : node.nextElementSibling;
|
|
175
192
|
if (nextSibling) {
|
|
176
193
|
const siblingFocusable = _getNextFocusable(nextSibling, false, false);
|
|
177
194
|
if (siblingFocusable) return siblingFocusable;
|
|
178
195
|
return null;
|
|
179
196
|
}
|
|
180
197
|
|
|
181
|
-
const nextParentSibling =
|
|
198
|
+
const nextParentSibling = getComposedNextAncestorElementSibling(node);
|
|
182
199
|
if (nextParentSibling) {
|
|
183
200
|
const parentSibingFocusable = _getNextFocusable(nextParentSibling, false, false);
|
|
184
201
|
if (parentSibingFocusable) return parentSibingFocusable;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.286.1",
|
|
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",
|