updated templater library; added accordion component

This commit is contained in:
2026-02-14 01:29:28 -07:00
parent 95ef64ce18
commit 6838d13c7a
11 changed files with 382 additions and 199 deletions
@@ -7,7 +7,8 @@
"HXSwap" "none"
"HXSelect" "#accounts-acct-id-inventory-sync-groups-mock-draft-table"
"ID" "sync-groups-mock-draft-table-add-listing-button"
"Class" "mt-[1em] mb-[1em]"
"Class" ""
"Style" ""
"Text" "Add Listing"
"_" `
on click
@@ -2,17 +2,23 @@
{{- $acctID := .PathParams.acctID }}
{{- $listings := .Accounts.GetMockSyncGroupListingDrafts $acctID }}
<table
id="accounts-acct-id-inventory-sync-groups-mock-draft-table"
class="max-w-full overflow-x-auto"
class="
max-w-full overflow-x-auto
grid-table-6
max-h-[50vh]
"
hx-get="{{ printf "/ui/accounts/%d/inventory/sync-groups/mock/draft/table" $acctID }}"
hx-trigger="sse:{{ printf "accounts_%d_inventory_sync-groups_mock_draft" $acctID }},sse:{{ printf "accounts_%d_inventory_sync-groups_mock_draft_listings" $acctID }}"
hx-select="#accounts-acct-id-inventory-sync-groups-mock-draft-table"
hx-swap="morph:outerHTML"
>
<thead>
<thead class="sticky top-0">
<tr>
<th>
Shop
@@ -58,14 +64,14 @@
send setDisabled(disabled: not allRowsFilledOut or numRows < 2) to #create-mock-sync-group-button
"
>
{{- $listings := .Accounts.GetMockSyncGroupListingDrafts $acctID }}
{{- range $listing := $listings }}
{{- component (printf "accounts/%d/inventory/sync-groups/mock/draft/listings/%d" $acctID $listing.OrderIndex)
"Listings" $listings
}}
{{- end }}
</tbody>
<tfoot>
{{- if gt (len $listings) 5 }}
<tfoot class="sticky bottom-0 outline-1 outline-(--table-tfoot)">
<tr>
<th>
Shop
@@ -87,6 +93,7 @@
</th>
</tr>
</tfoot>
{{- end }}
</table>
{{/*
@@ -18,8 +18,9 @@
{{ component "button"
"ID" "create-mock-sync-group-button"
"Class" "mt-[1em] mb-[1em]"
"Text" "Save Sync Group"
"Class" ""
"Style" ""
"Disabled" (or (not $enoughListings) (not $allCompleted))
"_" `
on setDisabled(disabled)