-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
435 additions
and
86 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<script setup lang="ts"> | ||
import { IonModal, IonPicker, IonPickerColumn, IonPickerColumnOption } from '@ionic/vue'; | ||
import { onMounted, ref } from 'vue'; | ||
const self = ref(); | ||
type ColumnContent = { | ||
name: string, | ||
values: PickerValue[], | ||
prefix?: string, | ||
suffix?: string | ||
} | ||
type PickerValue = { | ||
name: string, | ||
value: string|number|undefined, | ||
default?: boolean, | ||
disabled?: boolean, | ||
color?: string | ||
} | ||
const props = defineProps<{ | ||
content: ColumnContent[] | ||
}>(); | ||
const values = defineModel<Map<string, string|number|undefined>>(); | ||
onMounted(() => { | ||
for(const column of props.content) | ||
values.value?.set(column.name, column.values.find(x => x.default)?.value || undefined); | ||
}); | ||
</script> | ||
|
||
<template> | ||
<IonModal class="popup-picker" ref="self"> | ||
<IonPicker> | ||
<IonPickerColumn | ||
v-for="column in props.content" | ||
@ionChange="(e) => { values?.set(column.name, e.detail.value) }" | ||
:value="values?.get(column.name) || column.values.find(x => x.default)?.value || undefined" | ||
> | ||
<div slot="prefix" v-if="column.prefix">{{ column.prefix }}</div> | ||
<IonPickerColumnOption v-for="option in column.values" :value="option.value" :color="option.color" :disabled="option.disabled"> | ||
{{ option.name }} | ||
</IonPickerColumnOption> | ||
<div slot="suffix" v-if="column.suffix">{{ column.suffix }}</div> | ||
</IonPickerColumn> | ||
</IonPicker> | ||
</IonModal> | ||
</template> | ||
|
||
<style scoped> | ||
ion-modal.popup-picker { | ||
--backdrop-opacity: var(--ion-backdrop-opacity, 0.32) !important; | ||
--border-radius: 16px; | ||
--width: unset; | ||
--height: unset; | ||
} | ||
</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
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 |
---|---|---|
@@ -1,7 +1,19 @@ | ||
import { Reminder, UUIDable } from '../entities'; | ||
import { Reminder, UUID, UUIDable } from '../entities'; | ||
|
||
const impl = await ("isTauri" in window ? import('../impl/tauri/reminders') : import('../impl/dexie/reminders')); | ||
|
||
export function getReminders(){ | ||
return impl.getReminders(); | ||
} | ||
|
||
export function newReminder(reminder: Omit<Reminder, keyof UUIDable>) { | ||
return impl.newReminder(reminder); | ||
} | ||
|
||
export function removeReminder(uuid: UUID){ | ||
return impl.removeReminder(uuid); | ||
} | ||
|
||
export function updateReminder(uuid: UUID, newContent: Partial<Reminder>) { | ||
return impl.updateReminder(uuid, newContent); | ||
} |
Oops, something went wrong.