@tap-payments/os-micro-frontend-shared 0.1.367-test.1 → 0.1.367-test.2
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/build/components/Notifications/Notifications.d.ts +1 -0
- package/build/components/Notifications/Notifications.js +12 -0
- package/build/components/Notifications/index.d.ts +2 -0
- package/build/components/Notifications/index.js +2 -0
- package/build/components/index.d.ts +1 -1
- package/build/components/index.js +1 -1
- package/build/hooks/index.d.ts +0 -1
- package/build/hooks/index.js +0 -1
- package/build/types/appEvents.d.ts +1 -3
- package/build/types/appEvents.js +0 -1
- package/build/types/apps.d.ts +4 -3
- package/build/types/index.d.ts +0 -1
- package/build/types/index.js +0 -1
- package/build/types/tsUtils.d.ts +4 -0
- package/build/utils/navigation.d.ts +1 -1
- package/package.json +2 -2
- package/build/components/Toaster/Toaster.d.ts +0 -1
- package/build/components/Toaster/Toaster.js +0 -12
- package/build/components/Toaster/index.d.ts +0 -2
- package/build/components/Toaster/index.js +0 -2
- package/build/hooks/useToast.d.ts +0 -12
- package/build/hooks/useToast.js +0 -43
- package/build/types/toast.d.ts +0 -16
- package/build/types/toast.js +0 -1
- /package/build/components/{Toaster → Notifications}/style.d.ts +0 -0
- /package/build/components/{Toaster → Notifications}/style.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function Notifications(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Box from '@mui/material/Box';
|
|
3
|
+
import { Toaster, resolveValue } from 'react-hot-toast';
|
|
4
|
+
import { actionSuccessIcon, warningInfoIcon } from '../../constants/index.js';
|
|
5
|
+
import { Content } from './style';
|
|
6
|
+
const icons = {
|
|
7
|
+
success: actionSuccessIcon,
|
|
8
|
+
error: warningInfoIcon,
|
|
9
|
+
};
|
|
10
|
+
export default function Notifications() {
|
|
11
|
+
return (_jsx(Toaster, { children: (t) => (_jsxs(Content, { children: [icons[t.type] && _jsx(Box, { component: "img", src: icons[t.type], alt: t.type }), _jsx(Box, { children: resolveValue(t.message, t) })] })) }));
|
|
12
|
+
}
|
|
@@ -50,7 +50,7 @@ export { default as MultiSelectDropdownButton, type ButtonWithDropdownProps } fr
|
|
|
50
50
|
export { default as MultiSelectWithSearch, type MultiSelectWithSearchProps, ChildMenuItem, ParentMenuItem } from './MultiSelectWithSearch';
|
|
51
51
|
export { default as NestedDropdown, type DropdownProps, type Selected, type Placement, Dropdown, NestedMenuItem } from './NestedDropdown';
|
|
52
52
|
export { default as NoInternet } from './NoInternet';
|
|
53
|
-
export { default as
|
|
53
|
+
export { default as Notifications } from './Notifications';
|
|
54
54
|
export { default as ProgressBar } from './ProgressBar';
|
|
55
55
|
export { default as ProgressRing } from './ProgressRing';
|
|
56
56
|
export * from './InputBase';
|
|
@@ -50,7 +50,7 @@ export { default as MultiSelectDropdownButton } from './MultiSelectDropdownButto
|
|
|
50
50
|
export { default as MultiSelectWithSearch, ChildMenuItem, ParentMenuItem } from './MultiSelectWithSearch';
|
|
51
51
|
export { default as NestedDropdown, Dropdown, NestedMenuItem } from './NestedDropdown';
|
|
52
52
|
export { default as NoInternet } from './NoInternet';
|
|
53
|
-
export { default as
|
|
53
|
+
export { default as Notifications } from './Notifications';
|
|
54
54
|
export { default as ProgressBar } from './ProgressBar';
|
|
55
55
|
export { default as ProgressRing } from './ProgressRing';
|
|
56
56
|
export * from './InputBase';
|
package/build/hooks/index.d.ts
CHANGED
package/build/hooks/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CalenderMode, NavigateFunction, TableMode, Timezone
|
|
1
|
+
import { CalenderMode, NavigateFunction, TableMode, Timezone } from './index.js';
|
|
2
2
|
import { DragControls } from 'framer-motion';
|
|
3
3
|
export declare enum AppEvent {
|
|
4
4
|
OnClickTableAction = "on-click-table-action",
|
|
@@ -10,7 +10,6 @@ export declare enum AppEvent {
|
|
|
10
10
|
OnNavigate = "on-navigate",
|
|
11
11
|
OnStartDrag = "on-start-drag",
|
|
12
12
|
OnChangeAppToolbar = "on-change-app-toolbar",
|
|
13
|
-
OnToast = "on-toast",
|
|
14
13
|
OnModifyRemotePayload = "on-modify-remote-payload"
|
|
15
14
|
}
|
|
16
15
|
/**
|
|
@@ -47,5 +46,4 @@ export type AppEventMap = {
|
|
|
47
46
|
windowId: string;
|
|
48
47
|
payload: object;
|
|
49
48
|
}) => void;
|
|
50
|
-
[AppEvent.OnToast]: (params: ToastEventPayload) => void;
|
|
51
49
|
};
|
package/build/types/appEvents.js
CHANGED
|
@@ -10,7 +10,6 @@ export var AppEvent;
|
|
|
10
10
|
AppEvent["OnNavigate"] = "on-navigate";
|
|
11
11
|
AppEvent["OnStartDrag"] = "on-start-drag";
|
|
12
12
|
AppEvent["OnChangeAppToolbar"] = "on-change-app-toolbar";
|
|
13
|
-
AppEvent["OnToast"] = "on-toast";
|
|
14
13
|
// Remote Events
|
|
15
14
|
AppEvent["OnModifyRemotePayload"] = "on-modify-remote-payload";
|
|
16
15
|
})(AppEvent || (AppEvent = {}));
|
package/build/types/apps.d.ts
CHANGED
|
@@ -4,14 +4,14 @@ import type { i18n } from 'i18next';
|
|
|
4
4
|
import { Theme } from '@mui/material';
|
|
5
5
|
import { CalenderMode } from './theme';
|
|
6
6
|
import { Timezone } from './appConfig';
|
|
7
|
-
import { Brand, Entity, TableMode } from './index.js';
|
|
7
|
+
import { Brand, Entity, Override, TableMode } from './index.js';
|
|
8
8
|
import { TextAndLang } from './common';
|
|
9
9
|
export type AppPayload<TServiceCodes extends string = string> = {
|
|
10
10
|
services: {
|
|
11
11
|
[key in TServiceCodes]?: ServicePayload;
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export type DefaultServicePayload = {
|
|
15
15
|
columnFilters?: Record<string, any>;
|
|
16
16
|
filteredIds?: string[];
|
|
17
17
|
dateRange?: [Date, Date];
|
|
@@ -21,7 +21,8 @@ export interface ServicePayload {
|
|
|
21
21
|
tableViews?: ColumnsView[];
|
|
22
22
|
calendarTimezone?: number;
|
|
23
23
|
reportTypes?: string[];
|
|
24
|
-
}
|
|
24
|
+
};
|
|
25
|
+
export type ServicePayload<TOverrides extends Partial<DefaultServicePayload> = object> = Override<DefaultServicePayload, TOverrides>;
|
|
25
26
|
export interface AppDetails {
|
|
26
27
|
id: string;
|
|
27
28
|
appCode: string;
|
package/build/types/index.d.ts
CHANGED
package/build/types/index.js
CHANGED
package/build/types/tsUtils.d.ts
CHANGED
|
@@ -6,3 +6,7 @@ export type PartialExcept<T, K extends keyof T> = Partial<Omit<T, K>> & Pick<T,
|
|
|
6
6
|
export type DeepPartial<T> = {
|
|
7
7
|
[K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];
|
|
8
8
|
};
|
|
9
|
+
export type GeneralObject = Record<string, any>;
|
|
10
|
+
export type DeepExtendableObject<T> = T extends (...args: any[]) => any ? T : T extends readonly (infer U)[] ? ReadonlyArray<DeepExtendableObject<U>> : T extends GeneralObject ? {
|
|
11
|
+
[K in keyof T]: DeepExtendableObject<T[K]>;
|
|
12
|
+
} & GeneralObject : T;
|
|
@@ -6,7 +6,7 @@ export declare const openNewAppAttrs: ({ appCode, serviceCode, sandboxMode, payl
|
|
|
6
6
|
numberOfOpenedApps: number;
|
|
7
7
|
segmentId: string;
|
|
8
8
|
}) => {
|
|
9
|
-
payload?: (Record<string, any> & import("../types/index.js").
|
|
9
|
+
payload?: (Record<string, any> & Omit<import("../types/index.js").DefaultServicePayload, never> & object) | undefined;
|
|
10
10
|
segmentId: string;
|
|
11
11
|
appCode: string;
|
|
12
12
|
serviceCode: string;
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tap-payments/os-micro-frontend-shared",
|
|
3
3
|
"description": "Shared components and utilities for Tap Payments micro frontends",
|
|
4
|
-
"version": "0.1.367-test.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.367-test.2",
|
|
5
|
+
"testVersion": 2,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function Toaster(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import Box from '@mui/material/Box';
|
|
3
|
-
import { Toaster as HotToaster, resolveValue } from 'react-hot-toast';
|
|
4
|
-
import { actionSuccessIcon, warningInfoIcon } from '../../constants/index.js';
|
|
5
|
-
import { Content } from './style';
|
|
6
|
-
const icons = {
|
|
7
|
-
success: actionSuccessIcon,
|
|
8
|
-
error: warningInfoIcon,
|
|
9
|
-
};
|
|
10
|
-
export default function Toaster() {
|
|
11
|
-
return (_jsx(HotToaster, { children: (t) => (_jsxs(Content, { children: [icons[t.type] && _jsx(Box, { component: "img", src: icons[t.type], alt: t.type }), _jsx(Box, { children: resolveValue(t.message, t) })] })) }));
|
|
12
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ToastMessage } from '../types/index.js';
|
|
2
|
-
import type { ToastOptions } from 'react-hot-toast';
|
|
3
|
-
export interface ToastFunction {
|
|
4
|
-
(message: ToastMessage, options?: ToastOptions): string;
|
|
5
|
-
success: (message: ToastMessage, options?: ToastOptions) => string;
|
|
6
|
-
error: (message: ToastMessage, options?: ToastOptions) => string;
|
|
7
|
-
loading: (message: ToastMessage, options?: ToastOptions) => string;
|
|
8
|
-
custom: (message: ToastMessage, options?: ToastOptions) => string;
|
|
9
|
-
dismiss: (toastId?: string) => void;
|
|
10
|
-
remove: (toastId?: string) => void;
|
|
11
|
-
}
|
|
12
|
-
export declare function useToast(): ToastFunction;
|
package/build/hooks/useToast.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { useAppEventPublisher } from './index.js';
|
|
2
|
-
import { AppEvent } from '../types/index.js';
|
|
3
|
-
export function useToast() {
|
|
4
|
-
const publish = useAppEventPublisher(AppEvent.OnToast);
|
|
5
|
-
const generateToastId = () => crypto.randomUUID();
|
|
6
|
-
const base = ((message, options) => {
|
|
7
|
-
var _a;
|
|
8
|
-
const id = (_a = options === null || options === void 0 ? void 0 : options.id) !== null && _a !== void 0 ? _a : generateToastId();
|
|
9
|
-
publish({ action: 'show', variant: 'default', message, options: Object.assign(Object.assign({}, options), { id }) });
|
|
10
|
-
return id;
|
|
11
|
-
});
|
|
12
|
-
base.success = (message, options) => {
|
|
13
|
-
var _a;
|
|
14
|
-
const id = (_a = options === null || options === void 0 ? void 0 : options.id) !== null && _a !== void 0 ? _a : generateToastId();
|
|
15
|
-
publish({ action: 'show', variant: 'success', message, options: Object.assign(Object.assign({}, options), { id }) });
|
|
16
|
-
return id;
|
|
17
|
-
};
|
|
18
|
-
base.error = (message, options) => {
|
|
19
|
-
var _a;
|
|
20
|
-
const id = (_a = options === null || options === void 0 ? void 0 : options.id) !== null && _a !== void 0 ? _a : generateToastId();
|
|
21
|
-
publish({ action: 'show', variant: 'error', message, options: Object.assign(Object.assign({}, options), { id }) });
|
|
22
|
-
return id;
|
|
23
|
-
};
|
|
24
|
-
base.loading = (message, options) => {
|
|
25
|
-
var _a;
|
|
26
|
-
const id = (_a = options === null || options === void 0 ? void 0 : options.id) !== null && _a !== void 0 ? _a : generateToastId();
|
|
27
|
-
publish({ action: 'show', variant: 'loading', message, options: Object.assign(Object.assign({}, options), { id }) });
|
|
28
|
-
return id;
|
|
29
|
-
};
|
|
30
|
-
base.custom = (message, options) => {
|
|
31
|
-
var _a;
|
|
32
|
-
const id = (_a = options === null || options === void 0 ? void 0 : options.id) !== null && _a !== void 0 ? _a : generateToastId();
|
|
33
|
-
publish({ action: 'show', variant: 'custom', message, options: Object.assign(Object.assign({}, options), { id }) });
|
|
34
|
-
return id;
|
|
35
|
-
};
|
|
36
|
-
base.dismiss = (toastId) => {
|
|
37
|
-
publish({ action: 'dismiss', variant: 'dismiss', toastId });
|
|
38
|
-
};
|
|
39
|
-
base.remove = (toastId) => {
|
|
40
|
-
publish({ action: 'remove', variant: 'remove', toastId });
|
|
41
|
-
};
|
|
42
|
-
return base;
|
|
43
|
-
}
|
package/build/types/toast.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { ToastOptions, ValueOrFunction, Renderable, Toast } from 'react-hot-toast';
|
|
2
|
-
export type ToastMessage = ValueOrFunction<Renderable, Toast>;
|
|
3
|
-
export type ToastEventPayload = {
|
|
4
|
-
action: 'show';
|
|
5
|
-
variant: 'default' | 'success' | 'error' | 'loading' | 'custom';
|
|
6
|
-
message: ToastMessage;
|
|
7
|
-
options?: ToastOptions;
|
|
8
|
-
} | {
|
|
9
|
-
variant: 'dismiss';
|
|
10
|
-
action: 'dismiss';
|
|
11
|
-
toastId?: string;
|
|
12
|
-
} | {
|
|
13
|
-
variant: 'remove';
|
|
14
|
-
action: 'remove';
|
|
15
|
-
toastId?: string;
|
|
16
|
-
};
|
package/build/types/toast.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
File without changes
|
|
File without changes
|