@bento-core/paginated-table 0.2.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 (54) hide show
  1. package/babel.config.json +20 -0
  2. package/dist/index.js +104 -0
  3. package/dist/table/ClientController.js +64 -0
  4. package/dist/table/ContextProvider.js +31 -0
  5. package/dist/table/PaginatedTable.js +190 -0
  6. package/dist/table/README.md +253 -0
  7. package/dist/table/ServerController.js +42 -0
  8. package/dist/table/TableService.js +103 -0
  9. package/dist/table/state/Actions.js +57 -0
  10. package/dist/table/state/Reducer.js +53 -0
  11. package/dist/wrapper/Wrapper.js +167 -0
  12. package/dist/wrapper/WrapperService.js +36 -0
  13. package/dist/wrapper/components/AddAllFiles/AddAllView.js +88 -0
  14. package/dist/wrapper/components/AddFiles.js +65 -0
  15. package/dist/wrapper/components/AddSelectedFiles/AddSelectedFilesController.js +68 -0
  16. package/dist/wrapper/components/AddSelectedFiles/AddSelectedFilesView.js +62 -0
  17. package/dist/wrapper/components/AddToCartDialog/AddToCartDialogAlertView.js +35 -0
  18. package/dist/wrapper/components/AddToCartDialog/AddToCartDialogController.js +36 -0
  19. package/dist/wrapper/components/AddToCartDialog/AddToCartDialogView.js +42 -0
  20. package/dist/wrapper/components/ButtonView.js +22 -0
  21. package/dist/wrapper/components/DownloadManifestBtn.js +71 -0
  22. package/dist/wrapper/components/ReduxAddFile.js +26 -0
  23. package/dist/wrapper/components/Snackbar/Snackbar.js +40 -0
  24. package/dist/wrapper/components/Snackbar/SnackbarRedux.js +16 -0
  25. package/dist/wrapper/components/Snackbar/SuccessOutlined.js +17 -0
  26. package/dist/wrapper/components/TextFieldView.js +34 -0
  27. package/dist/wrapper/components/TooltipView.js +40 -0
  28. package/package.json +28 -0
  29. package/src/index.js +18 -0
  30. package/src/table/ClientController.js +64 -0
  31. package/src/table/ContextProvider.js +27 -0
  32. package/src/table/PaginatedTable.js +185 -0
  33. package/src/table/README.md +253 -0
  34. package/src/table/ServerController.js +40 -0
  35. package/src/table/TableService.js +80 -0
  36. package/src/table/state/Actions.js +50 -0
  37. package/src/table/state/Reducer.js +49 -0
  38. package/src/wrapper/Wrapper.js +163 -0
  39. package/src/wrapper/WrapperService.js +25 -0
  40. package/src/wrapper/components/AddAllFiles/AddAllView.js +88 -0
  41. package/src/wrapper/components/AddFiles.js +75 -0
  42. package/src/wrapper/components/AddSelectedFiles/AddSelectedFilesController.js +69 -0
  43. package/src/wrapper/components/AddSelectedFiles/AddSelectedFilesView.js +65 -0
  44. package/src/wrapper/components/AddToCartDialog/AddToCartDialogAlertView.js +37 -0
  45. package/src/wrapper/components/AddToCartDialog/AddToCartDialogController.js +32 -0
  46. package/src/wrapper/components/AddToCartDialog/AddToCartDialogView.js +56 -0
  47. package/src/wrapper/components/ButtonView.js +24 -0
  48. package/src/wrapper/components/DownloadManifestBtn.js +64 -0
  49. package/src/wrapper/components/ReduxAddFile.js +19 -0
  50. package/src/wrapper/components/Snackbar/Snackbar.js +43 -0
  51. package/src/wrapper/components/Snackbar/SnackbarRedux.js +11 -0
  52. package/src/wrapper/components/Snackbar/SuccessOutlined.js +10 -0
  53. package/src/wrapper/components/TextFieldView.js +31 -0
  54. package/src/wrapper/components/TooltipView.js +35 -0
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { connect } from 'react-redux';
3
+ import { onAddCartFiles } from '@bento-core/cart';
4
+ import AddFiles from './AddFiles';
5
+
6
+ const AddFilesRedux = (props) => <AddFiles {...props} />;
7
+
8
+ /**
9
+ * create query variable with actie filters
10
+ */
11
+ const mapStateToProps = (state) => ({
12
+ count: state.cartReducer && state.cartReducer.count,
13
+ });
14
+
15
+ const mapDispatchToProps = (dispatch) => ({
16
+ addFiles: (files) => { dispatch(onAddCartFiles(files)); },
17
+ });
18
+
19
+ export default connect(mapStateToProps, mapDispatchToProps)(AddFilesRedux);
@@ -0,0 +1,43 @@
1
+ import React from 'react';
2
+ import { Snackbar } from '@material-ui/core';
3
+ import SuccessOutlinedIcon from './SuccessOutlined';
4
+
5
+ const SnackbarView = (props) => {
6
+ const {
7
+ count,
8
+ open,
9
+ onClose,
10
+ } = props;
11
+
12
+ if (open) {
13
+ setTimeout(() => {
14
+ onClose();
15
+ }, 3000);
16
+ }
17
+
18
+ return (
19
+ <>
20
+ <Snackbar
21
+ className="snackBar"
22
+ open={open}
23
+ autoHideDuration={3000}
24
+ anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}
25
+ message={(
26
+ <div className="snackBarMessage">
27
+ <span className="snackBarMessageIcon">
28
+ <SuccessOutlinedIcon />
29
+ {' '}
30
+ </span>
31
+ <span className="snackBarText">
32
+ {count}
33
+ {' '}
34
+ File(s) successfully added to your cart
35
+ </span>
36
+ </div>
37
+ )}
38
+ />
39
+ </>
40
+ );
41
+ };
42
+
43
+ export default SnackbarView;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { connect } from 'react-redux';
3
+ import SnackbarView from './Snackbar';
4
+
5
+ const ReduxSnackbar = ((props) => <SnackbarView {...props} />);
6
+
7
+ const mapStateToProps = (state) => ({
8
+ count: state.cartReducer.count,
9
+ });
10
+
11
+ export default connect(mapStateToProps, null)(ReduxSnackbar);
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { createSvgIcon } from '@bento-core/util';
3
+
4
+ /**
5
+ * @ignore - internal component.
6
+ */
7
+ export default createSvgIcon(
8
+ <path d="M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z" />,
9
+ 'SuccessOutlined',
10
+ );
@@ -0,0 +1,31 @@
1
+ import React, { useContext, useEffect, useState } from 'react';
2
+ import {
3
+ CartContext,
4
+ onCommentChange,
5
+ } from '@bento-core/cart';
6
+
7
+ const TextFieldView = ({
8
+ clsName,
9
+ placeholder,
10
+ }) => {
11
+ const [text, setText] = useState('');
12
+ const cartContext = useContext(CartContext);
13
+ const {
14
+ dispatch,
15
+ } = cartContext.context;
16
+ useEffect(() => {
17
+ dispatch(onCommentChange(text));
18
+ }, [text]);
19
+ return (
20
+ <textarea
21
+ onChange={(e) => {
22
+ setText(`${e.target.value}`);
23
+ }}
24
+ className={clsName}
25
+ placeholder={placeholder}
26
+ id="multiline-user-coments"
27
+ />
28
+ );
29
+ };
30
+
31
+ export default TextFieldView;
@@ -0,0 +1,35 @@
1
+ import React from 'react';
2
+ import ToolTip from '@bento-core/tool-tip';
3
+
4
+ /**
5
+ * customize tooltips based on tooltipContent
6
+ * defined on dashboardTabData (tooltipContent)
7
+ */
8
+ const ToolTipView = (props) => {
9
+ const {
10
+ section,
11
+ tooltipCofig,
12
+ classes,
13
+ } = props;
14
+
15
+ const {
16
+ icon,
17
+ alt,
18
+ arrow = false,
19
+ clsName,
20
+ } = tooltipCofig;
21
+ return (
22
+ <ToolTip
23
+ title={tooltipCofig[section]}
24
+ arrow={arrow}
25
+ classes={{
26
+ tooltip: classes.customTooltip,
27
+ arrow: classes.customArrow,
28
+ }}
29
+ >
30
+ {icon && (<img src={icon} alt={alt} className={clsName} />)}
31
+ </ToolTip>
32
+ );
33
+ };
34
+
35
+ export default ToolTipView;