frontend: cleanup

* dummy commit

* cleanup workflows

* setup and run eslint

* add linter to CI

* use eslint for formatting

* reorder rules

* drop editor config
This commit is contained in:
Hayden 2022-09-09 14:46:53 -08:00 committed by GitHub
parent 78fa714297
commit 75c633dcb5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
65 changed files with 2048 additions and 641 deletions

View file

@ -1,7 +1,7 @@
<template>
<div class="dropdown dropdown-end w-full" ref="label">
<FormTextField tabindex="0" label="Date" v-model="dateText" :inline="inline" readonly />
<div @blur="resetTime" tabindex="0" class="mt-1 card compact dropdown-content shadow bg-base-100 rounded-box w-64">
<div ref="label" class="dropdown dropdown-end w-full">
<FormTextField v-model="dateText" tabindex="0" label="Date" :inline="inline" readonly />
<div tabindex="0" class="mt-1 card compact dropdown-content shadow bg-base-100 rounded-box w-64" @blur="resetTime">
<div class="card-body">
<div class="flex justify-between items-center">
<button class="btn btn-xs" @click="prevMonth">
@ -13,7 +13,7 @@
</button>
</div>
<div class="grid grid-cols-7 gap-2">
<div v-for="d in daysIdx">
<div v-for="d in daysIdx" :key="d">
<p class="text-center">
{{ d }}
</p>
@ -21,12 +21,13 @@
<template v-for="day in days">
<button
v-if="day.number != ''"
:key="day.number"
class="text-center btn-xs btn btn-outline"
@click="select($event, day.date)"
>
{{ day.number }}
</button>
<div v-else></div>
<div v-else :key="`${day.number}-empty`"></div>
</template>
</div>
</div>
@ -35,7 +36,7 @@
</template>
<script setup lang="ts">
const emit = defineEmits(['update:modelValue', 'update:text']);
const emit = defineEmits(["update:modelValue", "update:text"]);
const props = defineProps({
modelValue: {
@ -49,12 +50,12 @@
},
});
const selected = useVModel(props, 'modelValue', emit);
const selected = useVModel(props, "modelValue", emit);
const dateText = computed(() => {
if (selected.value) {
return selected.value.toLocaleDateString();
}
return '';
return "";
});
const time = ref(new Date());
@ -68,7 +69,7 @@
});
const month = computed(() => {
return time.value.toLocaleString('default', { month: 'long' });
return time.value.toLocaleString("default", { month: "long" });
});
const year = computed(() => {
@ -86,14 +87,14 @@
}
const daysIdx = computed(() => {
return ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'];
return ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
});
function select(e: MouseEvent, day: Date) {
console.log(day);
selected.value = day;
console.log(selected.value);
// @ts-ignore
// @ts-ignore - this is a vue3 bug
e.target.blur();
resetTime();
}
@ -116,7 +117,7 @@
for (let i = 0; i < firstDay; i++) {
days.push({
number: '',
number: "",
date: new Date(),
});
}