@apexcura/ui-components 0.0.14-Beta2 → 0.0.14-Beta21
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/dist/index.d.mts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +46 -48
- package/dist/index.mjs +43 -46
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -26,6 +26,8 @@ type ElementType = {
|
|
|
26
26
|
fields?: any[];
|
|
27
27
|
schema?: any[];
|
|
28
28
|
options?: any[];
|
|
29
|
+
firstOptions: any[];
|
|
30
|
+
secondOptions: any[];
|
|
29
31
|
onChange?: (value: string | number | boolean | object | any[] | undefined) => void;
|
|
30
32
|
onClick?: () => void;
|
|
31
33
|
dropDownOptions?: any[];
|
|
@@ -106,4 +108,6 @@ declare const FileUpload: (props: ElementType) => React$1.JSX.Element;
|
|
|
106
108
|
|
|
107
109
|
declare const TabsElement: (props: ElementType) => React$1.JSX.Element;
|
|
108
110
|
|
|
109
|
-
|
|
111
|
+
declare const SwitchElement: () => React$1.JSX.Element;
|
|
112
|
+
|
|
113
|
+
export { AddMoreTable, ButtonElement, CheckboxElement, CkEditor, DatePickerElement, DateRangePickerElement, DropDownGroup, FileUpload, Image, MultipleSelectElement, Navbar, NumberElement, PasswordElement, RadioElement, SelectElement, Sidebar, SingleCheckbox, SingleSelectElement, SwitchElement, TableElement, TabsElement, TextElement, TextareaElement };
|
package/dist/index.d.ts
CHANGED
|
@@ -26,6 +26,8 @@ type ElementType = {
|
|
|
26
26
|
fields?: any[];
|
|
27
27
|
schema?: any[];
|
|
28
28
|
options?: any[];
|
|
29
|
+
firstOptions: any[];
|
|
30
|
+
secondOptions: any[];
|
|
29
31
|
onChange?: (value: string | number | boolean | object | any[] | undefined) => void;
|
|
30
32
|
onClick?: () => void;
|
|
31
33
|
dropDownOptions?: any[];
|
|
@@ -106,4 +108,6 @@ declare const FileUpload: (props: ElementType) => React$1.JSX.Element;
|
|
|
106
108
|
|
|
107
109
|
declare const TabsElement: (props: ElementType) => React$1.JSX.Element;
|
|
108
110
|
|
|
109
|
-
|
|
111
|
+
declare const SwitchElement: () => React$1.JSX.Element;
|
|
112
|
+
|
|
113
|
+
export { AddMoreTable, ButtonElement, CheckboxElement, CkEditor, DatePickerElement, DateRangePickerElement, DropDownGroup, FileUpload, Image, MultipleSelectElement, Navbar, NumberElement, PasswordElement, RadioElement, SelectElement, Sidebar, SingleCheckbox, SingleSelectElement, SwitchElement, TableElement, TabsElement, TextElement, TextareaElement };
|
package/dist/index.js
CHANGED
|
@@ -48,6 +48,7 @@ __export(src_exports, {
|
|
|
48
48
|
Sidebar: () => Sidebar,
|
|
49
49
|
SingleCheckbox: () => SingleCheckbox,
|
|
50
50
|
SingleSelectElement: () => SingleSelectElement,
|
|
51
|
+
SwitchElement: () => SwitchElement,
|
|
51
52
|
TableElement: () => TableElement,
|
|
52
53
|
TabsElement: () => TabsElement,
|
|
53
54
|
TextElement: () => TextElement,
|
|
@@ -464,9 +465,9 @@ var AddMoreTable = (props) => {
|
|
|
464
465
|
if (!element) return null;
|
|
465
466
|
const { element: type, label } = element;
|
|
466
467
|
if (type === "single-select") {
|
|
467
|
-
return /* @__PURE__ */ import_react12.default.createElement(SingleSelectElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false });
|
|
468
|
+
return /* @__PURE__ */ import_react12.default.createElement(SingleSelectElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false, options1: [], options2: [], firstOptions: [], secondOptions: [] });
|
|
468
469
|
} else if (type === "textarea") {
|
|
469
|
-
return /* @__PURE__ */ import_react12.default.createElement(TextareaElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false });
|
|
470
|
+
return /* @__PURE__ */ import_react12.default.createElement(TextareaElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false, options1: [], options2: [], firstOptions: [], secondOptions: [] });
|
|
470
471
|
} else {
|
|
471
472
|
return null;
|
|
472
473
|
}
|
|
@@ -681,7 +682,23 @@ var TableElement = (props) => {
|
|
|
681
682
|
}
|
|
682
683
|
}
|
|
683
684
|
}
|
|
684
|
-
}))
|
|
685
|
+
})),
|
|
686
|
+
{
|
|
687
|
+
title: "View",
|
|
688
|
+
dataIndex: "View",
|
|
689
|
+
key: "View",
|
|
690
|
+
render: (_, record) => /* @__PURE__ */ import_react20.default.createElement(
|
|
691
|
+
"a",
|
|
692
|
+
{
|
|
693
|
+
onClick: () => {
|
|
694
|
+
setSelectedRecord(record);
|
|
695
|
+
handleChange(record);
|
|
696
|
+
setModel(true);
|
|
697
|
+
}
|
|
698
|
+
},
|
|
699
|
+
"View"
|
|
700
|
+
)
|
|
701
|
+
}
|
|
685
702
|
];
|
|
686
703
|
}
|
|
687
704
|
const dataSource = tbody && tbody.map((row, index) => ({
|
|
@@ -715,17 +732,7 @@ var TableElement = (props) => {
|
|
|
715
732
|
columns,
|
|
716
733
|
bordered: true,
|
|
717
734
|
rowSelection: rowSelectionConfig,
|
|
718
|
-
size: props.size && props.size
|
|
719
|
-
onRow: (record) => {
|
|
720
|
-
return {
|
|
721
|
-
onClick: () => {
|
|
722
|
-
setSelectedRecord(record);
|
|
723
|
-
handleChange(record);
|
|
724
|
-
setModel(true);
|
|
725
|
-
},
|
|
726
|
-
style: { cursor: "pointer" }
|
|
727
|
-
};
|
|
728
|
-
}
|
|
735
|
+
size: props.size && props.size
|
|
729
736
|
}
|
|
730
737
|
), model && /* @__PURE__ */ import_react20.default.createElement(ModelElement, { selectedRecord, ...props, columns, model, onCancel: () => setModel(false) }));
|
|
731
738
|
};
|
|
@@ -733,18 +740,15 @@ var TableElement = (props) => {
|
|
|
733
740
|
// src/Components/DatePicker.tsx
|
|
734
741
|
var import_react21 = __toESM(require("react"));
|
|
735
742
|
var import_antd15 = require("antd");
|
|
736
|
-
var import_icons4 = require("@ant-design/icons");
|
|
737
|
-
var import_moment = __toESM(require("moment"));
|
|
738
743
|
var DatePickerElement = (props) => {
|
|
739
744
|
const [date, setDate] = (0, import_react21.useState)(null);
|
|
745
|
+
const dateFormat = "DD/MM/YYYY";
|
|
740
746
|
const handleChange = (date2, dateString) => {
|
|
741
|
-
console.log("date
|
|
742
|
-
console.log("datestring", dateString);
|
|
747
|
+
console.log("date==========", date2);
|
|
743
748
|
if (date2) {
|
|
744
|
-
|
|
745
|
-
|
|
749
|
+
console.log("date==", date2);
|
|
750
|
+
const formattedDate = date2.format(dateFormat);
|
|
746
751
|
setDate(date2);
|
|
747
|
-
console.log("changedDate------------", date2);
|
|
748
752
|
if (props.onChange) {
|
|
749
753
|
props.onChange(formattedDate);
|
|
750
754
|
}
|
|
@@ -755,23 +759,7 @@ var DatePickerElement = (props) => {
|
|
|
755
759
|
}
|
|
756
760
|
}
|
|
757
761
|
};
|
|
758
|
-
|
|
759
|
-
const currentDate = date || (0, import_moment.default)();
|
|
760
|
-
const newDate = (0, import_moment.default)(currentDate).subtract(1, "days");
|
|
761
|
-
setDate(newDate);
|
|
762
|
-
if (props.onChange) {
|
|
763
|
-
props.onChange(newDate.format("lll"));
|
|
764
|
-
}
|
|
765
|
-
};
|
|
766
|
-
const onHandleIncrement = () => {
|
|
767
|
-
const currentDate = date || (0, import_moment.default)();
|
|
768
|
-
const newDate = (0, import_moment.default)(currentDate).add(1, "days");
|
|
769
|
-
setDate(newDate);
|
|
770
|
-
if (props.onChange) {
|
|
771
|
-
props.onChange(newDate.format("lll"));
|
|
772
|
-
}
|
|
773
|
-
};
|
|
774
|
-
return /* @__PURE__ */ import_react21.default.createElement("div", null, /* @__PURE__ */ import_react21.default.createElement("button", { onClick: onHandleDecrement }, /* @__PURE__ */ import_react21.default.createElement(import_icons4.LeftOutlined, null)), /* @__PURE__ */ import_react21.default.createElement(
|
|
762
|
+
return /* @__PURE__ */ import_react21.default.createElement("div", null, /* @__PURE__ */ import_react21.default.createElement(
|
|
775
763
|
import_antd15.DatePicker,
|
|
776
764
|
{
|
|
777
765
|
placeholder: props.placeholder,
|
|
@@ -779,7 +767,7 @@ var DatePickerElement = (props) => {
|
|
|
779
767
|
variant: "borderless",
|
|
780
768
|
onChange: handleChange
|
|
781
769
|
}
|
|
782
|
-
)
|
|
770
|
+
));
|
|
783
771
|
};
|
|
784
772
|
|
|
785
773
|
// src/Components/DateRangePickerElement.tsx
|
|
@@ -827,24 +815,25 @@ var import_react25 = __toESM(require("react"));
|
|
|
827
815
|
var import_antd18 = require("antd");
|
|
828
816
|
var DropDownGroup = (props) => {
|
|
829
817
|
const [selectedValue, setSelectedValue] = (0, import_react25.useState)({ firstValue: {}, secondValue: {} });
|
|
818
|
+
console.log(selectedValue);
|
|
830
819
|
const handleFirstChange = (value) => {
|
|
831
|
-
const filterOption2 = props.
|
|
820
|
+
const filterOption2 = props.firstOptions?.find((eachOption) => eachOption.value === value);
|
|
832
821
|
setSelectedValue((prev) => {
|
|
833
822
|
const newValue = { ...prev, firstValue: filterOption2 };
|
|
834
823
|
if (newValue.firstValue) {
|
|
835
824
|
props.onChange?.(newValue);
|
|
836
825
|
}
|
|
837
|
-
return
|
|
826
|
+
return newValue;
|
|
838
827
|
});
|
|
839
828
|
};
|
|
840
829
|
const handleSecondChange = (value) => {
|
|
841
|
-
const filterOption2 = props.
|
|
830
|
+
const filterOption2 = props.secondOptions?.find((eachOption) => eachOption.value === value);
|
|
842
831
|
setSelectedValue((prev) => {
|
|
843
832
|
const newValue = { ...prev, secondValue: filterOption2 };
|
|
844
833
|
if (newValue.secondValue) {
|
|
845
834
|
props.onChange?.(newValue);
|
|
846
835
|
}
|
|
847
|
-
return
|
|
836
|
+
return newValue;
|
|
848
837
|
});
|
|
849
838
|
};
|
|
850
839
|
return /* @__PURE__ */ import_react25.default.createElement("div", { className: props.className, style: { display: "flex", flexDirection: "row", backgroundColor: "white", borderRadius: 10, border: "1px solid gray" } }, /* @__PURE__ */ import_react25.default.createElement(
|
|
@@ -852,14 +841,14 @@ var DropDownGroup = (props) => {
|
|
|
852
841
|
{
|
|
853
842
|
onChange: handleFirstChange,
|
|
854
843
|
variant: props.variant,
|
|
855
|
-
options: props.
|
|
844
|
+
options: props.firstOptions
|
|
856
845
|
}
|
|
857
846
|
), /* @__PURE__ */ import_react25.default.createElement("div", { style: { borderLeft: "1px solid gray", height: "33px" } }), /* @__PURE__ */ import_react25.default.createElement(
|
|
858
847
|
import_antd18.Select,
|
|
859
848
|
{
|
|
860
849
|
onChange: handleSecondChange,
|
|
861
850
|
variant: props.variant,
|
|
862
|
-
options: props.
|
|
851
|
+
options: props.secondOptions
|
|
863
852
|
}
|
|
864
853
|
));
|
|
865
854
|
};
|
|
@@ -867,12 +856,12 @@ var DropDownGroup = (props) => {
|
|
|
867
856
|
// src/Components/FilesUpload.tsx
|
|
868
857
|
var import_react26 = __toESM(require("react"));
|
|
869
858
|
var import_antd19 = require("antd");
|
|
870
|
-
var
|
|
859
|
+
var import_icons4 = require("@ant-design/icons");
|
|
871
860
|
var FileUpload = (props) => {
|
|
872
861
|
const { Dragger } = import_antd19.Upload;
|
|
873
862
|
const [files, setFiles] = (0, import_react26.useState)([]);
|
|
874
863
|
const beforeUpload = (file) => {
|
|
875
|
-
const isCorrectFile = ["image
|
|
864
|
+
const isCorrectFile = ["image/*", "video/*", "application/*"].includes(file.type);
|
|
876
865
|
if (!isCorrectFile) {
|
|
877
866
|
import_antd19.message.error(`(${file.name}) is an invalid file. Please upload files with the following extensions only (.png/.jpg/.jpeg/.pdf)`);
|
|
878
867
|
return import_antd19.Upload.LIST_IGNORE;
|
|
@@ -907,7 +896,7 @@ var FileUpload = (props) => {
|
|
|
907
896
|
showUploadList: true,
|
|
908
897
|
customRequest
|
|
909
898
|
},
|
|
910
|
-
/* @__PURE__ */ import_react26.default.createElement("p", null, /* @__PURE__ */ import_react26.default.createElement(
|
|
899
|
+
/* @__PURE__ */ import_react26.default.createElement("p", null, /* @__PURE__ */ import_react26.default.createElement(import_icons4.InboxOutlined, null)),
|
|
911
900
|
/* @__PURE__ */ import_react26.default.createElement("p", null, "Click or drag file to upload")
|
|
912
901
|
));
|
|
913
902
|
};
|
|
@@ -923,6 +912,14 @@ var TabsElement = (props) => {
|
|
|
923
912
|
};
|
|
924
913
|
return /* @__PURE__ */ import_react27.default.createElement(import_antd20.Tabs, { className: props.containerClassName, items: props.options, onChange: handleChange });
|
|
925
914
|
};
|
|
915
|
+
|
|
916
|
+
// src/Components/SwitchElement.tsx
|
|
917
|
+
var import_react28 = __toESM(require("react"));
|
|
918
|
+
var import_antd21 = require("antd");
|
|
919
|
+
var onChange = (checked) => {
|
|
920
|
+
console.log(`switch to ${checked}`);
|
|
921
|
+
};
|
|
922
|
+
var SwitchElement = () => /* @__PURE__ */ import_react28.default.createElement(import_antd21.Switch, { defaultChecked: true, onChange });
|
|
926
923
|
// Annotate the CommonJS export names for ESM import in node:
|
|
927
924
|
0 && (module.exports = {
|
|
928
925
|
AddMoreTable,
|
|
@@ -943,6 +940,7 @@ var TabsElement = (props) => {
|
|
|
943
940
|
Sidebar,
|
|
944
941
|
SingleCheckbox,
|
|
945
942
|
SingleSelectElement,
|
|
943
|
+
SwitchElement,
|
|
946
944
|
TableElement,
|
|
947
945
|
TabsElement,
|
|
948
946
|
TextElement,
|
package/dist/index.mjs
CHANGED
|
@@ -407,9 +407,9 @@ var AddMoreTable = (props) => {
|
|
|
407
407
|
if (!element) return null;
|
|
408
408
|
const { element: type, label } = element;
|
|
409
409
|
if (type === "single-select") {
|
|
410
|
-
return /* @__PURE__ */ React12.createElement(SingleSelectElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false });
|
|
410
|
+
return /* @__PURE__ */ React12.createElement(SingleSelectElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false, options1: [], options2: [], firstOptions: [], secondOptions: [] });
|
|
411
411
|
} else if (type === "textarea") {
|
|
412
|
-
return /* @__PURE__ */ React12.createElement(TextareaElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false });
|
|
412
|
+
return /* @__PURE__ */ React12.createElement(TextareaElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false, options1: [], options2: [], firstOptions: [], secondOptions: [] });
|
|
413
413
|
} else {
|
|
414
414
|
return null;
|
|
415
415
|
}
|
|
@@ -624,7 +624,23 @@ var TableElement = (props) => {
|
|
|
624
624
|
}
|
|
625
625
|
}
|
|
626
626
|
}
|
|
627
|
-
}))
|
|
627
|
+
})),
|
|
628
|
+
{
|
|
629
|
+
title: "View",
|
|
630
|
+
dataIndex: "View",
|
|
631
|
+
key: "View",
|
|
632
|
+
render: (_, record) => /* @__PURE__ */ React20.createElement(
|
|
633
|
+
"a",
|
|
634
|
+
{
|
|
635
|
+
onClick: () => {
|
|
636
|
+
setSelectedRecord(record);
|
|
637
|
+
handleChange(record);
|
|
638
|
+
setModel(true);
|
|
639
|
+
}
|
|
640
|
+
},
|
|
641
|
+
"View"
|
|
642
|
+
)
|
|
643
|
+
}
|
|
628
644
|
];
|
|
629
645
|
}
|
|
630
646
|
const dataSource = tbody && tbody.map((row, index) => ({
|
|
@@ -658,17 +674,7 @@ var TableElement = (props) => {
|
|
|
658
674
|
columns,
|
|
659
675
|
bordered: true,
|
|
660
676
|
rowSelection: rowSelectionConfig,
|
|
661
|
-
size: props.size && props.size
|
|
662
|
-
onRow: (record) => {
|
|
663
|
-
return {
|
|
664
|
-
onClick: () => {
|
|
665
|
-
setSelectedRecord(record);
|
|
666
|
-
handleChange(record);
|
|
667
|
-
setModel(true);
|
|
668
|
-
},
|
|
669
|
-
style: { cursor: "pointer" }
|
|
670
|
-
};
|
|
671
|
-
}
|
|
677
|
+
size: props.size && props.size
|
|
672
678
|
}
|
|
673
679
|
), model && /* @__PURE__ */ React20.createElement(ModelElement, { selectedRecord, ...props, columns, model, onCancel: () => setModel(false) }));
|
|
674
680
|
};
|
|
@@ -676,18 +682,15 @@ var TableElement = (props) => {
|
|
|
676
682
|
// src/Components/DatePicker.tsx
|
|
677
683
|
import React21, { useState as useState6 } from "react";
|
|
678
684
|
import { DatePicker } from "antd";
|
|
679
|
-
import { LeftOutlined, RightOutlined } from "@ant-design/icons";
|
|
680
|
-
import moment from "moment";
|
|
681
685
|
var DatePickerElement = (props) => {
|
|
682
686
|
const [date, setDate] = useState6(null);
|
|
687
|
+
const dateFormat = "DD/MM/YYYY";
|
|
683
688
|
const handleChange = (date2, dateString) => {
|
|
684
|
-
console.log("date
|
|
685
|
-
console.log("datestring", dateString);
|
|
689
|
+
console.log("date==========", date2);
|
|
686
690
|
if (date2) {
|
|
687
|
-
|
|
688
|
-
|
|
691
|
+
console.log("date==", date2);
|
|
692
|
+
const formattedDate = date2.format(dateFormat);
|
|
689
693
|
setDate(date2);
|
|
690
|
-
console.log("changedDate------------", date2);
|
|
691
694
|
if (props.onChange) {
|
|
692
695
|
props.onChange(formattedDate);
|
|
693
696
|
}
|
|
@@ -698,23 +701,7 @@ var DatePickerElement = (props) => {
|
|
|
698
701
|
}
|
|
699
702
|
}
|
|
700
703
|
};
|
|
701
|
-
|
|
702
|
-
const currentDate = date || moment();
|
|
703
|
-
const newDate = moment(currentDate).subtract(1, "days");
|
|
704
|
-
setDate(newDate);
|
|
705
|
-
if (props.onChange) {
|
|
706
|
-
props.onChange(newDate.format("lll"));
|
|
707
|
-
}
|
|
708
|
-
};
|
|
709
|
-
const onHandleIncrement = () => {
|
|
710
|
-
const currentDate = date || moment();
|
|
711
|
-
const newDate = moment(currentDate).add(1, "days");
|
|
712
|
-
setDate(newDate);
|
|
713
|
-
if (props.onChange) {
|
|
714
|
-
props.onChange(newDate.format("lll"));
|
|
715
|
-
}
|
|
716
|
-
};
|
|
717
|
-
return /* @__PURE__ */ React21.createElement("div", null, /* @__PURE__ */ React21.createElement("button", { onClick: onHandleDecrement }, /* @__PURE__ */ React21.createElement(LeftOutlined, null)), /* @__PURE__ */ React21.createElement(
|
|
704
|
+
return /* @__PURE__ */ React21.createElement("div", null, /* @__PURE__ */ React21.createElement(
|
|
718
705
|
DatePicker,
|
|
719
706
|
{
|
|
720
707
|
placeholder: props.placeholder,
|
|
@@ -722,7 +709,7 @@ var DatePickerElement = (props) => {
|
|
|
722
709
|
variant: "borderless",
|
|
723
710
|
onChange: handleChange
|
|
724
711
|
}
|
|
725
|
-
)
|
|
712
|
+
));
|
|
726
713
|
};
|
|
727
714
|
|
|
728
715
|
// src/Components/DateRangePickerElement.tsx
|
|
@@ -770,24 +757,25 @@ import React25, { useState as useState7 } from "react";
|
|
|
770
757
|
import { Select as Select4 } from "antd";
|
|
771
758
|
var DropDownGroup = (props) => {
|
|
772
759
|
const [selectedValue, setSelectedValue] = useState7({ firstValue: {}, secondValue: {} });
|
|
760
|
+
console.log(selectedValue);
|
|
773
761
|
const handleFirstChange = (value) => {
|
|
774
|
-
const filterOption2 = props.
|
|
762
|
+
const filterOption2 = props.firstOptions?.find((eachOption) => eachOption.value === value);
|
|
775
763
|
setSelectedValue((prev) => {
|
|
776
764
|
const newValue = { ...prev, firstValue: filterOption2 };
|
|
777
765
|
if (newValue.firstValue) {
|
|
778
766
|
props.onChange?.(newValue);
|
|
779
767
|
}
|
|
780
|
-
return
|
|
768
|
+
return newValue;
|
|
781
769
|
});
|
|
782
770
|
};
|
|
783
771
|
const handleSecondChange = (value) => {
|
|
784
|
-
const filterOption2 = props.
|
|
772
|
+
const filterOption2 = props.secondOptions?.find((eachOption) => eachOption.value === value);
|
|
785
773
|
setSelectedValue((prev) => {
|
|
786
774
|
const newValue = { ...prev, secondValue: filterOption2 };
|
|
787
775
|
if (newValue.secondValue) {
|
|
788
776
|
props.onChange?.(newValue);
|
|
789
777
|
}
|
|
790
|
-
return
|
|
778
|
+
return newValue;
|
|
791
779
|
});
|
|
792
780
|
};
|
|
793
781
|
return /* @__PURE__ */ React25.createElement("div", { className: props.className, style: { display: "flex", flexDirection: "row", backgroundColor: "white", borderRadius: 10, border: "1px solid gray" } }, /* @__PURE__ */ React25.createElement(
|
|
@@ -795,14 +783,14 @@ var DropDownGroup = (props) => {
|
|
|
795
783
|
{
|
|
796
784
|
onChange: handleFirstChange,
|
|
797
785
|
variant: props.variant,
|
|
798
|
-
options: props.
|
|
786
|
+
options: props.firstOptions
|
|
799
787
|
}
|
|
800
788
|
), /* @__PURE__ */ React25.createElement("div", { style: { borderLeft: "1px solid gray", height: "33px" } }), /* @__PURE__ */ React25.createElement(
|
|
801
789
|
Select4,
|
|
802
790
|
{
|
|
803
791
|
onChange: handleSecondChange,
|
|
804
792
|
variant: props.variant,
|
|
805
|
-
options: props.
|
|
793
|
+
options: props.secondOptions
|
|
806
794
|
}
|
|
807
795
|
));
|
|
808
796
|
};
|
|
@@ -815,7 +803,7 @@ var FileUpload = (props) => {
|
|
|
815
803
|
const { Dragger } = Upload;
|
|
816
804
|
const [files, setFiles] = useState8([]);
|
|
817
805
|
const beforeUpload = (file) => {
|
|
818
|
-
const isCorrectFile = ["image
|
|
806
|
+
const isCorrectFile = ["image/*", "video/*", "application/*"].includes(file.type);
|
|
819
807
|
if (!isCorrectFile) {
|
|
820
808
|
message.error(`(${file.name}) is an invalid file. Please upload files with the following extensions only (.png/.jpg/.jpeg/.pdf)`);
|
|
821
809
|
return Upload.LIST_IGNORE;
|
|
@@ -866,6 +854,14 @@ var TabsElement = (props) => {
|
|
|
866
854
|
};
|
|
867
855
|
return /* @__PURE__ */ React27.createElement(Tabs, { className: props.containerClassName, items: props.options, onChange: handleChange });
|
|
868
856
|
};
|
|
857
|
+
|
|
858
|
+
// src/Components/SwitchElement.tsx
|
|
859
|
+
import React28 from "react";
|
|
860
|
+
import { Switch } from "antd";
|
|
861
|
+
var onChange = (checked) => {
|
|
862
|
+
console.log(`switch to ${checked}`);
|
|
863
|
+
};
|
|
864
|
+
var SwitchElement = () => /* @__PURE__ */ React28.createElement(Switch, { defaultChecked: true, onChange });
|
|
869
865
|
export {
|
|
870
866
|
AddMoreTable,
|
|
871
867
|
ButtonElement,
|
|
@@ -885,6 +881,7 @@ export {
|
|
|
885
881
|
Sidebar,
|
|
886
882
|
SingleCheckbox,
|
|
887
883
|
SingleSelectElement,
|
|
884
|
+
SwitchElement,
|
|
888
885
|
TableElement,
|
|
889
886
|
TabsElement,
|
|
890
887
|
TextElement,
|