From 74dc73f792262f87bbbb16d8ed2def2b588f778f Mon Sep 17 00:00:00 2001 From: Adrian Schmidt Date: Thu, 27 Mar 2025 17:34:02 +0100 Subject: [PATCH] docs(dialog): add an option field to the form example This helps us test limel-select when used in a limel-form inside a limel-dialog. --- .../dialog/examples/dialog-form.tsx | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/src/components/dialog/examples/dialog-form.tsx b/src/components/dialog/examples/dialog-form.tsx index 39191000d8..6456363223 100644 --- a/src/components/dialog/examples/dialog-form.tsx +++ b/src/components/dialog/examples/dialog-form.tsx @@ -13,6 +13,7 @@ interface FormValue { name: string; age: number; percentage: number; + color: string; } /** @@ -39,6 +40,7 @@ export class DialogFormExample { name: 'Harry Potter 🪄', age: 44, percentage: 40, + color: 'red', }; @State() @@ -81,6 +83,37 @@ export class DialogFormExample { }, }, }, + color: { + type: 'string', + title: 'Favorite color', + oneOf: [ + { + type: 'string', + const: 'red', + title: 'Red', + }, + { + type: 'string', + const: 'yellow', + title: 'Yellow', + }, + { + type: 'string', + const: 'green', + title: 'Green', + }, + { + type: 'string', + const: 'blue', + title: 'Blue', + }, + { + type: 'string', + const: 'black', + title: 'Black', + }, + ], + }, }, }; @@ -149,7 +182,9 @@ export class DialogFormExample { private submitForm = () => { this.isSaving = true; - alert(`${this.formValue?.name} is ${this.formValue?.age} years old`); + alert( + `${this.formValue?.name} is ${this.formValue?.age} years old. Favorite color is ${this.formValue?.color}.`, + ); this.closeDialog(); };