@adaptabletools/adaptable 12.1.0 → 12.1.1-canary.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 (35) hide show
  1. package/bundle.cjs.js +99 -99
  2. package/package.json +1 -1
  3. package/publishTimestamp.d.ts +1 -1
  4. package/publishTimestamp.js +1 -1
  5. package/src/Utilities/ObjectFactory.d.ts +1 -1
  6. package/src/Utilities/ObjectFactory.js +11 -11
  7. package/src/View/AdaptableView.js +2 -2
  8. package/src/View/Components/Popups/AdaptableToaster.js +7 -7
  9. package/src/bundle-dependencies/bundles/react-toastify/components/CloseButton.d.ts +9 -0
  10. package/src/bundle-dependencies/bundles/react-toastify/components/Icons.d.ts +24 -0
  11. package/src/bundle-dependencies/bundles/react-toastify/components/ProgressBar.d.ts +59 -0
  12. package/src/bundle-dependencies/bundles/react-toastify/components/Toast.d.ts +3 -0
  13. package/src/bundle-dependencies/bundles/react-toastify/components/ToastContainer.d.ts +3 -0
  14. package/src/bundle-dependencies/bundles/react-toastify/components/Transitions.d.ts +6 -0
  15. package/src/bundle-dependencies/bundles/react-toastify/components/index.d.ts +6 -0
  16. package/src/bundle-dependencies/bundles/react-toastify/core/eventManager.d.ts +39 -0
  17. package/src/bundle-dependencies/bundles/react-toastify/core/index.d.ts +2 -0
  18. package/src/bundle-dependencies/bundles/react-toastify/core/toast.d.ts +41 -0
  19. package/src/bundle-dependencies/bundles/react-toastify/hooks/index.d.ts +2 -0
  20. package/src/bundle-dependencies/bundles/react-toastify/hooks/useToast.d.ts +10 -0
  21. package/src/bundle-dependencies/bundles/react-toastify/hooks/useToastContainer.d.ts +23 -0
  22. package/src/bundle-dependencies/bundles/react-toastify/index.d.ts +5 -0
  23. package/src/bundle-dependencies/bundles/react-toastify/index.js +1 -0
  24. package/src/bundle-dependencies/bundles/react-toastify/inject-style.d.ts +8 -0
  25. package/src/bundle-dependencies/bundles/react-toastify/types/index.d.ts +269 -0
  26. package/src/bundle-dependencies/bundles/react-toastify/utils/collapseToast.d.ts +5 -0
  27. package/src/bundle-dependencies/bundles/react-toastify/utils/constant.d.ts +23 -0
  28. package/src/bundle-dependencies/bundles/react-toastify/utils/cssTransition.d.ts +43 -0
  29. package/src/bundle-dependencies/bundles/react-toastify/utils/index.d.ts +5 -0
  30. package/src/bundle-dependencies/bundles/react-toastify/utils/mapper.d.ts +2 -0
  31. package/src/bundle-dependencies/bundles/react-toastify/utils/propValidator.d.ts +9 -0
  32. package/src/components/Toastify/index.d.ts +3 -0
  33. package/src/components/Toastify/index.js +10 -0
  34. package/version.d.ts +1 -1
  35. package/version.js +1 -1
