@brightspace-ui/core 3.342.1 → 3.343.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.
|
@@ -24,6 +24,7 @@ import '../tooltip/tooltip.js';
|
|
|
24
24
|
|
|
25
25
|
import { bodyCompactStyles, bodySmallStyles, bodyStandardStyles, heading4Styles } from '../typography/styles.js';
|
|
26
26
|
import { css, html, LitElement, nothing } from 'lit';
|
|
27
|
+
import { getNextFocusable, getPreviousFocusable } from '../../helpers/focus.js';
|
|
27
28
|
import { getOverflowDeclarations, overflowEllipsisDeclarations } from '../../helpers/overflow.js';
|
|
28
29
|
import { announce } from '../../helpers/announce.js';
|
|
29
30
|
import { classMap } from 'lit/directives/class-map.js';
|
|
@@ -471,6 +472,7 @@ class Filter extends FocusMixin(LocalizeCoreElement(LitElement)) {
|
|
|
471
472
|
|
|
472
473
|
const clear = html`
|
|
473
474
|
<d2l-button-subtle
|
|
475
|
+
class="button-clear"
|
|
474
476
|
@click="${this._handleClear}"
|
|
475
477
|
?disabled="${dimension.loading || dimension.appliedCount === 0}"
|
|
476
478
|
description="${this.localize('components.filter.clearDescription', { filterName: dimension.text })}"
|
|
@@ -765,18 +767,21 @@ class Filter extends FocusMixin(LocalizeCoreElement(LitElement)) {
|
|
|
765
767
|
|
|
766
768
|
_handleClear() {
|
|
767
769
|
const dimension = this._getActiveDimension();
|
|
770
|
+
announce(this.localize('components.filter.clearAnnounce', { filterName: dimension.text }));
|
|
768
771
|
|
|
769
772
|
if (dimension.searchType !== 'none') {
|
|
770
773
|
this._handleClearSearch(dimension);
|
|
771
774
|
const searchInput = this.shadowRoot.querySelector('d2l-input-search');
|
|
772
775
|
if (searchInput) searchInput.value = '';
|
|
773
776
|
}
|
|
774
|
-
|
|
777
|
+
const buttonClear = this.shadowRoot.querySelector('.button-clear');
|
|
778
|
+
if (this.shadowRoot.activeElement === buttonClear) {
|
|
779
|
+
const focusable = getNextFocusable(buttonClear, false, true, true) ?? getPreviousFocusable(buttonClear, false, true, true);
|
|
780
|
+
focusable?.focus();
|
|
781
|
+
}
|
|
775
782
|
this._performDimensionClear(dimension);
|
|
776
783
|
this._dispatchChangeEventNow(false);
|
|
777
784
|
this.requestUpdate();
|
|
778
|
-
|
|
779
|
-
announce(this.localize('components.filter.clearAnnounce', { filterName: dimension.text }));
|
|
780
785
|
}
|
|
781
786
|
|
|
782
787
|
_handleClearAll() {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
import { getFlag } from '../../helpers/flags.js';
|
|
3
2
|
|
|
4
|
-
const OffSCREEN_SIZELESS = getFlag('d2l-offscreen-sizeless', true);
|
|
5
3
|
const HAS_DOCUMENT = globalThis.document !== undefined;
|
|
6
4
|
|
|
7
5
|
/**
|
|
@@ -9,12 +7,12 @@ const HAS_DOCUMENT = globalThis.document !== undefined;
|
|
|
9
7
|
*/
|
|
10
8
|
export const _offscreenStyleDeclarations = css`
|
|
11
9
|
direction: var(--d2l-document-direction, ${ !HAS_DOCUMENT ? css`unset` : (document.dir === 'rtl' ? css`rtl` : css`ltr`)}); /* stylelint-disable-line @stylistic/string-quotes */
|
|
12
|
-
height:
|
|
10
|
+
height: 0;
|
|
13
11
|
inset-inline-start: -10000px;
|
|
14
12
|
overflow: hidden;
|
|
15
13
|
position: absolute !important;
|
|
16
14
|
white-space: nowrap;
|
|
17
|
-
width:
|
|
15
|
+
width: 0;
|
|
18
16
|
`;
|
|
19
17
|
|
|
20
18
|
export const offscreenStyles = css`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.343.0",
|
|
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",
|