update packages
This commit is contained in:
51 files changed
+1983
-1681
No files matched your search
@@ -1 +1 @@
|
||||
function a({name:r,recordKey:s,state:n}){return{error:void 0,isLoading:!1,state:n,unsubscribeLivewireHook:null,init(){this.unsubscribeLivewireHook=Livewire.interceptMessage(({message:e,onSuccess:t})=>{t(()=>{this.$nextTick(()=>{if(this.isLoading||e.component.id!==this.$root.closest("[wire\\:id]")?.attributes["wire:id"].value)return;let i=this.getServerState();i===void 0||Alpine.raw(this.state)===i||(this.state=i)})})}),this.$watch("state",async()=>{let e=this.getServerState();if(e===void 0||Alpine.raw(this.state)===e)return;this.isLoading=!0;let t=await this.$wire.updateTableColumnState(r,s,this.state);this.error=t?.error??void 0,!this.error&&this.$refs.serverState&&(this.$refs.serverState.value=this.state?"1":"0"),this.isLoading=!1})},getServerState(){if(this.$refs.serverState)return[1,"1"].includes(this.$refs.serverState.value)},destroy(){this.unsubscribeLivewireHook?.()}}}export{a as default};
|
||||
function h({name:s,recordKey:u,state:f,messages:r}){let l=e=>e.method==="updateTableColumnState"&&e.params[0]===s&&String(e.params[1])===String(u);return{error:void 0,isLoading:!1,isDestroyed:!1,isRefreshing:!1,hasRenderedState:!1,state:f,status:void 0,unsubscribeLivewireHook:null,unsubscribeRequestHook:null,initEditableColumn(){this.unsubscribeLivewireHook=Livewire.interceptMessage(({message:e,onSuccess:t})=>{if(e.component.id!==this.$wire.$id)return;let a=e.calls.some(l),i=this.isRefreshing;t(({payload:n,onMorphed:o})=>o(()=>{let d=n.effects,c=!!d.html||this.isRenderedByPartial(d.partials);(a||i)&&(this.hasRenderedState=c),i&&(this.isRefreshing=!1),c&&this.$nextTick(()=>{!this.isDestroyed&&!this.isLoading&&this.syncServerState()})}))}),this.$watch("state",async()=>{let e=this.getServerState();if(!(this.isDestroyed||this.isLoading||e===void 0||this.getNormalizedState()===e)){this.clearError(),this.isLoading=!0,this.hasRenderedState=!1,this.status=r?.saving,this.unsubscribeRequestHook=Livewire.interceptRequest(({request:t,onResponse:a})=>{t.payload.components.some(i=>JSON.parse(i.snapshot).memo.id===this.$wire.$id&&(this.isRefreshing||i.calls.some(l)))&&a(({response:i})=>{let n=i.text.bind(i);i.text=async()=>{try{return await n()}catch(o){throw t.cancel(),this.handleSaveFailure(),o}}})});try{let t=await this.$wire.updateTableColumnState(s,u,this.state);if(await this.$nextTick(),!this.isDestroyed&&!this.hasRenderedState&&(this.isRefreshing=!0,await this.$wire.$refresh(),await this.$nextTick(),!this.hasRenderedState)){this.handleSaveFailure();return}if(this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null,this.isDestroyed)return;this.error=t?.error??void 0,this.status=this.error??r?.saved,this.isLoading=!1,this.syncServerState()}catch{this.handleSaveFailure()}}})},isRenderedByPartial(e){if(!e)return!1;let t=this.$el.closest("[wire\\:partial]");for(;t;){if(Object.hasOwn(e,t.getAttribute("wire:partial")))return!0;t=t.parentElement?.closest("[wire\\:partial]")}return!1},syncServerState(){let e=this.getServerState();e!==void 0&&(this.state=e)},getNormalizedState(){return Alpine.raw(this.state)??""},clearError(){this.isLoading||(this.error=void 0,this.status=void 0)},handleSaveFailure(){this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null,!this.isDestroyed&&(this.error=r?.failure??"The save could not be confirmed. Refresh the page before trying again.",this.status=this.error,this.isRefreshing=!1,this.isLoading=!1)},preventEdit(e){!this.isLoading||e.type==="keydown"&&["Tab","Escape"].includes(e.key)||(e.preventDefault(),e.stopImmediatePropagation())},getAccessibilityAttributes(e={}){return{...e,"aria-invalid":this.error?"true":e["aria-invalid"]??null,"aria-busy":this.isLoading?"true":e["aria-busy"]??null,"aria-describedby":[e["aria-describedby"],this.error&&r?this.$id("table-column-error"):null].filter(Boolean).join(" ")||null}},destroy(){this.isDestroyed=!0,this.unsubscribeLivewireHook?.(),this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null}}}function b(s){return{...h(s),init(){this.initEditableColumn()},getServerState(){if(this.$refs.serverState)return[1,"1"].includes(this.$refs.serverState.value)}}}export{b as default};
|
||||
@@ -1,4 +1,4 @@
|
||||
var Ht=Math.min,vt=Math.max,Wt=Math.round;var st=i=>({x:i,y:i}),Ji={left:"right",right:"left",bottom:"top",top:"bottom"};function Ce(i,t,e){return vt(i,Ht(t,e))}function Vt(i,t){return typeof i=="function"?i(t):i}function wt(i){return i.split("-")[0]}function zt(i){return i.split("-")[1]}function Le(i){return i==="x"?"y":"x"}function Ie(i){return i==="y"?"height":"width"}function ut(i){let t=i[0];return t==="t"||t==="b"?"y":"x"}function Te(i){return Le(ut(i))}function Ze(i,t,e){e===void 0&&(e=!1);let n=zt(i),o=Te(i),s=Ie(o),r=o==="x"?n===(e?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=Ft(r)),[r,Ft(r)]}function ti(i){let t=Ft(i);return[oe(i),t,oe(t)]}function oe(i){return i.includes("start")?i.replace("start","end"):i.replace("end","start")}var Je=["left","right"],Qe=["right","left"],Qi=["top","bottom"],Zi=["bottom","top"];function tn(i,t,e){switch(i){case"top":case"bottom":return e?t?Qe:Je:t?Je:Qe;case"left":case"right":return t?Qi:Zi;default:return[]}}function ei(i,t,e,n){let o=zt(i),s=tn(wt(i),e==="start",n);return o&&(s=s.map(r=>r+"-"+o),t&&(s=s.concat(s.map(oe)))),s}function Ft(i){let t=wt(i);return Ji[t]+i.slice(t.length)}function en(i){return{top:0,right:0,bottom:0,left:0,...i}}function ii(i){return typeof i!="number"?en(i):{top:i,right:i,bottom:i,left:i}}function Et(i){let{x:t,y:e,width:n,height:o}=i;return{width:n,height:o,top:e,left:t,right:t+n,bottom:e+o,x:t,y:e}}function ni(i,t,e){let{reference:n,floating:o}=i,s=ut(t),r=Te(t),a=Ie(r),l=wt(t),c=s==="y",h=n.x+n.width/2-o.width/2,d=n.y+n.height/2-o.height/2,f=n[a]/2-o[a]/2,p;switch(l){case"top":p={x:h,y:n.y-o.height};break;case"bottom":p={x:h,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:d};break;case"left":p={x:n.x-o.width,y:d};break;default:p={x:n.x,y:n.y}}switch(zt(t)){case"start":p[r]-=f*(e&&c?-1:1);break;case"end":p[r]+=f*(e&&c?-1:1);break}return p}async function oi(i,t){var e;t===void 0&&(t={});let{x:n,y:o,platform:s,rects:r,elements:a,strategy:l}=i,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=Vt(t,i),g=ii(p),x=a[f?d==="floating"?"reference":"floating":d],D=Et(await s.getClippingRect({element:(e=await(s.isElement==null?void 0:s.isElement(x)))==null||e?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),y=d==="floating"?{x:n,y:o,width:r.floating.width,height:r.floating.height}:r.reference,A=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),O=await(s.isElement==null?void 0:s.isElement(A))?await(s.getScale==null?void 0:s.getScale(A))||{x:1,y:1}:{x:1,y:1},P=Et(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:A,strategy:l}):y);return{top:(D.top-P.top+g.top)/O.y,bottom:(P.bottom-D.bottom+g.bottom)/O.y,left:(D.left-P.left+g.left)/O.x,right:(P.right-D.right+g.right)/O.x}}var nn=50,si=async(i,t,e)=>{let{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:r}=e,a=r.detectOverflow?r:{...r,detectOverflow:oi},l=await(r.isRTL==null?void 0:r.isRTL(t)),c=await r.getElementRects({reference:i,floating:t,strategy:o}),{x:h,y:d}=ni(c,n,l),f=n,p=0,g={};for(let m=0;m<s.length;m++){let x=s[m];if(!x)continue;let{name:D,fn:y}=x,{x:A,y:O,data:P,reset:C}=await y({x:h,y:d,initialPlacement:n,placement:f,strategy:o,middlewareData:g,rects:c,platform:a,elements:{reference:i,floating:t}});h=A??h,d=O??d,g[D]={...g[D],...P},C&&p<nn&&(p++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(c=C.rects===!0?await r.getElementRects({reference:i,floating:t,strategy:o}):C.rects),{x:h,y:d}=ni(c,f,l)),m=-1)}return{x:h,y:d,placement:f,strategy:o,middlewareData:g}};var ri=function(i){return i===void 0&&(i={}),{name:"flip",options:i,async fn(t){var e,n;let{placement:o,middlewareData:s,rects:r,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...x}=Vt(i,t);if((e=s.arrow)!=null&&e.alignmentOffset)return{};let D=wt(o),y=ut(a),A=wt(a)===a,O=await(l.isRTL==null?void 0:l.isRTL(c.floating)),P=f||(A||!m?[Ft(a)]:ti(a)),C=g!=="none";!f&&C&&P.push(...ei(a,m,g,O));let q=[a,...P],J=await l.detectOverflow(t,x),M=[],V=((n=s.flip)==null?void 0:n.overflows)||[];if(h&&M.push(J[D]),d){let T=Ze(o,r,O);M.push(J[T[0]],J[T[1]])}if(V=[...V,{placement:o,overflows:M}],!M.every(T=>T<=0)){var K,N;let T=(((K=s.flip)==null?void 0:K.index)||0)+1,ot=q[T];if(ot&&(!(d==="alignment"?y!==ut(ot):!1)||V.every(H=>ut(H.placement)===y?H.overflows[0]>0:!0)))return{data:{index:T,overflows:V},reset:{placement:ot}};let z=(N=V.filter(X=>X.overflows[0]<=0).sort((X,H)=>X.overflows[1]-H.overflows[1])[0])==null?void 0:N.placement;if(!z)switch(p){case"bestFit":{var k;let X=(k=V.filter(H=>{if(C){let tt=ut(H.placement);return tt===y||tt==="y"}return!0}).map(H=>[H.placeLine truncated
|
||||
var $t=Math.min,vt=Math.max,Vt=Math.round;var ot=i=>({x:i,y:i}),on={left:"right",right:"left",bottom:"top",top:"bottom"};function Le(i,t,e){return vt(i,$t(t,e))}function Wt(i,t){return typeof i=="function"?i(t):i}function yt(i){return i.split("-")[0]}function zt(i){return i.split("-")[1]}function Re(i){return i==="x"?"y":"x"}function Te(i){return i==="y"?"height":"width"}function ft(i){let t=i[0];return t==="t"||t==="b"?"y":"x"}function Ie(i){return Re(ft(i))}function ei(i,t,e){e===void 0&&(e=!1);let n=zt(i),s=Ie(i),o=Te(s),r=s==="x"?n===(e?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(r=Ht(r)),[r,Ht(r)]}function ii(i){let t=Ht(i);return[oe(i),t,oe(t)]}function oe(i){return i.includes("start")?i.replace("start","end"):i.replace("end","start")}var Ze=["left","right"],ti=["right","left"],rn=["top","bottom"],an=["bottom","top"];function ln(i,t,e){switch(i){case"top":case"bottom":return e?t?ti:Ze:t?Ze:ti;case"left":case"right":return t?rn:an;default:return[]}}function ni(i,t,e,n){let s=zt(i),o=ln(yt(i),e==="start",n);return s&&(o=o.map(r=>r+"-"+s),t&&(o=o.concat(o.map(oe)))),o}function Ht(i){let t=yt(i);return on[t]+i.slice(t.length)}function cn(i){return{top:0,right:0,bottom:0,left:0,...i}}function si(i){return typeof i!="number"?cn(i):{top:i,right:i,bottom:i,left:i}}function Ot(i){let{x:t,y:e,width:n,height:s}=i;return{width:n,height:s,top:e,left:t,right:t+n,bottom:e+s,x:t,y:e}}function oi(i,t,e){let{reference:n,floating:s}=i,o=ft(t),r=Ie(t),a=Te(r),l=yt(t),c=o==="y",h=n.x+n.width/2-s.width/2,u=n.y+n.height/2-s.height/2,f=n[a]/2-s[a]/2,p;switch(l){case"top":p={x:h,y:n.y-s.height};break;case"bottom":p={x:h,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:u};break;case"left":p={x:n.x-s.width,y:u};break;default:p={x:n.x,y:n.y}}switch(zt(t)){case"start":p[r]-=f*(e&&c?-1:1);break;case"end":p[r]+=f*(e&&c?-1:1);break}return p}async function ri(i,t){var e;t===void 0&&(t={});let{x:n,y:s,platform:o,rects:r,elements:a,strategy:l}=i,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:f=!1,padding:p=0}=Wt(t,i),m=si(p),w=a[f?u==="floating"?"reference":"floating":u],x=Ot(await o.getClippingRect({element:(e=await(o.isElement==null?void 0:o.isElement(w)))==null||e?w:w.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),S=u==="floating"?{x:n,y:s,width:r.floating.width,height:r.floating.height}:r.reference,A=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),D=await(o.isElement==null?void 0:o.isElement(A))?await(o.getScale==null?void 0:o.getScale(A))||{x:1,y:1}:{x:1,y:1},_=Ot(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:S,offsetParent:A,strategy:l}):S);return{top:(x.top-_.top+m.top)/D.y,bottom:(_.bottom-x.bottom+m.bottom)/D.y,left:(x.left-_.left+m.left)/D.x,right:(_.right-x.right+m.right)/D.x}}var hn=50,ai=async(i,t,e)=>{let{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:r}=e,a=r.detectOverflow?r:{...r,detectOverflow:ri},l=await(r.isRTL==null?void 0:r.isRTL(t)),c=await r.getElementRects({reference:i,floating:t,strategy:s}),{x:h,y:u}=oi(c,n,l),f=n,p=0,m={};for(let g=0;g<o.length;g++){let w=o[g];if(!w)continue;let{name:x,fn:S}=w,{x:A,y:D,data:_,reset:C}=await S({x:h,y:u,initialPlacement:n,placement:f,strategy:s,middlewareData:m,rects:c,platform:a,elements:{reference:i,floating:t}});h=A??h,u=D??u,m[x]={...m[x],..._},C&&p<hn&&(p++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(c=C.rects===!0?await r.getElementRects({reference:i,floating:t,strategy:s}):C.rects),{x:h,y:u}=oi(c,f,l)),g=-1)}return{x:h,y:u,placement:f,strategy:s,middlewareData:m}};var li=function(i){return i===void 0&&(i={}),{name:"flip",options:i,async fn(t){var e,n;let{placement:s,middlewareData:o,rects:r,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:h=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...w}=Wt(i,t);if((e=o.arrow)!=null&&e.alignmentOffset)return{};let x=yt(s),S=ft(a),A=yt(a)===a,D=await(l.isRTL==null?void 0:l.isRTL(c.floating)),_=f||(A||!g?[Ht(a)]:ii(a)),C=m!=="none";!f&&C&&_.push(...ni(a,g,m,D));let V=[a,..._],J=await l.detectOverflow(t,w),I=[],W=((n=o.flip)==null?void 0:n.overflows)||[];if(h&&I.push(J[x]),u){let P=ei(s,r,D);I.push(J[P[0]],J[P[1]])}if(W=[...W,{placement:s,overflows:I}],!I.every(P=>P<=0)){var j,tt;let P=(((j=o.flip)==null?void 0:j.index)||0)+1,N=V[P];if(N&&(!(u==="alignment"?S!==ft(N):!1)||W.every(F=>ft(F.placement)===S?F.overflows[0]>0:!0)))return{data:{index:P,overflows:W},reset:{placement:N}};let L=(tt=W.filter(q=>q.overflows[0]<=0).sort((q,F)=>q.overflows[1]-F.overflows[1])[0])==null?void 0:tt.placement;if(!L)switch(p){case"bestFit":{var z;let q=(z=W.filter(F=>{if(C){let et=ft(F.placement);return et===S||et==="y"}return!0}).map(F=>[F.placemLine truncated
|
||||
/*! Bundled license information:
|
||||
|
||||
sortablejs/modular/sortable.esm.js:
|
||||
|
||||
@@ -1 +1 @@
|
||||
function a({name:i,recordKey:s,state:n}){return{error:void 0,isLoading:!1,state:n,unsubscribeLivewireHook:null,init(){this.unsubscribeLivewireHook=Livewire.interceptMessage(({message:e,onSuccess:t})=>{t(()=>{this.$nextTick(()=>{if(this.isLoading||e.component.id!==this.$root.closest("[wire\\:id]")?.attributes["wire:id"].value)return;let r=this.getServerState();r===void 0||this.getNormalizedState()===r||(this.state=r)})})}),this.$watch("state",async()=>{let e=this.getServerState();if(e===void 0||this.getNormalizedState()===e)return;this.isLoading=!0;let t=await this.$wire.updateTableColumnState(i,s,this.state);this.error=t?.error??void 0,!this.error&&this.$refs.serverState&&(this.$refs.serverState.value=this.getNormalizedState()),this.isLoading=!1})},getServerState(){if(this.$refs.serverState)return[null,void 0].includes(this.$refs.serverState.value)?"":this.$refs.serverState.value.replaceAll('\\"','"')},getNormalizedState(){let e=Alpine.raw(this.state);return[null,void 0].includes(e)?"":e},destroy(){this.unsubscribeLivewireHook?.()}}}export{a as default};
|
||||
function u({name:s,recordKey:h,state:c,messages:r}){let l=e=>e.method==="updateTableColumnState"&&e.params[0]===s&&String(e.params[1])===String(h);return{error:void 0,isLoading:!1,isDestroyed:!1,isRefreshing:!1,hasRenderedState:!1,state:c,status:void 0,unsubscribeLivewireHook:null,unsubscribeRequestHook:null,initEditableColumn(){this.unsubscribeLivewireHook=Livewire.interceptMessage(({message:e,onSuccess:t})=>{if(e.component.id!==this.$wire.$id)return;let a=e.calls.some(l),i=this.isRefreshing;t(({payload:n,onMorphed:o})=>o(()=>{let d=n.effects,f=!!d.html||this.isRenderedByPartial(d.partials);(a||i)&&(this.hasRenderedState=f),i&&(this.isRefreshing=!1),f&&this.$nextTick(()=>{!this.isDestroyed&&!this.isLoading&&this.syncServerState()})}))}),this.$watch("state",async()=>{let e=this.getServerState();if(!(this.isDestroyed||this.isLoading||e===void 0||this.getNormalizedState()===e)){this.clearError(),this.isLoading=!0,this.hasRenderedState=!1,this.status=r?.saving,this.unsubscribeRequestHook=Livewire.interceptRequest(({request:t,onResponse:a})=>{t.payload.components.some(i=>JSON.parse(i.snapshot).memo.id===this.$wire.$id&&(this.isRefreshing||i.calls.some(l)))&&a(({response:i})=>{let n=i.text.bind(i);i.text=async()=>{try{return await n()}catch(o){throw t.cancel(),this.handleSaveFailure(),o}}})});try{let t=await this.$wire.updateTableColumnState(s,h,this.state);if(await this.$nextTick(),!this.isDestroyed&&!this.hasRenderedState&&(this.isRefreshing=!0,await this.$wire.$refresh(),await this.$nextTick(),!this.hasRenderedState)){this.handleSaveFailure();return}if(this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null,this.isDestroyed)return;this.error=t?.error??void 0,this.status=this.error??r?.saved,this.isLoading=!1,this.syncServerState()}catch{this.handleSaveFailure()}}})},isRenderedByPartial(e){if(!e)return!1;let t=this.$el.closest("[wire\\:partial]");for(;t;){if(Object.hasOwn(e,t.getAttribute("wire:partial")))return!0;t=t.parentElement?.closest("[wire\\:partial]")}return!1},syncServerState(){let e=this.getServerState();e!==void 0&&(this.state=e)},getNormalizedState(){return Alpine.raw(this.state)??""},clearError(){this.isLoading||(this.error=void 0,this.status=void 0)},handleSaveFailure(){this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null,!this.isDestroyed&&(this.error=r?.failure??"The save could not be confirmed. Refresh the page before trying again.",this.status=this.error,this.isRefreshing=!1,this.isLoading=!1)},preventEdit(e){!this.isLoading||e.type==="keydown"&&["Tab","Escape"].includes(e.key)||(e.preventDefault(),e.stopImmediatePropagation())},getAccessibilityAttributes(e={}){return{...e,"aria-invalid":this.error?"true":e["aria-invalid"]??null,"aria-busy":this.isLoading?"true":e["aria-busy"]??null,"aria-describedby":[e["aria-describedby"],this.error&&r?this.$id("table-column-error"):null].filter(Boolean).join(" ")||null}},destroy(){this.isDestroyed=!0,this.unsubscribeLivewireHook?.(),this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null}}}function b(s){return{...u(s),init(){this.initEditableColumn()},getServerState(){if(this.$refs.serverState)return[null,void 0].includes(this.$refs.serverState.value)?"":this.$refs.serverState.value.replaceAll('\\"','"')}}}export{b as default};
|
||||
@@ -1 +1 @@
|
||||
function a({name:r,recordKey:s,state:n}){return{error:void 0,isLoading:!1,state:n,unsubscribeLivewireHook:null,init(){this.unsubscribeLivewireHook=Livewire.interceptMessage(({message:e,onSuccess:t})=>{t(()=>{this.$nextTick(()=>{if(this.isLoading||e.component.id!==this.$root.closest("[wire\\:id]")?.attributes["wire:id"].value)return;let i=this.getServerState();i===void 0||Alpine.raw(this.state)===i||(this.state=i)})})}),this.$watch("state",async()=>{let e=this.getServerState();if(e===void 0||Alpine.raw(this.state)===e)return;this.isLoading=!0;let t=await this.$wire.updateTableColumnState(r,s,this.state);this.error=t?.error??void 0,!this.error&&this.$refs.serverState&&(this.$refs.serverState.value=this.state?"1":"0"),this.isLoading=!1})},getServerState(){if(this.$refs.serverState)return[1,"1"].includes(this.$refs.serverState.value)},destroy(){this.unsubscribeLivewireHook?.()}}}export{a as default};
|
||||
function u({name:s,recordKey:r,state:c,messages:a}){let l=e=>e.method==="updateTableColumnState"&&e.params[0]===s&&String(e.params[1])===String(r);return{error:void 0,isLoading:!1,isDestroyed:!1,isRefreshing:!1,hasRenderedState:!1,state:c,status:void 0,unsubscribeLivewireHook:null,unsubscribeRequestHook:null,initEditableColumn(){this.unsubscribeLivewireHook=Livewire.interceptMessage(({message:e,onSuccess:t})=>{if(e.component.id!==this.$wire.$id)return;let n=e.calls.some(l),i=this.isRefreshing;t(({payload:o,onMorphed:h})=>h(()=>{let d=o.effects,f=!!d.html||this.isRenderedByPartial(d.partials);(n||i)&&(this.hasRenderedState=f),i&&(this.isRefreshing=!1),f&&this.$nextTick(()=>{!this.isDestroyed&&!this.isLoading&&this.syncServerState()})}))}),this.$watch("state",async()=>{let e=this.getServerState();if(!(this.isDestroyed||this.isLoading||e===void 0||this.getNormalizedState()===e)){this.clearError(),this.isLoading=!0,this.hasRenderedState=!1,this.status=a?.saving,this.unsubscribeRequestHook=Livewire.interceptRequest(({request:t,onResponse:n})=>{t.payload.components.some(i=>JSON.parse(i.snapshot).memo.id===this.$wire.$id&&(this.isRefreshing||i.calls.some(l)))&&n(({response:i})=>{let o=i.text.bind(i);i.text=async()=>{try{return await o()}catch(h){throw t.cancel(),this.handleSaveFailure(),h}}})});try{let t=await this.$wire.updateTableColumnState(s,r,this.state);if(await this.$nextTick(),!this.isDestroyed&&!this.hasRenderedState&&(this.isRefreshing=!0,await this.$wire.$refresh(),await this.$nextTick(),!this.hasRenderedState)){this.handleSaveFailure();return}if(this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null,this.isDestroyed)return;this.error=t?.error??void 0,this.status=this.error??a?.saved,this.isLoading=!1,this.syncServerState()}catch{this.handleSaveFailure()}}})},isRenderedByPartial(e){if(!e)return!1;let t=this.$el.closest("[wire\\:partial]");for(;t;){if(Object.hasOwn(e,t.getAttribute("wire:partial")))return!0;t=t.parentElement?.closest("[wire\\:partial]")}return!1},syncServerState(){let e=this.getServerState();e!==void 0&&(this.state=e)},getNormalizedState(){return Alpine.raw(this.state)??""},clearError(){this.isLoading||(this.error=void 0,this.status=void 0)},handleSaveFailure(){this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null,!this.isDestroyed&&(this.error=a?.failure??"The save could not be confirmed. Refresh the page before trying again.",this.status=this.error,this.isRefreshing=!1,this.isLoading=!1)},preventEdit(e){!this.isLoading||e.type==="keydown"&&["Tab","Escape"].includes(e.key)||(e.preventDefault(),e.stopImmediatePropagation())},getAccessibilityAttributes(e={}){return{...e,"aria-invalid":this.error?"true":e["aria-invalid"]??null,"aria-busy":this.isLoading?"true":e["aria-busy"]??null,"aria-describedby":[e["aria-describedby"],this.error&&a?this.$id("table-column-error"):null].filter(Boolean).join(" ")||null}},destroy(){this.isDestroyed=!0,this.unsubscribeLivewireHook?.(),this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null}}}function b(s){return{...u(s),init(){this.initEditableColumn()},getServerState(){if(this.$refs.serverState)return[1,"1"].includes(this.$refs.serverState.value)},toggleState(r){r.hasAttribute("disabled")||(this.clearError(),this.state=!this.state)}}}export{b as default};
|
||||
Reference in new issue
Block a user