Add numeric input

This commit is contained in:
Georges KABBOUCHI 2021-09-06 01:28:42 +03:00
parent ee51fa7155
commit d2bca27ab6
2 changed files with 14 additions and 1 deletions

View File

@ -67,6 +67,15 @@
@input="$event => component.onInput($event)" @input="$event => component.onInput($event)"
/> />
<input-numeric
v-else-if="component.type === 'input-numeric'"
:key="index"
:value="component.value"
:error="component.error"
:placeholder="component.placeholder()"
@input="$event => component.onInput($event)"
/>
<SidebarContextHeading <SidebarContextHeading
v-else-if="component.type === 'heading'" v-else-if="component.type === 'heading'"
:key="index" :key="index"
@ -120,8 +129,9 @@ import InputAmount from "~/components/common/input/InputAmount.vue";
import { useToken } from "~/composables/useToken"; import { useToken } from "~/composables/useToken";
import ButtonCTA from "~/components/common/input/ButtonCTA.vue"; import ButtonCTA from "~/components/common/input/ButtonCTA.vue";
import ValueDisplay from "../components/ValueDisplay.vue"; import ValueDisplay from "../components/ValueDisplay.vue";
import InputNumeric from "~/components/common/input/InputNumeric.vue";
export default defineComponent({ export default defineComponent({
components: { InputAmount, ButtonCTA, ValueDisplay }, components: { InputAmount, ButtonCTA, ValueDisplay, InputNumeric },
props: { props: {
protocol: { protocol: {
type: String, type: String,

View File

@ -37,6 +37,7 @@ export interface IStrategyToken {
export enum StrategyComponentType { export enum StrategyComponentType {
// INPUT = "input", // INPUT = "input",
INPUT_NUMERIC = "input-numeric",
INPUT_AMOUNT = "input-amount", INPUT_AMOUNT = "input-amount",
INPUT_WITH_TOKEN = "input-with-token", INPUT_WITH_TOKEN = "input-with-token",
@ -48,6 +49,8 @@ export enum StrategyComponentType {
export type StrategyComponentParameterMap = { export type StrategyComponentParameterMap = {
// [StrategyInputType.INPUT]: {}; // [StrategyInputType.INPUT]: {};
[StrategyComponentType.INPUT_NUMERIC]: {};
[StrategyComponentType.INPUT_AMOUNT]: { [StrategyComponentType.INPUT_AMOUNT]: {
tokenKey: string; tokenKey: string;
}; };