react-dialogger 1.1.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.
Files changed (51) hide show
  1. package/README.md +303 -0
  2. package/components/CircularProgress.d.ts +8 -0
  3. package/components/CircularProgress.js +50 -0
  4. package/components/DialogActionBase.d.ts +44 -0
  5. package/components/DialogActionBase.js +222 -0
  6. package/components/DialogBase.d.ts +132 -0
  7. package/components/DialogBase.js +880 -0
  8. package/components/Futures/DialogCloseAction.d.ts +3 -0
  9. package/components/Futures/DialogCloseAction.js +54 -0
  10. package/components/Futures/DialogFullscreenAction.d.ts +3 -0
  11. package/components/Futures/DialogFullscreenAction.js +60 -0
  12. package/components/Futures/DialogHeaderActionsWrapper.d.ts +3 -0
  13. package/components/Futures/DialogHeaderActionsWrapper.js +11 -0
  14. package/components/Futures/DialogProcessing.d.ts +3 -0
  15. package/components/Futures/DialogProcessing.js +41 -0
  16. package/components/Futures/index.d.ts +4 -0
  17. package/components/Futures/index.js +11 -0
  18. package/components/RippleButton.d.ts +15 -0
  19. package/components/RippleButton.js +81 -0
  20. package/components/icons/CloseIcon.d.ts +6 -0
  21. package/components/icons/CloseIcon.js +23 -0
  22. package/components/icons/FullscreenExitIcon.d.ts +6 -0
  23. package/components/icons/FullscreenExitIcon.js +23 -0
  24. package/components/icons/FullscreenIcon.d.ts +6 -0
  25. package/components/icons/FullscreenIcon.js +23 -0
  26. package/components/icons/ResizeIcon.d.ts +6 -0
  27. package/components/icons/ResizeIcon.js +14 -0
  28. package/hooks/useDialogOptions.d.ts +3 -0
  29. package/hooks/useDialogOptions.js +82 -0
  30. package/index.d.ts +8 -0
  31. package/index.js +25 -0
  32. package/models/Dialog.d.ts +44 -0
  33. package/models/Dialog.js +142 -0
  34. package/models/DialogAction.d.ts +54 -0
  35. package/models/DialogAction.js +277 -0
  36. package/models/Resizeable.d.ts +21 -0
  37. package/models/Resizeable.js +87 -0
  38. package/package.json +20 -0
  39. package/styles/circular-progress.css +42 -0
  40. package/styles/dialog.action.css +234 -0
  41. package/styles/dialog.css +336 -0
  42. package/types/DialogActionTypes.d.ts +66 -0
  43. package/types/DialogActionTypes.js +3 -0
  44. package/types/DialogTypes.d.ts +128 -0
  45. package/types/DialogTypes.js +2 -0
  46. package/types/SizePosTypes.d.ts +5 -0
  47. package/types/SizePosTypes.js +2 -0
  48. package/types/index.d.ts +4 -0
  49. package/types/index.js +2 -0
  50. package/types/types.d.ts +58 -0
  51. package/types/types.js +2 -0
