diff options
author | Sebastian <sebasjm@gmail.com> | 2023-09-20 15:18:36 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-09-25 14:50:39 -0300 |
commit | e39d5c488e2e425bd7febf694caadc17d5126401 (patch) | |
tree | 0431fcaeebf8e515f21f7f1ff607cb4f12fcd509 /packages/demobank-ui/src/forms | |
parent | fdbe623e1060efc4b074d213a96e8f5a2ab7498b (diff) | |
download | wallet-core-e39d5c488e2e425bd7febf694caadc17d5126401.tar.xz |
more ui
Diffstat (limited to 'packages/demobank-ui/src/forms')
-rw-r--r-- | packages/demobank-ui/src/forms/simplest.ts | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/packages/demobank-ui/src/forms/simplest.ts b/packages/demobank-ui/src/forms/simplest.ts new file mode 100644 index 000000000..54b6b1c65 --- /dev/null +++ b/packages/demobank-ui/src/forms/simplest.ts @@ -0,0 +1,66 @@ +import { + AbsoluteTime, + AmountJson, + TranslatedString +} from "@gnu-taler/taler-util"; +import { DoubleColumnForm, FormState } from "@gnu-taler/web-util/browser"; + +export namespace Data { + export interface WithResolution { + when: AbsoluteTime; + threshold: AmountJson; + state: string; + } + export interface Form extends WithResolution { + comment: string; + } +} + +const design: DoubleColumnForm = [ + { + title: "Simple form" as TranslatedString, + fields: [ + { + type: "textArea", + props: { + name: "comment", + label: "Comments" as TranslatedString, + }, + }, + ], + }, + { + title: "Resolution" as TranslatedString, + description: `Current state is and threshold at ` as TranslatedString, + fields: [ + { + type: "date", + props: { + name: "when", + label: "Decision Time" as TranslatedString, + }, + }, + { + type: "amount", + props: { + name: "threshold", + label: "New threshold" as TranslatedString, + }, + }, + ], + } + , +]; + +function formBehavior(v: Partial<Data.Form>): FormState<Data.Form> { + return { + when: { + disabled: true, + }, + threshold: { + // disabled: v.state === AmlExchangeBackend.AmlState.frozen, + }, + }; +} + + |