enrecipes/app/components/modal/PromptDialog.vue

57 lines
1.2 KiB
Vue
Raw Normal View History

2020-10-21 17:54:45 +00:00
<template>
<Page>
<StackLayout class="dialogContainer" :class="isLightMode">
2020-10-21 17:54:45 +00:00
<Label class="dialogTitle orkm" :text="title" />
2020-11-02 11:36:53 +00:00
<StackLayout class="dialogInput">
<TextField
2020-11-02 11:36:53 +00:00
@loaded="focusField"
:hint="hint"
v-model="category"
autocapitalizationType="words"
/>
</StackLayout>
2020-11-02 11:36:53 +00:00
<GridLayout
rows="auto"
columns="*, auto, 32, auto"
class="actionsContainer"
>
2020-10-21 17:54:45 +00:00
<Label
2020-11-02 11:36:53 +00:00
col="1"
class="action orkm"
text="CANCEL"
@tap="$modal.close(false)"
/>
<Label
col="3"
2020-10-21 17:54:45 +00:00
class="action orkm"
:text="action"
@tap="$modal.close(category)"
/>
2020-11-02 11:36:53 +00:00
</GridLayout>
2020-10-21 17:54:45 +00:00
</StackLayout>
</Page>
</template>
<script>
2020-11-02 11:36:53 +00:00
import { Application, Utils } from "@nativescript/core"
2020-10-21 17:54:45 +00:00
export default {
props: ["title", "hint", "action"],
data() {
return {
category: null,
}
},
computed: {
isLightMode() {
return Application.systemAppearance()
},
2020-10-22 18:36:50 +00:00
},
2020-11-02 11:36:53 +00:00
methods: {
focusField(args) {
args.object.focus()
setTimeout((e) => Utils.ad.showSoftInput(args.object.android), 1)
},
},
2020-10-21 17:54:45 +00:00
}
</script>