@appartmint/mint 0.15.11 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/css/mint.css +17 -17
  2. package/dist/css/mint.css.map +1 -1
  3. package/dist/css/mint.min.css +1 -1
  4. package/dist/css/mint.min.css.map +1 -1
  5. package/dist/js/imports/components/header.d.ts +2 -2
  6. package/dist/js/imports/components/header.d.ts.map +1 -1
  7. package/dist/js/imports/components/index.d.ts +5 -0
  8. package/dist/js/imports/components/index.d.ts.map +1 -0
  9. package/dist/js/imports/enums/index.d.ts +5 -0
  10. package/dist/js/imports/enums/index.d.ts.map +1 -0
  11. package/dist/js/imports/{enum.d.ts → enums/side.d.ts} +2 -2
  12. package/dist/js/imports/enums/side.d.ts.map +1 -0
  13. package/dist/js/imports/index.d.ts +8 -0
  14. package/dist/js/imports/index.d.ts.map +1 -0
  15. package/dist/js/imports/models/index.d.ts +6 -0
  16. package/dist/js/imports/models/index.d.ts.map +1 -0
  17. package/dist/js/imports/models/item.d.ts +6 -6
  18. package/dist/js/imports/util/display.d.ts +20 -2
  19. package/dist/js/imports/util/display.d.ts.map +1 -1
  20. package/dist/js/imports/util/event.d.ts +36 -2
  21. package/dist/js/imports/util/event.d.ts.map +1 -1
  22. package/dist/js/imports/util/icon.d.ts +2 -2
  23. package/dist/js/imports/util/index.d.ts +15 -0
  24. package/dist/js/imports/util/index.d.ts.map +1 -0
  25. package/dist/js/imports/util/list.d.ts +2 -2
  26. package/dist/js/imports/util/math.d.ts +2 -2
  27. package/dist/js/imports/util/object.d.ts +2 -2
  28. package/dist/js/imports/util/scroll.d.ts +2 -2
  29. package/dist/js/imports/util/selectors.d.ts +2 -2
  30. package/dist/js/imports/util/settings.d.ts +2 -2
  31. package/dist/js/imports/util/settings.d.ts.map +1 -1
  32. package/dist/js/imports/util/text.d.ts +15 -2
  33. package/dist/js/imports/util/text.d.ts.map +1 -1
  34. package/dist/js/imports/util/window.d.ts +7 -2
  35. package/dist/js/imports/util/window.d.ts.map +1 -1
  36. package/dist/js/index.d.ts +1 -16
  37. package/dist/js/index.d.ts.map +1 -1
  38. package/dist/js/index.js +541 -475
  39. package/dist/js/index.js.map +1 -1
  40. package/dist/js/index.min.js +1 -1
  41. package/dist/js/index.min.js.map +1 -1
  42. package/package.json +1 -1
  43. package/src/scss/imports/components/_buttons.scss +1 -1
  44. package/src/scss/imports/components/_cards.scss +6 -6
  45. package/src/scss/imports/global/_global.scss +2 -2
  46. package/src/scss/imports/global/_inputs.scss +1 -1
  47. package/src/ts/imports/components/header.ts +34 -29
  48. package/src/ts/imports/components/index.ts +4 -0
  49. package/src/ts/imports/enums/index.ts +4 -0
  50. package/src/ts/imports/{enum.ts → enums/side.ts} +1 -1
  51. package/src/ts/imports/index.ts +7 -0
  52. package/src/ts/imports/models/index.ts +5 -0
  53. package/src/ts/imports/models/item.ts +6 -6
  54. package/src/ts/imports/util/display.ts +67 -2
  55. package/src/ts/imports/util/event.ts +88 -2
  56. package/src/ts/imports/util/icon.ts +2 -2
  57. package/src/ts/imports/util/index.ts +14 -0
  58. package/src/ts/imports/util/list.ts +2 -2
  59. package/src/ts/imports/util/math.ts +2 -2
  60. package/src/ts/imports/util/object.ts +3 -3
  61. package/src/ts/imports/util/scroll.ts +2 -2
  62. package/src/ts/imports/util/selectors.ts +3 -3
  63. package/src/ts/imports/util/settings.ts +2 -3
  64. package/src/ts/imports/util/text.ts +43 -2
  65. package/src/ts/imports/util/window.ts +10 -3
  66. package/src/ts/index.ts +1 -25
  67. package/dist/js/imports/enum.d.ts.map +0 -1
  68. package/dist/js/util.d.ts +0 -78
  69. package/dist/js/util.d.ts.map +0 -1
  70. package/dist/js/util.js +0 -399
  71. package/dist/js/util.js.map +0 -1
  72. package/dist/js/util.min.js +0 -2
  73. package/dist/js/util.min.js.map +0 -1
  74. package/src/ts/util.ts +0 -209
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Functions for analyzing and manipulating text.
3
3
  */
