@bigbinary/neeto-molecules 1.0.12 → 1.0.14
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/README.md +1 -0
- package/dist/Columns.cjs.js +1 -1
- package/dist/Columns.js +1 -1
- package/dist/CustomDomain.cjs.js +2 -2
- package/dist/CustomDomain.js +2 -2
- package/dist/DateRangeFilter.cjs.js +1 -1
- package/dist/DateRangeFilter.js +1 -1
- package/dist/IpRestriction.cjs.js +1 -1
- package/dist/IpRestriction.js +1 -1
- package/dist/LoginPage.cjs.js +1 -1
- package/dist/LoginPage.js +1 -1
- package/dist/MenuBar.cjs.js +9 -9
- package/dist/MenuBar.js +9 -9
- package/dist/NeetoWidget.cjs.js +3 -3
- package/dist/NeetoWidget.js +3 -3
- package/dist/Schedule.cjs.js +1 -1
- package/dist/Schedule.js +1 -1
- package/dist/Scrollable.cjs.js +6 -0
- package/dist/Scrollable.js +6 -0
- package/dist/Sidebar.cjs.js +1 -30
- package/dist/Sidebar.js +1 -30
- package/dist/TimeFormat.cjs.js +1 -1
- package/dist/TimeFormat.js +1 -1
- package/dist/TimezoneMismatchModal.cjs.js +1 -1
- package/dist/TimezoneMismatchModal.js +1 -1
- package/package.json +8 -5
- package/src/translations/en.json +24 -1
- package/types/BrowserSupport.d.ts +40 -3
- package/types/Columns.d.ts +66 -3
- package/types/Container.d.ts +31 -3
- package/types/CustomDomain.d.ts +30 -4
- package/types/DateRangeFilter.d.ts +40 -5
- package/types/DynamicVariables.d.ts +32 -5
- package/types/EmailPreview.d.ts +37 -3
- package/types/ErrorPage.d.ts +14 -3
- package/types/IpRestriction.d.ts +21 -3
- package/types/KeyboardShortcuts.d.ts +84 -5
- package/types/LoginPage.d.ts +36 -3
- package/types/MenuBar.d.ts +116 -8
- package/types/NeetoWidget.d.ts +24 -5
- package/types/PageLoader.d.ts +35 -4
- package/types/PublishBlock.d.ts +57 -5
- package/types/Schedule.d.ts +126 -3
- package/types/Scrollable.d.ts +28 -0
- package/types/ShareViaEmail.d.ts +73 -4
- package/types/ShareViaLink.d.ts +63 -3
- package/types/Sidebar.d.ts +27 -4
- package/types/TimeFormat.d.ts +14 -2
- package/types/TimezoneMismatchModal.d.ts +34 -3
package/types/IpRestriction.d.ts
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* A common component to restrict IPs in neeto applications.
|
|
5
|
+
*
|
|
6
|
+
* 
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
*
|
|
10
|
+
* import IpRestriction from "@bigbinary/neeto-molecules/IpRestriction";
|
|
11
|
+
*
|
|
12
|
+
* const IpRestrictionSetting = () => (
|
|
13
|
+
* <Container isHeaderFixed className="w-full">
|
|
14
|
+
* <Header title="IP Restrictions" />
|
|
15
|
+
* <Scrollable className="w-full">
|
|
16
|
+
* <IpRestriction />
|
|
17
|
+
* </Scrollable>
|
|
18
|
+
* </Container>
|
|
19
|
+
* );
|
|
20
|
+
* @endexample
|
|
21
|
+
*/
|
|
3
22
|
const IpRestriction: React.FC<{}>;
|
|
4
|
-
|
|
5
|
-
export default IpRestriction;
|
|
23
|
+
export default IpRestriction;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { TFunction } from "i18next";
|
|
3
|
-
|
|
4
3
|
interface Shortcut {
|
|
5
4
|
sequence: string;
|
|
6
5
|
description: TFunction;
|
|
@@ -12,12 +11,92 @@ interface Category {
|
|
|
12
11
|
interface ProductShortcuts {
|
|
13
12
|
[index: string | TFunction]: Category;
|
|
14
13
|
}
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* A common component that accept's a list of all the keyboard shortcuts in a
|
|
17
|
+
*
|
|
18
|
+
* product and renders a side panel on the right side of the screen upon pressing a
|
|
19
|
+
*
|
|
20
|
+
* defined hotkey (shift+/).
|
|
21
|
+
*
|
|
22
|
+
* All the global shortcuts like open pane, close modal etc will be rendered by
|
|
23
|
+
*
|
|
24
|
+
* default by the component. It provides a single prop called productShortcuts
|
|
25
|
+
*
|
|
26
|
+
* which is used to pass in the product specific keyboard shortcuts. The prop's
|
|
27
|
+
*
|
|
28
|
+
* structure is given below:
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
*
|
|
32
|
+
* {
|
|
33
|
+
* [i18n.t("shortcuts.category1.categoryName")]: {
|
|
34
|
+
* shortcutName: {
|
|
35
|
+
* sequence: "command+shift+r",
|
|
36
|
+
* description: "",
|
|
37
|
+
* },
|
|
38
|
+
* },
|
|
39
|
+
* [i18n.t("shortcuts.category2.categoryName")]: {
|
|
40
|
+
* shortcutName2: {
|
|
41
|
+
* sequence: "r s",
|
|
42
|
+
* description: "",
|
|
43
|
+
* fullShortcutsLink: "www.example.com/all-shortcuts"
|
|
44
|
+
* },
|
|
45
|
+
* },
|
|
46
|
+
* }
|
|
47
|
+
* @endexample
|
|
48
|
+
* fullShortcutsLink is an optional property in the data structure which can be
|
|
49
|
+
*
|
|
50
|
+
* used to render links which points to external pages that lists all the
|
|
51
|
+
*
|
|
52
|
+
* shortcuts. This will be useful when the number of shortcuts under a category is
|
|
53
|
+
*
|
|
54
|
+
* very large.
|
|
55
|
+
*
|
|
56
|
+
* The sequence should be passed in MacOS format and the component will take care
|
|
57
|
+
*
|
|
58
|
+
* of detecting & converting it to the users platform. The component supports three
|
|
59
|
+
*
|
|
60
|
+
* kinds of sequence.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
*
|
|
64
|
+
* import KeyboardShortcuts from "@bigbinary/neeto-molecules/KeyboardShortcuts";
|
|
65
|
+
*
|
|
66
|
+
* const App = () => (
|
|
67
|
+
* <Main />
|
|
68
|
+
* <KeyboardShortcuts.Pane productShortcuts={{
|
|
69
|
+
* [i18n.t("shortcuts.tickets.categoryName")]: {
|
|
70
|
+
* openNotes: {
|
|
71
|
+
* sequence: "command+shift+r",
|
|
72
|
+
* description: i18n.t("shortcuts.tickets.openNotes"),
|
|
73
|
+
* },
|
|
74
|
+
* },
|
|
75
|
+
* }}/>
|
|
76
|
+
* )
|
|
77
|
+
* @endexample
|
|
78
|
+
* This hook can be used to manage the behavior of KeyboardShortcuts pane.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
*
|
|
82
|
+
* import KeyboardShortcuts from "@bigbinary/neeto-molecules/KeyboardShortcuts";
|
|
83
|
+
*
|
|
84
|
+
* const [isOpen, setIsOpen] = KeyboardShortcuts.usePaneState();
|
|
85
|
+
*
|
|
86
|
+
* return (
|
|
87
|
+
* <>
|
|
88
|
+
* <button onClick={() => setIsOpen(true)}> Open shortcuts pane</button>
|
|
89
|
+
* <button onClick={() => setIsOpen(prevIsOpen => !prevIsOpen)}>
|
|
90
|
+
* Toggle shortcuts pane
|
|
91
|
+
* </button>
|
|
92
|
+
* </>
|
|
93
|
+
* );
|
|
94
|
+
* @endexample
|
|
95
|
+
*/
|
|
96
|
+
const KeyboardShortcuts: {
|
|
17
97
|
Pane: React.FC<{
|
|
18
98
|
productShortcuts?: ProductShortcuts;
|
|
19
99
|
}>;
|
|
20
100
|
usePaneState(): [boolean, React.Dispatch<React.SetStateAction<boolean>>];
|
|
21
101
|
};
|
|
22
|
-
|
|
23
|
-
export default KeyboardShortcutsPane;
|
|
102
|
+
export default KeyboardShortcuts;
|
package/types/LoginPage.d.ts
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* A common login page for all neeto-applications with dedicated button for oliver
|
|
5
|
+
*
|
|
6
|
+
* to login.
|
|
7
|
+
*
|
|
8
|
+
* undefined
|
|
9
|
+
*
|
|
10
|
+
* Usage:
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
*
|
|
14
|
+
* import LoginPage from "@bigbinary/neeto-molecules/LoginPage";
|
|
15
|
+
*
|
|
16
|
+
* // Main.jsx
|
|
17
|
+
* export default function Main() {
|
|
18
|
+
* if (!isLoggedIn) {
|
|
19
|
+
* return <LoginPage handleSubmit={payload => sessionsApi.create(payload)} />;
|
|
20
|
+
* }
|
|
21
|
+
*
|
|
22
|
+
* // return main routes
|
|
23
|
+
* }
|
|
24
|
+
* @endexample
|
|
25
|
+
* The payload will be of the following format:
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
*
|
|
29
|
+
* {
|
|
30
|
+
* "user": {
|
|
31
|
+
* "email": "oliver@example.com",
|
|
32
|
+
* "password": "welcome"
|
|
33
|
+
* }
|
|
34
|
+
* }
|
|
35
|
+
* @endexample
|
|
36
|
+
*/
|
|
3
37
|
const LoginPage: React.FC<{
|
|
4
38
|
handleSubmit: (data: {
|
|
5
39
|
user: {
|
|
@@ -8,5 +42,4 @@ const LoginPage: React.FC<{
|
|
|
8
42
|
};
|
|
9
43
|
}) => any;
|
|
10
44
|
}>;
|
|
11
|
-
|
|
12
|
-
export default LoginPage;
|
|
45
|
+
export default LoginPage;
|
package/types/MenuBar.d.ts
CHANGED
|
@@ -1,9 +1,117 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { ButtonProps, InputProps } from "@bigbinary/neetoui";
|
|
3
|
+
import { LinkProps } from "react-router-dom";
|
|
4
|
+
type BlockProps = {
|
|
5
|
+
label: string;
|
|
6
|
+
url?: string;
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
|
+
count?: number;
|
|
9
|
+
active?: boolean;
|
|
10
|
+
onEdit?: (...args: any[]) => any;
|
|
11
|
+
onClick?: (...args: any[]) => any;
|
|
12
|
+
className?: string;
|
|
13
|
+
} & LinkProps & React.RefAttributes<HTMLAnchorElement> & React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
|
|
14
|
+
type ItemProps = {
|
|
15
|
+
label?: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
active?: boolean;
|
|
18
|
+
className?: string;
|
|
19
|
+
} & React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
|
|
20
|
+
type SubTitleProps = {
|
|
21
|
+
iconProps?: ButtonProps[];
|
|
22
|
+
} & React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
|
23
|
+
type SearchProps = {
|
|
24
|
+
isCollapsed?: boolean;
|
|
25
|
+
onCollapse?: React.MouseEventHandler<HTMLButtonElement>;
|
|
26
|
+
} & InputProps;
|
|
27
|
+
type AddNewProps = {
|
|
28
|
+
label?: string;
|
|
29
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
30
|
+
} & React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* Used in neeto products to show a collapsible menu which can be used for adding
|
|
34
|
+
*
|
|
35
|
+
* navigation options to view different sections.
|
|
36
|
+
*
|
|
37
|
+
* 
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
*
|
|
41
|
+
* import MenuBar from "@bigbinary/neeto-molecules/MenuBar";
|
|
42
|
+
*
|
|
43
|
+
* const MenuBarContainer = ({ children }) => {
|
|
44
|
+
* return (
|
|
45
|
+
* <div>
|
|
46
|
+
* <MenuBar showMenu />
|
|
47
|
+
* </div>
|
|
48
|
+
* );
|
|
49
|
+
* };
|
|
50
|
+
* @endexample
|
|
51
|
+
* MenuBar with custom title
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
*
|
|
55
|
+
* import MenuBar from "@bigbinary/neeto-molecules/MenuBar";
|
|
56
|
+
*
|
|
57
|
+
* const MenuBarContainer = ({ children }) => {
|
|
58
|
+
* return (
|
|
59
|
+
* <div>
|
|
60
|
+
* <MenuBar showMenu title="Custom Title" />
|
|
61
|
+
* </div>
|
|
62
|
+
* );
|
|
63
|
+
* };
|
|
64
|
+
* @endexample
|
|
65
|
+
* MenuBar with child components
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
*
|
|
69
|
+
* import MenuBar from "@bigbinary/neeto-molecules/MenuBar";
|
|
70
|
+
*
|
|
71
|
+
* const MenuBarContainer = ({ children }) => {
|
|
72
|
+
* return (
|
|
73
|
+
* <div>
|
|
74
|
+
* <MenuBar showMenu title="Custom Title">
|
|
75
|
+
* <MenuBar.Block active count={13} label="All" />
|
|
76
|
+
* <MenuBar.SubTitle
|
|
77
|
+
* iconProps={[
|
|
78
|
+
* {
|
|
79
|
+
* icon: Search,
|
|
80
|
+
* onClick: () => {},
|
|
81
|
+
* },
|
|
82
|
+
* ]}
|
|
83
|
+
* >
|
|
84
|
+
* <Typography
|
|
85
|
+
* component="h4"
|
|
86
|
+
* style="h5"
|
|
87
|
+
* textTransform="uppercase"
|
|
88
|
+
* weight="bold"
|
|
89
|
+
* >
|
|
90
|
+
* Subtitle
|
|
91
|
+
* </Typography>
|
|
92
|
+
* </MenuBar.SubTitle>
|
|
93
|
+
* <MenuBar.Search collapse={isSearchCollapsed} onCollapse={() => {}} />
|
|
94
|
+
* <MenuBar.AddNew label="Add new button" />
|
|
95
|
+
* <MenuBar.Item
|
|
96
|
+
* description="An Item which can have a subheading and heading"
|
|
97
|
+
* label="Heading"
|
|
98
|
+
* />
|
|
99
|
+
* </MenuBar>
|
|
100
|
+
* </div>
|
|
101
|
+
* );
|
|
102
|
+
* };
|
|
103
|
+
* @endexample
|
|
104
|
+
*/
|
|
105
|
+
const MenuBar: React.FC<{
|
|
106
|
+
title?: string;
|
|
107
|
+
showMenu?: boolean;
|
|
108
|
+
className?: string;
|
|
109
|
+
children?: React.ReactNode | React.ReactNode[];
|
|
110
|
+
}> & {
|
|
111
|
+
Block: React.FC<BlockProps>;
|
|
112
|
+
Item: React.FC<ItemProps>;
|
|
113
|
+
SubTitle: React.FC<SubTitleProps>;
|
|
114
|
+
Search: React.FC<SearchProps>;
|
|
115
|
+
AddNew: React.FC<AddNewProps>;
|
|
116
|
+
};
|
|
117
|
+
export default MenuBar;
|
package/types/NeetoWidget.d.ts
CHANGED
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
2
|
type EmbedCode = React.FC<{
|
|
4
3
|
primaryApp?: string;
|
|
5
|
-
initialSelectedWidgets?: string[];
|
|
6
4
|
}>;
|
|
7
|
-
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* This object contains the widget names.
|
|
8
|
+
*
|
|
9
|
+
* This component can be used to render the neetoWidget embed code within any
|
|
10
|
+
*
|
|
11
|
+
* host application. It uses APIs from neeto_sso to query the apiKey from
|
|
12
|
+
*
|
|
13
|
+
* neeto-auth-web, enable/disable widgets, and to allow the user to send the
|
|
14
|
+
*
|
|
15
|
+
* embed code via email.
|
|
16
|
+
*
|
|
17
|
+
* Developers can use the props to customize the component for the host
|
|
18
|
+
*
|
|
19
|
+
* application.
|
|
20
|
+
*
|
|
21
|
+
* Usage:
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
*
|
|
25
|
+
* <NeetoWidget.EmbedCode primaryApp={NeetoWidget.WIDGET_TYPES.chat} />
|
|
26
|
+
* @endexample
|
|
27
|
+
*/
|
|
8
28
|
const NeetoWidget: {
|
|
9
29
|
EmbedCode: EmbedCode;
|
|
10
30
|
WIDGET_TYPES: {
|
|
@@ -13,5 +33,4 @@ const NeetoWidget: {
|
|
|
13
33
|
replay: "replay";
|
|
14
34
|
};
|
|
15
35
|
};
|
|
16
|
-
|
|
17
|
-
export default NeetoWidget;
|
|
36
|
+
export default NeetoWidget;
|
package/types/PageLoader.d.ts
CHANGED
|
@@ -1,7 +1,38 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* Used in neeto products as the page loader to indicate that the page is being
|
|
5
|
+
*
|
|
6
|
+
* loaded.
|
|
7
|
+
*
|
|
8
|
+
* 
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
*
|
|
12
|
+
* import PageLoader from "@bigbinary/neeto-molecules/PageLoader";
|
|
13
|
+
* const PageLoaderContainer = ({ children }) => {
|
|
14
|
+
* return (
|
|
15
|
+
* <div>
|
|
16
|
+
* <PageLoader />
|
|
17
|
+
* </div>
|
|
18
|
+
* );
|
|
19
|
+
* };
|
|
20
|
+
* @endexample
|
|
21
|
+
* PageLoader with custom text
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
*
|
|
25
|
+
* import PageLoader from "@bigbinary/neeto-molecules/PageLoader";
|
|
26
|
+
* const PageLoaderContainer = ({ children }) => {
|
|
27
|
+
* return (
|
|
28
|
+
* <div>
|
|
29
|
+
* <PageLoader text="Loading..." />
|
|
30
|
+
* </div>
|
|
31
|
+
* );
|
|
32
|
+
* };
|
|
33
|
+
* @endexample
|
|
34
|
+
*/
|
|
3
35
|
const PageLoader: React.FC<{
|
|
4
|
-
|
|
36
|
+
text?: string;
|
|
5
37
|
}>;
|
|
6
|
-
|
|
7
|
-
export default PageLoader;
|
|
38
|
+
export default PageLoader;
|
package/types/PublishBlock.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
2
|
import { AlertProps } from "@bigbinary/neetoui";
|
|
4
|
-
|
|
5
3
|
interface PublishBlockProps {
|
|
6
4
|
renderDraftButtons: (props: {
|
|
7
5
|
ViewDraftButton: JSX.Element;
|
|
@@ -12,9 +10,63 @@ interface PublishBlockProps {
|
|
|
12
10
|
PublishPreviewButton: JSX.Element;
|
|
13
11
|
}) => React.ReactNode;
|
|
14
12
|
}
|
|
15
|
-
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* A common component to manage draft and publish versions.
|
|
16
|
+
*
|
|
17
|
+
* 
|
|
18
|
+
*
|
|
19
|
+
* This optional component can be used to render the reset alert modal for
|
|
20
|
+
*
|
|
21
|
+
* discarding draft.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
*
|
|
25
|
+
* import PublishBlock from "@bigbinary/neeto-molecules/PublishBlock";
|
|
26
|
+
*
|
|
27
|
+
* const PublishActionBlock = (
|
|
28
|
+
* {
|
|
29
|
+
* //all variables used in the below example can be passed as props or can be defined in the component itself
|
|
30
|
+
* }
|
|
31
|
+
* ) => {
|
|
32
|
+
* const renderDraftButtons = ({ ViewDraftButton, ResetDraftButton }) =>
|
|
33
|
+
* !isDraftBlockHidden && (
|
|
34
|
+
* <>
|
|
35
|
+
* <ViewDraftButton to={previewDraftUrl} />
|
|
36
|
+
* {hasDraftVersion && <ResetDraftButton onClick={handleResetDraft} />}
|
|
37
|
+
* </>
|
|
38
|
+
* );
|
|
39
|
+
*
|
|
40
|
+
* const renderPublishButtons = ({ PublishButton, PublishPreviewButton }) => (
|
|
41
|
+
* <>
|
|
42
|
+
* <PublishButton disabled={isPublishDisabled} onClick={handlePublish} />
|
|
43
|
+
* <PublishPreviewButton
|
|
44
|
+
* disabled={isPublishPreviewDisabled}
|
|
45
|
+
* to={previewPublishedUrl}
|
|
46
|
+
* />
|
|
47
|
+
* </>
|
|
48
|
+
* );
|
|
49
|
+
* return (
|
|
50
|
+
* <>
|
|
51
|
+
* <PublishBlock
|
|
52
|
+
* renderDraftButtons={renderDraftButtons}
|
|
53
|
+
* renderPublishButtons={renderPublishButtons}
|
|
54
|
+
* />
|
|
55
|
+
*
|
|
56
|
+
* <PublishBlock.Alert
|
|
57
|
+
* isOpen={isResetDraftAlertOpen}
|
|
58
|
+
* message="Leaving this page will delete all unpublished changes."
|
|
59
|
+
* title="Are you sure you want to discard changes?"
|
|
60
|
+
* onClose={() => setIsResetDraftAlertOpen(false)}
|
|
61
|
+
* onSubmit={action("handleReset")}
|
|
62
|
+
* //other alert props can also be passed
|
|
63
|
+
* />
|
|
64
|
+
* </>
|
|
65
|
+
* );
|
|
66
|
+
* };
|
|
67
|
+
* @endexample
|
|
68
|
+
*/
|
|
16
69
|
const PublishBlock: React.FC<PublishBlockProps> & {
|
|
17
70
|
Alert: React.FC<AlertProps>;
|
|
18
71
|
};
|
|
19
|
-
|
|
20
|
-
export default PublishBlock;
|
|
72
|
+
export default PublishBlock;
|
package/types/Schedule.d.ts
CHANGED
|
@@ -1,5 +1,129 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* It is a component which allows setting working hours for the week.
|
|
5
|
+
*
|
|
6
|
+
* 
|
|
7
|
+
*
|
|
8
|
+
* Props:
|
|
9
|
+
*
|
|
10
|
+
* How to Reset Form from outside Schedule Component:
|
|
11
|
+
*
|
|
12
|
+
* How to get the form errors from outside Schedule Component:
|
|
13
|
+
*
|
|
14
|
+
* This is the data structure for the periods prop:
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
*
|
|
18
|
+
* const periods = {
|
|
19
|
+
* sunday: [],
|
|
20
|
+
* monday: [
|
|
21
|
+
* {
|
|
22
|
+
* id: "cf329f59-cbcb-445b-b567-ad04a2813b8c",
|
|
23
|
+
* periodableType: "Availability",
|
|
24
|
+
* periodableId: "2b9d8d31-8928-4f8e-87d2-8e8989b5be72",
|
|
25
|
+
* wday: "monday",
|
|
26
|
+
* period: null,
|
|
27
|
+
* createdAt: "2022-10-31T07:07:44.796Z",
|
|
28
|
+
* updatedAt: "2022-10-31T07:07:44.796Z",
|
|
29
|
+
* startTime: "09:00 AM",
|
|
30
|
+
* endTime: "05:00 PM",
|
|
31
|
+
* },
|
|
32
|
+
* {
|
|
33
|
+
* id: "9ad79a58-1a0f-4ee7-b540-d86d55765874",
|
|
34
|
+
* periodableType: "Availability",
|
|
35
|
+
* periodableId: "2b9d8d31-8928-4f8e-87d2-8e8989b5be72",
|
|
36
|
+
* wday: "monday",
|
|
37
|
+
* period: null,
|
|
38
|
+
* createdAt: "2022-10-31T07:07:44.801Z",
|
|
39
|
+
* updatedAt: "2022-10-31T07:07:44.801Z",
|
|
40
|
+
* startTime: "06:00 PM",
|
|
41
|
+
* endTime: "07:00 PM",
|
|
42
|
+
* },
|
|
43
|
+
* ],
|
|
44
|
+
* tuesday: [
|
|
45
|
+
* {
|
|
46
|
+
* id: "8cd6d2c6-50f5-436f-89f5-35db1a4c44bb",
|
|
47
|
+
* periodableType: "Availability",
|
|
48
|
+
* periodableId: "2b9d8d31-8928-4f8e-87d2-8e8989b5be72",
|
|
49
|
+
* wday: "tuesday",
|
|
50
|
+
* period: null,
|
|
51
|
+
* createdAt: "2022-10-31T07:07:44.806Z",
|
|
52
|
+
* updatedAt: "2022-10-31T07:07:44.806Z",
|
|
53
|
+
* startTime: "09:00 AM",
|
|
54
|
+
* endTime: "05:00 PM",
|
|
55
|
+
* },
|
|
56
|
+
* ],
|
|
57
|
+
* wednesday: [
|
|
58
|
+
* {
|
|
59
|
+
* id: "1ea6c1b7-2fdb-4b2b-b35a-dc75f58cb84d",
|
|
60
|
+
* periodableType: "Availability",
|
|
61
|
+
* periodableId: "2b9d8d31-8928-4f8e-87d2-8e8989b5be72",
|
|
62
|
+
* wday: "wednesday",
|
|
63
|
+
* period: null,
|
|
64
|
+
* createdAt: "2022-10-31T07:07:44.810Z",
|
|
65
|
+
* updatedAt: "2022-10-31T07:07:44.810Z",
|
|
66
|
+
* startTime: "09:00 AM",
|
|
67
|
+
* endTime: "05:00 PM",
|
|
68
|
+
* },
|
|
69
|
+
* ],
|
|
70
|
+
* thursday: [
|
|
71
|
+
* {
|
|
72
|
+
* id: "a9b5ea22-4765-4db2-b0f8-78aa1dd458f2",
|
|
73
|
+
* periodableType: "Availability",
|
|
74
|
+
* periodableId: "2b9d8d31-8928-4f8e-87d2-8e8989b5be72",
|
|
75
|
+
* wday: "thursday",
|
|
76
|
+
* period: null,
|
|
77
|
+
* createdAt: "2022-10-31T07:07:44.812Z",
|
|
78
|
+
* updatedAt: "2022-10-31T07:07:44.812Z",
|
|
79
|
+
* startTime: "09:00 AM",
|
|
80
|
+
* endTime: "05:00 PM",
|
|
81
|
+
* },
|
|
82
|
+
* ],
|
|
83
|
+
* friday: [
|
|
84
|
+
* {
|
|
85
|
+
* id: "b1e4852c-d91f-419e-bb95-1ead12da69b2",
|
|
86
|
+
* periodableType: "Availability",
|
|
87
|
+
* periodableId: "2b9d8d31-8928-4f8e-87d2-8e8989b5be72",
|
|
88
|
+
* wday: "friday",
|
|
89
|
+
* period: null,
|
|
90
|
+
* createdAt: "2022-10-31T07:07:44.823Z",
|
|
91
|
+
* updatedAt: "2022-10-31T07:07:44.823Z",
|
|
92
|
+
* startTime: "09:00 AM",
|
|
93
|
+
* endTime: "05:00 PM",
|
|
94
|
+
* },
|
|
95
|
+
* ],
|
|
96
|
+
* saturday: [],
|
|
97
|
+
* };
|
|
98
|
+
*
|
|
99
|
+
* ];
|
|
100
|
+
* @endexample
|
|
101
|
+
* Simple:
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
*
|
|
105
|
+
* import React, { useState } from "react";
|
|
106
|
+
* import Schedule from "@bigbinary/neeto-molecules/Schedule";
|
|
107
|
+
* import { periods } from "constants";
|
|
108
|
+
*
|
|
109
|
+
* const App = () => {
|
|
110
|
+
* const [isEditing, setIsEditing] = useState(false);
|
|
111
|
+
*
|
|
112
|
+
* return (
|
|
113
|
+
* <div>
|
|
114
|
+
* <Schedule
|
|
115
|
+
* handleSubmit={value => {
|
|
116
|
+
* setIsEditing(false);
|
|
117
|
+
* }}
|
|
118
|
+
* isEditing={isEditing}
|
|
119
|
+
* periods={periods}
|
|
120
|
+
* setIsEditing={setIsEditing}
|
|
121
|
+
* />
|
|
122
|
+
* </div>
|
|
123
|
+
* );
|
|
124
|
+
* };
|
|
125
|
+
* @endexample
|
|
126
|
+
*/
|
|
3
127
|
const Schedule: React.FC<{
|
|
4
128
|
isEditing?: boolean;
|
|
5
129
|
setIsEditing?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
@@ -11,5 +135,4 @@ const Schedule: React.FC<{
|
|
|
11
135
|
};
|
|
12
136
|
ref?: React.MutableRefObject;
|
|
13
137
|
}>;
|
|
14
|
-
|
|
15
|
-
export default Schedule;
|
|
138
|
+
export default Schedule;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SIZES } from "components/Scrollable/constants";
|
|
2
|
+
import React from "react";
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* The Scrollable component can be used along with the Header and SubHeader to show
|
|
6
|
+
*
|
|
7
|
+
* large tables or UI that needs scrolling. It provides a scrollable container in
|
|
8
|
+
*
|
|
9
|
+
* the remaining space.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
*
|
|
13
|
+
* import Scrollable from "@bigbinary/neeto-molecules/Scrollable";
|
|
14
|
+
*
|
|
15
|
+
* const App = () => (
|
|
16
|
+
* <Scrollable>
|
|
17
|
+
* {[...Array(20)].map((_, i) => (
|
|
18
|
+
* <DummyCard key={i} />
|
|
19
|
+
* ))}
|
|
20
|
+
* </Scrollable>
|
|
21
|
+
* );
|
|
22
|
+
* @endexample
|
|
23
|
+
*/
|
|
24
|
+
const Scrollable: React.FC<{
|
|
25
|
+
className?: string;
|
|
26
|
+
size?: keyof typeof SIZES;
|
|
27
|
+
} & React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
|
|
28
|
+
export default Scrollable;
|