@brightspace-ui/core 3.94.3 → 3.95.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/button/button-icon.js +2 -7
- package/components/overflow-group/overflow-group.js +3 -22
- package/components/selection/selection-controls.js +4 -16
- package/components/tabs/demo/tabs.html +3 -0
- package/components/tabs/tab-mixin.js +10 -0
- package/components/tabs/tab.js +11 -0
- package/components/tabs/tabs.js +6 -0
- package/custom-elements.json +4 -0
- package/package.json +1 -1
@@ -9,14 +9,13 @@ 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
11
|
import { PropertyRequiredMixin } from '../../mixins/property-required/property-required-mixin.js';
|
12
|
-
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
13
12
|
import { ThemeMixin } from '../../mixins/theme/theme-mixin.js';
|
14
13
|
|
15
14
|
/**
|
16
15
|
* A button component that can be used just like the native button for instances where only an icon is displayed.
|
17
16
|
* @slot icon - Optional slot for a custom icon
|
18
17
|
*/
|
19
|
-
class ButtonIcon extends PropertyRequiredMixin(ThemeMixin(ButtonMixin(VisibleOnAncestorMixin(
|
18
|
+
class ButtonIcon extends PropertyRequiredMixin(ThemeMixin(ButtonMixin(VisibleOnAncestorMixin(LitElement)))) {
|
20
19
|
|
21
20
|
static get properties() {
|
22
21
|
return {
|
@@ -103,11 +102,7 @@ class ButtonIcon extends PropertyRequiredMixin(ThemeMixin(ButtonMixin(VisibleOnA
|
|
103
102
|
}
|
104
103
|
|
105
104
|
:host([h-align="text"]) button {
|
106
|
-
|
107
|
-
}
|
108
|
-
:host([dir="rtl"][h-align="text"]) button {
|
109
|
-
left: 0;
|
110
|
-
right: var(--d2l-button-icon-h-align);
|
105
|
+
inset-inline-start: var(--d2l-button-icon-h-align);
|
111
106
|
}
|
112
107
|
|
113
108
|
/* Firefox includes a hidden border which messes up button dimensions */
|
@@ -13,7 +13,6 @@ import '../menu/menu-item-link.js';
|
|
13
13
|
import { css, html, LitElement } from 'lit';
|
14
14
|
import { OVERFLOW_CLASS, OVERFLOW_MINI_CLASS, OverflowGroupMixin } from './overflow-group-mixin.js';
|
15
15
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
16
|
-
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
17
16
|
|
18
17
|
const OPENER_STYLE = {
|
19
18
|
DEFAULT: 'default',
|
@@ -58,7 +57,7 @@ function createMenuItemSeparator() {
|
|
58
57
|
* @attr {'default'|'icon'} [opener-type="default"] - Set the opener type to 'icon' for a `...` menu icon instead of `More actions` text
|
59
58
|
* @attr {boolean} auto-show - Use predefined classes on slot elements to set min and max buttons to show
|
60
59
|
*/
|
61
|
-
class OverflowGroup extends OverflowGroupMixin(
|
60
|
+
class OverflowGroup extends OverflowGroupMixin(LitElement) {
|
62
61
|
|
63
62
|
static get properties() {
|
64
63
|
return {
|
@@ -87,15 +86,7 @@ class OverflowGroup extends OverflowGroupMixin(RtlMixin(LitElement)) {
|
|
87
86
|
::slotted(span),
|
88
87
|
::slotted(d2l-dropdown:not(.d2l-overflow-dropdown)),
|
89
88
|
::slotted(d2l-dropdown-button) {
|
90
|
-
margin-
|
91
|
-
}
|
92
|
-
:host([dir="rtl"]) ::slotted(d2l-button),
|
93
|
-
:host([dir="rtl"]) ::slotted(d2l-link),
|
94
|
-
:host([dir="rtl"]) ::slotted(span),
|
95
|
-
:host([dir="rtl"]) ::slotted(d2l-dropdown:not(.d2l-overflow-dropdown)),
|
96
|
-
:host([dir="rtl"]) ::slotted(d2l-dropdown-button) {
|
97
|
-
margin-left: 0.6rem;
|
98
|
-
margin-right: 0;
|
89
|
+
margin-inline-end: 0.6rem;
|
99
90
|
}
|
100
91
|
::slotted(d2l-button-subtle),
|
101
92
|
::slotted(d2l-button-icon),
|
@@ -104,17 +95,7 @@ class OverflowGroup extends OverflowGroupMixin(RtlMixin(LitElement)) {
|
|
104
95
|
::slotted(d2l-dropdown-context-menu),
|
105
96
|
::slotted(d2l-selection-action),
|
106
97
|
::slotted(d2l-selection-action-dropdown) {
|
107
|
-
margin-
|
108
|
-
}
|
109
|
-
:host([dir="rtl"]) ::slotted(d2l-button-subtle),
|
110
|
-
:host([dir="rtl"]) ::slotted(d2l-button-icon),
|
111
|
-
:host([dir="rtl"]) ::slotted(d2l-dropdown-button-subtle),
|
112
|
-
:host([dir="rtl"]) ::slotted(d2l-dropdown-more),
|
113
|
-
:host([dir="rtl"]) ::slotted(d2l-dropdown-context-menu),
|
114
|
-
:host([dir="rtl"]) ::slotted(d2l-selection-action),
|
115
|
-
:host([dir="rtl"]) ::slotted(d2l-selection-action-dropdown) {
|
116
|
-
margin-left: 0.2rem;
|
117
|
-
margin-right: 0;
|
98
|
+
margin-inline-end: 0.2rem;
|
118
99
|
}
|
119
100
|
`];
|
120
101
|
}
|
@@ -8,7 +8,6 @@ import { formatNumber } from '@brightspace-ui/intl/lib/number.js';
|
|
8
8
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
9
9
|
import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
10
10
|
import { PageableSubscriberMixin } from '../paging/pageable-subscriber-mixin.js';
|
11
|
-
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
12
11
|
import { SelectionObserverMixin } from './selection-observer-mixin.js';
|
13
12
|
|
14
13
|
/**
|
@@ -16,7 +15,7 @@ import { SelectionObserverMixin } from './selection-observer-mixin.js';
|
|
16
15
|
* @slot - Responsive container using `d2l-overflow-group` for `d2l-selection-action` elements
|
17
16
|
* @fires d2l-selection-observer-subscribe - Internal event
|
18
17
|
*/
|
19
|
-
export class SelectionControls extends PageableSubscriberMixin(SelectionObserverMixin(
|
18
|
+
export class SelectionControls extends PageableSubscriberMixin(SelectionObserverMixin(LocalizeCoreElement(LitElement))) {
|
20
19
|
|
21
20
|
static get properties() {
|
22
21
|
return {
|
@@ -95,27 +94,16 @@ export class SelectionControls extends PageableSubscriberMixin(SelectionObserver
|
|
95
94
|
flex: none;
|
96
95
|
}
|
97
96
|
d2l-selection-select-all + d2l-selection-summary {
|
98
|
-
margin-
|
99
|
-
}
|
100
|
-
:host([dir="rtl"]) d2l-selection-select-all + d2l-selection-summary {
|
101
|
-
margin-left: 0;
|
102
|
-
margin-right: 0.9rem;
|
97
|
+
margin-inline-start: 0.9rem;
|
103
98
|
}
|
104
99
|
d2l-selection-select-all-pages {
|
105
100
|
flex: none;
|
106
|
-
margin-
|
107
|
-
}
|
108
|
-
:host([dir="rtl"]) d2l-selection-select-all-pages {
|
109
|
-
margin-left: 0;
|
110
|
-
margin-right: 0.45rem;
|
101
|
+
margin-inline-start: 0.45rem;
|
111
102
|
}
|
112
103
|
.d2l-selection-controls-actions {
|
113
104
|
--d2l-overflow-group-justify-content: flex-end;
|
114
105
|
flex: auto;
|
115
|
-
text-align:
|
116
|
-
}
|
117
|
-
:host([dir="rtl"]) .d2l-selection-controls-actions {
|
118
|
-
text-align: left;
|
106
|
+
text-align: end;
|
119
107
|
}
|
120
108
|
.d2l-sticky-edge {
|
121
109
|
left: 0;
|
@@ -193,6 +193,9 @@
|
|
193
193
|
document.addEventListener('d2l-tab-panel-text-changed', (e) => {
|
194
194
|
console.log('tab panel text changed', e);
|
195
195
|
});
|
196
|
+
document.addEventListener('d2l-tab-content-change', (e) => {
|
197
|
+
console.log('tab content changed', e);
|
198
|
+
});
|
196
199
|
</script>
|
197
200
|
|
198
201
|
</body>
|
@@ -112,6 +112,16 @@ export const TabMixin = superclass => class extends SkeletonMixin(superclass) {
|
|
112
112
|
}
|
113
113
|
}
|
114
114
|
|
115
|
+
/**
|
116
|
+
* IMPORTANT: Call this in any consumer when anything changes that could impact the tab's size
|
117
|
+
* Notifies the parent d2l-tabs component of a change so that it can update virtual scrolling calculations
|
118
|
+
* */
|
119
|
+
dispatchContentChangeEvent() {
|
120
|
+
this.dispatchEvent(new CustomEvent(
|
121
|
+
'd2l-tab-content-change', { bubbles: true, composed: true }
|
122
|
+
));
|
123
|
+
}
|
124
|
+
|
115
125
|
renderContent() {
|
116
126
|
console.warn('Subclasses to implement/override renderContent');
|
117
127
|
return html`<div>Default Tab Content</div>`;
|
package/components/tabs/tab.js
CHANGED
@@ -3,6 +3,9 @@ import { classMap } from 'lit/directives/class-map.js';
|
|
3
3
|
import { getFocusPseudoClass } from '../../helpers/focus.js';
|
4
4
|
import { TabMixin } from './tab-mixin.js';
|
5
5
|
|
6
|
+
/**
|
7
|
+
* @fires d2l-tab-content-change - Dispatched when the text attribute is changed. Triggers virtual scrolling calculations in parent d2l-tabs.
|
8
|
+
*/
|
6
9
|
class Tab extends TabMixin(LitElement) {
|
7
10
|
|
8
11
|
static get properties() {
|
@@ -38,6 +41,14 @@ class Tab extends TabMixin(LitElement) {
|
|
38
41
|
return styles;
|
39
42
|
}
|
40
43
|
|
44
|
+
updated(changedProperties) {
|
45
|
+
super.updated(changedProperties);
|
46
|
+
|
47
|
+
if (changedProperties.has('text')) {
|
48
|
+
this.dispatchContentChangeEvent();
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
41
52
|
renderContent() {
|
42
53
|
const contentClasses = {
|
43
54
|
'd2l-tab-text': true,
|
package/components/tabs/tabs.js
CHANGED
@@ -343,6 +343,7 @@ class Tabs extends LocalizeCoreElement(ArrowKeysMixin(SkeletonMixin(LitElement))
|
|
343
343
|
</div>
|
344
344
|
${this.arrowKeysContainer(html`
|
345
345
|
<div class="d2l-tabs-container-list"
|
346
|
+
@d2l-tab-content-change="${this._handleTabContentChange}"
|
346
347
|
@d2l-tab-selected="${this._handleTabSelected}"
|
347
348
|
@focusout="${this._handleFocusOut}"
|
348
349
|
aria-label="${ifDefined(this.text)}"
|
@@ -718,6 +719,11 @@ class Tabs extends LocalizeCoreElement(ArrowKeysMixin(SkeletonMixin(LitElement))
|
|
718
719
|
|
719
720
|
}
|
720
721
|
|
722
|
+
async _handleTabContentChange() {
|
723
|
+
this._updateMeasures();
|
724
|
+
await this._updateScrollVisibility(this._getMeasures());
|
725
|
+
}
|
726
|
+
|
721
727
|
async _handleTabSelected(e) {
|
722
728
|
if (this._defaultSlotBehavior) {
|
723
729
|
this._handleTabSelectedDefaultSlotBehavior(e);
|
package/custom-elements.json
CHANGED
@@ -12892,6 +12892,10 @@
|
|
12892
12892
|
}
|
12893
12893
|
],
|
12894
12894
|
"events": [
|
12895
|
+
{
|
12896
|
+
"name": "d2l-tab-content-change",
|
12897
|
+
"description": "Dispatched when the text attribute is changed. Triggers virtual scrolling calculations in parent d2l-tabs."
|
12898
|
+
},
|
12895
12899
|
{
|
12896
12900
|
"name": "d2l-tab-selected"
|
12897
12901
|
},
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@brightspace-ui/core",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.95.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",
|