Merge pull request #2835 from brkcvn/modal-refactor
Modal component refactored
This commit is contained in:
commit
ab88fe413c
@ -224,37 +224,11 @@ export default {
|
|||||||
precision: 2,
|
precision: 2,
|
||||||
masked: false /* doesn't work with directive */
|
masked: false /* doesn't work with directive */
|
||||||
},
|
},
|
||||||
color: '#55588b',
|
|
||||||
predefineColors: [
|
|
||||||
'#3c3f72',
|
|
||||||
'#55588b',
|
|
||||||
'#e5e5e5',
|
|
||||||
'#328aef',
|
|
||||||
'#efad32',
|
|
||||||
'#ef3232',
|
|
||||||
'#efef32'
|
|
||||||
],
|
|
||||||
min_date: false,
|
|
||||||
selected_card: null,
|
selected_card: null,
|
||||||
item_name_input: false,
|
|
||||||
price_name_input: false,
|
|
||||||
quantity_name_input: false,
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
setMinDate(date) {
|
|
||||||
this.min_date = date;
|
|
||||||
},
|
|
||||||
|
|
||||||
onChangeColor() {
|
|
||||||
this.form.color = this.color;
|
|
||||||
},
|
|
||||||
|
|
||||||
onChangeColorInput() {
|
|
||||||
this.color = this.form.color;
|
|
||||||
},
|
|
||||||
|
|
||||||
onChangeRate() {
|
onChangeRate() {
|
||||||
this.form.rate = this.form.rate.replace(',', '.');
|
this.form.rate = this.form.rate.replace(',', '.');
|
||||||
},
|
},
|
||||||
@ -299,43 +273,6 @@ export default {
|
|||||||
.catch(error => {
|
.catch(error => {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onSmallWidthColumn(item) {
|
|
||||||
this.$refs[item].$el.classList.remove('sm:col-span-6');
|
|
||||||
this.$refs[item].$el.classList.add('sm:col-span-3');
|
|
||||||
},
|
|
||||||
|
|
||||||
onFullWidthColumn(item) {
|
|
||||||
this.$refs[item].$el.classList.add('sm:col-span-6');
|
|
||||||
this.$refs[item].$el.classList.remove('sm:col-span-3');
|
|
||||||
},
|
|
||||||
|
|
||||||
settingsInvoice() {
|
|
||||||
if (this.form.item_name == 'custom') {
|
|
||||||
this.item_name_input = true;
|
|
||||||
this.onSmallWidthColumn("item_name");
|
|
||||||
} else {
|
|
||||||
this.item_name_input = false;
|
|
||||||
this.onFullWidthColumn("item_name");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.form.price_name == 'custom') {
|
|
||||||
this.price_name_input = true;
|
|
||||||
this.onSmallWidthColumn("price_name");
|
|
||||||
} else {
|
|
||||||
this.price_name_input = false;
|
|
||||||
this.onFullWidthColumn("price_name");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.form.quantity_name == 'custom') {
|
|
||||||
this.quantity_name_input = true;
|
|
||||||
this.onSmallWidthColumn("quantity_name");
|
|
||||||
} else {
|
|
||||||
this.quantity_name_input = false;
|
|
||||||
this.onFullWidthColumn("quantity_name");
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
|
46
resources/assets/js/mixins/global.js
vendored
46
resources/assets/js/mixins/global.js
vendored
@ -119,6 +119,11 @@ export default {
|
|||||||
storeCard: false,
|
storeCard: false,
|
||||||
card_id: 0,
|
card_id: 0,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
min_date: false,
|
||||||
|
item_name_input: false,
|
||||||
|
price_name_input: false,
|
||||||
|
quantity_name_input: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -1261,5 +1266,46 @@ export default {
|
|||||||
this.errors.push(e);
|
this.errors.push(e);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
//custom input settings for invoice
|
||||||
|
onSmallWidthColumn(item) {
|
||||||
|
this.$refs[item].$el.setAttribute('custom-half', true);
|
||||||
|
},
|
||||||
|
|
||||||
|
onFullWidthColumn(item) {
|
||||||
|
this.$refs[item].$el.removeAttribute('custom-half');
|
||||||
|
},
|
||||||
|
|
||||||
|
settingsInvoice() {
|
||||||
|
if (this.form.item_name == 'custom') {
|
||||||
|
this.item_name_input = true;
|
||||||
|
this.onSmallWidthColumn("item_name");
|
||||||
|
} else {
|
||||||
|
this.item_name_input = false;
|
||||||
|
this.onFullWidthColumn("item_name");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.form.price_name == 'custom') {
|
||||||
|
this.price_name_input = true;
|
||||||
|
this.onSmallWidthColumn("price_name");
|
||||||
|
} else {
|
||||||
|
this.price_name_input = false;
|
||||||
|
this.onFullWidthColumn("price_name");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.form.quantity_name == 'custom') {
|
||||||
|
this.quantity_name_input = true;
|
||||||
|
this.onSmallWidthColumn("quantity_name");
|
||||||
|
} else {
|
||||||
|
this.quantity_name_input = false;
|
||||||
|
this.onFullWidthColumn("quantity_name");
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
// set minimum date for date component
|
||||||
|
setMinDate(date) {
|
||||||
|
this.min_date = date;
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
35
resources/assets/js/views/settings/settings.js
vendored
35
resources/assets/js/views/settings/settings.js
vendored
@ -141,41 +141,6 @@ const app = new Vue({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onSmallWidthColumn(item) {
|
|
||||||
this.$refs[item].$el.setAttribute('custom-half', true);
|
|
||||||
},
|
|
||||||
|
|
||||||
onFullWidthColumn(item) {
|
|
||||||
this.$refs[item].$el.removeAttribute('custom-half');
|
|
||||||
},
|
|
||||||
|
|
||||||
settingsInvoice() {
|
|
||||||
if (this.form.item_name == 'custom') {
|
|
||||||
this.item_name_input = true;
|
|
||||||
this.onSmallWidthColumn("item_name");
|
|
||||||
} else {
|
|
||||||
this.item_name_input = false;
|
|
||||||
this.onFullWidthColumn("item_name");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.form.price_name == 'custom') {
|
|
||||||
this.price_name_input = true;
|
|
||||||
this.onSmallWidthColumn("price_name");
|
|
||||||
} else {
|
|
||||||
this.price_name_input = false;
|
|
||||||
this.onFullWidthColumn("price_name");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.form.quantity_name == 'custom') {
|
|
||||||
this.quantity_name_input = true;
|
|
||||||
this.onSmallWidthColumn("quantity_name");
|
|
||||||
} else {
|
|
||||||
this.quantity_name_input = false;
|
|
||||||
this.onFullWidthColumn("quantity_name");
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
// Change currency get money
|
// Change currency get money
|
||||||
onChangeCurrency(currency_code) {
|
onChangeCurrency(currency_code) {
|
||||||
if (! currency_code) {
|
if (! currency_code) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user