monobill-mintui 0.6.616 → 0.6.619

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/components/alert/browser.js +1 -1
  2. package/dist/components/alert/index.cjs +1 -1
  3. package/dist/components/alert/index.js +1 -1
  4. package/dist/components/chart/browser.js +110 -99
  5. package/dist/components/chart/index.cjs +3 -3
  6. package/dist/components/chart/index.js +110 -99
  7. package/dist/components/chunks/{modal-VN2fwehS.js → modal-9S-FF3_o.js} +1 -1
  8. package/dist/components/chunks/{modal-DZDugqmr.js → modal-D7KKb4f9.js} +1 -1
  9. package/dist/components/chunks/{text-BHkEs8U5.js → text-Bmfl6CxJ.js} +1 -1
  10. package/dist/components/chunks/{text-BmHZbBMo.js → text-Cpl5ljSe.js} +1 -1
  11. package/dist/components/confirm-action/browser.js +2 -2
  12. package/dist/components/confirm-action/index.cjs +1 -1
  13. package/dist/components/confirm-action/index.js +2 -2
  14. package/dist/components/modal/browser.js +1 -1
  15. package/dist/components/modal/index.cjs +1 -1
  16. package/dist/components/modal/index.js +1 -1
  17. package/dist/components/off-canvas/browser.js +1 -1
  18. package/dist/components/off-canvas/index.cjs +1 -1
  19. package/dist/components/off-canvas/index.js +1 -1
  20. package/dist/components/side-navigation/browser.js +1 -1
  21. package/dist/components/side-navigation/index.cjs +1 -1
  22. package/dist/components/side-navigation/index.js +1 -1
  23. package/dist/components/text/browser.js +1 -1
  24. package/dist/components/text/index.cjs +1 -1
  25. package/dist/components/text/index.js +1 -1
  26. package/dist/components/time-picker/browser.js +1 -1
  27. package/dist/components/time-picker/index.cjs +1 -1
  28. package/dist/components/time-picker/index.js +1 -1
  29. package/dist/index.cjs +4 -4
  30. package/dist/index.css +5 -5
  31. package/dist/index.js +112 -101
  32. package/dist/input.css +1 -1
  33. package/dist/link.css +1 -1
  34. package/dist/modal.css +1 -1
  35. package/dist/navigation.css +1 -1
  36. package/dist/text.css +1 -1
  37. package/package.json +1 -1
@@ -18,7 +18,7 @@ import { a as e } from "../chunks/icon-B01tq_aJ.js";
18
18
  import { t } from "../chunks/register-element-BFYmIynH.js";
19
19
  import "../chunks/icon-DNWs0suS.js";
20
20
  import "../chunks/close-y8q0rMSE.js";
