diff --git a/CHANGELOG.md b/CHANGELOG.md
index a2ba6f5..f31bd41 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
+## 3.1.6
+
+- Add htmlable
+- Fixed chart background
+- Update docs
+
## 3.1.5
### Changed
diff --git a/README.md b/README.md
index d74a456..6bb91e4 100644
--- a/README.md
+++ b/README.md
@@ -148,14 +148,15 @@ protected static ?string $heading = 'Blog Posts Chart';
Optionally, you can use the `getHeading()` method.
-## Hiding header content
+## Setting a widget subheading
-You can hide header content by **NOT** providing these
+You may set a widget subheading:
-- $heading
-- getHeading()
-- getFormSchema()
-- getOptions()
+```php
+protected static ?string $subheading = 'This is a subheading';
+```
+
+Optionally, you can use the `getSubheading()` method.
## Setting a chart id
@@ -195,8 +196,10 @@ You can also use the `getFooter()` method:
Custom view:
```php
+use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Contracts\View\View;
-protected function getFooter(): string|View
+
+protected function getFooter(): null|string|Htmlable|View
{
return view('custom-footer', ['text' => 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.']);
}
@@ -212,13 +215,25 @@ protected function getFooter(): string|View
Html string:
```php
-use Illuminate\Support\HtmlString;
-protected function getFooter(): string|View
+use Illuminate\Contracts\Support\Htmlable;
+use Illuminate\Contracts\View\View;
+protected function getFooter(): null|string|Htmlable|View
{
return new HtmlString('
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
');
}
```
+## Hiding header content
+
+You can hide header content by **NOT** providing these
+
+- $heading
+- getHeading()
+- $subheading
+- getSubheading()
+- getFormSchema()
+- getOptions()
+
## Filtering chart data
You can set up chart filters to change the data shown on chart. Commonly, this is used to change the time period that chart data is rendered for.
@@ -283,6 +298,15 @@ protected function getFormSchema(): array
}
```
+### Changing the filter form width
+
+You can change the filter form width by setting the `$filterFormWidth` property:
+
+```php
+use Filament\Support\Enums\MaxWidth;
+protected static MaxWidth|string $filterFormWidth = MaxWidth::Medium;
+```
+
### Single select
To set a default filter value, set the `$filter` property:
diff --git a/apexcharts.js b/apexcharts.js
index ed7809b..20a5954 100644
--- a/apexcharts.js
+++ b/apexcharts.js
@@ -34,7 +34,7 @@ export default function apexcharts({
this.updateChart({
theme: { mode: theme },
chart: {
- background: 'inherit'
+ background: this.options.chart.background || 'inherit'
}
})
}
@@ -44,7 +44,7 @@ export default function apexcharts({
initChart: function () {
this.options.theme = { mode: this.theme }
- this.options.chart.background = 'inherit'
+ this.options.chart.background = this.options.chart.background || 'inherit'
this.options = merge(this.options, this.extraJsOptions)
@@ -55,4 +55,4 @@ export default function apexcharts({
this.chart.updateOptions(options, false, true, true)
},
}
-}
\ No newline at end of file
+}
diff --git a/dist/apexcharts.js b/dist/apexcharts.js
index 988dba3..04b43e9 100644
--- a/dist/apexcharts.js
+++ b/dist/apexcharts.js
@@ -816,7 +816,7 @@ rect.legend-mouseover-inactive,
.apexcharts-rangebar-goals-markers {
pointer-events: none
-}`;var c=((h=e.opts.chart)===null||h===void 0?void 0:h.nonce)||e.w.config.chart.nonce;c&&l.setAttribute("nonce",c),r?s.prepend(l):o.head.appendChild(l)}var d=e.create(e.w.config.series,{});if(!d)return t(e);e.mount(d).then(function(){typeof e.w.config.chart.events.mounted=="function"&&e.w.config.chart.events.mounted(e,e.w),e.events.fireEvent("mounted",[e,e.w]),t(d)}).catch(function(u){i(u)})}else i(new Error("Element not found"))})}},{key:"create",value:function(e,t){var i=this,a=this.w;new _a(this).initModules();var s=this.w.globals;if(s.noData=!1,s.animationEnded=!1,!L.elementExists(this.el))return s.animationEnded=!0,this.destroy(),null;if(this.responsive.checkResponsiveConfig(t),a.config.xaxis.convertedCatToNumeric&&new Bt(a.config).convertCatToNumericXaxis(a.config,this.ctx),this.core.setupElements(),a.config.chart.type==="treemap"&&(a.config.grid.show=!1,a.config.yaxis[0].show=!1),s.svgWidth===0)return s.animationEnded=!0,null;var r=e;e.forEach(function(u,g){u.hidden&&(r=i.legend.legendHelpers.getSeriesAfterCollapsing({realIndex:g}))});var o=le.checkComboSeries(r,a.config.chart.type);s.comboCharts=o.comboCharts,s.comboBarCount=o.comboBarCount;var l=r.every(function(u){return u.data&&u.data.length===0});(r.length===0||l&&s.collapsedSeries.length<1)&&this.series.handleNoData(),this.events.setupEventHandlers(),this.data.parseData(r),this.theme.init(),new At(this).setGlobalMarkerSize(),this.formatters.setLabelFormatters(),this.titleSubtitle.draw(),s.noData&&s.collapsedSeries.length!==s.series.length&&!a.config.legend.showForSingleSeries||this.legend.init(),this.series.hasAllSeriesEqualX(),s.axisCharts&&(this.core.coreCalculations(),a.config.xaxis.type!=="category"&&this.formatters.setLabelFormatters(),this.ctx.toolbar.minX=a.globals.minX,this.ctx.toolbar.maxX=a.globals.maxX),this.formatters.heatmapLabelFormatters(),new le(this).getLargestMarkerSize(),this.dimensions.plotCoords();var h=this.core.xySettings();this.grid.createGridMask();var c=this.core.plotChartType(r,h),d=new bt(this);return d.bringForward(),a.config.dataLabels.background.enabled&&d.dataLabelsBackground(),this.core.shiftGraphPosition(),{elGraph:c,xyRatios:h,dimensions:{plot:{left:a.globals.translateX,top:a.globals.translateY,width:a.globals.gridWidth,height:a.globals.gridHeight}}}}},{key:"mount",value:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,i=this,a=i.w;return new Promise(function(s,r){if(i.el===null)return r(new Error("Not enough data to display or target element not found"));(t===null||a.globals.allSeriesCollapsed)&&i.series.handleNoData(),i.grid=new vs(i);var o,l,h=i.grid.drawGrid();if(i.annotations=new Jr(i),i.annotations.drawImageAnnos(),i.annotations.drawTextAnnos(),a.config.grid.position==="back"&&(h&&a.globals.dom.elGraphical.add(h.el),h!=null&&(o=h.elGridBorders)!==null&&o!==void 0&&o.node&&a.globals.dom.elGraphical.add(h.elGridBorders)),Array.isArray(t.elGraph))for(var c=0;c0&&a.globals.memory.methodsToExec.forEach(function(p){p.method(p.params,!1,p.context)}),a.globals.axisCharts||a.globals.noData||i.core.resizeNonAxisCharts(),s(i)})}},{key:"destroy",value:function(){window.removeEventListener("resize",this.windowResizeHandler),function(t,i){var a=Oi.get(i);a&&(a.disconnect(),Oi.delete(i))}(this.el.parentNode,this.parentResizeHandler);var e=this.w.config.chart.id;e&&Apex._chartInstances.forEach(function(t,i){t.id===L.escapeString(e)&&Apex._chartInstances.splice(i,1)}),new Na(this.ctx).clear({isUpdating:!1})}},{key:"updateOptions",value:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1],a=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],s=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],r=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],o=this.w;return o.globals.selection=void 0,e.series&&(this.series.resetSeries(!1,!0,!1),e.series.length&&e.series[0].data&&(e.series=e.series.map(function(l,h){return t.updateHelpers._extendSeries(l,h)})),this.updateHelpers.revertDefaultAxisMinMax()),e.xaxis&&(e=this.updateHelpers.forceXAxisUpdate(e)),e.yaxis&&(e=this.updateHelpers.forceYAxisUpdate(e)),o.globals.collapsedSeriesIndices.length>0&&this.series.clearPreviousPaths(),e.theme&&(e=this.theme.updateThemeOptions(e)),this.updateHelpers._updateOptions(e,i,a,s,r)}},{key:"updateSeries",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];return this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(e,t,i)}},{key:"appendSeries",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],a=this.w.config.series.slice();return a.push(e),this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(a,t,i)}},{key:"appendData",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this;i.w.globals.dataChanged=!0,i.series.getPreviousPaths();for(var a=i.w.config.series.slice(),s=0;s0&&arguments[0]!==void 0)||arguments[0],t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.series.resetSeries(e,t)}},{key:"addEventListener",value:function(e,t){this.events.addEventListener(e,t)}},{key:"removeEventListener",value:function(e,t){this.events.removeEventListener(e,t)}},{key:"addXaxisAnnotation",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,a=this;i&&(a=i),a.annotations.addXaxisAnnotationExternal(e,t,a)}},{key:"addYaxisAnnotation",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,a=this;i&&(a=i),a.annotations.addYaxisAnnotationExternal(e,t,a)}},{key:"addPointAnnotation",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,a=this;i&&(a=i),a.annotations.addPointAnnotationExternal(e,t,a)}},{key:"clearAnnotations",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,t=this;e&&(t=e),t.annotations.clearAnnotations(t)}},{key:"removeAnnotation",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,i=this;t&&(i=t),i.annotations.removeAnnotation(i,e)}},{key:"getChartArea",value:function(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-inner")}},{key:"getSeriesTotalXRange",value:function(e,t){return this.coreUtils.getSeriesTotalsXRange(e,t)}},{key:"getHighestValueInSeries",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return new Ui(this.ctx).getMinYMaxY(e).highestY}},{key:"getLowestValueInSeries",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return new Ui(this.ctx).getMinYMaxY(e).lowestY}},{key:"getSeriesTotal",value:function(){return this.w.globals.seriesTotals}},{key:"toggleDataPointSelection",value:function(e,t){return this.updateHelpers.toggleDataPointSelection(e,t)}},{key:"zoomX",value:function(e,t){this.ctx.toolbar.zoomUpdateOptions(e,t)}},{key:"setLocale",value:function(e){this.localization.setCurrentLocaleValues(e)}},{key:"dataURI",value:function(e){return new di(this.ctx).dataURI(e)}},{key:"exportToCSV",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new di(this.ctx).exportToCSV(e)}},{key:"paper",value:function(){return this.w.globals.dom.Paper}},{key:"_parentResizeCallback",value:function(){this.w.globals.animationEnded&&this.w.config.chart.redrawOnParentResize&&this._windowResize()}},{key:"_windowResize",value:function(){var e=this;clearTimeout(this.w.globals.resizeTimer),this.w.globals.resizeTimer=window.setTimeout(function(){e.w.globals.resized=!0,e.w.globals.dataChanged=!1,e.ctx.update()},150)}},{key:"_windowResizeHandler",value:function(){var e=this.w.config.chart.redrawOnWindowResize;typeof e=="function"&&(e=e()),e&&this._windowResize()}}],[{key:"getChartByID",value:function(e){var t=L.escapeString(e);if(Apex._chartInstances){var i=Apex._chartInstances.filter(function(a){return a.id===t})[0];return i&&i.chart}}},{key:"initOnLoad",value:function(){for(var e=document.querySelectorAll("[data-apexcharts]"),t=0;t2?s-2:0),o=2;o{var Xn=200,Ns="__lodash_hash_undefined__",En=800,Rn=16,Ws=9007199254740991,Bs="[object Arguments]",On="[object Array]",Yn="[object AsyncFunction]",Hn="[object Boolean]",Fn="[object Date]",Dn="[object Error]",Gs="[object Function]",_n="[object GeneratorFunction]",Nn="[object Map]",Wn="[object Number]",Bn="[object Null]",js="[object Object]",Gn="[object Proxy]",jn="[object RegExp]",Vn="[object Set]",Un="[object String]",qn="[object Undefined]",Zn="[object WeakMap]",$n="[object ArrayBuffer]",Jn="[object DataView]",Kn="[object Float32Array]",Qn="[object Float64Array]",eo="[object Int8Array]",to="[object Int16Array]",io="[object Int32Array]",ao="[object Uint8Array]",so="[object Uint8ClampedArray]",ro="[object Uint16Array]",no="[object Uint32Array]",oo=/[\\^$.*+?()[\]{}|]/g,lo=/^\[object .+?Constructor\]$/,ho=/^(?:0|[1-9]\d*)$/,ne={};ne[Kn]=ne[Qn]=ne[eo]=ne[to]=ne[io]=ne[ao]=ne[so]=ne[ro]=ne[no]=!0;ne[Bs]=ne[On]=ne[$n]=ne[Hn]=ne[Jn]=ne[Fn]=ne[Dn]=ne[Gs]=ne[Nn]=ne[Wn]=ne[js]=ne[jn]=ne[Vn]=ne[Un]=ne[Zn]=!1;var Vs=typeof global=="object"&&global&&global.Object===Object&&global,co=typeof self=="object"&&self&&self.Object===Object&&self,Qt=Vs||co||Function("return this")(),Us=typeof $t=="object"&&$t&&!$t.nodeType&&$t,Jt=Us&&typeof Ct=="object"&&Ct&&!Ct.nodeType&&Ct,qs=Jt&&Jt.exports===Us,ua=qs&&Vs.process,Xs=function(){try{var n=Jt&&Jt.require&&Jt.require("util").types;return n||ua&&ua.binding&&ua.binding("util")}catch{}}(),Es=Xs&&Xs.isTypedArray;function uo(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function go(n,e){for(var t=-1,i=Array(n);++t-1}function Oo(n,e){var t=this.__data__,i=yi(t,n);return i<0?(++this.size,t.push([n,e])):t[i][1]=e,this}Be.prototype.clear=zo;Be.prototype.delete=Xo;Be.prototype.get=Eo;Be.prototype.has=Ro;Be.prototype.set=Oo;function St(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e1?t[a-1]:void 0,r=a>2?t[2]:void 0;for(s=n.length>3&&typeof s=="function"?(a--,s):void 0,r&&cl(t[0],t[1],r)&&(s=a<3?void 0:s,a=1),e=Object(e);++i-1&&n%1==0&&n0){if(++e>=En)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function ml(n){if(n!=null){try{return vi.call(n)}catch{}try{return n+""}catch{}}return""}function Ai(n,e){return n===e||n!==n&&e!==e}var xa=_s(function(){return arguments}())?_s:function(n){return ei(n)&&We.call(n,"callee")&&!wo.call(n,"callee")},ba=Array.isArray;function ya(n){return n!=null&&ir(n.length)&&!wa(n)}function vl(n){return ei(n)&&ya(n)}var tr=Ao||Cl;function wa(n){if(!rt(n))return!1;var e=wi(n);return e==Gs||e==_n||e==Yn||e==Gn}function ir(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=Ws}function rt(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function ei(n){return n!=null&&typeof n=="object"}function yl(n){if(!ei(n)||wi(n)!=js)return!1;var e=$s(n);if(e===null)return!0;var t=We.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&vi.call(t)==vo}var ar=Es?fo(Es):$o;function wl(n){return rl(n,sr(n))}function sr(n){return ya(n)?Vo(n,!0):Jo(n)}var kl=nl(function(n,e,t){Ks(n,e,t)});function Al(n){return function(){return n}}function rr(n){return n}function Cl(){return!1}Ct.exports=kl});var lr=xr(zs(),1),or=nr();function Sl({options:n,chartId:e,theme:t,extraJsOptions:i}){return{chart:null,options:n,chartId:e,theme:t,extraJsOptions:i,init:function(){this.$wire.$on("updateOptions",({options:a})=>{a=or(a,this.extraJsOptions),this.updateChart(a)}),Alpine.effect(()=>{let a=Alpine.store("theme");this.$nextTick(()=>{this.chart===null?this.initChart():this.updateChart({theme:{mode:a},chart:{background:"inherit"}})})})},initChart:function(){this.options.theme={mode:this.theme},this.options.chart.background="inherit",this.options=or(this.options,this.extraJsOptions),this.chart=new lr.default(document.querySelector(this.chartId),this.options),this.chart.render()},updateChart:function(a){this.chart.updateOptions(a,!1,!0,!0)}}}export{Sl as default};
+}`;var c=((h=e.opts.chart)===null||h===void 0?void 0:h.nonce)||e.w.config.chart.nonce;c&&l.setAttribute("nonce",c),r?s.prepend(l):o.head.appendChild(l)}var d=e.create(e.w.config.series,{});if(!d)return t(e);e.mount(d).then(function(){typeof e.w.config.chart.events.mounted=="function"&&e.w.config.chart.events.mounted(e,e.w),e.events.fireEvent("mounted",[e,e.w]),t(d)}).catch(function(u){i(u)})}else i(new Error("Element not found"))})}},{key:"create",value:function(e,t){var i=this,a=this.w;new _a(this).initModules();var s=this.w.globals;if(s.noData=!1,s.animationEnded=!1,!L.elementExists(this.el))return s.animationEnded=!0,this.destroy(),null;if(this.responsive.checkResponsiveConfig(t),a.config.xaxis.convertedCatToNumeric&&new Bt(a.config).convertCatToNumericXaxis(a.config,this.ctx),this.core.setupElements(),a.config.chart.type==="treemap"&&(a.config.grid.show=!1,a.config.yaxis[0].show=!1),s.svgWidth===0)return s.animationEnded=!0,null;var r=e;e.forEach(function(u,g){u.hidden&&(r=i.legend.legendHelpers.getSeriesAfterCollapsing({realIndex:g}))});var o=le.checkComboSeries(r,a.config.chart.type);s.comboCharts=o.comboCharts,s.comboBarCount=o.comboBarCount;var l=r.every(function(u){return u.data&&u.data.length===0});(r.length===0||l&&s.collapsedSeries.length<1)&&this.series.handleNoData(),this.events.setupEventHandlers(),this.data.parseData(r),this.theme.init(),new At(this).setGlobalMarkerSize(),this.formatters.setLabelFormatters(),this.titleSubtitle.draw(),s.noData&&s.collapsedSeries.length!==s.series.length&&!a.config.legend.showForSingleSeries||this.legend.init(),this.series.hasAllSeriesEqualX(),s.axisCharts&&(this.core.coreCalculations(),a.config.xaxis.type!=="category"&&this.formatters.setLabelFormatters(),this.ctx.toolbar.minX=a.globals.minX,this.ctx.toolbar.maxX=a.globals.maxX),this.formatters.heatmapLabelFormatters(),new le(this).getLargestMarkerSize(),this.dimensions.plotCoords();var h=this.core.xySettings();this.grid.createGridMask();var c=this.core.plotChartType(r,h),d=new bt(this);return d.bringForward(),a.config.dataLabels.background.enabled&&d.dataLabelsBackground(),this.core.shiftGraphPosition(),{elGraph:c,xyRatios:h,dimensions:{plot:{left:a.globals.translateX,top:a.globals.translateY,width:a.globals.gridWidth,height:a.globals.gridHeight}}}}},{key:"mount",value:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,i=this,a=i.w;return new Promise(function(s,r){if(i.el===null)return r(new Error("Not enough data to display or target element not found"));(t===null||a.globals.allSeriesCollapsed)&&i.series.handleNoData(),i.grid=new vs(i);var o,l,h=i.grid.drawGrid();if(i.annotations=new Jr(i),i.annotations.drawImageAnnos(),i.annotations.drawTextAnnos(),a.config.grid.position==="back"&&(h&&a.globals.dom.elGraphical.add(h.el),h!=null&&(o=h.elGridBorders)!==null&&o!==void 0&&o.node&&a.globals.dom.elGraphical.add(h.elGridBorders)),Array.isArray(t.elGraph))for(var c=0;c0&&a.globals.memory.methodsToExec.forEach(function(p){p.method(p.params,!1,p.context)}),a.globals.axisCharts||a.globals.noData||i.core.resizeNonAxisCharts(),s(i)})}},{key:"destroy",value:function(){window.removeEventListener("resize",this.windowResizeHandler),function(t,i){var a=Oi.get(i);a&&(a.disconnect(),Oi.delete(i))}(this.el.parentNode,this.parentResizeHandler);var e=this.w.config.chart.id;e&&Apex._chartInstances.forEach(function(t,i){t.id===L.escapeString(e)&&Apex._chartInstances.splice(i,1)}),new Na(this.ctx).clear({isUpdating:!1})}},{key:"updateOptions",value:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1],a=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],s=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],r=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],o=this.w;return o.globals.selection=void 0,e.series&&(this.series.resetSeries(!1,!0,!1),e.series.length&&e.series[0].data&&(e.series=e.series.map(function(l,h){return t.updateHelpers._extendSeries(l,h)})),this.updateHelpers.revertDefaultAxisMinMax()),e.xaxis&&(e=this.updateHelpers.forceXAxisUpdate(e)),e.yaxis&&(e=this.updateHelpers.forceYAxisUpdate(e)),o.globals.collapsedSeriesIndices.length>0&&this.series.clearPreviousPaths(),e.theme&&(e=this.theme.updateThemeOptions(e)),this.updateHelpers._updateOptions(e,i,a,s,r)}},{key:"updateSeries",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];return this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(e,t,i)}},{key:"appendSeries",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],a=this.w.config.series.slice();return a.push(e),this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(a,t,i)}},{key:"appendData",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this;i.w.globals.dataChanged=!0,i.series.getPreviousPaths();for(var a=i.w.config.series.slice(),s=0;s0&&arguments[0]!==void 0)||arguments[0],t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.series.resetSeries(e,t)}},{key:"addEventListener",value:function(e,t){this.events.addEventListener(e,t)}},{key:"removeEventListener",value:function(e,t){this.events.removeEventListener(e,t)}},{key:"addXaxisAnnotation",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,a=this;i&&(a=i),a.annotations.addXaxisAnnotationExternal(e,t,a)}},{key:"addYaxisAnnotation",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,a=this;i&&(a=i),a.annotations.addYaxisAnnotationExternal(e,t,a)}},{key:"addPointAnnotation",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,a=this;i&&(a=i),a.annotations.addPointAnnotationExternal(e,t,a)}},{key:"clearAnnotations",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,t=this;e&&(t=e),t.annotations.clearAnnotations(t)}},{key:"removeAnnotation",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,i=this;t&&(i=t),i.annotations.removeAnnotation(i,e)}},{key:"getChartArea",value:function(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-inner")}},{key:"getSeriesTotalXRange",value:function(e,t){return this.coreUtils.getSeriesTotalsXRange(e,t)}},{key:"getHighestValueInSeries",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return new Ui(this.ctx).getMinYMaxY(e).highestY}},{key:"getLowestValueInSeries",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return new Ui(this.ctx).getMinYMaxY(e).lowestY}},{key:"getSeriesTotal",value:function(){return this.w.globals.seriesTotals}},{key:"toggleDataPointSelection",value:function(e,t){return this.updateHelpers.toggleDataPointSelection(e,t)}},{key:"zoomX",value:function(e,t){this.ctx.toolbar.zoomUpdateOptions(e,t)}},{key:"setLocale",value:function(e){this.localization.setCurrentLocaleValues(e)}},{key:"dataURI",value:function(e){return new di(this.ctx).dataURI(e)}},{key:"exportToCSV",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new di(this.ctx).exportToCSV(e)}},{key:"paper",value:function(){return this.w.globals.dom.Paper}},{key:"_parentResizeCallback",value:function(){this.w.globals.animationEnded&&this.w.config.chart.redrawOnParentResize&&this._windowResize()}},{key:"_windowResize",value:function(){var e=this;clearTimeout(this.w.globals.resizeTimer),this.w.globals.resizeTimer=window.setTimeout(function(){e.w.globals.resized=!0,e.w.globals.dataChanged=!1,e.ctx.update()},150)}},{key:"_windowResizeHandler",value:function(){var e=this.w.config.chart.redrawOnWindowResize;typeof e=="function"&&(e=e()),e&&this._windowResize()}}],[{key:"getChartByID",value:function(e){var t=L.escapeString(e);if(Apex._chartInstances){var i=Apex._chartInstances.filter(function(a){return a.id===t})[0];return i&&i.chart}}},{key:"initOnLoad",value:function(){for(var e=document.querySelectorAll("[data-apexcharts]"),t=0;t2?s-2:0),o=2;o{var Xn=200,Ns="__lodash_hash_undefined__",En=800,Rn=16,Ws=9007199254740991,Bs="[object Arguments]",On="[object Array]",Yn="[object AsyncFunction]",Hn="[object Boolean]",Fn="[object Date]",Dn="[object Error]",Gs="[object Function]",_n="[object GeneratorFunction]",Nn="[object Map]",Wn="[object Number]",Bn="[object Null]",js="[object Object]",Gn="[object Proxy]",jn="[object RegExp]",Vn="[object Set]",Un="[object String]",qn="[object Undefined]",Zn="[object WeakMap]",$n="[object ArrayBuffer]",Jn="[object DataView]",Kn="[object Float32Array]",Qn="[object Float64Array]",eo="[object Int8Array]",to="[object Int16Array]",io="[object Int32Array]",ao="[object Uint8Array]",so="[object Uint8ClampedArray]",ro="[object Uint16Array]",no="[object Uint32Array]",oo=/[\\^$.*+?()[\]{}|]/g,lo=/^\[object .+?Constructor\]$/,ho=/^(?:0|[1-9]\d*)$/,ne={};ne[Kn]=ne[Qn]=ne[eo]=ne[to]=ne[io]=ne[ao]=ne[so]=ne[ro]=ne[no]=!0;ne[Bs]=ne[On]=ne[$n]=ne[Hn]=ne[Jn]=ne[Fn]=ne[Dn]=ne[Gs]=ne[Nn]=ne[Wn]=ne[js]=ne[jn]=ne[Vn]=ne[Un]=ne[Zn]=!1;var Vs=typeof global=="object"&&global&&global.Object===Object&&global,co=typeof self=="object"&&self&&self.Object===Object&&self,Qt=Vs||co||Function("return this")(),Us=typeof $t=="object"&&$t&&!$t.nodeType&&$t,Jt=Us&&typeof Ct=="object"&&Ct&&!Ct.nodeType&&Ct,qs=Jt&&Jt.exports===Us,ua=qs&&Vs.process,Xs=function(){try{var n=Jt&&Jt.require&&Jt.require("util").types;return n||ua&&ua.binding&&ua.binding("util")}catch{}}(),Es=Xs&&Xs.isTypedArray;function uo(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function go(n,e){for(var t=-1,i=Array(n);++t-1}function Oo(n,e){var t=this.__data__,i=yi(t,n);return i<0?(++this.size,t.push([n,e])):t[i][1]=e,this}Be.prototype.clear=zo;Be.prototype.delete=Xo;Be.prototype.get=Eo;Be.prototype.has=Ro;Be.prototype.set=Oo;function St(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e1?t[a-1]:void 0,r=a>2?t[2]:void 0;for(s=n.length>3&&typeof s=="function"?(a--,s):void 0,r&&cl(t[0],t[1],r)&&(s=a<3?void 0:s,a=1),e=Object(e);++i-1&&n%1==0&&n0){if(++e>=En)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function ml(n){if(n!=null){try{return vi.call(n)}catch{}try{return n+""}catch{}}return""}function Ai(n,e){return n===e||n!==n&&e!==e}var xa=_s(function(){return arguments}())?_s:function(n){return ei(n)&&We.call(n,"callee")&&!wo.call(n,"callee")},ba=Array.isArray;function ya(n){return n!=null&&ir(n.length)&&!wa(n)}function vl(n){return ei(n)&&ya(n)}var tr=Ao||Cl;function wa(n){if(!rt(n))return!1;var e=wi(n);return e==Gs||e==_n||e==Yn||e==Gn}function ir(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=Ws}function rt(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function ei(n){return n!=null&&typeof n=="object"}function yl(n){if(!ei(n)||wi(n)!=js)return!1;var e=$s(n);if(e===null)return!0;var t=We.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&vi.call(t)==vo}var ar=Es?fo(Es):$o;function wl(n){return rl(n,sr(n))}function sr(n){return ya(n)?Vo(n,!0):Jo(n)}var kl=nl(function(n,e,t){Ks(n,e,t)});function Al(n){return function(){return n}}function rr(n){return n}function Cl(){return!1}Ct.exports=kl});var lr=xr(zs(),1),or=nr();function Sl({options:n,chartId:e,theme:t,extraJsOptions:i}){return{chart:null,options:n,chartId:e,theme:t,extraJsOptions:i,init:function(){this.$wire.$on("updateOptions",({options:a})=>{a=or(a,this.extraJsOptions),this.updateChart(a)}),Alpine.effect(()=>{let a=Alpine.store("theme");this.$nextTick(()=>{this.chart===null?this.initChart():this.updateChart({theme:{mode:a},chart:{background:this.options.chart.background||"inherit"}})})})},initChart:function(){this.options.theme={mode:this.theme},this.options.chart.background=this.options.chart.background||"inherit",this.options=or(this.options,this.extraJsOptions),this.chart=new lr.default(document.querySelector(this.chartId),this.options),this.chart.render()},updateChart:function(a){this.chart.updateOptions(a,!1,!0,!0)}}}export{Sl as default};
/*! Bundled license information:
apexcharts/dist/apexcharts.common.js:
diff --git a/src/Concerns/HasFooter.php b/src/Concerns/HasFooter.php
index 4f4574a..395fcc8 100644
--- a/src/Concerns/HasFooter.php
+++ b/src/Concerns/HasFooter.php
@@ -2,16 +2,14 @@
namespace Leandrocfe\FilamentApexCharts\Concerns;
+use Illuminate\Contracts\Support\Htmlable;
+use Illuminate\Contracts\View\View;
+
trait HasFooter
{
protected static ?string $footer = null;
- /**
- * Retrieves the footer string or view object.
- *
- * @return null|string|\Illuminate\Contracts\View\View The footer value.
- */
- protected function getFooter(): null|string|\Illuminate\Contracts\View\View
+ protected function getFooter(): null|string|Htmlable|View
{
return static::$footer;
}
diff --git a/src/Concerns/HasHeader.php b/src/Concerns/HasHeader.php
index af48689..3e57996 100644
--- a/src/Concerns/HasHeader.php
+++ b/src/Concerns/HasHeader.php
@@ -2,6 +2,9 @@
namespace Leandrocfe\FilamentApexCharts\Concerns;
+use Illuminate\Contracts\Support\Htmlable;
+use Illuminate\Contracts\View\View;
+
trait HasHeader
{
protected static ?string $heading = null;
@@ -11,7 +14,7 @@ trait HasHeader
/**
* Retrieves the heading used in the class.
*/
- protected function getHeading(): ?string
+ protected function getHeading(): null|string|Htmlable|View
{
return static::$heading;
}
@@ -19,7 +22,7 @@ protected function getHeading(): ?string
/**
* Retrieves the subheading used in the class.
*/
- protected function getSubheading(): ?string
+ protected function getSubheading(): null|string|Htmlable|View
{
return static::$subheading;
}