From 0a24691d64513dcc2f3728cb6d179df0a5780317 Mon Sep 17 00:00:00 2001 From: Hayden <64056131+hay-kot@users.noreply.github.com> Date: Fri, 27 Jan 2023 14:11:18 -0900 Subject: [PATCH] introduce basic table/card view elements --- frontend/components/Item/View/Selectable.vue | 66 +++++++++ frontend/components/Item/View/Table.types.ts | 10 ++ frontend/components/Item/View/Table.vue | 141 +++++++++++++++++++ 3 files changed, 217 insertions(+) create mode 100644 frontend/components/Item/View/Selectable.vue create mode 100644 frontend/components/Item/View/Table.types.ts create mode 100644 frontend/components/Item/View/Table.vue diff --git a/frontend/components/Item/View/Selectable.vue b/frontend/components/Item/View/Selectable.vue new file mode 100644 index 0000000..a72f32a --- /dev/null +++ b/frontend/components/Item/View/Selectable.vue @@ -0,0 +1,66 @@ + + + + + + Items + + + + + + + + + + + Card + + + + + + Table + + + + + + + + + + + + + + + + + + + diff --git a/frontend/components/Item/View/Table.types.ts b/frontend/components/Item/View/Table.types.ts new file mode 100644 index 0000000..51496fc --- /dev/null +++ b/frontend/components/Item/View/Table.types.ts @@ -0,0 +1,10 @@ +import { ItemSummary } from "~~/lib/api/types/data-contracts"; + +export type TableHeader = { + text: string; + value: keyof ItemSummary; + sortable?: boolean; + align?: "left" | "center" | "right"; +}; + +export type TableData = Record; diff --git a/frontend/components/Item/View/Table.vue b/frontend/components/Item/View/Table.vue new file mode 100644 index 0000000..f339a17 --- /dev/null +++ b/frontend/components/Item/View/Table.vue @@ -0,0 +1,141 @@ + + + + + + + {{ h }} + {{ h.text }} + + + + + + + + + {{ d.name }} + + + + + + + + + + + {{ extractValue(d, h.value) }} + + + + + + + + « + Page {{ pagination.page }} + » + + + + + + + +