2020-10-21 17:54:45 +00:00
|
|
|
<template>
|
2020-12-07 14:45:00 +00:00
|
|
|
<Page>
|
|
|
|
<StackLayout class="dialogContainer" :class="appTheme">
|
2021-01-23 17:20:15 +00:00
|
|
|
<Label class="er dialogIcon" backgroundColor="#858585" :color="iconColor" :text="icon[helpIcon]" />
|
2020-12-07 14:45:00 +00:00
|
|
|
<Label class="dialogTitle orkm" :text="`${title}` | L" textWrap='true' />
|
|
|
|
<StackLayout class="dialogInput">
|
2020-12-29 10:35:19 +00:00
|
|
|
<TextField @loaded="focusField" :hint="hint ? hint : ''" v-model="category" autocapitalizationType="words" @returnPress="$modal.close(category)" />
|
2020-10-21 17:54:45 +00:00
|
|
|
</StackLayout>
|
2020-12-07 14:45:00 +00:00
|
|
|
<GridLayout rows="auto" columns="*, auto, auto" class="actionsContainer">
|
2021-01-13 05:02:48 +00:00
|
|
|
<MDButton :rippleColor="rippleColor" variant="text" col="1" class="action orkm" :text="'cBtn' | L" @tap="$modal.close(false)" />
|
2020-12-07 14:45:00 +00:00
|
|
|
<MDButton :rippleColor="rippleColor" variant="text" col="2" class="action orkm" :text="`${action}` | L" @tap="$modal.close(category)" />
|
|
|
|
</GridLayout>
|
|
|
|
</StackLayout>
|
|
|
|
</Page>
|
2020-10-21 17:54:45 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-12-07 14:45:00 +00:00
|
|
|
import {
|
|
|
|
Application,
|
|
|
|
Utils
|
|
|
|
}
|
|
|
|
from "@nativescript/core"
|
|
|
|
import {
|
|
|
|
localize
|
|
|
|
}
|
|
|
|
from '@nativescript/localize'
|
2021-01-13 05:02:48 +00:00
|
|
|
import {
|
|
|
|
mapState
|
|
|
|
}
|
|
|
|
from "vuex"
|
2020-10-21 17:54:45 +00:00
|
|
|
export default {
|
2021-01-13 05:02:48 +00:00
|
|
|
props: [ "title", "hint", "text", "action", "helpIcon" ],
|
2020-10-21 17:54:45 +00:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
category: null,
|
|
|
|
}
|
|
|
|
},
|
2020-10-24 18:02:35 +00:00
|
|
|
computed: {
|
2021-01-13 05:02:48 +00:00
|
|
|
...mapState( [ "icon" ] ),
|
2020-11-10 18:28:48 +00:00
|
|
|
appTheme() {
|
2020-10-24 18:02:35 +00:00
|
|
|
return Application.systemAppearance()
|
|
|
|
},
|
2021-01-13 05:02:48 +00:00
|
|
|
isLightMode() {
|
|
|
|
return this.appTheme == "light"
|
|
|
|
},
|
2020-11-10 18:28:48 +00:00
|
|
|
rippleColor() {
|
2021-01-23 17:20:15 +00:00
|
|
|
return "rgba(133,133,133,0.2)"
|
2021-01-13 05:02:48 +00:00
|
|
|
},
|
|
|
|
iconColor() {
|
2021-01-23 17:20:15 +00:00
|
|
|
return this.isLightMode ? "#f0f0f0" : "#1A1A1A"
|
2020-11-10 18:28:48 +00:00
|
|
|
},
|
2020-10-22 18:36:50 +00:00
|
|
|
},
|
2020-11-02 11:36:53 +00:00
|
|
|
methods: {
|
2020-12-07 14:45:00 +00:00
|
|
|
focusField( args ) {
|
2020-11-02 11:36:53 +00:00
|
|
|
args.object.focus()
|
2020-12-07 14:45:00 +00:00
|
|
|
setTimeout( ( e ) => Utils.ad.showSoftInput( args.object.android ), 1 )
|
2020-11-02 11:36:53 +00:00
|
|
|
},
|
|
|
|
},
|
2020-11-10 18:28:48 +00:00
|
|
|
mounted() {
|
2020-12-07 14:45:00 +00:00
|
|
|
if ( this.text ) {
|
|
|
|
this.category = localize( this.text )
|
2020-11-10 18:28:48 +00:00
|
|
|
}
|
|
|
|
},
|
2020-10-21 17:54:45 +00:00
|
|
|
}
|
|
|
|
</script>
|