@appartmint/tsm-mint 0.1.13 → 0.1.14

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class a{events=[];attachEvent(e,s,t){if(e){let h=this.events.find(n=>n.el===e);h?(h.handlers.push(t),h.events.push(s)):this.events.push({el:e,handlers:[t],events:[s]}),e.addEventListener(s,t)}}detachEvents(){this.events.forEach(e=>{e.handlers.forEach((s,t)=>{e.el?.removeEventListener(e.events[t],s)})}),this.events=[]}}exports.AttachesEvents=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class a{events=[];attachEvent(s,e,t){if(s){const n=this.events.find(h=>h.el===s);n?(n.handlers.push(t),n.events.push(e)):this.events.push({el:s,handlers:[t],events:[e]}),s.addEventListener(e,t)}}detachEvents(){this.events.forEach(s=>{s.handlers.forEach((e,t)=>{s.el?.removeEventListener(s.events[t],e)})}),this.events=[]}}exports.AttachesEvents=a;
@@ -2,7 +2,7 @@ class a {
2
2
  events = [];
3
3
  attachEvent(s, e, t) {
4
4
  if (s) {
5
- let h = this.events.find((n) => n.el === s);
5
+ const h = this.events.find((n) => n.el === s);
6
6
  h ? (h.handlers.push(t), h.events.push(e)) : this.events.push({
7
7
  el: s,
8
8
  handlers: [t],
@@ -1,5 +1,5 @@
1
1
  export declare const gridNums: readonly [1, 2, 3, 4];
2
2
  export type GridNum = typeof gridNums[number];
3
3
  export declare const gridNumMin: GridNum;
4
- export declare const gridNumMax: GridNum;
4
+ export declare const gridNumMax: 1 | 2 | 3 | 4;
5
5
  export declare function gridNum(num?: number): GridNum;
@@ -1,5 +1,5 @@
1
1
  export declare const titleNums: readonly [1, 2, 3, 4, 5, 6];
2
2
  export type TitleNum = typeof titleNums[number];
3
3
  export declare const titleNumMin: TitleNum;
4
- export declare const titleNumMax: TitleNum;
4
+ export declare const titleNumMax: 1 | 2 | 3 | 4 | 5 | 6;
5
5
  export declare function titleNum(num?: number): TitleNum;
@@ -1,17 +1,11 @@
1
1
  import { Panel } from './panel';
2
2
  import { Menu } from './menu';
3
3
  export declare class Header {
4
- settings: {
5
- [key: string]: any;
6
- };
7
- el: {
8
- [key: string]: HTMLElement | null;
9
- };
4
+ settings: Record<string, any>;
5
+ el: Record<string, HTMLElement | null>;
10
6
  panel?: Panel;
11
7
  menu?: Menu;
12
- constructor(settings?: {
13
- [key: string]: any;
14
- });
8
+ constructor(settings?: Record<string, any>);
15
9
  detachEvents(): void;
16
10
  attachElements(): void;
17
11
  addClasses(): void;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../abstract/attaches-events.cjs.js"),l=require("../../types/time.cjs.js"),i=require("../../util/display.cjs.js"),r=require("../../util/event.cjs.js"),a=require("../../util/selectors.cjs.js");class u extends o.AttachesEvents{settings={};el={};constructor(e){if(super(),this.settings={...this.settings,...e},!this.settings.wrapperId)throw new Error("Wrapper ID is required");this.attachElements(),this.attachEvents(),requestAnimationFrame(()=>{this.closeAllMenus()})}attachElements(){this.el.wrapper=document.getElementById(this.settings.wrapperId)}attachEvents(){this.attachEvent(window,"scroll",r.throttleEvent(this.eHandleScroll.bind(this),l.delay.default,{trailing:!1})),this.el.wrapper?.querySelectorAll(a.focusable)?.forEach(s=>{this.attachEvent(s,"keydown",r.throttleEvent(this.eHandleKeypress.bind(this)))}),this.el.wrapper?.querySelectorAll(a.controls())?.forEach(s=>{this.attachEvent(s,"click",r.throttleEvent(this.eToggleMenu.bind(this),l.delay.slower,{trailing:!1}))})}setMenu(e,t=!1){let s=t?"true":"false",n=e?.nextElementSibling;e&&n&&(e.setAttribute("aria-expanded",s),t?i.showElement(n):(i.hideElement(n),this.closeSubMenus(e)))}toggleMenu(e){this.setMenu(e,e?.getAttribute("aria-expanded")?.toLowerCase()!=="true")}closeSubMenus(e){let t=e?.nextElementSibling;(t?.querySelectorAll(a.subMenuButtons)).forEach(n=>{n.parentElement?.parentElement===t&&this.setMenu(n)})}closeSiblingMenus(e){(e?.parentElement?.parentElement?.querySelectorAll(a.subMenuButtons)).forEach(n=>{n!==e&&this.setMenu(n)})}closeAllMenus(){this.el.wrapper?.querySelectorAll(a.subMenuButtons)?.forEach(t=>{this.setMenu(t)})}openClosestMenu(){let e=document.activeElement,t=e?.nextElementSibling,s=e?.getAttribute("aria-expanded")?.toLowerCase()==="true";e?.getAttribute("aria-controls")===this.settings.wrapperId&&(t=this.el.wrapper),e?.getAttribute("aria-controls")&&t&&!s&&(e.click(),t.querySelector(a.focusable)?.focus())}closeClosestMenu(){let e=document.activeElement,t=e?.closest(a.subMenu),s=t?.previousElementSibling;e?.getAttribute("aria-controls")&&e?.getAttribute("aria-expanded")?.toLowerCase()==="true"&&(s=e),s?.getAttribute("aria-expanded")?.toLowerCase()==="true"&&(s?.click(),s?.focus())}toggleClosestMenu(){document.activeElement?.getAttribute("aria-expanded")?.toLowerCase()==="true"?this.closeClosestMenu():this.openClosestMenu()}eHandleScroll(){this.closeAllMenus()}eHandleButtonKeypress(e){let t=e.target,s=t?.closest("li");switch(e.key.toLowerCase()){case"escape":s?.classList.contains("mint-open")&&this.setMenu(s);break;case"arrowleft":this.closeClosestMenu();break;case"arrowright":this.openClosestMenu();break;case"enter":case"space":t?.click();break}}eHandleLinkKeypress(e){let t=e.target;switch(e.key.toLowerCase()){case"escape":case"arrowleft":this.closeClosestMenu();break;case"arrowright":this.openClosestMenu();break;case"enter":case"space":t?.click();break}}eHandleKeypress(e){switch(e.key.toLowerCase()!=="tab"&&e.preventDefault(),e.target?.tagName.toLowerCase()){case"a":this.eHandleLinkKeypress(e);break;case"button":this.eHandleButtonKeypress(e);break}}eToggleMenu(e){let t=e.target;this.closeSiblingMenus(t),this.toggleMenu(t)}}exports.Menu=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../abstract/attaches-events.cjs.js"),i=require("../../types/time.cjs.js"),l=require("../../util/display.cjs.js"),r=require("../../util/event.cjs.js"),a=require("../../util/selectors.cjs.js");class u extends o.AttachesEvents{settings={};el={};constructor(e){if(super(),this.settings={...this.settings,...e},!this.settings.wrapperId)throw new Error("Wrapper ID is required");this.attachElements(),this.attachEvents(),requestAnimationFrame(()=>{this.closeAllMenus()})}attachElements(){this.el.wrapper=document.getElementById(this.settings.wrapperId)}attachEvents(){this.attachEvent(window,"scroll",r.throttleEvent(this.eHandleScroll.bind(this),i.delay.default,{trailing:!1})),this.el.wrapper?.querySelectorAll(a.focusable)?.forEach(s=>{this.attachEvent(s,"keydown",r.throttleEvent(this.eHandleKeypress.bind(this)))}),this.el.wrapper?.querySelectorAll(a.controls())?.forEach(s=>{this.attachEvent(s,"click",r.throttleEvent(this.eToggleMenu.bind(this),i.delay.slower,{trailing:!1}))})}setMenu(e,t=!1){const s=t?"true":"false",n=e?.nextElementSibling;e&&n&&(e.setAttribute("aria-expanded",s),t?l.showElement(n):(l.hideElement(n),this.closeSubMenus(e)))}toggleMenu(e){this.setMenu(e,e?.getAttribute("aria-expanded")?.toLowerCase()!=="true")}closeSubMenus(e){const t=e?.nextElementSibling;(t?.querySelectorAll(a.subMenuButtons)).forEach(n=>{n.parentElement?.parentElement===t&&this.setMenu(n)})}closeSiblingMenus(e){(e?.parentElement?.parentElement?.querySelectorAll(a.subMenuButtons)).forEach(n=>{n!==e&&this.setMenu(n)})}closeAllMenus(){this.el.wrapper?.querySelectorAll(a.subMenuButtons)?.forEach(t=>{this.setMenu(t)})}openClosestMenu(){let e=document.activeElement,t=e?.nextElementSibling,s=e?.getAttribute("aria-expanded")?.toLowerCase()==="true";e?.getAttribute("aria-controls")===this.settings.wrapperId&&(t=this.el.wrapper),e?.getAttribute("aria-controls")&&t&&!s&&(e.click(),t.querySelector(a.focusable)?.focus())}closeClosestMenu(){let e=document.activeElement,t=e?.closest(a.subMenu),s=t?.previousElementSibling;e?.getAttribute("aria-controls")&&e?.getAttribute("aria-expanded")?.toLowerCase()==="true"&&(s=e),s?.getAttribute("aria-expanded")?.toLowerCase()==="true"&&(s?.click(),s?.focus())}toggleClosestMenu(){document.activeElement?.getAttribute("aria-expanded")?.toLowerCase()==="true"?this.closeClosestMenu():this.openClosestMenu()}eHandleScroll(){this.closeAllMenus()}eHandleButtonKeypress(e){const t=e.target,s=t?.closest("li");switch(e.key.toLowerCase()){case"escape":s?.classList.contains("mint-open")&&this.setMenu(s);break;case"arrowleft":this.closeClosestMenu();break;case"arrowright":this.openClosestMenu();break;case"enter":case"space":t?.click();break}}eHandleLinkKeypress(e){const t=e.target;switch(e.key.toLowerCase()){case"escape":case"arrowleft":this.closeClosestMenu();break;case"arrowright":this.openClosestMenu();break;case"enter":case"space":t?.click();break}}eHandleKeypress(e){switch(e.key.toLowerCase()!=="tab"&&e.preventDefault(),e.target?.tagName.toLowerCase()){case"a":this.eHandleLinkKeypress(e);break;case"button":this.eHandleButtonKeypress(e);break}}eToggleMenu(e){const t=e.target;this.closeSiblingMenus(t),this.toggleMenu(t)}}exports.Menu=u;
@@ -1,8 +1,8 @@
1
1
  import { AttachesEvents as o } from "../../abstract/attaches-events.es.js";
2
2
  import { delay as i } from "../../types/time.es.js";
3
- import { showElement as u, hideElement as c } from "../../util/display.es.js";
4
- import { throttleEvent as r } from "../../util/event.es.js";
5
- import { focusable as l, controls as h, subMenuButtons as n, subMenu as p } from "../../util/selectors.es.js";
3
+ import { showElement as c, hideElement as u } from "../../util/display.es.js";
4
+ import { throttleEvent as a } from "../../util/event.es.js";
5
+ import { focusable as l, controls as h, subMenuButtons as r, subMenu as p } from "../../util/selectors.es.js";
6
6
  class w extends o {
7
7
  settings = {};
8
8
  el = {};
@@ -17,32 +17,32 @@ class w extends o {
17
17
  this.el.wrapper = document.getElementById(this.settings.wrapperId);
18
18
  }
19
19
  attachEvents() {
20
- this.attachEvent(window, "scroll", r(this.eHandleScroll.bind(this), i.default, { trailing: !1 })), this.el.wrapper?.querySelectorAll(l)?.forEach((s) => {
21
- this.attachEvent(s, "keydown", r(this.eHandleKeypress.bind(this)));
20
+ this.attachEvent(window, "scroll", a(this.eHandleScroll.bind(this), i.default, { trailing: !1 })), this.el.wrapper?.querySelectorAll(l)?.forEach((s) => {
21
+ this.attachEvent(s, "keydown", a(this.eHandleKeypress.bind(this)));
22
22
  }), this.el.wrapper?.querySelectorAll(h())?.forEach((s) => {
23
- this.attachEvent(s, "click", r(this.eToggleMenu.bind(this), i.slower, { trailing: !1 }));
23
+ this.attachEvent(s, "click", a(this.eToggleMenu.bind(this), i.slower, { trailing: !1 }));
24
24
  });
25
25
  }
26
26
  setMenu(e, t = !1) {
27
- let s = t ? "true" : "false", a = e?.nextElementSibling;
28
- e && a && (e.setAttribute("aria-expanded", s), t ? u(a) : (c(a), this.closeSubMenus(e)));
27
+ const s = t ? "true" : "false", n = e?.nextElementSibling;
28
+ e && n && (e.setAttribute("aria-expanded", s), t ? c(n) : (u(n), this.closeSubMenus(e)));
29
29
  }
30
30
  toggleMenu(e) {
31
31
  this.setMenu(e, e?.getAttribute("aria-expanded")?.toLowerCase() !== "true");
32
32
  }
33
33
  closeSubMenus(e) {
34
- let t = e?.nextElementSibling;
35
- (t?.querySelectorAll(n)).forEach((a) => {
36
- a.parentElement?.parentElement === t && this.setMenu(a);
34
+ const t = e?.nextElementSibling;
35
+ (t?.querySelectorAll(r)).forEach((n) => {
36
+ n.parentElement?.parentElement === t && this.setMenu(n);
37
37
  });
38
38
  }
39
39
  closeSiblingMenus(e) {
40
- (e?.parentElement?.parentElement?.querySelectorAll(n)).forEach((a) => {
41
- a !== e && this.setMenu(a);
40
+ (e?.parentElement?.parentElement?.querySelectorAll(r)).forEach((n) => {
41
+ n !== e && this.setMenu(n);
42
42
  });
43
43
  }
44
44
  closeAllMenus() {
45
- this.el.wrapper?.querySelectorAll(n)?.forEach((t) => {
45
+ this.el.wrapper?.querySelectorAll(r)?.forEach((t) => {
46
46
  this.setMenu(t);
47
47
  });
48
48
  }
@@ -61,7 +61,7 @@ class w extends o {
61
61
  this.closeAllMenus();
62
62
  }
63
63
  eHandleButtonKeypress(e) {
64
- let t = e.target, s = t?.closest("li");
64
+ const t = e.target, s = t?.closest("li");
65
65
  switch (e.key.toLowerCase()) {
66
66
  case "escape":
67
67
  s?.classList.contains("mint-open") && this.setMenu(s);
@@ -79,7 +79,7 @@ class w extends o {
79
79
  }
80
80
  }
81
81
  eHandleLinkKeypress(e) {
82
- let t = e.target;
82
+ const t = e.target;
83
83
  switch (e.key.toLowerCase()) {
84
84
  case "escape":
85
85
  case "arrowleft":
@@ -105,7 +105,7 @@ class w extends o {
105
105
  }
106
106
  }
107
107
  eToggleMenu(e) {
108
- let t = e.target;
108
+ const t = e.target;
109
109
  this.closeSiblingMenus(t), this.toggleMenu(t);
110
110
  }
111
111
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../types/breakpoints.cjs.js"),h=require("../../types/side.cjs.js"),l=require("../../types/time.cjs.js"),c=require("../../abstract/attaches-events.cjs.js"),d=require("../../util/window.cjs.js"),n=require("../../util/event.cjs.js"),o=require("../../util/selectors.cjs.js");class p extends c.AttachesEvents{settings={title:"panel",from:h.sides[0],fixed:!0};el={};constructor(t){if(super(),this.settings={...this.settings,...t},!this.settings.id||!this.settings.wrapperId)throw new Error("Panel ID and wrapper ID are required");this.attachElements(),this.attachEvents(),this.addClasses(),requestAnimationFrame(()=>{this.setPanel()})}attachElements(){this.el.html=document.querySelector("html"),this.el.main=document.querySelector("main"),this.el.panel=document.getElementById(this.settings.id),this.el.wrapper=document.getElementById(this.settings.wrapperId),this.el.toggleButton=this.el.panel?.querySelector(o.controls(this.settings.wrapperId))||null}attachEvents(){this.attachEvent(window,"resize",n.throttleEvent(this.eHandleResize.bind(this),l.delay.default)),this.attachEvent(this.el.main,"click",n.throttleEvent(this.eClose.bind(this),l.delay.default,{trailing:!1})),this.attachEvent(this.el.wrapper,"transitionend",this.eTransitionEnd.bind(this)),o.getFocusables(this.el.panel)?.forEach(s=>{this.attachEvent(s,"keydown",n.throttleEvent(this.eWrapTab.bind(this)))}),this.el.panel?.querySelectorAll(o.controls(this.settings.wrapperId))?.forEach(s=>{this.attachEvent(s,"click",n.throttleEvent(this.eToggle.bind(this),l.delay.slower,{trailing:!1}))})}addClasses(){this.el.panel?.classList.add("mint-panel"),this.el.wrapper?.classList.add("mint-panel-wrap"),this.el.toggleButton?.classList.add("mint-panel-toggle"),this.settings.from&&(this.el.panel?.classList.remove("mint-top","mint-right","mint-bottom","mint-left"),this.el.panel?.classList.add(`mint-${this.settings.from.toLowerCase()}`)),this.settings.tray&&this.el.panel?.classList.add("mint-tray")}setPanel(t=!1){let e=t?"true":"false",s=t?`close ${this.settings.title}`:`open ${this.settings.title}`;this.el.toggleButton?.setAttribute("aria-expanded",e),setTimeout(()=>{this.el.toggleButton?.setAttribute("aria-label",s)},l.delay.faster),t?(this.closeOtherPanels(),this.settings.fixed!==!0&&window.scroll({top:0,left:0,behavior:"smooth"}),setTimeout(()=>{if(this.el.html){let i=d.windowWidth()<=r.breakpoints.sm,a="auto";this.settings.tray?i&&(a="hidden"):a="hidden",this.el.html.style.overflow=a}},this.settings.from===h.sides[3]?l.delay.default:l.delay.instant),this.el.wrapper&&(this.el.wrapper.style.display="flex"),requestAnimationFrame(()=>{this.el.wrapper?.classList.add("mint-open")})):(this.el.html&&(this.el.html.style.overflow="auto"),requestAnimationFrame(()=>{this.el.wrapper?.classList.remove("mint-open")}))}togglePanel(){this.setPanel(this.el.toggleButton?.getAttribute("aria-expanded")?.toLowerCase()==="false")}closeOtherPanels(){const t=`.mint-panel-toggle[aria-expanded="true"]:not([aria-controls="${this.settings.wrapperId}"])`;document.querySelector(t)?.click()}eHandleResize(){const t=d.windowWidth()<=r.breakpoints.sm;let e=!0;this.el.panel?.classList.contains("mint-tray")?e=!1:this.el.panel?.classList.contains("mint-expand")||(e=!1),!t&&e&&this.setPanel(!1);const s=this.el.toggleButton?.getAttribute("aria-expanded")?.toLowerCase()==="true";let i="auto";s&&(this.settings.tray?t&&(i="hidden"):i="hidden"),this.el.html&&(this.el.html.style.overflow=i)}eWrapTab(t){const e=o.getFocusables(this.el.panel),s=e?.[e?.length-1],i=e?.length>1&&document.activeElement===s;t.key.toLowerCase()==="tab"&&!t.shiftKey&&i&&(this.el.toggleButton?.focus(),document.activeElement===this.el.toggleButton&&t.preventDefault())}eToggle(){this.togglePanel()}eClose(){this.setPanel(!1)}eTransitionEnd(){this.el.wrapper?.classList.contains("mint-open")===!1&&(this.el.wrapper.style.display="none")}}exports.Panel=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../types/breakpoints.cjs.js"),h=require("../../types/side.cjs.js"),l=require("../../types/time.cjs.js"),c=require("../../abstract/attaches-events.cjs.js"),d=require("../../util/window.cjs.js"),n=require("../../util/event.cjs.js"),o=require("../../util/selectors.cjs.js");class p extends c.AttachesEvents{settings={title:"panel",from:h.sides[0],fixed:!0};el={};constructor(t){if(super(),this.settings={...this.settings,...t},!this.settings.id||!this.settings.wrapperId)throw new Error("Panel ID and wrapper ID are required");this.attachElements(),this.attachEvents(),this.addClasses(),requestAnimationFrame(()=>{this.setPanel()})}attachElements(){this.el.html=document.querySelector("html"),this.el.main=document.querySelector("main"),this.el.panel=document.getElementById(this.settings.id),this.el.wrapper=document.getElementById(this.settings.wrapperId),this.el.toggleButton=this.el.panel?.querySelector(o.controls(this.settings.wrapperId))??null}attachEvents(){this.attachEvent(window,"resize",n.throttleEvent(this.eHandleResize.bind(this),l.delay.default)),this.attachEvent(this.el.main,"click",n.throttleEvent(this.eClose.bind(this),l.delay.default,{trailing:!1})),this.attachEvent(this.el.wrapper,"transitionend",this.eTransitionEnd.bind(this)),o.getFocusables(this.el.panel).forEach(s=>{this.attachEvent(s,"keydown",n.throttleEvent(this.eWrapTab.bind(this)))}),(this.el.panel?.querySelectorAll(o.controls(this.settings.wrapperId))).forEach(s=>{this.attachEvent(s,"click",n.throttleEvent(this.eToggle.bind(this),l.delay.slower,{trailing:!1}))})}addClasses(){this.el.panel?.classList.add("mint-panel"),this.el.wrapper?.classList.add("mint-panel-wrap"),this.el.toggleButton?.classList.add("mint-panel-toggle"),this.settings.from&&(this.el.panel?.classList.remove("mint-top","mint-right","mint-bottom","mint-left"),this.el.panel?.classList.add(`mint-${this.settings.from.toLowerCase()}`)),this.settings.tray&&this.el.panel?.classList.add("mint-tray")}setPanel(t=!1){const e=t?"true":"false",s=t?`close ${this.settings.title}`:`open ${this.settings.title}`;this.el.toggleButton?.setAttribute("aria-expanded",e),setTimeout(()=>{this.el.toggleButton?.setAttribute("aria-label",s)},l.delay.faster),t?(this.closeOtherPanels(),this.settings.fixed!==!0&&window.scroll({top:0,left:0,behavior:"smooth"}),setTimeout(()=>{if(this.el.html){const i=d.windowWidth()<=r.breakpoints.sm;let a="auto";this.settings.tray?i&&(a="hidden"):a="hidden",this.el.html.style.overflow=a}},this.settings.from===h.sides[3]?l.delay.default:l.delay.instant),this.el.wrapper&&(this.el.wrapper.style.display="flex"),requestAnimationFrame(()=>{this.el.wrapper?.classList.add("mint-open")})):(this.el.html&&(this.el.html.style.overflow="auto"),requestAnimationFrame(()=>{this.el.wrapper?.classList.remove("mint-open")}))}togglePanel(){this.setPanel(this.el.toggleButton?.getAttribute("aria-expanded")?.toLowerCase()==="false")}closeOtherPanels(){const t=`.mint-panel-toggle[aria-expanded="true"]:not([aria-controls="${this.settings.wrapperId}"])`,e=document.querySelector(t);e&&e.click()}eHandleResize(){const t=d.windowWidth()<=r.breakpoints.sm;let e=!0;this.el.panel?.classList.contains("mint-tray")?e=!1:this.el.panel?.classList.contains("mint-expand")||(e=!1),!t&&e&&this.setPanel(!1);const s=this.el.toggleButton?.getAttribute("aria-expanded")?.toLowerCase()==="true";let i="auto";s&&(this.settings.tray?t&&(i="hidden"):i="hidden"),this.el.html&&(this.el.html.style.overflow=i)}eWrapTab(t){const e=o.getFocusables(this.el.panel),s=e[e.length-1],i=e.length>1&&document.activeElement===s;t.key.toLowerCase()==="tab"&&!t.shiftKey&&i&&(this.el.toggleButton?.focus(),document.activeElement===this.el.toggleButton&&t.preventDefault())}eToggle(){this.togglePanel()}eClose(){this.setPanel(!1)}eTransitionEnd(){this.el.wrapper?.classList.contains("mint-open")===!1&&(this.el.wrapper.style.display="none")}}exports.Panel=p;
@@ -1,11 +1,11 @@
1
1
  import { breakpoints as o } from "../../types/breakpoints.es.js";
2
2
  import { sides as r } from "../../types/side.es.js";
3
3
  import { delay as l } from "../../types/time.es.js";
4
- import { AttachesEvents as c } from "../../abstract/attaches-events.es.js";
4
+ import { AttachesEvents as p } from "../../abstract/attaches-events.es.js";
5
5
  import { windowWidth as h } from "../../util/window.es.js";
6
6
  import { throttleEvent as n } from "../../util/event.es.js";
7
- import { controls as d, getFocusables as p } from "../../util/selectors.es.js";
8
- class v extends c {
7
+ import { controls as d, getFocusables as c } from "../../util/selectors.es.js";
8
+ class v extends p {
9
9
  settings = {
10
10
  title: "panel",
11
11
  from: r[0],
@@ -20,12 +20,12 @@ class v extends c {
20
20
  });
21
21
  }
22
22
  attachElements() {
23
- this.el.html = document.querySelector("html"), this.el.main = document.querySelector("main"), this.el.panel = document.getElementById(this.settings.id), this.el.wrapper = document.getElementById(this.settings.wrapperId), this.el.toggleButton = this.el.panel?.querySelector(d(this.settings.wrapperId)) || null;
23
+ this.el.html = document.querySelector("html"), this.el.main = document.querySelector("main"), this.el.panel = document.getElementById(this.settings.id), this.el.wrapper = document.getElementById(this.settings.wrapperId), this.el.toggleButton = this.el.panel?.querySelector(d(this.settings.wrapperId)) ?? null;
24
24
  }
25
25
  attachEvents() {
26
- this.attachEvent(window, "resize", n(this.eHandleResize.bind(this), l.default)), this.attachEvent(this.el.main, "click", n(this.eClose.bind(this), l.default, { trailing: !1 })), this.attachEvent(this.el.wrapper, "transitionend", this.eTransitionEnd.bind(this)), p(this.el.panel)?.forEach((s) => {
26
+ this.attachEvent(window, "resize", n(this.eHandleResize.bind(this), l.default)), this.attachEvent(this.el.main, "click", n(this.eClose.bind(this), l.default, { trailing: !1 })), this.attachEvent(this.el.wrapper, "transitionend", this.eTransitionEnd.bind(this)), c(this.el.panel).forEach((s) => {
27
27
  this.attachEvent(s, "keydown", n(this.eWrapTab.bind(this)));
28
- }), this.el.panel?.querySelectorAll(d(this.settings.wrapperId))?.forEach((s) => {
28
+ }), (this.el.panel?.querySelectorAll(d(this.settings.wrapperId))).forEach((s) => {
29
29
  this.attachEvent(s, "click", n(this.eToggle.bind(this), l.slower, { trailing: !1 }));
30
30
  });
31
31
  }
@@ -33,7 +33,7 @@ class v extends c {
33
33
  this.el.panel?.classList.add("mint-panel"), this.el.wrapper?.classList.add("mint-panel-wrap"), this.el.toggleButton?.classList.add("mint-panel-toggle"), this.settings.from && (this.el.panel?.classList.remove("mint-top", "mint-right", "mint-bottom", "mint-left"), this.el.panel?.classList.add(`mint-${this.settings.from.toLowerCase()}`)), this.settings.tray && this.el.panel?.classList.add("mint-tray");
34
34
  }
35
35
  setPanel(t = !1) {
36
- let e = t ? "true" : "false", s = t ? `close ${this.settings.title}` : `open ${this.settings.title}`;
36
+ const e = t ? "true" : "false", s = t ? `close ${this.settings.title}` : `open ${this.settings.title}`;
37
37
  this.el.toggleButton?.setAttribute("aria-expanded", e), setTimeout(() => {
38
38
  this.el.toggleButton?.setAttribute("aria-label", s);
39
39
  }, l.faster), t ? (this.closeOtherPanels(), this.settings.fixed !== !0 && window.scroll({
@@ -42,7 +42,8 @@ class v extends c {
42
42
  behavior: "smooth"
43
43
  }), setTimeout(() => {
44
44
  if (this.el.html) {
45
- let i = h() <= o.sm, a = "auto";
45
+ const i = h() <= o.sm;
46
+ let a = "auto";
46
47
  this.settings.tray ? i && (a = "hidden") : a = "hidden", this.el.html.style.overflow = a;
47
48
  }
48
49
  }, this.settings.from === r[3] ? l.default : l.instant), this.el.wrapper && (this.el.wrapper.style.display = "flex"), requestAnimationFrame(() => {
@@ -55,8 +56,8 @@ class v extends c {
55
56
  this.setPanel(this.el.toggleButton?.getAttribute("aria-expanded")?.toLowerCase() === "false");
56
57
  }
57
58
  closeOtherPanels() {
58
- const t = `.mint-panel-toggle[aria-expanded="true"]:not([aria-controls="${this.settings.wrapperId}"])`;
59
- document.querySelector(t)?.click();
59
+ const t = `.mint-panel-toggle[aria-expanded="true"]:not([aria-controls="${this.settings.wrapperId}"])`, e = document.querySelector(t);
60
+ e && e.click();
60
61
  }
61
62
  eHandleResize() {
62
63
  const t = h() <= o.sm;
@@ -67,7 +68,7 @@ class v extends c {
67
68
  s && (this.settings.tray ? t && (i = "hidden") : i = "hidden"), this.el.html && (this.el.html.style.overflow = i);
68
69
  }
69
70
  eWrapTab(t) {
70
- const e = p(this.el.panel), s = e?.[e?.length - 1], i = e?.length > 1 && document.activeElement === s;
71
+ const e = c(this.el.panel), s = e[e.length - 1], i = e.length > 1 && document.activeElement === s;
71
72
  t.key.toLowerCase() === "tab" && !t.shiftKey && i && (this.el.toggleButton?.focus(), document.activeElement === this.el.toggleButton && t.preventDefault());
72
73
  }
73
74
  eToggle() {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=16;function u(s){const e=s.match(/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/);if(e){let t=e[1];t.length===3&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);const r=parseInt(t.substring(0,2),c),a=parseInt(t.substring(2,4),c),i=parseInt(t.substring(4,6),c);return o({r,g:a,b:i})}const n=s.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)?(?:,\s*(\d(?:\.\d*)?)\s*\))?/);if(n){const t=parseInt(n[1]),r=parseInt(n[2]),a=parseInt(n[3]),i=n[4]?parseFloat(n[4]):void 0;return o({r:t,g:r,b:a,a:i})}throw new Error(`Invalid color: ${s}`)}function o({r:s,g:e,b:n,a:t}){return t===0?262:!isNaN(s)&&!isNaN(e)&&!isNaN(n)?Math.round((s*299+e*587+n*144)/1e3):-1}exports.getLuminance=u;exports.getLuminanceRGBA=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=16;function u(e){const s=/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/.exec(e);if(s){let t=s[1];t.length===3&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);const r=parseInt(t.substring(0,2),c),a=parseInt(t.substring(2,4),c),i=parseInt(t.substring(4,6),c);return o({r,g:a,b:i})}const n=/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)?(?:,\s*(\d(?:\.\d*)?)\s*\))?/.exec(e);if(n){const t=parseInt(n[1]),r=parseInt(n[2]),a=parseInt(n[3]),i=n[4]?parseFloat(n[4]):void 0;return o({r:t,g:r,b:a,a:i})}throw new Error(`Invalid color: ${e}`)}function o({r:e,g:s,b:n,a:t}){return t===0?262:!isNaN(e)&&!isNaN(s)&&!isNaN(n)?Math.round((e*299+s*587+n*144)/1e3):-1}exports.getLuminance=u;exports.getLuminanceRGBA=o;
@@ -1,20 +1,20 @@
1
- function o(n) {
2
- const e = n.match(/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/);
1
+ function o(t) {
2
+ const e = /^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/.exec(t);
3
3
  if (e) {
4
4
  let s = e[1];
5
5
  s.length === 3 && (s = s[0] + s[0] + s[1] + s[1] + s[2] + s[2]);
6
6
  const r = parseInt(s.substring(0, 2), 16), a = parseInt(s.substring(2, 4), 16), c = parseInt(s.substring(4, 6), 16);
7
7
  return i({ r, g: a, b: c });
8
8
  }
9
- const t = n.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)?(?:,\s*(\d(?:\.\d*)?)\s*\))?/);
10
- if (t) {
11
- const s = parseInt(t[1]), r = parseInt(t[2]), a = parseInt(t[3]), c = t[4] ? parseFloat(t[4]) : void 0;
9
+ const n = /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)?(?:,\s*(\d(?:\.\d*)?)\s*\))?/.exec(t);
10
+ if (n) {
11
+ const s = parseInt(n[1]), r = parseInt(n[2]), a = parseInt(n[3]), c = n[4] ? parseFloat(n[4]) : void 0;
12
12
  return i({ r: s, g: r, b: a, a: c });
13
13
  }
14
- throw new Error(`Invalid color: ${n}`);
14
+ throw new Error(`Invalid color: ${t}`);
15
15
  }
16
- function i({ r: n, g: e, b: t, a: s }) {
17
- return s === 0 ? 262 : !isNaN(n) && !isNaN(e) && !isNaN(t) ? Math.round((n * 299 + e * 587 + t * 144) / 1e3) : -1;
16
+ function i({ r: t, g: e, b: n, a: s }) {
17
+ return s === 0 ? 262 : !isNaN(t) && !isNaN(e) && !isNaN(n) ? Math.round((t * 299 + e * 587 + n * 144) / 1e3) : -1;
18
18
  }
19
19
  export {
20
20
  o as getLuminance,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../types/time.cjs.js");function c(t,n=o.delay.default){let e;return function(...u){e&&clearTimeout(e),e=Number(setTimeout(t,n,...u))}}function g(t,n=o.delay.default){return c(t,n)}function m(t,n=o.delay.default,e){let u,i,a,l,r=0,s=function(){r=e?.leading===!1?0:new Date().getTime(),l=0,a=t.apply(u,i),l||(u=i=null)};return function(){let f=new Date().getTime();!r&&e?.leading===!1&&(r=f);let d=n-f+r;return u=this,i=arguments,d<=0||d>n?(l&&(clearTimeout(l),l=0),r=f,a=t.apply(u,i),l||(u=i=null)):!l&&e?.trailing!==!1&&(l=window.setTimeout(s,d)),a}}function y(t,n=o.delay.default,e){return m(t,n,e)}exports.debounce=c;exports.debounceEvent=g;exports.throttle=m;exports.throttleEvent=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../types/time.cjs.js");function c(t,n=o.delay.default){let e;return function(...u){e&&clearTimeout(e),e=Number(setTimeout(t,n,...u))}}function g(t,n=o.delay.default){return c(t,n)}function s(t,n=o.delay.default,e){let u,i,a,l,r=0,m=function(){r=e?.leading===!1?0:new Date().getTime(),l=0,a=t.apply(u,i),l||(u=i=null)};return function(){const f=new Date().getTime();!r&&e?.leading===!1&&(r=f);const d=n-f+r;return u=this,i=arguments,d<=0||d>n?(l&&(clearTimeout(l),l=0),r=f,a=t.apply(u,i),l||(u=i=null)):!l&&e?.trailing!==!1&&(l=window.setTimeout(m,d)),a}}function y(t,n=o.delay.default,e){return s(t,n,e)}exports.debounce=c;exports.debounceEvent=g;exports.throttle=s;exports.throttleEvent=y;
@@ -1,8 +1,4 @@
1
1
  export declare function debounce<T extends (...args: Parameters<T>) => ReturnType<T>>(func: T, wait?: number): (...args: Parameters<T>) => void;
2
2
  export declare function debounceEvent<T extends (e: Event) => ReturnType<T>>(func: T, wait?: number): EventListener;
3
- export declare function throttle(func: Function, wait?: number, options?: {
4
- [key: string]: boolean;
5
- }): Function;
6
- export declare function throttleEvent(func: Function, wait?: number, options?: {
7
- [key: string]: boolean;
8
- }): EventListener;
3
+ export declare function throttle(func: Function, wait?: number, options?: Record<string, boolean>): Function;
4
+ export declare function throttleEvent(func: Function, wait?: number, options?: Record<string, boolean>): EventListener;
@@ -1,29 +1,29 @@
1
- import { delay as f } from "../types/time.es.js";
2
- function c(t, n = f.default) {
1
+ import { delay as o } from "../types/time.es.js";
2
+ function d(t, n = o.default) {
3
3
  let e;
4
- return function(...i) {
5
- e && clearTimeout(e), e = Number(setTimeout(t, n, ...i));
4
+ return function(...l) {
5
+ e && clearTimeout(e), e = Number(setTimeout(t, n, ...l));
6
6
  };
7
7
  }
8
- function h(t, n = f.default) {
9
- return c(t, n);
8
+ function h(t, n = o.default) {
9
+ return d(t, n);
10
10
  }
11
- function s(t, n = f.default, e) {
12
- let i, r, o, l, u = 0, d = function() {
13
- u = e?.leading === !1 ? 0 : (/* @__PURE__ */ new Date()).getTime(), l = 0, o = t.apply(i, r), l || (i = r = null);
11
+ function s(t, n = o.default, e) {
12
+ let l, r, f, i, u = 0, m = function() {
13
+ u = e?.leading === !1 ? 0 : (/* @__PURE__ */ new Date()).getTime(), i = 0, f = t.apply(l, r), i || (l = r = null);
14
14
  };
15
15
  return function() {
16
- let a = (/* @__PURE__ */ new Date()).getTime();
16
+ const a = (/* @__PURE__ */ new Date()).getTime();
17
17
  !u && e?.leading === !1 && (u = a);
18
- let m = n - a + u;
19
- return i = this, r = arguments, m <= 0 || m > n ? (l && (clearTimeout(l), l = 0), u = a, o = t.apply(i, r), l || (i = r = null)) : !l && e?.trailing !== !1 && (l = window.setTimeout(d, m)), o;
18
+ const c = n - a + u;
19
+ return l = this, r = arguments, c <= 0 || c > n ? (i && (clearTimeout(i), i = 0), u = a, f = t.apply(l, r), i || (l = r = null)) : !i && e?.trailing !== !1 && (i = window.setTimeout(m, c)), f;
20
20
  };
21
21
  }
22
- function p(t, n = f.default, e) {
22
+ function p(t, n = o.default, e) {
23
23
  return s(t, n, e);
24
24
  }
25
25
  export {
26
- c as debounce,
26
+ d as debounce,
27
27
  h as debounceEvent,
28
28
  s as throttle,
29
29
  p as throttleEvent
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function o(e,n){let t=Object.keys(e);if(t.length!==Object.keys(n).length)return!1;let r=!0;return t.forEach(s=>{e[s]!==n[s]&&(r=!1)}),r}function f(e,n){let t=!0;if(e===n)return t;try{if(Object.keys(n).length===0)return!t}catch{return!t}return Object.keys(n).forEach(r=>{t=t&&f(e[r],n[r])}),t}function l(e,n){return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}function a(e,n){return Object.keys(e).reduce((t,r)=>(n.includes(e[r])||(t[r]=e[r]),t),{})}function y(e,n){return Object.keys(e).sort(n).reduce((t,r)=>(t[r]=e[r],t),{})}function h(e,n){return Object.keys(e).sort((t,r)=>n(e[t],e[r])).reduce((t,r)=>(t[r]=e[r],t),{})}function O(e,n){return n.reduce((t,r)=>(t[r]=e[r],t),{})}function d(e,n){return Object.keys(e).reduce((t,r)=>(n.includes(e[r])&&(t[r]=e[r]),t),{})}function p(e,n,t="id"){if(!n?.length)n?.forEach(s=>e.push(s));else{const s=n.reduce((c,i)=>({...c,[i?.[t]??""]:i}),{});e.filter(c=>!s[c?.[t]??""])?.forEach(c=>{const i=e.indexOf(c);typeof i=="number"&&i!==-1&&e.splice(i,1)}),e.forEach(c=>{s[c?.[t]??""]&&Object.assign(c,s[c?.[t]??""])})}n?.filter(s=>!e.some(u=>u?.[t]===s?.[t]))?.forEach(s=>e.push(s))}function b(e,n){return Object.keys(e).find(t=>e[t]===n)}function j(e){if(typeof e!="object"||e===null)return e;const n=new WeakMap,t=[[e,Array.isArray(e)?[]:{}]];for(;t.length;){const[r,s,u]=t.pop();if(u!==void 0){const c=r[u];if(typeof c=="function"){s[u]=c.bind(s);continue}if(typeof c!="object"||c===null){s[u]=c;continue}if(n.has(c)){s[u]=n.get(c);continue}s[u]=Array.isArray(c)?[]:{},n.set(c,s[u]),t.push([c,s[u]])}else{if(n.set(r,s),Array.isArray(r)){r.forEach((c,i)=>{t.push([r,s,i])});continue}Object.keys(r).forEach(c=>{t.push([r,s,c])})}}return n.get(e)}exports.objectDeepClone=j;exports.objectFilterKeys=O;exports.objectFilterValues=d;exports.objectGetKeyByValue=b;exports.objectIsSuperset=f;exports.objectRemoveValues=a;exports.objectSameKeys=o;exports.objectSortKeys=y;exports.objectSortValues=h;exports.objectUpdateArray=p;exports.removeKeys=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function f(e,n){const t=Object.keys(e);if(t.length!==Object.keys(n).length)return!1;let r=!0;return t.forEach(s=>{e[s]!==n[s]&&(r=!1)}),r}function o(e,n){let t=!0;if(e===n)return t;try{if(Object.keys(n).length===0)return!t}catch{return!t}return Object.keys(n).forEach(r=>{t=t&&o(e[r],n[r])}),t}function l(e,n){return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}function a(e,n){return Object.keys(e).reduce((t,r)=>(n.includes(e[r])||(t[r]=e[r]),t),{})}function y(e,n){return Object.keys(e).sort(n).reduce((t,r)=>(t[r]=e[r],t),{})}function h(e,n){return Object.keys(e).sort((t,r)=>n(e[t],e[r])).reduce((t,r)=>(t[r]=e[r],t),{})}function O(e,n){return n.reduce((t,r)=>(t[r]=e[r],t),{})}function d(e,n){return Object.keys(e).reduce((t,r)=>(n.includes(e[r])&&(t[r]=e[r]),t),{})}function p(e,n,t="id"){if(!n?.length)n?.forEach(s=>e.push(s));else{const s=n.reduce((c,i)=>({...c,[i?.[t]??""]:i}),{});e.filter(c=>!s[c?.[t]??""])?.forEach(c=>{const i=e.indexOf(c);typeof i=="number"&&i!==-1&&e.splice(i,1)}),e.forEach(c=>{s[c?.[t]??""]&&Object.assign(c,s[c?.[t]??""])})}n?.filter(s=>!e.some(u=>u?.[t]===s?.[t]))?.forEach(s=>e.push(s))}function b(e,n){return Object.keys(e).find(t=>e[t]===n)}function j(e){if(typeof e!="object"||e===null)return e;const n=new WeakMap,t=[[e,Array.isArray(e)?[]:{}]];for(;t.length;){const[r,s,u]=t.pop();if(u!==void 0){const c=r[u];if(typeof c=="function"){s[u]=c.bind(s);continue}if(typeof c!="object"||c===null){s[u]=c;continue}if(n.has(c)){s[u]=n.get(c);continue}s[u]=Array.isArray(c)?[]:{},n.set(c,s[u]),t.push([c,s[u]])}else{if(n.set(r,s),Array.isArray(r)){r.forEach((c,i)=>{t.push([r,s,i])});continue}Object.keys(r).forEach(c=>{t.push([r,s,c])})}}return n.get(e)}exports.objectDeepClone=j;exports.objectFilterKeys=O;exports.objectFilterValues=d;exports.objectGetKeyByValue=b;exports.objectIsSuperset=o;exports.objectRemoveValues=a;exports.objectSameKeys=f;exports.objectSortKeys=y;exports.objectSortValues=h;exports.objectUpdateArray=p;exports.removeKeys=l;
@@ -34,14 +34,14 @@ export declare function objectSortValues(object: any, compareFn: (a: any, b: any
34
34
  * @param keys - the keys to keep
35
35
  * @returns - the filtered object
36
36
  */
37
- export declare function objectFilterKeys(object: any, keys: string[]): Object;
37
+ export declare function objectFilterKeys(object: any, keys: string[]): object;
38
38
  /**
39
39
  * Filters an object by its values
40
40
  * @param object - the object to filter
41
41
  * @param values - the values to keep
42
42
  * @returns - the filtered object
43
43
  */
44
- export declare function objectFilterValues(object: any, values: any[]): Object;
44
+ export declare function objectFilterValues(object: any, values: any[]): object;
45
45
  /**
46
46
  * Update two sets of objects
47
47
  * @param original - the original object
@@ -1,5 +1,5 @@
1
1
  function o(e, n) {
2
- let t = Object.keys(e);
2
+ const t = Object.keys(e);
3
3
  if (t.length !== Object.keys(n).length)
4
4
  return !1;
5
5
  let r = !0;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./event.cjs.js");function s(t){switch(t){case"top":t=0;break;case"bottom":t=document.body.scrollHeight;break}window.scrollTo(0,t)}function o(){requestAnimationFrame(()=>{let t=document.querySelectorAll(".mint-fall-in:not(.mint-show)"),n=[];for(let e=0;e<t.length;e++)t[e].getBoundingClientRect().top<0?t[e].classList.add("mint-show"):t[e].getBoundingClientRect().top<window.innerHeight*3/4&&n.push(t[e]);for(let e=0;e<n.length;e++)setTimeout(()=>{n[e].classList.add("mint-show")},e*100)})}function i(){window.addEventListener("scroll",l.throttleEvent(o,200))}exports.scrollTo=s;exports.showElements=o;exports.showElementsOnScroll=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./event.cjs.js");function s(t){switch(t){case"top":t=0;break;case"bottom":t=document.body.scrollHeight;break}window.scrollTo(0,t)}function o(){requestAnimationFrame(()=>{const t=document.querySelectorAll(".mint-fall-in:not(.mint-show)"),n=[];for(let e=0;e<t.length;e++)t[e].getBoundingClientRect().top<0?t[e].classList.add("mint-show"):t[e].getBoundingClientRect().top<window.innerHeight*3/4&&n.push(t[e]);for(let e=0;e<n.length;e++)setTimeout(()=>{n[e].classList.add("mint-show")},e*100)})}function i(){window.addEventListener("scroll",l.throttleEvent(o,200))}exports.scrollTo=s;exports.showElements=o;exports.showElementsOnScroll=i;
@@ -12,7 +12,7 @@ function s(t) {
12
12
  }
13
13
  function i() {
14
14
  requestAnimationFrame(() => {
15
- let t = document.querySelectorAll(".mint-fall-in:not(.mint-show)"), n = [];
15
+ const t = document.querySelectorAll(".mint-fall-in:not(.mint-show)"), n = [];
16
16
  for (let e = 0; e < t.length; e++)
17
17
  t[e].getBoundingClientRect().top < 0 ? t[e].classList.add("mint-show") : t[e].getBoundingClientRect().top < window.innerHeight * 3 / 4 && n.push(t[e]);
18
18
  for (let e = 0; e < n.length; e++)
@@ -21,11 +21,11 @@ function i() {
21
21
  }, e * 100);
22
22
  });
23
23
  }
24
- function r() {
24
+ function c() {
25
25
  window.addEventListener("scroll", o(i, 200));
26
26
  }
27
27
  export {
28
28
  s as scrollTo,
29
29
  i as showElements,
30
- r as showElementsOnScroll
30
+ c as showElementsOnScroll
31
31
  };
@@ -1,8 +1,8 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function r(e,t=100){return e.length>t?e.slice(0,t).trim()+"...":e}function c(e){return e?.trim().toLowerCase().replace(/'/g,"").replace(/[^\w/-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").replace(/^\/+|\/+$/g,"")??""}function u(e){return s(e.replace(/[-/]+/g," "))}function l(e){const t=e?.toString().trim()??"";if(t==="("||t==="")return t;let n=t.replace(/\D/g,"")??"",a="";n.length>10&&(a+=`+${n.slice(0,n.length-10)} `,n=n.slice(n.length-10));for(var i=0;i<n.length;i++){switch(i){case 0:a+="(";break;case 3:a+=") ";break;case 6:a+="-";break}a+=n[i]}switch(t[t.length-1]){case")":i===3&&(a+=") ");break;case"-":i===6&&(a+="-");break}return a}function x(e){return e.endsWith("ies")||e.endsWith("es")||e.endsWith("s")&&!e.endsWith("us")&&!e.endsWith("is")&&!e.endsWith("ss")?e:e.endsWith("y")&&!["a","e","i","o","u"].includes(e.charAt(e.length-2))?e.slice(0,-1)+"ies":e.endsWith("s")||e.endsWith("sh")||e.endsWith("ch")||e.endsWith("x")||e.endsWith("z")?e+"es":e+"s"}function s(e){return e.toLowerCase().replace(/(?:^|\s)\S/g,t=>t.toUpperCase())}function g(e){let t=document.createElement("textarea");return!e||!t?!1:(t.value=e,t.style.cssText=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function r(e,t=100){return e.length>t?e.slice(0,t).trim()+"...":e}function c(e){return e?.trim().toLowerCase().replace(/'/g,"").replace(/[^\w/-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").replace(/^\/+|\/+$/g,"")??""}function u(e){return s(e.replace(/[-/]+/g," "))}function l(e){const t=e?.toString().trim()??"";if(t==="("||t==="")return t;let n=t.replace(/\D/g,"")??"",i="";n.length>10&&(i+=`+${n.slice(0,n.length-10)} `,n=n.slice(n.length-10));for(var a=0;a<n.length;a++){switch(a){case 0:i+="(";break;case 3:i+=") ";break;case 6:i+="-";break}i+=n[a]}switch(t[t.length-1]){case")":a===3&&(i+=") ");break;case"-":a===6&&(i+="-");break}return i}function x(e){return e.endsWith("ies")||e.endsWith("es")||e.endsWith("s")&&!e.endsWith("us")&&!e.endsWith("is")&&!e.endsWith("ss")?e:e.endsWith("y")&&!["a","e","i","o","u"].includes(e.charAt(e.length-2))?e.slice(0,-1)+"ies":e.endsWith("s")||e.endsWith("sh")||e.endsWith("ch")||e.endsWith("x")||e.endsWith("z")?e+"es":e+"s"}function s(e){return e.toLowerCase().replace(/(?:^|\s)\S/g,t=>t.toUpperCase())}function g(e){const t=document.createElement("textarea");return!e||!t?!1:(t.value=e,t.style.cssText=`
2
2
  position: fixed;
3
3
  top: 0;
4
4
  left: 0;
5
5
  transform: translate(-100%, -100%);
6
6
  opacity: 0;
7
7
  z-index: -1;
8
- `,document.body.appendChild(t),t.select(),t.setSelectionRange(0,99999),navigator.clipboard.writeText(t.value),document.body.removeChild(t),!0)}function f(e){return e.match(/(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/)!==null}function o(e=10){return Math.random().toString(36).substring(2,e+2)}function h(e){return!!e?.match(/\.(jpe?g|png|webp|gif|svg)$/i)}function p(e){return!!e?.match(/\.(mp4|webm|ogg)$/i)}exports.copyText=g;exports.formatPhone=l;exports.generateId=o;exports.isEmail=f;exports.isImage=h;exports.isVideo=p;exports.plural=x;exports.slug=c;exports.titleCase=s;exports.truncate=r;exports.unslug=u;
8
+ `,document.body.appendChild(t),t.select(),t.setSelectionRange(0,99999),navigator.clipboard.writeText(t.value),document.body.removeChild(t),!0)}function f(e){return/(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/.exec(e)!==null}function o(e=10){return Math.random().toString(36).substring(2,e+2)}function h(e){return!!e?.match(/\.(jpe?g|png|webp|gif|svg)$/i)}function p(e){return!!e?.match(/\.(mp4|webm|ogg)$/i)}exports.copyText=g;exports.formatPhone=l;exports.generateId=o;exports.isEmail=f;exports.isImage=h;exports.isVideo=p;exports.plural=x;exports.slug=c;exports.titleCase=s;exports.truncate=r;exports.unslug=u;
@@ -11,31 +11,31 @@ function l(e) {
11
11
  const t = e?.toString().trim() ?? "";
12
12
  if (t === "(" || t === "")
13
13
  return t;
14
- let n = t.replace(/\D/g, "") ?? "", a = "";
15
- n.length > 10 && (a += `+${n.slice(0, n.length - 10)} `, n = n.slice(n.length - 10));
16
- for (var i = 0; i < n.length; i++) {
17
- switch (i) {
14
+ let n = t.replace(/\D/g, "") ?? "", i = "";
15
+ n.length > 10 && (i += `+${n.slice(0, n.length - 10)} `, n = n.slice(n.length - 10));
16
+ for (var a = 0; a < n.length; a++) {
17
+ switch (a) {
18
18
  case 0:
19
- a += "(";
19
+ i += "(";
20
20
  break;
21
21
  case 3:
22
- a += ") ";
22
+ i += ") ";
23
23
  break;
24
24
  case 6:
25
- a += "-";
25
+ i += "-";
26
26
  break;
27
27
  }
28
- a += n[i];
28
+ i += n[a];
29
29
  }
30
30
  switch (t[t.length - 1]) {
31
31
  case ")":
32
- i === 3 && (a += ") ");
32
+ a === 3 && (i += ") ");
33
33
  break;
34
34
  case "-":
35
- i === 6 && (a += "-");
35
+ a === 6 && (i += "-");
36
36
  break;
37
37
  }
38
- return a;
38
+ return i;
39
39
  }
40
40
  function x(e) {
41
41
  return e.endsWith("ies") || e.endsWith("es") || e.endsWith("s") && !e.endsWith("us") && !e.endsWith("is") && !e.endsWith("ss") ? e : e.endsWith("y") && !["a", "e", "i", "o", "u"].includes(e.charAt(e.length - 2)) ? e.slice(0, -1) + "ies" : e.endsWith("s") || e.endsWith("sh") || e.endsWith("ch") || e.endsWith("x") || e.endsWith("z") ? e + "es" : e + "s";
@@ -44,7 +44,7 @@ function s(e) {
44
44
  return e.toLowerCase().replace(/(?:^|\s)\S/g, (t) => t.toUpperCase());
45
45
  }
46
46
  function f(e) {
47
- let t = document.createElement("textarea");
47
+ const t = document.createElement("textarea");
48
48
  return !e || !t ? !1 : (t.value = e, t.style.cssText = `
49
49
  position: fixed;
50
50
  top: 0;
@@ -55,7 +55,7 @@ function f(e) {
55
55
  `, document.body.appendChild(t), t.select(), t.setSelectionRange(0, 99999), navigator.clipboard.writeText(t.value), document.body.removeChild(t), !0);
56
56
  }
57
57
  function g(e) {
58
- return e.match(/(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/) !== null;
58
+ return /(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/.exec(e) !== null;
59
59
  }
60
60
  function h(e = 10) {
61
61
  return Math.random().toString(36).substring(2, e + 2);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@appartmint/tsm-mint",
3
3
  "author": "App Art Mint LLC",
4
- "version": "0.1.13",
4
+ "version": "0.1.14",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "description": "TypeScript Modules from App Art Mint LLC",
@@ -53,6 +53,7 @@
53
53
  "eslint": "^10.0.3",
54
54
  "glob": "^13.0.6",
55
55
  "globals": "^17.4.0",
56
+ "jiti": "^2.6.1",
56
57
  "madge": "^8.0.0",
57
58
  "npm-check-updates": "^19.6.3",
58
59
  "npm-run-all2": "^8.0.4",