@apexcura/ui-components 0.0.14-Beta23 → 0.0.14-Beta25
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 +10 -18
- package/dist/index.mjs +11 -19
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -741,19 +741,19 @@ 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
|
-
console.log("date==========",
|
|
748
|
-
if (
|
|
749
|
-
console.log("date==",
|
|
750
|
-
const formattedDate =
|
|
751
|
-
|
|
746
|
+
const handleChange = (date, dateString) => {
|
|
747
|
+
console.log("date==========", date);
|
|
748
|
+
if (date) {
|
|
749
|
+
console.log("date==", date);
|
|
750
|
+
const formattedDate = date.format(dateFormat);
|
|
751
|
+
setDateState(date);
|
|
752
752
|
if (props.onChange) {
|
|
753
753
|
props.onChange(formattedDate);
|
|
754
754
|
}
|
|
755
755
|
} else {
|
|
756
|
-
|
|
756
|
+
setDateState("");
|
|
757
757
|
if (props.onChange) {
|
|
758
758
|
props.onChange("");
|
|
759
759
|
}
|
|
@@ -763,7 +763,7 @@ var DatePickerElement = (props) => {
|
|
|
763
763
|
import_antd15.DatePicker,
|
|
764
764
|
{
|
|
765
765
|
placeholder: props.placeholder,
|
|
766
|
-
value:
|
|
766
|
+
value: dateState,
|
|
767
767
|
variant: "borderless",
|
|
768
768
|
onChange: handleChange
|
|
769
769
|
}
|
|
@@ -862,15 +862,8 @@ var import_icons4 = require("@ant-design/icons");
|
|
|
862
862
|
var FileUpload = (props) => {
|
|
863
863
|
const { Dragger } = import_antd19.Upload;
|
|
864
864
|
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
865
|
const handleChange = ({ fileList }) => {
|
|
866
|
+
console.log(fileList);
|
|
874
867
|
setFiles(fileList);
|
|
875
868
|
if (props.onChange) {
|
|
876
869
|
props.onChange({
|
|
@@ -893,7 +886,6 @@ var FileUpload = (props) => {
|
|
|
893
886
|
maxCount: props.max_count,
|
|
894
887
|
multiple: props.multiple,
|
|
895
888
|
fileList: files,
|
|
896
|
-
beforeUpload,
|
|
897
889
|
onChange: handleChange,
|
|
898
890
|
showUploadList: true,
|
|
899
891
|
customRequest
|
package/dist/index.mjs
CHANGED
|
@@ -683,19 +683,19 @@ 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
|
-
console.log("date==========",
|
|
690
|
-
if (
|
|
691
|
-
console.log("date==",
|
|
692
|
-
const formattedDate =
|
|
693
|
-
|
|
688
|
+
const handleChange = (date, dateString) => {
|
|
689
|
+
console.log("date==========", date);
|
|
690
|
+
if (date) {
|
|
691
|
+
console.log("date==", date);
|
|
692
|
+
const formattedDate = date.format(dateFormat);
|
|
693
|
+
setDateState(date);
|
|
694
694
|
if (props.onChange) {
|
|
695
695
|
props.onChange(formattedDate);
|
|
696
696
|
}
|
|
697
697
|
} else {
|
|
698
|
-
|
|
698
|
+
setDateState("");
|
|
699
699
|
if (props.onChange) {
|
|
700
700
|
props.onChange("");
|
|
701
701
|
}
|
|
@@ -705,7 +705,7 @@ var DatePickerElement = (props) => {
|
|
|
705
705
|
DatePicker,
|
|
706
706
|
{
|
|
707
707
|
placeholder: props.placeholder,
|
|
708
|
-
value:
|
|
708
|
+
value: dateState,
|
|
709
709
|
variant: "borderless",
|
|
710
710
|
onChange: handleChange
|
|
711
711
|
}
|
|
@@ -799,20 +799,13 @@ var DropDownGroup = (props) => {
|
|
|
799
799
|
|
|
800
800
|
// src/Components/FilesUpload.tsx
|
|
801
801
|
import React26, { useState as useState8 } from "react";
|
|
802
|
-
import { Upload
|
|
802
|
+
import { Upload } from "antd";
|
|
803
803
|
import { InboxOutlined } from "@ant-design/icons";
|
|
804
804
|
var FileUpload = (props) => {
|
|
805
805
|
const { Dragger } = Upload;
|
|
806
806
|
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
807
|
const handleChange = ({ fileList }) => {
|
|
808
|
+
console.log(fileList);
|
|
816
809
|
setFiles(fileList);
|
|
817
810
|
if (props.onChange) {
|
|
818
811
|
props.onChange({
|
|
@@ -835,7 +828,6 @@ var FileUpload = (props) => {
|
|
|
835
828
|
maxCount: props.max_count,
|
|
836
829
|
multiple: props.multiple,
|
|
837
830
|
fileList: files,
|
|
838
|
-
beforeUpload,
|
|
839
831
|
onChange: handleChange,
|
|
840
832
|
showUploadList: true,
|
|
841
833
|
customRequest
|