-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(bulkAdding): finished bulk processing
- Loading branch information
Showing
26 changed files
with
1,239 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<template> | ||
<div class="zefir-main-card"> | ||
<div class="right-side"> | ||
<Select v-model="foodItem.option" :options="unstringify(foodItem.servings)" class="zefir-select"></Select> | ||
</div> | ||
<div class="content-center"><StyledNumberInput :style="{ maxWidth: '4rem' }" v-model="foodItem.multiplier"></StyledNumberInput></div> | ||
<div class="content-center">{{ props.name }}</div> | ||
<button class="x-button" @click="emit('submit')">X</button> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import Select, { SelectOption } from "@/components/global/Select.vue"; | ||
import StyledNumberInput from "@/components/global/StyledNumberInput.vue"; | ||
import { onMounted } from "vue"; | ||
import { ShelfFoodItem } from "@/lib/models/TimeShelfs/TimeShelf"; | ||
const emit = defineEmits(["submit"]); | ||
const props = defineProps<{ | ||
name?: string; | ||
foodItem: ShelfFoodItem; | ||
}>(); | ||
function unstringify(data: string | null): SelectOption[] { | ||
if (data) { | ||
return JSON.parse(data); | ||
} | ||
return [ | ||
{ name: "Standard", value: 100 }, | ||
{ name: "Gram", value: 1 } | ||
]; | ||
} | ||
onMounted(() => {}); | ||
</script> | ||
|
||
<style scoped> | ||
.content-center { | ||
display: flex; | ||
align-items: center; | ||
height: 100%; | ||
} | ||
.zefir-select { | ||
height: 100%; | ||
} | ||
.right-side { | ||
height: 100%; | ||
/* background-color: aqua; */ | ||
} | ||
.x-button { | ||
height: 3rem; | ||
width: 3rem; | ||
border-radius: 5px; | ||
border: 0px; | ||
cursor: pointer; | ||
background-color: #3b3941; | ||
} | ||
.x-button:hover { | ||
background-color: brown; | ||
} | ||
.zefir-main-card { | ||
min-height: 3rem; | ||
display: flex; | ||
justify-content: space-between; | ||
border-radius: 5px; | ||
padding: 0px; | ||
overflow: hidden; | ||
background: #7950f226; | ||
color: #b197fc; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<template> | ||
<Card class="z-time-shelf-card" :class="{ highlight: props.highlighted }"> | ||
<template #content> | ||
<div> | ||
{{ props.name }} | ||
</div> | ||
<div class="absolute-text" v-if="props.text"> | ||
{{ props.text }} | ||
</div> | ||
<div class="z-item-container"> | ||
<slot name="content"></slot> | ||
</div> | ||
</template> | ||
</Card> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import Card from "primevue/card"; | ||
const props = defineProps<{ | ||
name: string; | ||
highlighted?: boolean; | ||
text?: string; | ||
}>(); | ||
</script> | ||
|
||
<style scoped> | ||
.z-item-container { | ||
display: flex; | ||
flex-direction: row; | ||
flex-wrap: wrap; | ||
gap: 1px; | ||
} | ||
.z-time-shelf-card { | ||
cursor: pointer; | ||
} | ||
.highlight { | ||
background-color: rgba(137, 43, 226, 0.05); | ||
border-width: 1px; | ||
border-color: rgba(22, 0, 31, 0.233); | ||
border-style: solid; | ||
} | ||
.absolute-text { | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<template> | ||
<div class="time-shelf-item">{{ props.name }}</div> | ||
</template> | ||
<script setup lang="ts"> | ||
const props = defineProps<{ | ||
name: string; | ||
}>(); | ||
</script> | ||
<style scoped> | ||
.time-shelf-item { | ||
width: 60px; | ||
height: 30px; | ||
border-width: 1px; | ||
background-color: rgb(87, 30, 95); | ||
border-radius: 3px; | ||
border-style: solid; | ||
border-color: black; | ||
overflow: hidden; | ||
font-family: | ||
-apple-system, | ||
BlinkMacSystemFont, | ||
Segoe UI, | ||
Roboto, | ||
Helvetica, | ||
Arial, | ||
sans-serif, | ||
Apple Color Emoji, | ||
Segoe UI Emoji; | ||
font-size: 10px; | ||
text-align: center; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<script setup lang="ts"> | ||
import InputText from "primevue/inputtext"; | ||
const props = defineProps<{ label?: String; disabled?: boolean }>(); | ||
const model = defineModel({ required: false, default: "" }); | ||
</script> | ||
<template> | ||
<div class="styled-number-input-container"> | ||
<small class="small-label">{{ props.label }}</small> | ||
<InputText class="my-input" :disabled="props.disabled" v-model="model" /> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
.small-label { | ||
line-height: 1.2; | ||
font-size: x-small; | ||
color: #828282; | ||
margin: 0; | ||
padding-bottom: 2px; | ||
} | ||
.styled-number-input-container { | ||
overflow: hidden; | ||
width: auto; | ||
display: flex; | ||
text-align: left; | ||
flex-direction: column; | ||
gap: 0; | ||
} | ||
.my-input { | ||
width: 100%; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//import { TablesInsert } from "../supabase/supabase/supabaseSchemas/supaDatabase"; | ||
//import { Tables } from "../supabase/supabase/supabaseSchemas/supaDatabaseExtensions"; | ||
|
||
//export type FoodInsertItemCombined = TablesInsert<"food"> & Tables<"food_types">; | ||
export type FoodInsertItemCombined = { | ||
id: number; | ||
name: string; | ||
description: string; | ||
calories: number; | ||
protein: number; | ||
fat: number; | ||
carbohydrates: number; | ||
multiplier: number; | ||
created_at: Date; | ||
updated_at: Date; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { FoodInsertItemCombined } from "../Food"; | ||
import { SelectOption } from "@/components/global/Select.vue"; | ||
|
||
export interface TimeShelf { | ||
id: string; | ||
startTime: string; | ||
endTime: string; | ||
name: string; | ||
} | ||
|
||
export type ShelfFoodItem = FoodInsertItemCombined & { | ||
shelfId: string; | ||
option: SelectOption; | ||
multiplier: number; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.