diff --git a/apps/metadata-utils/src/types.ts b/apps/metadata-utils/src/types.ts index 139a9a3bc6..c36a0d9be9 100644 --- a/apps/metadata-utils/src/types.ts +++ b/apps/metadata-utils/src/types.ts @@ -100,7 +100,7 @@ export interface IFormLegendSection { } export type columnId = string; -export type columnValue = string | number | boolean | columnValueObject; +export type columnValue = string | number | boolean | null | columnValueObject; interface columnValueObject { [x: string]: columnValue; diff --git a/apps/tailwind-components/components/form/FieldInput.vue b/apps/tailwind-components/components/form/FieldInput.vue index 0ae28a15cd..662a15a3fc 100644 --- a/apps/tailwind-components/components/form/FieldInput.vue +++ b/apps/tailwind-components/components/form/FieldInput.vue @@ -74,5 +74,16 @@ function validate(value: columnValue) { @update:modelValue="$emit('update:modelValue', $event)" @error="$emit('error', $event)" /> + diff --git a/apps/tailwind-components/components/input/Boolean.vue b/apps/tailwind-components/components/input/Boolean.vue new file mode 100644 index 0000000000..0d0ff6f247 --- /dev/null +++ b/apps/tailwind-components/components/input/Boolean.vue @@ -0,0 +1,84 @@ + + + diff --git a/apps/tailwind-components/components/input/Radio.vue b/apps/tailwind-components/components/input/Radio.vue index 95fd10a23b..454f58e2f7 100644 --- a/apps/tailwind-components/components/input/Radio.vue +++ b/apps/tailwind-components/components/input/Radio.vue @@ -8,9 +8,11 @@ diff --git a/apps/tailwind-components/components/input/RadioGroup.vue b/apps/tailwind-components/components/input/RadioGroup.vue index 70b223be09..0e3cda6a6a 100644 --- a/apps/tailwind-components/components/input/RadioGroup.vue +++ b/apps/tailwind-components/components/input/RadioGroup.vue @@ -1,19 +1,27 @@ -
- -
+ + diff --git a/apps/tailwind-components/pages/Form.story.vue b/apps/tailwind-components/pages/Form.story.vue index 7c3df99dfa..ae2da76c46 100644 --- a/apps/tailwind-components/pages/Form.story.vue +++ b/apps/tailwind-components/pages/Form.story.vue @@ -172,19 +172,21 @@ watch(

Values

-
+

Errors

-
+
diff --git a/apps/tailwind-components/pages/input/Boolean.story.vue b/apps/tailwind-components/pages/input/Boolean.story.vue new file mode 100644 index 0000000000..194f19c25d --- /dev/null +++ b/apps/tailwind-components/pages/input/Boolean.story.vue @@ -0,0 +1,25 @@ + + + diff --git a/apps/tailwind-components/tests/components/form/renderForm.spec.ts b/apps/tailwind-components/tests/components/form/renderForm.spec.ts index 61f4e9bb31..74601776e7 100644 --- a/apps/tailwind-components/tests/components/form/renderForm.spec.ts +++ b/apps/tailwind-components/tests/components/form/renderForm.spec.ts @@ -14,15 +14,12 @@ test("it should render the form", async ({ page }) => { await expect(page.getByRole("main")).toContainText("name"); await expect(page.getByRole("main")).toContainText("the name"); await expect(page.getByRole("main")).toContainText("date"); - await expect(page.getByRole("main")).toContainText("Required"); await expect(page.getByLabel("name")).toBeVisible(); }); test("it should handle input", async ({ page }) => { await page.getByLabel("name").pressSequentially("test"); await expect(page.getByLabel("name")).toHaveValue("test"); - await page.getByRole("heading", { name: "Values" }).click(); - await expect(page.getByRole("definition")).toContainText("test"); }); test("it should show the chapters in the legend", async ({ page }) => { diff --git a/apps/tailwind-components/types/types.ts b/apps/tailwind-components/types/types.ts index 1795d5ee3d..324180c596 100644 --- a/apps/tailwind-components/types/types.ts +++ b/apps/tailwind-components/types/types.ts @@ -1,4 +1,5 @@ import type { IColumn } from "../../metadata-utils/dist"; +import type { columnValue } from "../../metadata-utils/src/types"; export type Resp = { data: Record; @@ -91,4 +92,10 @@ export interface IDocumentation { file: IFile; } +export interface IRadioOptionsData { + value: columnValue; + label?: string; + checked?: boolean | undefined; +} + \ No newline at end of file