2019-11-20 19:46:03 +00:00
|
|
|
import ProgressDialogComponent from './components/ProgressDialogComponent.vue';
|
2018-10-19 18:15:57 +00:00
|
|
|
import Overlay from './Overlay';
|
|
|
|
import Vue from 'vue';
|
|
|
|
|
|
|
|
var component;
|
|
|
|
|
|
|
|
class ProgressDialog extends Overlay {
|
2019-11-20 19:46:03 +00:00
|
|
|
constructor({progressPerc, progressText, iconClass, message, title, hint, timestamp, ...options}) {
|
2018-10-19 18:15:57 +00:00
|
|
|
component = new Vue({
|
2019-11-20 19:46:03 +00:00
|
|
|
provide: {
|
|
|
|
iconClass,
|
|
|
|
message,
|
|
|
|
title,
|
|
|
|
hint,
|
|
|
|
timestamp
|
|
|
|
},
|
2018-10-19 18:15:57 +00:00
|
|
|
components: {
|
2019-11-20 19:46:03 +00:00
|
|
|
ProgressDialogComponent: ProgressDialogComponent
|
2018-10-19 18:15:57 +00:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
model: {
|
|
|
|
progressPerc: progressPerc || 0,
|
2019-11-20 19:46:03 +00:00
|
|
|
progressText
|
2018-10-19 18:15:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2019-11-20 19:46:03 +00:00
|
|
|
template: '<progress-dialog-component :model="model"></progress-dialog-component>'
|
2018-10-19 18:15:57 +00:00
|
|
|
}).$mount();
|
|
|
|
|
|
|
|
super({
|
|
|
|
element: component.$el,
|
|
|
|
size: 'fit',
|
2019-01-25 00:23:50 +00:00
|
|
|
dismissable: false,
|
2018-10-19 18:15:57 +00:00
|
|
|
...options
|
|
|
|
});
|
|
|
|
|
|
|
|
this.once('destroy', () => {
|
|
|
|
component.$destroy();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
updateProgress(progressPerc, progressText) {
|
|
|
|
component.model.progressPerc = progressPerc;
|
|
|
|
component.model.progressText = progressText;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ProgressDialog;
|