meticulous-ui 3.2.7 → 3.2.8
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 +26 -0
- package/index.js +26 -22
- package/package.json +1 -1
- package/utils/auditLog.js +12 -0
- package/utils/createPubSub.js +11 -0
- package/utils/deepFreeze.js +7 -0
- package/utils/fadeIn.js +10 -0
- package/utils/fadeOut.js +8 -0
- package/utils/featureGate.js +4 -0
- package/utils/filterByKey.js +4 -0
- package/utils/fuzzySearch.js +16 -0
- package/utils/identity.js +4 -0
- package/utils/index.js +153 -103
- package/utils/logInfo.js +8 -0
- package/utils/logWarn.js +8 -0
- package/utils/measurePerformance.js +12 -0
- package/utils/multiSort.js +11 -0
- package/utils/noop.js +5 -0
- package/utils/once.js +7 -0
- package/utils/paginate.js +13 -0
- package/utils/permissionGuard.js +4 -0
- package/utils/pipe.js +4 -0
- package/utils/singleton.js +7 -0
- package/utils/smoothScroll.js +14 -0
- package/utils/trackEvent.js +8 -0
- package/utils/trackPageView.js +12 -0
- package/utils/waitForTransitionEnd.js +9 -0
package/README.md
CHANGED
|
@@ -159,6 +159,32 @@ import blue from 'meticulous-ui/colors/blue';
|
|
|
159
159
|
| **Error Handling** | `logError`, `captureException`, `safeJSONParse`, `safeJSONStringify`, `fallback` |
|
|
160
160
|
| **Auth** | `isAuthenticated`, `getToken`, `setToken`, `removeToken`, `decodeJWT`, `hasPermission` |
|
|
161
161
|
| **Feature Flags** | `isFeatureEnabled`, `getVariant` |
|
|
162
|
+
| **Enterprise** | `trackEvent`, `trackPageView`, `measurePerformance`, `featureGate`, `permissionGuard`, `auditLog`, `logInfo`, `logWarn`, `captureException` |
|
|
163
|
+
| **Filter** | `fuzzySearch`, `filterByKey`, `multiSort`, `paginate` |
|
|
164
|
+
| **Animation** | `fadeIn`, `fadeOut`, `smoothScroll`, `waitForTransitionEnd` |
|
|
165
|
+
| **Function** | `once`, `noop`, `identity`, `pipe`, `singleton`, `createPubSub`, `deepFreeze` |
|
|
166
|
+
|
|
167
|
+
## 📦 React Helper Functions
|
|
168
|
+
|
|
169
|
+
| Function | Description |
|
|
170
|
+
| ------------------- | ---------------------------------------------------------------------------------- |
|
|
171
|
+
| `createContextHook` | Creates a React context + typed hook pair; throws if consumed outside its Provider |
|
|
172
|
+
| `composeProviders` | Merges N provider components into one wrapper, eliminating the provider pyramid |
|
|
173
|
+
| `lazyImport` | Extends `React.lazy` to work with named exports, not just default exports |
|
|
174
|
+
| `withErrorBoundary` | HOC wrapping a component in an error boundary with a configurable fallback |
|
|
175
|
+
| `withSuspense` | HOC wrapping a component in `<Suspense>` with a co-located fallback UI |
|
|
176
|
+
| `memoCompare` | Typed wrapper around `React.memo` with a custom equality comparator |
|
|
177
|
+
| `createPortalNode` | Creates and appends a DOM node to `document.body` for use as a portal container |
|
|
178
|
+
|
|
179
|
+
## 📦 Hooks
|
|
180
|
+
|
|
181
|
+
| Category | Hooks |
|
|
182
|
+
| --------------- | --------------------------------------------------------------------------------------------------------------------- |
|
|
183
|
+
| **State** | `usePrevious`, `useDebounce`, `useThrottle`, `useToggle` |
|
|
184
|
+
| **Lifecycle** | `useIsMounted`, `useUnmount`, `useFirstRender`, `useTimeout`, `useInterval` |
|
|
185
|
+
| **DOM/Browser** | `useEventListener`, `useIntersectionObserver`, `useMediaQuery`, `useOutsideClick`, `useWindowSize`, `useOnlineStatus` |
|
|
186
|
+
| **Storage** | `useLocalStorage`, `useSessionStorage` |
|
|
187
|
+
| **Utility** | `useCopyToClipboard` |
|
|
162
188
|
|
|
163
189
|
## 🌱 Features
|
|
164
190
|
|
package/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { default as a } from "./components/Pagination/Pagination.js";
|
|
2
2
|
import { default as r, ToastContainer as f } from "./components/Toast/Toast.js";
|
|
3
|
-
import { default as
|
|
4
|
-
import { default as
|
|
3
|
+
import { default as l } from "./components/Spinner/Spinner.js";
|
|
4
|
+
import { default as d } from "./components/Loader/Loader.js";
|
|
5
5
|
import { default as m } from "./components/PageLoader/PageLoader.js";
|
|
6
6
|
import { default as n } from "./components/OtpInput/OtpInput.js";
|
|
7
7
|
import { default as c } from "./components/Dropdown/Dropdown.js";
|
|
8
8
|
import { default as C } from "./components/RootComponent/RootComponent.js";
|
|
9
9
|
import { default as T } from "./components/Selectbox/Selectbox.js";
|
|
10
|
-
import { default as
|
|
11
|
-
import { default as
|
|
12
|
-
import { default as
|
|
13
|
-
import { default as
|
|
14
|
-
import { default as
|
|
15
|
-
import { default as
|
|
16
|
-
import { default as
|
|
17
|
-
import { default as
|
|
10
|
+
import { default as I } from "./components/Button/Button.js";
|
|
11
|
+
import { default as b } from "./components/Timer/Timer.js";
|
|
12
|
+
import { default as L } from "./components/Shimmer/Shimmer.js";
|
|
13
|
+
import { default as U } from "./components/VideoPlayer/VideoPlayer.js";
|
|
14
|
+
import { default as y } from "./components/Image/Image.js";
|
|
15
|
+
import { default as D } from "./components/Carousel/Carousel.js";
|
|
16
|
+
import { default as G } from "./components/Typography/Headings/index.js";
|
|
17
|
+
import { default as O } from "./components/Typography/P/P.js";
|
|
18
18
|
import { default as j } from "./components/Input/Input/Input.js";
|
|
19
19
|
import { default as v } from "./components/Input/Textarea/Textarea.js";
|
|
20
20
|
import { default as A } from "./components/Input/Checkbox/Checkbox.js";
|
|
@@ -22,32 +22,36 @@ import { default as J } from "./components/Input/RadioGroup/RadioGroup.js";
|
|
|
22
22
|
import { default as M } from "./components/Input/FileUploader/FileUploader.js";
|
|
23
23
|
import { default as Q } from "./colors/index.js";
|
|
24
24
|
import { default as X } from "./utils/index.js";
|
|
25
|
-
import { default as Z } from "./
|
|
25
|
+
import { default as Z } from "./hooks/index.js";
|
|
26
|
+
import { default as $ } from "./react-utils/index.js";
|
|
27
|
+
import { default as eo } from "./components/Icons/index.js";
|
|
26
28
|
export {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
I as Button,
|
|
30
|
+
D as Carousel,
|
|
29
31
|
A as Checkbox,
|
|
30
32
|
c as Dropdown,
|
|
31
33
|
M as FileUploader,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
G as Headings,
|
|
35
|
+
y as Image,
|
|
34
36
|
j as Input,
|
|
35
|
-
|
|
37
|
+
d as Loader,
|
|
36
38
|
n as OtpInput,
|
|
37
|
-
|
|
39
|
+
O as P,
|
|
38
40
|
m as PageLoader,
|
|
39
41
|
a as Pagination,
|
|
40
42
|
J as RadioGroup,
|
|
41
43
|
C as RootComponent,
|
|
42
44
|
T as Selectbox,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
L as Shimmer,
|
|
46
|
+
l as Spinner,
|
|
45
47
|
v as Textarea,
|
|
46
|
-
|
|
48
|
+
b as Timer,
|
|
47
49
|
r as Toast,
|
|
48
50
|
f as ToastContainer,
|
|
49
|
-
|
|
51
|
+
U as VideoPlayer,
|
|
50
52
|
Q as colors,
|
|
51
|
-
Z as
|
|
53
|
+
Z as hooks,
|
|
54
|
+
eo as icons,
|
|
55
|
+
$ as reactUtils,
|
|
52
56
|
X as utils
|
|
53
57
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "meticulous-ui",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.8",
|
|
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,12 @@
|
|
|
1
|
+
const t = (n, o = {}) => {
|
|
2
|
+
const e = {
|
|
3
|
+
action: n,
|
|
4
|
+
metadata: o,
|
|
5
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
6
|
+
user: typeof window < "u" ? window.__currentUser ?? null : null
|
|
7
|
+
};
|
|
8
|
+
return typeof window < "u" && typeof window.__auditLogger == "function" ? window.__auditLogger(e) : console.log("[auditLog]", e), e;
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
t as default
|
|
12
|
+
};
|
package/utils/fadeIn.js
ADDED
package/utils/fadeOut.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const u = (r, o) => {
|
|
2
|
+
if (!o) return r;
|
|
3
|
+
const n = o.toLowerCase(), s = (t) => {
|
|
4
|
+
let e = 0;
|
|
5
|
+
const f = t.toLowerCase();
|
|
6
|
+
for (const c of n) {
|
|
7
|
+
if (e = f.indexOf(c, e), e === -1) return !1;
|
|
8
|
+
e++;
|
|
9
|
+
}
|
|
10
|
+
return !0;
|
|
11
|
+
};
|
|
12
|
+
return r.filter((t) => typeof t == "string" ? s(t) : Object.values(t).some((e) => typeof e == "string" && s(e)));
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
u as default
|
|
16
|
+
};
|
package/utils/index.js
CHANGED
|
@@ -7,8 +7,8 @@ import e from "./compose.js";
|
|
|
7
7
|
import p from "./deepClone.js";
|
|
8
8
|
import f from "./flattenObject.js";
|
|
9
9
|
import a from "./formatCompactNumber.js";
|
|
10
|
-
import
|
|
11
|
-
import
|
|
10
|
+
import n from "./formatCurrency.js";
|
|
11
|
+
import s from "./formatDate.js";
|
|
12
12
|
import l from "./formatNumber.js";
|
|
13
13
|
import c from "./formatTime.js";
|
|
14
14
|
import d from "./generateInitials.js";
|
|
@@ -20,32 +20,32 @@ import T from "./countdown.js";
|
|
|
20
20
|
import k from "./differenceInDays.js";
|
|
21
21
|
import b from "./isEmpty.js";
|
|
22
22
|
import h from "./isEqual.js";
|
|
23
|
-
import
|
|
24
|
-
import
|
|
23
|
+
import P from "./isNonEmptyArray.js";
|
|
24
|
+
import E from "./isPast.js";
|
|
25
25
|
import C from "./isToday.js";
|
|
26
|
-
import
|
|
27
|
-
import
|
|
26
|
+
import L from "./kebabCase.js";
|
|
27
|
+
import A from "./keyBy.js";
|
|
28
28
|
import B from "./maskEmail.js";
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
29
|
+
import I from "./maskPhone.js";
|
|
30
|
+
import w from "./mergeDeep.js";
|
|
31
|
+
import N from "./omit.js";
|
|
32
32
|
import v from "./percentage.js";
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import
|
|
48
|
-
import
|
|
33
|
+
import z from "./pick.js";
|
|
34
|
+
import F from "./randomBetween.js";
|
|
35
|
+
import O from "./randomInt.js";
|
|
36
|
+
import q from "./randomValue.js";
|
|
37
|
+
import x from "./removeExtraSpaces.js";
|
|
38
|
+
import D from "./roundTo.js";
|
|
39
|
+
import R from "./slugify.js";
|
|
40
|
+
import G from "./snakeCase.js";
|
|
41
|
+
import J from "./sortBy.js";
|
|
42
|
+
import Q from "./timeAgo.js";
|
|
43
|
+
import V from "./titleCase.js";
|
|
44
|
+
import K from "./truncate.js";
|
|
45
|
+
import M from "./uniqueBy.js";
|
|
46
|
+
import U from "./isEmail.js";
|
|
47
|
+
import W from "./isPhone.js";
|
|
48
|
+
import j from "./isURL.js";
|
|
49
49
|
import H from "./isPasswordStrong.js";
|
|
50
50
|
import X from "./isPAN.js";
|
|
51
51
|
import Y from "./isAadhaar.js";
|
|
@@ -61,8 +61,8 @@ import eo from "./isDarkMode.js";
|
|
|
61
61
|
import po from "./isOnline.js";
|
|
62
62
|
import fo from "./copyToClipboard.js";
|
|
63
63
|
import ao from "./downloadFile.js";
|
|
64
|
-
import
|
|
65
|
-
import
|
|
64
|
+
import no from "./openInNewTab.js";
|
|
65
|
+
import so from "./getScreenSize.js";
|
|
66
66
|
import lo from "./getQueryParams.js";
|
|
67
67
|
import co from "./setQueryParam.js";
|
|
68
68
|
import uo from "./removeQueryParam.js";
|
|
@@ -73,32 +73,32 @@ import To from "./isActiveRoute.js";
|
|
|
73
73
|
import ko from "./setLocalStorage.js";
|
|
74
74
|
import bo from "./getLocalStorage.js";
|
|
75
75
|
import ho from "./removeLocalStorage.js";
|
|
76
|
-
import
|
|
77
|
-
import
|
|
76
|
+
import Po from "./setSessionStorage.js";
|
|
77
|
+
import Eo from "./getSessionStorage.js";
|
|
78
78
|
import Co from "./clearStorage.js";
|
|
79
|
-
import
|
|
80
|
-
import
|
|
79
|
+
import Lo from "./debounce.js";
|
|
80
|
+
import Ao from "./throttle.js";
|
|
81
81
|
import Bo from "./memoize.js";
|
|
82
|
-
import
|
|
83
|
-
import
|
|
84
|
-
import
|
|
82
|
+
import Io from "./lazyLoadComponent.js";
|
|
83
|
+
import wo from "./requestIdleTask.js";
|
|
84
|
+
import No from "./rafThrottle.js";
|
|
85
85
|
import vo from "./scrollToTop.js";
|
|
86
|
-
import
|
|
87
|
-
import
|
|
88
|
-
import
|
|
89
|
-
import
|
|
90
|
-
import
|
|
91
|
-
import
|
|
92
|
-
import
|
|
93
|
-
import
|
|
94
|
-
import
|
|
95
|
-
import
|
|
96
|
-
import
|
|
97
|
-
import
|
|
98
|
-
import
|
|
99
|
-
import
|
|
100
|
-
import
|
|
101
|
-
import
|
|
86
|
+
import zo from "./scrollToElement.js";
|
|
87
|
+
import Fo from "./lockBodyScroll.js";
|
|
88
|
+
import Oo from "./unlockBodyScroll.js";
|
|
89
|
+
import qo from "./toggleFullscreen.js";
|
|
90
|
+
import xo from "./focusElement.js";
|
|
91
|
+
import Do from "./detectOutsideClick.js";
|
|
92
|
+
import Ro from "./measureElement.js";
|
|
93
|
+
import Go from "./announceToScreenReader.js";
|
|
94
|
+
import Jo from "./trapFocus.js";
|
|
95
|
+
import Qo from "./generateAriaId.js";
|
|
96
|
+
import Vo from "./handleKeyboardNavigation.js";
|
|
97
|
+
import Ko from "./logError.js";
|
|
98
|
+
import Mo from "./captureException.js";
|
|
99
|
+
import Uo from "./safeJSONParse.js";
|
|
100
|
+
import Wo from "./safeJSONStringify.js";
|
|
101
|
+
import jo from "./fallback.js";
|
|
102
102
|
import Ho from "./isAuthenticated.js";
|
|
103
103
|
import Xo from "./getToken.js";
|
|
104
104
|
import Yo from "./setToken.js";
|
|
@@ -114,40 +114,63 @@ import er from "./parallel.js";
|
|
|
114
114
|
import pr from "./sequential.js";
|
|
115
115
|
import fr from "./safeAsync.js";
|
|
116
116
|
import ar from "./cancelablePromise.js";
|
|
117
|
-
|
|
117
|
+
import nr from "./fuzzySearch.js";
|
|
118
|
+
import sr from "./filterByKey.js";
|
|
119
|
+
import lr from "./multiSort.js";
|
|
120
|
+
import cr from "./paginate.js";
|
|
121
|
+
import dr from "./fadeIn.js";
|
|
122
|
+
import ur from "./fadeOut.js";
|
|
123
|
+
import gr from "./smoothScroll.js";
|
|
124
|
+
import yr from "./waitForTransitionEnd.js";
|
|
125
|
+
import Sr from "./trackEvent.js";
|
|
126
|
+
import Tr from "./trackPageView.js";
|
|
127
|
+
import kr from "./measurePerformance.js";
|
|
128
|
+
import br from "./featureGate.js";
|
|
129
|
+
import hr from "./permissionGuard.js";
|
|
130
|
+
import Pr from "./auditLog.js";
|
|
131
|
+
import Er from "./logInfo.js";
|
|
132
|
+
import Cr from "./logWarn.js";
|
|
133
|
+
import Lr from "./once.js";
|
|
134
|
+
import Ar from "./noop.js";
|
|
135
|
+
import Br from "./identity.js";
|
|
136
|
+
import Ir from "./pipe.js";
|
|
137
|
+
import wr from "./singleton.js";
|
|
138
|
+
import Nr from "./createPubSub.js";
|
|
139
|
+
import vr from "./deepFreeze.js";
|
|
140
|
+
const ni = {
|
|
118
141
|
// string
|
|
119
142
|
capFirstLetter: o,
|
|
120
143
|
capitalize: r,
|
|
121
144
|
camelCase: m,
|
|
122
145
|
generateInitials: d,
|
|
123
|
-
kebabCase:
|
|
146
|
+
kebabCase: L,
|
|
124
147
|
maskEmail: B,
|
|
125
|
-
maskPhone:
|
|
126
|
-
removeExtraSpaces:
|
|
127
|
-
slugify:
|
|
128
|
-
snakeCase:
|
|
129
|
-
titleCase:
|
|
130
|
-
truncate:
|
|
148
|
+
maskPhone: I,
|
|
149
|
+
removeExtraSpaces: x,
|
|
150
|
+
slugify: R,
|
|
151
|
+
snakeCase: G,
|
|
152
|
+
titleCase: V,
|
|
153
|
+
truncate: K,
|
|
131
154
|
// number
|
|
132
155
|
clamp: i,
|
|
133
156
|
formatCompactNumber: a,
|
|
134
|
-
formatCurrency:
|
|
157
|
+
formatCurrency: n,
|
|
135
158
|
formatNumber: l,
|
|
136
159
|
percentage: v,
|
|
137
|
-
randomBetween:
|
|
138
|
-
randomInt:
|
|
139
|
-
randomValue:
|
|
140
|
-
roundTo:
|
|
160
|
+
randomBetween: F,
|
|
161
|
+
randomInt: O,
|
|
162
|
+
randomValue: q,
|
|
163
|
+
roundTo: D,
|
|
141
164
|
// date-time
|
|
142
165
|
addDays: S,
|
|
143
166
|
countdown: T,
|
|
144
167
|
differenceInDays: k,
|
|
145
|
-
formatDate:
|
|
168
|
+
formatDate: s,
|
|
146
169
|
formatTime: c,
|
|
147
170
|
getGreetingByTime: u,
|
|
148
|
-
isPast:
|
|
171
|
+
isPast: E,
|
|
149
172
|
isToday: C,
|
|
150
|
-
timeAgo:
|
|
173
|
+
timeAgo: Q,
|
|
151
174
|
// object / array
|
|
152
175
|
chunk: t,
|
|
153
176
|
compose: e,
|
|
@@ -157,17 +180,17 @@ const St = {
|
|
|
157
180
|
hasEqualProps: y,
|
|
158
181
|
isEmpty: b,
|
|
159
182
|
isEqual: h,
|
|
160
|
-
isNonEmptyArray:
|
|
161
|
-
keyBy:
|
|
162
|
-
mergeDeep:
|
|
163
|
-
omit:
|
|
164
|
-
pick:
|
|
165
|
-
sortBy:
|
|
166
|
-
uniqueBy:
|
|
183
|
+
isNonEmptyArray: P,
|
|
184
|
+
keyBy: A,
|
|
185
|
+
mergeDeep: w,
|
|
186
|
+
omit: N,
|
|
187
|
+
pick: z,
|
|
188
|
+
sortBy: J,
|
|
189
|
+
uniqueBy: M,
|
|
167
190
|
// validation
|
|
168
|
-
isEmail:
|
|
169
|
-
isPhone:
|
|
170
|
-
isURL:
|
|
191
|
+
isEmail: U,
|
|
192
|
+
isPhone: W,
|
|
193
|
+
isURL: j,
|
|
171
194
|
isPasswordStrong: H,
|
|
172
195
|
isPAN: X,
|
|
173
196
|
isAadhaar: Y,
|
|
@@ -184,8 +207,8 @@ const St = {
|
|
|
184
207
|
isOnline: po,
|
|
185
208
|
copyToClipboard: fo,
|
|
186
209
|
downloadFile: ao,
|
|
187
|
-
openInNewTab:
|
|
188
|
-
getScreenSize:
|
|
210
|
+
openInNewTab: no,
|
|
211
|
+
getScreenSize: so,
|
|
189
212
|
// routing
|
|
190
213
|
getQueryParams: lo,
|
|
191
214
|
setQueryParam: co,
|
|
@@ -198,36 +221,36 @@ const St = {
|
|
|
198
221
|
setLocalStorage: ko,
|
|
199
222
|
getLocalStorage: bo,
|
|
200
223
|
removeLocalStorage: ho,
|
|
201
|
-
setSessionStorage:
|
|
202
|
-
getSessionStorage:
|
|
224
|
+
setSessionStorage: Po,
|
|
225
|
+
getSessionStorage: Eo,
|
|
203
226
|
clearStorage: Co,
|
|
204
227
|
// performance
|
|
205
|
-
debounce:
|
|
206
|
-
throttle:
|
|
228
|
+
debounce: Lo,
|
|
229
|
+
throttle: Ao,
|
|
207
230
|
memoize: Bo,
|
|
208
|
-
lazyLoadComponent:
|
|
209
|
-
requestIdleTask:
|
|
210
|
-
rafThrottle:
|
|
231
|
+
lazyLoadComponent: Io,
|
|
232
|
+
requestIdleTask: wo,
|
|
233
|
+
rafThrottle: No,
|
|
211
234
|
// ui / dom
|
|
212
235
|
scrollToTop: vo,
|
|
213
|
-
scrollToElement:
|
|
214
|
-
lockBodyScroll:
|
|
215
|
-
unlockBodyScroll:
|
|
216
|
-
toggleFullscreen:
|
|
217
|
-
focusElement:
|
|
218
|
-
detectOutsideClick:
|
|
219
|
-
measureElement:
|
|
236
|
+
scrollToElement: zo,
|
|
237
|
+
lockBodyScroll: Fo,
|
|
238
|
+
unlockBodyScroll: Oo,
|
|
239
|
+
toggleFullscreen: qo,
|
|
240
|
+
focusElement: xo,
|
|
241
|
+
detectOutsideClick: Do,
|
|
242
|
+
measureElement: Ro,
|
|
220
243
|
// accessibility
|
|
221
|
-
announceToScreenReader:
|
|
222
|
-
trapFocus:
|
|
223
|
-
generateAriaId:
|
|
224
|
-
handleKeyboardNavigation:
|
|
244
|
+
announceToScreenReader: Go,
|
|
245
|
+
trapFocus: Jo,
|
|
246
|
+
generateAriaId: Qo,
|
|
247
|
+
handleKeyboardNavigation: Vo,
|
|
225
248
|
// error handling
|
|
226
|
-
logError:
|
|
227
|
-
captureException:
|
|
228
|
-
safeJSONParse:
|
|
229
|
-
safeJSONStringify:
|
|
230
|
-
fallback:
|
|
249
|
+
logError: Ko,
|
|
250
|
+
captureException: Mo,
|
|
251
|
+
safeJSONParse: Uo,
|
|
252
|
+
safeJSONStringify: Wo,
|
|
253
|
+
fallback: jo,
|
|
231
254
|
// auth
|
|
232
255
|
isAuthenticated: Ho,
|
|
233
256
|
getToken: Xo,
|
|
@@ -245,8 +268,35 @@ const St = {
|
|
|
245
268
|
parallel: er,
|
|
246
269
|
sequential: pr,
|
|
247
270
|
safeAsync: fr,
|
|
248
|
-
cancelablePromise: ar
|
|
271
|
+
cancelablePromise: ar,
|
|
272
|
+
// filter
|
|
273
|
+
fuzzySearch: nr,
|
|
274
|
+
filterByKey: sr,
|
|
275
|
+
multiSort: lr,
|
|
276
|
+
paginate: cr,
|
|
277
|
+
// animation
|
|
278
|
+
fadeIn: dr,
|
|
279
|
+
fadeOut: ur,
|
|
280
|
+
smoothScroll: gr,
|
|
281
|
+
waitForTransitionEnd: yr,
|
|
282
|
+
// enterprise
|
|
283
|
+
trackEvent: Sr,
|
|
284
|
+
trackPageView: Tr,
|
|
285
|
+
measurePerformance: kr,
|
|
286
|
+
featureGate: br,
|
|
287
|
+
permissionGuard: hr,
|
|
288
|
+
auditLog: Pr,
|
|
289
|
+
logInfo: Er,
|
|
290
|
+
logWarn: Cr,
|
|
291
|
+
// function
|
|
292
|
+
once: Lr,
|
|
293
|
+
noop: Ar,
|
|
294
|
+
identity: Br,
|
|
295
|
+
pipe: Ir,
|
|
296
|
+
singleton: wr,
|
|
297
|
+
createPubSub: Nr,
|
|
298
|
+
deepFreeze: vr
|
|
249
299
|
};
|
|
250
300
|
export {
|
|
251
|
-
|
|
301
|
+
ni as default
|
|
252
302
|
};
|
package/utils/logInfo.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const f = (e, t = {}) => {
|
|
2
|
+
var n;
|
|
3
|
+
const o = { level: "info", message: e, ...t, timestamp: (/* @__PURE__ */ new Date()).toISOString() };
|
|
4
|
+
return typeof window < "u" && typeof ((n = window.__logger) == null ? void 0 : n.info) == "function" ? window.__logger.info(o) : console.info("[logInfo]", o), o;
|
|
5
|
+
};
|
|
6
|
+
export {
|
|
7
|
+
f as default
|
|
8
|
+
};
|
package/utils/logWarn.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const r = (o, t = {}) => {
|
|
2
|
+
var e;
|
|
3
|
+
const n = { level: "warn", message: o, ...t, timestamp: (/* @__PURE__ */ new Date()).toISOString() };
|
|
4
|
+
return typeof window < "u" && typeof ((e = window.__logger) == null ? void 0 : e.warn) == "function" ? window.__logger.warn(n) : console.warn("[logWarn]", n), n;
|
|
5
|
+
};
|
|
6
|
+
export {
|
|
7
|
+
r as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const r = (o) => {
|
|
2
|
+
const e = typeof performance < "u" ? performance.getEntriesByName(o)[0] ?? null : null, n = {
|
|
3
|
+
metric: o,
|
|
4
|
+
duration: (e == null ? void 0 : e.duration) ?? null,
|
|
5
|
+
startTime: (e == null ? void 0 : e.startTime) ?? null,
|
|
6
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
7
|
+
};
|
|
8
|
+
return typeof window < "u" && typeof window.__performanceReporter == "function" ? window.__performanceReporter(n) : console.log("[measurePerformance]", n), n;
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
r as default
|
|
12
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const u = (f, s) => [...f].sort((o, r) => {
|
|
2
|
+
for (const { key: t, order: n = "asc" } of s) {
|
|
3
|
+
const c = typeof t == "function" ? t(o) : o[t], e = typeof t == "function" ? t(r) : r[t];
|
|
4
|
+
if (c < e) return n === "asc" ? -1 : 1;
|
|
5
|
+
if (c > e) return n === "asc" ? 1 : -1;
|
|
6
|
+
}
|
|
7
|
+
return 0;
|
|
8
|
+
});
|
|
9
|
+
export {
|
|
10
|
+
u as default
|
|
11
|
+
};
|
package/utils/noop.js
ADDED
package/utils/once.js
ADDED
package/utils/pipe.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const u = (o, i = 500) => {
|
|
2
|
+
var t;
|
|
3
|
+
const e = window.scrollY, r = (typeof o == "number" ? o : ((t = o instanceof Element ? o : document.querySelector(o)) == null ? void 0 : t.getBoundingClientRect().top) + window.scrollY) - e;
|
|
4
|
+
let n = null;
|
|
5
|
+
const s = (c) => {
|
|
6
|
+
n || (n = c);
|
|
7
|
+
const d = c - n, l = Math.min(d / i, 1), a = 1 - Math.pow(1 - l, 3);
|
|
8
|
+
window.scrollTo(0, e + r * a), l < 1 && requestAnimationFrame(s);
|
|
9
|
+
};
|
|
10
|
+
requestAnimationFrame(s);
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
u as default
|
|
14
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const a = (e, o = {}) => {
|
|
2
|
+
var n;
|
|
3
|
+
const t = { name: e, payload: o, timestamp: (/* @__PURE__ */ new Date()).toISOString() };
|
|
4
|
+
return typeof window < "u" && typeof ((n = window.__analytics) == null ? void 0 : n.track) == "function" ? window.__analytics.track(t) : console.log("[trackEvent]", t), t;
|
|
5
|
+
};
|
|
6
|
+
export {
|
|
7
|
+
a as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const o = (t) => {
|
|
2
|
+
var n;
|
|
3
|
+
const e = {
|
|
4
|
+
path: t,
|
|
5
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
6
|
+
referrer: typeof document < "u" && document.referrer || null
|
|
7
|
+
};
|
|
8
|
+
return typeof window < "u" && typeof ((n = window.__analytics) == null ? void 0 : n.page) == "function" ? window.__analytics.page(e) : console.log("[trackPageView]", e), e;
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
o as default
|
|
12
|
+
};
|