2020-01-29 20:37:25 +01:00
|
|
|
<template>
|
2023-01-06 01:41:14 +01:00
|
|
|
<MkModalWindow
|
2022-07-20 15:24:26 +02:00
|
|
|
ref="dialog"
|
2020-10-17 13:12:00 +02:00
|
|
|
:width="370"
|
|
|
|
:height="400"
|
2022-05-19 13:28:08 +02:00
|
|
|
@close="onClose"
|
2022-01-15 22:59:35 +01:00
|
|
|
@closed="emit('closed')"
|
2020-10-17 13:12:00 +02:00
|
|
|
>
|
2022-07-20 15:24:26 +02:00
|
|
|
<template #header>{{ i18n.ts.login }}</template>
|
2020-10-17 13:12:00 +02:00
|
|
|
|
2023-01-06 01:41:14 +01:00
|
|
|
<MkSpacer :margin-min="20" :margin-max="28">
|
|
|
|
<MkSignin :auto-set="autoSet" :message="message" @login="onLogin"/>
|
|
|
|
</MkSpacer>
|
|
|
|
</MkModalWindow>
|
2020-01-29 20:37:25 +01:00
|
|
|
</template>
|
|
|
|
|
2022-01-15 22:59:35 +01:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { } from 'vue';
|
2022-08-30 17:24:33 +02:00
|
|
|
import MkSignin from '@/components/MkSignin.vue';
|
2023-01-06 01:41:14 +01:00
|
|
|
import MkModalWindow from '@/components/MkModalWindow.vue';
|
2022-07-20 15:24:26 +02:00
|
|
|
import { i18n } from '@/i18n';
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2023-03-09 06:27:16 +01:00
|
|
|
withDefaults(defineProps<{
|
2022-01-15 22:59:35 +01:00
|
|
|
autoSet?: boolean;
|
2022-05-19 13:28:08 +02:00
|
|
|
message?: string,
|
2022-01-15 22:59:35 +01:00
|
|
|
}>(), {
|
|
|
|
autoSet: false,
|
2022-07-20 15:24:26 +02:00
|
|
|
message: '',
|
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 emit = defineEmits<{
|
2023-03-09 06:27:16 +01:00
|
|
|
(ev: 'done', v: any): void;
|
2022-05-19 13:28:08 +02:00
|
|
|
(ev: 'closed'): void;
|
|
|
|
(ev: 'cancelled'): void;
|
2022-01-15 22:59:35 +01:00
|
|
|
}>();
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2023-01-06 01:41:14 +01:00
|
|
|
const dialog = $shallowRef<InstanceType<typeof MkModalWindow>>();
|
2020-10-17 13:12:00 +02:00
|
|
|
|
2022-05-19 13:28:08 +02:00
|
|
|
function onClose() {
|
|
|
|
emit('cancelled');
|
2023-03-09 06:27:16 +01:00
|
|
|
if (dialog) dialog.close();
|
2022-05-19 13:28:08 +02:00
|
|
|
}
|
|
|
|
|
2022-01-15 22:59:35 +01:00
|
|
|
function onLogin(res) {
|
|
|
|
emit('done', res);
|
2023-03-09 06:27:16 +01:00
|
|
|
if (dialog) dialog.close();
|
2022-01-15 22:59:35 +01:00
|
|
|
}
|
2020-01-29 20:37:25 +01:00
|
|
|
</script>
|