@appartmint/mint 0.15.11 → 1.0.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/css/mint.css +17 -17
- package/dist/css/mint.css.map +1 -1
- package/dist/css/mint.min.css +1 -1
- package/dist/css/mint.min.css.map +1 -1
- package/dist/js/imports/components/header.d.ts +2 -2
- package/dist/js/imports/components/header.d.ts.map +1 -1
- package/dist/js/imports/components/index.d.ts +5 -0
- package/dist/js/imports/components/index.d.ts.map +1 -0
- package/dist/js/imports/enums/index.d.ts +5 -0
- package/dist/js/imports/enums/index.d.ts.map +1 -0
- package/dist/js/imports/{enum.d.ts → enums/side.d.ts} +2 -2
- package/dist/js/imports/enums/side.d.ts.map +1 -0
- package/dist/js/imports/index.d.ts +8 -0
- package/dist/js/imports/index.d.ts.map +1 -0
- package/dist/js/imports/models/index.d.ts +6 -0
- package/dist/js/imports/models/index.d.ts.map +1 -0
- package/dist/js/imports/models/item.d.ts +6 -6
- package/dist/js/imports/util/display.d.ts +20 -2
- package/dist/js/imports/util/display.d.ts.map +1 -1
- package/dist/js/imports/util/event.d.ts +36 -2
- package/dist/js/imports/util/event.d.ts.map +1 -1
- package/dist/js/imports/util/icon.d.ts +2 -2
- package/dist/js/imports/util/index.d.ts +15 -0
- package/dist/js/imports/util/index.d.ts.map +1 -0
- package/dist/js/imports/util/list.d.ts +2 -2
- package/dist/js/imports/util/math.d.ts +2 -2
- package/dist/js/imports/util/object.d.ts +2 -2
- package/dist/js/imports/util/scroll.d.ts +2 -2
- package/dist/js/imports/util/selectors.d.ts +2 -2
- package/dist/js/imports/util/settings.d.ts +2 -2
- package/dist/js/imports/util/settings.d.ts.map +1 -1
- package/dist/js/imports/util/text.d.ts +15 -2
- package/dist/js/imports/util/text.d.ts.map +1 -1
- package/dist/js/imports/util/window.d.ts +7 -2
- package/dist/js/imports/util/window.d.ts.map +1 -1
- package/dist/js/index.d.ts +1 -16
- package/dist/js/index.d.ts.map +1 -1
- package/dist/js/index.js +541 -475
- package/dist/js/index.js.map +1 -1
- package/dist/js/index.min.js +1 -1
- package/dist/js/index.min.js.map +1 -1
- package/package.json +1 -1
- package/src/scss/imports/components/_buttons.scss +1 -1
- package/src/scss/imports/components/_cards.scss +6 -6
- package/src/scss/imports/global/_global.scss +2 -2
- package/src/scss/imports/global/_inputs.scss +1 -1
- package/src/ts/imports/components/header.ts +34 -29
- package/src/ts/imports/components/index.ts +4 -0
- package/src/ts/imports/enums/index.ts +4 -0
- package/src/ts/imports/{enum.ts → enums/side.ts} +1 -1
- package/src/ts/imports/index.ts +7 -0
- package/src/ts/imports/models/index.ts +5 -0
- package/src/ts/imports/models/item.ts +6 -6
- package/src/ts/imports/util/display.ts +67 -2
- package/src/ts/imports/util/event.ts +88 -2
- package/src/ts/imports/util/icon.ts +2 -2
- package/src/ts/imports/util/index.ts +14 -0
- package/src/ts/imports/util/list.ts +2 -2
- package/src/ts/imports/util/math.ts +2 -2
- package/src/ts/imports/util/object.ts +3 -3
- package/src/ts/imports/util/scroll.ts +2 -2
- package/src/ts/imports/util/selectors.ts +3 -3
- package/src/ts/imports/util/settings.ts +2 -3
- package/src/ts/imports/util/text.ts +43 -2
- package/src/ts/imports/util/window.ts +10 -3
- package/src/ts/index.ts +1 -25
- package/dist/js/imports/enum.d.ts.map +0 -1
- package/dist/js/util.d.ts +0 -78
- package/dist/js/util.d.ts.map +0 -1
- package/dist/js/util.js +0 -399
- package/dist/js/util.js.map +0 -1
- package/dist/js/util.min.js +0 -2
- package/dist/js/util.min.js.map +0 -1
- package/src/ts/util.ts +0 -209
package/dist/js/index.js
CHANGED
|
@@ -16,31 +16,24 @@ return /******/ (() => { // webpackBootstrap
|
|
|
16
16
|
/*!*********************************************!*\
|
|
17
17
|
!*** ./src/ts/imports/components/header.ts ***!
|
|
18
18
|
\*********************************************/
|
|
19
|
-
/***/ (
|
|
19
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
var __importDefault = this && this.__importDefault || function (mod) {
|
|
24
|
-
return mod && mod.__esModule ? mod : {
|
|
25
|
-
"default": mod
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
23
|
Object.defineProperty(exports, "__esModule", ({
|
|
29
24
|
value: true
|
|
30
25
|
}));
|
|
31
|
-
exports.
|
|
26
|
+
exports.MintHeader = void 0;
|
|
32
27
|
/**
|
|
33
28
|
* Imports
|
|
34
29
|
*/
|
|
35
|
-
const
|
|
36
|
-
const util_1 =
|
|
37
|
-
const selectors_1 = __importDefault(__webpack_require__(/*! ../util/selectors */ "./src/ts/imports/util/selectors.ts"));
|
|
38
|
-
const settings_1 = __importDefault(__webpack_require__(/*! ../util/settings */ "./src/ts/imports/util/settings.ts"));
|
|
30
|
+
const enums_1 = __webpack_require__(/*! ../enums */ "./src/ts/imports/enums/index.ts");
|
|
31
|
+
const util_1 = __webpack_require__(/*! ../util */ "./src/ts/imports/util/index.ts");
|
|
39
32
|
/**
|
|
40
33
|
* Main header functionality
|
|
41
34
|
* @public
|
|
42
35
|
*/
|
|
43
|
-
class
|
|
36
|
+
class MintHeader {
|
|
44
37
|
/**
|
|
45
38
|
* Initializes and closes the menu
|
|
46
39
|
*/
|
|
@@ -49,7 +42,7 @@ class mintHeader {
|
|
|
49
42
|
* Navbar settings
|
|
50
43
|
*/
|
|
51
44
|
this.settings = {
|
|
52
|
-
from:
|
|
45
|
+
from: enums_1.EMintSide.Top,
|
|
53
46
|
fixed: true
|
|
54
47
|
};
|
|
55
48
|
/**
|
|
@@ -69,7 +62,7 @@ class mintHeader {
|
|
|
69
62
|
this.el.html = document.querySelector('html');
|
|
70
63
|
this.el.body = document.querySelector('body');
|
|
71
64
|
this.el.header = document.getElementById('mint-header');
|
|
72
|
-
this.el.mobileButton = ((_a = this.el.header) === null || _a === void 0 ? void 0 : _a.querySelector(
|
|
65
|
+
this.el.mobileButton = ((_a = this.el.header) === null || _a === void 0 ? void 0 : _a.querySelector(util_1.MintSelectors.controls('mint-wrapper'))) || null;
|
|
73
66
|
this.el.wrapper = document.getElementById('mint-wrapper');
|
|
74
67
|
}
|
|
75
68
|
/**
|
|
@@ -77,23 +70,23 @@ class mintHeader {
|
|
|
77
70
|
*/
|
|
78
71
|
attachEvents() {
|
|
79
72
|
var _a, _b, _c, _d;
|
|
80
|
-
window.addEventListener('resize', util_1.
|
|
81
|
-
window.addEventListener('scroll', util_1.
|
|
73
|
+
window.addEventListener('resize', util_1.MintEvent.throttleEvent(this.eHandleResize.bind(this), util_1.MintSettings.delay.default));
|
|
74
|
+
window.addEventListener('scroll', util_1.MintEvent.throttleEvent(this.eHandleScroll.bind(this), util_1.MintSettings.delay.default, {
|
|
82
75
|
trailing: false
|
|
83
76
|
}));
|
|
84
|
-
let focusables = (_a = this.el.header) === null || _a === void 0 ? void 0 : _a.querySelectorAll(
|
|
77
|
+
let focusables = (_a = this.el.header) === null || _a === void 0 ? void 0 : _a.querySelectorAll(util_1.MintSelectors.focusable),
|
|
85
78
|
lastFocusable = focusables === null || focusables === void 0 ? void 0 : focusables[(focusables === null || focusables === void 0 ? void 0 : focusables.length) - 1];
|
|
86
|
-
lastFocusable === null || lastFocusable === void 0 ? void 0 : lastFocusable.addEventListener('keydown', util_1.
|
|
79
|
+
lastFocusable === null || lastFocusable === void 0 ? void 0 : lastFocusable.addEventListener('keydown', util_1.MintEvent.throttleEvent(this.eWrapTab.bind(this)));
|
|
87
80
|
focusables === null || focusables === void 0 ? void 0 : focusables.forEach(focusable => {
|
|
88
|
-
focusable.addEventListener('keydown', util_1.
|
|
81
|
+
focusable.addEventListener('keydown', util_1.MintEvent.throttleEvent(this.eHandleKeypress.bind(this)));
|
|
89
82
|
});
|
|
90
|
-
let menuButtons = (_b = this.el.wrapper) === null || _b === void 0 ? void 0 : _b.querySelectorAll(
|
|
83
|
+
let menuButtons = (_b = this.el.wrapper) === null || _b === void 0 ? void 0 : _b.querySelectorAll(util_1.MintSelectors.controls());
|
|
91
84
|
menuButtons === null || menuButtons === void 0 ? void 0 : menuButtons.forEach(menuButton => {
|
|
92
|
-
menuButton.addEventListener('click', util_1.
|
|
85
|
+
menuButton.addEventListener('click', util_1.MintEvent.throttleEvent(this.eToggleMenu.bind(this), util_1.MintSettings.delay.slow, {
|
|
93
86
|
trailing: false
|
|
94
87
|
}));
|
|
95
88
|
});
|
|
96
|
-
(_c = this.el.mobileButton) === null || _c === void 0 ? void 0 : _c.addEventListener('click', util_1.
|
|
89
|
+
(_c = this.el.mobileButton) === null || _c === void 0 ? void 0 : _c.addEventListener('click', util_1.MintEvent.throttleEvent(this.eToggleMobileMenu.bind(this), util_1.MintSettings.delay.slow, {
|
|
97
90
|
trailing: false
|
|
98
91
|
}));
|
|
99
92
|
(_d = this.el.wrapper) === null || _d === void 0 ? void 0 : _d.addEventListener('transitionend', this.eTransitionEnd.bind(this));
|
|
@@ -104,7 +97,7 @@ class mintHeader {
|
|
|
104
97
|
addClasses() {
|
|
105
98
|
var _a, _b, _c, _d, _e;
|
|
106
99
|
(_a = this.el.header) === null || _a === void 0 ? void 0 : _a.classList.remove('mint-top', 'mint-right', 'mint-bottom', 'mint-left');
|
|
107
|
-
(_b = this.el.header) === null || _b === void 0 ? void 0 : _b.classList.add(`mint-${
|
|
100
|
+
(_b = this.el.header) === null || _b === void 0 ? void 0 : _b.classList.add(`mint-${enums_1.EMintSide[(_c = this.settings.from) !== null && _c !== void 0 ? _c : 0].toLowerCase()}`);
|
|
108
101
|
if (this.settings.fixed) {
|
|
109
102
|
(_d = this.el.body) === null || _d === void 0 ? void 0 : _d.classList.add('mint-fixed');
|
|
110
103
|
}
|
|
@@ -125,7 +118,7 @@ class mintHeader {
|
|
|
125
118
|
setTimeout(() => {
|
|
126
119
|
var _a;
|
|
127
120
|
(_a = this.el.mobileButton) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-label', ariaLabel);
|
|
128
|
-
},
|
|
121
|
+
}, util_1.MintSettings.delay.fast);
|
|
129
122
|
if (open) {
|
|
130
123
|
if (this.settings.fixed !== true) {
|
|
131
124
|
window.scroll({
|
|
@@ -136,7 +129,7 @@ class mintHeader {
|
|
|
136
129
|
}
|
|
137
130
|
setTimeout(() => {
|
|
138
131
|
if (this.el.html) {
|
|
139
|
-
let isMobile = util_1.
|
|
132
|
+
let isMobile = util_1.MintWindow.width() <= util_1.MintSettings.break.sm,
|
|
140
133
|
overflow = 'auto';
|
|
141
134
|
if (this.settings.tray) {
|
|
142
135
|
if (isMobile) {
|
|
@@ -147,7 +140,7 @@ class mintHeader {
|
|
|
147
140
|
}
|
|
148
141
|
this.el.html.style.overflow = overflow;
|
|
149
142
|
}
|
|
150
|
-
}, this.settings.from ===
|
|
143
|
+
}, this.settings.from === enums_1.EMintSide.Left ? util_1.MintSettings.delay.default : util_1.MintSettings.delay.instant);
|
|
151
144
|
if (this.el.wrapper) {
|
|
152
145
|
this.el.wrapper.style.display = 'flex';
|
|
153
146
|
}
|
|
@@ -185,9 +178,9 @@ class mintHeader {
|
|
|
185
178
|
if (button && menu) {
|
|
186
179
|
button.setAttribute('aria-expanded', ariaExpanded);
|
|
187
180
|
if (open) {
|
|
188
|
-
util_1.
|
|
181
|
+
util_1.MintDisplay.show(menu);
|
|
189
182
|
} else {
|
|
190
|
-
util_1.
|
|
183
|
+
util_1.MintDisplay.hide(menu);
|
|
191
184
|
this.closeSubMenus(button);
|
|
192
185
|
}
|
|
193
186
|
}
|
|
@@ -206,7 +199,7 @@ class mintHeader {
|
|
|
206
199
|
*/
|
|
207
200
|
closeSubMenus(button) {
|
|
208
201
|
let menu = button === null || button === void 0 ? void 0 : button.nextElementSibling,
|
|
209
|
-
subMenus = menu === null || menu === void 0 ? void 0 : menu.querySelectorAll(
|
|
202
|
+
subMenus = menu === null || menu === void 0 ? void 0 : menu.querySelectorAll(util_1.MintSelectors.subMenuButtons);
|
|
210
203
|
subMenus.forEach(child => {
|
|
211
204
|
var _a;
|
|
212
205
|
// setMenu calls this function, so ignore subsub menus
|
|
@@ -222,7 +215,7 @@ class mintHeader {
|
|
|
222
215
|
closeSiblingMenus(button) {
|
|
223
216
|
var _a;
|
|
224
217
|
let menu = button === null || button === void 0 ? void 0 : button.parentElement,
|
|
225
|
-
siblingMenus = (_a = menu === null || menu === void 0 ? void 0 : menu.parentElement) === null || _a === void 0 ? void 0 : _a.querySelectorAll(
|
|
218
|
+
siblingMenus = (_a = menu === null || menu === void 0 ? void 0 : menu.parentElement) === null || _a === void 0 ? void 0 : _a.querySelectorAll(util_1.MintSelectors.subMenuButtons);
|
|
226
219
|
siblingMenus.forEach(child => {
|
|
227
220
|
if (child !== button) {
|
|
228
221
|
this.setMenu(child);
|
|
@@ -234,7 +227,7 @@ class mintHeader {
|
|
|
234
227
|
*/
|
|
235
228
|
closeAllMenus() {
|
|
236
229
|
var _a;
|
|
237
|
-
let menuButtons = (_a = this.el.wrapper) === null || _a === void 0 ? void 0 : _a.querySelectorAll(
|
|
230
|
+
let menuButtons = (_a = this.el.wrapper) === null || _a === void 0 ? void 0 : _a.querySelectorAll(util_1.MintSelectors.subMenuButtons);
|
|
238
231
|
menuButtons === null || menuButtons === void 0 ? void 0 : menuButtons.forEach(menuButton => {
|
|
239
232
|
this.setMenu(menuButton);
|
|
240
233
|
});
|
|
@@ -252,7 +245,7 @@ class mintHeader {
|
|
|
252
245
|
}
|
|
253
246
|
if ((activeButton === null || activeButton === void 0 ? void 0 : activeButton.getAttribute('aria-controls')) && activeMenu && !showing) {
|
|
254
247
|
activeButton.click();
|
|
255
|
-
let firstFocusable = activeMenu.querySelector(
|
|
248
|
+
let firstFocusable = activeMenu.querySelector(util_1.MintSelectors.focusable);
|
|
256
249
|
firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();
|
|
257
250
|
}
|
|
258
251
|
}
|
|
@@ -262,7 +255,7 @@ class mintHeader {
|
|
|
262
255
|
closeClosestMenu() {
|
|
263
256
|
var _a, _b;
|
|
264
257
|
let activeElement = document.activeElement,
|
|
265
|
-
activeMenu = activeElement === null || activeElement === void 0 ? void 0 : activeElement.closest(
|
|
258
|
+
activeMenu = activeElement === null || activeElement === void 0 ? void 0 : activeElement.closest(util_1.MintSelectors.subMenu),
|
|
266
259
|
activeButton = (activeMenu === null || activeMenu === void 0 ? void 0 : activeMenu.previousElementSibling) ? activeMenu.previousElementSibling : this.el.mobileButton;
|
|
267
260
|
if ((activeElement === null || activeElement === void 0 ? void 0 : activeElement.getAttribute('aria-controls')) && ((_a = activeElement === null || activeElement === void 0 ? void 0 : activeElement.getAttribute('aria-expanded')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'true') {
|
|
268
261
|
activeButton = activeElement;
|
|
@@ -289,7 +282,7 @@ class mintHeader {
|
|
|
289
282
|
eHandleResize() {
|
|
290
283
|
var _a, _b;
|
|
291
284
|
let isOpen = ((_b = (_a = this.el.mobileButton) === null || _a === void 0 ? void 0 : _a.getAttribute('aria-expanded')) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'true',
|
|
292
|
-
isMobile = util_1.
|
|
285
|
+
isMobile = util_1.MintWindow.width() <= util_1.MintSettings.break.sm,
|
|
293
286
|
overflow = 'auto';
|
|
294
287
|
if (isOpen) {
|
|
295
288
|
if (this.settings.tray) {
|
|
@@ -415,15 +408,90 @@ class mintHeader {
|
|
|
415
408
|
}
|
|
416
409
|
}
|
|
417
410
|
}
|
|
418
|
-
exports.
|
|
419
|
-
|
|
411
|
+
exports.MintHeader = MintHeader;
|
|
412
|
+
;
|
|
413
|
+
exports["default"] = MintHeader;
|
|
414
|
+
|
|
415
|
+
/***/ }),
|
|
416
|
+
|
|
417
|
+
/***/ "./src/ts/imports/components/index.ts":
|
|
418
|
+
/*!********************************************!*\
|
|
419
|
+
!*** ./src/ts/imports/components/index.ts ***!
|
|
420
|
+
\********************************************/
|
|
421
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
426
|
+
if (k2 === undefined) k2 = k;
|
|
427
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
428
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
429
|
+
desc = {
|
|
430
|
+
enumerable: true,
|
|
431
|
+
get: function () {
|
|
432
|
+
return m[k];
|
|
433
|
+
}
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
Object.defineProperty(o, k2, desc);
|
|
437
|
+
} : function (o, m, k, k2) {
|
|
438
|
+
if (k2 === undefined) k2 = k;
|
|
439
|
+
o[k2] = m[k];
|
|
440
|
+
});
|
|
441
|
+
var __exportStar = this && this.__exportStar || function (m, exports) {
|
|
442
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
443
|
+
};
|
|
444
|
+
Object.defineProperty(exports, "__esModule", ({
|
|
445
|
+
value: true
|
|
446
|
+
}));
|
|
447
|
+
/**
|
|
448
|
+
* Forward all exports from the components directory
|
|
449
|
+
*/
|
|
450
|
+
__exportStar(__webpack_require__(/*! ./header */ "./src/ts/imports/components/header.ts"), exports);
|
|
451
|
+
|
|
452
|
+
/***/ }),
|
|
453
|
+
|
|
454
|
+
/***/ "./src/ts/imports/enums/index.ts":
|
|
455
|
+
/*!***************************************!*\
|
|
456
|
+
!*** ./src/ts/imports/enums/index.ts ***!
|
|
457
|
+
\***************************************/
|
|
458
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
463
|
+
if (k2 === undefined) k2 = k;
|
|
464
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
465
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
466
|
+
desc = {
|
|
467
|
+
enumerable: true,
|
|
468
|
+
get: function () {
|
|
469
|
+
return m[k];
|
|
470
|
+
}
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
Object.defineProperty(o, k2, desc);
|
|
474
|
+
} : function (o, m, k, k2) {
|
|
475
|
+
if (k2 === undefined) k2 = k;
|
|
476
|
+
o[k2] = m[k];
|
|
477
|
+
});
|
|
478
|
+
var __exportStar = this && this.__exportStar || function (m, exports) {
|
|
479
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
480
|
+
};
|
|
481
|
+
Object.defineProperty(exports, "__esModule", ({
|
|
482
|
+
value: true
|
|
483
|
+
}));
|
|
484
|
+
/**
|
|
485
|
+
* Forward all exports from the enums directory
|
|
486
|
+
*/
|
|
487
|
+
__exportStar(__webpack_require__(/*! ./side */ "./src/ts/imports/enums/side.ts"), exports);
|
|
420
488
|
|
|
421
489
|
/***/ }),
|
|
422
490
|
|
|
423
|
-
/***/ "./src/ts/imports/
|
|
424
|
-
|
|
425
|
-
!*** ./src/ts/imports/
|
|
426
|
-
|
|
491
|
+
/***/ "./src/ts/imports/enums/side.ts":
|
|
492
|
+
/*!**************************************!*\
|
|
493
|
+
!*** ./src/ts/imports/enums/side.ts ***!
|
|
494
|
+
\**************************************/
|
|
427
495
|
/***/ ((__unused_webpack_module, exports) => {
|
|
428
496
|
|
|
429
497
|
|
|
@@ -431,21 +499,61 @@ exports["default"] = mintHeader;
|
|
|
431
499
|
Object.defineProperty(exports, "__esModule", ({
|
|
432
500
|
value: true
|
|
433
501
|
}));
|
|
434
|
-
exports.
|
|
502
|
+
exports.EMintSide = void 0;
|
|
435
503
|
/**
|
|
436
504
|
* Side Enum
|
|
437
505
|
*/
|
|
438
|
-
var
|
|
439
|
-
(function (
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
})(
|
|
506
|
+
var EMintSide;
|
|
507
|
+
(function (EMintSide) {
|
|
508
|
+
EMintSide[EMintSide["Top"] = 0] = "Top";
|
|
509
|
+
EMintSide[EMintSide["Right"] = 1] = "Right";
|
|
510
|
+
EMintSide[EMintSide["Bottom"] = 2] = "Bottom";
|
|
511
|
+
EMintSide[EMintSide["Left"] = 3] = "Left";
|
|
512
|
+
})(EMintSide = exports.EMintSide || (exports.EMintSide = {}));
|
|
445
513
|
;
|
|
446
514
|
|
|
447
515
|
/***/ }),
|
|
448
516
|
|
|
517
|
+
/***/ "./src/ts/imports/index.ts":
|
|
518
|
+
/*!*********************************!*\
|
|
519
|
+
!*** ./src/ts/imports/index.ts ***!
|
|
520
|
+
\*********************************/
|
|
521
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
526
|
+
if (k2 === undefined) k2 = k;
|
|
527
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
528
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
529
|
+
desc = {
|
|
530
|
+
enumerable: true,
|
|
531
|
+
get: function () {
|
|
532
|
+
return m[k];
|
|
533
|
+
}
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
Object.defineProperty(o, k2, desc);
|
|
537
|
+
} : function (o, m, k, k2) {
|
|
538
|
+
if (k2 === undefined) k2 = k;
|
|
539
|
+
o[k2] = m[k];
|
|
540
|
+
});
|
|
541
|
+
var __exportStar = this && this.__exportStar || function (m, exports) {
|
|
542
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
543
|
+
};
|
|
544
|
+
Object.defineProperty(exports, "__esModule", ({
|
|
545
|
+
value: true
|
|
546
|
+
}));
|
|
547
|
+
/**
|
|
548
|
+
* Forward all exports from the imports directory
|
|
549
|
+
*/
|
|
550
|
+
__exportStar(__webpack_require__(/*! ./components */ "./src/ts/imports/components/index.ts"), exports);
|
|
551
|
+
__exportStar(__webpack_require__(/*! ./enums */ "./src/ts/imports/enums/index.ts"), exports);
|
|
552
|
+
__exportStar(__webpack_require__(/*! ./models */ "./src/ts/imports/models/index.ts"), exports);
|
|
553
|
+
__exportStar(__webpack_require__(/*! ./util */ "./src/ts/imports/util/index.ts"), exports);
|
|
554
|
+
|
|
555
|
+
/***/ }),
|
|
556
|
+
|
|
449
557
|
/***/ "./src/ts/imports/models/color.ts":
|
|
450
558
|
/*!****************************************!*\
|
|
451
559
|
!*** ./src/ts/imports/models/color.ts ***!
|
|
@@ -548,6 +656,44 @@ exports["default"] = mintColor;
|
|
|
548
656
|
|
|
549
657
|
/***/ }),
|
|
550
658
|
|
|
659
|
+
/***/ "./src/ts/imports/models/index.ts":
|
|
660
|
+
/*!****************************************!*\
|
|
661
|
+
!*** ./src/ts/imports/models/index.ts ***!
|
|
662
|
+
\****************************************/
|
|
663
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
664
|
+
|
|
665
|
+
|
|
666
|
+
|
|
667
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
668
|
+
if (k2 === undefined) k2 = k;
|
|
669
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
670
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
671
|
+
desc = {
|
|
672
|
+
enumerable: true,
|
|
673
|
+
get: function () {
|
|
674
|
+
return m[k];
|
|
675
|
+
}
|
|
676
|
+
};
|
|
677
|
+
}
|
|
678
|
+
Object.defineProperty(o, k2, desc);
|
|
679
|
+
} : function (o, m, k, k2) {
|
|
680
|
+
if (k2 === undefined) k2 = k;
|
|
681
|
+
o[k2] = m[k];
|
|
682
|
+
});
|
|
683
|
+
var __exportStar = this && this.__exportStar || function (m, exports) {
|
|
684
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
685
|
+
};
|
|
686
|
+
Object.defineProperty(exports, "__esModule", ({
|
|
687
|
+
value: true
|
|
688
|
+
}));
|
|
689
|
+
/**
|
|
690
|
+
* Forward all exports from the models directory
|
|
691
|
+
*/
|
|
692
|
+
__exportStar(__webpack_require__(/*! ./color */ "./src/ts/imports/models/color.ts"), exports);
|
|
693
|
+
__exportStar(__webpack_require__(/*! ./item */ "./src/ts/imports/models/item.ts"), exports);
|
|
694
|
+
|
|
695
|
+
/***/ }),
|
|
696
|
+
|
|
551
697
|
/***/ "./src/ts/imports/models/item.ts":
|
|
552
698
|
/*!***************************************!*\
|
|
553
699
|
!*** ./src/ts/imports/models/item.ts ***!
|
|
@@ -559,13 +705,13 @@ exports["default"] = mintColor;
|
|
|
559
705
|
Object.defineProperty(exports, "__esModule", ({
|
|
560
706
|
value: true
|
|
561
707
|
}));
|
|
562
|
-
exports.
|
|
708
|
+
exports.MintItem = void 0;
|
|
563
709
|
/**
|
|
564
710
|
* A generic item
|
|
565
711
|
* @note - this class must be convertable with JSON
|
|
566
712
|
* - only add strings, numbers, booleans, arrays, and objects
|
|
567
713
|
*/
|
|
568
|
-
class
|
|
714
|
+
class MintItem {
|
|
569
715
|
constructor() {
|
|
570
716
|
/**
|
|
571
717
|
* Item settings
|
|
@@ -598,9 +744,9 @@ class mintItem {
|
|
|
598
744
|
this.buttons = [];
|
|
599
745
|
}
|
|
600
746
|
}
|
|
601
|
-
exports.
|
|
747
|
+
exports.MintItem = MintItem;
|
|
602
748
|
;
|
|
603
|
-
exports["default"] =
|
|
749
|
+
exports["default"] = MintItem;
|
|
604
750
|
|
|
605
751
|
/***/ }),
|
|
606
752
|
|
|
@@ -608,21 +754,88 @@ exports["default"] = mintItem;
|
|
|
608
754
|
/*!****************************************!*\
|
|
609
755
|
!*** ./src/ts/imports/util/display.ts ***!
|
|
610
756
|
\****************************************/
|
|
611
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
757
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
612
758
|
|
|
613
759
|
|
|
614
760
|
|
|
615
761
|
Object.defineProperty(exports, "__esModule", ({
|
|
616
762
|
value: true
|
|
617
763
|
}));
|
|
618
|
-
exports.
|
|
764
|
+
exports.MintDisplay = void 0;
|
|
765
|
+
/**
|
|
766
|
+
* Imports
|
|
767
|
+
*/
|
|
768
|
+
const enums_1 = __webpack_require__(/*! ../enums */ "./src/ts/imports/enums/index.ts");
|
|
769
|
+
const settings_1 = __webpack_require__(/*! ./settings */ "./src/ts/imports/util/settings.ts");
|
|
619
770
|
/**
|
|
620
771
|
* Handles the display of elements
|
|
621
772
|
*/
|
|
622
|
-
class
|
|
623
|
-
|
|
773
|
+
class MintDisplay {
|
|
774
|
+
/**
|
|
775
|
+
* Sets the element's height to its `innerHeight`, then to `auto` after a delay
|
|
776
|
+
* @param el - the element whose height will be set
|
|
777
|
+
* @param delay - the amount of time in milliseconds that the show animation will be active
|
|
778
|
+
* @param from - the side that the element is animating from
|
|
779
|
+
*/
|
|
780
|
+
static show(el) {
|
|
781
|
+
let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.MintSettings.delay.default;
|
|
782
|
+
let from = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : enums_1.EMintSide.Top;
|
|
783
|
+
if (el) {
|
|
784
|
+
el.style.display = '';
|
|
785
|
+
requestAnimationFrame(() => {
|
|
786
|
+
if (from === enums_1.EMintSide.Top || from === enums_1.EMintSide.Bottom) {
|
|
787
|
+
el.style.height = `${el.scrollHeight}px`;
|
|
788
|
+
} else {
|
|
789
|
+
el.style.width = `${el.scrollWidth}px`;
|
|
790
|
+
}
|
|
791
|
+
setTimeout(() => {
|
|
792
|
+
if (from === enums_1.EMintSide.Top || from === enums_1.EMintSide.Bottom) {
|
|
793
|
+
el.style.height = 'auto';
|
|
794
|
+
} else {
|
|
795
|
+
el.style.width = 'auto';
|
|
796
|
+
}
|
|
797
|
+
}, delay);
|
|
798
|
+
});
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
/**
|
|
802
|
+
* Sets the element's height to 0
|
|
803
|
+
* @param el - the element whose height will be set
|
|
804
|
+
* @param delay - the amount of time in milliseconds that the show animation will be active
|
|
805
|
+
* @param from - the side that the element is animating from
|
|
806
|
+
*/
|
|
807
|
+
static hide(el) {
|
|
808
|
+
let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.MintSettings.delay.default;
|
|
809
|
+
let from = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : enums_1.EMintSide.Top;
|
|
810
|
+
if (el) {
|
|
811
|
+
let height = el.scrollHeight,
|
|
812
|
+
width = el.scrollWidth,
|
|
813
|
+
transition = el.style.transition;
|
|
814
|
+
el.style.transition = '';
|
|
815
|
+
requestAnimationFrame(() => {
|
|
816
|
+
if (from === enums_1.EMintSide.Top || from === enums_1.EMintSide.Bottom) {
|
|
817
|
+
el.style.height = `${height}px`;
|
|
818
|
+
} else {
|
|
819
|
+
el.style.width = `${width}px`;
|
|
820
|
+
}
|
|
821
|
+
el.style.transition = transition;
|
|
822
|
+
requestAnimationFrame(() => {
|
|
823
|
+
if (from === enums_1.EMintSide.Top || from === enums_1.EMintSide.Bottom) {
|
|
824
|
+
el.style.height = '0';
|
|
825
|
+
} else {
|
|
826
|
+
el.style.width = '0';
|
|
827
|
+
}
|
|
828
|
+
});
|
|
829
|
+
});
|
|
830
|
+
setTimeout(() => {
|
|
831
|
+
el.style.display = 'none';
|
|
832
|
+
}, delay);
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
exports.MintDisplay = MintDisplay;
|
|
624
837
|
;
|
|
625
|
-
exports["default"] =
|
|
838
|
+
exports["default"] = MintDisplay;
|
|
626
839
|
|
|
627
840
|
/***/ }),
|
|
628
841
|
|
|
@@ -630,21 +843,114 @@ exports["default"] = mintDisplay;
|
|
|
630
843
|
/*!**************************************!*\
|
|
631
844
|
!*** ./src/ts/imports/util/event.ts ***!
|
|
632
845
|
\**************************************/
|
|
633
|
-
/***/ ((__unused_webpack_module, exports)
|
|
846
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
634
847
|
|
|
635
848
|
|
|
636
849
|
|
|
850
|
+
var __importDefault = this && this.__importDefault || function (mod) {
|
|
851
|
+
return mod && mod.__esModule ? mod : {
|
|
852
|
+
"default": mod
|
|
853
|
+
};
|
|
854
|
+
};
|
|
637
855
|
Object.defineProperty(exports, "__esModule", ({
|
|
638
856
|
value: true
|
|
639
857
|
}));
|
|
640
|
-
exports.
|
|
858
|
+
exports.MintEvent = void 0;
|
|
859
|
+
const settings_1 = __importDefault(__webpack_require__(/*! ./settings */ "./src/ts/imports/util/settings.ts"));
|
|
641
860
|
/**
|
|
642
861
|
* Event helper functions
|
|
643
862
|
*/
|
|
644
|
-
class
|
|
645
|
-
|
|
863
|
+
class MintEvent {
|
|
864
|
+
/**
|
|
865
|
+
* Ensures that a function `func` is run only after not being called for `wait` milliseconds
|
|
866
|
+
* @param func - the function to debounce
|
|
867
|
+
* @param wait - the amount of time to wait before running the function
|
|
868
|
+
* @returns - the debounced function
|
|
869
|
+
*/
|
|
870
|
+
static debounce(func) {
|
|
871
|
+
let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
|
|
872
|
+
let timer;
|
|
873
|
+
return function (e) {
|
|
874
|
+
if (timer) {
|
|
875
|
+
clearTimeout(timer);
|
|
876
|
+
}
|
|
877
|
+
timer = setTimeout(func, wait, e);
|
|
878
|
+
};
|
|
879
|
+
}
|
|
880
|
+
/**
|
|
881
|
+
* Ensures that a function `func` is run only after not being called for `wait` milliseconds
|
|
882
|
+
* @param func - the function to debounce
|
|
883
|
+
* @param wait - the amount of time to wait before running the function
|
|
884
|
+
* @returns - the debounced function as an EventListener
|
|
885
|
+
*/
|
|
886
|
+
static debounceEvent(func) {
|
|
887
|
+
let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
|
|
888
|
+
return MintEvent.debounce(func, wait);
|
|
889
|
+
}
|
|
890
|
+
/**
|
|
891
|
+
* Ensures that a function `func` is called at most every `wait` milliseconds with optional leading and trailing calls
|
|
892
|
+
* @param func - the function to throttle
|
|
893
|
+
* @param wait - the amount of time between function calls
|
|
894
|
+
* @param options - leading and trailing options: default = \{ leading: true, trailing, true \}
|
|
895
|
+
* @returns - the throttled function
|
|
896
|
+
*/
|
|
897
|
+
static throttle(func) {
|
|
898
|
+
let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
|
|
899
|
+
let options = arguments.length > 2 ? arguments[2] : undefined;
|
|
900
|
+
let context,
|
|
901
|
+
args,
|
|
902
|
+
result,
|
|
903
|
+
timeout,
|
|
904
|
+
previous = 0,
|
|
905
|
+
later = function () {
|
|
906
|
+
previous = (options === null || options === void 0 ? void 0 : options.leading) === false ? 0 : new Date().getTime();
|
|
907
|
+
timeout = 0;
|
|
908
|
+
result = func.apply(context, args);
|
|
909
|
+
if (!timeout) {
|
|
910
|
+
context = args = null;
|
|
911
|
+
}
|
|
912
|
+
},
|
|
913
|
+
throttled = function () {
|
|
914
|
+
let now = new Date().getTime();
|
|
915
|
+
if (!previous && (options === null || options === void 0 ? void 0 : options.leading) === false) {
|
|
916
|
+
previous = now;
|
|
917
|
+
}
|
|
918
|
+
let remaining = wait - now + previous;
|
|
919
|
+
context = this;
|
|
920
|
+
args = arguments;
|
|
921
|
+
if (remaining <= 0 || remaining > wait) {
|
|
922
|
+
if (timeout) {
|
|
923
|
+
clearTimeout(timeout);
|
|
924
|
+
timeout = 0;
|
|
925
|
+
}
|
|
926
|
+
previous = now;
|
|
927
|
+
result = func.apply(context, args);
|
|
928
|
+
if (!timeout) {
|
|
929
|
+
context = args = null;
|
|
930
|
+
}
|
|
931
|
+
} else if (!timeout && (options === null || options === void 0 ? void 0 : options.trailing) !== false) {
|
|
932
|
+
timeout = window.setTimeout(later, remaining);
|
|
933
|
+
}
|
|
934
|
+
return result;
|
|
935
|
+
};
|
|
936
|
+
return throttled;
|
|
937
|
+
}
|
|
938
|
+
/**
|
|
939
|
+
* Ensures that a function `func` is called at most every `wait` milliseconds with optional leading and trailing calls
|
|
940
|
+
* @param func - the function to throttle
|
|
941
|
+
* @param wait - the amount of time between function calls
|
|
942
|
+
* @param options - leading and trailing options: default = \{ leading: true, trailing, true \}
|
|
943
|
+
* @returns - the throttled function as an EventListener
|
|
944
|
+
*/
|
|
945
|
+
static throttleEvent(func) {
|
|
946
|
+
let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
|
|
947
|
+
let options = arguments.length > 2 ? arguments[2] : undefined;
|
|
948
|
+
return MintEvent.throttle(func, wait, options);
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
exports.MintEvent = MintEvent;
|
|
646
952
|
;
|
|
647
|
-
exports["default"] =
|
|
953
|
+
exports["default"] = MintEvent;
|
|
648
954
|
|
|
649
955
|
/***/ }),
|
|
650
956
|
|
|
@@ -664,7 +970,7 @@ var __importDefault = this && this.__importDefault || function (mod) {
|
|
|
664
970
|
Object.defineProperty(exports, "__esModule", ({
|
|
665
971
|
value: true
|
|
666
972
|
}));
|
|
667
|
-
exports.
|
|
973
|
+
exports.MintIcon = void 0;
|
|
668
974
|
/**
|
|
669
975
|
* Imports
|
|
670
976
|
*/
|
|
@@ -672,7 +978,7 @@ const object_1 = __importDefault(__webpack_require__(/*! ./object */ "./src/ts/i
|
|
|
672
978
|
/**
|
|
673
979
|
* Icon helper functions
|
|
674
980
|
*/
|
|
675
|
-
class
|
|
981
|
+
class MintIcon {
|
|
676
982
|
/**
|
|
677
983
|
* Appends the given icon to the given selector if there is not already an icon appended
|
|
678
984
|
*/
|
|
@@ -713,11 +1019,11 @@ class mintIcon {
|
|
|
713
1019
|
});
|
|
714
1020
|
}
|
|
715
1021
|
}
|
|
716
|
-
exports.
|
|
1022
|
+
exports.MintIcon = MintIcon;
|
|
717
1023
|
/**
|
|
718
1024
|
* Default icons
|
|
719
1025
|
*/
|
|
720
|
-
|
|
1026
|
+
MintIcon.icons = {
|
|
721
1027
|
'a[href^="mailto:"]': 'far fa-envelope',
|
|
722
1028
|
'a[href^="tel:"]': 'fas fa-phone-flip',
|
|
723
1029
|
'a[href^="sms:"]': 'far fa-message',
|
|
@@ -725,7 +1031,54 @@ mintIcon.icons = {
|
|
|
725
1031
|
'a[href^="http"]': 'fas fa-up-right-from-square'
|
|
726
1032
|
};
|
|
727
1033
|
;
|
|
728
|
-
exports["default"] =
|
|
1034
|
+
exports["default"] = MintIcon;
|
|
1035
|
+
|
|
1036
|
+
/***/ }),
|
|
1037
|
+
|
|
1038
|
+
/***/ "./src/ts/imports/util/index.ts":
|
|
1039
|
+
/*!**************************************!*\
|
|
1040
|
+
!*** ./src/ts/imports/util/index.ts ***!
|
|
1041
|
+
\**************************************/
|
|
1042
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
1043
|
+
|
|
1044
|
+
|
|
1045
|
+
|
|
1046
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
1047
|
+
if (k2 === undefined) k2 = k;
|
|
1048
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
1049
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
1050
|
+
desc = {
|
|
1051
|
+
enumerable: true,
|
|
1052
|
+
get: function () {
|
|
1053
|
+
return m[k];
|
|
1054
|
+
}
|
|
1055
|
+
};
|
|
1056
|
+
}
|
|
1057
|
+
Object.defineProperty(o, k2, desc);
|
|
1058
|
+
} : function (o, m, k, k2) {
|
|
1059
|
+
if (k2 === undefined) k2 = k;
|
|
1060
|
+
o[k2] = m[k];
|
|
1061
|
+
});
|
|
1062
|
+
var __exportStar = this && this.__exportStar || function (m, exports) {
|
|
1063
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
1064
|
+
};
|
|
1065
|
+
Object.defineProperty(exports, "__esModule", ({
|
|
1066
|
+
value: true
|
|
1067
|
+
}));
|
|
1068
|
+
/**
|
|
1069
|
+
* Forward all exports from the util directory
|
|
1070
|
+
*/
|
|
1071
|
+
__exportStar(__webpack_require__(/*! ./display */ "./src/ts/imports/util/display.ts"), exports);
|
|
1072
|
+
__exportStar(__webpack_require__(/*! ./event */ "./src/ts/imports/util/event.ts"), exports);
|
|
1073
|
+
__exportStar(__webpack_require__(/*! ./icon */ "./src/ts/imports/util/icon.ts"), exports);
|
|
1074
|
+
__exportStar(__webpack_require__(/*! ./list */ "./src/ts/imports/util/list.ts"), exports);
|
|
1075
|
+
__exportStar(__webpack_require__(/*! ./math */ "./src/ts/imports/util/math.ts"), exports);
|
|
1076
|
+
__exportStar(__webpack_require__(/*! ./object */ "./src/ts/imports/util/object.ts"), exports);
|
|
1077
|
+
__exportStar(__webpack_require__(/*! ./scroll */ "./src/ts/imports/util/scroll.ts"), exports);
|
|
1078
|
+
__exportStar(__webpack_require__(/*! ./selectors */ "./src/ts/imports/util/selectors.ts"), exports);
|
|
1079
|
+
__exportStar(__webpack_require__(/*! ./settings */ "./src/ts/imports/util/settings.ts"), exports);
|
|
1080
|
+
__exportStar(__webpack_require__(/*! ./text */ "./src/ts/imports/util/text.ts"), exports);
|
|
1081
|
+
__exportStar(__webpack_require__(/*! ./window */ "./src/ts/imports/util/window.ts"), exports);
|
|
729
1082
|
|
|
730
1083
|
/***/ }),
|
|
731
1084
|
|
|
@@ -740,11 +1093,11 @@ exports["default"] = mintIcon;
|
|
|
740
1093
|
Object.defineProperty(exports, "__esModule", ({
|
|
741
1094
|
value: true
|
|
742
1095
|
}));
|
|
743
|
-
exports.
|
|
1096
|
+
exports.MintList = void 0;
|
|
744
1097
|
/**
|
|
745
1098
|
* List functions for the util library
|
|
746
1099
|
*/
|
|
747
|
-
class
|
|
1100
|
+
class MintList {
|
|
748
1101
|
/**
|
|
749
1102
|
* Returns a copy of the provided list with the items in random order
|
|
750
1103
|
* @param list - the list to shuffle
|
|
@@ -778,9 +1131,9 @@ class mintList {
|
|
|
778
1131
|
return list;
|
|
779
1132
|
}
|
|
780
1133
|
}
|
|
781
|
-
exports.
|
|
1134
|
+
exports.MintList = MintList;
|
|
782
1135
|
;
|
|
783
|
-
exports["default"] =
|
|
1136
|
+
exports["default"] = MintList;
|
|
784
1137
|
|
|
785
1138
|
/***/ }),
|
|
786
1139
|
|
|
@@ -795,11 +1148,11 @@ exports["default"] = mintList;
|
|
|
795
1148
|
Object.defineProperty(exports, "__esModule", ({
|
|
796
1149
|
value: true
|
|
797
1150
|
}));
|
|
798
|
-
exports.
|
|
1151
|
+
exports.MintMath = void 0;
|
|
799
1152
|
/**
|
|
800
1153
|
* Math functions for the util library
|
|
801
1154
|
*/
|
|
802
|
-
class
|
|
1155
|
+
class MintMath {
|
|
803
1156
|
/**
|
|
804
1157
|
* Get a random integer between min and max
|
|
805
1158
|
* @param max Maximum value to return
|
|
@@ -813,9 +1166,9 @@ class mintMath {
|
|
|
813
1166
|
return Math.floor(Math.random() * (max - min) + min);
|
|
814
1167
|
}
|
|
815
1168
|
}
|
|
816
|
-
exports.
|
|
1169
|
+
exports.MintMath = MintMath;
|
|
817
1170
|
;
|
|
818
|
-
exports["default"] =
|
|
1171
|
+
exports["default"] = MintMath;
|
|
819
1172
|
|
|
820
1173
|
/***/ }),
|
|
821
1174
|
|
|
@@ -830,11 +1183,11 @@ exports["default"] = mintMath;
|
|
|
830
1183
|
Object.defineProperty(exports, "__esModule", ({
|
|
831
1184
|
value: true
|
|
832
1185
|
}));
|
|
833
|
-
exports.
|
|
1186
|
+
exports.MintObject = void 0;
|
|
834
1187
|
/**
|
|
835
1188
|
* Object functions for the util library
|
|
836
1189
|
*/
|
|
837
|
-
class
|
|
1190
|
+
class MintObject {
|
|
838
1191
|
/**
|
|
839
1192
|
* Returns true if the provided objects have the same entries
|
|
840
1193
|
*/
|
|
@@ -881,7 +1234,7 @@ class mintObject {
|
|
|
881
1234
|
// If the children of the subset are subsets of the
|
|
882
1235
|
// respective children of the superset, it is a superset
|
|
883
1236
|
Object.keys(subset).forEach(key => {
|
|
884
|
-
isSuperset = isSuperset &&
|
|
1237
|
+
isSuperset = isSuperset && MintObject.isSuperset(superset[key], subset[key]);
|
|
885
1238
|
});
|
|
886
1239
|
return isSuperset;
|
|
887
1240
|
}
|
|
@@ -1018,9 +1371,9 @@ class mintObject {
|
|
|
1018
1371
|
newObjects === null || newObjects === void 0 ? void 0 : newObjects.forEach(newObject => original.push(newObject));
|
|
1019
1372
|
}
|
|
1020
1373
|
}
|
|
1021
|
-
exports.
|
|
1374
|
+
exports.MintObject = MintObject;
|
|
1022
1375
|
;
|
|
1023
|
-
exports["default"] =
|
|
1376
|
+
exports["default"] = MintObject;
|
|
1024
1377
|
|
|
1025
1378
|
/***/ }),
|
|
1026
1379
|
|
|
@@ -1035,11 +1388,11 @@ exports["default"] = mintObject;
|
|
|
1035
1388
|
Object.defineProperty(exports, "__esModule", ({
|
|
1036
1389
|
value: true
|
|
1037
1390
|
}));
|
|
1038
|
-
exports.
|
|
1391
|
+
exports.MintScroll = void 0;
|
|
1039
1392
|
/**
|
|
1040
1393
|
* Scroll functions
|
|
1041
1394
|
*/
|
|
1042
|
-
class
|
|
1395
|
+
class MintScroll {
|
|
1043
1396
|
/**
|
|
1044
1397
|
* Scroll to the top of the page
|
|
1045
1398
|
*/
|
|
@@ -1074,9 +1427,9 @@ class mintScroll {
|
|
|
1074
1427
|
});
|
|
1075
1428
|
}
|
|
1076
1429
|
}
|
|
1077
|
-
exports.
|
|
1430
|
+
exports.MintScroll = MintScroll;
|
|
1078
1431
|
;
|
|
1079
|
-
exports["default"] =
|
|
1432
|
+
exports["default"] = MintScroll;
|
|
1080
1433
|
|
|
1081
1434
|
/***/ }),
|
|
1082
1435
|
|
|
@@ -1092,12 +1445,12 @@ var _a;
|
|
|
1092
1445
|
Object.defineProperty(exports, "__esModule", ({
|
|
1093
1446
|
value: true
|
|
1094
1447
|
}));
|
|
1095
|
-
exports.
|
|
1448
|
+
exports.MintSelectors = void 0;
|
|
1096
1449
|
/**
|
|
1097
1450
|
* CSS-selector helpers
|
|
1098
1451
|
* @public
|
|
1099
1452
|
*/
|
|
1100
|
-
class
|
|
1453
|
+
class MintSelectors {
|
|
1101
1454
|
/**
|
|
1102
1455
|
* Adds the library prefix to the beginning of the provided string
|
|
1103
1456
|
* @param base - the string to be prefixed
|
|
@@ -1195,52 +1548,52 @@ class mintSelectors {
|
|
|
1195
1548
|
return true;
|
|
1196
1549
|
}
|
|
1197
1550
|
}
|
|
1198
|
-
exports.
|
|
1199
|
-
_a =
|
|
1551
|
+
exports.MintSelectors = MintSelectors;
|
|
1552
|
+
_a = MintSelectors;
|
|
1200
1553
|
/**
|
|
1201
1554
|
* The library name that will be added as a prefix
|
|
1202
1555
|
*/
|
|
1203
|
-
|
|
1556
|
+
MintSelectors.lib = 'mint';
|
|
1204
1557
|
/**
|
|
1205
1558
|
* The prefix built from the library name
|
|
1206
1559
|
*/
|
|
1207
|
-
|
|
1560
|
+
MintSelectors.pre = `${_a.lib}-`;
|
|
1208
1561
|
/**
|
|
1209
1562
|
* CSS-selector for disabled elements
|
|
1210
1563
|
*/
|
|
1211
|
-
|
|
1564
|
+
MintSelectors.disabled = '[disabled]';
|
|
1212
1565
|
/**
|
|
1213
1566
|
* CSS-selector for elements with an aria-controls attribute
|
|
1214
1567
|
*/
|
|
1215
|
-
|
|
1568
|
+
MintSelectors.hasControls = '[aria-controls]';
|
|
1216
1569
|
/**
|
|
1217
1570
|
* CSS-selector for elements with an aria-expanded attribute
|
|
1218
1571
|
*/
|
|
1219
|
-
|
|
1572
|
+
MintSelectors.hasExpanded = '[aria-expanded]';
|
|
1220
1573
|
/**
|
|
1221
1574
|
* CSS-selector for elements with an href attribute
|
|
1222
1575
|
*/
|
|
1223
|
-
|
|
1576
|
+
MintSelectors.hasLink = '[href]';
|
|
1224
1577
|
/**
|
|
1225
1578
|
* CSS-selector for elements with a routerLink attribute
|
|
1226
1579
|
*/
|
|
1227
|
-
|
|
1580
|
+
MintSelectors.hasRouterLink = '[routerLink]';
|
|
1228
1581
|
/**
|
|
1229
1582
|
* CSS-selector for elements with an id attribute
|
|
1230
1583
|
*/
|
|
1231
|
-
|
|
1584
|
+
MintSelectors.hasId = '[id]';
|
|
1232
1585
|
/**
|
|
1233
1586
|
* CSS-selector for elements that aren't tabbable (i.e. tabindex is negative)
|
|
1234
1587
|
*/
|
|
1235
|
-
|
|
1588
|
+
MintSelectors.notTabbable = '[tabindex^="-"]';
|
|
1236
1589
|
/**
|
|
1237
1590
|
* CSS-selector for elements that are tabbable (i.e. tabindex isn't negative)
|
|
1238
1591
|
*/
|
|
1239
|
-
|
|
1592
|
+
MintSelectors.tabbable = `[tabindex]${_a.neg(_a.notTabbable)}`;
|
|
1240
1593
|
/**
|
|
1241
1594
|
* CSS-selector for elements that can receive focus
|
|
1242
1595
|
*/
|
|
1243
|
-
|
|
1596
|
+
MintSelectors.focusable = `input${_a.neg(_a.disabled)}${_a.neg(_a.notTabbable)},
|
|
1244
1597
|
select${_a.neg(_a.disabled)}${_a.neg(_a.notTabbable)},
|
|
1245
1598
|
textarea${_a.neg(_a.disabled)}${_a.neg(_a.notTabbable)},
|
|
1246
1599
|
button${_a.neg(_a.disabled)}${_a.neg(_a.notTabbable)},
|
|
@@ -1251,12 +1604,13 @@ mintSelectors.focusable = `input${_a.neg(_a.disabled)}${_a.neg(_a.notTabbable)},
|
|
|
1251
1604
|
/**
|
|
1252
1605
|
* CSS-selector for submenu buttons
|
|
1253
1606
|
*/
|
|
1254
|
-
|
|
1607
|
+
MintSelectors.subMenuButtons = `button${_a.hasControls}`;
|
|
1255
1608
|
/**
|
|
1256
1609
|
* CSS-selector for submenus
|
|
1257
1610
|
*/
|
|
1258
|
-
|
|
1259
|
-
|
|
1611
|
+
MintSelectors.subMenu = `${_a.subMenuButtons} + ul${_a.hasId}`;
|
|
1612
|
+
;
|
|
1613
|
+
exports["default"] = MintSelectors;
|
|
1260
1614
|
|
|
1261
1615
|
/***/ }),
|
|
1262
1616
|
|
|
@@ -1272,12 +1626,12 @@ var _a;
|
|
|
1272
1626
|
Object.defineProperty(exports, "__esModule", ({
|
|
1273
1627
|
value: true
|
|
1274
1628
|
}));
|
|
1275
|
-
exports.
|
|
1629
|
+
exports.MintSettings = void 0;
|
|
1276
1630
|
/**
|
|
1277
1631
|
* Settings management
|
|
1278
1632
|
* @public
|
|
1279
1633
|
*/
|
|
1280
|
-
class
|
|
1634
|
+
class MintSettings {
|
|
1281
1635
|
/**
|
|
1282
1636
|
* Update the provided settings variables
|
|
1283
1637
|
* @param settings - Object of settings variables to update
|
|
@@ -1320,20 +1674,20 @@ class mintSettings {
|
|
|
1320
1674
|
};
|
|
1321
1675
|
}
|
|
1322
1676
|
}
|
|
1323
|
-
exports.
|
|
1324
|
-
_a =
|
|
1677
|
+
exports.MintSettings = MintSettings;
|
|
1678
|
+
_a = MintSettings;
|
|
1325
1679
|
/**
|
|
1326
1680
|
* Value added to all delay variables
|
|
1327
1681
|
*/
|
|
1328
|
-
|
|
1682
|
+
MintSettings.delayBase = 0;
|
|
1329
1683
|
/**
|
|
1330
1684
|
* Value multiplied by delay variable index
|
|
1331
1685
|
*/
|
|
1332
|
-
|
|
1686
|
+
MintSettings.delayStep = 100;
|
|
1333
1687
|
/**
|
|
1334
1688
|
* Delay variables
|
|
1335
1689
|
*/
|
|
1336
|
-
|
|
1690
|
+
MintSettings.delay = {
|
|
1337
1691
|
instant: _a.delayBase + _a.delayStep * 0,
|
|
1338
1692
|
fast: _a.delayBase + _a.delayStep * 1,
|
|
1339
1693
|
medFast: _a.delayBase + _a.delayStep * 2,
|
|
@@ -1344,7 +1698,7 @@ mintSettings.delay = {
|
|
|
1344
1698
|
/**
|
|
1345
1699
|
* Breakpoint variables
|
|
1346
1700
|
*/
|
|
1347
|
-
|
|
1701
|
+
MintSettings.break = {
|
|
1348
1702
|
z: 0,
|
|
1349
1703
|
xs: 480,
|
|
1350
1704
|
sm: 768,
|
|
@@ -1353,7 +1707,7 @@ mintSettings.break = {
|
|
|
1353
1707
|
xl: 1440
|
|
1354
1708
|
};
|
|
1355
1709
|
;
|
|
1356
|
-
exports["default"] =
|
|
1710
|
+
exports["default"] = MintSettings;
|
|
1357
1711
|
|
|
1358
1712
|
/***/ }),
|
|
1359
1713
|
|
|
@@ -1368,11 +1722,11 @@ exports["default"] = mintSettings;
|
|
|
1368
1722
|
Object.defineProperty(exports, "__esModule", ({
|
|
1369
1723
|
value: true
|
|
1370
1724
|
}));
|
|
1371
|
-
exports.
|
|
1725
|
+
exports.MintText = void 0;
|
|
1372
1726
|
/**
|
|
1373
1727
|
* Functions for analyzing and manipulating text.
|
|
1374
1728
|
*/
|
|
1375
|
-
class
|
|
1729
|
+
class MintText {
|
|
1376
1730
|
/**
|
|
1377
1731
|
* Generate a slug from a string
|
|
1378
1732
|
* @param text - The string to slugify
|
|
@@ -1448,13 +1802,48 @@ class mintText {
|
|
|
1448
1802
|
static titleCase(text) {
|
|
1449
1803
|
return text.toLowerCase().replace(/(?:^|\s)\S/g, a => a.toUpperCase());
|
|
1450
1804
|
}
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1805
|
+
/**
|
|
1806
|
+
* Copies the provided text to the clipboard
|
|
1807
|
+
* @param text - the text to copy
|
|
1808
|
+
* @returns - true if the text was successfully copied to the clipboard; else false
|
|
1809
|
+
*/
|
|
1810
|
+
static copyText(text) {
|
|
1811
|
+
let textArea = document.createElement('textarea');
|
|
1812
|
+
if (!text || !textArea) {
|
|
1813
|
+
return false;
|
|
1814
|
+
}
|
|
1815
|
+
textArea.value = text;
|
|
1816
|
+
textArea.style.cssText = `
|
|
1817
|
+
position: fixed;
|
|
1818
|
+
top: 0;
|
|
1819
|
+
left: 0;
|
|
1820
|
+
transform: translate(-100%, -100%);
|
|
1821
|
+
opacity: 0;
|
|
1822
|
+
z-index: -1;
|
|
1823
|
+
`;
|
|
1824
|
+
document.body.appendChild(textArea);
|
|
1825
|
+
textArea.select();
|
|
1826
|
+
textArea.setSelectionRange(0, 99999);
|
|
1827
|
+
navigator.clipboard.writeText(textArea.value);
|
|
1828
|
+
document.body.removeChild(textArea);
|
|
1829
|
+
return true;
|
|
1830
|
+
}
|
|
1831
|
+
/**
|
|
1832
|
+
* Tests the validity of an email address
|
|
1833
|
+
* @see {@link https://stackoverflow.com/questions/201323/how-can-i-validate-an-email-address-using-a-regular-expression}
|
|
1834
|
+
* @param text - the string to test
|
|
1835
|
+
* @returns - true if the given string is an email address; false if not
|
|
1836
|
+
*/
|
|
1837
|
+
static isEmail(text) {
|
|
1838
|
+
return null !== text.match(/(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/);
|
|
1839
|
+
}
|
|
1840
|
+
}
|
|
1841
|
+
exports.MintText = MintText;
|
|
1842
|
+
;
|
|
1843
|
+
exports["default"] = MintText;
|
|
1844
|
+
|
|
1845
|
+
/***/ }),
|
|
1846
|
+
|
|
1458
1847
|
/***/ "./src/ts/imports/util/window.ts":
|
|
1459
1848
|
/*!***************************************!*\
|
|
1460
1849
|
!*** ./src/ts/imports/util/window.ts ***!
|
|
@@ -1466,14 +1855,23 @@ exports["default"] = mintText;
|
|
|
1466
1855
|
Object.defineProperty(exports, "__esModule", ({
|
|
1467
1856
|
value: true
|
|
1468
1857
|
}));
|
|
1469
|
-
exports.
|
|
1858
|
+
exports.MintWindow = void 0;
|
|
1470
1859
|
/**
|
|
1471
1860
|
* Functions related to the browser window.
|
|
1472
1861
|
*/
|
|
1473
|
-
class
|
|
1474
|
-
|
|
1862
|
+
class MintWindow {
|
|
1863
|
+
/**
|
|
1864
|
+
* Returns the width of the window, including fractional pixels
|
|
1865
|
+
* @returns the width of the window
|
|
1866
|
+
*/
|
|
1867
|
+
static width() {
|
|
1868
|
+
const decimal = document.body.getBoundingClientRect().width % 1;
|
|
1869
|
+
return window.innerWidth + decimal;
|
|
1870
|
+
}
|
|
1871
|
+
}
|
|
1872
|
+
exports.MintWindow = MintWindow;
|
|
1475
1873
|
;
|
|
1476
|
-
exports["default"] =
|
|
1874
|
+
exports["default"] = MintWindow;
|
|
1477
1875
|
|
|
1478
1876
|
/***/ }),
|
|
1479
1877
|
|
|
@@ -1490,364 +1888,32 @@ exports["default"] = mintWindow;
|
|
|
1490
1888
|
*
|
|
1491
1889
|
* @packageDocumentation
|
|
1492
1890
|
*/
|
|
1493
|
-
var
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
* Exports
|
|
1504
|
-
*/
|
|
1505
|
-
// Enums
|
|
1506
|
-
var enum_1 = __webpack_require__(/*! ./imports/enum */ "./src/ts/imports/enum.ts");
|
|
1507
|
-
Object.defineProperty(exports, "mintSide", ({
|
|
1508
|
-
enumerable: true,
|
|
1509
|
-
get: function () {
|
|
1510
|
-
return enum_1.mintSide;
|
|
1511
|
-
}
|
|
1512
|
-
}));
|
|
1513
|
-
// Components
|
|
1514
|
-
var header_1 = __webpack_require__(/*! ./imports/components/header */ "./src/ts/imports/components/header.ts");
|
|
1515
|
-
Object.defineProperty(exports, "mintHeader", ({
|
|
1516
|
-
enumerable: true,
|
|
1517
|
-
get: function () {
|
|
1518
|
-
return header_1.mintHeader;
|
|
1519
|
-
}
|
|
1520
|
-
}));
|
|
1521
|
-
// Models
|
|
1522
|
-
var color_1 = __webpack_require__(/*! ./imports/models/color */ "./src/ts/imports/models/color.ts");
|
|
1523
|
-
Object.defineProperty(exports, "mintColor", ({
|
|
1524
|
-
enumerable: true,
|
|
1525
|
-
get: function () {
|
|
1526
|
-
return color_1.mintColor;
|
|
1527
|
-
}
|
|
1528
|
-
}));
|
|
1529
|
-
var item_1 = __webpack_require__(/*! ./imports/models/item */ "./src/ts/imports/models/item.ts");
|
|
1530
|
-
Object.defineProperty(exports, "mintItem", ({
|
|
1531
|
-
enumerable: true,
|
|
1532
|
-
get: function () {
|
|
1533
|
-
return item_1.mintItem;
|
|
1534
|
-
}
|
|
1535
|
-
}));
|
|
1536
|
-
// Utilities
|
|
1537
|
-
var display_1 = __webpack_require__(/*! ./imports/util/display */ "./src/ts/imports/util/display.ts");
|
|
1538
|
-
Object.defineProperty(exports, "mintDisplay", ({
|
|
1539
|
-
enumerable: true,
|
|
1540
|
-
get: function () {
|
|
1541
|
-
return display_1.mintDisplay;
|
|
1542
|
-
}
|
|
1543
|
-
}));
|
|
1544
|
-
var event_1 = __webpack_require__(/*! ./imports/util/event */ "./src/ts/imports/util/event.ts");
|
|
1545
|
-
Object.defineProperty(exports, "mintEvent", ({
|
|
1546
|
-
enumerable: true,
|
|
1547
|
-
get: function () {
|
|
1548
|
-
return event_1.mintEvent;
|
|
1549
|
-
}
|
|
1550
|
-
}));
|
|
1551
|
-
var icon_1 = __webpack_require__(/*! ./imports/util/icon */ "./src/ts/imports/util/icon.ts");
|
|
1552
|
-
Object.defineProperty(exports, "mintIcon", ({
|
|
1553
|
-
enumerable: true,
|
|
1554
|
-
get: function () {
|
|
1555
|
-
return icon_1.mintIcon;
|
|
1556
|
-
}
|
|
1557
|
-
}));
|
|
1558
|
-
var list_1 = __webpack_require__(/*! ./imports/util/list */ "./src/ts/imports/util/list.ts");
|
|
1559
|
-
Object.defineProperty(exports, "mintList", ({
|
|
1560
|
-
enumerable: true,
|
|
1561
|
-
get: function () {
|
|
1562
|
-
return list_1.mintList;
|
|
1563
|
-
}
|
|
1564
|
-
}));
|
|
1565
|
-
var math_1 = __webpack_require__(/*! ./imports/util/math */ "./src/ts/imports/util/math.ts");
|
|
1566
|
-
Object.defineProperty(exports, "mintMath", ({
|
|
1567
|
-
enumerable: true,
|
|
1568
|
-
get: function () {
|
|
1569
|
-
return math_1.mintMath;
|
|
1570
|
-
}
|
|
1571
|
-
}));
|
|
1572
|
-
var object_1 = __webpack_require__(/*! ./imports/util/object */ "./src/ts/imports/util/object.ts");
|
|
1573
|
-
Object.defineProperty(exports, "mintObject", ({
|
|
1574
|
-
enumerable: true,
|
|
1575
|
-
get: function () {
|
|
1576
|
-
return object_1.mintObject;
|
|
1577
|
-
}
|
|
1578
|
-
}));
|
|
1579
|
-
var scroll_1 = __webpack_require__(/*! ./imports/util/scroll */ "./src/ts/imports/util/scroll.ts");
|
|
1580
|
-
Object.defineProperty(exports, "mintScroll", ({
|
|
1581
|
-
enumerable: true,
|
|
1582
|
-
get: function () {
|
|
1583
|
-
return scroll_1.mintScroll;
|
|
1584
|
-
}
|
|
1585
|
-
}));
|
|
1586
|
-
var text_1 = __webpack_require__(/*! ./imports/util/text */ "./src/ts/imports/util/text.ts");
|
|
1587
|
-
Object.defineProperty(exports, "mintText", ({
|
|
1588
|
-
enumerable: true,
|
|
1589
|
-
get: function () {
|
|
1590
|
-
return text_1.mintText;
|
|
1591
|
-
}
|
|
1592
|
-
}));
|
|
1593
|
-
var window_1 = __webpack_require__(/*! ./imports/util/window */ "./src/ts/imports/util/window.ts");
|
|
1594
|
-
Object.defineProperty(exports, "mintWindow", ({
|
|
1595
|
-
enumerable: true,
|
|
1596
|
-
get: function () {
|
|
1597
|
-
return window_1.mintWindow;
|
|
1598
|
-
}
|
|
1599
|
-
}));
|
|
1600
|
-
// Objects
|
|
1601
|
-
var selectors_1 = __webpack_require__(/*! ./imports/util/selectors */ "./src/ts/imports/util/selectors.ts");
|
|
1602
|
-
Object.defineProperty(exports, "mintSelectors", ({
|
|
1603
|
-
enumerable: true,
|
|
1604
|
-
get: function () {
|
|
1605
|
-
return selectors_1.mintSelectors;
|
|
1606
|
-
}
|
|
1607
|
-
}));
|
|
1608
|
-
var settings_1 = __webpack_require__(/*! ./imports/util/settings */ "./src/ts/imports/util/settings.ts");
|
|
1609
|
-
Object.defineProperty(exports, "mintSettings", ({
|
|
1610
|
-
enumerable: true,
|
|
1611
|
-
get: function () {
|
|
1612
|
-
return settings_1.mintSettings;
|
|
1613
|
-
}
|
|
1614
|
-
}));
|
|
1615
|
-
var util_1 = __webpack_require__(/*! ./util */ "./src/ts/util.ts");
|
|
1616
|
-
Object.defineProperty(exports, "mintUtil", ({
|
|
1617
|
-
enumerable: true,
|
|
1618
|
-
get: function () {
|
|
1619
|
-
return util_1.mintUtil;
|
|
1620
|
-
}
|
|
1621
|
-
}));
|
|
1622
|
-
Object.defineProperty(exports, "default", ({
|
|
1623
|
-
enumerable: true,
|
|
1624
|
-
get: function () {
|
|
1625
|
-
return __importDefault(util_1).default;
|
|
1891
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
1892
|
+
if (k2 === undefined) k2 = k;
|
|
1893
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
1894
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
1895
|
+
desc = {
|
|
1896
|
+
enumerable: true,
|
|
1897
|
+
get: function () {
|
|
1898
|
+
return m[k];
|
|
1899
|
+
}
|
|
1900
|
+
};
|
|
1626
1901
|
}
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
\************************/
|
|
1635
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
var __importDefault = this && this.__importDefault || function (mod) {
|
|
1640
|
-
return mod && mod.__esModule ? mod : {
|
|
1641
|
-
"default": mod
|
|
1642
|
-
};
|
|
1902
|
+
Object.defineProperty(o, k2, desc);
|
|
1903
|
+
} : function (o, m, k, k2) {
|
|
1904
|
+
if (k2 === undefined) k2 = k;
|
|
1905
|
+
o[k2] = m[k];
|
|
1906
|
+
});
|
|
1907
|
+
var __exportStar = this && this.__exportStar || function (m, exports) {
|
|
1908
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
1643
1909
|
};
|
|
1644
1910
|
Object.defineProperty(exports, "__esModule", ({
|
|
1645
1911
|
value: true
|
|
1646
1912
|
}));
|
|
1647
|
-
exports.mintUtil = void 0;
|
|
1648
1913
|
/**
|
|
1649
|
-
*
|
|
1650
|
-
*/
|
|
1651
|
-
const enum_1 = __webpack_require__(/*! ./imports/enum */ "./src/ts/imports/enum.ts");
|
|
1652
|
-
const settings_1 = __importDefault(__webpack_require__(/*! ./imports/util/settings */ "./src/ts/imports/util/settings.ts"));
|
|
1653
|
-
/**
|
|
1654
|
-
* Utility functions
|
|
1655
|
-
* @public
|
|
1914
|
+
* Exports
|
|
1656
1915
|
*/
|
|
1657
|
-
|
|
1658
|
-
/**
|
|
1659
|
-
* Returns the width of the window, including fractional pixels
|
|
1660
|
-
* @returns the width of the window
|
|
1661
|
-
*/
|
|
1662
|
-
static windowWidth() {
|
|
1663
|
-
const decimal = document.body.getBoundingClientRect().width % 1;
|
|
1664
|
-
return window.innerWidth + decimal;
|
|
1665
|
-
}
|
|
1666
|
-
/**
|
|
1667
|
-
* Ensures that a function `func` is run only after not being called for `wait` milliseconds
|
|
1668
|
-
* @param func - the function to debounce
|
|
1669
|
-
* @param wait - the amount of time to wait before running the function
|
|
1670
|
-
* @returns - the debounced function
|
|
1671
|
-
*/
|
|
1672
|
-
static debounce(func) {
|
|
1673
|
-
let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
|
|
1674
|
-
let timer;
|
|
1675
|
-
return function (e) {
|
|
1676
|
-
if (timer) {
|
|
1677
|
-
clearTimeout(timer);
|
|
1678
|
-
}
|
|
1679
|
-
timer = setTimeout(func, wait, e);
|
|
1680
|
-
};
|
|
1681
|
-
}
|
|
1682
|
-
/**
|
|
1683
|
-
* Ensures that a function `func` is run only after not being called for `wait` milliseconds
|
|
1684
|
-
* @param func - the function to debounce
|
|
1685
|
-
* @param wait - the amount of time to wait before running the function
|
|
1686
|
-
* @returns - the debounced function as an EventListener
|
|
1687
|
-
*/
|
|
1688
|
-
static debounceEvent(func) {
|
|
1689
|
-
let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
|
|
1690
|
-
return mintUtil.debounce(func, wait);
|
|
1691
|
-
}
|
|
1692
|
-
/**
|
|
1693
|
-
* Ensures that a function `func` is called at most every `wait` milliseconds with optional leading and trailing calls
|
|
1694
|
-
* @param func - the function to throttle
|
|
1695
|
-
* @param wait - the amount of time between function calls
|
|
1696
|
-
* @param options - leading and trailing options: default = \{ leading: true, trailing, true \}
|
|
1697
|
-
* @returns - the throttled function
|
|
1698
|
-
*/
|
|
1699
|
-
static throttle(func) {
|
|
1700
|
-
let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
|
|
1701
|
-
let options = arguments.length > 2 ? arguments[2] : undefined;
|
|
1702
|
-
let context,
|
|
1703
|
-
args,
|
|
1704
|
-
result,
|
|
1705
|
-
timeout,
|
|
1706
|
-
previous = 0,
|
|
1707
|
-
later = function () {
|
|
1708
|
-
previous = (options === null || options === void 0 ? void 0 : options.leading) === false ? 0 : new Date().getTime();
|
|
1709
|
-
timeout = 0;
|
|
1710
|
-
result = func.apply(context, args);
|
|
1711
|
-
if (!timeout) {
|
|
1712
|
-
context = args = null;
|
|
1713
|
-
}
|
|
1714
|
-
},
|
|
1715
|
-
throttled = function () {
|
|
1716
|
-
let now = new Date().getTime();
|
|
1717
|
-
if (!previous && (options === null || options === void 0 ? void 0 : options.leading) === false) {
|
|
1718
|
-
previous = now;
|
|
1719
|
-
}
|
|
1720
|
-
let remaining = wait - now + previous;
|
|
1721
|
-
context = this;
|
|
1722
|
-
args = arguments;
|
|
1723
|
-
if (remaining <= 0 || remaining > wait) {
|
|
1724
|
-
if (timeout) {
|
|
1725
|
-
clearTimeout(timeout);
|
|
1726
|
-
timeout = 0;
|
|
1727
|
-
}
|
|
1728
|
-
previous = now;
|
|
1729
|
-
result = func.apply(context, args);
|
|
1730
|
-
if (!timeout) {
|
|
1731
|
-
context = args = null;
|
|
1732
|
-
}
|
|
1733
|
-
} else if (!timeout && (options === null || options === void 0 ? void 0 : options.trailing) !== false) {
|
|
1734
|
-
timeout = window.setTimeout(later, remaining);
|
|
1735
|
-
}
|
|
1736
|
-
return result;
|
|
1737
|
-
};
|
|
1738
|
-
return throttled;
|
|
1739
|
-
}
|
|
1740
|
-
/**
|
|
1741
|
-
* Ensures that a function `func` is called at most every `wait` milliseconds with optional leading and trailing calls
|
|
1742
|
-
* @param func - the function to throttle
|
|
1743
|
-
* @param wait - the amount of time between function calls
|
|
1744
|
-
* @param options - leading and trailing options: default = \{ leading: true, trailing, true \}
|
|
1745
|
-
* @returns - the throttled function as an EventListener
|
|
1746
|
-
*/
|
|
1747
|
-
static throttleEvent(func) {
|
|
1748
|
-
let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
|
|
1749
|
-
let options = arguments.length > 2 ? arguments[2] : undefined;
|
|
1750
|
-
return mintUtil.throttle(func, wait, options);
|
|
1751
|
-
}
|
|
1752
|
-
/**
|
|
1753
|
-
* Sets the element's height to its `innerHeight`, then to `auto` after a delay
|
|
1754
|
-
* @param el - the element whose height will be set
|
|
1755
|
-
* @param delay - the amount of time in milliseconds that the show animation will be active
|
|
1756
|
-
* @param from - the side that the element is animating from
|
|
1757
|
-
*/
|
|
1758
|
-
static show(el) {
|
|
1759
|
-
let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
|
|
1760
|
-
let from = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : enum_1.mintSide.Top;
|
|
1761
|
-
if (el) {
|
|
1762
|
-
el.style.display = '';
|
|
1763
|
-
requestAnimationFrame(() => {
|
|
1764
|
-
if (from === enum_1.mintSide.Top || from === enum_1.mintSide.Bottom) {
|
|
1765
|
-
el.style.height = `${el.scrollHeight}px`;
|
|
1766
|
-
} else {
|
|
1767
|
-
el.style.width = `${el.scrollWidth}px`;
|
|
1768
|
-
}
|
|
1769
|
-
setTimeout(() => {
|
|
1770
|
-
if (from === enum_1.mintSide.Top || from === enum_1.mintSide.Bottom) {
|
|
1771
|
-
el.style.height = 'auto';
|
|
1772
|
-
} else {
|
|
1773
|
-
el.style.width = 'auto';
|
|
1774
|
-
}
|
|
1775
|
-
}, delay);
|
|
1776
|
-
});
|
|
1777
|
-
}
|
|
1778
|
-
}
|
|
1779
|
-
/**
|
|
1780
|
-
* Sets the element's height to 0
|
|
1781
|
-
* @param el - the element whose height will be set
|
|
1782
|
-
* @param delay - the amount of time in milliseconds that the show animation will be active
|
|
1783
|
-
* @param from - the side that the element is animating from
|
|
1784
|
-
*/
|
|
1785
|
-
static hide(el) {
|
|
1786
|
-
let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
|
|
1787
|
-
let from = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : enum_1.mintSide.Top;
|
|
1788
|
-
if (el) {
|
|
1789
|
-
let height = el.scrollHeight,
|
|
1790
|
-
width = el.scrollWidth,
|
|
1791
|
-
transition = el.style.transition;
|
|
1792
|
-
el.style.transition = '';
|
|
1793
|
-
requestAnimationFrame(() => {
|
|
1794
|
-
if (from === enum_1.mintSide.Top || from === enum_1.mintSide.Bottom) {
|
|
1795
|
-
el.style.height = `${height}px`;
|
|
1796
|
-
} else {
|
|
1797
|
-
el.style.width = `${width}px`;
|
|
1798
|
-
}
|
|
1799
|
-
el.style.transition = transition;
|
|
1800
|
-
requestAnimationFrame(() => {
|
|
1801
|
-
if (from === enum_1.mintSide.Top || from === enum_1.mintSide.Bottom) {
|
|
1802
|
-
el.style.height = '0';
|
|
1803
|
-
} else {
|
|
1804
|
-
el.style.width = '0';
|
|
1805
|
-
}
|
|
1806
|
-
});
|
|
1807
|
-
});
|
|
1808
|
-
setTimeout(() => {
|
|
1809
|
-
el.style.display = 'none';
|
|
1810
|
-
}, delay);
|
|
1811
|
-
}
|
|
1812
|
-
}
|
|
1813
|
-
/**
|
|
1814
|
-
* Copies the provided text to the clipboard
|
|
1815
|
-
* @param text - the text to copy
|
|
1816
|
-
* @returns - true if the text was successfully copied to the clipboard; else false
|
|
1817
|
-
*/
|
|
1818
|
-
static copyText(text) {
|
|
1819
|
-
let textArea = document.createElement('textarea');
|
|
1820
|
-
if (!text || !textArea) {
|
|
1821
|
-
return false;
|
|
1822
|
-
}
|
|
1823
|
-
textArea.value = text;
|
|
1824
|
-
textArea.style.cssText = `
|
|
1825
|
-
position: fixed;
|
|
1826
|
-
top: 0;
|
|
1827
|
-
left: 0;
|
|
1828
|
-
transform: translate(-100%, -100%);
|
|
1829
|
-
opacity: 0;
|
|
1830
|
-
z-index: -1;
|
|
1831
|
-
`;
|
|
1832
|
-
document.body.appendChild(textArea);
|
|
1833
|
-
textArea.select();
|
|
1834
|
-
textArea.setSelectionRange(0, 99999);
|
|
1835
|
-
navigator.clipboard.writeText(textArea.value);
|
|
1836
|
-
document.body.removeChild(textArea);
|
|
1837
|
-
return true;
|
|
1838
|
-
}
|
|
1839
|
-
/**
|
|
1840
|
-
* Tests the validity of an email address
|
|
1841
|
-
* @see {@link https://stackoverflow.com/questions/201323/how-can-i-validate-an-email-address-using-a-regular-expression}
|
|
1842
|
-
* @param text - the string to test
|
|
1843
|
-
* @returns - true if the given string is an email address; false if not
|
|
1844
|
-
*/
|
|
1845
|
-
static isEmail(text) {
|
|
1846
|
-
return null !== text.match(/(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/);
|
|
1847
|
-
}
|
|
1848
|
-
}
|
|
1849
|
-
exports.mintUtil = mintUtil;
|
|
1850
|
-
exports["default"] = mintUtil;
|
|
1916
|
+
__exportStar(__webpack_require__(/*! ./imports */ "./src/ts/imports/index.ts"), exports);
|
|
1851
1917
|
|
|
1852
1918
|
/***/ })
|
|
1853
1919
|
|