feat: Replace new Vue() with custom event bus (no-changelog) (#5780)

* refactor: replace new Vue() with custom event bus (no-changelog)

* fix: export types from design system main

* fix: update component types

* fix: update form inputs event bus
This commit is contained in:
Alex Grozav
2023-04-06 16:32:45 +03:00
committed by GitHub
parent 89c12fc1a7
commit 5651a52364
67 changed files with 347 additions and 210 deletions

View File

@@ -43,9 +43,10 @@
</template>
<script lang="ts">
import Vue from 'vue';
import Vue, { PropType } from 'vue';
import { useUIStore } from '@/stores/ui';
import { mapStores } from 'pinia';
import { EventBus } from '@/event-bus';
export default Vue.extend({
name: 'Modal',
@@ -60,7 +61,7 @@ export default Vue.extend({
type: String,
},
eventBus: {
type: Vue,
type: Object as PropType<EventBus>,
},
showClose: {
type: Boolean,
@@ -121,11 +122,11 @@ export default Vue.extend({
window.addEventListener('keydown', this.onWindowKeydown);
if (this.$props.eventBus) {
this.$props.eventBus.$on('close', () => {
this.$props.eventBus.on('close', () => {
this.closeDialog();
});
this.$props.eventBus.$on('closeAll', () => {
this.$props.eventBus.on('closeAll', () => {
this.uiStore.closeAllModals();
});
}