@minimaltech/ra-core-infra 0.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.
- package/LICENSE +26 -0
- package/README.md +119 -0
- package/dist/base/applications/base.application.d.ts +12 -0
- package/dist/base/applications/base.application.js +22 -0
- package/dist/base/applications/base.application.js.map +1 -0
- package/dist/base/applications/index.d.ts +1 -0
- package/dist/base/applications/index.js +2 -0
- package/dist/base/applications/index.js.map +1 -0
- package/dist/base/index.d.ts +3 -0
- package/dist/base/index.js +4 -0
- package/dist/base/index.js.map +1 -0
- package/dist/base/providers/base.provider.d.ts +10 -0
- package/dist/base/providers/base.provider.js +8 -0
- package/dist/base/providers/base.provider.js.map +1 -0
- package/dist/base/providers/count-rest-data.provider.d.ts +19 -0
- package/dist/base/providers/count-rest-data.provider.js +28 -0
- package/dist/base/providers/count-rest-data.provider.js.map +1 -0
- package/dist/base/providers/default-auth.provider.d.ts +17 -0
- package/dist/base/providers/default-auth.provider.js +116 -0
- package/dist/base/providers/default-auth.provider.js.map +1 -0
- package/dist/base/providers/default-i18n.provider.d.ts +8 -0
- package/dist/base/providers/default-i18n.provider.js +42 -0
- package/dist/base/providers/default-i18n.provider.js.map +1 -0
- package/dist/base/providers/default-rest-data.provider.d.ts +66 -0
- package/dist/base/providers/default-rest-data.provider.js +355 -0
- package/dist/base/providers/default-rest-data.provider.js.map +1 -0
- package/dist/base/providers/index.d.ts +5 -0
- package/dist/base/providers/index.js +6 -0
- package/dist/base/providers/index.js.map +1 -0
- package/dist/base/services/base-crud.service.d.ts +34 -0
- package/dist/base/services/base-crud.service.js +157 -0
- package/dist/base/services/base-crud.service.js.map +1 -0
- package/dist/base/services/base-network-request.service.d.ts +18 -0
- package/dist/base/services/base-network-request.service.js +43 -0
- package/dist/base/services/base-network-request.service.js.map +1 -0
- package/dist/base/services/default-auth.service.d.ts +22 -0
- package/dist/base/services/default-auth.service.js +38 -0
- package/dist/base/services/default-auth.service.js.map +1 -0
- package/dist/base/services/default-network-data.service.d.ts +173 -0
- package/dist/base/services/default-network-data.service.js +158 -0
- package/dist/base/services/default-network-data.service.js.map +1 -0
- package/dist/base/services/index.d.ts +4 -0
- package/dist/base/services/index.js +5 -0
- package/dist/base/services/index.js.map +1 -0
- package/dist/common/constants.d.ts +52 -0
- package/dist/common/constants.js +86 -0
- package/dist/common/constants.js.map +1 -0
- package/dist/common/index.d.ts +4 -0
- package/dist/common/index.js +5 -0
- package/dist/common/index.js.map +1 -0
- package/dist/common/keys.d.ts +15 -0
- package/dist/common/keys.js +16 -0
- package/dist/common/keys.js.map +1 -0
- package/dist/common/locales/en.d.ts +2 -0
- package/dist/common/locales/en.js +207 -0
- package/dist/common/locales/en.js.map +1 -0
- package/dist/common/locales/index.d.ts +2 -0
- package/dist/common/locales/index.js +3 -0
- package/dist/common/locales/index.js.map +1 -0
- package/dist/common/locales/vi.d.ts +2 -0
- package/dist/common/locales/vi.js +206 -0
- package/dist/common/locales/vi.js.map +1 -0
- package/dist/common/types.d.ts +147 -0
- package/dist/common/types.js +2 -0
- package/dist/common/types.js.map +1 -0
- package/dist/helpers/di-container.helper.d.ts +8 -0
- package/dist/helpers/di-container.helper.js +20 -0
- package/dist/helpers/di-container.helper.js.map +1 -0
- package/dist/helpers/index.d.ts +3 -0
- package/dist/helpers/index.js +4 -0
- package/dist/helpers/index.js.map +1 -0
- package/dist/helpers/logger.helper.d.ts +37 -0
- package/dist/helpers/logger.helper.js +65 -0
- package/dist/helpers/logger.helper.js.map +1 -0
- package/dist/helpers/network.helper.d.ts +25 -0
- package/dist/helpers/network.helper.js +56 -0
- package/dist/helpers/network.helper.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/ui/components/CoreRaApplication.d.ts +3 -0
- package/dist/ui/components/CoreRaApplication.js +31 -0
- package/dist/ui/components/CoreRaApplication.js.map +1 -0
- package/dist/ui/components/index.d.ts +1 -0
- package/dist/ui/components/index.js +2 -0
- package/dist/ui/components/index.js.map +1 -0
- package/dist/ui/context.d.ts +8 -0
- package/dist/ui/context.js +7 -0
- package/dist/ui/context.js.map +1 -0
- package/dist/ui/hooks/index.d.ts +10 -0
- package/dist/ui/hooks/index.js +11 -0
- package/dist/ui/hooks/index.js.map +1 -0
- package/dist/ui/hooks/use-application-context.d.ts +2 -0
- package/dist/ui/hooks/use-application-context.js +22 -0
- package/dist/ui/hooks/use-application-context.js.map +1 -0
- package/dist/ui/hooks/use-autosave.d.ts +8 -0
- package/dist/ui/hooks/use-autosave.js +38 -0
- package/dist/ui/hooks/use-autosave.js.map +1 -0
- package/dist/ui/hooks/use-before-unload.d.ts +5 -0
- package/dist/ui/hooks/use-before-unload.js +22 -0
- package/dist/ui/hooks/use-before-unload.js.map +1 -0
- package/dist/ui/hooks/use-confirm.d.ts +10 -0
- package/dist/ui/hooks/use-confirm.js +29 -0
- package/dist/ui/hooks/use-confirm.js.map +1 -0
- package/dist/ui/hooks/use-copy-to-clipboard.d.ts +6 -0
- package/dist/ui/hooks/use-copy-to-clipboard.js +20 -0
- package/dist/ui/hooks/use-copy-to-clipboard.js.map +1 -0
- package/dist/ui/hooks/use-debounce.d.ts +9 -0
- package/dist/ui/hooks/use-debounce.js +20 -0
- package/dist/ui/hooks/use-debounce.js.map +1 -0
- package/dist/ui/hooks/use-document-title.d.ts +5 -0
- package/dist/ui/hooks/use-document-title.js +11 -0
- package/dist/ui/hooks/use-document-title.js.map +1 -0
- package/dist/ui/hooks/use-injectable.d.ts +10 -0
- package/dist/ui/hooks/use-injectable.js +15 -0
- package/dist/ui/hooks/use-injectable.js.map +1 -0
- package/dist/ui/hooks/use-sizer.d.ts +6 -0
- package/dist/ui/hooks/use-sizer.js +33 -0
- package/dist/ui/hooks/use-sizer.js.map +1 -0
- package/dist/ui/hooks/use-window-dimensions.d.ts +4 -0
- package/dist/ui/hooks/use-window-dimensions.js +21 -0
- package/dist/ui/hooks/use-window-dimensions.js.map +1 -0
- package/dist/ui/index.d.ts +4 -0
- package/dist/ui/index.js +5 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/types.d.ts +14 -0
- package/dist/ui/types.js +2 -0
- package/dist/ui/types.js.map +1 -0
- package/dist/utilities/boolean.utility.d.ts +6 -0
- package/dist/utilities/boolean.utility.js +26 -0
- package/dist/utilities/boolean.utility.js.map +1 -0
- package/dist/utilities/error.utility.d.ts +18 -0
- package/dist/utilities/error.utility.js +35 -0
- package/dist/utilities/error.utility.js.map +1 -0
- package/dist/utilities/index.d.ts +4 -0
- package/dist/utilities/index.js +5 -0
- package/dist/utilities/index.js.map +1 -0
- package/dist/utilities/parse.utility.d.ts +14 -0
- package/dist/utilities/parse.utility.js +130 -0
- package/dist/utilities/parse.utility.js.map +1 -0
- package/dist/utilities/url.utility.d.ts +4 -0
- package/dist/utilities/url.utility.js +27 -0
- package/dist/utilities/url.utility.js.map +1 -0
- package/package.json +117 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export const useSizer = (props) => {
|
|
3
|
+
const [width, setWidth] = React.useState(0);
|
|
4
|
+
const [height, setHeight] = React.useState(0);
|
|
5
|
+
const cached = React.useRef({ width, height });
|
|
6
|
+
React.useEffect(() => {
|
|
7
|
+
const { containerId } = props;
|
|
8
|
+
const container = document.getElementById(containerId);
|
|
9
|
+
if (!container) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const sizeObserver = new ResizeObserver(() => {
|
|
13
|
+
if (container.offsetWidth !== cached.current.width) {
|
|
14
|
+
setWidth(container.clientWidth + 1);
|
|
15
|
+
}
|
|
16
|
+
if (container.offsetHeight !== cached.current.height) {
|
|
17
|
+
setHeight(container.offsetHeight + 1);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
sizeObserver.observe(container);
|
|
21
|
+
return () => {
|
|
22
|
+
sizeObserver.disconnect();
|
|
23
|
+
};
|
|
24
|
+
}, [props]);
|
|
25
|
+
React.useEffect(() => {
|
|
26
|
+
cached.current.width = width;
|
|
27
|
+
}, [width]);
|
|
28
|
+
React.useEffect(() => {
|
|
29
|
+
cached.current.height = height;
|
|
30
|
+
}, [height]);
|
|
31
|
+
return { width, height };
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=use-sizer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-sizer.js","sourceRoot":"","sources":["../../../src/ui/hooks/use-sizer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAExB,EAAqC,EAAE;IACtC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAS,CAAC,CAAC,CAAC;IACpD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAS,CAAC,CAAC,CAAC;IAEtD,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAoC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IAElF,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;QAC9B,MAAM,SAAS,GAAG,QAAQ,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;QACvD,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAO;QACT,CAAC;QAED,MAAM,YAAY,GAAG,IAAI,cAAc,CAAC,GAAG,EAAE;YAC3C,IAAI,SAAS,CAAC,WAAW,KAAK,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;gBACnD,QAAQ,CAAC,SAAS,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC;YACtC,CAAC;YAED,IAAI,SAAS,CAAC,YAAY,KAAK,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;gBACrD,SAAS,CAAC,SAAS,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;YACxC,CAAC;QACH,CAAC,CAAC,CAAC;QACH,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAEhC,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,UAAU,EAAE,CAAC;QAC5B,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,CAAC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;IAC/B,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;IACjC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAC3B,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export const useWindowDimensions = () => {
|
|
3
|
+
const [windowDimensions, setWindowDimensions] = React.useState({
|
|
4
|
+
width: window.innerWidth,
|
|
5
|
+
height: window.innerHeight,
|
|
6
|
+
});
|
|
7
|
+
React.useEffect(() => {
|
|
8
|
+
const resizeHandler = () => {
|
|
9
|
+
setWindowDimensions({
|
|
10
|
+
width: window.innerWidth,
|
|
11
|
+
height: window.innerHeight,
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
window.addEventListener('resize', resizeHandler);
|
|
15
|
+
return () => {
|
|
16
|
+
window.removeEventListener('resize', resizeHandler);
|
|
17
|
+
};
|
|
18
|
+
}, []);
|
|
19
|
+
return windowDimensions;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=use-window-dimensions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-window-dimensions.js","sourceRoot":"","sources":["../../../src/ui/hooks/use-window-dimensions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC;QAC7D,KAAK,EAAE,MAAM,CAAC,UAAU;QACxB,MAAM,EAAE,MAAM,CAAC,WAAW;KAC3B,CAAC,CAAC;IAEH,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,aAAa,GAAG,GAAG,EAAE;YACzB,mBAAmB,CAAC;gBAClB,KAAK,EAAE,MAAM,CAAC,UAAU;gBACxB,MAAM,EAAE,MAAM,CAAC,WAAW;aAC3B,CAAC,CAAC;QACL,CAAC,CAAC;QAEF,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;QAEjD,OAAO,GAAG,EAAE;YACV,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;QACtD,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,gBAAgB,CAAC;AAC1B,CAAC,CAAC"}
|
package/dist/ui/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ui/index.tsx"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAE1B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Context } from '@loopback/context';
|
|
2
|
+
import { Store } from '@reduxjs/toolkit';
|
|
3
|
+
import { CoreAdminProps, ResourceProps } from 'ra-core';
|
|
4
|
+
import { RouteProps } from 'react-router-dom';
|
|
5
|
+
export interface IApplication extends Omit<CoreAdminProps, 'children'> {
|
|
6
|
+
context: Context;
|
|
7
|
+
enableDebug?: boolean;
|
|
8
|
+
reduxStore: Store;
|
|
9
|
+
suspense: React.ReactNode;
|
|
10
|
+
resources: Array<ResourceProps>;
|
|
11
|
+
customRoutes?: {
|
|
12
|
+
routes: Array<RouteProps>;
|
|
13
|
+
};
|
|
14
|
+
}
|
package/dist/ui/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/ui/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const isDefined: <T>(value: T | null | undefined) => value is T;
|
|
2
|
+
export declare const isString: (value: unknown) => value is string;
|
|
3
|
+
export declare const isNumber: (value: unknown, exact?: boolean) => value is number;
|
|
4
|
+
export declare const isObject: (value: any) => boolean;
|
|
5
|
+
export declare const isBrowser: () => boolean;
|
|
6
|
+
export declare const isValidDate: (value: any) => boolean;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export const isDefined = (value) => {
|
|
2
|
+
return value !== undefined && value !== null;
|
|
3
|
+
};
|
|
4
|
+
export const isString = (value) => {
|
|
5
|
+
return typeof value === 'string';
|
|
6
|
+
};
|
|
7
|
+
export const isNumber = (value, exact) => {
|
|
8
|
+
if (exact) {
|
|
9
|
+
return typeof value === 'number';
|
|
10
|
+
}
|
|
11
|
+
if (typeof value !== 'string' && typeof value !== 'number') {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
return !isNaN(parseFloat(String(value))) && isFinite(Number(value));
|
|
15
|
+
};
|
|
16
|
+
export const isObject = (value) => {
|
|
17
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
18
|
+
};
|
|
19
|
+
export const isBrowser = () => {
|
|
20
|
+
return typeof window !== 'undefined';
|
|
21
|
+
};
|
|
22
|
+
export const isValidDate = (value) => {
|
|
23
|
+
const date = new Date(value);
|
|
24
|
+
return date instanceof Date && !isNaN(date.valueOf());
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=boolean.utility.js.map
|
|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OAAO,IAAI,YAAY,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;AACxD,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare class ApplicationError extends Error {
|
|
2
|
+
statusCode: number;
|
|
3
|
+
messageCode?: string;
|
|
4
|
+
payload?: any;
|
|
5
|
+
constructor(opts: {
|
|
6
|
+
statusCode?: number;
|
|
7
|
+
messageCode?: string;
|
|
8
|
+
message: string;
|
|
9
|
+
payload?: any;
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
export declare const getError: (opts: {
|
|
13
|
+
statusCode?: number;
|
|
14
|
+
messageCode?: string;
|
|
15
|
+
message: string;
|
|
16
|
+
payload?: any;
|
|
17
|
+
}) => ApplicationError;
|
|
18
|
+
export declare const getClientError: (e: unknown) => ApplicationError;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export class ApplicationError extends Error {
|
|
2
|
+
statusCode;
|
|
3
|
+
messageCode;
|
|
4
|
+
payload;
|
|
5
|
+
constructor(opts) {
|
|
6
|
+
const { message, messageCode, statusCode = 400, payload } = opts;
|
|
7
|
+
super(message);
|
|
8
|
+
this.statusCode = statusCode;
|
|
9
|
+
this.messageCode = messageCode;
|
|
10
|
+
this.payload = payload;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export const getError = (opts) => {
|
|
14
|
+
const error = new ApplicationError(opts);
|
|
15
|
+
return error;
|
|
16
|
+
};
|
|
17
|
+
export const getClientError = (e) => {
|
|
18
|
+
if (e instanceof ApplicationError) {
|
|
19
|
+
return new ApplicationError({
|
|
20
|
+
messageCode: e?.messageCode ?? e.message,
|
|
21
|
+
message: e.message,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
if (e instanceof Error) {
|
|
25
|
+
return new ApplicationError({
|
|
26
|
+
messageCode: e.message,
|
|
27
|
+
message: e.message,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
return new ApplicationError({
|
|
31
|
+
messageCode: `${e}`,
|
|
32
|
+
message: `${e}`,
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=error.utility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.utility.js","sourceRoot":"","sources":["../../src/utilities/error.utility.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IACzC,UAAU,CAAS;IACnB,WAAW,CAAU;IACrB,OAAO,CAAO;IAEd,YAAY,IAKX;QACC,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,GAAG,GAAG,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QACjE,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,IAKxB,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACzC,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAU,EAAE,EAAE;IAC3C,IAAI,CAAC,YAAY,gBAAgB,EAAE,CAAC;QAClC,OAAO,IAAI,gBAAgB,CAAC;YAC1B,WAAW,EAAE,CAAC,EAAE,WAAW,IAAI,CAAC,CAAC,OAAO;YACxC,OAAO,EAAE,CAAC,CAAC,OAAO;SACnB,CAAC,CAAC;IACL,CAAC;IAED,IAAI,CAAC,YAAY,KAAK,EAAE,CAAC;QACvB,OAAO,IAAI,gBAAgB,CAAC;YAC1B,WAAW,EAAE,CAAC,CAAC,OAAO;YACtB,OAAO,EAAE,CAAC,CAAC,OAAO;SACnB,CAAC,CAAC;IACL,CAAC;IAED,OAAO,IAAI,gBAAgB,CAAC;QAC1B,WAAW,EAAE,GAAG,CAAC,EAAE;QACnB,OAAO,EAAE,GAAG,CAAC,EAAE;KAChB,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utilities/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const INTL_0_DIGITS_FORMATER: Intl.NumberFormat;
|
|
2
|
+
export declare const INTL_2_DIGITS_FORMATER: Intl.NumberFormat;
|
|
3
|
+
export declare const getUID: () => string;
|
|
4
|
+
export declare const toCamel: (s: string) => string;
|
|
5
|
+
export declare const keysToCamel: (object: object) => any;
|
|
6
|
+
export declare const isInt: (n: any) => boolean;
|
|
7
|
+
export declare const isFloat: (n: any) => boolean;
|
|
8
|
+
export declare const int: (input: any) => number;
|
|
9
|
+
export declare const float: (input: any, digit?: number) => number;
|
|
10
|
+
export declare const toBoolean: (input: any) => boolean;
|
|
11
|
+
export declare const toStringDecimal: (input: any, digit?: number, options?: {
|
|
12
|
+
localeFormat: boolean;
|
|
13
|
+
}) => string | 0;
|
|
14
|
+
export declare const getNumberValue: (input: string, method?: "int" | "float") => number;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import get from 'lodash/get';
|
|
2
|
+
import round from 'lodash/round';
|
|
3
|
+
export const INTL_0_DIGITS_FORMATER = new Intl.NumberFormat('en-US', {
|
|
4
|
+
maximumFractionDigits: 0,
|
|
5
|
+
minimumFractionDigits: 0,
|
|
6
|
+
});
|
|
7
|
+
export const INTL_2_DIGITS_FORMATER = new Intl.NumberFormat('en-US', {
|
|
8
|
+
maximumFractionDigits: 2,
|
|
9
|
+
minimumFractionDigits: 2,
|
|
10
|
+
});
|
|
11
|
+
export const getUID = () => Math.random().toString(36).slice(2).toUpperCase();
|
|
12
|
+
export const toCamel = (s) => {
|
|
13
|
+
return s.replace(/([-_][a-z])/gi, (sub) => {
|
|
14
|
+
return sub.toUpperCase().replace('-', '').replace('_', '');
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
export const keysToCamel = (object) => {
|
|
18
|
+
const n = {};
|
|
19
|
+
const keys = Object.keys(object);
|
|
20
|
+
for (const key of keys) {
|
|
21
|
+
const value = get(object, key);
|
|
22
|
+
const valueType = Array.isArray(value) ? 'array' : typeof value;
|
|
23
|
+
switch (valueType) {
|
|
24
|
+
case 'object': {
|
|
25
|
+
if (!value) {
|
|
26
|
+
n[toCamel(key)] = value;
|
|
27
|
+
break;
|
|
28
|
+
}
|
|
29
|
+
n[toCamel(key)] = keysToCamel(value);
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
case 'array': {
|
|
33
|
+
n[toCamel(key)] = value;
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
default: {
|
|
37
|
+
n[toCamel(key)] = value;
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return n;
|
|
43
|
+
};
|
|
44
|
+
export const isInt = (n) => {
|
|
45
|
+
if (Number.isNaN(n)) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
return Number.isInteger(n) || Math.floor(Number(n)) === n || Number(n) % 1 === 0;
|
|
49
|
+
};
|
|
50
|
+
export const isFloat = (n) => {
|
|
51
|
+
if (Number.isNaN(n)) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
return n === +n && n !== (n | 0);
|
|
55
|
+
};
|
|
56
|
+
export const int = (input) => {
|
|
57
|
+
if (!input || Number.isNaN(input)) {
|
|
58
|
+
return 0;
|
|
59
|
+
}
|
|
60
|
+
const normalized = input?.toString()?.replace(/,/g, '');
|
|
61
|
+
return Number.parseInt(normalized, 10);
|
|
62
|
+
};
|
|
63
|
+
export const float = (input, digit = 2) => {
|
|
64
|
+
if (!input || Number.isNaN(input)) {
|
|
65
|
+
return 0;
|
|
66
|
+
}
|
|
67
|
+
const normalized = input?.toString()?.replace(/,/g, '');
|
|
68
|
+
return round(Number.parseFloat(normalized), digit);
|
|
69
|
+
};
|
|
70
|
+
export const toBoolean = (input) => {
|
|
71
|
+
return ((input !== 'false' &&
|
|
72
|
+
input !== '0' &&
|
|
73
|
+
input !== false &&
|
|
74
|
+
input !== 0 &&
|
|
75
|
+
input !== null &&
|
|
76
|
+
input !== undefined) ??
|
|
77
|
+
Boolean(input));
|
|
78
|
+
};
|
|
79
|
+
export const toStringDecimal = (input, digit = 2, options = { localeFormat: true }) => {
|
|
80
|
+
const { localeFormat: shouldFormatWithLocale } = options;
|
|
81
|
+
if (Number.isNaN(input)) {
|
|
82
|
+
return 0;
|
|
83
|
+
}
|
|
84
|
+
let number = 0;
|
|
85
|
+
if (isInt(input)) {
|
|
86
|
+
number = int(input);
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
number = float(input, digit);
|
|
90
|
+
}
|
|
91
|
+
if (!shouldFormatWithLocale) {
|
|
92
|
+
return number.toFixed(digit);
|
|
93
|
+
}
|
|
94
|
+
if (Number.isInteger(number)) {
|
|
95
|
+
return INTL_0_DIGITS_FORMATER.format(number);
|
|
96
|
+
}
|
|
97
|
+
if (digit === 2) {
|
|
98
|
+
return INTL_2_DIGITS_FORMATER.format(number);
|
|
99
|
+
}
|
|
100
|
+
const formater = new Intl.NumberFormat('en-US', {
|
|
101
|
+
maximumFractionDigits: digit,
|
|
102
|
+
minimumFractionDigits: digit,
|
|
103
|
+
});
|
|
104
|
+
return formater.format(number);
|
|
105
|
+
};
|
|
106
|
+
export const getNumberValue = (input, method = 'int') => {
|
|
107
|
+
if (!input) {
|
|
108
|
+
return 0;
|
|
109
|
+
}
|
|
110
|
+
let raw;
|
|
111
|
+
switch (typeof input) {
|
|
112
|
+
case 'string': {
|
|
113
|
+
raw = input.replace(/,|\./gi, '');
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
default: {
|
|
117
|
+
raw = input;
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
switch (method) {
|
|
122
|
+
case 'int': {
|
|
123
|
+
return int(raw);
|
|
124
|
+
}
|
|
125
|
+
default: {
|
|
126
|
+
return float(raw);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
//# sourceMappingURL=parse.utility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse.utility.js","sourceRoot":"","sources":["../../src/utilities/parse.utility.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,YAAY,CAAC;AAC7B,OAAO,KAAK,MAAM,cAAc,CAAC;AAGjC,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;IACnE,qBAAqB,EAAE,CAAC;IACxB,qBAAqB,EAAE,CAAC;CACzB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;IACnE,qBAAqB,EAAE,CAAC;IACxB,qBAAqB,EAAE,CAAC;CACzB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AAG9E,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAS,EAAE,EAAE;IACnC,OAAO,CAAC,CAAC,OAAO,CAAC,eAAe,EAAE,CAAC,GAAW,EAAE,EAAE;QAChD,OAAO,GAAG,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,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E,KAAK;KAC7B,CAAC,CAAC;IACH,OAAO,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC,CAAC;AAGF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAa,EAAE,SAA0B,KAAK,EAAE,EAAE;IAC/E,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,CAAC,CAAC;IACX,CAAC;IAED,IAAI,GAAQ,CAAC;IAEb,QAAQ,OAAO,KAAK,EAAE,CAAC;QACrB,KAAK,QAAQ,CAAC,CAAC,CAAC;YACd,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;YAClC,MAAM;QACR,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACR,GAAG,GAAG,KAAK,CAAC;YACZ,MAAM;QACR,CAAC;IACH,CAAC;IAED,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,KAAK,CAAC,CAAC,CAAC;YACX,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC;QAClB,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACR,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC;QACpB,CAAC;IACH,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { isDefined } from './boolean.utility';
|
|
2
|
+
export const stringify = (params) => {
|
|
3
|
+
const normalizedParams = {};
|
|
4
|
+
for (const key in params) {
|
|
5
|
+
if (!isDefined(params[key])) {
|
|
6
|
+
continue;
|
|
7
|
+
}
|
|
8
|
+
switch (typeof params[key]) {
|
|
9
|
+
case 'number':
|
|
10
|
+
case 'string': {
|
|
11
|
+
normalizedParams[key] = params[key];
|
|
12
|
+
break;
|
|
13
|
+
}
|
|
14
|
+
default: {
|
|
15
|
+
normalizedParams[key] = JSON.stringify(params[key]);
|
|
16
|
+
break;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const rs = new URLSearchParams(normalizedParams);
|
|
21
|
+
return rs.toString();
|
|
22
|
+
};
|
|
23
|
+
export const parse = (searchString) => {
|
|
24
|
+
const searchParams = new URLSearchParams(searchString);
|
|
25
|
+
return Object.fromEntries(searchParams);
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=url.utility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.utility.js","sourceRoot":"","sources":["../../src/utilities/url.utility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,MAAoC,EAAE,EAAE;IAChE,MAAM,gBAAgB,GAAiC,EAAE,CAAC;IAC1D,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;QACzB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YAC5B,SAAS;QACX,CAAC;QAED,QAAQ,OAAO,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;YAC3B,KAAK,QAAQ,CAAC;YACd,KAAK,QAAQ,CAAC,CAAC,CAAC;gBACd,gBAAgB,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;gBACpC,MAAM;YACR,CAAC;YACD,OAAO,CAAC,CAAC,CAAC;gBACR,gBAAgB,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;gBACpD,MAAM;YACR,CAAC;QACH,CAAC;IACH,CAAC;IACD,MAAM,EAAE,GAAG,IAAI,eAAe,CAAC,gBAAgB,CAAC,CAAC;IACjD,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC;AACvB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,YAAoB,EAAE,EAAE;IAC5C,MAAM,YAAY,GAAG,IAAI,eAAe,CAAC,YAAY,CAAC,CAAC;IACvD,OAAO,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;AAC1C,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@minimaltech/ra-core-infra",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Minimal Technology - ReactJS Infrastructure",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"web",
|
|
7
|
+
"web app",
|
|
8
|
+
"web framework",
|
|
9
|
+
"react",
|
|
10
|
+
"app",
|
|
11
|
+
"application",
|
|
12
|
+
"framework",
|
|
13
|
+
"ReactJS",
|
|
14
|
+
"loopback",
|
|
15
|
+
"loopback-application",
|
|
16
|
+
"infrastructure",
|
|
17
|
+
"minimaltech",
|
|
18
|
+
"minimaltek",
|
|
19
|
+
"mt",
|
|
20
|
+
"infra",
|
|
21
|
+
"reactjs framework"
|
|
22
|
+
],
|
|
23
|
+
"type": "module",
|
|
24
|
+
"main": "./dist/index.js",
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"import": "./dist/index.js"
|
|
30
|
+
},
|
|
31
|
+
"./package.json": "./package.json"
|
|
32
|
+
},
|
|
33
|
+
"sideEffects": false,
|
|
34
|
+
"engines": {
|
|
35
|
+
"node": ">=18"
|
|
36
|
+
},
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "git+https://github.com/phatnt199/aether.git"
|
|
40
|
+
},
|
|
41
|
+
"author": "Minimal Technology <developer@miminaltek.com>",
|
|
42
|
+
"bugs": {
|
|
43
|
+
"url": "https://github.com/phatnt199/aether/issues"
|
|
44
|
+
},
|
|
45
|
+
"homepage": "https://github.com/phatnt199/aether/wiki",
|
|
46
|
+
"license": "MIT",
|
|
47
|
+
"files": [
|
|
48
|
+
"README.md",
|
|
49
|
+
"LICENSE",
|
|
50
|
+
"dist",
|
|
51
|
+
"!/**/tests",
|
|
52
|
+
"!/**/dist/tests",
|
|
53
|
+
"!/**/__tests__"
|
|
54
|
+
],
|
|
55
|
+
"publishConfig": {
|
|
56
|
+
"access": "public"
|
|
57
|
+
},
|
|
58
|
+
"dependencies": {
|
|
59
|
+
"@reduxjs/toolkit": "^2.9.1",
|
|
60
|
+
"ra-i18n-polyglot": "^5.12.1",
|
|
61
|
+
"react-router-dom": "^7.9.4"
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"@minimaltech/eslint-react": "^0.2.1-0",
|
|
65
|
+
"@size-limit/preset-small-lib": "^11.2.0",
|
|
66
|
+
"@types/lodash": "^4.14.194",
|
|
67
|
+
"@types/node": "^22.10.5",
|
|
68
|
+
"@types/react": "^18.3.12",
|
|
69
|
+
"@types/react-dom": "^18.0.11",
|
|
70
|
+
"eslint": "^9.38.0",
|
|
71
|
+
"lodash": "^4.17.21",
|
|
72
|
+
"prettier": "3.6.2",
|
|
73
|
+
"ra-core": "^5.12.2",
|
|
74
|
+
"react": "^19.2.0",
|
|
75
|
+
"react-dom": "^19.2.0",
|
|
76
|
+
"size-limit": "^11.2.0",
|
|
77
|
+
"source-map-support": "^0.5.21",
|
|
78
|
+
"tsc-alias": "^1.8.10",
|
|
79
|
+
"tsconfig-paths": "^4.2.0",
|
|
80
|
+
"typescript": "~5.9.3",
|
|
81
|
+
"vite": "^7.1.10"
|
|
82
|
+
},
|
|
83
|
+
"peerDependencies": {
|
|
84
|
+
"@loopback/context": "^8.0.2",
|
|
85
|
+
"@loopback/filter": "^6.0.2",
|
|
86
|
+
"react": ">=18.0",
|
|
87
|
+
"ra-core": ">=5.12.2",
|
|
88
|
+
"react-dom": ">=18.0",
|
|
89
|
+
"react-redux": "^9.1.2"
|
|
90
|
+
},
|
|
91
|
+
"size-limit": [
|
|
92
|
+
{
|
|
93
|
+
"path": "./dist/index.js",
|
|
94
|
+
"limit": "50 KB"
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
"scripts": {
|
|
98
|
+
"size": "size-limit",
|
|
99
|
+
"build": "sh ./scripts/build.sh",
|
|
100
|
+
"test": "ts-node ./src/__test__/index.ts",
|
|
101
|
+
"clean": "sh ./scripts/clean.sh",
|
|
102
|
+
"eslint": "eslint --report-unused-disable-directives .",
|
|
103
|
+
"lint": "pnpm eslint && pnpm prettier:cli",
|
|
104
|
+
"lint:fix": "pnpm eslint --fix && pnpm prettier:fix",
|
|
105
|
+
"prettier:cli": "prettier \"**/*.{js,ts}\" -l",
|
|
106
|
+
"prettier:fix": "pnpm prettier:cli --write",
|
|
107
|
+
"rebuild": "sh ./scripts/rebuild.sh no-version",
|
|
108
|
+
"rebuild:major": "sh ./scripts/rebuild.sh major",
|
|
109
|
+
"rebuild:minor": "sh ./scripts/rebuild.sh minor",
|
|
110
|
+
"rebuild:patch": "sh ./scripts/rebuild.sh patch",
|
|
111
|
+
"rebuild:premajor": "sh ./scripts/rebuild.sh premajor",
|
|
112
|
+
"rebuild:preminor": "sh ./scripts/rebuild.sh preminor",
|
|
113
|
+
"rebuild:prepatch": "sh ./scripts/rebuild.sh prepatch",
|
|
114
|
+
"rebuild:prerelease": "sh ./scripts/rebuild.sh prerelease",
|
|
115
|
+
"pretest:dev": "pnpm run rebuild"
|
|
116
|
+
}
|
|
117
|
+
}
|