2020-01-29 13:37:25 -06:00
|
|
|
<template>
|
2023-01-05 18:41:14 -06:00
|
|
|
<MkModalWindow
|
2022-07-20 08:24:26 -05:00
|
|
|
ref="dialog"
|
2023-04-19 07:24:31 -05:00
|
|
|
:width="500"
|
|
|
|
:height="600"
|
2022-01-15 15:59:35 -06:00
|
|
|
@close="dialog.close()"
|
2020-10-17 06:12:00 -05:00
|
|
|
@closed="$emit('closed')"
|
|
|
|
>
|
2022-07-20 08:24:26 -05:00
|
|
|
<template #header>{{ i18n.ts.signup }}</template>
|
2020-10-17 06:12:00 -05:00
|
|
|
|
2023-04-19 07:24:31 -05:00
|
|
|
<div style="overflow-x: clip;">
|
|
|
|
<Transition
|
|
|
|
mode="out-in"
|
|
|
|
:enter-active-class="$style.transition_x_enterActive"
|
|
|
|
:leave-active-class="$style.transition_x_leaveActive"
|
|
|
|
:enter-from-class="$style.transition_x_enterFrom"
|
|
|
|
:leave-to-class="$style.transition_x_leaveTo"
|
|
|
|
>
|
|
|
|
<template v-if="!isAcceptedServerRule">
|
|
|
|
<XServerRules @accept="isAcceptedServerRule = true"/>
|
|
|
|
</template>
|
|
|
|
<template v-else>
|
|
|
|
<XSignup :auto-set="autoSet" @signup="onSignup" @signup-email-pending="onSignupEmailPending"/>
|
|
|
|
</template>
|
|
|
|
</Transition>
|
|
|
|
</div>
|
2023-01-05 18:41:14 -06:00
|
|
|
</MkModalWindow>
|
2020-01-29 13:37:25 -06:00
|
|
|
</template>
|
|
|
|
|
2022-01-15 15:59:35 -06:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { } from 'vue';
|
2023-04-19 07:24:31 -05:00
|
|
|
import { $ref } from 'vue/macros';
|
|
|
|
import XSignup from '@/components/MkSignupDialog.form.vue';
|
|
|
|
import XServerRules from '@/components/MkSignupDialog.rules.vue';
|
2023-01-05 18:41:14 -06:00
|
|
|
import MkModalWindow from '@/components/MkModalWindow.vue';
|
2022-07-20 08:24:26 -05:00
|
|
|
import { i18n } from '@/i18n';
|
2023-04-19 07:24:31 -05:00
|
|
|
import { instance } from '@/instance';
|
2020-01-29 13:37:25 -06:00
|
|
|
|
2022-01-15 15:59:35 -06:00
|
|
|
const props = withDefaults(defineProps<{
|
|
|
|
autoSet?: boolean;
|
|
|
|
}>(), {
|
|
|
|
autoSet: false,
|
|
|
|
});
|
2020-02-14 10:33:09 -06:00
|
|
|
|
2022-01-15 15:59:35 -06:00
|
|
|
const emit = defineEmits<{
|
2022-05-26 08:53:09 -05:00
|
|
|
(ev: 'done'): void;
|
|
|
|
(ev: 'closed'): void;
|
2022-01-15 15:59:35 -06:00
|
|
|
}>();
|
2020-02-14 10:33:09 -06:00
|
|
|
|
2023-01-05 18:41:14 -06:00
|
|
|
const dialog = $shallowRef<InstanceType<typeof MkModalWindow>>();
|
2020-10-17 06:12:00 -05:00
|
|
|
|
2023-04-19 07:24:31 -05:00
|
|
|
const isAcceptedServerRule = $ref(false);
|
|
|
|
|
2022-01-15 15:59:35 -06:00
|
|
|
function onSignup(res) {
|
|
|
|
emit('done', res);
|
|
|
|
dialog.close();
|
|
|
|
}
|
2021-10-07 23:37:02 -05:00
|
|
|
|
2022-01-15 15:59:35 -06:00
|
|
|
function onSignupEmailPending() {
|
|
|
|
dialog.close();
|
|
|
|
}
|
2020-01-29 13:37:25 -06:00
|
|
|
</script>
|
2023-04-19 07:24:31 -05:00
|
|
|
|
|
|
|
<style lang="scss" module>
|
|
|
|
.transition_x_enterActive,
|
|
|
|
.transition_x_leaveActive {
|
|
|
|
transition: opacity 0.3s cubic-bezier(0,0,.35,1), transform 0.3s cubic-bezier(0,0,.35,1);
|
|
|
|
}
|
|
|
|
.transition_x_enterFrom {
|
|
|
|
opacity: 0;
|
|
|
|
transform: translateX(50px);
|
|
|
|
}
|
|
|
|
.transition_x_leaveTo {
|
|
|
|
opacity: 0;
|
|
|
|
transform: translateX(-50px);
|
|
|
|
}
|
|
|
|
</style>
|