4
- export abstract class mintText {
4
+ export abstract class MintText {
5
5
 
6
6
  /**
7
7
  * Generate a slug from a string
@@ -91,5 +91,46 @@ export abstract class mintText {
91
91
  .toLowerCase()
92
92
  .replace(/(?:^|\s)\S/g, a => a.toUpperCase());
93
93
  }
94
+
95
+ /**
96
+ * Copies the provided text to the clipboard
97
+ * @param text - the text to copy
98
+ * @returns - true if the text was successfully copied to the clipboard; else false
99
+ */
100
+ static copyText (text: string) : boolean {
101
+ let textArea: HTMLTextAreaElement = document.createElement('textarea');
102
+
103
+ if (!text || !textArea) {
104
+ return false;
105
+ }
106
+
107
+ textArea.value = text;
108
+ textArea.style.cssText = `
109
+ position: fixed;
110
+ top: 0;
111
+ left: 0;
112
+ transform: translate(-100%, -100%);
113
+ opacity: 0;
114
+ z-index: -1;
115
+ `;
116
+
117
+ document.body.appendChild(textArea);
118
+ textArea.select();
119
+ textArea.setSelectionRange(0, 99999);
120
+ navigator.clipboard.writeText(textArea.value);
121
+ document.body.removeChild(textArea);
122
+
123
+ return true;
124
+ }
125
+
126
+ /**
127
+ * Tests the validity of an email address
128
+ * @see {@link https://stackoverflow.com/questions/201323/how-can-i-validate-an-email-address-using-a-regular-expression}
129
+ * @param text - the string to test
130
+ * @returns - true if the given string is an email address; false if not
131
+ */
132
+ static isEmail (text: string) : boolean {
133
+ 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])+)\])/);
134
+ }
94
135
  };
95
- export default mintText;
136
+ export default MintText;
@@ -1,7 +1,14 @@
1
1
  /**
2
2
  * Functions related to the browser window.
3
3
  */
