Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLarsKetch committed May 14, 2024
1 parent 5f56dc9 commit fa65dd1
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 11 deletions.
2 changes: 0 additions & 2 deletions src/composables/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import type {
ListPaginationOptions,
ListSortOptions,
ListStyleOptions,
ListConfig,
SortDir,
} from "./list"

Expand All @@ -36,7 +35,6 @@ export type {
UseBaseAPI,
DynamicTableOptions,
DynamicTableAPI,
ListConfig,
ListFilterOptions,
ListPaginationOptions,
ListSortOptions,
Expand Down
1 change: 0 additions & 1 deletion src/composables/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export interface ListStyleOptions {
export interface ListConfig {
filter?: ListFilterOptions
pagination?: ListPaginationOptions
sort?: ListSortOptions
style?: ListStyleOptions
}

Expand Down
38 changes: 33 additions & 5 deletions src/lib-components/lists/DetailList.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,44 @@
<script setup lang="ts">
import { computed, ref, watch } from "vue"
import { useAppFlasher } from "@/composables"
import { DynamicListAPI, ListConfig } from "@/composables/list"
import {
DynamicListAPI,
ListFilterOptions,
ListPaginationOptions,
ListStyleOptions,
} from "@/composables/list"
import { SearchIcon } from "@heroicons/vue/outline"
import BaseAPI from "../../api/base"
import DateFilter from "../layout/DateFilter.vue"
import Paginator from "../navigation/Paginator.vue"
const props = defineProps<{
config: ListConfig
url: string
}>()
const props = withDefaults(
defineProps<{
config?: {
filter?: ListFilterOptions
pagination?: ListPaginationOptions
style?: ListStyleOptions
}
url: string
}>(),
{
config: () => {
return {
filter: {
date: false,
query: false,
},
pagination: {
alwaysHideNav: false,
perPage: 10,
},
style: {
borderless: false,
},
}
},
}
)
const dateRange = ref<{ minDate: number; maxDate: number }>({
minDate: 0,
Expand Down
17 changes: 14 additions & 3 deletions src/lib-components/lists/DynamicTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,30 @@ import { useAppFlasher } from "@/composables/useFlashes"
import { TrailsRespPaged } from "@/api/client"
import { DateRangeProps } from "@/composables/date"
import { useTable } from "@/composables/useTable"
import { ListConfig, SortDir } from "@/composables/list"
import {
ListFilterOptions,
ListPaginationOptions,
ListSortOptions,
ListStyleOptions,
SortDir,
} from "@/composables/list"
import TableActionButtons from "./TableActionButtons.vue"
const props = withDefaults(
defineProps<{
tableActions?: TableActions<any>
tableColumns: TableColumns<any>
config?: ListConfig
config?: {
filter?: ListFilterOptions
pagination?: ListPaginationOptions
sort?: ListSortOptions
style?: ListStyleOptions
}
url: string
}>(),
{
tableActions: () => ({ type: "dropdown", actions: [] }),
config: (): ListConfig => {
config: () => {
return {
filter: {
query: false,
Expand Down

0 comments on commit fa65dd1

Please sign in to comment.