diff --git a/dist/js/field.js b/dist/js/field.js index 8edc5dc..a43c2dc 100644 --- a/dist/js/field.js +++ b/dist/js/field.js @@ -1,2 +1,2 @@ /*! For license information please see field.js.LICENSE.txt */ -(()=>{var t,r={9680:(t,e,r)=>{function n(t){return t&&"object"==typeof t&&"default"in t?t.default:t}var o=n(r(3945)),i=r(129),a=n(r(9996));function c(){return(c=Object.assign||function(t){for(var e=1;e0&&"back_forward"===window.performance.getEntriesByType("navigation")[0].type},r.handleBackForwardVisit=function(t){var e=this;window.history.state.version=t.version,this.setPage(window.history.state,{preserveScroll:!0,preserveState:!0}).then((function(){e.restoreScrollPositions(),b(t)}))},r.locationVisit=function(t,e){try{window.sessionStorage.setItem("inertiaLocationVisit",JSON.stringify({preserveScroll:e})),window.location.href=t.href,m(window.location).href===m(t).href&&window.location.reload()}catch(t){return!1}},r.isLocationVisit=function(){try{return null!==window.sessionStorage.getItem("inertiaLocationVisit")}catch(t){return!1}},r.handleLocationVisit=function(t){var e,r,n,o,i=this,a=JSON.parse(window.sessionStorage.getItem("inertiaLocationVisit")||"");window.sessionStorage.removeItem("inertiaLocationVisit"),t.url+=window.location.hash,t.rememberedState=null!=(e=null==(r=window.history.state)?void 0:r.rememberedState)?e:{},t.scrollRegions=null!=(n=null==(o=window.history.state)?void 0:o.scrollRegions)?n:[],this.setPage(t,{preserveScroll:a.preserveScroll,preserveState:!0}).then((function(){a.preserveScroll&&i.restoreScrollPositions(),b(t)}))},r.isLocationVisitResponse=function(t){return t&&409===t.status&&t.headers["x-inertia-location"]},r.isInertiaResponse=function(t){return null==t?void 0:t.headers["x-inertia"]},r.createVisitId=function(){return this.visitId={},this.visitId},r.cancelVisit=function(t,e){var r=e.cancelled,n=void 0!==r&&r,o=e.interrupted,i=void 0!==o&&o;!t||t.completed||t.cancelled||t.interrupted||(t.cancelToken.cancel(),t.onCancel(),t.completed=!1,t.cancelled=n,t.interrupted=i,y(t),t.onFinish(t))},r.finishVisit=function(t){t.cancelled||t.interrupted||(t.completed=!0,t.cancelled=!1,t.interrupted=!1,y(t),t.onFinish(t))},r.resolvePreserveOption=function(t,e){return"function"==typeof t?t(e):"errors"===t?Object.keys(e.props.errors||{}).length>0:t},r.visit=function(t,r){var n=this,i=void 0===r?{}:r,a=i.method,u=void 0===a?e.n$.GET:a,l=i.data,p=void 0===l?{}:l,h=i.replace,y=void 0!==h&&h,b=i.preserveScroll,w=void 0!==b&&b,x=i.preserveState,_=void 0!==x&&x,E=i.only,S=void 0===E?[]:E,O=i.headers,C=void 0===O?{}:O,k=i.errorBag,j=void 0===k?"":k,A=i.forceFormData,M=void 0!==A&&A,N=i.onCancelToken,P=void 0===N?function(){}:N,D=i.onBefore,T=void 0===D?function(){}:D,L=i.onStart,B=void 0===L?function(){}:L,I=i.onProgress,R=void 0===I?function(){}:I,F=i.onFinish,V=void 0===F?function(){}:F,U=i.onCancel,z=void 0===U?function(){}:U,H=i.onSuccess,W=void 0===H?function(){}:H,$=i.onError,q=void 0===$?function(){}:$,G=i.queryStringArrayFormat,X=void 0===G?"brackets":G,Y="string"==typeof t?d(t):t;if(!function t(e){return e instanceof File||e instanceof Blob||e instanceof FileList&&e.length>0||e instanceof FormData&&Array.from(e.values()).some((function(e){return t(e)}))||"object"==typeof e&&null!==e&&Object.values(e).some((function(e){return t(e)}))}(p)&&!M||p instanceof FormData||(p=f(p)),!(p instanceof FormData)){var Z=v(u,Y,p,X),K=Z[1];Y=d(Z[0]),p=K}var J={url:Y,method:u,data:p,replace:y,preserveScroll:w,preserveState:_,only:S,headers:C,errorBag:j,forceFormData:M,queryStringArrayFormat:X,cancelled:!1,completed:!1,interrupted:!1};if(!1!==T(J)&&function(t){return g("before",{cancelable:!0,detail:{visit:t}})}(J)){this.activeVisit&&this.cancelVisit(this.activeVisit,{interrupted:!0}),this.saveScrollPositions();var Q=this.createVisitId();this.activeVisit=c({},J,{onCancelToken:P,onBefore:T,onStart:B,onProgress:R,onFinish:V,onCancel:z,onSuccess:W,onError:q,queryStringArrayFormat:X,cancelToken:o.CancelToken.source()}),P({cancel:function(){n.activeVisit&&n.cancelVisit(n.activeVisit,{cancelled:!0})}}),function(t){g("start",{detail:{visit:t}})}(J),B(J),o({method:u,url:m(Y).href,data:u===e.n$.GET?{}:p,params:u===e.n$.GET?p:{},cancelToken:this.activeVisit.cancelToken.token,headers:c({},C,{Accept:"text/html, application/xhtml+xml","X-Requested-With":"XMLHttpRequest","X-Inertia":!0},S.length?{"X-Inertia-Partial-Component":this.page.component,"X-Inertia-Partial-Data":S.join(",")}:{},j&&j.length?{"X-Inertia-Error-Bag":j}:{},this.page.version?{"X-Inertia-Version":this.page.version}:{}),onUploadProgress:function(t){p instanceof FormData&&(t.percentage=Math.round(t.loaded/t.total*100),function(t){g("progress",{detail:{progress:t}})}(t),R(t))}}).then((function(t){var e;if(!n.isInertiaResponse(t))return Promise.reject({response:t});var r=t.data;S.length&&r.component===n.page.component&&(r.props=c({},n.page.props,r.props)),w=n.resolvePreserveOption(w,r),(_=n.resolvePreserveOption(_,r))&&null!=(e=window.history.state)&&e.rememberedState&&r.component===n.page.component&&(r.rememberedState=window.history.state.rememberedState);var o=Y,i=d(r.url);return o.hash&&!i.hash&&m(o).href===i.href&&(i.hash=o.hash,r.url=i.href),n.setPage(r,{visitId:Q,replace:y,preserveScroll:w,preserveState:_})})).then((function(){var t=n.page.props.errors||{};if(Object.keys(t).length>0){var e=j?t[j]?t[j]:{}:t;return function(t){g("error",{detail:{errors:t}})}(e),q(e)}return g("success",{detail:{page:n.page}}),W(n.page)})).catch((function(t){if(n.isInertiaResponse(t.response))return n.setPage(t.response.data,{visitId:Q});if(n.isLocationVisitResponse(t.response)){var e=d(t.response.headers["x-inertia-location"]),r=Y;r.hash&&!e.hash&&m(r).href===e.href&&(e.hash=r.hash),n.locationVisit(e,!0===w)}else{if(!t.response)return Promise.reject(t);g("invalid",{cancelable:!0,detail:{response:t.response}})&&s.show(t.response.data)}})).then((function(){n.activeVisit&&n.finishVisit(n.activeVisit)})).catch((function(t){if(!o.isCancel(t)){var e=g("exception",{cancelable:!0,detail:{exception:t}});if(n.activeVisit&&n.finishVisit(n.activeVisit),e)return Promise.reject(t)}}))}},r.setPage=function(t,e){var r=this,n=void 0===e?{}:e,o=n.visitId,i=void 0===o?this.createVisitId():o,a=n.replace,c=void 0!==a&&a,u=n.preserveScroll,s=void 0!==u&&u,l=n.preserveState,f=void 0!==l&&l;return Promise.resolve(this.resolveComponent(t.component)).then((function(e){i===r.visitId&&(t.scrollRegions=t.scrollRegions||[],t.rememberedState=t.rememberedState||{},(c=c||d(t.url).href===window.location.href)?r.replaceState(t):r.pushState(t),r.swapComponent({component:e,page:t,preserveState:f}).then((function(){s||r.resetScrollPositions(),c||b(t)})))}))},r.pushState=function(t){this.page=t,window.history.pushState(t,"",t.url)},r.replaceState=function(t){this.page=t,window.history.replaceState(t,"",t.url)},r.handlePopstateEvent=function(t){var e=this;if(null!==t.state){var r=t.state,n=this.createVisitId();Promise.resolve(this.resolveComponent(r.component)).then((function(t){n===e.visitId&&(e.page=r,e.swapComponent({component:t,page:r,preserveState:!1}).then((function(){e.restoreScrollPositions(),b(r)})))}))}else{var o=d(this.page.url);o.hash=window.location.hash,this.replaceState(c({},this.page,{url:o.href})),this.resetScrollPositions()}},r.get=function(t,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),this.visit(t,c({},n,{method:e.n$.GET,data:r}))},r.reload=function(t){return void 0===t&&(t={}),this.visit(window.location.href,c({},t,{preserveScroll:!0,preserveState:!0}))},r.replace=function(t,e){var r;return void 0===e&&(e={}),console.warn("Inertia.replace() has been deprecated and will be removed in a future release. Please use Inertia."+(null!=(r=e.method)?r:"get")+"() instead."),this.visit(t,c({preserveState:!0},e,{replace:!0}))},r.post=function(t,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),this.visit(t,c({preserveState:!0},n,{method:e.n$.POST,data:r}))},r.put=function(t,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),this.visit(t,c({preserveState:!0},n,{method:e.n$.PUT,data:r}))},r.patch=function(t,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),this.visit(t,c({preserveState:!0},n,{method:e.n$.PATCH,data:r}))},r.delete=function(t,r){return void 0===r&&(r={}),this.visit(t,c({preserveState:!0},r,{method:e.n$.DELETE}))},r.remember=function(t,e){var r,n;void 0===e&&(e="default"),w||this.replaceState(c({},this.page,{rememberedState:c({},null==(r=this.page)?void 0:r.rememberedState,(n={},n[e]=t,n))}))},r.restore=function(t){var e,r;if(void 0===t&&(t="default"),!w)return null==(e=window.history.state)||null==(r=e.rememberedState)?void 0:r[t]},r.on=function(t,e){var r=function(t){var r=e(t);t.cancelable&&!t.defaultPrevented&&!1===r&&t.preventDefault()};return document.addEventListener("inertia:"+t,r),function(){return document.removeEventListener("inertia:"+t,r)}},t}(),_={buildDOMElement:function(t){var e=document.createElement("template");e.innerHTML=t;var r=e.content.firstChild;if(!t.startsWith(" diff --git a/resources/js/components/Common/Loader.vue b/resources/js/components/Common/Loader.vue new file mode 100644 index 0000000..891084c --- /dev/null +++ b/resources/js/components/Common/Loader.vue @@ -0,0 +1,94 @@ + + + diff --git a/resources/js/components/Medialibrary/Modals/ChooseExistingMedia.vue b/resources/js/components/Medialibrary/Modals/ChooseExistingMedia.vue index f6362b7..589d3ec 100644 --- a/resources/js/components/Medialibrary/Modals/ChooseExistingMedia.vue +++ b/resources/js/components/Medialibrary/Modals/ChooseExistingMedia.vue @@ -29,10 +29,10 @@
- + {{ __('Choose') }} ({{ chosenMedia.length }}) - +
diff --git a/resources/js/components/Medialibrary/Modals/Cropper.vue b/resources/js/components/Medialibrary/Modals/Cropper.vue index 78366b7..35bd330 100644 --- a/resources/js/components/Medialibrary/Modals/Cropper.vue +++ b/resources/js/components/Medialibrary/Modals/Cropper.vue @@ -68,7 +68,7 @@
- {{ __('Crop') }} - +
diff --git a/resources/js/components/Medialibrary/Modals/Edit.vue b/resources/js/components/Medialibrary/Modals/Edit.vue index ec980f4..219c9dd 100644 --- a/resources/js/components/Medialibrary/Modals/Edit.vue +++ b/resources/js/components/Medialibrary/Modals/Edit.vue @@ -35,9 +35,9 @@
- + {{ __('Update Media') }} - +
diff --git a/resources/js/field.js b/resources/js/field.js index 422b0e4..d615397 100644 --- a/resources/js/field.js +++ b/resources/js/field.js @@ -12,6 +12,9 @@ import IconCropperUnlock from './components/Icons/Cropper/Unlock' import IconCropperZoomIn from './components/Icons/Cropper/ZoomIn' import IconCropperZoomOut from './components/Icons/Cropper/ZoomOut' +import LoadingButton from './components/Buttons/LoadingButton'; +import Loader from './components/Common/Loader'; + Nova.booting((app, store) => { // Icons app.component('icon-crop', IconCrop) @@ -24,9 +27,14 @@ Nova.booting((app, store) => { app.component('icon-cropper-zoom-in', IconCropperZoomIn) app.component('icon-cropper-zoom-out', IconCropperZoomOut) + app.component('loader', Loader); + + // Buttons + app.component('loading-button', LoadingButton); + app.component('index-nova-medialibrary-field', IndexField) app.component('detail-nova-medialibrary-field', DetailField) app.component('form-nova-medialibrary-field', FormField) app.component('detail-nova-generated-conversions-field', GeneratedConversionsDetailField) -}) +}) \ No newline at end of file