@apexcura/ui-components 0.0.14-Beta24 → 0.0.14-Beta26
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.js +21 -25
- package/dist/index.mjs +22 -26
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -741,19 +741,17 @@ var TableElement = (props) => {
|
|
|
741
741
|
var import_react21 = __toESM(require("react"));
|
|
742
742
|
var import_antd15 = require("antd");
|
|
743
743
|
var DatePickerElement = (props) => {
|
|
744
|
-
const [
|
|
744
|
+
const [dateState, setDateState] = (0, import_react21.useState)("");
|
|
745
745
|
const dateFormat = "DD/MM/YYYY";
|
|
746
|
-
const handleChange = (
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
const formattedDate = date2.format(dateFormat);
|
|
751
|
-
setDate(date2);
|
|
746
|
+
const handleChange = (date, dateString) => {
|
|
747
|
+
if (date) {
|
|
748
|
+
const formattedDate = date.format(dateFormat);
|
|
749
|
+
setDateState(formattedDate);
|
|
752
750
|
if (props.onChange) {
|
|
753
751
|
props.onChange(formattedDate);
|
|
754
752
|
}
|
|
755
753
|
} else {
|
|
756
|
-
|
|
754
|
+
setDateState("");
|
|
757
755
|
if (props.onChange) {
|
|
758
756
|
props.onChange("");
|
|
759
757
|
}
|
|
@@ -763,7 +761,7 @@ var DatePickerElement = (props) => {
|
|
|
763
761
|
import_antd15.DatePicker,
|
|
764
762
|
{
|
|
765
763
|
placeholder: props.placeholder,
|
|
766
|
-
value:
|
|
764
|
+
value: dateState,
|
|
767
765
|
variant: "borderless",
|
|
768
766
|
onChange: handleChange
|
|
769
767
|
}
|
|
@@ -814,26 +812,34 @@ var SingleCheckbox = (props) => {
|
|
|
814
812
|
var import_react25 = __toESM(require("react"));
|
|
815
813
|
var import_antd18 = require("antd");
|
|
816
814
|
var DropDownGroup = (props) => {
|
|
817
|
-
const [selectedValue, setSelectedValue] = (0, import_react25.useState)({
|
|
818
|
-
|
|
815
|
+
const [selectedValue, setSelectedValue] = (0, import_react25.useState)({
|
|
816
|
+
firstValue: {},
|
|
817
|
+
secondValue: {}
|
|
818
|
+
});
|
|
819
819
|
const handleFirstChange = (value) => {
|
|
820
|
-
const filterOption2 = props.firstOptions?.find(
|
|
820
|
+
const filterOption2 = props.firstOptions?.find(
|
|
821
|
+
(eachOption) => eachOption.value === value
|
|
822
|
+
);
|
|
821
823
|
setSelectedValue((prev) => {
|
|
822
824
|
const newValue = { ...prev, firstValue: filterOption2 };
|
|
823
825
|
if (newValue.firstValue) {
|
|
824
826
|
props.onChange?.(newValue);
|
|
825
827
|
}
|
|
826
|
-
|
|
828
|
+
console.log("selectedValue1=====", selectedValue);
|
|
829
|
+
return selectedValue;
|
|
827
830
|
});
|
|
828
831
|
};
|
|
829
832
|
const handleSecondChange = (value) => {
|
|
830
|
-
const filterOption2 = props.secondOptions?.find(
|
|
833
|
+
const filterOption2 = props.secondOptions?.find(
|
|
834
|
+
(eachOption) => eachOption.value === value
|
|
835
|
+
);
|
|
831
836
|
setSelectedValue((prev) => {
|
|
832
837
|
const newValue = { ...prev, secondValue: filterOption2 };
|
|
833
838
|
if (newValue.secondValue) {
|
|
834
839
|
props.onChange?.(newValue);
|
|
835
840
|
}
|
|
836
|
-
|
|
841
|
+
console.log("selectedValue2=====", selectedValue);
|
|
842
|
+
return selectedValue;
|
|
837
843
|
});
|
|
838
844
|
};
|
|
839
845
|
return /* @__PURE__ */ import_react25.default.createElement("div", { className: props.containerClassName }, props.label && /* @__PURE__ */ import_react25.default.createElement("label", { htmlFor: props.name, className: props.labelClassName }, props.label), /* @__PURE__ */ import_react25.default.createElement("div", { className: props.subContainerClassName }, /* @__PURE__ */ import_react25.default.createElement(
|
|
@@ -862,16 +868,7 @@ var import_icons4 = require("@ant-design/icons");
|
|
|
862
868
|
var FileUpload = (props) => {
|
|
863
869
|
const { Dragger } = import_antd19.Upload;
|
|
864
870
|
const [files, setFiles] = (0, import_react26.useState)([]);
|
|
865
|
-
const beforeUpload = (file) => {
|
|
866
|
-
const isCorrectFile = ["image/*", "video/*", "application/*"].includes(file.type);
|
|
867
|
-
if (!isCorrectFile) {
|
|
868
|
-
import_antd19.message.error(`(${file.name}) is an invalid file. Please upload files with the following extensions only (.png/.jpg/.jpeg/.pdf)`);
|
|
869
|
-
return import_antd19.Upload.LIST_IGNORE;
|
|
870
|
-
}
|
|
871
|
-
return true;
|
|
872
|
-
};
|
|
873
871
|
const handleChange = ({ fileList }) => {
|
|
874
|
-
console.log(fileList);
|
|
875
872
|
setFiles(fileList);
|
|
876
873
|
if (props.onChange) {
|
|
877
874
|
props.onChange({
|
|
@@ -894,7 +891,6 @@ var FileUpload = (props) => {
|
|
|
894
891
|
maxCount: props.max_count,
|
|
895
892
|
multiple: props.multiple,
|
|
896
893
|
fileList: files,
|
|
897
|
-
beforeUpload,
|
|
898
894
|
onChange: handleChange,
|
|
899
895
|
showUploadList: true,
|
|
900
896
|
customRequest
|
package/dist/index.mjs
CHANGED
|
@@ -683,19 +683,17 @@ var TableElement = (props) => {
|
|
|
683
683
|
import React21, { useState as useState6 } from "react";
|
|
684
684
|
import { DatePicker } from "antd";
|
|
685
685
|
var DatePickerElement = (props) => {
|
|
686
|
-
const [
|
|
686
|
+
const [dateState, setDateState] = useState6("");
|
|
687
687
|
const dateFormat = "DD/MM/YYYY";
|
|
688
|
-
const handleChange = (
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
const formattedDate = date2.format(dateFormat);
|
|
693
|
-
setDate(date2);
|
|
688
|
+
const handleChange = (date, dateString) => {
|
|
689
|
+
if (date) {
|
|
690
|
+
const formattedDate = date.format(dateFormat);
|
|
691
|
+
setDateState(formattedDate);
|
|
694
692
|
if (props.onChange) {
|
|
695
693
|
props.onChange(formattedDate);
|
|
696
694
|
}
|
|
697
695
|
} else {
|
|
698
|
-
|
|
696
|
+
setDateState("");
|
|
699
697
|
if (props.onChange) {
|
|
700
698
|
props.onChange("");
|
|
701
699
|
}
|
|
@@ -705,7 +703,7 @@ var DatePickerElement = (props) => {
|
|
|
705
703
|
DatePicker,
|
|
706
704
|
{
|
|
707
705
|
placeholder: props.placeholder,
|
|
708
|
-
value:
|
|
706
|
+
value: dateState,
|
|
709
707
|
variant: "borderless",
|
|
710
708
|
onChange: handleChange
|
|
711
709
|
}
|
|
@@ -756,26 +754,34 @@ var SingleCheckbox = (props) => {
|
|
|
756
754
|
import React25, { useState as useState7 } from "react";
|
|
757
755
|
import { Select as Select4 } from "antd";
|
|
758
756
|
var DropDownGroup = (props) => {
|
|
759
|
-
const [selectedValue, setSelectedValue] = useState7({
|
|
760
|
-
|
|
757
|
+
const [selectedValue, setSelectedValue] = useState7({
|
|
758
|
+
firstValue: {},
|
|
759
|
+
secondValue: {}
|
|
760
|
+
});
|
|
761
761
|
const handleFirstChange = (value) => {
|
|
762
|
-
const filterOption2 = props.firstOptions?.find(
|
|
762
|
+
const filterOption2 = props.firstOptions?.find(
|
|
763
|
+
(eachOption) => eachOption.value === value
|
|
764
|
+
);
|
|
763
765
|
setSelectedValue((prev) => {
|
|
764
766
|
const newValue = { ...prev, firstValue: filterOption2 };
|
|
765
767
|
if (newValue.firstValue) {
|
|
766
768
|
props.onChange?.(newValue);
|
|
767
769
|
}
|
|
768
|
-
|
|
770
|
+
console.log("selectedValue1=====", selectedValue);
|
|
771
|
+
return selectedValue;
|
|
769
772
|
});
|
|
770
773
|
};
|
|
771
774
|
const handleSecondChange = (value) => {
|
|
772
|
-
const filterOption2 = props.secondOptions?.find(
|
|
775
|
+
const filterOption2 = props.secondOptions?.find(
|
|
776
|
+
(eachOption) => eachOption.value === value
|
|
777
|
+
);
|
|
773
778
|
setSelectedValue((prev) => {
|
|
774
779
|
const newValue = { ...prev, secondValue: filterOption2 };
|
|
775
780
|
if (newValue.secondValue) {
|
|
776
781
|
props.onChange?.(newValue);
|
|
777
782
|
}
|
|
778
|
-
|
|
783
|
+
console.log("selectedValue2=====", selectedValue);
|
|
784
|
+
return selectedValue;
|
|
779
785
|
});
|
|
780
786
|
};
|
|
781
787
|
return /* @__PURE__ */ React25.createElement("div", { className: props.containerClassName }, props.label && /* @__PURE__ */ React25.createElement("label", { htmlFor: props.name, className: props.labelClassName }, props.label), /* @__PURE__ */ React25.createElement("div", { className: props.subContainerClassName }, /* @__PURE__ */ React25.createElement(
|
|
@@ -799,21 +805,12 @@ var DropDownGroup = (props) => {
|
|
|
799
805
|
|
|
800
806
|
// src/Components/FilesUpload.tsx
|
|
801
807
|
import React26, { useState as useState8 } from "react";
|
|
802
|
-
import { Upload
|
|
808
|
+
import { Upload } from "antd";
|
|
803
809
|
import { InboxOutlined } from "@ant-design/icons";
|
|
804
810
|
var FileUpload = (props) => {
|
|
805
811
|
const { Dragger } = Upload;
|
|
806
812
|
const [files, setFiles] = useState8([]);
|
|
807
|
-
const beforeUpload = (file) => {
|
|
808
|
-
const isCorrectFile = ["image/*", "video/*", "application/*"].includes(file.type);
|
|
809
|
-
if (!isCorrectFile) {
|
|
810
|
-
message.error(`(${file.name}) is an invalid file. Please upload files with the following extensions only (.png/.jpg/.jpeg/.pdf)`);
|
|
811
|
-
return Upload.LIST_IGNORE;
|
|
812
|
-
}
|
|
813
|
-
return true;
|
|
814
|
-
};
|
|
815
813
|
const handleChange = ({ fileList }) => {
|
|
816
|
-
console.log(fileList);
|
|
817
814
|
setFiles(fileList);
|
|
818
815
|
if (props.onChange) {
|
|
819
816
|
props.onChange({
|
|
@@ -836,7 +833,6 @@ var FileUpload = (props) => {
|
|
|
836
833
|
maxCount: props.max_count,
|
|
837
834
|
multiple: props.multiple,
|
|
838
835
|
fileList: files,
|
|
839
|
-
beforeUpload,
|
|
840
836
|
onChange: handleChange,
|
|
841
837
|
showUploadList: true,
|
|
842
838
|
customRequest
|