@@ -0,0 +1,269 @@
1
+ import React from 'react';
2
+ import { CloseButtonProps, IconProps } from '../components';
3
+ declare type Nullable<T> = {
4
+ [P in keyof T]: T[P] | null;
5
+ };
6
+ export declare type TypeOptions = 'info' | 'success' | 'warning' | 'error' | 'default';
7
+ export declare type Theme = 'light' | 'dark' | 'colored';
8
+ export declare type ToastPosition = 'top-right' | 'top-center' | 'top-left' | 'bottom-right' | 'bottom-center' | 'bottom-left';
9
+ export interface ToastContentProps<Data = {}> {
10
+ closeToast?: () => void;
11
+ toastProps: ToastProps;
12
+ data?: Data;
13
+ }
14
+ export declare type ToastContent<T = unknown> = React.ReactNode | ((props: ToastContentProps<T>) => React.ReactNode);
15
+ export declare type Id = number | string;
16
+ export declare type ToastTransition = React.FC<ToastTransitionProps> | React.ComponentClass<ToastTransitionProps>;
17
+ /**
18
+ * ClassName for the elements - can take a function to build a classname or a raw string that is cx'ed to defaults
19
+ */
20
+ export declare type ToastClassName = ((context?: {
21
+ type?: TypeOptions;
22
+ defaultClassName?: string;
23
+ position?: ToastPosition;
24
+ rtl?: boolean;
25
+ }) => string) | string;
26
+ export interface ClearWaitingQueueParams {
27
+ containerId?: Id;
28
+ }
29
+ export declare type DraggableDirection = 'x' | 'y';
30
+ interface CommonOptions {
31
+ /**
32
+ * Pause the timer when the mouse hover the toast.
33
+ * `Default: true`
34
+ */
35
+ pauseOnHover?: boolean;
36
+ /**
37
+ * Pause the toast when the window loses focus.
38
+ * `Default: true`
39
+ */
40
+ pauseOnFocusLoss?: boolean;
41
+ /**
42
+ * Remove the toast when clicked.
43
+ * `Default: true`
44
+ */
45
+ closeOnClick?: boolean;
46
+ /**
47
+ * Set the delay in ms to close the toast automatically.
48
+ * Use `false` to prevent the toast from closing.
49
+ * `Default: 5000`
50
+ */
51
+ autoClose?: number | false;
52
+ /**
53
+ * Set the default position to use.
54
+ * `One of: 'top-right', 'top-center', 'top-left', 'bottom-right', 'bottom-center', 'bottom-left'`
55
+ * `Default: 'top-right'`
56
+ */
57
+ position?: ToastPosition;
58
+ /**
59
+ * Pass a custom close button.
60
+ * To remove the close button pass `false`
61
+ */
62
+ closeButton?: boolean | ((props: CloseButtonProps) => React.ReactNode) | React.ReactElement<CloseButtonProps>;
63
+ /**
64
+ * An optional css class to set for the progress bar.
65
+ */
66
+ progressClassName?: ToastClassName;
67
+ /**
68
+ * An optional style to set for the progress bar.
69
+ */
70
+ progressStyle?: React.CSSProperties;
71
+ /**
72
+ * An optional css class to set for the toast content.
73
+ */
74
+ bodyClassName?: ToastClassName;
75
+ /**
76
+ * An optional inline style to apply for the toast content.
77
+ */
78
+ bodyStyle?: React.CSSProperties;
79
+ /**
80
+ * Hide or show the progress bar.
81
+ * `Default: false`
82
+ */
83
+ hideProgressBar?: boolean;
84
+ /**
85
+ * Pass a custom transition built with react-transition-group.
86
+ */
87
+ transition?: ToastTransition;
88
+ /**
89
+ * Allow toast to be draggable
90
+ * `Default: true`
91
+ */
92
+ draggable?: boolean;
93
+ /**
94
+ * The percentage of the toast's width it takes for a drag to dismiss a toast
95
+ * `Default: 80`
96
+ */
97
+ draggablePercent?: number;
98
+ /**
99
+ * Specify in which direction should you swipe to dismiss the toast
100
+ * `Default: "x"`
101
+ */
102
+ draggableDirection?: DraggableDirection;
103
+ /**
104
+ * Define the ARIA role for the toast
105
+ * `Default: alert`
106
+ * https://www.w3.org/WAI/PF/aria/roles
107
+ */
108
+ role?: string;
109
+ /**
110
+ * Set id to handle multiple container
111
+ */
112
+ containerId?: Id;
113
+ /**
114
+ * Fired when clicking inside toaster
115
+ */
116
+ onClick?: (event: React.MouseEvent) => void;
117
+ /**
118
+ * Support right to left display.
119
+ * `Default: false`
120
+ */
121
+ rtl?: boolean;
122
+ /**
123
+ * Used to display a custom icon. Set it to `false` to prevent
124
+ * the icons from being displayed
125
+ */
126
+ icon?: boolean | ((props: IconProps) => React.ReactNode) | React.ReactElement<IconProps> | string | number | React.ReactNode;
127
+ /**
128
+ * Theme to use.
129
+ * `One of: 'light', 'dark', 'colored'`
130
+ * `Default: 'light'`
131
+ */
132
+ theme?: Theme;
133
+ }
134
+ export interface ToastOptions<Data = {}> extends CommonOptions {
135
+ /**
136
+ * An optional css class to set.
137
+ */
138
+ className?: ToastClassName;
139
+ /**
140
+ * Called when toast is mounted.
141
+ */
142
+ onOpen?: <T = {}>(props: T) => void;
143
+ /**
144
+ * Called when toast is unmounted.
145
+ */
146
+ onClose?: <T = {}>(props: T) => void;
147
+ /**
148
+ * An optional inline style to apply.
149
+ */
150
+ style?: React.CSSProperties;
151
+ /**
152
+ * Set the toast type.
153
+ * `One of: 'info', 'success', 'warning', 'error', 'default'`
154
+ */
155
+ type?: TypeOptions;
156
+ /**
157
+ * Set a custom `toastId`
158
+ */
159
+ toastId?: Id;
160
+ /**
161
+ * Used during update
162
+ */
163
+ updateId?: Id;
164
+ /**
165
+ * Set the percentage for the controlled progress bar. `Value must be between 0 and 1.`
166
+ */
167
+ progress?: number | string;
168
+ /**
169
+ * Add a delay in ms before the toast appear.
170
+ */
171
+ delay?: number;
172
+ isLoading?: boolean;
173
+ data?: Data;
174
+ }
175
+ export interface UpdateOptions<T = unknown> extends Nullable<ToastOptions<T>> {
176
+ /**
177
+ * Used to update a toast.
178
+ * Pass any valid ReactNode(string, number, component)
179
+ */
180
+ render?: ToastContent<T>;
181
+ }
182
+ export interface ToastContainerProps extends CommonOptions {
183
+ /**
184
+ * An optional css class to set.
185
+ */
186
+ className?: ToastClassName;
187
+ /**
188
+ * Whether or not to display the newest toast on top.
189
+ * `Default: false`
190
+ */
191
+ newestOnTop?: boolean;
192
+ /**
193
+ * An optional inline style to apply.
194
+ */
195
+ style?: React.CSSProperties;
196
+ /**
197
+ * An optional inline style to apply for the toast.
198
+ */
199
+ toastStyle?: React.CSSProperties;
200
+ /**
201
+ * An optional css class for the toast.
202
+ */
203
+ toastClassName?: ToastClassName;
204
+ /**
205
+ * Show the toast only if it includes containerId and it's the same as containerId
206
+ * `Default: false`
207
+ */
208
+ enableMultiContainer?: boolean;
209
+ /**
210
+ * Limit the number of toast displayed at the same time
211
+ */
212
+ limit?: number;
213
+ }
214
+ export interface ToastTransitionProps {
215
+ isIn: boolean;
216
+ done: () => void;
217
+ position: ToastPosition | string;
218
+ preventExitTransition: boolean;
219
+ nodeRef: React.RefObject<HTMLElement>;
220
+ children?: React.ReactNode;
221
+ }
222
+ /**
223
+ * @INTERNAL
224
+ */
225
+ export interface ToastProps extends ToastOptions {
226
+ isIn: boolean;
227
+ staleId?: Id;
228
+ toastId: Id;
229
+ key: Id;
230
+ transition: ToastTransition;
231
+ closeToast: () => void;
232
+ position: ToastPosition;
233
+ children?: ToastContent;
234
+ draggablePercent: number;
235
+ draggableDirection?: DraggableDirection;
236
+ progressClassName?: ToastClassName;
237
+ className?: ToastClassName;
238
+ bodyClassName?: ToastClassName;
239
+ deleteToast: () => void;
240
+ theme: Theme;
241
+ type: TypeOptions;
242
+ iconOut?: React.ReactNode;
243
+ }
244
+ /**
245
+ * @INTERNAL
246
+ */
247
+ export interface NotValidatedToastProps extends Partial<ToastProps> {
248
+ toastId: Id;
249
+ }
250
+ /**
251
+ * @INTERNAL
252
+ */
253
+ export interface Toast {
254
+ content: ToastContent;
255
+ props: ToastProps;
256
+ }
257
+ export declare type ToastItemStatus = 'added' | 'removed' | 'updated';
258
+ export interface ToastItem<Data = {}> {
259
+ content: React.ReactNode;
260
+ id: Id;
261
+ theme?: Theme;
262
+ type?: TypeOptions;
263
+ isLoading?: boolean;
264
+ containerId?: Id;
265
+ data: Data;
266
+ icon?: React.ReactNode | false;
267
+ status: ToastItemStatus;
268
+ }
269
+ export {};
@@ -0,0 +1,5 @@
1
+ import { Default } from './constant';
2
+ /**
3
+ * Used to collapse toast after exit animation
4
+ */
5
+ export declare function collapseToast(node: HTMLElement, done: () => void, duration?: Default): void;
@@ -0,0 +1,23 @@
1
+ import { ToastPosition, TypeOptions } from '../types';
2
+ declare type KeyOfPosition = 'TOP_LEFT' | 'TOP_RIGHT' | 'TOP_CENTER' | 'BOTTOM_LEFT' | 'BOTTOM_RIGHT' | 'BOTTOM_CENTER';
3
+ declare type KeyOfType = 'INFO' | 'SUCCESS' | 'WARNING' | 'ERROR' | 'DEFAULT';
4
+ export declare const POSITION: {
5
+ [key in KeyOfPosition]: ToastPosition;
6
+ };
7
+ export declare const TYPE: {
8
+ [key in KeyOfType]: TypeOptions;
9
+ };
10
+ export declare const enum Default {
11
+ COLLAPSE_DURATION = 300,
12
+ DEBOUNCE_DURATION = 50,
13
+ CSS_NAMESPACE = "Toastify",
14
+ DRAGGABLE_PERCENT = 80
15
+ }
16
+ export declare const enum Direction {
17
+ X = "x",
18
+ Y = "y"
19
+ }
20
+ export declare const enum SyntheticEvent {
21
+ ENTRANCE_ANIMATION_END = "d"
22
+ }
23
+ export {};
@@ -0,0 +1,43 @@
1
+ /// <reference types="react" />
2
+ import { ToastTransitionProps } from '../types';
3
+ export interface CSSTransitionProps {
4
+ /**
5
+ * Css class to apply when toast enter
6
+ */
7
+ enter: string;
8
+ /**
9
+ * Css class to apply when toast leave
10
+ */
11
+ exit: string;
12
+ /**
13
+ * Append current toast position to the classname.
14
+ * If multiple classes are provided, only the last one will get the position
15
+ * For instance `myclass--top-center`...
16
+ * `Default: false`
17
+ */
18
+ appendPosition?: boolean;
19
+ /**
20
+ * Collapse toast smoothly when exit animation end
21
+ * `Default: true`
22
+ */
23
+ collapse?: boolean;
24
+ /**
25
+ * Collapse transition duration
26
+ * `Default: 300`
27
+ */
28
+ collapseDuration?: number;
29
+ }
30
+ /**
31
+ * Css animation that just work.
32
+ * You could use animate.css for instance
33
+ *
34
+ *
35
+ * ```
36
+ * cssTransition({
37
+ * enter: "animate__animated animate__bounceIn",
38
+ * exit: "animate__animated animate__bounceOut"
39
+ * })
40
+ * ```
41
+ *
42
+ */
43
+ export declare function cssTransition({ enter, exit, appendPosition, collapse, collapseDuration }: CSSTransitionProps): ({ children, position, preventExitTransition, done, nodeRef, isIn }: ToastTransitionProps) => JSX.Element;
@@ -0,0 +1,5 @@
1
+ export * from './propValidator';
2
+ export * from './constant';
3
+ export * from './cssTransition';
4
+ export * from './collapseToast';
5
+ export * from './mapper';
@@ -0,0 +1,2 @@
1
+ import { Toast, ToastItem, ToastItemStatus } from '../types';
2
+ export declare function toToastItem(toast: Toast, status: ToastItemStatus): ToastItem;
@@ -0,0 +1,9 @@
1
+ import { Id } from '../types';
2
+ export declare function isNum(v: any): v is Number;
3
+ export declare function isBool(v: any): v is Boolean;
4
+ export declare function isStr(v: any): v is String;
5
+ export declare function isFn(v: any): v is Function;
6
+ export declare function parseClassName(v: any): any;
7
+ export declare function isToastIdValid(toastId?: Id): true | Id | undefined;
8
+ export declare function getAutoCloseDelay(toastAutoClose?: false | number, containerAutoClose?: false | number): number | false | undefined;
9
+ export declare function canBeRendered<T>(content: T): boolean;
@@ -0,0 +1,3 @@
1
+ export { toast, ToastContainer, Slide, Zoom, Bounce, Flip, } from '../../bundle-dependencies/bundles/react-toastify';
2
+ import { ToastOptions } from '../../bundle-dependencies/bundles/react-toastify';
3
+ export type { ToastOptions };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Flip = exports.Bounce = exports.Zoom = exports.Slide = exports.ToastContainer = exports.toast = void 0;
4
+ var react_toastify_1 = require("../../bundle-dependencies/bundles/react-toastify");
5
+ Object.defineProperty(exports, "toast", { enumerable: true, get: function () { return react_toastify_1.toast; } });
6
+ Object.defineProperty(exports, "ToastContainer", { enumerable: true, get: function () { return react_toastify_1.ToastContainer; } });
7
+ Object.defineProperty(exports, "Slide", { enumerable: true, get: function () { return react_toastify_1.Slide; } });
8
+ Object.defineProperty(exports, "Zoom", { enumerable: true, get: function () { return react_toastify_1.Zoom; } });
9
+ Object.defineProperty(exports, "Bounce", { enumerable: true, get: function () { return react_toastify_1.Bounce; } });
10
+ Object.defineProperty(exports, "Flip", { enumerable: true, get: function () { return react_toastify_1.Flip; } });
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "12.1.0";
1
+ declare const _default: "12.1.1-canary.0";
2
2
  export default _default;
package/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = '12.1.0'; // PLEASE DONT UPDATE THIS!!! - will be updated at build time with the correct version
3
+ exports.default = '12.1.1-canary.0'; // PLEASE DONT UPDATE THIS!!! - will be updated at build time with the correct version