Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_enableFormSupport() {
const FormSupport = getFeature("FormSupport");
if (FormSupport) {
FormSupport.syncNativeHiddenInput(this, (element, nativeInput) => {
nativeInput.disabled = element.disabled;
nativeInput.value = element._currentlySelectedOption.value;
});
} else if (this.name) {
console.warn(`In order for the "name" property to have effect, you should also: import "@ui5/webcomponents/dist/features/InputElementsFormSupport.js";`); // eslint-disable-line
}
}
onBeforeRendering() {
this._exceededTextProps = this._calcExceededText();
this._mirrorText = this._tokenizeText(this.value);
this.exceeding = this._exceededTextProps.leftCharactersCount < 0;
if (this.growingMaxLines) {
// this should be complex calc between line height and paddings - TODO: make it stable
this._maxHeight = `${this.growingMaxLines * 1.4 * 14 + 9}px`;
}
const FormSupport = getFeature("FormSupport");
if (FormSupport) {
FormSupport.syncNativeHiddenInput(this);
} else if (this.name) {
console.warn(`In order for the "name" property to have effect, you should also: import "@ui5/webcomponents/dist/features/InputElementsFormSupport.js";`); // eslint-disable-line
}
}
_enableFormSupport() {
const FormSupport = getFeature("FormSupport");
if (FormSupport) {
FormSupport.syncNativeHiddenInput(this, (element, nativeInput) => {
nativeInput.disabled = element.disabled || !element.checked;
nativeInput.value = element.checked ? "on" : "";
});
} else if (this.name) {
console.warn(`In order for the "name" property to have effect, you should also: import "@ui5/webcomponents/dist/features/InputElementsFormSupport.js";`); // eslint-disable-line
}
}
onBeforeRendering() {
if (this.showSuggestions) {
this.enableSuggestions();
}
const FormSupport = getFeature("FormSupport");
if (FormSupport) {
FormSupport.syncNativeHiddenInput(this);
} else if (this.name) {
console.warn(`In order for the "name" property to have effect, you should also: import "@ui5/webcomponents/dist/features/InputElementsFormSupport.js";`); // eslint-disable-line
}
}
onBeforeRendering() {
this._calendar.primaryCalendarType = this._primaryCalendarType;
this._calendar.formatPattern = this._formatPattern;
if (this.isValid(this.value)) {
this._changeCalendarSelection();
} else {
this._calendar.selectedDates = [];
}
const FormSupport = getFeature("FormSupport");
if (FormSupport) {
FormSupport.syncNativeHiddenInput(this);
} else if (this.name) {
console.warn(`In order for the "name" property to have effect, you should also: import "@ui5/webcomponents/dist/features/InputElementsFormSupport.js";`); // eslint-disable-line
}
}
_onclick(event) {
event.isMarked = "button";
const FormSupport = getFeature("FormSupport");
if (FormSupport) {
FormSupport.triggerFormSubmit(this);
}
}
enableSuggestions() {
if (this.Suggestions) {
return;
}
const Suggestions = getFeature("InputSuggestions");
if (Suggestions) {
this.Suggestions = new Suggestions(this, "suggestionItems");
} else {
throw new Error(`You have to import "@ui5/webcomponents/dist/features/InputSuggestions.js" module to use ui5-input suggestions`);
}
}