@apexcura/ui-components 0.0.14-Beta186 → 0.0.14-Beta187
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 +3 -0
- package/dist/index.d.mts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +170 -196
- package/dist/index.mjs +171 -196
- 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,6 +460,9 @@ 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
|
+
}
|
|
463
466
|
.hover\:bg-\[\#F2F2F2\]:hover {
|
|
464
467
|
--tw-bg-opacity: 1;
|
|
465
468
|
background-color: rgb(242 242 242 / var(--tw-bg-opacity));
|
package/dist/index.d.mts
CHANGED
|
@@ -69,6 +69,9 @@ type ElementType = {
|
|
|
69
69
|
fillText2?: string;
|
|
70
70
|
labels?: any[];
|
|
71
71
|
data?: any[];
|
|
72
|
+
pagination?: boolean;
|
|
73
|
+
is_detail?: boolean;
|
|
74
|
+
dateTime?: string;
|
|
72
75
|
};
|
|
73
76
|
|
|
74
77
|
declare const TextElement: (props: ElementType) => React$1.JSX.Element;
|
|
@@ -132,10 +135,8 @@ declare const HorizontalBarChart: (props: ElementType) => React$1.JSX.Element;
|
|
|
132
135
|
|
|
133
136
|
declare const LineChart: (props: ElementType) => React$1.JSX.Element;
|
|
134
137
|
|
|
135
|
-
declare const HighchartsLineChart: (props: any) => React$1.JSX.Element;
|
|
136
|
-
|
|
137
138
|
declare const DoubleBarChart: (props: ElementType) => React$1.JSX.Element;
|
|
138
139
|
|
|
139
140
|
declare const BarChart: (props: ElementType) => React$1.JSX.Element;
|
|
140
141
|
|
|
141
|
-
export { AddMoreTable, BarChart, ButtonElement, CheckboxElement, CircleDonut, CkEditor, DatePickerElement, DateRangePickerElement, DoubleBarChart, DropDownGroup, FileUpload,
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -69,6 +69,9 @@ type ElementType = {
|
|
|
69
69
|
fillText2?: string;
|
|
70
70
|
labels?: any[];
|
|
71
71
|
data?: any[];
|
|
72
|
+
pagination?: boolean;
|
|
73
|
+
is_detail?: boolean;
|
|
74
|
+
dateTime?: string;
|
|
72
75
|
};
|
|
73
76
|
|
|
74
77
|
declare const TextElement: (props: ElementType) => React$1.JSX.Element;
|
|
@@ -132,10 +135,8 @@ declare const HorizontalBarChart: (props: ElementType) => React$1.JSX.Element;
|
|
|
132
135
|
|
|
133
136
|
declare const LineChart: (props: ElementType) => React$1.JSX.Element;
|
|
134
137
|
|
|
135
|
-
declare const HighchartsLineChart: (props: any) => React$1.JSX.Element;
|
|
136
|
-
|
|
137
138
|
declare const DoubleBarChart: (props: ElementType) => React$1.JSX.Element;
|
|
138
139
|
|
|
139
140
|
declare const BarChart: (props: ElementType) => React$1.JSX.Element;
|
|
140
141
|
|
|
141
|
-
export { AddMoreTable, BarChart, ButtonElement, CheckboxElement, CircleDonut, CkEditor, DatePickerElement, DateRangePickerElement, DoubleBarChart, DropDownGroup, FileUpload,
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -41,7 +41,6 @@ __export(src_exports, {
|
|
|
41
41
|
DoubleBarChart: () => DoubleBarChart,
|
|
42
42
|
DropDownGroup: () => DropDownGroup,
|
|
43
43
|
FileUpload: () => FileUpload,
|
|
44
|
-
HighchartsLineChart: () => HighchartsLineChart,
|
|
45
44
|
HorizontalBarChart: () => HorizontalBarChart,
|
|
46
45
|
Image: () => Image,
|
|
47
46
|
LineChart: () => LineChart,
|
|
@@ -386,7 +385,9 @@ var MultipleSelectElement = (props) => {
|
|
|
386
385
|
var import_react11 = __toESM(require("react"));
|
|
387
386
|
var ButtonElement = (props) => {
|
|
388
387
|
const [svgContent, setSvgContent] = (0, import_react11.useState)(null);
|
|
389
|
-
const [originalSvgContent, setOriginalSvgContent] = (0, import_react11.useState)(
|
|
388
|
+
const [originalSvgContent, setOriginalSvgContent] = (0, import_react11.useState)(
|
|
389
|
+
null
|
|
390
|
+
);
|
|
390
391
|
const [hoverColor, setHoverColor] = (0, import_react11.useState)(null);
|
|
391
392
|
(0, import_react11.useEffect)(() => {
|
|
392
393
|
if (props.icon) {
|
|
@@ -423,7 +424,7 @@ var ButtonElement = (props) => {
|
|
|
423
424
|
}
|
|
424
425
|
}).catch((error) => console.error("Error fetching SVG:", error));
|
|
425
426
|
}
|
|
426
|
-
}, [
|
|
427
|
+
}, []);
|
|
427
428
|
const handleMouseEnter = () => {
|
|
428
429
|
if (hoverColor && originalSvgContent) {
|
|
429
430
|
const tempDiv = document.createElement("div");
|
|
@@ -451,12 +452,14 @@ var ButtonElement = (props) => {
|
|
|
451
452
|
cursor: props.loading ? "no-drop" : "pointer"
|
|
452
453
|
}
|
|
453
454
|
},
|
|
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(
|
|
455
|
-
"
|
|
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
|
+
"img",
|
|
456
457
|
{
|
|
457
|
-
|
|
458
|
+
className: props.iconsClassName,
|
|
459
|
+
src: props.icon,
|
|
460
|
+
alt: props.label
|
|
458
461
|
}
|
|
459
|
-
), props.label)
|
|
462
|
+
) : svgContent ? /* @__PURE__ */ import_react11.default.createElement("span", { dangerouslySetInnerHTML: { __html: svgContent } }) : /* @__PURE__ */ import_react11.default.createElement("img", { src: "", className: props.iconsClassName }), props.label)
|
|
460
463
|
);
|
|
461
464
|
};
|
|
462
465
|
|
|
@@ -684,18 +687,48 @@ var import_antd13 = require("antd");
|
|
|
684
687
|
|
|
685
688
|
// src/Components/ModelBody.tsx
|
|
686
689
|
var import_react18 = __toESM(require("react"));
|
|
690
|
+
var import_moment = __toESM(require("moment"));
|
|
687
691
|
var ModelBody = (props) => {
|
|
688
|
-
return /* @__PURE__ */ import_react18.default.createElement("div", { className: props.modalContent && props.modalContent.className }, props.modalContent && props.modalContent.fields.map(
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
692
|
+
return /* @__PURE__ */ import_react18.default.createElement("div", { className: props.modalContent && props.modalContent.className }, props.modalContent && props.modalContent.fields.map(
|
|
693
|
+
(eachField) => {
|
|
694
|
+
if (eachField.element === "div") {
|
|
695
|
+
return /* @__PURE__ */ import_react18.default.createElement("div", { className: eachField.className }, eachField.label, eachField.dateTime ? /* @__PURE__ */ import_react18.default.createElement(
|
|
696
|
+
"p",
|
|
697
|
+
{
|
|
698
|
+
style: {
|
|
699
|
+
fontSize: "10px",
|
|
700
|
+
textAlign: eachField.source === "bot" ? "left" : "right"
|
|
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
|
+
}
|
|
697
730
|
}
|
|
698
|
-
|
|
731
|
+
));
|
|
699
732
|
};
|
|
700
733
|
|
|
701
734
|
// src/Components/Model.tsx
|
|
@@ -720,9 +753,22 @@ var ModelElement = (props) => {
|
|
|
720
753
|
margin: "-10px"
|
|
721
754
|
}
|
|
722
755
|
},
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
756
|
+
columns.map((eachColumn) => {
|
|
757
|
+
if (!["index", "View"].includes(eachColumn.key) && eachColumn?.["is_detail"] !== false) {
|
|
758
|
+
return /* @__PURE__ */ import_react19.default.createElement("p", { style: { fontWeight: "500", padding: "10px" } }, /* @__PURE__ */ import_react19.default.createElement(
|
|
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
|
+
}
|
|
726
772
|
})
|
|
727
773
|
)
|
|
728
774
|
},
|
|
@@ -731,12 +777,24 @@ var ModelElement = (props) => {
|
|
|
731
777
|
};
|
|
732
778
|
|
|
733
779
|
// src/Components/TableElement.tsx
|
|
780
|
+
var import_icons4 = require("@ant-design/icons");
|
|
734
781
|
var TableElement = (props) => {
|
|
735
782
|
const { thead, tbody } = props;
|
|
736
783
|
const [selectedRecord, setSelectedRecord] = (0, import_react20.useState)({});
|
|
737
784
|
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]);
|
|
738
797
|
const handleChange = (record) => {
|
|
739
|
-
console.log("record", record);
|
|
740
798
|
if (props.onChange) {
|
|
741
799
|
props.onChange(record);
|
|
742
800
|
}
|
|
@@ -746,8 +804,8 @@ var TableElement = (props) => {
|
|
|
746
804
|
columns = [
|
|
747
805
|
{
|
|
748
806
|
title: "#",
|
|
749
|
-
dataIndex: "
|
|
750
|
-
key: "
|
|
807
|
+
dataIndex: "index",
|
|
808
|
+
key: "index",
|
|
751
809
|
fixed: "left"
|
|
752
810
|
},
|
|
753
811
|
...thead.map((col, ind) => ({
|
|
@@ -758,9 +816,9 @@ var TableElement = (props) => {
|
|
|
758
816
|
render: col.render,
|
|
759
817
|
sorter: {
|
|
760
818
|
compare: (a, b) => {
|
|
761
|
-
if (typeof a[col.key] === "number" && typeof
|
|
819
|
+
if (typeof a[col.key] === "number" && typeof b[col.key] === "number") {
|
|
762
820
|
return a[col.key] - b[col.key];
|
|
763
|
-
} else if (typeof a[col.key] === "string" && typeof
|
|
821
|
+
} else if (typeof a[col.key] === "string" && typeof b[col.key] === "string") {
|
|
764
822
|
return a[col.key].localeCompare(b[col.key]);
|
|
765
823
|
}
|
|
766
824
|
}
|
|
@@ -772,26 +830,34 @@ var TableElement = (props) => {
|
|
|
772
830
|
title: "View",
|
|
773
831
|
dataIndex: "View",
|
|
774
832
|
key: "View",
|
|
775
|
-
render: (_, record) =>
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
833
|
+
render: (_, record) => {
|
|
834
|
+
return /* @__PURE__ */ import_react20.default.createElement(
|
|
835
|
+
"a",
|
|
836
|
+
{
|
|
837
|
+
onClick: () => {
|
|
838
|
+
if (props.view) {
|
|
839
|
+
setSelectedRecord(record);
|
|
840
|
+
handleChange(record);
|
|
841
|
+
setModel(true);
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
},
|
|
845
|
+
/* @__PURE__ */ import_react20.default.createElement(import_icons4.EyeOutlined, null)
|
|
846
|
+
);
|
|
847
|
+
}
|
|
786
848
|
});
|
|
787
849
|
}
|
|
788
850
|
}
|
|
789
|
-
const
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
851
|
+
const onChangeTable = (pagination, filters, sorter, extra) => {
|
|
852
|
+
if (extra && extra.currentDataSource) {
|
|
853
|
+
setDataSource(
|
|
854
|
+
extra.currentDataSource.map((row, index) => ({
|
|
855
|
+
...row,
|
|
856
|
+
index: index + 1
|
|
857
|
+
}))
|
|
858
|
+
);
|
|
859
|
+
}
|
|
860
|
+
};
|
|
795
861
|
const onChangePage = (page, pageSize) => {
|
|
796
862
|
if (props.onChange) {
|
|
797
863
|
props.onChange({ name: "pagination", page, pageSize });
|
|
@@ -799,7 +865,11 @@ var TableElement = (props) => {
|
|
|
799
865
|
};
|
|
800
866
|
const rowSelectionConfig = props.rowSelection ? {
|
|
801
867
|
onChange: (selectedRowKeys, selectedRows) => {
|
|
802
|
-
console.log(
|
|
868
|
+
console.log(
|
|
869
|
+
`selectedRowKeys: ${selectedRowKeys}`,
|
|
870
|
+
"selectedRows: ",
|
|
871
|
+
selectedRows
|
|
872
|
+
);
|
|
803
873
|
if (props.onChange) {
|
|
804
874
|
props.onChange(selectedRows);
|
|
805
875
|
}
|
|
@@ -809,19 +879,41 @@ var TableElement = (props) => {
|
|
|
809
879
|
import_antd14.Table,
|
|
810
880
|
{
|
|
811
881
|
className: props.className,
|
|
812
|
-
pagination: {
|
|
882
|
+
pagination: props.pagination ? {
|
|
813
883
|
showTotal: (total) => `Total: ${total} items`,
|
|
814
|
-
total: count,
|
|
815
|
-
showSizeChanger: count > 10,
|
|
884
|
+
total: props.count,
|
|
885
|
+
showSizeChanger: props.count ? props.count > 10 : 0 > 10,
|
|
816
886
|
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
|
+
};
|
|
817
899
|
},
|
|
818
900
|
rowSelection: rowSelectionConfig,
|
|
819
901
|
dataSource,
|
|
820
902
|
columns,
|
|
821
903
|
size: props.size,
|
|
822
|
-
bordered: true
|
|
904
|
+
bordered: true,
|
|
905
|
+
onChange: onChangeTable
|
|
823
906
|
}
|
|
824
|
-
), model && /* @__PURE__ */ import_react20.default.createElement(
|
|
907
|
+
), model && /* @__PURE__ */ import_react20.default.createElement(
|
|
908
|
+
ModelElement,
|
|
909
|
+
{
|
|
910
|
+
selectedRecord,
|
|
911
|
+
...props,
|
|
912
|
+
columns,
|
|
913
|
+
model,
|
|
914
|
+
onCancel: () => setModel(false)
|
|
915
|
+
}
|
|
916
|
+
));
|
|
825
917
|
};
|
|
826
918
|
|
|
827
919
|
// src/Components/DatePicker.tsx
|
|
@@ -829,6 +921,7 @@ var import_react21 = __toESM(require("react"));
|
|
|
829
921
|
var import_antd15 = require("antd");
|
|
830
922
|
var import_dayjs = __toESM(require("dayjs"));
|
|
831
923
|
var import_customParseFormat = __toESM(require("dayjs/plugin/customParseFormat.js"));
|
|
924
|
+
var import_moment2 = __toESM(require("moment"));
|
|
832
925
|
import_dayjs.default.extend(import_customParseFormat.default);
|
|
833
926
|
var DatePickerElement = (props) => {
|
|
834
927
|
const [dateState, setDateState] = (0, import_react21.useState)("");
|
|
@@ -846,9 +939,13 @@ var DatePickerElement = (props) => {
|
|
|
846
939
|
}
|
|
847
940
|
}
|
|
848
941
|
};
|
|
942
|
+
const disabledDate = (current) => {
|
|
943
|
+
return current && current > (0, import_moment2.default)();
|
|
944
|
+
};
|
|
849
945
|
return /* @__PURE__ */ import_react21.default.createElement("div", null, /* @__PURE__ */ import_react21.default.createElement(
|
|
850
946
|
import_antd15.DatePicker,
|
|
851
947
|
{
|
|
948
|
+
disabledDate,
|
|
852
949
|
placeholder: props.placeholder,
|
|
853
950
|
value: dateState,
|
|
854
951
|
format: { format: "DD-MM-YYYY" },
|
|
@@ -861,13 +958,14 @@ var DatePickerElement = (props) => {
|
|
|
861
958
|
var import_react22 = __toESM(require("react"));
|
|
862
959
|
var import_antd16 = require("antd");
|
|
863
960
|
var import_dayjs2 = __toESM(require("dayjs"));
|
|
961
|
+
var import_moment3 = __toESM(require("moment"));
|
|
864
962
|
var DateRangePickerElement = (props) => {
|
|
865
963
|
const { RangePicker } = import_antd16.DatePicker;
|
|
866
964
|
const handleChange = (dates, dateStrings) => {
|
|
867
|
-
if (dates
|
|
868
|
-
props.onChange(dateStrings);
|
|
965
|
+
if (dates) {
|
|
966
|
+
props.onChange && props.onChange(dateStrings);
|
|
869
967
|
} else {
|
|
870
|
-
|
|
968
|
+
props.onChange && props.onChange("clear");
|
|
871
969
|
}
|
|
872
970
|
};
|
|
873
971
|
const rangePresets = [
|
|
@@ -876,7 +974,18 @@ var DateRangePickerElement = (props) => {
|
|
|
876
974
|
{ label: "Last 30 Days", value: [(0, import_dayjs2.default)().add(-30, "d"), (0, import_dayjs2.default)()] },
|
|
877
975
|
{ label: "Last 90 Days", value: [(0, import_dayjs2.default)().add(-90, "d"), (0, import_dayjs2.default)()] }
|
|
878
976
|
];
|
|
879
|
-
|
|
977
|
+
const disabledDate = (current) => {
|
|
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
|
+
value: props.value
|
|
987
|
+
}
|
|
988
|
+
));
|
|
880
989
|
};
|
|
881
990
|
|
|
882
991
|
// src/Components/Image.tsx
|
|
@@ -955,7 +1064,7 @@ var DropDownGroup = (props) => {
|
|
|
955
1064
|
// src/Components/FilesUpload.tsx
|
|
956
1065
|
var import_react26 = __toESM(require("react"));
|
|
957
1066
|
var import_antd19 = require("antd");
|
|
958
|
-
var
|
|
1067
|
+
var import_icons5 = require("@ant-design/icons");
|
|
959
1068
|
var FileUpload = (props) => {
|
|
960
1069
|
const { Dragger } = import_antd19.Upload;
|
|
961
1070
|
const [files, setFiles] = (0, import_react26.useState)([]);
|
|
@@ -986,7 +1095,7 @@ var FileUpload = (props) => {
|
|
|
986
1095
|
showUploadList: true,
|
|
987
1096
|
customRequest
|
|
988
1097
|
},
|
|
989
|
-
/* @__PURE__ */ import_react26.default.createElement("p", null, /* @__PURE__ */ import_react26.default.createElement(
|
|
1098
|
+
/* @__PURE__ */ import_react26.default.createElement("p", null, /* @__PURE__ */ import_react26.default.createElement(import_icons5.InboxOutlined, null)),
|
|
990
1099
|
/* @__PURE__ */ import_react26.default.createElement("p", null, "Click or drag file to upload")
|
|
991
1100
|
));
|
|
992
1101
|
};
|
|
@@ -1383,147 +1492,13 @@ var LineChart = (props) => {
|
|
|
1383
1492
|
return /* @__PURE__ */ import_react34.default.createElement("div", { className: props.className }, /* @__PURE__ */ import_react34.default.createElement("canvas", { ref: chartRef }));
|
|
1384
1493
|
};
|
|
1385
1494
|
|
|
1386
|
-
// src/Components/highchart.tsx
|
|
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
1495
|
// src/Components/DoubleBarChart.tsx
|
|
1521
|
-
var
|
|
1496
|
+
var import_react35 = __toESM(require("react"));
|
|
1522
1497
|
var import_auto2 = __toESM(require("chart.js/auto"));
|
|
1523
1498
|
var DoubleBarChart = (props) => {
|
|
1524
|
-
const chartRef = (0,
|
|
1525
|
-
const chartInstance = (0,
|
|
1526
|
-
(0,
|
|
1499
|
+
const chartRef = (0, import_react35.useRef)(null);
|
|
1500
|
+
const chartInstance = (0, import_react35.useRef)(null);
|
|
1501
|
+
(0, import_react35.useEffect)(() => {
|
|
1527
1502
|
if (chartRef.current) {
|
|
1528
1503
|
if (chartInstance.current) {
|
|
1529
1504
|
chartInstance.current.destroy();
|
|
@@ -1592,11 +1567,11 @@ var DoubleBarChart = (props) => {
|
|
|
1592
1567
|
}
|
|
1593
1568
|
};
|
|
1594
1569
|
}, []);
|
|
1595
|
-
return /* @__PURE__ */
|
|
1570
|
+
return /* @__PURE__ */ import_react35.default.createElement("div", { className: props.className }, /* @__PURE__ */ import_react35.default.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ import_react35.default.createElement("canvas", { ref: chartRef }));
|
|
1596
1571
|
};
|
|
1597
1572
|
|
|
1598
1573
|
// src/Components/BarChart.tsx
|
|
1599
|
-
var
|
|
1574
|
+
var import_react36 = __toESM(require("react"));
|
|
1600
1575
|
var import_react_chartjs_24 = require("react-chartjs-2");
|
|
1601
1576
|
var import_chart4 = require("chart.js");
|
|
1602
1577
|
import_chart4.Chart.register(import_chart4.BarElement, import_chart4.CategoryScale, import_chart4.LinearScale, import_chart4.Tooltip);
|
|
@@ -1658,7 +1633,7 @@ var BarChart = (props) => {
|
|
|
1658
1633
|
}
|
|
1659
1634
|
}
|
|
1660
1635
|
};
|
|
1661
|
-
return /* @__PURE__ */
|
|
1636
|
+
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(import_react_chartjs_24.Bar, { data, options }));
|
|
1662
1637
|
};
|
|
1663
1638
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1664
1639
|
0 && (module.exports = {
|
|
@@ -1673,7 +1648,6 @@ var BarChart = (props) => {
|
|
|
1673
1648
|
DoubleBarChart,
|
|
1674
1649
|
DropDownGroup,
|
|
1675
1650
|
FileUpload,
|
|
1676
|
-
HighchartsLineChart,
|
|
1677
1651
|
HorizontalBarChart,
|
|
1678
1652
|
Image,
|
|
1679
1653
|
LineChart,
|
package/dist/index.mjs
CHANGED
|
@@ -319,7 +319,9 @@ 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(
|
|
322
|
+
const [originalSvgContent, setOriginalSvgContent] = useState4(
|
|
323
|
+
null
|
|
324
|
+
);
|
|
323
325
|
const [hoverColor, setHoverColor] = useState4(null);
|
|
324
326
|
useEffect(() => {
|
|
325
327
|
if (props.icon) {
|
|
@@ -356,7 +358,7 @@ var ButtonElement = (props) => {
|
|
|
356
358
|
}
|
|
357
359
|
}).catch((error) => console.error("Error fetching SVG:", error));
|
|
358
360
|
}
|
|
359
|
-
}, [
|
|
361
|
+
}, []);
|
|
360
362
|
const handleMouseEnter = () => {
|
|
361
363
|
if (hoverColor && originalSvgContent) {
|
|
362
364
|
const tempDiv = document.createElement("div");
|
|
@@ -384,12 +386,14 @@ var ButtonElement = (props) => {
|
|
|
384
386
|
cursor: props.loading ? "no-drop" : "pointer"
|
|
385
387
|
}
|
|
386
388
|
},
|
|
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(
|
|
388
|
-
"
|
|
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
|
+
"img",
|
|
389
391
|
{
|
|
390
|
-
|
|
392
|
+
className: props.iconsClassName,
|
|
393
|
+
src: props.icon,
|
|
394
|
+
alt: props.label
|
|
391
395
|
}
|
|
392
|
-
), props.label)
|
|
396
|
+
) : svgContent ? /* @__PURE__ */ React11.createElement("span", { dangerouslySetInnerHTML: { __html: svgContent } }) : /* @__PURE__ */ React11.createElement("img", { src: "", className: props.iconsClassName }), props.label)
|
|
393
397
|
);
|
|
394
398
|
};
|
|
395
399
|
|
|
@@ -608,7 +612,7 @@ var Navbar = (props) => {
|
|
|
608
612
|
};
|
|
609
613
|
|
|
610
614
|
// src/Components/TableElement.tsx
|
|
611
|
-
import React20, { useState as useState6 } from "react";
|
|
615
|
+
import React20, { useState as useState6, useEffect as useEffect3 } from "react";
|
|
612
616
|
import { Table as Table2 } from "antd";
|
|
613
617
|
|
|
614
618
|
// src/Components/Model.tsx
|
|
@@ -617,18 +621,48 @@ import { Modal } from "antd";
|
|
|
617
621
|
|
|
618
622
|
// src/Components/ModelBody.tsx
|
|
619
623
|
import React18 from "react";
|
|
624
|
+
import moment from "moment";
|
|
620
625
|
var ModelBody = (props) => {
|
|
621
|
-
return /* @__PURE__ */ React18.createElement("div", { className: props.modalContent && props.modalContent.className }, props.modalContent && props.modalContent.fields.map(
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
626
|
+
return /* @__PURE__ */ React18.createElement("div", { className: props.modalContent && props.modalContent.className }, props.modalContent && props.modalContent.fields.map(
|
|
627
|
+
(eachField) => {
|
|
628
|
+
if (eachField.element === "div") {
|
|
629
|
+
return /* @__PURE__ */ React18.createElement("div", { className: eachField.className }, eachField.label, eachField.dateTime ? /* @__PURE__ */ React18.createElement(
|
|
630
|
+
"p",
|
|
631
|
+
{
|
|
632
|
+
style: {
|
|
633
|
+
fontSize: "10px",
|
|
634
|
+
textAlign: eachField.source === "bot" ? "left" : "right"
|
|
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
|
+
}
|
|
630
664
|
}
|
|
631
|
-
|
|
665
|
+
));
|
|
632
666
|
};
|
|
633
667
|
|
|
634
668
|
// src/Components/Model.tsx
|
|
@@ -653,9 +687,22 @@ var ModelElement = (props) => {
|
|
|
653
687
|
margin: "-10px"
|
|
654
688
|
}
|
|
655
689
|
},
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
690
|
+
columns.map((eachColumn) => {
|
|
691
|
+
if (!["index", "View"].includes(eachColumn.key) && eachColumn?.["is_detail"] !== false) {
|
|
692
|
+
return /* @__PURE__ */ React19.createElement("p", { style: { fontWeight: "500", padding: "10px" } }, /* @__PURE__ */ React19.createElement(
|
|
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
|
+
}
|
|
659
706
|
})
|
|
660
707
|
)
|
|
661
708
|
},
|
|
@@ -664,12 +711,24 @@ var ModelElement = (props) => {
|
|
|
664
711
|
};
|
|
665
712
|
|
|
666
713
|
// src/Components/TableElement.tsx
|
|
714
|
+
import { EyeOutlined } from "@ant-design/icons";
|
|
667
715
|
var TableElement = (props) => {
|
|
668
716
|
const { thead, tbody } = props;
|
|
669
717
|
const [selectedRecord, setSelectedRecord] = useState6({});
|
|
670
718
|
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]);
|
|
671
731
|
const handleChange = (record) => {
|
|
672
|
-
console.log("record", record);
|
|
673
732
|
if (props.onChange) {
|
|
674
733
|
props.onChange(record);
|
|
675
734
|
}
|
|
@@ -679,8 +738,8 @@ var TableElement = (props) => {
|
|
|
679
738
|
columns = [
|
|
680
739
|
{
|
|
681
740
|
title: "#",
|
|
682
|
-
dataIndex: "
|
|
683
|
-
key: "
|
|
741
|
+
dataIndex: "index",
|
|
742
|
+
key: "index",
|
|
684
743
|
fixed: "left"
|
|
685
744
|
},
|
|
686
745
|
...thead.map((col, ind) => ({
|
|
@@ -691,9 +750,9 @@ var TableElement = (props) => {
|
|
|
691
750
|
render: col.render,
|
|
692
751
|
sorter: {
|
|
693
752
|
compare: (a, b) => {
|
|
694
|
-
if (typeof a[col.key] === "number" && typeof
|
|
753
|
+
if (typeof a[col.key] === "number" && typeof b[col.key] === "number") {
|
|
695
754
|
return a[col.key] - b[col.key];
|
|
696
|
-
} else if (typeof a[col.key] === "string" && typeof
|
|
755
|
+
} else if (typeof a[col.key] === "string" && typeof b[col.key] === "string") {
|
|
697
756
|
return a[col.key].localeCompare(b[col.key]);
|
|
698
757
|
}
|
|
699
758
|
}
|
|
@@ -705,26 +764,34 @@ var TableElement = (props) => {
|
|
|
705
764
|
title: "View",
|
|
706
765
|
dataIndex: "View",
|
|
707
766
|
key: "View",
|
|
708
|
-
render: (_, record) =>
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
767
|
+
render: (_, record) => {
|
|
768
|
+
return /* @__PURE__ */ React20.createElement(
|
|
769
|
+
"a",
|
|
770
|
+
{
|
|
771
|
+
onClick: () => {
|
|
772
|
+
if (props.view) {
|
|
773
|
+
setSelectedRecord(record);
|
|
774
|
+
handleChange(record);
|
|
775
|
+
setModel(true);
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
},
|
|
779
|
+
/* @__PURE__ */ React20.createElement(EyeOutlined, null)
|
|
780
|
+
);
|
|
781
|
+
}
|
|
719
782
|
});
|
|
720
783
|
}
|
|
721
784
|
}
|
|
722
|
-
const
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
785
|
+
const onChangeTable = (pagination, filters, sorter, extra) => {
|
|
786
|
+
if (extra && extra.currentDataSource) {
|
|
787
|
+
setDataSource(
|
|
788
|
+
extra.currentDataSource.map((row, index) => ({
|
|
789
|
+
...row,
|
|
790
|
+
index: index + 1
|
|
791
|
+
}))
|
|
792
|
+
);
|
|
793
|
+
}
|
|
794
|
+
};
|
|
728
795
|
const onChangePage = (page, pageSize) => {
|
|
729
796
|
if (props.onChange) {
|
|
730
797
|
props.onChange({ name: "pagination", page, pageSize });
|
|
@@ -732,7 +799,11 @@ var TableElement = (props) => {
|
|
|
732
799
|
};
|
|
733
800
|
const rowSelectionConfig = props.rowSelection ? {
|
|
734
801
|
onChange: (selectedRowKeys, selectedRows) => {
|
|
735
|
-
console.log(
|
|
802
|
+
console.log(
|
|
803
|
+
`selectedRowKeys: ${selectedRowKeys}`,
|
|
804
|
+
"selectedRows: ",
|
|
805
|
+
selectedRows
|
|
806
|
+
);
|
|
736
807
|
if (props.onChange) {
|
|
737
808
|
props.onChange(selectedRows);
|
|
738
809
|
}
|
|
@@ -742,19 +813,41 @@ var TableElement = (props) => {
|
|
|
742
813
|
Table2,
|
|
743
814
|
{
|
|
744
815
|
className: props.className,
|
|
745
|
-
pagination: {
|
|
816
|
+
pagination: props.pagination ? {
|
|
746
817
|
showTotal: (total) => `Total: ${total} items`,
|
|
747
|
-
total: count,
|
|
748
|
-
showSizeChanger: count > 10,
|
|
818
|
+
total: props.count,
|
|
819
|
+
showSizeChanger: props.count ? props.count > 10 : 0 > 10,
|
|
749
820
|
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
|
+
};
|
|
750
833
|
},
|
|
751
834
|
rowSelection: rowSelectionConfig,
|
|
752
835
|
dataSource,
|
|
753
836
|
columns,
|
|
754
837
|
size: props.size,
|
|
755
|
-
bordered: true
|
|
838
|
+
bordered: true,
|
|
839
|
+
onChange: onChangeTable
|
|
756
840
|
}
|
|
757
|
-
), model && /* @__PURE__ */ React20.createElement(
|
|
841
|
+
), model && /* @__PURE__ */ React20.createElement(
|
|
842
|
+
ModelElement,
|
|
843
|
+
{
|
|
844
|
+
selectedRecord,
|
|
845
|
+
...props,
|
|
846
|
+
columns,
|
|
847
|
+
model,
|
|
848
|
+
onCancel: () => setModel(false)
|
|
849
|
+
}
|
|
850
|
+
));
|
|
758
851
|
};
|
|
759
852
|
|
|
760
853
|
// src/Components/DatePicker.tsx
|
|
@@ -762,6 +855,7 @@ import React21, { useState as useState7 } from "react";
|
|
|
762
855
|
import { DatePicker } from "antd";
|
|
763
856
|
import dayjs from "dayjs";
|
|
764
857
|
import customParseFormat from "dayjs/plugin/customParseFormat.js";
|
|
858
|
+
import moment2 from "moment";
|
|
765
859
|
dayjs.extend(customParseFormat);
|
|
766
860
|
var DatePickerElement = (props) => {
|
|
767
861
|
const [dateState, setDateState] = useState7("");
|
|
@@ -779,9 +873,13 @@ var DatePickerElement = (props) => {
|
|
|
779
873
|
}
|
|
780
874
|
}
|
|
781
875
|
};
|
|
876
|
+
const disabledDate = (current) => {
|
|
877
|
+
return current && current > moment2();
|
|
878
|
+
};
|
|
782
879
|
return /* @__PURE__ */ React21.createElement("div", null, /* @__PURE__ */ React21.createElement(
|
|
783
880
|
DatePicker,
|
|
784
881
|
{
|
|
882
|
+
disabledDate,
|
|
785
883
|
placeholder: props.placeholder,
|
|
786
884
|
value: dateState,
|
|
787
885
|
format: { format: "DD-MM-YYYY" },
|
|
@@ -794,13 +892,14 @@ var DatePickerElement = (props) => {
|
|
|
794
892
|
import React22 from "react";
|
|
795
893
|
import { DatePicker as DatePicker2, Space } from "antd";
|
|
796
894
|
import dayjs2 from "dayjs";
|
|
895
|
+
import moment3 from "moment";
|
|
797
896
|
var DateRangePickerElement = (props) => {
|
|
798
897
|
const { RangePicker } = DatePicker2;
|
|
799
898
|
const handleChange = (dates, dateStrings) => {
|
|
800
|
-
if (dates
|
|
801
|
-
props.onChange(dateStrings);
|
|
899
|
+
if (dates) {
|
|
900
|
+
props.onChange && props.onChange(dateStrings);
|
|
802
901
|
} else {
|
|
803
|
-
|
|
902
|
+
props.onChange && props.onChange("clear");
|
|
804
903
|
}
|
|
805
904
|
};
|
|
806
905
|
const rangePresets = [
|
|
@@ -809,7 +908,18 @@ var DateRangePickerElement = (props) => {
|
|
|
809
908
|
{ label: "Last 30 Days", value: [dayjs2().add(-30, "d"), dayjs2()] },
|
|
810
909
|
{ label: "Last 90 Days", value: [dayjs2().add(-90, "d"), dayjs2()] }
|
|
811
910
|
];
|
|
812
|
-
|
|
911
|
+
const disabledDate = (current) => {
|
|
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
|
+
value: props.value
|
|
921
|
+
}
|
|
922
|
+
));
|
|
813
923
|
};
|
|
814
924
|
|
|
815
925
|
// src/Components/Image.tsx
|
|
@@ -973,7 +1083,7 @@ var Upload2 = (props) => {
|
|
|
973
1083
|
};
|
|
974
1084
|
|
|
975
1085
|
// src/Components/OtpElement.tsx
|
|
976
|
-
import React30, { useState as useState11, useRef, useEffect as
|
|
1086
|
+
import React30, { useState as useState11, useRef, useEffect as useEffect4 } from "react";
|
|
977
1087
|
import { Input as Input3 } from "antd";
|
|
978
1088
|
var OtpElement = (props) => {
|
|
979
1089
|
const length = props.length;
|
|
@@ -1010,7 +1120,7 @@ var OtpElement = (props) => {
|
|
|
1010
1120
|
});
|
|
1011
1121
|
}
|
|
1012
1122
|
};
|
|
1013
|
-
|
|
1123
|
+
useEffect4(() => {
|
|
1014
1124
|
inputRefs.current[0]?.focus();
|
|
1015
1125
|
}, []);
|
|
1016
1126
|
return /* @__PURE__ */ React30.createElement("div", { className: props.containerClassName }, Array.from({ length }).map((_, index) => /* @__PURE__ */ React30.createElement(
|
|
@@ -1262,7 +1372,7 @@ var HorizontalBarChart = (props) => {
|
|
|
1262
1372
|
};
|
|
1263
1373
|
|
|
1264
1374
|
// src/Components/LineChart.tsx
|
|
1265
|
-
import React34, { useEffect as
|
|
1375
|
+
import React34, { useEffect as useEffect5, useRef as useRef2 } from "react";
|
|
1266
1376
|
import Chart from "chart.js/auto";
|
|
1267
1377
|
var LineChart = (props) => {
|
|
1268
1378
|
const chartRef = useRef2(null);
|
|
@@ -1273,7 +1383,7 @@ var LineChart = (props) => {
|
|
|
1273
1383
|
{ label: "Conversion Rate", data: [50, 100, 150, 180, 50] }
|
|
1274
1384
|
];
|
|
1275
1385
|
const labels = ["Instagram", "Whatsapp", "Messages", "Telegram", "Linkedin"];
|
|
1276
|
-
|
|
1386
|
+
useEffect5(() => {
|
|
1277
1387
|
if (chartRef.current) {
|
|
1278
1388
|
if (chartInstance.current) {
|
|
1279
1389
|
chartInstance.current.destroy();
|
|
@@ -1334,147 +1444,13 @@ var LineChart = (props) => {
|
|
|
1334
1444
|
return /* @__PURE__ */ React34.createElement("div", { className: props.className }, /* @__PURE__ */ React34.createElement("canvas", { ref: chartRef }));
|
|
1335
1445
|
};
|
|
1336
1446
|
|
|
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
|
-
|
|
1471
1447
|
// src/Components/DoubleBarChart.tsx
|
|
1472
|
-
import
|
|
1448
|
+
import React35, { useEffect as useEffect6, useRef as useRef3 } from "react";
|
|
1473
1449
|
import Chart2 from "chart.js/auto";
|
|
1474
1450
|
var DoubleBarChart = (props) => {
|
|
1475
1451
|
const chartRef = useRef3(null);
|
|
1476
1452
|
const chartInstance = useRef3(null);
|
|
1477
|
-
|
|
1453
|
+
useEffect6(() => {
|
|
1478
1454
|
if (chartRef.current) {
|
|
1479
1455
|
if (chartInstance.current) {
|
|
1480
1456
|
chartInstance.current.destroy();
|
|
@@ -1543,11 +1519,11 @@ var DoubleBarChart = (props) => {
|
|
|
1543
1519
|
}
|
|
1544
1520
|
};
|
|
1545
1521
|
}, []);
|
|
1546
|
-
return /* @__PURE__ */
|
|
1522
|
+
return /* @__PURE__ */ React35.createElement("div", { className: props.className }, /* @__PURE__ */ React35.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ React35.createElement("canvas", { ref: chartRef }));
|
|
1547
1523
|
};
|
|
1548
1524
|
|
|
1549
1525
|
// src/Components/BarChart.tsx
|
|
1550
|
-
import
|
|
1526
|
+
import React36 from "react";
|
|
1551
1527
|
import { Bar as Bar2 } from "react-chartjs-2";
|
|
1552
1528
|
import {
|
|
1553
1529
|
Chart as ChartJS4,
|
|
@@ -1615,7 +1591,7 @@ var BarChart = (props) => {
|
|
|
1615
1591
|
}
|
|
1616
1592
|
}
|
|
1617
1593
|
};
|
|
1618
|
-
return /* @__PURE__ */
|
|
1594
|
+
return /* @__PURE__ */ React36.createElement("div", { className: props.className }, /* @__PURE__ */ React36.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ React36.createElement(Bar2, { data, options }));
|
|
1619
1595
|
};
|
|
1620
1596
|
export {
|
|
1621
1597
|
AddMoreTable,
|
|
@@ -1629,7 +1605,6 @@ export {
|
|
|
1629
1605
|
DoubleBarChart,
|
|
1630
1606
|
DropDownGroup,
|
|
1631
1607
|
FileUpload,
|
|
1632
|
-
HighchartsLineChart,
|
|
1633
1608
|
HorizontalBarChart,
|
|
1634
1609
|
Image,
|
|
1635
1610
|
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
|
+
|