@apexcura/ui-components 0.0.14-Beta184 → 0.0.14-Beta185
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 +169 -69
- package/dist/index.mjs +170 -69
- 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 function HighchartsLineChart(): 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 function HighchartsLineChart(): 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: () => highchart_default,
|
|
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
|
|
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
|
+
) : /* @__PURE__ */ import_react11.default.createElement("img", { src: "", alt: "", className: props.iconsClassName }) : svgContent && /* @__PURE__ */ import_react11.default.createElement("span", { dangerouslySetInnerHTML: { __html: svgContent } }), 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,17 @@ 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
|
+
}
|
|
987
|
+
));
|
|
880
988
|
};
|
|
881
989
|
|
|
882
990
|
// src/Components/Image.tsx
|
|
@@ -955,7 +1063,7 @@ var DropDownGroup = (props) => {
|
|
|
955
1063
|
// src/Components/FilesUpload.tsx
|
|
956
1064
|
var import_react26 = __toESM(require("react"));
|
|
957
1065
|
var import_antd19 = require("antd");
|
|
958
|
-
var
|
|
1066
|
+
var import_icons5 = require("@ant-design/icons");
|
|
959
1067
|
var FileUpload = (props) => {
|
|
960
1068
|
const { Dragger } = import_antd19.Upload;
|
|
961
1069
|
const [files, setFiles] = (0, import_react26.useState)([]);
|
|
@@ -986,7 +1094,7 @@ var FileUpload = (props) => {
|
|
|
986
1094
|
showUploadList: true,
|
|
987
1095
|
customRequest
|
|
988
1096
|
},
|
|
989
|
-
/* @__PURE__ */ import_react26.default.createElement("p", null, /* @__PURE__ */ import_react26.default.createElement(
|
|
1097
|
+
/* @__PURE__ */ import_react26.default.createElement("p", null, /* @__PURE__ */ import_react26.default.createElement(import_icons5.InboxOutlined, null)),
|
|
990
1098
|
/* @__PURE__ */ import_react26.default.createElement("p", null, "Click or drag file to upload")
|
|
991
1099
|
));
|
|
992
1100
|
};
|
|
@@ -1383,20 +1491,13 @@ var LineChart = (props) => {
|
|
|
1383
1491
|
return /* @__PURE__ */ import_react34.default.createElement("div", { className: props.className }, /* @__PURE__ */ import_react34.default.createElement("canvas", { ref: chartRef }));
|
|
1384
1492
|
};
|
|
1385
1493
|
|
|
1386
|
-
// src/Components/highchart.tsx
|
|
1387
|
-
var import_react35 = __toESM(require("react"));
|
|
1388
|
-
function HighchartsLineChart() {
|
|
1389
|
-
return /* @__PURE__ */ import_react35.default.createElement("h1", null, "123456789");
|
|
1390
|
-
}
|
|
1391
|
-
var highchart_default = HighchartsLineChart;
|
|
1392
|
-
|
|
1393
1494
|
// src/Components/DoubleBarChart.tsx
|
|
1394
|
-
var
|
|
1495
|
+
var import_react35 = __toESM(require("react"));
|
|
1395
1496
|
var import_auto2 = __toESM(require("chart.js/auto"));
|
|
1396
1497
|
var DoubleBarChart = (props) => {
|
|
1397
|
-
const chartRef = (0,
|
|
1398
|
-
const chartInstance = (0,
|
|
1399
|
-
(0,
|
|
1498
|
+
const chartRef = (0, import_react35.useRef)(null);
|
|
1499
|
+
const chartInstance = (0, import_react35.useRef)(null);
|
|
1500
|
+
(0, import_react35.useEffect)(() => {
|
|
1400
1501
|
if (chartRef.current) {
|
|
1401
1502
|
if (chartInstance.current) {
|
|
1402
1503
|
chartInstance.current.destroy();
|
|
@@ -1465,11 +1566,11 @@ var DoubleBarChart = (props) => {
|
|
|
1465
1566
|
}
|
|
1466
1567
|
};
|
|
1467
1568
|
}, []);
|
|
1468
|
-
return /* @__PURE__ */
|
|
1569
|
+
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 }));
|
|
1469
1570
|
};
|
|
1470
1571
|
|
|
1471
1572
|
// src/Components/BarChart.tsx
|
|
1472
|
-
var
|
|
1573
|
+
var import_react36 = __toESM(require("react"));
|
|
1473
1574
|
var import_react_chartjs_24 = require("react-chartjs-2");
|
|
1474
1575
|
var import_chart4 = require("chart.js");
|
|
1475
1576
|
import_chart4.Chart.register(import_chart4.BarElement, import_chart4.CategoryScale, import_chart4.LinearScale, import_chart4.Tooltip);
|
|
@@ -1531,7 +1632,7 @@ var BarChart = (props) => {
|
|
|
1531
1632
|
}
|
|
1532
1633
|
}
|
|
1533
1634
|
};
|
|
1534
|
-
return /* @__PURE__ */
|
|
1635
|
+
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 }));
|
|
1535
1636
|
};
|
|
1536
1637
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1537
1638
|
0 && (module.exports = {
|
|
@@ -1546,7 +1647,6 @@ var BarChart = (props) => {
|
|
|
1546
1647
|
DoubleBarChart,
|
|
1547
1648
|
DropDownGroup,
|
|
1548
1649
|
FileUpload,
|
|
1549
|
-
HighchartsLineChart,
|
|
1550
1650
|
HorizontalBarChart,
|
|
1551
1651
|
Image,
|
|
1552
1652
|
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
|
|
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
|
+
) : /* @__PURE__ */ React11.createElement("img", { src: "", alt: "", className: props.iconsClassName }) : svgContent && /* @__PURE__ */ React11.createElement("span", { dangerouslySetInnerHTML: { __html: svgContent } }), 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,17 @@ 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
|
+
}
|
|
921
|
+
));
|
|
813
922
|
};
|
|
814
923
|
|
|
815
924
|
// src/Components/Image.tsx
|
|
@@ -973,7 +1082,7 @@ var Upload2 = (props) => {
|
|
|
973
1082
|
};
|
|
974
1083
|
|
|
975
1084
|
// src/Components/OtpElement.tsx
|
|
976
|
-
import React30, { useState as useState11, useRef, useEffect as
|
|
1085
|
+
import React30, { useState as useState11, useRef, useEffect as useEffect4 } from "react";
|
|
977
1086
|
import { Input as Input3 } from "antd";
|
|
978
1087
|
var OtpElement = (props) => {
|
|
979
1088
|
const length = props.length;
|
|
@@ -1010,7 +1119,7 @@ var OtpElement = (props) => {
|
|
|
1010
1119
|
});
|
|
1011
1120
|
}
|
|
1012
1121
|
};
|
|
1013
|
-
|
|
1122
|
+
useEffect4(() => {
|
|
1014
1123
|
inputRefs.current[0]?.focus();
|
|
1015
1124
|
}, []);
|
|
1016
1125
|
return /* @__PURE__ */ React30.createElement("div", { className: props.containerClassName }, Array.from({ length }).map((_, index) => /* @__PURE__ */ React30.createElement(
|
|
@@ -1262,7 +1371,7 @@ var HorizontalBarChart = (props) => {
|
|
|
1262
1371
|
};
|
|
1263
1372
|
|
|
1264
1373
|
// src/Components/LineChart.tsx
|
|
1265
|
-
import React34, { useEffect as
|
|
1374
|
+
import React34, { useEffect as useEffect5, useRef as useRef2 } from "react";
|
|
1266
1375
|
import Chart from "chart.js/auto";
|
|
1267
1376
|
var LineChart = (props) => {
|
|
1268
1377
|
const chartRef = useRef2(null);
|
|
@@ -1273,7 +1382,7 @@ var LineChart = (props) => {
|
|
|
1273
1382
|
{ label: "Conversion Rate", data: [50, 100, 150, 180, 50] }
|
|
1274
1383
|
];
|
|
1275
1384
|
const labels = ["Instagram", "Whatsapp", "Messages", "Telegram", "Linkedin"];
|
|
1276
|
-
|
|
1385
|
+
useEffect5(() => {
|
|
1277
1386
|
if (chartRef.current) {
|
|
1278
1387
|
if (chartInstance.current) {
|
|
1279
1388
|
chartInstance.current.destroy();
|
|
@@ -1334,20 +1443,13 @@ var LineChart = (props) => {
|
|
|
1334
1443
|
return /* @__PURE__ */ React34.createElement("div", { className: props.className }, /* @__PURE__ */ React34.createElement("canvas", { ref: chartRef }));
|
|
1335
1444
|
};
|
|
1336
1445
|
|
|
1337
|
-
// src/Components/highchart.tsx
|
|
1338
|
-
import React35 from "react";
|
|
1339
|
-
function HighchartsLineChart() {
|
|
1340
|
-
return /* @__PURE__ */ React35.createElement("h1", null, "123456789");
|
|
1341
|
-
}
|
|
1342
|
-
var highchart_default = HighchartsLineChart;
|
|
1343
|
-
|
|
1344
1446
|
// src/Components/DoubleBarChart.tsx
|
|
1345
|
-
import
|
|
1447
|
+
import React35, { useEffect as useEffect6, useRef as useRef3 } from "react";
|
|
1346
1448
|
import Chart2 from "chart.js/auto";
|
|
1347
1449
|
var DoubleBarChart = (props) => {
|
|
1348
1450
|
const chartRef = useRef3(null);
|
|
1349
1451
|
const chartInstance = useRef3(null);
|
|
1350
|
-
|
|
1452
|
+
useEffect6(() => {
|
|
1351
1453
|
if (chartRef.current) {
|
|
1352
1454
|
if (chartInstance.current) {
|
|
1353
1455
|
chartInstance.current.destroy();
|
|
@@ -1416,11 +1518,11 @@ var DoubleBarChart = (props) => {
|
|
|
1416
1518
|
}
|
|
1417
1519
|
};
|
|
1418
1520
|
}, []);
|
|
1419
|
-
return /* @__PURE__ */
|
|
1521
|
+
return /* @__PURE__ */ React35.createElement("div", { className: props.className }, /* @__PURE__ */ React35.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ React35.createElement("canvas", { ref: chartRef }));
|
|
1420
1522
|
};
|
|
1421
1523
|
|
|
1422
1524
|
// src/Components/BarChart.tsx
|
|
1423
|
-
import
|
|
1525
|
+
import React36 from "react";
|
|
1424
1526
|
import { Bar as Bar2 } from "react-chartjs-2";
|
|
1425
1527
|
import {
|
|
1426
1528
|
Chart as ChartJS4,
|
|
@@ -1488,7 +1590,7 @@ var BarChart = (props) => {
|
|
|
1488
1590
|
}
|
|
1489
1591
|
}
|
|
1490
1592
|
};
|
|
1491
|
-
return /* @__PURE__ */
|
|
1593
|
+
return /* @__PURE__ */ React36.createElement("div", { className: props.className }, /* @__PURE__ */ React36.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ React36.createElement(Bar2, { data, options }));
|
|
1492
1594
|
};
|
|
1493
1595
|
export {
|
|
1494
1596
|
AddMoreTable,
|
|
@@ -1502,7 +1604,6 @@ export {
|
|
|
1502
1604
|
DoubleBarChart,
|
|
1503
1605
|
DropDownGroup,
|
|
1504
1606
|
FileUpload,
|
|
1505
|
-
highchart_default as HighchartsLineChart,
|
|
1506
1607
|
HorizontalBarChart,
|
|
1507
1608
|
Image,
|
|
1508
1609
|
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
|
+
|