@apexcura/ui-components 0.0.13-Beta79 → 0.0.13-Beta8
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 +26 -18
- package/dist/index.d.ts +26 -18
- package/dist/index.js +163 -241
- package/dist/index.mjs +116 -190
- package/package.json +1 -2
package/dist/index.mjs
CHANGED
|
@@ -2,12 +2,7 @@
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { Input as AntInput } from "antd";
|
|
4
4
|
var TextElement = (props) => {
|
|
5
|
-
|
|
6
|
-
if (props.onChange) {
|
|
7
|
-
props.onChange(e.target.value);
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
return /* @__PURE__ */ React.createElement("div", { className: props.containerClassName }, props.label && /* @__PURE__ */ React.createElement("label", { htmlFor: props.name, className: props.labelClassName }, props.label), /* @__PURE__ */ React.createElement(
|
|
5
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, props.label && /* @__PURE__ */ React.createElement("label", { htmlFor: props.name }, props.label), /* @__PURE__ */ React.createElement(
|
|
11
6
|
AntInput,
|
|
12
7
|
{
|
|
13
8
|
placeholder: props.placeholder,
|
|
@@ -23,9 +18,7 @@ var TextElement = (props) => {
|
|
|
23
18
|
className: props.className,
|
|
24
19
|
variant: props.variant,
|
|
25
20
|
name: props.name,
|
|
26
|
-
onChange: (e) =>
|
|
27
|
-
handleChange(e);
|
|
28
|
-
}
|
|
21
|
+
onChange: (e) => props.onChange(e.target.value)
|
|
29
22
|
}
|
|
30
23
|
));
|
|
31
24
|
};
|
|
@@ -33,47 +26,37 @@ var TextElement = (props) => {
|
|
|
33
26
|
// src/Components/PasswordElement.tsx
|
|
34
27
|
import React2, { useState } from "react";
|
|
35
28
|
import { EyeInvisibleOutlined, EyeTwoTone } from "@ant-design/icons";
|
|
36
|
-
import { Input } from "antd";
|
|
37
|
-
var PasswordElement = (
|
|
29
|
+
import { Button, Input, Space } from "antd";
|
|
30
|
+
var PasswordElement = ({ inputData }) => {
|
|
38
31
|
const [passwordVisible, setPasswordVisible] = useState(false);
|
|
39
32
|
const handleVisibilityToggle = () => {
|
|
40
33
|
setPasswordVisible((prev) => !prev);
|
|
41
34
|
};
|
|
42
|
-
const handleChange = (e) => {
|
|
43
|
-
if (props.onChange) {
|
|
44
|
-
props.onChange(e.target.value);
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
35
|
const renderVisibilityIcon = (visible) => visible ? /* @__PURE__ */ React2.createElement(EyeTwoTone, null) : /* @__PURE__ */ React2.createElement(EyeInvisibleOutlined, null);
|
|
48
|
-
|
|
36
|
+
const renderPasswordInput = () => /* @__PURE__ */ React2.createElement(
|
|
49
37
|
Input.Password,
|
|
50
38
|
{
|
|
51
|
-
placeholder:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
},
|
|
39
|
+
placeholder: inputData.placeholder,
|
|
40
|
+
id: inputData.id,
|
|
41
|
+
prefix: inputData.prefix,
|
|
42
|
+
addonBefore: inputData.addonBefore,
|
|
43
|
+
type: inputData.type,
|
|
57
44
|
iconRender: renderVisibilityIcon,
|
|
58
|
-
visibilityToggle: {
|
|
59
|
-
visible: passwordVisible,
|
|
60
|
-
onVisibleChange: handleVisibilityToggle
|
|
61
|
-
}
|
|
45
|
+
visibilityToggle: { visible: passwordVisible, onVisibleChange: handleVisibilityToggle }
|
|
62
46
|
}
|
|
63
|
-
)
|
|
47
|
+
);
|
|
48
|
+
return /* @__PURE__ */ React2.createElement(Space, { direction: "vertical" }, renderPasswordInput(), /* @__PURE__ */ React2.createElement(Space, { direction: "horizontal" }, renderPasswordInput(), /* @__PURE__ */ React2.createElement(Button, { style: { width: 80 }, onClick: handleVisibilityToggle }, passwordVisible ? "Hide" : "Show")));
|
|
64
49
|
};
|
|
65
50
|
|
|
66
51
|
// src/Components/NumberElement.tsx
|
|
67
52
|
import React3 from "react";
|
|
68
53
|
import { Input as AntInput2 } from "antd";
|
|
69
54
|
var NumberElement = (props) => {
|
|
70
|
-
const
|
|
55
|
+
const handleInputChange = (e) => {
|
|
71
56
|
const newValue = e.target.value.replace(/[^0-9]/g, "");
|
|
72
|
-
|
|
73
|
-
props.onChange(newValue);
|
|
74
|
-
}
|
|
57
|
+
props.onChange(newValue);
|
|
75
58
|
};
|
|
76
|
-
return /* @__PURE__ */ React3.createElement(
|
|
59
|
+
return /* @__PURE__ */ React3.createElement(
|
|
77
60
|
AntInput2,
|
|
78
61
|
{
|
|
79
62
|
placeholder: props.placeholder,
|
|
@@ -88,24 +71,17 @@ var NumberElement = (props) => {
|
|
|
88
71
|
className: props.className,
|
|
89
72
|
variant: props.variant,
|
|
90
73
|
name: props.name,
|
|
91
|
-
onChange:
|
|
92
|
-
handleChange(e);
|
|
93
|
-
}
|
|
74
|
+
onChange: handleInputChange
|
|
94
75
|
}
|
|
95
|
-
)
|
|
76
|
+
);
|
|
96
77
|
};
|
|
97
78
|
|
|
98
79
|
// src/Components/TextareaElement.tsx
|
|
99
80
|
import React4 from "react";
|
|
100
|
-
import { Input as Input2 } from "antd";
|
|
81
|
+
import { Flex, Input as Input2 } from "antd";
|
|
101
82
|
var { TextArea } = Input2;
|
|
102
83
|
var TextareaElement = (props) => {
|
|
103
|
-
|
|
104
|
-
if (props.onChange) {
|
|
105
|
-
props.onChange(e.target.value);
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
return /* @__PURE__ */ React4.createElement("div", { className: props.containerClassName }, props.label && /* @__PURE__ */ React4.createElement("label", { htmlFor: props.name, className: props.labelClassName }, props.label), /* @__PURE__ */ React4.createElement(
|
|
84
|
+
return /* @__PURE__ */ React4.createElement(Flex, null, /* @__PURE__ */ React4.createElement(
|
|
109
85
|
TextArea,
|
|
110
86
|
{
|
|
111
87
|
placeholder: props.placeholder,
|
|
@@ -119,9 +95,7 @@ var TextareaElement = (props) => {
|
|
|
119
95
|
name: props.name,
|
|
120
96
|
showCount: true,
|
|
121
97
|
maxLength: props.maxLength,
|
|
122
|
-
onChange: (e) =>
|
|
123
|
-
handleChange(e);
|
|
124
|
-
}
|
|
98
|
+
onChange: (e) => props.onChange(e.target.value)
|
|
125
99
|
}
|
|
126
100
|
));
|
|
127
101
|
};
|
|
@@ -129,18 +103,24 @@ var TextareaElement = (props) => {
|
|
|
129
103
|
// src/Components/SelectElement.tsx
|
|
130
104
|
import React5 from "react";
|
|
131
105
|
import { Select } from "antd";
|
|
106
|
+
var labelRender = (props) => {
|
|
107
|
+
const { label, value } = props;
|
|
108
|
+
if (label) {
|
|
109
|
+
return value;
|
|
110
|
+
}
|
|
111
|
+
return /* @__PURE__ */ React5.createElement("span", null, "select gender");
|
|
112
|
+
};
|
|
132
113
|
var SelectElement = (props) => {
|
|
133
114
|
const handleChange = (value) => {
|
|
134
|
-
console.log("sigleselectvalue----", value);
|
|
135
115
|
if (props.onChange) {
|
|
136
|
-
|
|
137
|
-
props.onChange(filterOption2);
|
|
116
|
+
props.onChange(value);
|
|
138
117
|
}
|
|
139
118
|
};
|
|
140
|
-
return /* @__PURE__ */ React5.createElement(
|
|
119
|
+
return /* @__PURE__ */ React5.createElement(
|
|
141
120
|
Select,
|
|
142
121
|
{
|
|
143
|
-
|
|
122
|
+
labelRender,
|
|
123
|
+
options: props.fieldNames,
|
|
144
124
|
placeholder: props.placeholder,
|
|
145
125
|
allowClear: true,
|
|
146
126
|
defaultValue: props.defaultValue,
|
|
@@ -152,7 +132,7 @@ var SelectElement = (props) => {
|
|
|
152
132
|
variant: props.variant,
|
|
153
133
|
onChange: handleChange
|
|
154
134
|
}
|
|
155
|
-
)
|
|
135
|
+
);
|
|
156
136
|
};
|
|
157
137
|
|
|
158
138
|
// src/Components/RadioElement.tsx
|
|
@@ -203,7 +183,7 @@ var RadioElement = (props) => {
|
|
|
203
183
|
|
|
204
184
|
// src/Components/Checkbox.tsx
|
|
205
185
|
import React7, { useState as useState3 } from "react";
|
|
206
|
-
import { Checkbox } from "antd";
|
|
186
|
+
import { Checkbox, Divider } from "antd";
|
|
207
187
|
var CheckboxGroup = Checkbox.Group;
|
|
208
188
|
var defaultCheckedList = [];
|
|
209
189
|
var CheckboxElement = (props) => {
|
|
@@ -212,7 +192,9 @@ var CheckboxElement = (props) => {
|
|
|
212
192
|
const handleChange = (list) => {
|
|
213
193
|
setCheckedList(list);
|
|
214
194
|
if (props.onChange) {
|
|
215
|
-
const selectedOptions =
|
|
195
|
+
const selectedOptions = list.map((value) => {
|
|
196
|
+
return { id: list.indexOf(value), value };
|
|
197
|
+
});
|
|
216
198
|
props.onChange(selectedOptions);
|
|
217
199
|
}
|
|
218
200
|
};
|
|
@@ -234,7 +216,7 @@ var CheckboxElement = (props) => {
|
|
|
234
216
|
checked: checkAll
|
|
235
217
|
},
|
|
236
218
|
"Check all"
|
|
237
|
-
), /* @__PURE__ */ React7.createElement(
|
|
219
|
+
), /* @__PURE__ */ React7.createElement(Divider, null), /* @__PURE__ */ React7.createElement(
|
|
238
220
|
CheckboxGroup,
|
|
239
221
|
{
|
|
240
222
|
disabled: props.disabled,
|
|
@@ -248,9 +230,55 @@ var CheckboxElement = (props) => {
|
|
|
248
230
|
};
|
|
249
231
|
|
|
250
232
|
// src/Components/CkEditor.tsx
|
|
233
|
+
import { useRef } from "react";
|
|
234
|
+
import { Editor } from "@tinymce/tinymce-react";
|
|
251
235
|
import React8 from "react";
|
|
252
236
|
var CkEditor = (props) => {
|
|
253
|
-
|
|
237
|
+
const editorRef = useRef(null);
|
|
238
|
+
const log = () => {
|
|
239
|
+
if (editorRef.current) {
|
|
240
|
+
let content = editorRef.current.getContent();
|
|
241
|
+
if (props.onChange) {
|
|
242
|
+
props.onChange(content);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
return /* @__PURE__ */ React8.createElement("div", null, /* @__PURE__ */ React8.createElement(
|
|
247
|
+
Editor,
|
|
248
|
+
{
|
|
249
|
+
apiKey: "rwpgt7maa54n0pe5mglhkl686p7h57sg6z636n6gf2mio1b9",
|
|
250
|
+
onInit: (_evt, editor) => {
|
|
251
|
+
if (editor) editorRef.current = editor;
|
|
252
|
+
},
|
|
253
|
+
initialValue: "<p>This is the initial content of the editor.</p>",
|
|
254
|
+
init: {
|
|
255
|
+
height: 500,
|
|
256
|
+
menubar: false,
|
|
257
|
+
plugins: [
|
|
258
|
+
"advlist",
|
|
259
|
+
"autolink",
|
|
260
|
+
"lists",
|
|
261
|
+
"link",
|
|
262
|
+
"image",
|
|
263
|
+
"charmap",
|
|
264
|
+
"preview",
|
|
265
|
+
"anchor",
|
|
266
|
+
"searchreplace",
|
|
267
|
+
"visualblocks",
|
|
268
|
+
"code",
|
|
269
|
+
"fullscreen",
|
|
270
|
+
"insertdatetime",
|
|
271
|
+
"media",
|
|
272
|
+
"table",
|
|
273
|
+
"code",
|
|
274
|
+
"help",
|
|
275
|
+
"wordcount"
|
|
276
|
+
],
|
|
277
|
+
toolbar: "undo redo | blocks | bold italic forecolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | help",
|
|
278
|
+
content_style: "body { font-family:Helvetica,Arial,sans-serif; font-size:14px }"
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
), /* @__PURE__ */ React8.createElement("button", { onClick: log }, "Log editor content"));
|
|
254
282
|
};
|
|
255
283
|
|
|
256
284
|
// src/Components/Select/SingleSelectElement.tsx
|
|
@@ -263,9 +291,7 @@ var filterOption = (input, option) => (option?.label ?? "").toLowerCase().includ
|
|
|
263
291
|
var SingleSelectElement = (props) => {
|
|
264
292
|
const handleChange = (values) => {
|
|
265
293
|
if (props.onChange) {
|
|
266
|
-
const option = props.dropDownOptions?.find(
|
|
267
|
-
(option2) => String(option2.title) === values
|
|
268
|
-
);
|
|
294
|
+
const option = props.dropDownOptions?.find((option2) => String(option2.title) === values);
|
|
269
295
|
const selectedOption = { id: option?.id, value: values };
|
|
270
296
|
props.onChange([selectedOption]);
|
|
271
297
|
}
|
|
@@ -279,11 +305,7 @@ var SingleSelectElement = (props) => {
|
|
|
279
305
|
onChange: handleChange,
|
|
280
306
|
onSearch,
|
|
281
307
|
filterOption,
|
|
282
|
-
options: props.dropDownOptions?.map((eachOption) => ({
|
|
283
|
-
label: String(eachOption.title),
|
|
284
|
-
value: String(eachOption.title),
|
|
285
|
-
id: String(eachOption.id)
|
|
286
|
-
}))
|
|
308
|
+
options: props.dropDownOptions?.map((eachOption) => ({ label: String(eachOption.title), value: String(eachOption.title), id: String(eachOption.id) }))
|
|
287
309
|
}
|
|
288
310
|
);
|
|
289
311
|
};
|
|
@@ -328,7 +350,7 @@ var ButtonElement = (props) => {
|
|
|
328
350
|
|
|
329
351
|
// src/Components/AddMoreTable.tsx
|
|
330
352
|
import React12, { useEffect, useState as useState4 } from "react";
|
|
331
|
-
import { Table, Button } from "antd";
|
|
353
|
+
import { Table, Button as Button2 } from "antd";
|
|
332
354
|
import { PlusOutlined, DeleteOutlined } from "@ant-design/icons";
|
|
333
355
|
var AddMoreTable = (props) => {
|
|
334
356
|
const { thead, tbody } = props;
|
|
@@ -423,13 +445,13 @@ var AddMoreTable = (props) => {
|
|
|
423
445
|
eachRow.variable_data.forEach((variable, subIndex) => {
|
|
424
446
|
Object.keys(variable).forEach((key) => {
|
|
425
447
|
if (key === "SubRows") {
|
|
426
|
-
rowData[`${key}`] = /* @__PURE__ */ React12.createElement("div", { key: subIndex }, eachRow.variable_data.length > 1 && /* @__PURE__ */ React12.createElement(
|
|
448
|
+
rowData[`${key}`] = /* @__PURE__ */ React12.createElement("div", { key: subIndex }, eachRow.variable_data.length > 1 && /* @__PURE__ */ React12.createElement(Button2, { onClick: () => onHandleSubRowsDelete(rowIndex, subIndex) }, /* @__PURE__ */ React12.createElement(DeleteOutlined, null)), subIndex === eachRow.variable_data.length - 1 && /* @__PURE__ */ React12.createElement(Button2, { onClick: () => onHandleSubRowsAdd(rowIndex) }, /* @__PURE__ */ React12.createElement(PlusOutlined, null)));
|
|
427
449
|
} else {
|
|
428
450
|
rowData[`${key}`] = renderInputElement(variable[key]);
|
|
429
451
|
}
|
|
430
452
|
});
|
|
431
453
|
});
|
|
432
|
-
rowData.actions = /* @__PURE__ */ React12.createElement("div", null, /* @__PURE__ */ React12.createElement(
|
|
454
|
+
rowData.actions = /* @__PURE__ */ React12.createElement("div", null, /* @__PURE__ */ React12.createElement(Button2, { onClick: () => onHandleDelete(eachRow.id) }, /* @__PURE__ */ React12.createElement(DeleteOutlined, null)), rowIndex === rows.length - 1 && /* @__PURE__ */ React12.createElement(Button2, { onClick: onHandleRows }, /* @__PURE__ */ React12.createElement(PlusOutlined, null)));
|
|
433
455
|
console.log("=====rowdata", rowData);
|
|
434
456
|
return rowData;
|
|
435
457
|
});
|
|
@@ -476,7 +498,7 @@ import React17 from "react";
|
|
|
476
498
|
|
|
477
499
|
// src/Components/Notification.tsx
|
|
478
500
|
import React14 from "react";
|
|
479
|
-
import { Popover, Badge, Button as
|
|
501
|
+
import { Popover, Badge, Button as Button3, Avatar, List } from "antd";
|
|
480
502
|
import { IoIosNotifications } from "react-icons/io";
|
|
481
503
|
var popoverContentStyle = {
|
|
482
504
|
minWidth: "300px",
|
|
@@ -504,7 +526,7 @@ var Notification = (props) => /* @__PURE__ */ React14.createElement(
|
|
|
504
526
|
trigger: "focus",
|
|
505
527
|
placement: "bottomRight"
|
|
506
528
|
},
|
|
507
|
-
/* @__PURE__ */ React14.createElement(
|
|
529
|
+
/* @__PURE__ */ React14.createElement(Button3, { className: props.buttonClassName }, /* @__PURE__ */ React14.createElement(Badge, { size: "small", count: props.count }, /* @__PURE__ */ React14.createElement("span", { className: props.iconsClassName }, /* @__PURE__ */ React14.createElement(IoIosNotifications, null))))
|
|
508
530
|
);
|
|
509
531
|
|
|
510
532
|
// src/Components/SpanElement.tsx
|
|
@@ -706,7 +728,7 @@ var DatePickerElement = (props) => {
|
|
|
706
728
|
|
|
707
729
|
// src/Components/DateRangePickerElement.tsx
|
|
708
730
|
import React22 from "react";
|
|
709
|
-
import { DatePicker as DatePicker2, Space } from "antd";
|
|
731
|
+
import { DatePicker as DatePicker2, Space as Space2 } from "antd";
|
|
710
732
|
import dayjs from "dayjs";
|
|
711
733
|
var DateRangePickerElement = (props) => {
|
|
712
734
|
const { RangePicker } = DatePicker2;
|
|
@@ -723,125 +745,33 @@ var DateRangePickerElement = (props) => {
|
|
|
723
745
|
{ label: "Last 30 Days", value: [dayjs().add(-30, "d"), dayjs()] },
|
|
724
746
|
{ label: "Last 90 Days", value: [dayjs().add(-90, "d"), dayjs()] }
|
|
725
747
|
];
|
|
726
|
-
return /* @__PURE__ */ React22.createElement(
|
|
748
|
+
return /* @__PURE__ */ React22.createElement(Space2, { direction: "vertical", size: 12 }, /* @__PURE__ */ React22.createElement(RangePicker, { presets: rangePresets, onChange: handleChange }));
|
|
727
749
|
};
|
|
728
750
|
|
|
729
|
-
// src/Components/
|
|
751
|
+
// src/Components/UploadElement.tsx
|
|
730
752
|
import React23 from "react";
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
};
|
|
744
|
-
return /* @__PURE__ */ React24.createElement(Checkbox2, { onChange: (e) => handleChange(e), className: props.className }, props.label);
|
|
745
|
-
};
|
|
746
|
-
|
|
747
|
-
// src/Components/MultiSelect.tsx
|
|
748
|
-
import React25, { useState as useState7 } from "react";
|
|
749
|
-
import { Select as Select4 } from "antd";
|
|
750
|
-
var MultiSelect = (props) => {
|
|
751
|
-
const [selectedValue, setSelectedValue] = useState7({ firstValue: {}, secondValue: {} });
|
|
752
|
-
const handleFirstChange = (value) => {
|
|
753
|
-
if (props.onChange) {
|
|
754
|
-
const filterOption2 = props.options && props.options.find((eachOption) => eachOption.value === value);
|
|
755
|
-
console.log("filterOption1--------", filterOption2);
|
|
756
|
-
setSelectedValue((prev) => ({ ...prev, firstValue: filterOption2 && filterOption2 }));
|
|
757
|
-
props.onChange(selectedValue.firstValue && selectedValue);
|
|
758
|
-
}
|
|
759
|
-
};
|
|
760
|
-
const handleSecondChange = (value) => {
|
|
761
|
-
if (props.onChange) {
|
|
762
|
-
const filterOption2 = props.options && props.options.find((eachOption) => eachOption.value === value);
|
|
763
|
-
console.log("filterOption2--------", filterOption2);
|
|
764
|
-
setSelectedValue((prev) => ({ ...prev, secondValue: filterOption2 && filterOption2 }));
|
|
765
|
-
props.onChange(selectedValue.secondValue && selectedValue);
|
|
766
|
-
}
|
|
767
|
-
};
|
|
768
|
-
return /* @__PURE__ */ React25.createElement("div", { className: props.className, style: { display: "flex", flexDirection: "row", backgroundColor: "white", borderRadius: 10, border: "1px solid gray", width: "100px" } }, /* @__PURE__ */ React25.createElement(
|
|
769
|
-
Select4,
|
|
770
|
-
{
|
|
771
|
-
onChange: handleFirstChange,
|
|
772
|
-
variant: props.variant,
|
|
773
|
-
options: props.options
|
|
774
|
-
}
|
|
775
|
-
), /* @__PURE__ */ React25.createElement("div", { style: { borderLeft: "1px solid gray", height: "33px" } }), /* @__PURE__ */ React25.createElement(
|
|
776
|
-
Select4,
|
|
777
|
-
{
|
|
778
|
-
onChange: handleSecondChange,
|
|
779
|
-
variant: props.variant,
|
|
780
|
-
options: props.options
|
|
781
|
-
}
|
|
782
|
-
));
|
|
783
|
-
};
|
|
784
|
-
|
|
785
|
-
// src/Components/FilesUpload.tsx
|
|
786
|
-
import React26, { useState as useState8 } from "react";
|
|
787
|
-
import { Upload, message } from "antd";
|
|
788
|
-
import { InboxOutlined } from "@ant-design/icons";
|
|
789
|
-
var FileUpload = (props) => {
|
|
790
|
-
const { Dragger } = Upload;
|
|
791
|
-
const [files, setFiles] = useState8([]);
|
|
792
|
-
const beforeUpload = (file) => {
|
|
793
|
-
const isCorrectFile = ["image/png", "image/jpg", "image/jpeg", "application/pdf"].includes(file.type);
|
|
794
|
-
if (!isCorrectFile) {
|
|
795
|
-
message.error(`(${file.name}) is an invalid file. Please upload files with the following extensions only (.png/.jpg/.jpeg/.pdf)`);
|
|
796
|
-
return Upload.LIST_IGNORE;
|
|
753
|
+
import { UploadOutlined } from "@ant-design/icons";
|
|
754
|
+
import { Button as Button4, message, Upload } from "antd";
|
|
755
|
+
var uploadProps = {
|
|
756
|
+
name: "file",
|
|
757
|
+
multiple: true,
|
|
758
|
+
action: "https://660d2bd96ddfa2943b33731c.mockapi.io/api/upload",
|
|
759
|
+
headers: {
|
|
760
|
+
authorization: "authorization-text"
|
|
761
|
+
},
|
|
762
|
+
onChange(info) {
|
|
763
|
+
if (info.file.status !== "uploading") {
|
|
764
|
+
console.log(info.file, info.fileList);
|
|
797
765
|
}
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
if (props.onChange) {
|
|
803
|
-
props.onChange({
|
|
804
|
-
name: props.name,
|
|
805
|
-
value: fileList
|
|
806
|
-
});
|
|
766
|
+
if (info.file.status === "done") {
|
|
767
|
+
message.success(`${info.file.name} file uploaded successfully`);
|
|
768
|
+
} else if (info.file.status === "error") {
|
|
769
|
+
message.error(`${info.file.name} file upload failed.`);
|
|
807
770
|
}
|
|
808
|
-
}
|
|
809
|
-
const customRequest = ({ file, onSuccess }) => {
|
|
810
|
-
setTimeout(() => {
|
|
811
|
-
onSuccess("ok");
|
|
812
|
-
}, 0);
|
|
813
|
-
};
|
|
814
|
-
return /* @__PURE__ */ React26.createElement("div", null, /* @__PURE__ */ React26.createElement(
|
|
815
|
-
Dragger,
|
|
816
|
-
{
|
|
817
|
-
action: "",
|
|
818
|
-
accept: props.accept,
|
|
819
|
-
listType: "picture",
|
|
820
|
-
maxCount: props.max_count,
|
|
821
|
-
multiple: true,
|
|
822
|
-
fileList: files,
|
|
823
|
-
beforeUpload,
|
|
824
|
-
onChange: handleChange,
|
|
825
|
-
showUploadList: true,
|
|
826
|
-
customRequest
|
|
827
|
-
},
|
|
828
|
-
/* @__PURE__ */ React26.createElement("p", null, /* @__PURE__ */ React26.createElement(InboxOutlined, null)),
|
|
829
|
-
/* @__PURE__ */ React26.createElement("p", null, "Click or drag file to upload")
|
|
830
|
-
));
|
|
771
|
+
}
|
|
831
772
|
};
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
import React27 from "react";
|
|
835
|
-
import { Tabs } from "antd";
|
|
836
|
-
var TabsElement = (props) => {
|
|
837
|
-
console.log(props);
|
|
838
|
-
const handleChange = (key) => {
|
|
839
|
-
if (props.onChange) {
|
|
840
|
-
props.onChange(props.options?.filter((eachOption) => eachOption.key === key));
|
|
841
|
-
}
|
|
842
|
-
console.log(key);
|
|
843
|
-
};
|
|
844
|
-
return /* @__PURE__ */ React27.createElement(Tabs, { defaultActiveKey: "1", items: props.options, onChange: handleChange });
|
|
773
|
+
var UploadElement = (props) => {
|
|
774
|
+
return /* @__PURE__ */ React23.createElement(Upload, { ...uploadProps }, /* @__PURE__ */ React23.createElement(Button4, { icon: /* @__PURE__ */ React23.createElement(UploadOutlined, null) }, "Click to Upload"));
|
|
845
775
|
};
|
|
846
776
|
export {
|
|
847
777
|
AddMoreTable,
|
|
@@ -850,9 +780,6 @@ export {
|
|
|
850
780
|
CkEditor,
|
|
851
781
|
DatePickerElement,
|
|
852
782
|
DateRangePickerElement,
|
|
853
|
-
FileUpload,
|
|
854
|
-
Image,
|
|
855
|
-
MultiSelect,
|
|
856
783
|
MultipleSelectElement,
|
|
857
784
|
Navbar,
|
|
858
785
|
NumberElement,
|
|
@@ -860,10 +787,9 @@ export {
|
|
|
860
787
|
RadioElement,
|
|
861
788
|
SelectElement,
|
|
862
789
|
Sidebar,
|
|
863
|
-
SingleCheckbox,
|
|
864
790
|
SingleSelectElement,
|
|
865
791
|
TableElement,
|
|
866
|
-
TabsElement,
|
|
867
792
|
TextElement,
|
|
868
|
-
TextareaElement
|
|
793
|
+
TextareaElement,
|
|
794
|
+
UploadElement
|
|
869
795
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apexcura/ui-components",
|
|
3
|
-
"version": "0.0.13-
|
|
3
|
+
"version": "0.0.13-Beta8",
|
|
4
4
|
"description": "Apex cura React components library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"apex cura",
|
|
@@ -48,7 +48,6 @@
|
|
|
48
48
|
"node": ">=18.0.0"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@apexcura/core": "^0.0.15-Beta34",
|
|
52
51
|
"@apexcura/ui-components": "^0.0.11-Beta256",
|
|
53
52
|
"@tinymce/tinymce-react": "^5.0.1",
|
|
54
53
|
"autoprefixer": "^10.4.19",
|