@rws-framework/components
Version:
29 lines (26 loc) • 1.32 kB
HTML
<div class="rws-api-container">
${T.when(x => x.resourceLabel, T.html`<h3>${x => x.resourceLabel}</h3>`)}
<div class="rws-api-controls">
${T.when(x => x.createEnabled === 'true', T.html`<sl-button @click="${ (x, c) => x.toggleForm() }" variant="secondary" >
${T.when(x => x.viewType === 'list', T.html`<span>${ x => x.createEntryLabel }</span>`)}
${T.when(x => x.viewType === 'form', T.html`<span>${ x => x.listEntryLabel }</span>`)}
</sl-button>`)}
</div>
<div class="rws-api-content">
${T.when(x => x.dbModelData && x.viewType === 'list', T.html`<rws-resource-list
resource="${x => x.resource}"
emptyLabel="${x => x.emptyLabel}"
:dbModelData="${x => x.dbModelData}"
:fields="${x => x.fields}"
:actions="${x => x.listActions}"
:extraFormatters="${x => x.extraFormatters}"
:headerTranslations="${x => x.headerTranslations}"
>
</rws-resource-list>`)}
${T.when(x => x.viewType === 'form', T.html`<rws-resource-form
resource="${x => x.resource}"
:dbModelData="${x => x.dbModelData}"
:back="${x => x.back}"
></rws-resource-form> `)}
</div>
</div>