2021-06-20 23:29:55 -05:00
|
|
|
<template>
|
2022-01-13 22:25:47 -06:00
|
|
|
<span class="container" :class="{ confirming: isConfirming }">
|
|
|
|
<span v-if="isConfirming">Are you sure?</span>
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-16 23:30:54 -05:00
|
|
|
<button @click.stop="click" class="button danger" :disabled="disabled">
|
2022-01-13 22:25:47 -06:00
|
|
|
<span v-if="isConfirming">Yes</span>
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-16 23:30:54 -05:00
|
|
|
<slot v-else />
|
|
|
|
</button>
|
2022-01-13 22:25:47 -06:00
|
|
|
<button v-if="isConfirming" class="button" @click.stop="cancel">No</button>
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-16 23:30:54 -05:00
|
|
|
</span>
|
2021-06-20 23:29:55 -05:00
|
|
|
</template>
|
|
|
|
|
2022-01-13 22:25:47 -06:00
|
|
|
<script setup lang="ts">
|
|
|
|
import { ref, toRefs, unref, watch } from "vue";
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-16 23:30:54 -05:00
|
|
|
|
2022-01-24 22:25:34 -06:00
|
|
|
const _props = defineProps<{
|
|
|
|
disabled?: boolean;
|
|
|
|
skipConfirm?: boolean;
|
|
|
|
}>();
|
|
|
|
const props = toRefs(_props);
|
2022-01-13 22:25:47 -06:00
|
|
|
const emit = defineEmits<{
|
|
|
|
(e: "click"): void;
|
|
|
|
(e: "confirmingChanged", value: boolean): void;
|
|
|
|
}>();
|
|
|
|
|
|
|
|
const isConfirming = ref(false);
|
|
|
|
|
|
|
|
watch(isConfirming, isConfirming => {
|
|
|
|
emit("confirmingChanged", isConfirming);
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-16 23:30:54 -05:00
|
|
|
});
|
2022-01-13 22:25:47 -06:00
|
|
|
|
|
|
|
function click() {
|
|
|
|
if (unref(props.skipConfirm)) {
|
|
|
|
emit("click");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (isConfirming.value) {
|
|
|
|
emit("click");
|
|
|
|
}
|
|
|
|
isConfirming.value = !isConfirming.value;
|
|
|
|
}
|
|
|
|
|
|
|
|
function cancel() {
|
|
|
|
isConfirming.value = false;
|
|
|
|
}
|
2021-06-20 23:29:55 -05:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.container {
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-16 23:30:54 -05:00
|
|
|
display: flex;
|
2021-06-20 23:29:55 -05:00
|
|
|
align-items: center;
|
2021-09-19 11:08:47 -05:00
|
|
|
background: var(--raised-background);
|
|
|
|
box-shadow: var(--raised-background) 0 2px 3px 5px;
|
2021-06-20 23:29:55 -05:00
|
|
|
}
|
|
|
|
|
2021-07-24 17:08:52 -05:00
|
|
|
.container.confirming button {
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-16 23:30:54 -05:00
|
|
|
font-size: 1em;
|
2021-07-24 17:08:52 -05:00
|
|
|
}
|
|
|
|
|
2021-06-20 23:29:55 -05:00
|
|
|
.container > * {
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-16 23:30:54 -05:00
|
|
|
margin: 0 4px;
|
2021-06-20 23:29:55 -05:00
|
|
|
}
|
2021-07-02 08:48:34 -05:00
|
|
|
</style>
|
2021-06-20 23:29:55 -05:00
|
|
|
|
2021-07-02 08:48:34 -05:00
|
|
|
<style>
|
2022-01-24 22:25:34 -06:00
|
|
|
.danger,
|
|
|
|
.button.danger {
|
2021-07-02 08:48:34 -05:00
|
|
|
position: relative;
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-16 23:30:54 -05:00
|
|
|
border: solid 2px var(--danger);
|
2021-07-02 08:48:34 -05:00
|
|
|
border-right-width: 16px;
|
2021-06-20 23:29:55 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
.danger::after {
|
2021-07-02 08:48:34 -05:00
|
|
|
position: absolute;
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-16 23:30:54 -05:00
|
|
|
content: "!";
|
|
|
|
color: white;
|
2021-07-02 08:48:34 -05:00
|
|
|
right: -13px;
|
2021-06-20 23:29:55 -05:00
|
|
|
}
|
|
|
|
</style>
|