monobill-mintui 0.6.618 → 0.6.620
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.
- package/dist/components/alert/browser.js +3 -3
- package/dist/components/alert/index.cjs +1 -1
- package/dist/components/alert/index.js +3 -3
- package/dist/components/back-button/browser.js +2 -2
- package/dist/components/back-button/index.cjs +1 -1
- package/dist/components/back-button/index.js +2 -2
- package/dist/components/bottom-navigation/browser.js +2 -2
- package/dist/components/bottom-navigation/index.cjs +1 -1
- package/dist/components/bottom-navigation/index.js +2 -2
- package/dist/components/button/browser.js +1 -1
- package/dist/components/button/index.cjs +1 -1
- package/dist/components/button/index.js +1 -1
- package/dist/components/chart/browser.js +110 -99
- package/dist/components/chart/index.cjs +3 -3
- package/dist/components/chart/index.js +110 -99
- package/dist/components/checkbox/browser.js +2 -2
- package/dist/components/checkbox/index.cjs +1 -1
- package/dist/components/checkbox/index.js +2 -2
- package/dist/components/chip/browser.js +1 -1
- package/dist/components/chip/index.cjs +1 -1
- package/dist/components/chip/index.js +1 -1
- package/dist/components/chunks/{button-BZ25puI2.js → button-BYQbRAwl.js} +2 -2
- package/dist/components/chunks/{button-CgYC1lB7.js → button-DbxqmBWQ.js} +1 -1
- package/dist/components/chunks/caret-down-CeADWana.js +1 -0
- package/dist/components/chunks/{caret-down-CDGP3GB2.js → caret-down-DD9Ie5js.js} +1 -1
- package/dist/components/chunks/caret-right-3V_JDnOP.js +1 -0
- package/dist/components/chunks/{caret-right-CQ5hBjsy.js → caret-right-fnCcTJKp.js} +1 -1
- package/dist/components/chunks/{caret-up-1paz-pnI.js → caret-up-CK7JOG6X.js} +1 -1
- package/dist/components/chunks/caret-up-hwsMK8n3.js +1 -0
- package/dist/components/chunks/{chip-p6RXdzHa.js → chip-08aR26vc.js} +3 -3
- package/dist/components/chunks/{chip-Bb1Epj5C.js → chip-8BYSJ7yI.js} +1 -1
- package/dist/components/chunks/close-BdZJfr6m.js +1 -0
- package/dist/components/chunks/{close-y8q0rMSE.js → close-CFxX3WCG.js} +1 -1
- package/dist/components/chunks/icon-B8p3Co0-.js +1 -0
- package/dist/components/chunks/{icon-B01tq_aJ.js → icon-BWUYe89V.js} +4 -3
- package/dist/components/chunks/{icon-BcsWL4kZ.js → icon-B_7c8b8e.js} +1 -1
- package/dist/components/chunks/icon-CSqBgTae.js +1 -0
- package/dist/components/chunks/{input-BzrCXBg4.js → input-Dwrs8tJH.js} +4 -4
- package/dist/components/chunks/{input-DnVgj6QV.js → input-lLl8cB6r.js} +1 -1
- package/dist/components/chunks/{modal-9S-FF3_o.js → modal-CNBmdA63.js} +1 -1
- package/dist/components/chunks/{modal-D7KKb4f9.js → modal-CPcIPIO7.js} +2 -2
- package/dist/components/chunks/search-Bsaoxa30.js +1 -0
- package/dist/components/chunks/{search-Dd28O4mG.js → search-xHKqAXph.js} +1 -1
- package/dist/components/confirm-action/browser.js +2 -2
- package/dist/components/confirm-action/index.cjs +1 -1
- package/dist/components/confirm-action/index.js +2 -2
- package/dist/components/date-picker/browser.js +4 -4
- package/dist/components/date-picker/index.cjs +1 -1
- package/dist/components/date-picker/index.js +4 -4
- package/dist/components/dropzone/browser.js +3 -3
- package/dist/components/dropzone/index.cjs +1 -1
- package/dist/components/dropzone/index.js +3 -3
- package/dist/components/icon/browser.js +1 -1
- package/dist/components/icon/index.cjs +1 -1
- package/dist/components/icon/index.js +1 -1
- package/dist/components/input/browser.js +1 -1
- package/dist/components/input/index.cjs +1 -1
- package/dist/components/input/index.js +1 -1
- package/dist/components/modal/browser.js +1 -1
- package/dist/components/modal/index.cjs +1 -1
- package/dist/components/modal/index.js +1 -1
- package/dist/components/navigation/browser.js +2 -2
- package/dist/components/navigation/index.cjs +1 -1
- package/dist/components/navigation/index.js +2 -2
- package/dist/components/off-canvas/browser.js +2 -2
- package/dist/components/off-canvas/index.cjs +1 -1
- package/dist/components/off-canvas/index.js +2 -2
- package/dist/components/resource-table/browser.js +7 -7
- package/dist/components/resource-table/index.cjs +1 -1
- package/dist/components/resource-table/index.js +7 -7
- package/dist/components/search/browser.js +7 -7
- package/dist/components/search/index.cjs +1 -1
- package/dist/components/search/index.js +7 -7
- package/dist/components/select/browser.js +4 -4
- package/dist/components/select/index.cjs +1 -1
- package/dist/components/select/index.js +4 -4
- package/dist/components/side-navigation/browser.js +4 -4
- package/dist/components/side-navigation/index.cjs +1 -1
- package/dist/components/side-navigation/index.js +4 -4
- package/dist/components/switch/browser.js +2 -2
- package/dist/components/switch/index.cjs +1 -1
- package/dist/components/switch/index.js +2 -2
- package/dist/components/tags/browser.js +3 -3
- package/dist/components/tags/index.cjs +1 -1
- package/dist/components/tags/index.js +3 -3
- package/dist/components/time-picker/browser.js +2 -2
- package/dist/components/time-picker/index.cjs +1 -1
- package/dist/components/time-picker/index.js +2 -2
- package/dist/icons/pin.svg +1 -3
- package/dist/index.cjs +4 -4
- package/dist/index.css +1 -1
- package/dist/index.js +115 -103
- package/dist/input.css +1 -1
- package/package.json +1 -1
- package/dist/components/chunks/caret-down-C5a1fGvt.js +0 -1
- package/dist/components/chunks/caret-right-BMyWflHN.js +0 -1
- package/dist/components/chunks/caret-up-BJAyfrty.js +0 -1
- package/dist/components/chunks/close-Bg0kqvrY.js +0 -1
- package/dist/components/chunks/icon-DNWs0suS.js +0 -1
- package/dist/components/chunks/icon-uMo_iGkX.js +0 -1
- package/dist/components/chunks/search-C5jD2OC-.js +0 -1
|
@@ -14,10 +14,10 @@ __mintLoadStyle('theme', '../../theme.css')
|
|
|
14
14
|
__mintLoadStyle('text', '../../text.css')
|
|
15
15
|
__mintLoadStyle('icon', '../../icon.css')
|
|
16
16
|
__mintLoadStyle('alert', '../../alert.css')
|
|
17
|
-
import { a as e } from "../chunks/icon-
|
|
17
|
+
import { a as e } from "../chunks/icon-BWUYe89V.js";
|
|
18
18
|
import { t } from "../chunks/register-element-BFYmIynH.js";
|
|
19
|
-
import "../chunks/icon-
|
|
20
|
-
import "../chunks/close-
|
|
19
|
+
import "../chunks/icon-B8p3Co0-.js";
|
|
20
|
+
import "../chunks/close-CFxX3WCG.js";
|
|
21
21
|
import "../chunks/text-Bmfl6CxJ.js";
|
|
22
22
|
e({
|
|
23
23
|
name: "info",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../chunks/icon-
|
|
1
|
+
const e=require(`../chunks/icon-B_7c8b8e.js`),t=require(`../chunks/register-element-tCL_F1YI.js`);require(`../chunks/icon-CSqBgTae.js`),require(`../chunks/close-BdZJfr6m.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;
|
|
@@ -2,10 +2,10 @@ import '../../theme.css'
|
|
|
2
2
|
import '../../text.css'
|
|
3
3
|
import '../../icon.css'
|
|
4
4
|
import '../../alert.css'
|
|
5
|
-
import { a as e } from "../chunks/icon-
|
|
5
|
+
import { a as e } from "../chunks/icon-BWUYe89V.js";
|
|
6
6
|
import { t } from "../chunks/register-element-BFYmIynH.js";
|
|
7
|
-
import "../chunks/icon-
|
|
8
|
-
import "../chunks/close-
|
|
7
|
+
import "../chunks/icon-B8p3Co0-.js";
|
|
8
|
+
import "../chunks/close-CFxX3WCG.js";
|
|
9
9
|
import "../chunks/text-Bmfl6CxJ.js";
|
|
10
10
|
e({
|
|
11
11
|
name: "info",
|
|
@@ -15,9 +15,9 @@ __mintLoadStyle('button', '../../button.css')
|
|
|
15
15
|
__mintLoadStyle('spinner', '../../spinner.css')
|
|
16
16
|
__mintLoadStyle('icon', '../../icon.css')
|
|
17
17
|
__mintLoadStyle('back-button', '../../back-button.css')
|
|
18
|
-
import { a as e } from "../chunks/icon-
|
|
18
|
+
import { a as e } from "../chunks/icon-BWUYe89V.js";
|
|
19
19
|
import { t } from "../chunks/register-element-BFYmIynH.js";
|
|
20
|
-
import "../chunks/icon-
|
|
20
|
+
import "../chunks/icon-B8p3Co0-.js";
|
|
21
21
|
/* empty css */
|
|
22
22
|
import "../chunks/spinner-BsaFHuS6.js";
|
|
23
23
|
e({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../chunks/icon-
|
|
1
|
+
const e=require(`../chunks/icon-B_7c8b8e.js`),t=require(`../chunks/register-element-tCL_F1YI.js`);require(`../chunks/icon-CSqBgTae.js`),/* empty css */require(`../chunks/spinner-DbTohC6i.js`),e.a({name:`arrow-left`,viewBox:`0 0 24 24`,path:`M19 12H5m7-7l-7 7 7 7`,strokeLinecap:`round`,strokeLinejoin:`round`});var n=class extends HTMLElement{static get observedAttributes(){return[`variant`,`tone`,`disabled`,`loading`,`button-type`,`type`,`full-width`,`icon-position`,`icon`]}constructor(){super(),this._button=null,this._clickHandler=null,this._isHandlingClick=!1}connectedCallback(){this.render(),this._button&&this.setupEventListeners()}disconnectedCallback(){this.removeEventListeners()}attributeChangedCallback(e,t,n){t!==n&&this.render()}getVariant(){return this.getAttribute(`variant`)||`solid`}getTone(){return this.getAttribute(`tone`)||`neutral`}isDisabled(){return this.hasAttribute(`disabled`)}isLoading(){return this.hasAttribute(`loading`)}getType(){return(this.getAttribute(`type`)||this.getAttribute(`button-type`)||`default`)===`submit`?`submit`:`button`}isFullWidth(){return this.hasAttribute(`full-width`)}getIconPosition(){return this.getAttribute(`icon-position`)||`left`}getIcon(){return this.getAttribute(`icon`)||``}isIconOnly(){if(!(this.getIcon()||this._button?.querySelector(`[slot="icon"], .mint-button-icon, mint-icon`)))return!1;let e=this._button?.querySelector(`.mint-button-content`);if(e&&e.textContent.trim())return!1;if(this._button){for(let e=this._button.firstChild;e;e=e.nextSibling)if(e.nodeType===Node.TEXT_NODE&&e.textContent.trim()||e.nodeType===Node.ELEMENT_NODE&&e.tagName!==`MINT-ICON`&&e.tagName!==`MINT-SPINNER`&&!e.querySelector?.(`mint-spinner`)&&!e.hasAttribute?.(`slot`)&&e.className!==`mint-button-icon`&&!(e.className===`mr-2`&&e.querySelector(`mint-spinner`))&&e.textContent.trim())return!1}return!0}getButtonClasses(){return[`mint-button-core`,`mint-button-`+this.getVariant(),`mint-button-tone-`+this.getTone(),this.isIconOnly()?`mint-button-icon-only`:``,this.isFullWidth()?`mint-button-full-width`:``].filter(Boolean).join(` `)}render(){let e=this.isDisabled()||this.isLoading(),t=this.getType();if(!this._button){for(this._button=document.createElement(`button`);this.firstChild;)this._button.appendChild(this.firstChild);this.appendChild(this._button),this.setupEventListeners()}this._button.type=t,this._button.disabled=e;let n=this._button.querySelector(`mint-spinner`);if(this.isLoading())if(n)n.setAttribute(`data-button-variant`,this.getVariant()),n.setAttribute(`data-button-tone`,this.getTone()),n.render();else{let e=document.createElement(`span`);e.className=`mint-spinner-wrap`;let t=document.createElement(`mint-spinner`);t.setAttribute(`size`,`default`),t.setAttribute(`data-button-variant`,this.getVariant()),t.setAttribute(`data-button-tone`,this.getTone()),t.style.width=`0.875rem`,t.style.height=`0.875rem`,e.appendChild(t),this._button.insertBefore(e,this._button.firstChild)}else n&&n.parentElement?.remove();for(;this.firstChild&&this.firstChild!==this._button;)this._button.appendChild(this.firstChild);let r=this.getIcon(),i=this._button.querySelector(`[slot="icon"], .mint-button-icon, mint-icon`);r?(i&&i.tagName!==`MINT-ICON`&&(i.remove(),i=null),!i||i.tagName!==`MINT-ICON`?(i=document.createElement(`mint-icon`),i.setAttribute(`name`,r),i.className=`mint-button-icon`):i.setAttribute(`name`,r)):i&&i.tagName===`MINT-ICON`&&(i.remove(),i=null),i||=this._button.querySelector(`[slot="icon"], .mint-button-icon`);let a=this.getIconPosition(),o=this._button.querySelector(`.mint-button-content`);if(o){let e=i&&i.tagName===`MINT-ICON`;if(i&&!i.parentElement){let t=this._button.querySelector(`mint-spinner`)?.parentElement;e||a===`left`?t?t.insertAdjacentElement(`afterend`,i):this._button.insertBefore(i,o):o.insertAdjacentElement(`afterend`,i)}else if(i&&(e||a===`left`)&&i.nextSibling!==o){i.remove();let e=this._button.querySelector(`mint-spinner`)?.parentElement;e?e.insertAdjacentElement(`afterend`,i):this._button.insertBefore(i,o)}else i&&!e&&a===`right`&&i.previousSibling!==o&&(i.remove(),o.insertAdjacentElement(`afterend`,i))}else{let e=[];for(let t=this._button.firstChild;t;t=t.nextSibling)t.tagName!==`MINT-SPINNER`&&!t.querySelector?.(`mint-spinner`)&&t!==i&&!t.hasAttribute?.(`slot`)&&!(t.className===`mr-2`&&t.querySelector(`mint-spinner`))&&e.push(t);if(e.length>0){o=document.createElement(`span`),o.className=`mint-button-content`,e.forEach(e=>{o.appendChild(e)});let t=this._button.querySelector(`mint-spinner`)?.parentElement;i&&a===`left`?t?(t.insertAdjacentElement(`afterend`,i),i.insertAdjacentElement(`afterend`,o)):(this._button.insertBefore(i,this._button.firstChild),i.insertAdjacentElement(`afterend`,o)):i&&a===`right`?t?(t.insertAdjacentElement(`afterend`,o),o.insertAdjacentElement(`afterend`,i)):(this._button.insertBefore(o,this._button.firstChild),o.insertAdjacentElement(`afterend`,i)):t?t.insertAdjacentElement(`afterend`,o):this._button.insertBefore(o,this._button.firstChild)}else if(i&&i.tagName===`MINT-ICON`&&!i.parentElement){let e=this._button.querySelector(`mint-spinner`)?.parentElement;e?e.insertAdjacentElement(`afterend`,i):this._button.insertBefore(i,this._button.firstChild)}}let s=this.isIconOnly();i&&(i.classList.contains(`mint-button-icon`)||i.classList.add(`mint-button-icon`),i.classList.remove(`mint-icon-leading`,`mint-icon-trailing`),s?i.tagName===`MINT-ICON`?(i.style.width=`1rem`,i.style.height=`1rem`,i.style.maxWidth=`1rem`,i.style.maxHeight=`1rem`,i.style.flexShrink=`0`):(i.style.maxWidth=`1rem`,i.style.maxHeight=`1rem`,i.style.flexShrink=`0`,i.tagName===`svg`&&(i.style.width=`1rem`,i.style.height=`1rem`)):a===`left`?i.classList.add(`mint-icon-leading`):i.classList.add(`mint-icon-trailing`));let c=this.getButtonClasses();this._button.className=c}setupEventListeners(){this._button&&!this._clickHandler&&(this._clickHandler=this.handleClick.bind(this),this._button.addEventListener(`click`,this._clickHandler,!0),this._button.addEventListener(`mousedown`,this._handleMouseDown),this._button.addEventListener(`mouseup`,this._handleMouseUp),this._button.addEventListener(`mouseleave`,this._handleMouseLeave),this._button.addEventListener(`touchstart`,this._handleTouchStart),this._button.addEventListener(`touchend`,this._handleTouchEnd),this._button.addEventListener(`touchcancel`,this._handleTouchCancel))}removeEventListeners(){this._button&&(this._clickHandler&&=(this._button.removeEventListener(`click`,this._clickHandler,!0),null),this._button.removeEventListener(`mousedown`,this._handleMouseDown),this._button.removeEventListener(`mouseup`,this._handleMouseUp),this._button.removeEventListener(`mouseleave`,this._handleMouseLeave),this._button.removeEventListener(`touchstart`,this._handleTouchStart),this._button.removeEventListener(`touchend`,this._handleTouchEnd),this._button.removeEventListener(`touchcancel`,this._handleTouchCancel))}_handleMouseDown=()=>{this._button&&!this.isDisabled()&&!this.isLoading()&&this._button.classList.add(`mint-button-active`)};_handleMouseUp=()=>{this._button&&this._button.classList.remove(`mint-button-active`)};_handleMouseLeave=()=>{this._button&&this._button.classList.remove(`mint-button-active`)};_handleTouchStart=()=>{this._button&&!this.isDisabled()&&!this.isLoading()&&this._button.classList.add(`mint-button-active`)};_handleTouchEnd=()=>{this._button&&this._button.classList.remove(`mint-button-active`)};_handleTouchCancel=()=>{this._button&&this._button.classList.remove(`mint-button-active`)};handleClick(e){if(this.isDisabled()||this.isLoading()){e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();return}if(e.stopPropagation(),e.stopImmediatePropagation(),this._isHandlingClick){e.preventDefault();return}this._isHandlingClick=!0,e.preventDefault(),this.dispatchEvent(new CustomEvent(`click`,{detail:{originalEvent:e},bubbles:!0,cancelable:!0,composed:!0})),requestAnimationFrame(()=>{this._isHandlingClick=!1})}};typeof customElements<`u`&&!customElements.get(`mint-button`)&&t.t(`mint-button`,n);var r=class extends HTMLElement{static get observedAttributes(){return[`href`,`fallback-href`]}constructor(){super(),this._historyDepth=0,this._maxBackAttempts=10,this._backAttempts=0}connectedCallback(){this.render(),this._setupHistoryTracking()}attributeChangedCallback(e,t,n){t!==n&&this.render()}_setupHistoryTracking(){window.addEventListener(`popstate`,()=>{this._backAttempts=0}),this._historyDepth=window.history.length}getFallbackHref(){return this.getAttribute(`fallback-href`)||this.getAttribute(`href`)||`/`}handleClick(e){if(e.preventDefault(),e.stopPropagation(),window.history.length>1&&this._backAttempts<this._maxBackAttempts&&this._backAttempts===0){this._backAttempts++;let e=window.location.href,t=Date.now();window.history.back(),setTimeout(()=>{Date.now()-t,window.location.href===e?this._navigateToFallback():setTimeout(()=>{this._backAttempts=0},500)},200)}else this._navigateToFallback()}_navigateToFallback(){let e=this.getFallbackHref();if(this._backAttempts=0,e.startsWith(`/`)&&!e.startsWith(`//`))try{window.history.pushState({},``,e),window.dispatchEvent(new PopStateEvent(`popstate`));return}catch{}window.location.href=e}render(){this._button||(this._button=document.createElement(`mint-button`),this._button.setAttribute(`variant`,`neutral`),this._button.setAttribute(`icon`,`arrow-left`),this._button.addEventListener(`click`,e=>this.handleClick(e)),this.appendChild(this._button))}};typeof customElements<`u`&&!customElements.get(`mint-back-button`)&&t.t(`mint-back-button`,r),module.exports=r;
|
|
@@ -3,9 +3,9 @@ import '../../button.css'
|
|
|
3
3
|
import '../../spinner.css'
|
|
4
4
|
import '../../icon.css'
|
|
5
5
|
import '../../back-button.css'
|
|
6
|
-
import { a as e } from "../chunks/icon-
|
|
6
|
+
import { a as e } from "../chunks/icon-BWUYe89V.js";
|
|
7
7
|
import { t } from "../chunks/register-element-BFYmIynH.js";
|
|
8
|
-
import "../chunks/icon-
|
|
8
|
+
import "../chunks/icon-B8p3Co0-.js";
|
|
9
9
|
/* empty css */
|
|
10
10
|
import "../chunks/spinner-BsaFHuS6.js";
|
|
11
11
|
e({
|
|
@@ -13,9 +13,9 @@ const __mintLoadStyle = (key, url) => {
|
|
|
13
13
|
__mintLoadStyle('theme', '../../theme.css')
|
|
14
14
|
__mintLoadStyle('icon', '../../icon.css')
|
|
15
15
|
__mintLoadStyle('bottom-navigation', '../../bottom-navigation.css')
|
|
16
|
-
import "../chunks/icon-
|
|
16
|
+
import "../chunks/icon-BWUYe89V.js";
|
|
17
17
|
import { t as e } from "../chunks/register-element-BFYmIynH.js";
|
|
18
|
-
import "../chunks/icon-
|
|
18
|
+
import "../chunks/icon-B8p3Co0-.js";
|
|
19
19
|
//#region src/components/bottom-navigation/BottomNavigation.ts
|
|
20
20
|
var t = class extends HTMLElement {
|
|
21
21
|
constructor(...e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../chunks/icon-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../chunks/icon-B_7c8b8e.js`);const e=require(`../chunks/register-element-tCL_F1YI.js`);require(`../chunks/icon-CSqBgTae.js`);var t=class extends HTMLElement{constructor(...e){super(...e),this._lastScrollY=0,this._scrollHandler=null}connectedCallback(){this.classList.add(`mint-bottom-navigation`),this.setAttribute(`role`,`navigation`),this.hasAttribute(`aria-label`)||this.setAttribute(`aria-label`,`Primary`),this._lastScrollY=window.scrollY,this.hasAttribute(`data-preview`)||this._attachScrollListener()}disconnectedCallback(){this._detachScrollListener()}_attachScrollListener(){this._scrollHandler||(this._scrollHandler=()=>{let e=window.scrollY;if(e<=8){this.classList.remove(`is-hidden`),this._lastScrollY=e;return}let t=e-this._lastScrollY;Math.abs(t)<4||(t>0?this.classList.add(`is-hidden`):this.classList.remove(`is-hidden`),this._lastScrollY=e)},window.addEventListener(`scroll`,this._scrollHandler,{passive:!0}))}_detachScrollListener(){this._scrollHandler&&=(window.removeEventListener(`scroll`,this._scrollHandler),null)}};customElements.get(`mint-bottom-navigation`)||e.t(`mint-bottom-navigation`,t);var n=class extends HTMLElement{constructor(...e){super(...e),this._root=null}static get observedAttributes(){return[`icon`,`label`,`href`,`active`]}connectedCallback(){this.classList.add(`mint-bottom-nav-item`),this.render()}attributeChangedCallback(e,t,n){t!==n&&this.render()}_isActive(){return this.hasAttribute(`active`)&&this.getAttribute(`active`)!==`false`}_getLabel(){return this.getAttribute(`label`)||``}_getIcon(){return this.getAttribute(`icon`)||``}_getHref(){return this.getAttribute(`href`)}render(){let e=this._getHref(),t=this._getLabel(),n=this._getIcon(),r=this._isActive(),i;e?(i=document.createElement(`a`),i.href=e):(i=document.createElement(`button`),i.type=`button`),i.className=`mint-bottom-nav-link`,i.setAttribute(`aria-current`,r?`page`:`false`);let a=n.split(`-`).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `);i.setAttribute(`aria-label`,t||a||`Navigation item`);let o=document.createElement(`span`);if(o.className=`mint-bottom-nav-icon`,n){let e=document.createElement(`mint-icon`);e.setAttribute(`name`,n),e.className=`mint-bottom-nav-icon-glyph`,o.appendChild(e)}let s=document.createElement(`span`);s.className=`mint-bottom-nav-label`,s.textContent=t,i.appendChild(o),i.appendChild(s),this.replaceChildren(i),this._root=i}};customElements.get(`mint-bottom-nav-item`)||e.t(`mint-bottom-nav-item`,n);var r=t;exports.MintBottomNavItem=n,exports.MintBottomNavigation=t,exports.default=r;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import '../../theme.css'
|
|
2
2
|
import '../../icon.css'
|
|
3
3
|
import '../../bottom-navigation.css'
|
|
4
|
-
import "../chunks/icon-
|
|
4
|
+
import "../chunks/icon-BWUYe89V.js";
|
|
5
5
|
import { t as e } from "../chunks/register-element-BFYmIynH.js";
|
|
6
|
-
import "../chunks/icon-
|
|
6
|
+
import "../chunks/icon-B8p3Co0-.js";
|
|
7
7
|
//#region src/components/bottom-navigation/BottomNavigation.ts
|
|
8
8
|
var t = class extends HTMLElement {
|
|
9
9
|
constructor(...e) {
|
|
@@ -14,5 +14,5 @@ __mintLoadStyle('theme', '../../theme.css')
|
|
|
14
14
|
__mintLoadStyle('spinner', '../../spinner.css')
|
|
15
15
|
__mintLoadStyle('icon', '../../icon.css')
|
|
16
16
|
__mintLoadStyle('button', '../../button.css')
|
|
17
|
-
import { t as e } from "../chunks/button-
|
|
17
|
+
import { t as e } from "../chunks/button-BYQbRAwl.js";
|
|
18
18
|
export { e as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../chunks/button-
|
|
1
|
+
const e=require(`../chunks/button-DbxqmBWQ.js`);module.exports=e.t;
|
|
@@ -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 =
|
|
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 =
|
|
364
|
-
|
|
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(
|
|
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
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
o
|
|
823
|
-
|
|
824
|
-
|
|
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
|
|
827
|
-
if (
|
|
828
|
-
this._svg.appendChild(
|
|
833
|
+
let o = this._getXValues();
|
|
834
|
+
if (o.length === 0) {
|
|
835
|
+
this._svg.appendChild(n);
|
|
829
836
|
return;
|
|
830
837
|
}
|
|
831
|
-
let
|
|
832
|
-
|
|
833
|
-
let n =
|
|
834
|
-
|
|
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
|
|
837
|
-
if (
|
|
838
|
-
|
|
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
|
-
|
|
841
|
-
let n = this._formatXAxisValue(t), r =
|
|
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 <
|
|
846
|
-
let r =
|
|
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
|
-
|
|
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 <
|
|
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
|
-
|
|
873
|
+
d = Array(o.length).fill(!1);
|
|
867
874
|
let t = -Infinity;
|
|
868
|
-
|
|
869
|
-
for (let n = 1; n <
|
|
870
|
-
let r =
|
|
871
|
-
r - t >= e && (
|
|
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 (
|
|
874
|
-
let n =
|
|
875
|
-
if (n - t >= e)
|
|
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 =
|
|
880
|
-
if (
|
|
881
|
-
for (let r = n - 1; r >= 0; r--) if (
|
|
882
|
-
t =
|
|
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 =
|
|
886
|
-
} else t =
|
|
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 && (
|
|
899
|
+
n - t >= e && (d[o.length - 1] = !0);
|
|
893
900
|
}
|
|
894
901
|
}
|
|
895
902
|
}
|
|
896
903
|
}
|
|
897
|
-
} else
|
|
898
|
-
|
|
899
|
-
if (
|
|
900
|
-
let i =
|
|
901
|
-
|
|
902
|
-
let
|
|
903
|
-
if (!
|
|
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
|
-
|
|
907
|
-
} else if (r ===
|
|
913
|
+
l = Math.max(i, t), d = "start";
|
|
914
|
+
} else if (r === o.length - 1) {
|
|
908
915
|
let t = e.x + e.width;
|
|
909
|
-
|
|
916
|
+
l = Math.min(i, t), d = "end";
|
|
910
917
|
}
|
|
911
|
-
} else if (d = "end", r ===
|
|
912
|
-
let
|
|
913
|
-
if (
|
|
914
|
-
|
|
915
|
-
let r = this._formatXAxisValue(
|
|
916
|
-
|
|
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
|
-
|
|
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 = (
|
|
923
|
-
|
|
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(
|
|
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
|
|
997
|
-
|
|
998
|
-
let
|
|
999
|
-
this._chartData.datasets.forEach((
|
|
1000
|
-
if (!this._isDatasetVisible(
|
|
1001
|
-
let
|
|
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
|
-
|
|
1006
|
-
let o = document.createElementNS("http://www.w3.org/2000/svg", "circle"), s = this._scaleX(
|
|
1007
|
-
o.setAttribute("cx", s.toString()), o.setAttribute("cy", c.toString()), o.setAttribute("r", "4"), o.setAttribute("fill",
|
|
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",
|
|
1010
|
-
let u = String(
|
|
1011
|
-
this._plotPoints.has(u) || this._plotPoints.set(u, []), this._plotPoints.get(u).push(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
|
-
}),
|
|
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
|
|
1069
|
-
|
|
1070
|
-
let
|
|
1071
|
-
this._chartData.datasets.forEach((
|
|
1072
|
-
if (!this._isDatasetVisible(
|
|
1073
|
-
let
|
|
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 (
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
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;
|