@apexcura/ui-components 0.0.13-Beta44 → 0.0.13-Beta45

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
@@ -1,6 +1,5 @@
1
1
  import React$1 from 'react';
2
2
  import { SizeType } from 'antd/es/config-provider/SizeContext';
3
- import { UploadFile } from 'antd/lib/upload/interface';
4
3
 
5
4
  type ElementType = {
6
5
  [x: string]: any;
@@ -14,7 +13,7 @@ type ElementType = {
14
13
  prefix?: React.ReactNode;
15
14
  type?: string;
16
15
  size?: SizeType;
17
- value?: string | number | boolean | any[] | null | object | undefined;
16
+ value?: string | number | boolean | any[] | null | object | undefined | any;
18
17
  status?: "error" | "warning";
19
18
  styles?: React.CSSProperties;
20
19
  variant?: "outlined" | "borderless" | "filled";
@@ -96,25 +95,7 @@ declare const DatePickerElement: (props: ElementType) => React$1.JSX.Element;
96
95
 
97
96
  declare const DateRangePickerElement: (props: ElementType) => React$1.JSX.Element;
98
97
 
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;
98
+ declare const UploadElement: (props: ElementType) => React$1.JSX.Element;
118
99
 
119
100
  declare const Image: (props: ElementType) => React$1.JSX.Element;
120
101
 
package/dist/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import React$1 from 'react';
2
2
  import { SizeType } from 'antd/es/config-provider/SizeContext';
3
- import { UploadFile } from 'antd/lib/upload/interface';
4
3
 
5
4
  type ElementType = {
6
5
  [x: string]: any;
@@ -14,7 +13,7 @@ type ElementType = {
14
13
  prefix?: React.ReactNode;
15
14
  type?: string;
16
15
  size?: SizeType;
17
- value?: string | number | boolean | any[] | null | object | undefined;
16
+ value?: string | number | boolean | any[] | null | object | undefined | any;
18
17
  status?: "error" | "warning";
19
18
  styles?: React.CSSProperties;
20
19
  variant?: "outlined" | "borderless" | "filled";
@@ -96,25 +95,7 @@ declare const DatePickerElement: (props: ElementType) => React$1.JSX.Element;
96
95
 
97
96
  declare const DateRangePickerElement: (props: ElementType) => React$1.JSX.Element;
98
97
 
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;
98
+ declare const UploadElement: (props: ElementType) => React$1.JSX.Element;
118
99
 
119
100
  declare const Image: (props: ElementType) => React$1.JSX.Element;
120
101
 
package/dist/index.js CHANGED
@@ -820,16 +820,16 @@ var UploadElement = (props) => {
820
820
  }
821
821
  };
822
822
  reader.readAsDataURL(selectedFile);
823
- const newFileList = props.feildData.value ? [...props.feildData.value, newFile] : [newFile];
824
- props.onInputChanges({
825
- name: props.feildData.name,
823
+ const newFileList = props.value ? [...props.value, newFile] : [newFile];
824
+ props.onChange && props.onChange({
825
+ name: props.name,
826
826
  value: newFileList
827
827
  });
828
828
  };
829
829
  const uploadChange2 = ({ file, fileList }) => {
830
830
  const newFileList = fileList.filter((f) => f.name !== file.name);
831
- props.onInputChanges({
832
- name: props.feildData.name,
831
+ props.onChange && props.onChange({
832
+ name: props.name,
833
833
  value: newFileList
834
834
  });
835
835
  };
@@ -847,7 +847,7 @@ var UploadElement = (props) => {
847
847
  setPreviewOpen(false);
848
848
  setPreviewTitle(null);
849
849
  };
850
- return /* @__PURE__ */ import_react23.default.createElement(import_react23.default.Fragment, null, Object.keys(props.feildData).length !== 0 && /* @__PURE__ */ import_react23.default.createElement("span", { className: "native-camera-lib" }, /* @__PURE__ */ import_react23.default.createElement("p", { className: "flat-label text-capitalize" }, props.feildData.label), /* @__PURE__ */ import_react23.default.createElement("label", { className: "native-camera-button" }, /* @__PURE__ */ import_react23.default.createElement("div", { className: "ant-btn" }, /* @__PURE__ */ import_react23.default.createElement(import_icons5.UploadOutlined, null), " ", props.feildData.max_count ? `Upload (Max:${props.feildData.max_count})` : "Upload"), /* @__PURE__ */ import_react23.default.createElement(
850
+ return /* @__PURE__ */ import_react23.default.createElement(import_react23.default.Fragment, null, /* @__PURE__ */ import_react23.default.createElement("span", { className: "native-camera-lib" }, /* @__PURE__ */ import_react23.default.createElement("p", { className: "flat-label text-capitalize" }, props.label), /* @__PURE__ */ import_react23.default.createElement("label", { className: "native-camera-button" }, /* @__PURE__ */ import_react23.default.createElement("div", { className: "ant-btn" }, /* @__PURE__ */ import_react23.default.createElement(import_icons5.UploadOutlined, null), " ", props.max_count ? `Upload (Max:${props.max_count})` : "Upload"), /* @__PURE__ */ import_react23.default.createElement(
851
851
  "input",
852
852
  {
853
853
  id: "upload",
@@ -858,18 +858,18 @@ var UploadElement = (props) => {
858
858
  )), /* @__PURE__ */ import_react23.default.createElement(
859
859
  import_antd17.Upload,
860
860
  {
861
- accept: props.feildData.accept,
862
- listType: props.feildData.list_type,
863
- maxCount: props.feildData.max_count,
864
- multiple: props.feildData.multiple,
865
- fileList: props.feildData.value,
861
+ accept: props.accept,
862
+ listType: props.list_type,
863
+ maxCount: props.max_count,
864
+ multiple: props.multiple,
865
+ fileList: props.value,
866
866
  onChange: uploadChange2,
867
867
  onPreview: handlePreview,
868
868
  showUploadList: true
869
869
  },
870
- props.feildData.list_type === "picture-card" && /* @__PURE__ */ import_react23.default.createElement("div", null, /* @__PURE__ */ import_react23.default.createElement(import_icons5.PlusOutlined, null), /* @__PURE__ */ import_react23.default.createElement("div", { style: { marginTop: 8 } }, "Upload ", /* @__PURE__ */ import_react23.default.createElement("small", { className: "d-flex" }, "(Max:", props.feildData.max_count, ")"))),
871
- props.feildData.list_type === "picture" && /* @__PURE__ */ import_react23.default.createElement(import_antd17.Button, { icon: /* @__PURE__ */ import_react23.default.createElement(import_icons5.UploadOutlined, null) }, props.feildData.max_count ? `Upload (Max:${props.feildData.max_count})` : "Upload")
872
- ), props.feildData.errors && props.feildData.errors.length > 0 && props.feildData.errors.map((error, eKey) => /* @__PURE__ */ import_react23.default.createElement("small", { key: eKey, className: "text-danger animated flash" }, error.message)), /* @__PURE__ */ import_react23.default.createElement(
870
+ props.list_type === "picture-card" && /* @__PURE__ */ import_react23.default.createElement("div", null, /* @__PURE__ */ import_react23.default.createElement(import_icons5.PlusOutlined, null), /* @__PURE__ */ import_react23.default.createElement("div", { style: { marginTop: 8 } }, "Upload ", /* @__PURE__ */ import_react23.default.createElement("small", { className: "d-flex" }, "(Max:", props.max_count, ")"))),
871
+ props.list_type === "picture" && /* @__PURE__ */ import_react23.default.createElement(import_antd17.Button, { icon: /* @__PURE__ */ import_react23.default.createElement(import_icons5.UploadOutlined, null) }, props.feildData.max_count ? `Upload (Max:${props.max_count})` : "Upload")
872
+ ), props.errors && props.errors.length > 0 && props.errors.map((error, eKey) => /* @__PURE__ */ import_react23.default.createElement("small", { key: eKey, className: "text-danger animated flash" }, error.message)), /* @__PURE__ */ import_react23.default.createElement(
873
873
  import_antd17.Modal,
874
874
  {
875
875
  visible: previewOpen,
package/dist/index.mjs CHANGED
@@ -764,16 +764,16 @@ var UploadElement = (props) => {
764
764
  }
765
765
  };
766
766
  reader.readAsDataURL(selectedFile);
767
- const newFileList = props.feildData.value ? [...props.feildData.value, newFile] : [newFile];
768
- props.onInputChanges({
769
- name: props.feildData.name,
767
+ const newFileList = props.value ? [...props.value, newFile] : [newFile];
768
+ props.onChange && props.onChange({
769
+ name: props.name,
770
770
  value: newFileList
771
771
  });
772
772
  };
773
773
  const uploadChange2 = ({ file, fileList }) => {
774
774
  const newFileList = fileList.filter((f) => f.name !== file.name);
775
- props.onInputChanges({
776
- name: props.feildData.name,
775
+ props.onChange && props.onChange({
776
+ name: props.name,
777
777
  value: newFileList
778
778
  });
779
779
  };
@@ -791,7 +791,7 @@ var UploadElement = (props) => {
791
791
  setPreviewOpen(false);
792
792
  setPreviewTitle(null);
793
793
  };
794
- 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(
794
+ return /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement("span", { className: "native-camera-lib" }, /* @__PURE__ */ React23.createElement("p", { className: "flat-label text-capitalize" }, props.label), /* @__PURE__ */ React23.createElement("label", { className: "native-camera-button" }, /* @__PURE__ */ React23.createElement("div", { className: "ant-btn" }, /* @__PURE__ */ React23.createElement(UploadOutlined, null), " ", props.max_count ? `Upload (Max:${props.max_count})` : "Upload"), /* @__PURE__ */ React23.createElement(
795
795
  "input",
796
796
  {
797
797
  id: "upload",
@@ -802,18 +802,18 @@ var UploadElement = (props) => {
802
802
  )), /* @__PURE__ */ React23.createElement(
803
803
  Upload,
804
804
  {
805
- accept: props.feildData.accept,
806
- listType: props.feildData.list_type,
807
- maxCount: props.feildData.max_count,
808
- multiple: props.feildData.multiple,
809
- fileList: props.feildData.value,
805
+ accept: props.accept,
806
+ listType: props.list_type,
807
+ maxCount: props.max_count,
808
+ multiple: props.multiple,
809
+ fileList: props.value,
810
810
  onChange: uploadChange2,
811
811
  onPreview: handlePreview,
812
812
  showUploadList: true
813
813
  },
814
- 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, ")"))),
815
- 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")
816
- ), 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(
814
+ props.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.max_count, ")"))),
815
+ props.list_type === "picture" && /* @__PURE__ */ React23.createElement(Button3, { icon: /* @__PURE__ */ React23.createElement(UploadOutlined, null) }, props.feildData.max_count ? `Upload (Max:${props.max_count})` : "Upload")
816
+ ), props.errors && props.errors.length > 0 && props.errors.map((error, eKey) => /* @__PURE__ */ React23.createElement("small", { key: eKey, className: "text-danger animated flash" }, error.message)), /* @__PURE__ */ React23.createElement(
817
817
  Modal2,
818
818
  {
819
819
  visible: previewOpen,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.13-Beta44",
3
+ "version": "0.0.13-Beta45",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",