Repository URL to install this package:
|
Version:
3.6.2 ▾
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @todo 1. belongs in input deps?
* @todo 2. could be as an input method?
* @todo 3. how to put this at the plugin level?
*/
function resetInput(inputState) {
// To reset textbox
if (inputState.type !== 'button' &&
inputState.type !== 'label' &&
inputState.type !== 'select') {
if (!inputState.setValue) {
console.warn('inputState missing setValue');
console.log(inputState);
console.log('\n\n\n');
}
else {
inputState.setValue('');
}
// inputState.isValidInput = true
}
// To reset groupElements
if (inputState.elementList && inputState.elementList.length > 0) {
inputState.elementList.forEach(resetInput);
}
if (inputState.type === 'select') {
inputState.setValue(inputState.label);
}
// To reset the 'show password' state
if (inputState.name === 'password') {
inputState.type = 'password';
}
}
exports.resetInput = resetInput;
//# sourceMappingURL=deps.js.map