@apexcura/ui-components 0.0.13-Beta40 → 0.0.13-Beta42

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 CHANGED
@@ -96,19 +96,25 @@ declare const DatePickerElement: (props: ElementType) => React$1.JSX.Element;
96
96
 
97
97
  declare const DateRangePickerElement: (props: ElementType) => React$1.JSX.Element;
98
98
 
99
- declare const UploadElement: (feildData: {
100
- value?: any;
101
- name?: any;
102
- label?: any;
103
- max_count?: any;
104
- accept?: any;
105
- list_type?: any;
106
- multiple?: any;
107
- errors?: any;
108
- }, onInputChanges: (arg0: {
109
- name: any;
110
- value: any[] | UploadFile<any>[];
111
- }) => void) => React$1.JSX.Element;
99
+ interface NativeCameraUploadLayerProps {
100
+ feildData: {
101
+ name: string;
102
+ label: string;
103
+ value: UploadFile[];
104
+ max_count?: number;
105
+ accept?: string;
106
+ list_type?: "text" | "picture" | "picture-card";
107
+ multiple?: boolean;
108
+ errors?: {
109
+ message: string;
110
+ }[];
111
+ };
112
+ onInputChanges: (input: {
113
+ name: string;
114
+ value: UploadFile[];
115
+ }) => void;
116
+ }
117
+ declare const UploadElement: (props: NativeCameraUploadLayerProps) => React$1.JSX.Element;
112
118
 
113
119
  declare const Image: (props: ElementType) => React$1.JSX.Element;
114
120
 
package/dist/index.d.ts CHANGED
@@ -96,19 +96,25 @@ declare const DatePickerElement: (props: ElementType) => React$1.JSX.Element;
96
96
 
97
97
  declare const DateRangePickerElement: (props: ElementType) => React$1.JSX.Element;
98
98
 
99
- declare const UploadElement: (feildData: {
100
- value?: any;
101
- name?: any;
102
- label?: any;
103
- max_count?: any;
104
- accept?: any;
105
- list_type?: any;
106
- multiple?: any;
107
- errors?: any;
108
- }, onInputChanges: (arg0: {
109
- name: any;
110
- value: any[] | UploadFile<any>[];
111
- }) => void) => React$1.JSX.Element;
99
+ interface NativeCameraUploadLayerProps {
100
+ feildData: {
101
+ name: string;
102
+ label: string;
103
+ value: UploadFile[];
104
+ max_count?: number;
105
+ accept?: string;
106
+ list_type?: "text" | "picture" | "picture-card";
107
+ multiple?: boolean;
108
+ errors?: {
109
+ message: string;
110
+ }[];
111
+ };
112
+ onInputChanges: (input: {
113
+ name: string;
114
+ value: UploadFile[];
115
+ }) => void;
116
+ }
117
+ declare const UploadElement: (props: NativeCameraUploadLayerProps) => React$1.JSX.Element;
112
118
 
113
119
  declare const Image: (props: ElementType) => React$1.JSX.Element;
114
120
 
