izen-react-starter 2.3.7 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +121 -0
- package/dist/{2SSKDMRQ-BWxJ7KHy.js → 2SSKDMRQ-D50rlKfr.js} +2 -2
- package/dist/{AP7HFJJL-uVnY5RPz.js → AP7HFJJL-B_liWFpt.js} +1 -1
- package/dist/{WDYDFRGG-Pjnjsi2V.js → WDYDFRGG-Cml_4Hf-.js} +2 -2
- package/dist/components/form/FormLayout.d.ts +1 -3
- package/dist/components/form/FormLayout.d.ts.map +1 -1
- package/dist/components/form/inputs/FileUpload.d.ts +1 -1
- package/dist/components/form/inputs/FileUpload.d.ts.map +1 -1
- package/dist/{index-BWKXTVrJ.js → index-Gs1Xd6jo.js} +10910 -10938
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/lib/api/axios/hooks/useAxiosAuth.d.ts +1 -1
- package/dist/lib/api/axios/hooks/useAxiosAuth.d.ts.map +1 -1
- package/dist/lib/api/queries/generic.d.ts +2 -99
- package/dist/lib/api/queries/generic.d.ts.map +1 -1
- package/dist/lib/api/queries/index.d.ts +0 -1
- package/dist/lib/api/queries/index.d.ts.map +1 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/utils.d.ts +28 -0
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/react-starter.js +1 -1
- package/dist/react-starter.umd.cjs +222 -222
- package/dist/services/apiService.d.ts +7 -0
- package/dist/services/apiService.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export { LayoutProvider, useLayout } from './contexts/LayoutContext';
|
|
|
18
18
|
export type { LayoutContextType } from './contexts/LayoutContext';
|
|
19
19
|
export { useIsMobile } from './hooks';
|
|
20
20
|
export { cn, capitalize, convertToHourMinuteString, formatErrorToList, formatDate, dateFromat, createChangeEvent, appendFormData, debounce, throttle, handleEditCache, handleSingleEditCache, createAxiosInstance, createAuthAxiosInstance, onDelete, useRefreshToken, useAxiosAuth, useAxiosHeadersUrl, useFetchSingleAxios, useGet, useGetSingle, useUploadFile, useSendEmail, } from './lib';
|
|
21
|
-
export type { CacheEditOptions, AxiosConfig, DeleteOptions, RefreshTokenResponse, UseRefreshTokenOptions, UseAxiosAuthOptions, AxiosHeadersConfig, UseFetchSingleAxiosOptions, UseFetchSingleAxiosReturn,
|
|
21
|
+
export type { CacheEditOptions, AxiosConfig, DeleteOptions, RefreshTokenResponse, UseRefreshTokenOptions, UseAxiosAuthOptions, AxiosHeadersConfig, UseFetchSingleAxiosOptions, UseFetchSingleAxiosReturn, FileUploadResponse, FileUploadParams, UseUploadFileOptions, SendEmailResponse, SendEmailParams, UseSendEmailOptions, } from './lib';
|
|
22
22
|
export { CommonActions, userCan, useAccessControl, AccessControlWrapper, withAccessControl, UpdateAccessControlWrapper, RBACProvider, useRBAC } from './rbac';
|
|
23
23
|
export type { Action, Resource, Role, RoleLabel, Rule, RoleRules, Rules, RBACConfig, UseAccessControlReturn, AccessControlWrapperProps, WithAccessControlProps, UpdateAccessControlWrapperProps, RBACProviderProps, RBACContextType } from './rbac';
|
|
24
24
|
export { AuthProvider, useAuth, ModalProvider, useModal, OverlayProvider, useOverlay, ThemeProvider, useTheme, AppProvider, queryClient } from './providers';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,aAAa,CAAC;AAGrB,cAAc,iBAAiB,CAAC;AAGhC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAGzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB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;AACf,YAAY,EACV,gBAAgB,EAEhB,WAAW,EACX,aAAa,EACb,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EAClB,0BAA0B,EAC1B,yBAAyB,EACzB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,aAAa,CAAC;AAGrB,cAAc,iBAAiB,CAAC;AAGhC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAGzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AAGpC,OAAO,EACL,OAAO,EACP,YAAY,EACZ,OAAO,IAAI,UAAU,EACrB,aAAa,EACd,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,YAAY,EACZ,iBAAiB,EACjB,YAAY,IAAI,eAAe,EAC/B,mBAAmB,IAAI,kBAAkB,EAC1C,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,UAAU,EACV,WAAW,EACX,WAAW,EACX,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,EACtB,eAAe,EACf,SAAS,EACT,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,eAAe,EACf,qBAAqB,EACrB,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,GACb,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EA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AAiB,EACjB,eAAe,EACf,IAAI,EACJ,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,EACL,gBAAgB,EACjB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC9E,YAAY,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAG3E,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGxD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -56,6 +56,6 @@ export interface UseAxiosAuthOptions {
|
|
|
56
56
|
* }
|
|
57
57
|
* ```
|
|
58
58
|
*/
|
|
59
|
-
declare const useAxiosAuth: (
|
|
59
|
+
declare const useAxiosAuth: () => AxiosInstance;
|
|
60
60
|
export default useAxiosAuth;
|
|
61
61
|
//# sourceMappingURL=useAxiosAuth.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAxiosAuth.d.ts","sourceRoot":"","sources":["../../../../../src/lib/api/axios/hooks/useAxiosAuth.ts"],"names":[],"mappings":"AACA,OAAwB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE3E,OAAO,EAAc,aAAa,EAA8B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useAxiosAuth.d.ts","sourceRoot":"","sources":["../../../../../src/lib/api/axios/hooks/useAxiosAuth.ts"],"names":[],"mappings":"AACA,OAAwB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE3E,OAAO,EAAc,aAAa,EAA8B,MAAM,OAAO,CAAC;AAI9E,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,aAAa,EAAE,aAAa,CAAC;IAC7B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B;;OAEG;IACH,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,IAAI,CAAC;CAC3D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,QAAA,MAAM,YAAY,QAAO,aAuExB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,102 +1,5 @@
|
|
|
1
1
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Cache key for the query
|
|
6
|
-
*/
|
|
7
|
-
queryKey?: string;
|
|
8
|
-
/**
|
|
9
|
-
* Query parameters
|
|
10
|
-
*/
|
|
11
|
-
params?: Record<string, any>;
|
|
12
|
-
/**
|
|
13
|
-
* Override URL (if different from key)
|
|
14
|
-
*/
|
|
15
|
-
url?: string;
|
|
16
|
-
/**
|
|
17
|
-
* Time in milliseconds until data is considered stale
|
|
18
|
-
*/
|
|
19
|
-
staleTime?: number;
|
|
20
|
-
/**
|
|
21
|
-
* Enable refetch on window focus
|
|
22
|
-
*/
|
|
23
|
-
refetchOnWindowFocus?: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* Enable refetch on mount
|
|
26
|
-
*/
|
|
27
|
-
refetchOnMount?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Enable refetch on reconnect
|
|
30
|
-
*/
|
|
31
|
-
refetchOnReconnect?: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Enable the query (useful for conditional queries)
|
|
34
|
-
*/
|
|
35
|
-
enabled?: boolean;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Generic hook to fetch multiple items
|
|
39
|
-
*
|
|
40
|
-
* @param axios - Configured axios instance
|
|
41
|
-
* @param key - Query key / API endpoint
|
|
42
|
-
* @param options - Query configuration options
|
|
43
|
-
* @returns React Query result object
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* ```tsx
|
|
47
|
-
* import { useGet } from 'izen-react-starter';
|
|
48
|
-
* import useAxiosAuth from './hooks/useAxiosAuth';
|
|
49
|
-
*
|
|
50
|
-
* function UsersList() {
|
|
51
|
-
* const axios = useAxiosAuth({ axiosInstance: myAxios });
|
|
52
|
-
* const { data, isLoading, error } = useGet(axios, '/users', {
|
|
53
|
-
* queryKey: 'users',
|
|
54
|
-
* params: { page: 1, limit: 10 }
|
|
55
|
-
* });
|
|
56
|
-
*
|
|
57
|
-
* if (isLoading) return <div>Loading...</div>;
|
|
58
|
-
* if (error) return <div>Error: {error.message}</div>;
|
|
59
|
-
*
|
|
60
|
-
* return (
|
|
61
|
-
* <ul>
|
|
62
|
-
* {data?.map(user => (
|
|
63
|
-
* <li key={user.id}>{user.name}</li>
|
|
64
|
-
* ))}
|
|
65
|
-
* </ul>
|
|
66
|
-
* );
|
|
67
|
-
* }
|
|
68
|
-
* ```
|
|
69
|
-
*/
|
|
70
|
-
declare const useGet: <T = any>(axios: AxiosInstance, key: string, options?: UseGetOptions) => UseQueryResult<T[], Error>;
|
|
71
|
-
/**
|
|
72
|
-
* Generic hook to fetch a single item
|
|
73
|
-
*
|
|
74
|
-
* @param axios - Configured axios instance
|
|
75
|
-
* @param key - Query key / API endpoint
|
|
76
|
-
* @param options - Query configuration options
|
|
77
|
-
* @returns React Query result object with single item
|
|
78
|
-
*
|
|
79
|
-
* @example
|
|
80
|
-
* ```tsx
|
|
81
|
-
* import { useGetSingle } from 'izen-react-starter';
|
|
82
|
-
* import useAxiosAuth from './hooks/useAxiosAuth';
|
|
83
|
-
*
|
|
84
|
-
* function UserDetail({ userId }) {
|
|
85
|
-
* const axios = useAxiosAuth({ axiosInstance: myAxios });
|
|
86
|
-
* const { data: user, isLoading, error } = useGetSingle(axios, `/users/${userId}`, {
|
|
87
|
-
* queryKey: `user-${userId}`,
|
|
88
|
-
* enabled: !!userId
|
|
89
|
-
* });
|
|
90
|
-
*
|
|
91
|
-
* if (isLoading) return <div>Loading...</div>;
|
|
92
|
-
* if (error) return <div>Error: {error.message}</div>;
|
|
93
|
-
*
|
|
94
|
-
* return <div>{user?.name}</div>;
|
|
95
|
-
* }
|
|
96
|
-
* ```
|
|
97
|
-
*/
|
|
98
|
-
declare const useGetSingle: <T = any>(axios: AxiosInstance, key: string, options?: UseGetOptions & {
|
|
99
|
-
defaultValue?: T;
|
|
100
|
-
}) => UseQueryResult<T, Error>;
|
|
2
|
+
declare const useGet: <T = any>(key: string, params?: any, url?: string) => UseQueryResult<T[]>;
|
|
3
|
+
declare const useGetSingle: <T = any>(key: string, params?: any, defaultValue?: T, url?: string) => UseQueryResult<T>;
|
|
101
4
|
export { useGet, useGetSingle };
|
|
102
5
|
//# sourceMappingURL=generic.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generic.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/queries/generic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,cAAc,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"generic.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/queries/generic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGjE,QAAA,MAAM,MAAM,GAAI,CAAC,GAAG,GAAG,EAAE,KAAK,MAAM,EAAE,SAAS,GAAG,EAAE,MAAM,MAAM,KAAG,cAAc,CAAC,CAAC,EAAE,CAiBpF,CAAC;AAEF,QAAA,MAAM,YAAY,GAAI,CAAC,GAAG,GAAG,EAC3B,KAAK,MAAM,EACX,SAAS,GAAG,EACZ,eAAe,CAAC,EAChB,MAAM,MAAM,KACX,cAAc,CAAC,CAAC,CAiBlB,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/queries/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/queries/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { cn, capitalize, convertToHourMinuteString, formatErrorToList, formatDate, dateFromat, createChangeEvent, appendFormData, debounce, throttle } from './utils';
|
|
1
|
+
export { cn, capitalize, convertToHourMinuteString, formatErrorToList, formatDate, dateFromat, createChangeEvent, appendFormData, buildMultipartFormData, buildRolePermissionsFormData, buildEmployeeShiftFormData, formatPayloadForEndpoint, formatAxiosData, removeHtmlTags, toUTCDateString, toUTCDateTimeString, parseTimeToMilliseconds, diffHoursFromTimestamps, subtractTimeStrings, sumTimeStrings, formatSecondsToHms, getWeekRange, debounce, throttle, } from './utils';
|
|
2
2
|
export { handleEditCache, handleSingleEditCache } from './cache-util';
|
|
3
3
|
export type { CacheEditOptions } from './cache-util';
|
|
4
4
|
export * from './api';
|
package/dist/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,EAAE,EACF,UAAU,EACV,yBAAyB,EACzB,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,sBAAsB,EACtB,4BAA4B,EAC5B,0BAA0B,EAC1B,wBAAwB,EACxB,eAAe,EACf,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,QAAQ,EACR,QAAQ,GACR,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACtE,YAAY,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGrD,cAAc,OAAO,CAAC"}
|
package/dist/lib/utils.d.ts
CHANGED
|
@@ -3,6 +3,12 @@ import { ChangeEvent } from 'react';
|
|
|
3
3
|
export declare function cn(...inputs: ClassValue[]): string;
|
|
4
4
|
export declare function capitalize(str: string): string;
|
|
5
5
|
export declare function convertToHourMinuteString(hours: number): string;
|
|
6
|
+
/**
|
|
7
|
+
* Format payloads for specific endpoints (multipart, boolean fixes, etc.).
|
|
8
|
+
* This is the library-friendly replacement for the old formatAxiosData.
|
|
9
|
+
*/
|
|
10
|
+
export declare function formatPayloadForEndpoint(payload: any, endpoint: string): any;
|
|
11
|
+
export declare const formatAxiosData: typeof formatPayloadForEndpoint;
|
|
6
12
|
export declare function formatErrorToList(str: string[] | string): string;
|
|
7
13
|
export declare function formatDate(date: Date | string, formatStr?: string): string;
|
|
8
14
|
/**
|
|
@@ -19,6 +25,9 @@ export declare function formatDate(date: Date | string, formatStr?: string): str
|
|
|
19
25
|
* ```
|
|
20
26
|
*/
|
|
21
27
|
export declare const dateFromat: (date: string | Date) => string;
|
|
28
|
+
export declare function removeHtmlTags(input?: string): string;
|
|
29
|
+
export declare function toUTCDateString(date: Date): string;
|
|
30
|
+
export declare function toUTCDateTimeString(date: Date): string;
|
|
22
31
|
/**
|
|
23
32
|
* Create a synthetic change event for form inputs
|
|
24
33
|
* Useful for programmatic form updates when working with custom components
|
|
@@ -37,6 +46,25 @@ export declare const dateFromat: (date: string | Date) => string;
|
|
|
37
46
|
*/
|
|
38
47
|
export declare const createChangeEvent: <T extends HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>(name: string, value: string) => ChangeEvent<T>;
|
|
39
48
|
export declare function appendFormData(data: Record<string, any>): FormData;
|
|
49
|
+
export declare const buildMultipartFormData: typeof appendFormData;
|
|
50
|
+
export declare function buildRolePermissionsFormData(data: any): FormData;
|
|
51
|
+
export declare function buildEmployeeShiftFormData(data: any): FormData;
|
|
40
52
|
export declare function debounce<T extends (...args: any[]) => any>(func: T, wait: number): (...args: Parameters<T>) => void;
|
|
41
53
|
export declare function throttle<T extends (...args: any[]) => any>(func: T, limit: number): (...args: Parameters<T>) => void;
|
|
54
|
+
export declare function parseTimeToMilliseconds(timeStr?: string): number;
|
|
55
|
+
export declare function diffHoursFromTimestamps(endMs: number, startMs: number): string;
|
|
56
|
+
export declare function subtractTimeStrings(time1: string, time2: string): string;
|
|
57
|
+
export declare function sumTimeStrings(time1: string, time2: string): string;
|
|
58
|
+
export declare function formatSecondsToHms(totalSeconds: number): string;
|
|
59
|
+
export declare function getWeekRange(selectedDate: Date): {
|
|
60
|
+
startDate: Date;
|
|
61
|
+
endDate: Date;
|
|
62
|
+
};
|
|
63
|
+
export declare const getUTCDate: typeof toUTCDateString;
|
|
64
|
+
export declare const getUTCDateTime: typeof toUTCDateTimeString;
|
|
65
|
+
export declare const TimeDiffHours: typeof diffHoursFromTimestamps;
|
|
66
|
+
export declare const parseTime: typeof parseTimeToMilliseconds;
|
|
67
|
+
export declare const formatTimeStr: typeof formatSecondsToHms;
|
|
68
|
+
export declare const secondsToTime: typeof formatSecondsToHms;
|
|
69
|
+
export declare const getWeekBounds: typeof getWeekRange;
|
|
42
70
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/lib/utils.d.ts.map
CHANGED
|
@@ -1 +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M,aAAa,2BAAqB,CAAC;AAChD,eAAO,MAAM,aAAa,2BAAqB,CAAC;AAChD,eAAO,MAAM,aAAa,qBAAe,CAAC"}
|
package/dist/react-starter.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aL as r, b5 as o, b8 as t, b6 as n, b7 as i, eZ as d, a4 as l, a5 as u, b9 as c, bb as b, bc as p, bl as g, bm as S, bg as C, bk as M, bi as m, bh as T, be as D, bd as A, bj as h, bf as v, fd as I, ba as P, aY as F, a0 as w, bn as x, aQ as f, bo as B, bq as R, bp as G, br as L, bt as k, bz as y, bv as H, bw as N, bu as O, bx as U, by as E, X as V, bB as z, Y as W, bG as q, bF as j, bD as X, bC as Y, bE as Z, bH as _, bI as J, bJ as K, bL as Q, bK as $, eW as aa, bM as ea, bP as sa, bQ as ra, bR as oa, bN as ta, bO as na, bS as ia, bT as da, bV as la, bU as ua, bW as ca, bX as ba, b_ as pa, b$ as ga, bY as Sa, c0 as Ca, bZ as Ma, c2 as ma, c1 as Ta, aI as Da, c3 as Aa, c7 as ha, c5 as va, cc as Ia, c6 as Pa, c9 as Fa, cd as wa, ch as xa, c8 as fa, ca as Ba, cb as Ra, ce as Ga, cf as La, cg as ka, c4 as ya, fc as Ha, _ as Na, f0 as Oa, f2 as Ua, a9 as Ea, aa as Va, fg as za, fh as Wa, fe as qa, ci as ja, cm as Xa, cn as Ya, cr as Za, cp as _a, co as Ja, ck as Ka, cj as Qa, cq as $a, cl as ae, cs as ee, cw as se, cx as re, cB as oe, cz as te, cy as ne, cu as ie, ct as de, cA as le, cv as ue, cC as ce, cG as be, cE as pe, cL as ge, cF as Se, cI as Ce, cM as Me, cQ as me, cH as Te, cJ as De, cK as Ae, cN as he, cO as ve, cP as Ie, cD as Pe, a3 as Fe, ah as we, cS as xe, cV as fe, cW as Be, cY as Re, cT as Ge, cU as Le, a2 as ke, cX as ye, f5 as He, fm as Ne, fj as Oe, cZ as Ue, c$ as Ee, c_ as Ve, d0 as ze, ab as We, ac as qe, ad as je, ae as Xe, d1 as Ye, a6 as Ze, d2 as _e, d3 as Je, d5 as Ke, d4 as Qe, d6 as $e, ai as as, d7 as es, de as ss, da as rs, dk as os, db as ts, dd as ns, d8 as is, dh as ds, df as ls, dg as us, dc as cs, dm as bs, dl as ps, di as gs, dj as Ss, d9 as Cs, a1 as Ms, dn as ms, aS as Ts, fb as Ds, f8 as As, f9 as hs, fa as vs, dq as Is, dt as Ps, dw as Fs, ds as ws, dv as xs, dr as fs, du as Bs, dx as Rs, f6 as Gs, aU as Ls, fk as ks, eX as ys, f3 as Hs, dy as Ns, dB as Os, dA as Us, dz as Es, ff as Vs, dC as zs, dE as Ws, dD as qs, dF as js, aO as Xs, dG as Ys, dH as Zs, a_ as _s, dK as Js, dJ as Ks, dI as Qs, af as $s, dL as ar, dM as er, dN as sr, dR as rr, a8 as or, dO as tr, a7 as nr, dT as ir, dS as dr, dW as lr, dV as ur, dU as cr, dQ as br, dP as pr, dX as gr, f4 as Sr, dY as Cr, e0 as Mr, e1 as mr, e5 as Tr, e3 as Dr, e2 as Ar, d_ as hr, dZ as vr, e4 as Ir, d$ as Pr, e6 as Fr, e7 as wr, e8 as xr, e9 as fr, ea as Br, eb as Rr, ec as Gr, ed as Lr, ee as kr, ef as yr, eg as Hr, eh as Nr, ei as Or, ej as Ur, ek as Er, el as Vr, em as zr, en as Wr, eo as qr, ep as jr, eq as Xr, er as Yr, es as Zr, f7 as _r, eu as Jr, ev as Kr, ew as Qr, ey as $r, e$ as ao, eY as eo, e_ as so, fi as ro, ez as oo, eC as to, eA as no, eB as io, eD as lo, aW as uo, fl as co, ag as bo, eG as po, eK as go, eJ as So, eI as Co, eE as Mo, eH as mo, b4 as To, eF as Do, ex as Ao, eL as ho, eN as vo, eO as Io, eP as Po, eR as Fo, eS as wo, eQ as xo, aN as fo, Z as Bo, b2 as Ro, as as Go, bs as Lo, bA as ko, am as yo, al as Ho, an as No, ay as Oo, ax as Uo, ar as Eo, f1 as Vo, aq as zo, at as Wo, ap as qo, ao as jo, av as Xo, aw as Yo, dp as Zo, az as _o, b3 as Jo, aZ as Ko, eT as Qo, au as $o, eV as at, eM as et, aK as st, a$ as rt, aR as ot, aB as tt, aC as nt, aD as it, cR as dt, aE as lt, aF as ut, ak as ct, aj as bt, aT as pt, aV as gt, b0 as St, aP as Ct, aA as Mt, b1 as mt, aH as Tt, et as Dt, aX as At, eU as ht, aG as vt, aJ as It, aM as Pt } from "./index-
|
|
1
|
+
import { aL as r, b5 as o, b8 as t, b6 as n, b7 as i, eZ as d, a4 as l, a5 as u, b9 as c, bb as b, bc as p, bl as g, bm as S, bg as C, bk as M, bi as m, bh as T, be as D, bd as A, bj as h, bf as v, fd as I, ba as P, aY as F, a0 as w, bn as x, aQ as f, bo as B, bq as R, bp as G, br as L, bt as k, bz as y, bv as H, bw as N, bu as O, bx as U, by as E, X as V, bB as z, Y as W, bG as q, bF as j, bD as X, bC as Y, bE as Z, bH as _, bI as J, bJ as K, bL as Q, bK as $, eW as aa, bM as ea, bP as sa, bQ as ra, bR as oa, bN as ta, bO as na, bS as ia, bT as da, bV as la, bU as ua, bW as ca, bX as ba, b_ as pa, b$ as ga, bY as Sa, c0 as Ca, bZ as Ma, c2 as ma, c1 as Ta, aI as Da, c3 as Aa, c7 as ha, c5 as va, cc as Ia, c6 as Pa, c9 as Fa, cd as wa, ch as xa, c8 as fa, ca as Ba, cb as Ra, ce as Ga, cf as La, cg as ka, c4 as ya, fc as Ha, _ as Na, f0 as Oa, f2 as Ua, a9 as Ea, aa as Va, fg as za, fh as Wa, fe as qa, ci as ja, cm as Xa, cn as Ya, cr as Za, cp as _a, co as Ja, ck as Ka, cj as Qa, cq as $a, cl as ae, cs as ee, cw as se, cx as re, cB as oe, cz as te, cy as ne, cu as ie, ct as de, cA as le, cv as ue, cC as ce, cG as be, cE as pe, cL as ge, cF as Se, cI as Ce, cM as Me, cQ as me, cH as Te, cJ as De, cK as Ae, cN as he, cO as ve, cP as Ie, cD as Pe, a3 as Fe, ah as we, cS as xe, cV as fe, cW as Be, cY as Re, cT as Ge, cU as Le, a2 as ke, cX as ye, f5 as He, fm as Ne, fj as Oe, cZ as Ue, c$ as Ee, c_ as Ve, d0 as ze, ab as We, ac as qe, ad as je, ae as Xe, d1 as Ye, a6 as Ze, d2 as _e, d3 as Je, d5 as Ke, d4 as Qe, d6 as $e, ai as as, d7 as es, de as ss, da as rs, dk as os, db as ts, dd as ns, d8 as is, dh as ds, df as ls, dg as us, dc as cs, dm as bs, dl as ps, di as gs, dj as Ss, d9 as Cs, a1 as Ms, dn as ms, aS as Ts, fb as Ds, f8 as As, f9 as hs, fa as vs, dq as Is, dt as Ps, dw as Fs, ds as ws, dv as xs, dr as fs, du as Bs, dx as Rs, f6 as Gs, aU as Ls, fk as ks, eX as ys, f3 as Hs, dy as Ns, dB as Os, dA as Us, dz as Es, ff as Vs, dC as zs, dE as Ws, dD as qs, dF as js, aO as Xs, dG as Ys, dH as Zs, a_ as _s, dK as Js, dJ as Ks, dI as Qs, af as $s, dL as ar, dM as er, dN as sr, dR as rr, a8 as or, dO as tr, a7 as nr, dT as ir, dS as dr, dW as lr, dV as ur, dU as cr, dQ as br, dP as pr, dX as gr, f4 as Sr, dY as Cr, e0 as Mr, e1 as mr, e5 as Tr, e3 as Dr, e2 as Ar, d_ as hr, dZ as vr, e4 as Ir, d$ as Pr, e6 as Fr, e7 as wr, e8 as xr, e9 as fr, ea as Br, eb as Rr, ec as Gr, ed as Lr, ee as kr, ef as yr, eg as Hr, eh as Nr, ei as Or, ej as Ur, ek as Er, el as Vr, em as zr, en as Wr, eo as qr, ep as jr, eq as Xr, er as Yr, es as Zr, f7 as _r, eu as Jr, ev as Kr, ew as Qr, ey as $r, e$ as ao, eY as eo, e_ as so, fi as ro, ez as oo, eC as to, eA as no, eB as io, eD as lo, aW as uo, fl as co, ag as bo, eG as po, eK as go, eJ as So, eI as Co, eE as Mo, eH as mo, b4 as To, eF as Do, ex as Ao, eL as ho, eN as vo, eO as Io, eP as Po, eR as Fo, eS as wo, eQ as xo, aN as fo, Z as Bo, b2 as Ro, as as Go, bs as Lo, bA as ko, am as yo, al as Ho, an as No, ay as Oo, ax as Uo, ar as Eo, f1 as Vo, aq as zo, at as Wo, ap as qo, ao as jo, av as Xo, aw as Yo, dp as Zo, az as _o, b3 as Jo, aZ as Ko, eT as Qo, au as $o, eV as at, eM as et, aK as st, a$ as rt, aR as ot, aB as tt, aC as nt, aD as it, cR as dt, aE as lt, aF as ut, ak as ct, aj as bt, aT as pt, aV as gt, b0 as St, aP as Ct, aA as Mt, b1 as mt, aH as Tt, et as Dt, aX as At, eU as ht, aG as vt, aJ as It, aM as Pt } from "./index-Gs1Xd6jo.js";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
export {
|
|
4
4
|
r as AccessControlWrapper,
|