@apexcura/ui-components 0.0.14-Beta2 → 0.0.14-Beta20
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 +44 -47
- package/dist/index.mjs +41 -45
- 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,14 @@ 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(
|
|
742
|
-
console.log("datestring", dateString);
|
|
747
|
+
console.log(dateString);
|
|
743
748
|
if (date2) {
|
|
744
|
-
const formattedDate =
|
|
745
|
-
console.log("formattedDate-----------------", formattedDate);
|
|
749
|
+
const formattedDate = date2.format(dateFormat);
|
|
746
750
|
setDate(date2);
|
|
747
|
-
console.log("changedDate------------", date2);
|
|
748
751
|
if (props.onChange) {
|
|
749
752
|
props.onChange(formattedDate);
|
|
750
753
|
}
|
|
@@ -755,31 +758,15 @@ var DatePickerElement = (props) => {
|
|
|
755
758
|
}
|
|
756
759
|
}
|
|
757
760
|
};
|
|
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(
|
|
761
|
+
return /* @__PURE__ */ import_react21.default.createElement("div", null, /* @__PURE__ */ import_react21.default.createElement(
|
|
775
762
|
import_antd15.DatePicker,
|
|
776
763
|
{
|
|
777
764
|
placeholder: props.placeholder,
|
|
778
|
-
value: date,
|
|
765
|
+
value: date?.format(dateFormat),
|
|
779
766
|
variant: "borderless",
|
|
780
767
|
onChange: handleChange
|
|
781
768
|
}
|
|
782
|
-
)
|
|
769
|
+
));
|
|
783
770
|
};
|
|
784
771
|
|
|
785
772
|
// src/Components/DateRangePickerElement.tsx
|
|
@@ -828,7 +815,7 @@ var import_antd18 = require("antd");
|
|
|
828
815
|
var DropDownGroup = (props) => {
|
|
829
816
|
const [selectedValue, setSelectedValue] = (0, import_react25.useState)({ firstValue: {}, secondValue: {} });
|
|
830
817
|
const handleFirstChange = (value) => {
|
|
831
|
-
const filterOption2 = props.
|
|
818
|
+
const filterOption2 = props.firstOptions?.find((eachOption) => eachOption.value === value);
|
|
832
819
|
setSelectedValue((prev) => {
|
|
833
820
|
const newValue = { ...prev, firstValue: filterOption2 };
|
|
834
821
|
if (newValue.firstValue) {
|
|
@@ -838,7 +825,7 @@ var DropDownGroup = (props) => {
|
|
|
838
825
|
});
|
|
839
826
|
};
|
|
840
827
|
const handleSecondChange = (value) => {
|
|
841
|
-
const filterOption2 = props.
|
|
828
|
+
const filterOption2 = props.secondOptions?.find((eachOption) => eachOption.value === value);
|
|
842
829
|
setSelectedValue((prev) => {
|
|
843
830
|
const newValue = { ...prev, secondValue: filterOption2 };
|
|
844
831
|
if (newValue.secondValue) {
|
|
@@ -847,19 +834,20 @@ var DropDownGroup = (props) => {
|
|
|
847
834
|
return selectedValue;
|
|
848
835
|
});
|
|
849
836
|
};
|
|
837
|
+
console.log("selectedValue", selectedValue);
|
|
850
838
|
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(
|
|
851
839
|
import_antd18.Select,
|
|
852
840
|
{
|
|
853
841
|
onChange: handleFirstChange,
|
|
854
842
|
variant: props.variant,
|
|
855
|
-
options: props.
|
|
843
|
+
options: props.firstOptions
|
|
856
844
|
}
|
|
857
845
|
), /* @__PURE__ */ import_react25.default.createElement("div", { style: { borderLeft: "1px solid gray", height: "33px" } }), /* @__PURE__ */ import_react25.default.createElement(
|
|
858
846
|
import_antd18.Select,
|
|
859
847
|
{
|
|
860
848
|
onChange: handleSecondChange,
|
|
861
849
|
variant: props.variant,
|
|
862
|
-
options: props.
|
|
850
|
+
options: props.secondOptions
|
|
863
851
|
}
|
|
864
852
|
));
|
|
865
853
|
};
|
|
@@ -867,12 +855,12 @@ var DropDownGroup = (props) => {
|
|
|
867
855
|
// src/Components/FilesUpload.tsx
|
|
868
856
|
var import_react26 = __toESM(require("react"));
|
|
869
857
|
var import_antd19 = require("antd");
|
|
870
|
-
var
|
|
858
|
+
var import_icons4 = require("@ant-design/icons");
|
|
871
859
|
var FileUpload = (props) => {
|
|
872
860
|
const { Dragger } = import_antd19.Upload;
|
|
873
861
|
const [files, setFiles] = (0, import_react26.useState)([]);
|
|
874
862
|
const beforeUpload = (file) => {
|
|
875
|
-
const isCorrectFile = ["image
|
|
863
|
+
const isCorrectFile = ["image/*", "video/*", "application/*"].includes(file.type);
|
|
876
864
|
if (!isCorrectFile) {
|
|
877
865
|
import_antd19.message.error(`(${file.name}) is an invalid file. Please upload files with the following extensions only (.png/.jpg/.jpeg/.pdf)`);
|
|
878
866
|
return import_antd19.Upload.LIST_IGNORE;
|
|
@@ -907,7 +895,7 @@ var FileUpload = (props) => {
|
|
|
907
895
|
showUploadList: true,
|
|
908
896
|
customRequest
|
|
909
897
|
},
|
|
910
|
-
/* @__PURE__ */ import_react26.default.createElement("p", null, /* @__PURE__ */ import_react26.default.createElement(
|
|
898
|
+
/* @__PURE__ */ import_react26.default.createElement("p", null, /* @__PURE__ */ import_react26.default.createElement(import_icons4.InboxOutlined, null)),
|
|
911
899
|
/* @__PURE__ */ import_react26.default.createElement("p", null, "Click or drag file to upload")
|
|
912
900
|
));
|
|
913
901
|
};
|
|
@@ -923,6 +911,14 @@ var TabsElement = (props) => {
|
|
|
923
911
|
};
|
|
924
912
|
return /* @__PURE__ */ import_react27.default.createElement(import_antd20.Tabs, { className: props.containerClassName, items: props.options, onChange: handleChange });
|
|
925
913
|
};
|
|
914
|
+
|
|
915
|
+
// src/Components/SwitchElement.tsx
|
|
916
|
+
var import_react28 = __toESM(require("react"));
|
|
917
|
+
var import_antd21 = require("antd");
|
|
918
|
+
var onChange = (checked) => {
|
|
919
|
+
console.log(`switch to ${checked}`);
|
|
920
|
+
};
|
|
921
|
+
var SwitchElement = () => /* @__PURE__ */ import_react28.default.createElement(import_antd21.Switch, { defaultChecked: true, onChange });
|
|
926
922
|
// Annotate the CommonJS export names for ESM import in node:
|
|
927
923
|
0 && (module.exports = {
|
|
928
924
|
AddMoreTable,
|
|
@@ -943,6 +939,7 @@ var TabsElement = (props) => {
|
|
|
943
939
|
Sidebar,
|
|
944
940
|
SingleCheckbox,
|
|
945
941
|
SingleSelectElement,
|
|
942
|
+
SwitchElement,
|
|
946
943
|
TableElement,
|
|
947
944
|
TabsElement,
|
|
948
945
|
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,14 @@ 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(
|
|
685
|
-
console.log("datestring", dateString);
|
|
689
|
+
console.log(dateString);
|
|
686
690
|
if (date2) {
|
|
687
|
-
const formattedDate =
|
|
688
|
-
console.log("formattedDate-----------------", formattedDate);
|
|
691
|
+
const formattedDate = date2.format(dateFormat);
|
|
689
692
|
setDate(date2);
|
|
690
|
-
console.log("changedDate------------", date2);
|
|
691
693
|
if (props.onChange) {
|
|
692
694
|
props.onChange(formattedDate);
|
|
693
695
|
}
|
|
@@ -698,31 +700,15 @@ var DatePickerElement = (props) => {
|
|
|
698
700
|
}
|
|
699
701
|
}
|
|
700
702
|
};
|
|
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(
|
|
703
|
+
return /* @__PURE__ */ React21.createElement("div", null, /* @__PURE__ */ React21.createElement(
|
|
718
704
|
DatePicker,
|
|
719
705
|
{
|
|
720
706
|
placeholder: props.placeholder,
|
|
721
|
-
value: date,
|
|
707
|
+
value: date?.format(dateFormat),
|
|
722
708
|
variant: "borderless",
|
|
723
709
|
onChange: handleChange
|
|
724
710
|
}
|
|
725
|
-
)
|
|
711
|
+
));
|
|
726
712
|
};
|
|
727
713
|
|
|
728
714
|
// src/Components/DateRangePickerElement.tsx
|
|
@@ -771,7 +757,7 @@ import { Select as Select4 } from "antd";
|
|
|
771
757
|
var DropDownGroup = (props) => {
|
|
772
758
|
const [selectedValue, setSelectedValue] = useState7({ firstValue: {}, secondValue: {} });
|
|
773
759
|
const handleFirstChange = (value) => {
|
|
774
|
-
const filterOption2 = props.
|
|
760
|
+
const filterOption2 = props.firstOptions?.find((eachOption) => eachOption.value === value);
|
|
775
761
|
setSelectedValue((prev) => {
|
|
776
762
|
const newValue = { ...prev, firstValue: filterOption2 };
|
|
777
763
|
if (newValue.firstValue) {
|
|
@@ -781,7 +767,7 @@ var DropDownGroup = (props) => {
|
|
|
781
767
|
});
|
|
782
768
|
};
|
|
783
769
|
const handleSecondChange = (value) => {
|
|
784
|
-
const filterOption2 = props.
|
|
770
|
+
const filterOption2 = props.secondOptions?.find((eachOption) => eachOption.value === value);
|
|
785
771
|
setSelectedValue((prev) => {
|
|
786
772
|
const newValue = { ...prev, secondValue: filterOption2 };
|
|
787
773
|
if (newValue.secondValue) {
|
|
@@ -790,19 +776,20 @@ var DropDownGroup = (props) => {
|
|
|
790
776
|
return selectedValue;
|
|
791
777
|
});
|
|
792
778
|
};
|
|
779
|
+
console.log("selectedValue", selectedValue);
|
|
793
780
|
return /* @__PURE__ */ React25.createElement("div", { className: props.className, style: { display: "flex", flexDirection: "row", backgroundColor: "white", borderRadius: 10, border: "1px solid gray" } }, /* @__PURE__ */ React25.createElement(
|
|
794
781
|
Select4,
|
|
795
782
|
{
|
|
796
783
|
onChange: handleFirstChange,
|
|
797
784
|
variant: props.variant,
|
|
798
|
-
options: props.
|
|
785
|
+
options: props.firstOptions
|
|
799
786
|
}
|
|
800
787
|
), /* @__PURE__ */ React25.createElement("div", { style: { borderLeft: "1px solid gray", height: "33px" } }), /* @__PURE__ */ React25.createElement(
|
|
801
788
|
Select4,
|
|
802
789
|
{
|
|
803
790
|
onChange: handleSecondChange,
|
|
804
791
|
variant: props.variant,
|
|
805
|
-
options: props.
|
|
792
|
+
options: props.secondOptions
|
|
806
793
|
}
|
|
807
794
|
));
|
|
808
795
|
};
|
|
@@ -815,7 +802,7 @@ var FileUpload = (props) => {
|
|
|
815
802
|
const { Dragger } = Upload;
|
|
816
803
|
const [files, setFiles] = useState8([]);
|
|
817
804
|
const beforeUpload = (file) => {
|
|
818
|
-
const isCorrectFile = ["image
|
|
805
|
+
const isCorrectFile = ["image/*", "video/*", "application/*"].includes(file.type);
|
|
819
806
|
if (!isCorrectFile) {
|
|
820
807
|
message.error(`(${file.name}) is an invalid file. Please upload files with the following extensions only (.png/.jpg/.jpeg/.pdf)`);
|
|
821
808
|
return Upload.LIST_IGNORE;
|
|
@@ -866,6 +853,14 @@ var TabsElement = (props) => {
|
|
|
866
853
|
};
|
|
867
854
|
return /* @__PURE__ */ React27.createElement(Tabs, { className: props.containerClassName, items: props.options, onChange: handleChange });
|
|
868
855
|
};
|
|
856
|
+
|
|
857
|
+
// src/Components/SwitchElement.tsx
|
|
858
|
+
import React28 from "react";
|
|
859
|
+
import { Switch } from "antd";
|
|
860
|
+
var onChange = (checked) => {
|
|
861
|
+
console.log(`switch to ${checked}`);
|
|
862
|
+
};
|
|
863
|
+
var SwitchElement = () => /* @__PURE__ */ React28.createElement(Switch, { defaultChecked: true, onChange });
|
|
869
864
|
export {
|
|
870
865
|
AddMoreTable,
|
|
871
866
|
ButtonElement,
|
|
@@ -885,6 +880,7 @@ export {
|
|
|
885
880
|
Sidebar,
|
|
886
881
|
SingleCheckbox,
|
|
887
882
|
SingleSelectElement,
|
|
883
|
+
SwitchElement,
|
|
888
884
|
TableElement,
|
|
889
885
|
TabsElement,
|
|
890
886
|
TextElement,
|