@appartmint/mint 1.3.1 → 1.3.3
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/README.md +3 -3
- package/dist/css/mint.css.map +1 -1
- package/dist/css/mint.min.css.map +1 -1
- package/dist/js/imports/components/header.d.ts +124 -124
- package/dist/js/imports/components/index.d.ts +4 -4
- package/dist/js/imports/enums/index.d.ts +4 -4
- package/dist/js/imports/enums/side.d.ts +9 -9
- package/dist/js/imports/index.d.ts +7 -7
- package/dist/js/imports/models/color.d.ts +31 -31
- package/dist/js/imports/models/file.d.ts +20 -20
- package/dist/js/imports/models/index.d.ts +9 -9
- package/dist/js/imports/models/item.d.ts +74 -74
- package/dist/js/imports/models/minify.d.ts +11 -11
- package/dist/js/imports/models/page.d.ts +17 -17
- package/dist/js/imports/models/recaptcha.d.ts +8 -8
- package/dist/js/imports/util/async.d.ts +10 -10
- package/dist/js/imports/util/display.d.ts +24 -24
- package/dist/js/imports/util/event.d.ts +40 -40
- package/dist/js/imports/util/icon.d.ts +28 -28
- package/dist/js/imports/util/index.d.ts +15 -15
- package/dist/js/imports/util/list.d.ts +22 -22
- package/dist/js/imports/util/math.d.ts +13 -13
- package/dist/js/imports/util/object.d.ts +82 -82
- package/dist/js/imports/util/scroll.d.ts +22 -22
- package/dist/js/imports/util/selectors.d.ts +121 -121
- package/dist/js/imports/util/settings.d.ts +38 -38
- package/dist/js/imports/util/text.d.ts +45 -45
- package/dist/js/imports/util/window.d.ts +11 -11
- package/dist/js/index.d.ts +9 -9
- package/dist/js/index.js +362 -362
- package/dist/js/index.js.map +1 -1
- package/dist/js/index.min.js.map +1 -1
- package/package.json +4 -4
- package/src/scss/imports/global/_icons.scss +6 -6
package/dist/js/index.js
CHANGED
|
@@ -24,29 +24,29 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
24
24
|
value: true
|
|
25
25
|
}));
|
|
26
26
|
exports.MintHeader = void 0;
|
|
27
|
-
/**
|
|
28
|
-
* Imports
|
|
27
|
+
/**
|
|
28
|
+
* Imports
|
|
29
29
|
*/
|
|
30
30
|
const enums_1 = __webpack_require__(/*! ../enums */ "./src/ts/imports/enums/index.ts");
|
|
31
31
|
const util_1 = __webpack_require__(/*! ../util */ "./src/ts/imports/util/index.ts");
|
|
32
|
-
/**
|
|
33
|
-
* Main header functionality
|
|
34
|
-
* @public
|
|
32
|
+
/**
|
|
33
|
+
* Main header functionality
|
|
34
|
+
* @public
|
|
35
35
|
*/
|
|
36
36
|
class MintHeader {
|
|
37
|
-
/**
|
|
38
|
-
* Initializes and closes the menu
|
|
37
|
+
/**
|
|
38
|
+
* Initializes and closes the menu
|
|
39
39
|
*/
|
|
40
40
|
constructor(settings) {
|
|
41
|
-
/**
|
|
42
|
-
* Navbar settings
|
|
41
|
+
/**
|
|
42
|
+
* Navbar settings
|
|
43
43
|
*/
|
|
44
44
|
this.settings = {
|
|
45
45
|
from: enums_1.EMintSide.Top,
|
|
46
46
|
fixed: true
|
|
47
47
|
};
|
|
48
|
-
/**
|
|
49
|
-
* Frequently-referenced elements
|
|
48
|
+
/**
|
|
49
|
+
* Frequently-referenced elements
|
|
50
50
|
*/
|
|
51
51
|
this.el = {};
|
|
52
52
|
this.settings = Object.assign(Object.assign({}, this.settings), settings);
|
|
@@ -54,8 +54,8 @@ class MintHeader {
|
|
|
54
54
|
this.attachEvents();
|
|
55
55
|
this.addClasses();
|
|
56
56
|
}
|
|
57
|
-
/**
|
|
58
|
-
* Adds elements to {@link el | `this.el`}
|
|
57
|
+
/**
|
|
58
|
+
* Adds elements to {@link el | `this.el`}
|
|
59
59
|
*/
|
|
60
60
|
attachElements() {
|
|
61
61
|
var _a;
|
|
@@ -65,8 +65,8 @@ class MintHeader {
|
|
|
65
65
|
this.el.mobileButton = ((_a = this.el.header) === null || _a === void 0 ? void 0 : _a.querySelector(util_1.MintSelectors.controls('mint-wrapper'))) || null;
|
|
66
66
|
this.el.wrapper = document.getElementById('mint-wrapper');
|
|
67
67
|
}
|
|
68
|
-
/**
|
|
69
|
-
* Adds events to the dom
|
|
68
|
+
/**
|
|
69
|
+
* Adds events to the dom
|
|
70
70
|
*/
|
|
71
71
|
attachEvents() {
|
|
72
72
|
var _a, _b, _c, _d;
|
|
@@ -91,8 +91,8 @@ class MintHeader {
|
|
|
91
91
|
}));
|
|
92
92
|
(_d = this.el.wrapper) === null || _d === void 0 ? void 0 : _d.addEventListener('transitionend', this.eTransitionEnd.bind(this));
|
|
93
93
|
}
|
|
94
|
-
/**
|
|
95
|
-
* Adds classes that inform the styles based on settings
|
|
94
|
+
/**
|
|
95
|
+
* Adds classes that inform the styles based on settings
|
|
96
96
|
*/
|
|
97
97
|
addClasses() {
|
|
98
98
|
var _a, _b, _c, _d, _e;
|
|
@@ -105,9 +105,9 @@ class MintHeader {
|
|
|
105
105
|
(_e = this.el.header) === null || _e === void 0 ? void 0 : _e.classList.add('mint-tray');
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
/**
|
|
109
|
-
* Sets the state of the mobile menu
|
|
110
|
-
* @param open - `true` to open the menu or `false` to close it
|
|
108
|
+
/**
|
|
109
|
+
* Sets the state of the mobile menu
|
|
110
|
+
* @param open - `true` to open the menu or `false` to close it
|
|
111
111
|
*/
|
|
112
112
|
setMobileMenu() {
|
|
113
113
|
let open = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
@@ -159,17 +159,17 @@ class MintHeader {
|
|
|
159
159
|
this.closeAllMenus();
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
|
-
/**
|
|
163
|
-
* Toggles the state of the mobile menu
|
|
162
|
+
/**
|
|
163
|
+
* Toggles the state of the mobile menu
|
|
164
164
|
*/
|
|
165
165
|
toggleMobileMenu() {
|
|
166
166
|
var _a, _b;
|
|
167
167
|
this.setMobileMenu(((_b = (_a = this.el.mobileButton) === null || _a === void 0 ? void 0 : _a.getAttribute('aria-expanded')) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'false');
|
|
168
168
|
}
|
|
169
|
-
/**
|
|
170
|
-
* Sets the state of the provided button's menu
|
|
171
|
-
* @param button - Button element to set
|
|
172
|
-
* @param open - `true` to open the menu or `false` to close it
|
|
169
|
+
/**
|
|
170
|
+
* Sets the state of the provided button's menu
|
|
171
|
+
* @param button - Button element to set
|
|
172
|
+
* @param open - `true` to open the menu or `false` to close it
|
|
173
173
|
*/
|
|
174
174
|
setMenu(button) {
|
|
175
175
|
let open = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
@@ -185,17 +185,17 @@ class MintHeader {
|
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
/**
|
|
189
|
-
* Toggles the state of the provided button's menu
|
|
190
|
-
* @param button - Button element to toggle
|
|
188
|
+
/**
|
|
189
|
+
* Toggles the state of the provided button's menu
|
|
190
|
+
* @param button - Button element to toggle
|
|
191
191
|
*/
|
|
192
192
|
toggleMenu(button) {
|
|
193
193
|
var _a;
|
|
194
194
|
this.setMenu(button, ((_a = button === null || button === void 0 ? void 0 : button.getAttribute('aria-expanded')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== 'true');
|
|
195
195
|
}
|
|
196
|
-
/**
|
|
197
|
-
* Closes all submenus of the provided button's menu
|
|
198
|
-
* @param button - Button element of the parent menu
|
|
196
|
+
/**
|
|
197
|
+
* Closes all submenus of the provided button's menu
|
|
198
|
+
* @param button - Button element of the parent menu
|
|
199
199
|
*/
|
|
200
200
|
closeSubMenus(button) {
|
|
201
201
|
let menu = button === null || button === void 0 ? void 0 : button.nextElementSibling,
|
|
@@ -208,9 +208,9 @@ class MintHeader {
|
|
|
208
208
|
}
|
|
209
209
|
});
|
|
210
210
|
}
|
|
211
|
-
/**
|
|
212
|
-
* Closes all sibling menus of the provided button's menu
|
|
213
|
-
* @param button - Button element of the sibling menus
|
|
211
|
+
/**
|
|
212
|
+
* Closes all sibling menus of the provided button's menu
|
|
213
|
+
* @param button - Button element of the sibling menus
|
|
214
214
|
*/
|
|
215
215
|
closeSiblingMenus(button) {
|
|
216
216
|
var _a;
|
|
@@ -222,8 +222,8 @@ class MintHeader {
|
|
|
222
222
|
}
|
|
223
223
|
});
|
|
224
224
|
}
|
|
225
|
-
/**
|
|
226
|
-
* Closes all submenus of the n4vbar
|
|
225
|
+
/**
|
|
226
|
+
* Closes all submenus of the n4vbar
|
|
227
227
|
*/
|
|
228
228
|
closeAllMenus() {
|
|
229
229
|
var _a;
|
|
@@ -232,8 +232,8 @@ class MintHeader {
|
|
|
232
232
|
this.setMenu(menuButton);
|
|
233
233
|
});
|
|
234
234
|
}
|
|
235
|
-
/**
|
|
236
|
-
* Opens the menu closest to the document's focus
|
|
235
|
+
/**
|
|
236
|
+
* Opens the menu closest to the document's focus
|
|
237
237
|
*/
|
|
238
238
|
openClosestMenu() {
|
|
239
239
|
var _a;
|
|
@@ -249,8 +249,8 @@ class MintHeader {
|
|
|
249
249
|
firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
|
-
/**
|
|
253
|
-
* Closes the menu closest to the document's focus
|
|
252
|
+
/**
|
|
253
|
+
* Closes the menu closest to the document's focus
|
|
254
254
|
*/
|
|
255
255
|
closeClosestMenu() {
|
|
256
256
|
var _a, _b;
|
|
@@ -265,8 +265,8 @@ class MintHeader {
|
|
|
265
265
|
activeButton === null || activeButton === void 0 ? void 0 : activeButton.focus();
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
|
-
/**
|
|
269
|
-
* Toggles the menu closest to the document's focus
|
|
268
|
+
/**
|
|
269
|
+
* Toggles the menu closest to the document's focus
|
|
270
270
|
*/
|
|
271
271
|
toggleClosestMenu() {
|
|
272
272
|
var _a, _b;
|
|
@@ -276,8 +276,8 @@ class MintHeader {
|
|
|
276
276
|
this.openClosestMenu();
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
|
-
/**
|
|
280
|
-
* Closes the mobile menu when the window resizes
|
|
279
|
+
/**
|
|
280
|
+
* Closes the mobile menu when the window resizes
|
|
281
281
|
*/
|
|
282
282
|
eHandleResize() {
|
|
283
283
|
var _a, _b;
|
|
@@ -297,15 +297,15 @@ class MintHeader {
|
|
|
297
297
|
this.el.html.style.overflow = overflow;
|
|
298
298
|
}
|
|
299
299
|
}
|
|
300
|
-
/**
|
|
301
|
-
* Closes all submenus when the page is scrolled
|
|
300
|
+
/**
|
|
301
|
+
* Closes all submenus when the page is scrolled
|
|
302
302
|
*/
|
|
303
303
|
eHandleScroll() {
|
|
304
304
|
this.closeAllMenus();
|
|
305
305
|
}
|
|
306
|
-
/**
|
|
307
|
-
* Sends the focus to the menu button after tabbing past the last menu item
|
|
308
|
-
* @param e - Keyboard event
|
|
306
|
+
/**
|
|
307
|
+
* Sends the focus to the menu button after tabbing past the last menu item
|
|
308
|
+
* @param e - Keyboard event
|
|
309
309
|
*/
|
|
310
310
|
eWrapTab(e) {
|
|
311
311
|
var _a;
|
|
@@ -316,9 +316,9 @@ class MintHeader {
|
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
|
-
/**
|
|
320
|
-
* Handles keypresses on n4vbar buttons
|
|
321
|
-
* @param e - Keyboard event
|
|
319
|
+
/**
|
|
320
|
+
* Handles keypresses on n4vbar buttons
|
|
321
|
+
* @param e - Keyboard event
|
|
322
322
|
*/
|
|
323
323
|
eHandleButtonKeypress(e) {
|
|
324
324
|
var _a;
|
|
@@ -345,9 +345,9 @@ class MintHeader {
|
|
|
345
345
|
break;
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
|
-
/**
|
|
349
|
-
* Handles keypresses on n4vbar links
|
|
350
|
-
* @param e - Keyboard event
|
|
348
|
+
/**
|
|
349
|
+
* Handles keypresses on n4vbar links
|
|
350
|
+
* @param e - Keyboard event
|
|
351
351
|
*/
|
|
352
352
|
eHandleLinkKeypress(e) {
|
|
353
353
|
let target = e.target;
|
|
@@ -365,9 +365,9 @@ class MintHeader {
|
|
|
365
365
|
break;
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
|
-
/**
|
|
369
|
-
* Handles keypresses on the n4vbar
|
|
370
|
-
* @param e - Keyboard event
|
|
368
|
+
/**
|
|
369
|
+
* Handles keypresses on the n4vbar
|
|
370
|
+
* @param e - Keyboard event
|
|
371
371
|
*/
|
|
372
372
|
eHandleKeypress(e) {
|
|
373
373
|
if (e.key.toLowerCase() !== 'tab') {
|
|
@@ -383,23 +383,23 @@ class MintHeader {
|
|
|
383
383
|
break;
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
|
-
/**
|
|
387
|
-
* Toggles the mobile menu
|
|
386
|
+
/**
|
|
387
|
+
* Toggles the mobile menu
|
|
388
388
|
*/
|
|
389
389
|
eToggleMobileMenu() {
|
|
390
390
|
this.toggleMobileMenu();
|
|
391
391
|
}
|
|
392
|
-
/**
|
|
393
|
-
* Toggles the clicked submenu
|
|
394
|
-
* @param e - Mouse event
|
|
392
|
+
/**
|
|
393
|
+
* Toggles the clicked submenu
|
|
394
|
+
* @param e - Mouse event
|
|
395
395
|
*/
|
|
396
396
|
eToggleMenu(e) {
|
|
397
397
|
let target = e.target;
|
|
398
398
|
this.closeSiblingMenus(target);
|
|
399
399
|
this.toggleMenu(target);
|
|
400
400
|
}
|
|
401
|
-
/**
|
|
402
|
-
* Runs after the mobile menu transitions
|
|
401
|
+
/**
|
|
402
|
+
* Runs after the mobile menu transitions
|
|
403
403
|
*/
|
|
404
404
|
eTransitionEnd() {
|
|
405
405
|
var _a;
|
|
@@ -444,8 +444,8 @@ var __exportStar = this && this.__exportStar || function (m, exports) {
|
|
|
444
444
|
Object.defineProperty(exports, "__esModule", ({
|
|
445
445
|
value: true
|
|
446
446
|
}));
|
|
447
|
-
/**
|
|
448
|
-
* Forward all exports from the components directory
|
|
447
|
+
/**
|
|
448
|
+
* Forward all exports from the components directory
|
|
449
449
|
*/
|
|
450
450
|
__exportStar(__webpack_require__(/*! ./header */ "./src/ts/imports/components/header.ts"), exports);
|
|
451
451
|
|
|
@@ -481,8 +481,8 @@ var __exportStar = this && this.__exportStar || function (m, exports) {
|
|
|
481
481
|
Object.defineProperty(exports, "__esModule", ({
|
|
482
482
|
value: true
|
|
483
483
|
}));
|
|
484
|
-
/**
|
|
485
|
-
* Forward all exports from the enums directory
|
|
484
|
+
/**
|
|
485
|
+
* Forward all exports from the enums directory
|
|
486
486
|
*/
|
|
487
487
|
__exportStar(__webpack_require__(/*! ./side */ "./src/ts/imports/enums/side.ts"), exports);
|
|
488
488
|
|
|
@@ -500,8 +500,8 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
500
500
|
value: true
|
|
501
501
|
}));
|
|
502
502
|
exports.EMintSide = void 0;
|
|
503
|
-
/**
|
|
504
|
-
* Side Enum
|
|
503
|
+
/**
|
|
504
|
+
* Side Enum
|
|
505
505
|
*/
|
|
506
506
|
var EMintSide;
|
|
507
507
|
(function (EMintSide) {
|
|
@@ -544,8 +544,8 @@ var __exportStar = this && this.__exportStar || function (m, exports) {
|
|
|
544
544
|
Object.defineProperty(exports, "__esModule", ({
|
|
545
545
|
value: true
|
|
546
546
|
}));
|
|
547
|
-
/**
|
|
548
|
-
* Forward all exports from the imports directory
|
|
547
|
+
/**
|
|
548
|
+
* Forward all exports from the imports directory
|
|
549
549
|
*/
|
|
550
550
|
__exportStar(__webpack_require__(/*! ./components */ "./src/ts/imports/components/index.ts"), exports);
|
|
551
551
|
__exportStar(__webpack_require__(/*! ./enums */ "./src/ts/imports/enums/index.ts"), exports);
|
|
@@ -566,8 +566,8 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
566
566
|
value: true
|
|
567
567
|
}));
|
|
568
568
|
exports.mintColor = void 0;
|
|
569
|
-
/**
|
|
570
|
-
* Color
|
|
569
|
+
/**
|
|
570
|
+
* Color
|
|
571
571
|
*/
|
|
572
572
|
class mintColor {
|
|
573
573
|
constructor(args) {
|
|
@@ -579,8 +579,8 @@ class mintColor {
|
|
|
579
579
|
this.stringConstructor(args.color);
|
|
580
580
|
}
|
|
581
581
|
}
|
|
582
|
-
/**
|
|
583
|
-
* Constructor from a string argument
|
|
582
|
+
/**
|
|
583
|
+
* Constructor from a string argument
|
|
584
584
|
*/
|
|
585
585
|
stringConstructor(str) {
|
|
586
586
|
if (str.startsWith('#')) {
|
|
@@ -592,8 +592,8 @@ class mintColor {
|
|
|
592
592
|
this.rgbConstructor(str);
|
|
593
593
|
}
|
|
594
594
|
}
|
|
595
|
-
/**
|
|
596
|
-
* Constructor from a hex argument
|
|
595
|
+
/**
|
|
596
|
+
* Constructor from a hex argument
|
|
597
597
|
*/
|
|
598
598
|
hexConstructor(hex) {
|
|
599
599
|
switch (hex.length) {
|
|
@@ -624,8 +624,8 @@ class mintColor {
|
|
|
624
624
|
this.b = parseInt(hex.substring(5, 7), mintColor.hexBase);
|
|
625
625
|
this.a = parseInt(hex.substring(7, 9), mintColor.hexBase) / mintColor.hexBase ** 2;
|
|
626
626
|
}
|
|
627
|
-
/**
|
|
628
|
-
* Constructor from an rgba argument
|
|
627
|
+
/**
|
|
628
|
+
* Constructor from an rgba argument
|
|
629
629
|
*/
|
|
630
630
|
rgbConstructor(rgb) {
|
|
631
631
|
let match = rgb.match(/rgba?\((\d{1,3}), ?(\d{1,3}), ?(\d{1,3})\)?(?:, ?(\d(?:\.\d*)?)\))?/);
|
|
@@ -636,8 +636,8 @@ class mintColor {
|
|
|
636
636
|
this.a = parseFloat(match[4]);
|
|
637
637
|
}
|
|
638
638
|
}
|
|
639
|
-
/**
|
|
640
|
-
* Returns the perceived brightness of the color
|
|
639
|
+
/**
|
|
640
|
+
* Returns the perceived brightness of the color
|
|
641
641
|
*/
|
|
642
642
|
getBrightness() {
|
|
643
643
|
if (this.a === 0) {
|
|
@@ -700,8 +700,8 @@ var __exportStar = this && this.__exportStar || function (m, exports) {
|
|
|
700
700
|
Object.defineProperty(exports, "__esModule", ({
|
|
701
701
|
value: true
|
|
702
702
|
}));
|
|
703
|
-
/**
|
|
704
|
-
* Forward all exports from the models directory
|
|
703
|
+
/**
|
|
704
|
+
* Forward all exports from the models directory
|
|
705
705
|
*/
|
|
706
706
|
__exportStar(__webpack_require__(/*! ./color */ "./src/ts/imports/models/color.ts"), exports);
|
|
707
707
|
__exportStar(__webpack_require__(/*! ./file */ "./src/ts/imports/models/file.ts"), exports);
|
|
@@ -724,15 +724,15 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
724
724
|
value: true
|
|
725
725
|
}));
|
|
726
726
|
exports.MintItem = void 0;
|
|
727
|
-
/**
|
|
728
|
-
* A generic item
|
|
729
|
-
* @note - this class must be convertable with JSON
|
|
730
|
-
* - only add strings, numbers, booleans, arrays, and objects
|
|
727
|
+
/**
|
|
728
|
+
* A generic item
|
|
729
|
+
* @note - this class must be convertable with JSON
|
|
730
|
+
* - only add strings, numbers, booleans, arrays, and objects
|
|
731
731
|
*/
|
|
732
732
|
class MintItem {
|
|
733
733
|
constructor() {
|
|
734
|
-
/**
|
|
735
|
-
* Item settings
|
|
734
|
+
/**
|
|
735
|
+
* Item settings
|
|
736
736
|
*/
|
|
737
737
|
this.version = 0;
|
|
738
738
|
this.priority = 0;
|
|
@@ -746,15 +746,15 @@ class MintItem {
|
|
|
746
746
|
this.centered = false;
|
|
747
747
|
this.disabled = false;
|
|
748
748
|
this.private = false;
|
|
749
|
-
/**
|
|
750
|
-
* Item data
|
|
749
|
+
/**
|
|
750
|
+
* Item data
|
|
751
751
|
*/
|
|
752
752
|
this.attr = {};
|
|
753
753
|
this.params = {};
|
|
754
754
|
this.options = {};
|
|
755
755
|
this.lists = {};
|
|
756
|
-
/**
|
|
757
|
-
* Item lists
|
|
756
|
+
/**
|
|
757
|
+
* Item lists
|
|
758
758
|
*/
|
|
759
759
|
this.paragraphs = [];
|
|
760
760
|
this.classes = [];
|
|
@@ -824,12 +824,12 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
824
824
|
value: true
|
|
825
825
|
}));
|
|
826
826
|
exports.MintAsync = void 0;
|
|
827
|
-
/**
|
|
828
|
-
* Handles asynchronous operations
|
|
827
|
+
/**
|
|
828
|
+
* Handles asynchronous operations
|
|
829
829
|
*/
|
|
830
830
|
class MintAsync {
|
|
831
|
-
/**
|
|
832
|
-
* Wait n milliseconds
|
|
831
|
+
/**
|
|
832
|
+
* Wait n milliseconds
|
|
833
833
|
*/
|
|
834
834
|
static wait(ms) {
|
|
835
835
|
return new Promise(resolve => setTimeout(resolve, ms));
|
|
@@ -853,20 +853,20 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
853
853
|
value: true
|
|
854
854
|
}));
|
|
855
855
|
exports.MintDisplay = void 0;
|
|
856
|
-
/**
|
|
857
|
-
* Imports
|
|
856
|
+
/**
|
|
857
|
+
* Imports
|
|
858
858
|
*/
|
|
859
859
|
const enums_1 = __webpack_require__(/*! ../enums */ "./src/ts/imports/enums/index.ts");
|
|
860
860
|
const settings_1 = __webpack_require__(/*! ./settings */ "./src/ts/imports/util/settings.ts");
|
|
861
|
-
/**
|
|
862
|
-
* Handles the display of elements
|
|
861
|
+
/**
|
|
862
|
+
* Handles the display of elements
|
|
863
863
|
*/
|
|
864
864
|
class MintDisplay {
|
|
865
|
-
/**
|
|
866
|
-
* Sets the element's height to its `innerHeight`, then to `auto` after a delay
|
|
867
|
-
* @param el - the element whose height will be set
|
|
868
|
-
* @param delay - the amount of time in milliseconds that the show animation will be active
|
|
869
|
-
* @param from - the side that the element is animating from
|
|
865
|
+
/**
|
|
866
|
+
* Sets the element's height to its `innerHeight`, then to `auto` after a delay
|
|
867
|
+
* @param el - the element whose height will be set
|
|
868
|
+
* @param delay - the amount of time in milliseconds that the show animation will be active
|
|
869
|
+
* @param from - the side that the element is animating from
|
|
870
870
|
*/
|
|
871
871
|
static show(el) {
|
|
872
872
|
let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.MintSettings.delay.default;
|
|
@@ -889,11 +889,11 @@ class MintDisplay {
|
|
|
889
889
|
});
|
|
890
890
|
}
|
|
891
891
|
}
|
|
892
|
-
/**
|
|
893
|
-
* Sets the element's height to 0
|
|
894
|
-
* @param el - the element whose height will be set
|
|
895
|
-
* @param delay - the amount of time in milliseconds that the show animation will be active
|
|
896
|
-
* @param from - the side that the element is animating from
|
|
892
|
+
/**
|
|
893
|
+
* Sets the element's height to 0
|
|
894
|
+
* @param el - the element whose height will be set
|
|
895
|
+
* @param delay - the amount of time in milliseconds that the show animation will be active
|
|
896
|
+
* @param from - the side that the element is animating from
|
|
897
897
|
*/
|
|
898
898
|
static hide(el) {
|
|
899
899
|
let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.MintSettings.delay.default;
|
|
@@ -948,15 +948,15 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
948
948
|
}));
|
|
949
949
|
exports.MintEvent = void 0;
|
|
950
950
|
const settings_1 = __importDefault(__webpack_require__(/*! ./settings */ "./src/ts/imports/util/settings.ts"));
|
|
951
|
-
/**
|
|
952
|
-
* Event helper functions
|
|
951
|
+
/**
|
|
952
|
+
* Event helper functions
|
|
953
953
|
*/
|
|
954
954
|
class MintEvent {
|
|
955
|
-
/**
|
|
956
|
-
* Ensures that a function `func` is run only after not being called for `wait` milliseconds
|
|
957
|
-
* @param func - the function to debounce
|
|
958
|
-
* @param wait - the amount of time to wait before running the function
|
|
959
|
-
* @returns - the debounced function
|
|
955
|
+
/**
|
|
956
|
+
* Ensures that a function `func` is run only after not being called for `wait` milliseconds
|
|
957
|
+
* @param func - the function to debounce
|
|
958
|
+
* @param wait - the amount of time to wait before running the function
|
|
959
|
+
* @returns - the debounced function
|
|
960
960
|
*/
|
|
961
961
|
static debounce(func) {
|
|
962
962
|
let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
|
|
@@ -968,22 +968,22 @@ class MintEvent {
|
|
|
968
968
|
timer = setTimeout(func, wait, e);
|
|
969
969
|
};
|
|
970
970
|
}
|
|
971
|
-
/**
|
|
972
|
-
* Ensures that a function `func` is run only after not being called for `wait` milliseconds
|
|
973
|
-
* @param func - the function to debounce
|
|
974
|
-
* @param wait - the amount of time to wait before running the function
|
|
975
|
-
* @returns - the debounced function as an EventListener
|
|
971
|
+
/**
|
|
972
|
+
* Ensures that a function `func` is run only after not being called for `wait` milliseconds
|
|
973
|
+
* @param func - the function to debounce
|
|
974
|
+
* @param wait - the amount of time to wait before running the function
|
|
975
|
+
* @returns - the debounced function as an EventListener
|
|
976
976
|
*/
|
|
977
977
|
static debounceEvent(func) {
|
|
978
978
|
let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
|
|
979
979
|
return MintEvent.debounce(func, wait);
|
|
980
980
|
}
|
|
981
|
-
/**
|
|
982
|
-
* Ensures that a function `func` is called at most every `wait` milliseconds with optional leading and trailing calls
|
|
983
|
-
* @param func - the function to throttle
|
|
984
|
-
* @param wait - the amount of time between function calls
|
|
985
|
-
* @param options - leading and trailing options: default = \{ leading: true, trailing, true \}
|
|
986
|
-
* @returns - the throttled function
|
|
981
|
+
/**
|
|
982
|
+
* Ensures that a function `func` is called at most every `wait` milliseconds with optional leading and trailing calls
|
|
983
|
+
* @param func - the function to throttle
|
|
984
|
+
* @param wait - the amount of time between function calls
|
|
985
|
+
* @param options - leading and trailing options: default = \{ leading: true, trailing, true \}
|
|
986
|
+
* @returns - the throttled function
|
|
987
987
|
*/
|
|
988
988
|
static throttle(func) {
|
|
989
989
|
let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
|
|
@@ -1026,12 +1026,12 @@ class MintEvent {
|
|
|
1026
1026
|
};
|
|
1027
1027
|
return throttled;
|
|
1028
1028
|
}
|
|
1029
|
-
/**
|
|
1030
|
-
* Ensures that a function `func` is called at most every `wait` milliseconds with optional leading and trailing calls
|
|
1031
|
-
* @param func - the function to throttle
|
|
1032
|
-
* @param wait - the amount of time between function calls
|
|
1033
|
-
* @param options - leading and trailing options: default = \{ leading: true, trailing, true \}
|
|
1034
|
-
* @returns - the throttled function as an EventListener
|
|
1029
|
+
/**
|
|
1030
|
+
* Ensures that a function `func` is called at most every `wait` milliseconds with optional leading and trailing calls
|
|
1031
|
+
* @param func - the function to throttle
|
|
1032
|
+
* @param wait - the amount of time between function calls
|
|
1033
|
+
* @param options - leading and trailing options: default = \{ leading: true, trailing, true \}
|
|
1034
|
+
* @returns - the throttled function as an EventListener
|
|
1035
1035
|
*/
|
|
1036
1036
|
static throttleEvent(func) {
|
|
1037
1037
|
let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
|
|
@@ -1062,16 +1062,16 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
1062
1062
|
value: true
|
|
1063
1063
|
}));
|
|
1064
1064
|
exports.MintIcon = void 0;
|
|
1065
|
-
/**
|
|
1066
|
-
* Imports
|
|
1065
|
+
/**
|
|
1066
|
+
* Imports
|
|
1067
1067
|
*/
|
|
1068
1068
|
const object_1 = __importDefault(__webpack_require__(/*! ./object */ "./src/ts/imports/util/object.ts"));
|
|
1069
|
-
/**
|
|
1070
|
-
* Icon helper functions
|
|
1069
|
+
/**
|
|
1070
|
+
* Icon helper functions
|
|
1071
1071
|
*/
|
|
1072
1072
|
class MintIcon {
|
|
1073
|
-
/**
|
|
1074
|
-
* Appends the given icon to the given selector if there is not already an icon appended
|
|
1073
|
+
/**
|
|
1074
|
+
* Appends the given icon to the given selector if there is not already an icon appended
|
|
1075
1075
|
*/
|
|
1076
1076
|
static append(icon, selector) {
|
|
1077
1077
|
let items = document.querySelectorAll(selector);
|
|
@@ -1086,9 +1086,9 @@ class MintIcon {
|
|
|
1086
1086
|
}
|
|
1087
1087
|
});
|
|
1088
1088
|
}
|
|
1089
|
-
/**
|
|
1090
|
-
* Updates the icons
|
|
1091
|
-
* @param icons - the icons to update
|
|
1089
|
+
/**
|
|
1090
|
+
* Updates the icons
|
|
1091
|
+
* @param icons - the icons to update
|
|
1092
1092
|
*/
|
|
1093
1093
|
static update(icons) {
|
|
1094
1094
|
let activeIcons = object_1.default.removeValues(Object.assign(Object.assign({}, this.icons), icons), [false]);
|
|
@@ -1096,9 +1096,9 @@ class MintIcon {
|
|
|
1096
1096
|
this.append(activeIcons[selector], selector);
|
|
1097
1097
|
});
|
|
1098
1098
|
}
|
|
1099
|
-
/**
|
|
1100
|
-
* Removes the given icon from the given selector
|
|
1101
|
-
* @param icon - the icon to remove
|
|
1099
|
+
/**
|
|
1100
|
+
* Removes the given icon from the given selector
|
|
1101
|
+
* @param icon - the icon to remove
|
|
1102
1102
|
*/
|
|
1103
1103
|
static remove(icon, selector) {
|
|
1104
1104
|
let items = document.querySelectorAll(selector);
|
|
@@ -1111,8 +1111,8 @@ class MintIcon {
|
|
|
1111
1111
|
}
|
|
1112
1112
|
}
|
|
1113
1113
|
exports.MintIcon = MintIcon;
|
|
1114
|
-
/**
|
|
1115
|
-
* Default icons
|
|
1114
|
+
/**
|
|
1115
|
+
* Default icons
|
|
1116
1116
|
*/
|
|
1117
1117
|
MintIcon.icons = {
|
|
1118
1118
|
'a[href^="mailto:"]': 'far fa-envelope',
|
|
@@ -1156,8 +1156,8 @@ var __exportStar = this && this.__exportStar || function (m, exports) {
|
|
|
1156
1156
|
Object.defineProperty(exports, "__esModule", ({
|
|
1157
1157
|
value: true
|
|
1158
1158
|
}));
|
|
1159
|
-
/**
|
|
1160
|
-
* Forward all exports from the util directory
|
|
1159
|
+
/**
|
|
1160
|
+
* Forward all exports from the util directory
|
|
1161
1161
|
*/
|
|
1162
1162
|
__exportStar(__webpack_require__(/*! ./async */ "./src/ts/imports/util/async.ts"), exports);
|
|
1163
1163
|
__exportStar(__webpack_require__(/*! ./display */ "./src/ts/imports/util/display.ts"), exports);
|
|
@@ -1186,14 +1186,14 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
1186
1186
|
value: true
|
|
1187
1187
|
}));
|
|
1188
1188
|
exports.MintList = void 0;
|
|
1189
|
-
/**
|
|
1190
|
-
* List functions for the util library
|
|
1189
|
+
/**
|
|
1190
|
+
* List functions for the util library
|
|
1191
1191
|
*/
|
|
1192
1192
|
class MintList {
|
|
1193
|
-
/**
|
|
1194
|
-
* Returns a copy of the provided list with the items in random order
|
|
1195
|
-
* @param list - the list to shuffle
|
|
1196
|
-
* @returns - the shuffled list
|
|
1193
|
+
/**
|
|
1194
|
+
* Returns a copy of the provided list with the items in random order
|
|
1195
|
+
* @param list - the list to shuffle
|
|
1196
|
+
* @returns - the shuffled list
|
|
1197
1197
|
*/
|
|
1198
1198
|
static shuffleCopy(list) {
|
|
1199
1199
|
let copy = [...list];
|
|
@@ -1203,14 +1203,14 @@ class MintList {
|
|
|
1203
1203
|
}
|
|
1204
1204
|
return copy;
|
|
1205
1205
|
}
|
|
1206
|
-
/**
|
|
1207
|
-
* Filters the array in place based on a test condition and returns the filtered array.
|
|
1208
|
-
* This method modifies the original array by removing elements that do not pass the test implemented by the provided function.
|
|
1209
|
-
*
|
|
1210
|
-
* @template T The type of elements in the array.
|
|
1211
|
-
* @param {T[]} list The array to filter, which will be modified in place.
|
|
1212
|
-
* @param {(item: T) => boolean} test A function that tests each element of the array. Return `true` to keep the element, `false` otherwise.
|
|
1213
|
-
* @returns {T[]} The original array with only the elements that passed the test.
|
|
1206
|
+
/**
|
|
1207
|
+
* Filters the array in place based on a test condition and returns the filtered array.
|
|
1208
|
+
* This method modifies the original array by removing elements that do not pass the test implemented by the provided function.
|
|
1209
|
+
*
|
|
1210
|
+
* @template T The type of elements in the array.
|
|
1211
|
+
* @param {T[]} list The array to filter, which will be modified in place.
|
|
1212
|
+
* @param {(item: T) => boolean} test A function that tests each element of the array. Return `true` to keep the element, `false` otherwise.
|
|
1213
|
+
* @returns {T[]} The original array with only the elements that passed the test.
|
|
1214
1214
|
*/
|
|
1215
1215
|
static filter(list, test) {
|
|
1216
1216
|
let newLength = 0;
|
|
@@ -1241,15 +1241,15 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
1241
1241
|
value: true
|
|
1242
1242
|
}));
|
|
1243
1243
|
exports.MintMath = void 0;
|
|
1244
|
-
/**
|
|
1245
|
-
* Math functions for the util library
|
|
1244
|
+
/**
|
|
1245
|
+
* Math functions for the util library
|
|
1246
1246
|
*/
|
|
1247
1247
|
class MintMath {
|
|
1248
|
-
/**
|
|
1249
|
-
* Get a random integer between min and max
|
|
1250
|
-
* @param max Maximum value to return
|
|
1251
|
-
* @param min Minimum value to return (default is 0)
|
|
1252
|
-
* @returns a random integer between min and max
|
|
1248
|
+
/**
|
|
1249
|
+
* Get a random integer between min and max
|
|
1250
|
+
* @param max Maximum value to return
|
|
1251
|
+
* @param min Minimum value to return (default is 0)
|
|
1252
|
+
* @returns a random integer between min and max
|
|
1253
1253
|
*/
|
|
1254
1254
|
static randomInt(max) {
|
|
1255
1255
|
let min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
@@ -1276,12 +1276,12 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
1276
1276
|
value: true
|
|
1277
1277
|
}));
|
|
1278
1278
|
exports.MintObject = void 0;
|
|
1279
|
-
/**
|
|
1280
|
-
* Object functions for the util library
|
|
1279
|
+
/**
|
|
1280
|
+
* Object functions for the util library
|
|
1281
1281
|
*/
|
|
1282
1282
|
class MintObject {
|
|
1283
|
-
/**
|
|
1284
|
-
* Returns true if the provided objects have the same entries
|
|
1283
|
+
/**
|
|
1284
|
+
* Returns true if the provided objects have the same entries
|
|
1285
1285
|
*/
|
|
1286
1286
|
static isSimilar(obj1, obj2) {
|
|
1287
1287
|
let keys = Object.keys(obj1);
|
|
@@ -1296,13 +1296,13 @@ class MintObject {
|
|
|
1296
1296
|
});
|
|
1297
1297
|
return isSimilar;
|
|
1298
1298
|
}
|
|
1299
|
-
/**
|
|
1300
|
-
* Returns true if the first object has at least the same
|
|
1301
|
-
* entries as the second object
|
|
1302
|
-
* @param superset - the object to check
|
|
1303
|
-
* @param subset - the object whose entries are required
|
|
1304
|
-
* @returns - true if the first object is a superset of the second
|
|
1305
|
-
* @recursive
|
|
1299
|
+
/**
|
|
1300
|
+
* Returns true if the first object has at least the same
|
|
1301
|
+
* entries as the second object
|
|
1302
|
+
* @param superset - the object to check
|
|
1303
|
+
* @param subset - the object whose entries are required
|
|
1304
|
+
* @returns - true if the first object is a superset of the second
|
|
1305
|
+
* @recursive
|
|
1306
1306
|
*/
|
|
1307
1307
|
static isSuperset(superset, subset) {
|
|
1308
1308
|
let isSuperset = true;
|
|
@@ -1330,19 +1330,19 @@ class MintObject {
|
|
|
1330
1330
|
});
|
|
1331
1331
|
return isSuperset;
|
|
1332
1332
|
}
|
|
1333
|
-
/**
|
|
1334
|
-
* Removes object entries by key
|
|
1335
|
-
* @alias mintObject.removeKeys
|
|
1336
|
-
* @param object - the object to remove entries from
|
|
1337
|
-
* @param keys - the keys to remove
|
|
1333
|
+
/**
|
|
1334
|
+
* Removes object entries by key
|
|
1335
|
+
* @alias mintObject.removeKeys
|
|
1336
|
+
* @param object - the object to remove entries from
|
|
1337
|
+
* @param keys - the keys to remove
|
|
1338
1338
|
*/
|
|
1339
1339
|
static remove(object, keys) {
|
|
1340
1340
|
return this.removeKeys(object, keys);
|
|
1341
1341
|
}
|
|
1342
|
-
/**
|
|
1343
|
-
* Removes object entries by key
|
|
1344
|
-
* @param object - the object to remove entries from
|
|
1345
|
-
* @param keys - the keys to remove
|
|
1342
|
+
/**
|
|
1343
|
+
* Removes object entries by key
|
|
1344
|
+
* @param object - the object to remove entries from
|
|
1345
|
+
* @param keys - the keys to remove
|
|
1346
1346
|
*/
|
|
1347
1347
|
static removeKeys(object, keys) {
|
|
1348
1348
|
return Object.keys(object).reduce((obj, key) => {
|
|
@@ -1352,8 +1352,8 @@ class MintObject {
|
|
|
1352
1352
|
return obj;
|
|
1353
1353
|
}, {});
|
|
1354
1354
|
}
|
|
1355
|
-
/**
|
|
1356
|
-
* Removes object entries by value
|
|
1355
|
+
/**
|
|
1356
|
+
* Removes object entries by value
|
|
1357
1357
|
*/
|
|
1358
1358
|
static removeValues(object, values) {
|
|
1359
1359
|
return Object.keys(object).reduce((obj, key) => {
|
|
@@ -1363,14 +1363,14 @@ class MintObject {
|
|
|
1363
1363
|
return obj;
|
|
1364
1364
|
}, {});
|
|
1365
1365
|
}
|
|
1366
|
-
/**
|
|
1367
|
-
* Sorts an object's entries alphabetically by key
|
|
1366
|
+
/**
|
|
1367
|
+
* Sorts an object's entries alphabetically by key
|
|
1368
1368
|
*/
|
|
1369
1369
|
static sort(object, compareFn) {
|
|
1370
1370
|
return this.sortKeys(object, compareFn);
|
|
1371
1371
|
}
|
|
1372
|
-
/**
|
|
1373
|
-
* Sorts an object's entries alphabetically by key
|
|
1372
|
+
/**
|
|
1373
|
+
* Sorts an object's entries alphabetically by key
|
|
1374
1374
|
*/
|
|
1375
1375
|
static sortKeys(object, compareFn) {
|
|
1376
1376
|
return Object.keys(object).sort(compareFn).reduce((obj, key) => {
|
|
@@ -1378,8 +1378,8 @@ class MintObject {
|
|
|
1378
1378
|
return obj;
|
|
1379
1379
|
}, {});
|
|
1380
1380
|
}
|
|
1381
|
-
/**
|
|
1382
|
-
* Sorts an object's entries alphabetically by value
|
|
1381
|
+
/**
|
|
1382
|
+
* Sorts an object's entries alphabetically by value
|
|
1383
1383
|
*/
|
|
1384
1384
|
static sortValues(object, compareFn) {
|
|
1385
1385
|
return Object.keys(object).sort((a, b) => compareFn(object[a], object[b])).reduce((obj, key) => {
|
|
@@ -1387,17 +1387,17 @@ class MintObject {
|
|
|
1387
1387
|
return obj;
|
|
1388
1388
|
}, {});
|
|
1389
1389
|
}
|
|
1390
|
-
/**
|
|
1391
|
-
* @alias mintObject.filterKeys
|
|
1390
|
+
/**
|
|
1391
|
+
* @alias mintObject.filterKeys
|
|
1392
1392
|
*/
|
|
1393
1393
|
static filter(object, keys) {
|
|
1394
1394
|
return this.filterKeys(object, keys);
|
|
1395
1395
|
}
|
|
1396
|
-
/**
|
|
1397
|
-
* Filters an object by its keys
|
|
1398
|
-
* @param object - the object to filter
|
|
1399
|
-
* @param keys - the keys to keep
|
|
1400
|
-
* @returns - the filtered object
|
|
1396
|
+
/**
|
|
1397
|
+
* Filters an object by its keys
|
|
1398
|
+
* @param object - the object to filter
|
|
1399
|
+
* @param keys - the keys to keep
|
|
1400
|
+
* @returns - the filtered object
|
|
1401
1401
|
*/
|
|
1402
1402
|
static filterKeys(object, keys) {
|
|
1403
1403
|
return keys.reduce((obj, key) => {
|
|
@@ -1405,11 +1405,11 @@ class MintObject {
|
|
|
1405
1405
|
return obj;
|
|
1406
1406
|
}, {});
|
|
1407
1407
|
}
|
|
1408
|
-
/**
|
|
1409
|
-
* Filters an object by its values
|
|
1410
|
-
* @param object - the object to filter
|
|
1411
|
-
* @param values - the values to keep
|
|
1412
|
-
* @returns - the filtered object
|
|
1408
|
+
/**
|
|
1409
|
+
* Filters an object by its values
|
|
1410
|
+
* @param object - the object to filter
|
|
1411
|
+
* @param values - the values to keep
|
|
1412
|
+
* @returns - the filtered object
|
|
1413
1413
|
*/
|
|
1414
1414
|
static filterValues(object, values) {
|
|
1415
1415
|
return Object.keys(object).reduce((obj, key) => {
|
|
@@ -1419,11 +1419,11 @@ class MintObject {
|
|
|
1419
1419
|
return obj;
|
|
1420
1420
|
}, {});
|
|
1421
1421
|
}
|
|
1422
|
-
/**
|
|
1423
|
-
* Update two sets of objects
|
|
1424
|
-
* @param original - the original object
|
|
1425
|
-
* @param update - the object to update the original with
|
|
1426
|
-
* @returns - the original objects with updated data from the update
|
|
1422
|
+
/**
|
|
1423
|
+
* Update two sets of objects
|
|
1424
|
+
* @param original - the original object
|
|
1425
|
+
* @param update - the object to update the original with
|
|
1426
|
+
* @returns - the original objects with updated data from the update
|
|
1427
1427
|
*/
|
|
1428
1428
|
static updateArray(original, update) {
|
|
1429
1429
|
let key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'id';
|
|
@@ -1462,15 +1462,15 @@ class MintObject {
|
|
|
1462
1462
|
const newObjects = update === null || update === void 0 ? void 0 : update.filter(object => !original.some(existingObject => (existingObject === null || existingObject === void 0 ? void 0 : existingObject[key]) === (object === null || object === void 0 ? void 0 : object[key])));
|
|
1463
1463
|
newObjects === null || newObjects === void 0 ? void 0 : newObjects.forEach(newObject => original.push(newObject));
|
|
1464
1464
|
}
|
|
1465
|
-
/**
|
|
1466
|
-
* Get an object's key by value
|
|
1465
|
+
/**
|
|
1466
|
+
* Get an object's key by value
|
|
1467
1467
|
*/
|
|
1468
1468
|
static getKeyByValue(object, value) {
|
|
1469
1469
|
return Object.keys(object).find(key => object[key] === value);
|
|
1470
1470
|
}
|
|
1471
|
-
/**
|
|
1472
|
-
* Create a deep copy of an object
|
|
1473
|
-
* @recursive
|
|
1471
|
+
/**
|
|
1472
|
+
* Create a deep copy of an object
|
|
1473
|
+
* @recursive
|
|
1474
1474
|
*/
|
|
1475
1475
|
static deepClone(object) {
|
|
1476
1476
|
// Clone every property
|
|
@@ -1513,28 +1513,28 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
1513
1513
|
value: true
|
|
1514
1514
|
}));
|
|
1515
1515
|
exports.MintScroll = void 0;
|
|
1516
|
-
/**
|
|
1517
|
-
* Imports
|
|
1516
|
+
/**
|
|
1517
|
+
* Imports
|
|
1518
1518
|
*/
|
|
1519
1519
|
const event_1 = __importDefault(__webpack_require__(/*! ./event */ "./src/ts/imports/util/event.ts"));
|
|
1520
|
-
/**
|
|
1521
|
-
* Scroll functions
|
|
1520
|
+
/**
|
|
1521
|
+
* Scroll functions
|
|
1522
1522
|
*/
|
|
1523
1523
|
class MintScroll {
|
|
1524
|
-
/**
|
|
1525
|
-
* Scroll to the top of the page
|
|
1524
|
+
/**
|
|
1525
|
+
* Scroll to the top of the page
|
|
1526
1526
|
*/
|
|
1527
1527
|
static toTop() {
|
|
1528
1528
|
window.scrollTo(0, 0);
|
|
1529
1529
|
}
|
|
1530
|
-
/**
|
|
1531
|
-
* Scroll to the bottom of the page
|
|
1530
|
+
/**
|
|
1531
|
+
* Scroll to the bottom of the page
|
|
1532
1532
|
*/
|
|
1533
1533
|
static toBottom() {
|
|
1534
1534
|
window.scrollTo(0, document.body.scrollHeight);
|
|
1535
1535
|
}
|
|
1536
|
-
/**
|
|
1537
|
-
* Show visible elements
|
|
1536
|
+
/**
|
|
1537
|
+
* Show visible elements
|
|
1538
1538
|
*/
|
|
1539
1539
|
static showElements() {
|
|
1540
1540
|
requestAnimationFrame(() => {
|
|
@@ -1554,8 +1554,8 @@ class MintScroll {
|
|
|
1554
1554
|
}
|
|
1555
1555
|
});
|
|
1556
1556
|
}
|
|
1557
|
-
/**
|
|
1558
|
-
* Show visible elements on scroll
|
|
1557
|
+
/**
|
|
1558
|
+
* Show visible elements on scroll
|
|
1559
1559
|
*/
|
|
1560
1560
|
static showElementsOnScroll() {
|
|
1561
1561
|
window.addEventListener('scroll', event_1.default.throttleEvent(this.showElements, 200));
|
|
@@ -1580,80 +1580,80 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
1580
1580
|
value: true
|
|
1581
1581
|
}));
|
|
1582
1582
|
exports.MintSelectors = void 0;
|
|
1583
|
-
/**
|
|
1584
|
-
* CSS-selector helpers
|
|
1585
|
-
* @public
|
|
1583
|
+
/**
|
|
1584
|
+
* CSS-selector helpers
|
|
1585
|
+
* @public
|
|
1586
1586
|
*/
|
|
1587
1587
|
class MintSelectors {
|
|
1588
|
-
/**
|
|
1589
|
-
* Adds the library prefix to the beginning of the provided string
|
|
1590
|
-
* @param base - the string to be prefixed
|
|
1591
|
-
* @returns - the provided string prefixed with the library name
|
|
1588
|
+
/**
|
|
1589
|
+
* Adds the library prefix to the beginning of the provided string
|
|
1590
|
+
* @param base - the string to be prefixed
|
|
1591
|
+
* @returns - the provided string prefixed with the library name
|
|
1592
1592
|
*/
|
|
1593
1593
|
static prefix(base) {
|
|
1594
1594
|
base = base.toLowerCase();
|
|
1595
1595
|
return base.startsWith(this.pre) ? base : `${this.pre}${base}`;
|
|
1596
1596
|
}
|
|
1597
|
-
/**
|
|
1598
|
-
* Adds two dashes to the beginning of the provided string
|
|
1599
|
-
* @param base - the string to be prefixed
|
|
1600
|
-
* @returns - the provided string prefixed with two dashes
|
|
1597
|
+
/**
|
|
1598
|
+
* Adds two dashes to the beginning of the provided string
|
|
1599
|
+
* @param base - the string to be prefixed
|
|
1600
|
+
* @returns - the provided string prefixed with two dashes
|
|
1601
1601
|
*/
|
|
1602
1602
|
static cssPrefix(base) {
|
|
1603
1603
|
return `--${this.prefix(base.replace(/^-+/, ''))}`;
|
|
1604
1604
|
}
|
|
1605
|
-
/**
|
|
1606
|
-
* Turns the provided string into a CSS variable call
|
|
1607
|
-
* @param base - the name of the CSS variable to call
|
|
1608
|
-
* @returns - the CSS variable call for the provided string
|
|
1605
|
+
/**
|
|
1606
|
+
* Turns the provided string into a CSS variable call
|
|
1607
|
+
* @param base - the name of the CSS variable to call
|
|
1608
|
+
* @returns - the CSS variable call for the provided string
|
|
1609
1609
|
*/
|
|
1610
1610
|
static cssVar(base) {
|
|
1611
1611
|
return `var(${this.cssPrefix(base)})`;
|
|
1612
1612
|
}
|
|
1613
|
-
/**
|
|
1614
|
-
* Negates the provided CSS selector
|
|
1615
|
-
* @param base - the CSS selector to negate
|
|
1616
|
-
* @returns - the negated CSS selector
|
|
1613
|
+
/**
|
|
1614
|
+
* Negates the provided CSS selector
|
|
1615
|
+
* @param base - the CSS selector to negate
|
|
1616
|
+
* @returns - the negated CSS selector
|
|
1617
1617
|
*/
|
|
1618
1618
|
static neg(base) {
|
|
1619
1619
|
return `:not(${base})`;
|
|
1620
1620
|
}
|
|
1621
|
-
/**
|
|
1622
|
-
* Generates a class CSS selector
|
|
1623
|
-
* @param base - the name of the class to generate
|
|
1624
|
-
* @returns - the generated CSS selector
|
|
1621
|
+
/**
|
|
1622
|
+
* Generates a class CSS selector
|
|
1623
|
+
* @param base - the name of the class to generate
|
|
1624
|
+
* @returns - the generated CSS selector
|
|
1625
1625
|
*/
|
|
1626
1626
|
static class(base) {
|
|
1627
1627
|
return `.${this.prefix(base)}`;
|
|
1628
1628
|
}
|
|
1629
|
-
/**
|
|
1630
|
-
* Generates an id CSS selector
|
|
1631
|
-
* @param base - the name of the id to generate
|
|
1632
|
-
* @returns - the generated CSS selector
|
|
1629
|
+
/**
|
|
1630
|
+
* Generates an id CSS selector
|
|
1631
|
+
* @param base - the name of the id to generate
|
|
1632
|
+
* @returns - the generated CSS selector
|
|
1633
1633
|
*/
|
|
1634
1634
|
static id(base) {
|
|
1635
1635
|
return `#${this.prefix(base)}`;
|
|
1636
1636
|
}
|
|
1637
|
-
/**
|
|
1638
|
-
* Generates an aria-controls CSS selector
|
|
1639
|
-
* @param id - the id of the controlled element
|
|
1640
|
-
* @returns - the generated CSS selector
|
|
1637
|
+
/**
|
|
1638
|
+
* Generates an aria-controls CSS selector
|
|
1639
|
+
* @param id - the id of the controlled element
|
|
1640
|
+
* @returns - the generated CSS selector
|
|
1641
1641
|
*/
|
|
1642
1642
|
static controls(id) {
|
|
1643
1643
|
return id ? `[aria-controls="${this.prefix(id)}"]` : this.hasControls;
|
|
1644
1644
|
}
|
|
1645
|
-
/**
|
|
1646
|
-
* Generates an aria-expanded CSS selector
|
|
1647
|
-
* @param bool - whether the element is expanded or not
|
|
1648
|
-
* @returns - the generated CSS selector
|
|
1645
|
+
/**
|
|
1646
|
+
* Generates an aria-expanded CSS selector
|
|
1647
|
+
* @param bool - whether the element is expanded or not
|
|
1648
|
+
* @returns - the generated CSS selector
|
|
1649
1649
|
*/
|
|
1650
1650
|
static expanded(bool) {
|
|
1651
1651
|
return typeof bool === 'boolean' ? `[aria-expanded="${bool}"]` : this.hasExpanded;
|
|
1652
1652
|
}
|
|
1653
|
-
/**
|
|
1654
|
-
* Returns a NodeList of HTMLElements within the given element that are focusable
|
|
1655
|
-
* @param el - the element whose focusable children will be returned
|
|
1656
|
-
* @returns - the elements within the given element that are focusable
|
|
1653
|
+
/**
|
|
1654
|
+
* Returns a NodeList of HTMLElements within the given element that are focusable
|
|
1655
|
+
* @param el - the element whose focusable children will be returned
|
|
1656
|
+
* @returns - the elements within the given element that are focusable
|
|
1657
1657
|
*/
|
|
1658
1658
|
static getFocusables(el) {
|
|
1659
1659
|
let focusables;
|
|
@@ -1664,12 +1664,12 @@ class MintSelectors {
|
|
|
1664
1664
|
}
|
|
1665
1665
|
return focusables.filter(el => this.isFocusable(el));
|
|
1666
1666
|
}
|
|
1667
|
-
/**
|
|
1668
|
-
* Returns true if an element is focusable and false if not,
|
|
1669
|
-
* based on styles (i.e. a parent has display: none;)
|
|
1670
|
-
* NOTE: Still need to determine what other styles may make an element un-focusable
|
|
1671
|
-
* @param el - the element
|
|
1672
|
-
* @returns - true if the element is focusable; false if not
|
|
1667
|
+
/**
|
|
1668
|
+
* Returns true if an element is focusable and false if not,
|
|
1669
|
+
* based on styles (i.e. a parent has display: none;)
|
|
1670
|
+
* NOTE: Still need to determine what other styles may make an element un-focusable
|
|
1671
|
+
* @param el - the element
|
|
1672
|
+
* @returns - true if the element is focusable; false if not
|
|
1673
1673
|
*/
|
|
1674
1674
|
static isFocusable(el) {
|
|
1675
1675
|
let current = el;
|
|
@@ -1684,48 +1684,48 @@ class MintSelectors {
|
|
|
1684
1684
|
}
|
|
1685
1685
|
exports.MintSelectors = MintSelectors;
|
|
1686
1686
|
_a = MintSelectors;
|
|
1687
|
-
/**
|
|
1688
|
-
* The library name that will be added as a prefix
|
|
1687
|
+
/**
|
|
1688
|
+
* The library name that will be added as a prefix
|
|
1689
1689
|
*/
|
|
1690
1690
|
MintSelectors.lib = 'mint';
|
|
1691
|
-
/**
|
|
1692
|
-
* The prefix built from the library name
|
|
1691
|
+
/**
|
|
1692
|
+
* The prefix built from the library name
|
|
1693
1693
|
*/
|
|
1694
1694
|
MintSelectors.pre = `${_a.lib}-`;
|
|
1695
|
-
/**
|
|
1696
|
-
* CSS-selector for disabled elements
|
|
1695
|
+
/**
|
|
1696
|
+
* CSS-selector for disabled elements
|
|
1697
1697
|
*/
|
|
1698
1698
|
MintSelectors.disabled = '[disabled]';
|
|
1699
|
-
/**
|
|
1700
|
-
* CSS-selector for elements with an aria-controls attribute
|
|
1699
|
+
/**
|
|
1700
|
+
* CSS-selector for elements with an aria-controls attribute
|
|
1701
1701
|
*/
|
|
1702
1702
|
MintSelectors.hasControls = '[aria-controls]';
|
|
1703
|
-
/**
|
|
1704
|
-
* CSS-selector for elements with an aria-expanded attribute
|
|
1703
|
+
/**
|
|
1704
|
+
* CSS-selector for elements with an aria-expanded attribute
|
|
1705
1705
|
*/
|
|
1706
1706
|
MintSelectors.hasExpanded = '[aria-expanded]';
|
|
1707
|
-
/**
|
|
1708
|
-
* CSS-selector for elements with an href attribute
|
|
1707
|
+
/**
|
|
1708
|
+
* CSS-selector for elements with an href attribute
|
|
1709
1709
|
*/
|
|
1710
1710
|
MintSelectors.hasLink = '[href]';
|
|
1711
|
-
/**
|
|
1712
|
-
* CSS-selector for elements with a routerLink attribute
|
|
1711
|
+
/**
|
|
1712
|
+
* CSS-selector for elements with a routerLink attribute
|
|
1713
1713
|
*/
|
|
1714
1714
|
MintSelectors.hasRouterLink = '[routerLink]';
|
|
1715
|
-
/**
|
|
1716
|
-
* CSS-selector for elements with an id attribute
|
|
1715
|
+
/**
|
|
1716
|
+
* CSS-selector for elements with an id attribute
|
|
1717
1717
|
*/
|
|
1718
1718
|
MintSelectors.hasId = '[id]';
|
|
1719
|
-
/**
|
|
1720
|
-
* CSS-selector for elements that aren't tabbable (i.e. tabindex is negative)
|
|
1719
|
+
/**
|
|
1720
|
+
* CSS-selector for elements that aren't tabbable (i.e. tabindex is negative)
|
|
1721
1721
|
*/
|
|
1722
1722
|
MintSelectors.notTabbable = '[tabindex^="-"]';
|
|
1723
|
-
/**
|
|
1724
|
-
* CSS-selector for elements that are tabbable (i.e. tabindex isn't negative)
|
|
1723
|
+
/**
|
|
1724
|
+
* CSS-selector for elements that are tabbable (i.e. tabindex isn't negative)
|
|
1725
1725
|
*/
|
|
1726
1726
|
MintSelectors.tabbable = `[tabindex]${_a.neg(_a.notTabbable)}`;
|
|
1727
|
-
/**
|
|
1728
|
-
* CSS-selector for elements that can receive focus
|
|
1727
|
+
/**
|
|
1728
|
+
* CSS-selector for elements that can receive focus
|
|
1729
1729
|
*/
|
|
1730
1730
|
MintSelectors.focusable = `input${_a.neg(_a.disabled)}${_a.neg(_a.notTabbable)},
|
|
1731
1731
|
select${_a.neg(_a.disabled)}${_a.neg(_a.notTabbable)},
|
|
@@ -1735,12 +1735,12 @@ MintSelectors.focusable = `input${_a.neg(_a.disabled)}${_a.neg(_a.notTabbable)},
|
|
|
1735
1735
|
a${_a.hasLink}, a${_a.hasRouterLink},
|
|
1736
1736
|
area${_a.hasLink},
|
|
1737
1737
|
${_a.tabbable}`.replace(/\s/g, '');
|
|
1738
|
-
/**
|
|
1739
|
-
* CSS-selector for submenu buttons
|
|
1738
|
+
/**
|
|
1739
|
+
* CSS-selector for submenu buttons
|
|
1740
1740
|
*/
|
|
1741
1741
|
MintSelectors.subMenuButtons = `button${_a.hasControls}`;
|
|
1742
|
-
/**
|
|
1743
|
-
* CSS-selector for submenus
|
|
1742
|
+
/**
|
|
1743
|
+
* CSS-selector for submenus
|
|
1744
1744
|
*/
|
|
1745
1745
|
MintSelectors.subMenu = `${_a.subMenuButtons} + ul${_a.hasId}`;
|
|
1746
1746
|
;
|
|
@@ -1761,14 +1761,14 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
1761
1761
|
value: true
|
|
1762
1762
|
}));
|
|
1763
1763
|
exports.MintSettings = void 0;
|
|
1764
|
-
/**
|
|
1765
|
-
* Settings management
|
|
1766
|
-
* @public
|
|
1764
|
+
/**
|
|
1765
|
+
* Settings management
|
|
1766
|
+
* @public
|
|
1767
1767
|
*/
|
|
1768
1768
|
class MintSettings {
|
|
1769
|
-
/**
|
|
1770
|
-
* Update the provided settings variables
|
|
1771
|
-
* @param settings - Object of settings variables to update
|
|
1769
|
+
/**
|
|
1770
|
+
* Update the provided settings variables
|
|
1771
|
+
* @param settings - Object of settings variables to update
|
|
1772
1772
|
*/
|
|
1773
1773
|
static set(settings) {
|
|
1774
1774
|
let newDelay = false;
|
|
@@ -1794,8 +1794,8 @@ class MintSettings {
|
|
|
1794
1794
|
}
|
|
1795
1795
|
}
|
|
1796
1796
|
}
|
|
1797
|
-
/**
|
|
1798
|
-
* Updates the delay variables based on `this.delayBase` and `this.delayStep`
|
|
1797
|
+
/**
|
|
1798
|
+
* Updates the delay variables based on `this.delayBase` and `this.delayStep`
|
|
1799
1799
|
*/
|
|
1800
1800
|
static setDelay() {
|
|
1801
1801
|
this.delay = {
|
|
@@ -1810,16 +1810,16 @@ class MintSettings {
|
|
|
1810
1810
|
}
|
|
1811
1811
|
exports.MintSettings = MintSettings;
|
|
1812
1812
|
_a = MintSettings;
|
|
1813
|
-
/**
|
|
1814
|
-
* Value added to all delay variables
|
|
1813
|
+
/**
|
|
1814
|
+
* Value added to all delay variables
|
|
1815
1815
|
*/
|
|
1816
1816
|
MintSettings.delayBase = 0;
|
|
1817
|
-
/**
|
|
1818
|
-
* Value multiplied by delay variable index
|
|
1817
|
+
/**
|
|
1818
|
+
* Value multiplied by delay variable index
|
|
1819
1819
|
*/
|
|
1820
1820
|
MintSettings.delayStep = 100;
|
|
1821
|
-
/**
|
|
1822
|
-
* Delay variables
|
|
1821
|
+
/**
|
|
1822
|
+
* Delay variables
|
|
1823
1823
|
*/
|
|
1824
1824
|
MintSettings.delay = {
|
|
1825
1825
|
instant: _a.delayBase + _a.delayStep * 0,
|
|
@@ -1829,8 +1829,8 @@ MintSettings.delay = {
|
|
|
1829
1829
|
medSlow: _a.delayBase + _a.delayStep * 4,
|
|
1830
1830
|
slow: _a.delayBase + _a.delayStep * 5
|
|
1831
1831
|
};
|
|
1832
|
-
/**
|
|
1833
|
-
* Breakpoint variables
|
|
1832
|
+
/**
|
|
1833
|
+
* Breakpoint variables
|
|
1834
1834
|
*/
|
|
1835
1835
|
MintSettings.break = {
|
|
1836
1836
|
z: 0,
|
|
@@ -1857,31 +1857,31 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
1857
1857
|
value: true
|
|
1858
1858
|
}));
|
|
1859
1859
|
exports.MintText = void 0;
|
|
1860
|
-
/**
|
|
1861
|
-
* Functions for analyzing and manipulating text.
|
|
1860
|
+
/**
|
|
1861
|
+
* Functions for analyzing and manipulating text.
|
|
1862
1862
|
*/
|
|
1863
1863
|
class MintText {
|
|
1864
|
-
/**
|
|
1865
|
-
* Generate a slug from a string
|
|
1866
|
-
* @param text - The string to slugify
|
|
1867
|
-
* @returns The slugified string
|
|
1864
|
+
/**
|
|
1865
|
+
* Generate a slug from a string
|
|
1866
|
+
* @param text - The string to slugify
|
|
1867
|
+
* @returns The slugified string
|
|
1868
1868
|
*/
|
|
1869
1869
|
static slug(text) {
|
|
1870
1870
|
var _a;
|
|
1871
1871
|
return (_a = text === null || text === void 0 ? void 0 : text.trim().toLowerCase().replace(/'/g, '').replace(/[^\w/-]+/g, '-').replace(/-+/g, '-').replace(/^-+|-+$/g, '').replace(/^\/+|\/+$/g, '')) !== null && _a !== void 0 ? _a : '';
|
|
1872
1872
|
}
|
|
1873
|
-
/**
|
|
1874
|
-
* Generate a title from a slug
|
|
1875
|
-
* @param slug - The slug to generate a title from
|
|
1876
|
-
* @returns The title
|
|
1873
|
+
/**
|
|
1874
|
+
* Generate a title from a slug
|
|
1875
|
+
* @param slug - The slug to generate a title from
|
|
1876
|
+
* @returns The title
|
|
1877
1877
|
*/
|
|
1878
1878
|
static unslug(slug) {
|
|
1879
1879
|
return this.titleCase(slug.replace(/[-/]+/g, ' '));
|
|
1880
1880
|
}
|
|
1881
|
-
/**
|
|
1882
|
-
* Format a phone number
|
|
1883
|
-
* @param phone - The phone number to format
|
|
1884
|
-
* @returns The formatted phone number
|
|
1881
|
+
/**
|
|
1882
|
+
* Format a phone number
|
|
1883
|
+
* @param phone - The phone number to format
|
|
1884
|
+
* @returns The formatted phone number
|
|
1885
1885
|
*/
|
|
1886
1886
|
static phone(phone) {
|
|
1887
1887
|
var _a, _b;
|
|
@@ -1923,8 +1923,8 @@ class MintText {
|
|
|
1923
1923
|
}
|
|
1924
1924
|
return formatted;
|
|
1925
1925
|
}
|
|
1926
|
-
/**
|
|
1927
|
-
* Pluralize the given word
|
|
1926
|
+
/**
|
|
1927
|
+
* Pluralize the given word
|
|
1928
1928
|
*/
|
|
1929
1929
|
static plural(word) {
|
|
1930
1930
|
if (word.endsWith('ies') || word.endsWith('es') || word.endsWith('s') && !word.endsWith('us') && !word.endsWith('is') && !word.endsWith('ss')) {
|
|
@@ -1938,16 +1938,16 @@ class MintText {
|
|
|
1938
1938
|
}
|
|
1939
1939
|
return word + 's';
|
|
1940
1940
|
}
|
|
1941
|
-
/**
|
|
1942
|
-
* Capitalize the first letter of the given word
|
|
1941
|
+
/**
|
|
1942
|
+
* Capitalize the first letter of the given word
|
|
1943
1943
|
*/
|
|
1944
1944
|
static titleCase(text) {
|
|
1945
1945
|
return text.toLowerCase().replace(/(?:^|\s)\S/g, a => a.toUpperCase());
|
|
1946
1946
|
}
|
|
1947
|
-
/**
|
|
1948
|
-
* Copies the provided text to the clipboard
|
|
1949
|
-
* @param text - the text to copy
|
|
1950
|
-
* @returns - true if the text was successfully copied to the clipboard; else false
|
|
1947
|
+
/**
|
|
1948
|
+
* Copies the provided text to the clipboard
|
|
1949
|
+
* @param text - the text to copy
|
|
1950
|
+
* @returns - true if the text was successfully copied to the clipboard; else false
|
|
1951
1951
|
*/
|
|
1952
1952
|
static copyText(text) {
|
|
1953
1953
|
let textArea = document.createElement('textarea');
|
|
@@ -1970,11 +1970,11 @@ class MintText {
|
|
|
1970
1970
|
document.body.removeChild(textArea);
|
|
1971
1971
|
return true;
|
|
1972
1972
|
}
|
|
1973
|
-
/**
|
|
1974
|
-
* Tests the validity of an email address
|
|
1975
|
-
* @see {@link https://stackoverflow.com/questions/201323/how-can-i-validate-an-email-address-using-a-regular-expression}
|
|
1976
|
-
* @param text - the string to test
|
|
1977
|
-
* @returns - true if the given string is an email address; false if not
|
|
1973
|
+
/**
|
|
1974
|
+
* Tests the validity of an email address
|
|
1975
|
+
* @see {@link https://stackoverflow.com/questions/201323/how-can-i-validate-an-email-address-using-a-regular-expression}
|
|
1976
|
+
* @param text - the string to test
|
|
1977
|
+
* @returns - true if the given string is an email address; false if not
|
|
1978
1978
|
*/
|
|
1979
1979
|
static isEmail(text) {
|
|
1980
1980
|
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])+)\])/);
|
|
@@ -1998,13 +1998,13 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
1998
1998
|
value: true
|
|
1999
1999
|
}));
|
|
2000
2000
|
exports.MintWindow = void 0;
|
|
2001
|
-
/**
|
|
2002
|
-
* Functions related to the browser window.
|
|
2001
|
+
/**
|
|
2002
|
+
* Functions related to the browser window.
|
|
2003
2003
|
*/
|
|
2004
2004
|
class MintWindow {
|
|
2005
|
-
/**
|
|
2006
|
-
* Returns the width of the window, including fractional pixels
|
|
2007
|
-
* @returns the width of the window
|
|
2005
|
+
/**
|
|
2006
|
+
* Returns the width of the window, including fractional pixels
|
|
2007
|
+
* @returns the width of the window
|
|
2008
2008
|
*/
|
|
2009
2009
|
static width() {
|
|
2010
2010
|
const decimal = document.body.getBoundingClientRect().width % 1;
|
|
@@ -2025,10 +2025,10 @@ exports["default"] = MintWindow;
|
|
|
2025
2025
|
|
|
2026
2026
|
|
|
2027
2027
|
|
|
2028
|
-
/**
|
|
2029
|
-
* A library for building responsive web applications.
|
|
2030
|
-
*
|
|
2031
|
-
* @packageDocumentation
|
|
2028
|
+
/**
|
|
2029
|
+
* A library for building responsive web applications.
|
|
2030
|
+
*
|
|
2031
|
+
* @packageDocumentation
|
|
2032
2032
|
*/
|
|
2033
2033
|
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
2034
2034
|
if (k2 === undefined) k2 = k;
|
|
@@ -2052,8 +2052,8 @@ var __exportStar = this && this.__exportStar || function (m, exports) {
|
|
|
2052
2052
|
Object.defineProperty(exports, "__esModule", ({
|
|
2053
2053
|
value: true
|
|
2054
2054
|
}));
|
|
2055
|
-
/**
|
|
2056
|
-
* Exports
|
|
2055
|
+
/**
|
|
2056
|
+
* Exports
|
|
2057
2057
|
*/
|
|
2058
2058
|
__exportStar(__webpack_require__(/*! ./imports */ "./src/ts/imports/index.ts"), exports);
|
|
2059
2059
|
|