diff --git a/README.md b/README.md index 47ba7f3..6dfa2f6 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,20 @@ public function cards(NovaRequest $request) } ``` +### Custom width (small, medium or large) + +```php +public function cards(NovaRequest $request) +{ + return [ + FieldProgressbar::make('Awesomeness') + ->options([ + 'width' => 'medium', + ]), + ]; +} +``` + Feel free to come with suggestions for improvements. Packages based on this package: [nova-progressbar-field](https://github.com/signifly/nova-progressbar-field) by [Signifly](https://github.com/signifly) diff --git a/dist/js/field.js b/dist/js/field.js index 0ddc50d..13d39ed 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={543:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var n=r(645),i=r.n(n)()((function(t){return t[1]}));i.push([t.id,".pg-bar[data-v-66267225]{max-width:400px;width:100%}",""]);const o=i},375:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var n=r(645),i=r.n(n)()((function(t){return t[1]}));i.push([t.id,".pg-bar[data-v-0818b841]{max-width:400px;width:100%}",""]);const o=i},645:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r=t(e);return e[2]?"@media ".concat(e[2]," {").concat(r,"}"):r})).join("")},e.i=function(t,r,n){"string"==typeof t&&(t=[[null,t,""]]);var i={};if(n)for(var o=0;o{var n=r(865),i=r(128),o=function(t,e){this._pathTemplate="M 50,50 m 0,-{radius} a {radius},{radius} 0 1 1 0,{2radius} a {radius},{radius} 0 1 1 0,-{2radius}",this.containerAspectRatio=1,n.apply(this,arguments)};(o.prototype=new n).constructor=o,o.prototype._pathString=function(t){var e=t.strokeWidth;t.trailWidth&&t.trailWidth>t.strokeWidth&&(e=t.trailWidth);var r=50-e/2;return i.render(this._pathTemplate,{radius:r,"2radius":2*r})},o.prototype._trailString=function(t){return this._pathString(t)},t.exports=o},688:(t,e,r)=>{var n=r(865),i=r(128),o=function(t,e){this._pathTemplate="M 0,{center} L 100,{center}",n.apply(this,arguments)};(o.prototype=new n).constructor=o,o.prototype._initializeSvg=function(t,e){t.setAttribute("viewBox","0 0 100 "+e.strokeWidth),t.setAttribute("preserveAspectRatio","none")},o.prototype._pathString=function(t){return i.render(this._pathTemplate,{center:t.strokeWidth/2})},o.prototype._trailString=function(t){return this._pathString(t)},t.exports=o},86:(t,e,r)=>{t.exports={Line:r(688),Circle:r(534),SemiCircle:r(157),Square:r(681),Path:r(888),Shape:r(865),utils:r(128)}},888:(t,e,r)=>{var n=r(350),i=r(128),o=n.Tweenable,a={easeIn:"easeInCubic",easeOut:"easeOutCubic",easeInOut:"easeInOutCubic"},s=function t(e,r){if(!(this instanceof t))throw new Error("Constructor was called without new keyword");var n;r=i.extend({delay:0,duration:800,easing:"linear",from:{},to:{},step:function(){}},r),n=i.isString(e)?document.querySelector(e):e,this.path=n,this._opts=r,this._tweenable=null;var o=this.path.getTotalLength();this.path.style.strokeDasharray=o+" "+o,this.set(0)};s.prototype.value=function(){var t=this._getComputedDashOffset(),e=this.path.getTotalLength();return parseFloat((1-t/e).toFixed(6),10)},s.prototype.set=function(t){this.stop(),this.path.style.strokeDashoffset=this._progressToOffset(t);var e=this._opts.step;if(i.isFunction(e)){var r=this._easing(this._opts.easing);e(this._calculateTo(t,r),this._opts.shape||this,this._opts.attachment)}},s.prototype.stop=function(){this._stopTween(),this.path.style.strokeDashoffset=this._getComputedDashOffset()},s.prototype.animate=function(t,e,r){e=e||{},i.isFunction(e)&&(r=e,e={});var n=i.extend({},e),a=i.extend({},this._opts);e=i.extend(a,e);var s=this._easing(e.easing),u=this._resolveFromAndTo(t,s,n);this.stop(),this.path.getBoundingClientRect();var l=this._getComputedDashOffset(),c=this._progressToOffset(t),h=this;this._tweenable=new o,this._tweenable.tween({from:i.extend({offset:l},u.from),to:i.extend({offset:c},u.to),duration:e.duration,delay:e.delay,easing:s,step:function(t){h.path.style.strokeDashoffset=t.offset;var r=e.shape||h;e.step(t,r,e.attachment)}}).then((function(t){i.isFunction(r)&&r()}))},s.prototype._getComputedDashOffset=function(){var t=window.getComputedStyle(this.path,null);return parseFloat(t.getPropertyValue("stroke-dashoffset"),10)},s.prototype._progressToOffset=function(t){var e=this.path.getTotalLength();return e-t*e},s.prototype._resolveFromAndTo=function(t,e,r){return r.from&&r.to?{from:r.from,to:r.to}:{from:this._calculateFrom(e),to:this._calculateTo(t,e)}},s.prototype._calculateFrom=function(t){return n.interpolate(this._opts.from,this._opts.to,this.value(),t)},s.prototype._calculateTo=function(t,e){return n.interpolate(this._opts.from,this._opts.to,t,e)},s.prototype._stopTween=function(){null!==this._tweenable&&(this._tweenable.stop(),this._tweenable=null)},s.prototype._easing=function(t){return a.hasOwnProperty(t)?a[t]:t},t.exports=s},157:(t,e,r)=>{var n=r(865),i=r(534),o=r(128),a=function(t,e){this._pathTemplate="M 50,50 m -{radius},0 a {radius},{radius} 0 1 1 {2radius},0",this.containerAspectRatio=2,n.apply(this,arguments)};(a.prototype=new n).constructor=a,a.prototype._initializeSvg=function(t,e){t.setAttribute("viewBox","0 0 100 50")},a.prototype._initializeTextContainer=function(t,e,r){t.text.style&&(r.style.top="auto",r.style.bottom="0",t.text.alignToBottom?o.setStyle(r,"transform","translate(-50%, 0)"):o.setStyle(r,"transform","translate(-50%, 50%)"))},a.prototype._pathString=i.prototype._pathString,a.prototype._trailString=i.prototype._trailString,t.exports=a},865:(t,e,r)=>{var n=r(888),i=r(128),o="Object is destroyed",a=function t(e,r){if(!(this instanceof t))throw new Error("Constructor was called without new keyword");if(0!==arguments.length){this._opts=i.extend({color:"#555",strokeWidth:1,trailColor:null,trailWidth:null,fill:null,text:{style:{color:null,position:"absolute",left:"50%",top:"50%",padding:0,margin:0,transform:{prefix:!0,value:"translate(-50%, -50%)"}},autoStyleContainer:!0,alignToBottom:!0,value:null,className:"progressbar-text"},svgStyle:{display:"block",width:"100%"},warnings:!1},r,!0),i.isObject(r)&&void 0!==r.svgStyle&&(this._opts.svgStyle=r.svgStyle),i.isObject(r)&&i.isObject(r.text)&&void 0!==r.text.style&&(this._opts.text.style=r.text.style);var o,a=this._createSvgView(this._opts);if(!(o=i.isString(e)?document.querySelector(e):e))throw new Error("Container does not exist: "+e);this._container=o,this._container.appendChild(a.svg),this._opts.warnings&&this._warnContainerAspectRatio(this._container),this._opts.svgStyle&&i.setStyles(a.svg,this._opts.svgStyle),this.svg=a.svg,this.path=a.path,this.trail=a.trail,this.text=null;var s=i.extend({attachment:void 0,shape:this},this._opts);this._progressPath=new n(a.path,s),i.isObject(this._opts.text)&&null!==this._opts.text.value&&this.setText(this._opts.text.value)}};a.prototype.animate=function(t,e,r){if(null===this._progressPath)throw new Error(o);this._progressPath.animate(t,e,r)},a.prototype.stop=function(){if(null===this._progressPath)throw new Error(o);void 0!==this._progressPath&&this._progressPath.stop()},a.prototype.pause=function(){if(null===this._progressPath)throw new Error(o);void 0!==this._progressPath&&this._progressPath._tweenable&&this._progressPath._tweenable.pause()},a.prototype.resume=function(){if(null===this._progressPath)throw new Error(o);void 0!==this._progressPath&&this._progressPath._tweenable&&this._progressPath._tweenable.resume()},a.prototype.destroy=function(){if(null===this._progressPath)throw new Error(o);this.stop(),this.svg.parentNode.removeChild(this.svg),this.svg=null,this.path=null,this.trail=null,this._progressPath=null,null!==this.text&&(this.text.parentNode.removeChild(this.text),this.text=null)},a.prototype.set=function(t){if(null===this._progressPath)throw new Error(o);this._progressPath.set(t)},a.prototype.value=function(){if(null===this._progressPath)throw new Error(o);return void 0===this._progressPath?0:this._progressPath.value()},a.prototype.setText=function(t){if(null===this._progressPath)throw new Error(o);null===this.text&&(this.text=this._createTextContainer(this._opts,this._container),this._container.appendChild(this.text)),i.isObject(t)?(i.removeChildren(this.text),this.text.appendChild(t)):this.text.innerHTML=t},a.prototype._createSvgView=function(t){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");this._initializeSvg(e,t);var r=null;(t.trailColor||t.trailWidth)&&(r=this._createTrail(t),e.appendChild(r));var n=this._createPath(t);return e.appendChild(n),{svg:e,path:n,trail:r}},a.prototype._initializeSvg=function(t,e){t.setAttribute("viewBox","0 0 100 100")},a.prototype._createPath=function(t){var e=this._pathString(t);return this._createPathElement(e,t)},a.prototype._createTrail=function(t){var e=this._trailString(t),r=i.extend({},t);return r.trailColor||(r.trailColor="#eee"),r.trailWidth||(r.trailWidth=r.strokeWidth),r.color=r.trailColor,r.strokeWidth=r.trailWidth,r.fill=null,this._createPathElement(e,r)},a.prototype._createPathElement=function(t,e){var r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttribute("d",t),r.setAttribute("stroke",e.color),r.setAttribute("stroke-width",e.strokeWidth),e.fill?r.setAttribute("fill",e.fill):r.setAttribute("fill-opacity","0"),r},a.prototype._createTextContainer=function(t,e){var r=document.createElement("div");r.className=t.text.className;var n=t.text.style;return n&&(t.text.autoStyleContainer&&(e.style.position="relative"),i.setStyles(r,n),n.color||(r.style.color=t.color)),this._initializeTextContainer(t,e,r),r},a.prototype._initializeTextContainer=function(t,e,r){},a.prototype._pathString=function(t){throw new Error("Override this function for each progress bar")},a.prototype._trailString=function(t){throw new Error("Override this function for each progress bar")},a.prototype._warnContainerAspectRatio=function(t){if(this.containerAspectRatio){var e=window.getComputedStyle(t,null),r=parseFloat(e.getPropertyValue("width"),10),n=parseFloat(e.getPropertyValue("height"),10);i.floatEquals(this.containerAspectRatio,r/n)||(console.warn("Incorrect aspect ratio of container","#"+t.id,"detected:",e.getPropertyValue("width")+"(width)","/",e.getPropertyValue("height")+"(height)","=",r/n),console.warn("Aspect ratio of should be",this.containerAspectRatio))}},t.exports=a},681:(t,e,r)=>{var n=r(865),i=r(128),o=function(t,e){this._pathTemplate="M 0,{halfOfStrokeWidth} L {width},{halfOfStrokeWidth} L {width},{width} L {halfOfStrokeWidth},{width} L {halfOfStrokeWidth},{strokeWidth}",this._trailTemplate="M {startMargin},{halfOfStrokeWidth} L {width},{halfOfStrokeWidth} L {width},{width} L {halfOfStrokeWidth},{width} L {halfOfStrokeWidth},{halfOfStrokeWidth}",n.apply(this,arguments)};(o.prototype=new n).constructor=o,o.prototype._pathString=function(t){var e=100-t.strokeWidth/2;return i.render(this._pathTemplate,{width:e,strokeWidth:t.strokeWidth,halfOfStrokeWidth:t.strokeWidth/2})},o.prototype._trailString=function(t){var e=100-t.strokeWidth/2;return i.render(this._trailTemplate,{width:e,strokeWidth:t.strokeWidth,halfOfStrokeWidth:t.strokeWidth/2,startMargin:t.strokeWidth/2-t.trailWidth/2})},t.exports=o},128:t=>{var e="Webkit Moz O ms".split(" ");function r(t,r,i){for(var o=t.style,a=0;a{self,t.exports=function(){"use strict";var t={720:function(t,e,r){r.r(e),r.d(e,{Scene:function(){return Kt},Tweenable:function(){return vt},interpolate:function(){return Qt},processTweens:function(){return ct},setBezierFunction:function(){return Xt},tween:function(){return yt},unsetBezierFunction:function(){return Yt}});var n={};r.r(n),r.d(n,{bounce:function(){return I},bouncePast:function(){return L},easeFrom:function(){return B},easeFromTo:function(){return N},easeInBack:function(){return T},easeInCirc:function(){return O},easeInCubic:function(){return l},easeInExpo:function(){return b},easeInOutBack:function(){return j},easeInOutCirc:function(){return C},easeInOutCubic:function(){return h},easeInOutExpo:function(){return k},easeInOutQuad:function(){return u},easeInOutQuart:function(){return d},easeInOutQuint:function(){return g},easeInOutSine:function(){return w},easeInQuad:function(){return a},easeInQuart:function(){return f},easeInQuint:function(){return v},easeInSine:function(){return _},easeOutBack:function(){return E},easeOutBounce:function(){return P},easeOutCirc:function(){return x},easeOutCubic:function(){return c},easeOutExpo:function(){return S},easeOutQuad:function(){return s},easeOutQuart:function(){return p},easeOutQuint:function(){return y},easeOutSine:function(){return m},easeTo:function(){return D},elastic:function(){return M},linear:function(){return o},swingFrom:function(){return F},swingFromTo:function(){return A},swingTo:function(){return W}});var i={};r.r(i),r.d(i,{afterTween:function(){return Dt},beforeTween:function(){return Bt},doesApply:function(){return Lt},tweenCreated:function(){return Nt}});var o=function(t){return t},a=function(t){return Math.pow(t,2)},s=function(t){return-(Math.pow(t-1,2)-1)},u=function(t){return(t/=.5)<1?.5*Math.pow(t,2):-.5*((t-=2)*t-2)},l=function(t){return Math.pow(t,3)},c=function(t){return Math.pow(t-1,3)+1},h=function(t){return(t/=.5)<1?.5*Math.pow(t,3):.5*(Math.pow(t-2,3)+2)},f=function(t){return Math.pow(t,4)},p=function(t){return-(Math.pow(t-1,4)-1)},d=function(t){return(t/=.5)<1?.5*Math.pow(t,4):-.5*((t-=2)*Math.pow(t,3)-2)},v=function(t){return Math.pow(t,5)},y=function(t){return Math.pow(t-1,5)+1},g=function(t){return(t/=.5)<1?.5*Math.pow(t,5):.5*(Math.pow(t-2,5)+2)},_=function(t){return 1-Math.cos(t*(Math.PI/2))},m=function(t){return Math.sin(t*(Math.PI/2))},w=function(t){return-.5*(Math.cos(Math.PI*t)-1)},b=function(t){return 0===t?0:Math.pow(2,10*(t-1))},S=function(t){return 1===t?1:1-Math.pow(2,-10*t)},k=function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))},O=function(t){return-(Math.sqrt(1-t*t)-1)},x=function(t){return Math.sqrt(1-Math.pow(t-1,2))},C=function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},P=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},T=function(t){var e=1.70158;return t*t*((e+1)*t-e)},E=function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},j=function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},M=function(t){return-1*Math.pow(4,-8*t)*Math.sin((6*t-1)*(2*Math.PI)/2)+1},A=function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},F=function(t){var e=1.70158;return t*t*((e+1)*t-e)},W=function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},I=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},L=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?2-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?2-(7.5625*(t-=2.25/2.75)*t+.9375):2-(7.5625*(t-=2.625/2.75)*t+.984375)},N=function(t){return(t/=.5)<1?.5*Math.pow(t,4):-.5*((t-=2)*Math.pow(t,3)-2)},B=function(t){return Math.pow(t,4)},D=function(t){return Math.pow(t,.25)};function R(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function V(t,e){for(var r=0;rs?s:e,l=u>=s,c=o-(s-u),h=t._filters.length>0;if(l)return t._render(a,t._data,c),t.stop(!0);h&&t._applyFilter(Y),u1&&void 0!==arguments[1]?arguments[1]:J,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=q(e);if(st[e])return st[e];if(n===rt||n===et)for(var i in t)r[i]=e;else for(var o in t)r[o]=e[o]||J;return r},pt=function(t){t===ot?(ot=t._next)?ot._previous=null:at=null:t===at?(at=t._previous)?at._next=null:ot=null:($=t._previous,U=t._next,$._next=U,U._previous=$),t._previous=t._next=null},dt="function"==typeof Promise?Promise:null,vt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;R(this,t),this._config={},this._data={},this._delay=0,this._filters=[],this._next=null,this._previous=null,this._timestamp=null,this._resolve=null,this._reject=null,this._currentState=e||{},this._originalState={},this._targetState={},this._start=it,this._render=it,this._promiseCtor=dt,r&&this.setConfig(r)}var e;return(e=[{key:"_applyFilter",value:function(t){for(var e=this._filters.length;e>0;e--){var r=this._filters[e-e][t];r&&r(this)}}},{key:"tween",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return this._isPlaying&&this.stop(),!e&&this._config||this.setConfig(e),this._pausedAtTime=null,this._timestamp=t.now(),this._start(this.get(),this._data),this._delay&&this._render(this._currentState,this._data,0),this._resume(this._timestamp)}},{key:"setConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=this._config;for(var n in e)r[n]=e[n];var i=r.promise,o=void 0===i?this._promiseCtor:i,a=r.start,s=void 0===a?it:a,u=r.finish,l=r.render,c=void 0===l?this._config.step||it:l,h=r.step,f=void 0===h?it:h;this._data=r.data||r.attachment||this._data,this._isPlaying=!1,this._pausedAtTime=null,this._scheduleId=null,this._delay=e.delay||0,this._start=s,this._render=c||f,this._duration=r.duration||500,this._promiseCtor=o,u&&(this._resolve=u);var p=e.from,d=e.to,v=void 0===d?{}:d,y=this._currentState,g=this._originalState,_=this._targetState;for(var m in p)y[m]=p[m];var w=!1;for(var b in y){var S=y[b];w||q(S)!==rt||(w=!0),g[b]=S,_[b]=v.hasOwnProperty(b)?v[b]:S}if(this._easing=ft(this._currentState,r.easing,this._easing),this._filters.length=0,w){for(var k in t.filters)t.filters[k].doesApply(this)&&this._filters.push(t.filters[k]);this._applyFilter(tt)}return this}},{key:"then",value:function(t,e){var r=this;return this._promise=new this._promiseCtor((function(t,e){r._resolve=t,r._reject=e})),this._promise.then(t,e)}},{key:"catch",value:function(t){return this.then().catch(t)}},{key:"get",value:function(){return H({},this._currentState)}},{key:"set",value:function(t){this._currentState=t}},{key:"pause",value:function(){if(this._isPlaying)return this._pausedAtTime=t.now(),this._isPlaying=!1,pt(this),this}},{key:"resume",value:function(){return this._resume()}},{key:"_resume",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.now();return null===this._timestamp?this.tween():this._isPlaying?this._promise:(this._pausedAtTime&&(this._timestamp+=e-this._pausedAtTime,this._pausedAtTime=null),this._isPlaying=!0,null===ot?(ot=this,at=this):(this._previous=at,at._next=this,at=this),this)}},{key:"seek",value:function(e){e=Math.max(e,0);var r=t.now();return this._timestamp+e===0||(this._timestamp=r-e,lt(this,r)),this}},{key:"stop",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._isPlaying)return this;this._isPlaying=!1,pt(this);var e=this._filters.length>0;return t&&(e&&this._applyFilter(Y),ut(1,this._currentState,this._originalState,this._targetState,1,0,this._easing),e&&(this._applyFilter(K),this._applyFilter(X))),this._resolve&&this._resolve({data:this._data,state:this._currentState,tweenable:this}),this._resolve=null,this._reject=null,this}},{key:"cancel",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this._currentState,r=this._data;return this._isPlaying?(this._reject&&this._reject({data:r,state:e,tweenable:this}),this._resolve=null,this._reject=null,this.stop(t)):this}},{key:"isPlaying",value:function(){return this._isPlaying}},{key:"setScheduleFunction",value:function(e){t.setScheduleFunction(e)}},{key:"data",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t&&(this._data=H({},t)),this._data}},{key:"dispose",value:function(){for(var t in this)delete this[t]}}])&&V(t.prototype,e),t}();function yt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=new vt;return e.tween(t),e.tweenable=e,e}Q(vt,"now",(function(){return Z})),vt.setScheduleFunction=function(t){return nt=t},vt.formulas=st,vt.filters={},function t(){Z=ht(),nt.call(G,t,16.666666666666668),ct()}();var gt,_t,mt=/(\d|-|\.)/,wt=/([^\-0-9.]+)/g,bt=/[0-9.-]+/g,St=(gt=bt.source,_t=/,\s*/.source,new RegExp("rgba?\\(".concat(gt).concat(_t).concat(gt).concat(_t).concat(gt,"(").concat(_t).concat(gt,")?\\)"),"g")),kt=/^.*\(/,Ot=/#([0-9]|[a-f]){3,6}/gi,xt="VAL",Ct=function(t,e){return t.map((function(t,r){return"_".concat(e,"_").concat(r)}))};function Pt(t){return parseInt(t,16)}var Tt=function(t){return"rgb(".concat((e=t,3===(e=e.replace(/#/,"")).length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]),[Pt(e.substr(0,2)),Pt(e.substr(2,2)),Pt(e.substr(4,2))]).join(","),")");var e},Et=function(t,e,r){var n=e.match(t),i=e.replace(t,xt);return n&&n.forEach((function(t){return i=i.replace(xt,r(t))})),i},jt=function(t){for(var e in t){var r=t[e];"string"==typeof r&&r.match(Ot)&&(t[e]=Et(Ot,r,Tt))}},Mt=function(t){var e=t.match(bt),r=e.slice(0,3).map(Math.floor),n=t.match(kt)[0];if(3===e.length)return"".concat(n).concat(r.join(","),")");if(4===e.length)return"".concat(n).concat(r.join(","),",").concat(e[3],")");throw new Error("Invalid rgbChunk: ".concat(t))},At=function(t){return t.match(bt)},Ft=function(t,e){var r={};return e.forEach((function(e){r[e]=t[e],delete t[e]})),r},Wt=function(t,e){return e.map((function(e){return t[e]}))},It=function(t,e){return e.forEach((function(e){return t=t.replace(xt,+e.toFixed(4))})),t},Lt=function(t){for(var e in t._currentState)if("string"==typeof t._currentState[e])return!0;return!1};function Nt(t){var e=t._currentState;[e,t._originalState,t._targetState].forEach(jt),t._tokenData=function(t){var e,r,n={};for(var i in t){var o=t[i];"string"==typeof o&&(n[i]={formatString:(e=o,r=void 0,r=e.match(wt),r?(1===r.length||e.charAt(0).match(mt))&&r.unshift(""):r=["",""],r.join(xt)),chunkNames:Ct(At(o),i)})}return n}(e)}function Bt(t){var e=t._currentState,r=t._originalState,n=t._targetState,i=t._easing,o=t._tokenData;!function(t,e){var r=function(r){var n=e[r].chunkNames,i=t[r];if("string"==typeof i){var o=i.split(" "),a=o[o.length-1];n.forEach((function(e,r){return t[e]=o[r]||a}))}else n.forEach((function(e){return t[e]=i}));delete t[r]};for(var n in e)r(n)}(i,o),[e,r,n].forEach((function(t){return function(t,e){var r=function(r){At(t[r]).forEach((function(n,i){return t[e[r].chunkNames[i]]=+n})),delete t[r]};for(var n in e)r(n)}(t,o)}))}function Dt(t){var e=t._currentState,r=t._originalState,n=t._targetState,i=t._easing,o=t._tokenData;[e,r,n].forEach((function(t){return function(t,e){for(var r in e){var n=e[r],i=n.chunkNames,o=n.formatString,a=It(o,Wt(Ft(t,i),i));t[r]=Et(St,a,Mt)}}(t,o)})),function(t,e){for(var r in e){var n=e[r].chunkNames,i=t[n[0]];t[r]="string"==typeof i?n.map((function(e){var r=t[e];return delete t[e],r})).join(" "):i}}(i,o)}function Rt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Vt(t){for(var e=1;e4&&void 0!==arguments[4]?arguments[4]:0,o=Vt({},t),a=ft(t,n);for(var s in zt._filters.length=0,zt.set({}),zt._currentState=o,zt._originalState=t,zt._targetState=e,zt._easing=a,Ht)Ht[s].doesApply(zt)&&zt._filters.push(Ht[s]);zt._applyFilter("tweenCreated"),zt._applyFilter("beforeTween");var u=ut(r,o,t,e,1,i,a);return zt._applyFilter("afterTween"),u};function Zt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0?t:0-t},c=1-(f=3*(o=t))-(h=3*(r-o)-f),s=1-(l=3*(a=e))-(u=3*(n-a)-l),function(t){return((s*t+u)*t+l)*t}(function(t,e){var r,n,i,o,a,s;for(i=t,s=0;s<8;s++){if(o=p(i)-t,v(o)(n=1))return n;for(;ro?r=i:n=i,i=.5*(n-r)+r}return i}(i,.005));var o,a,s,u,l,c,h,f,p,d,v}}(e,r,n,i);return o.displayName=t,o.x1=e,o.y1=r,o.x2=n,o.y2=i,vt.formulas[t]=o},Yt=function(t){return delete vt.formulas[t]};vt.filters.token=i}},e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}return r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(720)}()},379:(t,e,r)=>{"use strict";var n,i=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},o=function(){var t={};return function(e){if(void 0===t[e]){var r=document.querySelector(e);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}t[e]=r}return t[e]}}(),a=[];function s(t){for(var e=-1,r=0;r{"use strict";e.Z=(t,e)=>{const r=t.__vccOpts||t;for(const[t,n]of e)r[t]=n;return r}}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={id:n,exports:{}};return t[n](o,o.exports,r),o.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";const t=Vue;var e={class:"pg-bar",ref:"chartContainer"};var n=r(86);const i={props:["resourceName","field"],data:function(){return{options:{strokeWidth:4,color:"#FFEA82",fromColor:"#FFEA82",toColor:"#FFEA82",percentage:1,type:"line",sub:null,animateColor:!1}}},mounted:function(){for(var t in this.field.options)this.field.options.hasOwnProperty(t)&&(this.options[t]=this.field.options[t]);if("semi-circle"===this.options.type)this.drawSemiCircle();else this.drawLine()},methods:{drawLine:function(){var t=this,e=new n.Line(this.$refs.chartContainer,{strokeWidth:this.options.strokeWidth,easing:"easeInOut",duration:1e3,color:this.options.color,trailColor:"#E5E4F0",trailWidth:4,svgStyle:null,text:{style:{color:"#999",textAlign:"right",position:"relative",padding:0,margin:0,transform:null},autoStyleContainer:!1},from:{color:this.options.fromColor},to:{color:this.options.toColor},step:function(e,r){r.setText(Math.round(100*r.value())+" %"),t.options.animateColor&&r.path.setAttribute("stroke",e.color)}});this.$nextTick((function(){t.field.value&&e.animate(t.field.value)}))}}};var o=r(379),a=r.n(o),s=r(375),u={insert:"head",singleton:!1};a()(s.Z,u);s.Z.locals;var l=r(744);const c=(0,l.Z)(i,[["render",function(r,n,i,o,a,s){return(0,t.openBlock)(),(0,t.createElementBlock)("span",e,null,512)}],["__scopeId","data-v-0818b841"]]);var h={key:0,class:"md:w-1/4 md:py-3"},f={class:"font-bold md:font-normal"},p={class:"break-words md:w-3/4 md:py-3"},d={key:0,class:"text-90",style:{"max-width":"400px",width:"100%"}},v={class:"pg-bar",ref:"chartContainer"},y=["innerHTML"],g={key:2};var _=r(86);const m={props:["index","resource","resourceName","resourceId","field"],data:function(){return{options:{strokeWidth:4,color:"#FFEA82",percentage:1,type:"line",sub:null,fromColor:"#FFEA82",toColor:"#FFEA82",animateColor:!1},subtitle:""}},mounted:function(){var t;for(var e in this.field.options)this.field.options.hasOwnProperty(e)&&(this.options[e]=this.field.options[e]);if("semi-circle"===this.options.type)this.drawSemiCircle();else this.drawLine();this.subtitle=null!==(t=this.field.subtitle)&&void 0!==t?t:""},computed:{label:function(){return this.fieldName||this.field.name},fieldValue:function(){return""!==this.field.value&&null!==this.field.value&&void 0!==this.field.value&&String(this.field.value)},shouldDisplayAsHtml:function(){return this.field.asHtml},hideLabel:function(){return this.field.hideLabel}},methods:{drawLine:function(){var t=this,e=new _.Line(this.$refs.chartContainer,{strokeWidth:this.options.strokeWidth,easing:"easeInOut",duration:1400,color:this.options.color,trailColor:"#eee",trailWidth:1,svgStyle:null,text:{style:{color:"#999",textAlign:"center",position:"relative",padding:0,margin:0,transform:null},autoStyleContainer:!1},from:{color:this.options.fromColor},to:{color:this.options.toColor},step:function(e,r){var n=Math.round(100*r.value())+" % ";t.field.subtitle&&(n+=t.field.subtitle),r.setText(n),t.options.animateColor&&r.path.setAttribute("stroke",e.color)}});this.field.value&&e.animate(this.field.value)}}};var w=r(543),b={insert:"head",singleton:!1};a()(w.Z,b);w.Z.locals;const S=(0,l.Z)(m,[["render",function(e,r,n,i,o,a){return(0,t.openBlock)(),(0,t.createElementBlock)("div",{class:(0,t.normalizeClass)(["-mx-6 flex flex-col space-y-2 px-6 py-2 md:flex-row md:space-y-0 md:py-0",{"border-t border-gray-100 dark:border-gray-700":0!==n.index}])},[a.hideLabel?(0,t.createCommentVNode)("",!0):((0,t.openBlock)(),(0,t.createElementBlock)("div",h,[(0,t.renderSlot)(e.$slots,"default",{},(function(){return[(0,t.createElementVNode)("h4",f,[(0,t.createElementVNode)("span",null,(0,t.toDisplayString)(a.label),1)])]}),!0)])),(0,t.createElementVNode)("div",p,[(0,t.renderSlot)(e.$slots,"value",{},(function(){return[a.fieldValue&&!a.shouldDisplayAsHtml?((0,t.openBlock)(),(0,t.createElementBlock)("p",d,[(0,t.createElementVNode)("span",v,null,512)])):a.fieldValue&&a.shouldDisplayAsHtml?((0,t.openBlock)(),(0,t.createElementBlock)("div",{key:1,innerHTML:n.field.value},null,8,y)):((0,t.openBlock)(),(0,t.createElementBlock)("p",g,"—"))]}),!0)])],2)}],["__scopeId","data-v-66267225"]]);Nova.booting((function(t,e){t.component("index-field-progressbar",c),t.component("detail-field-progressbar",S)}))})()})(); \ No newline at end of file +(()=>{var t={223:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(645),i=n.n(r)()((function(t){return t[1]}));i.push([t.id,".pg-bar[data-v-70269a15]{max-width:400px;width:100%}",""]);const o=i},15:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(645),i=n.n(r)()((function(t){return t[1]}));i.push([t.id,".pg-bar[data-v-8974cdfe]{max-width:400px;width:100%}",""]);const o=i},645:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=t(e);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,r){"string"==typeof t&&(t=[[null,t,""]]);var i={};if(r)for(var o=0;o{var r=n(865),i=n(128),o=function(t,e){this._pathTemplate="M 50,50 m 0,-{radius} a {radius},{radius} 0 1 1 0,{2radius} a {radius},{radius} 0 1 1 0,-{2radius}",this.containerAspectRatio=1,r.apply(this,arguments)};(o.prototype=new r).constructor=o,o.prototype._pathString=function(t){var e=t.strokeWidth;t.trailWidth&&t.trailWidth>t.strokeWidth&&(e=t.trailWidth);var n=50-e/2;return i.render(this._pathTemplate,{radius:n,"2radius":2*n})},o.prototype._trailString=function(t){return this._pathString(t)},t.exports=o},688:(t,e,n)=>{var r=n(865),i=n(128),o=function(t,e){this._pathTemplate="M 0,{center} L 100,{center}",r.apply(this,arguments)};(o.prototype=new r).constructor=o,o.prototype._initializeSvg=function(t,e){t.setAttribute("viewBox","0 0 100 "+e.strokeWidth),t.setAttribute("preserveAspectRatio","none")},o.prototype._pathString=function(t){return i.render(this._pathTemplate,{center:t.strokeWidth/2})},o.prototype._trailString=function(t){return this._pathString(t)},t.exports=o},86:(t,e,n)=>{t.exports={Line:n(688),Circle:n(534),SemiCircle:n(157),Square:n(681),Path:n(888),Shape:n(865),utils:n(128)}},888:(t,e,n)=>{var r=n(350),i=n(128),o=r.Tweenable,a={easeIn:"easeInCubic",easeOut:"easeOutCubic",easeInOut:"easeInOutCubic"},s=function t(e,n){if(!(this instanceof t))throw new Error("Constructor was called without new keyword");var r;n=i.extend({delay:0,duration:800,easing:"linear",from:{},to:{},step:function(){}},n),r=i.isString(e)?document.querySelector(e):e,this.path=r,this._opts=n,this._tweenable=null;var o=this.path.getTotalLength();this.path.style.strokeDasharray=o+" "+o,this.set(0)};s.prototype.value=function(){var t=this._getComputedDashOffset(),e=this.path.getTotalLength();return parseFloat((1-t/e).toFixed(6),10)},s.prototype.set=function(t){this.stop(),this.path.style.strokeDashoffset=this._progressToOffset(t);var e=this._opts.step;if(i.isFunction(e)){var n=this._easing(this._opts.easing);e(this._calculateTo(t,n),this._opts.shape||this,this._opts.attachment)}},s.prototype.stop=function(){this._stopTween(),this.path.style.strokeDashoffset=this._getComputedDashOffset()},s.prototype.animate=function(t,e,n){e=e||{},i.isFunction(e)&&(n=e,e={});var r=i.extend({},e),a=i.extend({},this._opts);e=i.extend(a,e);var s=this._easing(e.easing),u=this._resolveFromAndTo(t,s,r);this.stop(),this.path.getBoundingClientRect();var l=this._getComputedDashOffset(),c=this._progressToOffset(t),h=this;this._tweenable=new o,this._tweenable.tween({from:i.extend({offset:l},u.from),to:i.extend({offset:c},u.to),duration:e.duration,delay:e.delay,easing:s,step:function(t){h.path.style.strokeDashoffset=t.offset;var n=e.shape||h;e.step(t,n,e.attachment)}}).then((function(t){i.isFunction(n)&&n()}))},s.prototype._getComputedDashOffset=function(){var t=window.getComputedStyle(this.path,null);return parseFloat(t.getPropertyValue("stroke-dashoffset"),10)},s.prototype._progressToOffset=function(t){var e=this.path.getTotalLength();return e-t*e},s.prototype._resolveFromAndTo=function(t,e,n){return n.from&&n.to?{from:n.from,to:n.to}:{from:this._calculateFrom(e),to:this._calculateTo(t,e)}},s.prototype._calculateFrom=function(t){return r.interpolate(this._opts.from,this._opts.to,this.value(),t)},s.prototype._calculateTo=function(t,e){return r.interpolate(this._opts.from,this._opts.to,t,e)},s.prototype._stopTween=function(){null!==this._tweenable&&(this._tweenable.stop(),this._tweenable=null)},s.prototype._easing=function(t){return a.hasOwnProperty(t)?a[t]:t},t.exports=s},157:(t,e,n)=>{var r=n(865),i=n(534),o=n(128),a=function(t,e){this._pathTemplate="M 50,50 m -{radius},0 a {radius},{radius} 0 1 1 {2radius},0",this.containerAspectRatio=2,r.apply(this,arguments)};(a.prototype=new r).constructor=a,a.prototype._initializeSvg=function(t,e){t.setAttribute("viewBox","0 0 100 50")},a.prototype._initializeTextContainer=function(t,e,n){t.text.style&&(n.style.top="auto",n.style.bottom="0",t.text.alignToBottom?o.setStyle(n,"transform","translate(-50%, 0)"):o.setStyle(n,"transform","translate(-50%, 50%)"))},a.prototype._pathString=i.prototype._pathString,a.prototype._trailString=i.prototype._trailString,t.exports=a},865:(t,e,n)=>{var r=n(888),i=n(128),o="Object is destroyed",a=function t(e,n){if(!(this instanceof t))throw new Error("Constructor was called without new keyword");if(0!==arguments.length){this._opts=i.extend({color:"#555",strokeWidth:1,trailColor:null,trailWidth:null,fill:null,text:{style:{color:null,position:"absolute",left:"50%",top:"50%",padding:0,margin:0,transform:{prefix:!0,value:"translate(-50%, -50%)"}},autoStyleContainer:!0,alignToBottom:!0,value:null,className:"progressbar-text"},svgStyle:{display:"block",width:"100%"},warnings:!1},n,!0),i.isObject(n)&&void 0!==n.svgStyle&&(this._opts.svgStyle=n.svgStyle),i.isObject(n)&&i.isObject(n.text)&&void 0!==n.text.style&&(this._opts.text.style=n.text.style);var o,a=this._createSvgView(this._opts);if(!(o=i.isString(e)?document.querySelector(e):e))throw new Error("Container does not exist: "+e);this._container=o,this._container.appendChild(a.svg),this._opts.warnings&&this._warnContainerAspectRatio(this._container),this._opts.svgStyle&&i.setStyles(a.svg,this._opts.svgStyle),this.svg=a.svg,this.path=a.path,this.trail=a.trail,this.text=null;var s=i.extend({attachment:void 0,shape:this},this._opts);this._progressPath=new r(a.path,s),i.isObject(this._opts.text)&&null!==this._opts.text.value&&this.setText(this._opts.text.value)}};a.prototype.animate=function(t,e,n){if(null===this._progressPath)throw new Error(o);this._progressPath.animate(t,e,n)},a.prototype.stop=function(){if(null===this._progressPath)throw new Error(o);void 0!==this._progressPath&&this._progressPath.stop()},a.prototype.pause=function(){if(null===this._progressPath)throw new Error(o);void 0!==this._progressPath&&this._progressPath._tweenable&&this._progressPath._tweenable.pause()},a.prototype.resume=function(){if(null===this._progressPath)throw new Error(o);void 0!==this._progressPath&&this._progressPath._tweenable&&this._progressPath._tweenable.resume()},a.prototype.destroy=function(){if(null===this._progressPath)throw new Error(o);this.stop(),this.svg.parentNode.removeChild(this.svg),this.svg=null,this.path=null,this.trail=null,this._progressPath=null,null!==this.text&&(this.text.parentNode.removeChild(this.text),this.text=null)},a.prototype.set=function(t){if(null===this._progressPath)throw new Error(o);this._progressPath.set(t)},a.prototype.value=function(){if(null===this._progressPath)throw new Error(o);return void 0===this._progressPath?0:this._progressPath.value()},a.prototype.setText=function(t){if(null===this._progressPath)throw new Error(o);null===this.text&&(this.text=this._createTextContainer(this._opts,this._container),this._container.appendChild(this.text)),i.isObject(t)?(i.removeChildren(this.text),this.text.appendChild(t)):this.text.innerHTML=t},a.prototype._createSvgView=function(t){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");this._initializeSvg(e,t);var n=null;(t.trailColor||t.trailWidth)&&(n=this._createTrail(t),e.appendChild(n));var r=this._createPath(t);return e.appendChild(r),{svg:e,path:r,trail:n}},a.prototype._initializeSvg=function(t,e){t.setAttribute("viewBox","0 0 100 100")},a.prototype._createPath=function(t){var e=this._pathString(t);return this._createPathElement(e,t)},a.prototype._createTrail=function(t){var e=this._trailString(t),n=i.extend({},t);return n.trailColor||(n.trailColor="#eee"),n.trailWidth||(n.trailWidth=n.strokeWidth),n.color=n.trailColor,n.strokeWidth=n.trailWidth,n.fill=null,this._createPathElement(e,n)},a.prototype._createPathElement=function(t,e){var n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttribute("d",t),n.setAttribute("stroke",e.color),n.setAttribute("stroke-width",e.strokeWidth),e.fill?n.setAttribute("fill",e.fill):n.setAttribute("fill-opacity","0"),n},a.prototype._createTextContainer=function(t,e){var n=document.createElement("div");n.className=t.text.className;var r=t.text.style;return r&&(t.text.autoStyleContainer&&(e.style.position="relative"),i.setStyles(n,r),r.color||(n.style.color=t.color)),this._initializeTextContainer(t,e,n),n},a.prototype._initializeTextContainer=function(t,e,n){},a.prototype._pathString=function(t){throw new Error("Override this function for each progress bar")},a.prototype._trailString=function(t){throw new Error("Override this function for each progress bar")},a.prototype._warnContainerAspectRatio=function(t){if(this.containerAspectRatio){var e=window.getComputedStyle(t,null),n=parseFloat(e.getPropertyValue("width"),10),r=parseFloat(e.getPropertyValue("height"),10);i.floatEquals(this.containerAspectRatio,n/r)||(console.warn("Incorrect aspect ratio of container","#"+t.id,"detected:",e.getPropertyValue("width")+"(width)","/",e.getPropertyValue("height")+"(height)","=",n/r),console.warn("Aspect ratio of should be",this.containerAspectRatio))}},t.exports=a},681:(t,e,n)=>{var r=n(865),i=n(128),o=function(t,e){this._pathTemplate="M 0,{halfOfStrokeWidth} L {width},{halfOfStrokeWidth} L {width},{width} L {halfOfStrokeWidth},{width} L {halfOfStrokeWidth},{strokeWidth}",this._trailTemplate="M {startMargin},{halfOfStrokeWidth} L {width},{halfOfStrokeWidth} L {width},{width} L {halfOfStrokeWidth},{width} L {halfOfStrokeWidth},{halfOfStrokeWidth}",r.apply(this,arguments)};(o.prototype=new r).constructor=o,o.prototype._pathString=function(t){var e=100-t.strokeWidth/2;return i.render(this._pathTemplate,{width:e,strokeWidth:t.strokeWidth,halfOfStrokeWidth:t.strokeWidth/2})},o.prototype._trailString=function(t){var e=100-t.strokeWidth/2;return i.render(this._trailTemplate,{width:e,strokeWidth:t.strokeWidth,halfOfStrokeWidth:t.strokeWidth/2,startMargin:t.strokeWidth/2-t.trailWidth/2})},t.exports=o},128:t=>{var e="Webkit Moz O ms".split(" ");function n(t,n,i){for(var o=t.style,a=0;a{self,t.exports=function(){"use strict";var t={720:function(t,e,n){n.r(e),n.d(e,{Scene:function(){return ee},Tweenable:function(){return mt},interpolate:function(){return Jt},processTweens:function(){return ht},setBezierFunction:function(){return ne},shouldScheduleUpdate:function(){return dt},tween:function(){return wt},unsetBezierFunction:function(){return re}});var r={};n.r(r),n.d(r,{bounce:function(){return L},bouncePast:function(){return N},easeFrom:function(){return D},easeFromTo:function(){return B},easeInBack:function(){return T},easeInCirc:function(){return x},easeInCubic:function(){return c},easeInExpo:function(){return S},easeInOutBack:function(){return M},easeInOutCirc:function(){return P},easeInOutCubic:function(){return f},easeInOutExpo:function(){return O},easeInOutQuad:function(){return l},easeInOutQuart:function(){return v},easeInOutQuint:function(){return _},easeInOutSine:function(){return b},easeInQuad:function(){return s},easeInQuart:function(){return p},easeInQuint:function(){return y},easeInSine:function(){return m},easeOutBack:function(){return j},easeOutBounce:function(){return E},easeOutCirc:function(){return C},easeOutCubic:function(){return h},easeOutExpo:function(){return k},easeOutQuad:function(){return u},easeOutQuart:function(){return d},easeOutQuint:function(){return g},easeOutSine:function(){return w},easeTo:function(){return R},elastic:function(){return A},linear:function(){return a},swingFrom:function(){return W},swingFromTo:function(){return F},swingTo:function(){return I}});var i={};n.r(i),n.d(i,{afterTween:function(){return zt},beforeTween:function(){return qt},doesApply:function(){return Rt},tweenCreated:function(){return Vt}});var o,a=function(t){return t},s=function(t){return Math.pow(t,2)},u=function(t){return-(Math.pow(t-1,2)-1)},l=function(t){return(t/=.5)<1?.5*Math.pow(t,2):-.5*((t-=2)*t-2)},c=function(t){return Math.pow(t,3)},h=function(t){return Math.pow(t-1,3)+1},f=function(t){return(t/=.5)<1?.5*Math.pow(t,3):.5*(Math.pow(t-2,3)+2)},p=function(t){return Math.pow(t,4)},d=function(t){return-(Math.pow(t-1,4)-1)},v=function(t){return(t/=.5)<1?.5*Math.pow(t,4):-.5*((t-=2)*Math.pow(t,3)-2)},y=function(t){return Math.pow(t,5)},g=function(t){return Math.pow(t-1,5)+1},_=function(t){return(t/=.5)<1?.5*Math.pow(t,5):.5*(Math.pow(t-2,5)+2)},m=function(t){return 1-Math.cos(t*(Math.PI/2))},w=function(t){return Math.sin(t*(Math.PI/2))},b=function(t){return-.5*(Math.cos(Math.PI*t)-1)},S=function(t){return 0===t?0:Math.pow(2,10*(t-1))},k=function(t){return 1===t?1:1-Math.pow(2,-10*t)},O=function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))},x=function(t){return-(Math.sqrt(1-t*t)-1)},C=function(t){return Math.sqrt(1-Math.pow(t-1,2))},P=function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},E=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},T=function(t){var e=1.70158;return t*t*((e+1)*t-e)},j=function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},M=function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},A=function(t){return-1*Math.pow(4,-8*t)*Math.sin((6*t-1)*(2*Math.PI)/2)+1},F=function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},W=function(t){var e=1.70158;return t*t*((e+1)*t-e)},I=function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},L=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},N=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?2-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?2-(7.5625*(t-=2.25/2.75)*t+.9375):2-(7.5625*(t-=2.625/2.75)*t+.984375)},B=function(t){return(t/=.5)<1?.5*Math.pow(t,4):-.5*((t-=2)*Math.pow(t,3)-2)},D=function(t){return Math.pow(t,4)},R=function(t){return Math.pow(t,.25)};function V(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function q(t,e){for(var n=0;ns?s:e;t._hasEnded=u>=s;var l=o-(s-u),c=t._filters.length>0;if(t._hasEnded)return t._render(a,t._data,l),t.stop(!0);c&&t._applyFilter(tt),u1&&void 0!==arguments[1]?arguments[1]:G,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=z(e);if(ut[e])return ut[e];if(r===rt||r===nt)for(var i in t)n[i]=e;else for(var o in t)n[o]=e[o]||G;return n},gt=function(t){t===at?(at=t._next)?at._previous=null:st=null:t===st?(st=t._previous)?st._next=null:at=null:(U=t._previous,J=t._next,U._next=J,J._previous=U),t._previous=t._next=null},_t="function"==typeof Promise?Promise:null;o=Symbol.toStringTag;var mt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;V(this,t),Z(this,o,"Promise"),this._config={},this._data={},this._delay=0,this._filters=[],this._next=null,this._previous=null,this._timestamp=null,this._hasEnded=!1,this._resolve=null,this._reject=null,this._currentState=e||{},this._originalState={},this._targetState={},this._start=ot,this._render=ot,this._promiseCtor=_t,n&&this.setConfig(n)}var e;return(e=[{key:"_applyFilter",value:function(t){for(var e=this._filters.length;e>0;e--){var n=this._filters[e-e][t];n&&n(this)}}},{key:"tween",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return this._isPlaying&&this.stop(),!e&&this._config||this.setConfig(e),this._pausedAtTime=null,this._timestamp=t.now(),this._start(this.get(),this._data),this._delay&&this._render(this._currentState,this._data,0),this._resume(this._timestamp)}},{key:"setConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this._config;for(var r in e)n[r]=e[r];var i=n.promise,o=void 0===i?this._promiseCtor:i,a=n.start,s=void 0===a?ot:a,u=n.finish,l=n.render,c=void 0===l?this._config.step||ot:l,h=n.step,f=void 0===h?ot:h;this._data=n.data||n.attachment||this._data,this._isPlaying=!1,this._pausedAtTime=null,this._scheduleId=null,this._delay=e.delay||0,this._start=s,this._render=c||f,this._duration=n.duration||500,this._promiseCtor=o,u&&(this._resolve=u);var p=e.from,d=e.to,v=void 0===d?{}:d,y=this._currentState,g=this._originalState,_=this._targetState;for(var m in p)y[m]=p[m];var w=!1;for(var b in y){var S=y[b];w||z(S)!==rt||(w=!0),g[b]=S,_[b]=v.hasOwnProperty(b)?v[b]:S}if(this._easing=yt(this._currentState,n.easing,this._easing),this._filters.length=0,w){for(var k in t.filters)t.filters[k].doesApply(this)&&this._filters.push(t.filters[k]);this._applyFilter(et)}return this}},{key:"then",value:function(t,e){var n=this;return this._promise=new this._promiseCtor((function(t,e){n._resolve=t,n._reject=e})),this._promise.then(t,e)}},{key:"catch",value:function(t){return this.then().catch(t)}},{key:"finally",value:function(t){return this.then().finally(t)}},{key:"get",value:function(){return Q({},this._currentState)}},{key:"set",value:function(t){this._currentState=t}},{key:"pause",value:function(){if(this._isPlaying)return this._pausedAtTime=t.now(),this._isPlaying=!1,gt(this),this}},{key:"resume",value:function(){return this._resume()}},{key:"_resume",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.now();return null===this._timestamp?this.tween():this._isPlaying?this._promise:(this._pausedAtTime&&(this._timestamp+=e-this._pausedAtTime,this._pausedAtTime=null),this._isPlaying=!0,null===at?(at=this,st=this):(this._previous=st,st._next=this,st=this),this)}},{key:"seek",value:function(e){e=Math.max(e,0);var n=t.now();return this._timestamp+e===0||(this._timestamp=n-e,ct(this,n)),this}},{key:"stop",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._isPlaying)return this;this._isPlaying=!1,gt(this);var e=this._filters.length>0;return t&&(e&&this._applyFilter(tt),lt(1,this._currentState,this._originalState,this._targetState,1,0,this._easing),e&&(this._applyFilter(X),this._applyFilter(Y))),this._resolve&&this._resolve({data:this._data,state:this._currentState,tweenable:this}),this._resolve=null,this._reject=null,this}},{key:"cancel",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this._currentState,n=this._data;return this._isPlaying?(this._reject&&this._reject({data:n,state:e,tweenable:this}),this._resolve=null,this._reject=null,this.stop(t)):this}},{key:"isPlaying",value:function(){return this._isPlaying}},{key:"hasEnded",value:function(){return this._hasEnded}},{key:"setScheduleFunction",value:function(e){t.setScheduleFunction(e)}},{key:"data",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t&&(this._data=Q({},t)),this._data}},{key:"dispose",value:function(){for(var t in this)delete this[t]}}])&&q(t.prototype,e),t}();function wt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=new mt;return e.tween(t),e.tweenable=e,e}Z(mt,"now",(function(){return $})),Z(mt,"setScheduleFunction",(function(t){return it=t})),Z(mt,"filters",{}),Z(mt,"formulas",ut),dt(!0);var bt,St,kt=/(\d|-|\.)/,Ot=/([^\-0-9.]+)/g,xt=/[0-9.-]+/g,Ct=(bt=xt.source,St=/,\s*/.source,new RegExp("rgba?\\(".concat(bt).concat(St).concat(bt).concat(St).concat(bt,"(").concat(St).concat(bt,")?\\)"),"g")),Pt=/^.*\(/,Et=/#([0-9]|[a-f]){3,6}/gi,Tt="VAL",jt=function(t,e){return t.map((function(t,n){return"_".concat(e,"_").concat(n)}))};function Mt(t){return parseInt(t,16)}var At=function(t){return"rgb(".concat((e=t,3===(e=e.replace(/#/,"")).length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]),[Mt(e.substr(0,2)),Mt(e.substr(2,2)),Mt(e.substr(4,2))]).join(","),")");var e},Ft=function(t,e,n){var r=e.match(t),i=e.replace(t,Tt);return r&&r.forEach((function(t){return i=i.replace(Tt,n(t))})),i},Wt=function(t){for(var e in t){var n=t[e];"string"==typeof n&&n.match(Et)&&(t[e]=Ft(Et,n,At))}},It=function(t){var e=t.match(xt),n=e.slice(0,3).map(Math.floor),r=t.match(Pt)[0];if(3===e.length)return"".concat(r).concat(n.join(","),")");if(4===e.length)return"".concat(r).concat(n.join(","),",").concat(e[3],")");throw new Error("Invalid rgbChunk: ".concat(t))},Lt=function(t){return t.match(xt)},Nt=function(t,e){var n={};return e.forEach((function(e){n[e]=t[e],delete t[e]})),n},Bt=function(t,e){return e.map((function(e){return t[e]}))},Dt=function(t,e){return e.forEach((function(e){return t=t.replace(Tt,+e.toFixed(4))})),t},Rt=function(t){for(var e in t._currentState)if("string"==typeof t._currentState[e])return!0;return!1};function Vt(t){var e=t._currentState;[e,t._originalState,t._targetState].forEach(Wt),t._tokenData=function(t){var e,n,r={};for(var i in t){var o=t[i];"string"==typeof o&&(r[i]={formatString:(e=o,n=void 0,n=e.match(Ot),n?(1===n.length||e.charAt(0).match(kt))&&n.unshift(""):n=["",""],n.join(Tt)),chunkNames:jt(Lt(o),i)})}return r}(e)}function qt(t){var e=t._currentState,n=t._originalState,r=t._targetState,i=t._easing,o=t._tokenData;!function(t,e){var n=function(n){var r=e[n].chunkNames,i=t[n];if("string"==typeof i){var o=i.split(" "),a=o[o.length-1];r.forEach((function(e,n){return t[e]=o[n]||a}))}else r.forEach((function(e){return t[e]=i}));delete t[n]};for(var r in e)n(r)}(i,o),[e,n,r].forEach((function(t){return function(t,e){var n=function(n){Lt(t[n]).forEach((function(r,i){return t[e[n].chunkNames[i]]=+r})),delete t[n]};for(var r in e)n(r)}(t,o)}))}function zt(t){var e=t._currentState,n=t._originalState,r=t._targetState,i=t._easing,o=t._tokenData;[e,n,r].forEach((function(t){return function(t,e){for(var n in e){var r=e[n],i=r.chunkNames,o=r.formatString,a=Dt(o,Bt(Nt(t,i),i));t[n]=Ft(Ct,a,It)}}(t,o)})),function(t,e){for(var n in e){var r=e[n].chunkNames,i=t[r[0]];t[n]="string"==typeof i?r.map((function(e){var n=t[e];return delete t[e],n})).join(" "):i}}(i,o)}function Ht(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Qt(t){for(var e=1;e4&&void 0!==arguments[4]?arguments[4]:0,o=Qt({},t),a=yt(t,r);for(var s in $t._filters.length=0,$t.set({}),$t._currentState=o,$t._originalState=t,$t._targetState=e,$t._easing=a,Ut)Ut[s].doesApply($t)&&$t._filters.push(Ut[s]);$t._applyFilter("tweenCreated"),$t._applyFilter("beforeTween");var u=lt(n,o,t,e,1,i,a);return $t._applyFilter("afterTween"),u};function Gt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0?t:0-t},c=1-(f=3*(o=t))-(h=3*(n-o)-f),s=1-(l=3*(a=e))-(u=3*(r-a)-l),function(t){return((s*t+u)*t+l)*t}(function(t,e){var n,r,i,o,a,s;for(i=t,s=0;s<8;s++){if(o=p(i)-t,v(o)(r=1))return r;for(;no?n=i:r=i,i=.5*(r-n)+n}return i}(i,.005));var o,a,s,u,l,c,h,f,p,d,v}}(e,n,r,i);return o.displayName=t,o.x1=e,o.y1=n,o.x2=r,o.y2=i,mt.formulas[t]=o},re=function(t){return delete mt.formulas[t]};mt.filters.token=i}},e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={exports:{}};return t[r](i,i.exports,n),i.exports}return n.d=function(t,e){for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n(720)}()},379:(t,e,n)=>{"use strict";var r,i=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},o=function(){var t={};return function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}t[e]=n}return t[e]}}(),a=[];function s(t){for(var e=-1,n=0;n{"use strict";e.Z=(t,e)=>{const n=t.__vccOpts||t;for(const[t,r]of e)n[t]=r;return n}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={id:r,exports:{}};return t[r](o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.nc=void 0,(()=>{"use strict";const t=Vue;var e={class:"pg-bar",ref:"chartContainer"};var r=n(86),i={large:"",medium:"px-6",small:"px-10"};const o={props:["resourceName","field"],data:function(){return{options:{strokeWidth:4,color:"#FFEA82",fromColor:"#FFEA82",toColor:"#FFEA82",percentage:1,type:"line",sub:null,animateColor:!1},padding:""}},mounted:function(){var t;for(var e in this.field.options)this.field.options.hasOwnProperty(e)&&(this.options[e]=this.field.options[e]);if("semi-circle"===this.options.type)this.drawSemiCircle();else this.drawLine();this.padding=null!==(t=i[this.options.width])&&void 0!==t?t:i.full},methods:{drawLine:function(){var t=this,e=new r.Line(this.$refs.chartContainer,{strokeWidth:this.options.strokeWidth,easing:"easeInOut",duration:1e3,color:this.options.color,trailColor:"#E5E4F0",trailWidth:4,svgStyle:null,text:{style:{color:"#999",textAlign:"right",position:"relative",padding:0,margin:0,transform:null},autoStyleContainer:!1},from:{color:this.options.fromColor},to:{color:this.options.toColor},step:function(e,n){n.setText(Math.round(100*n.value())+" %"),t.options.animateColor&&n.path.setAttribute("stroke",e.color)}});this.$nextTick((function(){t.field.value&&e.animate(t.field.value)}))}}};var a=n(379),s=n.n(a),u=n(15),l={insert:"head",singleton:!1};s()(u.Z,l);u.Z.locals;var c=n(744);const h=(0,c.Z)(o,[["render",function(n,r,i,o,a,s){return(0,t.openBlock)(),(0,t.createElementBlock)("div",{class:(0,t.normalizeClass)(["w-full",a.padding])},[(0,t.createElementVNode)("span",e,null,512)],2)}],["__scopeId","data-v-8974cdfe"]]);var f={key:0,class:"md:w-1/4 md:py-3"},p={class:"font-bold md:font-normal"},d={class:"break-words md:w-3/4 md:py-3"},v={key:0,class:"text-90 pg-bar"},y={class:"pg-bar",ref:"chartContainer"},g=["innerHTML"],_={key:2};var m=n(86);const w={props:["index","resource","resourceName","resourceId","field"],data:function(){return{options:{strokeWidth:4,color:"#FFEA82",percentage:1,type:"line",sub:null,fromColor:"#FFEA82",toColor:"#FFEA82",animateColor:!1},subtitle:""}},mounted:function(){for(var t in this.field.options)this.field.options.hasOwnProperty(t)&&(this.options[t]=this.field.options[t]);if("semi-circle"===this.options.type)this.drawSemiCircle();else this.drawLine()},computed:{label:function(){return this.fieldName||this.field.name},fieldValue:function(){return""!==this.field.value&&null!==this.field.value&&void 0!==this.field.value&&String(this.field.value)},shouldDisplayAsHtml:function(){return this.field.asHtml},hideLabel:function(){return this.field.hideLabel}},methods:{drawLine:function(){var t=this,e=new m.Line(this.$refs.chartContainer,{strokeWidth:this.options.strokeWidth,easing:"easeInOut",duration:1400,color:this.options.color,trailColor:"#eee",trailWidth:1,svgStyle:null,text:{style:{color:"#999",textAlign:"center",position:"relative",padding:0,margin:0,transform:null},autoStyleContainer:!1},from:{color:this.options.fromColor},to:{color:this.options.toColor},step:function(e,n){var r=Math.round(100*n.value())+" % ";t.field.subtitle&&(r+=t.field.subtitle),n.setText(r),t.options.animateColor&&n.path.setAttribute("stroke",e.color)}});this.field.value&&e.animate(this.field.value)}}};var b=n(223),S={insert:"head",singleton:!1};s()(b.Z,S);b.Z.locals;const k=(0,c.Z)(w,[["render",function(e,n,r,i,o,a){return(0,t.openBlock)(),(0,t.createElementBlock)("div",{class:(0,t.normalizeClass)(["-mx-6 flex flex-col space-y-2 px-6 py-2 md:flex-row md:space-y-0 md:py-0",{"border-t border-gray-100 dark:border-gray-700":0!==r.index}])},[a.hideLabel?(0,t.createCommentVNode)("",!0):((0,t.openBlock)(),(0,t.createElementBlock)("div",f,[(0,t.renderSlot)(e.$slots,"default",{},(function(){return[(0,t.createElementVNode)("h4",p,[(0,t.createElementVNode)("span",null,(0,t.toDisplayString)(a.label),1)])]}),!0)])),(0,t.createElementVNode)("div",d,[(0,t.renderSlot)(e.$slots,"value",{},(function(){return[a.fieldValue&&!a.shouldDisplayAsHtml?((0,t.openBlock)(),(0,t.createElementBlock)("p",v,[(0,t.createElementVNode)("span",y,null,512)])):a.fieldValue&&a.shouldDisplayAsHtml?((0,t.openBlock)(),(0,t.createElementBlock)("div",{key:1,innerHTML:r.field.value},null,8,g)):((0,t.openBlock)(),(0,t.createElementBlock)("p",_,"—"))]}),!0)])],2)}],["__scopeId","data-v-70269a15"]]);Nova.booting((function(t,e){t.component("index-field-progressbar",h),t.component("detail-field-progressbar",k)}))})()})(); \ No newline at end of file diff --git a/dist/mix-manifest.json b/dist/mix-manifest.json index d2f0fb4..580164f 100644 --- a/dist/mix-manifest.json +++ b/dist/mix-manifest.json @@ -1,3 +1,3 @@ { "/js/field.js": "/js/field.js" -} +} diff --git a/resources/js/components/IndexField.vue b/resources/js/components/IndexField.vue index 6c5c324..faf1a22 100644 --- a/resources/js/components/IndexField.vue +++ b/resources/js/components/IndexField.vue @@ -1,9 +1,16 @@