@@ -0,0 +1,128 @@
1
+ import { ComponentOrderType, IBackdropOptions, IDialogAnchor, IInProcess, ISnackbarAnchor, TInitialHolder, TNotifyOnClosing, TUserProps, DialogValues } from "./types";
2
+ import * as React from "react";
3
+ import { DialogAction } from "../models/DialogAction";
4
+ import Dialog from "../models/Dialog";
5
+ import { ITypeHeight, ITypeWidth } from "./SizePosTypes";
6
+ import DialogBase from "../components/DialogBase";
7
+ export interface TBaseDialogState {
8
+ [K: string]: any;
9
+ }
10
+ export interface BaseDialogState {
11
+ values: DialogValues;
12
+ inProcess: IInProcess;
13
+ fullscreenMode?: boolean;
14
+ }
15
+ export interface BaseDialogProps {
16
+ options?: DialogOptionsType;
17
+ ref: React.RefObject<any>;
18
+ body: TDialogCallbackNodeFn;
19
+ header?: TDialogCallbackNodeFn;
20
+ actions?: Array<DialogAction>;
21
+ dialogSize?: IDialogSize;
22
+ didMountCallback?: TDialogCallbackVoidFn;
23
+ stateListener: TDialogStateListenerCallbackType;
24
+ order?: ComponentOrderType;
25
+ /**@deprecated use initialValues*/
26
+ initialUserProps: TUserProps;
27
+ initialValues: DialogValues;
28
+ initialHolder: TInitialHolder;
29
+ /**
30
+ * @deprecated
31
+ * @see dialogOptions.snackbar.anchorOrigin */
32
+ snackbarAnchor?: ISnackbarAnchor;
33
+ dom: HTMLDivElement;
34
+ parent?: Dialog;
35
+ onClose?: () => void;
36
+ root?: any;
37
+ keyboardListener: (key: string, dialog: Dialog) => void;
38
+ }
39
+ export interface IDialogSize {
40
+ width?: ITypeWidth | number;
41
+ height?: ITypeHeight | number;
42
+ }
43
+ interface IDialogOptionsType {
44
+ backdrop?: IBackdropOptions;
45
+ base?: IBaseDialogOptions;
46
+ progress?: IBaseDialogProgressOptions;
47
+ snackbar?: {
48
+ anchorOrigin?: ISnackbarAnchor;
49
+ autoHideDuration?: number | null;
50
+ maxSnack?: number;
51
+ busyMessage?: string;
52
+ };
53
+ slot?: kSlot;
54
+ slotProps?: kSlotProps;
55
+ }
56
+ export type DialogOptionsType = Partial<IDialogOptionsType>;
57
+ interface kSlot {
58
+ action?: React.JSXElementConstructor<any>;
59
+ footer?: React.JSXElementConstructor<any>;
60
+ header?: React.JSXElementConstructor<any>;
61
+ }
62
+ interface kSlotProps {
63
+ action?: {
64
+ style?: React.CSSProperties;
65
+ [k: string]: any;
66
+ };
67
+ footer?: (props: IBaseFooterProps) => Record<string, any>;
68
+ header?: (props: IBaseHeaderProps) => Record<string, any>;
69
+ }
70
+ export interface IBaseDialogOptions {
71
+ closeable?: boolean;
72
+ initialAnchor?: IDialogAnchor;
73
+ draggable?: boolean;
74
+ resizeable?: boolean;
75
+ fullscreen?: boolean;
76
+ header?: {
77
+ style?: React.CSSProperties;
78
+ };
79
+ footer?: {
80
+ style?: React.CSSProperties;
81
+ };
82
+ style?: React.CSSProperties;
83
+ size?: IDialogSize;
84
+ notifyOnClosing?: TNotifyOnClosing;
85
+ actions?: {
86
+ disabledOnDialogProcessing?: boolean;
87
+ baseStyle?: React.CSSProperties;
88
+ };
89
+ headerControllerIcons?: {
90
+ size?: number;
91
+ color?: any;
92
+ };
93
+ }
94
+ export interface IBaseDialogProgressOptions {
95
+ color?: string;
96
+ size?: number;
97
+ }
98
+ export interface IBaseFooterProps extends BaseDialogSlotProps {
99
+ inProcess?: IInProcess;
100
+ }
101
+ type FooterSlotProps = ReturnType<NonNullable<kSlotProps['footer']>>;
102
+ export type IFooterProps = IBaseFooterProps & FooterSlotProps;
103
+ export interface IBaseHeaderProps extends BaseDialogSlotProps {
104
+ }
105
+ type HeaderSlotProps = ReturnType<NonNullable<kSlotProps['header']>>;
106
+ export type IHeaderProps = IBaseHeaderProps & HeaderSlotProps;
107
+ export interface BaseDialogSlotProps {
108
+ dialogValues: DialogValues;
109
+ dialogOptions: DialogOptionsType;
110
+ dialog?: IDialogDef;
111
+ }
112
+ export interface IStateDef extends Pick<BaseDialogState, "values" | "fullscreenMode" | "inProcess"> {
113
+ }
114
+ export interface IListenerDialogDef extends Omit<IDialogDef, "state" | "values" | "setValues"> {
115
+ }
116
+ export type TDialogStateListenerCallbackType = (state: IStateDef, values: DialogValues, dialog: IListenerDialogDef) => void;
117
+ type TDialogCallbackFn<T> = (dialog: IDialogDef) => T;
118
+ export type TDialogCallbackNodeFn = TDialogCallbackFn<string | React.ReactElement<any>>;
119
+ export type TDialogCallbackVoidFn = TDialogCallbackFn<void>;
120
+ export interface IDialogDef extends Omit<Partial<Pick<DialogBase, 'isInProcess' | 'setInProcess' | 'values' | 'setValue' | 'setValues' | 'close' | 'dialogOptions' | 'switchFullScreen' | 'actions' | 'snackbar' | 'formikValidate' | 'formikProps' | 'focus' | 'setOrder' | 'setBody'>>, 'switchFullScreen'> {
121
+ /** @deprecated Deprecated, use setValues instead. */
122
+ switchFullScreen?: DialogBase['switchFullScreen'];
123
+ /** @deprecated Deprecated, never use. */
124
+ setOrder?: DialogBase['setOrder'];
125
+ }
126
+ export interface IDialogCloseRef extends Pick<DialogBase, 'close'> {
127
+ }
128
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ export type ITypeWidth = "xs" | "sm" | "md" | "lg" | "xl" | "auto";
2
+ export type ITypeHeight = "initial" | "auto" | "fit-content" | "max-content" | "min-content" | "content" | "unset" | "revert" | "revert-layer";
3
+ export type TSnackbarHorizontal = "left" | "center" | "right";
4
+ export type TSnackbarVertical = "top" | "bottom";
5
+ export type TFlexPos = "flex-start" | "center" | "flex-end";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ export { IFooterProps, IHeaderProps, IBaseFooterProps, IBaseHeaderProps, IDialogCloseRef, IDialogDef, } from "./DialogTypes";
2
+ export { DialogValues } from "./types";
3
+ export { ActionDef, ActionDialogDef, // <-- Action -> Dialog dialog of action
4
+ IDialogActionDef } from "./DialogActionTypes";
package/types/index.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,58 @@
1
+ import { TSnackbarHorizontal, TSnackbarVertical, TFlexPos } from "./SizePosTypes";
2
+ export interface ISnackbarAnchor {
3
+ vertical?: TSnackbarVertical;
4
+ horizontal?: TSnackbarHorizontal;
5
+ }
6
+ export interface IDialogAnchor {
7
+ vertical?: TFlexPos;
8
+ horizontal?: TFlexPos;
9
+ }
10
+ export interface IBackdropOptions {
11
+ backgroundColor?: string;
12
+ opacity?: number;
13
+ hideOnClick?: boolean;
14
+ }
15
+ export type TNotifyOnClosing = "snackbar" | "zoom" | undefined;
16
+ export type TInitialHolder = any;
17
+ export interface IInProcess {
18
+ inProcess: boolean;
19
+ message?: string;
20
+ }
21
+ export interface ISnackBarOpenOptions {
22
+ message: string;
23
+ severity: TSeverity;
24
+ key?: string;
25
+ action?: (key: string, snackbarRef: any) => void;
26
+ autoHideDuration?: number;
27
+ }
28
+ export type TSeverity = "default" | "error" | "success" | "warning" | "info";
29
+ /**@deprecated
30
+ * @use TUserProps*/
31
+ export type TInitialValues<T extends Record<string, any>> = T;
32
+ /**@deprecated use TValues*/
33
+ export type TUserProps = {
34
+ [K: string]: any;
35
+ };
36
+ export type TValues = Record<string, any>;
37
+ export type DialogValues = Readonly<Partial<TValues>>;
38
+ export interface BaseDialogDOMRect {
39
+ height?: number;
40
+ width?: number;
41
+ x?: number;
42
+ y?: number;
43
+ bottom?: number;
44
+ left?: number;
45
+ right?: number;
46
+ top?: number;
47
+ isMultiple?: boolean;
48
+ }
49
+ export type ComponentOrderPositions = "before" | "after";
50
+ export type ComponentOrderType = {
51
+ position: ComponentOrderPositions;
52
+ dom: HTMLElement;
53
+ };
54
+ export type TAccessFrom = "internal" | "external";
55
+ export interface ICoords {
56
+ x: number;
57
+ y: number;
58
+ }
package/types/types.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });