@carbonorm/carbonreact 1.1.6 → 1.1.7

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 (95) hide show
  1. package/dist/cjs/index.js +4742 -0
  2. package/dist/cjs/index.js.map +1 -0
  3. package/dist/esm/CarbonReact.d.ts +31 -0
  4. package/dist/esm/components/Alert/Alert.d.ts +24 -0
  5. package/dist/esm/components/Errors/AccessDenied.d.ts +4 -0
  6. package/dist/esm/components/Errors/BackendThrowable.d.ts +1 -0
  7. package/dist/esm/components/Errors/ErrorHttpCode.d.ts +5 -0
  8. package/dist/esm/components/Errors/Localhost.d.ts +1 -0
  9. package/dist/esm/components/Errors/PageNotFound.d.ts +1 -0
  10. package/dist/esm/components/Loading/Loading.d.ts +9 -0
  11. package/dist/esm/components/Nest/Nest.d.ts +49 -0
  12. package/dist/esm/components/Popup/Popup.d.ts +9 -0
  13. package/dist/esm/hoc/GlobalHistory.d.ts +6 -0
  14. package/dist/esm/hoc/addValidSQL.d.ts +2 -0
  15. package/dist/esm/hoc/axiosInstance.d.ts +5 -0
  16. package/dist/esm/hoc/changed.d.ts +2 -0
  17. package/dist/esm/hoc/deleteRestfulObjectArrays.d.ts +2 -0
  18. package/dist/esm/hoc/getStyles.d.ts +7 -0
  19. package/dist/esm/hoc/hexToRgb.d.ts +1 -0
  20. package/dist/esm/hoc/isEdgeBrowser.d.ts +2 -0
  21. package/dist/esm/hoc/parseMultipleJson.d.ts +1 -0
  22. package/dist/esm/hoc/scrollIntoView.d.ts +1 -0
  23. package/dist/esm/hoc/setUrl.d.ts +1 -0
  24. package/dist/esm/hoc/updateRestfulObjectArrays.d.ts +17 -0
  25. package/dist/esm/hoc/uploadImage.d.ts +4 -0
  26. package/dist/esm/hoc/windowDimensions.d.ts +4 -0
  27. package/dist/esm/index.css +13298 -0
  28. package/dist/esm/index.css.map +1 -0
  29. package/dist/esm/index.d.ts +52 -0
  30. package/dist/esm/index.js.map +1 -0
  31. package/dist/esm/variables/C6.d.ts +1008 -0
  32. package/dist/esm/variables/isProduction.d.ts +2 -0
  33. package/dist/umd/CarbonReact.d.ts +31 -0
  34. package/dist/umd/components/Alert/Alert.d.ts +24 -0
  35. package/dist/umd/components/Errors/AccessDenied.d.ts +4 -0
  36. package/dist/umd/components/Errors/BackendThrowable.d.ts +1 -0
  37. package/dist/umd/components/Errors/ErrorHttpCode.d.ts +5 -0
  38. package/dist/umd/components/Errors/Localhost.d.ts +1 -0
  39. package/dist/umd/components/Errors/PageNotFound.d.ts +1 -0
  40. package/dist/umd/components/Loading/Loading.d.ts +9 -0
  41. package/dist/umd/components/Nest/Nest.d.ts +49 -0
  42. package/dist/umd/components/Popup/Popup.d.ts +9 -0
  43. package/dist/umd/hoc/GlobalHistory.d.ts +6 -0
  44. package/dist/umd/hoc/addValidSQL.d.ts +2 -0
  45. package/dist/umd/hoc/axiosInstance.d.ts +5 -0
  46. package/dist/umd/hoc/changed.d.ts +2 -0
  47. package/dist/umd/hoc/deleteRestfulObjectArrays.d.ts +2 -0
  48. package/dist/umd/hoc/getStyles.d.ts +7 -0
  49. package/dist/umd/hoc/hexToRgb.d.ts +1 -0
  50. package/dist/umd/hoc/isEdgeBrowser.d.ts +2 -0
  51. package/dist/umd/hoc/parseMultipleJson.d.ts +1 -0
  52. package/dist/umd/hoc/scrollIntoView.d.ts +1 -0
  53. package/dist/umd/hoc/setUrl.d.ts +1 -0
  54. package/dist/umd/hoc/updateRestfulObjectArrays.d.ts +17 -0
  55. package/dist/umd/hoc/uploadImage.d.ts +4 -0
  56. package/dist/umd/hoc/windowDimensions.d.ts +4 -0
  57. package/dist/umd/index.css +13298 -0
  58. package/dist/umd/index.css.map +1 -0
  59. package/dist/umd/index.d.ts +52 -0
  60. package/dist/umd/index.js +4736 -0
  61. package/dist/umd/index.js.map +1 -0
  62. package/dist/umd/variables/C6.d.ts +1008 -0
  63. package/dist/umd/variables/isProduction.d.ts +2 -0
  64. package/package.json +7 -5
  65. package/dist/index.js.map +0 -1
  66. /package/dist/{CarbonReact.d.ts → cjs/CarbonReact.d.ts} +0 -0
  67. /package/dist/{components → cjs/components}/Alert/Alert.d.ts +0 -0
  68. /package/dist/{components → cjs/components}/Errors/AccessDenied.d.ts +0 -0
  69. /package/dist/{components → cjs/components}/Errors/BackendThrowable.d.ts +0 -0
  70. /package/dist/{components → cjs/components}/Errors/ErrorHttpCode.d.ts +0 -0
  71. /package/dist/{components → cjs/components}/Errors/Localhost.d.ts +0 -0
  72. /package/dist/{components → cjs/components}/Errors/PageNotFound.d.ts +0 -0
  73. /package/dist/{components → cjs/components}/Loading/Loading.d.ts +0 -0
  74. /package/dist/{components → cjs/components}/Nest/Nest.d.ts +0 -0
  75. /package/dist/{components → cjs/components}/Popup/Popup.d.ts +0 -0
  76. /package/dist/{hoc → cjs/hoc}/GlobalHistory.d.ts +0 -0
  77. /package/dist/{hoc → cjs/hoc}/addValidSQL.d.ts +0 -0
  78. /package/dist/{hoc → cjs/hoc}/axiosInstance.d.ts +0 -0
  79. /package/dist/{hoc → cjs/hoc}/changed.d.ts +0 -0
  80. /package/dist/{hoc → cjs/hoc}/deleteRestfulObjectArrays.d.ts +0 -0
  81. /package/dist/{hoc → cjs/hoc}/getStyles.d.ts +0 -0
  82. /package/dist/{hoc → cjs/hoc}/hexToRgb.d.ts +0 -0
  83. /package/dist/{hoc → cjs/hoc}/isEdgeBrowser.d.ts +0 -0
  84. /package/dist/{hoc → cjs/hoc}/parseMultipleJson.d.ts +0 -0
  85. /package/dist/{hoc → cjs/hoc}/scrollIntoView.d.ts +0 -0
  86. /package/dist/{hoc → cjs/hoc}/setUrl.d.ts +0 -0
  87. /package/dist/{hoc → cjs/hoc}/updateRestfulObjectArrays.d.ts +0 -0
  88. /package/dist/{hoc → cjs/hoc}/uploadImage.d.ts +0 -0
  89. /package/dist/{hoc → cjs/hoc}/windowDimensions.d.ts +0 -0
  90. /package/dist/{index.css → cjs/index.css} +0 -0
  91. /package/dist/{index.css.map → cjs/index.css.map} +0 -0
  92. /package/dist/{index.d.ts → cjs/index.d.ts} +0 -0
  93. /package/dist/{variables → cjs/variables}/C6.d.ts +0 -0
  94. /package/dist/{variables → cjs/variables}/isProduction.d.ts +0 -0
  95. /package/dist/{index.js → esm/index.js} +0 -0
