@brightspace-ui/core 3.137.4 → 3.138.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/components/tabs/README.md +2 -2
- package/components/tabs/tab.js +12 -2
- package/custom-elements.json +2 -2
- package/package.json +1 -1
@@ -129,8 +129,8 @@ An element that displays the corresponding tab panel when selected.
|
|
129
129
|
|
130
130
|
| Slot | Description |
|
131
131
|
|--|--|
|
132
|
-
| `before` | Slot for content to be displayed before the tab text |
|
133
|
-
| `after` | Slot for content to be displayed after the tab text |
|
132
|
+
| `before` | Slot for content to be displayed before the tab text. Supports `d2l-icon`, `d2l-icon-custom`, and `d2l-count-badge`. Only the *first* item assigned to this slot will be shown. |
|
133
|
+
| `after` | Slot for content to be displayed after the tab text. Supports `d2l-icon`, `d2l-icon-custom`, and `d2l-count-badge`. Only the *last* item assigned to this slot will be shown. |
|
134
134
|
|
135
135
|
### Events
|
136
136
|
- `d2l-tab-content-change`: Dispatched when the text attribute is changed. Triggers virtual scrolling calculations in parent `d2l-tabs`.
|
package/components/tabs/tab.js
CHANGED
@@ -6,8 +6,8 @@ import { TabMixin } from './tab-mixin.js';
|
|
6
6
|
/**
|
7
7
|
* @attr {string} id - REQUIRED: Unique identifier for the tab
|
8
8
|
* @fires d2l-tab-content-change - Dispatched when the text attribute is changed. Triggers virtual scrolling calculations in parent d2l-tabs.
|
9
|
-
* @slot before - Slot for content to be displayed before the tab text
|
10
|
-
* @slot after - Slot for content to be displayed after the tab text
|
9
|
+
* @slot before - Slot for content to be displayed before the tab text. Supports `d2l-icon`, `d2l-icon-custom`, and `d2l-count-badge`. Only the *first* item assigned to this slot will be shown.
|
10
|
+
* @slot after - Slot for content to be displayed after the tab text. Supports `d2l-icon`, `d2l-icon-custom`, and `d2l-count-badge`. Only the *last* item assigned to this slot will be shown.
|
11
11
|
*/
|
12
12
|
class Tab extends TabMixin(LitElement) {
|
13
13
|
|
@@ -59,6 +59,16 @@ class Tab extends TabMixin(LitElement) {
|
|
59
59
|
:host([skeleton]) .d2l-tab-content.d2l-skeletize::before {
|
60
60
|
inset-block: 0.15rem;
|
61
61
|
}
|
62
|
+
|
63
|
+
/**
|
64
|
+
* Only allow d2l-icon, d2l-count-badge, and d2l-icon-custom in the before/after slots
|
65
|
+
* Only show the first item in the before slot and the last item in the after slot
|
66
|
+
*/
|
67
|
+
::slotted([slot]:not(d2l-icon):not(d2l-count-badge):not(d2l-icon-custom)),
|
68
|
+
::slotted([slot="before"]:not(:first-child)),
|
69
|
+
::slotted([slot="after"]:not(:last-child)) {
|
70
|
+
display: none;
|
71
|
+
}
|
62
72
|
`];
|
63
73
|
|
64
74
|
super.styles && styles.unshift(super.styles);
|
package/custom-elements.json
CHANGED
@@ -13799,11 +13799,11 @@
|
|
13799
13799
|
"slots": [
|
13800
13800
|
{
|
13801
13801
|
"name": "before",
|
13802
|
-
"description": "Slot for content to be displayed before the tab text"
|
13802
|
+
"description": "Slot for content to be displayed before the tab text. Supports `d2l-icon`, `d2l-icon-custom`, and `d2l-count-badge`. Only the *first* item assigned to this slot will be shown."
|
13803
13803
|
},
|
13804
13804
|
{
|
13805
13805
|
"name": "after",
|
13806
|
-
"description": "Slot for content to be displayed after the tab text"
|
13806
|
+
"description": "Slot for content to be displayed after the tab text. Supports `d2l-icon`, `d2l-icon-custom`, and `d2l-count-badge`. Only the *last* item assigned to this slot will be shown."
|
13807
13807
|
}
|
13808
13808
|
]
|
13809
13809
|
},
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@brightspace-ui/core",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.138.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",
|