From 5d8880540b4dc46c25e49fafa027586276f2aa06 Mon Sep 17 00:00:00 2001 From: Norman Huth Date: Tue, 26 Nov 2024 07:58:01 +0100 Subject: [PATCH] feat: add component class for more style flexibility --- dist/js/tool.js | 2 +- dist/mix-manifest.json | 2 +- resources/js/components/MenuGroup.vue | 4 ++-- resources/js/components/MenuIcon.vue | 2 ++ resources/js/components/MenuItem.vue | 2 +- resources/js/components/MenuSection.vue | 4 ++-- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/dist/js/tool.js b/dist/js/tool.js index cc075fb..d11a5c3 100644 --- a/dist/js/tool.js +++ b/dist/js/tool.js @@ -1,2 +1,2 @@ /*! For license information please see tool.js.LICENSE.txt */ -(()=>{var e={8646:(e,t,r)=>{function n(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var o=n(r(2505)),i=r(5373),a=n(r(4744));function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&"back_forward"===window.performance.getEntriesByType("navigation")[0].type},r.handleBackForwardVisit=function(e){var t=this;window.history.state.version=e.version,this.setPage(window.history.state,{preserveScroll:!0,preserveState:!0}).then((function(){t.restoreScrollPositions(),b(e)}))},r.locationVisit=function(e,t){try{window.sessionStorage.setItem("inertiaLocationVisit",JSON.stringify({preserveScroll:t})),window.location.href=e.href,m(window.location).href===m(e).href&&window.location.reload()}catch(e){return!1}},r.isLocationVisit=function(){try{return null!==window.sessionStorage.getItem("inertiaLocationVisit")}catch(e){return!1}},r.handleLocationVisit=function(e){var t,r,n,o,i=this,a=JSON.parse(window.sessionStorage.getItem("inertiaLocationVisit")||"");window.sessionStorage.removeItem("inertiaLocationVisit"),e.url+=window.location.hash,e.rememberedState=null!=(t=null==(r=window.history.state)?void 0:r.rememberedState)?t:{},e.scrollRegions=null!=(n=null==(o=window.history.state)?void 0:o.scrollRegions)?n:[],this.setPage(e,{preserveScroll:a.preserveScroll,preserveState:!0}).then((function(){a.preserveScroll&&i.restoreScrollPositions(),b(e)}))},r.isLocationVisitResponse=function(e){return e&&409===e.status&&e.headers["x-inertia-location"]},r.isInertiaResponse=function(e){return null==e?void 0:e.headers["x-inertia"]},r.createVisitId=function(){return this.visitId={},this.visitId},r.cancelVisit=function(e,t){var r=t.cancelled,n=void 0!==r&&r,o=t.interrupted,i=void 0!==o&&o;!e||e.completed||e.cancelled||e.interrupted||(e.cancelToken.cancel(),e.onCancel(),e.completed=!1,e.cancelled=n,e.interrupted=i,g(e),e.onFinish(e))},r.finishVisit=function(e){e.cancelled||e.interrupted||(e.completed=!0,e.cancelled=!1,e.interrupted=!1,g(e),e.onFinish(e))},r.resolvePreserveOption=function(e,t){return"function"==typeof e?e(t):"errors"===e?Object.keys(t.props.errors||{}).length>0:e},r.visit=function(e,r){var n=this,i=void 0===r?{}:r,a=i.method,c=void 0===a?t.IT.GET:a,u=i.data,f=void 0===u?{}:u,d=i.replace,g=void 0!==d&&d,b=i.preserveScroll,w=void 0!==b&&b,x=i.preserveState,S=void 0!==x&&x,j=i.only,O=void 0===j?[]:j,k=i.headers,E=void 0===k?{}:k,_=i.errorBag,P=void 0===_?"":_,A=i.forceFormData,C=void 0!==A&&A,T=i.onCancelToken,N=void 0===T?function(){}:T,B=i.onBefore,D=void 0===B?function(){}:B,I=i.onStart,M=void 0===I?function(){}:I,L=i.onProgress,V=void 0===L?function(){}:L,F=i.onFinish,R=void 0===F?function(){}:F,U=i.onCancel,z=void 0===U?function(){}:U,G=i.onSuccess,$=void 0===G?function(){}:G,H=i.onError,W=void 0===H?function(){}:H,q=i.queryStringArrayFormat,K=void 0===q?"brackets":q,J="string"==typeof e?h(e):e;if(!function e(t){return t instanceof File||t instanceof Blob||t instanceof FileList&&t.length>0||t instanceof FormData&&Array.from(t.values()).some((function(t){return e(t)}))||"object"==typeof t&&null!==t&&Object.values(t).some((function(t){return e(t)}))}(f)&&!C||f instanceof FormData||(f=p(f)),!(f instanceof FormData)){var Q=y(c,J,f,K),X=Q[1];J=h(Q[0]),f=X}var Y={url:J,method:c,data:f,replace:g,preserveScroll:w,preserveState:S,only:O,headers:E,errorBag:P,forceFormData:C,queryStringArrayFormat:K,cancelled:!1,completed:!1,interrupted:!1};if(!1!==D(Y)&&function(e){return v("before",{cancelable:!0,detail:{visit:e}})}(Y)){this.activeVisit&&this.cancelVisit(this.activeVisit,{interrupted:!0}),this.saveScrollPositions();var Z=this.createVisitId();this.activeVisit=s({},Y,{onCancelToken:N,onBefore:D,onStart:M,onProgress:V,onFinish:R,onCancel:z,onSuccess:$,onError:W,queryStringArrayFormat:K,cancelToken:o.CancelToken.source()}),N({cancel:function(){n.activeVisit&&n.cancelVisit(n.activeVisit,{cancelled:!0})}}),function(e){v("start",{detail:{visit:e}})}(Y),M(Y),o({method:c,url:m(J).href,data:c===t.IT.GET?{}:f,params:c===t.IT.GET?f:{},cancelToken:this.activeVisit.cancelToken.token,headers:s({},E,{Accept:"text/html, application/xhtml+xml","X-Requested-With":"XMLHttpRequest","X-Inertia":!0},O.length?{"X-Inertia-Partial-Component":this.page.component,"X-Inertia-Partial-Data":O.join(",")}:{},P&&P.length?{"X-Inertia-Error-Bag":P}:{},this.page.version?{"X-Inertia-Version":this.page.version}:{}),onUploadProgress:function(e){f instanceof FormData&&(e.percentage=Math.round(e.loaded/e.total*100),function(e){v("progress",{detail:{progress:e}})}(e),V(e))}}).then((function(e){var t;if(!n.isInertiaResponse(e))return Promise.reject({response:e});var r=e.data;O.length&&r.component===n.page.component&&(r.props=s({},n.page.props,r.props)),w=n.resolvePreserveOption(w,r),(S=n.resolvePreserveOption(S,r))&&null!=(t=window.history.state)&&t.rememberedState&&r.component===n.page.component&&(r.rememberedState=window.history.state.rememberedState);var o=J,i=h(r.url);return o.hash&&!i.hash&&m(o).href===i.href&&(i.hash=o.hash,r.url=i.href),n.setPage(r,{visitId:Z,replace:g,preserveScroll:w,preserveState:S})})).then((function(){var e=n.page.props.errors||{};if(Object.keys(e).length>0){var t=P?e[P]?e[P]:{}:e;return function(e){v("error",{detail:{errors:e}})}(t),W(t)}return v("success",{detail:{page:n.page}}),$(n.page)})).catch((function(e){if(n.isInertiaResponse(e.response))return n.setPage(e.response.data,{visitId:Z});if(n.isLocationVisitResponse(e.response)){var t=h(e.response.headers["x-inertia-location"]),r=J;r.hash&&!t.hash&&m(r).href===t.href&&(t.hash=r.hash),n.locationVisit(t,!0===w)}else{if(!e.response)return Promise.reject(e);v("invalid",{cancelable:!0,detail:{response:e.response}})&&l.show(e.response.data)}})).then((function(){n.activeVisit&&n.finishVisit(n.activeVisit)})).catch((function(e){if(!o.isCancel(e)){var t=v("exception",{cancelable:!0,detail:{exception:e}});if(n.activeVisit&&n.finishVisit(n.activeVisit),t)return Promise.reject(e)}}))}},r.setPage=function(e,t){var r=this,n=void 0===t?{}:t,o=n.visitId,i=void 0===o?this.createVisitId():o,a=n.replace,s=void 0!==a&&a,c=n.preserveScroll,l=void 0!==c&&c,u=n.preserveState,p=void 0!==u&&u;return Promise.resolve(this.resolveComponent(e.component)).then((function(t){i===r.visitId&&(e.scrollRegions=e.scrollRegions||[],e.rememberedState=e.rememberedState||{},(s=s||h(e.url).href===window.location.href)?r.replaceState(e):r.pushState(e),r.swapComponent({component:t,page:e,preserveState:p}).then((function(){l||r.resetScrollPositions(),s||b(e)})))}))},r.pushState=function(e){this.page=e,window.history.pushState(e,"",e.url)},r.replaceState=function(e){this.page=e,window.history.replaceState(e,"",e.url)},r.handlePopstateEvent=function(e){var t=this;if(null!==e.state){var r=e.state,n=this.createVisitId();Promise.resolve(this.resolveComponent(r.component)).then((function(e){n===t.visitId&&(t.page=r,t.swapComponent({component:e,page:r,preserveState:!1}).then((function(){t.restoreScrollPositions(),b(r)})))}))}else{var o=h(this.page.url);o.hash=window.location.hash,this.replaceState(s({},this.page,{url:o.href})),this.resetScrollPositions()}},r.get=function(e,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),this.visit(e,s({},n,{method:t.IT.GET,data:r}))},r.reload=function(e){return void 0===e&&(e={}),this.visit(window.location.href,s({},e,{preserveScroll:!0,preserveState:!0}))},r.replace=function(e,t){var r;return void 0===t&&(t={}),console.warn("Inertia.replace() has been deprecated and will be removed in a future release. Please use Inertia."+(null!=(r=t.method)?r:"get")+"() instead."),this.visit(e,s({preserveState:!0},t,{replace:!0}))},r.post=function(e,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),this.visit(e,s({preserveState:!0},n,{method:t.IT.POST,data:r}))},r.put=function(e,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),this.visit(e,s({preserveState:!0},n,{method:t.IT.PUT,data:r}))},r.patch=function(e,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),this.visit(e,s({preserveState:!0},n,{method:t.IT.PATCH,data:r}))},r.delete=function(e,r){return void 0===r&&(r={}),this.visit(e,s({preserveState:!0},r,{method:t.IT.DELETE}))},r.remember=function(e,t){var r,n;void 0===t&&(t="default"),w||this.replaceState(s({},this.page,{rememberedState:s({},null==(r=this.page)?void 0:r.rememberedState,(n={},n[t]=e,n))}))},r.restore=function(e){var t,r;if(void 0===e&&(e="default"),!w)return null==(t=window.history.state)||null==(r=t.rememberedState)?void 0:r[e]},r.on=function(e,t){var r=function(e){var r=t(e);e.cancelable&&!e.defaultPrevented&&!1===r&&e.preventDefault()};return document.addEventListener("inertia:"+e,r),function(){return document.removeEventListener("inertia:"+e,r)}},e}(),S={buildDOMElement:function(e){var t=document.createElement("template");t.innerHTML=e;var r=t.content.firstChild;if(!e.startsWith("