@momentum-design/components 0.120.35 → 0.120.36
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/dist/browser/index.js +8 -8
- package/dist/browser/index.js.map +3 -3
- package/dist/components/input/input.component.d.ts +6 -0
- package/dist/components/input/input.component.js +12 -2
- package/dist/custom-elements.json +571 -495
- package/dist/react/index.d.ts +3 -3
- package/dist/react/index.js +3 -3
- package/package.json +1 -1
|
@@ -132,6 +132,12 @@ declare class Input extends Input_base implements AssociatedFormControl {
|
|
|
132
132
|
* @default ''
|
|
133
133
|
*/
|
|
134
134
|
clearAriaLabel: string;
|
|
135
|
+
/**
|
|
136
|
+
* Defines a id pointing to the element which describes the input element.
|
|
137
|
+
* The AriaDescribedby attribute to be set for accessibility.
|
|
138
|
+
* @default null
|
|
139
|
+
*/
|
|
140
|
+
dataAriaDescribedby: string | null;
|
|
135
141
|
connectedCallback(): void;
|
|
136
142
|
protected firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
|
|
137
143
|
/** @internal */
|
|
@@ -111,6 +111,12 @@ class Input extends AutoFocusOnMountMixin(FormInternalsMixin(DataAriaLabelMixin(
|
|
|
111
111
|
* @default ''
|
|
112
112
|
*/
|
|
113
113
|
this.clearAriaLabel = '';
|
|
114
|
+
/**
|
|
115
|
+
* Defines a id pointing to the element which describes the input element.
|
|
116
|
+
* The AriaDescribedby attribute to be set for accessibility.
|
|
117
|
+
* @default null
|
|
118
|
+
*/
|
|
119
|
+
this.dataAriaDescribedby = null;
|
|
114
120
|
}
|
|
115
121
|
connectedCallback() {
|
|
116
122
|
super.connectedCallback();
|
|
@@ -300,7 +306,7 @@ class Input extends AutoFocusOnMountMixin(FormInternalsMixin(DataAriaLabelMixin(
|
|
|
300
306
|
`;
|
|
301
307
|
}
|
|
302
308
|
renderInputElement(type, hidePlaceholder = false) {
|
|
303
|
-
var _a;
|
|
309
|
+
var _a, _b;
|
|
304
310
|
const placeholderText = hidePlaceholder ? '' : this.placeholder;
|
|
305
311
|
return html `<input
|
|
306
312
|
aria-label="${(_a = this.dataAriaLabel) !== null && _a !== void 0 ? _a : ''}"
|
|
@@ -312,7 +318,7 @@ class Input extends AutoFocusOnMountMixin(FormInternalsMixin(DataAriaLabelMixin(
|
|
|
312
318
|
?readonly="${this.readonly}"
|
|
313
319
|
?required="${this.required}"
|
|
314
320
|
type="${type}"
|
|
315
|
-
aria-describedby="${ifDefined(this.helpText ? FORMFIELD_DEFAULTS.HELPER_TEXT_ID : '')}"
|
|
321
|
+
aria-describedby="${ifDefined(this.helpText ? FORMFIELD_DEFAULTS.HELPER_TEXT_ID : ((_b = this.dataAriaDescribedby) !== null && _b !== void 0 ? _b : ''))}"
|
|
316
322
|
aria-invalid="${this.helpTextType === 'error' ? 'true' : 'false'}"
|
|
317
323
|
placeholder=${ifDefined(placeholderText)}
|
|
318
324
|
minlength=${ifDefined(this.minlength)}
|
|
@@ -396,4 +402,8 @@ __decorate([
|
|
|
396
402
|
property({ type: String, attribute: 'clear-aria-label' }),
|
|
397
403
|
__metadata("design:type", Object)
|
|
398
404
|
], Input.prototype, "clearAriaLabel", void 0);
|
|
405
|
+
__decorate([
|
|
406
|
+
property({ type: String, reflect: true, attribute: 'data-aria-describedby' }),
|
|
407
|
+
__metadata("design:type", Object)
|
|
408
|
+
], Input.prototype, "dataAriaDescribedby", void 0);
|
|
399
409
|
export default Input;
|