@appartmint/mint 5.0.3 → 5.0.5
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/imports/abstract/attaches-events.cjs.js +1 -0
- package/dist/{js/imports → imports}/abstract/attaches-events.d.ts +0 -4
- package/dist/imports/abstract/attaches-events.esm.js +23 -0
- package/dist/imports/abstract/index.cjs.js +1 -0
- package/dist/{js/imports → imports}/abstract/index.d.ts +0 -1
- package/dist/imports/abstract/index.esm.js +2 -0
- package/dist/imports/components/grid.cjs.js +1 -0
- package/dist/imports/components/grid.d.ts +9 -0
- package/dist/imports/components/grid.esm.js +7 -0
- package/dist/imports/components/header.cjs.js +1 -0
- package/dist/{js/imports → imports}/components/header.d.ts +12 -13
- package/dist/imports/components/header.esm.js +31 -0
- package/dist/imports/components/index.cjs.js +1 -0
- package/dist/{js/imports → imports}/components/index.d.ts +0 -1
- package/dist/imports/components/index.esm.js +5 -0
- package/dist/imports/components/menu.cjs.js +1 -0
- package/dist/{js/imports → imports}/components/menu.d.ts +9 -7
- package/dist/imports/components/menu.esm.js +119 -0
- package/dist/imports/components/panel.cjs.js +1 -0
- package/dist/{js/imports → imports}/components/panel.d.ts +15 -4
- package/dist/imports/components/panel.esm.js +88 -0
- package/dist/imports/enums/index.cjs.js +1 -0
- package/dist/{js/imports → imports}/enums/index.d.ts +0 -1
- package/dist/imports/enums/index.esm.js +2 -0
- package/dist/imports/enums/side.cjs.js +1 -0
- package/dist/{js/imports → imports}/enums/side.d.ts +0 -1
- package/dist/imports/enums/side.esm.js +6 -0
- package/dist/imports/index.cjs.js +1 -0
- package/dist/{js/imports → imports}/index.d.ts +0 -1
- package/dist/imports/index.esm.js +23 -0
- package/dist/imports/models/color.cjs.js +1 -0
- package/dist/{js/imports → imports}/models/color.d.ts +1 -4
- package/dist/imports/models/color.esm.js +48 -0
- package/dist/imports/models/event.cjs.js +1 -0
- package/dist/{js/imports → imports}/models/event.d.ts +0 -1
- package/dist/imports/models/event.esm.js +0 -0
- package/dist/imports/models/file.cjs.js +1 -0
- package/dist/{js/imports → imports}/models/file.d.ts +2 -7
- package/dist/imports/models/file.esm.js +0 -0
- package/dist/imports/models/index.cjs.js +1 -0
- package/dist/{js/imports → imports}/models/index.d.ts +0 -1
- package/dist/imports/models/index.esm.js +3 -0
- package/dist/imports/models/item.cjs.js +1 -0
- package/dist/{js/imports → imports}/models/item.d.ts +6 -14
- package/dist/imports/models/item.esm.js +45 -0
- package/dist/imports/models/minify.cjs.js +1 -0
- package/dist/{js/imports → imports}/models/minify.d.ts +0 -1
- package/dist/imports/models/minify.esm.js +0 -0
- package/dist/imports/models/page.cjs.js +1 -0
- package/dist/{js/imports → imports}/models/page.d.ts +1 -5
- package/dist/imports/models/page.esm.js +0 -0
- package/dist/imports/models/primitive.cjs.js +1 -0
- package/dist/{js/imports → imports}/models/primitive.d.ts +0 -1
- package/dist/imports/models/primitive.esm.js +0 -0
- package/dist/imports/models/recaptcha.cjs.js +1 -0
- package/dist/{js/imports → imports}/models/recaptcha.d.ts +0 -1
- package/dist/imports/models/recaptcha.esm.js +0 -0
- package/dist/imports/util/async.cjs.js +1 -0
- package/dist/imports/util/async.d.ts +10 -0
- package/dist/imports/util/async.esm.js +6 -0
- package/dist/imports/util/display.cjs.js +1 -0
- package/dist/{js/imports → imports}/util/display.d.ts +4 -8
- package/dist/imports/util/display.esm.js +26 -0
- package/dist/imports/util/event.cjs.js +1 -0
- package/dist/{js/imports → imports}/util/event.d.ts +8 -11
- package/dist/imports/util/event.esm.js +31 -0
- package/dist/imports/util/icon.cjs.js +1 -0
- package/dist/imports/util/icon.d.ts +23 -0
- package/dist/imports/util/icon.esm.js +33 -0
- package/dist/imports/util/index.cjs.js +1 -0
- package/dist/{js/imports → imports}/util/index.d.ts +0 -1
- package/dist/imports/util/index.esm.js +13 -0
- package/dist/imports/util/list.cjs.js +1 -0
- package/dist/{js/imports → imports}/util/list.d.ts +5 -6
- package/dist/imports/util/list.esm.js +21 -0
- package/dist/imports/util/math.cjs.js +1 -0
- package/dist/{js/imports → imports}/util/math.d.ts +7 -8
- package/dist/imports/util/math.esm.js +16 -0
- package/dist/imports/util/object.cjs.js +1 -0
- package/dist/{js/imports → imports}/util/object.d.ts +16 -17
- package/dist/imports/util/object.esm.js +115 -0
- package/dist/imports/util/scroll.cjs.js +1 -0
- package/dist/{js/imports → imports}/util/scroll.d.ts +6 -7
- package/dist/imports/util/scroll.esm.js +26 -0
- package/dist/imports/util/selectors.cjs.js +8 -0
- package/dist/{js/imports → imports}/util/selectors.d.ts +26 -69
- package/dist/imports/util/selectors.esm.js +63 -0
- package/dist/imports/util/settings.cjs.js +1 -0
- package/dist/imports/util/settings.d.ts +38 -0
- package/dist/imports/util/settings.esm.js +43 -0
- package/dist/imports/util/text.cjs.js +8 -0
- package/dist/{js/imports → imports}/util/text.d.ts +13 -14
- package/dist/imports/util/text.esm.js +75 -0
- package/dist/imports/util/window.cjs.js +1 -0
- package/dist/{js/imports → imports}/util/window.d.ts +4 -5
- package/dist/imports/util/window.esm.js +13 -0
- package/dist/index.cjs.js +1 -0
- package/dist/{js/index.d.ts → index.d.ts} +0 -1
- package/dist/index.esm.js +22 -0
- package/dist/{css/mint.css → mint.css} +1 -4
- package/dist/mint.css.map +1 -0
- package/dist/mint.min.css +1 -0
- package/dist/mint.min.css.map +1 -0
- package/dist/noscript.css +5 -0
- package/dist/noscript.css.map +1 -0
- package/dist/noscript.min.css +1 -0
- package/dist/noscript.min.css.map +1 -0
- package/package.json +86 -67
- package/src/scss/imports/util/_vars.scss +12 -12
- package/dist/css/mint.css.map +0 -1
- package/dist/css/mint.min.css +0 -3
- package/dist/css/mint.min.css.map +0 -1
- package/dist/css/noscript.css +0 -8
- package/dist/css/noscript.css.map +0 -1
- package/dist/css/noscript.min.css +0 -3
- package/dist/css/noscript.min.css.map +0 -1
- package/dist/js/imports/abstract/attaches-events.d.ts.map +0 -1
- package/dist/js/imports/abstract/index.d.ts.map +0 -1
- package/dist/js/imports/components/grid.d.ts +0 -10
- package/dist/js/imports/components/grid.d.ts.map +0 -1
- package/dist/js/imports/components/header.d.ts.map +0 -1
- package/dist/js/imports/components/index.d.ts.map +0 -1
- package/dist/js/imports/components/menu.d.ts.map +0 -1
- package/dist/js/imports/components/panel.d.ts.map +0 -1
- package/dist/js/imports/enums/index.d.ts.map +0 -1
- package/dist/js/imports/enums/side.d.ts.map +0 -1
- package/dist/js/imports/index.d.ts.map +0 -1
- package/dist/js/imports/models/color.d.ts.map +0 -1
- package/dist/js/imports/models/event.d.ts.map +0 -1
- package/dist/js/imports/models/file.d.ts.map +0 -1
- package/dist/js/imports/models/index.d.ts.map +0 -1
- package/dist/js/imports/models/item.d.ts.map +0 -1
- package/dist/js/imports/models/minify.d.ts.map +0 -1
- package/dist/js/imports/models/page.d.ts.map +0 -1
- package/dist/js/imports/models/primitive.d.ts.map +0 -1
- package/dist/js/imports/models/recaptcha.d.ts.map +0 -1
- package/dist/js/imports/util/async.d.ts +0 -11
- package/dist/js/imports/util/async.d.ts.map +0 -1
- package/dist/js/imports/util/display.d.ts.map +0 -1
- package/dist/js/imports/util/event.d.ts.map +0 -1
- package/dist/js/imports/util/icon.d.ts +0 -29
- package/dist/js/imports/util/icon.d.ts.map +0 -1
- package/dist/js/imports/util/index.d.ts.map +0 -1
- package/dist/js/imports/util/list.d.ts.map +0 -1
- package/dist/js/imports/util/math.d.ts.map +0 -1
- package/dist/js/imports/util/object.d.ts.map +0 -1
- package/dist/js/imports/util/scroll.d.ts.map +0 -1
- package/dist/js/imports/util/selectors.d.ts.map +0 -1
- package/dist/js/imports/util/settings.d.ts +0 -39
- package/dist/js/imports/util/settings.d.ts.map +0 -1
- package/dist/js/imports/util/text.d.ts.map +0 -1
- package/dist/js/imports/util/window.d.ts.map +0 -1
- package/dist/js/index.d.ts.map +0 -1
- package/dist/js/index.js +0 -2455
- package/dist/js/index.js.map +0 -1
- package/dist/js/index.min.js +0 -2
- package/dist/js/index.min.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Object functions for the util library
|
|
3
3
|
*/
|
|
4
|
-
export declare
|
|
4
|
+
export declare const MintObject: {
|
|
5
5
|
/**
|
|
6
6
|
* Returns true if the provided objects have the same entries
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
isSimilar(obj1: Record<string, unknown>, obj2: Record<string, unknown>): boolean;
|
|
9
9
|
/**
|
|
10
10
|
* Returns true if the first object has at least the same
|
|
11
11
|
* entries as the second object
|
|
@@ -13,69 +13,68 @@ export declare abstract class MintObject {
|
|
|
13
13
|
* @param subset - the object whose entries are required
|
|
14
14
|
* @returns - true if the first object is a superset of the second
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
isSuperset(superset: unknown, subset: unknown): boolean;
|
|
17
17
|
/**
|
|
18
18
|
* Removes object entries by key
|
|
19
19
|
* @see mintObject.removeKeys
|
|
20
20
|
* @param object - the object to remove entries from
|
|
21
21
|
* @param keys - the keys to remove
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
remove(object: Record<string, unknown>, keys: string[]): Record<string, unknown>;
|
|
24
24
|
/**
|
|
25
25
|
* Removes object entries by key
|
|
26
26
|
* @param object - the object to remove entries from
|
|
27
27
|
* @param keys - the keys to remove
|
|
28
28
|
*/
|
|
29
|
-
|
|
29
|
+
removeKeys(object: Record<string, unknown>, keys: string[]): Record<string, unknown>;
|
|
30
30
|
/**
|
|
31
31
|
* Removes object entries by value
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
removeValues(object: Record<string, unknown>, values: unknown[]): Record<string, unknown>;
|
|
34
34
|
/**
|
|
35
35
|
* Sorts an object's entries alphabetically by key
|
|
36
36
|
*/
|
|
37
|
-
|
|
37
|
+
sort(object: Record<string, unknown>, compareFn?: (a: string, b: string) => number): Record<string, unknown>;
|
|
38
38
|
/**
|
|
39
39
|
* Sorts an object's entries alphabetically by key
|
|
40
40
|
*/
|
|
41
|
-
|
|
41
|
+
sortKeys(object: Record<string, unknown>, compareFn?: (a: string, b: string) => number): Record<string, unknown>;
|
|
42
42
|
/**
|
|
43
43
|
* Sorts an object's entries alphabetically by value
|
|
44
44
|
*/
|
|
45
|
-
|
|
45
|
+
sortValues(object: Record<string, unknown>, compareFn: (a: unknown, b: unknown) => number): Record<string, unknown>;
|
|
46
46
|
/**
|
|
47
47
|
* @see mintObject.filterKeys
|
|
48
48
|
*/
|
|
49
|
-
|
|
49
|
+
filter(object: Record<string, unknown>, keys: string[]): Record<string, unknown>;
|
|
50
50
|
/**
|
|
51
51
|
* Filters an object by its keys
|
|
52
52
|
* @param object - the object to filter
|
|
53
53
|
* @param keys - the keys to keep
|
|
54
54
|
* @returns - the filtered object
|
|
55
55
|
*/
|
|
56
|
-
|
|
56
|
+
filterKeys(object: Record<string, unknown>, keys: string[]): Record<string, unknown>;
|
|
57
57
|
/**
|
|
58
58
|
* Filters an object by its values
|
|
59
59
|
* @param object - the object to filter
|
|
60
60
|
* @param values - the values to keep
|
|
61
61
|
* @returns - the filtered object
|
|
62
62
|
*/
|
|
63
|
-
|
|
63
|
+
filterValues(object: Record<string, unknown>, values: unknown[]): Record<string, unknown>;
|
|
64
64
|
/**
|
|
65
65
|
* Update two sets of objects
|
|
66
66
|
* @param original - the original object
|
|
67
67
|
* @param update - the object to update the original with
|
|
68
68
|
* @returns - the original objects with updated data from the update
|
|
69
69
|
*/
|
|
70
|
-
|
|
70
|
+
updateArray(original: Record<string, unknown>[], update?: Record<string, unknown>[], key?: string): void;
|
|
71
71
|
/**
|
|
72
72
|
* Get an object's key by value
|
|
73
73
|
*/
|
|
74
|
-
|
|
74
|
+
getKeyByValue(object: Record<string, unknown>, value: unknown): string | undefined;
|
|
75
75
|
/**
|
|
76
76
|
* Create a deep copy of an object
|
|
77
77
|
*/
|
|
78
|
-
|
|
79
|
-
}
|
|
78
|
+
deepClone<T>(object: T): T;
|
|
79
|
+
};
|
|
80
80
|
export default MintObject;
|
|
81
|
-
//# sourceMappingURL=object.d.ts.map
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
//#region src/ts/imports/util/object.ts
|
|
2
|
+
var e = {
|
|
3
|
+
isSimilar(e, t) {
|
|
4
|
+
let n = Object.keys(e);
|
|
5
|
+
if (n.length !== Object.keys(t).length) return !1;
|
|
6
|
+
let r = !0;
|
|
7
|
+
return n.forEach((n) => {
|
|
8
|
+
e[n] !== t[n] && (r = !1);
|
|
9
|
+
}), r;
|
|
10
|
+
},
|
|
11
|
+
isSuperset(t, n) {
|
|
12
|
+
let r = !0;
|
|
13
|
+
if (t === n) return r;
|
|
14
|
+
try {
|
|
15
|
+
if (Object.keys(n).length === 0) return !r;
|
|
16
|
+
} catch {
|
|
17
|
+
return !r;
|
|
18
|
+
}
|
|
19
|
+
let i = n, a = t ?? {};
|
|
20
|
+
return Object.keys(i).forEach((t) => {
|
|
21
|
+
r &&= e.isSuperset(a[t], i[t]);
|
|
22
|
+
}), r;
|
|
23
|
+
},
|
|
24
|
+
remove(t, n) {
|
|
25
|
+
return e.removeKeys(t, n);
|
|
26
|
+
},
|
|
27
|
+
removeKeys(e, t) {
|
|
28
|
+
return Object.keys(e).reduce((n, r) => (t.includes(r) || (n[r] = e[r]), n), {});
|
|
29
|
+
},
|
|
30
|
+
removeValues(e, t) {
|
|
31
|
+
return Object.keys(e).reduce((n, r) => (t.includes(e[r]) || (n[r] = e[r]), n), {});
|
|
32
|
+
},
|
|
33
|
+
sort(t, n) {
|
|
34
|
+
return e.sortKeys(t, n);
|
|
35
|
+
},
|
|
36
|
+
sortKeys(e, t) {
|
|
37
|
+
return Object.keys(e).sort(t).reduce((t, n) => (t[n] = e[n], t), {});
|
|
38
|
+
},
|
|
39
|
+
sortValues(e, t) {
|
|
40
|
+
return Object.keys(e).sort((n, r) => t(e[n], e[r])).reduce((t, n) => (t[n] = e[n], t), {});
|
|
41
|
+
},
|
|
42
|
+
filter(t, n) {
|
|
43
|
+
return e.filterKeys(t, n);
|
|
44
|
+
},
|
|
45
|
+
filterKeys(e, t) {
|
|
46
|
+
return t.reduce((t, n) => (t[n] = e[n], t), {});
|
|
47
|
+
},
|
|
48
|
+
filterValues(e, t) {
|
|
49
|
+
return Object.keys(e).reduce((n, r) => (t.includes(e[r]) && (n[r] = e[r]), n), {});
|
|
50
|
+
},
|
|
51
|
+
updateArray(e, t, n = "id") {
|
|
52
|
+
let r = (e) => typeof e == "string" || typeof e == "number" ? String(e) : "";
|
|
53
|
+
if (!t?.length) return;
|
|
54
|
+
let i = t.reduce((e, t) => ({
|
|
55
|
+
...e,
|
|
56
|
+
[r(t[n])]: t
|
|
57
|
+
}), {});
|
|
58
|
+
e.filter((e) => !(r(e[n]) in i)).forEach((t) => {
|
|
59
|
+
let n = e.indexOf(t);
|
|
60
|
+
n !== -1 && e.splice(n, 1);
|
|
61
|
+
}), e.forEach((e) => {
|
|
62
|
+
let t = r(e[n]);
|
|
63
|
+
t in i && Object.assign(e, i[t]);
|
|
64
|
+
}), t.filter((t) => !e.some((e) => e[n] === t[n])).forEach((t) => e.push(t));
|
|
65
|
+
},
|
|
66
|
+
getKeyByValue(e, t) {
|
|
67
|
+
return Object.keys(e).find((n) => e[n] === t);
|
|
68
|
+
},
|
|
69
|
+
deepClone(e) {
|
|
70
|
+
if (typeof e != "object" || !e) return e;
|
|
71
|
+
let t = /* @__PURE__ */ new WeakMap(), n = [[e, Array.isArray(e) ? [] : {}]];
|
|
72
|
+
for (; n.length;) {
|
|
73
|
+
let e = n.pop();
|
|
74
|
+
if (!e) break;
|
|
75
|
+
let [r, i, a] = e;
|
|
76
|
+
if (a !== void 0) {
|
|
77
|
+
let e = r[a];
|
|
78
|
+
if (typeof e == "function") {
|
|
79
|
+
i[a] = e.bind(i);
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
if (typeof e != "object" || !e) {
|
|
83
|
+
i[a] = e;
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
if (t.has(e)) {
|
|
87
|
+
i[a] = t.get(e);
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
i[a] = Array.isArray(e) ? [] : {}, t.set(e, i[a]), n.push([e, i[a]]);
|
|
91
|
+
} else {
|
|
92
|
+
if (t.set(r, i), Array.isArray(r)) {
|
|
93
|
+
r.forEach((e, t) => {
|
|
94
|
+
n.push([
|
|
95
|
+
r,
|
|
96
|
+
i,
|
|
97
|
+
t
|
|
98
|
+
]);
|
|
99
|
+
});
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
Object.keys(r).forEach((e) => {
|
|
103
|
+
n.push([
|
|
104
|
+
r,
|
|
105
|
+
i,
|
|
106
|
+
e
|
|
107
|
+
]);
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return t.get(e);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
//#endregion
|
|
115
|
+
export { e as MintObject, e as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./event.cjs.js");var t={toTop(){window.scrollTo(0,0)},toBottom(){window.scrollTo(0,document.body.scrollHeight)},showElements(){requestAnimationFrame(()=>{let e=document.querySelectorAll(`.mint-fall-in:not(.mint-show)`),t=[];for(let n of e)n.getBoundingClientRect().top<0?n.classList.add(`mint-show`):n.getBoundingClientRect().top<window.innerHeight*3/4&&t.push(n);for(let e=0;e<t.length;e++)setTimeout(()=>{t[e].classList.add(`mint-show`)},e*100)})},showElementsOnScroll(){window.addEventListener(`scroll`,e.MintEvent.throttleEvent(()=>{t.showElements()},200))}};exports.MintScroll=t,exports.default=t;
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Scroll functions
|
|
3
3
|
*/
|
|
4
|
-
export declare
|
|
4
|
+
export declare const MintScroll: {
|
|
5
5
|
/**
|
|
6
6
|
* Scroll to the top of the page
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
toTop(): void;
|
|
9
9
|
/**
|
|
10
10
|
* Scroll to the bottom of the page
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
toBottom(): void;
|
|
13
13
|
/**
|
|
14
14
|
* Show visible elements
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
showElements(): void;
|
|
17
17
|
/**
|
|
18
18
|
* Show visible elements on scroll
|
|
19
19
|
*/
|
|
20
|
-
|
|
21
|
-
}
|
|
20
|
+
showElementsOnScroll(): void;
|
|
21
|
+
};
|
|
22
22
|
export default MintScroll;
|
|
23
|
-
//# sourceMappingURL=scroll.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { MintEvent as e } from "./event.esm.js";
|
|
2
|
+
//#region src/ts/imports/util/scroll.ts
|
|
3
|
+
var t = {
|
|
4
|
+
toTop() {
|
|
5
|
+
window.scrollTo(0, 0);
|
|
6
|
+
},
|
|
7
|
+
toBottom() {
|
|
8
|
+
window.scrollTo(0, document.body.scrollHeight);
|
|
9
|
+
},
|
|
10
|
+
showElements() {
|
|
11
|
+
requestAnimationFrame(() => {
|
|
12
|
+
let e = document.querySelectorAll(".mint-fall-in:not(.mint-show)"), t = [];
|
|
13
|
+
for (let n of e) n.getBoundingClientRect().top < 0 ? n.classList.add("mint-show") : n.getBoundingClientRect().top < window.innerHeight * 3 / 4 && t.push(n);
|
|
14
|
+
for (let e = 0; e < t.length; e++) setTimeout(() => {
|
|
15
|
+
t[e].classList.add("mint-show");
|
|
16
|
+
}, e * 100);
|
|
17
|
+
});
|
|
18
|
+
},
|
|
19
|
+
showElementsOnScroll() {
|
|
20
|
+
window.addEventListener("scroll", e.throttleEvent(() => {
|
|
21
|
+
t.showElements();
|
|
22
|
+
}, 200));
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { t as MintScroll, t as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var e=`mint`,t=`${e}-`,n=`[disabled]`,r=`[aria-controls]`,i=`[aria-expanded]`,a=`[href]`,o=`[routerLink]`,s=`[id]`,c=`[tabindex^="-"]`;function l(e){return`:not(${e})`}var u=`[tabindex]${l(c)}`,d=`input${l(n)}${l(c)},
|
|
2
|
+
select${l(n)}${l(c)},
|
|
3
|
+
textarea${l(n)}${l(c)},
|
|
4
|
+
button${l(n)}${l(c)},
|
|
5
|
+
object${l(n)}${l(c)},
|
|
6
|
+
a${a}, a${o},
|
|
7
|
+
area${a},
|
|
8
|
+
${u}`.replace(/\s/g,``),f=`button${r}`,p={lib:e,pre:t,disabled:n,hasControls:r,hasExpanded:i,hasLink:a,hasRouterLink:o,hasId:s,notTabbable:c,tabbable:u,focusable:d,subMenuButtons:f,subMenu:`${f} + ul${s}`,prefix(e){return e=e.toLowerCase(),e.startsWith(t)?e:`${t}${e}`},cssPrefix(e){return`--${p.prefix(e.replace(/^-+/,``))}`},cssVar(e){return`var(${p.cssPrefix(e)})`},neg:l,class(e){return`.${p.prefix(e)}`},id(e){return`#${p.prefix(e)}`},controls(e){return e?`[aria-controls="${p.prefix(e)}"]`:r},expanded(e){return typeof e==`boolean`?`[aria-expanded="${String(e)}"]`:i},getFocusables(e){let t;return t=e?Array.from(e.querySelectorAll(d)):Array.from(document.querySelectorAll(d)),t.filter(e=>p.isFocusable(e))},isFocusable(e){let t=e;do{if(window.getComputedStyle(t).getPropertyValue(`display`).toLowerCase()===`none`)return!1;t=t.parentElement}while(t);return!0}};exports.MintSelectors=p,exports.default=p;
|
|
@@ -1,114 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*/
|
|
17
|
-
static disabled: string;
|
|
18
|
-
/**
|
|
19
|
-
* CSS-selector for elements with an aria-controls attribute
|
|
20
|
-
*/
|
|
21
|
-
static hasControls: string;
|
|
22
|
-
/**
|
|
23
|
-
* CSS-selector for elements with an aria-expanded attribute
|
|
24
|
-
*/
|
|
25
|
-
static hasExpanded: string;
|
|
26
|
-
/**
|
|
27
|
-
* CSS-selector for elements with an href attribute
|
|
28
|
-
*/
|
|
29
|
-
static hasLink: string;
|
|
30
|
-
/**
|
|
31
|
-
* CSS-selector for elements with a routerLink attribute
|
|
32
|
-
*/
|
|
33
|
-
static hasRouterLink: string;
|
|
34
|
-
/**
|
|
35
|
-
* CSS-selector for elements with an id attribute
|
|
36
|
-
*/
|
|
37
|
-
static hasId: string;
|
|
38
|
-
/**
|
|
39
|
-
* CSS-selector for elements that aren't tabbable (i.e. tabindex is negative)
|
|
40
|
-
*/
|
|
41
|
-
static notTabbable: string;
|
|
42
|
-
/**
|
|
43
|
-
* CSS-selector for elements that are tabbable (i.e. tabindex isn't negative)
|
|
44
|
-
*/
|
|
45
|
-
static tabbable: string;
|
|
46
|
-
/**
|
|
47
|
-
* CSS-selector for elements that can receive focus
|
|
48
|
-
*/
|
|
49
|
-
static focusable: string;
|
|
50
|
-
/**
|
|
51
|
-
* CSS-selector for submenu buttons
|
|
52
|
-
*/
|
|
53
|
-
static subMenuButtons: string;
|
|
54
|
-
/**
|
|
55
|
-
* CSS-selector for submenus
|
|
56
|
-
*/
|
|
57
|
-
static subMenu: string;
|
|
1
|
+
declare function neg(base: string): string;
|
|
2
|
+
export declare const MintSelectors: {
|
|
3
|
+
lib: string;
|
|
4
|
+
pre: string;
|
|
5
|
+
disabled: string;
|
|
6
|
+
hasControls: string;
|
|
7
|
+
hasExpanded: string;
|
|
8
|
+
hasLink: string;
|
|
9
|
+
hasRouterLink: string;
|
|
10
|
+
hasId: string;
|
|
11
|
+
notTabbable: string;
|
|
12
|
+
tabbable: string;
|
|
13
|
+
focusable: string;
|
|
14
|
+
subMenuButtons: string;
|
|
15
|
+
subMenu: string;
|
|
58
16
|
/**
|
|
59
17
|
* Adds the library prefix to the beginning of the provided string
|
|
60
18
|
* @param base - the string to be prefixed
|
|
61
19
|
* @returns - the provided string prefixed with the library name
|
|
62
20
|
*/
|
|
63
|
-
|
|
21
|
+
prefix(base: string): string;
|
|
64
22
|
/**
|
|
65
23
|
* Adds two dashes to the beginning of the provided string
|
|
66
24
|
* @param base - the string to be prefixed
|
|
67
25
|
* @returns - the provided string prefixed with two dashes
|
|
68
26
|
*/
|
|
69
|
-
|
|
27
|
+
cssPrefix(base: string): string;
|
|
70
28
|
/**
|
|
71
29
|
* Turns the provided string into a CSS variable call
|
|
72
30
|
* @param base - the name of the CSS variable to call
|
|
73
31
|
* @returns - the CSS variable call for the provided string
|
|
74
32
|
*/
|
|
75
|
-
|
|
33
|
+
cssVar(base: string): string;
|
|
76
34
|
/**
|
|
77
35
|
* Negates the provided CSS selector
|
|
78
36
|
* @param base - the CSS selector to negate
|
|
79
37
|
* @returns - the negated CSS selector
|
|
80
38
|
*/
|
|
81
|
-
|
|
39
|
+
neg: typeof neg;
|
|
82
40
|
/**
|
|
83
41
|
* Generates a class CSS selector
|
|
84
42
|
* @param base - the name of the class to generate
|
|
85
43
|
* @returns - the generated CSS selector
|
|
86
44
|
*/
|
|
87
|
-
|
|
45
|
+
class(base: string): string;
|
|
88
46
|
/**
|
|
89
47
|
* Generates an id CSS selector
|
|
90
48
|
* @param base - the name of the id to generate
|
|
91
49
|
* @returns - the generated CSS selector
|
|
92
50
|
*/
|
|
93
|
-
|
|
51
|
+
id(base: string): string;
|
|
94
52
|
/**
|
|
95
53
|
* Generates an aria-controls CSS selector
|
|
96
54
|
* @param id - the id of the controlled element
|
|
97
55
|
* @returns - the generated CSS selector
|
|
98
56
|
*/
|
|
99
|
-
|
|
57
|
+
controls(id?: string | null): string;
|
|
100
58
|
/**
|
|
101
59
|
* Generates an aria-expanded CSS selector
|
|
102
60
|
* @param bool - whether the element is expanded or not
|
|
103
61
|
* @returns - the generated CSS selector
|
|
104
62
|
*/
|
|
105
|
-
|
|
63
|
+
expanded(bool?: boolean | null): string;
|
|
106
64
|
/**
|
|
107
65
|
* Returns a NodeList of HTMLElements within the given element that are focusable
|
|
108
66
|
* @param el - the element whose focusable children will be returned
|
|
109
67
|
* @returns - the elements within the given element that are focusable
|
|
110
68
|
*/
|
|
111
|
-
|
|
69
|
+
getFocusables(el?: HTMLElement | null): HTMLElement[];
|
|
112
70
|
/**
|
|
113
71
|
* Returns true if an element is focusable and false if not,
|
|
114
72
|
* based on styles (i.e. a parent has display: none;)
|
|
@@ -116,7 +74,6 @@ export declare abstract class MintSelectors {
|
|
|
116
74
|
* @param el - the element
|
|
117
75
|
* @returns - true if the element is focusable; false if not
|
|
118
76
|
*/
|
|
119
|
-
|
|
120
|
-
}
|
|
77
|
+
isFocusable(el: HTMLElement): boolean;
|
|
78
|
+
};
|
|
121
79
|
export default MintSelectors;
|
|
122
|
-
//# sourceMappingURL=selectors.d.ts.map
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
//#region src/ts/imports/util/selectors.ts
|
|
2
|
+
var e = "mint", t = `${e}-`, n = "[disabled]", r = "[aria-controls]", i = "[aria-expanded]", a = "[href]", o = "[routerLink]", s = "[id]", c = "[tabindex^=\"-\"]";
|
|
3
|
+
function l(e) {
|
|
4
|
+
return `:not(${e})`;
|
|
5
|
+
}
|
|
6
|
+
var u = `[tabindex]${l(c)}`, d = `input${l(n)}${l(c)},
|
|
7
|
+
select${l(n)}${l(c)},
|
|
8
|
+
textarea${l(n)}${l(c)},
|
|
9
|
+
button${l(n)}${l(c)},
|
|
10
|
+
object${l(n)}${l(c)},
|
|
11
|
+
a${a}, a${o},
|
|
12
|
+
area${a},
|
|
13
|
+
${u}`.replace(/\s/g, ""), f = `button${r}`, p = {
|
|
14
|
+
lib: e,
|
|
15
|
+
pre: t,
|
|
16
|
+
disabled: n,
|
|
17
|
+
hasControls: r,
|
|
18
|
+
hasExpanded: i,
|
|
19
|
+
hasLink: a,
|
|
20
|
+
hasRouterLink: o,
|
|
21
|
+
hasId: s,
|
|
22
|
+
notTabbable: c,
|
|
23
|
+
tabbable: u,
|
|
24
|
+
focusable: d,
|
|
25
|
+
subMenuButtons: f,
|
|
26
|
+
subMenu: `${f} + ul${s}`,
|
|
27
|
+
prefix(e) {
|
|
28
|
+
return e = e.toLowerCase(), e.startsWith(t) ? e : `${t}${e}`;
|
|
29
|
+
},
|
|
30
|
+
cssPrefix(e) {
|
|
31
|
+
return `--${p.prefix(e.replace(/^-+/, ""))}`;
|
|
32
|
+
},
|
|
33
|
+
cssVar(e) {
|
|
34
|
+
return `var(${p.cssPrefix(e)})`;
|
|
35
|
+
},
|
|
36
|
+
neg: l,
|
|
37
|
+
class(e) {
|
|
38
|
+
return `.${p.prefix(e)}`;
|
|
39
|
+
},
|
|
40
|
+
id(e) {
|
|
41
|
+
return `#${p.prefix(e)}`;
|
|
42
|
+
},
|
|
43
|
+
controls(e) {
|
|
44
|
+
return e ? `[aria-controls="${p.prefix(e)}"]` : r;
|
|
45
|
+
},
|
|
46
|
+
expanded(e) {
|
|
47
|
+
return typeof e == "boolean" ? `[aria-expanded="${String(e)}"]` : i;
|
|
48
|
+
},
|
|
49
|
+
getFocusables(e) {
|
|
50
|
+
let t;
|
|
51
|
+
return t = e ? Array.from(e.querySelectorAll(d)) : Array.from(document.querySelectorAll(d)), t.filter((e) => p.isFocusable(e));
|
|
52
|
+
},
|
|
53
|
+
isFocusable(e) {
|
|
54
|
+
let t = e;
|
|
55
|
+
do {
|
|
56
|
+
if (window.getComputedStyle(t).getPropertyValue("display").toLowerCase() === "none") return !1;
|
|
57
|
+
t = t.parentElement;
|
|
58
|
+
} while (t);
|
|
59
|
+
return !0;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
//#endregion
|
|
63
|
+
export { p as MintSelectors, p as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var e={delayBase:0,delayStep:100,delay:{instant:0,fast:100,medFast:200,default:300,medSlow:400,slow:500},break:{z:0,xs:480,sm:768,md:1024,lg:1200,xl:1440},set(t){let n=!1;typeof t.delayBase==`number`&&(e.delayBase=t.delayBase,n=!0),typeof t.delayStep==`number`&&(e.delayStep=t.delayStep,n=!0),n&&e.setDelay(),t.delay&&Object.keys(t.delay).length&&Object.values(t.delay).every(e=>typeof e==`number`)&&(e.delay={...e.delay,...t.delay}),t.break&&Object.keys(t.break).length&&Object.values(t.break).every(e=>typeof e==`number`)&&(e.break={...e.break,...t.break})},setDelay(){e.delay={instant:e.delayBase+e.delayStep*0,fast:e.delayBase+e.delayStep*1,medFast:e.delayBase+e.delayStep*2,default:e.delayBase+e.delayStep*3,medSlow:e.delayBase+e.delayStep*4,slow:e.delayBase+e.delayStep*5}}};exports.MintSettings=e,exports.default=e;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Settings management
|
|
3
|
+
* @public
|
|
4
|
+
*/
|
|
5
|
+
export interface MintSettingsUpdate {
|
|
6
|
+
delayBase?: number;
|
|
7
|
+
delayStep?: number;
|
|
8
|
+
delay?: Record<string, number>;
|
|
9
|
+
break?: Record<string, number>;
|
|
10
|
+
}
|
|
11
|
+
export declare const MintSettings: {
|
|
12
|
+
/**
|
|
13
|
+
* Value added to all delay variables
|
|
14
|
+
*/
|
|
15
|
+
delayBase: number;
|
|
16
|
+
/**
|
|
17
|
+
* Value multiplied by delay variable index
|
|
18
|
+
*/
|
|
19
|
+
delayStep: number;
|
|
20
|
+
/**
|
|
21
|
+
* Delay variables
|
|
22
|
+
*/
|
|
23
|
+
delay: Record<string, number>;
|
|
24
|
+
/**
|
|
25
|
+
* Breakpoint variables
|
|
26
|
+
*/
|
|
27
|
+
break: Record<string, number>;
|
|
28
|
+
/**
|
|
29
|
+
* Update the provided settings variables
|
|
30
|
+
* @param settings - Object of settings variables to update
|
|
31
|
+
*/
|
|
32
|
+
set(settings: MintSettingsUpdate): void;
|
|
33
|
+
/**
|
|
34
|
+
* Updates the delay variables based on `delayBase` and `delayStep`
|
|
35
|
+
*/
|
|
36
|
+
setDelay(): void;
|
|
37
|
+
};
|
|
38
|
+
export default MintSettings;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
//#region src/ts/imports/util/settings.ts
|
|
2
|
+
var e = {
|
|
3
|
+
delayBase: 0,
|
|
4
|
+
delayStep: 100,
|
|
5
|
+
delay: {
|
|
6
|
+
instant: 0,
|
|
7
|
+
fast: 100,
|
|
8
|
+
medFast: 200,
|
|
9
|
+
default: 300,
|
|
10
|
+
medSlow: 400,
|
|
11
|
+
slow: 500
|
|
12
|
+
},
|
|
13
|
+
break: {
|
|
14
|
+
z: 0,
|
|
15
|
+
xs: 480,
|
|
16
|
+
sm: 768,
|
|
17
|
+
md: 1024,
|
|
18
|
+
lg: 1200,
|
|
19
|
+
xl: 1440
|
|
20
|
+
},
|
|
21
|
+
set(t) {
|
|
22
|
+
let n = !1;
|
|
23
|
+
typeof t.delayBase == "number" && (e.delayBase = t.delayBase, n = !0), typeof t.delayStep == "number" && (e.delayStep = t.delayStep, n = !0), n && e.setDelay(), t.delay && Object.keys(t.delay).length && Object.values(t.delay).every((e) => typeof e == "number") && (e.delay = {
|
|
24
|
+
...e.delay,
|
|
25
|
+
...t.delay
|
|
26
|
+
}), t.break && Object.keys(t.break).length && Object.values(t.break).every((e) => typeof e == "number") && (e.break = {
|
|
27
|
+
...e.break,
|
|
28
|
+
...t.break
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
setDelay() {
|
|
32
|
+
e.delay = {
|
|
33
|
+
instant: e.delayBase + e.delayStep * 0,
|
|
34
|
+
fast: e.delayBase + e.delayStep * 1,
|
|
35
|
+
medFast: e.delayBase + e.delayStep * 2,
|
|
36
|
+
default: e.delayBase + e.delayStep * 3,
|
|
37
|
+
medSlow: e.delayBase + e.delayStep * 4,
|
|
38
|
+
slow: e.delayBase + e.delayStep * 5
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
//#endregion
|
|
43
|
+
export { e as MintSettings, e as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e={truncate(e,t=100){return e.length>t?e.slice(0,t).trim()+`...`:e},slug(e){return e?.trim().toLowerCase().replace(/'/g,``).replace(/[^\w/-]+/g,`-`).replace(/-+/g,`-`).replace(/^-+|-+$/g,``).replace(/^\/+|\/+$/g,``)??``},unslug(t){return e.titleCase(t.replace(/[-/]+/g,` `))},phone(e){let t=e?.toString().trim()??``;if(t===`(`||t===``)return t;let n=t.replace(/\D/g,``),r=``;n.length>10&&(r+=`+${n.slice(0,n.length-10)} `,n=n.slice(n.length-10));let i=0;for(;i<n.length;i++){switch(i){case 0:r+=`(`;break;case 3:r+=`) `;break;case 6:r+=`-`;break}r+=n[i]}switch(t[t.length-1]){case`)`:i===3&&(r+=`) `);break;case`-`:i===6&&(r+=`-`);break}return r},plural(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`},titleCase(e){return e.toLowerCase().replace(/(?:^|\s)\S/g,e=>e.toUpperCase())},copyText(e){if(!e)return!1;let t=document.createElement(`textarea`);return t.value=e,t.style.cssText=`
|
|
2
|
+
position: fixed;
|
|
3
|
+
top: 0;
|
|
4
|
+
left: 0;
|
|
5
|
+
transform: translate(-100%, -100%);
|
|
6
|
+
opacity: 0;
|
|
7
|
+
z-index: -1;
|
|
8
|
+
`,document.body.appendChild(t),t.select(),t.setSelectionRange(0,99999),navigator.clipboard.writeText(t.value).then(()=>{document.body.removeChild(t)}).catch(()=>(document.body.removeChild(t),!1)),!0},isEmail(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},generateId(e=10){return Math.random().toString(36).substring(2,e+2)},isImage(e){return!!e?.match(/\.(jpe?g|png|webp|gif|svg)$/i)},isVideo(e){return!!e?.match(/\.(mp4|webm|ogg)$/i)}};exports.MintText=e;
|
|
@@ -1,61 +1,60 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Functions for analyzing and manipulating text.
|
|
3
3
|
*/
|
|
4
|
-
export declare
|
|
4
|
+
export declare const MintText: {
|
|
5
5
|
/**
|
|
6
6
|
* Shorten a string to the given length
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
truncate(text: string, length?: number): string;
|
|
9
9
|
/**
|
|
10
10
|
* Generate a slug from a string
|
|
11
11
|
* @param text - The string to slugify
|
|
12
12
|
* @returns The slugified string
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
slug(text?: string): string;
|
|
15
15
|
/**
|
|
16
16
|
* Generate a title from a slug
|
|
17
17
|
* @param slug - The slug to generate a title from
|
|
18
18
|
* @returns The title
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
unslug(slug: string): string;
|
|
21
21
|
/**
|
|
22
22
|
* Format a phone number
|
|
23
23
|
* @param phone - The phone number to format
|
|
24
24
|
* @returns The formatted phone number
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
phone(phone?: string | number): string;
|
|
27
27
|
/**
|
|
28
28
|
* Pluralize the given word
|
|
29
29
|
*/
|
|
30
|
-
|
|
30
|
+
plural(word: string): string;
|
|
31
31
|
/**
|
|
32
32
|
* Capitalize the first letter of the given word
|
|
33
33
|
*/
|
|
34
|
-
|
|
34
|
+
titleCase(text: string): string;
|
|
35
35
|
/**
|
|
36
36
|
* Copies the provided text to the clipboard
|
|
37
37
|
* @param text - the text to copy
|
|
38
38
|
* @returns - true if the text was successfully copied to the clipboard; else false
|
|
39
39
|
*/
|
|
40
|
-
|
|
40
|
+
copyText(text: string): boolean;
|
|
41
41
|
/**
|
|
42
42
|
* Tests the validity of an email address
|
|
43
43
|
* @see {@link https://stackoverflow.com/questions/201323/how-can-i-validate-an-email-address-using-a-regular-expression}
|
|
44
44
|
* @param text - the string to test
|
|
45
45
|
* @returns - true if the given string is an email address; false if not
|
|
46
46
|
*/
|
|
47
|
-
|
|
47
|
+
isEmail(text: string): boolean;
|
|
48
48
|
/**
|
|
49
49
|
* Generate a random string [a-z0-9]
|
|
50
50
|
*/
|
|
51
|
-
|
|
51
|
+
generateId(length?: number): string;
|
|
52
52
|
/**
|
|
53
53
|
* Check if the given string is an image url
|
|
54
54
|
*/
|
|
55
|
-
|
|
55
|
+
isImage(src?: string): boolean;
|
|
56
56
|
/**
|
|
57
57
|
* Check if the given string is a video url
|
|
58
58
|
*/
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=text.d.ts.map
|
|
59
|
+
isVideo(src?: string): boolean;
|
|
60
|
+
};
|