@appartmint/mint 0.14.12 → 0.14.13
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 +20 -8
- 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 +124 -124
- package/dist/js/imports/enum.d.ts +9 -9
- package/dist/js/imports/models/color.d.ts +31 -31
- package/dist/js/imports/models/item.d.ts +69 -69
- package/dist/js/imports/util/display.d.ts +6 -6
- package/dist/js/imports/util/event.d.ts +6 -6
- package/dist/js/imports/util/icon.d.ts +28 -28
- package/dist/js/imports/util/list.d.ts +12 -12
- package/dist/js/imports/util/math.d.ts +13 -13
- package/dist/js/imports/util/object.d.ts +65 -65
- package/dist/js/imports/util/scroll.d.ts +18 -18
- 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 +16 -16
- package/dist/js/imports/util/window.d.ts +6 -6
- package/dist/js/index.d.ts +24 -24
- package/dist/js/index.js +330 -330
- package/dist/js/index.js.map +1 -1
- package/dist/js/index.min.js.map +1 -1
- package/dist/js/util.d.ts +77 -77
- package/dist/js/util.js +67 -67
- package/dist/js/util.js.map +1 -1
- package/dist/js/util.min.js.map +1 -1
- package/package.json +1 -1
- package/src/scss/imports/_index.scss +8 -8
- package/src/scss/imports/components/_header.scss +12 -5
- package/src/scss/imports/components/_index.scss +7 -7
- package/src/scss/imports/global/_global.scss +29 -4
- package/src/scss/imports/global/_icons.scss +6 -6
- package/src/scss/imports/util/_index.scss +8 -8
- package/src/scss/imports/util/_vars.scss +4 -0
- package/src/ts/imports/enum.ts +9 -9
- package/src/ts/imports/models/color.ts +96 -96
- package/src/ts/imports/util/display.ts +6 -6
- package/src/ts/imports/util/event.ts +7 -7
- package/src/ts/imports/util/list.ts +19 -19
- package/src/ts/imports/util/math.ts +17 -17
- package/src/ts/imports/util/window.ts +6 -6
package/dist/js/index.js
CHANGED
|
@@ -29,31 +29,31 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
29
29
|
value: true
|
|
30
30
|
}));
|
|
31
31
|
exports.mintHeader = void 0;
|
|
32
|
-
/**
|
|
33
|
-
* Imports
|
|
32
|
+
/**
|
|
33
|
+
* Imports
|
|
34
34
|
*/
|
|
35
35
|
const enum_1 = __webpack_require__(/*! ../enum */ "./src/ts/imports/enum.ts");
|
|
36
36
|
const util_1 = __importDefault(__webpack_require__(/*! ../../util */ "./src/ts/util.ts"));
|
|
37
37
|
const selectors_1 = __importDefault(__webpack_require__(/*! ../util/selectors */ "./src/ts/imports/util/selectors.ts"));
|
|
38
38
|
const settings_1 = __importDefault(__webpack_require__(/*! ../util/settings */ "./src/ts/imports/util/settings.ts"));
|
|
39
|
-
/**
|
|
40
|
-
* Main header functionality
|
|
41
|
-
* @public
|
|
39
|
+
/**
|
|
40
|
+
* Main header functionality
|
|
41
|
+
* @public
|
|
42
42
|
*/
|
|
43
43
|
class mintHeader {
|
|
44
|
-
/**
|
|
45
|
-
* Initializes and closes the menu
|
|
44
|
+
/**
|
|
45
|
+
* Initializes and closes the menu
|
|
46
46
|
*/
|
|
47
47
|
constructor(settings) {
|
|
48
|
-
/**
|
|
49
|
-
* Navbar settings
|
|
48
|
+
/**
|
|
49
|
+
* Navbar settings
|
|
50
50
|
*/
|
|
51
51
|
this.settings = {
|
|
52
52
|
from: enum_1.mintSide.Top,
|
|
53
53
|
fixed: true
|
|
54
54
|
};
|
|
55
|
-
/**
|
|
56
|
-
* Frequently-referenced elements
|
|
55
|
+
/**
|
|
56
|
+
* Frequently-referenced elements
|
|
57
57
|
*/
|
|
58
58
|
this.el = {};
|
|
59
59
|
this.settings = Object.assign(Object.assign({}, this.settings), settings);
|
|
@@ -61,8 +61,8 @@ class mintHeader {
|
|
|
61
61
|
this.attachEvents();
|
|
62
62
|
this.addClasses();
|
|
63
63
|
}
|
|
64
|
-
/**
|
|
65
|
-
* Adds elements to {@link el | `this.el`}
|
|
64
|
+
/**
|
|
65
|
+
* Adds elements to {@link el | `this.el`}
|
|
66
66
|
*/
|
|
67
67
|
attachElements() {
|
|
68
68
|
var _a;
|
|
@@ -72,8 +72,8 @@ class mintHeader {
|
|
|
72
72
|
this.el.mobileButton = ((_a = this.el.header) === null || _a === void 0 ? void 0 : _a.querySelector(selectors_1.default.controls('mint-wrapper'))) || null;
|
|
73
73
|
this.el.wrapper = document.getElementById('mint-wrapper');
|
|
74
74
|
}
|
|
75
|
-
/**
|
|
76
|
-
* Adds events to the dom
|
|
75
|
+
/**
|
|
76
|
+
* Adds events to the dom
|
|
77
77
|
*/
|
|
78
78
|
attachEvents() {
|
|
79
79
|
var _a, _b, _c, _d;
|
|
@@ -98,8 +98,8 @@ class mintHeader {
|
|
|
98
98
|
}));
|
|
99
99
|
(_d = this.el.wrapper) === null || _d === void 0 ? void 0 : _d.addEventListener('transitionend', this.eTransitionEnd.bind(this));
|
|
100
100
|
}
|
|
101
|
-
/**
|
|
102
|
-
* Adds classes that inform the styles based on settings
|
|
101
|
+
/**
|
|
102
|
+
* Adds classes that inform the styles based on settings
|
|
103
103
|
*/
|
|
104
104
|
addClasses() {
|
|
105
105
|
var _a, _b, _c, _d, _e;
|
|
@@ -112,9 +112,9 @@ class mintHeader {
|
|
|
112
112
|
(_e = this.el.header) === null || _e === void 0 ? void 0 : _e.classList.add('mint-tray');
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
/**
|
|
116
|
-
* Sets the state of the mobile menu
|
|
117
|
-
* @param open - `true` to open the menu or `false` to close it
|
|
115
|
+
/**
|
|
116
|
+
* Sets the state of the mobile menu
|
|
117
|
+
* @param open - `true` to open the menu or `false` to close it
|
|
118
118
|
*/
|
|
119
119
|
setMobileMenu() {
|
|
120
120
|
let open = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
@@ -166,17 +166,17 @@ class mintHeader {
|
|
|
166
166
|
this.closeAllMenus();
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
/**
|
|
170
|
-
* Toggles the state of the mobile menu
|
|
169
|
+
/**
|
|
170
|
+
* Toggles the state of the mobile menu
|
|
171
171
|
*/
|
|
172
172
|
toggleMobileMenu() {
|
|
173
173
|
var _a, _b;
|
|
174
174
|
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');
|
|
175
175
|
}
|
|
176
|
-
/**
|
|
177
|
-
* Sets the state of the provided button's menu
|
|
178
|
-
* @param button - Button element to set
|
|
179
|
-
* @param open - `true` to open the menu or `false` to close it
|
|
176
|
+
/**
|
|
177
|
+
* Sets the state of the provided button's menu
|
|
178
|
+
* @param button - Button element to set
|
|
179
|
+
* @param open - `true` to open the menu or `false` to close it
|
|
180
180
|
*/
|
|
181
181
|
setMenu(button) {
|
|
182
182
|
let open = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
@@ -192,17 +192,17 @@ class mintHeader {
|
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
|
-
/**
|
|
196
|
-
* Toggles the state of the provided button's menu
|
|
197
|
-
* @param button - Button element to toggle
|
|
195
|
+
/**
|
|
196
|
+
* Toggles the state of the provided button's menu
|
|
197
|
+
* @param button - Button element to toggle
|
|
198
198
|
*/
|
|
199
199
|
toggleMenu(button) {
|
|
200
200
|
var _a;
|
|
201
201
|
this.setMenu(button, ((_a = button === null || button === void 0 ? void 0 : button.getAttribute('aria-expanded')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== 'true');
|
|
202
202
|
}
|
|
203
|
-
/**
|
|
204
|
-
* Closes all submenus of the provided button's menu
|
|
205
|
-
* @param button - Button element of the parent menu
|
|
203
|
+
/**
|
|
204
|
+
* Closes all submenus of the provided button's menu
|
|
205
|
+
* @param button - Button element of the parent menu
|
|
206
206
|
*/
|
|
207
207
|
closeSubMenus(button) {
|
|
208
208
|
let menu = button === null || button === void 0 ? void 0 : button.nextElementSibling,
|
|
@@ -215,9 +215,9 @@ class mintHeader {
|
|
|
215
215
|
}
|
|
216
216
|
});
|
|
217
217
|
}
|
|
218
|
-
/**
|
|
219
|
-
* Closes all sibling menus of the provided button's menu
|
|
220
|
-
* @param button - Button element of the sibling menus
|
|
218
|
+
/**
|
|
219
|
+
* Closes all sibling menus of the provided button's menu
|
|
220
|
+
* @param button - Button element of the sibling menus
|
|
221
221
|
*/
|
|
222
222
|
closeSiblingMenus(button) {
|
|
223
223
|
var _a;
|
|
@@ -229,8 +229,8 @@ class mintHeader {
|
|
|
229
229
|
}
|
|
230
230
|
});
|
|
231
231
|
}
|
|
232
|
-
/**
|
|
233
|
-
* Closes all submenus of the n4vbar
|
|
232
|
+
/**
|
|
233
|
+
* Closes all submenus of the n4vbar
|
|
234
234
|
*/
|
|
235
235
|
closeAllMenus() {
|
|
236
236
|
var _a;
|
|
@@ -239,8 +239,8 @@ class mintHeader {
|
|
|
239
239
|
this.setMenu(menuButton);
|
|
240
240
|
});
|
|
241
241
|
}
|
|
242
|
-
/**
|
|
243
|
-
* Opens the menu closest to the document's focus
|
|
242
|
+
/**
|
|
243
|
+
* Opens the menu closest to the document's focus
|
|
244
244
|
*/
|
|
245
245
|
openClosestMenu() {
|
|
246
246
|
var _a;
|
|
@@ -256,8 +256,8 @@ class mintHeader {
|
|
|
256
256
|
firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
|
-
/**
|
|
260
|
-
* Closes the menu closest to the document's focus
|
|
259
|
+
/**
|
|
260
|
+
* Closes the menu closest to the document's focus
|
|
261
261
|
*/
|
|
262
262
|
closeClosestMenu() {
|
|
263
263
|
var _a, _b;
|
|
@@ -272,8 +272,8 @@ class mintHeader {
|
|
|
272
272
|
activeButton === null || activeButton === void 0 ? void 0 : activeButton.focus();
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
|
-
/**
|
|
276
|
-
* Toggles the menu closest to the document's focus
|
|
275
|
+
/**
|
|
276
|
+
* Toggles the menu closest to the document's focus
|
|
277
277
|
*/
|
|
278
278
|
toggleClosestMenu() {
|
|
279
279
|
var _a, _b;
|
|
@@ -283,8 +283,8 @@ class mintHeader {
|
|
|
283
283
|
this.openClosestMenu();
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
|
-
/**
|
|
287
|
-
* Closes the mobile menu when the window resizes
|
|
286
|
+
/**
|
|
287
|
+
* Closes the mobile menu when the window resizes
|
|
288
288
|
*/
|
|
289
289
|
eHandleResize() {
|
|
290
290
|
var _a, _b;
|
|
@@ -304,15 +304,15 @@ class mintHeader {
|
|
|
304
304
|
this.el.html.style.overflow = overflow;
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
|
-
/**
|
|
308
|
-
* Closes all submenus when the page is scrolled
|
|
307
|
+
/**
|
|
308
|
+
* Closes all submenus when the page is scrolled
|
|
309
309
|
*/
|
|
310
310
|
eHandleScroll() {
|
|
311
311
|
this.closeAllMenus();
|
|
312
312
|
}
|
|
313
|
-
/**
|
|
314
|
-
* Sends the focus to the menu button after tabbing past the last menu item
|
|
315
|
-
* @param e - Keyboard event
|
|
313
|
+
/**
|
|
314
|
+
* Sends the focus to the menu button after tabbing past the last menu item
|
|
315
|
+
* @param e - Keyboard event
|
|
316
316
|
*/
|
|
317
317
|
eWrapTab(e) {
|
|
318
318
|
var _a;
|
|
@@ -323,9 +323,9 @@ class mintHeader {
|
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
|
-
/**
|
|
327
|
-
* Handles keypresses on n4vbar buttons
|
|
328
|
-
* @param e - Keyboard event
|
|
326
|
+
/**
|
|
327
|
+
* Handles keypresses on n4vbar buttons
|
|
328
|
+
* @param e - Keyboard event
|
|
329
329
|
*/
|
|
330
330
|
eHandleButtonKeypress(e) {
|
|
331
331
|
var _a;
|
|
@@ -352,9 +352,9 @@ class mintHeader {
|
|
|
352
352
|
break;
|
|
353
353
|
}
|
|
354
354
|
}
|
|
355
|
-
/**
|
|
356
|
-
* Handles keypresses on n4vbar links
|
|
357
|
-
* @param e - Keyboard event
|
|
355
|
+
/**
|
|
356
|
+
* Handles keypresses on n4vbar links
|
|
357
|
+
* @param e - Keyboard event
|
|
358
358
|
*/
|
|
359
359
|
eHandleLinkKeypress(e) {
|
|
360
360
|
let target = e.target;
|
|
@@ -372,9 +372,9 @@ class mintHeader {
|
|
|
372
372
|
break;
|
|
373
373
|
}
|
|
374
374
|
}
|
|
375
|
-
/**
|
|
376
|
-
* Handles keypresses on the n4vbar
|
|
377
|
-
* @param e - Keyboard event
|
|
375
|
+
/**
|
|
376
|
+
* Handles keypresses on the n4vbar
|
|
377
|
+
* @param e - Keyboard event
|
|
378
378
|
*/
|
|
379
379
|
eHandleKeypress(e) {
|
|
380
380
|
if (e.key.toLowerCase() !== 'tab') {
|
|
@@ -390,23 +390,23 @@ class mintHeader {
|
|
|
390
390
|
break;
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
|
-
/**
|
|
394
|
-
* Toggles the mobile menu
|
|
393
|
+
/**
|
|
394
|
+
* Toggles the mobile menu
|
|
395
395
|
*/
|
|
396
396
|
eToggleMobileMenu() {
|
|
397
397
|
this.toggleMobileMenu();
|
|
398
398
|
}
|
|
399
|
-
/**
|
|
400
|
-
* Toggles the clicked submenu
|
|
401
|
-
* @param e - Mouse event
|
|
399
|
+
/**
|
|
400
|
+
* Toggles the clicked submenu
|
|
401
|
+
* @param e - Mouse event
|
|
402
402
|
*/
|
|
403
403
|
eToggleMenu(e) {
|
|
404
404
|
let target = e.target;
|
|
405
405
|
this.closeSiblingMenus(target);
|
|
406
406
|
this.toggleMenu(target);
|
|
407
407
|
}
|
|
408
|
-
/**
|
|
409
|
-
* Runs after the mobile menu transitions
|
|
408
|
+
/**
|
|
409
|
+
* Runs after the mobile menu transitions
|
|
410
410
|
*/
|
|
411
411
|
eTransitionEnd() {
|
|
412
412
|
var _a;
|
|
@@ -432,8 +432,8 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
432
432
|
value: true
|
|
433
433
|
}));
|
|
434
434
|
exports.mintSide = void 0;
|
|
435
|
-
/**
|
|
436
|
-
* Side Enum
|
|
435
|
+
/**
|
|
436
|
+
* Side Enum
|
|
437
437
|
*/
|
|
438
438
|
var mintSide;
|
|
439
439
|
(function (mintSide) {
|
|
@@ -458,8 +458,8 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
458
458
|
value: true
|
|
459
459
|
}));
|
|
460
460
|
exports.mintColor = void 0;
|
|
461
|
-
/**
|
|
462
|
-
* Color
|
|
461
|
+
/**
|
|
462
|
+
* Color
|
|
463
463
|
*/
|
|
464
464
|
class mintColor {
|
|
465
465
|
constructor(args) {
|
|
@@ -471,8 +471,8 @@ class mintColor {
|
|
|
471
471
|
this.stringConstructor(args.color);
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
|
-
/**
|
|
475
|
-
* Constructor from a string argument
|
|
474
|
+
/**
|
|
475
|
+
* Constructor from a string argument
|
|
476
476
|
*/
|
|
477
477
|
stringConstructor(str) {
|
|
478
478
|
if (str.startsWith('#')) {
|
|
@@ -484,8 +484,8 @@ class mintColor {
|
|
|
484
484
|
this.rgbConstructor(str);
|
|
485
485
|
}
|
|
486
486
|
}
|
|
487
|
-
/**
|
|
488
|
-
* Constructor from a hex argument
|
|
487
|
+
/**
|
|
488
|
+
* Constructor from a hex argument
|
|
489
489
|
*/
|
|
490
490
|
hexConstructor(hex) {
|
|
491
491
|
switch (hex.length) {
|
|
@@ -516,8 +516,8 @@ class mintColor {
|
|
|
516
516
|
this.b = parseInt(hex.substring(5, 7), mintColor.hexBase);
|
|
517
517
|
this.a = parseInt(hex.substring(7, 9), mintColor.hexBase) / mintColor.hexBase ** 2;
|
|
518
518
|
}
|
|
519
|
-
/**
|
|
520
|
-
* Constructor from an rgba argument
|
|
519
|
+
/**
|
|
520
|
+
* Constructor from an rgba argument
|
|
521
521
|
*/
|
|
522
522
|
rgbConstructor(rgb) {
|
|
523
523
|
let match = rgb.match(/rgba?\((\d{1,3}), ?(\d{1,3}), ?(\d{1,3})\)?(?:, ?(\d(?:\.\d*)?)\))?/);
|
|
@@ -528,8 +528,8 @@ class mintColor {
|
|
|
528
528
|
this.a = parseFloat(match[4]);
|
|
529
529
|
}
|
|
530
530
|
}
|
|
531
|
-
/**
|
|
532
|
-
* Returns the perceived brightness of the color
|
|
531
|
+
/**
|
|
532
|
+
* Returns the perceived brightness of the color
|
|
533
533
|
*/
|
|
534
534
|
getBrightness() {
|
|
535
535
|
if (this.a === 0) {
|
|
@@ -560,15 +560,15 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
560
560
|
value: true
|
|
561
561
|
}));
|
|
562
562
|
exports.mintItem = void 0;
|
|
563
|
-
/**
|
|
564
|
-
* A generic item
|
|
565
|
-
* @note - this class must be convertable with JSON
|
|
566
|
-
* - only add strings, numbers, booleans, arrays, and objects
|
|
563
|
+
/**
|
|
564
|
+
* A generic item
|
|
565
|
+
* @note - this class must be convertable with JSON
|
|
566
|
+
* - only add strings, numbers, booleans, arrays, and objects
|
|
567
567
|
*/
|
|
568
568
|
class mintItem {
|
|
569
569
|
constructor() {
|
|
570
|
-
/**
|
|
571
|
-
* Item settings
|
|
570
|
+
/**
|
|
571
|
+
* Item settings
|
|
572
572
|
*/
|
|
573
573
|
this.version = 0;
|
|
574
574
|
this.priority = 0;
|
|
@@ -581,15 +581,15 @@ class mintItem {
|
|
|
581
581
|
this.centered = false;
|
|
582
582
|
this.disabled = false;
|
|
583
583
|
this.private = false;
|
|
584
|
-
/**
|
|
585
|
-
* Item data
|
|
584
|
+
/**
|
|
585
|
+
* Item data
|
|
586
586
|
*/
|
|
587
587
|
this.attr = {};
|
|
588
588
|
this.params = {};
|
|
589
589
|
this.options = {};
|
|
590
590
|
this.lists = {};
|
|
591
|
-
/**
|
|
592
|
-
* Item lists
|
|
591
|
+
/**
|
|
592
|
+
* Item lists
|
|
593
593
|
*/
|
|
594
594
|
this.paragraphs = [];
|
|
595
595
|
this.classes = [];
|
|
@@ -616,8 +616,8 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
616
616
|
value: true
|
|
617
617
|
}));
|
|
618
618
|
exports.mintDisplay = void 0;
|
|
619
|
-
/**
|
|
620
|
-
* Handles the display of elements
|
|
619
|
+
/**
|
|
620
|
+
* Handles the display of elements
|
|
621
621
|
*/
|
|
622
622
|
class mintDisplay {}
|
|
623
623
|
exports.mintDisplay = mintDisplay;
|
|
@@ -638,8 +638,8 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
638
638
|
value: true
|
|
639
639
|
}));
|
|
640
640
|
exports.mintEvent = void 0;
|
|
641
|
-
/**
|
|
642
|
-
* Event helper functions
|
|
641
|
+
/**
|
|
642
|
+
* Event helper functions
|
|
643
643
|
*/
|
|
644
644
|
class mintEvent {}
|
|
645
645
|
exports.mintEvent = mintEvent;
|
|
@@ -665,16 +665,16 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
665
665
|
value: true
|
|
666
666
|
}));
|
|
667
667
|
exports.mintIcon = void 0;
|
|
668
|
-
/**
|
|
669
|
-
* Imports
|
|
668
|
+
/**
|
|
669
|
+
* Imports
|
|
670
670
|
*/
|
|
671
671
|
const object_1 = __importDefault(__webpack_require__(/*! ./object */ "./src/ts/imports/util/object.ts"));
|
|
672
|
-
/**
|
|
673
|
-
* Icon helper functions
|
|
672
|
+
/**
|
|
673
|
+
* Icon helper functions
|
|
674
674
|
*/
|
|
675
675
|
class mintIcon {
|
|
676
|
-
/**
|
|
677
|
-
* Appends the given icon to the given selector if there is not already an icon appended
|
|
676
|
+
/**
|
|
677
|
+
* Appends the given icon to the given selector if there is not already an icon appended
|
|
678
678
|
*/
|
|
679
679
|
static append(icon, selector) {
|
|
680
680
|
let items = document.querySelectorAll(selector);
|
|
@@ -689,9 +689,9 @@ class mintIcon {
|
|
|
689
689
|
}
|
|
690
690
|
});
|
|
691
691
|
}
|
|
692
|
-
/**
|
|
693
|
-
* Updates the icons
|
|
694
|
-
* @param icons - the icons to update
|
|
692
|
+
/**
|
|
693
|
+
* Updates the icons
|
|
694
|
+
* @param icons - the icons to update
|
|
695
695
|
*/
|
|
696
696
|
static update(icons) {
|
|
697
697
|
let activeIcons = object_1.default.removeValues(Object.assign(Object.assign({}, this.icons), icons), [false]);
|
|
@@ -699,9 +699,9 @@ class mintIcon {
|
|
|
699
699
|
this.append(activeIcons[selector], selector);
|
|
700
700
|
});
|
|
701
701
|
}
|
|
702
|
-
/**
|
|
703
|
-
* Removes the given icon from the given selector
|
|
704
|
-
* @param icon - the icon to remove
|
|
702
|
+
/**
|
|
703
|
+
* Removes the given icon from the given selector
|
|
704
|
+
* @param icon - the icon to remove
|
|
705
705
|
*/
|
|
706
706
|
static remove(icon, selector) {
|
|
707
707
|
let items = document.querySelectorAll(selector);
|
|
@@ -714,8 +714,8 @@ class mintIcon {
|
|
|
714
714
|
}
|
|
715
715
|
}
|
|
716
716
|
exports.mintIcon = mintIcon;
|
|
717
|
-
/**
|
|
718
|
-
* Default icons
|
|
717
|
+
/**
|
|
718
|
+
* Default icons
|
|
719
719
|
*/
|
|
720
720
|
mintIcon.icons = {
|
|
721
721
|
'a[href^="mailto:"]': 'far fa-envelope',
|
|
@@ -741,14 +741,14 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
741
741
|
value: true
|
|
742
742
|
}));
|
|
743
743
|
exports.mintList = void 0;
|
|
744
|
-
/**
|
|
745
|
-
* List functions for the util library
|
|
744
|
+
/**
|
|
745
|
+
* List functions for the util library
|
|
746
746
|
*/
|
|
747
747
|
class mintList {
|
|
748
|
-
/**
|
|
749
|
-
* Returns a copy of the provided list with the items in random order
|
|
750
|
-
* @param list - the list to shuffle
|
|
751
|
-
* @returns - the shuffled list
|
|
748
|
+
/**
|
|
749
|
+
* Returns a copy of the provided list with the items in random order
|
|
750
|
+
* @param list - the list to shuffle
|
|
751
|
+
* @returns - the shuffled list
|
|
752
752
|
*/
|
|
753
753
|
static shuffle(list) {
|
|
754
754
|
let copy = [...list];
|
|
@@ -777,15 +777,15 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
777
777
|
value: true
|
|
778
778
|
}));
|
|
779
779
|
exports.mintMath = void 0;
|
|
780
|
-
/**
|
|
781
|
-
* Math functions for the util library
|
|
780
|
+
/**
|
|
781
|
+
* Math functions for the util library
|
|
782
782
|
*/
|
|
783
783
|
class mintMath {
|
|
784
|
-
/**
|
|
785
|
-
* Get a random integer between min and max
|
|
786
|
-
* @param max Maximum value to return
|
|
787
|
-
* @param min Minimum value to return (default is 0)
|
|
788
|
-
* @returns a random integer between min and max
|
|
784
|
+
/**
|
|
785
|
+
* Get a random integer between min and max
|
|
786
|
+
* @param max Maximum value to return
|
|
787
|
+
* @param min Minimum value to return (default is 0)
|
|
788
|
+
* @returns a random integer between min and max
|
|
789
789
|
*/
|
|
790
790
|
static randomInt(max) {
|
|
791
791
|
let min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
@@ -812,12 +812,12 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
812
812
|
value: true
|
|
813
813
|
}));
|
|
814
814
|
exports.mintObject = void 0;
|
|
815
|
-
/**
|
|
816
|
-
* Object functions for the util library
|
|
815
|
+
/**
|
|
816
|
+
* Object functions for the util library
|
|
817
817
|
*/
|
|
818
818
|
class mintObject {
|
|
819
|
-
/**
|
|
820
|
-
* Returns true if the provided objects have the same entries
|
|
819
|
+
/**
|
|
820
|
+
* Returns true if the provided objects have the same entries
|
|
821
821
|
*/
|
|
822
822
|
static isSimilar(obj1, obj2) {
|
|
823
823
|
let keys = Object.keys(obj1);
|
|
@@ -832,13 +832,13 @@ class mintObject {
|
|
|
832
832
|
});
|
|
833
833
|
return isSimilar;
|
|
834
834
|
}
|
|
835
|
-
/**
|
|
836
|
-
* Returns true if the first object has at least the same
|
|
837
|
-
* entries as the second object
|
|
838
|
-
* @param superset - the object to check
|
|
839
|
-
* @param subset - the object whose entries are required
|
|
840
|
-
* @returns - true if the first object is a superset of the second
|
|
841
|
-
* @recursive
|
|
835
|
+
/**
|
|
836
|
+
* Returns true if the first object has at least the same
|
|
837
|
+
* entries as the second object
|
|
838
|
+
* @param superset - the object to check
|
|
839
|
+
* @param subset - the object whose entries are required
|
|
840
|
+
* @returns - true if the first object is a superset of the second
|
|
841
|
+
* @recursive
|
|
842
842
|
*/
|
|
843
843
|
static isSuperset(superset, subset) {
|
|
844
844
|
let isSuperset = true;
|
|
@@ -866,19 +866,19 @@ class mintObject {
|
|
|
866
866
|
});
|
|
867
867
|
return isSuperset;
|
|
868
868
|
}
|
|
869
|
-
/**
|
|
870
|
-
* Removes object entries by key
|
|
871
|
-
* @alias mintObject.removeKeys
|
|
872
|
-
* @param object - the object to remove entries from
|
|
873
|
-
* @param keys - the keys to remove
|
|
869
|
+
/**
|
|
870
|
+
* Removes object entries by key
|
|
871
|
+
* @alias mintObject.removeKeys
|
|
872
|
+
* @param object - the object to remove entries from
|
|
873
|
+
* @param keys - the keys to remove
|
|
874
874
|
*/
|
|
875
875
|
static remove(object, keys) {
|
|
876
876
|
return this.removeKeys(object, keys);
|
|
877
877
|
}
|
|
878
|
-
/**
|
|
879
|
-
* Removes object entries by key
|
|
880
|
-
* @param object - the object to remove entries from
|
|
881
|
-
* @param keys - the keys to remove
|
|
878
|
+
/**
|
|
879
|
+
* Removes object entries by key
|
|
880
|
+
* @param object - the object to remove entries from
|
|
881
|
+
* @param keys - the keys to remove
|
|
882
882
|
*/
|
|
883
883
|
static removeKeys(object, keys) {
|
|
884
884
|
return Object.keys(object).reduce((obj, key) => {
|
|
@@ -888,8 +888,8 @@ class mintObject {
|
|
|
888
888
|
return obj;
|
|
889
889
|
}, {});
|
|
890
890
|
}
|
|
891
|
-
/**
|
|
892
|
-
* Removes object entries by value
|
|
891
|
+
/**
|
|
892
|
+
* Removes object entries by value
|
|
893
893
|
*/
|
|
894
894
|
static removeValues(object, values) {
|
|
895
895
|
return Object.keys(object).reduce((obj, key) => {
|
|
@@ -899,8 +899,8 @@ class mintObject {
|
|
|
899
899
|
return obj;
|
|
900
900
|
}, {});
|
|
901
901
|
}
|
|
902
|
-
/**
|
|
903
|
-
* Sorts an object's entries alphabetically by key
|
|
902
|
+
/**
|
|
903
|
+
* Sorts an object's entries alphabetically by key
|
|
904
904
|
*/
|
|
905
905
|
static sort(object) {
|
|
906
906
|
return Object.keys(object).sort().reduce((obj, key) => {
|
|
@@ -908,17 +908,17 @@ class mintObject {
|
|
|
908
908
|
return obj;
|
|
909
909
|
}, {});
|
|
910
910
|
}
|
|
911
|
-
/**
|
|
912
|
-
* @alias mintObject.filterKeys
|
|
911
|
+
/**
|
|
912
|
+
* @alias mintObject.filterKeys
|
|
913
913
|
*/
|
|
914
914
|
static filter(object, keys) {
|
|
915
915
|
return this.filterKeys(object, keys);
|
|
916
916
|
}
|
|
917
|
-
/**
|
|
918
|
-
* Filters an object by its keys
|
|
919
|
-
* @param object - the object to filter
|
|
920
|
-
* @param keys - the keys to keep
|
|
921
|
-
* @returns - the filtered object
|
|
917
|
+
/**
|
|
918
|
+
* Filters an object by its keys
|
|
919
|
+
* @param object - the object to filter
|
|
920
|
+
* @param keys - the keys to keep
|
|
921
|
+
* @returns - the filtered object
|
|
922
922
|
*/
|
|
923
923
|
static filterKeys(object, keys) {
|
|
924
924
|
return keys.reduce((obj, key) => {
|
|
@@ -926,11 +926,11 @@ class mintObject {
|
|
|
926
926
|
return obj;
|
|
927
927
|
}, {});
|
|
928
928
|
}
|
|
929
|
-
/**
|
|
930
|
-
* Filters an object by its values
|
|
931
|
-
* @param object - the object to filter
|
|
932
|
-
* @param values - the values to keep
|
|
933
|
-
* @returns - the filtered object
|
|
929
|
+
/**
|
|
930
|
+
* Filters an object by its values
|
|
931
|
+
* @param object - the object to filter
|
|
932
|
+
* @param values - the values to keep
|
|
933
|
+
* @returns - the filtered object
|
|
934
934
|
*/
|
|
935
935
|
static filterValues(object, values) {
|
|
936
936
|
return Object.keys(object).reduce((obj, key) => {
|
|
@@ -940,11 +940,11 @@ class mintObject {
|
|
|
940
940
|
return obj;
|
|
941
941
|
}, {});
|
|
942
942
|
}
|
|
943
|
-
/**
|
|
944
|
-
* Update two sets of objects
|
|
945
|
-
* @param original - the original object
|
|
946
|
-
* @param update - the object to update the original with
|
|
947
|
-
* @returns - the original objects with updated data from the update
|
|
943
|
+
/**
|
|
944
|
+
* Update two sets of objects
|
|
945
|
+
* @param original - the original object
|
|
946
|
+
* @param update - the object to update the original with
|
|
947
|
+
* @returns - the original objects with updated data from the update
|
|
948
948
|
*/
|
|
949
949
|
static updateArray(original, update) {
|
|
950
950
|
let key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'id';
|
|
@@ -1002,24 +1002,24 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
1002
1002
|
value: true
|
|
1003
1003
|
}));
|
|
1004
1004
|
exports.mintScroll = void 0;
|
|
1005
|
-
/**
|
|
1006
|
-
* Scroll functions
|
|
1005
|
+
/**
|
|
1006
|
+
* Scroll functions
|
|
1007
1007
|
*/
|
|
1008
1008
|
class mintScroll {
|
|
1009
|
-
/**
|
|
1010
|
-
* Scroll to the top of the page
|
|
1009
|
+
/**
|
|
1010
|
+
* Scroll to the top of the page
|
|
1011
1011
|
*/
|
|
1012
1012
|
static toTop() {
|
|
1013
1013
|
window.scrollTo(0, 0);
|
|
1014
1014
|
}
|
|
1015
|
-
/**
|
|
1016
|
-
* Scroll to the bottom of the page
|
|
1015
|
+
/**
|
|
1016
|
+
* Scroll to the bottom of the page
|
|
1017
1017
|
*/
|
|
1018
1018
|
static toBottom() {
|
|
1019
1019
|
window.scrollTo(0, document.body.scrollHeight);
|
|
1020
1020
|
}
|
|
1021
|
-
/**
|
|
1022
|
-
* Show visible elements
|
|
1021
|
+
/**
|
|
1022
|
+
* Show visible elements
|
|
1023
1023
|
*/
|
|
1024
1024
|
static showElements() {
|
|
1025
1025
|
requestAnimationFrame(() => {
|
|
@@ -1059,80 +1059,80 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
1059
1059
|
value: true
|
|
1060
1060
|
}));
|
|
1061
1061
|
exports.mintSelectors = void 0;
|
|
1062
|
-
/**
|
|
1063
|
-
* CSS-selector helpers
|
|
1064
|
-
* @public
|
|
1062
|
+
/**
|
|
1063
|
+
* CSS-selector helpers
|
|
1064
|
+
* @public
|
|
1065
1065
|
*/
|
|
1066
1066
|
class mintSelectors {
|
|
1067
|
-
/**
|
|
1068
|
-
* Adds the library prefix to the beginning of the provided string
|
|
1069
|
-
* @param base - the string to be prefixed
|
|
1070
|
-
* @returns - the provided string prefixed with the library name
|
|
1067
|
+
/**
|
|
1068
|
+
* Adds the library prefix to the beginning of the provided string
|
|
1069
|
+
* @param base - the string to be prefixed
|
|
1070
|
+
* @returns - the provided string prefixed with the library name
|
|
1071
1071
|
*/
|
|
1072
1072
|
static prefix(base) {
|
|
1073
1073
|
base = base.toLowerCase();
|
|
1074
1074
|
return base.startsWith(this.pre) ? base : `${this.pre}${base}`;
|
|
1075
1075
|
}
|
|
1076
|
-
/**
|
|
1077
|
-
* Adds two dashes to the beginning of the provided string
|
|
1078
|
-
* @param base - the string to be prefixed
|
|
1079
|
-
* @returns - the provided string prefixed with two dashes
|
|
1076
|
+
/**
|
|
1077
|
+
* Adds two dashes to the beginning of the provided string
|
|
1078
|
+
* @param base - the string to be prefixed
|
|
1079
|
+
* @returns - the provided string prefixed with two dashes
|
|
1080
1080
|
*/
|
|
1081
1081
|
static cssPrefix(base) {
|
|
1082
1082
|
return `--${this.prefix(base.replace(/^-+/, ''))}`;
|
|
1083
1083
|
}
|
|
1084
|
-
/**
|
|
1085
|
-
* Turns the provided string into a CSS variable call
|
|
1086
|
-
* @param base - the name of the CSS variable to call
|
|
1087
|
-
* @returns - the CSS variable call for the provided string
|
|
1084
|
+
/**
|
|
1085
|
+
* Turns the provided string into a CSS variable call
|
|
1086
|
+
* @param base - the name of the CSS variable to call
|
|
1087
|
+
* @returns - the CSS variable call for the provided string
|
|
1088
1088
|
*/
|
|
1089
1089
|
static cssVar(base) {
|
|
1090
1090
|
return `var(${this.cssPrefix(base)})`;
|
|
1091
1091
|
}
|
|
1092
|
-
/**
|
|
1093
|
-
* Negates the provided CSS selector
|
|
1094
|
-
* @param base - the CSS selector to negate
|
|
1095
|
-
* @returns - the negated CSS selector
|
|
1092
|
+
/**
|
|
1093
|
+
* Negates the provided CSS selector
|
|
1094
|
+
* @param base - the CSS selector to negate
|
|
1095
|
+
* @returns - the negated CSS selector
|
|
1096
1096
|
*/
|
|
1097
1097
|
static neg(base) {
|
|
1098
1098
|
return `:not(${base})`;
|
|
1099
1099
|
}
|
|
1100
|
-
/**
|
|
1101
|
-
* Generates a class CSS selector
|
|
1102
|
-
* @param base - the name of the class to generate
|
|
1103
|
-
* @returns - the generated CSS selector
|
|
1100
|
+
/**
|
|
1101
|
+
* Generates a class CSS selector
|
|
1102
|
+
* @param base - the name of the class to generate
|
|
1103
|
+
* @returns - the generated CSS selector
|
|
1104
1104
|
*/
|
|
1105
1105
|
static class(base) {
|
|
1106
1106
|
return `.${this.prefix(base)}`;
|
|
1107
1107
|
}
|
|
1108
|
-
/**
|
|
1109
|
-
* Generates an id CSS selector
|
|
1110
|
-
* @param base - the name of the id to generate
|
|
1111
|
-
* @returns - the generated CSS selector
|
|
1108
|
+
/**
|
|
1109
|
+
* Generates an id CSS selector
|
|
1110
|
+
* @param base - the name of the id to generate
|
|
1111
|
+
* @returns - the generated CSS selector
|
|
1112
1112
|
*/
|
|
1113
1113
|
static id(base) {
|
|
1114
1114
|
return `#${this.prefix(base)}`;
|
|
1115
1115
|
}
|
|
1116
|
-
/**
|
|
1117
|
-
* Generates an aria-controls CSS selector
|
|
1118
|
-
* @param id - the id of the controlled element
|
|
1119
|
-
* @returns - the generated CSS selector
|
|
1116
|
+
/**
|
|
1117
|
+
* Generates an aria-controls CSS selector
|
|
1118
|
+
* @param id - the id of the controlled element
|
|
1119
|
+
* @returns - the generated CSS selector
|
|
1120
1120
|
*/
|
|
1121
1121
|
static controls(id) {
|
|
1122
1122
|
return id ? `[aria-controls="${this.prefix(id)}"]` : this.hasControls;
|
|
1123
1123
|
}
|
|
1124
|
-
/**
|
|
1125
|
-
* Generates an aria-expanded CSS selector
|
|
1126
|
-
* @param bool - whether the element is expanded or not
|
|
1127
|
-
* @returns - the generated CSS selector
|
|
1124
|
+
/**
|
|
1125
|
+
* Generates an aria-expanded CSS selector
|
|
1126
|
+
* @param bool - whether the element is expanded or not
|
|
1127
|
+
* @returns - the generated CSS selector
|
|
1128
1128
|
*/
|
|
1129
1129
|
static expanded(bool) {
|
|
1130
1130
|
return typeof bool === 'boolean' ? `[aria-expanded="${bool}"]` : this.hasExpanded;
|
|
1131
1131
|
}
|
|
1132
|
-
/**
|
|
1133
|
-
* Returns a NodeList of HTMLElements within the given element that are focusable
|
|
1134
|
-
* @param el - the element whose focusable children will be returned
|
|
1135
|
-
* @returns - the elements within the given element that are focusable
|
|
1132
|
+
/**
|
|
1133
|
+
* Returns a NodeList of HTMLElements within the given element that are focusable
|
|
1134
|
+
* @param el - the element whose focusable children will be returned
|
|
1135
|
+
* @returns - the elements within the given element that are focusable
|
|
1136
1136
|
*/
|
|
1137
1137
|
static getFocusables(el) {
|
|
1138
1138
|
let focusables;
|
|
@@ -1143,12 +1143,12 @@ class mintSelectors {
|
|
|
1143
1143
|
}
|
|
1144
1144
|
return focusables.filter(el => this.isFocusable(el));
|
|
1145
1145
|
}
|
|
1146
|
-
/**
|
|
1147
|
-
* Returns true if an element is focusable and false if not,
|
|
1148
|
-
* based on styles (i.e. a parent has display: none;)
|
|
1149
|
-
* NOTE: Still need to determine what other styles may make an element un-focusable
|
|
1150
|
-
* @param el - the element
|
|
1151
|
-
* @returns - true if the element is focusable; false if not
|
|
1146
|
+
/**
|
|
1147
|
+
* Returns true if an element is focusable and false if not,
|
|
1148
|
+
* based on styles (i.e. a parent has display: none;)
|
|
1149
|
+
* NOTE: Still need to determine what other styles may make an element un-focusable
|
|
1150
|
+
* @param el - the element
|
|
1151
|
+
* @returns - true if the element is focusable; false if not
|
|
1152
1152
|
*/
|
|
1153
1153
|
static isFocusable(el) {
|
|
1154
1154
|
let current = el;
|
|
@@ -1163,48 +1163,48 @@ class mintSelectors {
|
|
|
1163
1163
|
}
|
|
1164
1164
|
exports.mintSelectors = mintSelectors;
|
|
1165
1165
|
_a = mintSelectors;
|
|
1166
|
-
/**
|
|
1167
|
-
* The library name that will be added as a prefix
|
|
1166
|
+
/**
|
|
1167
|
+
* The library name that will be added as a prefix
|
|
1168
1168
|
*/
|
|
1169
1169
|
mintSelectors.lib = 'mint';
|
|
1170
|
-
/**
|
|
1171
|
-
* The prefix built from the library name
|
|
1170
|
+
/**
|
|
1171
|
+
* The prefix built from the library name
|
|
1172
1172
|
*/
|
|
1173
1173
|
mintSelectors.pre = `${_a.lib}-`;
|
|
1174
|
-
/**
|
|
1175
|
-
* CSS-selector for disabled elements
|
|
1174
|
+
/**
|
|
1175
|
+
* CSS-selector for disabled elements
|
|
1176
1176
|
*/
|
|
1177
1177
|
mintSelectors.disabled = '[disabled]';
|
|
1178
|
-
/**
|
|
1179
|
-
* CSS-selector for elements with an aria-controls attribute
|
|
1178
|
+
/**
|
|
1179
|
+
* CSS-selector for elements with an aria-controls attribute
|
|
1180
1180
|
*/
|
|
1181
1181
|
mintSelectors.hasControls = '[aria-controls]';
|
|
1182
|
-
/**
|
|
1183
|
-
* CSS-selector for elements with an aria-expanded attribute
|
|
1182
|
+
/**
|
|
1183
|
+
* CSS-selector for elements with an aria-expanded attribute
|
|
1184
1184
|
*/
|
|
1185
1185
|
mintSelectors.hasExpanded = '[aria-expanded]';
|
|
1186
|
-
/**
|
|
1187
|
-
* CSS-selector for elements with an href attribute
|
|
1186
|
+
/**
|
|
1187
|
+
* CSS-selector for elements with an href attribute
|
|
1188
1188
|
*/
|
|
1189
1189
|
mintSelectors.hasLink = '[href]';
|
|
1190
|
-
/**
|
|
1191
|
-
* CSS-selector for elements with a routerLink attribute
|
|
1190
|
+
/**
|
|
1191
|
+
* CSS-selector for elements with a routerLink attribute
|
|
1192
1192
|
*/
|
|
1193
1193
|
mintSelectors.hasRouterLink = '[routerLink]';
|
|
1194
|
-
/**
|
|
1195
|
-
* CSS-selector for elements with an id attribute
|
|
1194
|
+
/**
|
|
1195
|
+
* CSS-selector for elements with an id attribute
|
|
1196
1196
|
*/
|
|
1197
1197
|
mintSelectors.hasId = '[id]';
|
|
1198
|
-
/**
|
|
1199
|
-
* CSS-selector for elements that aren't tabbable (i.e. tabindex is negative)
|
|
1198
|
+
/**
|
|
1199
|
+
* CSS-selector for elements that aren't tabbable (i.e. tabindex is negative)
|
|
1200
1200
|
*/
|
|
1201
1201
|
mintSelectors.notTabbable = '[tabindex^="-"]';
|
|
1202
|
-
/**
|
|
1203
|
-
* CSS-selector for elements that are tabbable (i.e. tabindex isn't negative)
|
|
1202
|
+
/**
|
|
1203
|
+
* CSS-selector for elements that are tabbable (i.e. tabindex isn't negative)
|
|
1204
1204
|
*/
|
|
1205
1205
|
mintSelectors.tabbable = `[tabindex]${_a.neg(_a.notTabbable)}`;
|
|
1206
|
-
/**
|
|
1207
|
-
* CSS-selector for elements that can receive focus
|
|
1206
|
+
/**
|
|
1207
|
+
* CSS-selector for elements that can receive focus
|
|
1208
1208
|
*/
|
|
1209
1209
|
mintSelectors.focusable = `input${_a.neg(_a.disabled)}${_a.neg(_a.notTabbable)},
|
|
1210
1210
|
select${_a.neg(_a.disabled)}${_a.neg(_a.notTabbable)},
|
|
@@ -1214,12 +1214,12 @@ mintSelectors.focusable = `input${_a.neg(_a.disabled)}${_a.neg(_a.notTabbable)},
|
|
|
1214
1214
|
a${_a.hasLink}, a${_a.hasRouterLink},
|
|
1215
1215
|
area${_a.hasLink},
|
|
1216
1216
|
${_a.tabbable}`.replace(/\s/g, '');
|
|
1217
|
-
/**
|
|
1218
|
-
* CSS-selector for submenu buttons
|
|
1217
|
+
/**
|
|
1218
|
+
* CSS-selector for submenu buttons
|
|
1219
1219
|
*/
|
|
1220
1220
|
mintSelectors.subMenuButtons = `button${_a.hasControls}`;
|
|
1221
|
-
/**
|
|
1222
|
-
* CSS-selector for submenus
|
|
1221
|
+
/**
|
|
1222
|
+
* CSS-selector for submenus
|
|
1223
1223
|
*/
|
|
1224
1224
|
mintSelectors.subMenu = `${_a.subMenuButtons} + ul${_a.hasId}`;
|
|
1225
1225
|
exports["default"] = mintSelectors;
|
|
@@ -1239,14 +1239,14 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
1239
1239
|
value: true
|
|
1240
1240
|
}));
|
|
1241
1241
|
exports.mintSettings = void 0;
|
|
1242
|
-
/**
|
|
1243
|
-
* Settings management
|
|
1244
|
-
* @public
|
|
1242
|
+
/**
|
|
1243
|
+
* Settings management
|
|
1244
|
+
* @public
|
|
1245
1245
|
*/
|
|
1246
1246
|
class mintSettings {
|
|
1247
|
-
/**
|
|
1248
|
-
* Update the provided settings variables
|
|
1249
|
-
* @param settings - Object of settings variables to update
|
|
1247
|
+
/**
|
|
1248
|
+
* Update the provided settings variables
|
|
1249
|
+
* @param settings - Object of settings variables to update
|
|
1250
1250
|
*/
|
|
1251
1251
|
static set(settings) {
|
|
1252
1252
|
let newDelay = false;
|
|
@@ -1272,8 +1272,8 @@ class mintSettings {
|
|
|
1272
1272
|
}
|
|
1273
1273
|
}
|
|
1274
1274
|
}
|
|
1275
|
-
/**
|
|
1276
|
-
* Updates the delay variables based on `this.delayBase` and `this.delayStep`
|
|
1275
|
+
/**
|
|
1276
|
+
* Updates the delay variables based on `this.delayBase` and `this.delayStep`
|
|
1277
1277
|
*/
|
|
1278
1278
|
static setDelay() {
|
|
1279
1279
|
this.delay = {
|
|
@@ -1288,16 +1288,16 @@ class mintSettings {
|
|
|
1288
1288
|
}
|
|
1289
1289
|
exports.mintSettings = mintSettings;
|
|
1290
1290
|
_a = mintSettings;
|
|
1291
|
-
/**
|
|
1292
|
-
* Value added to all delay variables
|
|
1291
|
+
/**
|
|
1292
|
+
* Value added to all delay variables
|
|
1293
1293
|
*/
|
|
1294
1294
|
mintSettings.delayBase = 0;
|
|
1295
|
-
/**
|
|
1296
|
-
* Value multiplied by delay variable index
|
|
1295
|
+
/**
|
|
1296
|
+
* Value multiplied by delay variable index
|
|
1297
1297
|
*/
|
|
1298
1298
|
mintSettings.delayStep = 100;
|
|
1299
|
-
/**
|
|
1300
|
-
* Delay variables
|
|
1299
|
+
/**
|
|
1300
|
+
* Delay variables
|
|
1301
1301
|
*/
|
|
1302
1302
|
mintSettings.delay = {
|
|
1303
1303
|
instant: _a.delayBase + _a.delayStep * 0,
|
|
@@ -1307,8 +1307,8 @@ mintSettings.delay = {
|
|
|
1307
1307
|
medSlow: _a.delayBase + _a.delayStep * 4,
|
|
1308
1308
|
slow: _a.delayBase + _a.delayStep * 5
|
|
1309
1309
|
};
|
|
1310
|
-
/**
|
|
1311
|
-
* Breakpoint variables
|
|
1310
|
+
/**
|
|
1311
|
+
* Breakpoint variables
|
|
1312
1312
|
*/
|
|
1313
1313
|
mintSettings.break = {
|
|
1314
1314
|
z: 0,
|
|
@@ -1335,31 +1335,31 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
1335
1335
|
value: true
|
|
1336
1336
|
}));
|
|
1337
1337
|
exports.mintText = void 0;
|
|
1338
|
-
/**
|
|
1339
|
-
* Functions for analyzing and manipulating text.
|
|
1338
|
+
/**
|
|
1339
|
+
* Functions for analyzing and manipulating text.
|
|
1340
1340
|
*/
|
|
1341
1341
|
class mintText {
|
|
1342
|
-
/*static fitContainer () {
|
|
1343
|
-
let $warning: JQuery<HTMLElement> = $(warningSelector);
|
|
1344
|
-
$warning.css({
|
|
1345
|
-
overflow: 'scroll',
|
|
1346
|
-
fontSize: ''
|
|
1347
|
-
});
|
|
1348
|
-
while (($warning?.[0].scrollHeight ?? Number.MIN_SAFE_INTEGER) > ($warning?.innerHeight() ?? Number.MAX_SAFE_INTEGER)) {
|
|
1349
|
-
let fontSize: number = parseInt($warning.css('font-size')) - 1;
|
|
1350
|
-
$warning.css('font-size', fontSize + 'px');
|
|
1351
|
-
}
|
|
1342
|
+
/*static fitContainer () {
|
|
1343
|
+
let $warning: JQuery<HTMLElement> = $(warningSelector);
|
|
1344
|
+
$warning.css({
|
|
1345
|
+
overflow: 'scroll',
|
|
1346
|
+
fontSize: ''
|
|
1347
|
+
});
|
|
1348
|
+
while (($warning?.[0].scrollHeight ?? Number.MIN_SAFE_INTEGER) > ($warning?.innerHeight() ?? Number.MAX_SAFE_INTEGER)) {
|
|
1349
|
+
let fontSize: number = parseInt($warning.css('font-size')) - 1;
|
|
1350
|
+
$warning.css('font-size', fontSize + 'px');
|
|
1351
|
+
}
|
|
1352
1352
|
}*/
|
|
1353
|
-
/**
|
|
1354
|
-
* Generate a slug from a string
|
|
1355
|
-
* @param str - The string to slugify
|
|
1356
|
-
* @returns The slugified string
|
|
1353
|
+
/**
|
|
1354
|
+
* Generate a slug from a string
|
|
1355
|
+
* @param str - The string to slugify
|
|
1356
|
+
* @returns The slugified string
|
|
1357
1357
|
*/
|
|
1358
1358
|
static slug(str) {
|
|
1359
1359
|
return str.toLowerCase().replace(/\W+/g, '-').replace(/^-+|-+$/g, '');
|
|
1360
1360
|
}
|
|
1361
|
-
/**
|
|
1362
|
-
* Pluralize the given word
|
|
1361
|
+
/**
|
|
1362
|
+
* Pluralize the given word
|
|
1363
1363
|
*/
|
|
1364
1364
|
static pluralize(word) {
|
|
1365
1365
|
if (word.endsWith('ies') || word.endsWith('es') || word.endsWith('s') && !word.endsWith('us') && !word.endsWith('is') && !word.endsWith('ss')) {
|
|
@@ -1392,8 +1392,8 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
1392
1392
|
value: true
|
|
1393
1393
|
}));
|
|
1394
1394
|
exports.mintWindow = void 0;
|
|
1395
|
-
/**
|
|
1396
|
-
* Functions related to the browser window.
|
|
1395
|
+
/**
|
|
1396
|
+
* Functions related to the browser window.
|
|
1397
1397
|
*/
|
|
1398
1398
|
class mintWindow {}
|
|
1399
1399
|
exports.mintWindow = mintWindow;
|
|
@@ -1410,10 +1410,10 @@ exports["default"] = mintWindow;
|
|
|
1410
1410
|
|
|
1411
1411
|
|
|
1412
1412
|
|
|
1413
|
-
/**
|
|
1414
|
-
* A library for building responsive web applications.
|
|
1415
|
-
*
|
|
1416
|
-
* @packageDocumentation
|
|
1413
|
+
/**
|
|
1414
|
+
* A library for building responsive web applications.
|
|
1415
|
+
*
|
|
1416
|
+
* @packageDocumentation
|
|
1417
1417
|
*/
|
|
1418
1418
|
var __importDefault = this && this.__importDefault || function (mod) {
|
|
1419
1419
|
return mod && mod.__esModule ? mod : {
|
|
@@ -1424,8 +1424,8 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
1424
1424
|
value: true
|
|
1425
1425
|
}));
|
|
1426
1426
|
exports["default"] = exports.mintUtil = exports.mintSettings = exports.mintSelectors = exports.mintWindow = exports.mintText = exports.mintScroll = exports.mintObject = exports.mintMath = exports.mintList = exports.mintIcon = exports.mintEvent = exports.mintDisplay = exports.mintItem = exports.mintColor = exports.mintHeader = exports.mintSide = void 0;
|
|
1427
|
-
/**
|
|
1428
|
-
* Exports
|
|
1427
|
+
/**
|
|
1428
|
+
* Exports
|
|
1429
1429
|
*/
|
|
1430
1430
|
// Enums
|
|
1431
1431
|
var enum_1 = __webpack_require__(/*! ./imports/enum */ "./src/ts/imports/enum.ts");
|
|
@@ -1570,29 +1570,29 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
1570
1570
|
value: true
|
|
1571
1571
|
}));
|
|
1572
1572
|
exports.mintUtil = void 0;
|
|
1573
|
-
/**
|
|
1574
|
-
* Imports
|
|
1573
|
+
/**
|
|
1574
|
+
* Imports
|
|
1575
1575
|
*/
|
|
1576
1576
|
const enum_1 = __webpack_require__(/*! ./imports/enum */ "./src/ts/imports/enum.ts");
|
|
1577
1577
|
const settings_1 = __importDefault(__webpack_require__(/*! ./imports/util/settings */ "./src/ts/imports/util/settings.ts"));
|
|
1578
|
-
/**
|
|
1579
|
-
* Utility functions
|
|
1580
|
-
* @public
|
|
1578
|
+
/**
|
|
1579
|
+
* Utility functions
|
|
1580
|
+
* @public
|
|
1581
1581
|
*/
|
|
1582
1582
|
class mintUtil {
|
|
1583
|
-
/**
|
|
1584
|
-
* Returns the width of the window, including fractional pixels
|
|
1585
|
-
* @returns the width of the window
|
|
1583
|
+
/**
|
|
1584
|
+
* Returns the width of the window, including fractional pixels
|
|
1585
|
+
* @returns the width of the window
|
|
1586
1586
|
*/
|
|
1587
1587
|
static windowWidth() {
|
|
1588
1588
|
const decimal = document.body.getBoundingClientRect().width % 1;
|
|
1589
1589
|
return window.innerWidth + decimal;
|
|
1590
1590
|
}
|
|
1591
|
-
/**
|
|
1592
|
-
* Ensures that a function `func` is run only after not being called for `wait` milliseconds
|
|
1593
|
-
* @param func - the function to debounce
|
|
1594
|
-
* @param wait - the amount of time to wait before running the function
|
|
1595
|
-
* @returns - the debounced function
|
|
1591
|
+
/**
|
|
1592
|
+
* Ensures that a function `func` is run only after not being called for `wait` milliseconds
|
|
1593
|
+
* @param func - the function to debounce
|
|
1594
|
+
* @param wait - the amount of time to wait before running the function
|
|
1595
|
+
* @returns - the debounced function
|
|
1596
1596
|
*/
|
|
1597
1597
|
static debounce(func) {
|
|
1598
1598
|
let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
|
|
@@ -1604,22 +1604,22 @@ class mintUtil {
|
|
|
1604
1604
|
timer = setTimeout(func, wait, e);
|
|
1605
1605
|
};
|
|
1606
1606
|
}
|
|
1607
|
-
/**
|
|
1608
|
-
* Ensures that a function `func` is run only after not being called for `wait` milliseconds
|
|
1609
|
-
* @param func - the function to debounce
|
|
1610
|
-
* @param wait - the amount of time to wait before running the function
|
|
1611
|
-
* @returns - the debounced function as an EventListener
|
|
1607
|
+
/**
|
|
1608
|
+
* Ensures that a function `func` is run only after not being called for `wait` milliseconds
|
|
1609
|
+
* @param func - the function to debounce
|
|
1610
|
+
* @param wait - the amount of time to wait before running the function
|
|
1611
|
+
* @returns - the debounced function as an EventListener
|
|
1612
1612
|
*/
|
|
1613
1613
|
static debounceEvent(func) {
|
|
1614
1614
|
let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
|
|
1615
1615
|
return mintUtil.debounce(func, wait);
|
|
1616
1616
|
}
|
|
1617
|
-
/**
|
|
1618
|
-
* Ensures that a function `func` is called at most every `wait` milliseconds with optional leading and trailing calls
|
|
1619
|
-
* @param func - the function to throttle
|
|
1620
|
-
* @param wait - the amount of time between function calls
|
|
1621
|
-
* @param options - leading and trailing options: default = \{ leading: true, trailing, true \}
|
|
1622
|
-
* @returns - the throttled function
|
|
1617
|
+
/**
|
|
1618
|
+
* Ensures that a function `func` is called at most every `wait` milliseconds with optional leading and trailing calls
|
|
1619
|
+
* @param func - the function to throttle
|
|
1620
|
+
* @param wait - the amount of time between function calls
|
|
1621
|
+
* @param options - leading and trailing options: default = \{ leading: true, trailing, true \}
|
|
1622
|
+
* @returns - the throttled function
|
|
1623
1623
|
*/
|
|
1624
1624
|
static throttle(func) {
|
|
1625
1625
|
let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
|
|
@@ -1662,23 +1662,23 @@ class mintUtil {
|
|
|
1662
1662
|
};
|
|
1663
1663
|
return throttled;
|
|
1664
1664
|
}
|
|
1665
|
-
/**
|
|
1666
|
-
* Ensures that a function `func` is called at most every `wait` milliseconds with optional leading and trailing calls
|
|
1667
|
-
* @param func - the function to throttle
|
|
1668
|
-
* @param wait - the amount of time between function calls
|
|
1669
|
-
* @param options - leading and trailing options: default = \{ leading: true, trailing, true \}
|
|
1670
|
-
* @returns - the throttled function as an EventListener
|
|
1665
|
+
/**
|
|
1666
|
+
* Ensures that a function `func` is called at most every `wait` milliseconds with optional leading and trailing calls
|
|
1667
|
+
* @param func - the function to throttle
|
|
1668
|
+
* @param wait - the amount of time between function calls
|
|
1669
|
+
* @param options - leading and trailing options: default = \{ leading: true, trailing, true \}
|
|
1670
|
+
* @returns - the throttled function as an EventListener
|
|
1671
1671
|
*/
|
|
1672
1672
|
static throttleEvent(func) {
|
|
1673
1673
|
let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
|
|
1674
1674
|
let options = arguments.length > 2 ? arguments[2] : undefined;
|
|
1675
1675
|
return mintUtil.throttle(func, wait, options);
|
|
1676
1676
|
}
|
|
1677
|
-
/**
|
|
1678
|
-
* Sets the element's height to its `innerHeight`, then to `auto` after a delay
|
|
1679
|
-
* @param el - the element whose height will be set
|
|
1680
|
-
* @param delay - the amount of time in milliseconds that the show animation will be active
|
|
1681
|
-
* @param from - the side that the element is animating from
|
|
1677
|
+
/**
|
|
1678
|
+
* Sets the element's height to its `innerHeight`, then to `auto` after a delay
|
|
1679
|
+
* @param el - the element whose height will be set
|
|
1680
|
+
* @param delay - the amount of time in milliseconds that the show animation will be active
|
|
1681
|
+
* @param from - the side that the element is animating from
|
|
1682
1682
|
*/
|
|
1683
1683
|
static show(el) {
|
|
1684
1684
|
let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
|
|
@@ -1701,11 +1701,11 @@ class mintUtil {
|
|
|
1701
1701
|
});
|
|
1702
1702
|
}
|
|
1703
1703
|
}
|
|
1704
|
-
/**
|
|
1705
|
-
* Sets the element's height to 0
|
|
1706
|
-
* @param el - the element whose height will be set
|
|
1707
|
-
* @param delay - the amount of time in milliseconds that the show animation will be active
|
|
1708
|
-
* @param from - the side that the element is animating from
|
|
1704
|
+
/**
|
|
1705
|
+
* Sets the element's height to 0
|
|
1706
|
+
* @param el - the element whose height will be set
|
|
1707
|
+
* @param delay - the amount of time in milliseconds that the show animation will be active
|
|
1708
|
+
* @param from - the side that the element is animating from
|
|
1709
1709
|
*/
|
|
1710
1710
|
static hide(el) {
|
|
1711
1711
|
let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
|
|
@@ -1735,10 +1735,10 @@ class mintUtil {
|
|
|
1735
1735
|
}, delay);
|
|
1736
1736
|
}
|
|
1737
1737
|
}
|
|
1738
|
-
/**
|
|
1739
|
-
* Copies the provided text to the clipboard
|
|
1740
|
-
* @param text - the text to copy
|
|
1741
|
-
* @returns - true if the text was successfully copied to the clipboard; else false
|
|
1738
|
+
/**
|
|
1739
|
+
* Copies the provided text to the clipboard
|
|
1740
|
+
* @param text - the text to copy
|
|
1741
|
+
* @returns - true if the text was successfully copied to the clipboard; else false
|
|
1742
1742
|
*/
|
|
1743
1743
|
static copyText(text) {
|
|
1744
1744
|
let textArea = document.createElement('textarea');
|
|
@@ -1761,11 +1761,11 @@ class mintUtil {
|
|
|
1761
1761
|
document.body.removeChild(textArea);
|
|
1762
1762
|
return true;
|
|
1763
1763
|
}
|
|
1764
|
-
/**
|
|
1765
|
-
* Tests the validity of an email address
|
|
1766
|
-
* @see {@link https://stackoverflow.com/questions/201323/how-can-i-validate-an-email-address-using-a-regular-expression}
|
|
1767
|
-
* @param text - the string to test
|
|
1768
|
-
* @returns - true if the given string is an email address; false if not
|
|
1764
|
+
/**
|
|
1765
|
+
* Tests the validity of an email address
|
|
1766
|
+
* @see {@link https://stackoverflow.com/questions/201323/how-can-i-validate-an-email-address-using-a-regular-expression}
|
|
1767
|
+
* @param text - the string to test
|
|
1768
|
+
* @returns - true if the given string is an email address; false if not
|
|
1769
1769
|
*/
|
|
1770
1770
|
static isEmail(text) {
|
|
1771
1771
|
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])+)\])/);
|