@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.
- package/README.md +73 -0
- package/dist/App.css +72 -0
- package/dist/App.js +124 -0
- package/dist/App.test.js +8 -0
- 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
- package/dist/Bootstrap.min.css +2 -0
- package/dist/Components/Charts/Bar/Form.js +231 -0
- package/dist/Components/Charts/Bar/Format.js +43 -0
- package/dist/Components/Charts/Bar/index.js +106 -0
- package/dist/Components/Charts/Chart.css +203 -0
- package/dist/Components/Charts/DoughnutAndPie/Form.js +232 -0
- package/dist/Components/Charts/DoughnutAndPie/Format.js +52 -0
- package/dist/Components/Charts/DoughnutAndPie/index.js +106 -0
- package/dist/Components/Charts/DrawGraph.js +32 -0
- package/dist/Components/Charts/Line/Form.js +231 -0
- package/dist/Components/Charts/Line/Format.js +47 -0
- package/dist/Components/Charts/Line/index.js +106 -0
- package/dist/Components/Charts/MixedChart/index.js +107 -0
- package/dist/Components/Charts/Options.js +139 -0
- package/dist/Components/Charts/PolarArea/Form.js +225 -0
- package/dist/Components/Charts/PolarArea/Format.js +42 -0
- package/dist/Components/Charts/PolarArea/index.js +106 -0
- package/dist/Components/Charts/Progess/Form.js +107 -0
- package/dist/Components/Charts/Progess/index.js +119 -0
- package/dist/Components/Charts/Scatter/Form.js +225 -0
- package/dist/Components/Charts/Scatter/Format.js +45 -0
- package/dist/Components/Charts/Scatter/index.js +106 -0
- package/dist/Components/Charts/Table/Form.js +70 -0
- package/dist/Components/Charts/Table/Styles.js +27 -0
- package/dist/Components/Charts/Table/index.js +56 -0
- package/dist/Components/Common/CustomComponent/index.js +83 -0
- package/dist/Components/Common/Menu/DynamicMenu/List.js +43 -0
- package/dist/Components/Common/Menu/DynamicMenu/index.css +109 -0
- package/dist/Components/Common/Menu/DynamicMenu/index.js +155 -0
- package/dist/Components/Common/Menu/index.css +74 -0
- package/dist/Components/Common/Menu/index.js +24 -0
- package/dist/Components/Common/Model/Model.css +112 -0
- package/dist/Components/Common/Model/Model.js +56 -0
- package/dist/Components/Common/MultipleSelectDropdown/index.js +124 -0
- package/dist/Components/Common/NotFound/index.css +16 -0
- package/dist/Components/Common/NotFound/index.js +19 -0
- package/dist/Components/Common/Title/Form.js +36 -0
- package/dist/Components/Common/Title/Styles.js +16 -0
- package/dist/Components/Common/Title/index.js +41 -0
- package/dist/Components/Common/Widget/index.css +435 -0
- package/dist/Components/Common/Widget/index.js +407 -0
- package/dist/Pages/Dashboard/CreatePage.css +23 -0
- package/dist/Pages/Dashboard/CreatePage.js +115 -0
- package/dist/Pages/Dashboard/index.css +114 -0
- package/dist/Pages/Dashboard/index.js +150 -0
- package/dist/Pages/LayoutPages/index.css +80 -0
- package/dist/Pages/LayoutPages/index.js +143 -0
- package/dist/Pages/Layouts/index.js +52 -0
- package/dist/Services/Menu.js +58 -0
- package/dist/Services/Routing.js +80 -0
- package/dist/Utility/Contexts.js +20 -0
- package/dist/Utility/Main.js +368 -0
- package/dist/Utility/Routes.js +10 -0
- package/dist/index.css +13 -0
- package/dist/index.js +15 -0
- package/dist/reportWebVitals.js +13 -0
- package/dist/setupTests.js +5 -0
- package/package.json +72 -0
|
@@ -0,0 +1,155 @@
|
|
|
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
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
49
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
50
|
+
if (ar || !(i in from)) {
|
|
51
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
52
|
+
ar[i] = from[i];
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
56
|
+
};
|
|
57
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
58
|
+
import React, { useContext, useEffect, useState } from "react";
|
|
59
|
+
import { toast } from "react-toastify";
|
|
60
|
+
import { PopUpContext, RouteContext } from "../../../../Utility/Contexts";
|
|
61
|
+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
62
|
+
import { faPlusSquare } from "@fortawesome/free-regular-svg-icons";
|
|
63
|
+
import './index.css';
|
|
64
|
+
import { createMenu } from "../../../../Services/Menu";
|
|
65
|
+
import * as Icons from '@fortawesome/free-solid-svg-icons';
|
|
66
|
+
export var DynamicMenu = function (props) {
|
|
67
|
+
var _a, _b;
|
|
68
|
+
var _c = useState({
|
|
69
|
+
name: '',
|
|
70
|
+
menu: [{
|
|
71
|
+
title: '',
|
|
72
|
+
path: '',
|
|
73
|
+
icon: '',
|
|
74
|
+
subMenu: []
|
|
75
|
+
}]
|
|
76
|
+
}), data = _c[0], setData = _c[1];
|
|
77
|
+
var _d = useContext(PopUpContext), setshowPopup = _d.setshowPopup, setMenu = _d.setMenu, menu = _d.menu;
|
|
78
|
+
var routePages = useContext(RouteContext).routePages;
|
|
79
|
+
var _e = useState([]), paths = _e[0], setPaths = _e[1];
|
|
80
|
+
var handleChange = function (e, i, p, field) {
|
|
81
|
+
var _a = e.target, name = _a.name, value = _a.value;
|
|
82
|
+
if (field === 'Submenu') {
|
|
83
|
+
data['menu'][i]['subMenu'][p][name] = value;
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
data['menu'][i][name] = value;
|
|
87
|
+
}
|
|
88
|
+
setData(__assign({}, data));
|
|
89
|
+
};
|
|
90
|
+
var AddNewRow = function (e) {
|
|
91
|
+
data['menu'] = __spreadArray(__spreadArray([], data['menu'], true), [{ title: '', path: '', subMenu: [] }], false);
|
|
92
|
+
setData(__assign({}, data));
|
|
93
|
+
};
|
|
94
|
+
var AddNewSubRow = function (e, i) {
|
|
95
|
+
data['menu'][i]['subMenu'] = __spreadArray(__spreadArray([], data['menu'][i]['subMenu'], true), [{ title: '', path: '' }], false);
|
|
96
|
+
setData(__assign({}, data));
|
|
97
|
+
};
|
|
98
|
+
var handleSubmit = function (e) { return __awaiter(void 0, void 0, void 0, function () {
|
|
99
|
+
var config, result, obj, getIds, getMaxId, error_1;
|
|
100
|
+
return __generator(this, function (_a) {
|
|
101
|
+
switch (_a.label) {
|
|
102
|
+
case 0:
|
|
103
|
+
e.preventDefault();
|
|
104
|
+
_a.label = 1;
|
|
105
|
+
case 1:
|
|
106
|
+
_a.trys.push([1, 4, , 5]);
|
|
107
|
+
if (!(data === null || data === void 0 ? void 0 : data.name)) return [3 /*break*/, 3];
|
|
108
|
+
config = {
|
|
109
|
+
method: 'POST',
|
|
110
|
+
body: JSON.stringify(data),
|
|
111
|
+
headers: __assign({ "Content-Type": "application/json" }, props === null || props === void 0 ? void 0 : props.headers)
|
|
112
|
+
};
|
|
113
|
+
return [4 /*yield*/, createMenu(props === null || props === void 0 ? void 0 : props.backendUrl, config)];
|
|
114
|
+
case 2:
|
|
115
|
+
result = _a.sent();
|
|
116
|
+
toast.success(result === null || result === void 0 ? void 0 : result.message);
|
|
117
|
+
obj = data;
|
|
118
|
+
getIds = (menu === null || menu === void 0 ? void 0 : menu.map(function (it) { return it === null || it === void 0 ? void 0 : it.id; })) || [];
|
|
119
|
+
getMaxId = (getIds === null || getIds === void 0 ? void 0 : getIds.length) > 0 ? Math.max.apply(Math, getIds) : 0;
|
|
120
|
+
obj['id'] = (result === null || result === void 0 ? void 0 : result.id) || getMaxId + 1;
|
|
121
|
+
setMenu(__spreadArray(__spreadArray([], menu, true), [obj], false));
|
|
122
|
+
setshowPopup(false);
|
|
123
|
+
_a.label = 3;
|
|
124
|
+
case 3: return [3 /*break*/, 5];
|
|
125
|
+
case 4:
|
|
126
|
+
error_1 = _a.sent();
|
|
127
|
+
toast.error(error_1 === null || error_1 === void 0 ? void 0 : error_1.toString());
|
|
128
|
+
return [3 /*break*/, 5];
|
|
129
|
+
case 5: return [2 /*return*/];
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
}); };
|
|
133
|
+
var renderHtml = function (i, p, field) {
|
|
134
|
+
var _a;
|
|
135
|
+
return (_jsxs(React.Fragment, { children: [_jsxs("div", __assign({ className: "form-group ".concat(field === 'Menu' ? 'w-25' : 'w-45') }, { children: [_jsxs("label", { children: [field, " Title (", i + 1, field === 'Submenu' && ".".concat(p + 1), ")"] }), _jsx("input", { type: "text", name: 'title', className: "form-control", onChange: function (e) { return handleChange(e, i, p, field); } })] })), _jsxs("div", __assign({ className: "form-group ".concat(field === 'Menu' ? 'w-25' : 'w-45') }, { children: [_jsxs("label", { children: [field, " Path (", i + 1, field === 'Submenu' && ".".concat(p + 1), ")"] }), _jsxs("select", __assign({ name: "path", className: "form-control", onChange: function (e) { return handleChange(e, i, p, field); } }, { children: [_jsx("option", __assign({ value: '' }, { children: "-- Select Route --" })), paths === null || paths === void 0 ? void 0 : paths.map(function (it, i) {
|
|
136
|
+
var _a;
|
|
137
|
+
return (_jsx("option", __assign({ value: it === null || it === void 0 ? void 0 : it.path }, { children: (_a = it === null || it === void 0 ? void 0 : it.title) === null || _a === void 0 ? void 0 : _a.name }), i));
|
|
138
|
+
})] }))] })), field === 'Menu' && _jsxs("div", __assign({ className: "form-group ".concat(field === 'Menu' ? 'w-25' : 'w-45') }, { children: [_jsx("label", { children: "Title Icons" }), _jsxs("select", __assign({ name: "icon", className: "form-control", onChange: function (e) { return handleChange(e, i, p, field); } }, { children: [_jsx("option", __assign({ value: '' }, { children: "-- Select Icon --" })), (_a = Object.keys(Icons)) === null || _a === void 0 ? void 0 : _a.map(function (it, i) { return (_jsx("option", __assign({ value: it }, { children: it }), i)); })] }))] }))] }));
|
|
139
|
+
};
|
|
140
|
+
var getRoutesData = function () {
|
|
141
|
+
var routes = routePages === null || routePages === void 0 ? void 0 : routePages.map(function (it) { return { id: it === null || it === void 0 ? void 0 : it.id, title: it === null || it === void 0 ? void 0 : it.title, path: it === null || it === void 0 ? void 0 : it.path }; });
|
|
142
|
+
setPaths(routes);
|
|
143
|
+
};
|
|
144
|
+
useEffect(function () {
|
|
145
|
+
getRoutesData();
|
|
146
|
+
}, [props]);
|
|
147
|
+
return (_jsxs("div", __assign({ className: "crt-pge-st col-md-12" }, { children: [_jsxs("div", __assign({ className: "form-group" }, { children: [_jsx("label", { children: "Unique Identifier Name" }), _jsx("input", { type: 'text', name: "name", className: "form-control", onChange: function (e) {
|
|
148
|
+
var _a;
|
|
149
|
+
return setData(__assign(__assign({}, data), (_a = {}, _a[e.target.name] = e.target.value, _a)));
|
|
150
|
+
} })] })), ((_a = data === null || data === void 0 ? void 0 : data.menu) === null || _a === void 0 ? void 0 : _a.length) > 0 && _jsx("ul", __assign({ className: "list-unstyled dy-mn" }, { children: (_b = data === null || data === void 0 ? void 0 : data.menu) === null || _b === void 0 ? void 0 : _b.map(function (item, i) {
|
|
151
|
+
var _a, _b;
|
|
152
|
+
return (_jsxs("li", __assign({ className: "d-flex flex-wrap justify-content-between align-items-center" }, { children: [_jsxs("div", __assign({ className: "add-icons" }, { children: [_jsx(FontAwesomeIcon, { className: "icon", icon: faPlusSquare, cursor: 'pointer', onClick: function (e) { return AddNewRow(e); } }), _jsx(FontAwesomeIcon, { className: "icon", icon: faPlusSquare, cursor: 'pointer', style: { marginLeft: 5 }, onClick: function (e) { return AddNewSubRow(e, i); } })] })), renderHtml(i, 0, 'Menu'), ((_a = item === null || item === void 0 ? void 0 : item.subMenu) === null || _a === void 0 ? void 0 : _a.length) > 0 && _jsx("ul", __assign({ className: "dy-mn" }, { children: (_b = item === null || item === void 0 ? void 0 : item.subMenu) === null || _b === void 0 ? void 0 : _b.map(function (sm, s) { return (_jsxs("li", __assign({ className: "d-flex flex-wrap justify-content-between align-items-center" }, { children: [_jsx(FontAwesomeIcon, { className: "icon", icon: faPlusSquare, cursor: 'pointer', style: { marginLeft: 5 }, onClick: function (e) { return AddNewSubRow(e, i); } }), renderHtml(i, s, 'Submenu')] }), s)); }) }))] }), i));
|
|
153
|
+
}) })), _jsx("div", __assign({ className: "button" }, { children: _jsx("button", __assign({ className: "btn add-btn", onClick: function (e) { return handleSubmit(e); } }, { children: "Submit" })) }))] })));
|
|
154
|
+
};
|
|
155
|
+
export default DynamicMenu;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
.menu-section{
|
|
2
|
+
width: 100%;
|
|
3
|
+
height: 100vh;
|
|
4
|
+
border-radius: 5px;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
box-shadow: 0 0 5px #dedede;
|
|
7
|
+
background: #fff;
|
|
8
|
+
padding: 15px;
|
|
9
|
+
overflow-y: scroll;
|
|
10
|
+
.up-1 p{
|
|
11
|
+
font-size: 12px;
|
|
12
|
+
opacity: .8;
|
|
13
|
+
}
|
|
14
|
+
.up-2{
|
|
15
|
+
display: flex;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
align-items: center;
|
|
18
|
+
width: 100%;
|
|
19
|
+
margin-top: 30px;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
.prf-sect{
|
|
22
|
+
width: 80px;
|
|
23
|
+
height: 80px;
|
|
24
|
+
border-radius: 100%;
|
|
25
|
+
box-shadow: 1px 2px 3px #000;
|
|
26
|
+
text-align: center;
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
background: linear-gradient(45deg, #fd746c, #ff9068);
|
|
31
|
+
color: #fff;
|
|
32
|
+
h1{
|
|
33
|
+
margin-bottom: 0;
|
|
34
|
+
font-weight: 600;
|
|
35
|
+
font-size: 50px;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
.prf-name{
|
|
39
|
+
font-size: 15px;
|
|
40
|
+
margin-top: 15px;
|
|
41
|
+
font-weight: 600;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
.mid{
|
|
45
|
+
margin-top: 15px;
|
|
46
|
+
li{
|
|
47
|
+
border: 1px solid #eee;
|
|
48
|
+
padding: 8px;
|
|
49
|
+
margin-bottom: 5px;
|
|
50
|
+
border-radius: 5px;
|
|
51
|
+
cursor: pointer;
|
|
52
|
+
font-size: 12px;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
.bottom{
|
|
56
|
+
margin-top: 15px;
|
|
57
|
+
opacity: .8;
|
|
58
|
+
text-align: center;
|
|
59
|
+
width: 100%;
|
|
60
|
+
font-size: 12px;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.menu-section::-webkit-scrollbar{
|
|
65
|
+
width: 2px;
|
|
66
|
+
height: 2px;
|
|
67
|
+
}
|
|
68
|
+
.menu-section::-webkit-scrollbar-track{
|
|
69
|
+
border-radius: 10px;
|
|
70
|
+
}
|
|
71
|
+
.menu-section::-webkit-scrollbar-thumb{
|
|
72
|
+
background: #ef5323;
|
|
73
|
+
border-radius: 10px;
|
|
74
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
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 './index.css';
|
|
14
|
+
import { faDashboard } from '@fortawesome/free-solid-svg-icons';
|
|
15
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
16
|
+
export var Menu = function () {
|
|
17
|
+
var menuList = [{
|
|
18
|
+
id: 1,
|
|
19
|
+
name: 'Dashboard',
|
|
20
|
+
icon: faDashboard
|
|
21
|
+
}];
|
|
22
|
+
return (_jsxs("div", __assign({ className: 'menu-section' }, { children: [_jsx("div", __assign({ className: 'up-1' }, { children: _jsx("p", { children: "Welcome to LDG Portal!" }) })), _jsxs("div", __assign({ className: 'up-2' }, { children: [_jsx("div", __assign({ className: 'prf-sect' }, { children: _jsx("h1", { children: "A" }) })), _jsx("p", __assign({ className: 'prf-name' }, { children: "Admin" }))] })), _jsx("div", __assign({ className: 'mid' }, { children: _jsx("ul", __assign({ className: 'list-unstyled' }, { children: menuList === null || menuList === void 0 ? void 0 : menuList.map(function (item, i) { return (_jsxs("li", { children: [_jsx(FontAwesomeIcon, { icon: item === null || item === void 0 ? void 0 : item.icon, style: { marginRight: 5 }, color: '#ff9068' }), " ", item === null || item === void 0 ? void 0 : item.name] }, i)); }) })) })), _jsx("div", __assign({ className: 'bottom' }, { children: _jsx("p", { children: "Version 0.1" }) }))] })));
|
|
23
|
+
};
|
|
24
|
+
export default Menu;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
.model-body{
|
|
2
|
+
position: fixed;
|
|
3
|
+
top: 0;
|
|
4
|
+
right: 0;
|
|
5
|
+
width: 100%;
|
|
6
|
+
height: 100%;
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
box-shadow: 0 0 5px #dedede;
|
|
9
|
+
transition: .1s all linear;
|
|
10
|
+
z-index: 1;
|
|
11
|
+
background: #fff;
|
|
12
|
+
.model-header{
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-wrap: wrap;
|
|
15
|
+
justify-content: space-between;
|
|
16
|
+
align-items: center;
|
|
17
|
+
width: 100%;
|
|
18
|
+
height: 15%;
|
|
19
|
+
padding: 10px;
|
|
20
|
+
box-shadow: 0 0 5px #dedede;
|
|
21
|
+
h5{
|
|
22
|
+
margin-bottom: 0;
|
|
23
|
+
font-size: 15px;
|
|
24
|
+
font-weight: 500;
|
|
25
|
+
color: #000;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
.model-bottom{
|
|
29
|
+
height: 85%;
|
|
30
|
+
overflow-y: scroll;
|
|
31
|
+
}
|
|
32
|
+
.model-bottom::-webkit-scrollbar{
|
|
33
|
+
width: 2px;
|
|
34
|
+
height: 2px;
|
|
35
|
+
}
|
|
36
|
+
.model-bottom::-webkit-scrollbar-track{
|
|
37
|
+
border-radius: 10px;
|
|
38
|
+
}
|
|
39
|
+
.model-bottom::-webkit-scrollbar-thumb{
|
|
40
|
+
background: #ef5323;
|
|
41
|
+
border-radius: 10px;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.model-section-form, .model-section-side-form{
|
|
46
|
+
position: fixed;
|
|
47
|
+
left: 0;
|
|
48
|
+
width: 100%;
|
|
49
|
+
height: 100vh;
|
|
50
|
+
top: 0;
|
|
51
|
+
background: rgba(0,0,0,0.2);
|
|
52
|
+
display: flex;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
align-items: center;
|
|
55
|
+
z-index: 1;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.model-section-side-form{
|
|
59
|
+
left: 75%;
|
|
60
|
+
width: 25%;
|
|
61
|
+
background: #fff;
|
|
62
|
+
box-shadow: 0 0 5px #dedede;
|
|
63
|
+
.model-body-form{
|
|
64
|
+
width: 100%;
|
|
65
|
+
height: 100%;
|
|
66
|
+
.model-bottom{
|
|
67
|
+
height: 85%;
|
|
68
|
+
overflow-y: scroll;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.model-body-form{
|
|
74
|
+
width: 500px;
|
|
75
|
+
height: 400px;
|
|
76
|
+
background: #fff;
|
|
77
|
+
padding: 15px;
|
|
78
|
+
z-index: 1;
|
|
79
|
+
border-radius: 5px;
|
|
80
|
+
.model-header{
|
|
81
|
+
display: flex;
|
|
82
|
+
flex-wrap: wrap;
|
|
83
|
+
justify-content: space-between;
|
|
84
|
+
align-items: center;
|
|
85
|
+
width: 100%;
|
|
86
|
+
height: 40px;
|
|
87
|
+
padding: 10px;
|
|
88
|
+
box-shadow: 0 0 5px #dedede;
|
|
89
|
+
margin-bottom: 15px;
|
|
90
|
+
h5{
|
|
91
|
+
margin-bottom: 0;
|
|
92
|
+
font-size: 13px;
|
|
93
|
+
font-weight: 600;
|
|
94
|
+
color: #000;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
.model-bottom{
|
|
98
|
+
height: 300px;
|
|
99
|
+
overflow-y: scroll;
|
|
100
|
+
}
|
|
101
|
+
.model-bottom::-webkit-scrollbar{
|
|
102
|
+
width: 2px;
|
|
103
|
+
height: 2px;
|
|
104
|
+
}
|
|
105
|
+
.model-bottom::-webkit-scrollbar-track{
|
|
106
|
+
border-radius: 10px;
|
|
107
|
+
}
|
|
108
|
+
.model-bottom::-webkit-scrollbar-thumb{
|
|
109
|
+
background: #ef5323;
|
|
110
|
+
border-radius: 10px;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
@@ -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 } from "react";
|
|
14
|
+
import { PopUpContext } from "../../../Utility/Contexts";
|
|
15
|
+
import { ChartTypes, ModelTypes, Modules } from "../../../Utility/Main";
|
|
16
|
+
import './Model.css';
|
|
17
|
+
import BarConfigForm from "../../Charts/Bar/Form";
|
|
18
|
+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
19
|
+
import { faClose } from "@fortawesome/free-solid-svg-icons";
|
|
20
|
+
import LineConfigForm from "../../Charts/Line/Form";
|
|
21
|
+
import DoughnutConfigForm from "../../Charts/DoughnutAndPie/Form";
|
|
22
|
+
import PolarConfigForm from "../../Charts/PolarArea/Form";
|
|
23
|
+
import TableConfigForm from "../../Charts/Table/Form";
|
|
24
|
+
import CreatePage from "../../../Pages/Dashboard/CreatePage";
|
|
25
|
+
import ScatterConfigForm from "../../Charts/Scatter/Form";
|
|
26
|
+
import ProgressChartConfigForm from "../../Charts/Progess/Form";
|
|
27
|
+
import DynamicMenu from "../Menu/DynamicMenu";
|
|
28
|
+
import LayoutTitleConfigForm from "../Title/Form";
|
|
29
|
+
var Model = function (props) {
|
|
30
|
+
var _a = useContext(PopUpContext), showPopup = _a.showPopup, setshowPopup = _a.setshowPopup;
|
|
31
|
+
var closePopup = function () {
|
|
32
|
+
setshowPopup(false);
|
|
33
|
+
};
|
|
34
|
+
return (_jsxs("div", __assign({ className: "".concat((props === null || props === void 0 ? void 0 : props.type) === ModelTypes.FORM ? 'model-section-form' : (props === null || props === void 0 ? void 0 : props.type) === (ModelTypes === null || ModelTypes === void 0 ? void 0 : ModelTypes.SIDE_FORM) ? 'model-section-side-form' : 'model-section', " disable") }, { children: [(props === null || props === void 0 ? void 0 : props.type) === (ModelTypes === null || ModelTypes === void 0 ? void 0 : ModelTypes.CONFIGURE) &&
|
|
35
|
+
_jsxs("div", __assign({ className: "model-body" }, { children: [_jsxs("div", __assign({ className: "model-header" }, { children: [_jsx("h5", { children: props === null || props === void 0 ? void 0 : props.headTitle }), _jsx(FontAwesomeIcon, { icon: faClose, style: { cursor: 'pointer', color: '#000' }, onClick: function () { return closePopup(); } })] })), _jsx("div", __assign({ className: "model-bottom" }, { children: (props === null || props === void 0 ? void 0 : props.chart) === (ChartTypes === null || ChartTypes === void 0 ? void 0 : ChartTypes.BAR) ?
|
|
36
|
+
_jsx(BarConfigForm, { data: props === null || props === void 0 ? void 0 : props.data })
|
|
37
|
+
: (props === null || props === void 0 ? void 0 : props.chart) === ChartTypes.LINE ?
|
|
38
|
+
_jsx(LineConfigForm, { data: props === null || props === void 0 ? void 0 : props.data })
|
|
39
|
+
: (props === null || props === void 0 ? void 0 : props.chart) === ChartTypes.DOUGHNUT ?
|
|
40
|
+
_jsx(DoughnutConfigForm, { data: props === null || props === void 0 ? void 0 : props.data })
|
|
41
|
+
: (props === null || props === void 0 ? void 0 : props.chart) === ChartTypes.POLAR ?
|
|
42
|
+
_jsx(PolarConfigForm, { data: props === null || props === void 0 ? void 0 : props.data })
|
|
43
|
+
: (props === null || props === void 0 ? void 0 : props.chart) === ChartTypes.SCATTER ?
|
|
44
|
+
_jsx(ScatterConfigForm, { data: props === null || props === void 0 ? void 0 : props.data })
|
|
45
|
+
: (props === null || props === void 0 ? void 0 : props.chart) === ChartTypes.TABLE ?
|
|
46
|
+
_jsx(TableConfigForm, { data: props === null || props === void 0 ? void 0 : props.data })
|
|
47
|
+
: (props === null || props === void 0 ? void 0 : props.chart) === ChartTypes.PROGRESS &&
|
|
48
|
+
_jsx(ProgressChartConfigForm, { data: props === null || props === void 0 ? void 0 : props.data }) }))] })), (props === null || props === void 0 ? void 0 : props.type) === (ModelTypes === null || ModelTypes === void 0 ? void 0 : ModelTypes.FORM) &&
|
|
49
|
+
_jsxs("div", __assign({ className: "model-body-form" }, { children: [_jsxs("div", __assign({ className: "model-header" }, { children: [_jsx("h5", { children: props === null || props === void 0 ? void 0 : props.headTitle }), _jsx(FontAwesomeIcon, { icon: faClose, style: { cursor: 'pointer', color: '#000' }, onClick: function () { return closePopup(); } })] })), _jsx("div", __assign({ className: "model-bottom" }, { children: (props === null || props === void 0 ? void 0 : props.module) === Modules.DASHBOARD ?
|
|
50
|
+
_jsx(CreatePage, { data: props === null || props === void 0 ? void 0 : props.data, backendUrl: props === null || props === void 0 ? void 0 : props.backendUrl, headers: props === null || props === void 0 ? void 0 : props.headers })
|
|
51
|
+
: (props === null || props === void 0 ? void 0 : props.module) === Modules.MENU &&
|
|
52
|
+
_jsx(DynamicMenu, { data: props === null || props === void 0 ? void 0 : props.data, backendUrl: props === null || props === void 0 ? void 0 : props.backendUrl, headers: props === null || props === void 0 ? void 0 : props.headers }) }))] })), (props === null || props === void 0 ? void 0 : props.type) === (ModelTypes === null || ModelTypes === void 0 ? void 0 : ModelTypes.SIDE_FORM) &&
|
|
53
|
+
_jsxs("div", __assign({ className: "model-body-form" }, { children: [_jsxs("div", __assign({ className: "model-header" }, { children: [_jsx("h5", { children: props === null || props === void 0 ? void 0 : props.headTitle }), _jsx(FontAwesomeIcon, { icon: faClose, style: { cursor: 'pointer' }, onClick: function () { return closePopup(); } })] })), _jsx("div", __assign({ className: "model-bottom" }, { children: (props === null || props === void 0 ? void 0 : props.module) === Modules.TITLE &&
|
|
54
|
+
_jsx(LayoutTitleConfigForm, { data: props === null || props === void 0 ? void 0 : props.data }) }))] }))] })));
|
|
55
|
+
};
|
|
56
|
+
export default Model;
|
|
@@ -0,0 +1,124 @@
|
|
|
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 __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
|
+
if (ar || !(i in from)) {
|
|
15
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
16
|
+
ar[i] = from[i];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
|
+
};
|
|
21
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
+
import React, { useContext, useEffect, useState } from "react";
|
|
23
|
+
import { GraphContext } from "../../../Utility/Contexts";
|
|
24
|
+
import { toast } from "react-toastify";
|
|
25
|
+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
26
|
+
import { faChevronDown } from "@fortawesome/free-solid-svg-icons";
|
|
27
|
+
var MultipleSelectDropdown = function (_a) {
|
|
28
|
+
var _b;
|
|
29
|
+
var data = _a.data, existFilter = _a.existFilter, isEdit = _a.isEdit;
|
|
30
|
+
var _c = useState(false), enable = _c[0], setEnable = _c[1];
|
|
31
|
+
var _d = useState([]), active = _d[0], setActive = _d[1];
|
|
32
|
+
var _e = useState(0), maxCount = _e[0], setMaxCount = _e[1];
|
|
33
|
+
var _f = useContext(GraphContext), drawData = _f.drawData, setDrawData = _f.setDrawData;
|
|
34
|
+
var handleList = function () {
|
|
35
|
+
if (enable) {
|
|
36
|
+
setEnable(false);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
setEnable(true);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var onFilterChange = function (e) {
|
|
43
|
+
var _a, _b, _c;
|
|
44
|
+
try {
|
|
45
|
+
var _d = e.target, value = _d.value, name_1 = _d.name, type = _d.type;
|
|
46
|
+
var typeNo = Number(type);
|
|
47
|
+
if (value) {
|
|
48
|
+
if ((_a = drawData['apiCall']) === null || _a === void 0 ? void 0 : _a.body) {
|
|
49
|
+
var bodyFormat = JSON.parse(drawData['apiCall']['body']);
|
|
50
|
+
switch (typeNo) {
|
|
51
|
+
case 1:
|
|
52
|
+
bodyFormat[name_1] = value;
|
|
53
|
+
setActive([value]);
|
|
54
|
+
break;
|
|
55
|
+
case 2:
|
|
56
|
+
if (((_b = bodyFormat[name_1]) === null || _b === void 0 ? void 0 : _b.indexOf(value)) === -1) {
|
|
57
|
+
if ((active === null || active === void 0 ? void 0 : active.length) < maxCount) {
|
|
58
|
+
bodyFormat[name_1] = __spreadArray(__spreadArray([], bodyFormat[name_1], true), [value], false);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
bodyFormat[name_1].splice((_c = bodyFormat[name_1]) === null || _c === void 0 ? void 0 : _c.indexOf(value), 1);
|
|
63
|
+
}
|
|
64
|
+
if ((active === null || active === void 0 ? void 0 : active.indexOf(value)) === -1) {
|
|
65
|
+
if ((active === null || active === void 0 ? void 0 : active.length) < maxCount) {
|
|
66
|
+
active.push(value);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
toast.error("Selection Exceeded.");
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
active.splice(active === null || active === void 0 ? void 0 : active.indexOf(value), 1);
|
|
74
|
+
}
|
|
75
|
+
setActive(active);
|
|
76
|
+
break;
|
|
77
|
+
default:
|
|
78
|
+
bodyFormat[name_1] = value;
|
|
79
|
+
setActive([]);
|
|
80
|
+
}
|
|
81
|
+
drawData['apiCall']['body'] = JSON.stringify(bodyFormat);
|
|
82
|
+
setDrawData(__assign({}, drawData));
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
console.debug(error === null || error === void 0 ? void 0 : error.toString());
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
var defaultSelected = function () {
|
|
91
|
+
var _a, _b, _c;
|
|
92
|
+
try {
|
|
93
|
+
var parseFilter = (JSON === null || JSON === void 0 ? void 0 : JSON.parse(existFilter)) || {};
|
|
94
|
+
if (((_a = Object === null || Object === void 0 ? void 0 : Object.keys(parseFilter)) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
95
|
+
setActive(parseFilter[(_c = (_b = drawData === null || drawData === void 0 ? void 0 : drawData.filters) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.filter]);
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
setActive([]);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
console.debug(error === null || error === void 0 ? void 0 : error.toString());
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
var getMaxSelection = function () {
|
|
106
|
+
var _a, _b, _c;
|
|
107
|
+
try {
|
|
108
|
+
var parseFilter = (JSON === null || JSON === void 0 ? void 0 : JSON.parse(existFilter)) || {};
|
|
109
|
+
setMaxCount(((_c = parseFilter[(_b = (_a = drawData === null || drawData === void 0 ? void 0 : drawData.filters) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.filter]) === null || _c === void 0 ? void 0 : _c.length) || 0);
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
console.debug(error === null || error === void 0 ? void 0 : error.toString());
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
useEffect(function () { defaultSelected(); }, [existFilter]);
|
|
116
|
+
useEffect(function () { getMaxSelection(); }, []);
|
|
117
|
+
return (_jsx(React.Fragment, { children: (_b = drawData === null || drawData === void 0 ? void 0 : drawData.filters) === null || _b === void 0 ? void 0 : _b.map(function (item, i) {
|
|
118
|
+
var _a, _b;
|
|
119
|
+
return (_jsxs("div", __assign({ className: "multiple-select disable", style: { right: isEdit ? '60px' : '2px' } }, { children: [_jsxs("button", __assign({ className: "btn", onClick: handleList }, { children: [(typeof active === 'object' && (active === null || active === void 0 ? void 0 : active.length)) ? "".concat(active === null || active === void 0 ? void 0 : active.length, " Items Selected") : (typeof active === 'string' && active) ? active : 'Select', " ", _jsx(FontAwesomeIcon, { icon: faChevronDown })] })), enable && _jsx("div", __assign({ className: "list-section" }, { children: _jsx("ul", __assign({ className: "list-unstyled" }, { children: ((_a = item === null || item === void 0 ? void 0 : item.values) === null || _a === void 0 ? void 0 : _a.length) > 0 ?
|
|
120
|
+
(_b = item === null || item === void 0 ? void 0 : item.values) === null || _b === void 0 ? void 0 : _b.map(function (it, no) { return (_jsxs("li", __assign({ className: "d-flex align-items-center flex-wrap ".concat((active === null || active === void 0 ? void 0 : active.includes(it)) ? 'multi-select-li-active' : 'multi-select-li-inactive'), onClick: function (e) { return onFilterChange({ target: { name: item === null || item === void 0 ? void 0 : item.filter, value: it, type: item === null || item === void 0 ? void 0 : item.type } }); } }, { children: [_jsx("div", { style: { width: 10, height: 10, borderRadius: 3, border: '1px solid #bbb', marginRight: 5, background: (active === null || active === void 0 ? void 0 : active.includes(it)) ? '#f29f67' : 'transparent' } }), _jsx("span", __assign({ style: { color: '#000' } }, { children: it }))] }), no)); })
|
|
121
|
+
: _jsx("li", { children: "No Data Found" }) })) }))] }), i));
|
|
122
|
+
}) }));
|
|
123
|
+
};
|
|
124
|
+
export default MultipleSelectDropdown;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.not-found-componet{
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
flex-wrap: wrap;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
align-items: center;
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 100%;
|
|
9
|
+
.nf-icon{
|
|
10
|
+
margin-bottom: 15px;
|
|
11
|
+
}
|
|
12
|
+
p{
|
|
13
|
+
margin-bottom: 0;
|
|
14
|
+
font-size: 13px;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
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 { faCircleExclamation } from "@fortawesome/free-solid-svg-icons";
|
|
14
|
+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
15
|
+
import './index.css';
|
|
16
|
+
var NotFoundComponent = function () {
|
|
17
|
+
return (_jsxs("div", __assign({ className: "not-found-componet" }, { children: [_jsx(FontAwesomeIcon, { icon: faCircleExclamation, size: "2x", className: "nf-icon", color: "red" }), _jsx("p", { children: "Oops! Data Not Found." })] })));
|
|
18
|
+
};
|
|
19
|
+
export default NotFoundComponent;
|
|
@@ -0,0 +1,36 @@
|
|
|
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, useState } from 'react';
|
|
14
|
+
import { PopUpContext } from '../../../Utility/Contexts';
|
|
15
|
+
var LayoutTitleConfigForm = function (props) {
|
|
16
|
+
var _a, _b, _c, _d, _e;
|
|
17
|
+
var _f = useState((_a = props === null || props === void 0 ? void 0 : props.data) === null || _a === void 0 ? void 0 : _a.gData), data = _f[0], setData = _f[1];
|
|
18
|
+
var setTitle = useContext(PopUpContext).setTitle;
|
|
19
|
+
var handleChange = function (e, field) {
|
|
20
|
+
var _a = e.target, name = _a.name, value = _a.value;
|
|
21
|
+
if (field === 'customStyles') {
|
|
22
|
+
data[field]['div'][name] = value;
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
data[name] = value;
|
|
26
|
+
}
|
|
27
|
+
setData(__assign({}, data));
|
|
28
|
+
setTitle(__assign({}, data));
|
|
29
|
+
};
|
|
30
|
+
return (_jsxs("div", __assign({ className: 'popup-model-form' }, { children: [((_c = (_b = props === null || props === void 0 ? void 0 : props.data) === null || _b === void 0 ? void 0 : _b.gData) === null || _c === void 0 ? void 0 : _c.name) &&
|
|
31
|
+
_jsxs("div", __assign({ className: 'form-group d-flex' }, { children: [_jsx("label", __assign({ className: 'subtitle' }, { children: "Title:" })), _jsx("input", { type: 'text', name: 'name', value: data === null || data === void 0 ? void 0 : data.name, className: 'form-control', onChange: function (e) { return handleChange(e); } })] })), (_e = Object.keys((_d = data === null || data === void 0 ? void 0 : data.customStyles) === null || _d === void 0 ? void 0 : _d.div)) === null || _e === void 0 ? void 0 : _e.map(function (st, sn) {
|
|
32
|
+
var _a, _b;
|
|
33
|
+
return (_jsxs("div", __assign({ className: 'form-group d-flex' }, { children: [_jsxs("label", { children: ["Title ", st, ":"] }), _jsx("input", { type: 'text', name: st, value: (_b = (_a = data === null || data === void 0 ? void 0 : data.customStyles) === null || _a === void 0 ? void 0 : _a.div) === null || _b === void 0 ? void 0 : _b[st], className: 'form-control', onChange: function (e) { return handleChange(e, 'customStyles'); } })] }), sn));
|
|
34
|
+
})] })));
|
|
35
|
+
};
|
|
36
|
+
export default LayoutTitleConfigForm;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export var LayoutTitleStyles = function () {
|
|
2
|
+
return {
|
|
3
|
+
div: {
|
|
4
|
+
padding: '10px 0 10px 0',
|
|
5
|
+
display: 'flex',
|
|
6
|
+
justifyContent: 'space-between',
|
|
7
|
+
alignItems: 'center',
|
|
8
|
+
flexWrap: 'wrap',
|
|
9
|
+
background: 'transparent',
|
|
10
|
+
color: '#000',
|
|
11
|
+
borderRadius: 5,
|
|
12
|
+
boxShadow: '0 0',
|
|
13
|
+
fontSize: '15px'
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
};
|