@apexcura/ui-components 0.0.14-Beta187 → 0.0.14-Beta188
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 +68 -170
- package/dist/index.mjs +68 -171
- 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 && /* @__PURE__ */ import_react11.default.createElement(
|
|
456
|
-
"
|
|
454
|
+
props.isLoading ? /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, /* @__PURE__ */ import_react11.default.createElement("svg", { className: "animate-spin h-5 w-5 mr-3", viewBox: "0 0 24 24" }), props.label) : /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, props.isSVGStylesOverride === false ? props.icon && /* @__PURE__ */ import_react11.default.createElement("img", { className: props.iconsClassName, src: props.icon, alt: props.label }) : svgContent && /* @__PURE__ */ import_react11.default.createElement(
|
|
455
|
+
"span",
|
|
457
456
|
{
|
|
458
|
-
|
|
459
|
-
src: props.icon,
|
|
460
|
-
alt: props.label
|
|
457
|
+
dangerouslySetInnerHTML: { __html: svgContent }
|
|
461
458
|
}
|
|
462
|
-
)
|
|
459
|
+
), props.label)
|
|
463
460
|
);
|
|
464
461
|
};
|
|
465
462
|
|
|
@@ -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,18 +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
|
-
value: props.value
|
|
987
|
-
}
|
|
988
|
-
));
|
|
879
|
+
return /* @__PURE__ */ import_react22.default.createElement(import_antd16.Space, { direction: "vertical", size: 12 }, /* @__PURE__ */ import_react22.default.createElement(RangePicker, { presets: rangePresets, onChange: handleChange }));
|
|
989
880
|
};
|
|
990
881
|
|
|
991
882
|
// src/Components/Image.tsx
|
|
@@ -1064,7 +955,7 @@ var DropDownGroup = (props) => {
|
|
|
1064
955
|
// src/Components/FilesUpload.tsx
|
|
1065
956
|
var import_react26 = __toESM(require("react"));
|
|
1066
957
|
var import_antd19 = require("antd");
|
|
1067
|
-
var
|
|
958
|
+
var import_icons4 = require("@ant-design/icons");
|
|
1068
959
|
var FileUpload = (props) => {
|
|
1069
960
|
const { Dragger } = import_antd19.Upload;
|
|
1070
961
|
const [files, setFiles] = (0, import_react26.useState)([]);
|
|
@@ -1095,7 +986,7 @@ var FileUpload = (props) => {
|
|
|
1095
986
|
showUploadList: true,
|
|
1096
987
|
customRequest
|
|
1097
988
|
},
|
|
1098
|
-
/* @__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)),
|
|
1099
990
|
/* @__PURE__ */ import_react26.default.createElement("p", null, "Click or drag file to upload")
|
|
1100
991
|
));
|
|
1101
992
|
};
|
|
@@ -1492,13 +1383,19 @@ var LineChart = (props) => {
|
|
|
1492
1383
|
return /* @__PURE__ */ import_react34.default.createElement("div", { className: props.className }, /* @__PURE__ */ import_react34.default.createElement("canvas", { ref: chartRef }));
|
|
1493
1384
|
};
|
|
1494
1385
|
|
|
1495
|
-
// src/Components/
|
|
1386
|
+
// src/Components/highchart.tsx
|
|
1496
1387
|
var import_react35 = __toESM(require("react"));
|
|
1388
|
+
var HighchartsLineChart = (props) => {
|
|
1389
|
+
return /* @__PURE__ */ import_react35.default.createElement("div", null, /* @__PURE__ */ import_react35.default.createElement("h1", null, "123456789"));
|
|
1390
|
+
};
|
|
1391
|
+
|
|
1392
|
+
// src/Components/DoubleBarChart.tsx
|
|
1393
|
+
var import_react36 = __toESM(require("react"));
|
|
1497
1394
|
var import_auto2 = __toESM(require("chart.js/auto"));
|
|
1498
1395
|
var DoubleBarChart = (props) => {
|
|
1499
|
-
const chartRef = (0,
|
|
1500
|
-
const chartInstance = (0,
|
|
1501
|
-
(0,
|
|
1396
|
+
const chartRef = (0, import_react36.useRef)(null);
|
|
1397
|
+
const chartInstance = (0, import_react36.useRef)(null);
|
|
1398
|
+
(0, import_react36.useEffect)(() => {
|
|
1502
1399
|
if (chartRef.current) {
|
|
1503
1400
|
if (chartInstance.current) {
|
|
1504
1401
|
chartInstance.current.destroy();
|
|
@@ -1567,11 +1464,11 @@ var DoubleBarChart = (props) => {
|
|
|
1567
1464
|
}
|
|
1568
1465
|
};
|
|
1569
1466
|
}, []);
|
|
1570
|
-
return /* @__PURE__ */
|
|
1467
|
+
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 }));
|
|
1571
1468
|
};
|
|
1572
1469
|
|
|
1573
1470
|
// src/Components/BarChart.tsx
|
|
1574
|
-
var
|
|
1471
|
+
var import_react37 = __toESM(require("react"));
|
|
1575
1472
|
var import_react_chartjs_24 = require("react-chartjs-2");
|
|
1576
1473
|
var import_chart4 = require("chart.js");
|
|
1577
1474
|
import_chart4.Chart.register(import_chart4.BarElement, import_chart4.CategoryScale, import_chart4.LinearScale, import_chart4.Tooltip);
|
|
@@ -1633,7 +1530,7 @@ var BarChart = (props) => {
|
|
|
1633
1530
|
}
|
|
1634
1531
|
}
|
|
1635
1532
|
};
|
|
1636
|
-
return /* @__PURE__ */
|
|
1533
|
+
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 }));
|
|
1637
1534
|
};
|
|
1638
1535
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1639
1536
|
0 && (module.exports = {
|
|
@@ -1648,6 +1545,7 @@ var BarChart = (props) => {
|
|
|
1648
1545
|
DoubleBarChart,
|
|
1649
1546
|
DropDownGroup,
|
|
1650
1547
|
FileUpload,
|
|
1548
|
+
HighchartsLineChart,
|
|
1651
1549
|
HorizontalBarChart,
|
|
1652
1550
|
Image,
|
|
1653
1551
|
LineChart,
|
package/dist/index.mjs
CHANGED
|
@@ -319,9 +319,7 @@ var MultipleSelectElement = (props) => {
|
|
|
319
319
|
import React11, { useEffect, useState as useState4 } from "react";
|
|
320
320
|
var ButtonElement = (props) => {
|
|
321
321
|
const [svgContent, setSvgContent] = useState4(null);
|
|
322
|
-
const [originalSvgContent, setOriginalSvgContent] = useState4(
|
|
323
|
-
null
|
|
324
|
-
);
|
|
322
|
+
const [originalSvgContent, setOriginalSvgContent] = useState4(null);
|
|
325
323
|
const [hoverColor, setHoverColor] = useState4(null);
|
|
326
324
|
useEffect(() => {
|
|
327
325
|
if (props.icon) {
|
|
@@ -358,7 +356,7 @@ var ButtonElement = (props) => {
|
|
|
358
356
|
}
|
|
359
357
|
}).catch((error) => console.error("Error fetching SVG:", error));
|
|
360
358
|
}
|
|
361
|
-
}, []);
|
|
359
|
+
}, [props.icon, props.className]);
|
|
362
360
|
const handleMouseEnter = () => {
|
|
363
361
|
if (hoverColor && originalSvgContent) {
|
|
364
362
|
const tempDiv = document.createElement("div");
|
|
@@ -386,14 +384,12 @@ var ButtonElement = (props) => {
|
|
|
386
384
|
cursor: props.loading ? "no-drop" : "pointer"
|
|
387
385
|
}
|
|
388
386
|
},
|
|
389
|
-
props.isLoading ? /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement("svg", { className: "animate-spin h-5 w-5 mr-3", viewBox: "0 0 24 24" }), props.label) : /* @__PURE__ */ React11.createElement(React11.Fragment, null, props.isSVGStylesOverride === false ? props.icon && /* @__PURE__ */ React11.createElement(
|
|
390
|
-
"
|
|
387
|
+
props.isLoading ? /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement("svg", { className: "animate-spin h-5 w-5 mr-3", viewBox: "0 0 24 24" }), props.label) : /* @__PURE__ */ React11.createElement(React11.Fragment, null, props.isSVGStylesOverride === false ? props.icon && /* @__PURE__ */ React11.createElement("img", { className: props.iconsClassName, src: props.icon, alt: props.label }) : svgContent && /* @__PURE__ */ React11.createElement(
|
|
388
|
+
"span",
|
|
391
389
|
{
|
|
392
|
-
|
|
393
|
-
src: props.icon,
|
|
394
|
-
alt: props.label
|
|
390
|
+
dangerouslySetInnerHTML: { __html: svgContent }
|
|
395
391
|
}
|
|
396
|
-
)
|
|
392
|
+
), props.label)
|
|
397
393
|
);
|
|
398
394
|
};
|
|
399
395
|
|
|
@@ -612,7 +608,7 @@ var Navbar = (props) => {
|
|
|
612
608
|
};
|
|
613
609
|
|
|
614
610
|
// src/Components/TableElement.tsx
|
|
615
|
-
import React20, { useState as useState6
|
|
611
|
+
import React20, { useState as useState6 } from "react";
|
|
616
612
|
import { Table as Table2 } from "antd";
|
|
617
613
|
|
|
618
614
|
// src/Components/Model.tsx
|
|
@@ -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,18 +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
|
-
value: props.value
|
|
921
|
-
}
|
|
922
|
-
));
|
|
812
|
+
return /* @__PURE__ */ React22.createElement(Space, { direction: "vertical", size: 12 }, /* @__PURE__ */ React22.createElement(RangePicker, { presets: rangePresets, onChange: handleChange }));
|
|
923
813
|
};
|
|
924
814
|
|
|
925
815
|
// src/Components/Image.tsx
|
|
@@ -1083,7 +973,7 @@ var Upload2 = (props) => {
|
|
|
1083
973
|
};
|
|
1084
974
|
|
|
1085
975
|
// src/Components/OtpElement.tsx
|
|
1086
|
-
import React30, { useState as useState11, useRef, useEffect as
|
|
976
|
+
import React30, { useState as useState11, useRef, useEffect as useEffect3 } from "react";
|
|
1087
977
|
import { Input as Input3 } from "antd";
|
|
1088
978
|
var OtpElement = (props) => {
|
|
1089
979
|
const length = props.length;
|
|
@@ -1120,7 +1010,7 @@ var OtpElement = (props) => {
|
|
|
1120
1010
|
});
|
|
1121
1011
|
}
|
|
1122
1012
|
};
|
|
1123
|
-
|
|
1013
|
+
useEffect3(() => {
|
|
1124
1014
|
inputRefs.current[0]?.focus();
|
|
1125
1015
|
}, []);
|
|
1126
1016
|
return /* @__PURE__ */ React30.createElement("div", { className: props.containerClassName }, Array.from({ length }).map((_, index) => /* @__PURE__ */ React30.createElement(
|
|
@@ -1372,7 +1262,7 @@ var HorizontalBarChart = (props) => {
|
|
|
1372
1262
|
};
|
|
1373
1263
|
|
|
1374
1264
|
// src/Components/LineChart.tsx
|
|
1375
|
-
import React34, { useEffect as
|
|
1265
|
+
import React34, { useEffect as useEffect4, useRef as useRef2 } from "react";
|
|
1376
1266
|
import Chart from "chart.js/auto";
|
|
1377
1267
|
var LineChart = (props) => {
|
|
1378
1268
|
const chartRef = useRef2(null);
|
|
@@ -1383,7 +1273,7 @@ var LineChart = (props) => {
|
|
|
1383
1273
|
{ label: "Conversion Rate", data: [50, 100, 150, 180, 50] }
|
|
1384
1274
|
];
|
|
1385
1275
|
const labels = ["Instagram", "Whatsapp", "Messages", "Telegram", "Linkedin"];
|
|
1386
|
-
|
|
1276
|
+
useEffect4(() => {
|
|
1387
1277
|
if (chartRef.current) {
|
|
1388
1278
|
if (chartInstance.current) {
|
|
1389
1279
|
chartInstance.current.destroy();
|
|
@@ -1444,13 +1334,19 @@ var LineChart = (props) => {
|
|
|
1444
1334
|
return /* @__PURE__ */ React34.createElement("div", { className: props.className }, /* @__PURE__ */ React34.createElement("canvas", { ref: chartRef }));
|
|
1445
1335
|
};
|
|
1446
1336
|
|
|
1337
|
+
// src/Components/highchart.tsx
|
|
1338
|
+
import React35 from "react";
|
|
1339
|
+
var HighchartsLineChart = (props) => {
|
|
1340
|
+
return /* @__PURE__ */ React35.createElement("div", null, /* @__PURE__ */ React35.createElement("h1", null, "123456789"));
|
|
1341
|
+
};
|
|
1342
|
+
|
|
1447
1343
|
// src/Components/DoubleBarChart.tsx
|
|
1448
|
-
import
|
|
1344
|
+
import React36, { useEffect as useEffect5, useRef as useRef3 } from "react";
|
|
1449
1345
|
import Chart2 from "chart.js/auto";
|
|
1450
1346
|
var DoubleBarChart = (props) => {
|
|
1451
1347
|
const chartRef = useRef3(null);
|
|
1452
1348
|
const chartInstance = useRef3(null);
|
|
1453
|
-
|
|
1349
|
+
useEffect5(() => {
|
|
1454
1350
|
if (chartRef.current) {
|
|
1455
1351
|
if (chartInstance.current) {
|
|
1456
1352
|
chartInstance.current.destroy();
|
|
@@ -1519,11 +1415,11 @@ var DoubleBarChart = (props) => {
|
|
|
1519
1415
|
}
|
|
1520
1416
|
};
|
|
1521
1417
|
}, []);
|
|
1522
|
-
return /* @__PURE__ */
|
|
1418
|
+
return /* @__PURE__ */ React36.createElement("div", { className: props.className }, /* @__PURE__ */ React36.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ React36.createElement("canvas", { ref: chartRef }));
|
|
1523
1419
|
};
|
|
1524
1420
|
|
|
1525
1421
|
// src/Components/BarChart.tsx
|
|
1526
|
-
import
|
|
1422
|
+
import React37 from "react";
|
|
1527
1423
|
import { Bar as Bar2 } from "react-chartjs-2";
|
|
1528
1424
|
import {
|
|
1529
1425
|
Chart as ChartJS4,
|
|
@@ -1591,7 +1487,7 @@ var BarChart = (props) => {
|
|
|
1591
1487
|
}
|
|
1592
1488
|
}
|
|
1593
1489
|
};
|
|
1594
|
-
return /* @__PURE__ */
|
|
1490
|
+
return /* @__PURE__ */ React37.createElement("div", { className: props.className }, /* @__PURE__ */ React37.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ React37.createElement(Bar2, { data, options }));
|
|
1595
1491
|
};
|
|
1596
1492
|
export {
|
|
1597
1493
|
AddMoreTable,
|
|
@@ -1605,6 +1501,7 @@ export {
|
|
|
1605
1501
|
DoubleBarChart,
|
|
1606
1502
|
DropDownGroup,
|
|
1607
1503
|
FileUpload,
|
|
1504
|
+
HighchartsLineChart,
|
|
1608
1505
|
HorizontalBarChart,
|
|
1609
1506
|
Image,
|
|
1610
1507
|
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
|
+
|