@apexcura/ui-components 0.0.13-Beta21 → 0.0.13-Beta22
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 +3 -12
- package/dist/index.d.ts +3 -12
- package/dist/index.js +34 -7
- package/dist/index.mjs +42 -15
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -56,22 +56,13 @@ type ElementType = {
|
|
|
56
56
|
containerClassName?: string;
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
onChange: (value: string | number | boolean | object | any[] | undefined) => void;
|
|
61
|
-
}
|
|
62
|
-
declare const TextElement: (props: ElementExecuterProps$3) => React$1.JSX.Element;
|
|
59
|
+
declare const TextElement: (props: ElementType) => React$1.JSX.Element;
|
|
63
60
|
|
|
64
61
|
declare const PasswordElement: (props: ElementType) => React$1.JSX.Element;
|
|
65
62
|
|
|
66
|
-
|
|
67
|
-
onChange: (value: string | number | object | boolean | any[] | undefined) => void;
|
|
68
|
-
}
|
|
69
|
-
declare const NumberElement: (props: ElementExecuterProps$2) => React$1.JSX.Element;
|
|
63
|
+
declare const NumberElement: (props: ElementType) => React$1.JSX.Element;
|
|
70
64
|
|
|
71
|
-
|
|
72
|
-
onChange: (value: string | number | boolean | object | any[] | undefined) => void;
|
|
73
|
-
}
|
|
74
|
-
declare const TextareaElement: (props: ElementExecuterProps$1) => React$1.JSX.Element;
|
|
65
|
+
declare const TextareaElement: (props: ElementType) => React$1.JSX.Element;
|
|
75
66
|
|
|
76
67
|
declare const SelectElement: (props: ElementType) => React$1.JSX.Element;
|
|
77
68
|
|
package/dist/index.d.ts
CHANGED
|
@@ -56,22 +56,13 @@ type ElementType = {
|
|
|
56
56
|
containerClassName?: string;
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
onChange: (value: string | number | boolean | object | any[] | undefined) => void;
|
|
61
|
-
}
|
|
62
|
-
declare const TextElement: (props: ElementExecuterProps$3) => React$1.JSX.Element;
|
|
59
|
+
declare const TextElement: (props: ElementType) => React$1.JSX.Element;
|
|
63
60
|
|
|
64
61
|
declare const PasswordElement: (props: ElementType) => React$1.JSX.Element;
|
|
65
62
|
|
|
66
|
-
|
|
67
|
-
onChange: (value: string | number | object | boolean | any[] | undefined) => void;
|
|
68
|
-
}
|
|
69
|
-
declare const NumberElement: (props: ElementExecuterProps$2) => React$1.JSX.Element;
|
|
63
|
+
declare const NumberElement: (props: ElementType) => React$1.JSX.Element;
|
|
70
64
|
|
|
71
|
-
|
|
72
|
-
onChange: (value: string | number | boolean | object | any[] | undefined) => void;
|
|
73
|
-
}
|
|
74
|
-
declare const TextareaElement: (props: ElementExecuterProps$1) => React$1.JSX.Element;
|
|
65
|
+
declare const TextareaElement: (props: ElementType) => React$1.JSX.Element;
|
|
75
66
|
|
|
76
67
|
declare const SelectElement: (props: ElementType) => React$1.JSX.Element;
|
|
77
68
|
|
package/dist/index.js
CHANGED
|
@@ -56,7 +56,12 @@ module.exports = __toCommonJS(src_exports);
|
|
|
56
56
|
var import_react = __toESM(require("react"));
|
|
57
57
|
var import_antd = require("antd");
|
|
58
58
|
var TextElement = (props) => {
|
|
59
|
-
|
|
59
|
+
const handleChange = (e) => {
|
|
60
|
+
if (props.onChange) {
|
|
61
|
+
props.onChange(e.target.value);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
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(
|
|
60
65
|
import_antd.Input,
|
|
61
66
|
{
|
|
62
67
|
placeholder: props.placeholder,
|
|
@@ -72,7 +77,9 @@ var TextElement = (props) => {
|
|
|
72
77
|
className: props.className,
|
|
73
78
|
variant: props.variant,
|
|
74
79
|
name: props.name,
|
|
75
|
-
onChange: (e) =>
|
|
80
|
+
onChange: (e) => {
|
|
81
|
+
handleChange(e);
|
|
82
|
+
}
|
|
76
83
|
}
|
|
77
84
|
));
|
|
78
85
|
};
|
|
@@ -86,6 +93,11 @@ var PasswordElement = (props) => {
|
|
|
86
93
|
const handleVisibilityToggle = () => {
|
|
87
94
|
setPasswordVisible((prev) => !prev);
|
|
88
95
|
};
|
|
96
|
+
const handleChange = (e) => {
|
|
97
|
+
if (props.onChange) {
|
|
98
|
+
props.onChange(e.target.value);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
89
101
|
const renderVisibilityIcon = (visible) => visible ? /* @__PURE__ */ import_react2.default.createElement(import_icons.EyeTwoTone, null) : /* @__PURE__ */ import_react2.default.createElement(import_icons.EyeInvisibleOutlined, null);
|
|
90
102
|
const renderPasswordInput = () => /* @__PURE__ */ import_react2.default.createElement(
|
|
91
103
|
import_antd2.Input.Password,
|
|
@@ -93,21 +105,27 @@ var PasswordElement = (props) => {
|
|
|
93
105
|
placeholder: props.placeholder,
|
|
94
106
|
prefix: props.prefix,
|
|
95
107
|
addonBefore: props.addonBefore,
|
|
108
|
+
className: props.className,
|
|
96
109
|
type: props.type,
|
|
110
|
+
onChange: (e) => {
|
|
111
|
+
handleChange(e);
|
|
112
|
+
},
|
|
97
113
|
iconRender: renderVisibilityIcon,
|
|
98
114
|
visibilityToggle: { visible: passwordVisible, onVisibleChange: handleVisibilityToggle }
|
|
99
115
|
}
|
|
100
116
|
);
|
|
101
|
-
return /* @__PURE__ */ import_react2.default.createElement(import_antd2.Space,
|
|
117
|
+
return /* @__PURE__ */ import_react2.default.createElement(import_antd2.Space, null, /* @__PURE__ */ import_react2.default.createElement("label", null, props.label), renderPasswordInput());
|
|
102
118
|
};
|
|
103
119
|
|
|
104
120
|
// src/Components/NumberElement.tsx
|
|
105
121
|
var import_react3 = __toESM(require("react"));
|
|
106
122
|
var import_antd3 = require("antd");
|
|
107
123
|
var NumberElement = (props) => {
|
|
108
|
-
const
|
|
124
|
+
const handleChange = (e) => {
|
|
109
125
|
const newValue = e.target.value.replace(/[^0-9]/g, "");
|
|
110
|
-
props.onChange
|
|
126
|
+
if (props.onChange) {
|
|
127
|
+
props.onChange(newValue);
|
|
128
|
+
}
|
|
111
129
|
};
|
|
112
130
|
return /* @__PURE__ */ import_react3.default.createElement(
|
|
113
131
|
import_antd3.Input,
|
|
@@ -124,7 +142,9 @@ var NumberElement = (props) => {
|
|
|
124
142
|
className: props.className,
|
|
125
143
|
variant: props.variant,
|
|
126
144
|
name: props.name,
|
|
127
|
-
onChange:
|
|
145
|
+
onChange: (e) => {
|
|
146
|
+
handleChange(e);
|
|
147
|
+
}
|
|
128
148
|
}
|
|
129
149
|
);
|
|
130
150
|
};
|
|
@@ -134,6 +154,11 @@ var import_react4 = __toESM(require("react"));
|
|
|
134
154
|
var import_antd4 = require("antd");
|
|
135
155
|
var { TextArea } = import_antd4.Input;
|
|
136
156
|
var TextareaElement = (props) => {
|
|
157
|
+
const handleChange = (e) => {
|
|
158
|
+
if (props.onChange) {
|
|
159
|
+
props.onChange(e.target.value);
|
|
160
|
+
}
|
|
161
|
+
};
|
|
137
162
|
return /* @__PURE__ */ import_react4.default.createElement(import_antd4.Flex, null, /* @__PURE__ */ import_react4.default.createElement(
|
|
138
163
|
TextArea,
|
|
139
164
|
{
|
|
@@ -148,7 +173,9 @@ var TextareaElement = (props) => {
|
|
|
148
173
|
name: props.name,
|
|
149
174
|
showCount: true,
|
|
150
175
|
maxLength: props.maxLength,
|
|
151
|
-
onChange: (e) =>
|
|
176
|
+
onChange: (e) => {
|
|
177
|
+
handleChange(e);
|
|
178
|
+
}
|
|
152
179
|
}
|
|
153
180
|
));
|
|
154
181
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,12 @@
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { Input as AntInput } from "antd";
|
|
4
4
|
var TextElement = (props) => {
|
|
5
|
-
|
|
5
|
+
const handleChange = (e) => {
|
|
6
|
+
if (props.onChange) {
|
|
7
|
+
props.onChange(e.target.value);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, props.label && /* @__PURE__ */ React.createElement("label", { htmlFor: props.name }, props.label), /* @__PURE__ */ React.createElement(
|
|
6
11
|
AntInput,
|
|
7
12
|
{
|
|
8
13
|
placeholder: props.placeholder,
|
|
@@ -18,7 +23,9 @@ var TextElement = (props) => {
|
|
|
18
23
|
className: props.className,
|
|
19
24
|
variant: props.variant,
|
|
20
25
|
name: props.name,
|
|
21
|
-
onChange: (e) =>
|
|
26
|
+
onChange: (e) => {
|
|
27
|
+
handleChange(e);
|
|
28
|
+
}
|
|
22
29
|
}
|
|
23
30
|
));
|
|
24
31
|
};
|
|
@@ -26,12 +33,17 @@ var TextElement = (props) => {
|
|
|
26
33
|
// src/Components/PasswordElement.tsx
|
|
27
34
|
import React2, { useState } from "react";
|
|
28
35
|
import { EyeInvisibleOutlined, EyeTwoTone } from "@ant-design/icons";
|
|
29
|
-
import {
|
|
36
|
+
import { Input, Space } from "antd";
|
|
30
37
|
var PasswordElement = (props) => {
|
|
31
38
|
const [passwordVisible, setPasswordVisible] = useState(false);
|
|
32
39
|
const handleVisibilityToggle = () => {
|
|
33
40
|
setPasswordVisible((prev) => !prev);
|
|
34
41
|
};
|
|
42
|
+
const handleChange = (e) => {
|
|
43
|
+
if (props.onChange) {
|
|
44
|
+
props.onChange(e.target.value);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
35
47
|
const renderVisibilityIcon = (visible) => visible ? /* @__PURE__ */ React2.createElement(EyeTwoTone, null) : /* @__PURE__ */ React2.createElement(EyeInvisibleOutlined, null);
|
|
36
48
|
const renderPasswordInput = () => /* @__PURE__ */ React2.createElement(
|
|
37
49
|
Input.Password,
|
|
@@ -39,21 +51,27 @@ var PasswordElement = (props) => {
|
|
|
39
51
|
placeholder: props.placeholder,
|
|
40
52
|
prefix: props.prefix,
|
|
41
53
|
addonBefore: props.addonBefore,
|
|
54
|
+
className: props.className,
|
|
42
55
|
type: props.type,
|
|
56
|
+
onChange: (e) => {
|
|
57
|
+
handleChange(e);
|
|
58
|
+
},
|
|
43
59
|
iconRender: renderVisibilityIcon,
|
|
44
60
|
visibilityToggle: { visible: passwordVisible, onVisibleChange: handleVisibilityToggle }
|
|
45
61
|
}
|
|
46
62
|
);
|
|
47
|
-
return /* @__PURE__ */ React2.createElement(Space,
|
|
63
|
+
return /* @__PURE__ */ React2.createElement(Space, null, /* @__PURE__ */ React2.createElement("label", null, props.label), renderPasswordInput());
|
|
48
64
|
};
|
|
49
65
|
|
|
50
66
|
// src/Components/NumberElement.tsx
|
|
51
67
|
import React3 from "react";
|
|
52
68
|
import { Input as AntInput2 } from "antd";
|
|
53
69
|
var NumberElement = (props) => {
|
|
54
|
-
const
|
|
70
|
+
const handleChange = (e) => {
|
|
55
71
|
const newValue = e.target.value.replace(/[^0-9]/g, "");
|
|
56
|
-
props.onChange
|
|
72
|
+
if (props.onChange) {
|
|
73
|
+
props.onChange(newValue);
|
|
74
|
+
}
|
|
57
75
|
};
|
|
58
76
|
return /* @__PURE__ */ React3.createElement(
|
|
59
77
|
AntInput2,
|
|
@@ -70,7 +88,9 @@ var NumberElement = (props) => {
|
|
|
70
88
|
className: props.className,
|
|
71
89
|
variant: props.variant,
|
|
72
90
|
name: props.name,
|
|
73
|
-
onChange:
|
|
91
|
+
onChange: (e) => {
|
|
92
|
+
handleChange(e);
|
|
93
|
+
}
|
|
74
94
|
}
|
|
75
95
|
);
|
|
76
96
|
};
|
|
@@ -80,6 +100,11 @@ import React4 from "react";
|
|
|
80
100
|
import { Flex, Input as Input2 } from "antd";
|
|
81
101
|
var { TextArea } = Input2;
|
|
82
102
|
var TextareaElement = (props) => {
|
|
103
|
+
const handleChange = (e) => {
|
|
104
|
+
if (props.onChange) {
|
|
105
|
+
props.onChange(e.target.value);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
83
108
|
return /* @__PURE__ */ React4.createElement(Flex, null, /* @__PURE__ */ React4.createElement(
|
|
84
109
|
TextArea,
|
|
85
110
|
{
|
|
@@ -94,7 +119,9 @@ var TextareaElement = (props) => {
|
|
|
94
119
|
name: props.name,
|
|
95
120
|
showCount: true,
|
|
96
121
|
maxLength: props.maxLength,
|
|
97
|
-
onChange: (e) =>
|
|
122
|
+
onChange: (e) => {
|
|
123
|
+
handleChange(e);
|
|
124
|
+
}
|
|
98
125
|
}
|
|
99
126
|
));
|
|
100
127
|
};
|
|
@@ -347,7 +374,7 @@ var ButtonElement = (props) => {
|
|
|
347
374
|
|
|
348
375
|
// src/Components/AddMoreTable.tsx
|
|
349
376
|
import React12, { useEffect, useState as useState4 } from "react";
|
|
350
|
-
import { Table, Button
|
|
377
|
+
import { Table, Button } from "antd";
|
|
351
378
|
import { PlusOutlined, DeleteOutlined } from "@ant-design/icons";
|
|
352
379
|
var AddMoreTable = (props) => {
|
|
353
380
|
const { thead, tbody } = props;
|
|
@@ -442,13 +469,13 @@ var AddMoreTable = (props) => {
|
|
|
442
469
|
eachRow.variable_data.forEach((variable, subIndex) => {
|
|
443
470
|
Object.keys(variable).forEach((key) => {
|
|
444
471
|
if (key === "SubRows") {
|
|
445
|
-
rowData[`${key}`] = /* @__PURE__ */ React12.createElement("div", { key: subIndex }, eachRow.variable_data.length > 1 && /* @__PURE__ */ React12.createElement(
|
|
472
|
+
rowData[`${key}`] = /* @__PURE__ */ React12.createElement("div", { key: subIndex }, eachRow.variable_data.length > 1 && /* @__PURE__ */ React12.createElement(Button, { onClick: () => onHandleSubRowsDelete(rowIndex, subIndex) }, /* @__PURE__ */ React12.createElement(DeleteOutlined, null)), subIndex === eachRow.variable_data.length - 1 && /* @__PURE__ */ React12.createElement(Button, { onClick: () => onHandleSubRowsAdd(rowIndex) }, /* @__PURE__ */ React12.createElement(PlusOutlined, null)));
|
|
446
473
|
} else {
|
|
447
474
|
rowData[`${key}`] = renderInputElement(variable[key]);
|
|
448
475
|
}
|
|
449
476
|
});
|
|
450
477
|
});
|
|
451
|
-
rowData.actions = /* @__PURE__ */ React12.createElement("div", null, /* @__PURE__ */ React12.createElement(
|
|
478
|
+
rowData.actions = /* @__PURE__ */ React12.createElement("div", null, /* @__PURE__ */ React12.createElement(Button, { onClick: () => onHandleDelete(eachRow.id) }, /* @__PURE__ */ React12.createElement(DeleteOutlined, null)), rowIndex === rows.length - 1 && /* @__PURE__ */ React12.createElement(Button, { onClick: onHandleRows }, /* @__PURE__ */ React12.createElement(PlusOutlined, null)));
|
|
452
479
|
console.log("=====rowdata", rowData);
|
|
453
480
|
return rowData;
|
|
454
481
|
});
|
|
@@ -495,7 +522,7 @@ import React17 from "react";
|
|
|
495
522
|
|
|
496
523
|
// src/Components/Notification.tsx
|
|
497
524
|
import React14 from "react";
|
|
498
|
-
import { Popover, Badge, Button as
|
|
525
|
+
import { Popover, Badge, Button as Button2, Avatar, List } from "antd";
|
|
499
526
|
import { IoIosNotifications } from "react-icons/io";
|
|
500
527
|
var popoverContentStyle = {
|
|
501
528
|
minWidth: "300px",
|
|
@@ -523,7 +550,7 @@ var Notification = (props) => /* @__PURE__ */ React14.createElement(
|
|
|
523
550
|
trigger: "focus",
|
|
524
551
|
placement: "bottomRight"
|
|
525
552
|
},
|
|
526
|
-
/* @__PURE__ */ React14.createElement(
|
|
553
|
+
/* @__PURE__ */ React14.createElement(Button2, { className: props.buttonClassName }, /* @__PURE__ */ React14.createElement(Badge, { size: "small", count: props.count }, /* @__PURE__ */ React14.createElement("span", { className: props.iconsClassName }, /* @__PURE__ */ React14.createElement(IoIosNotifications, null))))
|
|
527
554
|
);
|
|
528
555
|
|
|
529
556
|
// src/Components/SpanElement.tsx
|
|
@@ -748,7 +775,7 @@ var DateRangePickerElement = (props) => {
|
|
|
748
775
|
// src/Components/UploadElement.tsx
|
|
749
776
|
import React23 from "react";
|
|
750
777
|
import { UploadOutlined } from "@ant-design/icons";
|
|
751
|
-
import { Button as
|
|
778
|
+
import { Button as Button3, message, Upload } from "antd";
|
|
752
779
|
var uploadProps = {
|
|
753
780
|
name: "file",
|
|
754
781
|
multiple: true,
|
|
@@ -768,7 +795,7 @@ var uploadProps = {
|
|
|
768
795
|
}
|
|
769
796
|
};
|
|
770
797
|
var UploadElement = (props) => {
|
|
771
|
-
return /* @__PURE__ */ React23.createElement(Upload, { ...uploadProps }, /* @__PURE__ */ React23.createElement(
|
|
798
|
+
return /* @__PURE__ */ React23.createElement(Upload, { ...uploadProps }, /* @__PURE__ */ React23.createElement(Button3, { icon: /* @__PURE__ */ React23.createElement(UploadOutlined, null) }, "Click to Upload"));
|
|
772
799
|
};
|
|
773
800
|
|
|
774
801
|
// src/Components/Image.tsx
|