@appartmint/mint 0.13.3 → 0.14.0
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 +55 -9
- 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 -122
- package/dist/js/imports/components/header.d.ts.map +1 -1
- 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 +58 -58
- package/dist/js/imports/util/selectors.d.ts +121 -145
- package/dist/js/imports/util/selectors.d.ts.map +1 -1
- package/dist/js/imports/util/settings.d.ts +38 -52
- package/dist/js/imports/util/settings.d.ts.map +1 -1
- 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 +23 -23
- package/dist/js/index.js +381 -422
- package/dist/js/index.js.map +1 -1
- package/dist/js/index.min.js +1 -1
- package/dist/js/index.min.js.map +1 -1
- package/dist/js/util.d.ts +77 -77
- package/dist/js/util.js +81 -325
- package/dist/js/util.js.map +1 -1
- package/dist/js/util.min.js +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/_cards.scss +12 -1
- package/src/scss/imports/components/_embed.scss +75 -63
- package/src/scss/imports/components/_header.scss +60 -13
- package/src/scss/imports/components/_index.scss +7 -7
- package/src/scss/imports/global/_aspect.scss +1 -1
- package/src/scss/imports/global/_icons.scss +6 -6
- package/src/scss/imports/global/_structure.scss +2 -1
- package/src/scss/imports/global/_texture.scss +27 -2
- package/src/scss/imports/util/_index.scss +8 -8
- package/src/scss/imports/util/_vars.scss +8 -0
- package/src/ts/imports/components/header.ts +60 -35
- 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/selectors.ts +0 -45
- package/src/ts/imports/util/settings.ts +13 -47
- package/src/ts/imports/util/window.ts +6 -6
- package/src/ts/index.ts +33 -33
package/dist/js/util.js
CHANGED
|
@@ -24,8 +24,8 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
24
24
|
value: true
|
|
25
25
|
}));
|
|
26
26
|
exports.mintSide = void 0;
|
|
27
|
-
/**
|
|
28
|
-
* Side Enum
|
|
27
|
+
/**
|
|
28
|
+
* Side Enum
|
|
29
29
|
*/
|
|
30
30
|
var mintSide;
|
|
31
31
|
(function (mintSide) {
|
|
@@ -38,234 +38,11 @@ var mintSide;
|
|
|
38
38
|
|
|
39
39
|
/***/ }),
|
|
40
40
|
|
|
41
|
-
/***/ "./src/ts/imports/util/selectors.ts":
|
|
42
|
-
/*!******************************************!*\
|
|
43
|
-
!*** ./src/ts/imports/util/selectors.ts ***!
|
|
44
|
-
\******************************************/
|
|
45
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
var _a;
|
|
50
|
-
Object.defineProperty(exports, "__esModule", ({
|
|
51
|
-
value: true
|
|
52
|
-
}));
|
|
53
|
-
exports.mintSelectors = void 0;
|
|
54
|
-
/**
|
|
55
|
-
* CSS-selector helpers
|
|
56
|
-
* @public
|
|
57
|
-
*/
|
|
58
|
-
class mintSelectors {
|
|
59
|
-
/**
|
|
60
|
-
* Adds the library prefix to the beginning of the provided string
|
|
61
|
-
* @param base - the string to be prefixed
|
|
62
|
-
* @returns - the provided string prefixed with the library name
|
|
63
|
-
*/
|
|
64
|
-
static prefix(base) {
|
|
65
|
-
base = base.toLowerCase();
|
|
66
|
-
return base.startsWith(this.pre) ? base : `${this.pre}${base}`;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Adds two dashes to the beginning of the provided string
|
|
70
|
-
* @param base - the string to be prefixed
|
|
71
|
-
* @returns - the provided string prefixed with two dashes
|
|
72
|
-
*/
|
|
73
|
-
static cssPrefix(base) {
|
|
74
|
-
return `--${this.prefix(base.replace(/^-+/, ''))}`;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Turns the provided string into a CSS variable call
|
|
78
|
-
* @param base - the name of the CSS variable to call
|
|
79
|
-
* @returns - the CSS variable call for the provided string
|
|
80
|
-
*/
|
|
81
|
-
static cssVar(base) {
|
|
82
|
-
return `var(${this.cssPrefix(base)})`;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Negates the provided CSS selector
|
|
86
|
-
* @param base - the CSS selector to negate
|
|
87
|
-
* @returns - the negated CSS selector
|
|
88
|
-
*/
|
|
89
|
-
static neg(base) {
|
|
90
|
-
return `:not(${base})`;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Generates a class CSS selector
|
|
94
|
-
* @param base - the name of the class to generate
|
|
95
|
-
* @returns - the generated CSS selector
|
|
96
|
-
*/
|
|
97
|
-
static class(base) {
|
|
98
|
-
return `.${this.prefix(base)}`;
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Generates an id CSS selector
|
|
102
|
-
* @param base - the name of the id to generate
|
|
103
|
-
* @returns - the generated CSS selector
|
|
104
|
-
*/
|
|
105
|
-
static id(base) {
|
|
106
|
-
return `#${this.prefix(base)}`;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Generates an aria-controls CSS selector
|
|
110
|
-
* @param id - the id of the controlled element
|
|
111
|
-
* @returns - the generated CSS selector
|
|
112
|
-
*/
|
|
113
|
-
static controls(id) {
|
|
114
|
-
return id ? `[aria-controls="${this.prefix(id)}"]` : this.hasControls;
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Generates an aria-expanded CSS selector
|
|
118
|
-
* @param bool - whether the element is expanded or not
|
|
119
|
-
* @returns - the generated CSS selector
|
|
120
|
-
*/
|
|
121
|
-
static expanded(bool) {
|
|
122
|
-
return typeof bool === 'boolean' ? `[aria-expanded="${bool}"]` : this.hasExpanded;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Returns the id of the requested element
|
|
126
|
-
*/
|
|
127
|
-
static getId(id) {
|
|
128
|
-
var _b;
|
|
129
|
-
return (_b = this.ids[id !== null && id !== void 0 ? id : -1]) !== null && _b !== void 0 ? _b : '';
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Returns the class of the requested element
|
|
133
|
-
*/
|
|
134
|
-
static getClass(className, classGroup) {
|
|
135
|
-
var _b, _c;
|
|
136
|
-
if (classGroup) {
|
|
137
|
-
let group = this.classes[classGroup];
|
|
138
|
-
return (_b = group[className !== null && className !== void 0 ? className : -1]) !== null && _b !== void 0 ? _b : '';
|
|
139
|
-
}
|
|
140
|
-
return (_c = this.classes[className !== null && className !== void 0 ? className : -1]) !== null && _c !== void 0 ? _c : '';
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Returns a NodeList of HTMLElements within the given element that are focusable
|
|
144
|
-
* @param el - the element whose focusable children will be returned
|
|
145
|
-
* @returns - the elements within the given element that are focusable
|
|
146
|
-
*/
|
|
147
|
-
static getFocusables(el) {
|
|
148
|
-
let focusables;
|
|
149
|
-
if (el) {
|
|
150
|
-
focusables = Array.from(el.querySelectorAll(this.focusable));
|
|
151
|
-
} else {
|
|
152
|
-
focusables = Array.from(document.querySelectorAll(this.focusable));
|
|
153
|
-
}
|
|
154
|
-
return focusables.filter(el => this.isFocusable(el));
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Returns true if an element is focusable and false if not,
|
|
158
|
-
* based on styles (i.e. a parent has display: none;)
|
|
159
|
-
* NOTE: Still need to determine what other styles may make an element un-focusable
|
|
160
|
-
* @param el - the element
|
|
161
|
-
* @returns - true if the element is focusable; false if not
|
|
162
|
-
*/
|
|
163
|
-
static isFocusable(el) {
|
|
164
|
-
let current = el;
|
|
165
|
-
do {
|
|
166
|
-
if (window.getComputedStyle(current).getPropertyValue('display').toLowerCase() === 'none') {
|
|
167
|
-
return false;
|
|
168
|
-
}
|
|
169
|
-
current = current.parentElement;
|
|
170
|
-
} while (current);
|
|
171
|
-
return true;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
exports.mintSelectors = mintSelectors;
|
|
175
|
-
_a = mintSelectors;
|
|
176
|
-
/**
|
|
177
|
-
* The library name that will be added as a prefix
|
|
178
|
-
*/
|
|
179
|
-
mintSelectors.lib = 'mint';
|
|
180
|
-
/**
|
|
181
|
-
* The prefix built from the library name
|
|
182
|
-
*/
|
|
183
|
-
mintSelectors.pre = `${_a.lib}-`;
|
|
184
|
-
/**
|
|
185
|
-
* CSS-selector for disabled elements
|
|
186
|
-
*/
|
|
187
|
-
mintSelectors.disabled = '[disabled]';
|
|
188
|
-
/**
|
|
189
|
-
* CSS-selector for elements with an aria-controls attribute
|
|
190
|
-
*/
|
|
191
|
-
mintSelectors.hasControls = '[aria-controls]';
|
|
192
|
-
/**
|
|
193
|
-
* CSS-selector for elements with an aria-expanded attribute
|
|
194
|
-
*/
|
|
195
|
-
mintSelectors.hasExpanded = '[aria-expanded]';
|
|
196
|
-
/**
|
|
197
|
-
* CSS-selector for elements with an href attribute
|
|
198
|
-
*/
|
|
199
|
-
mintSelectors.hasLink = '[href]';
|
|
200
|
-
/**
|
|
201
|
-
* CSS-selector for elements with a routerLink attribute
|
|
202
|
-
*/
|
|
203
|
-
mintSelectors.hasRouterLink = '[routerLink]';
|
|
204
|
-
/**
|
|
205
|
-
* CSS-selector for elements with an id attribute
|
|
206
|
-
*/
|
|
207
|
-
mintSelectors.hasId = '[id]';
|
|
208
|
-
/**
|
|
209
|
-
* CSS-selector for elements that aren't tabbable (i.e. tabindex is negative)
|
|
210
|
-
*/
|
|
211
|
-
mintSelectors.notTabbable = '[tabindex^="-"]';
|
|
212
|
-
/**
|
|
213
|
-
* CSS-selector for elements that are tabbable (i.e. tabindex isn't negative)
|
|
214
|
-
*/
|
|
215
|
-
mintSelectors.tabbable = `[tabindex]${_a.neg(_a.notTabbable)}`;
|
|
216
|
-
/**
|
|
217
|
-
* CSS-selector for elements that can receive focus
|
|
218
|
-
*/
|
|
219
|
-
mintSelectors.focusable = `input${_a.neg(_a.disabled)}${_a.neg(_a.notTabbable)},
|
|
220
|
-
select${_a.neg(_a.disabled)}${_a.neg(_a.notTabbable)},
|
|
221
|
-
textarea${_a.neg(_a.disabled)}${_a.neg(_a.notTabbable)},
|
|
222
|
-
button${_a.neg(_a.disabled)}${_a.neg(_a.notTabbable)},
|
|
223
|
-
object${_a.neg(_a.disabled)}${_a.neg(_a.notTabbable)},
|
|
224
|
-
a${_a.hasLink}, a${_a.hasRouterLink},
|
|
225
|
-
area${_a.hasLink},
|
|
226
|
-
${_a.tabbable}`.replace(/\s/g, '');
|
|
227
|
-
/**
|
|
228
|
-
* CSS-selector for submenu buttons
|
|
229
|
-
*/
|
|
230
|
-
mintSelectors.subMenuButtons = `button${_a.hasControls}`;
|
|
231
|
-
/**
|
|
232
|
-
* CSS-selector for submenus
|
|
233
|
-
*/
|
|
234
|
-
mintSelectors.subMenu = `${_a.subMenuButtons} + ul${_a.hasId}`;
|
|
235
|
-
/**
|
|
236
|
-
* Frequently-used ids
|
|
237
|
-
*/
|
|
238
|
-
mintSelectors.ids = {
|
|
239
|
-
header: _a.prefix('header'),
|
|
240
|
-
logo: _a.prefix('logo'),
|
|
241
|
-
wrapper: _a.prefix('wrapper'),
|
|
242
|
-
mainContent: _a.prefix('main-content')
|
|
243
|
-
};
|
|
244
|
-
/**
|
|
245
|
-
* Classes
|
|
246
|
-
*/
|
|
247
|
-
mintSelectors.classes = {
|
|
248
|
-
sides: {
|
|
249
|
-
top: _a.prefix('top'),
|
|
250
|
-
right: _a.prefix('right'),
|
|
251
|
-
bottom: _a.prefix('bottom'),
|
|
252
|
-
left: _a.prefix('left')
|
|
253
|
-
},
|
|
254
|
-
srOnly: _a.prefix('sr-only'),
|
|
255
|
-
js: _a.prefix('js'),
|
|
256
|
-
ready: _a.prefix('ready'),
|
|
257
|
-
fixed: _a.prefix('fixed'),
|
|
258
|
-
open: _a.prefix('open')
|
|
259
|
-
};
|
|
260
|
-
exports["default"] = mintSelectors;
|
|
261
|
-
|
|
262
|
-
/***/ }),
|
|
263
|
-
|
|
264
41
|
/***/ "./src/ts/imports/util/settings.ts":
|
|
265
42
|
/*!*****************************************!*\
|
|
266
43
|
!*** ./src/ts/imports/util/settings.ts ***!
|
|
267
44
|
\*****************************************/
|
|
268
|
-
/***/ ((__unused_webpack_module, exports
|
|
45
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
269
46
|
|
|
270
47
|
|
|
271
48
|
|
|
@@ -274,19 +51,14 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
274
51
|
value: true
|
|
275
52
|
}));
|
|
276
53
|
exports.mintSettings = void 0;
|
|
277
|
-
/**
|
|
278
|
-
*
|
|
279
|
-
|
|
280
|
-
const enum_1 = __webpack_require__(/*! ../enum */ "./src/ts/imports/enum.ts");
|
|
281
|
-
const selectors_1 = __webpack_require__(/*! ./selectors */ "./src/ts/imports/util/selectors.ts");
|
|
282
|
-
/**
|
|
283
|
-
* Settings management
|
|
284
|
-
* @public
|
|
54
|
+
/**
|
|
55
|
+
* Settings management
|
|
56
|
+
* @public
|
|
285
57
|
*/
|
|
286
58
|
class mintSettings {
|
|
287
|
-
/**
|
|
288
|
-
* Update the provided settings variables
|
|
289
|
-
* @param settings - Object of settings variables to update
|
|
59
|
+
/**
|
|
60
|
+
* Update the provided settings variables
|
|
61
|
+
* @param settings - Object of settings variables to update
|
|
290
62
|
*/
|
|
291
63
|
static set(settings) {
|
|
292
64
|
let newDelay = false;
|
|
@@ -306,15 +78,14 @@ class mintSettings {
|
|
|
306
78
|
this.delay = Object.assign(Object.assign({}, this.delay), settings.delay);
|
|
307
79
|
}
|
|
308
80
|
}
|
|
309
|
-
if (
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
this.setFixed(settings.fixed);
|
|
81
|
+
if (settings.break && Object.keys(settings.break).length) {
|
|
82
|
+
if (Object.values(settings.break).reduce((prev, next) => prev && typeof next === 'number', true)) {
|
|
83
|
+
this.break = Object.assign(Object.assign({}, this.break), settings.break);
|
|
84
|
+
}
|
|
314
85
|
}
|
|
315
86
|
}
|
|
316
|
-
/**
|
|
317
|
-
* Updates the delay variables based on `this.delayBase` and `this.delayStep`
|
|
87
|
+
/**
|
|
88
|
+
* Updates the delay variables based on `this.delayBase` and `this.delayStep`
|
|
318
89
|
*/
|
|
319
90
|
static setDelay() {
|
|
320
91
|
this.delay = {
|
|
@@ -326,45 +97,19 @@ class mintSettings {
|
|
|
326
97
|
slow: this.delayBase + this.delayStep * 5
|
|
327
98
|
};
|
|
328
99
|
}
|
|
329
|
-
/**
|
|
330
|
-
* Updates the direction the navbar enters from
|
|
331
|
-
*/
|
|
332
|
-
static setFrom(from) {
|
|
333
|
-
if (this.from !== from) {
|
|
334
|
-
this.from = from;
|
|
335
|
-
let header = document.getElementById(selectors_1.mintSelectors.getId('header'));
|
|
336
|
-
header === null || header === void 0 ? void 0 : header.classList.remove(...Object.values(selectors_1.mintSelectors.classes.sides));
|
|
337
|
-
header === null || header === void 0 ? void 0 : header.classList.add(selectors_1.mintSelectors.getClass(enum_1.mintSide[this.from].toLowerCase(), 'sides'));
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
/**
|
|
341
|
-
* Updates whether or not the navbar is fixed
|
|
342
|
-
*/
|
|
343
|
-
static setFixed(fixed) {
|
|
344
|
-
if (this.fixed !== fixed) {
|
|
345
|
-
this.fixed = fixed;
|
|
346
|
-
let header = document.getElementById(selectors_1.mintSelectors.getId('header')),
|
|
347
|
-
fixedClass = selectors_1.mintSelectors.getClass('fixed');
|
|
348
|
-
if (this.fixed) {
|
|
349
|
-
header === null || header === void 0 ? void 0 : header.classList.add(fixedClass);
|
|
350
|
-
} else {
|
|
351
|
-
header === null || header === void 0 ? void 0 : header.classList.remove(fixedClass);
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
100
|
}
|
|
356
101
|
exports.mintSettings = mintSettings;
|
|
357
102
|
_a = mintSettings;
|
|
358
|
-
/**
|
|
359
|
-
* Value added to all delay variables
|
|
103
|
+
/**
|
|
104
|
+
* Value added to all delay variables
|
|
360
105
|
*/
|
|
361
106
|
mintSettings.delayBase = 0;
|
|
362
|
-
/**
|
|
363
|
-
* Value multiplied by delay variable index
|
|
107
|
+
/**
|
|
108
|
+
* Value multiplied by delay variable index
|
|
364
109
|
*/
|
|
365
110
|
mintSettings.delayStep = 100;
|
|
366
|
-
/**
|
|
367
|
-
* Delay variables
|
|
111
|
+
/**
|
|
112
|
+
* Delay variables
|
|
368
113
|
*/
|
|
369
114
|
mintSettings.delay = {
|
|
370
115
|
instant: _a.delayBase + _a.delayStep * 0,
|
|
@@ -374,6 +119,17 @@ mintSettings.delay = {
|
|
|
374
119
|
medSlow: _a.delayBase + _a.delayStep * 4,
|
|
375
120
|
slow: _a.delayBase + _a.delayStep * 5
|
|
376
121
|
};
|
|
122
|
+
/**
|
|
123
|
+
* Breakpoint variables
|
|
124
|
+
*/
|
|
125
|
+
mintSettings.break = {
|
|
126
|
+
z: 0,
|
|
127
|
+
xs: 480,
|
|
128
|
+
sm: 768,
|
|
129
|
+
md: 1024,
|
|
130
|
+
lg: 1200,
|
|
131
|
+
xl: 1440
|
|
132
|
+
};
|
|
377
133
|
;
|
|
378
134
|
exports["default"] = mintSettings;
|
|
379
135
|
|
|
@@ -396,29 +152,29 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
396
152
|
value: true
|
|
397
153
|
}));
|
|
398
154
|
exports.mintUtil = void 0;
|
|
399
|
-
/**
|
|
400
|
-
* Imports
|
|
155
|
+
/**
|
|
156
|
+
* Imports
|
|
401
157
|
*/
|
|
402
158
|
const enum_1 = __webpack_require__(/*! ./imports/enum */ "./src/ts/imports/enum.ts");
|
|
403
159
|
const settings_1 = __importDefault(__webpack_require__(/*! ./imports/util/settings */ "./src/ts/imports/util/settings.ts"));
|
|
404
|
-
/**
|
|
405
|
-
* Utility functions
|
|
406
|
-
* @public
|
|
160
|
+
/**
|
|
161
|
+
* Utility functions
|
|
162
|
+
* @public
|
|
407
163
|
*/
|
|
408
164
|
class mintUtil {
|
|
409
|
-
/**
|
|
410
|
-
* Returns the width of the window, including fractional pixels
|
|
411
|
-
* @returns the width of the window
|
|
165
|
+
/**
|
|
166
|
+
* Returns the width of the window, including fractional pixels
|
|
167
|
+
* @returns the width of the window
|
|
412
168
|
*/
|
|
413
169
|
static windowWidth() {
|
|
414
170
|
const decimal = document.body.getBoundingClientRect().width % 1;
|
|
415
171
|
return window.innerWidth + decimal;
|
|
416
172
|
}
|
|
417
|
-
/**
|
|
418
|
-
* Ensures that a function `func` is run only after not being called for `wait` milliseconds
|
|
419
|
-
* @param func - the function to debounce
|
|
420
|
-
* @param wait - the amount of time to wait before running the function
|
|
421
|
-
* @returns - the debounced function
|
|
173
|
+
/**
|
|
174
|
+
* Ensures that a function `func` is run only after not being called for `wait` milliseconds
|
|
175
|
+
* @param func - the function to debounce
|
|
176
|
+
* @param wait - the amount of time to wait before running the function
|
|
177
|
+
* @returns - the debounced function
|
|
422
178
|
*/
|
|
423
179
|
static debounce(func) {
|
|
424
180
|
let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
|
|
@@ -430,22 +186,22 @@ class mintUtil {
|
|
|
430
186
|
timer = setTimeout(func, wait, e);
|
|
431
187
|
};
|
|
432
188
|
}
|
|
433
|
-
/**
|
|
434
|
-
* Ensures that a function `func` is run only after not being called for `wait` milliseconds
|
|
435
|
-
* @param func - the function to debounce
|
|
436
|
-
* @param wait - the amount of time to wait before running the function
|
|
437
|
-
* @returns - the debounced function as an EventListener
|
|
189
|
+
/**
|
|
190
|
+
* Ensures that a function `func` is run only after not being called for `wait` milliseconds
|
|
191
|
+
* @param func - the function to debounce
|
|
192
|
+
* @param wait - the amount of time to wait before running the function
|
|
193
|
+
* @returns - the debounced function as an EventListener
|
|
438
194
|
*/
|
|
439
195
|
static debounceEvent(func) {
|
|
440
196
|
let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
|
|
441
197
|
return mintUtil.debounce(func, wait);
|
|
442
198
|
}
|
|
443
|
-
/**
|
|
444
|
-
* Ensures that a function `func` is called at most every `wait` milliseconds with optional leading and trailing calls
|
|
445
|
-
* @param func - the function to throttle
|
|
446
|
-
* @param wait - the amount of time between function calls
|
|
447
|
-
* @param options - leading and trailing options: default = \{ leading: true, trailing, true \}
|
|
448
|
-
* @returns - the throttled function
|
|
199
|
+
/**
|
|
200
|
+
* Ensures that a function `func` is called at most every `wait` milliseconds with optional leading and trailing calls
|
|
201
|
+
* @param func - the function to throttle
|
|
202
|
+
* @param wait - the amount of time between function calls
|
|
203
|
+
* @param options - leading and trailing options: default = \{ leading: true, trailing, true \}
|
|
204
|
+
* @returns - the throttled function
|
|
449
205
|
*/
|
|
450
206
|
static throttle(func) {
|
|
451
207
|
let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
|
|
@@ -488,23 +244,23 @@ class mintUtil {
|
|
|
488
244
|
};
|
|
489
245
|
return throttled;
|
|
490
246
|
}
|
|
491
|
-
/**
|
|
492
|
-
* Ensures that a function `func` is called at most every `wait` milliseconds with optional leading and trailing calls
|
|
493
|
-
* @param func - the function to throttle
|
|
494
|
-
* @param wait - the amount of time between function calls
|
|
495
|
-
* @param options - leading and trailing options: default = \{ leading: true, trailing, true \}
|
|
496
|
-
* @returns - the throttled function as an EventListener
|
|
247
|
+
/**
|
|
248
|
+
* Ensures that a function `func` is called at most every `wait` milliseconds with optional leading and trailing calls
|
|
249
|
+
* @param func - the function to throttle
|
|
250
|
+
* @param wait - the amount of time between function calls
|
|
251
|
+
* @param options - leading and trailing options: default = \{ leading: true, trailing, true \}
|
|
252
|
+
* @returns - the throttled function as an EventListener
|
|
497
253
|
*/
|
|
498
254
|
static throttleEvent(func) {
|
|
499
255
|
let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
|
|
500
256
|
let options = arguments.length > 2 ? arguments[2] : undefined;
|
|
501
257
|
return mintUtil.throttle(func, wait, options);
|
|
502
258
|
}
|
|
503
|
-
/**
|
|
504
|
-
* Sets the element's height to its `innerHeight`, then to `auto` after a delay
|
|
505
|
-
* @param el - the element whose height will be set
|
|
506
|
-
* @param delay - the amount of time in milliseconds that the show animation will be active
|
|
507
|
-
* @param from - the side that the element is animating from
|
|
259
|
+
/**
|
|
260
|
+
* Sets the element's height to its `innerHeight`, then to `auto` after a delay
|
|
261
|
+
* @param el - the element whose height will be set
|
|
262
|
+
* @param delay - the amount of time in milliseconds that the show animation will be active
|
|
263
|
+
* @param from - the side that the element is animating from
|
|
508
264
|
*/
|
|
509
265
|
static show(el) {
|
|
510
266
|
let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
|
|
@@ -527,11 +283,11 @@ class mintUtil {
|
|
|
527
283
|
});
|
|
528
284
|
}
|
|
529
285
|
}
|
|
530
|
-
/**
|
|
531
|
-
* Sets the element's height to 0
|
|
532
|
-
* @param el - the element whose height will be set
|
|
533
|
-
* @param delay - the amount of time in milliseconds that the show animation will be active
|
|
534
|
-
* @param from - the side that the element is animating from
|
|
286
|
+
/**
|
|
287
|
+
* Sets the element's height to 0
|
|
288
|
+
* @param el - the element whose height will be set
|
|
289
|
+
* @param delay - the amount of time in milliseconds that the show animation will be active
|
|
290
|
+
* @param from - the side that the element is animating from
|
|
535
291
|
*/
|
|
536
292
|
static hide(el) {
|
|
537
293
|
let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
|
|
@@ -561,10 +317,10 @@ class mintUtil {
|
|
|
561
317
|
}, delay);
|
|
562
318
|
}
|
|
563
319
|
}
|
|
564
|
-
/**
|
|
565
|
-
* Copies the provided text to the clipboard
|
|
566
|
-
* @param text - the text to copy
|
|
567
|
-
* @returns - true if the text was successfully copied to the clipboard; else false
|
|
320
|
+
/**
|
|
321
|
+
* Copies the provided text to the clipboard
|
|
322
|
+
* @param text - the text to copy
|
|
323
|
+
* @returns - true if the text was successfully copied to the clipboard; else false
|
|
568
324
|
*/
|
|
569
325
|
static copyText(text) {
|
|
570
326
|
let textArea = document.createElement('textarea');
|
|
@@ -587,11 +343,11 @@ class mintUtil {
|
|
|
587
343
|
document.body.removeChild(textArea);
|
|
588
344
|
return true;
|
|
589
345
|
}
|
|
590
|
-
/**
|
|
591
|
-
* Tests the validity of an email address
|
|
592
|
-
* @see {@link https://stackoverflow.com/questions/201323/how-can-i-validate-an-email-address-using-a-regular-expression}
|
|
593
|
-
* @param text - the string to test
|
|
594
|
-
* @returns - true if the given string is an email address; false if not
|
|
346
|
+
/**
|
|
347
|
+
* Tests the validity of an email address
|
|
348
|
+
* @see {@link https://stackoverflow.com/questions/201323/how-can-i-validate-an-email-address-using-a-regular-expression}
|
|
349
|
+
* @param text - the string to test
|
|
350
|
+
* @returns - true if the given string is an email address; false if not
|
|
595
351
|
*/
|
|
596
352
|
static isEmail(text) {
|
|
597
353
|
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-]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AAwBjH,QAAQ,CAACkH,aAAa,CAAC,UAAU,CAAC;IAEtE,IAAI,CAACF,IAAI,IAAI,CAACC,QAAQ,EAAE;MACpB,OAAO,KAAK;;IAGhBA,QAAQ,CAACE,KAAK,GAAGH,IAAI;IACrBC,QAAQ,CAACX,KAAK,CAACc,OAAO,GAAG;;;;;;;SAOxB;IAEDpH,QAAQ,CAACqE,IAAI,CAACgD,WAAW,CAACJ,QAAQ,CAAC;IACnCA,QAAQ,CAACK,MAAM,EAAE;IACjBL,QAAQ,CAACM,iBAAiB,CAAC,CAAC,EAAE,KAAK,CAAC;IACpCC,SAAS,CAACC,SAAS,CAACC,SAAS,CAACT,QAAQ,CAACE,KAAK,CAAC;IAC7CnH,QAAQ,CAACqE,IAAI,CAACsD,WAAW,CAACV,QAAQ,CAAC;IAEnC,OAAO,IAAI;EACf;EAEA;;;;;;EAMA,OAAOW,OAAOA,CAAEZ,IAAY;IACxB,OAAO,IAAI,KAAKA,IAAI,CAACa,KAAK,CAAC,gcAAgc,CAAC;EAChe;;AApMJ/J,gBAAA,GAAAoG,QAAA;AAsMApG,kBAAA,GAAeoG,QAAQ;;;;;;UChNvB;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;UEtBA;UACA;UACA;UACA","sources":["webpack://mint/webpack/universalModuleDefinition","webpack://mint/./src/ts/imports/enum.ts","webpack://mint/./src/ts/imports/util/selectors.ts","webpack://mint/./src/ts/imports/util/settings.ts","webpack://mint/./src/ts/util.ts","webpack://mint/webpack/bootstrap","webpack://mint/webpack/before-startup","webpack://mint/webpack/startup","webpack://mint/webpack/after-startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"mintUtil\"] = factory();\n\telse\n\t\troot[\"mintUtil\"] = factory();\n})(this, () => {\nreturn ","/**\r\n * Side Enum\r\n */\r\n export enum mintSide {\r\n Top,\r\n Right,\r\n Bottom,\r\n Left\r\n};\r\n","/**\n * CSS-selector helpers\n * @public\n */\nexport abstract class mintSelectors {\n /**\n * The library name that will be added as a prefix\n */\n static lib: string = 'mint';\n\n /**\n * The prefix built from the library name\n */\n static pre: string = `${this.lib}-`;\n\n /**\n * CSS-selector for disabled elements\n */\n static disabled: string = '[disabled]';\n\n /**\n * CSS-selector for elements with an aria-controls attribute\n */\n static hasControls: string = '[aria-controls]';\n\n /**\n * CSS-selector for elements with an aria-expanded attribute\n */\n static hasExpanded: string = '[aria-expanded]';\n\n /**\n * CSS-selector for elements with an href attribute\n */\n static hasLink: string = '[href]';\n\n /**\n * CSS-selector for elements with a routerLink attribute\n */\n static hasRouterLink: string = '[routerLink]';\n\n /**\n * CSS-selector for elements with an id attribute\n */\n static hasId: string = '[id]';\n\n /**\n * CSS-selector for elements that aren't tabbable (i.e. tabindex is negative)\n */\n static notTabbable: string = '[tabindex^=\"-\"]';\n\n /**\n * CSS-selector for elements that are tabbable (i.e. tabindex isn't negative)\n */\n static tabbable: string = `[tabindex]${this.neg(this.notTabbable)}`;\n\n /**\n * CSS-selector for elements that can receive focus\n */\n static focusable: string = `input${this.neg(this.disabled)}${this.neg(this.notTabbable)},\n select${this.neg(this.disabled)}${this.neg(this.notTabbable)},\n textarea${this.neg(this.disabled)}${this.neg(this.notTabbable)},\n button${this.neg(this.disabled)}${this.neg(this.notTabbable)},\n object${this.neg(this.disabled)}${this.neg(this.notTabbable)},\n a${this.hasLink}, a${this.hasRouterLink},\n area${this.hasLink},\n ${this.tabbable}`.replace(/\\s/g, '');\n\n /**\n * CSS-selector for submenu buttons\n */\n static subMenuButtons: string = `button${this.hasControls}`;\n\n /**\n * CSS-selector for submenus\n */\n static subMenu: string = `${this.subMenuButtons} + ul${this.hasId}`;\n\n /**\n * Frequently-used ids\n */\n static ids: {[key: string]: string | {[key: string]: string}} = {\n header: this.prefix('header'),\n logo: this.prefix('logo'),\n wrapper: this.prefix('wrapper'),\n mainContent: this.prefix('main-content')\n };\n\n /**\n * Classes\n */\n static classes: {[key: string]: string | {[key: string]: string}} = {\n sides: {\n top: this.prefix('top'),\n right: this.prefix('right'),\n bottom: this.prefix('bottom'),\n left: this.prefix('left')\n },\n srOnly: this.prefix('sr-only'),\n js: this.prefix('js'),\n ready: this.prefix('ready'),\n fixed: this.prefix('fixed'),\n open: this.prefix('open')\n };\n\n /**\n * Adds the library prefix to the beginning of the provided string\n * @param base - the string to be prefixed\n * @returns - the provided string prefixed with the library name\n */\n static prefix (base: string) : string {\n base = base.toLowerCase();\n return base.startsWith(this.pre) ? base : `${this.pre}${base}`;\n }\n\n /**\n * Adds two dashes to the beginning of the provided string\n * @param base - the string to be prefixed\n * @returns - the provided string prefixed with two dashes\n */\n static cssPrefix (base: string) : string {\n return `--${this.prefix(base.replace(/^-+/, ''))}`;\n }\n\n /**\n * Turns the provided string into a CSS variable call\n * @param base - the name of the CSS variable to call\n * @returns - the CSS variable call for the provided string\n */\n static cssVar (base: string) : string {\n return `var(${this.cssPrefix(base)})`;\n }\n\n /**\n * Negates the provided CSS selector\n * @param base - the CSS selector to negate\n * @returns - the negated CSS selector\n */\n static neg (base: string) : string {\n return `:not(${base})`;\n }\n\n /**\n * Generates a class CSS selector\n * @param base - the name of the class to generate\n * @returns - the generated CSS selector\n */\n static class (base: string) : string {\n return `.${this.prefix(base)}`;\n }\n\n /**\n * Generates an id CSS selector\n * @param base - the name of the id to generate\n * @returns - the generated CSS selector\n */\n static id (base: string) : string {\n return `#${this.prefix(base)}`;\n }\n\n /**\n * Generates an aria-controls CSS selector\n * @param id - the id of the controlled element\n * @returns - the generated CSS selector\n */\n static controls (id?: string | null) : string {\n return id ? `[aria-controls=\"${this.prefix(id)}\"]` : this.hasControls;\n }\n\n /**\n * Generates an aria-expanded CSS selector\n * @param bool - whether the element is expanded or not\n * @returns - the generated CSS selector\n */\n static expanded (bool?: boolean | null) : string {\n return typeof bool === 'boolean' ? `[aria-expanded=\"${bool}\"]` : this.hasExpanded;\n }\n\n /**\n * Returns the id of the requested element\n */\n static getId (id?: string) : string {\n return this.ids[id ?? -1] as string ?? '';\n }\n\n /**\n * Returns the class of the requested element\n */\n static getClass (className?: string, classGroup?: string) : string {\n if (classGroup) {\n let group: {[key: string]: string} = this.classes[classGroup] as {[key: string]: string};\n return group[className ?? -1] ?? '';\n }\n return this.classes[className ?? -1] as string ?? '';\n }\n\n /**\n * Returns a NodeList of HTMLElements within the given element that are focusable\n * @param el - the element whose focusable children will be returned\n * @returns - the elements within the given element that are focusable\n */\n static getFocusables (el?: HTMLElement) : HTMLElement[] {\n let focusables: HTMLElement[];\n if (el) {\n focusables = Array.from(el.querySelectorAll<HTMLElement>(this.focusable));\n } else {\n focusables = Array.from(document.querySelectorAll<HTMLElement>(this.focusable));\n }\n return focusables.filter((el: HTMLElement) => this.isFocusable(el));\n }\n\n /**\n * Returns true if an element is focusable and false if not,\n * based on styles (i.e. a parent has display: none;)\n * NOTE: Still need to determine what other styles may make an element un-focusable\n * @param el - the element\n * @returns - true if the element is focusable; false if not\n */\n static isFocusable (el: HTMLElement) : boolean {\n let current: HTMLElement | null = el;\n\n do {\n if (window.getComputedStyle(current).getPropertyValue('display').toLowerCase() === 'none') {\n return false;\n }\n current = current.parentElement;\n } while (current);\n return true;\n }\n}\nexport default mintSelectors;\n","/**\n * Imports\n */\nimport { mintSide } from '../enum';\nimport { mintSelectors } from './selectors';\n\n/**\n * Settings management\n * @public\n */\nexport abstract class mintSettings {\n /**\n * Value added to all delay variables\n */\n static delayBase: number = 0;\n\n /**\n * Value multiplied by delay variable index\n */\n static delayStep: number = 100;\n\n /**\n * Delay variables\n */\n static delay: {[key: string]: number} = {\n instant: this.delayBase + this.delayStep * 0,\n fast: this.delayBase + this.delayStep * 1,\n medFast: this.delayBase + this.delayStep * 2,\n default: this.delayBase + this.delayStep * 3,\n medSlow: this.delayBase + this.delayStep * 4,\n slow: this.delayBase + this.delayStep * 5\n };\n\n /**\n * Side of the window the mobile navbar enters from\n */\n static from?: mintSide;\n\n /**\n * Whether the navbar is fixed or not\n */\n static fixed?: boolean;\n\n /**\n * Update the provided settings variables\n * @param settings - Object of settings variables to update\n */\n static set (settings: {[key: string]: any}) : void {\n let newDelay: boolean = false;\n if (typeof settings.delayBase === 'number') {\n this.delayBase = settings.delayBase;\n newDelay = true;\n }\n if (typeof settings.delayStep === 'number') {\n this.delayStep = settings.delayStep;\n newDelay = true;\n }\n if (newDelay) {\n this.setDelay();\n }\n\n if (settings.delay && Object.keys(settings.delay).length) {\n if (Object.values(settings.delay).reduce((prev: any, next: any) => prev && typeof next === 'number', true)) {\n this.delay = {...this.delay, ...settings.delay};\n }\n }\n\n if (typeof settings.from === 'number') {\n this.setFrom(settings.from);\n }\n\n if (typeof settings.fixed === 'boolean') {\n this.setFixed(settings.fixed);\n }\n }\n\n /**\n * Updates the delay variables based on `this.delayBase` and `this.delayStep`\n */\n protected static setDelay () : void {\n this.delay = {\n instant: this.delayBase + this.delayStep * 0,\n fast: this.delayBase + this.delayStep * 1,\n medFast: this.delayBase + this.delayStep * 2,\n default: this.delayBase + this.delayStep * 3,\n medSlow: this.delayBase + this.delayStep * 4,\n slow: this.delayBase + this.delayStep * 5\n };\n }\n\n /**\n * Updates the direction the navbar enters from\n */\n protected static setFrom (from: mintSide) : void {\n if (this.from !== from) {\n this.from = from;\n let header: HTMLElement | null = document.getElementById(mintSelectors.getId('header'));\n header?.classList.remove(...Object.values(mintSelectors.classes.sides));\n header?.classList.add(mintSelectors.getClass(mintSide[this.from].toLowerCase(), 'sides'));\n }\n }\n\n /**\n * Updates whether or not the navbar is fixed\n */\n protected static setFixed (fixed: boolean) : void {\n if (this.fixed !== fixed) {\n this.fixed = fixed;\n let header: HTMLElement | null = document.getElementById(mintSelectors.getId('header')),\n fixedClass: string = mintSelectors.getClass('fixed');\n if (this.fixed) {\n header?.classList.add(fixedClass);\n } else {\n header?.classList.remove(fixedClass);\n }\n }\n }\n};\n\nexport default mintSettings;\n","/**\n * Imports\n */\nimport { mintSide } from './imports/enum';\nimport mintSettings from './imports/util/settings';\n\n/**\n * Utility functions\n * @public\n */\nexport abstract class mintUtil {\n /**\n * Returns the width of the window, including fractional pixels\n * @returns the width of the window\n */\n static windowWidth () : number {\n const decimal: number = document.body.getBoundingClientRect().width % 1;\n return window.innerWidth + decimal;\n }\n\n /**\n * Ensures that a function `func` is run only after not being called for `wait` milliseconds\n * @param func - the function to debounce\n * @param wait - the amount of time to wait before running the function\n * @returns - the debounced function\n */\n static debounce (func: Function, wait: number = mintSettings.delay.default) : Function {\n let timer: number;\n return function (e: any) {\n if (timer) {\n clearTimeout(timer);\n }\n timer = setTimeout(func, wait, e);\n }\n }\n\n /**\n * Ensures that a function `func` is run only after not being called for `wait` milliseconds\n * @param func - the function to debounce\n * @param wait - the amount of time to wait before running the function\n * @returns - the debounced function as an EventListener\n */\n static debounceEvent (func: Function, wait: number = mintSettings.delay.default) : EventListener {\n return mintUtil.debounce(func, wait) as EventListener;\n }\n\n /**\n * Ensures that a function `func` is called at most every `wait` milliseconds with optional leading and trailing calls\n * @param func - the function to throttle\n * @param wait - the amount of time between function calls\n * @param options - leading and trailing options: default = \\{ leading: true, trailing, true \\}\n * @returns - the throttled function\n */\n static throttle (func: Function,\n wait: number = mintSettings.delay.default,\n options?: {[key: string]: boolean}) : Function {\n let context: any, args: any, result: any,\n timeout: number, previous: number = 0,\n later: Function = function () {\n previous = options?.leading === false ? 0 : new Date().getTime();\n timeout = 0;\n result = func.apply(context, args);\n if (!timeout) {\n context = args = null;\n }\n },\n throttled: Function = function (this: any): any {\n let now: number = new Date().getTime();\n if (!previous && options?.leading === false) {\n previous = now;\n }\n let remaining: number = wait - now + previous;\n context = this;\n args = arguments;\n if (remaining <= 0 || remaining > wait) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = 0;\n }\n previous = now;\n result = func.apply(context, args);\n if (!timeout) {\n context = args = null;\n }\n } else if (!timeout && options?.trailing !== false) {\n timeout = window.setTimeout(later, remaining);\n }\n return result;\n };\n\n return throttled;\n }\n\n /**\n * Ensures that a function `func` is called at most every `wait` milliseconds with optional leading and trailing calls\n * @param func - the function to throttle\n * @param wait - the amount of time between function calls\n * @param options - leading and trailing options: default = \\{ leading: true, trailing, true \\}\n * @returns - the throttled function as an EventListener\n */\n static throttleEvent (func: Function,\n wait: number = mintSettings.delay.default,\n options?: {[key: string]: boolean}) : EventListener {\n return mintUtil.throttle(func, wait, options) as EventListener;\n }\n\n /**\n * Sets the element's height to its `innerHeight`, then to `auto` after a delay\n * @param el - the element whose height will be set\n * @param delay - the amount of time in milliseconds that the show animation will be active\n * @param from - the side that the element is animating from\n */\n static show (el?: HTMLElement | null, delay: number = mintSettings.delay.default, from: mintSide = mintSide.Top) : void {\n if (el) {\n el.style.display = '';\n requestAnimationFrame(() => {\n if (from === mintSide.Top || from === mintSide.Bottom) {\n el.style.height = `${el.scrollHeight}px`;\n } else {\n el.style.width = `${el.scrollWidth}px`;\n }\n \n setTimeout(() => {\n if (from === mintSide.Top || from === mintSide.Bottom) {\n el.style.height = 'auto';\n } else {\n el.style.width = 'auto';\n }\n }, delay);\n });\n }\n }\n\n /**\n * Sets the element's height to 0\n * @param el - the element whose height will be set\n * @param delay - the amount of time in milliseconds that the show animation will be active\n * @param from - the side that the element is animating from\n */\n static hide (el?: HTMLElement | null, delay: number = mintSettings.delay.default, from: mintSide = mintSide.Top) : void {\n if (el) {\n let height = el.scrollHeight,\n width = el.scrollWidth,\n transition = el.style.transition;\n el.style.transition = '';\n requestAnimationFrame(() => {\n if (from === mintSide.Top || from === mintSide.Bottom) {\n el.style.height = `${height}px`;\n } else {\n el.style.width = `${width}px`;\n }\n \n el.style.transition = transition;\n requestAnimationFrame(() => {\n if (from === mintSide.Top || from === mintSide.Bottom) {\n el.style.height = '0';\n } else {\n el.style.width = '0';\n }\n });\n });\n setTimeout(() => {\n el.style.display = 'none';\n }, delay);\n }\n }\n\n /**\n * Copies the provided text to the clipboard\n * @param text - the text to copy\n * @returns - true if the text was successfully copied to the clipboard; else false\n */\n static copyText (text: string) : boolean {\n let textArea: HTMLTextAreaElement = document.createElement('textarea');\n\n if (!text || !textArea) {\n return false;\n }\n\n textArea.value = text;\n textArea.style.cssText = `\n position: fixed;\n top: 0;\n left: 0;\n transform: translate(-100%, -100%);\n opacity: 0;\n z-index: -1;\n `;\n\n document.body.appendChild(textArea);\n textArea.select();\n textArea.setSelectionRange(0, 99999);\n navigator.clipboard.writeText(textArea.value);\n document.body.removeChild(textArea);\n\n return true;\n }\n\n /**\n * Tests the validity of an email address\n * @see {@link https://stackoverflow.com/questions/201323/how-can-i-validate-an-email-address-using-a-regular-expression}\n * @param text - the string to test\n * @returns - true if the given string is an email address; false if not\n */\n static isEmail (text: string) : boolean {\n 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])+)\\])/);\n }\n}\nexport default mintUtil;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(\"./src/ts/util.ts\");\n",""],"names":["mintSide","exports","mintSelectors","prefix","base","toLowerCase","startsWith","pre","cssPrefix","replace","cssVar","neg","class","id","controls","hasControls","expanded","bool","hasExpanded","getId","_b","ids","getClass","className","classGroup","group","classes","_c","getFocusables","el","focusables","Array","from","querySelectorAll","focusable","document","filter","isFocusable","current","window","getComputedStyle","getPropertyValue","parentElement","lib","_a","disabled","hasLink","hasRouterLink","hasId","notTabbable","tabbable","subMenuButtons","subMenu","header","logo","wrapper","mainContent","sides","top","right","bottom","left","srOnly","js","ready","fixed","open","default","enum_1","require","selectors_1","mintSettings","set","settings","newDelay","delayBase","delayStep","setDelay","delay","Object","keys","length","values","reduce","prev","next","assign","setFrom","setFixed","instant","fast","medFast","medSlow","slow","getElementById","classList","remove","add","fixedClass","settings_1","__importDefault","mintUtil","windowWidth","decimal","body","getBoundingClientRect","width","innerWidth","debounce","func","wait","arguments","undefined","timer","e","clearTimeout","setTimeout","debounceEvent","throttle","options","context","args","result","timeout","previous","later","leading","Date","getTime","apply","throttled","now","remaining","trailing","throttleEvent","show","Top","style","display","requestAnimationFrame","Bottom","height","scrollHeight","scrollWidth","hide","transition","copyText","text","textArea","createElement","value","cssText","appendChild","select","setSelectionRange","navigator","clipboard","writeText","removeChild","isEmail","match"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"js/util.js","mappings":"AAAA;AACA;AACA;AACA;AACA;A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C,IAAI,CAACmD,WAAW,CAACJ,QAAQ,CAAC;IACnCA,QAAQ,CAACK,MAAM,EAAE;IACjBL,QAAQ,CAACM,iBAAiB,CAAC,CAAC,EAAE,KAAK,CAAC;IACpCC,SAAS,CAACC,SAAS,CAACC,SAAS,CAACT,QAAQ,CAACE,KAAK,CAAC;IAC7ClD,QAAQ,CAACC,IAAI,CAACyD,WAAW,CAACV,QAAQ,CAAC;IAEnC,OAAO,IAAI;EACf;EAEA;;;;;;EAMA,OAAOW,OAAOA,CAAEZ,IAAY;IACxB,OAAO,IAAI,KAAKA,IAAI,CAACa,KAAK,CAAC,gcAAgc,CAAC;EAChe;;AApMJlG,gBAAA,GAAAmC,QAAA;AAsMAnC,kBAAA,GAAemC,QAAQ;;;;;;UChNvB;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;UEtBA;UACA;UACA;UACA","sources":["webpack://mint/webpack/universalModuleDefinition","webpack://mint/./src/ts/imports/enum.ts","webpack://mint/./src/ts/imports/util/settings.ts","webpack://mint/./src/ts/util.ts","webpack://mint/webpack/bootstrap","webpack://mint/webpack/before-startup","webpack://mint/webpack/startup","webpack://mint/webpack/after-startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"mintUtil\"] = factory();\n\telse\n\t\troot[\"mintUtil\"] = factory();\n})(this, () => {\nreturn ","/**\n * Side Enum\n */\n export enum mintSide {\n Top,\n Right,\n Bottom,\n Left\n};\n","/**\n * Settings management\n * @public\n */\nexport abstract class mintSettings {\n /**\n * Value added to all delay variables\n */\n static delayBase: number = 0;\n\n /**\n * Value multiplied by delay variable index\n */\n static delayStep: number = 100;\n\n /**\n * Delay variables\n */\n static delay: {[key: string]: number} = {\n instant: this.delayBase + this.delayStep * 0,\n fast: this.delayBase + this.delayStep * 1,\n medFast: this.delayBase + this.delayStep * 2,\n default: this.delayBase + this.delayStep * 3,\n medSlow: this.delayBase + this.delayStep * 4,\n slow: this.delayBase + this.delayStep * 5\n };\n\n /**\n * Breakpoint variables\n */\n static break: {[key: string]: number} = {\n z: 0,\n xs: 480,\n sm: 768,\n md: 1024,\n lg: 1200,\n xl: 1440\n };\n\n /**\n * Update the provided settings variables\n * @param settings - Object of settings variables to update\n */\n static set (settings: {[key: string]: any}) : void {\n let newDelay: boolean = false;\n if (typeof settings.delayBase === 'number') {\n this.delayBase = settings.delayBase;\n newDelay = true;\n }\n if (typeof settings.delayStep === 'number') {\n this.delayStep = settings.delayStep;\n newDelay = true;\n }\n if (newDelay) {\n this.setDelay();\n }\n\n if (settings.delay && Object.keys(settings.delay).length) {\n if (Object.values(settings.delay).reduce((prev: any, next: any) => prev && typeof next === 'number', true)) {\n this.delay = {...this.delay, ...settings.delay};\n }\n }\n\n if (settings.break && Object.keys(settings.break).length) {\n if (Object.values(settings.break).reduce((prev: any, next: any) => prev && typeof next === 'number', true)) {\n this.break = {...this.break, ...settings.break};\n }\n }\n }\n\n /**\n * Updates the delay variables based on `this.delayBase` and `this.delayStep`\n */\n protected static setDelay () : void {\n this.delay = {\n instant: this.delayBase + this.delayStep * 0,\n fast: this.delayBase + this.delayStep * 1,\n medFast: this.delayBase + this.delayStep * 2,\n default: this.delayBase + this.delayStep * 3,\n medSlow: this.delayBase + this.delayStep * 4,\n slow: this.delayBase + this.delayStep * 5\n };\n }\n};\n\nexport default mintSettings;\n","/**\n * Imports\n */\nimport { mintSide } from './imports/enum';\nimport mintSettings from './imports/util/settings';\n\n/**\n * Utility functions\n * @public\n */\nexport abstract class mintUtil {\n /**\n * Returns the width of the window, including fractional pixels\n * @returns the width of the window\n */\n static windowWidth () : number {\n const decimal: number = document.body.getBoundingClientRect().width % 1;\n return window.innerWidth + decimal;\n }\n\n /**\n * Ensures that a function `func` is run only after not being called for `wait` milliseconds\n * @param func - the function to debounce\n * @param wait - the amount of time to wait before running the function\n * @returns - the debounced function\n */\n static debounce (func: Function, wait: number = mintSettings.delay.default) : Function {\n let timer: number;\n return function (e: any) {\n if (timer) {\n clearTimeout(timer);\n }\n timer = setTimeout(func, wait, e);\n }\n }\n\n /**\n * Ensures that a function `func` is run only after not being called for `wait` milliseconds\n * @param func - the function to debounce\n * @param wait - the amount of time to wait before running the function\n * @returns - the debounced function as an EventListener\n */\n static debounceEvent (func: Function, wait: number = mintSettings.delay.default) : EventListener {\n return mintUtil.debounce(func, wait) as EventListener;\n }\n\n /**\n * Ensures that a function `func` is called at most every `wait` milliseconds with optional leading and trailing calls\n * @param func - the function to throttle\n * @param wait - the amount of time between function calls\n * @param options - leading and trailing options: default = \\{ leading: true, trailing, true \\}\n * @returns - the throttled function\n */\n static throttle (func: Function,\n wait: number = mintSettings.delay.default,\n options?: {[key: string]: boolean}) : Function {\n let context: any, args: any, result: any,\n timeout: number, previous: number = 0,\n later: Function = function () {\n previous = options?.leading === false ? 0 : new Date().getTime();\n timeout = 0;\n result = func.apply(context, args);\n if (!timeout) {\n context = args = null;\n }\n },\n throttled: Function = function (this: any): any {\n let now: number = new Date().getTime();\n if (!previous && options?.leading === false) {\n previous = now;\n }\n let remaining: number = wait - now + previous;\n context = this;\n args = arguments;\n if (remaining <= 0 || remaining > wait) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = 0;\n }\n previous = now;\n result = func.apply(context, args);\n if (!timeout) {\n context = args = null;\n }\n } else if (!timeout && options?.trailing !== false) {\n timeout = window.setTimeout(later, remaining);\n }\n return result;\n };\n\n return throttled;\n }\n\n /**\n * Ensures that a function `func` is called at most every `wait` milliseconds with optional leading and trailing calls\n * @param func - the function to throttle\n * @param wait - the amount of time between function calls\n * @param options - leading and trailing options: default = \\{ leading: true, trailing, true \\}\n * @returns - the throttled function as an EventListener\n */\n static throttleEvent (func: Function,\n wait: number = mintSettings.delay.default,\n options?: {[key: string]: boolean}) : EventListener {\n return mintUtil.throttle(func, wait, options) as EventListener;\n }\n\n /**\n * Sets the element's height to its `innerHeight`, then to `auto` after a delay\n * @param el - the element whose height will be set\n * @param delay - the amount of time in milliseconds that the show animation will be active\n * @param from - the side that the element is animating from\n */\n static show (el?: HTMLElement | null, delay: number = mintSettings.delay.default, from: mintSide = mintSide.Top) : void {\n if (el) {\n el.style.display = '';\n requestAnimationFrame(() => {\n if (from === mintSide.Top || from === mintSide.Bottom) {\n el.style.height = `${el.scrollHeight}px`;\n } else {\n el.style.width = `${el.scrollWidth}px`;\n }\n \n setTimeout(() => {\n if (from === mintSide.Top || from === mintSide.Bottom) {\n el.style.height = 'auto';\n } else {\n el.style.width = 'auto';\n }\n }, delay);\n });\n }\n }\n\n /**\n * Sets the element's height to 0\n * @param el - the element whose height will be set\n * @param delay - the amount of time in milliseconds that the show animation will be active\n * @param from - the side that the element is animating from\n */\n static hide (el?: HTMLElement | null, delay: number = mintSettings.delay.default, from: mintSide = mintSide.Top) : void {\n if (el) {\n let height = el.scrollHeight,\n width = el.scrollWidth,\n transition = el.style.transition;\n el.style.transition = '';\n requestAnimationFrame(() => {\n if (from === mintSide.Top || from === mintSide.Bottom) {\n el.style.height = `${height}px`;\n } else {\n el.style.width = `${width}px`;\n }\n \n el.style.transition = transition;\n requestAnimationFrame(() => {\n if (from === mintSide.Top || from === mintSide.Bottom) {\n el.style.height = '0';\n } else {\n el.style.width = '0';\n }\n });\n });\n setTimeout(() => {\n el.style.display = 'none';\n }, delay);\n }\n }\n\n /**\n * Copies the provided text to the clipboard\n * @param text - the text to copy\n * @returns - true if the text was successfully copied to the clipboard; else false\n */\n static copyText (text: string) : boolean {\n let textArea: HTMLTextAreaElement = document.createElement('textarea');\n\n if (!text || !textArea) {\n return false;\n }\n\n textArea.value = text;\n textArea.style.cssText = `\n position: fixed;\n top: 0;\n left: 0;\n transform: translate(-100%, -100%);\n opacity: 0;\n z-index: -1;\n `;\n\n document.body.appendChild(textArea);\n textArea.select();\n textArea.setSelectionRange(0, 99999);\n navigator.clipboard.writeText(textArea.value);\n document.body.removeChild(textArea);\n\n return true;\n }\n\n /**\n * Tests the validity of an email address\n * @see {@link https://stackoverflow.com/questions/201323/how-can-i-validate-an-email-address-using-a-regular-expression}\n * @param text - the string to test\n * @returns - true if the given string is an email address; false if not\n */\n static isEmail (text: string) : boolean {\n 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])+)\\])/);\n }\n}\nexport default mintUtil;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(\"./src/ts/util.ts\");\n",""],"names":["mintSide","exports","mintSettings","set","settings","newDelay","delayBase","delayStep","setDelay","delay","Object","keys","length","values","reduce","prev","next","assign","break","instant","fast","medFast","default","medSlow","slow","_a","z","xs","sm","md","lg","xl","enum_1","require","settings_1","__importDefault","mintUtil","windowWidth","decimal","document","body","getBoundingClientRect","width","window","innerWidth","debounce","func","wait","arguments","undefined","timer","e","clearTimeout","setTimeout","debounceEvent","throttle","options","context","args","result","timeout","previous","later","leading","Date","getTime","apply","throttled","now","remaining","trailing","throttleEvent","show","el","from","Top","style","display","requestAnimationFrame","Bottom","height","scrollHeight","scrollWidth","hide","transition","copyText","text","textArea","createElement","value","cssText","appendChild","select","setSelectionRange","navigator","clipboard","writeText","removeChild","isEmail","match"],"sourceRoot":""}
|