@apexcura/ui-components 0.0.14-Beta185 → 0.0.14-Beta186
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 +3 -4
- package/dist/index.d.ts +3 -4
- package/dist/index.js +196 -169
- package/dist/index.mjs +196 -170
- 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,9 +69,6 @@ type ElementType = {
|
|
|
69
69
|
fillText2?: string;
|
|
70
70
|
labels?: any[];
|
|
71
71
|
data?: any[];
|
|
72
|
-
pagination?: boolean;
|
|
73
|
-
is_detail?: boolean;
|
|
74
|
-
dateTime?: string;
|
|
75
72
|
};
|
|
76
73
|
|
|
77
74
|
declare const TextElement: (props: ElementType) => React$1.JSX.Element;
|
|
@@ -135,8 +132,10 @@ declare const HorizontalBarChart: (props: ElementType) => React$1.JSX.Element;
|
|
|
135
132
|
|
|
136
133
|
declare const LineChart: (props: ElementType) => React$1.JSX.Element;
|
|
137
134
|
|
|
135
|
+
declare const HighchartsLineChart: (props: any) => React$1.JSX.Element;
|
|
136
|
+
|
|
138
137
|
declare const DoubleBarChart: (props: ElementType) => React$1.JSX.Element;
|
|
139
138
|
|
|
140
139
|
declare const BarChart: (props: ElementType) => React$1.JSX.Element;
|
|
141
140
|
|
|
142
|
-
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 };
|
|
141
|
+
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,9 +69,6 @@ type ElementType = {
|
|
|
69
69
|
fillText2?: string;
|
|
70
70
|
labels?: any[];
|
|
71
71
|
data?: any[];
|
|
72
|
-
pagination?: boolean;
|
|
73
|
-
is_detail?: boolean;
|
|
74
|
-
dateTime?: string;
|
|
75
72
|
};
|
|
76
73
|
|
|
77
74
|
declare const TextElement: (props: ElementType) => React$1.JSX.Element;
|
|
@@ -135,8 +132,10 @@ declare const HorizontalBarChart: (props: ElementType) => React$1.JSX.Element;
|
|
|
135
132
|
|
|
136
133
|
declare const LineChart: (props: ElementType) => React$1.JSX.Element;
|
|
137
134
|
|
|
135
|
+
declare const HighchartsLineChart: (props: any) => React$1.JSX.Element;
|
|
136
|
+
|
|
138
137
|
declare const DoubleBarChart: (props: ElementType) => React$1.JSX.Element;
|
|
139
138
|
|
|
140
139
|
declare const BarChart: (props: ElementType) => React$1.JSX.Element;
|
|
141
140
|
|
|
142
|
-
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 };
|
|
141
|
+
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: () => HighchartsLineChart,
|
|
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
|
|
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
|
|
|
@@ -687,48 +684,18 @@ var import_antd13 = require("antd");
|
|
|
687
684
|
|
|
688
685
|
// src/Components/ModelBody.tsx
|
|
689
686
|
var import_react18 = __toESM(require("react"));
|
|
690
|
-
var import_moment = __toESM(require("moment"));
|
|
691
687
|
var ModelBody = (props) => {
|
|
692
|
-
return /* @__PURE__ */ import_react18.default.createElement("div", { className: props.modalContent && props.modalContent.className }, props.modalContent && props.modalContent.fields.map(
|
|
693
|
-
(eachField)
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
}
|
|
702
|
-
},
|
|
703
|
-
(0, import_moment.default)(eachField.dateTime).format("LT")
|
|
704
|
-
) : "");
|
|
705
|
-
} else if (eachField.element === "input-radio") {
|
|
706
|
-
return /* @__PURE__ */ import_react18.default.createElement("div", { className: eachField.className }, /* @__PURE__ */ import_react18.default.createElement(RadioElement, { ...eachField }), eachField.dateTime ? /* @__PURE__ */ import_react18.default.createElement(
|
|
707
|
-
"p",
|
|
708
|
-
{
|
|
709
|
-
style: {
|
|
710
|
-
fontSize: "10px",
|
|
711
|
-
textAlign: eachField.source === "bot" ? "left" : "right"
|
|
712
|
-
}
|
|
713
|
-
},
|
|
714
|
-
(0, import_moment.default)(eachField.dateTime).format("LT")
|
|
715
|
-
) : "");
|
|
716
|
-
} else if (eachField.element === "button") {
|
|
717
|
-
return /* @__PURE__ */ import_react18.default.createElement("div", { className: eachField.className }, /* @__PURE__ */ import_react18.default.createElement(ButtonElement, { ...eachField }), eachField.dateTime ? /* @__PURE__ */ import_react18.default.createElement(
|
|
718
|
-
"p",
|
|
719
|
-
{
|
|
720
|
-
style: {
|
|
721
|
-
fontSize: "10px",
|
|
722
|
-
textAlign: eachField.source === "bot" ? "left" : "right"
|
|
723
|
-
}
|
|
724
|
-
},
|
|
725
|
-
(0, import_moment.default)(eachField.dateTime).format("LT")
|
|
726
|
-
) : "");
|
|
727
|
-
} else {
|
|
728
|
-
return null;
|
|
729
|
-
}
|
|
688
|
+
return /* @__PURE__ */ import_react18.default.createElement("div", { className: props.modalContent && props.modalContent.className }, props.modalContent && props.modalContent.fields.map((eachField) => {
|
|
689
|
+
if (eachField.element === "div") {
|
|
690
|
+
return /* @__PURE__ */ import_react18.default.createElement("div", { className: eachField.className }, eachField.label);
|
|
691
|
+
} else if (eachField.element === "input-radio") {
|
|
692
|
+
return /* @__PURE__ */ import_react18.default.createElement("div", { className: eachField.className }, /* @__PURE__ */ import_react18.default.createElement(RadioElement, { ...eachField }));
|
|
693
|
+
} else if (eachField.element === "button") {
|
|
694
|
+
return /* @__PURE__ */ import_react18.default.createElement("div", { className: eachField.className }, /* @__PURE__ */ import_react18.default.createElement(ButtonElement, { ...eachField }));
|
|
695
|
+
} else {
|
|
696
|
+
return null;
|
|
730
697
|
}
|
|
731
|
-
));
|
|
698
|
+
}));
|
|
732
699
|
};
|
|
733
700
|
|
|
734
701
|
// src/Components/Model.tsx
|
|
@@ -753,22 +720,9 @@ var ModelElement = (props) => {
|
|
|
753
720
|
margin: "-10px"
|
|
754
721
|
}
|
|
755
722
|
},
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
"span",
|
|
760
|
-
{
|
|
761
|
-
style: {
|
|
762
|
-
fontWeight: "200",
|
|
763
|
-
color: "gray",
|
|
764
|
-
paddingRight: "10px"
|
|
765
|
-
}
|
|
766
|
-
},
|
|
767
|
-
eachColumn.title
|
|
768
|
-
), selectedRecord[eachColumn.key] !== "" ? selectedRecord[eachColumn.key] : "--");
|
|
769
|
-
} else {
|
|
770
|
-
return null;
|
|
771
|
-
}
|
|
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)) : "";
|
|
772
726
|
})
|
|
773
727
|
)
|
|
774
728
|
},
|
|
@@ -777,24 +731,12 @@ var ModelElement = (props) => {
|
|
|
777
731
|
};
|
|
778
732
|
|
|
779
733
|
// src/Components/TableElement.tsx
|
|
780
|
-
var import_icons4 = require("@ant-design/icons");
|
|
781
734
|
var TableElement = (props) => {
|
|
782
735
|
const { thead, tbody } = props;
|
|
783
736
|
const [selectedRecord, setSelectedRecord] = (0, import_react20.useState)({});
|
|
784
737
|
const [model, setModel] = (0, import_react20.useState)(false);
|
|
785
|
-
const [dataSource, setDataSource] = (0, import_react20.useState)([]);
|
|
786
|
-
(0, import_react20.useEffect)(() => {
|
|
787
|
-
if (tbody) {
|
|
788
|
-
setDataSource(
|
|
789
|
-
tbody.map((row, index) => ({
|
|
790
|
-
...row,
|
|
791
|
-
key: index,
|
|
792
|
-
index: index + 1
|
|
793
|
-
}))
|
|
794
|
-
);
|
|
795
|
-
}
|
|
796
|
-
}, [tbody]);
|
|
797
738
|
const handleChange = (record) => {
|
|
739
|
+
console.log("record", record);
|
|
798
740
|
if (props.onChange) {
|
|
799
741
|
props.onChange(record);
|
|
800
742
|
}
|
|
@@ -804,8 +746,8 @@ var TableElement = (props) => {
|
|
|
804
746
|
columns = [
|
|
805
747
|
{
|
|
806
748
|
title: "#",
|
|
807
|
-
dataIndex: "
|
|
808
|
-
key: "
|
|
749
|
+
dataIndex: "#",
|
|
750
|
+
key: "#",
|
|
809
751
|
fixed: "left"
|
|
810
752
|
},
|
|
811
753
|
...thead.map((col, ind) => ({
|
|
@@ -816,9 +758,9 @@ var TableElement = (props) => {
|
|
|
816
758
|
render: col.render,
|
|
817
759
|
sorter: {
|
|
818
760
|
compare: (a, b) => {
|
|
819
|
-
if (typeof a[col.key] === "number" && typeof
|
|
761
|
+
if (typeof a[col.key] === "number" && typeof a[col.key] === "number") {
|
|
820
762
|
return a[col.key] - b[col.key];
|
|
821
|
-
} else if (typeof a[col.key] === "string" && typeof
|
|
763
|
+
} else if (typeof a[col.key] === "string" && typeof a[col.key] === "string") {
|
|
822
764
|
return a[col.key].localeCompare(b[col.key]);
|
|
823
765
|
}
|
|
824
766
|
}
|
|
@@ -830,34 +772,26 @@ var TableElement = (props) => {
|
|
|
830
772
|
title: "View",
|
|
831
773
|
dataIndex: "View",
|
|
832
774
|
key: "View",
|
|
833
|
-
render: (_, record) =>
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
{
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
},
|
|
845
|
-
/* @__PURE__ */ import_react20.default.createElement(import_icons4.EyeOutlined, null)
|
|
846
|
-
);
|
|
847
|
-
}
|
|
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
|
+
)
|
|
848
786
|
});
|
|
849
787
|
}
|
|
850
788
|
}
|
|
851
|
-
const
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
}))
|
|
858
|
-
);
|
|
859
|
-
}
|
|
860
|
-
};
|
|
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;
|
|
861
795
|
const onChangePage = (page, pageSize) => {
|
|
862
796
|
if (props.onChange) {
|
|
863
797
|
props.onChange({ name: "pagination", page, pageSize });
|
|
@@ -865,11 +799,7 @@ var TableElement = (props) => {
|
|
|
865
799
|
};
|
|
866
800
|
const rowSelectionConfig = props.rowSelection ? {
|
|
867
801
|
onChange: (selectedRowKeys, selectedRows) => {
|
|
868
|
-
console.log(
|
|
869
|
-
`selectedRowKeys: ${selectedRowKeys}`,
|
|
870
|
-
"selectedRows: ",
|
|
871
|
-
selectedRows
|
|
872
|
-
);
|
|
802
|
+
console.log(`selectedRowKeys: ${selectedRowKeys}`, "selectedRows: ", selectedRows);
|
|
873
803
|
if (props.onChange) {
|
|
874
804
|
props.onChange(selectedRows);
|
|
875
805
|
}
|
|
@@ -879,41 +809,19 @@ var TableElement = (props) => {
|
|
|
879
809
|
import_antd14.Table,
|
|
880
810
|
{
|
|
881
811
|
className: props.className,
|
|
882
|
-
pagination:
|
|
812
|
+
pagination: {
|
|
883
813
|
showTotal: (total) => `Total: ${total} items`,
|
|
884
|
-
total:
|
|
885
|
-
showSizeChanger:
|
|
814
|
+
total: count,
|
|
815
|
+
showSizeChanger: count > 10,
|
|
886
816
|
onChange: onChangePage
|
|
887
|
-
} : false,
|
|
888
|
-
onRow: (record) => {
|
|
889
|
-
return {
|
|
890
|
-
onClick: () => {
|
|
891
|
-
if (props.view) {
|
|
892
|
-
setSelectedRecord(record);
|
|
893
|
-
handleChange(record);
|
|
894
|
-
setModel(true);
|
|
895
|
-
}
|
|
896
|
-
},
|
|
897
|
-
style: { cursor: "pointer" }
|
|
898
|
-
};
|
|
899
817
|
},
|
|
900
818
|
rowSelection: rowSelectionConfig,
|
|
901
819
|
dataSource,
|
|
902
820
|
columns,
|
|
903
821
|
size: props.size,
|
|
904
|
-
bordered: true
|
|
905
|
-
onChange: onChangeTable
|
|
906
|
-
}
|
|
907
|
-
), model && /* @__PURE__ */ import_react20.default.createElement(
|
|
908
|
-
ModelElement,
|
|
909
|
-
{
|
|
910
|
-
selectedRecord,
|
|
911
|
-
...props,
|
|
912
|
-
columns,
|
|
913
|
-
model,
|
|
914
|
-
onCancel: () => setModel(false)
|
|
822
|
+
bordered: true
|
|
915
823
|
}
|
|
916
|
-
));
|
|
824
|
+
), model && /* @__PURE__ */ import_react20.default.createElement(ModelElement, { selectedRecord, ...props, columns, model, onCancel: () => setModel(false) }));
|
|
917
825
|
};
|
|
918
826
|
|
|
919
827
|
// src/Components/DatePicker.tsx
|
|
@@ -921,7 +829,6 @@ var import_react21 = __toESM(require("react"));
|
|
|
921
829
|
var import_antd15 = require("antd");
|
|
922
830
|
var import_dayjs = __toESM(require("dayjs"));
|
|
923
831
|
var import_customParseFormat = __toESM(require("dayjs/plugin/customParseFormat.js"));
|
|
924
|
-
var import_moment2 = __toESM(require("moment"));
|
|
925
832
|
import_dayjs.default.extend(import_customParseFormat.default);
|
|
926
833
|
var DatePickerElement = (props) => {
|
|
927
834
|
const [dateState, setDateState] = (0, import_react21.useState)("");
|
|
@@ -939,13 +846,9 @@ var DatePickerElement = (props) => {
|
|
|
939
846
|
}
|
|
940
847
|
}
|
|
941
848
|
};
|
|
942
|
-
const disabledDate = (current) => {
|
|
943
|
-
return current && current > (0, import_moment2.default)();
|
|
944
|
-
};
|
|
945
849
|
return /* @__PURE__ */ import_react21.default.createElement("div", null, /* @__PURE__ */ import_react21.default.createElement(
|
|
946
850
|
import_antd15.DatePicker,
|
|
947
851
|
{
|
|
948
|
-
disabledDate,
|
|
949
852
|
placeholder: props.placeholder,
|
|
950
853
|
value: dateState,
|
|
951
854
|
format: { format: "DD-MM-YYYY" },
|
|
@@ -958,14 +861,13 @@ var DatePickerElement = (props) => {
|
|
|
958
861
|
var import_react22 = __toESM(require("react"));
|
|
959
862
|
var import_antd16 = require("antd");
|
|
960
863
|
var import_dayjs2 = __toESM(require("dayjs"));
|
|
961
|
-
var import_moment3 = __toESM(require("moment"));
|
|
962
864
|
var DateRangePickerElement = (props) => {
|
|
963
865
|
const { RangePicker } = import_antd16.DatePicker;
|
|
964
866
|
const handleChange = (dates, dateStrings) => {
|
|
965
|
-
if (dates) {
|
|
966
|
-
props.onChange
|
|
867
|
+
if (dates && props.onChange) {
|
|
868
|
+
props.onChange(dateStrings);
|
|
967
869
|
} else {
|
|
968
|
-
|
|
870
|
+
console.log("Clear");
|
|
969
871
|
}
|
|
970
872
|
};
|
|
971
873
|
const rangePresets = [
|
|
@@ -974,17 +876,7 @@ var DateRangePickerElement = (props) => {
|
|
|
974
876
|
{ label: "Last 30 Days", value: [(0, import_dayjs2.default)().add(-30, "d"), (0, import_dayjs2.default)()] },
|
|
975
877
|
{ label: "Last 90 Days", value: [(0, import_dayjs2.default)().add(-90, "d"), (0, import_dayjs2.default)()] }
|
|
976
878
|
];
|
|
977
|
-
|
|
978
|
-
return current && current > (0, import_moment3.default)();
|
|
979
|
-
};
|
|
980
|
-
return /* @__PURE__ */ import_react22.default.createElement(import_antd16.Space, { direction: "vertical", size: 12 }, /* @__PURE__ */ import_react22.default.createElement(
|
|
981
|
-
RangePicker,
|
|
982
|
-
{
|
|
983
|
-
disabledDate,
|
|
984
|
-
presets: rangePresets,
|
|
985
|
-
onChange: handleChange
|
|
986
|
-
}
|
|
987
|
-
));
|
|
879
|
+
return /* @__PURE__ */ import_react22.default.createElement(import_antd16.Space, { direction: "vertical", size: 12 }, /* @__PURE__ */ import_react22.default.createElement(RangePicker, { presets: rangePresets, onChange: handleChange }));
|
|
988
880
|
};
|
|
989
881
|
|
|
990
882
|
// src/Components/Image.tsx
|
|
@@ -1063,7 +955,7 @@ var DropDownGroup = (props) => {
|
|
|
1063
955
|
// src/Components/FilesUpload.tsx
|
|
1064
956
|
var import_react26 = __toESM(require("react"));
|
|
1065
957
|
var import_antd19 = require("antd");
|
|
1066
|
-
var
|
|
958
|
+
var import_icons4 = require("@ant-design/icons");
|
|
1067
959
|
var FileUpload = (props) => {
|
|
1068
960
|
const { Dragger } = import_antd19.Upload;
|
|
1069
961
|
const [files, setFiles] = (0, import_react26.useState)([]);
|
|
@@ -1094,7 +986,7 @@ var FileUpload = (props) => {
|
|
|
1094
986
|
showUploadList: true,
|
|
1095
987
|
customRequest
|
|
1096
988
|
},
|
|
1097
|
-
/* @__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)),
|
|
1098
990
|
/* @__PURE__ */ import_react26.default.createElement("p", null, "Click or drag file to upload")
|
|
1099
991
|
));
|
|
1100
992
|
};
|
|
@@ -1491,13 +1383,147 @@ var LineChart = (props) => {
|
|
|
1491
1383
|
return /* @__PURE__ */ import_react34.default.createElement("div", { className: props.className }, /* @__PURE__ */ import_react34.default.createElement("canvas", { ref: chartRef }));
|
|
1492
1384
|
};
|
|
1493
1385
|
|
|
1494
|
-
// src/Components/
|
|
1386
|
+
// src/Components/highchart.tsx
|
|
1495
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 = (props) => {
|
|
1391
|
+
let graph_data = {
|
|
1392
|
+
chart: {
|
|
1393
|
+
height: "50%"
|
|
1394
|
+
},
|
|
1395
|
+
title: {
|
|
1396
|
+
text: "U.S Solar Employment Growth",
|
|
1397
|
+
align: "left"
|
|
1398
|
+
},
|
|
1399
|
+
subtitle: {
|
|
1400
|
+
text: 'By Job Category. Source: <a href="https://irecusa.org/programs/solar-jobs-census/" target="_blank">IREC</a>.',
|
|
1401
|
+
align: "left"
|
|
1402
|
+
},
|
|
1403
|
+
yAxis: {
|
|
1404
|
+
title: {
|
|
1405
|
+
text: "Number of Employees"
|
|
1406
|
+
}
|
|
1407
|
+
},
|
|
1408
|
+
xAxis: {
|
|
1409
|
+
accessibility: {
|
|
1410
|
+
rangeDescription: "Range: 2010 to 2020"
|
|
1411
|
+
}
|
|
1412
|
+
},
|
|
1413
|
+
legend: {
|
|
1414
|
+
layout: "vertical",
|
|
1415
|
+
align: "right",
|
|
1416
|
+
verticalAlign: "middle"
|
|
1417
|
+
},
|
|
1418
|
+
plotOptions: {
|
|
1419
|
+
series: {
|
|
1420
|
+
label: {
|
|
1421
|
+
connectorAllowed: false
|
|
1422
|
+
},
|
|
1423
|
+
pointStart: 2010
|
|
1424
|
+
}
|
|
1425
|
+
},
|
|
1426
|
+
series: [{
|
|
1427
|
+
name: "Installation & Developers",
|
|
1428
|
+
data: [
|
|
1429
|
+
43934,
|
|
1430
|
+
48656,
|
|
1431
|
+
65165,
|
|
1432
|
+
81827,
|
|
1433
|
+
112143,
|
|
1434
|
+
142383,
|
|
1435
|
+
171533,
|
|
1436
|
+
165174,
|
|
1437
|
+
155157,
|
|
1438
|
+
161454,
|
|
1439
|
+
154610
|
|
1440
|
+
]
|
|
1441
|
+
}, {
|
|
1442
|
+
name: "Manufacturing",
|
|
1443
|
+
data: [
|
|
1444
|
+
24916,
|
|
1445
|
+
37941,
|
|
1446
|
+
29742,
|
|
1447
|
+
29851,
|
|
1448
|
+
32490,
|
|
1449
|
+
30282,
|
|
1450
|
+
38121,
|
|
1451
|
+
36885,
|
|
1452
|
+
33726,
|
|
1453
|
+
34243,
|
|
1454
|
+
31050
|
|
1455
|
+
]
|
|
1456
|
+
}, {
|
|
1457
|
+
name: "Sales & Distribution",
|
|
1458
|
+
data: [
|
|
1459
|
+
11744,
|
|
1460
|
+
3e4,
|
|
1461
|
+
16005,
|
|
1462
|
+
19771,
|
|
1463
|
+
20185,
|
|
1464
|
+
24377,
|
|
1465
|
+
32147,
|
|
1466
|
+
30912,
|
|
1467
|
+
29243,
|
|
1468
|
+
29213,
|
|
1469
|
+
25663
|
|
1470
|
+
]
|
|
1471
|
+
}, {
|
|
1472
|
+
name: "Operations & Maintenance",
|
|
1473
|
+
data: [
|
|
1474
|
+
null,
|
|
1475
|
+
null,
|
|
1476
|
+
null,
|
|
1477
|
+
null,
|
|
1478
|
+
null,
|
|
1479
|
+
null,
|
|
1480
|
+
null,
|
|
1481
|
+
null,
|
|
1482
|
+
11164,
|
|
1483
|
+
11218,
|
|
1484
|
+
10077
|
|
1485
|
+
]
|
|
1486
|
+
}, {
|
|
1487
|
+
name: "Other",
|
|
1488
|
+
data: [
|
|
1489
|
+
21908,
|
|
1490
|
+
5548,
|
|
1491
|
+
8105,
|
|
1492
|
+
11248,
|
|
1493
|
+
8989,
|
|
1494
|
+
11816,
|
|
1495
|
+
18274,
|
|
1496
|
+
17300,
|
|
1497
|
+
13053,
|
|
1498
|
+
11906,
|
|
1499
|
+
10073
|
|
1500
|
+
]
|
|
1501
|
+
}],
|
|
1502
|
+
responsive: {
|
|
1503
|
+
rules: [{
|
|
1504
|
+
condition: {
|
|
1505
|
+
maxWidth: 500
|
|
1506
|
+
},
|
|
1507
|
+
chartOptions: {
|
|
1508
|
+
legend: {
|
|
1509
|
+
layout: "horizontal",
|
|
1510
|
+
align: "center",
|
|
1511
|
+
verticalAlign: "bottom"
|
|
1512
|
+
}
|
|
1513
|
+
}
|
|
1514
|
+
}]
|
|
1515
|
+
}
|
|
1516
|
+
};
|
|
1517
|
+
return /* @__PURE__ */ import_react35.default.createElement("div", null, /* @__PURE__ */ import_react35.default.createElement(import_highcharts_react_official.default, { highcharts: import_highcharts.default, options: graph_data }));
|
|
1518
|
+
};
|
|
1519
|
+
|
|
1520
|
+
// src/Components/DoubleBarChart.tsx
|
|
1521
|
+
var import_react36 = __toESM(require("react"));
|
|
1496
1522
|
var import_auto2 = __toESM(require("chart.js/auto"));
|
|
1497
1523
|
var DoubleBarChart = (props) => {
|
|
1498
|
-
const chartRef = (0,
|
|
1499
|
-
const chartInstance = (0,
|
|
1500
|
-
(0,
|
|
1524
|
+
const chartRef = (0, import_react36.useRef)(null);
|
|
1525
|
+
const chartInstance = (0, import_react36.useRef)(null);
|
|
1526
|
+
(0, import_react36.useEffect)(() => {
|
|
1501
1527
|
if (chartRef.current) {
|
|
1502
1528
|
if (chartInstance.current) {
|
|
1503
1529
|
chartInstance.current.destroy();
|
|
@@ -1566,11 +1592,11 @@ var DoubleBarChart = (props) => {
|
|
|
1566
1592
|
}
|
|
1567
1593
|
};
|
|
1568
1594
|
}, []);
|
|
1569
|
-
return /* @__PURE__ */
|
|
1595
|
+
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 }));
|
|
1570
1596
|
};
|
|
1571
1597
|
|
|
1572
1598
|
// src/Components/BarChart.tsx
|
|
1573
|
-
var
|
|
1599
|
+
var import_react37 = __toESM(require("react"));
|
|
1574
1600
|
var import_react_chartjs_24 = require("react-chartjs-2");
|
|
1575
1601
|
var import_chart4 = require("chart.js");
|
|
1576
1602
|
import_chart4.Chart.register(import_chart4.BarElement, import_chart4.CategoryScale, import_chart4.LinearScale, import_chart4.Tooltip);
|
|
@@ -1632,7 +1658,7 @@ var BarChart = (props) => {
|
|
|
1632
1658
|
}
|
|
1633
1659
|
}
|
|
1634
1660
|
};
|
|
1635
|
-
return /* @__PURE__ */
|
|
1661
|
+
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 }));
|
|
1636
1662
|
};
|
|
1637
1663
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1638
1664
|
0 && (module.exports = {
|
|
@@ -1647,6 +1673,7 @@ var BarChart = (props) => {
|
|
|
1647
1673
|
DoubleBarChart,
|
|
1648
1674
|
DropDownGroup,
|
|
1649
1675
|
FileUpload,
|
|
1676
|
+
HighchartsLineChart,
|
|
1650
1677
|
HorizontalBarChart,
|
|
1651
1678
|
Image,
|
|
1652
1679
|
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
|
|
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
|
|
@@ -621,48 +617,18 @@ import { Modal } from "antd";
|
|
|
621
617
|
|
|
622
618
|
// src/Components/ModelBody.tsx
|
|
623
619
|
import React18 from "react";
|
|
624
|
-
import moment from "moment";
|
|
625
620
|
var ModelBody = (props) => {
|
|
626
|
-
return /* @__PURE__ */ React18.createElement("div", { className: props.modalContent && props.modalContent.className }, props.modalContent && props.modalContent.fields.map(
|
|
627
|
-
(eachField)
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
}
|
|
636
|
-
},
|
|
637
|
-
moment(eachField.dateTime).format("LT")
|
|
638
|
-
) : "");
|
|
639
|
-
} else if (eachField.element === "input-radio") {
|
|
640
|
-
return /* @__PURE__ */ React18.createElement("div", { className: eachField.className }, /* @__PURE__ */ React18.createElement(RadioElement, { ...eachField }), eachField.dateTime ? /* @__PURE__ */ React18.createElement(
|
|
641
|
-
"p",
|
|
642
|
-
{
|
|
643
|
-
style: {
|
|
644
|
-
fontSize: "10px",
|
|
645
|
-
textAlign: eachField.source === "bot" ? "left" : "right"
|
|
646
|
-
}
|
|
647
|
-
},
|
|
648
|
-
moment(eachField.dateTime).format("LT")
|
|
649
|
-
) : "");
|
|
650
|
-
} else if (eachField.element === "button") {
|
|
651
|
-
return /* @__PURE__ */ React18.createElement("div", { className: eachField.className }, /* @__PURE__ */ React18.createElement(ButtonElement, { ...eachField }), eachField.dateTime ? /* @__PURE__ */ React18.createElement(
|
|
652
|
-
"p",
|
|
653
|
-
{
|
|
654
|
-
style: {
|
|
655
|
-
fontSize: "10px",
|
|
656
|
-
textAlign: eachField.source === "bot" ? "left" : "right"
|
|
657
|
-
}
|
|
658
|
-
},
|
|
659
|
-
moment(eachField.dateTime).format("LT")
|
|
660
|
-
) : "");
|
|
661
|
-
} else {
|
|
662
|
-
return null;
|
|
663
|
-
}
|
|
621
|
+
return /* @__PURE__ */ React18.createElement("div", { className: props.modalContent && props.modalContent.className }, props.modalContent && props.modalContent.fields.map((eachField) => {
|
|
622
|
+
if (eachField.element === "div") {
|
|
623
|
+
return /* @__PURE__ */ React18.createElement("div", { className: eachField.className }, eachField.label);
|
|
624
|
+
} else if (eachField.element === "input-radio") {
|
|
625
|
+
return /* @__PURE__ */ React18.createElement("div", { className: eachField.className }, /* @__PURE__ */ React18.createElement(RadioElement, { ...eachField }));
|
|
626
|
+
} else if (eachField.element === "button") {
|
|
627
|
+
return /* @__PURE__ */ React18.createElement("div", { className: eachField.className }, /* @__PURE__ */ React18.createElement(ButtonElement, { ...eachField }));
|
|
628
|
+
} else {
|
|
629
|
+
return null;
|
|
664
630
|
}
|
|
665
|
-
));
|
|
631
|
+
}));
|
|
666
632
|
};
|
|
667
633
|
|
|
668
634
|
// src/Components/Model.tsx
|
|
@@ -687,22 +653,9 @@ var ModelElement = (props) => {
|
|
|
687
653
|
margin: "-10px"
|
|
688
654
|
}
|
|
689
655
|
},
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
"span",
|
|
694
|
-
{
|
|
695
|
-
style: {
|
|
696
|
-
fontWeight: "200",
|
|
697
|
-
color: "gray",
|
|
698
|
-
paddingRight: "10px"
|
|
699
|
-
}
|
|
700
|
-
},
|
|
701
|
-
eachColumn.title
|
|
702
|
-
), selectedRecord[eachColumn.key] !== "" ? selectedRecord[eachColumn.key] : "--");
|
|
703
|
-
} else {
|
|
704
|
-
return null;
|
|
705
|
-
}
|
|
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)) : "";
|
|
706
659
|
})
|
|
707
660
|
)
|
|
708
661
|
},
|
|
@@ -711,24 +664,12 @@ var ModelElement = (props) => {
|
|
|
711
664
|
};
|
|
712
665
|
|
|
713
666
|
// src/Components/TableElement.tsx
|
|
714
|
-
import { EyeOutlined } from "@ant-design/icons";
|
|
715
667
|
var TableElement = (props) => {
|
|
716
668
|
const { thead, tbody } = props;
|
|
717
669
|
const [selectedRecord, setSelectedRecord] = useState6({});
|
|
718
670
|
const [model, setModel] = useState6(false);
|
|
719
|
-
const [dataSource, setDataSource] = useState6([]);
|
|
720
|
-
useEffect3(() => {
|
|
721
|
-
if (tbody) {
|
|
722
|
-
setDataSource(
|
|
723
|
-
tbody.map((row, index) => ({
|
|
724
|
-
...row,
|
|
725
|
-
key: index,
|
|
726
|
-
index: index + 1
|
|
727
|
-
}))
|
|
728
|
-
);
|
|
729
|
-
}
|
|
730
|
-
}, [tbody]);
|
|
731
671
|
const handleChange = (record) => {
|
|
672
|
+
console.log("record", record);
|
|
732
673
|
if (props.onChange) {
|
|
733
674
|
props.onChange(record);
|
|
734
675
|
}
|
|
@@ -738,8 +679,8 @@ var TableElement = (props) => {
|
|
|
738
679
|
columns = [
|
|
739
680
|
{
|
|
740
681
|
title: "#",
|
|
741
|
-
dataIndex: "
|
|
742
|
-
key: "
|
|
682
|
+
dataIndex: "#",
|
|
683
|
+
key: "#",
|
|
743
684
|
fixed: "left"
|
|
744
685
|
},
|
|
745
686
|
...thead.map((col, ind) => ({
|
|
@@ -750,9 +691,9 @@ var TableElement = (props) => {
|
|
|
750
691
|
render: col.render,
|
|
751
692
|
sorter: {
|
|
752
693
|
compare: (a, b) => {
|
|
753
|
-
if (typeof a[col.key] === "number" && typeof
|
|
694
|
+
if (typeof a[col.key] === "number" && typeof a[col.key] === "number") {
|
|
754
695
|
return a[col.key] - b[col.key];
|
|
755
|
-
} else if (typeof a[col.key] === "string" && typeof
|
|
696
|
+
} else if (typeof a[col.key] === "string" && typeof a[col.key] === "string") {
|
|
756
697
|
return a[col.key].localeCompare(b[col.key]);
|
|
757
698
|
}
|
|
758
699
|
}
|
|
@@ -764,34 +705,26 @@ var TableElement = (props) => {
|
|
|
764
705
|
title: "View",
|
|
765
706
|
dataIndex: "View",
|
|
766
707
|
key: "View",
|
|
767
|
-
render: (_, record) =>
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
{
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
},
|
|
779
|
-
/* @__PURE__ */ React20.createElement(EyeOutlined, null)
|
|
780
|
-
);
|
|
781
|
-
}
|
|
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
|
+
)
|
|
782
719
|
});
|
|
783
720
|
}
|
|
784
721
|
}
|
|
785
|
-
const
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
}))
|
|
792
|
-
);
|
|
793
|
-
}
|
|
794
|
-
};
|
|
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;
|
|
795
728
|
const onChangePage = (page, pageSize) => {
|
|
796
729
|
if (props.onChange) {
|
|
797
730
|
props.onChange({ name: "pagination", page, pageSize });
|
|
@@ -799,11 +732,7 @@ var TableElement = (props) => {
|
|
|
799
732
|
};
|
|
800
733
|
const rowSelectionConfig = props.rowSelection ? {
|
|
801
734
|
onChange: (selectedRowKeys, selectedRows) => {
|
|
802
|
-
console.log(
|
|
803
|
-
`selectedRowKeys: ${selectedRowKeys}`,
|
|
804
|
-
"selectedRows: ",
|
|
805
|
-
selectedRows
|
|
806
|
-
);
|
|
735
|
+
console.log(`selectedRowKeys: ${selectedRowKeys}`, "selectedRows: ", selectedRows);
|
|
807
736
|
if (props.onChange) {
|
|
808
737
|
props.onChange(selectedRows);
|
|
809
738
|
}
|
|
@@ -813,41 +742,19 @@ var TableElement = (props) => {
|
|
|
813
742
|
Table2,
|
|
814
743
|
{
|
|
815
744
|
className: props.className,
|
|
816
|
-
pagination:
|
|
745
|
+
pagination: {
|
|
817
746
|
showTotal: (total) => `Total: ${total} items`,
|
|
818
|
-
total:
|
|
819
|
-
showSizeChanger:
|
|
747
|
+
total: count,
|
|
748
|
+
showSizeChanger: count > 10,
|
|
820
749
|
onChange: onChangePage
|
|
821
|
-
} : false,
|
|
822
|
-
onRow: (record) => {
|
|
823
|
-
return {
|
|
824
|
-
onClick: () => {
|
|
825
|
-
if (props.view) {
|
|
826
|
-
setSelectedRecord(record);
|
|
827
|
-
handleChange(record);
|
|
828
|
-
setModel(true);
|
|
829
|
-
}
|
|
830
|
-
},
|
|
831
|
-
style: { cursor: "pointer" }
|
|
832
|
-
};
|
|
833
750
|
},
|
|
834
751
|
rowSelection: rowSelectionConfig,
|
|
835
752
|
dataSource,
|
|
836
753
|
columns,
|
|
837
754
|
size: props.size,
|
|
838
|
-
bordered: true
|
|
839
|
-
onChange: onChangeTable
|
|
840
|
-
}
|
|
841
|
-
), model && /* @__PURE__ */ React20.createElement(
|
|
842
|
-
ModelElement,
|
|
843
|
-
{
|
|
844
|
-
selectedRecord,
|
|
845
|
-
...props,
|
|
846
|
-
columns,
|
|
847
|
-
model,
|
|
848
|
-
onCancel: () => setModel(false)
|
|
755
|
+
bordered: true
|
|
849
756
|
}
|
|
850
|
-
));
|
|
757
|
+
), model && /* @__PURE__ */ React20.createElement(ModelElement, { selectedRecord, ...props, columns, model, onCancel: () => setModel(false) }));
|
|
851
758
|
};
|
|
852
759
|
|
|
853
760
|
// src/Components/DatePicker.tsx
|
|
@@ -855,7 +762,6 @@ import React21, { useState as useState7 } from "react";
|
|
|
855
762
|
import { DatePicker } from "antd";
|
|
856
763
|
import dayjs from "dayjs";
|
|
857
764
|
import customParseFormat from "dayjs/plugin/customParseFormat.js";
|
|
858
|
-
import moment2 from "moment";
|
|
859
765
|
dayjs.extend(customParseFormat);
|
|
860
766
|
var DatePickerElement = (props) => {
|
|
861
767
|
const [dateState, setDateState] = useState7("");
|
|
@@ -873,13 +779,9 @@ var DatePickerElement = (props) => {
|
|
|
873
779
|
}
|
|
874
780
|
}
|
|
875
781
|
};
|
|
876
|
-
const disabledDate = (current) => {
|
|
877
|
-
return current && current > moment2();
|
|
878
|
-
};
|
|
879
782
|
return /* @__PURE__ */ React21.createElement("div", null, /* @__PURE__ */ React21.createElement(
|
|
880
783
|
DatePicker,
|
|
881
784
|
{
|
|
882
|
-
disabledDate,
|
|
883
785
|
placeholder: props.placeholder,
|
|
884
786
|
value: dateState,
|
|
885
787
|
format: { format: "DD-MM-YYYY" },
|
|
@@ -892,14 +794,13 @@ var DatePickerElement = (props) => {
|
|
|
892
794
|
import React22 from "react";
|
|
893
795
|
import { DatePicker as DatePicker2, Space } from "antd";
|
|
894
796
|
import dayjs2 from "dayjs";
|
|
895
|
-
import moment3 from "moment";
|
|
896
797
|
var DateRangePickerElement = (props) => {
|
|
897
798
|
const { RangePicker } = DatePicker2;
|
|
898
799
|
const handleChange = (dates, dateStrings) => {
|
|
899
|
-
if (dates) {
|
|
900
|
-
props.onChange
|
|
800
|
+
if (dates && props.onChange) {
|
|
801
|
+
props.onChange(dateStrings);
|
|
901
802
|
} else {
|
|
902
|
-
|
|
803
|
+
console.log("Clear");
|
|
903
804
|
}
|
|
904
805
|
};
|
|
905
806
|
const rangePresets = [
|
|
@@ -908,17 +809,7 @@ var DateRangePickerElement = (props) => {
|
|
|
908
809
|
{ label: "Last 30 Days", value: [dayjs2().add(-30, "d"), dayjs2()] },
|
|
909
810
|
{ label: "Last 90 Days", value: [dayjs2().add(-90, "d"), dayjs2()] }
|
|
910
811
|
];
|
|
911
|
-
|
|
912
|
-
return current && current > moment3();
|
|
913
|
-
};
|
|
914
|
-
return /* @__PURE__ */ React22.createElement(Space, { direction: "vertical", size: 12 }, /* @__PURE__ */ React22.createElement(
|
|
915
|
-
RangePicker,
|
|
916
|
-
{
|
|
917
|
-
disabledDate,
|
|
918
|
-
presets: rangePresets,
|
|
919
|
-
onChange: handleChange
|
|
920
|
-
}
|
|
921
|
-
));
|
|
812
|
+
return /* @__PURE__ */ React22.createElement(Space, { direction: "vertical", size: 12 }, /* @__PURE__ */ React22.createElement(RangePicker, { presets: rangePresets, onChange: handleChange }));
|
|
922
813
|
};
|
|
923
814
|
|
|
924
815
|
// src/Components/Image.tsx
|
|
@@ -1082,7 +973,7 @@ var Upload2 = (props) => {
|
|
|
1082
973
|
};
|
|
1083
974
|
|
|
1084
975
|
// src/Components/OtpElement.tsx
|
|
1085
|
-
import React30, { useState as useState11, useRef, useEffect as
|
|
976
|
+
import React30, { useState as useState11, useRef, useEffect as useEffect3 } from "react";
|
|
1086
977
|
import { Input as Input3 } from "antd";
|
|
1087
978
|
var OtpElement = (props) => {
|
|
1088
979
|
const length = props.length;
|
|
@@ -1119,7 +1010,7 @@ var OtpElement = (props) => {
|
|
|
1119
1010
|
});
|
|
1120
1011
|
}
|
|
1121
1012
|
};
|
|
1122
|
-
|
|
1013
|
+
useEffect3(() => {
|
|
1123
1014
|
inputRefs.current[0]?.focus();
|
|
1124
1015
|
}, []);
|
|
1125
1016
|
return /* @__PURE__ */ React30.createElement("div", { className: props.containerClassName }, Array.from({ length }).map((_, index) => /* @__PURE__ */ React30.createElement(
|
|
@@ -1371,7 +1262,7 @@ var HorizontalBarChart = (props) => {
|
|
|
1371
1262
|
};
|
|
1372
1263
|
|
|
1373
1264
|
// src/Components/LineChart.tsx
|
|
1374
|
-
import React34, { useEffect as
|
|
1265
|
+
import React34, { useEffect as useEffect4, useRef as useRef2 } from "react";
|
|
1375
1266
|
import Chart from "chart.js/auto";
|
|
1376
1267
|
var LineChart = (props) => {
|
|
1377
1268
|
const chartRef = useRef2(null);
|
|
@@ -1382,7 +1273,7 @@ var LineChart = (props) => {
|
|
|
1382
1273
|
{ label: "Conversion Rate", data: [50, 100, 150, 180, 50] }
|
|
1383
1274
|
];
|
|
1384
1275
|
const labels = ["Instagram", "Whatsapp", "Messages", "Telegram", "Linkedin"];
|
|
1385
|
-
|
|
1276
|
+
useEffect4(() => {
|
|
1386
1277
|
if (chartRef.current) {
|
|
1387
1278
|
if (chartInstance.current) {
|
|
1388
1279
|
chartInstance.current.destroy();
|
|
@@ -1443,13 +1334,147 @@ var LineChart = (props) => {
|
|
|
1443
1334
|
return /* @__PURE__ */ React34.createElement("div", { className: props.className }, /* @__PURE__ */ React34.createElement("canvas", { ref: chartRef }));
|
|
1444
1335
|
};
|
|
1445
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 = (props) => {
|
|
1342
|
+
let graph_data = {
|
|
1343
|
+
chart: {
|
|
1344
|
+
height: "50%"
|
|
1345
|
+
},
|
|
1346
|
+
title: {
|
|
1347
|
+
text: "U.S Solar Employment Growth",
|
|
1348
|
+
align: "left"
|
|
1349
|
+
},
|
|
1350
|
+
subtitle: {
|
|
1351
|
+
text: 'By Job Category. Source: <a href="https://irecusa.org/programs/solar-jobs-census/" target="_blank">IREC</a>.',
|
|
1352
|
+
align: "left"
|
|
1353
|
+
},
|
|
1354
|
+
yAxis: {
|
|
1355
|
+
title: {
|
|
1356
|
+
text: "Number of Employees"
|
|
1357
|
+
}
|
|
1358
|
+
},
|
|
1359
|
+
xAxis: {
|
|
1360
|
+
accessibility: {
|
|
1361
|
+
rangeDescription: "Range: 2010 to 2020"
|
|
1362
|
+
}
|
|
1363
|
+
},
|
|
1364
|
+
legend: {
|
|
1365
|
+
layout: "vertical",
|
|
1366
|
+
align: "right",
|
|
1367
|
+
verticalAlign: "middle"
|
|
1368
|
+
},
|
|
1369
|
+
plotOptions: {
|
|
1370
|
+
series: {
|
|
1371
|
+
label: {
|
|
1372
|
+
connectorAllowed: false
|
|
1373
|
+
},
|
|
1374
|
+
pointStart: 2010
|
|
1375
|
+
}
|
|
1376
|
+
},
|
|
1377
|
+
series: [{
|
|
1378
|
+
name: "Installation & Developers",
|
|
1379
|
+
data: [
|
|
1380
|
+
43934,
|
|
1381
|
+
48656,
|
|
1382
|
+
65165,
|
|
1383
|
+
81827,
|
|
1384
|
+
112143,
|
|
1385
|
+
142383,
|
|
1386
|
+
171533,
|
|
1387
|
+
165174,
|
|
1388
|
+
155157,
|
|
1389
|
+
161454,
|
|
1390
|
+
154610
|
|
1391
|
+
]
|
|
1392
|
+
}, {
|
|
1393
|
+
name: "Manufacturing",
|
|
1394
|
+
data: [
|
|
1395
|
+
24916,
|
|
1396
|
+
37941,
|
|
1397
|
+
29742,
|
|
1398
|
+
29851,
|
|
1399
|
+
32490,
|
|
1400
|
+
30282,
|
|
1401
|
+
38121,
|
|
1402
|
+
36885,
|
|
1403
|
+
33726,
|
|
1404
|
+
34243,
|
|
1405
|
+
31050
|
|
1406
|
+
]
|
|
1407
|
+
}, {
|
|
1408
|
+
name: "Sales & Distribution",
|
|
1409
|
+
data: [
|
|
1410
|
+
11744,
|
|
1411
|
+
3e4,
|
|
1412
|
+
16005,
|
|
1413
|
+
19771,
|
|
1414
|
+
20185,
|
|
1415
|
+
24377,
|
|
1416
|
+
32147,
|
|
1417
|
+
30912,
|
|
1418
|
+
29243,
|
|
1419
|
+
29213,
|
|
1420
|
+
25663
|
|
1421
|
+
]
|
|
1422
|
+
}, {
|
|
1423
|
+
name: "Operations & Maintenance",
|
|
1424
|
+
data: [
|
|
1425
|
+
null,
|
|
1426
|
+
null,
|
|
1427
|
+
null,
|
|
1428
|
+
null,
|
|
1429
|
+
null,
|
|
1430
|
+
null,
|
|
1431
|
+
null,
|
|
1432
|
+
null,
|
|
1433
|
+
11164,
|
|
1434
|
+
11218,
|
|
1435
|
+
10077
|
|
1436
|
+
]
|
|
1437
|
+
}, {
|
|
1438
|
+
name: "Other",
|
|
1439
|
+
data: [
|
|
1440
|
+
21908,
|
|
1441
|
+
5548,
|
|
1442
|
+
8105,
|
|
1443
|
+
11248,
|
|
1444
|
+
8989,
|
|
1445
|
+
11816,
|
|
1446
|
+
18274,
|
|
1447
|
+
17300,
|
|
1448
|
+
13053,
|
|
1449
|
+
11906,
|
|
1450
|
+
10073
|
|
1451
|
+
]
|
|
1452
|
+
}],
|
|
1453
|
+
responsive: {
|
|
1454
|
+
rules: [{
|
|
1455
|
+
condition: {
|
|
1456
|
+
maxWidth: 500
|
|
1457
|
+
},
|
|
1458
|
+
chartOptions: {
|
|
1459
|
+
legend: {
|
|
1460
|
+
layout: "horizontal",
|
|
1461
|
+
align: "center",
|
|
1462
|
+
verticalAlign: "bottom"
|
|
1463
|
+
}
|
|
1464
|
+
}
|
|
1465
|
+
}]
|
|
1466
|
+
}
|
|
1467
|
+
};
|
|
1468
|
+
return /* @__PURE__ */ React35.createElement("div", null, /* @__PURE__ */ React35.createElement(HighchartsReact, { highcharts: Highcharts, options: graph_data }));
|
|
1469
|
+
};
|
|
1470
|
+
|
|
1446
1471
|
// src/Components/DoubleBarChart.tsx
|
|
1447
|
-
import
|
|
1472
|
+
import React36, { useEffect as useEffect5, useRef as useRef3 } from "react";
|
|
1448
1473
|
import Chart2 from "chart.js/auto";
|
|
1449
1474
|
var DoubleBarChart = (props) => {
|
|
1450
1475
|
const chartRef = useRef3(null);
|
|
1451
1476
|
const chartInstance = useRef3(null);
|
|
1452
|
-
|
|
1477
|
+
useEffect5(() => {
|
|
1453
1478
|
if (chartRef.current) {
|
|
1454
1479
|
if (chartInstance.current) {
|
|
1455
1480
|
chartInstance.current.destroy();
|
|
@@ -1518,11 +1543,11 @@ var DoubleBarChart = (props) => {
|
|
|
1518
1543
|
}
|
|
1519
1544
|
};
|
|
1520
1545
|
}, []);
|
|
1521
|
-
return /* @__PURE__ */
|
|
1546
|
+
return /* @__PURE__ */ React36.createElement("div", { className: props.className }, /* @__PURE__ */ React36.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ React36.createElement("canvas", { ref: chartRef }));
|
|
1522
1547
|
};
|
|
1523
1548
|
|
|
1524
1549
|
// src/Components/BarChart.tsx
|
|
1525
|
-
import
|
|
1550
|
+
import React37 from "react";
|
|
1526
1551
|
import { Bar as Bar2 } from "react-chartjs-2";
|
|
1527
1552
|
import {
|
|
1528
1553
|
Chart as ChartJS4,
|
|
@@ -1590,7 +1615,7 @@ var BarChart = (props) => {
|
|
|
1590
1615
|
}
|
|
1591
1616
|
}
|
|
1592
1617
|
};
|
|
1593
|
-
return /* @__PURE__ */
|
|
1618
|
+
return /* @__PURE__ */ React37.createElement("div", { className: props.className }, /* @__PURE__ */ React37.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ React37.createElement(Bar2, { data, options }));
|
|
1594
1619
|
};
|
|
1595
1620
|
export {
|
|
1596
1621
|
AddMoreTable,
|
|
@@ -1604,6 +1629,7 @@ export {
|
|
|
1604
1629
|
DoubleBarChart,
|
|
1605
1630
|
DropDownGroup,
|
|
1606
1631
|
FileUpload,
|
|
1632
|
+
HighchartsLineChart,
|
|
1607
1633
|
HorizontalBarChart,
|
|
1608
1634
|
Image,
|
|
1609
1635
|
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
|
+
|