4
- export abstract class mintWindow {
5
-
4
+ export abstract class MintWindow {
5
+ /**
6
+ * Returns the width of the window, including fractional pixels
7
+ * @returns the width of the window
8
+ */
9
+ static width () : number {
10
+ const decimal: number = document.body.getBoundingClientRect().width % 1;
11
+ return window.innerWidth + decimal;
12
+ }
6
13
  };
7
- export default mintWindow;
14
+ export default MintWindow;
package/src/ts/index.ts CHANGED
@@ -7,28 +7,4 @@
7
7
  /**
8
8
  * Exports
9
9
  */
10
- // Enums
11
- export { mintSide } from './imports/enum';
12
-
13
- // Components
14
- export { mintHeader } from './imports/components/header';
15
-
16
- // Models
17
- export { mintColor } from './imports/models/color';
18
- export { mintItem } from './imports/models/item';
19
-
20
- // Utilities
21
- export { mintDisplay } from './imports/util/display';
22
- export { mintEvent } from './imports/util/event';
23
- export { mintIcon } from './imports/util/icon';
24
- export { mintList } from './imports/util/list';
25
- export { mintMath } from './imports/util/math';
26
- export { mintObject } from './imports/util/object';
27
- export { mintScroll } from './imports/util/scroll';
28
- export { mintText } from './imports/util/text';
29
- export { mintWindow } from './imports/util/window';
30
-
31
- // Objects
32
- export { mintSelectors } from './imports/util/selectors';
33
- export { mintSettings } from './imports/util/settings';
34
- export { mintUtil, default } from './util';
10
+ export * from './imports';
@@ -1 +0,0 @@
1
- {"version":3,"file":"enum.d.ts","sourceRoot":"","sources":["../../../src/ts/imports/enum.ts"],"names":[],"mappings":"AAAA;;GAEG;AACF,oBAAY,QAAQ;IACjB,GAAG,IAAA;IACH,KAAK,IAAA;IACL,MAAM,IAAA;IACN,IAAI,IAAA;CACP"}
package/dist/js/util.d.ts DELETED
@@ -1,78 +0,0 @@
1
- /**
2
- * Imports
3
- */
4
- import { mintSide } from './imports/enum';
5
- /**
6
- * Utility functions
7
- * @public
8
- */
9
- export declare abstract class mintUtil {
10
- /**
11
- * Returns the width of the window, including fractional pixels
12
- * @returns the width of the window
13
- */
14
- static windowWidth(): number;
15
- /**
16
- * Ensures that a function `func` is run only after not being called for `wait` milliseconds
17
- * @param func - the function to debounce
18
- * @param wait - the amount of time to wait before running the function
19
- * @returns - the debounced function
20
- */
21
- static debounce(func: Function, wait?: number): Function;
22
- /**
23
- * Ensures that a function `func` is run only after not being called for `wait` milliseconds
24
- * @param func - the function to debounce
25
- * @param wait - the amount of time to wait before running the function
26
- * @returns - the debounced function as an EventListener
27
- */
28
- static debounceEvent(func: Function, wait?: number): EventListener;
29
- /**
30
- * Ensures that a function `func` is called at most every `wait` milliseconds with optional leading and trailing calls
31
- * @param func - the function to throttle
32
- * @param wait - the amount of time between function calls
33
- * @param options - leading and trailing options: default = \{ leading: true, trailing, true \}
34
- * @returns - the throttled function
35
- */
36
- static throttle(func: Function, wait?: number, options?: {
37
- [key: string]: boolean;
38
- }): Function;
39
- /**
40
- * Ensures that a function `func` is called at most every `wait` milliseconds with optional leading and trailing calls
41
- * @param func - the function to throttle
42
- * @param wait - the amount of time between function calls
43
- * @param options - leading and trailing options: default = \{ leading: true, trailing, true \}
44
- * @returns - the throttled function as an EventListener
45
- */
46
- static throttleEvent(func: Function, wait?: number, options?: {
47
- [key: string]: boolean;
48
- }): EventListener;
49
- /**
50
- * Sets the element's height to its `innerHeight`, then to `auto` after a delay
51
- * @param el - the element whose height will be set
52
- * @param delay - the amount of time in milliseconds that the show animation will be active
53
- * @param from - the side that the element is animating from
54
- */
55
- static show(el?: HTMLElement | null, delay?: number, from?: mintSide): void;
56
- /**
57
- * Sets the element's height to 0
58
- * @param el - the element whose height will be set
59
- * @param delay - the amount of time in milliseconds that the show animation will be active
60
- * @param from - the side that the element is animating from
61
- */
62
- static hide(el?: HTMLElement | null, delay?: number, from?: mintSide): void;
63
- /**
64
- * Copies the provided text to the clipboard
65
- * @param text - the text to copy
66
- * @returns - true if the text was successfully copied to the clipboard; else false
67
- */
68
- static copyText(text: string): boolean;
69
- /**
70
- * Tests the validity of an email address
71
- * @see {@link https://stackoverflow.com/questions/201323/how-can-i-validate-an-email-address-using-a-regular-expression}
72
- * @param text - the string to test
73
- * @returns - true if the given string is an email address; false if not
74
- */
75
- static isEmail(text: string): boolean;
76
- }
77
- export default mintUtil;
78
- //# sourceMappingURL=util.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/ts/util.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG1C;;;GAGG;AACH,8BAAsB,QAAQ;IAC1B;;;OAGG;IACH,MAAM,CAAC,WAAW,IAAM,MAAM;IAK9B;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,GAAE,MAAmC,GAAI,QAAQ;IAUtF;;;;;OAKG;IACH,MAAM,CAAC,aAAa,CAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,GAAE,MAAmC,GAAI,aAAa;IAIhG;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,CAAE,IAAI,EAAE,QAAQ,EACd,IAAI,GAAE,MAAmC,EACzC,OAAO,CAAC,EAAE;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAC,GAAI,QAAQ;IAsC/D;;;;;;OAMG;IACH,MAAM,CAAC,aAAa,CAAE,IAAI,EAAE,QAAQ,EACd,IAAI,GAAE,MAAmC,EACzC,OAAO,CAAC,EAAE;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAC,GAAI,aAAa;IAIzE;;;;;OAKG;IACH,MAAM,CAAC,IAAI,CAAE,EAAE,CAAC,EAAE,WAAW,GAAG,IAAI,EAAE,KAAK,GAAE,MAAmC,EAAE,IAAI,GAAE,QAAuB,GAAI,IAAI;IAqBvH;;;;;OAKG;IACH,MAAM,CAAC,IAAI,CAAE,EAAE,CAAC,EAAE,WAAW,GAAG,IAAI,EAAE,KAAK,GAAE,MAAmC,EAAE,IAAI,GAAE,QAAuB,GAAI,IAAI;IA4BvH;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAE,IAAI,EAAE,MAAM,GAAI,OAAO;IA0BxC;;;;;OAKG;IACH,MAAM,CAAC,OAAO,CAAE,IAAI,EAAE,MAAM,GAAI,OAAO;CAG1C;AACD,eAAe,QAAQ,CAAC"}
package/dist/js/util.js DELETED
@@ -1,399 +0,0 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory();
4
- else if(typeof define === 'function' && define.amd)
5
- define([], factory);
6
- else if(typeof exports === 'object')
7
- exports["mintUtil"] = factory();
8
- else
9
- root["mintUtil"] = factory();
10
- })(this, () => {
11
- return /******/ (() => { // webpackBootstrap
12
- /******/ "use strict";
13
- /******/ var __webpack_modules__ = ({
14
-
15
- /***/ "./src/ts/imports/enum.ts":
16
- /*!********************************!*\
17
- !*** ./src/ts/imports/enum.ts ***!
18
- \********************************/
19
- /***/ ((__unused_webpack_module, exports) => {
20
-
21
-
22
-
23
- Object.defineProperty(exports, "__esModule", ({
24
- value: true
25
- }));
26
- exports.mintSide = void 0;
27
- /**
28
- * Side Enum
29
- */
30
- var mintSide;
31
- (function (mintSide) {
32
- mintSide[mintSide["Top"] = 0] = "Top";
33
- mintSide[mintSide["Right"] = 1] = "Right";
34
- mintSide[mintSide["Bottom"] = 2] = "Bottom";
35
- mintSide[mintSide["Left"] = 3] = "Left";
36
- })(mintSide = exports.mintSide || (exports.mintSide = {}));
37
- ;
38
-
39
- /***/ }),
40
-
41
- /***/ "./src/ts/imports/util/settings.ts":
42
- /*!*****************************************!*\
43
- !*** ./src/ts/imports/util/settings.ts ***!
44
- \*****************************************/
45
- /***/ ((__unused_webpack_module, exports) => {
46
-
47
-
48
-
49
- var _a;
50
- Object.defineProperty(exports, "__esModule", ({
51
- value: true
52
- }));
53
- exports.mintSettings = void 0;
54
- /**
55
- * Settings management
56
- * @public
57
- */
58
- class mintSettings {
59
- /**
60
- * Update the provided settings variables
61
- * @param settings - Object of settings variables to update
62
- */
63
- static set(settings) {
64
- let newDelay = false;
65
- if (typeof settings.delayBase === 'number') {
66
- this.delayBase = settings.delayBase;
67
- newDelay = true;
68
- }
69
- if (typeof settings.delayStep === 'number') {
70
- this.delayStep = settings.delayStep;
71
- newDelay = true;
72
- }
73
- if (newDelay) {
74
- this.setDelay();
75
- }
76
- if (settings.delay && Object.keys(settings.delay).length) {
77
- if (Object.values(settings.delay).reduce((prev, next) => prev && typeof next === 'number', true)) {
78
- this.delay = Object.assign(Object.assign({}, this.delay), settings.delay);
79
- }
80
- }
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
- }
85
- }
86
- }
87
- /**
88
- * Updates the delay variables based on `this.delayBase` and `this.delayStep`
89
- */
90
- static setDelay() {
91
- this.delay = {
92
- instant: this.delayBase + this.delayStep * 0,
93
- fast: this.delayBase + this.delayStep * 1,
94
- medFast: this.delayBase + this.delayStep * 2,
95
- default: this.delayBase + this.delayStep * 3,
96
- medSlow: this.delayBase + this.delayStep * 4,
97
- slow: this.delayBase + this.delayStep * 5
98
- };
99
- }
100
- }
101
- exports.mintSettings = mintSettings;
102
- _a = mintSettings;
103
- /**
104
- * Value added to all delay variables
105
- */
106
- mintSettings.delayBase = 0;
107
- /**
108
- * Value multiplied by delay variable index
109
- */
110
- mintSettings.delayStep = 100;
111
- /**
112
- * Delay variables
113
- */
114
- mintSettings.delay = {
115
- instant: _a.delayBase + _a.delayStep * 0,
116
- fast: _a.delayBase + _a.delayStep * 1,
117
- medFast: _a.delayBase + _a.delayStep * 2,
118
- default: _a.delayBase + _a.delayStep * 3,
119
- medSlow: _a.delayBase + _a.delayStep * 4,
120
- slow: _a.delayBase + _a.delayStep * 5
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
- };
133
- ;
134
- exports["default"] = mintSettings;
135
-
136
- /***/ }),
137
-
138
- /***/ "./src/ts/util.ts":
139
- /*!************************!*\
140
- !*** ./src/ts/util.ts ***!
141
- \************************/
142
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
143
-
144
-
145
-
146
- var __importDefault = this && this.__importDefault || function (mod) {
147
- return mod && mod.__esModule ? mod : {
148
- "default": mod
149
- };
150
- };
151
- Object.defineProperty(exports, "__esModule", ({
152
- value: true
153
- }));
154
- exports.mintUtil = void 0;
155
- /**
156
- * Imports
157
- */
158
- const enum_1 = __webpack_require__(/*! ./imports/enum */ "./src/ts/imports/enum.ts");
159
- const settings_1 = __importDefault(__webpack_require__(/*! ./imports/util/settings */ "./src/ts/imports/util/settings.ts"));
160
- /**
161
- * Utility functions
162
- * @public
163
- */
164
- class mintUtil {
165
- /**
166
- * Returns the width of the window, including fractional pixels
167
- * @returns the width of the window
168
- */
169
- static windowWidth() {
170
- const decimal = document.body.getBoundingClientRect().width % 1;
171
- return window.innerWidth + decimal;
172
- }
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
178
- */
179
- static debounce(func) {
180
- let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
181
- let timer;
182
- return function (e) {
183
- if (timer) {
184
- clearTimeout(timer);
185
- }
186
- timer = setTimeout(func, wait, e);
187
- };
188
- }
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
194
- */
195
- static debounceEvent(func) {
196
- let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
197
- return mintUtil.debounce(func, wait);
198
- }
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
205
- */
206
- static throttle(func) {
207
- let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
208
- let options = arguments.length > 2 ? arguments[2] : undefined;
209
- let context,
210
- args,
211
- result,
212
- timeout,
213
- previous = 0,
214
- later = function () {
215
- previous = (options === null || options === void 0 ? void 0 : options.leading) === false ? 0 : new Date().getTime();
216
- timeout = 0;
217
- result = func.apply(context, args);
218
- if (!timeout) {
219
- context = args = null;
220
- }
221
- },
222
- throttled = function () {
223
- let now = new Date().getTime();
224
- if (!previous && (options === null || options === void 0 ? void 0 : options.leading) === false) {
225
- previous = now;
226
- }
227
- let remaining = wait - now + previous;
228
- context = this;
229
- args = arguments;
230
- if (remaining <= 0 || remaining > wait) {
231
- if (timeout) {
232
- clearTimeout(timeout);
233
- timeout = 0;
234
- }
235
- previous = now;
236
- result = func.apply(context, args);
237
- if (!timeout) {
238
- context = args = null;
239
- }
240
- } else if (!timeout && (options === null || options === void 0 ? void 0 : options.trailing) !== false) {
241
- timeout = window.setTimeout(later, remaining);
242
- }
243
- return result;
244
- };
245
- return throttled;
246
- }
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
253
- */
254
- static throttleEvent(func) {
255
- let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
256
- let options = arguments.length > 2 ? arguments[2] : undefined;
257
- return mintUtil.throttle(func, wait, options);
258
- }
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
264
- */
265
- static show(el) {
266
- let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
267
- let from = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : enum_1.mintSide.Top;
268
- if (el) {
269
- el.style.display = '';
270
- requestAnimationFrame(() => {
271
- if (from === enum_1.mintSide.Top || from === enum_1.mintSide.Bottom) {
272
- el.style.height = `${el.scrollHeight}px`;
273
- } else {
274
- el.style.width = `${el.scrollWidth}px`;
275
- }
276
- setTimeout(() => {
277
- if (from === enum_1.mintSide.Top || from === enum_1.mintSide.Bottom) {
278
- el.style.height = 'auto';
279
- } else {
280
- el.style.width = 'auto';
281
- }
282
- }, delay);
283
- });
284
- }
285
- }
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
291
- */
292
- static hide(el) {
293
- let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
294
- let from = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : enum_1.mintSide.Top;
295
- if (el) {
296
- let height = el.scrollHeight,
297
- width = el.scrollWidth,
298
- transition = el.style.transition;
299
- el.style.transition = '';
300
- requestAnimationFrame(() => {
301
- if (from === enum_1.mintSide.Top || from === enum_1.mintSide.Bottom) {
302
- el.style.height = `${height}px`;
303
- } else {
304
- el.style.width = `${width}px`;
305
- }
306
- el.style.transition = transition;
307
- requestAnimationFrame(() => {
308
- if (from === enum_1.mintSide.Top || from === enum_1.mintSide.Bottom) {
309
- el.style.height = '0';
310
- } else {
311
- el.style.width = '0';
312
- }
313
- });
314
- });
315
- setTimeout(() => {
316
- el.style.display = 'none';
317
- }, delay);
318
- }
319
- }
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
324
- */
325
- static copyText(text) {
326
- let textArea = document.createElement('textarea');
327
- if (!text || !textArea) {
328
- return false;
329
- }
330
- textArea.value = text;
331
- textArea.style.cssText = `
332
- position: fixed;
333
- top: 0;
334
- left: 0;
335
- transform: translate(-100%, -100%);
336
- opacity: 0;
337
- z-index: -1;
338
- `;
339
- document.body.appendChild(textArea);
340
- textArea.select();
341
- textArea.setSelectionRange(0, 99999);
342
- navigator.clipboard.writeText(textArea.value);
343
- document.body.removeChild(textArea);
344
- return true;
345
- }
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
351
- */
352
- static isEmail(text) {
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-]*[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])+)\])/);
354
- }
355
- }
356
- exports.mintUtil = mintUtil;
357
- exports["default"] = mintUtil;
358
-
359
- /***/ })
360
-
361
- /******/ });
362
- /************************************************************************/
363
- /******/ // The module cache
364
- /******/ var __webpack_module_cache__ = {};
365
- /******/
366
- /******/ // The require function
367
- /******/ function __webpack_require__(moduleId) {
368
- /******/ // Check if module is in cache
369
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
370
- /******/ if (cachedModule !== undefined) {
371
- /******/ return cachedModule.exports;
372
- /******/ }
373
- /******/ // Create a new module (and put it into the cache)
374
- /******/ var module = __webpack_module_cache__[moduleId] = {
375
- /******/ // no module.id needed
376
- /******/ // no module.loaded needed
377
- /******/ exports: {}
378
- /******/ };
379
- /******/
380
- /******/ // Execute the module function
381
- /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
382
- /******/
383
- /******/ // Return the exports of the module
384
- /******/ return module.exports;
385
- /******/ }
386
- /******/
387
- /************************************************************************/
388
- /******/
389
- /******/ // startup
390
- /******/ // Load entry module and return exports
391
- /******/ // This entry module is referenced by other modules so it can't be inlined
392
- /******/ var __webpack_exports__ = __webpack_require__("./src/ts/util.ts");
393
- /******/ __webpack_exports__ = __webpack_exports__["default"];
394
- /******/
395
- /******/ return __webpack_exports__;
396
- /******/ })()
397
- ;
398
- });
399
- //# sourceMappingURL=util.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"js/util.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;;;;;;;;;;;;ACVA;;;AAGC,IAAYA,QAKZ;AALA,WAAYA,QAAQ;EACjBA,QAAA,CAAAA,QAAA,oBAAG;EACHA,QAAA,CAAAA,QAAA,wBAAK;EACLA,QAAA,CAAAA,QAAA,0BAAM;EACNA,QAAA,CAAAA,QAAA,sBAAI;AACR,CAAC,EALYA,QAAQ,GAARC,OAAA,CAAAD,QAAQ,KAARC,gBAAQ;AAKpB;;;;;;;;;;;;;;;;;ACRD;;;;AAIA,MAAsBC,YAAY;EAmC9B;;;;EAIA,OAAOC,GAAGA,CAAEC,QAA8B;IACtC,IAAIC,QAAQ,GAAY,KAAK;IAC7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MAnC,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 ","/**\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 * 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":""}
@@ -1,2 +0,0 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.mintUtil=t():e.mintUtil=t()}(this,(()=>(()=>{"use strict";var e={64:(e,t)=>{var i;Object.defineProperty(t,"__esModule",{value:!0}),t.mintSide=void 0,(i=t.mintSide||(t.mintSide={}))[i.Top=0]="Top",i[i.Right=1]="Right",i[i.Bottom=2]="Bottom",i[i.Left=3]="Left"},110:(e,t)=>{var i;Object.defineProperty(t,"__esModule",{value:!0}),t.mintSettings=void 0;class a{static set(e){let t=!1;"number"==typeof e.delayBase&&(this.delayBase=e.delayBase,t=!0),"number"==typeof e.delayStep&&(this.delayStep=e.delayStep,t=!0),t&&this.setDelay(),e.delay&&Object.keys(e.delay).length&&Object.values(e.delay).reduce(((e,t)=>e&&"number"==typeof t),!0)&&(this.delay=Object.assign(Object.assign({},this.delay),e.delay)),e.break&&Object.keys(e.break).length&&Object.values(e.break).reduce(((e,t)=>e&&"number"==typeof t),!0)&&(this.break=Object.assign(Object.assign({},this.break),e.break))}static setDelay(){this.delay={instant:this.delayBase+0*this.delayStep,fast:this.delayBase+1*this.delayStep,medFast:this.delayBase+2*this.delayStep,default:this.delayBase+3*this.delayStep,medSlow:this.delayBase+4*this.delayStep,slow:this.delayBase+5*this.delayStep}}}t.mintSettings=a,i=a,a.delayBase=0,a.delayStep=100,a.delay={instant:i.delayBase+0*i.delayStep,fast:i.delayBase+1*i.delayStep,medFast:i.delayBase+2*i.delayStep,default:i.delayBase+3*i.delayStep,medSlow:i.delayBase+4*i.delayStep,slow:i.delayBase+5*i.delayStep},a.break={z:0,xs:480,sm:768,md:1024,lg:1200,xl:1440},t.default=a},427:function(e,t,i){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.mintUtil=void 0;const l=i(64),d=a(i(110));class n{static windowWidth(){const e=document.body.getBoundingClientRect().width%1;return window.innerWidth+e}static debounce(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d.default.delay.default;return function(a){t&&clearTimeout(t),t=setTimeout(e,i,a)}}static debounceEvent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d.default.delay.default;return n.debounce(e,t)}static throttle(e){let t,i,a,l,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d.default.delay.default,s=arguments.length>2?arguments[2]:void 0,o=0,r=function(){o=!1===(null==s?void 0:s.leading)?0:(new Date).getTime(),l=0,a=e.apply(t,i),l||(t=i=null)};return function(){let d=(new Date).getTime();o||!1!==(null==s?void 0:s.leading)||(o=d);let u=n-d+o;return t=this,i=arguments,u<=0||u>n?(l&&(clearTimeout(l),l=0),o=d,a=e.apply(t,i),l||(t=i=null)):l||!1===(null==s?void 0:s.trailing)||(l=window.setTimeout(r,u)),a}}static throttleEvent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d.default.delay.default,i=arguments.length>2?arguments[2]:void 0;return n.throttle(e,t,i)}static show(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d.default.delay.default,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.mintSide.Top;e&&(e.style.display="",requestAnimationFrame((()=>{i===l.mintSide.Top||i===l.mintSide.Bottom?e.style.height=`${e.scrollHeight}px`:e.style.width=`${e.scrollWidth}px`,setTimeout((()=>{i===l.mintSide.Top||i===l.mintSide.Bottom?e.style.height="auto":e.style.width="auto"}),t)})))}static hide(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d.default.delay.default,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.mintSide.Top;if(e){let a=e.scrollHeight,d=e.scrollWidth,n=e.style.transition;e.style.transition="",requestAnimationFrame((()=>{i===l.mintSide.Top||i===l.mintSide.Bottom?e.style.height=`${a}px`:e.style.width=`${d}px`,e.style.transition=n,requestAnimationFrame((()=>{i===l.mintSide.Top||i===l.mintSide.Bottom?e.style.height="0":e.style.width="0"}))})),setTimeout((()=>{e.style.display="none"}),t)}}static copyText(e){let t=document.createElement("textarea");return!(!e||!t||(t.value=e,t.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n transform: translate(-100%, -100%);\n opacity: 0;\n z-index: -1;\n ",document.body.appendChild(t),t.select(),t.setSelectionRange(0,99999),navigator.clipboard.writeText(t.value),document.body.removeChild(t),0))}static isEmail(e){return null!==e.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])+)\])/)}}t.mintUtil=n,t.default=n}},t={},i=function i(a){var l=t[a];if(void 0!==l)return l.exports;var d=t[a]={exports:{}};return e[a].call(d.exports,d,d.exports,i),d.exports}(427);return i.default})()));
2
- //# sourceMappingURL=util.min.js.map