@msrajawat298/do-graphs 1.0.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 (80) hide show
  1. package/README.md +73 -0
  2. package/dist/App.css +72 -0
  3. package/dist/App.js +124 -0
  4. package/dist/App.test.js +8 -0
  5. package/dist/Assets/Fonts/NotoSans-Bold.ttf +0 -0
  6. package/dist/Assets/Fonts/NotoSans-Medium.ttf +0 -0
  7. package/dist/Assets/Fonts/NotoSans-Regular.ttf +0 -0
  8. package/dist/Assets/Fonts/NotoSans-SemiBold.ttf +0 -0
  9. package/dist/Assets/Images/analytic-graph.png +0 -0
  10. package/dist/Assets/Images/bar-graph.png +0 -0
  11. package/dist/Assets/Images/bubble-chart.png +0 -0
  12. package/dist/Assets/Images/coding.png +0 -0
  13. package/dist/Assets/Images/doughnut.png +0 -0
  14. package/dist/Assets/Images/horizontal-bar-graph.png +0 -0
  15. package/dist/Assets/Images/line-chart.png +0 -0
  16. package/dist/Assets/Images/mixed-chart.png +0 -0
  17. package/dist/Assets/Images/pie-chart.png +0 -0
  18. package/dist/Assets/Images/polar-chart.png +0 -0
  19. package/dist/Assets/Images/progress-bar.png +0 -0
  20. package/dist/Assets/Images/scatter-graph.png +0 -0
  21. package/dist/Assets/Images/table.png +0 -0
  22. package/dist/Assets/Images/travel.png +0 -0
  23. package/dist/Bootstrap.min.css +2 -0
  24. package/dist/Components/Charts/Bar/Form.js +231 -0
  25. package/dist/Components/Charts/Bar/Format.js +43 -0
  26. package/dist/Components/Charts/Bar/index.js +106 -0
  27. package/dist/Components/Charts/Chart.css +203 -0
  28. package/dist/Components/Charts/DoughnutAndPie/Form.js +232 -0
  29. package/dist/Components/Charts/DoughnutAndPie/Format.js +52 -0
  30. package/dist/Components/Charts/DoughnutAndPie/index.js +106 -0
  31. package/dist/Components/Charts/DrawGraph.js +32 -0
  32. package/dist/Components/Charts/Line/Form.js +231 -0
  33. package/dist/Components/Charts/Line/Format.js +47 -0
  34. package/dist/Components/Charts/Line/index.js +106 -0
  35. package/dist/Components/Charts/MixedChart/index.js +107 -0
  36. package/dist/Components/Charts/Options.js +139 -0
  37. package/dist/Components/Charts/PolarArea/Form.js +225 -0
  38. package/dist/Components/Charts/PolarArea/Format.js +42 -0
  39. package/dist/Components/Charts/PolarArea/index.js +106 -0
  40. package/dist/Components/Charts/Progess/Form.js +107 -0
  41. package/dist/Components/Charts/Progess/index.js +119 -0
  42. package/dist/Components/Charts/Scatter/Form.js +225 -0
  43. package/dist/Components/Charts/Scatter/Format.js +45 -0
  44. package/dist/Components/Charts/Scatter/index.js +106 -0
  45. package/dist/Components/Charts/Table/Form.js +70 -0
  46. package/dist/Components/Charts/Table/Styles.js +27 -0
  47. package/dist/Components/Charts/Table/index.js +56 -0
  48. package/dist/Components/Common/CustomComponent/index.js +83 -0
  49. package/dist/Components/Common/Menu/DynamicMenu/List.js +43 -0
  50. package/dist/Components/Common/Menu/DynamicMenu/index.css +109 -0
  51. package/dist/Components/Common/Menu/DynamicMenu/index.js +155 -0
  52. package/dist/Components/Common/Menu/index.css +74 -0
  53. package/dist/Components/Common/Menu/index.js +24 -0
  54. package/dist/Components/Common/Model/Model.css +112 -0
  55. package/dist/Components/Common/Model/Model.js +56 -0
  56. package/dist/Components/Common/MultipleSelectDropdown/index.js +124 -0
  57. package/dist/Components/Common/NotFound/index.css +16 -0
  58. package/dist/Components/Common/NotFound/index.js +19 -0
  59. package/dist/Components/Common/Title/Form.js +36 -0
  60. package/dist/Components/Common/Title/Styles.js +16 -0
  61. package/dist/Components/Common/Title/index.js +41 -0
  62. package/dist/Components/Common/Widget/index.css +435 -0
  63. package/dist/Components/Common/Widget/index.js +407 -0
  64. package/dist/Pages/Dashboard/CreatePage.css +23 -0
  65. package/dist/Pages/Dashboard/CreatePage.js +115 -0
  66. package/dist/Pages/Dashboard/index.css +114 -0
  67. package/dist/Pages/Dashboard/index.js +150 -0
  68. package/dist/Pages/LayoutPages/index.css +80 -0
  69. package/dist/Pages/LayoutPages/index.js +143 -0
  70. package/dist/Pages/Layouts/index.js +52 -0
  71. package/dist/Services/Menu.js +58 -0
  72. package/dist/Services/Routing.js +80 -0
  73. package/dist/Utility/Contexts.js +20 -0
  74. package/dist/Utility/Main.js +368 -0
  75. package/dist/Utility/Routes.js +10 -0
  76. package/dist/index.css +13 -0
  77. package/dist/index.js +15 -0
  78. package/dist/reportWebVitals.js +13 -0
  79. package/dist/setupTests.js +5 -0
  80. package/package.json +72 -0
