meticulous-ui 3.2.5 → 3.2.6
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 +13 -73
- package/package.json +1 -1
- package/utils/buildURL.js +9 -0
- package/utils/cancelablePromise.js +17 -0
- package/utils/clearStorage.js +6 -0
- package/utils/debounce.js +9 -0
- package/utils/detectOutsideClick.js +10 -0
- package/utils/focusElement.js +7 -0
- package/utils/getCurrentPath.js +4 -0
- package/utils/getLocalStorage.js +11 -0
- package/utils/getQueryParams.js +9 -0
- package/utils/getSessionStorage.js +11 -0
- package/utils/index.js +167 -94
- package/utils/isActiveRoute.js +4 -0
- package/utils/lazyLoadComponent.js +5 -0
- package/utils/lockBodyScroll.js +6 -0
- package/utils/measureElement.js +7 -0
- package/utils/memoize.js +12 -0
- package/utils/parallel.js +4 -0
- package/utils/rafThrottle.js +11 -0
- package/utils/redirectTo.js +6 -0
- package/utils/removeLocalStorage.js +6 -0
- package/utils/removeQueryParam.js +7 -0
- package/utils/requestIdleTask.js +6 -0
- package/utils/retry.js +13 -0
- package/utils/safeAsync.js +10 -0
- package/utils/scrollToElement.js +7 -0
- package/utils/scrollToTop.js +6 -0
- package/utils/sequential.js +9 -0
- package/utils/setLocalStorage.js +9 -0
- package/utils/setQueryParam.js +7 -0
- package/utils/setSessionStorage.js +9 -0
- package/utils/sleep.js +4 -0
- package/utils/throttle.js +10 -0
- package/utils/toggleFullscreen.js +7 -0
- package/utils/unlockBodyScroll.js +6 -0
- package/utils/withTimeout.js +9 -0
package/README.md
CHANGED
|
@@ -142,79 +142,19 @@ import blue from 'meticulous-ui/colors/blue';
|
|
|
142
142
|
|
|
143
143
|
## 📦 Utils
|
|
144
144
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
|
148
|
-
|
|
|
149
|
-
| `
|
|
150
|
-
| `
|
|
151
|
-
| `
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
|
156
|
-
|
|
|
157
|
-
|
|
|
158
|
-
| `mergeDeep` | `(target, source) → object` | Deep-merges source into target; source wins on conflicts |
|
|
159
|
-
| `pick` | `(obj, keys) → object` | Returns a new object with only the specified keys |
|
|
160
|
-
| `omit` | `(obj, keys) → object` | Returns a new object without the specified keys |
|
|
161
|
-
| `isEmpty` | `(value) → boolean` | `true` for `null`, `undefined`, `""`, `[]`, `{}` |
|
|
162
|
-
| `isEqual` | `(a, b) → boolean` | Deep structural equality — handles objects, arrays, and Dates |
|
|
163
|
-
| `hasEqualProps` | `(oldProps, newProps) → boolean` | Deep equality ignoring function-valued keys; ideal for `React.memo` |
|
|
164
|
-
| `isNonEmptyArray` | `(arr) → boolean` | `true` only when the value is an array with at least one element |
|
|
165
|
-
| `flattenObject` | `(obj, prefix?) → object` | Collapses nested object to dot-notation keys |
|
|
166
|
-
| `groupBy` | `(array, key) → object` | Groups array items into an object of arrays keyed by a field or function |
|
|
167
|
-
| `keyBy` | `(array, key) → object` | Converts an array into a lookup object keyed by a field or function |
|
|
168
|
-
| `uniqueBy` | `(array, key) → array` | Removes duplicates by a field or function; first occurrence wins |
|
|
169
|
-
| `sortBy` | `(array, key) → array` | Ascending sort by a field or function; non-mutating |
|
|
170
|
-
| `chunk` | `(array, size) → array[]` | Splits array into consecutive chunks of the given size |
|
|
171
|
-
|
|
172
|
-
### String Utilities
|
|
173
|
-
|
|
174
|
-
| Function | Signature | Description |
|
|
175
|
-
| ------------------- | ----------------------- | ------------------------------------------------------------------- |
|
|
176
|
-
| `capFirstLetter` | `(str) → string` | Takes a string and returns with first letter capitalised |
|
|
177
|
-
| `capitalize` | `(str) → string` | Uppercases first character, lowercases the rest |
|
|
178
|
-
| `titleCase` | `(str) → string` | Capitalizes the first letter of every word |
|
|
179
|
-
| `camelCase` | `(str) → string` | Converts to `camelCase` from spaces, hyphens, or underscores |
|
|
180
|
-
| `snakeCase` | `(str) → string` | Converts to `snake_case` from camelCase, spaces, or hyphens |
|
|
181
|
-
| `kebabCase` | `(str) → string` | Converts to `kebab-case` from camelCase, spaces, or underscores |
|
|
182
|
-
| `truncate` | `(str, limit) → string` | Trims to `limit` characters and appends `…` |
|
|
183
|
-
| `slugify` | `(str) → string` | URL-safe slug — strips diacritics, removes special chars |
|
|
184
|
-
| `removeExtraSpaces` | `(str) → string` | Trims and collapses internal whitespace runs to a single space |
|
|
185
|
-
| `maskEmail` | `(str) → string` | Shows only the first character of the local part, e.g. `j***@x.com` |
|
|
186
|
-
| `maskPhone` | `(str) → string` | Masks all digits except the last four; preserves formatting chars |
|
|
187
|
-
| `generateInitials` | `(name) → string` | Extracts uppercased first letter of each word, e.g. `"JD"` |
|
|
188
|
-
|
|
189
|
-
### Device Utilities
|
|
190
|
-
|
|
191
|
-
| Function | Signature | Description |
|
|
192
|
-
| ----------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------ |
|
|
193
|
-
| `isMobile` | `() → boolean` | `true` when the UA matches any known mobile platform |
|
|
194
|
-
| `isIOS` | `() → boolean` | `true` on iPhone, iPad, and iPod; handles iPadOS 13+ UA quirk |
|
|
195
|
-
| `isAndroid` | `() → boolean` | `true` when the UA string contains `Android` |
|
|
196
|
-
| `isSafari` | `() → boolean` | `true` for genuine Safari; excludes Chrome/Android which also include "Safari" |
|
|
197
|
-
| `isDarkMode` | `() → boolean` | `true` when the OS/browser prefers dark color scheme |
|
|
198
|
-
| `isOnline` | `() → boolean` | `true` when the browser reports network connectivity |
|
|
199
|
-
| `copyToClipboard` | `(text: string) → Promise<void>` | Copies text using Clipboard API with `execCommand` fallback |
|
|
200
|
-
| `downloadFile` | `(url: string, filename?: string) → void` | Triggers a file download; filename inferred from URL if omitted |
|
|
201
|
-
| `openInNewTab` | `(url: string) → void` | Opens URL in a new tab with `noopener,noreferrer` |
|
|
202
|
-
| `getScreenSize` | `() → { width, height, deviceWidth, deviceHeight, pixelRatio }` | Returns viewport size, physical screen size, and device pixel ratio |
|
|
203
|
-
|
|
204
|
-
### Validation Utilities
|
|
205
|
-
|
|
206
|
-
| Function | Signature | Description |
|
|
207
|
-
| ------------------ | ---------------------- | ------------------------------------------------------------------------- |
|
|
208
|
-
| `isEmail` | `(value) → boolean` | Valid email — must have local part, `@`, and domain with dot |
|
|
209
|
-
| `isPhone` | `(value) → boolean` | Plausible phone — optional `+`, 7–15 digits, allows spaces/hyphens/parens |
|
|
210
|
-
| `isURL` | `(value) → boolean` | Valid `http` or `https` URL via native `URL` constructor |
|
|
211
|
-
| `isPasswordStrong` | `(value) → boolean` | 8+ chars with uppercase, lowercase, digit, and special character |
|
|
212
|
-
| `isPAN` | `(value) → boolean` | Indian PAN — `AAAAA0000A` (5 letters, 4 digits, 1 letter) |
|
|
213
|
-
| `isAadhaar` | `(value) → boolean` | Indian Aadhaar — 12 digits, first digit non-zero; strips spaces |
|
|
214
|
-
| `isGST` | `(value) → boolean` | Indian GSTIN — 2-digit state code + PAN + entity digit + `Z` + check char |
|
|
215
|
-
| `isRequired` | `(value) → boolean` | `false` for `null`, `undefined`, blank strings, and empty arrays |
|
|
216
|
-
| `minLength` | `(value, n) → boolean` | `true` when `value.length >= n` |
|
|
217
|
-
| `maxLength` | `(value, n) → boolean` | `true` when `value.length <= n` |
|
|
145
|
+
| Category | Functions |
|
|
146
|
+
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
147
|
+
| **String** | `capFirstLetter` `capitalize` `titleCase` `camelCase` `snakeCase` `kebabCase` `slugify` `truncate` `removeExtraSpaces` `maskEmail` `maskPhone` `generateInitials` |
|
|
148
|
+
| **Number** | `clamp` `formatCurrency` `formatNumber` `formatCompactNumber` `percentage` `randomInt` `randomBetween` `randomValue` `roundTo` |
|
|
149
|
+
| **Date-Time** | `formatDate` `formatTime` `addDays` `differenceInDays` `isToday` `isPast` `timeAgo` `getGreetingByTime` `countdown` |
|
|
150
|
+
| **Data** | `deepClone` `mergeDeep` `pick` `omit` `isEmpty` `isEqual` `hasEqualProps` `isNonEmptyArray` `flattenObject` `groupBy` `keyBy` `uniqueBy` `sortBy` `chunk` `compose` |
|
|
151
|
+
| **Validation** | `isEmail` `isPhone` `isURL` `isPasswordStrong` `isPAN` `isAadhaar` `isGST` `isRequired` `minLength` `maxLength` |
|
|
152
|
+
| **Device** | `isMobile` `isIOS` `isAndroid` `isSafari` `isDarkMode` `isOnline` `copyToClipboard` `downloadFile` `openInNewTab` `getScreenSize` |
|
|
153
|
+
| **Storage** | `setLocalStorage` `getLocalStorage` `removeLocalStorage` `setSessionStorage` `getSessionStorage` `clearStorage` |
|
|
154
|
+
| **Routing** | `getQueryParams` `setQueryParam` `removeQueryParam` `buildURL` `redirectTo` `getCurrentPath` `isActiveRoute` |
|
|
155
|
+
| **UI** | `scrollToTop` `scrollToElement` `lockBodyScroll` `unlockBodyScroll` `toggleFullscreen` `focusElement` `detectOutsideClick` `measureElement` |
|
|
156
|
+
| **Performance** | `debounce` `throttle` `memoize` `lazyLoadComponent` `requestIdleTask` `rafThrottle` |
|
|
157
|
+
| **Async** | `retry` `sleep` `withTimeout` `parallel` `sequential` `safeAsync` `cancelablePromise` |
|
|
218
158
|
|
|
219
159
|
## 🌱 Features
|
|
220
160
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "meticulous-ui",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.6",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"description": "A comprehensive React UI component library with a wide range of customizable components, icons, colors, and utilities for building modern web applications.",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const t = (c) => {
|
|
2
|
+
let e = !1;
|
|
3
|
+
return {
|
|
4
|
+
promise: new Promise((n, a) => {
|
|
5
|
+
c.then(
|
|
6
|
+
(r) => e ? a({ canceled: !0 }) : n(r),
|
|
7
|
+
(r) => a(e ? { canceled: !0 } : r)
|
|
8
|
+
);
|
|
9
|
+
}),
|
|
10
|
+
cancel: () => {
|
|
11
|
+
e = !0;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
t as default
|
|
17
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const s = (t, d) => {
|
|
2
|
+
const e = (n) => {
|
|
3
|
+
const o = (t == null ? void 0 : t.current) ?? t;
|
|
4
|
+
o && !o.contains(n.target) && d(n);
|
|
5
|
+
};
|
|
6
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
s as default
|
|
10
|
+
};
|
package/utils/index.js
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
import o from "./capFirstLetter.js";
|
|
2
2
|
import r from "./capitalize.js";
|
|
3
3
|
import m from "./camelCase.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
4
|
+
import t from "./chunk.js";
|
|
5
|
+
import i from "./clamp.js";
|
|
6
|
+
import e from "./compose.js";
|
|
7
|
+
import p from "./deepClone.js";
|
|
8
|
+
import f from "./flattenObject.js";
|
|
9
9
|
import a from "./formatCompactNumber.js";
|
|
10
10
|
import s from "./formatCurrency.js";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
11
|
+
import l from "./formatDate.js";
|
|
12
|
+
import n from "./formatNumber.js";
|
|
13
|
+
import c from "./formatTime.js";
|
|
14
|
+
import u from "./generateInitials.js";
|
|
15
|
+
import d from "./getGreetingByTime.js";
|
|
16
|
+
import g from "./groupBy.js";
|
|
17
|
+
import y from "./hasEqualProps.js";
|
|
18
|
+
import S from "./addDays.js";
|
|
19
|
+
import T from "./countdown.js";
|
|
20
|
+
import k from "./differenceInDays.js";
|
|
21
|
+
import b from "./isEmpty.js";
|
|
22
|
+
import h from "./isEqual.js";
|
|
23
|
+
import C from "./isNonEmptyArray.js";
|
|
24
|
+
import P from "./isPast.js";
|
|
25
|
+
import E from "./isToday.js";
|
|
26
|
+
import L from "./kebabCase.js";
|
|
27
|
+
import B from "./keyBy.js";
|
|
28
28
|
import A from "./maskEmail.js";
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
29
|
+
import q from "./maskPhone.js";
|
|
30
|
+
import w from "./mergeDeep.js";
|
|
31
|
+
import I from "./omit.js";
|
|
32
|
+
import D from "./percentage.js";
|
|
33
|
+
import N from "./pick.js";
|
|
34
|
+
import v from "./randomBetween.js";
|
|
35
|
+
import x from "./randomInt.js";
|
|
36
36
|
import z from "./randomValue.js";
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import
|
|
37
|
+
import O from "./removeExtraSpaces.js";
|
|
38
|
+
import R from "./roundTo.js";
|
|
39
|
+
import F from "./slugify.js";
|
|
40
|
+
import Q from "./snakeCase.js";
|
|
41
|
+
import G from "./sortBy.js";
|
|
42
|
+
import M from "./timeAgo.js";
|
|
43
43
|
import U from "./titleCase.js";
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import
|
|
48
|
-
import
|
|
44
|
+
import j from "./truncate.js";
|
|
45
|
+
import V from "./uniqueBy.js";
|
|
46
|
+
import H from "./isEmail.js";
|
|
47
|
+
import J from "./isPhone.js";
|
|
48
|
+
import K from "./isURL.js";
|
|
49
49
|
import W from "./isPasswordStrong.js";
|
|
50
50
|
import X from "./isPAN.js";
|
|
51
51
|
import Y from "./isAadhaar.js";
|
|
@@ -55,68 +55,102 @@ import $ from "./minLength.js";
|
|
|
55
55
|
import oo from "./maxLength.js";
|
|
56
56
|
import ro from "./isMobile.js";
|
|
57
57
|
import mo from "./isIOS.js";
|
|
58
|
-
import
|
|
59
|
-
import
|
|
60
|
-
import
|
|
61
|
-
import
|
|
62
|
-
import
|
|
58
|
+
import to from "./isAndroid.js";
|
|
59
|
+
import io from "./isSafari.js";
|
|
60
|
+
import eo from "./isDarkMode.js";
|
|
61
|
+
import po from "./isOnline.js";
|
|
62
|
+
import fo from "./copyToClipboard.js";
|
|
63
63
|
import ao from "./downloadFile.js";
|
|
64
64
|
import so from "./openInNewTab.js";
|
|
65
|
-
import
|
|
66
|
-
|
|
65
|
+
import lo from "./getScreenSize.js";
|
|
66
|
+
import no from "./getQueryParams.js";
|
|
67
|
+
import co from "./setQueryParam.js";
|
|
68
|
+
import uo from "./removeQueryParam.js";
|
|
69
|
+
import go from "./buildURL.js";
|
|
70
|
+
import yo from "./redirectTo.js";
|
|
71
|
+
import So from "./getCurrentPath.js";
|
|
72
|
+
import To from "./isActiveRoute.js";
|
|
73
|
+
import ko from "./setLocalStorage.js";
|
|
74
|
+
import bo from "./getLocalStorage.js";
|
|
75
|
+
import ho from "./removeLocalStorage.js";
|
|
76
|
+
import Co from "./setSessionStorage.js";
|
|
77
|
+
import Po from "./getSessionStorage.js";
|
|
78
|
+
import Eo from "./clearStorage.js";
|
|
79
|
+
import Lo from "./debounce.js";
|
|
80
|
+
import Bo from "./throttle.js";
|
|
81
|
+
import Ao from "./memoize.js";
|
|
82
|
+
import qo from "./lazyLoadComponent.js";
|
|
83
|
+
import wo from "./requestIdleTask.js";
|
|
84
|
+
import Io from "./rafThrottle.js";
|
|
85
|
+
import Do from "./scrollToTop.js";
|
|
86
|
+
import No from "./scrollToElement.js";
|
|
87
|
+
import vo from "./lockBodyScroll.js";
|
|
88
|
+
import xo from "./unlockBodyScroll.js";
|
|
89
|
+
import zo from "./toggleFullscreen.js";
|
|
90
|
+
import Oo from "./focusElement.js";
|
|
91
|
+
import Ro from "./detectOutsideClick.js";
|
|
92
|
+
import Fo from "./measureElement.js";
|
|
93
|
+
import Qo from "./retry.js";
|
|
94
|
+
import Go from "./sleep.js";
|
|
95
|
+
import Mo from "./withTimeout.js";
|
|
96
|
+
import Uo from "./parallel.js";
|
|
97
|
+
import jo from "./sequential.js";
|
|
98
|
+
import Vo from "./safeAsync.js";
|
|
99
|
+
import Ho from "./cancelablePromise.js";
|
|
100
|
+
const Rm = {
|
|
67
101
|
// string
|
|
68
102
|
capFirstLetter: o,
|
|
69
103
|
capitalize: r,
|
|
70
104
|
camelCase: m,
|
|
71
|
-
generateInitials:
|
|
72
|
-
kebabCase:
|
|
105
|
+
generateInitials: u,
|
|
106
|
+
kebabCase: L,
|
|
73
107
|
maskEmail: A,
|
|
74
|
-
maskPhone:
|
|
75
|
-
removeExtraSpaces:
|
|
76
|
-
slugify:
|
|
77
|
-
snakeCase:
|
|
108
|
+
maskPhone: q,
|
|
109
|
+
removeExtraSpaces: O,
|
|
110
|
+
slugify: F,
|
|
111
|
+
snakeCase: Q,
|
|
78
112
|
titleCase: U,
|
|
79
|
-
truncate:
|
|
113
|
+
truncate: j,
|
|
80
114
|
// number
|
|
81
|
-
clamp:
|
|
115
|
+
clamp: i,
|
|
82
116
|
formatCompactNumber: a,
|
|
83
117
|
formatCurrency: s,
|
|
84
|
-
formatNumber:
|
|
85
|
-
percentage:
|
|
86
|
-
randomBetween:
|
|
87
|
-
randomInt:
|
|
118
|
+
formatNumber: n,
|
|
119
|
+
percentage: D,
|
|
120
|
+
randomBetween: v,
|
|
121
|
+
randomInt: x,
|
|
88
122
|
randomValue: z,
|
|
89
|
-
roundTo:
|
|
123
|
+
roundTo: R,
|
|
90
124
|
// date-time
|
|
91
|
-
addDays:
|
|
92
|
-
countdown:
|
|
93
|
-
differenceInDays:
|
|
94
|
-
formatDate:
|
|
95
|
-
formatTime:
|
|
96
|
-
getGreetingByTime:
|
|
97
|
-
isPast:
|
|
98
|
-
isToday:
|
|
99
|
-
timeAgo:
|
|
125
|
+
addDays: S,
|
|
126
|
+
countdown: T,
|
|
127
|
+
differenceInDays: k,
|
|
128
|
+
formatDate: l,
|
|
129
|
+
formatTime: c,
|
|
130
|
+
getGreetingByTime: d,
|
|
131
|
+
isPast: P,
|
|
132
|
+
isToday: E,
|
|
133
|
+
timeAgo: M,
|
|
100
134
|
// object / array
|
|
101
|
-
chunk:
|
|
102
|
-
compose:
|
|
103
|
-
deepClone:
|
|
104
|
-
flattenObject:
|
|
105
|
-
groupBy:
|
|
106
|
-
hasEqualProps:
|
|
107
|
-
isEmpty:
|
|
108
|
-
isEqual:
|
|
109
|
-
isNonEmptyArray:
|
|
110
|
-
keyBy:
|
|
111
|
-
mergeDeep:
|
|
112
|
-
omit:
|
|
113
|
-
pick:
|
|
114
|
-
sortBy:
|
|
115
|
-
uniqueBy:
|
|
135
|
+
chunk: t,
|
|
136
|
+
compose: e,
|
|
137
|
+
deepClone: p,
|
|
138
|
+
flattenObject: f,
|
|
139
|
+
groupBy: g,
|
|
140
|
+
hasEqualProps: y,
|
|
141
|
+
isEmpty: b,
|
|
142
|
+
isEqual: h,
|
|
143
|
+
isNonEmptyArray: C,
|
|
144
|
+
keyBy: B,
|
|
145
|
+
mergeDeep: w,
|
|
146
|
+
omit: I,
|
|
147
|
+
pick: N,
|
|
148
|
+
sortBy: G,
|
|
149
|
+
uniqueBy: V,
|
|
116
150
|
// validation
|
|
117
|
-
isEmail:
|
|
118
|
-
isPhone:
|
|
119
|
-
isURL:
|
|
151
|
+
isEmail: H,
|
|
152
|
+
isPhone: J,
|
|
153
|
+
isURL: K,
|
|
120
154
|
isPasswordStrong: W,
|
|
121
155
|
isPAN: X,
|
|
122
156
|
isAadhaar: Y,
|
|
@@ -127,15 +161,54 @@ const Tr = {
|
|
|
127
161
|
// device
|
|
128
162
|
isMobile: ro,
|
|
129
163
|
isIOS: mo,
|
|
130
|
-
isAndroid:
|
|
131
|
-
isSafari:
|
|
132
|
-
isDarkMode:
|
|
133
|
-
isOnline:
|
|
134
|
-
copyToClipboard:
|
|
164
|
+
isAndroid: to,
|
|
165
|
+
isSafari: io,
|
|
166
|
+
isDarkMode: eo,
|
|
167
|
+
isOnline: po,
|
|
168
|
+
copyToClipboard: fo,
|
|
135
169
|
downloadFile: ao,
|
|
136
170
|
openInNewTab: so,
|
|
137
|
-
getScreenSize:
|
|
171
|
+
getScreenSize: lo,
|
|
172
|
+
// routing
|
|
173
|
+
getQueryParams: no,
|
|
174
|
+
setQueryParam: co,
|
|
175
|
+
removeQueryParam: uo,
|
|
176
|
+
buildURL: go,
|
|
177
|
+
redirectTo: yo,
|
|
178
|
+
getCurrentPath: So,
|
|
179
|
+
isActiveRoute: To,
|
|
180
|
+
// storage
|
|
181
|
+
setLocalStorage: ko,
|
|
182
|
+
getLocalStorage: bo,
|
|
183
|
+
removeLocalStorage: ho,
|
|
184
|
+
setSessionStorage: Co,
|
|
185
|
+
getSessionStorage: Po,
|
|
186
|
+
clearStorage: Eo,
|
|
187
|
+
// performance
|
|
188
|
+
debounce: Lo,
|
|
189
|
+
throttle: Bo,
|
|
190
|
+
memoize: Ao,
|
|
191
|
+
lazyLoadComponent: qo,
|
|
192
|
+
requestIdleTask: wo,
|
|
193
|
+
rafThrottle: Io,
|
|
194
|
+
// ui / dom
|
|
195
|
+
scrollToTop: Do,
|
|
196
|
+
scrollToElement: No,
|
|
197
|
+
lockBodyScroll: vo,
|
|
198
|
+
unlockBodyScroll: xo,
|
|
199
|
+
toggleFullscreen: zo,
|
|
200
|
+
focusElement: Oo,
|
|
201
|
+
detectOutsideClick: Ro,
|
|
202
|
+
measureElement: Fo,
|
|
203
|
+
// async / api
|
|
204
|
+
retry: Qo,
|
|
205
|
+
sleep: Go,
|
|
206
|
+
withTimeout: Mo,
|
|
207
|
+
parallel: Uo,
|
|
208
|
+
sequential: jo,
|
|
209
|
+
safeAsync: Vo,
|
|
210
|
+
cancelablePromise: Ho
|
|
138
211
|
};
|
|
139
212
|
export {
|
|
140
|
-
|
|
213
|
+
Rm as default
|
|
141
214
|
};
|
package/utils/memoize.js
ADDED
package/utils/retry.js
ADDED
package/utils/sleep.js
ADDED