@apexcura/ui-components 0.0.14-Beta192 → 0.0.14-Beta194
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 +0 -3
- package/dist/index.d.ts +0 -3
- package/dist/index.js +53 -167
- package/dist/index.mjs +58 -172
- 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
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -385,14 +385,10 @@ var MultipleSelectElement = (props) => {
|
|
|
385
385
|
var import_react11 = __toESM(require("react"));
|
|
386
386
|
var ButtonElement = (props) => {
|
|
387
387
|
const [svgContent, setSvgContent] = (0, import_react11.useState)(null);
|
|
388
|
-
const [originalSvgContent, setOriginalSvgContent] = (0, import_react11.useState)(
|
|
389
|
-
null
|
|
390
|
-
);
|
|
388
|
+
const [originalSvgContent, setOriginalSvgContent] = (0, import_react11.useState)(null);
|
|
391
389
|
const [hoverColor, setHoverColor] = (0, import_react11.useState)(null);
|
|
392
|
-
const [loading, setLoading] = (0, import_react11.useState)(true);
|
|
393
390
|
(0, import_react11.useEffect)(() => {
|
|
394
391
|
if (props.icon) {
|
|
395
|
-
setLoading(false);
|
|
396
392
|
fetch(props.icon).then((response) => response.text()).then((data) => {
|
|
397
393
|
const tempDiv = document.createElement("div");
|
|
398
394
|
tempDiv.innerHTML = data;
|
|
@@ -426,8 +422,7 @@ var ButtonElement = (props) => {
|
|
|
426
422
|
}
|
|
427
423
|
}).catch((error) => console.error("Error fetching SVG:", error));
|
|
428
424
|
}
|
|
429
|
-
|
|
430
|
-
}, []);
|
|
425
|
+
}, [props.icon, props.className]);
|
|
431
426
|
const handleMouseEnter = () => {
|
|
432
427
|
if (hoverColor && originalSvgContent) {
|
|
433
428
|
const tempDiv = document.createElement("div");
|
|
@@ -455,14 +450,12 @@ var ButtonElement = (props) => {
|
|
|
455
450
|
cursor: props.loading ? "no-drop" : "pointer"
|
|
456
451
|
}
|
|
457
452
|
},
|
|
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 &&
|
|
459
|
-
"
|
|
453
|
+
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(
|
|
454
|
+
"span",
|
|
460
455
|
{
|
|
461
|
-
|
|
462
|
-
src: props.icon,
|
|
463
|
-
alt: props.label
|
|
456
|
+
dangerouslySetInnerHTML: { __html: svgContent }
|
|
464
457
|
}
|
|
465
|
-
)
|
|
458
|
+
), props.label)
|
|
466
459
|
);
|
|
467
460
|
};
|
|
468
461
|
|
|
@@ -690,48 +683,18 @@ var import_antd13 = require("antd");
|
|
|
690
683
|
|
|
691
684
|
// src/Components/ModelBody.tsx
|
|
692
685
|
var import_react18 = __toESM(require("react"));
|
|
693
|
-
var import_moment = __toESM(require("moment"));
|
|
694
686
|
var ModelBody = (props) => {
|
|
695
|
-
return /* @__PURE__ */ import_react18.default.createElement("div", { className: props.modalContent && props.modalContent.className }, props.modalContent && props.modalContent.fields.map(
|
|
696
|
-
(eachField)
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
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
|
-
}
|
|
687
|
+
return /* @__PURE__ */ import_react18.default.createElement("div", { className: props.modalContent && props.modalContent.className }, props.modalContent && props.modalContent.fields.map((eachField) => {
|
|
688
|
+
if (eachField.element === "div") {
|
|
689
|
+
return /* @__PURE__ */ import_react18.default.createElement("div", { className: eachField.className }, eachField.label);
|
|
690
|
+
} else if (eachField.element === "input-radio") {
|
|
691
|
+
return /* @__PURE__ */ import_react18.default.createElement("div", { className: eachField.className }, /* @__PURE__ */ import_react18.default.createElement(RadioElement, { ...eachField }));
|
|
692
|
+
} else if (eachField.element === "button") {
|
|
693
|
+
return /* @__PURE__ */ import_react18.default.createElement("div", { className: eachField.className }, /* @__PURE__ */ import_react18.default.createElement(ButtonElement, { ...eachField }));
|
|
694
|
+
} else {
|
|
695
|
+
return null;
|
|
733
696
|
}
|
|
734
|
-
));
|
|
697
|
+
}));
|
|
735
698
|
};
|
|
736
699
|
|
|
737
700
|
// src/Components/Model.tsx
|
|
@@ -756,22 +719,9 @@ var ModelElement = (props) => {
|
|
|
756
719
|
margin: "-10px"
|
|
757
720
|
}
|
|
758
721
|
},
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
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
|
-
}
|
|
722
|
+
Object.entries(selectedRecord).map(([key, value]) => {
|
|
723
|
+
const record = columns.filter((eachColumn) => eachColumn.key === key);
|
|
724
|
+
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)) : "";
|
|
775
725
|
})
|
|
776
726
|
)
|
|
777
727
|
},
|
|
@@ -780,24 +730,12 @@ var ModelElement = (props) => {
|
|
|
780
730
|
};
|
|
781
731
|
|
|
782
732
|
// src/Components/TableElement.tsx
|
|
783
|
-
var import_icons4 = require("@ant-design/icons");
|
|
784
733
|
var TableElement = (props) => {
|
|
785
734
|
const { thead, tbody } = props;
|
|
786
735
|
const [selectedRecord, setSelectedRecord] = (0, import_react20.useState)({});
|
|
787
736
|
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]);
|
|
800
737
|
const handleChange = (record) => {
|
|
738
|
+
console.log("record", record);
|
|
801
739
|
if (props.onChange) {
|
|
802
740
|
props.onChange(record);
|
|
803
741
|
}
|
|
@@ -807,8 +745,8 @@ var TableElement = (props) => {
|
|
|
807
745
|
columns = [
|
|
808
746
|
{
|
|
809
747
|
title: "#",
|
|
810
|
-
dataIndex: "
|
|
811
|
-
key: "
|
|
748
|
+
dataIndex: "#",
|
|
749
|
+
key: "#",
|
|
812
750
|
fixed: "left"
|
|
813
751
|
},
|
|
814
752
|
...thead.map((col, ind) => ({
|
|
@@ -819,9 +757,9 @@ var TableElement = (props) => {
|
|
|
819
757
|
render: col.render,
|
|
820
758
|
sorter: {
|
|
821
759
|
compare: (a, b) => {
|
|
822
|
-
if (typeof a[col.key] === "number" && typeof
|
|
760
|
+
if (typeof a[col.key] === "number" && typeof a[col.key] === "number") {
|
|
823
761
|
return a[col.key] - b[col.key];
|
|
824
|
-
} else if (typeof a[col.key] === "string" && typeof
|
|
762
|
+
} else if (typeof a[col.key] === "string" && typeof a[col.key] === "string") {
|
|
825
763
|
return a[col.key].localeCompare(b[col.key]);
|
|
826
764
|
}
|
|
827
765
|
}
|
|
@@ -833,34 +771,26 @@ var TableElement = (props) => {
|
|
|
833
771
|
title: "View",
|
|
834
772
|
dataIndex: "View",
|
|
835
773
|
key: "View",
|
|
836
|
-
render: (_, record) =>
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
{
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
},
|
|
848
|
-
/* @__PURE__ */ import_react20.default.createElement(import_icons4.EyeOutlined, null)
|
|
849
|
-
);
|
|
850
|
-
}
|
|
774
|
+
render: (_, record) => /* @__PURE__ */ import_react20.default.createElement(
|
|
775
|
+
"a",
|
|
776
|
+
{
|
|
777
|
+
onClick: () => {
|
|
778
|
+
setSelectedRecord(record);
|
|
779
|
+
handleChange(record);
|
|
780
|
+
setModel(true);
|
|
781
|
+
}
|
|
782
|
+
},
|
|
783
|
+
"View"
|
|
784
|
+
)
|
|
851
785
|
});
|
|
852
786
|
}
|
|
853
787
|
}
|
|
854
|
-
const
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
}))
|
|
861
|
-
);
|
|
862
|
-
}
|
|
863
|
-
};
|
|
788
|
+
const dataSource = tbody && tbody.map((row, index) => ({
|
|
789
|
+
...row,
|
|
790
|
+
key: index + 1,
|
|
791
|
+
[columns[0].key]: index + 1
|
|
792
|
+
}));
|
|
793
|
+
const count = dataSource ? dataSource.length : 0;
|
|
864
794
|
const onChangePage = (page, pageSize) => {
|
|
865
795
|
if (props.onChange) {
|
|
866
796
|
props.onChange({ name: "pagination", page, pageSize });
|
|
@@ -868,11 +798,7 @@ var TableElement = (props) => {
|
|
|
868
798
|
};
|
|
869
799
|
const rowSelectionConfig = props.rowSelection ? {
|
|
870
800
|
onChange: (selectedRowKeys, selectedRows) => {
|
|
871
|
-
console.log(
|
|
872
|
-
`selectedRowKeys: ${selectedRowKeys}`,
|
|
873
|
-
"selectedRows: ",
|
|
874
|
-
selectedRows
|
|
875
|
-
);
|
|
801
|
+
console.log(`selectedRowKeys: ${selectedRowKeys}`, "selectedRows: ", selectedRows);
|
|
876
802
|
if (props.onChange) {
|
|
877
803
|
props.onChange(selectedRows);
|
|
878
804
|
}
|
|
@@ -882,41 +808,19 @@ var TableElement = (props) => {
|
|
|
882
808
|
import_antd14.Table,
|
|
883
809
|
{
|
|
884
810
|
className: props.className,
|
|
885
|
-
pagination:
|
|
811
|
+
pagination: {
|
|
886
812
|
showTotal: (total) => `Total: ${total} items`,
|
|
887
|
-
total:
|
|
888
|
-
showSizeChanger:
|
|
813
|
+
total: count,
|
|
814
|
+
showSizeChanger: count > 10,
|
|
889
815
|
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
|
-
};
|
|
902
816
|
},
|
|
903
817
|
rowSelection: rowSelectionConfig,
|
|
904
818
|
dataSource,
|
|
905
819
|
columns,
|
|
906
820
|
size: props.size,
|
|
907
|
-
bordered: true
|
|
908
|
-
onChange: onChangeTable
|
|
909
|
-
}
|
|
910
|
-
), model && /* @__PURE__ */ import_react20.default.createElement(
|
|
911
|
-
ModelElement,
|
|
912
|
-
{
|
|
913
|
-
selectedRecord,
|
|
914
|
-
...props,
|
|
915
|
-
columns,
|
|
916
|
-
model,
|
|
917
|
-
onCancel: () => setModel(false)
|
|
821
|
+
bordered: true
|
|
918
822
|
}
|
|
919
|
-
));
|
|
823
|
+
), model && /* @__PURE__ */ import_react20.default.createElement(ModelElement, { selectedRecord, ...props, columns, model, onCancel: () => setModel(false) }));
|
|
920
824
|
};
|
|
921
825
|
|
|
922
826
|
// src/Components/DatePicker.tsx
|
|
@@ -924,7 +828,6 @@ var import_react21 = __toESM(require("react"));
|
|
|
924
828
|
var import_antd15 = require("antd");
|
|
925
829
|
var import_dayjs = __toESM(require("dayjs"));
|
|
926
830
|
var import_customParseFormat = __toESM(require("dayjs/plugin/customParseFormat.js"));
|
|
927
|
-
var import_moment2 = __toESM(require("moment"));
|
|
928
831
|
import_dayjs.default.extend(import_customParseFormat.default);
|
|
929
832
|
var DatePickerElement = (props) => {
|
|
930
833
|
const [dateState, setDateState] = (0, import_react21.useState)("");
|
|
@@ -942,13 +845,9 @@ var DatePickerElement = (props) => {
|
|
|
942
845
|
}
|
|
943
846
|
}
|
|
944
847
|
};
|
|
945
|
-
const disabledDate = (current) => {
|
|
946
|
-
return current && current > (0, import_moment2.default)();
|
|
947
|
-
};
|
|
948
848
|
return /* @__PURE__ */ import_react21.default.createElement("div", null, /* @__PURE__ */ import_react21.default.createElement(
|
|
949
849
|
import_antd15.DatePicker,
|
|
950
850
|
{
|
|
951
|
-
disabledDate,
|
|
952
851
|
placeholder: props.placeholder,
|
|
953
852
|
value: dateState,
|
|
954
853
|
format: { format: "DD-MM-YYYY" },
|
|
@@ -961,15 +860,13 @@ var DatePickerElement = (props) => {
|
|
|
961
860
|
var import_react22 = __toESM(require("react"));
|
|
962
861
|
var import_antd16 = require("antd");
|
|
963
862
|
var import_dayjs2 = __toESM(require("dayjs"));
|
|
964
|
-
var import_moment3 = __toESM(require("moment"));
|
|
965
863
|
var DateRangePickerElement = (props) => {
|
|
966
|
-
const { value } = props;
|
|
967
864
|
const { RangePicker } = import_antd16.DatePicker;
|
|
968
865
|
const handleChange = (dates, dateStrings) => {
|
|
969
|
-
if (dates) {
|
|
970
|
-
props.onChange
|
|
866
|
+
if (dates && props.onChange) {
|
|
867
|
+
props.onChange(dateStrings);
|
|
971
868
|
} else {
|
|
972
|
-
|
|
869
|
+
console.log("Clear");
|
|
973
870
|
}
|
|
974
871
|
};
|
|
975
872
|
const rangePresets = [
|
|
@@ -978,18 +875,7 @@ var DateRangePickerElement = (props) => {
|
|
|
978
875
|
{ label: "Last 30 Days", value: [(0, import_dayjs2.default)().add(-30, "d"), (0, import_dayjs2.default)()] },
|
|
979
876
|
{ label: "Last 90 Days", value: [(0, import_dayjs2.default)().add(-90, "d"), (0, import_dayjs2.default)()] }
|
|
980
877
|
];
|
|
981
|
-
|
|
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])]
|
|
991
|
-
}
|
|
992
|
-
));
|
|
878
|
+
return /* @__PURE__ */ import_react22.default.createElement(import_antd16.Space, { direction: "vertical", size: 12 }, /* @__PURE__ */ import_react22.default.createElement(RangePicker, { presets: rangePresets, onChange: handleChange }));
|
|
993
879
|
};
|
|
994
880
|
|
|
995
881
|
// src/Components/Image.tsx
|
|
@@ -1068,7 +954,7 @@ var DropDownGroup = (props) => {
|
|
|
1068
954
|
// src/Components/FilesUpload.tsx
|
|
1069
955
|
var import_react26 = __toESM(require("react"));
|
|
1070
956
|
var import_antd19 = require("antd");
|
|
1071
|
-
var
|
|
957
|
+
var import_icons4 = require("@ant-design/icons");
|
|
1072
958
|
var FileUpload = (props) => {
|
|
1073
959
|
const { Dragger } = import_antd19.Upload;
|
|
1074
960
|
const [files, setFiles] = (0, import_react26.useState)([]);
|
|
@@ -1099,7 +985,7 @@ var FileUpload = (props) => {
|
|
|
1099
985
|
showUploadList: true,
|
|
1100
986
|
customRequest
|
|
1101
987
|
},
|
|
1102
|
-
/* @__PURE__ */ import_react26.default.createElement("p", null, /* @__PURE__ */ import_react26.default.createElement(
|
|
988
|
+
/* @__PURE__ */ import_react26.default.createElement("p", null, /* @__PURE__ */ import_react26.default.createElement(import_icons4.InboxOutlined, null)),
|
|
1103
989
|
/* @__PURE__ */ import_react26.default.createElement("p", null, "Click or drag file to upload")
|
|
1104
990
|
));
|
|
1105
991
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -319,14 +319,10 @@ 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
|
-
const [loading, setLoading] = useState4(true);
|
|
327
324
|
useEffect(() => {
|
|
328
325
|
if (props.icon) {
|
|
329
|
-
setLoading(false);
|
|
330
326
|
fetch(props.icon).then((response) => response.text()).then((data) => {
|
|
331
327
|
const tempDiv = document.createElement("div");
|
|
332
328
|
tempDiv.innerHTML = data;
|
|
@@ -360,8 +356,7 @@ var ButtonElement = (props) => {
|
|
|
360
356
|
}
|
|
361
357
|
}).catch((error) => console.error("Error fetching SVG:", error));
|
|
362
358
|
}
|
|
363
|
-
|
|
364
|
-
}, []);
|
|
359
|
+
}, [props.icon, props.className]);
|
|
365
360
|
const handleMouseEnter = () => {
|
|
366
361
|
if (hoverColor && originalSvgContent) {
|
|
367
362
|
const tempDiv = document.createElement("div");
|
|
@@ -389,14 +384,12 @@ var ButtonElement = (props) => {
|
|
|
389
384
|
cursor: props.loading ? "no-drop" : "pointer"
|
|
390
385
|
}
|
|
391
386
|
},
|
|
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 &&
|
|
393
|
-
"
|
|
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",
|
|
394
389
|
{
|
|
395
|
-
|
|
396
|
-
src: props.icon,
|
|
397
|
-
alt: props.label
|
|
390
|
+
dangerouslySetInnerHTML: { __html: svgContent }
|
|
398
391
|
}
|
|
399
|
-
)
|
|
392
|
+
), props.label)
|
|
400
393
|
);
|
|
401
394
|
};
|
|
402
395
|
|
|
@@ -615,7 +608,7 @@ var Navbar = (props) => {
|
|
|
615
608
|
};
|
|
616
609
|
|
|
617
610
|
// src/Components/TableElement.tsx
|
|
618
|
-
import React20, { useState as useState6
|
|
611
|
+
import React20, { useState as useState6 } from "react";
|
|
619
612
|
import { Table as Table2 } from "antd";
|
|
620
613
|
|
|
621
614
|
// src/Components/Model.tsx
|
|
@@ -624,48 +617,18 @@ import { Modal } from "antd";
|
|
|
624
617
|
|
|
625
618
|
// src/Components/ModelBody.tsx
|
|
626
619
|
import React18 from "react";
|
|
627
|
-
import moment from "moment";
|
|
628
620
|
var ModelBody = (props) => {
|
|
629
|
-
return /* @__PURE__ */ React18.createElement("div", { className: props.modalContent && props.modalContent.className }, props.modalContent && props.modalContent.fields.map(
|
|
630
|
-
(eachField)
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
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
|
-
}
|
|
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;
|
|
667
630
|
}
|
|
668
|
-
));
|
|
631
|
+
}));
|
|
669
632
|
};
|
|
670
633
|
|
|
671
634
|
// src/Components/Model.tsx
|
|
@@ -690,22 +653,9 @@ var ModelElement = (props) => {
|
|
|
690
653
|
margin: "-10px"
|
|
691
654
|
}
|
|
692
655
|
},
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
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
|
-
}
|
|
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)) : "";
|
|
709
659
|
})
|
|
710
660
|
)
|
|
711
661
|
},
|
|
@@ -714,24 +664,12 @@ var ModelElement = (props) => {
|
|
|
714
664
|
};
|
|
715
665
|
|
|
716
666
|
// src/Components/TableElement.tsx
|
|
717
|
-
import { EyeOutlined } from "@ant-design/icons";
|
|
718
667
|
var TableElement = (props) => {
|
|
719
668
|
const { thead, tbody } = props;
|
|
720
669
|
const [selectedRecord, setSelectedRecord] = useState6({});
|
|
721
670
|
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]);
|
|
734
671
|
const handleChange = (record) => {
|
|
672
|
+
console.log("record", record);
|
|
735
673
|
if (props.onChange) {
|
|
736
674
|
props.onChange(record);
|
|
737
675
|
}
|
|
@@ -741,8 +679,8 @@ var TableElement = (props) => {
|
|
|
741
679
|
columns = [
|
|
742
680
|
{
|
|
743
681
|
title: "#",
|
|
744
|
-
dataIndex: "
|
|
745
|
-
key: "
|
|
682
|
+
dataIndex: "#",
|
|
683
|
+
key: "#",
|
|
746
684
|
fixed: "left"
|
|
747
685
|
},
|
|
748
686
|
...thead.map((col, ind) => ({
|
|
@@ -753,9 +691,9 @@ var TableElement = (props) => {
|
|
|
753
691
|
render: col.render,
|
|
754
692
|
sorter: {
|
|
755
693
|
compare: (a, b) => {
|
|
756
|
-
if (typeof a[col.key] === "number" && typeof
|
|
694
|
+
if (typeof a[col.key] === "number" && typeof a[col.key] === "number") {
|
|
757
695
|
return a[col.key] - b[col.key];
|
|
758
|
-
} else if (typeof a[col.key] === "string" && typeof
|
|
696
|
+
} else if (typeof a[col.key] === "string" && typeof a[col.key] === "string") {
|
|
759
697
|
return a[col.key].localeCompare(b[col.key]);
|
|
760
698
|
}
|
|
761
699
|
}
|
|
@@ -767,34 +705,26 @@ var TableElement = (props) => {
|
|
|
767
705
|
title: "View",
|
|
768
706
|
dataIndex: "View",
|
|
769
707
|
key: "View",
|
|
770
|
-
render: (_, record) =>
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
{
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
},
|
|
782
|
-
/* @__PURE__ */ React20.createElement(EyeOutlined, null)
|
|
783
|
-
);
|
|
784
|
-
}
|
|
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
|
+
)
|
|
785
719
|
});
|
|
786
720
|
}
|
|
787
721
|
}
|
|
788
|
-
const
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
}))
|
|
795
|
-
);
|
|
796
|
-
}
|
|
797
|
-
};
|
|
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;
|
|
798
728
|
const onChangePage = (page, pageSize) => {
|
|
799
729
|
if (props.onChange) {
|
|
800
730
|
props.onChange({ name: "pagination", page, pageSize });
|
|
@@ -802,11 +732,7 @@ var TableElement = (props) => {
|
|
|
802
732
|
};
|
|
803
733
|
const rowSelectionConfig = props.rowSelection ? {
|
|
804
734
|
onChange: (selectedRowKeys, selectedRows) => {
|
|
805
|
-
console.log(
|
|
806
|
-
`selectedRowKeys: ${selectedRowKeys}`,
|
|
807
|
-
"selectedRows: ",
|
|
808
|
-
selectedRows
|
|
809
|
-
);
|
|
735
|
+
console.log(`selectedRowKeys: ${selectedRowKeys}`, "selectedRows: ", selectedRows);
|
|
810
736
|
if (props.onChange) {
|
|
811
737
|
props.onChange(selectedRows);
|
|
812
738
|
}
|
|
@@ -816,41 +742,19 @@ var TableElement = (props) => {
|
|
|
816
742
|
Table2,
|
|
817
743
|
{
|
|
818
744
|
className: props.className,
|
|
819
|
-
pagination:
|
|
745
|
+
pagination: {
|
|
820
746
|
showTotal: (total) => `Total: ${total} items`,
|
|
821
|
-
total:
|
|
822
|
-
showSizeChanger:
|
|
747
|
+
total: count,
|
|
748
|
+
showSizeChanger: count > 10,
|
|
823
749
|
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
|
-
};
|
|
836
750
|
},
|
|
837
751
|
rowSelection: rowSelectionConfig,
|
|
838
752
|
dataSource,
|
|
839
753
|
columns,
|
|
840
754
|
size: props.size,
|
|
841
|
-
bordered: true
|
|
842
|
-
onChange: onChangeTable
|
|
843
|
-
}
|
|
844
|
-
), model && /* @__PURE__ */ React20.createElement(
|
|
845
|
-
ModelElement,
|
|
846
|
-
{
|
|
847
|
-
selectedRecord,
|
|
848
|
-
...props,
|
|
849
|
-
columns,
|
|
850
|
-
model,
|
|
851
|
-
onCancel: () => setModel(false)
|
|
755
|
+
bordered: true
|
|
852
756
|
}
|
|
853
|
-
));
|
|
757
|
+
), model && /* @__PURE__ */ React20.createElement(ModelElement, { selectedRecord, ...props, columns, model, onCancel: () => setModel(false) }));
|
|
854
758
|
};
|
|
855
759
|
|
|
856
760
|
// src/Components/DatePicker.tsx
|
|
@@ -858,7 +762,6 @@ import React21, { useState as useState7 } from "react";
|
|
|
858
762
|
import { DatePicker } from "antd";
|
|
859
763
|
import dayjs from "dayjs";
|
|
860
764
|
import customParseFormat from "dayjs/plugin/customParseFormat.js";
|
|
861
|
-
import moment2 from "moment";
|
|
862
765
|
dayjs.extend(customParseFormat);
|
|
863
766
|
var DatePickerElement = (props) => {
|
|
864
767
|
const [dateState, setDateState] = useState7("");
|
|
@@ -876,13 +779,9 @@ var DatePickerElement = (props) => {
|
|
|
876
779
|
}
|
|
877
780
|
}
|
|
878
781
|
};
|
|
879
|
-
const disabledDate = (current) => {
|
|
880
|
-
return current && current > moment2();
|
|
881
|
-
};
|
|
882
782
|
return /* @__PURE__ */ React21.createElement("div", null, /* @__PURE__ */ React21.createElement(
|
|
883
783
|
DatePicker,
|
|
884
784
|
{
|
|
885
|
-
disabledDate,
|
|
886
785
|
placeholder: props.placeholder,
|
|
887
786
|
value: dateState,
|
|
888
787
|
format: { format: "DD-MM-YYYY" },
|
|
@@ -895,15 +794,13 @@ var DatePickerElement = (props) => {
|
|
|
895
794
|
import React22 from "react";
|
|
896
795
|
import { DatePicker as DatePicker2, Space } from "antd";
|
|
897
796
|
import dayjs2 from "dayjs";
|
|
898
|
-
import moment3 from "moment";
|
|
899
797
|
var DateRangePickerElement = (props) => {
|
|
900
|
-
const { value } = props;
|
|
901
798
|
const { RangePicker } = DatePicker2;
|
|
902
799
|
const handleChange = (dates, dateStrings) => {
|
|
903
|
-
if (dates) {
|
|
904
|
-
props.onChange
|
|
800
|
+
if (dates && props.onChange) {
|
|
801
|
+
props.onChange(dateStrings);
|
|
905
802
|
} else {
|
|
906
|
-
|
|
803
|
+
console.log("Clear");
|
|
907
804
|
}
|
|
908
805
|
};
|
|
909
806
|
const rangePresets = [
|
|
@@ -912,18 +809,7 @@ var DateRangePickerElement = (props) => {
|
|
|
912
809
|
{ label: "Last 30 Days", value: [dayjs2().add(-30, "d"), dayjs2()] },
|
|
913
810
|
{ label: "Last 90 Days", value: [dayjs2().add(-90, "d"), dayjs2()] }
|
|
914
811
|
];
|
|
915
|
-
|
|
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])]
|
|
925
|
-
}
|
|
926
|
-
));
|
|
812
|
+
return /* @__PURE__ */ React22.createElement(Space, { direction: "vertical", size: 12 }, /* @__PURE__ */ React22.createElement(RangePicker, { presets: rangePresets, onChange: handleChange }));
|
|
927
813
|
};
|
|
928
814
|
|
|
929
815
|
// src/Components/Image.tsx
|
|
@@ -1087,7 +973,7 @@ var Upload2 = (props) => {
|
|
|
1087
973
|
};
|
|
1088
974
|
|
|
1089
975
|
// src/Components/OtpElement.tsx
|
|
1090
|
-
import React30, { useState as useState11, useRef, useEffect as
|
|
976
|
+
import React30, { useState as useState11, useRef, useEffect as useEffect3 } from "react";
|
|
1091
977
|
import { Input as Input3 } from "antd";
|
|
1092
978
|
var OtpElement = (props) => {
|
|
1093
979
|
const length = props.length;
|
|
@@ -1124,7 +1010,7 @@ var OtpElement = (props) => {
|
|
|
1124
1010
|
});
|
|
1125
1011
|
}
|
|
1126
1012
|
};
|
|
1127
|
-
|
|
1013
|
+
useEffect3(() => {
|
|
1128
1014
|
inputRefs.current[0]?.focus();
|
|
1129
1015
|
}, []);
|
|
1130
1016
|
return /* @__PURE__ */ React30.createElement("div", { className: props.containerClassName }, Array.from({ length }).map((_, index) => /* @__PURE__ */ React30.createElement(
|
|
@@ -1376,7 +1262,7 @@ var HorizontalBarChart = (props) => {
|
|
|
1376
1262
|
};
|
|
1377
1263
|
|
|
1378
1264
|
// src/Components/LineChart.tsx
|
|
1379
|
-
import React34, { useEffect as
|
|
1265
|
+
import React34, { useEffect as useEffect4, useRef as useRef2 } from "react";
|
|
1380
1266
|
import Chart from "chart.js/auto";
|
|
1381
1267
|
var LineChart = (props) => {
|
|
1382
1268
|
const chartRef = useRef2(null);
|
|
@@ -1387,7 +1273,7 @@ var LineChart = (props) => {
|
|
|
1387
1273
|
{ label: "Conversion Rate", data: [50, 100, 150, 180, 50] }
|
|
1388
1274
|
];
|
|
1389
1275
|
const labels = ["Instagram", "Whatsapp", "Messages", "Telegram", "Linkedin"];
|
|
1390
|
-
|
|
1276
|
+
useEffect4(() => {
|
|
1391
1277
|
if (chartRef.current) {
|
|
1392
1278
|
if (chartInstance.current) {
|
|
1393
1279
|
chartInstance.current.destroy();
|
|
@@ -1449,12 +1335,12 @@ var LineChart = (props) => {
|
|
|
1449
1335
|
};
|
|
1450
1336
|
|
|
1451
1337
|
// src/Components/DoubleBarChart.tsx
|
|
1452
|
-
import React35, { useEffect as
|
|
1338
|
+
import React35, { useEffect as useEffect5, useRef as useRef3 } from "react";
|
|
1453
1339
|
import Chart2 from "chart.js/auto";
|
|
1454
1340
|
var DoubleBarChart = (props) => {
|
|
1455
1341
|
const chartRef = useRef3(null);
|
|
1456
1342
|
const chartInstance = useRef3(null);
|
|
1457
|
-
|
|
1343
|
+
useEffect5(() => {
|
|
1458
1344
|
if (chartRef.current) {
|
|
1459
1345
|
if (chartInstance.current) {
|
|
1460
1346
|
chartInstance.current.destroy();
|
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
|
+
|