@apexcura/ui-components 0.0.14-Beta188 → 0.0.14-Beta189
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 +174 -68
- package/dist/index.mjs +175 -68
- 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,10 +385,14 @@ 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);
|
|
392
|
+
const [loading, setLoading] = (0, import_react11.useState)(true);
|
|
391
393
|
(0, import_react11.useEffect)(() => {
|
|
392
394
|
if (props.icon) {
|
|
395
|
+
setLoading(false);
|
|
393
396
|
fetch(props.icon).then((response) => response.text()).then((data) => {
|
|
394
397
|
const tempDiv = document.createElement("div");
|
|
395
398
|
tempDiv.innerHTML = data;
|
|
@@ -423,7 +426,8 @@ var ButtonElement = (props) => {
|
|
|
423
426
|
}
|
|
424
427
|
}).catch((error) => console.error("Error fetching SVG:", error));
|
|
425
428
|
}
|
|
426
|
-
|
|
429
|
+
setLoading(true);
|
|
430
|
+
}, []);
|
|
427
431
|
const handleMouseEnter = () => {
|
|
428
432
|
if (hoverColor && originalSvgContent) {
|
|
429
433
|
const tempDiv = document.createElement("div");
|
|
@@ -451,12 +455,14 @@ var ButtonElement = (props) => {
|
|
|
451
455
|
cursor: props.loading ? "no-drop" : "pointer"
|
|
452
456
|
}
|
|
453
457
|
},
|
|
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
|
|
455
|
-
"
|
|
458
|
+
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 && loading ? props.icon && /* @__PURE__ */ import_react11.default.createElement(
|
|
459
|
+
"img",
|
|
456
460
|
{
|
|
457
|
-
|
|
461
|
+
className: props.iconsClassName,
|
|
462
|
+
src: props.icon,
|
|
463
|
+
alt: props.label
|
|
458
464
|
}
|
|
459
|
-
), props.label)
|
|
465
|
+
) : svgContent && /* @__PURE__ */ import_react11.default.createElement("span", { dangerouslySetInnerHTML: { __html: svgContent } }), props.label)
|
|
460
466
|
);
|
|
461
467
|
};
|
|
462
468
|
|
|
@@ -684,18 +690,48 @@ var import_antd13 = require("antd");
|
|
|
684
690
|
|
|
685
691
|
// src/Components/ModelBody.tsx
|
|
686
692
|
var import_react18 = __toESM(require("react"));
|
|
693
|
+
var import_moment = __toESM(require("moment"));
|
|
687
694
|
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
|
-
|
|
695
|
+
return /* @__PURE__ */ import_react18.default.createElement("div", { className: props.modalContent && props.modalContent.className }, props.modalContent && props.modalContent.fields.map(
|
|
696
|
+
(eachField) => {
|
|
697
|
+
if (eachField.element === "div") {
|
|
698
|
+
return /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null, /* @__PURE__ */ import_react18.default.createElement("div", { className: eachField.className }, eachField.label), eachField.dateTime ? /* @__PURE__ */ import_react18.default.createElement(
|
|
699
|
+
"p",
|
|
700
|
+
{
|
|
701
|
+
style: {
|
|
702
|
+
fontSize: "10px",
|
|
703
|
+
textAlign: eachField.source === "bot" ? "left" : "right"
|
|
704
|
+
}
|
|
705
|
+
},
|
|
706
|
+
(0, import_moment.default)(eachField.dateTime).format("LT")
|
|
707
|
+
) : "");
|
|
708
|
+
} else if (eachField.element === "input-radio") {
|
|
709
|
+
return /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null, /* @__PURE__ */ import_react18.default.createElement("div", { className: eachField.className }, /* @__PURE__ */ import_react18.default.createElement(RadioElement, { ...eachField })), eachField.dateTime ? /* @__PURE__ */ import_react18.default.createElement(
|
|
710
|
+
"p",
|
|
711
|
+
{
|
|
712
|
+
style: {
|
|
713
|
+
fontSize: "10px",
|
|
714
|
+
textAlign: eachField.source === "bot" ? "left" : "right"
|
|
715
|
+
}
|
|
716
|
+
},
|
|
717
|
+
(0, import_moment.default)(eachField.dateTime).format("LT")
|
|
718
|
+
) : "");
|
|
719
|
+
} else if (eachField.element === "button") {
|
|
720
|
+
return /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null, /* @__PURE__ */ import_react18.default.createElement("div", { className: eachField.className }, /* @__PURE__ */ import_react18.default.createElement(ButtonElement, { ...eachField })), eachField.dateTime ? /* @__PURE__ */ import_react18.default.createElement(
|
|
721
|
+
"p",
|
|
722
|
+
{
|
|
723
|
+
style: {
|
|
724
|
+
fontSize: "10px",
|
|
725
|
+
textAlign: eachField.source === "bot" ? "left" : "right"
|
|
726
|
+
}
|
|
727
|
+
},
|
|
728
|
+
(0, import_moment.default)(eachField.dateTime).format("LT")
|
|
729
|
+
) : "");
|
|
730
|
+
} else {
|
|
731
|
+
return null;
|
|
732
|
+
}
|
|
697
733
|
}
|
|
698
|
-
|
|
734
|
+
));
|
|
699
735
|
};
|
|
700
736
|
|
|
701
737
|
// src/Components/Model.tsx
|
|
@@ -720,9 +756,22 @@ var ModelElement = (props) => {
|
|
|
720
756
|
margin: "-10px"
|
|
721
757
|
}
|
|
722
758
|
},
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
759
|
+
columns.map((eachColumn) => {
|
|
760
|
+
if (!["index", "View"].includes(eachColumn.key) && eachColumn?.["is_detail"] !== false) {
|
|
761
|
+
return /* @__PURE__ */ import_react19.default.createElement("p", { style: { fontWeight: "500", padding: "10px" } }, /* @__PURE__ */ import_react19.default.createElement(
|
|
762
|
+
"span",
|
|
763
|
+
{
|
|
764
|
+
style: {
|
|
765
|
+
fontWeight: "200",
|
|
766
|
+
color: "gray",
|
|
767
|
+
paddingRight: "10px"
|
|
768
|
+
}
|
|
769
|
+
},
|
|
770
|
+
eachColumn.title
|
|
771
|
+
), selectedRecord[eachColumn.key] !== "" ? selectedRecord[eachColumn.key] : "--");
|
|
772
|
+
} else {
|
|
773
|
+
return null;
|
|
774
|
+
}
|
|
726
775
|
})
|
|
727
776
|
)
|
|
728
777
|
},
|
|
@@ -731,12 +780,24 @@ var ModelElement = (props) => {
|
|
|
731
780
|
};
|
|
732
781
|
|
|
733
782
|
// src/Components/TableElement.tsx
|
|
783
|
+
var import_icons4 = require("@ant-design/icons");
|
|
734
784
|
var TableElement = (props) => {
|
|
735
785
|
const { thead, tbody } = props;
|
|
736
786
|
const [selectedRecord, setSelectedRecord] = (0, import_react20.useState)({});
|
|
737
787
|
const [model, setModel] = (0, import_react20.useState)(false);
|
|
788
|
+
const [dataSource, setDataSource] = (0, import_react20.useState)([]);
|
|
789
|
+
(0, import_react20.useEffect)(() => {
|
|
790
|
+
if (tbody) {
|
|
791
|
+
setDataSource(
|
|
792
|
+
tbody.map((row, index) => ({
|
|
793
|
+
...row,
|
|
794
|
+
key: index,
|
|
795
|
+
index: index + 1
|
|
796
|
+
}))
|
|
797
|
+
);
|
|
798
|
+
}
|
|
799
|
+
}, [tbody]);
|
|
738
800
|
const handleChange = (record) => {
|
|
739
|
-
console.log("record", record);
|
|
740
801
|
if (props.onChange) {
|
|
741
802
|
props.onChange(record);
|
|
742
803
|
}
|
|
@@ -746,8 +807,8 @@ var TableElement = (props) => {
|
|
|
746
807
|
columns = [
|
|
747
808
|
{
|
|
748
809
|
title: "#",
|
|
749
|
-
dataIndex: "
|
|
750
|
-
key: "
|
|
810
|
+
dataIndex: "index",
|
|
811
|
+
key: "index",
|
|
751
812
|
fixed: "left"
|
|
752
813
|
},
|
|
753
814
|
...thead.map((col, ind) => ({
|
|
@@ -758,9 +819,9 @@ var TableElement = (props) => {
|
|
|
758
819
|
render: col.render,
|
|
759
820
|
sorter: {
|
|
760
821
|
compare: (a, b) => {
|
|
761
|
-
if (typeof a[col.key] === "number" && typeof
|
|
822
|
+
if (typeof a[col.key] === "number" && typeof b[col.key] === "number") {
|
|
762
823
|
return a[col.key] - b[col.key];
|
|
763
|
-
} else if (typeof a[col.key] === "string" && typeof
|
|
824
|
+
} else if (typeof a[col.key] === "string" && typeof b[col.key] === "string") {
|
|
764
825
|
return a[col.key].localeCompare(b[col.key]);
|
|
765
826
|
}
|
|
766
827
|
}
|
|
@@ -772,26 +833,34 @@ var TableElement = (props) => {
|
|
|
772
833
|
title: "View",
|
|
773
834
|
dataIndex: "View",
|
|
774
835
|
key: "View",
|
|
775
|
-
render: (_, record) =>
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
836
|
+
render: (_, record) => {
|
|
837
|
+
return /* @__PURE__ */ import_react20.default.createElement(
|
|
838
|
+
"a",
|
|
839
|
+
{
|
|
840
|
+
onClick: () => {
|
|
841
|
+
if (props.view) {
|
|
842
|
+
setSelectedRecord(record);
|
|
843
|
+
handleChange(record);
|
|
844
|
+
setModel(true);
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
},
|
|
848
|
+
/* @__PURE__ */ import_react20.default.createElement(import_icons4.EyeOutlined, null)
|
|
849
|
+
);
|
|
850
|
+
}
|
|
786
851
|
});
|
|
787
852
|
}
|
|
788
853
|
}
|
|
789
|
-
const
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
854
|
+
const onChangeTable = (pagination, filters, sorter, extra) => {
|
|
855
|
+
if (extra && extra.currentDataSource) {
|
|
856
|
+
setDataSource(
|
|
857
|
+
extra.currentDataSource.map((row, index) => ({
|
|
858
|
+
...row,
|
|
859
|
+
index: index + 1
|
|
860
|
+
}))
|
|
861
|
+
);
|
|
862
|
+
}
|
|
863
|
+
};
|
|
795
864
|
const onChangePage = (page, pageSize) => {
|
|
796
865
|
if (props.onChange) {
|
|
797
866
|
props.onChange({ name: "pagination", page, pageSize });
|
|
@@ -799,7 +868,11 @@ var TableElement = (props) => {
|
|
|
799
868
|
};
|
|
800
869
|
const rowSelectionConfig = props.rowSelection ? {
|
|
801
870
|
onChange: (selectedRowKeys, selectedRows) => {
|
|
802
|
-
console.log(
|
|
871
|
+
console.log(
|
|
872
|
+
`selectedRowKeys: ${selectedRowKeys}`,
|
|
873
|
+
"selectedRows: ",
|
|
874
|
+
selectedRows
|
|
875
|
+
);
|
|
803
876
|
if (props.onChange) {
|
|
804
877
|
props.onChange(selectedRows);
|
|
805
878
|
}
|
|
@@ -809,19 +882,41 @@ var TableElement = (props) => {
|
|
|
809
882
|
import_antd14.Table,
|
|
810
883
|
{
|
|
811
884
|
className: props.className,
|
|
812
|
-
pagination: {
|
|
885
|
+
pagination: props.pagination ? {
|
|
813
886
|
showTotal: (total) => `Total: ${total} items`,
|
|
814
|
-
total: count,
|
|
815
|
-
showSizeChanger: count > 10,
|
|
887
|
+
total: props.count,
|
|
888
|
+
showSizeChanger: props.count ? props.count > 10 : 0 > 10,
|
|
816
889
|
onChange: onChangePage
|
|
890
|
+
} : false,
|
|
891
|
+
onRow: (record) => {
|
|
892
|
+
return {
|
|
893
|
+
onClick: () => {
|
|
894
|
+
if (props.view) {
|
|
895
|
+
setSelectedRecord(record);
|
|
896
|
+
handleChange(record);
|
|
897
|
+
setModel(true);
|
|
898
|
+
}
|
|
899
|
+
},
|
|
900
|
+
style: { cursor: "pointer" }
|
|
901
|
+
};
|
|
817
902
|
},
|
|
818
903
|
rowSelection: rowSelectionConfig,
|
|
819
904
|
dataSource,
|
|
820
905
|
columns,
|
|
821
906
|
size: props.size,
|
|
822
|
-
bordered: true
|
|
907
|
+
bordered: true,
|
|
908
|
+
onChange: onChangeTable
|
|
823
909
|
}
|
|
824
|
-
), model && /* @__PURE__ */ import_react20.default.createElement(
|
|
910
|
+
), model && /* @__PURE__ */ import_react20.default.createElement(
|
|
911
|
+
ModelElement,
|
|
912
|
+
{
|
|
913
|
+
selectedRecord,
|
|
914
|
+
...props,
|
|
915
|
+
columns,
|
|
916
|
+
model,
|
|
917
|
+
onCancel: () => setModel(false)
|
|
918
|
+
}
|
|
919
|
+
));
|
|
825
920
|
};
|
|
826
921
|
|
|
827
922
|
// src/Components/DatePicker.tsx
|
|
@@ -829,6 +924,7 @@ var import_react21 = __toESM(require("react"));
|
|
|
829
924
|
var import_antd15 = require("antd");
|
|
830
925
|
var import_dayjs = __toESM(require("dayjs"));
|
|
831
926
|
var import_customParseFormat = __toESM(require("dayjs/plugin/customParseFormat.js"));
|
|
927
|
+
var import_moment2 = __toESM(require("moment"));
|
|
832
928
|
import_dayjs.default.extend(import_customParseFormat.default);
|
|
833
929
|
var DatePickerElement = (props) => {
|
|
834
930
|
const [dateState, setDateState] = (0, import_react21.useState)("");
|
|
@@ -846,9 +942,13 @@ var DatePickerElement = (props) => {
|
|
|
846
942
|
}
|
|
847
943
|
}
|
|
848
944
|
};
|
|
945
|
+
const disabledDate = (current) => {
|
|
946
|
+
return current && current > (0, import_moment2.default)();
|
|
947
|
+
};
|
|
849
948
|
return /* @__PURE__ */ import_react21.default.createElement("div", null, /* @__PURE__ */ import_react21.default.createElement(
|
|
850
949
|
import_antd15.DatePicker,
|
|
851
950
|
{
|
|
951
|
+
disabledDate,
|
|
852
952
|
placeholder: props.placeholder,
|
|
853
953
|
value: dateState,
|
|
854
954
|
format: { format: "DD-MM-YYYY" },
|
|
@@ -861,13 +961,15 @@ var DatePickerElement = (props) => {
|
|
|
861
961
|
var import_react22 = __toESM(require("react"));
|
|
862
962
|
var import_antd16 = require("antd");
|
|
863
963
|
var import_dayjs2 = __toESM(require("dayjs"));
|
|
964
|
+
var import_moment3 = __toESM(require("moment"));
|
|
864
965
|
var DateRangePickerElement = (props) => {
|
|
966
|
+
const { value } = props;
|
|
865
967
|
const { RangePicker } = import_antd16.DatePicker;
|
|
866
968
|
const handleChange = (dates, dateStrings) => {
|
|
867
|
-
if (dates
|
|
868
|
-
props.onChange(dateStrings);
|
|
969
|
+
if (dates) {
|
|
970
|
+
props.onChange && props.onChange(dateStrings);
|
|
869
971
|
} else {
|
|
870
|
-
|
|
972
|
+
props.onChange && props.onChange("clear");
|
|
871
973
|
}
|
|
872
974
|
};
|
|
873
975
|
const rangePresets = [
|
|
@@ -876,7 +978,18 @@ var DateRangePickerElement = (props) => {
|
|
|
876
978
|
{ label: "Last 30 Days", value: [(0, import_dayjs2.default)().add(-30, "d"), (0, import_dayjs2.default)()] },
|
|
877
979
|
{ label: "Last 90 Days", value: [(0, import_dayjs2.default)().add(-90, "d"), (0, import_dayjs2.default)()] }
|
|
878
980
|
];
|
|
879
|
-
|
|
981
|
+
const disabledDate = (current) => {
|
|
982
|
+
return current && current > (0, import_moment3.default)();
|
|
983
|
+
};
|
|
984
|
+
return /* @__PURE__ */ import_react22.default.createElement(import_antd16.Space, { direction: "vertical", size: 12 }, /* @__PURE__ */ import_react22.default.createElement(
|
|
985
|
+
RangePicker,
|
|
986
|
+
{
|
|
987
|
+
disabledDate,
|
|
988
|
+
presets: rangePresets,
|
|
989
|
+
onChange: handleChange,
|
|
990
|
+
value: value ? [(0, import_dayjs2.default)(value[0]), (0, import_dayjs2.default)(value[1])] : void 0
|
|
991
|
+
}
|
|
992
|
+
));
|
|
880
993
|
};
|
|
881
994
|
|
|
882
995
|
// src/Components/Image.tsx
|
|
@@ -955,7 +1068,7 @@ var DropDownGroup = (props) => {
|
|
|
955
1068
|
// src/Components/FilesUpload.tsx
|
|
956
1069
|
var import_react26 = __toESM(require("react"));
|
|
957
1070
|
var import_antd19 = require("antd");
|
|
958
|
-
var
|
|
1071
|
+
var import_icons5 = require("@ant-design/icons");
|
|
959
1072
|
var FileUpload = (props) => {
|
|
960
1073
|
const { Dragger } = import_antd19.Upload;
|
|
961
1074
|
const [files, setFiles] = (0, import_react26.useState)([]);
|
|
@@ -986,7 +1099,7 @@ var FileUpload = (props) => {
|
|
|
986
1099
|
showUploadList: true,
|
|
987
1100
|
customRequest
|
|
988
1101
|
},
|
|
989
|
-
/* @__PURE__ */ import_react26.default.createElement("p", null, /* @__PURE__ */ import_react26.default.createElement(
|
|
1102
|
+
/* @__PURE__ */ import_react26.default.createElement("p", null, /* @__PURE__ */ import_react26.default.createElement(import_icons5.InboxOutlined, null)),
|
|
990
1103
|
/* @__PURE__ */ import_react26.default.createElement("p", null, "Click or drag file to upload")
|
|
991
1104
|
));
|
|
992
1105
|
};
|
|
@@ -1383,19 +1496,13 @@ var LineChart = (props) => {
|
|
|
1383
1496
|
return /* @__PURE__ */ import_react34.default.createElement("div", { className: props.className }, /* @__PURE__ */ import_react34.default.createElement("canvas", { ref: chartRef }));
|
|
1384
1497
|
};
|
|
1385
1498
|
|
|
1386
|
-
// src/Components/highchart.tsx
|
|
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
1499
|
// src/Components/DoubleBarChart.tsx
|
|
1393
|
-
var
|
|
1500
|
+
var import_react35 = __toESM(require("react"));
|
|
1394
1501
|
var import_auto2 = __toESM(require("chart.js/auto"));
|
|
1395
1502
|
var DoubleBarChart = (props) => {
|
|
1396
|
-
const chartRef = (0,
|
|
1397
|
-
const chartInstance = (0,
|
|
1398
|
-
(0,
|
|
1503
|
+
const chartRef = (0, import_react35.useRef)(null);
|
|
1504
|
+
const chartInstance = (0, import_react35.useRef)(null);
|
|
1505
|
+
(0, import_react35.useEffect)(() => {
|
|
1399
1506
|
if (chartRef.current) {
|
|
1400
1507
|
if (chartInstance.current) {
|
|
1401
1508
|
chartInstance.current.destroy();
|
|
@@ -1464,11 +1571,11 @@ var DoubleBarChart = (props) => {
|
|
|
1464
1571
|
}
|
|
1465
1572
|
};
|
|
1466
1573
|
}, []);
|
|
1467
|
-
return /* @__PURE__ */
|
|
1574
|
+
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 }));
|
|
1468
1575
|
};
|
|
1469
1576
|
|
|
1470
1577
|
// src/Components/BarChart.tsx
|
|
1471
|
-
var
|
|
1578
|
+
var import_react36 = __toESM(require("react"));
|
|
1472
1579
|
var import_react_chartjs_24 = require("react-chartjs-2");
|
|
1473
1580
|
var import_chart4 = require("chart.js");
|
|
1474
1581
|
import_chart4.Chart.register(import_chart4.BarElement, import_chart4.CategoryScale, import_chart4.LinearScale, import_chart4.Tooltip);
|
|
@@ -1530,7 +1637,7 @@ var BarChart = (props) => {
|
|
|
1530
1637
|
}
|
|
1531
1638
|
}
|
|
1532
1639
|
};
|
|
1533
|
-
return /* @__PURE__ */
|
|
1640
|
+
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 }));
|
|
1534
1641
|
};
|
|
1535
1642
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1536
1643
|
0 && (module.exports = {
|
|
@@ -1545,7 +1652,6 @@ var BarChart = (props) => {
|
|
|
1545
1652
|
DoubleBarChart,
|
|
1546
1653
|
DropDownGroup,
|
|
1547
1654
|
FileUpload,
|
|
1548
|
-
HighchartsLineChart,
|
|
1549
1655
|
HorizontalBarChart,
|
|
1550
1656
|
Image,
|
|
1551
1657
|
LineChart,
|
package/dist/index.mjs
CHANGED
|
@@ -319,10 +319,14 @@ 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);
|
|
326
|
+
const [loading, setLoading] = useState4(true);
|
|
324
327
|
useEffect(() => {
|
|
325
328
|
if (props.icon) {
|
|
329
|
+
setLoading(false);
|
|
326
330
|
fetch(props.icon).then((response) => response.text()).then((data) => {
|
|
327
331
|
const tempDiv = document.createElement("div");
|
|
328
332
|
tempDiv.innerHTML = data;
|
|
@@ -356,7 +360,8 @@ var ButtonElement = (props) => {
|
|
|
356
360
|
}
|
|
357
361
|
}).catch((error) => console.error("Error fetching SVG:", error));
|
|
358
362
|
}
|
|
359
|
-
|
|
363
|
+
setLoading(true);
|
|
364
|
+
}, []);
|
|
360
365
|
const handleMouseEnter = () => {
|
|
361
366
|
if (hoverColor && originalSvgContent) {
|
|
362
367
|
const tempDiv = document.createElement("div");
|
|
@@ -384,12 +389,14 @@ var ButtonElement = (props) => {
|
|
|
384
389
|
cursor: props.loading ? "no-drop" : "pointer"
|
|
385
390
|
}
|
|
386
391
|
},
|
|
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
|
|
388
|
-
"
|
|
392
|
+
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 && loading ? props.icon && /* @__PURE__ */ React11.createElement(
|
|
393
|
+
"img",
|
|
389
394
|
{
|
|
390
|
-
|
|
395
|
+
className: props.iconsClassName,
|
|
396
|
+
src: props.icon,
|
|
397
|
+
alt: props.label
|
|
391
398
|
}
|
|
392
|
-
), props.label)
|
|
399
|
+
) : svgContent && /* @__PURE__ */ React11.createElement("span", { dangerouslySetInnerHTML: { __html: svgContent } }), props.label)
|
|
393
400
|
);
|
|
394
401
|
};
|
|
395
402
|
|
|
@@ -608,7 +615,7 @@ var Navbar = (props) => {
|
|
|
608
615
|
};
|
|
609
616
|
|
|
610
617
|
// src/Components/TableElement.tsx
|
|
611
|
-
import React20, { useState as useState6 } from "react";
|
|
618
|
+
import React20, { useState as useState6, useEffect as useEffect3 } from "react";
|
|
612
619
|
import { Table as Table2 } from "antd";
|
|
613
620
|
|
|
614
621
|
// src/Components/Model.tsx
|
|
@@ -617,18 +624,48 @@ import { Modal } from "antd";
|
|
|
617
624
|
|
|
618
625
|
// src/Components/ModelBody.tsx
|
|
619
626
|
import React18 from "react";
|
|
627
|
+
import moment from "moment";
|
|
620
628
|
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
|
-
|
|
629
|
+
return /* @__PURE__ */ React18.createElement("div", { className: props.modalContent && props.modalContent.className }, props.modalContent && props.modalContent.fields.map(
|
|
630
|
+
(eachField) => {
|
|
631
|
+
if (eachField.element === "div") {
|
|
632
|
+
return /* @__PURE__ */ React18.createElement(React18.Fragment, null, /* @__PURE__ */ React18.createElement("div", { className: eachField.className }, eachField.label), eachField.dateTime ? /* @__PURE__ */ React18.createElement(
|
|
633
|
+
"p",
|
|
634
|
+
{
|
|
635
|
+
style: {
|
|
636
|
+
fontSize: "10px",
|
|
637
|
+
textAlign: eachField.source === "bot" ? "left" : "right"
|
|
638
|
+
}
|
|
639
|
+
},
|
|
640
|
+
moment(eachField.dateTime).format("LT")
|
|
641
|
+
) : "");
|
|
642
|
+
} else if (eachField.element === "input-radio") {
|
|
643
|
+
return /* @__PURE__ */ React18.createElement(React18.Fragment, null, /* @__PURE__ */ React18.createElement("div", { className: eachField.className }, /* @__PURE__ */ React18.createElement(RadioElement, { ...eachField })), eachField.dateTime ? /* @__PURE__ */ React18.createElement(
|
|
644
|
+
"p",
|
|
645
|
+
{
|
|
646
|
+
style: {
|
|
647
|
+
fontSize: "10px",
|
|
648
|
+
textAlign: eachField.source === "bot" ? "left" : "right"
|
|
649
|
+
}
|
|
650
|
+
},
|
|
651
|
+
moment(eachField.dateTime).format("LT")
|
|
652
|
+
) : "");
|
|
653
|
+
} else if (eachField.element === "button") {
|
|
654
|
+
return /* @__PURE__ */ React18.createElement(React18.Fragment, null, /* @__PURE__ */ React18.createElement("div", { className: eachField.className }, /* @__PURE__ */ React18.createElement(ButtonElement, { ...eachField })), eachField.dateTime ? /* @__PURE__ */ React18.createElement(
|
|
655
|
+
"p",
|
|
656
|
+
{
|
|
657
|
+
style: {
|
|
658
|
+
fontSize: "10px",
|
|
659
|
+
textAlign: eachField.source === "bot" ? "left" : "right"
|
|
660
|
+
}
|
|
661
|
+
},
|
|
662
|
+
moment(eachField.dateTime).format("LT")
|
|
663
|
+
) : "");
|
|
664
|
+
} else {
|
|
665
|
+
return null;
|
|
666
|
+
}
|
|
630
667
|
}
|
|
631
|
-
|
|
668
|
+
));
|
|
632
669
|
};
|
|
633
670
|
|
|
634
671
|
// src/Components/Model.tsx
|
|
@@ -653,9 +690,22 @@ var ModelElement = (props) => {
|
|
|
653
690
|
margin: "-10px"
|
|
654
691
|
}
|
|
655
692
|
},
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
693
|
+
columns.map((eachColumn) => {
|
|
694
|
+
if (!["index", "View"].includes(eachColumn.key) && eachColumn?.["is_detail"] !== false) {
|
|
695
|
+
return /* @__PURE__ */ React19.createElement("p", { style: { fontWeight: "500", padding: "10px" } }, /* @__PURE__ */ React19.createElement(
|
|
696
|
+
"span",
|
|
697
|
+
{
|
|
698
|
+
style: {
|
|
699
|
+
fontWeight: "200",
|
|
700
|
+
color: "gray",
|
|
701
|
+
paddingRight: "10px"
|
|
702
|
+
}
|
|
703
|
+
},
|
|
704
|
+
eachColumn.title
|
|
705
|
+
), selectedRecord[eachColumn.key] !== "" ? selectedRecord[eachColumn.key] : "--");
|
|
706
|
+
} else {
|
|
707
|
+
return null;
|
|
708
|
+
}
|
|
659
709
|
})
|
|
660
710
|
)
|
|
661
711
|
},
|
|
@@ -664,12 +714,24 @@ var ModelElement = (props) => {
|
|
|
664
714
|
};
|
|
665
715
|
|
|
666
716
|
// src/Components/TableElement.tsx
|
|
717
|
+
import { EyeOutlined } from "@ant-design/icons";
|
|
667
718
|
var TableElement = (props) => {
|
|
668
719
|
const { thead, tbody } = props;
|
|
669
720
|
const [selectedRecord, setSelectedRecord] = useState6({});
|
|
670
721
|
const [model, setModel] = useState6(false);
|
|
722
|
+
const [dataSource, setDataSource] = useState6([]);
|
|
723
|
+
useEffect3(() => {
|
|
724
|
+
if (tbody) {
|
|
725
|
+
setDataSource(
|
|
726
|
+
tbody.map((row, index) => ({
|
|
727
|
+
...row,
|
|
728
|
+
key: index,
|
|
729
|
+
index: index + 1
|
|
730
|
+
}))
|
|
731
|
+
);
|
|
732
|
+
}
|
|
733
|
+
}, [tbody]);
|
|
671
734
|
const handleChange = (record) => {
|
|
672
|
-
console.log("record", record);
|
|
673
735
|
if (props.onChange) {
|
|
674
736
|
props.onChange(record);
|
|
675
737
|
}
|
|
@@ -679,8 +741,8 @@ var TableElement = (props) => {
|
|
|
679
741
|
columns = [
|
|
680
742
|
{
|
|
681
743
|
title: "#",
|
|
682
|
-
dataIndex: "
|
|
683
|
-
key: "
|
|
744
|
+
dataIndex: "index",
|
|
745
|
+
key: "index",
|
|
684
746
|
fixed: "left"
|
|
685
747
|
},
|
|
686
748
|
...thead.map((col, ind) => ({
|
|
@@ -691,9 +753,9 @@ var TableElement = (props) => {
|
|
|
691
753
|
render: col.render,
|
|
692
754
|
sorter: {
|
|
693
755
|
compare: (a, b) => {
|
|
694
|
-
if (typeof a[col.key] === "number" && typeof
|
|
756
|
+
if (typeof a[col.key] === "number" && typeof b[col.key] === "number") {
|
|
695
757
|
return a[col.key] - b[col.key];
|
|
696
|
-
} else if (typeof a[col.key] === "string" && typeof
|
|
758
|
+
} else if (typeof a[col.key] === "string" && typeof b[col.key] === "string") {
|
|
697
759
|
return a[col.key].localeCompare(b[col.key]);
|
|
698
760
|
}
|
|
699
761
|
}
|
|
@@ -705,26 +767,34 @@ var TableElement = (props) => {
|
|
|
705
767
|
title: "View",
|
|
706
768
|
dataIndex: "View",
|
|
707
769
|
key: "View",
|
|
708
|
-
render: (_, record) =>
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
770
|
+
render: (_, record) => {
|
|
771
|
+
return /* @__PURE__ */ React20.createElement(
|
|
772
|
+
"a",
|
|
773
|
+
{
|
|
774
|
+
onClick: () => {
|
|
775
|
+
if (props.view) {
|
|
776
|
+
setSelectedRecord(record);
|
|
777
|
+
handleChange(record);
|
|
778
|
+
setModel(true);
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
},
|
|
782
|
+
/* @__PURE__ */ React20.createElement(EyeOutlined, null)
|
|
783
|
+
);
|
|
784
|
+
}
|
|
719
785
|
});
|
|
720
786
|
}
|
|
721
787
|
}
|
|
722
|
-
const
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
788
|
+
const onChangeTable = (pagination, filters, sorter, extra) => {
|
|
789
|
+
if (extra && extra.currentDataSource) {
|
|
790
|
+
setDataSource(
|
|
791
|
+
extra.currentDataSource.map((row, index) => ({
|
|
792
|
+
...row,
|
|
793
|
+
index: index + 1
|
|
794
|
+
}))
|
|
795
|
+
);
|
|
796
|
+
}
|
|
797
|
+
};
|
|
728
798
|
const onChangePage = (page, pageSize) => {
|
|
729
799
|
if (props.onChange) {
|
|
730
800
|
props.onChange({ name: "pagination", page, pageSize });
|
|
@@ -732,7 +802,11 @@ var TableElement = (props) => {
|
|
|
732
802
|
};
|
|
733
803
|
const rowSelectionConfig = props.rowSelection ? {
|
|
734
804
|
onChange: (selectedRowKeys, selectedRows) => {
|
|
735
|
-
console.log(
|
|
805
|
+
console.log(
|
|
806
|
+
`selectedRowKeys: ${selectedRowKeys}`,
|
|
807
|
+
"selectedRows: ",
|
|
808
|
+
selectedRows
|
|
809
|
+
);
|
|
736
810
|
if (props.onChange) {
|
|
737
811
|
props.onChange(selectedRows);
|
|
738
812
|
}
|
|
@@ -742,19 +816,41 @@ var TableElement = (props) => {
|
|
|
742
816
|
Table2,
|
|
743
817
|
{
|
|
744
818
|
className: props.className,
|
|
745
|
-
pagination: {
|
|
819
|
+
pagination: props.pagination ? {
|
|
746
820
|
showTotal: (total) => `Total: ${total} items`,
|
|
747
|
-
total: count,
|
|
748
|
-
showSizeChanger: count > 10,
|
|
821
|
+
total: props.count,
|
|
822
|
+
showSizeChanger: props.count ? props.count > 10 : 0 > 10,
|
|
749
823
|
onChange: onChangePage
|
|
824
|
+
} : false,
|
|
825
|
+
onRow: (record) => {
|
|
826
|
+
return {
|
|
827
|
+
onClick: () => {
|
|
828
|
+
if (props.view) {
|
|
829
|
+
setSelectedRecord(record);
|
|
830
|
+
handleChange(record);
|
|
831
|
+
setModel(true);
|
|
832
|
+
}
|
|
833
|
+
},
|
|
834
|
+
style: { cursor: "pointer" }
|
|
835
|
+
};
|
|
750
836
|
},
|
|
751
837
|
rowSelection: rowSelectionConfig,
|
|
752
838
|
dataSource,
|
|
753
839
|
columns,
|
|
754
840
|
size: props.size,
|
|
755
|
-
bordered: true
|
|
841
|
+
bordered: true,
|
|
842
|
+
onChange: onChangeTable
|
|
756
843
|
}
|
|
757
|
-
), model && /* @__PURE__ */ React20.createElement(
|
|
844
|
+
), model && /* @__PURE__ */ React20.createElement(
|
|
845
|
+
ModelElement,
|
|
846
|
+
{
|
|
847
|
+
selectedRecord,
|
|
848
|
+
...props,
|
|
849
|
+
columns,
|
|
850
|
+
model,
|
|
851
|
+
onCancel: () => setModel(false)
|
|
852
|
+
}
|
|
853
|
+
));
|
|
758
854
|
};
|
|
759
855
|
|
|
760
856
|
// src/Components/DatePicker.tsx
|
|
@@ -762,6 +858,7 @@ import React21, { useState as useState7 } from "react";
|
|
|
762
858
|
import { DatePicker } from "antd";
|
|
763
859
|
import dayjs from "dayjs";
|
|
764
860
|
import customParseFormat from "dayjs/plugin/customParseFormat.js";
|
|
861
|
+
import moment2 from "moment";
|
|
765
862
|
dayjs.extend(customParseFormat);
|
|
766
863
|
var DatePickerElement = (props) => {
|
|
767
864
|
const [dateState, setDateState] = useState7("");
|
|
@@ -779,9 +876,13 @@ var DatePickerElement = (props) => {
|
|
|
779
876
|
}
|
|
780
877
|
}
|
|
781
878
|
};
|
|
879
|
+
const disabledDate = (current) => {
|
|
880
|
+
return current && current > moment2();
|
|
881
|
+
};
|
|
782
882
|
return /* @__PURE__ */ React21.createElement("div", null, /* @__PURE__ */ React21.createElement(
|
|
783
883
|
DatePicker,
|
|
784
884
|
{
|
|
885
|
+
disabledDate,
|
|
785
886
|
placeholder: props.placeholder,
|
|
786
887
|
value: dateState,
|
|
787
888
|
format: { format: "DD-MM-YYYY" },
|
|
@@ -794,13 +895,15 @@ var DatePickerElement = (props) => {
|
|
|
794
895
|
import React22 from "react";
|
|
795
896
|
import { DatePicker as DatePicker2, Space } from "antd";
|
|
796
897
|
import dayjs2 from "dayjs";
|
|
898
|
+
import moment3 from "moment";
|
|
797
899
|
var DateRangePickerElement = (props) => {
|
|
900
|
+
const { value } = props;
|
|
798
901
|
const { RangePicker } = DatePicker2;
|
|
799
902
|
const handleChange = (dates, dateStrings) => {
|
|
800
|
-
if (dates
|
|
801
|
-
props.onChange(dateStrings);
|
|
903
|
+
if (dates) {
|
|
904
|
+
props.onChange && props.onChange(dateStrings);
|
|
802
905
|
} else {
|
|
803
|
-
|
|
906
|
+
props.onChange && props.onChange("clear");
|
|
804
907
|
}
|
|
805
908
|
};
|
|
806
909
|
const rangePresets = [
|
|
@@ -809,7 +912,18 @@ var DateRangePickerElement = (props) => {
|
|
|
809
912
|
{ label: "Last 30 Days", value: [dayjs2().add(-30, "d"), dayjs2()] },
|
|
810
913
|
{ label: "Last 90 Days", value: [dayjs2().add(-90, "d"), dayjs2()] }
|
|
811
914
|
];
|
|
812
|
-
|
|
915
|
+
const disabledDate = (current) => {
|
|
916
|
+
return current && current > moment3();
|
|
917
|
+
};
|
|
918
|
+
return /* @__PURE__ */ React22.createElement(Space, { direction: "vertical", size: 12 }, /* @__PURE__ */ React22.createElement(
|
|
919
|
+
RangePicker,
|
|
920
|
+
{
|
|
921
|
+
disabledDate,
|
|
922
|
+
presets: rangePresets,
|
|
923
|
+
onChange: handleChange,
|
|
924
|
+
value: value ? [dayjs2(value[0]), dayjs2(value[1])] : void 0
|
|
925
|
+
}
|
|
926
|
+
));
|
|
813
927
|
};
|
|
814
928
|
|
|
815
929
|
// src/Components/Image.tsx
|
|
@@ -973,7 +1087,7 @@ var Upload2 = (props) => {
|
|
|
973
1087
|
};
|
|
974
1088
|
|
|
975
1089
|
// src/Components/OtpElement.tsx
|
|
976
|
-
import React30, { useState as useState11, useRef, useEffect as
|
|
1090
|
+
import React30, { useState as useState11, useRef, useEffect as useEffect4 } from "react";
|
|
977
1091
|
import { Input as Input3 } from "antd";
|
|
978
1092
|
var OtpElement = (props) => {
|
|
979
1093
|
const length = props.length;
|
|
@@ -1010,7 +1124,7 @@ var OtpElement = (props) => {
|
|
|
1010
1124
|
});
|
|
1011
1125
|
}
|
|
1012
1126
|
};
|
|
1013
|
-
|
|
1127
|
+
useEffect4(() => {
|
|
1014
1128
|
inputRefs.current[0]?.focus();
|
|
1015
1129
|
}, []);
|
|
1016
1130
|
return /* @__PURE__ */ React30.createElement("div", { className: props.containerClassName }, Array.from({ length }).map((_, index) => /* @__PURE__ */ React30.createElement(
|
|
@@ -1262,7 +1376,7 @@ var HorizontalBarChart = (props) => {
|
|
|
1262
1376
|
};
|
|
1263
1377
|
|
|
1264
1378
|
// src/Components/LineChart.tsx
|
|
1265
|
-
import React34, { useEffect as
|
|
1379
|
+
import React34, { useEffect as useEffect5, useRef as useRef2 } from "react";
|
|
1266
1380
|
import Chart from "chart.js/auto";
|
|
1267
1381
|
var LineChart = (props) => {
|
|
1268
1382
|
const chartRef = useRef2(null);
|
|
@@ -1273,7 +1387,7 @@ var LineChart = (props) => {
|
|
|
1273
1387
|
{ label: "Conversion Rate", data: [50, 100, 150, 180, 50] }
|
|
1274
1388
|
];
|
|
1275
1389
|
const labels = ["Instagram", "Whatsapp", "Messages", "Telegram", "Linkedin"];
|
|
1276
|
-
|
|
1390
|
+
useEffect5(() => {
|
|
1277
1391
|
if (chartRef.current) {
|
|
1278
1392
|
if (chartInstance.current) {
|
|
1279
1393
|
chartInstance.current.destroy();
|
|
@@ -1334,19 +1448,13 @@ var LineChart = (props) => {
|
|
|
1334
1448
|
return /* @__PURE__ */ React34.createElement("div", { className: props.className }, /* @__PURE__ */ React34.createElement("canvas", { ref: chartRef }));
|
|
1335
1449
|
};
|
|
1336
1450
|
|
|
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
|
-
|
|
1343
1451
|
// src/Components/DoubleBarChart.tsx
|
|
1344
|
-
import
|
|
1452
|
+
import React35, { useEffect as useEffect6, useRef as useRef3 } from "react";
|
|
1345
1453
|
import Chart2 from "chart.js/auto";
|
|
1346
1454
|
var DoubleBarChart = (props) => {
|
|
1347
1455
|
const chartRef = useRef3(null);
|
|
1348
1456
|
const chartInstance = useRef3(null);
|
|
1349
|
-
|
|
1457
|
+
useEffect6(() => {
|
|
1350
1458
|
if (chartRef.current) {
|
|
1351
1459
|
if (chartInstance.current) {
|
|
1352
1460
|
chartInstance.current.destroy();
|
|
@@ -1415,11 +1523,11 @@ var DoubleBarChart = (props) => {
|
|
|
1415
1523
|
}
|
|
1416
1524
|
};
|
|
1417
1525
|
}, []);
|
|
1418
|
-
return /* @__PURE__ */
|
|
1526
|
+
return /* @__PURE__ */ React35.createElement("div", { className: props.className }, /* @__PURE__ */ React35.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ React35.createElement("canvas", { ref: chartRef }));
|
|
1419
1527
|
};
|
|
1420
1528
|
|
|
1421
1529
|
// src/Components/BarChart.tsx
|
|
1422
|
-
import
|
|
1530
|
+
import React36 from "react";
|
|
1423
1531
|
import { Bar as Bar2 } from "react-chartjs-2";
|
|
1424
1532
|
import {
|
|
1425
1533
|
Chart as ChartJS4,
|
|
@@ -1487,7 +1595,7 @@ var BarChart = (props) => {
|
|
|
1487
1595
|
}
|
|
1488
1596
|
}
|
|
1489
1597
|
};
|
|
1490
|
-
return /* @__PURE__ */
|
|
1598
|
+
return /* @__PURE__ */ React36.createElement("div", { className: props.className }, /* @__PURE__ */ React36.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ React36.createElement(Bar2, { data, options }));
|
|
1491
1599
|
};
|
|
1492
1600
|
export {
|
|
1493
1601
|
AddMoreTable,
|
|
@@ -1501,7 +1609,6 @@ export {
|
|
|
1501
1609
|
DoubleBarChart,
|
|
1502
1610
|
DropDownGroup,
|
|
1503
1611
|
FileUpload,
|
|
1504
|
-
HighchartsLineChart,
|
|
1505
1612
|
HorizontalBarChart,
|
|
1506
1613
|
Image,
|
|
1507
1614
|
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
|
+
|