21
- import "../chunks/text-BHkEs8U5.js";
21
+ import "../chunks/text-Bmfl6CxJ.js";
22
22
  e({
23
23
  name: "info",
24
24
  viewBox: "0 0 24 24",
@@ -1 +1 @@
1
- const e=require(`../chunks/icon-BcsWL4kZ.js`),t=require(`../chunks/register-element-tCL_F1YI.js`);require(`../chunks/icon-uMo_iGkX.js`),require(`../chunks/close-Bg0kqvrY.js`),require(`../chunks/text-BmHZbBMo.js`),e.a({name:`info`,viewBox:`0 0 24 24`,path:`M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`,strokeLinecap:`round`,strokeLinejoin:`round`}),e.a({name:`success`,viewBox:`0 0 24 24`,path:`M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z`,strokeLinecap:`round`,strokeLinejoin:`round`}),e.a({name:`warning`,viewBox:`0 0 24 24`,path:`M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z`,strokeLinecap:`round`,strokeLinejoin:`round`}),e.a({name:`error`,viewBox:`0 0 24 24`,path:`M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z`,strokeLinecap:`round`,strokeLinejoin:`round`});var n=class extends HTMLElement{static get observedAttributes(){return[`heading`,`dismissable`,`tone`]}constructor(){super(),this._headingElement=null,this._iconElement=null,this._dismissButton=null,this._headerWrapper=null,this._bodyWrapper=null,this._dismissHandler=null,this._rendering=!1,this._childObserver=null,this._normalizingChildren=!1}connectedCallback(){this.render()}disconnectedCallback(){this._childObserver?.disconnect(),this._dismissButton?.removeEventListener(`click`,this._dismissHandler),this._dismissHandler=null}get heading(){return this.getAttribute(`heading`)??``}set heading(e){this.setAttribute(`heading`,String(e??``))}get tone(){return this.getTone()}set tone(e){this.setAttribute(`tone`,e)}get dismissable(){return this.isDismissable()}set dismissable(e){this.setAttribute(`dismissable`,String(!!e))}get dismissible(){return this.dismissable}set dismissible(e){this.dismissable=e}cleanupDismissListener(){this._dismissButton&&this._dismissHandler&&this._dismissButton.removeEventListener(`click`,this._dismissHandler),this._dismissHandler=null}attributeChangedCallback(e,t,n){t!==n&&this.render()}getHeading(){return this.getAttribute(`heading`)||``}getTone(){let e=this.getAttribute(`tone`);return e===`info`||e===`success`||e===`warning`||e===`danger`?e:`info`}isDismissable(){return this.getAttribute(`dismissable`)===`true`}getIconName(){switch(this.getTone()){case`info`:return`info`;case`success`:return`success`;case`warning`:return`warning`;case`danger`:return`error`;default:return`info`}}getAriaLive(){return this.getTone()===`danger`?`assertive`:`polite`}render(){if(!(this._rendering||!this.isConnected)){this._rendering=!0;try{this.renderContent()}finally{this._rendering=!1}}}renderContent(){this._childObserver?.disconnect();let e=this.getTone(),t=this.getHeading(),n=this.isDismissable(),r=this.getAriaLive();this.setAttribute(`role`,e===`danger`?`alert`:`status`),this.setAttribute(`aria-live`,r),e===`danger`?this.setAttribute(`aria-atomic`,`true`):this.removeAttribute(`aria-atomic`);let i=[];for(this._bodyWrapper?Array.from(this._bodyWrapper.childNodes).forEach(e=>{i.push(e)}):Array.from(this.childNodes).forEach(e=>{e!==this._headerWrapper&&e!==this._bodyWrapper&&e!==this._iconElement&&e!==this._headingElement&&e!==this._dismissButton&&i.push(e)}),this.cleanupDismissListener();this.firstChild;)this.removeChild(this.firstChild);if(this._headerWrapper=null,this._bodyWrapper=null,this._iconElement=null,this._headingElement=null,this._dismissButton=null,this._headerWrapper=document.createElement(`div`),this._headerWrapper.className=`mint-alert-header`,this._iconElement=document.createElement(`mint-icon`),this._iconElement.setAttribute(`name`,this.getIconName()),this._iconElement.className=`mint-alert-icon`,this._headerWrapper.appendChild(this._iconElement),this._headingElement=document.createElement(`mint-text`),this._headingElement.className=`mint-alert-heading`,this._headingElement.textContent=t||``,this._headerWrapper.appendChild(this._headingElement),n){this._dismissButton=document.createElement(`button`),this._dismissButton.className=`mint-alert-dismiss`,this._dismissButton.setAttribute(`aria-label`,`Dismiss alert`),this._dismissButton.setAttribute(`type`,`button`);let e=document.createElement(`mint-icon`);e.setAttribute(`name`,`close`),e.className=`mint-alert-close-icon`,this._dismissButton.appendChild(e),this._dismissHandler=e=>{e.preventDefault(),e.stopPropagation(),this.dispatchEvent(new CustomEvent(`dismissed`,{bubbles:!0,composed:!0})),this.remove()},this._dismissButton.addEventListener(`click`,this._dismissHandler),this._headerWrapper.appendChild(this._dismissButton)}this._bodyWrapper=document.createElement(`div`),this._bodyWrapper.className=`mint-alert-body`,i.forEach(e=>{this._bodyWrapper.appendChild(e)}),this.appendChild(this._headerWrapper),this.appendChild(this._bodyWrapper),this._childObserver||=new MutationObserver(()=>this.normalizeConsumerChildren()),this._childObserver.observe(this,{childList:!0})}normalizeConsumerChildren(){if(!(this._normalizingChildren||!this._bodyWrapper)){this._normalizingChildren=!0;try{Array.from(this.childNodes).forEach(e=>{e!==this._headerWrapper&&e!==this._bodyWrapper&&this._bodyWrapper.appendChild(e)})}finally{this._normalizingChildren=!1}}}};customElements.get(`mint-alert`)||t.t(`mint-alert`,n),module.exports=n;
1
+ const e=require(`../chunks/icon-BcsWL4kZ.js`),t=require(`../chunks/register-element-tCL_F1YI.js`);require(`../chunks/icon-uMo_iGkX.js`),require(`../chunks/close-Bg0kqvrY.js`),require(`../chunks/text-Cpl5ljSe.js`),e.a({name:`info`,viewBox:`0 0 24 24`,path:`M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`,strokeLinecap:`round`,strokeLinejoin:`round`}),e.a({name:`success`,viewBox:`0 0 24 24`,path:`M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z`,strokeLinecap:`round`,strokeLinejoin:`round`}),e.a({name:`warning`,viewBox:`0 0 24 24`,path:`M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z`,strokeLinecap:`round`,strokeLinejoin:`round`}),e.a({name:`error`,viewBox:`0 0 24 24`,path:`M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z`,strokeLinecap:`round`,strokeLinejoin:`round`});var n=class extends HTMLElement{static get observedAttributes(){return[`heading`,`dismissable`,`tone`]}constructor(){super(),this._headingElement=null,this._iconElement=null,this._dismissButton=null,this._headerWrapper=null,this._bodyWrapper=null,this._dismissHandler=null,this._rendering=!1,this._childObserver=null,this._normalizingChildren=!1}connectedCallback(){this.render()}disconnectedCallback(){this._childObserver?.disconnect(),this._dismissButton?.removeEventListener(`click`,this._dismissHandler),this._dismissHandler=null}get heading(){return this.getAttribute(`heading`)??``}set heading(e){this.setAttribute(`heading`,String(e??``))}get tone(){return this.getTone()}set tone(e){this.setAttribute(`tone`,e)}get dismissable(){return this.isDismissable()}set dismissable(e){this.setAttribute(`dismissable`,String(!!e))}get dismissible(){return this.dismissable}set dismissible(e){this.dismissable=e}cleanupDismissListener(){this._dismissButton&&this._dismissHandler&&this._dismissButton.removeEventListener(`click`,this._dismissHandler),this._dismissHandler=null}attributeChangedCallback(e,t,n){t!==n&&this.render()}getHeading(){return this.getAttribute(`heading`)||``}getTone(){let e=this.getAttribute(`tone`);return e===`info`||e===`success`||e===`warning`||e===`danger`?e:`info`}isDismissable(){return this.getAttribute(`dismissable`)===`true`}getIconName(){switch(this.getTone()){case`info`:return`info`;case`success`:return`success`;case`warning`:return`warning`;case`danger`:return`error`;default:return`info`}}getAriaLive(){return this.getTone()===`danger`?`assertive`:`polite`}render(){if(!(this._rendering||!this.isConnected)){this._rendering=!0;try{this.renderContent()}finally{this._rendering=!1}}}renderContent(){this._childObserver?.disconnect();let e=this.getTone(),t=this.getHeading(),n=this.isDismissable(),r=this.getAriaLive();this.setAttribute(`role`,e===`danger`?`alert`:`status`),this.setAttribute(`aria-live`,r),e===`danger`?this.setAttribute(`aria-atomic`,`true`):this.removeAttribute(`aria-atomic`);let i=[];for(this._bodyWrapper?Array.from(this._bodyWrapper.childNodes).forEach(e=>{i.push(e)}):Array.from(this.childNodes).forEach(e=>{e!==this._headerWrapper&&e!==this._bodyWrapper&&e!==this._iconElement&&e!==this._headingElement&&e!==this._dismissButton&&i.push(e)}),this.cleanupDismissListener();this.firstChild;)this.removeChild(this.firstChild);if(this._headerWrapper=null,this._bodyWrapper=null,this._iconElement=null,this._headingElement=null,this._dismissButton=null,this._headerWrapper=document.createElement(`div`),this._headerWrapper.className=`mint-alert-header`,this._iconElement=document.createElement(`mint-icon`),this._iconElement.setAttribute(`name`,this.getIconName()),this._iconElement.className=`mint-alert-icon`,this._headerWrapper.appendChild(this._iconElement),this._headingElement=document.createElement(`mint-text`),this._headingElement.className=`mint-alert-heading`,this._headingElement.textContent=t||``,this._headerWrapper.appendChild(this._headingElement),n){this._dismissButton=document.createElement(`button`),this._dismissButton.className=`mint-alert-dismiss`,this._dismissButton.setAttribute(`aria-label`,`Dismiss alert`),this._dismissButton.setAttribute(`type`,`button`);let e=document.createElement(`mint-icon`);e.setAttribute(`name`,`close`),e.className=`mint-alert-close-icon`,this._dismissButton.appendChild(e),this._dismissHandler=e=>{e.preventDefault(),e.stopPropagation(),this.dispatchEvent(new CustomEvent(`dismissed`,{bubbles:!0,composed:!0})),this.remove()},this._dismissButton.addEventListener(`click`,this._dismissHandler),this._headerWrapper.appendChild(this._dismissButton)}this._bodyWrapper=document.createElement(`div`),this._bodyWrapper.className=`mint-alert-body`,i.forEach(e=>{this._bodyWrapper.appendChild(e)}),this.appendChild(this._headerWrapper),this.appendChild(this._bodyWrapper),this._childObserver||=new MutationObserver(()=>this.normalizeConsumerChildren()),this._childObserver.observe(this,{childList:!0})}normalizeConsumerChildren(){if(!(this._normalizingChildren||!this._bodyWrapper)){this._normalizingChildren=!0;try{Array.from(this.childNodes).forEach(e=>{e!==this._headerWrapper&&e!==this._bodyWrapper&&this._bodyWrapper.appendChild(e)})}finally{this._normalizingChildren=!1}}}};customElements.get(`mint-alert`)||t.t(`mint-alert`,n),module.exports=n;
@@ -6,7 +6,7 @@ import { a as e } from "../chunks/icon-B01tq_aJ.js";
6
6
  import { t } from "../chunks/register-element-BFYmIynH.js";
7
7
  import "../chunks/icon-DNWs0suS.js";
8
8
  import "../chunks/close-y8q0rMSE.js";
9
- import "../chunks/text-BHkEs8U5.js";
9
+ import "../chunks/text-Bmfl6CxJ.js";
10
10
  e({
11
11
  name: "info",
12
12
  viewBox: "0 0 24 24",
@@ -358,12 +358,14 @@ var t = class e extends HTMLElement {
358
358
  let e = document.createElement("canvas").getContext("2d");
359
359
  if (!e) return 60;
360
360
  e.font = "12px system-ui, -apple-system, sans-serif";
361
- let t = this._showLegend ? Math.max(this._legendHeight, 60) : 0, n = this._height - t, r = Math.floor(n / 35), i = Math.min(5, r), a = 0;
361
+ let t = this._showLegend ? Math.max(this._legendHeight, 60) : 0, n = this._height - t, r = Math.floor(n / 35), i = Math.max(1, Math.min(5, r)), a = this._getYRange();
362
+ if (this._hasOnlyZeroValues()) return Math.ceil(e.measureText(this._formatYAxisValue(0)).width) + 20;
363
+ let o = 0;
362
364
  for (let t = 0; t <= i; t++) {
363
- let n = this._getYRange(), r = n.max - (n.max - n.min) / i * t, o = this._formatYAxisValue(r), s = e.measureText(o);
364
- a = Math.max(a, s.width);
365
+ let n = a.max - (a.max - a.min) / i * t, r = this._formatYAxisValue(n), s = e.measureText(r);
366
+ o = Math.max(o, s.width);
365
367
  }
366
- return Math.ceil(a) + 20;
368
+ return Math.ceil(o) + 20;
367
369
  }
368
370
  _getChartBounds() {
369
371
  let e = this._calculateMaxYAxisLabelWidth(), t = `${this._width}-${this._height}-${this._showGrid}-${this._showLegend}-${this._legendHeight}-${e}-${this._rotatedLabelHeight}`;
@@ -398,6 +400,10 @@ var t = class e extends HTMLElement {
398
400
  this._isDatasetVisible(t, n) && e.push(...t.data);
399
401
  }), e;
400
402
  }
403
+ _hasOnlyZeroValues() {
404
+ let e = this._getAllDataPoints();
405
+ return e.length > 0 && e.every((e) => e.y === 0);
406
+ }
401
407
  _getXValues() {
402
408
  if (!this._chartData) return [];
403
409
  let e = JSON.stringify(this._chartData.labels) + JSON.stringify(this._chartData.datasets.map((e) => e.data.map((e) => e.x)));
@@ -766,7 +772,7 @@ var t = class e extends HTMLElement {
766
772
  }
767
773
  _scaleY(e, t) {
768
774
  let n = this._getYRange();
769
- if (n.max === n.min) return t.y + t.height / 2;
775
+ if (n.max === n.min) return n.min === 0 ? t.y + t.height : t.y + t.height / 2;
770
776
  let r = (e - n.min) / (n.max - n.min);
771
777
  return t.y + t.height - r * t.height;
772
778
  }
@@ -813,116 +819,117 @@ var t = class e extends HTMLElement {
813
819
  }
814
820
  }
815
821
  _renderGrid(e) {
816
- if (!this._svg || !this._showGrid) return;
817
- let t = document.createElementNS("http://www.w3.org/2000/svg", "g");
818
- t.setAttribute("class", "chart-grid");
819
- let n = this._getYRange(), r = Math.floor(e.height / 35), i = Math.min(5, r);
820
- for (let r = 0; r <= i; r++) {
821
- let a = e.y + e.height / i * r, o = document.createElementNS("http://www.w3.org/2000/svg", "line");
822
- o.setAttribute("x1", e.x.toString()), o.setAttribute("y1", a.toString()), o.setAttribute("x2", (e.x + e.width).toString()), o.setAttribute("y2", a.toString()), o.setAttribute("stroke", "#e5e7eb"), o.setAttribute("stroke-width", "1"), o.setAttribute("stroke-dasharray", "2,2"), document.documentElement.classList.contains("dark") && o.setAttribute("stroke", "#374151"), t.appendChild(o);
823
- let s = n.max - (n.max - n.min) / i * r, c = document.createElementNS("http://www.w3.org/2000/svg", "text"), l = a + 4;
824
- r === 0 && (l = a + 12), c.setAttribute("x", "5"), c.setAttribute("y", l.toString()), c.setAttribute("text-anchor", "start"), c.setAttribute("fill", "#6b7280"), c.setAttribute("font-size", "12"), c.textContent = this._formatYAxisValue(s), document.documentElement.classList.contains("dark") && c.setAttribute("fill", "#9ca3af"), t.appendChild(c);
822
+ let t = this._chartType !== "pie" && this._hasOnlyZeroValues();
823
+ if (!this._svg || !this._showGrid && !t) return;
824
+ let n = document.createElementNS("http://www.w3.org/2000/svg", "g");
825
+ n.setAttribute("class", "chart-grid");
826
+ let r = this._getYRange(), i = Math.floor(e.height / 35), a = t ? 0 : Math.max(1, Math.min(5, i));
827
+ for (let i = 0; i <= a; i++) {
828
+ let o = t ? e.y + e.height : e.y + e.height / a * i, s = document.createElementNS("http://www.w3.org/2000/svg", "line");
829
+ if (s.setAttribute("x1", e.x.toString()), s.setAttribute("y1", o.toString()), s.setAttribute("x2", (e.x + e.width).toString()), s.setAttribute("y2", o.toString()), s.setAttribute("stroke", t ? "#9ca3af" : "#e5e7eb"), s.setAttribute("stroke-width", "1"), t || s.setAttribute("stroke-dasharray", "2,2"), document.documentElement.classList.contains("dark") && s.setAttribute("stroke", "#374151"), n.appendChild(s), t && !this._showGrid) continue;
830
+ let c = t ? 0 : r.max - (r.max - r.min) / a * i, l = document.createElementNS("http://www.w3.org/2000/svg", "text"), u = o + 4;
831
+ i === 0 && (u = o + 12), l.setAttribute("x", "5"), l.setAttribute("y", u.toString()), l.setAttribute("text-anchor", "start"), l.setAttribute("fill", "#6b7280"), l.setAttribute("font-size", "12"), l.textContent = this._formatYAxisValue(c), document.documentElement.classList.contains("dark") && l.setAttribute("fill", "#9ca3af"), n.appendChild(l);
825
832
  }
826
- let a = this._getXValues();
827
- if (a.length === 0) {
828
- this._svg.appendChild(t);
833
+ let o = this._getXValues();
834
+ if (o.length === 0) {
835
+ this._svg.appendChild(n);
829
836
  return;
830
837
  }
831
- let o = this._chartType === "bar", s = [];
832
- a.forEach((t) => {
833
- let n = o ? this._scaleXForBarChart(t, e) : this._scaleX(t, e);
834
- s.push(n);
838
+ let s = this._chartType === "bar", c = [];
839
+ o.forEach((t) => {
840
+ let n = s ? this._scaleXForBarChart(t, e) : this._scaleX(t, e);
841
+ c.push(n);
835
842
  });
836
- let c = document.createElement("canvas").getContext("2d"), l = !1, u = Array(a.length).fill(!0);
837
- if (c && a.length > 1) {
838
- c.font = "12px system-ui, -apple-system, sans-serif";
843
+ let l = document.createElement("canvas").getContext("2d"), u = !1, d = Array(o.length).fill(!0);
844
+ if (l && o.length > 1) {
845
+ l.font = "12px system-ui, -apple-system, sans-serif";
839
846
  let e = [];
840
- a.forEach((t) => {
841
- let n = this._formatXAxisValue(t), r = c.measureText(n);
847
+ o.forEach((t) => {
848
+ let n = this._formatXAxisValue(t), r = l.measureText(n);
842
849
  e.push(r.width);
843
850
  });
844
851
  let t = !0;
845
- for (let n = 1; n < a.length; n++) {
846
- let r = s[n] - s[n - 1], i = e[n - 1] / 2 + e[n] / 2 + 10;
852
+ for (let n = 1; n < o.length; n++) {
853
+ let r = c[n] - c[n - 1], i = e[n - 1] / 2 + e[n] / 2 + 10;
847
854
  if (r < Math.max(i, 80)) {
848
855
  t = !1;
849
856
  break;
850
857
  }
851
858
  }
852
859
  if (!t) {
853
- l = !0;
860
+ u = !0;
854
861
  let t = 12 * 1.2;
855
862
  if (this._rotatedLabelHeight === 0) {
856
863
  let n = (Math.max(...e) + t) * .707;
857
864
  this._rotatedLabelHeight = Math.ceil(n) + 10;
858
865
  }
859
866
  let n = t * 1.5, r = !0;
860
- for (let e = 1; e < a.length; e++) if (s[e] - s[e - 1] < n) {
867
+ for (let e = 1; e < o.length; e++) if (c[e] - c[e - 1] < n) {
861
868
  r = !1;
862
869
  break;
863
870
  }
864
871
  if (!r) {
865
872
  let e = n;
866
- u = Array(a.length).fill(!1);
873
+ d = Array(o.length).fill(!1);
867
874
  let t = -Infinity;
868
- a.length > 0 && (u[0] = !0, t = s[0]);
869
- for (let n = 1; n < a.length - 1; n++) {
870
- let r = s[n];
871
- r - t >= e && (u[n] = !0, t = r);
875
+ o.length > 0 && (d[0] = !0, t = c[0]);
876
+ for (let n = 1; n < o.length - 1; n++) {
877
+ let r = c[n];
878
+ r - t >= e && (d[n] = !0, t = r);
872
879
  }
873
- if (a.length > 1) {
874
- let n = s[a.length - 1];
875
- if (n - t >= e) u[a.length - 1] = !0;
880
+ if (o.length > 1) {
881
+ let n = c[o.length - 1];
882
+ if (n - t >= e) d[o.length - 1] = !0;
876
883
  else {
877
884
  for (; n - t < e;) {
878
885
  let e = !1;
879
- for (let n = a.length - 2; n >= 0; n--) if (u[n]) {
880
- if (u[n] = !1, n > 0) {
881
- for (let r = n - 1; r >= 0; r--) if (u[r]) {
882
- t = s[r], e = !0;
886
+ for (let n = o.length - 2; n >= 0; n--) if (d[n]) {
887
+ if (d[n] = !1, n > 0) {
888
+ for (let r = n - 1; r >= 0; r--) if (d[r]) {
889
+ t = c[r], e = !0;
883
890
  break;
884
891
  }
885
- e || (t = s[0]);
886
- } else t = s[0];
892
+ e || (t = c[0]);
893
+ } else t = c[0];
887
894
  e = !0;
888
895
  break;
889
896
  }
890
897
  if (!e) break;
891
898
  }
892
- n - t >= e && (u[a.length - 1] = !0);
899
+ n - t >= e && (d[o.length - 1] = !0);
893
900
  }
894
901
  }
895
902
  }
896
903
  }
897
- } else u = Array(a.length).fill(!1), a.length > 0 && (u[0] = !0), a.length > 1 && (u[a.length - 1] = !0), this._rotatedLabelHeight = 0;
898
- l || (this._rotatedLabelHeight = 0), a.forEach((n, r) => {
899
- if (u[r]) {
900
- let i = s[r], o = document.createElementNS("http://www.w3.org/2000/svg", "line");
901
- o.setAttribute("x1", i.toString()), o.setAttribute("y1", e.y.toString()), o.setAttribute("x2", i.toString()), o.setAttribute("y2", (e.y + e.height).toString()), o.setAttribute("stroke", "#e5e7eb"), o.setAttribute("stroke-width", "1"), o.setAttribute("stroke-dasharray", "2,2"), document.documentElement.classList.contains("dark") && o.setAttribute("stroke", "#374151"), t.appendChild(o);
902
- let c = document.createElementNS("http://www.w3.org/2000/svg", "text"), u = i, d = "middle";
903
- if (!l) {
904
+ } else d = Array(o.length).fill(!1), o.length > 0 && (d[0] = !0), o.length > 1 && (d[o.length - 1] = !0), this._rotatedLabelHeight = 0;
905
+ u || (this._rotatedLabelHeight = 0), o.forEach((t, r) => {
906
+ if (d[r]) {
907
+ let i = c[r], a = document.createElementNS("http://www.w3.org/2000/svg", "line");
908
+ a.setAttribute("x1", i.toString()), a.setAttribute("y1", e.y.toString()), a.setAttribute("x2", i.toString()), a.setAttribute("y2", (e.y + e.height).toString()), a.setAttribute("stroke", "#e5e7eb"), a.setAttribute("stroke-width", "1"), a.setAttribute("stroke-dasharray", "2,2"), document.documentElement.classList.contains("dark") && a.setAttribute("stroke", "#374151"), n.appendChild(a);
909
+ let s = document.createElementNS("http://www.w3.org/2000/svg", "text"), l = i, d = "middle";
910
+ if (!u) {
904
911
  if (r === 0) {
905
912
  let t = e.x;
906
- u = Math.max(i, t), d = "start";
907
- } else if (r === a.length - 1) {
913
+ l = Math.max(i, t), d = "start";
914
+ } else if (r === o.length - 1) {
908
915
  let t = e.x + e.width;
909
- u = Math.min(i, t), d = "end";
916
+ l = Math.min(i, t), d = "end";
910
917
  }
911
- } else if (d = "end", r === a.length - 1) {
912
- let t = document.createElement("canvas").getContext("2d");
913
- if (t) {
914
- t.font = "12px system-ui, -apple-system, sans-serif";
915
- let r = this._formatXAxisValue(n), a = t.measureText(r).width * .707, o = e.x + e.width + 100;
916
- u = Math.min(i, o - a);
918
+ } else if (d = "end", r === o.length - 1) {
919
+ let n = document.createElement("canvas").getContext("2d");
920
+ if (n) {
921
+ n.font = "12px system-ui, -apple-system, sans-serif";
922
+ let r = this._formatXAxisValue(t), a = n.measureText(r).width * .707, o = e.x + e.width + 100;
923
+ l = Math.min(i, o - a);
917
924
  }
918
925
  }
919
- c.setAttribute("x", u.toString());
926
+ s.setAttribute("x", l.toString());
920
927
  let f = (this._rotatedLabelHeight > 0 ? 30 : 20) + this._rotatedLabelHeight + 12, p = f;
921
928
  this._showLegend && (p = f + 20 + Math.max(this._legendHeight, 60));
922
- let m = (this._height - e.y - e.height) / p, h = (l ? 30 : 20) * m, g = e.y + e.height + h;
923
- c.setAttribute("y", g.toString()), c.setAttribute("text-anchor", d), c.setAttribute("fill", "#6b7280"), c.setAttribute("font-size", "12"), l && c.setAttribute("transform", `rotate(-45 ${u} ${g})`), c.textContent = this._formatXAxisValue(n), document.documentElement.classList.contains("dark") && c.setAttribute("fill", "#9ca3af"), t.appendChild(c);
929
+ let m = (this._height - e.y - e.height) / p, h = (u ? 30 : 20) * m, g = e.y + e.height + h;
930
+ s.setAttribute("y", g.toString()), s.setAttribute("text-anchor", d), s.setAttribute("fill", "#6b7280"), s.setAttribute("font-size", "12"), u && s.setAttribute("transform", `rotate(-45 ${l} ${g})`), s.textContent = this._formatXAxisValue(t), document.documentElement.classList.contains("dark") && s.setAttribute("fill", "#9ca3af"), n.appendChild(s);
924
931
  }
925
- }), this._svg.appendChild(t);
932
+ }), this._svg.appendChild(n);
926
933
  }
927
934
  _buildMonotoneXLinePathD(e) {
928
935
  let t = (e) => e < 0 ? -1 : 1, n = (e, n, r, i, a, o) => {
@@ -991,26 +998,26 @@ var t = class e extends HTMLElement {
991
998
  }
992
999
  _renderLineChart() {
993
1000
  if (!this._svg || !this._chartData) return;
994
- let e = this._getChartBounds();
1001
+ let e = this._getChartBounds(), t = this._hasOnlyZeroValues();
995
1002
  this._renderGrid(e);
996
- let t = document.createElementNS("http://www.w3.org/2000/svg", "g");
997
- t.setAttribute("class", "chart-data");
998
- let n = document.createDocumentFragment();
999
- this._chartData.datasets.forEach((t, r) => {
1000
- if (!this._isDatasetVisible(t, r)) return;
1001
- let i = this._getDatasetColor(t, r), a = document.createElementNS("http://www.w3.org/2000/svg", "path"), o = t.data.map((t) => ({
1003
+ let n = document.createElementNS("http://www.w3.org/2000/svg", "g");
1004
+ n.setAttribute("class", "chart-data");
1005
+ let r = document.createDocumentFragment();
1006
+ this._chartData.datasets.forEach((n, i) => {
1007
+ if (!this._isDatasetVisible(n, i)) return;
1008
+ let a = this._getDatasetColor(n, i), o = document.createElementNS("http://www.w3.org/2000/svg", "path"), s = n.data.map((t) => ({
1002
1009
  x: this._scaleX(t.x, e),
1003
1010
  y: this._scaleY(t.y, e)
1004
1011
  }));
1005
- o.length !== 0 && (a.setAttribute("d", this._buildSmoothLinePathD(o)), a.setAttribute("fill", "none"), a.setAttribute("stroke", i), a.setAttribute("stroke-width", "2"), a.setAttribute("stroke-linecap", "round"), a.setAttribute("stroke-linejoin", "round"), n.appendChild(a), t.data.forEach((a) => {
1006
- let o = document.createElementNS("http://www.w3.org/2000/svg", "circle"), s = this._scaleX(a.x, e), c = this._scaleY(a.y, e);
1007
- o.setAttribute("cx", s.toString()), o.setAttribute("cy", c.toString()), o.setAttribute("r", "4"), o.setAttribute("fill", i);
1012
+ s.length !== 0 && (t || (o.setAttribute("d", this._buildSmoothLinePathD(s)), o.setAttribute("fill", "none"), o.setAttribute("stroke", a), o.setAttribute("stroke-width", "2"), o.setAttribute("stroke-linecap", "round"), o.setAttribute("stroke-linejoin", "round"), r.appendChild(o)), n.data.forEach((t) => {
1013
+ let o = document.createElementNS("http://www.w3.org/2000/svg", "circle"), s = this._scaleX(t.x, e), c = this._scaleY(t.y, e);
1014
+ o.setAttribute("cx", s.toString()), o.setAttribute("cy", c.toString()), o.setAttribute("r", "4"), o.setAttribute("fill", a);
1008
1015
  let l = document.documentElement.classList.contains("dark");
1009
- o.setAttribute("stroke", l ? "#1f2937" : "#fff"), o.setAttribute("stroke-width", "2"), o.setAttribute("class", "chart-point"), o.setAttribute("data-dataset", r.toString()), o.setAttribute("data-x", String(a.x)), o.setAttribute("data-y", a.y.toString()), o.setAttribute("data-name", t.name), o.style.opacity = "0", o.style.pointerEvents = "none";
1010
- let u = String(a.x);
1011
- this._plotPoints.has(u) || this._plotPoints.set(u, []), this._plotPoints.get(u).push(o), n.appendChild(o);
1016
+ o.setAttribute("stroke", l ? "#1f2937" : "#fff"), o.setAttribute("stroke-width", "2"), o.setAttribute("class", "chart-point"), o.setAttribute("data-dataset", i.toString()), o.setAttribute("data-x", String(t.x)), o.setAttribute("data-y", t.y.toString()), o.setAttribute("data-name", n.name), o.style.opacity = "0", o.style.pointerEvents = "none";
1017
+ let u = String(t.x);
1018
+ this._plotPoints.has(u) || this._plotPoints.set(u, []), this._plotPoints.get(u).push(o), r.appendChild(o);
1012
1019
  }));
1013
- }), t.appendChild(n), this._svg.appendChild(t);
1020
+ }), n.appendChild(r), this._svg.appendChild(n);
1014
1021
  }
1015
1022
  _scaleXForBarChart(e, t) {
1016
1023
  let n = this._getXValues();
@@ -1063,30 +1070,34 @@ var t = class e extends HTMLElement {
1063
1070
  }
1064
1071
  _renderAreaChart() {
1065
1072
  if (!this._svg || !this._chartData) return;
1066
- let e = this._getChartBounds();
1073
+ let e = this._getChartBounds(), t = this._hasOnlyZeroValues();
1067
1074
  this._renderGrid(e);
1068
- let t = document.createElementNS("http://www.w3.org/2000/svg", "g");
1069
- t.setAttribute("class", "chart-data");
1070
- let n = document.createDocumentFragment();
1071
- this._chartData.datasets.forEach((t, r) => {
1072
- if (!this._isDatasetVisible(t, r)) return;
1073
- let i = this._getDatasetColor(t, r), a = t.data.map((t) => ({
1075
+ let n = document.createElementNS("http://www.w3.org/2000/svg", "g");
1076
+ n.setAttribute("class", "chart-data");
1077
+ let r = document.createDocumentFragment();
1078
+ this._chartData.datasets.forEach((n, i) => {
1079
+ if (!this._isDatasetVisible(n, i)) return;
1080
+ let a = this._getDatasetColor(n, i), o = n.data.map((t) => ({
1074
1081
  x: this._scaleX(t.x, e),
1075
1082
  y: this._scaleY(t.y, e)
1076
1083
  }));
1077
- if (a.length === 0) return;
1078
- let o = e.y + e.height, s = document.createElementNS("http://www.w3.org/2000/svg", "path");
1079
- s.setAttribute("d", this._buildAreaFillPathD(a, o)), s.setAttribute("fill", i), s.setAttribute("fill-opacity", "0.3"), n.appendChild(s);
1080
- let c = document.createElementNS("http://www.w3.org/2000/svg", "path");
1081
- c.setAttribute("d", this._buildSmoothLinePathD(a)), c.setAttribute("fill", "none"), c.setAttribute("stroke", i), c.setAttribute("stroke-width", "2"), c.setAttribute("stroke-linecap", "round"), c.setAttribute("stroke-linejoin", "round"), n.appendChild(c), t.data.forEach((a) => {
1082
- let o = document.createElementNS("http://www.w3.org/2000/svg", "circle"), s = this._scaleX(a.x, e), c = this._scaleY(a.y, e);
1083
- o.setAttribute("cx", s.toString()), o.setAttribute("cy", c.toString()), o.setAttribute("r", "4"), o.setAttribute("fill", i);
1084
- let l = document.documentElement.classList.contains("dark");
1085
- o.setAttribute("stroke", l ? "#1f2937" : "#fff"), o.setAttribute("stroke-width", "2"), o.setAttribute("class", "chart-point"), o.setAttribute("data-dataset", r.toString()), o.setAttribute("data-x", String(a.x)), o.setAttribute("data-y", a.y.toString()), o.setAttribute("data-name", t.name), o.style.opacity = "0", o.style.pointerEvents = "none";
1086
- let u = String(a.x);
1087
- this._plotPoints.has(u) || this._plotPoints.set(u, []), this._plotPoints.get(u).push(o), n.appendChild(o);
1088
- });
1089
- }), t.appendChild(n), this._svg.appendChild(t);
1084
+ if (o.length !== 0) {
1085
+ if (!t) {
1086
+ let t = e.y + e.height, n = document.createElementNS("http://www.w3.org/2000/svg", "path");
1087
+ n.setAttribute("d", this._buildAreaFillPathD(o, t)), n.setAttribute("fill", a), n.setAttribute("fill-opacity", "0.3"), r.appendChild(n);
1088
+ let i = document.createElementNS("http://www.w3.org/2000/svg", "path");
1089
+ i.setAttribute("d", this._buildSmoothLinePathD(o)), i.setAttribute("fill", "none"), i.setAttribute("stroke", a), i.setAttribute("stroke-width", "2"), i.setAttribute("stroke-linecap", "round"), i.setAttribute("stroke-linejoin", "round"), r.appendChild(i);
1090
+ }
1091
+ n.data.forEach((t) => {
1092
+ let o = document.createElementNS("http://www.w3.org/2000/svg", "circle"), s = this._scaleX(t.x, e), c = this._scaleY(t.y, e);
1093
+ o.setAttribute("cx", s.toString()), o.setAttribute("cy", c.toString()), o.setAttribute("r", "4"), o.setAttribute("fill", a);
1094
+ let l = document.documentElement.classList.contains("dark");
1095
+ o.setAttribute("stroke", l ? "#1f2937" : "#fff"), o.setAttribute("stroke-width", "2"), o.setAttribute("class", "chart-point"), o.setAttribute("data-dataset", i.toString()), o.setAttribute("data-x", String(t.x)), o.setAttribute("data-y", t.y.toString()), o.setAttribute("data-name", n.name), o.style.opacity = "0", o.style.pointerEvents = "none";
1096
+ let u = String(t.x);
1097
+ this._plotPoints.has(u) || this._plotPoints.set(u, []), this._plotPoints.get(u).push(o), r.appendChild(o);
1098
+ });
1099
+ }
1100
+ }), n.appendChild(r), this._svg.appendChild(n);
1090
1101
  }
1091
1102
  _renderPieChart() {
1092
1103
  if (!this._svg || !this._chartData) return;