@@ -0,0 +1,2 @@
1
+ declare const isProduction: boolean;
2
+ export default isProduction;
@@ -0,0 +1,31 @@
1
+ import React, { ReactNode } from 'react';
2
+ import 'react-toastify/dist/ReactToastify.min.css';
3
+ import { iCarbons } from "variables/C6";
4
+ export type tStatefulApiData<T> = T[] | undefined | null;
5
+ export interface iRestfulObjectArrayTypes {
6
+ carbons: tStatefulApiData<iCarbons>;
7
+ }
8
+ export type tRestfulObjectArrayKeys = keyof iRestfulObjectArrayTypes;
9
+ export type tRestfulObjectArrayValues = iRestfulObjectArrayTypes[tRestfulObjectArrayKeys];
10
+ export type tRestfulObjectValues = tRestfulObjectArrayValues[number];
11
+ export interface iCarbonORMState extends iRestfulObjectArrayTypes {
12
+ websocketEvents: MessageEvent[];
13
+ websocketData: any[];
14
+ websocket?: WebSocket;
15
+ websocketMounted: boolean;
16
+ alert?: boolean;
17
+ alertsWaiting: any[];
18
+ backendThrowable: any[];
19
+ }
20
+ export default class CarbonReact<P = {}, S = {}> extends React.Component<{
21
+ children?: ReactNode | ReactNode[];
22
+ } & P, iCarbonORMState & S> {
23
+ static instance: CarbonReact;
24
+ static lastLocation: string;
25
+ static whyDidYouRender: boolean;
26
+ constructor(props: any);
27
+ websocketTimeout: number;
28
+ shouldComponentUpdate(nextProps: Readonly<any>, nextState: Readonly<iCarbonORMState>, _nextContext: any): boolean;
29
+ componentDidUpdate(_prevProps: Readonly<any>, _prevState: Readonly<iCarbonORMState>, _snapshot?: any): void;
30
+ render(): import("react/jsx-runtime").JSX.Element;
31
+ }
@@ -0,0 +1,24 @@
1
+ import { ReactNode } from "react";
2
+ export interface iAlertButtonOptions {
3
+ text: string;
4
+ value?: string;
5
+ className?: string;
6
+ color: "default" | "primary" | "secondary" | "inherit" | "danger" | "info" | "success" | "warning" | undefined;
7
+ }
8
+ export declare function addAlert(props: iAlert): void;
9
+ export interface iAlert {
10
+ title: string;
11
+ text: string;
12
+ component?: ReactNode;
13
+ icon?: "warning" | "error" | "success" | "info" | "question" | null;
14
+ buttons?: (iAlertButtonOptions)[] | undefined;
15
+ dangerMode?: true;
16
+ then?: (value: string | undefined) => void;
17
+ timeout?: number;
18
+ footerText?: string;
19
+ intercept?: boolean;
20
+ backendThrowable?: {
21
+ [key: string]: any;
22
+ };
23
+ }
24
+ export default function Alert(): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export default function AccessDenied({ children }: {
3
+ children?: React.ReactNode;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export default function BackendThrowable(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export default function ErrorHttpCode({ code, title, message }: {
2
+ code: string;
3
+ title: string;
4
+ message: string;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export default function Localhost(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export default function PageNotFound(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from "react";
2
+ interface iLoading {
3
+ lineHeight?: number;
4
+ count?: number;
5
+ children?: ReactNode;
6
+ message: string | undefined;
7
+ }
8
+ export default function Loading(props: iLoading): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,49 @@
1
+ import React from "react";
2
+ export declare const range: (n: any) => number[];
3
+ interface iTwoD {
4
+ max: number;
5
+ x: number | null;
6
+ y: number | null;
7
+ }
8
+ interface iTwoDAnimated extends iTwoD {
9
+ ya: number;
10
+ xa: number;
11
+ }
12
+ type NestProps = typeof Nest.defaultProps & {
13
+ children?: any;
14
+ position: "relative" | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "-webkit-sticky" | "absolute" | "fixed" | "static" | "sticky";
15
+ };
16
+ export default class Nest extends React.Component<NestProps, {}> {
17
+ static defaultProps: {
18
+ backgroundColor: string;
19
+ display: string;
20
+ top: number;
21
+ left: number;
22
+ zIndex: number;
23
+ count: number;
24
+ opacity: number;
25
+ overflow: string;
26
+ color: string;
27
+ pointColor: string;
28
+ position: string;
29
+ };
30
+ canvas?: HTMLCanvasElement;
31
+ all: Array<iTwoDAnimated | iTwoD>;
32
+ points?: Array<iTwoDAnimated>;
33
+ current: iTwoD;
34
+ constructor(props: any);
35
+ canvasContext?: CanvasRenderingContext2D;
36
+ componentDidMount(): void;
37
+ randomPoints: () => {
38
+ x: number;
39
+ y: number;
40
+ xa: number;
41
+ ya: number;
42
+ max: number;
43
+ }[];
44
+ tid: number;
45
+ drawCanvas: () => void;
46
+ destroy(): void;
47
+ render(): import("react/jsx-runtime").JSX.Element;
48
+ }
49
+ export {};
@@ -0,0 +1,9 @@
1
+ interface iPopupProperties {
2
+ open?: boolean;
3
+ handleClose: () => any;
4
+ children: any;
5
+ minWidth?: string;
6
+ maxWidth?: string;
7
+ }
8
+ export default function Popup({ open, handleClose, children, maxWidth, }: iPopupProperties): import("react/jsx-runtime").JSX.Element | null;
9
+ export {};
@@ -0,0 +1,6 @@
1
+ import { NavigateFunction } from "react-router-dom";
2
+ export declare let globalNavigate: NavigateFunction;
3
+ export declare const GlobalHistory: {
4
+ (): null;
5
+ displayName: string;
6
+ };
@@ -0,0 +1,2 @@
1
+ export declare const addValidSQL: any[];
2
+ export default function (sql: any): void;
@@ -0,0 +1,5 @@
1
+ import { AxiosInstance, AxiosResponse } from "axios";
2
+ export declare function HandleResponseCodes(data: any): void;
3
+ export declare function setCookies(cookies: string[], req?: AxiosResponse | undefined): void;
4
+ declare const axiosInstance: AxiosInstance;
5
+ export default axiosInstance;
@@ -0,0 +1,2 @@
1
+ declare const changed: (name: string, context: "state" | "props", old: any, v: any) => void;
2
+ export default changed;
@@ -0,0 +1,2 @@
1
+ import { iCarbonORMState, iRestfulObjectArrayTypes, tRestfulObjectValues } from "CarbonReact";
2
+ export default function deleteRestfulObjectArrays<ObjectType extends tRestfulObjectValues>(dataOrCallback: ((prev: Readonly<iCarbonORMState>) => ObjectType[]) | ObjectType[], stateKey: keyof iRestfulObjectArrayTypes, uniqueObjectId: keyof ObjectType, callback?: () => void): void;
@@ -0,0 +1,7 @@
1
+ import BootstrapStyle from "variables/bootstrap.module.css";
2
+ import DropInGamingStyles from "style.module.css";
3
+ export declare const getRootStyleValue: (property?: string) => string;
4
+ type tBootstrap = typeof BootstrapStyle;
5
+ type tDropInGaming = typeof DropInGamingStyles;
6
+ export default function getStyles<iCSS extends {}>(overrides?: iCSS): tBootstrap & tDropInGaming & iCSS;
7
+ export {};
@@ -0,0 +1 @@
1
+ export default function (hex: any): string;
@@ -0,0 +1,2 @@
1
+ declare const isEdgeBrowser: boolean;
2
+ export default isEdgeBrowser;
@@ -0,0 +1 @@
1
+ export declare function parseMultipleJson(ss: string | any): any[];
@@ -0,0 +1 @@
1
+ export default function ScrollIntoViewDirective(el: Element): void;
@@ -0,0 +1 @@
1
+ export default function setUrl(): void;
@@ -0,0 +1,17 @@
1
+ import { iCarbonORMState, iRestfulObjectArrayTypes, tRestfulObjectValues } from "CarbonReact";
2
+ export declare enum eUpdateInsertMethod {
3
+ REPLACE = 0,
4
+ FIRST = 1,
5
+ LAST = 2
6
+ }
7
+ /**
8
+ *
9
+ * merged with existing objects.uniqueObjectId || {}.
10
+ * @param dataOrCallback
11
+ * @param uniqueObjectId - the uniqueObjectId of the object to update; typically the primary key of the table.
12
+ * @param stateKey -
13
+ * @param insertUpdateOrder
14
+ * @param callback - if you want to do something with the updated state, you can pass a callback here. Run as the second
15
+ * parameter of setState.
16
+ */
17
+ export default function updateRestfulObjectArray<ObjectType extends tRestfulObjectValues>(dataOrCallback: ((prev: Readonly<iCarbonORMState>) => ObjectType[]) | ObjectType[], uniqueObjectId: keyof ObjectType, stateKey: keyof iRestfulObjectArrayTypes, insertUpdateOrder?: eUpdateInsertMethod, callback?: () => void): void;
@@ -0,0 +1,4 @@
1
+ import { ChangeEvent } from "react";
2
+ export declare function toDataURL(src: string, fileType: string, callback: (dataUriEncoded: string) => void): Promise<void>;
3
+ export declare function uploadImageChange(event: ChangeEvent<HTMLInputElement>, uploadCallback: ((imageDataUri: string) => void)): void;
4
+ export default function uploadImage(uploadCallback: (dataUriBase64: string) => void): () => void;
@@ -0,0 +1,4 @@
1
+ export default function useWindowDimensions(): {
2
+ width: number;
3
+ height: number;
4
+ };