@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,24 +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;
|
|
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;
|
|
@@ -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 } 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;
|
|
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;
|
|
@@ -1,124 +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;
|
|
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;
|
|
@@ -1,19 +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;
|
|
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;
|
|
@@ -1,36 +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;
|
|
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;
|
|
@@ -1,16 +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
|
-
};
|
|
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
|
+
};
|