Merge branch 'address_refactoring' into ggg

This commit is contained in:
Mathieu Jaumotte 2021-08-12 15:53:42 +02:00
commit 368bbcf9b2

View File

@ -205,25 +205,38 @@ export default {
return step2; return step2;
}, },
getTextTitle() { getTextTitle() {
if (this.options.title && (this.options.title.edit !== null || this.options.title.create !== null)) { if ( typeof this.options.title !== 'undefined'
&& ( this.options.title.edit !== null
|| this.options.title.create !== null
)) {
return (this.context.edit) ? this.options.title.edit : this.options.title.create; return (this.context.edit) ? this.options.title.edit : this.options.title.create;
} }
return (this.context.edit) ? this.$t(this.default.title.edit) : this.$t(this.default.title.create); return (this.context.edit) ? this.$t(this.default.title.edit) : this.$t(this.default.title.create);
}, },
getTextButton() { getTextButton() {
if (this.options.button && this.options.button.text && (this.options.button.text.edit !== null || this.options.button.text.create !== null)) { if ( typeof this.options.button.text !== 'undefined'
&& ( this.options.button.text.edit !== null
|| this.options.button.text.create !== null
)) {
return (this.context.edit) ? this.options.button.text.edit : this.options.button.text.create; return (this.context.edit) ? this.options.button.text.edit : this.options.button.text.create;
} }
return (this.context.edit) ? this.default.button.text.edit : this.default.button.text.create; return (this.context.edit) ? this.default.button.text.edit : this.default.button.text.create;
}, },
getClassButton() { getClassButton() {
let size = (this.options.button && this.options.button.size !== null) ? this.options.button.size : ''; let type = this.default.button.type,
let type = (this.options.button && this.options.button.type !== null) ? this.options.button.type : this.default.button.type; size = '';
return size ? size + ' ' + type : type; if (typeof this.options.button !== 'undefined') {
type = typeof this.options.button.type !== 'undefined' ? this.options.button.type : type;
size = typeof this.options.button.size !== 'undefined' ? this.options.button.size : size;
}
return size ? `${size} ${type}` : type;
}, },
displayTextButton() { displayTextButton() {
return (this.options.button !== null && typeof this.options.button.display !== 'undefined') ? return (typeof this.options.button !== 'undefined' && typeof this.options.button.display !== 'undefined') ?
this.options.button.display : this.default.button.display; this.options.button.display : this.default.button.display;
},
context() {
return this.context;
} }
}, },
mounted() { mounted() {