@brightspace-ui/core 2.80.10 → 2.80.11
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../colors/colors.js';
|
|
2
2
|
import '../tooltip/tooltip.js';
|
|
3
|
-
import { css, html, LitElement } from 'lit';
|
|
3
|
+
import { css, html, LitElement, nothing } from 'lit';
|
|
4
4
|
import { classMap } from 'lit/directives/class-map.js';
|
|
5
5
|
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
6
6
|
import { formatNumber } from '@brightspace-ui/intl/lib/number.js';
|
|
@@ -460,18 +460,23 @@ class InputText extends FocusMixin(LabelledMixin(FormElementMixin(SkeletonMixin(
|
|
|
460
460
|
<div class="d2l-input-inside-before" @keypress="${this._suppressEvent}">${this.dir === 'rtl' ? unit : ''}<slot name="${firstSlotName}" @slotchange="${this._handleSlotChange}"></slot></div>
|
|
461
461
|
<div class="d2l-input-inside-after" @keypress="${this._suppressEvent}">${this.dir !== 'rtl' ? unit : ''}<slot name="${lastSlotName}" @slotchange="${this._handleSlotChange}"></slot></div>
|
|
462
462
|
${ (!isValid && !this.hideInvalidIcon && !this._focused) ? html`<div class="d2l-input-text-invalid-icon" style="${styleMap(invalidIconStyles)}" @click="${this._handleInvalidIconClick}"></div>` : null}
|
|
463
|
-
${ this.validationError ? html`<d2l-tooltip for=${this._inputId} state="error" align="start">${this.validationError} <span class="d2l-offscreen">${this.description}</span></d2l-tooltip>` : null }
|
|
464
463
|
</div><div id="after-slot" class="d2l-skeletize" ?hidden="${!this._hasAfterContent}"><slot name="after" @slotchange="${this._handleAfterSlotChange}"></slot></div>
|
|
465
464
|
</div>
|
|
466
465
|
${offscreenContainer}
|
|
467
466
|
`;
|
|
467
|
+
|
|
468
|
+
let label = nothing;
|
|
468
469
|
if (this.label && !this.labelHidden && !this.labelledBy) {
|
|
469
470
|
const unitLabel = this._getUnitLabel();
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
471
|
+
label = html`<label class="d2l-input-label d2l-skeletize" for="${this._inputId}">${this.label}${unitLabel ? html`<span class="d2l-offscreen">${unitLabel}</span>` : ''}</label>`;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
let tooltip = nothing;
|
|
475
|
+
if (this.validationError && !this.skeleton) {
|
|
476
|
+
tooltip = html`<d2l-tooltip state="error" align="start">${this.validationError} <span class="d2l-offscreen">${this.description}</span></d2l-tooltip>`;
|
|
473
477
|
}
|
|
474
|
-
|
|
478
|
+
|
|
479
|
+
return html`${tooltip}${label}${input}`;
|
|
475
480
|
}
|
|
476
481
|
|
|
477
482
|
updated(changedProperties) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "2.80.
|
|
3
|
+
"version": "2.80.11",
|
|
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",
|