package/dist/index.js CHANGED
@@ -832,7 +832,7 @@ var DateRangePickerElement = (props) => {
832
832
  var import_react24 = __toESM(require("react"));
833
833
  var import_antd17 = require("antd");
834
834
  var import_icons5 = require("@ant-design/icons");
835
- var UploadElement = (feildData, onInputChanges) => {
835
+ var UploadElement = (props) => {
836
836
  const [previewTitle, setPreviewTitle] = (0, import_react24.useState)(null);
837
837
  const [previewOpen, setPreviewOpen] = (0, import_react24.useState)(false);
838
838
  const [previewType, setPreviewType] = (0, import_react24.useState)(null);
@@ -866,16 +866,16 @@ var UploadElement = (feildData, onInputChanges) => {
866
866
  }
867
867
  };
868
868
  reader.readAsDataURL(selectedFile);
869
- const newFileList = feildData.value ? [...feildData.value, newFile] : [newFile];
870
- onInputChanges({
871
- name: feildData.name,
869
+ const newFileList = props.feildData.value ? [...props.feildData.value, newFile] : [newFile];
870
+ props.onInputChanges({
871
+ name: props.feildData.name,
872
872
  value: newFileList
873
873
  });
874
874
  };
875
875
  const uploadChange2 = ({ file, fileList }) => {
876
876
  const newFileList = fileList.filter((f) => f.name !== file.name);
877
- onInputChanges({
878
- name: feildData.name,
877
+ props.onInputChanges({
878
+ name: props.feildData.name,
879
879
  value: newFileList
880
880
  });
881
881
  };
@@ -893,7 +893,7 @@ var UploadElement = (feildData, onInputChanges) => {
893
893
  setPreviewOpen(false);
894
894
  setPreviewTitle(null);
895
895
  };
896
- return /* @__PURE__ */ import_react24.default.createElement(import_react24.default.Fragment, null, Object.keys(feildData).length !== 0 && /* @__PURE__ */ import_react24.default.createElement("span", { className: "native-camera-lib" }, /* @__PURE__ */ import_react24.default.createElement("p", { className: "flat-label text-capitalize" }, feildData.label), /* @__PURE__ */ import_react24.default.createElement("label", { className: "native-camera-button" }, /* @__PURE__ */ import_react24.default.createElement("div", { className: "ant-btn" }, /* @__PURE__ */ import_react24.default.createElement(import_icons5.UploadOutlined, null), " ", feildData.max_count ? `Upload (Max:${feildData.max_count})` : "Upload"), /* @__PURE__ */ import_react24.default.createElement(
896
+ return /* @__PURE__ */ import_react24.default.createElement(import_react24.default.Fragment, null, Object.keys(props.feildData).length !== 0 && /* @__PURE__ */ import_react24.default.createElement("span", { className: "native-camera-lib" }, /* @__PURE__ */ import_react24.default.createElement("p", { className: "flat-label text-capitalize" }, props.feildData.label), /* @__PURE__ */ import_react24.default.createElement("label", { className: "native-camera-button" }, /* @__PURE__ */ import_react24.default.createElement("div", { className: "ant-btn" }, /* @__PURE__ */ import_react24.default.createElement(import_icons5.UploadOutlined, null), " ", props.feildData.max_count ? `Upload (Max:${props.feildData.max_count})` : "Upload"), /* @__PURE__ */ import_react24.default.createElement(
897
897
  "input",
898
898
  {
899
899
  id: "upload",
@@ -904,18 +904,18 @@ var UploadElement = (feildData, onInputChanges) => {
904
904
  )), /* @__PURE__ */ import_react24.default.createElement(
905
905
  import_antd17.Upload,
906
906
  {
907
- accept: feildData.accept,
908
- listType: feildData.list_type,
909
- maxCount: feildData.max_count,
910
- multiple: feildData.multiple,
911
- fileList: feildData.value,
907
+ accept: props.feildData.accept,
908
+ listType: props.feildData.list_type,
909
+ maxCount: props.feildData.max_count,
910
+ multiple: props.feildData.multiple,
911
+ fileList: props.feildData.value,
912
912
  onChange: uploadChange2,
913
913
  onPreview: handlePreview,
914
914
  showUploadList: true
915
915
  },
916
- feildData.list_type === "picture-card" && /* @__PURE__ */ import_react24.default.createElement("div", null, /* @__PURE__ */ import_react24.default.createElement(import_icons5.PlusOutlined, null), /* @__PURE__ */ import_react24.default.createElement("div", { style: { marginTop: 8 } }, "Upload ", /* @__PURE__ */ import_react24.default.createElement("small", { className: "d-flex" }, "(Max:", feildData.max_count, ")"))),
917
- feildData.list_type === "picture" && /* @__PURE__ */ import_react24.default.createElement(import_antd17.Button, { icon: /* @__PURE__ */ import_react24.default.createElement(import_icons5.UploadOutlined, null) }, feildData.max_count ? `Upload (Max:${feildData.max_count})` : "Upload")
918
- ), feildData.errors && feildData.errors.length > 0 && feildData.errors.map((error, eKey) => /* @__PURE__ */ import_react24.default.createElement("small", { key: eKey, className: "text-danger animated flash" }, error.message)), /* @__PURE__ */ import_react24.default.createElement(
916
+ props.feildData.list_type === "picture-card" && /* @__PURE__ */ import_react24.default.createElement("div", null, /* @__PURE__ */ import_react24.default.createElement(import_icons5.PlusOutlined, null), /* @__PURE__ */ import_react24.default.createElement("div", { style: { marginTop: 8 } }, "Upload ", /* @__PURE__ */ import_react24.default.createElement("small", { className: "d-flex" }, "(Max:", props.feildData.max_count, ")"))),
917
+ props.feildData.list_type === "picture" && /* @__PURE__ */ import_react24.default.createElement(import_antd17.Button, { icon: /* @__PURE__ */ import_react24.default.createElement(import_icons5.UploadOutlined, null) }, props.feildData.max_count ? `Upload (Max:${props.feildData.max_count})` : "Upload")
918
+ ), props.feildData.errors && props.feildData.errors.length > 0 && props.feildData.errors.map((error, eKey) => /* @__PURE__ */ import_react24.default.createElement("small", { key: eKey, className: "text-danger animated flash" }, error.message)), /* @__PURE__ */ import_react24.default.createElement(
919
919
  import_antd17.Modal,
920
920
  {
921
921
  visible: previewOpen,
package/dist/index.mjs CHANGED
@@ -776,7 +776,7 @@ var DateRangePickerElement = (props) => {
776
776
  import React23, { useState as useState7 } from "react";
777
777
  import { Upload, Button as Button3, Modal as Modal2, Tooltip } from "antd";
778
778
  import { UploadOutlined, PlusOutlined as PlusOutlined2, CloseOutlined } from "@ant-design/icons";
779
- var UploadElement = (feildData, onInputChanges) => {
779
+ var UploadElement = (props) => {
780
780
  const [previewTitle, setPreviewTitle] = useState7(null);
781
781
  const [previewOpen, setPreviewOpen] = useState7(false);
782
782
  const [previewType, setPreviewType] = useState7(null);
@@ -810,16 +810,16 @@ var UploadElement = (feildData, onInputChanges) => {
810
810
  }
811
811
  };
812
812
  reader.readAsDataURL(selectedFile);
813
- const newFileList = feildData.value ? [...feildData.value, newFile] : [newFile];
814
- onInputChanges({
815
- name: feildData.name,
813
+ const newFileList = props.feildData.value ? [...props.feildData.value, newFile] : [newFile];
814
+ props.onInputChanges({
815
+ name: props.feildData.name,
816
816
  value: newFileList
817
817
  });
818
818
  };
819
819
  const uploadChange2 = ({ file, fileList }) => {
820
820
  const newFileList = fileList.filter((f) => f.name !== file.name);
821
- onInputChanges({
822
- name: feildData.name,
821
+ props.onInputChanges({
822
+ name: props.feildData.name,
823
823
  value: newFileList
824
824
  });
825
825
  };
@@ -837,7 +837,7 @@ var UploadElement = (feildData, onInputChanges) => {
837
837
  setPreviewOpen(false);
838
838
  setPreviewTitle(null);
839
839
  };
840
- return /* @__PURE__ */ React23.createElement(React23.Fragment, null, Object.keys(feildData).length !== 0 && /* @__PURE__ */ React23.createElement("span", { className: "native-camera-lib" }, /* @__PURE__ */ React23.createElement("p", { className: "flat-label text-capitalize" }, feildData.label), /* @__PURE__ */ React23.createElement("label", { className: "native-camera-button" }, /* @__PURE__ */ React23.createElement("div", { className: "ant-btn" }, /* @__PURE__ */ React23.createElement(UploadOutlined, null), " ", feildData.max_count ? `Upload (Max:${feildData.max_count})` : "Upload"), /* @__PURE__ */ React23.createElement(
840
+ return /* @__PURE__ */ React23.createElement(React23.Fragment, null, Object.keys(props.feildData).length !== 0 && /* @__PURE__ */ React23.createElement("span", { className: "native-camera-lib" }, /* @__PURE__ */ React23.createElement("p", { className: "flat-label text-capitalize" }, props.feildData.label), /* @__PURE__ */ React23.createElement("label", { className: "native-camera-button" }, /* @__PURE__ */ React23.createElement("div", { className: "ant-btn" }, /* @__PURE__ */ React23.createElement(UploadOutlined, null), " ", props.feildData.max_count ? `Upload (Max:${props.feildData.max_count})` : "Upload"), /* @__PURE__ */ React23.createElement(
841
841
  "input",
842
842
  {
843
843
  id: "upload",
@@ -848,18 +848,18 @@ var UploadElement = (feildData, onInputChanges) => {
848
848
  )), /* @__PURE__ */ React23.createElement(
849
849
  Upload,
850
850
  {
851
- accept: feildData.accept,
852
- listType: feildData.list_type,
853
- maxCount: feildData.max_count,
854
- multiple: feildData.multiple,
855
- fileList: feildData.value,
851
+ accept: props.feildData.accept,
852
+ listType: props.feildData.list_type,
853
+ maxCount: props.feildData.max_count,
854
+ multiple: props.feildData.multiple,
855
+ fileList: props.feildData.value,
856
856
  onChange: uploadChange2,
857
857
  onPreview: handlePreview,
858
858
  showUploadList: true
859
859
  },
860
- feildData.list_type === "picture-card" && /* @__PURE__ */ React23.createElement("div", null, /* @__PURE__ */ React23.createElement(PlusOutlined2, null), /* @__PURE__ */ React23.createElement("div", { style: { marginTop: 8 } }, "Upload ", /* @__PURE__ */ React23.createElement("small", { className: "d-flex" }, "(Max:", feildData.max_count, ")"))),
861
- feildData.list_type === "picture" && /* @__PURE__ */ React23.createElement(Button3, { icon: /* @__PURE__ */ React23.createElement(UploadOutlined, null) }, feildData.max_count ? `Upload (Max:${feildData.max_count})` : "Upload")
862
- ), feildData.errors && feildData.errors.length > 0 && feildData.errors.map((error, eKey) => /* @__PURE__ */ React23.createElement("small", { key: eKey, className: "text-danger animated flash" }, error.message)), /* @__PURE__ */ React23.createElement(
860
+ props.feildData.list_type === "picture-card" && /* @__PURE__ */ React23.createElement("div", null, /* @__PURE__ */ React23.createElement(PlusOutlined2, null), /* @__PURE__ */ React23.createElement("div", { style: { marginTop: 8 } }, "Upload ", /* @__PURE__ */ React23.createElement("small", { className: "d-flex" }, "(Max:", props.feildData.max_count, ")"))),
861
+ props.feildData.list_type === "picture" && /* @__PURE__ */ React23.createElement(Button3, { icon: /* @__PURE__ */ React23.createElement(UploadOutlined, null) }, props.feildData.max_count ? `Upload (Max:${props.feildData.max_count})` : "Upload")
862
+ ), props.feildData.errors && props.feildData.errors.length > 0 && props.feildData.errors.map((error, eKey) => /* @__PURE__ */ React23.createElement("small", { key: eKey, className: "text-danger animated flash" }, error.message)), /* @__PURE__ */ React23.createElement(
863
863
  Modal2,
864
864
  {
865
865
  visible: previewOpen,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.13-Beta40",
3
+ "version": "0.0.13-Beta42",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",