@apexcura/ui-components 0.0.14-Beta180 → 0.0.14-Beta182
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/.env.defaults +2 -2
- package/dist/index.css +0 -3
- package/dist/index.d.mts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +60 -109
- package/dist/index.mjs +60 -110
- package/package.json +1 -1
- package/postcss.config.js +6 -6
- package/tailwind.config.js +10 -10
package/.env.defaults
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
GOOGLE_CLIENT_ID=1234
|
|
2
|
-
GOOGLE_AUTH_ORIGINS=1234
|
|
1
|
+
GOOGLE_CLIENT_ID=1234
|
|
2
|
+
GOOGLE_AUTH_ORIGINS=1234
|
package/dist/index.css
CHANGED
|
@@ -460,9 +460,6 @@ video {
|
|
|
460
460
|
:where(.css-dev-only-do-not-override-1r287do).ant-radio-button-wrapper:first-child {
|
|
461
461
|
border-inline-start: 1px solid rgb(145 145 145);
|
|
462
462
|
}
|
|
463
|
-
:where(.css-dev-only-do-not-override-m4timi).ant-tabs-top > .ant-tabs-nav {
|
|
464
|
-
margin: 0px;
|
|
465
|
-
}
|
|
466
463
|
.hover\:bg-\[\#F2F2F2\]:hover {
|
|
467
464
|
--tw-bg-opacity: 1;
|
|
468
465
|
background-color: rgb(242 242 242 / var(--tw-bg-opacity));
|
package/dist/index.d.mts
CHANGED
|
@@ -69,8 +69,6 @@ type ElementType = {
|
|
|
69
69
|
fillText2?: string;
|
|
70
70
|
labels?: any[];
|
|
71
71
|
data?: any[];
|
|
72
|
-
pagination?: boolean;
|
|
73
|
-
is_detail?: boolean;
|
|
74
72
|
};
|
|
75
73
|
|
|
76
74
|
declare const TextElement: (props: ElementType) => React$1.JSX.Element;
|
|
@@ -134,8 +132,12 @@ declare const HorizontalBarChart: (props: ElementType) => React$1.JSX.Element;
|
|
|
134
132
|
|
|
135
133
|
declare const LineChart: (props: ElementType) => React$1.JSX.Element;
|
|
136
134
|
|
|
135
|
+
declare class HighchartsLineChart extends React$1.Component<any, any> {
|
|
136
|
+
render(): React$1.JSX.Element;
|
|
137
|
+
}
|
|
138
|
+
|
|
137
139
|
declare const DoubleBarChart: (props: ElementType) => React$1.JSX.Element;
|
|
138
140
|
|
|
139
141
|
declare const BarChart: (props: ElementType) => React$1.JSX.Element;
|
|
140
142
|
|
|
141
|
-
export { AddMoreTable, BarChart, ButtonElement, CheckboxElement, CircleDonut, CkEditor, DatePickerElement, DateRangePickerElement, DoubleBarChart, DropDownGroup, FileUpload, HorizontalBarChart, Image, LineChart, MultipleSelectElement, Navbar, NumberElement, OtpElement, PasswordElement, RadioElement, SelectElement, SemiCircleDonut, Sidebar, SingleCheckbox, SingleSelectElement, SwitchElement, TableElement, TabsElement, TextElement, TextareaElement, Upload };
|
|
143
|
+
export { AddMoreTable, BarChart, ButtonElement, CheckboxElement, CircleDonut, CkEditor, DatePickerElement, DateRangePickerElement, DoubleBarChart, DropDownGroup, FileUpload, HighchartsLineChart, HorizontalBarChart, Image, LineChart, MultipleSelectElement, Navbar, NumberElement, OtpElement, PasswordElement, RadioElement, SelectElement, SemiCircleDonut, Sidebar, SingleCheckbox, SingleSelectElement, SwitchElement, TableElement, TabsElement, TextElement, TextareaElement, Upload };
|
package/dist/index.d.ts
CHANGED
|
@@ -69,8 +69,6 @@ type ElementType = {
|
|
|
69
69
|
fillText2?: string;
|
|
70
70
|
labels?: any[];
|
|
71
71
|
data?: any[];
|
|
72
|
-
pagination?: boolean;
|
|
73
|
-
is_detail?: boolean;
|
|
74
72
|
};
|
|
75
73
|
|
|
76
74
|
declare const TextElement: (props: ElementType) => React$1.JSX.Element;
|
|
@@ -134,8 +132,12 @@ declare const HorizontalBarChart: (props: ElementType) => React$1.JSX.Element;
|
|
|
134
132
|
|
|
135
133
|
declare const LineChart: (props: ElementType) => React$1.JSX.Element;
|
|
136
134
|
|
|
135
|
+
declare class HighchartsLineChart extends React$1.Component<any, any> {
|
|
136
|
+
render(): React$1.JSX.Element;
|
|
137
|
+
}
|
|
138
|
+
|
|
137
139
|
declare const DoubleBarChart: (props: ElementType) => React$1.JSX.Element;
|
|
138
140
|
|
|
139
141
|
declare const BarChart: (props: ElementType) => React$1.JSX.Element;
|
|
140
142
|
|
|
141
|
-
export { AddMoreTable, BarChart, ButtonElement, CheckboxElement, CircleDonut, CkEditor, DatePickerElement, DateRangePickerElement, DoubleBarChart, DropDownGroup, FileUpload, HorizontalBarChart, Image, LineChart, MultipleSelectElement, Navbar, NumberElement, OtpElement, PasswordElement, RadioElement, SelectElement, SemiCircleDonut, Sidebar, SingleCheckbox, SingleSelectElement, SwitchElement, TableElement, TabsElement, TextElement, TextareaElement, Upload };
|
|
143
|
+
export { AddMoreTable, BarChart, ButtonElement, CheckboxElement, CircleDonut, CkEditor, DatePickerElement, DateRangePickerElement, DoubleBarChart, DropDownGroup, FileUpload, HighchartsLineChart, HorizontalBarChart, Image, LineChart, MultipleSelectElement, Navbar, NumberElement, OtpElement, PasswordElement, RadioElement, SelectElement, SemiCircleDonut, Sidebar, SingleCheckbox, SingleSelectElement, SwitchElement, TableElement, TabsElement, TextElement, TextareaElement, Upload };
|
package/dist/index.js
CHANGED
|
@@ -41,6 +41,7 @@ __export(src_exports, {
|
|
|
41
41
|
DoubleBarChart: () => DoubleBarChart,
|
|
42
42
|
DropDownGroup: () => DropDownGroup,
|
|
43
43
|
FileUpload: () => FileUpload,
|
|
44
|
+
HighchartsLineChart: () => highchart_default,
|
|
44
45
|
HorizontalBarChart: () => HorizontalBarChart,
|
|
45
46
|
Image: () => Image,
|
|
46
47
|
LineChart: () => LineChart,
|
|
@@ -385,9 +386,7 @@ var MultipleSelectElement = (props) => {
|
|
|
385
386
|
var import_react11 = __toESM(require("react"));
|
|
386
387
|
var ButtonElement = (props) => {
|
|
387
388
|
const [svgContent, setSvgContent] = (0, import_react11.useState)(null);
|
|
388
|
-
const [originalSvgContent, setOriginalSvgContent] = (0, import_react11.useState)(
|
|
389
|
-
null
|
|
390
|
-
);
|
|
389
|
+
const [originalSvgContent, setOriginalSvgContent] = (0, import_react11.useState)(null);
|
|
391
390
|
const [hoverColor, setHoverColor] = (0, import_react11.useState)(null);
|
|
392
391
|
(0, import_react11.useEffect)(() => {
|
|
393
392
|
if (props.icon) {
|
|
@@ -424,7 +423,7 @@ var ButtonElement = (props) => {
|
|
|
424
423
|
}
|
|
425
424
|
}).catch((error) => console.error("Error fetching SVG:", error));
|
|
426
425
|
}
|
|
427
|
-
}, []);
|
|
426
|
+
}, [props.icon, props.className]);
|
|
428
427
|
const handleMouseEnter = () => {
|
|
429
428
|
if (hoverColor && originalSvgContent) {
|
|
430
429
|
const tempDiv = document.createElement("div");
|
|
@@ -452,14 +451,12 @@ var ButtonElement = (props) => {
|
|
|
452
451
|
cursor: props.loading ? "no-drop" : "pointer"
|
|
453
452
|
}
|
|
454
453
|
},
|
|
455
|
-
props.isLoading ? /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, /* @__PURE__ */ import_react11.default.createElement("svg", { className: "animate-spin h-5 w-5 mr-3", viewBox: "0 0 24 24" }), props.label) : /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, props.isSVGStylesOverride === false ? props.icon && /* @__PURE__ */ import_react11.default.createElement(
|
|
456
|
-
"
|
|
454
|
+
props.isLoading ? /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, /* @__PURE__ */ import_react11.default.createElement("svg", { className: "animate-spin h-5 w-5 mr-3", viewBox: "0 0 24 24" }), props.label) : /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, props.isSVGStylesOverride === false ? props.icon && /* @__PURE__ */ import_react11.default.createElement("img", { className: props.iconsClassName, src: props.icon, alt: props.label }) : svgContent && /* @__PURE__ */ import_react11.default.createElement(
|
|
455
|
+
"span",
|
|
457
456
|
{
|
|
458
|
-
|
|
459
|
-
src: props.icon,
|
|
460
|
-
alt: props.label
|
|
457
|
+
dangerouslySetInnerHTML: { __html: svgContent }
|
|
461
458
|
}
|
|
462
|
-
)
|
|
459
|
+
), props.label)
|
|
463
460
|
);
|
|
464
461
|
};
|
|
465
462
|
|
|
@@ -723,22 +720,9 @@ var ModelElement = (props) => {
|
|
|
723
720
|
margin: "-10px"
|
|
724
721
|
}
|
|
725
722
|
},
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
"span",
|
|
730
|
-
{
|
|
731
|
-
style: {
|
|
732
|
-
fontWeight: "200",
|
|
733
|
-
color: "gray",
|
|
734
|
-
paddingRight: "10px"
|
|
735
|
-
}
|
|
736
|
-
},
|
|
737
|
-
eachColumn.title
|
|
738
|
-
), selectedRecord[eachColumn.key] !== "" ? selectedRecord[eachColumn.key] : "--");
|
|
739
|
-
} else {
|
|
740
|
-
return null;
|
|
741
|
-
}
|
|
723
|
+
Object.entries(selectedRecord).map(([key, value]) => {
|
|
724
|
+
const record = columns.filter((eachColumn) => eachColumn.key === key);
|
|
725
|
+
return record.length > 0 ? /* @__PURE__ */ import_react19.default.createElement("p", { style: { fontWeight: "500", padding: "10px" }, key }, /* @__PURE__ */ import_react19.default.createElement("span", { style: { fontWeight: "200", color: "gray", paddingRight: "10px" } }, record[0].title), String(value)) : "";
|
|
742
726
|
})
|
|
743
727
|
)
|
|
744
728
|
},
|
|
@@ -747,24 +731,12 @@ var ModelElement = (props) => {
|
|
|
747
731
|
};
|
|
748
732
|
|
|
749
733
|
// src/Components/TableElement.tsx
|
|
750
|
-
var import_icons4 = require("@ant-design/icons");
|
|
751
734
|
var TableElement = (props) => {
|
|
752
735
|
const { thead, tbody } = props;
|
|
753
736
|
const [selectedRecord, setSelectedRecord] = (0, import_react20.useState)({});
|
|
754
737
|
const [model, setModel] = (0, import_react20.useState)(false);
|
|
755
|
-
const [dataSource, setDataSource] = (0, import_react20.useState)([]);
|
|
756
|
-
(0, import_react20.useEffect)(() => {
|
|
757
|
-
if (tbody) {
|
|
758
|
-
setDataSource(
|
|
759
|
-
tbody.map((row, index) => ({
|
|
760
|
-
...row,
|
|
761
|
-
key: index,
|
|
762
|
-
index: index + 1
|
|
763
|
-
}))
|
|
764
|
-
);
|
|
765
|
-
}
|
|
766
|
-
}, [tbody]);
|
|
767
738
|
const handleChange = (record) => {
|
|
739
|
+
console.log("record", record);
|
|
768
740
|
if (props.onChange) {
|
|
769
741
|
props.onChange(record);
|
|
770
742
|
}
|
|
@@ -774,8 +746,8 @@ var TableElement = (props) => {
|
|
|
774
746
|
columns = [
|
|
775
747
|
{
|
|
776
748
|
title: "#",
|
|
777
|
-
dataIndex: "
|
|
778
|
-
key: "
|
|
749
|
+
dataIndex: "#",
|
|
750
|
+
key: "#",
|
|
779
751
|
fixed: "left"
|
|
780
752
|
},
|
|
781
753
|
...thead.map((col, ind) => ({
|
|
@@ -786,9 +758,9 @@ var TableElement = (props) => {
|
|
|
786
758
|
render: col.render,
|
|
787
759
|
sorter: {
|
|
788
760
|
compare: (a, b) => {
|
|
789
|
-
if (typeof a[col.key] === "number" && typeof
|
|
761
|
+
if (typeof a[col.key] === "number" && typeof a[col.key] === "number") {
|
|
790
762
|
return a[col.key] - b[col.key];
|
|
791
|
-
} else if (typeof a[col.key] === "string" && typeof
|
|
763
|
+
} else if (typeof a[col.key] === "string" && typeof a[col.key] === "string") {
|
|
792
764
|
return a[col.key].localeCompare(b[col.key]);
|
|
793
765
|
}
|
|
794
766
|
}
|
|
@@ -800,34 +772,26 @@ var TableElement = (props) => {
|
|
|
800
772
|
title: "View",
|
|
801
773
|
dataIndex: "View",
|
|
802
774
|
key: "View",
|
|
803
|
-
render: (_, record) =>
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
{
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
},
|
|
815
|
-
/* @__PURE__ */ import_react20.default.createElement(import_icons4.EyeOutlined, null)
|
|
816
|
-
);
|
|
817
|
-
}
|
|
775
|
+
render: (_, record) => /* @__PURE__ */ import_react20.default.createElement(
|
|
776
|
+
"a",
|
|
777
|
+
{
|
|
778
|
+
onClick: () => {
|
|
779
|
+
setSelectedRecord(record);
|
|
780
|
+
handleChange(record);
|
|
781
|
+
setModel(true);
|
|
782
|
+
}
|
|
783
|
+
},
|
|
784
|
+
"View"
|
|
785
|
+
)
|
|
818
786
|
});
|
|
819
787
|
}
|
|
820
788
|
}
|
|
821
|
-
const
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
}))
|
|
828
|
-
);
|
|
829
|
-
}
|
|
830
|
-
};
|
|
789
|
+
const dataSource = tbody && tbody.map((row, index) => ({
|
|
790
|
+
...row,
|
|
791
|
+
key: index + 1,
|
|
792
|
+
[columns[0].key]: index + 1
|
|
793
|
+
}));
|
|
794
|
+
const count = dataSource ? dataSource.length : 0;
|
|
831
795
|
const onChangePage = (page, pageSize) => {
|
|
832
796
|
if (props.onChange) {
|
|
833
797
|
props.onChange({ name: "pagination", page, pageSize });
|
|
@@ -835,11 +799,7 @@ var TableElement = (props) => {
|
|
|
835
799
|
};
|
|
836
800
|
const rowSelectionConfig = props.rowSelection ? {
|
|
837
801
|
onChange: (selectedRowKeys, selectedRows) => {
|
|
838
|
-
console.log(
|
|
839
|
-
`selectedRowKeys: ${selectedRowKeys}`,
|
|
840
|
-
"selectedRows: ",
|
|
841
|
-
selectedRows
|
|
842
|
-
);
|
|
802
|
+
console.log(`selectedRowKeys: ${selectedRowKeys}`, "selectedRows: ", selectedRows);
|
|
843
803
|
if (props.onChange) {
|
|
844
804
|
props.onChange(selectedRows);
|
|
845
805
|
}
|
|
@@ -849,41 +809,19 @@ var TableElement = (props) => {
|
|
|
849
809
|
import_antd14.Table,
|
|
850
810
|
{
|
|
851
811
|
className: props.className,
|
|
852
|
-
pagination:
|
|
812
|
+
pagination: {
|
|
853
813
|
showTotal: (total) => `Total: ${total} items`,
|
|
854
|
-
total:
|
|
855
|
-
showSizeChanger:
|
|
814
|
+
total: count,
|
|
815
|
+
showSizeChanger: count > 10,
|
|
856
816
|
onChange: onChangePage
|
|
857
|
-
} : false,
|
|
858
|
-
onRow: (record) => {
|
|
859
|
-
return {
|
|
860
|
-
onClick: () => {
|
|
861
|
-
if (props.view) {
|
|
862
|
-
setSelectedRecord(record);
|
|
863
|
-
handleChange(record);
|
|
864
|
-
setModel(true);
|
|
865
|
-
}
|
|
866
|
-
},
|
|
867
|
-
style: { cursor: "pointer" }
|
|
868
|
-
};
|
|
869
817
|
},
|
|
870
818
|
rowSelection: rowSelectionConfig,
|
|
871
819
|
dataSource,
|
|
872
820
|
columns,
|
|
873
821
|
size: props.size,
|
|
874
|
-
bordered: true
|
|
875
|
-
onChange: onChangeTable
|
|
876
|
-
}
|
|
877
|
-
), model && /* @__PURE__ */ import_react20.default.createElement(
|
|
878
|
-
ModelElement,
|
|
879
|
-
{
|
|
880
|
-
selectedRecord,
|
|
881
|
-
...props,
|
|
882
|
-
columns,
|
|
883
|
-
model,
|
|
884
|
-
onCancel: () => setModel(false)
|
|
822
|
+
bordered: true
|
|
885
823
|
}
|
|
886
|
-
));
|
|
824
|
+
), model && /* @__PURE__ */ import_react20.default.createElement(ModelElement, { selectedRecord, ...props, columns, model, onCancel: () => setModel(false) }));
|
|
887
825
|
};
|
|
888
826
|
|
|
889
827
|
// src/Components/DatePicker.tsx
|
|
@@ -1017,7 +955,7 @@ var DropDownGroup = (props) => {
|
|
|
1017
955
|
// src/Components/FilesUpload.tsx
|
|
1018
956
|
var import_react26 = __toESM(require("react"));
|
|
1019
957
|
var import_antd19 = require("antd");
|
|
1020
|
-
var
|
|
958
|
+
var import_icons4 = require("@ant-design/icons");
|
|
1021
959
|
var FileUpload = (props) => {
|
|
1022
960
|
const { Dragger } = import_antd19.Upload;
|
|
1023
961
|
const [files, setFiles] = (0, import_react26.useState)([]);
|
|
@@ -1048,7 +986,7 @@ var FileUpload = (props) => {
|
|
|
1048
986
|
showUploadList: true,
|
|
1049
987
|
customRequest
|
|
1050
988
|
},
|
|
1051
|
-
/* @__PURE__ */ import_react26.default.createElement("p", null, /* @__PURE__ */ import_react26.default.createElement(
|
|
989
|
+
/* @__PURE__ */ import_react26.default.createElement("p", null, /* @__PURE__ */ import_react26.default.createElement(import_icons4.InboxOutlined, null)),
|
|
1052
990
|
/* @__PURE__ */ import_react26.default.createElement("p", null, "Click or drag file to upload")
|
|
1053
991
|
));
|
|
1054
992
|
};
|
|
@@ -1445,13 +1383,25 @@ var LineChart = (props) => {
|
|
|
1445
1383
|
return /* @__PURE__ */ import_react34.default.createElement("div", { className: props.className }, /* @__PURE__ */ import_react34.default.createElement("canvas", { ref: chartRef }));
|
|
1446
1384
|
};
|
|
1447
1385
|
|
|
1448
|
-
// src/Components/
|
|
1386
|
+
// src/Components/highchart.tsx
|
|
1449
1387
|
var import_react35 = __toESM(require("react"));
|
|
1388
|
+
var import_highcharts = __toESM(require("highcharts"));
|
|
1389
|
+
var import_highcharts_react_official = __toESM(require("highcharts-react-official"));
|
|
1390
|
+
var HighchartsLineChart = class extends import_react35.default.Component {
|
|
1391
|
+
render() {
|
|
1392
|
+
let { className, graph_data } = this.props;
|
|
1393
|
+
return /* @__PURE__ */ import_react35.default.createElement("div", { className }, /* @__PURE__ */ import_react35.default.createElement(import_highcharts_react_official.default, { highcharts: import_highcharts.default, options: graph_data }));
|
|
1394
|
+
}
|
|
1395
|
+
};
|
|
1396
|
+
var highchart_default = HighchartsLineChart;
|
|
1397
|
+
|
|
1398
|
+
// src/Components/DoubleBarChart.tsx
|
|
1399
|
+
var import_react36 = __toESM(require("react"));
|
|
1450
1400
|
var import_auto2 = __toESM(require("chart.js/auto"));
|
|
1451
1401
|
var DoubleBarChart = (props) => {
|
|
1452
|
-
const chartRef = (0,
|
|
1453
|
-
const chartInstance = (0,
|
|
1454
|
-
(0,
|
|
1402
|
+
const chartRef = (0, import_react36.useRef)(null);
|
|
1403
|
+
const chartInstance = (0, import_react36.useRef)(null);
|
|
1404
|
+
(0, import_react36.useEffect)(() => {
|
|
1455
1405
|
if (chartRef.current) {
|
|
1456
1406
|
if (chartInstance.current) {
|
|
1457
1407
|
chartInstance.current.destroy();
|
|
@@ -1520,11 +1470,11 @@ var DoubleBarChart = (props) => {
|
|
|
1520
1470
|
}
|
|
1521
1471
|
};
|
|
1522
1472
|
}, []);
|
|
1523
|
-
return /* @__PURE__ */
|
|
1473
|
+
return /* @__PURE__ */ import_react36.default.createElement("div", { className: props.className }, /* @__PURE__ */ import_react36.default.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ import_react36.default.createElement("canvas", { ref: chartRef }));
|
|
1524
1474
|
};
|
|
1525
1475
|
|
|
1526
1476
|
// src/Components/BarChart.tsx
|
|
1527
|
-
var
|
|
1477
|
+
var import_react37 = __toESM(require("react"));
|
|
1528
1478
|
var import_react_chartjs_24 = require("react-chartjs-2");
|
|
1529
1479
|
var import_chart4 = require("chart.js");
|
|
1530
1480
|
import_chart4.Chart.register(import_chart4.BarElement, import_chart4.CategoryScale, import_chart4.LinearScale, import_chart4.Tooltip);
|
|
@@ -1586,7 +1536,7 @@ var BarChart = (props) => {
|
|
|
1586
1536
|
}
|
|
1587
1537
|
}
|
|
1588
1538
|
};
|
|
1589
|
-
return /* @__PURE__ */
|
|
1539
|
+
return /* @__PURE__ */ import_react37.default.createElement("div", { className: props.className }, /* @__PURE__ */ import_react37.default.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ import_react37.default.createElement(import_react_chartjs_24.Bar, { data, options }));
|
|
1590
1540
|
};
|
|
1591
1541
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1592
1542
|
0 && (module.exports = {
|
|
@@ -1601,6 +1551,7 @@ var BarChart = (props) => {
|
|
|
1601
1551
|
DoubleBarChart,
|
|
1602
1552
|
DropDownGroup,
|
|
1603
1553
|
FileUpload,
|
|
1554
|
+
HighchartsLineChart,
|
|
1604
1555
|
HorizontalBarChart,
|
|
1605
1556
|
Image,
|
|
1606
1557
|
LineChart,
|
package/dist/index.mjs
CHANGED
|
@@ -319,9 +319,7 @@ var MultipleSelectElement = (props) => {
|
|
|
319
319
|
import React11, { useEffect, useState as useState4 } from "react";
|
|
320
320
|
var ButtonElement = (props) => {
|
|
321
321
|
const [svgContent, setSvgContent] = useState4(null);
|
|
322
|
-
const [originalSvgContent, setOriginalSvgContent] = useState4(
|
|
323
|
-
null
|
|
324
|
-
);
|
|
322
|
+
const [originalSvgContent, setOriginalSvgContent] = useState4(null);
|
|
325
323
|
const [hoverColor, setHoverColor] = useState4(null);
|
|
326
324
|
useEffect(() => {
|
|
327
325
|
if (props.icon) {
|
|
@@ -358,7 +356,7 @@ var ButtonElement = (props) => {
|
|
|
358
356
|
}
|
|
359
357
|
}).catch((error) => console.error("Error fetching SVG:", error));
|
|
360
358
|
}
|
|
361
|
-
}, []);
|
|
359
|
+
}, [props.icon, props.className]);
|
|
362
360
|
const handleMouseEnter = () => {
|
|
363
361
|
if (hoverColor && originalSvgContent) {
|
|
364
362
|
const tempDiv = document.createElement("div");
|
|
@@ -386,14 +384,12 @@ var ButtonElement = (props) => {
|
|
|
386
384
|
cursor: props.loading ? "no-drop" : "pointer"
|
|
387
385
|
}
|
|
388
386
|
},
|
|
389
|
-
props.isLoading ? /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement("svg", { className: "animate-spin h-5 w-5 mr-3", viewBox: "0 0 24 24" }), props.label) : /* @__PURE__ */ React11.createElement(React11.Fragment, null, props.isSVGStylesOverride === false ? props.icon && /* @__PURE__ */ React11.createElement(
|
|
390
|
-
"
|
|
387
|
+
props.isLoading ? /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement("svg", { className: "animate-spin h-5 w-5 mr-3", viewBox: "0 0 24 24" }), props.label) : /* @__PURE__ */ React11.createElement(React11.Fragment, null, props.isSVGStylesOverride === false ? props.icon && /* @__PURE__ */ React11.createElement("img", { className: props.iconsClassName, src: props.icon, alt: props.label }) : svgContent && /* @__PURE__ */ React11.createElement(
|
|
388
|
+
"span",
|
|
391
389
|
{
|
|
392
|
-
|
|
393
|
-
src: props.icon,
|
|
394
|
-
alt: props.label
|
|
390
|
+
dangerouslySetInnerHTML: { __html: svgContent }
|
|
395
391
|
}
|
|
396
|
-
)
|
|
392
|
+
), props.label)
|
|
397
393
|
);
|
|
398
394
|
};
|
|
399
395
|
|
|
@@ -612,7 +608,7 @@ var Navbar = (props) => {
|
|
|
612
608
|
};
|
|
613
609
|
|
|
614
610
|
// src/Components/TableElement.tsx
|
|
615
|
-
import React20, { useState as useState6
|
|
611
|
+
import React20, { useState as useState6 } from "react";
|
|
616
612
|
import { Table as Table2 } from "antd";
|
|
617
613
|
|
|
618
614
|
// src/Components/Model.tsx
|
|
@@ -657,22 +653,9 @@ var ModelElement = (props) => {
|
|
|
657
653
|
margin: "-10px"
|
|
658
654
|
}
|
|
659
655
|
},
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
"span",
|
|
664
|
-
{
|
|
665
|
-
style: {
|
|
666
|
-
fontWeight: "200",
|
|
667
|
-
color: "gray",
|
|
668
|
-
paddingRight: "10px"
|
|
669
|
-
}
|
|
670
|
-
},
|
|
671
|
-
eachColumn.title
|
|
672
|
-
), selectedRecord[eachColumn.key] !== "" ? selectedRecord[eachColumn.key] : "--");
|
|
673
|
-
} else {
|
|
674
|
-
return null;
|
|
675
|
-
}
|
|
656
|
+
Object.entries(selectedRecord).map(([key, value]) => {
|
|
657
|
+
const record = columns.filter((eachColumn) => eachColumn.key === key);
|
|
658
|
+
return record.length > 0 ? /* @__PURE__ */ React19.createElement("p", { style: { fontWeight: "500", padding: "10px" }, key }, /* @__PURE__ */ React19.createElement("span", { style: { fontWeight: "200", color: "gray", paddingRight: "10px" } }, record[0].title), String(value)) : "";
|
|
676
659
|
})
|
|
677
660
|
)
|
|
678
661
|
},
|
|
@@ -681,24 +664,12 @@ var ModelElement = (props) => {
|
|
|
681
664
|
};
|
|
682
665
|
|
|
683
666
|
// src/Components/TableElement.tsx
|
|
684
|
-
import { EyeOutlined } from "@ant-design/icons";
|
|
685
667
|
var TableElement = (props) => {
|
|
686
668
|
const { thead, tbody } = props;
|
|
687
669
|
const [selectedRecord, setSelectedRecord] = useState6({});
|
|
688
670
|
const [model, setModel] = useState6(false);
|
|
689
|
-
const [dataSource, setDataSource] = useState6([]);
|
|
690
|
-
useEffect3(() => {
|
|
691
|
-
if (tbody) {
|
|
692
|
-
setDataSource(
|
|
693
|
-
tbody.map((row, index) => ({
|
|
694
|
-
...row,
|
|
695
|
-
key: index,
|
|
696
|
-
index: index + 1
|
|
697
|
-
}))
|
|
698
|
-
);
|
|
699
|
-
}
|
|
700
|
-
}, [tbody]);
|
|
701
671
|
const handleChange = (record) => {
|
|
672
|
+
console.log("record", record);
|
|
702
673
|
if (props.onChange) {
|
|
703
674
|
props.onChange(record);
|
|
704
675
|
}
|
|
@@ -708,8 +679,8 @@ var TableElement = (props) => {
|
|
|
708
679
|
columns = [
|
|
709
680
|
{
|
|
710
681
|
title: "#",
|
|
711
|
-
dataIndex: "
|
|
712
|
-
key: "
|
|
682
|
+
dataIndex: "#",
|
|
683
|
+
key: "#",
|
|
713
684
|
fixed: "left"
|
|
714
685
|
},
|
|
715
686
|
...thead.map((col, ind) => ({
|
|
@@ -720,9 +691,9 @@ var TableElement = (props) => {
|
|
|
720
691
|
render: col.render,
|
|
721
692
|
sorter: {
|
|
722
693
|
compare: (a, b) => {
|
|
723
|
-
if (typeof a[col.key] === "number" && typeof
|
|
694
|
+
if (typeof a[col.key] === "number" && typeof a[col.key] === "number") {
|
|
724
695
|
return a[col.key] - b[col.key];
|
|
725
|
-
} else if (typeof a[col.key] === "string" && typeof
|
|
696
|
+
} else if (typeof a[col.key] === "string" && typeof a[col.key] === "string") {
|
|
726
697
|
return a[col.key].localeCompare(b[col.key]);
|
|
727
698
|
}
|
|
728
699
|
}
|
|
@@ -734,34 +705,26 @@ var TableElement = (props) => {
|
|
|
734
705
|
title: "View",
|
|
735
706
|
dataIndex: "View",
|
|
736
707
|
key: "View",
|
|
737
|
-
render: (_, record) =>
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
{
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
},
|
|
749
|
-
/* @__PURE__ */ React20.createElement(EyeOutlined, null)
|
|
750
|
-
);
|
|
751
|
-
}
|
|
708
|
+
render: (_, record) => /* @__PURE__ */ React20.createElement(
|
|
709
|
+
"a",
|
|
710
|
+
{
|
|
711
|
+
onClick: () => {
|
|
712
|
+
setSelectedRecord(record);
|
|
713
|
+
handleChange(record);
|
|
714
|
+
setModel(true);
|
|
715
|
+
}
|
|
716
|
+
},
|
|
717
|
+
"View"
|
|
718
|
+
)
|
|
752
719
|
});
|
|
753
720
|
}
|
|
754
721
|
}
|
|
755
|
-
const
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
}))
|
|
762
|
-
);
|
|
763
|
-
}
|
|
764
|
-
};
|
|
722
|
+
const dataSource = tbody && tbody.map((row, index) => ({
|
|
723
|
+
...row,
|
|
724
|
+
key: index + 1,
|
|
725
|
+
[columns[0].key]: index + 1
|
|
726
|
+
}));
|
|
727
|
+
const count = dataSource ? dataSource.length : 0;
|
|
765
728
|
const onChangePage = (page, pageSize) => {
|
|
766
729
|
if (props.onChange) {
|
|
767
730
|
props.onChange({ name: "pagination", page, pageSize });
|
|
@@ -769,11 +732,7 @@ var TableElement = (props) => {
|
|
|
769
732
|
};
|
|
770
733
|
const rowSelectionConfig = props.rowSelection ? {
|
|
771
734
|
onChange: (selectedRowKeys, selectedRows) => {
|
|
772
|
-
console.log(
|
|
773
|
-
`selectedRowKeys: ${selectedRowKeys}`,
|
|
774
|
-
"selectedRows: ",
|
|
775
|
-
selectedRows
|
|
776
|
-
);
|
|
735
|
+
console.log(`selectedRowKeys: ${selectedRowKeys}`, "selectedRows: ", selectedRows);
|
|
777
736
|
if (props.onChange) {
|
|
778
737
|
props.onChange(selectedRows);
|
|
779
738
|
}
|
|
@@ -783,41 +742,19 @@ var TableElement = (props) => {
|
|
|
783
742
|
Table2,
|
|
784
743
|
{
|
|
785
744
|
className: props.className,
|
|
786
|
-
pagination:
|
|
745
|
+
pagination: {
|
|
787
746
|
showTotal: (total) => `Total: ${total} items`,
|
|
788
|
-
total:
|
|
789
|
-
showSizeChanger:
|
|
747
|
+
total: count,
|
|
748
|
+
showSizeChanger: count > 10,
|
|
790
749
|
onChange: onChangePage
|
|
791
|
-
} : false,
|
|
792
|
-
onRow: (record) => {
|
|
793
|
-
return {
|
|
794
|
-
onClick: () => {
|
|
795
|
-
if (props.view) {
|
|
796
|
-
setSelectedRecord(record);
|
|
797
|
-
handleChange(record);
|
|
798
|
-
setModel(true);
|
|
799
|
-
}
|
|
800
|
-
},
|
|
801
|
-
style: { cursor: "pointer" }
|
|
802
|
-
};
|
|
803
750
|
},
|
|
804
751
|
rowSelection: rowSelectionConfig,
|
|
805
752
|
dataSource,
|
|
806
753
|
columns,
|
|
807
754
|
size: props.size,
|
|
808
|
-
bordered: true
|
|
809
|
-
onChange: onChangeTable
|
|
810
|
-
}
|
|
811
|
-
), model && /* @__PURE__ */ React20.createElement(
|
|
812
|
-
ModelElement,
|
|
813
|
-
{
|
|
814
|
-
selectedRecord,
|
|
815
|
-
...props,
|
|
816
|
-
columns,
|
|
817
|
-
model,
|
|
818
|
-
onCancel: () => setModel(false)
|
|
755
|
+
bordered: true
|
|
819
756
|
}
|
|
820
|
-
));
|
|
757
|
+
), model && /* @__PURE__ */ React20.createElement(ModelElement, { selectedRecord, ...props, columns, model, onCancel: () => setModel(false) }));
|
|
821
758
|
};
|
|
822
759
|
|
|
823
760
|
// src/Components/DatePicker.tsx
|
|
@@ -1036,7 +973,7 @@ var Upload2 = (props) => {
|
|
|
1036
973
|
};
|
|
1037
974
|
|
|
1038
975
|
// src/Components/OtpElement.tsx
|
|
1039
|
-
import React30, { useState as useState11, useRef, useEffect as
|
|
976
|
+
import React30, { useState as useState11, useRef, useEffect as useEffect3 } from "react";
|
|
1040
977
|
import { Input as Input3 } from "antd";
|
|
1041
978
|
var OtpElement = (props) => {
|
|
1042
979
|
const length = props.length;
|
|
@@ -1073,7 +1010,7 @@ var OtpElement = (props) => {
|
|
|
1073
1010
|
});
|
|
1074
1011
|
}
|
|
1075
1012
|
};
|
|
1076
|
-
|
|
1013
|
+
useEffect3(() => {
|
|
1077
1014
|
inputRefs.current[0]?.focus();
|
|
1078
1015
|
}, []);
|
|
1079
1016
|
return /* @__PURE__ */ React30.createElement("div", { className: props.containerClassName }, Array.from({ length }).map((_, index) => /* @__PURE__ */ React30.createElement(
|
|
@@ -1325,7 +1262,7 @@ var HorizontalBarChart = (props) => {
|
|
|
1325
1262
|
};
|
|
1326
1263
|
|
|
1327
1264
|
// src/Components/LineChart.tsx
|
|
1328
|
-
import React34, { useEffect as
|
|
1265
|
+
import React34, { useEffect as useEffect4, useRef as useRef2 } from "react";
|
|
1329
1266
|
import Chart from "chart.js/auto";
|
|
1330
1267
|
var LineChart = (props) => {
|
|
1331
1268
|
const chartRef = useRef2(null);
|
|
@@ -1336,7 +1273,7 @@ var LineChart = (props) => {
|
|
|
1336
1273
|
{ label: "Conversion Rate", data: [50, 100, 150, 180, 50] }
|
|
1337
1274
|
];
|
|
1338
1275
|
const labels = ["Instagram", "Whatsapp", "Messages", "Telegram", "Linkedin"];
|
|
1339
|
-
|
|
1276
|
+
useEffect4(() => {
|
|
1340
1277
|
if (chartRef.current) {
|
|
1341
1278
|
if (chartInstance.current) {
|
|
1342
1279
|
chartInstance.current.destroy();
|
|
@@ -1397,13 +1334,25 @@ var LineChart = (props) => {
|
|
|
1397
1334
|
return /* @__PURE__ */ React34.createElement("div", { className: props.className }, /* @__PURE__ */ React34.createElement("canvas", { ref: chartRef }));
|
|
1398
1335
|
};
|
|
1399
1336
|
|
|
1337
|
+
// src/Components/highchart.tsx
|
|
1338
|
+
import React35 from "react";
|
|
1339
|
+
import Highcharts from "highcharts";
|
|
1340
|
+
import HighchartsReact from "highcharts-react-official";
|
|
1341
|
+
var HighchartsLineChart = class extends React35.Component {
|
|
1342
|
+
render() {
|
|
1343
|
+
let { className, graph_data } = this.props;
|
|
1344
|
+
return /* @__PURE__ */ React35.createElement("div", { className }, /* @__PURE__ */ React35.createElement(HighchartsReact, { highcharts: Highcharts, options: graph_data }));
|
|
1345
|
+
}
|
|
1346
|
+
};
|
|
1347
|
+
var highchart_default = HighchartsLineChart;
|
|
1348
|
+
|
|
1400
1349
|
// src/Components/DoubleBarChart.tsx
|
|
1401
|
-
import
|
|
1350
|
+
import React36, { useEffect as useEffect5, useRef as useRef3 } from "react";
|
|
1402
1351
|
import Chart2 from "chart.js/auto";
|
|
1403
1352
|
var DoubleBarChart = (props) => {
|
|
1404
1353
|
const chartRef = useRef3(null);
|
|
1405
1354
|
const chartInstance = useRef3(null);
|
|
1406
|
-
|
|
1355
|
+
useEffect5(() => {
|
|
1407
1356
|
if (chartRef.current) {
|
|
1408
1357
|
if (chartInstance.current) {
|
|
1409
1358
|
chartInstance.current.destroy();
|
|
@@ -1472,11 +1421,11 @@ var DoubleBarChart = (props) => {
|
|
|
1472
1421
|
}
|
|
1473
1422
|
};
|
|
1474
1423
|
}, []);
|
|
1475
|
-
return /* @__PURE__ */
|
|
1424
|
+
return /* @__PURE__ */ React36.createElement("div", { className: props.className }, /* @__PURE__ */ React36.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ React36.createElement("canvas", { ref: chartRef }));
|
|
1476
1425
|
};
|
|
1477
1426
|
|
|
1478
1427
|
// src/Components/BarChart.tsx
|
|
1479
|
-
import
|
|
1428
|
+
import React37 from "react";
|
|
1480
1429
|
import { Bar as Bar2 } from "react-chartjs-2";
|
|
1481
1430
|
import {
|
|
1482
1431
|
Chart as ChartJS4,
|
|
@@ -1544,7 +1493,7 @@ var BarChart = (props) => {
|
|
|
1544
1493
|
}
|
|
1545
1494
|
}
|
|
1546
1495
|
};
|
|
1547
|
-
return /* @__PURE__ */
|
|
1496
|
+
return /* @__PURE__ */ React37.createElement("div", { className: props.className }, /* @__PURE__ */ React37.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ React37.createElement(Bar2, { data, options }));
|
|
1548
1497
|
};
|
|
1549
1498
|
export {
|
|
1550
1499
|
AddMoreTable,
|
|
@@ -1558,6 +1507,7 @@ export {
|
|
|
1558
1507
|
DoubleBarChart,
|
|
1559
1508
|
DropDownGroup,
|
|
1560
1509
|
FileUpload,
|
|
1510
|
+
highchart_default as HighchartsLineChart,
|
|
1561
1511
|
HorizontalBarChart,
|
|
1562
1512
|
Image,
|
|
1563
1513
|
LineChart,
|
package/package.json
CHANGED
package/postcss.config.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
plugins: {
|
|
3
|
-
tailwindcss: {},
|
|
4
|
-
autoprefixer: {},
|
|
5
|
-
},
|
|
6
|
-
}
|
|
1
|
+
module.exports = {
|
|
2
|
+
plugins: {
|
|
3
|
+
tailwindcss: {},
|
|
4
|
+
autoprefixer: {},
|
|
5
|
+
},
|
|
6
|
+
}
|
package/tailwind.config.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/** @type {import('tailwindcss').Config} */
|
|
2
|
-
module.exports = {
|
|
3
|
-
|
|
4
|
-
content: ['./src/**/*.{js,jsx,ts,tsx}'],
|
|
5
|
-
theme: {
|
|
6
|
-
extend: {},
|
|
7
|
-
},
|
|
8
|
-
plugins: [],
|
|
9
|
-
}
|
|
10
|
-
|
|
1
|
+
/** @type {import('tailwindcss').Config} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
|
|
4
|
+
content: ['./src/**/*.{js,jsx,ts,tsx}'],
|
|
5
|
+
theme: {
|
|
6
|
+
extend: {},
|
|
7
|
+
},
|
|
8
|
+
plugins: [],
|
|
9
|
+
}
|
|
10
|
+
|