@apexcura/ui-components 0.0.13-Beta68 → 0.0.13-Beta7
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.css +0 -4
- package/dist/index.js +159 -285
- package/dist/index.mjs +114 -237
- package/package.json +1 -2
- package/dist/index.d.mts +0 -107
- package/dist/index.d.ts +0 -107
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,175 +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
751
|
// src/Components/UploadElement.tsx
|
|
730
|
-
import React23
|
|
731
|
-
import {
|
|
732
|
-
import {
|
|
733
|
-
var
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
console.log(newFileList);
|
|
744
|
-
for (let i = 0; i < fileList.length; i++) {
|
|
745
|
-
const selectedFile = fileList[i];
|
|
746
|
-
const isCorrectFile = ["image/png", "image/jpg", "image/jpeg"].includes(
|
|
747
|
-
selectedFile.type
|
|
748
|
-
);
|
|
749
|
-
if (!isCorrectFile) {
|
|
750
|
-
Modal2.error({
|
|
751
|
-
title: `(${selectedFile.name}) is an invalid file.`,
|
|
752
|
-
content: `Please upload files with the following extensions only (.png/.jpg/.jpeg)`,
|
|
753
|
-
zIndex: 1022
|
|
754
|
-
});
|
|
755
|
-
return;
|
|
756
|
-
}
|
|
757
|
-
const newFile = {
|
|
758
|
-
uid: `id${Math.random().toString(16).slice(2)}`,
|
|
759
|
-
name: selectedFile.name,
|
|
760
|
-
status: "done",
|
|
761
|
-
type: selectedFile.type,
|
|
762
|
-
size: selectedFile.size,
|
|
763
|
-
url: URL.createObjectURL(selectedFile),
|
|
764
|
-
originFileObj: selectedFile
|
|
765
|
-
};
|
|
766
|
-
const reader = new FileReader();
|
|
767
|
-
reader.onload = (e) => {
|
|
768
|
-
if (e.target?.result) {
|
|
769
|
-
newFile.thumbUrl = e.target.result.toString();
|
|
770
|
-
}
|
|
771
|
-
};
|
|
772
|
-
reader.readAsDataURL(selectedFile);
|
|
773
|
-
newFileList.push(newFile);
|
|
774
|
-
}
|
|
775
|
-
setFiles(newFileList);
|
|
776
|
-
props.onChange && props.onChange({
|
|
777
|
-
name: props.name,
|
|
778
|
-
value: newFileList
|
|
779
|
-
});
|
|
780
|
-
};
|
|
781
|
-
const handleCancel = () => {
|
|
782
|
-
setPreviewImage(null);
|
|
783
|
-
setPreviewType(null);
|
|
784
|
-
setPreviewOpen(false);
|
|
785
|
-
setPreviewTitle(null);
|
|
786
|
-
};
|
|
787
|
-
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(
|
|
788
|
-
"input",
|
|
789
|
-
{
|
|
790
|
-
id: "upload",
|
|
791
|
-
type: "file",
|
|
792
|
-
accept: "image/*;capture=camera",
|
|
793
|
-
multiple: true,
|
|
794
|
-
onChange: (e) => uploadChange(e.target.files)
|
|
752
|
+
import React23 from "react";
|
|
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);
|
|
795
765
|
}
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
props.list_type === "picture" && /* @__PURE__ */ React23.createElement(Button3, { icon: /* @__PURE__ */ React23.createElement(UploadOutlined, null) }, props.feildData.max_count ? `Upload (Max:${props.max_count})` : "Upload")
|
|
801
|
-
), props.errors && props.errors.length > 0 && props.errors.map(
|
|
802
|
-
(error, eKey) => /* @__PURE__ */ React23.createElement("small", { key: eKey, className: "text-danger animated flash" }, error.message)
|
|
803
|
-
), /* @__PURE__ */ React23.createElement(
|
|
804
|
-
Modal2,
|
|
805
|
-
{
|
|
806
|
-
open: previewOpen,
|
|
807
|
-
width: "100%",
|
|
808
|
-
zIndex: 1025,
|
|
809
|
-
centered: true,
|
|
810
|
-
maskClosable: false,
|
|
811
|
-
title: previewTitle,
|
|
812
|
-
footer: null,
|
|
813
|
-
onCancel: handleCancel,
|
|
814
|
-
destroyOnClose: true
|
|
815
|
-
},
|
|
816
|
-
/* @__PURE__ */ React23.createElement(Tooltip, { title: "Close", placement: "bottom" }, /* @__PURE__ */ React23.createElement(
|
|
817
|
-
CloseOutlined,
|
|
818
|
-
{
|
|
819
|
-
className: "border popup-close",
|
|
820
|
-
onClick: handleCancel
|
|
821
|
-
}
|
|
822
|
-
)),
|
|
823
|
-
previewType === "application/pdf" || previewType === "pdf" ? /* @__PURE__ */ React23.createElement(
|
|
824
|
-
"iframe",
|
|
825
|
-
{
|
|
826
|
-
title: "document",
|
|
827
|
-
style: { width: "95vw", height: "40vw" },
|
|
828
|
-
src: `${previewImage}#toolbar=0`
|
|
829
|
-
}
|
|
830
|
-
) : /* @__PURE__ */ React23.createElement(
|
|
831
|
-
"img",
|
|
832
|
-
{
|
|
833
|
-
alt: "image",
|
|
834
|
-
src: previewImage || void 0,
|
|
835
|
-
className: "d-flex mx-auto w-100"
|
|
836
|
-
}
|
|
837
|
-
)
|
|
838
|
-
)));
|
|
839
|
-
};
|
|
840
|
-
|
|
841
|
-
// src/Components/Image.tsx
|
|
842
|
-
import React24 from "react";
|
|
843
|
-
var Image = (props) => {
|
|
844
|
-
return /* @__PURE__ */ React24.createElement("div", null, /* @__PURE__ */ React24.createElement("img", { className: props.className, src: props.img, alt: "image" }));
|
|
845
|
-
};
|
|
846
|
-
|
|
847
|
-
// src/Components/SingleCheckbox.tsx
|
|
848
|
-
import React25 from "react";
|
|
849
|
-
import { Checkbox as Checkbox2 } from "antd";
|
|
850
|
-
var SingleCheckbox = (props) => {
|
|
851
|
-
const handleChange = (e) => {
|
|
852
|
-
if (props.onChange) {
|
|
853
|
-
props.onChange(e.target.checked);
|
|
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.`);
|
|
854
770
|
}
|
|
855
|
-
}
|
|
856
|
-
return /* @__PURE__ */ React25.createElement(Checkbox2, { onChange: (e) => handleChange(e), className: props.className }, props.label);
|
|
771
|
+
}
|
|
857
772
|
};
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
import React26, { useState as useState8 } from "react";
|
|
861
|
-
import { Select as Select4 } from "antd";
|
|
862
|
-
var MultiSelect = (props) => {
|
|
863
|
-
const [selectedValue, setSelectedValue] = useState8({ firstValue: {}, secondValue: {} });
|
|
864
|
-
const handleFirstChange = (value) => {
|
|
865
|
-
if (props.onChange) {
|
|
866
|
-
const filterOption2 = props.options && props.options.find((eachOption) => eachOption.value === value);
|
|
867
|
-
console.log("filterOption1--------", filterOption2);
|
|
868
|
-
setSelectedValue((prev) => ({ ...prev, firstValue: filterOption2 && filterOption2 }));
|
|
869
|
-
props.onChange(selectedValue.firstValue && selectedValue);
|
|
870
|
-
}
|
|
871
|
-
};
|
|
872
|
-
const handleSecondChange = (value) => {
|
|
873
|
-
if (props.onChange) {
|
|
874
|
-
const filterOption2 = props.options && props.options.find((eachOption) => eachOption.value === value);
|
|
875
|
-
console.log("filterOption2--------", filterOption2);
|
|
876
|
-
setSelectedValue((prev) => ({ ...prev, secondValue: filterOption2 && filterOption2 }));
|
|
877
|
-
props.onChange(selectedValue.secondValue && selectedValue);
|
|
878
|
-
}
|
|
879
|
-
};
|
|
880
|
-
return /* @__PURE__ */ React26.createElement("div", { className: props.className, style: { display: "flex", flexDirection: "row", backgroundColor: "white", borderRadius: 10, border: "1px solid gray", width: "100px" } }, /* @__PURE__ */ React26.createElement(
|
|
881
|
-
Select4,
|
|
882
|
-
{
|
|
883
|
-
onChange: handleFirstChange,
|
|
884
|
-
variant: props.variant,
|
|
885
|
-
options: props.options
|
|
886
|
-
}
|
|
887
|
-
), /* @__PURE__ */ React26.createElement("div", { style: { borderLeft: "1px solid gray", height: "33px" } }), /* @__PURE__ */ React26.createElement(
|
|
888
|
-
Select4,
|
|
889
|
-
{
|
|
890
|
-
onChange: handleSecondChange,
|
|
891
|
-
variant: props.variant,
|
|
892
|
-
options: props.options
|
|
893
|
-
}
|
|
894
|
-
));
|
|
773
|
+
var UploadElement = (props) => {
|
|
774
|
+
return /* @__PURE__ */ React23.createElement(Upload, { ...uploadProps }, /* @__PURE__ */ React23.createElement(Button4, { icon: /* @__PURE__ */ React23.createElement(UploadOutlined, null) }, "Click to Upload"));
|
|
895
775
|
};
|
|
896
776
|
export {
|
|
897
777
|
AddMoreTable,
|
|
@@ -900,8 +780,6 @@ export {
|
|
|
900
780
|
CkEditor,
|
|
901
781
|
DatePickerElement,
|
|
902
782
|
DateRangePickerElement,
|
|
903
|
-
Image,
|
|
904
|
-
MultiSelect,
|
|
905
783
|
MultipleSelectElement,
|
|
906
784
|
Navbar,
|
|
907
785
|
NumberElement,
|
|
@@ -909,7 +787,6 @@ export {
|
|
|
909
787
|
RadioElement,
|
|
910
788
|
SelectElement,
|
|
911
789
|
Sidebar,
|
|
912
|
-
SingleCheckbox,
|
|
913
790
|
SingleSelectElement,
|
|
914
791
|
TableElement,
|
|
915
792
|
TextElement,
|
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-Beta7",
|
|
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",
|
package/dist/index.d.mts
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import React$1 from 'react';
|
|
2
|
-
import { SizeType } from 'antd/es/config-provider/SizeContext';
|
|
3
|
-
import { UploadFile } from 'antd/lib/upload/interface';
|
|
4
|
-
|
|
5
|
-
type ElementType = {
|
|
6
|
-
[x: string]: any;
|
|
7
|
-
selectedStyle: boolean;
|
|
8
|
-
style: boolean;
|
|
9
|
-
className: string | undefined;
|
|
10
|
-
placeholder?: string;
|
|
11
|
-
addonBefore?: React.ReactNode;
|
|
12
|
-
defaultValue?: string;
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
prefix?: React.ReactNode;
|
|
15
|
-
type?: string;
|
|
16
|
-
size?: SizeType;
|
|
17
|
-
value?: string | number | boolean | any[] | null | object | undefined | any | UploadFile<any>[];
|
|
18
|
-
status?: "error" | "warning";
|
|
19
|
-
styles?: React.CSSProperties;
|
|
20
|
-
variant?: "outlined" | "borderless" | "filled";
|
|
21
|
-
label?: string;
|
|
22
|
-
name?: string;
|
|
23
|
-
suffix?: React.ReactNode;
|
|
24
|
-
maxLength?: number;
|
|
25
|
-
fieldNames?: any[];
|
|
26
|
-
fields?: any[];
|
|
27
|
-
schema?: any[];
|
|
28
|
-
options?: any[];
|
|
29
|
-
onChange?: (value: string | number | boolean | object | any[] | undefined) => void;
|
|
30
|
-
onClick?: () => void;
|
|
31
|
-
dropDownOptions?: any[];
|
|
32
|
-
id?: number;
|
|
33
|
-
thead?: any[];
|
|
34
|
-
tbody?: any[];
|
|
35
|
-
variable_data?: any[];
|
|
36
|
-
optionType?: string;
|
|
37
|
-
selectedClassName?: string;
|
|
38
|
-
action?: React.MouseEventHandler<HTMLElement> | string;
|
|
39
|
-
listClassName?: string;
|
|
40
|
-
listItemClassName?: string;
|
|
41
|
-
img?: string;
|
|
42
|
-
items?: any[];
|
|
43
|
-
primaryText?: string;
|
|
44
|
-
secondaryText?: string;
|
|
45
|
-
count?: number;
|
|
46
|
-
icon?: string;
|
|
47
|
-
placement?: string;
|
|
48
|
-
profileImage?: string;
|
|
49
|
-
buttonClassName?: string;
|
|
50
|
-
profileImageClassName?: string;
|
|
51
|
-
profileSubClassName?: string;
|
|
52
|
-
subContainerClassName?: string;
|
|
53
|
-
element?: string;
|
|
54
|
-
secondTextClassName?: string;
|
|
55
|
-
iconsClassName?: string;
|
|
56
|
-
labelClassName?: string;
|
|
57
|
-
containerClassName?: string;
|
|
58
|
-
selectBefore?: any[];
|
|
59
|
-
selectAfter?: any[];
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
declare const TextElement: (props: ElementType) => React$1.JSX.Element;
|
|
63
|
-
|
|
64
|
-
declare const PasswordElement: (props: ElementType) => React$1.JSX.Element;
|
|
65
|
-
|
|
66
|
-
declare const NumberElement: (props: ElementType) => React$1.JSX.Element;
|
|
67
|
-
|
|
68
|
-
declare const TextareaElement: (props: ElementType) => React$1.JSX.Element;
|
|
69
|
-
|
|
70
|
-
declare const SelectElement: (props: ElementType) => React$1.JSX.Element;
|
|
71
|
-
|
|
72
|
-
declare const RadioElement: (props: ElementType) => React$1.JSX.Element;
|
|
73
|
-
|
|
74
|
-
declare const CheckboxElement: (props: ElementType) => React$1.JSX.Element;
|
|
75
|
-
|
|
76
|
-
interface ElementExecuterProps extends ElementType {
|
|
77
|
-
onChange: (value: string | number | object | boolean | any[] | undefined) => void;
|
|
78
|
-
}
|
|
79
|
-
declare const CkEditor: (props: ElementExecuterProps) => React$1.JSX.Element;
|
|
80
|
-
|
|
81
|
-
declare const SingleSelectElement: (props: ElementType) => React$1.JSX.Element;
|
|
82
|
-
|
|
83
|
-
declare const MultipleSelectElement: (props: ElementType) => React$1.JSX.Element;
|
|
84
|
-
|
|
85
|
-
declare const ButtonElement: React$1.FC<ElementType>;
|
|
86
|
-
|
|
87
|
-
declare const AddMoreTable: (props: ElementType) => React$1.JSX.Element;
|
|
88
|
-
|
|
89
|
-
declare const Sidebar: (props: ElementType) => React$1.JSX.Element;
|
|
90
|
-
|
|
91
|
-
declare const Navbar: (props: ElementType) => React$1.JSX.Element;
|
|
92
|
-
|
|
93
|
-
declare const TableElement: (props: ElementType) => React$1.JSX.Element;
|
|
94
|
-
|
|
95
|
-
declare const DatePickerElement: (props: ElementType) => React$1.JSX.Element;
|
|
96
|
-
|
|
97
|
-
declare const DateRangePickerElement: (props: ElementType) => React$1.JSX.Element;
|
|
98
|
-
|
|
99
|
-
declare const UploadElement: (props: ElementType) => React$1.JSX.Element;
|
|
100
|
-
|
|
101
|
-
declare const Image: (props: ElementType) => React$1.JSX.Element;
|
|
102
|
-
|
|
103
|
-
declare const SingleCheckbox: (props: ElementType) => React$1.JSX.Element;
|
|
104
|
-
|
|
105
|
-
declare const MultiSelect: (props: ElementType) => React$1.JSX.Element;
|
|
106
|
-
|
|
107
|
-
export { AddMoreTable, ButtonElement, CheckboxElement, CkEditor, DatePickerElement, DateRangePickerElement, Image, MultiSelect, MultipleSelectElement, Navbar, NumberElement, PasswordElement, RadioElement, SelectElement, Sidebar, SingleCheckbox, SingleSelectElement, TableElement, TextElement, TextareaElement, UploadElement };
|