@appartmint/tsm-mint 0.0.6 → 0.1.1
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/section/grid.cjs.js +1 -0
- package/dist/components/{grid.es.js → section/grid.es.js} +1 -1
- package/dist/components/ui/text/title.cjs.js +1 -0
- package/dist/components/{title.es.js → ui/text/title.es.js} +1 -1
- package/dist/components/widget/header.cjs.js +1 -0
- package/dist/components/widget/header.d.ts +18 -0
- package/dist/components/widget/header.es.js +33 -0
- package/dist/components/widget/menu.cjs.js +1 -0
- package/dist/components/widget/menu.d.ts +21 -0
- package/dist/components/widget/menu.es.js +138 -0
- package/dist/components/widget/panel.cjs.js +1 -0
- package/dist/components/widget/panel.d.ts +17 -0
- package/dist/components/widget/panel.es.js +104 -0
- package/dist/types/breakpoints.cjs.js +1 -0
- package/dist/types/breakpoints.d.ts +11 -0
- package/dist/types/breakpoints.es.js +10 -0
- package/dist/types/side.cjs.js +1 -0
- package/dist/types/side.d.ts +2 -0
- package/dist/types/{box.es.js → side.es.js} +2 -2
- package/dist/types/time.cjs.js +1 -1
- package/dist/types/time.d.ts +10 -1
- package/dist/types/time.es.js +11 -2
- package/dist/util/display.cjs.js +1 -1
- package/dist/util/display.d.ts +2 -2
- package/dist/util/display.es.js +8 -8
- package/dist/util/event.cjs.js +1 -1
- package/dist/util/event.es.js +13 -13
- package/dist/util/selectors.cjs.js +7 -0
- package/dist/util/selectors.d.ts +115 -0
- package/dist/util/selectors.es.js +69 -0
- package/package.json +58 -67
- package/dist/abstract/index.cjs.js +0 -1
- package/dist/abstract/index.d.ts +0 -1
- package/dist/abstract/index.es.js +0 -4
- package/dist/components/grid.cjs.js +0 -1
- package/dist/components/index.cjs.js +0 -1
- package/dist/components/index.d.ts +0 -2
- package/dist/components/index.es.js +0 -12
- package/dist/components/title.cjs.js +0 -1
- package/dist/index.cjs.js +0 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.es.js +0 -50
- package/dist/types/box.cjs.js +0 -1
- package/dist/types/box.d.ts +0 -2
- package/dist/types/index.cjs.js +0 -1
- package/dist/types/index.d.ts +0 -2
- package/dist/types/index.es.js +0 -6
- package/dist/util/index.cjs.js +0 -1
- package/dist/util/index.d.ts +0 -7
- package/dist/util/index.es.js +0 -34
- /package/dist/components/{grid.d.ts → section/grid.d.ts} +0 -0
- /package/dist/components/{title.d.ts → ui/text/title.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../util/math.cjs.js"),i=[1,2,3,4],r=i[0],t=i[i.length-1];function e(u){return n.clamp(u,r,t)}exports.gridNum=e;exports.gridNumMax=t;exports.gridNumMin=r;exports.gridNums=i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../../../util/math.cjs.js"),t=[1,2,3,4,5,6],e=t[0],i=t[t.length-1];function n(u){return l.clamp(u,e,i)}exports.titleNum=n;exports.titleNumMax=i;exports.titleNumMin=e;exports.titleNums=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var i=Object.defineProperty;var a=(s,e,t)=>e in s?i(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var n=(s,e,t)=>a(s,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./panel.cjs.js"),l=require("./menu.cjs.js");class r{constructor(e){n(this,"settings",{id:"mint-menu",wrapperId:"mint-wrapper",title:"menu",fixed:!0});n(this,"el",{});n(this,"panel");n(this,"menu");this.settings={...this.settings,...e},this.panel=new d.Panel(this.settings),this.menu=new l.Menu(this.settings),this.attachElements(),this.addClasses()}detachEvents(){var e,t;(e=this.panel)==null||e.detachEvents(),(t=this.menu)==null||t.detachEvents()}attachElements(){this.el.body=document.querySelector("body")}addClasses(){var e;this.settings.fixed&&((e=this.el.body)==null||e.classList.add("mint-fixed"))}}exports.Header=r;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Panel } from './panel';
|
|
2
|
+
import { Menu } from './menu';
|
|
3
|
+
export declare class Header {
|
|
4
|
+
settings: {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
};
|
|
7
|
+
el: {
|
|
8
|
+
[key: string]: HTMLElement | null;
|
|
9
|
+
};
|
|
10
|
+
panel?: Panel;
|
|
11
|
+
menu?: Menu;
|
|
12
|
+
constructor(settings?: {
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
});
|
|
15
|
+
detachEvents(): void;
|
|
16
|
+
attachElements(): void;
|
|
17
|
+
addClasses(): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var n = Object.defineProperty;
|
|
2
|
+
var a = (s, t, e) => t in s ? n(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
|
|
3
|
+
var i = (s, t, e) => a(s, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { Panel as d } from "./panel.es.js";
|
|
5
|
+
import { Menu as h } from "./menu.es.js";
|
|
6
|
+
class o {
|
|
7
|
+
constructor(t) {
|
|
8
|
+
i(this, "settings", {
|
|
9
|
+
id: "mint-menu",
|
|
10
|
+
wrapperId: "mint-wrapper",
|
|
11
|
+
title: "menu",
|
|
12
|
+
fixed: !0
|
|
13
|
+
});
|
|
14
|
+
i(this, "el", {});
|
|
15
|
+
i(this, "panel");
|
|
16
|
+
i(this, "menu");
|
|
17
|
+
this.settings = { ...this.settings, ...t }, this.panel = new d(this.settings), this.menu = new h(this.settings), this.attachElements(), this.addClasses();
|
|
18
|
+
}
|
|
19
|
+
detachEvents() {
|
|
20
|
+
var t, e;
|
|
21
|
+
(t = this.panel) == null || t.detachEvents(), (e = this.menu) == null || e.detachEvents();
|
|
22
|
+
}
|
|
23
|
+
attachElements() {
|
|
24
|
+
this.el.body = document.querySelector("body");
|
|
25
|
+
}
|
|
26
|
+
addClasses() {
|
|
27
|
+
var t;
|
|
28
|
+
this.settings.fixed && ((t = this.el.body) == null || t.classList.add("mint-fixed"));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
o as Header
|
|
33
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var p=Object.defineProperty;var d=(n,i,e)=>i in n?p(n,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[i]=e;var o=(n,i,e)=>d(n,typeof i!="symbol"?i+"":i,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("../../abstract/attaches-events.cjs.js"),h=require("../../types/time.cjs.js"),u=require("../../util/display.cjs.js"),c=require("../../util/event.cjs.js"),a=require("../../util/selectors.cjs.js");class M extends g.AttachesEvents{constructor(e){super();o(this,"settings",{});o(this,"el",{});if(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(){var t,r;this.attachEvent(window,"scroll",c.throttleEvent(this.eHandleScroll.bind(this),h.delay.default,{trailing:!1}));const e=(t=this.el.wrapper)==null?void 0:t.querySelectorAll(a.focusable);e==null||e.forEach(l=>{this.attachEvent(l,"keydown",c.throttleEvent(this.eHandleKeypress.bind(this)))});const s=(r=this.el.wrapper)==null?void 0:r.querySelectorAll(a.controls());s==null||s.forEach(l=>{this.attachEvent(l,"click",c.throttleEvent(this.eToggleMenu.bind(this),h.delay.slower,{trailing:!1}))})}setMenu(e,s=!1){let t=s?"true":"false",r=e==null?void 0:e.nextElementSibling;e&&r&&(e.setAttribute("aria-expanded",t),s?u.showElement(r):(u.hideElement(r),this.closeSubMenus(e)))}toggleMenu(e){var s;this.setMenu(e,((s=e==null?void 0:e.getAttribute("aria-expanded"))==null?void 0:s.toLowerCase())!=="true")}closeSubMenus(e){let s=e==null?void 0:e.nextElementSibling;(s==null?void 0:s.querySelectorAll(a.subMenuButtons)).forEach(r=>{var l;((l=r.parentElement)==null?void 0:l.parentElement)===s&&this.setMenu(r)})}closeSiblingMenus(e){var r;let s=e==null?void 0:e.parentElement;((r=s==null?void 0:s.parentElement)==null?void 0:r.querySelectorAll(a.subMenuButtons)).forEach(l=>{l!==e&&this.setMenu(l)})}closeAllMenus(){var s;let e=(s=this.el.wrapper)==null?void 0:s.querySelectorAll(a.subMenuButtons);e==null||e.forEach(t=>{this.setMenu(t)})}openClosestMenu(){var r;let e=document.activeElement,s=e==null?void 0:e.nextElementSibling,t=((r=e==null?void 0:e.getAttribute("aria-expanded"))==null?void 0:r.toLowerCase())==="true";if((e==null?void 0:e.getAttribute("aria-controls"))===this.settings.wrapperId&&(s=this.el.wrapper),e!=null&&e.getAttribute("aria-controls")&&s&&!t){e.click();let l=s.querySelector(a.focusable);l==null||l.focus()}}closeClosestMenu(){var r,l;let e=document.activeElement,s=e==null?void 0:e.closest(a.subMenu),t=s==null?void 0:s.previousElementSibling;e!=null&&e.getAttribute("aria-controls")&&((r=e==null?void 0:e.getAttribute("aria-expanded"))==null?void 0:r.toLowerCase())==="true"&&(t=e),((l=t==null?void 0:t.getAttribute("aria-expanded"))==null?void 0:l.toLowerCase())==="true"&&(t==null||t.click(),t==null||t.focus())}toggleClosestMenu(){var e,s;((s=(e=document.activeElement)==null?void 0:e.getAttribute("aria-expanded"))==null?void 0:s.toLowerCase())==="true"?this.closeClosestMenu():this.openClosestMenu()}eHandleScroll(){this.closeAllMenus()}eHandleButtonKeypress(e){let s=e.target,t=s==null?void 0:s.closest("li");switch(e.key.toLowerCase()){case"escape":t!=null&&t.classList.contains("mint-open")&&this.setMenu(t);break;case"arrowleft":this.closeClosestMenu();break;case"arrowright":this.openClosestMenu();break;case"enter":case"space":s==null||s.click();break}}eHandleLinkKeypress(e){let s=e.target;switch(e.key.toLowerCase()){case"escape":case"arrowleft":this.closeClosestMenu();break;case"arrowright":this.openClosestMenu();break;case"enter":case"space":s==null||s.click();break}}eHandleKeypress(e){e.key.toLowerCase()!=="tab"&&e.preventDefault();const s=e.target;switch(s==null?void 0:s.tagName.toLowerCase()){case"a":this.eHandleLinkKeypress(e);break;case"button":this.eHandleButtonKeypress(e);break}}eToggleMenu(e){let s=e.target;this.closeSiblingMenus(s),this.toggleMenu(s)}}exports.Menu=M;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AttachesEvents } from '../../abstract/attaches-events';
|
|
2
|
+
export declare class Menu extends AttachesEvents {
|
|
3
|
+
settings: Record<string, any>;
|
|
4
|
+
el: Record<string, HTMLElement | null>;
|
|
5
|
+
constructor(settings?: Record<string, any>);
|
|
6
|
+
attachElements(): void;
|
|
7
|
+
attachEvents(): void;
|
|
8
|
+
setMenu(button?: HTMLElement | null, open?: boolean): void;
|
|
9
|
+
toggleMenu(button?: HTMLElement | null): void;
|
|
10
|
+
closeSubMenus(button?: HTMLElement | null): void;
|
|
11
|
+
closeSiblingMenus(button?: HTMLElement | null): void;
|
|
12
|
+
closeAllMenus(): void;
|
|
13
|
+
openClosestMenu(): void;
|
|
14
|
+
closeClosestMenu(): void;
|
|
15
|
+
toggleClosestMenu(): void;
|
|
16
|
+
eHandleScroll(): void;
|
|
17
|
+
eHandleButtonKeypress(e: KeyboardEvent): void;
|
|
18
|
+
eHandleLinkKeypress(e: KeyboardEvent): void;
|
|
19
|
+
eHandleKeypress(e: KeyboardEvent): void;
|
|
20
|
+
eToggleMenu(e: MouseEvent): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
var g = Object.defineProperty;
|
|
2
|
+
var d = (a, i, e) => i in a ? g(a, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[i] = e;
|
|
3
|
+
var n = (a, i, e) => d(a, typeof i != "symbol" ? i + "" : i, e);
|
|
4
|
+
import { AttachesEvents as u } from "../../abstract/attaches-events.es.js";
|
|
5
|
+
import { delay as h } from "../../types/time.es.js";
|
|
6
|
+
import { showElement as w, hideElement as M } from "../../util/display.es.js";
|
|
7
|
+
import { throttleEvent as o } from "../../util/event.es.js";
|
|
8
|
+
import { focusable as p, controls as f, subMenuButtons as c, subMenu as m } from "../../util/selectors.es.js";
|
|
9
|
+
class b extends u {
|
|
10
|
+
constructor(e) {
|
|
11
|
+
super();
|
|
12
|
+
n(this, "settings", {});
|
|
13
|
+
n(this, "el", {});
|
|
14
|
+
if (this.settings = { ...this.settings, ...e }, !this.settings.wrapperId)
|
|
15
|
+
throw new Error("Wrapper ID is required");
|
|
16
|
+
this.attachElements(), this.attachEvents(), requestAnimationFrame(() => {
|
|
17
|
+
this.closeAllMenus();
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
attachElements() {
|
|
21
|
+
this.el.wrapper = document.getElementById(this.settings.wrapperId);
|
|
22
|
+
}
|
|
23
|
+
attachEvents() {
|
|
24
|
+
var t, r;
|
|
25
|
+
this.attachEvent(window, "scroll", o(this.eHandleScroll.bind(this), h.default, { trailing: !1 }));
|
|
26
|
+
const e = (t = this.el.wrapper) == null ? void 0 : t.querySelectorAll(p);
|
|
27
|
+
e == null || e.forEach((l) => {
|
|
28
|
+
this.attachEvent(l, "keydown", o(this.eHandleKeypress.bind(this)));
|
|
29
|
+
});
|
|
30
|
+
const s = (r = this.el.wrapper) == null ? void 0 : r.querySelectorAll(f());
|
|
31
|
+
s == null || s.forEach((l) => {
|
|
32
|
+
this.attachEvent(l, "click", o(this.eToggleMenu.bind(this), h.slower, { trailing: !1 }));
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
setMenu(e, s = !1) {
|
|
36
|
+
let t = s ? "true" : "false", r = e == null ? void 0 : e.nextElementSibling;
|
|
37
|
+
e && r && (e.setAttribute("aria-expanded", t), s ? w(r) : (M(r), this.closeSubMenus(e)));
|
|
38
|
+
}
|
|
39
|
+
toggleMenu(e) {
|
|
40
|
+
var s;
|
|
41
|
+
this.setMenu(e, ((s = e == null ? void 0 : e.getAttribute("aria-expanded")) == null ? void 0 : s.toLowerCase()) !== "true");
|
|
42
|
+
}
|
|
43
|
+
closeSubMenus(e) {
|
|
44
|
+
let s = e == null ? void 0 : e.nextElementSibling;
|
|
45
|
+
(s == null ? void 0 : s.querySelectorAll(c)).forEach((r) => {
|
|
46
|
+
var l;
|
|
47
|
+
((l = r.parentElement) == null ? void 0 : l.parentElement) === s && this.setMenu(r);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
closeSiblingMenus(e) {
|
|
51
|
+
var r;
|
|
52
|
+
let s = e == null ? void 0 : e.parentElement;
|
|
53
|
+
((r = s == null ? void 0 : s.parentElement) == null ? void 0 : r.querySelectorAll(c)).forEach((l) => {
|
|
54
|
+
l !== e && this.setMenu(l);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
closeAllMenus() {
|
|
58
|
+
var s;
|
|
59
|
+
let e = (s = this.el.wrapper) == null ? void 0 : s.querySelectorAll(c);
|
|
60
|
+
e == null || e.forEach((t) => {
|
|
61
|
+
this.setMenu(t);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
openClosestMenu() {
|
|
65
|
+
var r;
|
|
66
|
+
let e = document.activeElement, s = e == null ? void 0 : e.nextElementSibling, t = ((r = e == null ? void 0 : e.getAttribute("aria-expanded")) == null ? void 0 : r.toLowerCase()) === "true";
|
|
67
|
+
if ((e == null ? void 0 : e.getAttribute("aria-controls")) === this.settings.wrapperId && (s = this.el.wrapper), e != null && e.getAttribute("aria-controls") && s && !t) {
|
|
68
|
+
e.click();
|
|
69
|
+
let l = s.querySelector(p);
|
|
70
|
+
l == null || l.focus();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
closeClosestMenu() {
|
|
74
|
+
var r, l;
|
|
75
|
+
let e = document.activeElement, s = e == null ? void 0 : e.closest(m), t = s == null ? void 0 : s.previousElementSibling;
|
|
76
|
+
e != null && e.getAttribute("aria-controls") && ((r = e == null ? void 0 : e.getAttribute("aria-expanded")) == null ? void 0 : r.toLowerCase()) === "true" && (t = e), ((l = t == null ? void 0 : t.getAttribute("aria-expanded")) == null ? void 0 : l.toLowerCase()) === "true" && (t == null || t.click(), t == null || t.focus());
|
|
77
|
+
}
|
|
78
|
+
toggleClosestMenu() {
|
|
79
|
+
var e, s;
|
|
80
|
+
((s = (e = document.activeElement) == null ? void 0 : e.getAttribute("aria-expanded")) == null ? void 0 : s.toLowerCase()) === "true" ? this.closeClosestMenu() : this.openClosestMenu();
|
|
81
|
+
}
|
|
82
|
+
eHandleScroll() {
|
|
83
|
+
this.closeAllMenus();
|
|
84
|
+
}
|
|
85
|
+
eHandleButtonKeypress(e) {
|
|
86
|
+
let s = e.target, t = s == null ? void 0 : s.closest("li");
|
|
87
|
+
switch (e.key.toLowerCase()) {
|
|
88
|
+
case "escape":
|
|
89
|
+
t != null && t.classList.contains("mint-open") && this.setMenu(t);
|
|
90
|
+
break;
|
|
91
|
+
case "arrowleft":
|
|
92
|
+
this.closeClosestMenu();
|
|
93
|
+
break;
|
|
94
|
+
case "arrowright":
|
|
95
|
+
this.openClosestMenu();
|
|
96
|
+
break;
|
|
97
|
+
case "enter":
|
|
98
|
+
case "space":
|
|
99
|
+
s == null || s.click();
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
eHandleLinkKeypress(e) {
|
|
104
|
+
let s = e.target;
|
|
105
|
+
switch (e.key.toLowerCase()) {
|
|
106
|
+
case "escape":
|
|
107
|
+
case "arrowleft":
|
|
108
|
+
this.closeClosestMenu();
|
|
109
|
+
break;
|
|
110
|
+
case "arrowright":
|
|
111
|
+
this.openClosestMenu();
|
|
112
|
+
break;
|
|
113
|
+
case "enter":
|
|
114
|
+
case "space":
|
|
115
|
+
s == null || s.click();
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
eHandleKeypress(e) {
|
|
120
|
+
e.key.toLowerCase() !== "tab" && e.preventDefault();
|
|
121
|
+
const s = e.target;
|
|
122
|
+
switch (s == null ? void 0 : s.tagName.toLowerCase()) {
|
|
123
|
+
case "a":
|
|
124
|
+
this.eHandleLinkKeypress(e);
|
|
125
|
+
break;
|
|
126
|
+
case "button":
|
|
127
|
+
this.eHandleButtonKeypress(e);
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
eToggleMenu(e) {
|
|
132
|
+
let s = e.target;
|
|
133
|
+
this.closeSiblingMenus(s), this.toggleMenu(s);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
export {
|
|
137
|
+
b as Menu
|
|
138
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var y=Object.defineProperty;var v=(o,a,t)=>a in o?y(o,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[a]=t;var m=(o,a,t)=>v(o,typeof a!="symbol"?a+"":a,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../../types/breakpoints.cjs.js"),r=require("../../types/side.cjs.js"),h=require("../../types/time.cjs.js"),E=require("../../abstract/attaches-events.cjs.js"),w=require("../../util/window.cjs.js"),p=require("../../util/event.cjs.js"),g=require("../../util/selectors.cjs.js");class b extends E.AttachesEvents{constructor(t){super();m(this,"settings",{title:"panel",from:r.sides[0],fixed:!0});m(this,"el",{});if(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(){var t;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=((t=this.el.panel)==null?void 0:t.querySelector(g.controls(this.settings.wrapperId)))||null}attachEvents(){var n;this.attachEvent(window,"resize",p.throttleEvent(this.eHandleResize.bind(this),h.delay.default)),this.attachEvent(this.el.main,"click",p.throttleEvent(this.eClose.bind(this),h.delay.default,{trailing:!1})),this.attachEvent(this.el.wrapper,"transitionend",this.eTransitionEnd.bind(this));const t=g.getFocusables(this.el.panel);t==null||t.forEach(i=>{this.attachEvent(i,"keydown",p.throttleEvent(this.eWrapTab.bind(this)))});const e=(n=this.el.panel)==null?void 0:n.querySelectorAll(g.controls(this.settings.wrapperId));e==null||e.forEach(i=>{this.attachEvent(i,"click",p.throttleEvent(this.eToggle.bind(this),h.delay.slower,{trailing:!1}))})}addClasses(){var t,e,n,i,s,l,d,c,u;(t=this.el.panel)==null||t.classList.add("mint-panel"),(e=this.el.wrapper)==null||e.classList.add("mint-panel-wrapper"),(n=this.el.toggleButton)==null||n.classList.add("mint-panel-toggle"),this.settings.from&&(console.log(this.settings.from),console.log(r.sides[this.settings.from]),console.log((i=r.sides[this.settings.from])==null?void 0:i.toLowerCase()),console.log(`mint-${(s=r.sides[this.settings.from])==null?void 0:s.toLowerCase()}`),(l=this.el.panel)==null||l.classList.remove("mint-top","mint-right","mint-bottom","mint-left"),(c=this.el.panel)==null||c.classList.add(`mint-${(d=r.sides[this.settings.from])==null?void 0:d.toLowerCase()}`)),this.settings.tray&&((u=this.el.panel)==null||u.classList.add("mint-tray"))}setPanel(t=!1){var i;let e=t?"true":"false",n=t?`close ${this.settings.title}`:`open ${this.settings.title}`;(i=this.el.toggleButton)==null||i.setAttribute("aria-expanded",e),setTimeout(()=>{var s;(s=this.el.toggleButton)==null||s.setAttribute("aria-label",n)},h.delay.faster),t?(this.closeOtherPanels(),this.settings.fixed!==!0&&window.scroll({top:0,left:0,behavior:"smooth"}),setTimeout(()=>{if(this.el.html){let s=w.windowWidth()<=f.breakpoints.sm,l="auto";this.settings.tray?s&&(l="hidden"):l="hidden",this.el.html.style.overflow=l}},this.settings.from===r.sides[3]?h.delay.default:h.delay.instant),this.el.wrapper&&(this.el.wrapper.style.display="flex"),requestAnimationFrame(()=>{var s;(s=this.el.wrapper)==null||s.classList.add("mint-open")})):(this.el.html&&(this.el.html.style.overflow="auto"),requestAnimationFrame(()=>{var s;(s=this.el.wrapper)==null||s.classList.remove("mint-open")}))}togglePanel(){var t,e;this.setPanel(((e=(t=this.el.toggleButton)==null?void 0:t.getAttribute("aria-expanded"))==null?void 0:e.toLowerCase())==="false")}closeOtherPanels(){const t=`.mint-panel-toggle[aria-expanded="true"]:not([aria-controls="${this.settings.wrapperId}"])`,e=document.querySelector(t);e==null||e.click()}eHandleResize(){var s,l,d,c;const t=w.windowWidth()<=f.breakpoints.sm;let e=!0;(s=this.el.panel)!=null&&s.classList.contains("mint-tray")?e=!1:(l=this.el.panel)!=null&&l.classList.contains("mint-expand")||(e=!1),!t&&e&&this.setPanel(!1);const n=((c=(d=this.el.toggleButton)==null?void 0:d.getAttribute("aria-expanded"))==null?void 0:c.toLowerCase())==="true";let i="auto";n&&(this.settings.tray?t&&(i="hidden"):i="hidden"),this.el.html&&(this.el.html.style.overflow=i)}eWrapTab(t){var l;const e=g.getFocusables(this.el.panel),n=e==null?void 0:e[(e==null?void 0:e.length)-1],i=(e==null?void 0:e.length)>1&&document.activeElement===n;t.key.toLowerCase()==="tab"&&!t.shiftKey&&i&&((l=this.el.toggleButton)==null||l.focus(),document.activeElement===this.el.toggleButton&&t.preventDefault())}eToggle(){this.togglePanel()}eClose(){this.setPanel(!1)}eTransitionEnd(){var t;((t=this.el.wrapper)==null?void 0:t.classList.contains("mint-open"))===!1&&(this.el.wrapper.style.display="none")}}exports.Panel=b;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AttachesEvents } from '../../abstract/attaches-events';
|
|
2
|
+
export declare class Panel extends AttachesEvents {
|
|
3
|
+
settings: Record<string, any>;
|
|
4
|
+
el: Record<string, HTMLElement | null>;
|
|
5
|
+
constructor(settings?: Record<string, any>);
|
|
6
|
+
attachElements(): void;
|
|
7
|
+
attachEvents(): void;
|
|
8
|
+
addClasses(): void;
|
|
9
|
+
setPanel(open?: boolean): void;
|
|
10
|
+
togglePanel(): void;
|
|
11
|
+
closeOtherPanels(): void;
|
|
12
|
+
eHandleResize(): void;
|
|
13
|
+
eWrapTab(e: KeyboardEvent): void;
|
|
14
|
+
eToggle(): void;
|
|
15
|
+
eClose(): void;
|
|
16
|
+
eTransitionEnd(): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
var E = Object.defineProperty;
|
|
2
|
+
var v = (o, a, t) => a in o ? E(o, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[a] = t;
|
|
3
|
+
var c = (o, a, t) => v(o, typeof a != "symbol" ? a + "" : a, t);
|
|
4
|
+
import { breakpoints as f } from "../../types/breakpoints.es.js";
|
|
5
|
+
import { sides as r } from "../../types/side.es.js";
|
|
6
|
+
import { delay as h } from "../../types/time.es.js";
|
|
7
|
+
import { AttachesEvents as b } from "../../abstract/attaches-events.es.js";
|
|
8
|
+
import { windowWidth as u } from "../../util/window.es.js";
|
|
9
|
+
import { throttleEvent as p } from "../../util/event.es.js";
|
|
10
|
+
import { controls as w, getFocusables as y } from "../../util/selectors.es.js";
|
|
11
|
+
class B extends b {
|
|
12
|
+
constructor(t) {
|
|
13
|
+
super();
|
|
14
|
+
c(this, "settings", {
|
|
15
|
+
title: "panel",
|
|
16
|
+
from: r[0],
|
|
17
|
+
fixed: !0
|
|
18
|
+
});
|
|
19
|
+
c(this, "el", {});
|
|
20
|
+
if (this.settings = { ...this.settings, ...t }, !this.settings.id || !this.settings.wrapperId)
|
|
21
|
+
throw new Error("Panel ID and wrapper ID are required");
|
|
22
|
+
this.attachElements(), this.attachEvents(), this.addClasses(), requestAnimationFrame(() => {
|
|
23
|
+
this.setPanel();
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
attachElements() {
|
|
27
|
+
var t;
|
|
28
|
+
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 = ((t = this.el.panel) == null ? void 0 : t.querySelector(w(this.settings.wrapperId))) || null;
|
|
29
|
+
}
|
|
30
|
+
attachEvents() {
|
|
31
|
+
var n;
|
|
32
|
+
this.attachEvent(window, "resize", p(this.eHandleResize.bind(this), h.default)), this.attachEvent(this.el.main, "click", p(this.eClose.bind(this), h.default, { trailing: !1 })), this.attachEvent(this.el.wrapper, "transitionend", this.eTransitionEnd.bind(this));
|
|
33
|
+
const t = y(this.el.panel);
|
|
34
|
+
t == null || t.forEach((i) => {
|
|
35
|
+
this.attachEvent(i, "keydown", p(this.eWrapTab.bind(this)));
|
|
36
|
+
});
|
|
37
|
+
const e = (n = this.el.panel) == null ? void 0 : n.querySelectorAll(w(this.settings.wrapperId));
|
|
38
|
+
e == null || e.forEach((i) => {
|
|
39
|
+
this.attachEvent(i, "click", p(this.eToggle.bind(this), h.slower, { trailing: !1 }));
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
addClasses() {
|
|
43
|
+
var t, e, n, i, s, l, d, m, g;
|
|
44
|
+
(t = this.el.panel) == null || t.classList.add("mint-panel"), (e = this.el.wrapper) == null || e.classList.add("mint-panel-wrapper"), (n = this.el.toggleButton) == null || n.classList.add("mint-panel-toggle"), this.settings.from && (console.log(this.settings.from), console.log(r[this.settings.from]), console.log((i = r[this.settings.from]) == null ? void 0 : i.toLowerCase()), console.log(`mint-${(s = r[this.settings.from]) == null ? void 0 : s.toLowerCase()}`), (l = this.el.panel) == null || l.classList.remove("mint-top", "mint-right", "mint-bottom", "mint-left"), (m = this.el.panel) == null || m.classList.add(`mint-${(d = r[this.settings.from]) == null ? void 0 : d.toLowerCase()}`)), this.settings.tray && ((g = this.el.panel) == null || g.classList.add("mint-tray"));
|
|
45
|
+
}
|
|
46
|
+
setPanel(t = !1) {
|
|
47
|
+
var i;
|
|
48
|
+
let e = t ? "true" : "false", n = t ? `close ${this.settings.title}` : `open ${this.settings.title}`;
|
|
49
|
+
(i = this.el.toggleButton) == null || i.setAttribute("aria-expanded", e), setTimeout(() => {
|
|
50
|
+
var s;
|
|
51
|
+
(s = this.el.toggleButton) == null || s.setAttribute("aria-label", n);
|
|
52
|
+
}, h.faster), t ? (this.closeOtherPanels(), this.settings.fixed !== !0 && window.scroll({
|
|
53
|
+
top: 0,
|
|
54
|
+
left: 0,
|
|
55
|
+
behavior: "smooth"
|
|
56
|
+
}), setTimeout(() => {
|
|
57
|
+
if (this.el.html) {
|
|
58
|
+
let s = u() <= f.sm, l = "auto";
|
|
59
|
+
this.settings.tray ? s && (l = "hidden") : l = "hidden", this.el.html.style.overflow = l;
|
|
60
|
+
}
|
|
61
|
+
}, this.settings.from === r[3] ? h.default : h.instant), this.el.wrapper && (this.el.wrapper.style.display = "flex"), requestAnimationFrame(() => {
|
|
62
|
+
var s;
|
|
63
|
+
(s = this.el.wrapper) == null || s.classList.add("mint-open");
|
|
64
|
+
})) : (this.el.html && (this.el.html.style.overflow = "auto"), requestAnimationFrame(() => {
|
|
65
|
+
var s;
|
|
66
|
+
(s = this.el.wrapper) == null || s.classList.remove("mint-open");
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
togglePanel() {
|
|
70
|
+
var t, e;
|
|
71
|
+
this.setPanel(((e = (t = this.el.toggleButton) == null ? void 0 : t.getAttribute("aria-expanded")) == null ? void 0 : e.toLowerCase()) === "false");
|
|
72
|
+
}
|
|
73
|
+
closeOtherPanels() {
|
|
74
|
+
const t = `.mint-panel-toggle[aria-expanded="true"]:not([aria-controls="${this.settings.wrapperId}"])`, e = document.querySelector(t);
|
|
75
|
+
e == null || e.click();
|
|
76
|
+
}
|
|
77
|
+
eHandleResize() {
|
|
78
|
+
var s, l, d, m;
|
|
79
|
+
const t = u() <= f.sm;
|
|
80
|
+
let e = !0;
|
|
81
|
+
(s = this.el.panel) != null && s.classList.contains("mint-tray") ? e = !1 : (l = this.el.panel) != null && l.classList.contains("mint-expand") || (e = !1), !t && e && this.setPanel(!1);
|
|
82
|
+
const n = ((m = (d = this.el.toggleButton) == null ? void 0 : d.getAttribute("aria-expanded")) == null ? void 0 : m.toLowerCase()) === "true";
|
|
83
|
+
let i = "auto";
|
|
84
|
+
n && (this.settings.tray ? t && (i = "hidden") : i = "hidden"), this.el.html && (this.el.html.style.overflow = i);
|
|
85
|
+
}
|
|
86
|
+
eWrapTab(t) {
|
|
87
|
+
var l;
|
|
88
|
+
const e = y(this.el.panel), n = e == null ? void 0 : e[(e == null ? void 0 : e.length) - 1], i = (e == null ? void 0 : e.length) > 1 && document.activeElement === n;
|
|
89
|
+
t.key.toLowerCase() === "tab" && !t.shiftKey && i && ((l = this.el.toggleButton) == null || l.focus(), document.activeElement === this.el.toggleButton && t.preventDefault());
|
|
90
|
+
}
|
|
91
|
+
eToggle() {
|
|
92
|
+
this.togglePanel();
|
|
93
|
+
}
|
|
94
|
+
eClose() {
|
|
95
|
+
this.setPanel(!1);
|
|
96
|
+
}
|
|
97
|
+
eTransitionEnd() {
|
|
98
|
+
var t;
|
|
99
|
+
((t = this.el.wrapper) == null ? void 0 : t.classList.contains("mint-open")) === !1 && (this.el.wrapper.style.display = "none");
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
export {
|
|
103
|
+
B as Panel
|
|
104
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={xs:480,sm:768,md:1024,lg:1200,xl:1440};exports.breakpoints=e;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const breakpoints: {
|
|
2
|
+
readonly xs: 480;
|
|
3
|
+
readonly sm: 768;
|
|
4
|
+
readonly md: 1024;
|
|
5
|
+
readonly lg: 1200;
|
|
6
|
+
readonly xl: 1440;
|
|
7
|
+
};
|
|
8
|
+
type BP = typeof breakpoints;
|
|
9
|
+
export type BreakpointKey = keyof BP;
|
|
10
|
+
export type Breakpoint = BP[BreakpointKey];
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=["top","right","bottom","left"];exports.sides=t;
|
package/dist/types/time.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=0,t=100,a={instant:e+t*0,fastest:e+t*1,faster:e+t*2,default:e+t*3,slower:e+t*4,slowest:e+t*5};exports.delay=a;exports.delayBase=e;exports.delayStep=t;
|
package/dist/types/time.d.ts
CHANGED
|
@@ -1 +1,10 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const delayBase: 0;
|
|
2
|
+
export declare const delayStep: 100;
|
|
3
|
+
export declare const delay: {
|
|
4
|
+
readonly instant: number;
|
|
5
|
+
readonly fastest: number;
|
|
6
|
+
readonly faster: number;
|
|
7
|
+
readonly default: number;
|
|
8
|
+
readonly slower: number;
|
|
9
|
+
readonly slowest: number;
|
|
10
|
+
};
|
package/dist/types/time.es.js
CHANGED
package/dist/util/display.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../types/side.cjs.js"),r=require("../types/time.cjs.js");function y(t,{duration:s=r.delay.default,from:e=l.sides[0]}={}){if(!t)return;const i=e==="top"||e==="bottom";t.style.display="",requestAnimationFrame(()=>{const{scrollHeight:o,scrollWidth:n}=t;i?t.style.height=`${o}px`:t.style.width=`${n}px`,setTimeout(()=>{i?t.style.height="auto":t.style.width="auto"},s)})}function h(t,{duration:s=r.delay.default,from:e=l.sides[0]}={}){if(!t)return;const i=e==="top"||e==="bottom",{scrollHeight:o,scrollWidth:n,style:{transition:a}}=t;t.style.transition="",requestAnimationFrame(()=>{i?t.style.height=`${o}px`:t.style.width=`${n}px`,t.style.transition=a,requestAnimationFrame(()=>{i?t.style.height="0":t.style.width="0"})}),setTimeout(()=>{t.style.display="none"},s)}exports.hideElement=h;exports.showElement=y;
|
package/dist/util/display.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Side } from '../types/side';
|
|
2
2
|
export interface TransitionProps {
|
|
3
3
|
duration?: number;
|
|
4
|
-
from?:
|
|
4
|
+
from?: Side;
|
|
5
5
|
}
|
|
6
6
|
export declare function showElement(el?: HTMLElement | null, { duration, from, }?: TransitionProps): void;
|
|
7
7
|
export declare function hideElement(el?: HTMLElement | null, { duration, from, }?: TransitionProps): void;
|
package/dist/util/display.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { sides as r } from "../types/side.es.js";
|
|
2
|
+
import { delay as l } from "../types/time.es.js";
|
|
3
3
|
function m(t, {
|
|
4
|
-
duration: s =
|
|
4
|
+
duration: s = l.default,
|
|
5
5
|
from: i = r[0]
|
|
6
6
|
} = {}) {
|
|
7
7
|
if (!t)
|
|
@@ -14,15 +14,15 @@ function m(t, {
|
|
|
14
14
|
}, s);
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
duration: s =
|
|
17
|
+
function d(t, {
|
|
18
|
+
duration: s = l.default,
|
|
19
19
|
from: i = r[0]
|
|
20
20
|
} = {}) {
|
|
21
21
|
if (!t)
|
|
22
22
|
return;
|
|
23
|
-
const e = i === "top" || i === "bottom", { scrollHeight: o, scrollWidth: n, style: { transition:
|
|
23
|
+
const e = i === "top" || i === "bottom", { scrollHeight: o, scrollWidth: n, style: { transition: a } } = t;
|
|
24
24
|
t.style.transition = "", requestAnimationFrame(() => {
|
|
25
|
-
e ? t.style.height = `${o}px` : t.style.width = `${n}px`, t.style.transition =
|
|
25
|
+
e ? t.style.height = `${o}px` : t.style.width = `${n}px`, t.style.transition = a, requestAnimationFrame(() => {
|
|
26
26
|
e ? t.style.height = "0" : t.style.width = "0";
|
|
27
27
|
});
|
|
28
28
|
}), setTimeout(() => {
|
|
@@ -30,6 +30,6 @@ function u(t, {
|
|
|
30
30
|
}, s);
|
|
31
31
|
}
|
|
32
32
|
export {
|
|
33
|
-
|
|
33
|
+
d as hideElement,
|
|
34
34
|
m as showElement
|
|
35
35
|
};
|
package/dist/util/event.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../types/time.cjs.js");function m(t,l=f.delay.default){let e;return function(...r){e&&clearTimeout(e),e=Number(setTimeout(t,l,...r))}}function b(t,l=f.delay.default){return m(t,l)}function g(t,l=f.delay.default,e){let r,n,i,u,a=0,y=function(){a=(e==null?void 0:e.leading)===!1?0:new Date().getTime(),u=0,i=t.apply(r,n),u||(r=n=null)};return function(){let d=new Date().getTime();!a&&(e==null?void 0:e.leading)===!1&&(a=d);let c=l-d+a;return r=this,n=arguments,c<=0||c>l?(u&&(clearTimeout(u),u=0),a=d,i=t.apply(r,n),u||(r=n=null)):!u&&(e==null?void 0:e.trailing)!==!1&&(u=window.setTimeout(y,c)),i}}function h(t,l=f.delay.default,e){return g(t,l,e)}exports.debounce=m;exports.debounceEvent=b;exports.throttle=g;exports.throttleEvent=h;
|
package/dist/util/event.es.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function g(t,
|
|
1
|
+
import { delay as a } from "../types/time.es.js";
|
|
2
|
+
function g(t, l = a.default) {
|
|
3
3
|
let e;
|
|
4
4
|
return function(...u) {
|
|
5
|
-
e && clearTimeout(e), e = Number(setTimeout(t,
|
|
5
|
+
e && clearTimeout(e), e = Number(setTimeout(t, l, ...u));
|
|
6
6
|
};
|
|
7
7
|
}
|
|
8
|
-
function b(t,
|
|
9
|
-
return g(t,
|
|
8
|
+
function b(t, l = a.default) {
|
|
9
|
+
return g(t, l);
|
|
10
10
|
}
|
|
11
|
-
function T(t,
|
|
12
|
-
let u,
|
|
13
|
-
|
|
11
|
+
function T(t, l = a.default, e) {
|
|
12
|
+
let u, f, i, r, n = 0, c = function() {
|
|
13
|
+
n = (e == null ? void 0 : e.leading) === !1 ? 0 : (/* @__PURE__ */ new Date()).getTime(), r = 0, i = t.apply(u, f), r || (u = f = null);
|
|
14
14
|
};
|
|
15
15
|
return function() {
|
|
16
16
|
let m = (/* @__PURE__ */ new Date()).getTime();
|
|
17
|
-
!
|
|
18
|
-
let
|
|
19
|
-
return u = this,
|
|
17
|
+
!n && (e == null ? void 0 : e.leading) === !1 && (n = m);
|
|
18
|
+
let d = l - m + n;
|
|
19
|
+
return u = this, f = arguments, d <= 0 || d > l ? (r && (clearTimeout(r), r = 0), n = m, i = t.apply(u, f), r || (u = f = null)) : !r && (e == null ? void 0 : e.trailing) !== !1 && (r = window.setTimeout(c, d)), i;
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
function v(t,
|
|
23
|
-
return T(t,
|
|
22
|
+
function v(t, l = a.default, e) {
|
|
23
|
+
return T(t, l, e);
|
|
24
24
|
}
|
|
25
25
|
export {
|
|
26
26
|
g as debounce,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d="mint",a=`${d}-`,r="[disabled]",i="[aria-controls]",b="[aria-expanded]",u="[href]",$="[routerLink]",f="[id]",p=`button${i}`,m=`${p} + ul${f}`,o='[tabindex^="-"]',h=`[tabindex]${t(o)}`,c=`input${t(r)}${t(o)},
|
|
2
|
+
select${t(r)}${t(o)},
|
|
3
|
+
textarea${t(r)}${t(o)},
|
|
4
|
+
button${t(r)}${t(o)},
|
|
5
|
+
object${t(r)}${t(o)},
|
|
6
|
+
a${u}, a${$},
|
|
7
|
+
area${u}, ${h}`.replace(/\s/g,"");function s(e){return e=e.toLowerCase(),e.startsWith(a)?e:`${a}${e}`}function x(e){return`--${s(e.replace(/^-+/,""))}`}function g(e){return`var(${x(e)})`}function t(e){return`:not(${e})`}function L(e){return`.${s(e)}`}function k(e){return`#${s(e)}`}function w(e){return e?`[aria-controls="${s(e)}"]`:i}function C(e){return typeof e=="boolean"?`[aria-expanded="${e}"]`:b}function M(e){let n;return e?n=Array.from(e.querySelectorAll(c)):n=Array.from(document.querySelectorAll(c)),n.filter(l=>y(l))}function y(e){let n=e;do{if(window.getComputedStyle(n).getPropertyValue("display").toLowerCase()==="none")return!1;n=n.parentElement}while(n);return!0}exports.className=L;exports.controls=w;exports.cssPrefix=x;exports.cssVar=g;exports.disabled=r;exports.expanded=C;exports.focusable=c;exports.getFocusables=M;exports.hasControls=i;exports.hasExpanded=b;exports.hasId=f;exports.hasLink=u;exports.hasRouterLink=$;exports.id=k;exports.isFocusable=y;exports.lib=d;exports.not=t;exports.notTabbable=o;exports.pre=a;exports.prefix=s;exports.subMenu=m;exports.subMenuButtons=p;exports.tabbable=h;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The library name that will be added as a prefix
|
|
3
|
+
*/
|
|
4
|
+
export declare const lib: "mint";
|
|
5
|
+
/**
|
|
6
|
+
* The prefix built from the library name
|
|
7
|
+
*/
|
|
8
|
+
export declare const pre: "mint-";
|
|
9
|
+
/**
|
|
10
|
+
* CSS-selector for disabled elements
|
|
11
|
+
*/
|
|
12
|
+
export declare const disabled: "[disabled]";
|
|
13
|
+
/**
|
|
14
|
+
* CSS-selector for elements with an aria-controls attribute
|
|
15
|
+
*/
|
|
16
|
+
export declare const hasControls: "[aria-controls]";
|
|
17
|
+
/**
|
|
18
|
+
* CSS-selector for elements with an aria-expanded attribute
|
|
19
|
+
*/
|
|
20
|
+
export declare const hasExpanded: "[aria-expanded]";
|
|
21
|
+
/**
|
|
22
|
+
* CSS-selector for elements with an href attribute
|
|
23
|
+
*/
|
|
24
|
+
export declare const hasLink: "[href]";
|
|
25
|
+
/**
|
|
26
|
+
* CSS-selector for elements with a routerLink attribute
|
|
27
|
+
* @summary - the routerLink attribute is used in Angular
|
|
28
|
+
*/
|
|
29
|
+
export declare const hasRouterLink: "[routerLink]";
|
|
30
|
+
/**
|
|
31
|
+
* CSS-selector for elements with an id attribute
|
|
32
|
+
*/
|
|
33
|
+
export declare const hasId: "[id]";
|
|
34
|
+
/**
|
|
35
|
+
* CSS-selector for submenu buttons
|
|
36
|
+
*/
|
|
37
|
+
export declare const subMenuButtons: "button[aria-controls]";
|
|
38
|
+
/**
|
|
39
|
+
* CSS-selector for submenus
|
|
40
|
+
*/
|
|
41
|
+
export declare const subMenu: "button[aria-controls] + ul[id]";
|
|
42
|
+
/**
|
|
43
|
+
* CSS-selector for elements that aren't tabbable (i.e. tabindex is negative)
|
|
44
|
+
*/
|
|
45
|
+
export declare const notTabbable: "[tabindex^=\"-\"]";
|
|
46
|
+
/**
|
|
47
|
+
* CSS-selector for elements that are tabbable (i.e. tabindex isn't negative)
|
|
48
|
+
*/
|
|
49
|
+
export declare const tabbable: `[tabindex]${string}`;
|
|
50
|
+
/**
|
|
51
|
+
* CSS-selector for elements that can receive focus
|
|
52
|
+
*/
|
|
53
|
+
export declare const focusable: string;
|
|
54
|
+
/**
|
|
55
|
+
* Adds the library prefix to the beginning of the provided string
|
|
56
|
+
* @param base - the string to be prefixed
|
|
57
|
+
* @returns - the provided string prefixed with the library name
|
|
58
|
+
*/
|
|
59
|
+
export declare function prefix(base: string): string;
|
|
60
|
+
/**
|
|
61
|
+
* Adds two dashes to the beginning of the provided string
|
|
62
|
+
* @param base - the string to be prefixed
|
|
63
|
+
* @returns - the provided string prefixed with two dashes
|
|
64
|
+
*/
|
|
65
|
+
export declare function cssPrefix(base: string): string;
|
|
66
|
+
/**
|
|
67
|
+
* Turns the provided string into a CSS variable call
|
|
68
|
+
* @param base - the name of the CSS variable to call
|
|
69
|
+
* @returns - the CSS variable call for the provided string
|
|
70
|
+
*/
|
|
71
|
+
export declare function cssVar(base: string): string;
|
|
72
|
+
/**
|
|
73
|
+
* Negates the provided CSS selector
|
|
74
|
+
* @param base - the CSS selector to negate
|
|
75
|
+
* @returns - the negated CSS selector
|
|
76
|
+
*/
|
|
77
|
+
export declare function not(base: string): string;
|
|
78
|
+
/**
|
|
79
|
+
* Generates a class CSS selector
|
|
80
|
+
* @param base - the name of the class to generate
|
|
81
|
+
* @returns - the generated CSS selector
|
|
82
|
+
*/
|
|
83
|
+
export declare function className(base: string): string;
|
|
84
|
+
/**
|
|
85
|
+
* Generates an id CSS selector
|
|
86
|
+
* @param base - the name of the id to generate
|
|
87
|
+
* @returns - the generated CSS selector
|
|
88
|
+
*/
|
|
89
|
+
export declare function id(base: string): string;
|
|
90
|
+
/**
|
|
91
|
+
* Generates an aria-controls CSS selector
|
|
92
|
+
* @param id - the id of the controlled element
|
|
93
|
+
* @returns - the generated CSS selector
|
|
94
|
+
*/
|
|
95
|
+
export declare function controls(id?: string | null): string;
|
|
96
|
+
/**
|
|
97
|
+
* Generates an aria-expanded CSS selector
|
|
98
|
+
* @param bool - whether the element is expanded or not
|
|
99
|
+
* @returns - the generated CSS selector
|
|
100
|
+
*/
|
|
101
|
+
export declare function expanded(bool?: boolean | null): string;
|
|
102
|
+
/**
|
|
103
|
+
* Returns a NodeList of HTMLElements within the given element that are focusable
|
|
104
|
+
* @param el - the element whose focusable children will be returned
|
|
105
|
+
* @returns - the elements within the given element that are focusable
|
|
106
|
+
*/
|
|
107
|
+
export declare function getFocusables(el?: HTMLElement | null): HTMLElement[];
|
|
108
|
+
/**
|
|
109
|
+
* Returns true if an element is focusable and false if not,
|
|
110
|
+
* based on styles (i.e. a parent has display: none;)
|
|
111
|
+
* NOTE: Still need to determine what other styles may make an element un-focusable
|
|
112
|
+
* @param el - the element
|
|
113
|
+
* @returns - true if the element is focusable; false if not
|
|
114
|
+
*/
|
|
115
|
+
export declare function isFocusable(el: HTMLElement): boolean;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
const $ = "mint", u = `${$}-`, o = "[disabled]", l = "[aria-controls]", d = "[aria-expanded]", c = "[href]", f = "[routerLink]", p = "[id]", b = `button${l}`, m = `${b} + ul${p}`, r = '[tabindex^="-"]', x = `[tabindex]${e(r)}`, i = `input${e(o)}${e(r)},
|
|
2
|
+
select${e(o)}${e(r)},
|
|
3
|
+
textarea${e(o)}${e(r)},
|
|
4
|
+
button${e(o)}${e(r)},
|
|
5
|
+
object${e(o)}${e(r)},
|
|
6
|
+
a${c}, a${f},
|
|
7
|
+
area${c}, ${x}`.replace(/\s/g, "");
|
|
8
|
+
function a(t) {
|
|
9
|
+
return t = t.toLowerCase(), t.startsWith(u) ? t : `${u}${t}`;
|
|
10
|
+
}
|
|
11
|
+
function y(t) {
|
|
12
|
+
return `--${a(t.replace(/^-+/, ""))}`;
|
|
13
|
+
}
|
|
14
|
+
function w(t) {
|
|
15
|
+
return `var(${y(t)})`;
|
|
16
|
+
}
|
|
17
|
+
function e(t) {
|
|
18
|
+
return `:not(${t})`;
|
|
19
|
+
}
|
|
20
|
+
function L(t) {
|
|
21
|
+
return `.${a(t)}`;
|
|
22
|
+
}
|
|
23
|
+
function g(t) {
|
|
24
|
+
return `#${a(t)}`;
|
|
25
|
+
}
|
|
26
|
+
function A(t) {
|
|
27
|
+
return t ? `[aria-controls="${a(t)}"]` : l;
|
|
28
|
+
}
|
|
29
|
+
function C(t) {
|
|
30
|
+
return typeof t == "boolean" ? `[aria-expanded="${t}"]` : d;
|
|
31
|
+
}
|
|
32
|
+
function k(t) {
|
|
33
|
+
let n;
|
|
34
|
+
return t ? n = Array.from(t.querySelectorAll(i)) : n = Array.from(document.querySelectorAll(i)), n.filter((s) => h(s));
|
|
35
|
+
}
|
|
36
|
+
function h(t) {
|
|
37
|
+
let n = t;
|
|
38
|
+
do {
|
|
39
|
+
if (window.getComputedStyle(n).getPropertyValue("display").toLowerCase() === "none")
|
|
40
|
+
return !1;
|
|
41
|
+
n = n.parentElement;
|
|
42
|
+
} while (n);
|
|
43
|
+
return !0;
|
|
44
|
+
}
|
|
45
|
+
export {
|
|
46
|
+
L as className,
|
|
47
|
+
A as controls,
|
|
48
|
+
y as cssPrefix,
|
|
49
|
+
w as cssVar,
|
|
50
|
+
o as disabled,
|
|
51
|
+
C as expanded,
|
|
52
|
+
i as focusable,
|
|
53
|
+
k as getFocusables,
|
|
54
|
+
l as hasControls,
|
|
55
|
+
d as hasExpanded,
|
|
56
|
+
p as hasId,
|
|
57
|
+
c as hasLink,
|
|
58
|
+
f as hasRouterLink,
|
|
59
|
+
g as id,
|
|
60
|
+
h as isFocusable,
|
|
61
|
+
$ as lib,
|
|
62
|
+
e as not,
|
|
63
|
+
r as notTabbable,
|
|
64
|
+
u as pre,
|
|
65
|
+
a as prefix,
|
|
66
|
+
m as subMenu,
|
|
67
|
+
b as subMenuButtons,
|
|
68
|
+
x as tabbable
|
|
69
|
+
};
|
package/package.json
CHANGED
|
@@ -1,69 +1,60 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"glob": "^11.0.3",
|
|
61
|
-
"madge": "^8.0.0",
|
|
62
|
-
"npm-run-all2": "^8.0.4",
|
|
63
|
-
"rimraf": "^6.1.0",
|
|
64
|
-
"typescript": "^5.9.3",
|
|
65
|
-
"typescript-eslint": "^8.46.2",
|
|
66
|
-
"vite": "^6.4.1",
|
|
67
|
-
"vite-plugin-dts": "^4.5.4"
|
|
68
|
-
}
|
|
2
|
+
"name": "@appartmint/tsm-mint",
|
|
3
|
+
"author": "App Art Mint LLC",
|
|
4
|
+
"version": "0.1.1",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"description": "TypeScript Modules from App Art Mint LLC",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"typescript",
|
|
10
|
+
"modules",
|
|
11
|
+
"app art mint",
|
|
12
|
+
"appartmint"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://github.com/App-Art-Mint/tsm-mint#readme",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/App-Art-Mint/tsm-mint.git"
|
|
18
|
+
},
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/App-Art-Mint/tsm-mint/issues"
|
|
21
|
+
},
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist/**/*.{js,d.ts}"
|
|
27
|
+
],
|
|
28
|
+
"exports": {
|
|
29
|
+
"./*": {
|
|
30
|
+
"types": "./dist/*.d.ts",
|
|
31
|
+
"import": "./dist/*.es.js",
|
|
32
|
+
"require": "./dist/*.cjs.js",
|
|
33
|
+
"default": "./dist/*.es.js"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"version": "npm i && git add -A",
|
|
38
|
+
"postversion": "git push && git push --tags && cross-replace gh release create \"v$npm_package_version\" --generate-notes",
|
|
39
|
+
"prepare": "run-s build",
|
|
40
|
+
"build": "run-p test:types build:prod",
|
|
41
|
+
"build:prod": "vite build",
|
|
42
|
+
"clean": "rimraf dist",
|
|
43
|
+
"test:types": "tsc -b",
|
|
44
|
+
"test:circular": "madge --circular --extensions ts .",
|
|
45
|
+
"lint": "eslint --fix ."
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@types/node": "^24.9.2",
|
|
49
|
+
"cross-replace": "^0.2.0",
|
|
50
|
+
"eslint": "^9.39.0",
|
|
51
|
+
"glob": "^11.0.3",
|
|
52
|
+
"madge": "^8.0.0",
|
|
53
|
+
"npm-run-all2": "^8.0.4",
|
|
54
|
+
"rimraf": "^6.1.0",
|
|
55
|
+
"typescript": "^5.9.3",
|
|
56
|
+
"typescript-eslint": "^8.46.2",
|
|
57
|
+
"vite": "^6.4.1",
|
|
58
|
+
"vite-plugin-dts": "^4.5.4"
|
|
59
|
+
}
|
|
69
60
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./attaches-events.cjs.js");exports.AttachesEvents=t.AttachesEvents;
|
package/dist/abstract/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './attaches-events';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../util/math.cjs.js"),i=[1,2,3,4],r=i[0],t=i[i.length-1];function e(u){return n.clamp(u,r,t)}exports.gridNum=e;exports.gridNumMax=t;exports.gridNumMin=r;exports.gridNums=i;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./grid.cjs.js"),i=require("./title.cjs.js");exports.gridNum=t.gridNum;exports.gridNumMax=t.gridNumMax;exports.gridNumMin=t.gridNumMin;exports.gridNums=t.gridNums;exports.titleNum=i.titleNum;exports.titleNumMax=i.titleNumMax;exports.titleNumMin=i.titleNumMin;exports.titleNums=i.titleNums;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { gridNum as t, gridNumMax as r, gridNumMin as u, gridNums as N } from "./grid.es.js";
|
|
2
|
-
import { titleNum as d, titleNumMax as g, titleNumMin as l, titleNums as o } from "./title.es.js";
|
|
3
|
-
export {
|
|
4
|
-
t as gridNum,
|
|
5
|
-
r as gridNumMax,
|
|
6
|
-
u as gridNumMin,
|
|
7
|
-
N as gridNums,
|
|
8
|
-
d as titleNum,
|
|
9
|
-
g as titleNumMax,
|
|
10
|
-
l as titleNumMin,
|
|
11
|
-
o as titleNums
|
|
12
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../util/math.cjs.js"),t=[1,2,3,4,5,6],e=t[0],i=t[t.length-1];function n(u){return l.clamp(u,e,i)}exports.titleNum=n;exports.titleNumMax=i;exports.titleNumMin=e;exports.titleNums=t;
|
package/dist/index.cjs.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./abstract/attaches-events.cjs.js"),e=require("./components/grid.cjs.js"),i=require("./components/title.cjs.js"),a=require("./types/box.cjs.js"),m=require("./types/time.cjs.js"),c=require("./util/async.cjs.js"),s=require("./util/display.cjs.js"),n=require("./util/event.cjs.js"),r=require("./util/math.cjs.js"),o=require("./util/scroll.cjs.js"),t=require("./util/text.cjs.js"),l=require("./util/window.cjs.js");exports.AttachesEvents=u.AttachesEvents;exports.gridNum=e.gridNum;exports.gridNumMax=e.gridNumMax;exports.gridNumMin=e.gridNumMin;exports.gridNums=e.gridNums;exports.titleNum=i.titleNum;exports.titleNumMax=i.titleNumMax;exports.titleNumMin=i.titleNumMin;exports.titleNums=i.titleNums;exports.boxPositions=a.boxPositions;exports.durationDefault=m.durationDefault;exports.wait=c.wait;exports.hideElement=s.hideElement;exports.showElement=s.showElement;exports.debounce=n.debounce;exports.debounceEvent=n.debounceEvent;exports.throttle=n.throttle;exports.throttleEvent=n.throttleEvent;exports.clamp=r.clamp;exports.randomInt=r.randomInt;exports.scrollTo=o.scrollTo;exports.showElements=o.showElements;exports.showElementsOnScroll=o.showElementsOnScroll;exports.copyText=t.copyText;exports.formatPhone=t.formatPhone;exports.generateId=t.generateId;exports.isEmail=t.isEmail;exports.isImage=t.isImage;exports.isVideo=t.isVideo;exports.plural=t.plural;exports.slug=t.slug;exports.titleCase=t.titleCase;exports.truncate=t.truncate;exports.unslug=t.unslug;exports.windowHeight=l.windowHeight;exports.windowWidth=l.windowWidth;
|
package/dist/index.d.ts
DELETED
package/dist/index.es.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { AttachesEvents as o } from "./abstract/attaches-events.es.js";
|
|
2
|
-
import { gridNum as m, gridNumMax as i, gridNumMin as l, gridNums as n } from "./components/grid.es.js";
|
|
3
|
-
import { titleNum as u, titleNumMax as x, titleNumMin as a, titleNums as p } from "./components/title.es.js";
|
|
4
|
-
import { boxPositions as f } from "./types/box.es.js";
|
|
5
|
-
import { durationDefault as g } from "./types/time.es.js";
|
|
6
|
-
import { wait as w } from "./util/async.es.js";
|
|
7
|
-
import { hideElement as N, showElement as M } from "./util/display.es.js";
|
|
8
|
-
import { debounce as v, debounceEvent as I, throttle as P, throttleEvent as T } from "./util/event.es.js";
|
|
9
|
-
import { clamp as A, randomInt as C } from "./util/math.es.js";
|
|
10
|
-
import { scrollTo as H, showElements as O, showElementsOnScroll as S } from "./util/scroll.es.js";
|
|
11
|
-
import { copyText as W, formatPhone as j, generateId as k, isEmail as q, isImage as z, isVideo as B, plural as F, slug as G, titleCase as J, truncate as K, unslug as L } from "./util/text.es.js";
|
|
12
|
-
import { windowHeight as R, windowWidth as U } from "./util/window.es.js";
|
|
13
|
-
export {
|
|
14
|
-
o as AttachesEvents,
|
|
15
|
-
f as boxPositions,
|
|
16
|
-
A as clamp,
|
|
17
|
-
W as copyText,
|
|
18
|
-
v as debounce,
|
|
19
|
-
I as debounceEvent,
|
|
20
|
-
g as durationDefault,
|
|
21
|
-
j as formatPhone,
|
|
22
|
-
k as generateId,
|
|
23
|
-
m as gridNum,
|
|
24
|
-
i as gridNumMax,
|
|
25
|
-
l as gridNumMin,
|
|
26
|
-
n as gridNums,
|
|
27
|
-
N as hideElement,
|
|
28
|
-
q as isEmail,
|
|
29
|
-
z as isImage,
|
|
30
|
-
B as isVideo,
|
|
31
|
-
F as plural,
|
|
32
|
-
C as randomInt,
|
|
33
|
-
H as scrollTo,
|
|
34
|
-
M as showElement,
|
|
35
|
-
O as showElements,
|
|
36
|
-
S as showElementsOnScroll,
|
|
37
|
-
G as slug,
|
|
38
|
-
P as throttle,
|
|
39
|
-
T as throttleEvent,
|
|
40
|
-
J as titleCase,
|
|
41
|
-
u as titleNum,
|
|
42
|
-
x as titleNumMax,
|
|
43
|
-
a as titleNumMin,
|
|
44
|
-
p as titleNums,
|
|
45
|
-
K as truncate,
|
|
46
|
-
L as unslug,
|
|
47
|
-
w as wait,
|
|
48
|
-
R as windowHeight,
|
|
49
|
-
U as windowWidth
|
|
50
|
-
};
|
package/dist/types/box.cjs.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=["top","right","bottom","left"];exports.boxPositions=o;
|
package/dist/types/box.d.ts
DELETED
package/dist/types/index.cjs.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./box.cjs.js"),e=require("./time.cjs.js");exports.boxPositions=t.boxPositions;exports.durationDefault=e.durationDefault;
|
package/dist/types/index.d.ts
DELETED
package/dist/types/index.es.js
DELETED
package/dist/util/index.cjs.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./async.cjs.js"),o=require("./display.cjs.js"),t=require("./event.cjs.js"),n=require("./math.cjs.js"),l=require("./scroll.cjs.js"),e=require("./text.cjs.js"),i=require("./window.cjs.js");exports.wait=r.wait;exports.hideElement=o.hideElement;exports.showElement=o.showElement;exports.debounce=t.debounce;exports.debounceEvent=t.debounceEvent;exports.throttle=t.throttle;exports.throttleEvent=t.throttleEvent;exports.clamp=n.clamp;exports.randomInt=n.randomInt;exports.scrollTo=l.scrollTo;exports.showElements=l.showElements;exports.showElementsOnScroll=l.showElementsOnScroll;exports.copyText=e.copyText;exports.formatPhone=e.formatPhone;exports.generateId=e.generateId;exports.isEmail=e.isEmail;exports.isImage=e.isImage;exports.isVideo=e.isVideo;exports.plural=e.plural;exports.slug=e.slug;exports.titleCase=e.titleCase;exports.truncate=e.truncate;exports.unslug=e.unslug;exports.windowHeight=i.windowHeight;exports.windowWidth=i.windowWidth;
|
package/dist/util/index.d.ts
DELETED
package/dist/util/index.es.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { wait as t } from "./async.es.js";
|
|
2
|
-
import { hideElement as l, showElement as n } from "./display.es.js";
|
|
3
|
-
import { debounce as i, debounceEvent as s, throttle as a, throttleEvent as p } from "./event.es.js";
|
|
4
|
-
import { clamp as h, randomInt as f } from "./math.es.js";
|
|
5
|
-
import { scrollTo as x, showElements as c, showElementsOnScroll as u } from "./scroll.es.js";
|
|
6
|
-
import { copyText as g, formatPhone as I, generateId as b, isEmail as v, isImage as T, isVideo as y, plural as C, slug as H, titleCase as O, truncate as P, unslug as S } from "./text.es.js";
|
|
7
|
-
import { windowHeight as W, windowWidth as j } from "./window.es.js";
|
|
8
|
-
export {
|
|
9
|
-
h as clamp,
|
|
10
|
-
g as copyText,
|
|
11
|
-
i as debounce,
|
|
12
|
-
s as debounceEvent,
|
|
13
|
-
I as formatPhone,
|
|
14
|
-
b as generateId,
|
|
15
|
-
l as hideElement,
|
|
16
|
-
v as isEmail,
|
|
17
|
-
T as isImage,
|
|
18
|
-
y as isVideo,
|
|
19
|
-
C as plural,
|
|
20
|
-
f as randomInt,
|
|
21
|
-
x as scrollTo,
|
|
22
|
-
n as showElement,
|
|
23
|
-
c as showElements,
|
|
24
|
-
u as showElementsOnScroll,
|
|
25
|
-
H as slug,
|
|
26
|
-
a as throttle,
|
|
27
|
-
p as throttleEvent,
|
|
28
|
-
O as titleCase,
|
|
29
|
-
P as truncate,
|
|
30
|
-
S as unslug,
|
|
31
|
-
t as wait,
|
|
32
|
-
W as windowHeight,
|
|
33
|
-
j as windowWidth
|
|
34
|
-
};
|
|
File without changes
|
|
File without changes
|