@@ -0,0 +1,106 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
+ return new (P || (P = Promise))(function (resolve, reject) {
15
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
19
+ });
20
+ };
21
+ var __generator = (this && this.__generator) || function (thisArg, body) {
22
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
+ function verb(n) { return function (v) { return step([n, v]); }; }
25
+ function step(op) {
26
+ if (f) throw new TypeError("Generator is already executing.");
27
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
28
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
+ if (y = 0, t) op = [op[0] & 2, t.value];
30
+ switch (op[0]) {
31
+ case 0: case 1: t = op; break;
32
+ case 4: _.label++; return { value: op[1], done: false };
33
+ case 5: _.label++; y = op[1]; op = [0]; continue;
34
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
+ default:
36
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
+ if (t[2]) _.ops.pop();
41
+ _.trys.pop(); continue;
42
+ }
43
+ op = body.call(thisArg, _);
44
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
+ }
47
+ };
48
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
49
+ import { useContext, useEffect, useState } from 'react';
50
+ import DrawChart from '../DrawGraph';
51
+ import { chartDrawData, ChartTypes, fetchApi, ModelTypes } from '../../../Utility/Main';
52
+ import '../Chart.css';
53
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
54
+ import { faEllipsisVertical, faLink } from '@fortawesome/free-solid-svg-icons';
55
+ import Model from '../../Common/Model/Model';
56
+ import { GraphContext, PopUpContext } from '../../../Utility/Contexts';
57
+ import { ScatterDatasetFormat } from './Format';
58
+ import { faTrashAlt } from '@fortawesome/free-regular-svg-icons';
59
+ import MultipleSelectDropdown from '../../Common/MultipleSelectDropdown';
60
+ import NotFoundComponent from '../../Common/NotFound';
61
+ var Scatter = function (props) {
62
+ var _a, _b, _c, _d, _e;
63
+ var _f = useContext(PopUpContext), layout = _f.layout, setLayout = _f.setLayout, removeChart = _f.removeChart;
64
+ var addNewFormat = ((_a = props === null || props === void 0 ? void 0 : props.datasets) === null || _a === void 0 ? void 0 : _a.length) > 0 ? (_b = props === null || props === void 0 ? void 0 : props.datasets) === null || _b === void 0 ? void 0 : _b.map(function (it) { return ScatterDatasetFormat(it); }) : [ScatterDatasetFormat(null)];
65
+ var _g = useState(chartDrawData(props, layout, addNewFormat)), drawData = _g[0], setDrawData = _g[1];
66
+ var _h = useState(props === null || props === void 0 ? void 0 : props.chartOptions), graphOptions = _h[0], setGraphOptions = _h[1];
67
+ var _j = useState(false), showPopup = _j[0], setshowPopup = _j[1];
68
+ var _k = useState({}), gData = _k[0], setgData = _k[1];
69
+ var _l = useState({
70
+ headTitle: '',
71
+ chart: '',
72
+ data: {},
73
+ type: ''
74
+ }), modelData = _l[0], setModelData = _l[1];
75
+ var showForm = function (formName, title, data, type) {
76
+ setshowPopup(true);
77
+ setModelData({
78
+ headTitle: title,
79
+ chart: formName,
80
+ data: data,
81
+ type: type
82
+ });
83
+ };
84
+ var fetchResult = function () { return __awaiter(void 0, void 0, void 0, function () {
85
+ var result, error_1;
86
+ return __generator(this, function (_a) {
87
+ switch (_a.label) {
88
+ case 0:
89
+ _a.trys.push([0, 2, , 3]);
90
+ return [4 /*yield*/, fetchApi(props === null || props === void 0 ? void 0 : props.apiCall, drawData, ChartTypes === null || ChartTypes === void 0 ? void 0 : ChartTypes.SCATTER, showPopup)];
91
+ case 1:
92
+ result = _a.sent();
93
+ setgData(result);
94
+ return [3 /*break*/, 3];
95
+ case 2:
96
+ error_1 = _a.sent();
97
+ console.debug(error_1 === null || error_1 === void 0 ? void 0 : error_1.toString());
98
+ return [3 /*break*/, 3];
99
+ case 3: return [2 /*return*/];
100
+ }
101
+ });
102
+ }); };
103
+ useEffect(function () { fetchResult(); }, [drawData, graphOptions]);
104
+ return (_jsx(GraphContext.Provider, __assign({ value: { drawData: drawData, setDrawData: setDrawData, graphOptions: graphOptions, setGraphOptions: setGraphOptions } }, { children: _jsxs(PopUpContext.Provider, __assign({ value: { showPopup: showPopup, setshowPopup: setshowPopup, modelData: modelData, setModelData: setModelData, layout: layout, setLayout: setLayout } }, { children: [_jsxs("div", __assign({ className: 'chart-container', style: { width: '100%', height: '100%' } }, { children: [_jsxs("div", __assign({ className: 'chart-title', style: __assign({}, drawData === null || drawData === void 0 ? void 0 : drawData.styles) }, { children: [_jsxs("h5", { children: [drawData === null || drawData === void 0 ? void 0 : drawData.title, " ", (drawData === null || drawData === void 0 ? void 0 : drawData.url) && _jsx("span", { children: _jsx(FontAwesomeIcon, { className: 'disable', icon: faLink, cursor: 'pointer', title: drawData === null || drawData === void 0 ? void 0 : drawData.urlTitle, style: { marginLeft: 5, color: '#0d6efd' }, onClick: function () { return window.open(drawData === null || drawData === void 0 ? void 0 : drawData.url, '_blank'); } }) })] }), ((_c = drawData === null || drawData === void 0 ? void 0 : drawData.filters) === null || _c === void 0 ? void 0 : _c.length) > 0 && _jsx(MultipleSelectDropdown, { existFilter: ((_d = props === null || props === void 0 ? void 0 : props.apiCall) === null || _d === void 0 ? void 0 : _d.body) || '{}', isEdit: props === null || props === void 0 ? void 0 : props.isConfigEdit }), (props === null || props === void 0 ? void 0 : props.isConfigEdit) && _jsxs("div", { children: [_jsx(FontAwesomeIcon, { className: 'disable', icon: faTrashAlt, color: 'red', style: { marginRight: 15 }, cursor: 'pointer', onClick: function () { return removeChart(props === null || props === void 0 ? void 0 : props.layoutId); } }), _jsx(FontAwesomeIcon, { className: 'settings disable', icon: faEllipsisVertical, cursor: 'pointer', onClick: function (e) { return showForm(ChartTypes === null || ChartTypes === void 0 ? void 0 : ChartTypes.POLAR, 'Configure Polar Chart Data', { gData: drawData, gOptions: graphOptions, layoutId: props === null || props === void 0 ? void 0 : props.layoutId }, ModelTypes === null || ModelTypes === void 0 ? void 0 : ModelTypes.CONFIGURE); } })] })] })), _jsx("div", __assign({ className: "graph-container" }, { children: ((_e = drawData === null || drawData === void 0 ? void 0 : drawData.datasets) === null || _e === void 0 ? void 0 : _e.length) > 0 ? _jsx(DrawChart, { type: ChartTypes === null || ChartTypes === void 0 ? void 0 : ChartTypes.SCATTER, data: gData }) : _jsx(NotFoundComponent, {}) }))] })), showPopup && _jsx(Model, { headTitle: modelData === null || modelData === void 0 ? void 0 : modelData.headTitle, chart: modelData === null || modelData === void 0 ? void 0 : modelData.chart, data: modelData === null || modelData === void 0 ? void 0 : modelData.data, type: modelData === null || modelData === void 0 ? void 0 : modelData.type })] })) })));
105
+ };
106
+ export default Scatter;
@@ -0,0 +1,70 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import React, { useContext, useState } from 'react';
14
+ import { GraphContext, PopUpContext } from '../../../Utility/Contexts';
15
+ var TableConfigForm = function (props) {
16
+ var _a, _b, _c, _d, _e, _f, _g, _h;
17
+ var _j = useState((_a = props === null || props === void 0 ? void 0 : props.data) === null || _a === void 0 ? void 0 : _a.gData), data = _j[0], setData = _j[1];
18
+ var _k = useState((_b = props === null || props === void 0 ? void 0 : props.data) === null || _b === void 0 ? void 0 : _b.gOptions), options = _k[0], setOptions = _k[1];
19
+ var _l = useContext(GraphContext), setDrawData = _l.setDrawData, setGraphOptions = _l.setGraphOptions;
20
+ var _m = useContext(PopUpContext), layout = _m.layout, setLayout = _m.setLayout;
21
+ var handleChange = function (e, field) {
22
+ var _a = e.target, name = _a.name, value = _a.value;
23
+ if (field === 'styles') {
24
+ data[field][name] = value;
25
+ }
26
+ else {
27
+ data[name] = value;
28
+ }
29
+ setData(__assign({}, data));
30
+ setDrawData(__assign({}, data));
31
+ updateLayoutDetails(['title', 'styles', 'url', 'urlTitle'], data);
32
+ };
33
+ var handleOptionChange = function (e, field) {
34
+ var _a;
35
+ var _b = e.target, name = _b.name, value = _b.value;
36
+ var opt = __assign(__assign({}, options[field]), (_a = {}, _a[name] = value, _a));
37
+ options[field] = opt;
38
+ setOptions(__assign({}, options));
39
+ setGraphOptions(__assign({}, options));
40
+ updateLayoutDetails(['options'], options);
41
+ };
42
+ var updateLayoutDetails = function (field, data) {
43
+ var _a;
44
+ for (var i = 0; i < (layout === null || layout === void 0 ? void 0 : layout.length); i++) {
45
+ if (layout[i]['i'] === ((_a = props === null || props === void 0 ? void 0 : props.data) === null || _a === void 0 ? void 0 : _a.layoutId)) {
46
+ if (field.includes('title')) {
47
+ layout[i]['props']['title'] = data['title'];
48
+ }
49
+ if (field.includes('options')) {
50
+ layout[i]['props']['chartOptions'] = data;
51
+ }
52
+ if (field.includes('styles')) {
53
+ layout[i]['props']['styles'] = data['styles'];
54
+ }
55
+ if (field.includes('url')) {
56
+ layout[i]['props']['url'] = data['url'];
57
+ }
58
+ if (field.includes('urlTitle')) {
59
+ layout[i]['props']['urlTitle'] = data['urlTitle'];
60
+ }
61
+ }
62
+ }
63
+ setLayout(layout);
64
+ };
65
+ return (_jsxs("div", __assign({ className: 'popup-model-form' }, { children: [((_d = (_c = props === null || props === void 0 ? void 0 : props.data) === null || _c === void 0 ? void 0 : _c.gData) === null || _d === void 0 ? void 0 : _d.title) && _jsxs(React.Fragment, { children: [_jsxs("div", __assign({ className: 'form-group d-flex' }, { children: [_jsx("label", __assign({ className: 'subtitle' }, { children: "Title:" })), _jsx("input", { type: 'text', name: 'title', value: data === null || data === void 0 ? void 0 : data.title, className: 'form-control', onChange: function (e) { return handleChange(e); } })] })), _jsxs("div", __assign({ className: 'form-group d-flex' }, { children: [_jsx("label", { children: "URL:" }), _jsx("input", { type: 'text', name: 'url', value: data === null || data === void 0 ? void 0 : data.url, className: 'form-control', onChange: function (e) { return handleChange(e); } })] })), _jsxs("div", __assign({ className: 'form-group d-flex' }, { children: [_jsx("label", { children: "URL Title:" }), _jsx("input", { type: 'text', name: 'urlTitle', value: data === null || data === void 0 ? void 0 : data.urlTitle, className: 'form-control', onChange: function (e) { return handleChange(e); } })] }))] }), (_e = Object.keys(data === null || data === void 0 ? void 0 : data.styles)) === null || _e === void 0 ? void 0 : _e.map(function (st, sn) {
66
+ var _a;
67
+ return (_jsxs("div", __assign({ className: 'form-group d-flex' }, { children: [_jsxs("label", { children: ["Title ", st, ":"] }), _jsx("input", { type: 'text', name: st, value: (_a = data === null || data === void 0 ? void 0 : data.styles) === null || _a === void 0 ? void 0 : _a[st], className: 'form-control', onChange: function (e) { return handleChange(e, 'styles'); } })] }), sn));
68
+ }), _jsx("p", __assign({ className: 'subtitle' }, { children: "Table Options:" })), (_f = Object.keys(options === null || options === void 0 ? void 0 : options.table)) === null || _f === void 0 ? void 0 : _f.map(function (key, i) { return (_jsxs("div", __assign({ className: 'form-group d-flex' }, { children: [_jsx("label", { children: key }), _jsx("input", { type: 'text', name: key, className: 'form-control', value: options['table'][key], onChange: function (e) { return handleOptionChange(e, 'table'); } })] }), i)); }), (_g = Object.keys(options === null || options === void 0 ? void 0 : options.th)) === null || _g === void 0 ? void 0 : _g.map(function (key, i) { return (_jsxs("div", __assign({ className: 'form-group d-flex' }, { children: [_jsxs("label", { children: ["Table TH ", key] }), _jsx("input", { type: 'text', name: key, className: 'form-control', value: options['th'][key], onChange: function (e) { return handleOptionChange(e, 'th'); } })] }), i)); }), (_h = Object.keys(options === null || options === void 0 ? void 0 : options.td)) === null || _h === void 0 ? void 0 : _h.map(function (key, i) { return (_jsxs("div", __assign({ className: 'form-group d-flex' }, { children: [_jsxs("label", { children: ["Table TD ", key] }), _jsx("input", { type: 'text', name: key, className: 'form-control', value: options['td'][key], onChange: function (e) { return handleOptionChange(e, 'td'); } })] }), i)); })] })));
69
+ };
70
+ export default TableConfigForm;
@@ -0,0 +1,27 @@
1
+ export var TableStyles = function () {
2
+ return {
3
+ table: {
4
+ backgroundColor: '#fff',
5
+ border: 0,
6
+ width: '100%',
7
+ fontSize: '13px'
8
+ },
9
+ th: {
10
+ padding: 5,
11
+ border: 0,
12
+ fontWeight: 500,
13
+ backgroundColor: '#eee',
14
+ color: '#000',
15
+ width: 'auto',
16
+ textAlign: 'left'
17
+ },
18
+ td: {
19
+ padding: 5,
20
+ border: '1px solid #eee',
21
+ fontWeight: 400,
22
+ backgroundColor: '#fff',
23
+ color: '#000',
24
+ textAlign: 'left'
25
+ }
26
+ };
27
+ };
@@ -0,0 +1,56 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { useContext, useEffect, useState } from 'react';
14
+ import { ChartTypes, fetchApi, ModelTypes, titleStyleConfig } from '../../../Utility/Main';
15
+ import '../Chart.css';
16
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
17
+ import { faEllipsisVertical, faLink } from '@fortawesome/free-solid-svg-icons';
18
+ import Model from '../../Common/Model/Model';
19
+ import { GraphContext, PopUpContext } from '../../../Utility/Contexts';
20
+ import { faTrashAlt } from '@fortawesome/free-regular-svg-icons';
21
+ var TableChart = function (props) {
22
+ var _a, _b, _c, _d, _e;
23
+ var _f = useContext(PopUpContext), layout = _f.layout, setLayout = _f.setLayout, removeChart = _f.removeChart;
24
+ var getLayout = (_a = layout === null || layout === void 0 ? void 0 : layout.find(function (it) { return (it === null || it === void 0 ? void 0 : it.i) === (props === null || props === void 0 ? void 0 : props.layoutId); })) === null || _a === void 0 ? void 0 : _a.props;
25
+ var getStyles = getLayout === null || getLayout === void 0 ? void 0 : getLayout.styles;
26
+ var getUrl = getLayout === null || getLayout === void 0 ? void 0 : getLayout.url;
27
+ var getUrlTitle = getLayout === null || getLayout === void 0 ? void 0 : getLayout.urlTitle;
28
+ var _g = useState({
29
+ title: props === null || props === void 0 ? void 0 : props.title,
30
+ columns: (_b = props === null || props === void 0 ? void 0 : props.tableData) === null || _b === void 0 ? void 0 : _b.cols,
31
+ rows: (_c = props === null || props === void 0 ? void 0 : props.tableData) === null || _c === void 0 ? void 0 : _c.rows,
32
+ styles: getStyles ? getStyles : titleStyleConfig(),
33
+ url: getUrl ? getUrl : '',
34
+ urlTitle: getUrlTitle ? getUrlTitle : ''
35
+ }), drawData = _g[0], setDrawData = _g[1];
36
+ var _h = useState(props === null || props === void 0 ? void 0 : props.chartOptions), graphOptions = _h[0], setGraphOptions = _h[1];
37
+ var _j = useState(false), showPopup = _j[0], setshowPopup = _j[1];
38
+ var _k = useState({
39
+ headTitle: '',
40
+ chart: '',
41
+ data: {},
42
+ type: ''
43
+ }), modelData = _k[0], setModelData = _k[1];
44
+ var showForm = function (formName, title, data, type) {
45
+ setshowPopup(true);
46
+ setModelData({
47
+ headTitle: title,
48
+ chart: formName,
49
+ data: data,
50
+ type: type
51
+ });
52
+ };
53
+ useEffect(function () { fetchApi(props === null || props === void 0 ? void 0 : props.apiCall, drawData, ChartTypes.TABLE); }, [drawData, graphOptions]);
54
+ return (_jsx(GraphContext.Provider, __assign({ value: { drawData: drawData, setDrawData: setDrawData, graphOptions: graphOptions, setGraphOptions: setGraphOptions } }, { children: _jsxs(PopUpContext.Provider, __assign({ value: { showPopup: showPopup, setshowPopup: setshowPopup, modelData: modelData, setModelData: setModelData, layout: layout, setLayout: setLayout } }, { children: [_jsxs("div", __assign({ className: 'chart-container', style: { width: '100%', height: '100%' } }, { children: [_jsxs("div", __assign({ className: 'chart-title', style: __assign({}, drawData === null || drawData === void 0 ? void 0 : drawData.styles) }, { children: [_jsxs("h5", { children: [drawData === null || drawData === void 0 ? void 0 : drawData.title, " ", (drawData === null || drawData === void 0 ? void 0 : drawData.url) && _jsx("span", { children: _jsx(FontAwesomeIcon, { className: 'disable', icon: faLink, cursor: 'pointer', title: drawData === null || drawData === void 0 ? void 0 : drawData.urlTitle, style: { marginLeft: 5, color: '#0d6efd' }, onClick: function () { return window.open(drawData === null || drawData === void 0 ? void 0 : drawData.url, '_blank'); } }) })] }), (props === null || props === void 0 ? void 0 : props.isConfigEdit) && _jsxs("div", { children: [_jsx(FontAwesomeIcon, { className: 'disable', icon: faTrashAlt, color: 'red', style: { marginRight: 15 }, cursor: 'pointer', onClick: function () { return removeChart(props === null || props === void 0 ? void 0 : props.layoutId); } }), _jsx(FontAwesomeIcon, { className: 'settings disable', icon: faEllipsisVertical, cursor: 'pointer', onClick: function (e) { return showForm(ChartTypes === null || ChartTypes === void 0 ? void 0 : ChartTypes.TABLE, 'Configure Table Chart Data', { gData: drawData, gOptions: graphOptions, layoutId: props === null || props === void 0 ? void 0 : props.layoutId }, ModelTypes === null || ModelTypes === void 0 ? void 0 : ModelTypes.CONFIGURE); } })] })] })), _jsx("div", __assign({ className: "graph-container" }, { children: _jsxs("table", __assign({ className: 'table', style: graphOptions === null || graphOptions === void 0 ? void 0 : graphOptions.table }, { children: [_jsx("thead", { children: _jsx("tr", { children: (_d = drawData === null || drawData === void 0 ? void 0 : drawData.columns) === null || _d === void 0 ? void 0 : _d.map(function (it, n) { return (_jsx("th", __assign({ style: graphOptions === null || graphOptions === void 0 ? void 0 : graphOptions.th }, { children: it }), n)); }) }) }), _jsx("tbody", { children: (_e = drawData === null || drawData === void 0 ? void 0 : drawData.rows) === null || _e === void 0 ? void 0 : _e.map(function (it, n) { return (_jsx("tr", { children: it === null || it === void 0 ? void 0 : it.map(function (v, no) { return (_jsx("td", __assign({ style: graphOptions === null || graphOptions === void 0 ? void 0 : graphOptions.td }, { children: v }), no)); }) }, n)); }) })] })) }))] })), showPopup && _jsx(Model, { headTitle: modelData === null || modelData === void 0 ? void 0 : modelData.headTitle, chart: modelData === null || modelData === void 0 ? void 0 : modelData.chart, data: modelData === null || modelData === void 0 ? void 0 : modelData.data, type: modelData === null || modelData === void 0 ? void 0 : modelData.type })] })) })));
55
+ };
56
+ export default TableChart;
@@ -0,0 +1,83 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
+ return new (P || (P = Promise))(function (resolve, reject) {
15
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
19
+ });
20
+ };
21
+ var __generator = (this && this.__generator) || function (thisArg, body) {
22
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
+ function verb(n) { return function (v) { return step([n, v]); }; }
25
+ function step(op) {
26
+ if (f) throw new TypeError("Generator is already executing.");
27
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
28
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
+ if (y = 0, t) op = [op[0] & 2, t.value];
30
+ switch (op[0]) {
31
+ case 0: case 1: t = op; break;
32
+ case 4: _.label++; return { value: op[1], done: false };
33
+ case 5: _.label++; y = op[1]; op = [0]; continue;
34
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
+ default:
36
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
+ if (t[2]) _.ops.pop();
41
+ _.trys.pop(); continue;
42
+ }
43
+ op = body.call(thisArg, _);
44
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
+ }
47
+ };
48
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
49
+ import { Suspense, useContext, useEffect, useState } from 'react';
50
+ import { toast } from 'react-toastify';
51
+ import { PopUpContext } from '../../../Utility/Contexts';
52
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
53
+ import { faTrashAlt } from '@fortawesome/free-solid-svg-icons';
54
+ var CustomComponent = function (_a) {
55
+ var component = _a.component, layoutId = _a.layoutId, isConfigEdit = _a.isConfigEdit;
56
+ var _b = useContext(PopUpContext), layout = _b.layout, setLayout = _b.setLayout, removeChart = _b.removeChart;
57
+ var _c = useState(null), importedComponent = _c[0], setImportedComponent = _c[1];
58
+ var importComponent = function () { return __awaiter(void 0, void 0, void 0, function () {
59
+ var module_1, AnotherComponent, error_1;
60
+ return __generator(this, function (_a) {
61
+ switch (_a.label) {
62
+ case 0:
63
+ _a.trys.push([0, 2, , 3]);
64
+ return [4 /*yield*/, import(process.env.REACT_APP_ROOT_PATH + '/' + component)];
65
+ case 1:
66
+ module_1 = _a.sent();
67
+ AnotherComponent = module_1.default;
68
+ setImportedComponent(_jsx(AnotherComponent, {}));
69
+ return [3 /*break*/, 3];
70
+ case 2:
71
+ error_1 = _a.sent();
72
+ toast.error(error_1 === null || error_1 === void 0 ? void 0 : error_1.toString());
73
+ return [3 /*break*/, 3];
74
+ case 3: return [2 /*return*/];
75
+ }
76
+ });
77
+ }); };
78
+ useEffect(function () {
79
+ importComponent();
80
+ }, []);
81
+ return (_jsx("div", { children: _jsxs(Suspense, __assign({ fallback: _jsx("div", { children: "loading.." }) }, { children: [_jsx("div", __assign({ className: 'delete-icons', style: { textAlign: 'right' } }, { children: isConfigEdit && _jsx(FontAwesomeIcon, { className: 'disable', icon: faTrashAlt, color: 'red', style: { marginRight: 15 }, cursor: 'pointer', onClick: function () { return removeChart(layoutId); } }) })), importedComponent] })) }));
82
+ };
83
+ export default CustomComponent;
@@ -0,0 +1,43 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { faArrowRightLong, faBars, faClose } from '@fortawesome/free-solid-svg-icons';
14
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
15
+ import { useContext } from 'react';
16
+ import './index.css';
17
+ import { useNavigate } from 'react-router-dom';
18
+ import { PopUpContext } from '../../../../Utility/Contexts';
19
+ import * as Icons from '@fortawesome/free-solid-svg-icons';
20
+ var DynamicMenuList = function (props) {
21
+ var _a, _b, _c;
22
+ var navigate = useNavigate();
23
+ var _d = useContext(PopUpContext), showMenu = _d.showMenu, setShowMenu = _d.setShowMenu;
24
+ var handleMenu = function () {
25
+ if (showMenu) {
26
+ setShowMenu(false);
27
+ }
28
+ else {
29
+ setShowMenu(true);
30
+ }
31
+ };
32
+ var renderIcons = function (fIcon) {
33
+ var iconList = Object.keys(Icons).filter(function (key) { return key === (fIcon === null || fIcon === void 0 ? void 0 : fIcon.icons); }).map(function (icon) { return Icons[icon]; });
34
+ if ((iconList === null || iconList === void 0 ? void 0 : iconList.length) > 0) {
35
+ return (_jsx("div", __assign({ className: 'w-100 p-relative list-icn text-center' }, { children: _jsx(FontAwesomeIcon, { className: 'menu-icons', icon: iconList === null || iconList === void 0 ? void 0 : iconList[0], size: 'lg' }) })));
36
+ }
37
+ };
38
+ return (_jsxs("div", __assign({ className: 'menu-list', style: { width: (props === null || props === void 0 ? void 0 : props.show) ? '200px' : '100%' } }, { children: [((_a = props === null || props === void 0 ? void 0 : props.menu) === null || _a === void 0 ? void 0 : _a.length) > 0 && _jsx(FontAwesomeIcon, { icon: showMenu ? faClose : faBars, size: 'lg', cursor: 'pointer', className: 'mic', onClick: handleMenu }), (props === null || props === void 0 ? void 0 : props.show) && _jsxs("h4", { children: ["Menu ", _jsx(FontAwesomeIcon, { icon: faArrowRightLong })] }), ((_b = props === null || props === void 0 ? void 0 : props.menu) === null || _b === void 0 ? void 0 : _b.length) > 0 && _jsx("ul", __assign({ className: "list-unstyled dy-mn-li", style: { paddingTop: (props === null || props === void 0 ? void 0 : props.show) ? 15 : 25 } }, { children: (_c = props === null || props === void 0 ? void 0 : props.menu) === null || _c === void 0 ? void 0 : _c.map(function (item, i) {
39
+ var _a, _b, _c;
40
+ return (_jsxs("li", __assign({ onClick: function () { var _a; return ((_a = item === null || item === void 0 ? void 0 : item.subMenu) === null || _a === void 0 ? void 0 : _a.length) === 0 && navigate(item === null || item === void 0 ? void 0 : item.path); }, style: { paddingBottom: ((_a = item === null || item === void 0 ? void 0 : item.subMenu) === null || _a === void 0 ? void 0 : _a.length) > 0 ? 15 : 0 } }, { children: [(props === null || props === void 0 ? void 0 : props.show) ? _jsx("p", { children: item === null || item === void 0 ? void 0 : item.title }) : renderIcons(item), (props === null || props === void 0 ? void 0 : props.show) && ((_b = item === null || item === void 0 ? void 0 : item.subMenu) === null || _b === void 0 ? void 0 : _b.length) > 0 && _jsx("ul", __assign({ className: "list-unstyled dy-mn-sli pad-l-30" }, { children: (_c = item === null || item === void 0 ? void 0 : item.subMenu) === null || _c === void 0 ? void 0 : _c.map(function (sm, s) { return (_jsx("li", __assign({ onClick: function () { return navigate(sm === null || sm === void 0 ? void 0 : sm.path); } }, { children: sm === null || sm === void 0 ? void 0 : sm.title }), s)); }) }))] }), i));
41
+ }) }))] })));
42
+ };
43
+ export default DynamicMenuList;
@@ -0,0 +1,109 @@
1
+ .dy-mn>li>.form-group {
2
+ width: 45%;
3
+
4
+ label {
5
+ font-size: 12px;
6
+ opacity: .8;
7
+ }
8
+
9
+ input,
10
+ select {
11
+ font-size: 12px;
12
+ }
13
+ }
14
+
15
+ .w-45 {
16
+ width: 45% !important;
17
+ }
18
+
19
+ .w-25 {
20
+ width: 25% !important;
21
+ }
22
+
23
+ .mic {
24
+ text-align: center;
25
+ width: 100%;
26
+ margin-top: 25px;
27
+ }
28
+
29
+ .menu-list {
30
+ position: relative;
31
+ left: 0;
32
+ width: 100%;
33
+ height: 100%;
34
+ background: #fff;
35
+ z-index: 1;
36
+ top: 0;
37
+ box-sizing: border-box;
38
+ box-shadow: 0 0 5px #dedede;
39
+ overflow-y: scroll;
40
+ transition: .1s all linear;
41
+
42
+ h4 {
43
+ font-size: 15px;
44
+ padding: 15px;
45
+ margin-top: 8px;
46
+ }
47
+ }
48
+
49
+ .menu-list::-webkit-scrollbar {
50
+ width: 2px;
51
+ height: 2px;
52
+ }
53
+
54
+ .menu-list::-webkit-scrollbar-track {
55
+ border-radius: 10px;
56
+ }
57
+
58
+ .menu-list::-webkit-scrollbar-thumb {
59
+ background: #ef5323;
60
+ border-radius: 10px;
61
+ }
62
+
63
+ .dy-mn-li {
64
+ padding: 15px;
65
+
66
+ li {
67
+ font-size: 12px;
68
+ padding-bottom: 15px;
69
+ cursor: pointer;
70
+
71
+ .menu-icons {
72
+ text-align: center;
73
+ width: 100%;
74
+ margin-bottom: 0;
75
+ }
76
+
77
+ p {
78
+ margin-bottom: 8px;
79
+ opacity: .6;
80
+ color: #000;
81
+ }
82
+ }
83
+
84
+ .dy-mn-sli li {
85
+ opacity: 1;
86
+ font-weight: 500;
87
+ color: #000;
88
+ padding-bottom: 5px;
89
+ padding-top: 5px;
90
+ margin-top: 5px;
91
+ margin-bottom: 5px;
92
+ padding-left: 15px;
93
+ border-radius: 5px;
94
+ background: #f5f7ff;
95
+ cursor: pointer;
96
+ }
97
+ }
98
+
99
+ .pad-l-30 {
100
+ padding-left: 15px;
101
+ }
102
+
103
+ .p-relative{
104
+ position: relative;
105
+ }
106
+
107
+ .list-icn{
108
+ padding: 8px 0 8px 0 ;
109
+ }