UNPKG

@lucidcms/core

Version:

The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.

1 lines 2.8 kB
import{Rn as e,T as t,dn as n,fn as r,r as i}from"./ErrorBlock-CuwX01Wv.js";import{D as a,F as o,M as s,S as c,a as l,c as u,j as d,m as f,s as p}from"./web-BWdORzMO.js";import{pt as m}from"./Form-Cbz3dIAq.js";import{A as h,O as g,g as _,h as v,k as y}from"./publish-operations-D4J5WbXS.js";var b=e(n(),1),x=f(`<div><div class="w-full flex flex-wrap justify-between gap-2.5"><div class="flex flex-wrap gap-2.5 items-center"></div><div class="flex flex-wrap gap-2.5 items-center md:justify-end">`),S=e=>{let[n,f]=o(!1),[S,C]=o(!1),w=d(()=>e.onRefresh!==void 0),T=d(()=>e.filterSection),E=d(()=>T()?.open??S()),D=()=>{f(!0),e.onRefresh?.(),setTimeout(()=>{f(!1)},1e3)},O=e=>{let t=T()?.setOpen;t?t(e):C(e)};return(()=>{var o=x(),d=o.firstChild.firstChild,f=d.nextSibling;return p(d,a(c,{get when(){return T()},children:t=>a(v,{get open(){return E()},onToggle:()=>O(!E()),get searchParams(){return e.searchParams},get disabled(){return t().fields.length===0}})}),null),p(d,a(c,{get when(){return e.sorts!==void 0},get children(){return a(g,{get sorts(){return e.sorts},get searchParams(){return e.searchParams}})}}),null),p(d,a(c,{get when(){return e.custom!==void 0},get children(){return e.custom}}),null),p(d,a(c,{get when(){return u(()=>e.showingDeleted!==void 0)()&&e.setShowingDeleted!==void 0},get children(){return a(m,{id:`isDeleted`,get value(){return e.showingDeleted?.()??!1},onChange:t=>{e.setShowingDeleted?.(t)},name:`isDeleted`,get copy(){return{label:r()(`media.deleted.show`)}},theme:`error`})}}),null),p(d,a(c,{get when(){return u(()=>T()!==void 0||e.onResetFilters!==void 0)()&&!e.searchParams.hasDefaultFiltersApplied()},get children(){return a(y,{onReset:()=>{e.onResetFilters?e.onResetFilters():e.searchParams.resetFilters()}})}}),null),p(f,a(c,{get when(){return w()},get children(){return a(i,{theme:`border-outline`,size:`icon`,type:`button`,onClick:D,get disabled(){return n()},get"aria-label"(){return r()(`common.refresh`)},get children(){return a(t,{size:12,get class(){return(0,b.default)({"animate-spin":n()})}})}})}}),null),p(f,a(c,{get when(){return e.perPage!==void 0},get children(){return a(h,{get options(){return u(()=>e.perPage?.length===0)()?void 0:e.perPage},get searchParams(){return e.searchParams}})}}),null),p(o,a(c,{get when(){return T()},children:t=>a(_,{get open(){return E()},setOpen:O,get subject(){return t().subject},get fields(){return t().fields},get searchParams(){return e.searchParams},get embedded(){return t().embedded},get preserveSubjectCase(){return t().preserveSubjectCase},get parentPadding(){return e.options?.padding??`24`}})}),null),s(()=>l(o,(0,b.default)(`w-full flex flex-col gap-2.5`,{"px-4 pb-4":e.options?.padding===`16`,"px-4 md:px-6 pb-4 md:pb-6":e.options?.padding===`24`||e.options?.padding===void 0}))),o})()};export{S as t};