@msrajawat298/do-graphs 1.0.0 → 1.0.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/README.md +1 -1
- package/dist/App.js +124 -124
- package/dist/App.test.js +8 -8
- package/dist/Components/Charts/Bar/Form.js +231 -231
- package/dist/Components/Charts/Bar/Format.js +43 -43
- package/dist/Components/Charts/Bar/index.js +106 -106
- package/dist/Components/Charts/DoughnutAndPie/Form.js +232 -232
- package/dist/Components/Charts/DoughnutAndPie/Format.js +52 -52
- package/dist/Components/Charts/DoughnutAndPie/index.js +106 -106
- package/dist/Components/Charts/DrawGraph.js +32 -32
- package/dist/Components/Charts/Line/Form.js +231 -231
- package/dist/Components/Charts/Line/Format.js +47 -47
- package/dist/Components/Charts/Line/index.js +106 -106
- package/dist/Components/Charts/MixedChart/index.js +107 -107
- package/dist/Components/Charts/Options.js +139 -139
- package/dist/Components/Charts/PolarArea/Form.js +225 -225
- package/dist/Components/Charts/PolarArea/Format.js +42 -42
- package/dist/Components/Charts/PolarArea/index.js +106 -106
- package/dist/Components/Charts/Progess/Form.js +107 -107
- package/dist/Components/Charts/Progess/index.js +119 -119
- package/dist/Components/Charts/Scatter/Form.js +225 -225
- package/dist/Components/Charts/Scatter/Format.js +45 -45
- package/dist/Components/Charts/Scatter/index.js +106 -106
- package/dist/Components/Charts/Table/Form.js +70 -70
- package/dist/Components/Charts/Table/Styles.js +27 -27
- package/dist/Components/Charts/Table/index.js +56 -56
- package/dist/Components/Common/CustomComponent/index.js +83 -83
- package/dist/Components/Common/Menu/DynamicMenu/List.js +43 -43
- package/dist/Components/Common/Menu/DynamicMenu/index.js +155 -155
- package/dist/Components/Common/Menu/index.js +24 -24
- package/dist/Components/Common/Model/Model.js +56 -56
- package/dist/Components/Common/MultipleSelectDropdown/index.js +124 -124
- package/dist/Components/Common/NotFound/index.js +19 -19
- package/dist/Components/Common/Title/Form.js +36 -36
- package/dist/Components/Common/Title/Styles.js +16 -16
- package/dist/Components/Common/Title/index.js +41 -41
- package/dist/Components/Common/Widget/index.js +407 -407
- package/dist/Pages/Dashboard/CreatePage.js +115 -115
- package/dist/Pages/Dashboard/index.js +150 -150
- package/dist/Pages/LayoutPages/index.js +143 -143
- package/dist/Pages/Layouts/index.js +52 -52
- package/dist/Services/Menu.js +58 -58
- package/dist/Services/Routing.js +80 -80
- package/dist/Utility/Contexts.js +20 -20
- package/dist/Utility/Main.js +368 -368
- package/dist/Utility/Routes.js +10 -10
- package/dist/index.js +15 -15
- package/dist/reportWebVitals.js +13 -13
- package/dist/setupTests.js +5 -5
- package/package.json +4 -3
- package/dist/Assets/Fonts/NotoSans-Bold.ttf +0 -0
- package/dist/Assets/Fonts/NotoSans-Medium.ttf +0 -0
- package/dist/Assets/Fonts/NotoSans-Regular.ttf +0 -0
- package/dist/Assets/Fonts/NotoSans-SemiBold.ttf +0 -0
- package/dist/Assets/Images/analytic-graph.png +0 -0
- package/dist/Assets/Images/bar-graph.png +0 -0
- package/dist/Assets/Images/bubble-chart.png +0 -0
- package/dist/Assets/Images/coding.png +0 -0
- package/dist/Assets/Images/doughnut.png +0 -0
- package/dist/Assets/Images/horizontal-bar-graph.png +0 -0
- package/dist/Assets/Images/line-chart.png +0 -0
- package/dist/Assets/Images/mixed-chart.png +0 -0
- package/dist/Assets/Images/pie-chart.png +0 -0
- package/dist/Assets/Images/polar-chart.png +0 -0
- package/dist/Assets/Images/progress-bar.png +0 -0
- package/dist/Assets/Images/scatter-graph.png +0 -0
- package/dist/Assets/Images/table.png +0 -0
- package/dist/Assets/Images/travel.png +0 -0
|
@@ -1,106 +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;
|
|
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;
|
|
@@ -1,70 +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;
|
|
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;
|
|
@@ -1,27 +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
|
-
};
|
|
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
|
+
};
|
|
@@ -1,56 +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;
|
|
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;
|