@brightspace-ui/core 3.99.0 → 3.99.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.
@@ -198,34 +198,33 @@ export const SwitchMixin = superclass => class extends FocusMixin(RtlMixin(super
|
|
198
198
|
|
199
199
|
// Note: we render the switchLabel in the case of textPosition === 'hidden' so that any slot handlers can pick up on content being passed in
|
200
200
|
return html`
|
201
|
-
${textPosition === 'start' ? switchLabel : ''}
|
202
201
|
<div
|
203
|
-
aria-checked="${this.on ? 'true' : 'false'}"
|
204
|
-
aria-label="${ifDefined(textPosition === 'hidden' ? this.text : undefined)}"
|
205
|
-
aria-labelledby="${ifDefined(textPosition !== 'hidden' ? this._textId : undefined)}"
|
206
|
-
class="d2l-switch-container"
|
207
202
|
@click="${this._handleClick}"
|
208
|
-
@
|
209
|
-
@
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
203
|
+
@mouseenter="${this._handleSwitchHover}"
|
204
|
+
@mouseleave="${this._handleSwitchHoverLeave}">
|
205
|
+
${textPosition === 'start' ? switchLabel : ''}
|
206
|
+
<div
|
207
|
+
aria-checked="${this.on ? 'true' : 'false'}"
|
208
|
+
aria-label="${ifDefined(textPosition === 'hidden' ? this.text : undefined)}"
|
209
|
+
aria-labelledby="${ifDefined(textPosition !== 'hidden' ? this._textId : undefined)}"
|
210
|
+
class="d2l-switch-container"
|
211
|
+
@keydown="${this._handleKeyDown}"
|
212
|
+
@keyup="${this._handleKeyUp}"
|
213
|
+
role="switch"
|
214
|
+
tabindex="${ifDefined(tabindex)}">
|
215
|
+
<div class="${classMap(innerSwitchClasses)}">
|
216
|
+
<div class="d2l-switch-icon-on">${this.onIcon}</div>
|
217
|
+
<div class="d2l-switch-icon-off">${this.offIcon}</div>
|
218
|
+
<div class="d2l-switch-toggle"><div></div></div>
|
219
|
+
</div>
|
216
220
|
</div>
|
221
|
+
${textPosition === 'end' || textPosition === 'hidden' ? switchLabel : ''}
|
217
222
|
</div>
|
218
|
-
${textPosition === 'end' || textPosition === 'hidden' ? switchLabel : ''}
|
219
223
|
`;
|
220
224
|
}
|
221
225
|
|
222
226
|
get _labelContent() {
|
223
|
-
return
|
224
|
-
@click='${this._handleClick}'
|
225
|
-
@mouseenter='${this._handleSwitchHover}'
|
226
|
-
@mouseleave='${this._handleSwitchHoverLeave}'>
|
227
|
-
${this.text}
|
228
|
-
</span>`;
|
227
|
+
return this.text;
|
229
228
|
}
|
230
229
|
|
231
230
|
_handleClick() {
|
@@ -81,7 +81,8 @@ class VisibilitySwitch extends LocalizeCoreElement(SwitchMixin(LitElement)) {
|
|
81
81
|
class="${classMap(tooltipHelpClasses)}"
|
82
82
|
id="conditions-help"
|
83
83
|
inherit-font-style
|
84
|
-
text="${this.localize('components.switch.conditions')}"
|
84
|
+
text="${this.localize('components.switch.conditions')}"
|
85
|
+
@click="${this._handleTooltipClick}">
|
85
86
|
<slot @slotchange="${this._handleConditionsSlotChange}"></slot>
|
86
87
|
</d2l-tooltip-help>
|
87
88
|
`;
|
@@ -93,6 +94,10 @@ class VisibilitySwitch extends LocalizeCoreElement(SwitchMixin(LitElement)) {
|
|
93
94
|
const nodes = e.target.assignedNodes({ flatten: true });
|
94
95
|
this._hasConditions = !!nodes[0]?.textContent?.trim();
|
95
96
|
}
|
97
|
+
|
98
|
+
_handleTooltipClick(e) {
|
99
|
+
e.stopPropagation();
|
100
|
+
}
|
96
101
|
}
|
97
102
|
|
98
103
|
customElements.define('d2l-switch-visibility', VisibilitySwitch);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@brightspace-ui/core",
|
3
|
-
"version": "3.99.
|
3
|
+
"version": "3.99.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",
|