{#if $isCollectionsLoading && !$collections.length} Loading collections... {:else if !$collections.length} {#if $hideControls} You don't have any collections yet. {:else} Create your first collection to add records! collectionUpsertPanel?.show()} > Create new collection {/if} {:else} Collections {$activeCollection.name} {#if !$hideControls} collectionUpsertPanel?.show($activeCollection)} > {/if} { recordsList?.load(); recordsCount?.reload(); }} /> collectionDocsPanel?.show($activeCollection)} > API Preview {#if $activeCollection.type !== "view"} recordUpsertPanel?.show()}> New record {/if} (filter = e.detail)} /> { updateQueryParams({ recordId: e.detail.id, }); let showModel = e.detail._partial ? e.detail.id : e.detail; $activeCollection.type === "view" ? recordPreviewPanel?.show(showModel) : recordUpsertPanel?.show(showModel); }} on:delete={() => { recordsCount?.reload(); }} on:new={() => recordUpsertPanel?.show()} /> {/if} { recordsList?.load(); recordsCount?.reload(); }} /> { updateQueryParams({ recordId: null }); }} on:save={(e) => { if (filter) { // if there is applied filter, reload the count since we // don't know after the save whether the record satisfies it recordsCount?.reload(); } else if (e.detail.isNew) { totalCount++; } recordsList?.reloadLoadedPages(); }} on:delete={(e) => { if (!filter || recordsList?.hasRecord(e.detail.id)) { totalCount--; } recordsList?.reloadLoadedPages(); }} /> { updateQueryParams({ recordId: null }); }} />