@apexcura/ui-components 0.0.13-Beta2 → 0.0.13-Beta21
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 +12 -17
- package/dist/index.d.ts +12 -17
- package/dist/index.js +50 -22
- package/dist/index.mjs +48 -22
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -25,7 +25,8 @@ type ElementType = {
|
|
|
25
25
|
fields?: any[];
|
|
26
26
|
schema?: any[];
|
|
27
27
|
options?: any[];
|
|
28
|
-
onChange?: (value: string | number | boolean | object | any[]) => void;
|
|
28
|
+
onChange?: (value: string | number | boolean | object | any[] | undefined) => void;
|
|
29
|
+
onClick?: () => void;
|
|
29
30
|
dropDownOptions?: any[];
|
|
30
31
|
id?: number;
|
|
31
32
|
thead?: any[];
|
|
@@ -56,29 +57,19 @@ type ElementType = {
|
|
|
56
57
|
};
|
|
57
58
|
|
|
58
59
|
interface ElementExecuterProps$3 extends ElementType {
|
|
59
|
-
onChange: (value: string | number | boolean | object | any[]) => void;
|
|
60
|
+
onChange: (value: string | number | boolean | object | any[] | undefined) => void;
|
|
60
61
|
}
|
|
61
62
|
declare const TextElement: (props: ElementExecuterProps$3) => React$1.JSX.Element;
|
|
62
63
|
|
|
63
|
-
|
|
64
|
-
placeholder?: string;
|
|
65
|
-
id?: string;
|
|
66
|
-
prefix?: React$1.ReactNode;
|
|
67
|
-
addonBefore?: React$1.ReactNode;
|
|
68
|
-
type?: string;
|
|
69
|
-
}
|
|
70
|
-
interface PasswordProps {
|
|
71
|
-
inputData: InputData;
|
|
72
|
-
}
|
|
73
|
-
declare const PasswordElement: React$1.FC<PasswordProps>;
|
|
64
|
+
declare const PasswordElement: (props: ElementType) => React$1.JSX.Element;
|
|
74
65
|
|
|
75
66
|
interface ElementExecuterProps$2 extends ElementType {
|
|
76
|
-
onChange: (value: string | number | object | boolean | any[]) => void;
|
|
67
|
+
onChange: (value: string | number | object | boolean | any[] | undefined) => void;
|
|
77
68
|
}
|
|
78
69
|
declare const NumberElement: (props: ElementExecuterProps$2) => React$1.JSX.Element;
|
|
79
70
|
|
|
80
71
|
interface ElementExecuterProps$1 extends ElementType {
|
|
81
|
-
onChange: (value: string | number | boolean | object | any[]) => void;
|
|
72
|
+
onChange: (value: string | number | boolean | object | any[] | undefined) => void;
|
|
82
73
|
}
|
|
83
74
|
declare const TextareaElement: (props: ElementExecuterProps$1) => React$1.JSX.Element;
|
|
84
75
|
|
|
@@ -89,7 +80,7 @@ declare const RadioElement: (props: ElementType) => React$1.JSX.Element;
|
|
|
89
80
|
declare const CheckboxElement: (props: ElementType) => React$1.JSX.Element;
|
|
90
81
|
|
|
91
82
|
interface ElementExecuterProps extends ElementType {
|
|
92
|
-
onChange: (value: string | number | object | boolean | any[]) => void;
|
|
83
|
+
onChange: (value: string | number | object | boolean | any[] | undefined) => void;
|
|
93
84
|
}
|
|
94
85
|
declare const CkEditor: (props: ElementExecuterProps) => React$1.JSX.Element;
|
|
95
86
|
|
|
@@ -111,4 +102,8 @@ declare const DatePickerElement: (props: ElementType) => React$1.JSX.Element;
|
|
|
111
102
|
|
|
112
103
|
declare const DateRangePickerElement: (props: ElementType) => React$1.JSX.Element;
|
|
113
104
|
|
|
114
|
-
|
|
105
|
+
declare const UploadElement: (props: ElementType) => React$1.JSX.Element;
|
|
106
|
+
|
|
107
|
+
declare const Image: (props: ElementType) => React$1.JSX.Element;
|
|
108
|
+
|
|
109
|
+
export { AddMoreTable, ButtonElement, CheckboxElement, CkEditor, DatePickerElement, DateRangePickerElement, Image, MultipleSelectElement, Navbar, NumberElement, PasswordElement, RadioElement, SelectElement, Sidebar, SingleSelectElement, TableElement, TextElement, TextareaElement, UploadElement };
|
package/dist/index.d.ts
CHANGED
|
@@ -25,7 +25,8 @@ type ElementType = {
|
|
|
25
25
|
fields?: any[];
|
|
26
26
|
schema?: any[];
|
|
27
27
|
options?: any[];
|
|
28
|
-
onChange?: (value: string | number | boolean | object | any[]) => void;
|
|
28
|
+
onChange?: (value: string | number | boolean | object | any[] | undefined) => void;
|
|
29
|
+
onClick?: () => void;
|
|
29
30
|
dropDownOptions?: any[];
|
|
30
31
|
id?: number;
|
|
31
32
|
thead?: any[];
|
|
@@ -56,29 +57,19 @@ type ElementType = {
|
|
|
56
57
|
};
|
|
57
58
|
|
|
58
59
|
interface ElementExecuterProps$3 extends ElementType {
|
|
59
|
-
onChange: (value: string | number | boolean | object | any[]) => void;
|
|
60
|
+
onChange: (value: string | number | boolean | object | any[] | undefined) => void;
|
|
60
61
|
}
|
|
61
62
|
declare const TextElement: (props: ElementExecuterProps$3) => React$1.JSX.Element;
|
|
62
63
|
|
|
63
|
-
|
|
64
|
-
placeholder?: string;
|
|
65
|
-
id?: string;
|
|
66
|
-
prefix?: React$1.ReactNode;
|
|
67
|
-
addonBefore?: React$1.ReactNode;
|
|
68
|
-
type?: string;
|
|
69
|
-
}
|
|
70
|
-
interface PasswordProps {
|
|
71
|
-
inputData: InputData;
|
|
72
|
-
}
|
|
73
|
-
declare const PasswordElement: React$1.FC<PasswordProps>;
|
|
64
|
+
declare const PasswordElement: (props: ElementType) => React$1.JSX.Element;
|
|
74
65
|
|
|
75
66
|
interface ElementExecuterProps$2 extends ElementType {
|
|
76
|
-
onChange: (value: string | number | object | boolean | any[]) => void;
|
|
67
|
+
onChange: (value: string | number | object | boolean | any[] | undefined) => void;
|
|
77
68
|
}
|
|
78
69
|
declare const NumberElement: (props: ElementExecuterProps$2) => React$1.JSX.Element;
|
|
79
70
|
|
|
80
71
|
interface ElementExecuterProps$1 extends ElementType {
|
|
81
|
-
onChange: (value: string | number | boolean | object | any[]) => void;
|
|
72
|
+
onChange: (value: string | number | boolean | object | any[] | undefined) => void;
|
|
82
73
|
}
|
|
83
74
|
declare const TextareaElement: (props: ElementExecuterProps$1) => React$1.JSX.Element;
|
|
84
75
|
|
|
@@ -89,7 +80,7 @@ declare const RadioElement: (props: ElementType) => React$1.JSX.Element;
|
|
|
89
80
|
declare const CheckboxElement: (props: ElementType) => React$1.JSX.Element;
|
|
90
81
|
|
|
91
82
|
interface ElementExecuterProps extends ElementType {
|
|
92
|
-
onChange: (value: string | number | object | boolean | any[]) => void;
|
|
83
|
+
onChange: (value: string | number | object | boolean | any[] | undefined) => void;
|
|
93
84
|
}
|
|
94
85
|
declare const CkEditor: (props: ElementExecuterProps) => React$1.JSX.Element;
|
|
95
86
|
|
|
@@ -111,4 +102,8 @@ declare const DatePickerElement: (props: ElementType) => React$1.JSX.Element;
|
|
|
111
102
|
|
|
112
103
|
declare const DateRangePickerElement: (props: ElementType) => React$1.JSX.Element;
|
|
113
104
|
|
|
114
|
-
|
|
105
|
+
declare const UploadElement: (props: ElementType) => React$1.JSX.Element;
|
|
106
|
+
|
|
107
|
+
declare const Image: (props: ElementType) => React$1.JSX.Element;
|
|
108
|
+
|
|
109
|
+
export { AddMoreTable, ButtonElement, CheckboxElement, CkEditor, DatePickerElement, DateRangePickerElement, Image, MultipleSelectElement, Navbar, NumberElement, PasswordElement, RadioElement, SelectElement, Sidebar, SingleSelectElement, TableElement, TextElement, TextareaElement, UploadElement };
|
package/dist/index.js
CHANGED
|
@@ -36,6 +36,7 @@ __export(src_exports, {
|
|
|
36
36
|
CkEditor: () => CkEditor,
|
|
37
37
|
DatePickerElement: () => DatePickerElement,
|
|
38
38
|
DateRangePickerElement: () => DateRangePickerElement,
|
|
39
|
+
Image: () => Image,
|
|
39
40
|
MultipleSelectElement: () => MultipleSelectElement,
|
|
40
41
|
Navbar: () => Navbar,
|
|
41
42
|
NumberElement: () => NumberElement,
|
|
@@ -46,7 +47,8 @@ __export(src_exports, {
|
|
|
46
47
|
SingleSelectElement: () => SingleSelectElement,
|
|
47
48
|
TableElement: () => TableElement,
|
|
48
49
|
TextElement: () => TextElement,
|
|
49
|
-
TextareaElement: () => TextareaElement
|
|
50
|
+
TextareaElement: () => TextareaElement,
|
|
51
|
+
UploadElement: () => UploadElement
|
|
50
52
|
});
|
|
51
53
|
module.exports = __toCommonJS(src_exports);
|
|
52
54
|
|
|
@@ -54,7 +56,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
54
56
|
var import_react = __toESM(require("react"));
|
|
55
57
|
var import_antd = require("antd");
|
|
56
58
|
var TextElement = (props) => {
|
|
57
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, props.label && /* @__PURE__ */ import_react.default.createElement("label", { htmlFor: props.name }, props.label), /* @__PURE__ */ import_react.default.createElement(
|
|
59
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, props.label && /* @__PURE__ */ import_react.default.createElement("label", { htmlFor: props.name, style: { display: "flex", flexDirection: "row", justifyContent: "left" } }, props.label), /* @__PURE__ */ import_react.default.createElement(
|
|
58
60
|
import_antd.Input,
|
|
59
61
|
{
|
|
60
62
|
placeholder: props.placeholder,
|
|
@@ -79,7 +81,7 @@ var TextElement = (props) => {
|
|
|
79
81
|
var import_react2 = __toESM(require("react"));
|
|
80
82
|
var import_icons = require("@ant-design/icons");
|
|
81
83
|
var import_antd2 = require("antd");
|
|
82
|
-
var PasswordElement = (
|
|
84
|
+
var PasswordElement = (props) => {
|
|
83
85
|
const [passwordVisible, setPasswordVisible] = (0, import_react2.useState)(false);
|
|
84
86
|
const handleVisibilityToggle = () => {
|
|
85
87
|
setPasswordVisible((prev) => !prev);
|
|
@@ -88,11 +90,10 @@ var PasswordElement = ({ inputData }) => {
|
|
|
88
90
|
const renderPasswordInput = () => /* @__PURE__ */ import_react2.default.createElement(
|
|
89
91
|
import_antd2.Input.Password,
|
|
90
92
|
{
|
|
91
|
-
placeholder:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
type: inputData.type,
|
|
93
|
+
placeholder: props.placeholder,
|
|
94
|
+
prefix: props.prefix,
|
|
95
|
+
addonBefore: props.addonBefore,
|
|
96
|
+
type: props.type,
|
|
96
97
|
iconRender: renderVisibilityIcon,
|
|
97
98
|
visibilityToggle: { visible: passwordVisible, onVisibleChange: handleVisibilityToggle }
|
|
98
99
|
}
|
|
@@ -215,7 +216,6 @@ var RadioElement = (props) => {
|
|
|
215
216
|
value: selectedValue
|
|
216
217
|
},
|
|
217
218
|
props.options && props.options.map((option) => {
|
|
218
|
-
console.log(option);
|
|
219
219
|
return /* @__PURE__ */ import_react6.default.createElement(
|
|
220
220
|
import_antd6.Radio,
|
|
221
221
|
{
|
|
@@ -238,22 +238,19 @@ var RadioElement = (props) => {
|
|
|
238
238
|
var import_react7 = __toESM(require("react"));
|
|
239
239
|
var import_antd7 = require("antd");
|
|
240
240
|
var CheckboxGroup = import_antd7.Checkbox.Group;
|
|
241
|
-
var plainOptions = ["Apple", "Pear", "Orange"];
|
|
242
241
|
var defaultCheckedList = [];
|
|
243
242
|
var CheckboxElement = (props) => {
|
|
244
243
|
const [checkedList, setCheckedList] = (0, import_react7.useState)(defaultCheckedList);
|
|
245
|
-
const checkAll =
|
|
244
|
+
const checkAll = props.options && props.options.length === checkedList.length;
|
|
246
245
|
const handleChange = (list) => {
|
|
247
246
|
setCheckedList(list);
|
|
248
247
|
if (props.onChange) {
|
|
249
|
-
const selectedOptions =
|
|
250
|
-
return { id: list.indexOf(value), value };
|
|
251
|
-
});
|
|
248
|
+
const selectedOptions = props.options && props.options.filter((option) => list.includes(option.value));
|
|
252
249
|
props.onChange(selectedOptions);
|
|
253
250
|
}
|
|
254
251
|
};
|
|
255
252
|
const onHandleAllChanges = (e) => {
|
|
256
|
-
const newList = e.target.checked ?
|
|
253
|
+
const newList = e.target.checked ? props.options : [];
|
|
257
254
|
setCheckedList(newList);
|
|
258
255
|
if (props.onChange) {
|
|
259
256
|
props.onChange(newList);
|
|
@@ -270,13 +267,13 @@ var CheckboxElement = (props) => {
|
|
|
270
267
|
checked: checkAll
|
|
271
268
|
},
|
|
272
269
|
"Check all"
|
|
273
|
-
), /* @__PURE__ */ import_react7.default.createElement(
|
|
270
|
+
), /* @__PURE__ */ import_react7.default.createElement(
|
|
274
271
|
CheckboxGroup,
|
|
275
272
|
{
|
|
276
273
|
disabled: props.disabled,
|
|
277
274
|
style: props.styles,
|
|
278
275
|
className: props.className,
|
|
279
|
-
options:
|
|
276
|
+
options: props.options,
|
|
280
277
|
value: checkedList,
|
|
281
278
|
onChange: handleChange
|
|
282
279
|
}
|
|
@@ -391,13 +388,10 @@ var MultipleSelectElement = (props) => {
|
|
|
391
388
|
// src/Components/Button.tsx
|
|
392
389
|
var import_react12 = __toESM(require("react"));
|
|
393
390
|
var ButtonElement = (props) => {
|
|
394
|
-
const handleClick = typeof props.action === "string" ? () => {
|
|
395
|
-
console.log("Performing action:", props.action);
|
|
396
|
-
} : props.action;
|
|
397
391
|
return /* @__PURE__ */ import_react12.default.createElement(
|
|
398
392
|
"button",
|
|
399
393
|
{
|
|
400
|
-
onClick:
|
|
394
|
+
onClick: () => props.onClick && props.onClick(),
|
|
401
395
|
className: `${props.className ? props.className : ""}`
|
|
402
396
|
},
|
|
403
397
|
props.icon && /* @__PURE__ */ import_react12.default.createElement("img", { src: props.icon }),
|
|
@@ -804,6 +798,38 @@ var DateRangePickerElement = (props) => {
|
|
|
804
798
|
];
|
|
805
799
|
return /* @__PURE__ */ import_react23.default.createElement(import_antd16.Space, { direction: "vertical", size: 12 }, /* @__PURE__ */ import_react23.default.createElement(RangePicker, { presets: rangePresets, onChange: handleChange }));
|
|
806
800
|
};
|
|
801
|
+
|
|
802
|
+
// src/Components/UploadElement.tsx
|
|
803
|
+
var import_react24 = __toESM(require("react"));
|
|
804
|
+
var import_icons5 = require("@ant-design/icons");
|
|
805
|
+
var import_antd17 = require("antd");
|
|
806
|
+
var uploadProps = {
|
|
807
|
+
name: "file",
|
|
808
|
+
multiple: true,
|
|
809
|
+
// action: 'https://660d2bd96ddfa2943b33731c.mockapi.io/api/upload',
|
|
810
|
+
headers: {
|
|
811
|
+
authorization: "authorization-text"
|
|
812
|
+
},
|
|
813
|
+
onChange(info) {
|
|
814
|
+
if (info.file.status !== "uploading") {
|
|
815
|
+
console.log(info.file, info.fileList);
|
|
816
|
+
}
|
|
817
|
+
if (info.file.status === "done") {
|
|
818
|
+
import_antd17.message.success(`${info.file.name} file uploaded successfully`);
|
|
819
|
+
} else if (info.file.status === "error") {
|
|
820
|
+
import_antd17.message.error(`${info.file.name} file upload failed.`);
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
};
|
|
824
|
+
var UploadElement = (props) => {
|
|
825
|
+
return /* @__PURE__ */ import_react24.default.createElement(import_antd17.Upload, { ...uploadProps }, /* @__PURE__ */ import_react24.default.createElement(import_antd17.Button, { icon: /* @__PURE__ */ import_react24.default.createElement(import_icons5.UploadOutlined, null) }, "Click to Upload"));
|
|
826
|
+
};
|
|
827
|
+
|
|
828
|
+
// src/Components/Image.tsx
|
|
829
|
+
var import_react25 = __toESM(require("react"));
|
|
830
|
+
var Image = (props) => {
|
|
831
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", null, /* @__PURE__ */ import_react25.default.createElement("img", { className: props.className, src: props.img, alt: "image" }));
|
|
832
|
+
};
|
|
807
833
|
// Annotate the CommonJS export names for ESM import in node:
|
|
808
834
|
0 && (module.exports = {
|
|
809
835
|
AddMoreTable,
|
|
@@ -812,6 +838,7 @@ var DateRangePickerElement = (props) => {
|
|
|
812
838
|
CkEditor,
|
|
813
839
|
DatePickerElement,
|
|
814
840
|
DateRangePickerElement,
|
|
841
|
+
Image,
|
|
815
842
|
MultipleSelectElement,
|
|
816
843
|
Navbar,
|
|
817
844
|
NumberElement,
|
|
@@ -822,5 +849,6 @@ var DateRangePickerElement = (props) => {
|
|
|
822
849
|
SingleSelectElement,
|
|
823
850
|
TableElement,
|
|
824
851
|
TextElement,
|
|
825
|
-
TextareaElement
|
|
852
|
+
TextareaElement,
|
|
853
|
+
UploadElement
|
|
826
854
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { Input as AntInput } from "antd";
|
|
4
4
|
var TextElement = (props) => {
|
|
5
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, props.label && /* @__PURE__ */ React.createElement("label", { htmlFor: props.name }, props.label), /* @__PURE__ */ React.createElement(
|
|
5
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, props.label && /* @__PURE__ */ React.createElement("label", { htmlFor: props.name, style: { display: "flex", flexDirection: "row", justifyContent: "left" } }, props.label), /* @__PURE__ */ React.createElement(
|
|
6
6
|
AntInput,
|
|
7
7
|
{
|
|
8
8
|
placeholder: props.placeholder,
|
|
@@ -27,7 +27,7 @@ var TextElement = (props) => {
|
|
|
27
27
|
import React2, { useState } from "react";
|
|
28
28
|
import { EyeInvisibleOutlined, EyeTwoTone } from "@ant-design/icons";
|
|
29
29
|
import { Button, Input, Space } from "antd";
|
|
30
|
-
var PasswordElement = (
|
|
30
|
+
var PasswordElement = (props) => {
|
|
31
31
|
const [passwordVisible, setPasswordVisible] = useState(false);
|
|
32
32
|
const handleVisibilityToggle = () => {
|
|
33
33
|
setPasswordVisible((prev) => !prev);
|
|
@@ -36,11 +36,10 @@ var PasswordElement = ({ inputData }) => {
|
|
|
36
36
|
const renderPasswordInput = () => /* @__PURE__ */ React2.createElement(
|
|
37
37
|
Input.Password,
|
|
38
38
|
{
|
|
39
|
-
placeholder:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
type: inputData.type,
|
|
39
|
+
placeholder: props.placeholder,
|
|
40
|
+
prefix: props.prefix,
|
|
41
|
+
addonBefore: props.addonBefore,
|
|
42
|
+
type: props.type,
|
|
44
43
|
iconRender: renderVisibilityIcon,
|
|
45
44
|
visibilityToggle: { visible: passwordVisible, onVisibleChange: handleVisibilityToggle }
|
|
46
45
|
}
|
|
@@ -163,7 +162,6 @@ var RadioElement = (props) => {
|
|
|
163
162
|
value: selectedValue
|
|
164
163
|
},
|
|
165
164
|
props.options && props.options.map((option) => {
|
|
166
|
-
console.log(option);
|
|
167
165
|
return /* @__PURE__ */ React6.createElement(
|
|
168
166
|
Radio,
|
|
169
167
|
{
|
|
@@ -184,24 +182,21 @@ var RadioElement = (props) => {
|
|
|
184
182
|
|
|
185
183
|
// src/Components/Checkbox.tsx
|
|
186
184
|
import React7, { useState as useState3 } from "react";
|
|
187
|
-
import { Checkbox
|
|
185
|
+
import { Checkbox } from "antd";
|
|
188
186
|
var CheckboxGroup = Checkbox.Group;
|
|
189
|
-
var plainOptions = ["Apple", "Pear", "Orange"];
|
|
190
187
|
var defaultCheckedList = [];
|
|
191
188
|
var CheckboxElement = (props) => {
|
|
192
189
|
const [checkedList, setCheckedList] = useState3(defaultCheckedList);
|
|
193
|
-
const checkAll =
|
|
190
|
+
const checkAll = props.options && props.options.length === checkedList.length;
|
|
194
191
|
const handleChange = (list) => {
|
|
195
192
|
setCheckedList(list);
|
|
196
193
|
if (props.onChange) {
|
|
197
|
-
const selectedOptions =
|
|
198
|
-
return { id: list.indexOf(value), value };
|
|
199
|
-
});
|
|
194
|
+
const selectedOptions = props.options && props.options.filter((option) => list.includes(option.value));
|
|
200
195
|
props.onChange(selectedOptions);
|
|
201
196
|
}
|
|
202
197
|
};
|
|
203
198
|
const onHandleAllChanges = (e) => {
|
|
204
|
-
const newList = e.target.checked ?
|
|
199
|
+
const newList = e.target.checked ? props.options : [];
|
|
205
200
|
setCheckedList(newList);
|
|
206
201
|
if (props.onChange) {
|
|
207
202
|
props.onChange(newList);
|
|
@@ -218,13 +213,13 @@ var CheckboxElement = (props) => {
|
|
|
218
213
|
checked: checkAll
|
|
219
214
|
},
|
|
220
215
|
"Check all"
|
|
221
|
-
), /* @__PURE__ */ React7.createElement(
|
|
216
|
+
), /* @__PURE__ */ React7.createElement(
|
|
222
217
|
CheckboxGroup,
|
|
223
218
|
{
|
|
224
219
|
disabled: props.disabled,
|
|
225
220
|
style: props.styles,
|
|
226
221
|
className: props.className,
|
|
227
|
-
options:
|
|
222
|
+
options: props.options,
|
|
228
223
|
value: checkedList,
|
|
229
224
|
onChange: handleChange
|
|
230
225
|
}
|
|
@@ -339,13 +334,10 @@ var MultipleSelectElement = (props) => {
|
|
|
339
334
|
// src/Components/Button.tsx
|
|
340
335
|
import React11 from "react";
|
|
341
336
|
var ButtonElement = (props) => {
|
|
342
|
-
const handleClick = typeof props.action === "string" ? () => {
|
|
343
|
-
console.log("Performing action:", props.action);
|
|
344
|
-
} : props.action;
|
|
345
337
|
return /* @__PURE__ */ React11.createElement(
|
|
346
338
|
"button",
|
|
347
339
|
{
|
|
348
|
-
onClick:
|
|
340
|
+
onClick: () => props.onClick && props.onClick(),
|
|
349
341
|
className: `${props.className ? props.className : ""}`
|
|
350
342
|
},
|
|
351
343
|
props.icon && /* @__PURE__ */ React11.createElement("img", { src: props.icon }),
|
|
@@ -752,6 +744,38 @@ var DateRangePickerElement = (props) => {
|
|
|
752
744
|
];
|
|
753
745
|
return /* @__PURE__ */ React22.createElement(Space2, { direction: "vertical", size: 12 }, /* @__PURE__ */ React22.createElement(RangePicker, { presets: rangePresets, onChange: handleChange }));
|
|
754
746
|
};
|
|
747
|
+
|
|
748
|
+
// src/Components/UploadElement.tsx
|
|
749
|
+
import React23 from "react";
|
|
750
|
+
import { UploadOutlined } from "@ant-design/icons";
|
|
751
|
+
import { Button as Button4, message, Upload } from "antd";
|
|
752
|
+
var uploadProps = {
|
|
753
|
+
name: "file",
|
|
754
|
+
multiple: true,
|
|
755
|
+
// action: 'https://660d2bd96ddfa2943b33731c.mockapi.io/api/upload',
|
|
756
|
+
headers: {
|
|
757
|
+
authorization: "authorization-text"
|
|
758
|
+
},
|
|
759
|
+
onChange(info) {
|
|
760
|
+
if (info.file.status !== "uploading") {
|
|
761
|
+
console.log(info.file, info.fileList);
|
|
762
|
+
}
|
|
763
|
+
if (info.file.status === "done") {
|
|
764
|
+
message.success(`${info.file.name} file uploaded successfully`);
|
|
765
|
+
} else if (info.file.status === "error") {
|
|
766
|
+
message.error(`${info.file.name} file upload failed.`);
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
};
|
|
770
|
+
var UploadElement = (props) => {
|
|
771
|
+
return /* @__PURE__ */ React23.createElement(Upload, { ...uploadProps }, /* @__PURE__ */ React23.createElement(Button4, { icon: /* @__PURE__ */ React23.createElement(UploadOutlined, null) }, "Click to Upload"));
|
|
772
|
+
};
|
|
773
|
+
|
|
774
|
+
// src/Components/Image.tsx
|
|
775
|
+
import React24 from "react";
|
|
776
|
+
var Image = (props) => {
|
|
777
|
+
return /* @__PURE__ */ React24.createElement("div", null, /* @__PURE__ */ React24.createElement("img", { className: props.className, src: props.img, alt: "image" }));
|
|
778
|
+
};
|
|
755
779
|
export {
|
|
756
780
|
AddMoreTable,
|
|
757
781
|
ButtonElement,
|
|
@@ -759,6 +783,7 @@ export {
|
|
|
759
783
|
CkEditor,
|
|
760
784
|
DatePickerElement,
|
|
761
785
|
DateRangePickerElement,
|
|
786
|
+
Image,
|
|
762
787
|
MultipleSelectElement,
|
|
763
788
|
Navbar,
|
|
764
789
|
NumberElement,
|
|
@@ -769,5 +794,6 @@ export {
|
|
|
769
794
|
SingleSelectElement,
|
|
770
795
|
TableElement,
|
|
771
796
|
TextElement,
|
|
772
|
-
TextareaElement
|
|
797
|
+
TextareaElement,
|
|
798
|
+
UploadElement
|
|
773
799
|
};
|