@capsitech/react-utilities 0.1.4 → 0.1.5

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 (45) hide show
  1. package/lib/Components/SuspenseRoute.d.ts +7 -7
  2. package/lib/Components/SuspenseRoute.js +29 -29
  3. package/lib/Components/index.d.ts +1 -1
  4. package/lib/Components/index.js +1 -1
  5. package/lib/Hooks/index.d.ts +45 -45
  6. package/lib/Hooks/index.js +98 -98
  7. package/lib/Hooks/useInfiniteScroll.d.ts +7 -7
  8. package/lib/Hooks/useInfiniteScroll.js +22 -22
  9. package/lib/Hooks/useNetworkState.d.ts +67 -67
  10. package/lib/Hooks/useNetworkState.js +41 -41
  11. package/lib/Hooks/useShortcuts.d.ts +4 -4
  12. package/lib/Hooks/useShortcuts.js +91 -91
  13. package/lib/Utilities/ApiUtility.axios.d.ts +60 -60
  14. package/lib/Utilities/ApiUtility.axios.js +305 -305
  15. package/lib/Utilities/BrowserInfo.d.ts +74 -74
  16. package/lib/Utilities/BrowserInfo.js +153 -153
  17. package/lib/Utilities/Countries.d.ts +14 -14
  18. package/lib/Utilities/Countries.js +290 -290
  19. package/lib/Utilities/CustomEventEmitter.d.ts +12 -12
  20. package/lib/Utilities/CustomEventEmitter.js +30 -30
  21. package/lib/Utilities/FastCompare.d.ts +1 -1
  22. package/lib/Utilities/FastCompare.js +128 -128
  23. package/lib/Utilities/HideablePromise.d.ts +5 -5
  24. package/lib/Utilities/HideablePromise.js +10 -10
  25. package/lib/Utilities/LoadScripts.d.ts +9 -9
  26. package/lib/Utilities/LoadScripts.js +51 -51
  27. package/lib/Utilities/MTDFraudPrevention.d.ts +28 -28
  28. package/lib/Utilities/MTDFraudPrevention.js +157 -157
  29. package/lib/Utilities/Nationalities.d.ts +5 -5
  30. package/lib/Utilities/Nationalities.js +245 -245
  31. package/lib/Utilities/RouteUtils.d.ts +129 -120
  32. package/lib/Utilities/RouteUtils.js +223 -206
  33. package/lib/Utilities/TimeZones.d.ts +10 -10
  34. package/lib/Utilities/TimeZones.js +1069 -1069
  35. package/lib/Utilities/Types.d.ts +19 -19
  36. package/lib/Utilities/Types.js +1 -1
  37. package/lib/Utilities/Utils.d.ts +174 -174
  38. package/lib/Utilities/Utils.js +331 -331
  39. package/lib/Utilities/dayjs.d.ts +18 -18
  40. package/lib/Utilities/dayjs.js +56 -56
  41. package/lib/Utilities/index.d.ts +14 -14
  42. package/lib/Utilities/index.js +14 -14
  43. package/lib/index.d.ts +3 -3
  44. package/lib/index.js +3 -3
  45. package/package.json +12 -25
