Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
handleInput(e) {
let m = moment(e.target.value, this.displayFormat, true);
this.localInputValue = e.target.value;
if(!m.isValid()) {
this.$field.$emit('error', `${lang('form.date.validation_error.format')} (${this.displayFormat})`);
this.showPicker = false;
}
else {
this.rollback();
this.$emit('input', m);
this.showPicker = true;
}
},
submitLabel() {
if(this.uploading) {
return lang('action_bar.form.submit_button.pending.upload')
}
return this.create
? lang('action_bar.form.submit_button.create')
: lang('action_bar.form.submit_button.update');
},
},
label(element, extra) {
let localeKey = `action_bar.form.${element}`, stateLabel;
if(this.actionsState) {
let { state, modifier } = this.actionsState;
stateLabel = lang(`${localeKey}.${state}.${modifier}`);
}
if(!stateLabel && extra) localeKey+=`.${extra}`;
return stateLabel || lang(localeKey);
},
emitAction() {
default: () => lang('form.multiselect.placeholder')
},
default: () => lang('form.multiselect.placeholder')
},
label(element, extra) {
let localeKey = `action_bar.form.${element}`, stateLabel;
if(this.actionsState) {
let { state, modifier } = this.actionsState;
stateLabel = lang(`${localeKey}.${state}.${modifier}`);
}
if(!stateLabel && extra) localeKey+=`.${extra}`;
return stateLabel || lang(localeKey);
},
emitAction() {
submitLabel() {
if(this.uploading) {
return lang('action_bar.form.submit_button.pending.upload')
}
return this.create
? lang('action_bar.form.submit_button.create')
: lang('action_bar.form.submit_button.update');
},
},
.catch(error => {
const { data } = error.response;
if(error.response.status === 422) {
showAlert(data.message, {
title: lang('modals.state.422.title'),
isError: true,
});
}
})
},