2020-01-29 20:37:25 +01:00
|
|
|
<template>
|
2023-04-08 02:01:42 +02:00
|
|
|
<XModalWindow
|
|
|
|
ref="dialog"
|
|
|
|
:width="400"
|
|
|
|
@close="onClose"
|
|
|
|
@closed="emit('closed')"
|
|
|
|
>
|
|
|
|
<template #header>{{ i18n.ts.login }}</template>
|
2020-10-17 13:12:00 +02:00
|
|
|
|
2023-04-08 02:01:42 +02:00
|
|
|
<MkSignin :auto-set="autoSet" :message="message" @login="onLogin" />
|
|
|
|
</XModalWindow>
|
2020-01-29 20:37:25 +01:00
|
|
|
</template>
|
|
|
|
|
2022-01-15 22:59:35 +01:00
|
|
|
<script lang="ts" setup>
|
2023-04-08 02:01:42 +02:00
|
|
|
import {} from "vue";
|
|
|
|
import MkSignin from "@/components/MkSignin.vue";
|
|
|
|
import XModalWindow from "@/components/MkModalWindow.vue";
|
|
|
|
import { i18n } from "@/i18n";
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2023-04-08 02:01:42 +02:00
|
|
|
const props = withDefaults(
|
|
|
|
defineProps<{
|
|
|
|
autoSet?: boolean;
|
|
|
|
message?: string;
|
|
|
|
}>(),
|
|
|
|
{
|
|
|
|
autoSet: false,
|
|
|
|
message: "",
|
|
|
|
}
|
|
|
|
);
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2022-01-15 22:59:35 +01:00
|
|
|
const emit = defineEmits<{
|
2023-04-08 02:01:42 +02:00
|
|
|
(ev: "done"): void;
|
|
|
|
(ev: "closed"): void;
|
|
|
|
(ev: "cancelled"): void;
|
2022-01-15 22:59:35 +01:00
|
|
|
}>();
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2022-01-15 22:59:35 +01:00
|
|
|
const dialog = $ref<InstanceType<typeof XModalWindow>>();
|
2020-10-17 13:12:00 +02:00
|
|
|
|
2022-05-19 13:28:08 +02:00
|
|
|
function onClose() {
|
2023-04-08 02:01:42 +02:00
|
|
|
emit("cancelled");
|
2022-05-19 13:28:08 +02:00
|
|
|
dialog.close();
|
|
|
|
}
|
|
|
|
|
2022-01-15 22:59:35 +01:00
|
|
|
function onLogin(res) {
|
2023-04-08 02:01:42 +02:00
|
|
|
emit("done", res);
|
2022-01-15 22:59:35 +01:00
|
|
|
dialog.close();
|
|
|
|
}
|
2020-01-29 20:37:25 +01:00
|
|
|
</script>
|