@@ -1,120 +1,129 @@
1
- import React from "react";
2
- import { RouteProps } from "react-router-dom";
3
- export declare enum FeatureStatus {
4
- placeholder = 0,
5
- alpha = 1,
6
- beta = 2,
7
- release = 3
8
- }
9
- export interface IRouteProps extends RouteProps {
10
- name?: string;
11
- path?: string;
12
- url?: string;
13
- key?: string | number;
14
- icon?: string;
15
- isCategory?: boolean;
16
- children?: React.ReactNode;
17
- /**
18
- * The component to render for this route's content (or a loading placeholder if `getComponent` is provided).
19
- */
20
- component?: any;
21
- /**
22
- * Function that loads the component asynchronously.
23
- * Notify when loading has finished using `cb`.
24
- * If `component` is provided, it will be rendered while waiting for the callback.
25
- */
26
- getComponent?: (cb: (component: any) => void) => void;
27
- /**
28
- * User roles to check for route rendering
29
- */
30
- roles?: string[];
31
- /**
32
- * Practice features to check for route rendering
33
- */
34
- features?: number[];
35
- /**
36
- * Business types to check for route rendering
37
- */
38
- businessTypes?: number[];
39
- /**
40
- * User config/tags to check for route rendering
41
- */
42
- userConfig?: string[];
43
- /**
44
- * User params to check for route rendering
45
- */
46
- userParams?: string[];
47
- /**
48
- * Other tags to check for route rendering
49
- */
50
- tags?: string[];
51
- /**
52
- * Sub/inner links
53
- */
54
- links?: IRouteProps[];
55
- /**
56
- * Other URL to show this link as active
57
- */
58
- activeUrl?: string;
59
- /**
60
- * Other URLs to show this link as active
61
- */
62
- activeUrls?: string[];
63
- /**
64
- * Default expanded or collapsed
65
- */
66
- isExpanded?: boolean;
67
- /**
68
- * Feature status (to show bedge on link)
69
- */
70
- status?: FeatureStatus;
71
- }
72
- export interface IRouteGroupProps {
73
- /**
74
- * Links to render within this group
75
- */
76
- links: IRouteProps[];
77
- /**
78
- * User roles to check for route rendering
79
- */
80
- roles?: string[];
81
- /**
82
- * Practice features to check for route rendering
83
- */
84
- features?: number[];
85
- /**
86
- * User config/tags to check for route rendering
87
- */
88
- userConfig?: string[];
89
- /**
90
- * Other tags to check for route rendering
91
- */
92
- tags?: string[];
93
- /**
94
- * Other URL to show this link as active
95
- */
96
- activeUrls?: string[];
97
- /**
98
- * Default expanded or collapsed
99
- */
100
- isExpanded?: boolean;
101
- }
102
- declare class RouteUtilsBase {
103
- private hasValidRole;
104
- private hasValidFeatures;
105
- private hasValidBusinessType;
106
- private hasValidUserConfig;
107
- private hasValidUserParam;
108
- private hasValidTags;
109
- private isValidLink;
110
- private getPath;
111
- getRoutesFromGroups: (groups: IRouteGroupProps[], SecureRoute: any, roles?: string[], features?: number[], businessType?: number, userConfig?: any, userParams?: any, tags?: any, trimUrl?: string) => any[];
112
- getRoutesFromGroup: (links: IRouteProps[], SecureRoute: any, roles?: string[], features?: number[], businessType?: number, userConfig?: any, userParams?: any, tags?: any, trimUrl?: string) => any[];
113
- getLinksFromGroups: (links: IRouteGroupProps[], roles?: string[], features?: number[], businessType?: number, userConfig?: any, userParams?: any, currentPath?: string, params?: any, tags?: any) => IRouteGroupProps[];
114
- getLinksFromGroup: (links: IRouteProps[], roles?: string[], features?: number[], businessType?: number, userConfig?: any, userParams?: any, currentPath?: string, params?: any, tags?: any) => IRouteProps[];
115
- getRoutesFromLinks: (links: IRouteProps[], SecureRoute: any, roles?: string[], features?: number[], businessType?: number, userConfig?: any, userParams?: any, tags?: any, trimUrl?: string) => any[];
116
- getLinksFromLinks: (links: IRouteProps[], roles?: string[], features?: number[], businessType?: number, userConfig?: any, userParams?: any, currentPath?: string, params?: any, tags?: any) => IRouteProps[];
117
- getSelectedNavKey: (pagesGroup: IRouteGroupProps[], currentPath: string) => string | number | undefined;
118
- }
119
- export declare const RouteUtils: RouteUtilsBase;
120
- export {};
1
+ import React from "react";
2
+ export declare enum FeatureStatus {
3
+ placeholder = 0,
4
+ alpha = 1,
5
+ beta = 2,
6
+ release = 3
7
+ }
8
+ export interface IRouteProps {
9
+ name?: string;
10
+ path?: string;
11
+ url?: string;
12
+ key?: string | number;
13
+ icon?: string;
14
+ isCategory?: boolean;
15
+ children?: React.ReactNode;
16
+ /**
17
+ * The component to render for this route's content (or a loading placeholder if `getComponent` is provided).
18
+ */
19
+ component?: any;
20
+ /**
21
+ * Function that loads the component asynchronously.
22
+ * Notify when loading has finished using `cb`.
23
+ * If `component` is provided, it will be rendered while waiting for the callback.
24
+ */
25
+ getComponent?: (cb: (component: any) => void) => void;
26
+ /**
27
+ * User roles to check for route rendering
28
+ */
29
+ roles?: string[];
30
+ /**
31
+ * User permissions to check for route rendering
32
+ */
33
+ permissions?: string[];
34
+ /**
35
+ * Practice features to check for route rendering
36
+ */
37
+ features?: number[];
38
+ /**
39
+ * Business types to check for route rendering
40
+ */
41
+ businessTypes?: number[];
42
+ /**
43
+ * User config/tags to check for route rendering
44
+ */
45
+ userConfig?: string[];
46
+ /**
47
+ * User params to check for route rendering
48
+ */
49
+ userParams?: string[];
50
+ /**
51
+ * Other tags to check for route rendering
52
+ */
53
+ tags?: string[];
54
+ /**
55
+ * Sub/inner links
56
+ */
57
+ links?: IRouteProps[];
58
+ /**
59
+ * Other URL to show this link as active
60
+ */
61
+ activeUrl?: string;
62
+ /**
63
+ * Other URLs to show this link as active
64
+ */
65
+ activeUrls?: string[];
66
+ /**
67
+ * Default expanded or collapsed
68
+ */
69
+ isExpanded?: boolean;
70
+ /**
71
+ * Feature status (to show bedge on link)
72
+ */
73
+ status?: FeatureStatus;
74
+ }
75
+ export interface IRouteGroupProps {
76
+ /**
77
+ * Links to render within this group
78
+ */
79
+ links: IRouteProps[];
80
+ /**
81
+ * User roles to check for route rendering
82
+ */
83
+ roles?: string[];
84
+ /**
85
+ * User permissions to check for route rendering
86
+ */
87
+ permissions?: string[];
88
+ /**
89
+ * Practice features to check for route rendering
90
+ */
91
+ features?: number[];
92
+ /**
93
+ * User config/tags to check for route rendering
94
+ */
95
+ userConfig?: string[];
96
+ /**
97
+ * Other tags to check for route rendering
98
+ */
99
+ tags?: string[];
100
+ /**
101
+ * Other URL to show this link as active
102
+ */
103
+ activeUrls?: string[];
104
+ /**
105
+ * Default expanded or collapsed
106
+ */
107
+ isExpanded?: boolean;
108
+ }
109
+ declare class RouteUtilsBase {
110
+ private hasValidRole;
111
+ private hasValidPermission;
112
+ private hasValidRoleOrPermission;
113
+ private hasValidFeatures;
114
+ private hasValidBusinessType;
115
+ private hasValidUserConfig;
116
+ private hasValidUserParam;
117
+ private hasValidTags;
118
+ private isValidLink;
119
+ private getPath;
120
+ getRoutesFromGroups: (groups: IRouteGroupProps[], SecureRoute: any, userRoles?: string[], userPermissions?: string[], features?: number[], businessType?: number, userConfig?: any, userParams?: any, tags?: any, trimUrl?: string) => any[];
121
+ getRoutesFromGroup: (links: IRouteProps[], SecureRoute: any, userRoles?: string[], userPermissions?: string[], features?: number[], businessType?: number, userConfig?: any, userParams?: any, tags?: any, trimUrl?: string) => any[];
122
+ getLinksFromGroups: (links: IRouteGroupProps[], userRoles?: string[], userPermissions?: string[], features?: number[], businessType?: number, userConfig?: any, userParams?: any, currentPath?: string, params?: any, tags?: any) => IRouteGroupProps[];
123
+ getLinksFromGroup: (links: IRouteProps[], userRoles?: string[], userPermissions?: string[], features?: number[], businessType?: number, userConfig?: any, userParams?: any, currentPath?: string, params?: any, tags?: any) => IRouteProps[];
124
+ getRoutesFromLinks: (links: IRouteProps[], SecureRoute: any, userRoles?: string[], userPermissions?: string[], features?: number[], businessType?: number, userConfig?: any, userParams?: any, tags?: any, trimUrl?: string) => any[];
125
+ getLinksFromLinks: (links: IRouteProps[], userRoles?: string[], userPermissions?: string[], features?: number[], businessType?: number, userConfig?: any, userParams?: any, currentPath?: string, params?: any, tags?: any) => IRouteProps[];
126
+ getSelectedNavKey: (pagesGroup: IRouteGroupProps[], currentPath: string) => string | number | undefined;
127
+ }
128
+ export declare const RouteUtils: RouteUtilsBase;
129
+ export {};