@apexcura/ui-components 0.0.13-Beta28 → 0.0.13-Beta3
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 -17
- package/dist/index.d.ts +26 -17
- package/dist/index.js +51 -167
- package/dist/index.mjs +59 -171
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -25,7 +25,7 @@ type ElementType = {
|
|
|
25
25
|
fields?: any[];
|
|
26
26
|
schema?: any[];
|
|
27
27
|
options?: any[];
|
|
28
|
-
onChange?: (value: string | number | boolean | object | any[]
|
|
28
|
+
onChange?: (value: string | number | boolean | object | any[]) => void;
|
|
29
29
|
onClick?: () => void;
|
|
30
30
|
dropDownOptions?: any[];
|
|
31
31
|
id?: number;
|
|
@@ -54,17 +54,34 @@ type ElementType = {
|
|
|
54
54
|
iconsClassName?: string;
|
|
55
55
|
labelClassName?: string;
|
|
56
56
|
containerClassName?: string;
|
|
57
|
-
selectBefore?: any[];
|
|
58
|
-
selectAfter?: any[];
|
|
59
57
|
};
|
|
60
58
|
|
|
61
|
-
|
|
59
|
+
interface ElementExecuterProps$3 extends ElementType {
|
|
60
|
+
onChange: (value: string | number | boolean | object | any[]) => void;
|
|
61
|
+
}
|
|
62
|
+
declare const TextElement: (props: ElementExecuterProps$3) => React$1.JSX.Element;
|
|
62
63
|
|
|
63
|
-
|
|
64
|
+
interface InputData {
|
|
65
|
+
placeholder?: string;
|
|
66
|
+
id?: string;
|
|
67
|
+
prefix?: React$1.ReactNode;
|
|
68
|
+
addonBefore?: React$1.ReactNode;
|
|
69
|
+
type?: string;
|
|
70
|
+
}
|
|
71
|
+
interface PasswordProps {
|
|
72
|
+
inputData: InputData;
|
|
73
|
+
}
|
|
74
|
+
declare const PasswordElement: React$1.FC<PasswordProps>;
|
|
64
75
|
|
|
65
|
-
|
|
76
|
+
interface ElementExecuterProps$2 extends ElementType {
|
|
77
|
+
onChange: (value: string | number | object | boolean | any[]) => void;
|
|
78
|
+
}
|
|
79
|
+
declare const NumberElement: (props: ElementExecuterProps$2) => React$1.JSX.Element;
|
|
66
80
|
|
|
67
|
-
|
|
81
|
+
interface ElementExecuterProps$1 extends ElementType {
|
|
82
|
+
onChange: (value: string | number | boolean | object | any[]) => void;
|
|
83
|
+
}
|
|
84
|
+
declare const TextareaElement: (props: ElementExecuterProps$1) => React$1.JSX.Element;
|
|
68
85
|
|
|
69
86
|
declare const SelectElement: (props: ElementType) => React$1.JSX.Element;
|
|
70
87
|
|
|
@@ -73,7 +90,7 @@ declare const RadioElement: (props: ElementType) => React$1.JSX.Element;
|
|
|
73
90
|
declare const CheckboxElement: (props: ElementType) => React$1.JSX.Element;
|
|
74
91
|
|
|
75
92
|
interface ElementExecuterProps extends ElementType {
|
|
76
|
-
onChange: (value: string | number | object | boolean | any[]
|
|
93
|
+
onChange: (value: string | number | object | boolean | any[]) => void;
|
|
77
94
|
}
|
|
78
95
|
declare const CkEditor: (props: ElementExecuterProps) => React$1.JSX.Element;
|
|
79
96
|
|
|
@@ -95,12 +112,4 @@ declare const DatePickerElement: (props: ElementType) => React$1.JSX.Element;
|
|
|
95
112
|
|
|
96
113
|
declare const DateRangePickerElement: (props: ElementType) => React$1.JSX.Element;
|
|
97
114
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
declare const Image: (props: ElementType) => React$1.JSX.Element;
|
|
101
|
-
|
|
102
|
-
declare const SingleCheckbox: (props: ElementType) => React$1.JSX.Element;
|
|
103
|
-
|
|
104
|
-
declare const MultiSelect: (props: ElementType) => React$1.JSX.Element;
|
|
105
|
-
|
|
106
|
-
export { AddMoreTable, ButtonElement, CheckboxElement, CkEditor, DatePickerElement, DateRangePickerElement, Image, MultiSelect, MultipleSelectElement, Navbar, NumberElement, PasswordElement, RadioElement, SelectElement, Sidebar, SingleCheckbox, SingleSelectElement, TableElement, TextElement, TextareaElement, UploadElement };
|
|
115
|
+
export { AddMoreTable, ButtonElement, CheckboxElement, CkEditor, DatePickerElement, DateRangePickerElement, MultipleSelectElement, Navbar, NumberElement, PasswordElement, RadioElement, SelectElement, Sidebar, SingleSelectElement, TableElement, TextElement, TextareaElement };
|
package/dist/index.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ type ElementType = {
|
|
|
25
25
|
fields?: any[];
|
|
26
26
|
schema?: any[];
|
|
27
27
|
options?: any[];
|
|
28
|
-
onChange?: (value: string | number | boolean | object | any[]
|
|
28
|
+
onChange?: (value: string | number | boolean | object | any[]) => void;
|
|
29
29
|
onClick?: () => void;
|
|
30
30
|
dropDownOptions?: any[];
|
|
31
31
|
id?: number;
|
|
@@ -54,17 +54,34 @@ type ElementType = {
|
|
|
54
54
|
iconsClassName?: string;
|
|
55
55
|
labelClassName?: string;
|
|
56
56
|
containerClassName?: string;
|
|
57
|
-
selectBefore?: any[];
|
|
58
|
-
selectAfter?: any[];
|
|
59
57
|
};
|
|
60
58
|
|
|
61
|
-
|
|
59
|
+
interface ElementExecuterProps$3 extends ElementType {
|
|
60
|
+
onChange: (value: string | number | boolean | object | any[]) => void;
|
|
61
|
+
}
|
|
62
|
+
declare const TextElement: (props: ElementExecuterProps$3) => React$1.JSX.Element;
|
|
62
63
|
|
|
63
|
-
|
|
64
|
+
interface InputData {
|
|
65
|
+
placeholder?: string;
|
|
66
|
+
id?: string;
|
|
67
|
+
prefix?: React$1.ReactNode;
|
|
68
|
+
addonBefore?: React$1.ReactNode;
|
|
69
|
+
type?: string;
|
|
70
|
+
}
|
|
71
|
+
interface PasswordProps {
|
|
72
|
+
inputData: InputData;
|
|
73
|
+
}
|
|
74
|
+
declare const PasswordElement: React$1.FC<PasswordProps>;
|
|
64
75
|
|
|
65
|
-
|
|
76
|
+
interface ElementExecuterProps$2 extends ElementType {
|
|
77
|
+
onChange: (value: string | number | object | boolean | any[]) => void;
|
|
78
|
+
}
|
|
79
|
+
declare const NumberElement: (props: ElementExecuterProps$2) => React$1.JSX.Element;
|
|
66
80
|
|
|
67
|
-
|
|
81
|
+
interface ElementExecuterProps$1 extends ElementType {
|
|
82
|
+
onChange: (value: string | number | boolean | object | any[]) => void;
|
|
83
|
+
}
|
|
84
|
+
declare const TextareaElement: (props: ElementExecuterProps$1) => React$1.JSX.Element;
|
|
68
85
|
|
|
69
86
|
declare const SelectElement: (props: ElementType) => React$1.JSX.Element;
|
|
70
87
|
|
|
@@ -73,7 +90,7 @@ declare const RadioElement: (props: ElementType) => React$1.JSX.Element;
|
|
|
73
90
|
declare const CheckboxElement: (props: ElementType) => React$1.JSX.Element;
|
|
74
91
|
|
|
75
92
|
interface ElementExecuterProps extends ElementType {
|
|
76
|
-
onChange: (value: string | number | object | boolean | any[]
|
|
93
|
+
onChange: (value: string | number | object | boolean | any[]) => void;
|
|
77
94
|
}
|
|
78
95
|
declare const CkEditor: (props: ElementExecuterProps) => React$1.JSX.Element;
|
|
79
96
|
|
|
@@ -95,12 +112,4 @@ declare const DatePickerElement: (props: ElementType) => React$1.JSX.Element;
|
|
|
95
112
|
|
|
96
113
|
declare const DateRangePickerElement: (props: ElementType) => React$1.JSX.Element;
|
|
97
114
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
declare const Image: (props: ElementType) => React$1.JSX.Element;
|
|
101
|
-
|
|
102
|
-
declare const SingleCheckbox: (props: ElementType) => React$1.JSX.Element;
|
|
103
|
-
|
|
104
|
-
declare const MultiSelect: (props: ElementType) => React$1.JSX.Element;
|
|
105
|
-
|
|
106
|
-
export { AddMoreTable, ButtonElement, CheckboxElement, CkEditor, DatePickerElement, DateRangePickerElement, Image, MultiSelect, MultipleSelectElement, Navbar, NumberElement, PasswordElement, RadioElement, SelectElement, Sidebar, SingleCheckbox, SingleSelectElement, TableElement, TextElement, TextareaElement, UploadElement };
|
|
115
|
+
export { AddMoreTable, ButtonElement, CheckboxElement, CkEditor, DatePickerElement, DateRangePickerElement, MultipleSelectElement, Navbar, NumberElement, PasswordElement, RadioElement, SelectElement, Sidebar, SingleSelectElement, TableElement, TextElement, TextareaElement };
|
package/dist/index.js
CHANGED
|
@@ -36,8 +36,6 @@ __export(src_exports, {
|
|
|
36
36
|
CkEditor: () => CkEditor,
|
|
37
37
|
DatePickerElement: () => DatePickerElement,
|
|
38
38
|
DateRangePickerElement: () => DateRangePickerElement,
|
|
39
|
-
Image: () => Image,
|
|
40
|
-
MultiSelect: () => MultiSelect,
|
|
41
39
|
MultipleSelectElement: () => MultipleSelectElement,
|
|
42
40
|
Navbar: () => Navbar,
|
|
43
41
|
NumberElement: () => NumberElement,
|
|
@@ -45,12 +43,10 @@ __export(src_exports, {
|
|
|
45
43
|
RadioElement: () => RadioElement,
|
|
46
44
|
SelectElement: () => SelectElement,
|
|
47
45
|
Sidebar: () => Sidebar,
|
|
48
|
-
SingleCheckbox: () => SingleCheckbox,
|
|
49
46
|
SingleSelectElement: () => SingleSelectElement,
|
|
50
47
|
TableElement: () => TableElement,
|
|
51
48
|
TextElement: () => TextElement,
|
|
52
|
-
TextareaElement: () => TextareaElement
|
|
53
|
-
UploadElement: () => UploadElement
|
|
49
|
+
TextareaElement: () => TextareaElement
|
|
54
50
|
});
|
|
55
51
|
module.exports = __toCommonJS(src_exports);
|
|
56
52
|
|
|
@@ -58,12 +54,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
58
54
|
var import_react = __toESM(require("react"));
|
|
59
55
|
var import_antd = require("antd");
|
|
60
56
|
var TextElement = (props) => {
|
|
61
|
-
|
|
62
|
-
if (props.onChange) {
|
|
63
|
-
props.onChange(e.target.value);
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: props.containerClassName }, props.label && /* @__PURE__ */ import_react.default.createElement("label", { htmlFor: props.name, className: props.labelClassName }, props.label), /* @__PURE__ */ import_react.default.createElement(
|
|
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(
|
|
67
58
|
import_antd.Input,
|
|
68
59
|
{
|
|
69
60
|
placeholder: props.placeholder,
|
|
@@ -79,9 +70,7 @@ var TextElement = (props) => {
|
|
|
79
70
|
className: props.className,
|
|
80
71
|
variant: props.variant,
|
|
81
72
|
name: props.name,
|
|
82
|
-
onChange: (e) =>
|
|
83
|
-
handleChange2(e);
|
|
84
|
-
}
|
|
73
|
+
onChange: (e) => props.onChange(e.target.value)
|
|
85
74
|
}
|
|
86
75
|
));
|
|
87
76
|
};
|
|
@@ -90,46 +79,36 @@ var TextElement = (props) => {
|
|
|
90
79
|
var import_react2 = __toESM(require("react"));
|
|
91
80
|
var import_icons = require("@ant-design/icons");
|
|
92
81
|
var import_antd2 = require("antd");
|
|
93
|
-
var PasswordElement = (
|
|
82
|
+
var PasswordElement = ({ inputData }) => {
|
|
94
83
|
const [passwordVisible, setPasswordVisible] = (0, import_react2.useState)(false);
|
|
95
84
|
const handleVisibilityToggle = () => {
|
|
96
85
|
setPasswordVisible((prev) => !prev);
|
|
97
86
|
};
|
|
98
|
-
const handleChange2 = (e) => {
|
|
99
|
-
if (props.onChange) {
|
|
100
|
-
props.onChange(e.target.value);
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
87
|
const renderVisibilityIcon = (visible) => visible ? /* @__PURE__ */ import_react2.default.createElement(import_icons.EyeTwoTone, null) : /* @__PURE__ */ import_react2.default.createElement(import_icons.EyeInvisibleOutlined, null);
|
|
104
|
-
|
|
88
|
+
const renderPasswordInput = () => /* @__PURE__ */ import_react2.default.createElement(
|
|
105
89
|
import_antd2.Input.Password,
|
|
106
90
|
{
|
|
107
|
-
placeholder:
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
},
|
|
91
|
+
placeholder: inputData.placeholder,
|
|
92
|
+
id: inputData.id,
|
|
93
|
+
prefix: inputData.prefix,
|
|
94
|
+
addonBefore: inputData.addonBefore,
|
|
95
|
+
type: inputData.type,
|
|
113
96
|
iconRender: renderVisibilityIcon,
|
|
114
|
-
visibilityToggle: {
|
|
115
|
-
visible: passwordVisible,
|
|
116
|
-
onVisibleChange: handleVisibilityToggle
|
|
117
|
-
}
|
|
97
|
+
visibilityToggle: { visible: passwordVisible, onVisibleChange: handleVisibilityToggle }
|
|
118
98
|
}
|
|
119
|
-
)
|
|
99
|
+
);
|
|
100
|
+
return /* @__PURE__ */ import_react2.default.createElement(import_antd2.Space, { direction: "vertical" }, renderPasswordInput(), /* @__PURE__ */ import_react2.default.createElement(import_antd2.Space, { direction: "horizontal" }, renderPasswordInput(), /* @__PURE__ */ import_react2.default.createElement(import_antd2.Button, { style: { width: 80 }, onClick: handleVisibilityToggle }, passwordVisible ? "Hide" : "Show")));
|
|
120
101
|
};
|
|
121
102
|
|
|
122
103
|
// src/Components/NumberElement.tsx
|
|
123
104
|
var import_react3 = __toESM(require("react"));
|
|
124
105
|
var import_antd3 = require("antd");
|
|
125
106
|
var NumberElement = (props) => {
|
|
126
|
-
const
|
|
107
|
+
const handleInputChange = (e) => {
|
|
127
108
|
const newValue = e.target.value.replace(/[^0-9]/g, "");
|
|
128
|
-
|
|
129
|
-
props.onChange(newValue);
|
|
130
|
-
}
|
|
109
|
+
props.onChange(newValue);
|
|
131
110
|
};
|
|
132
|
-
return /* @__PURE__ */ import_react3.default.createElement(
|
|
111
|
+
return /* @__PURE__ */ import_react3.default.createElement(
|
|
133
112
|
import_antd3.Input,
|
|
134
113
|
{
|
|
135
114
|
placeholder: props.placeholder,
|
|
@@ -144,11 +123,9 @@ var NumberElement = (props) => {
|
|
|
144
123
|
className: props.className,
|
|
145
124
|
variant: props.variant,
|
|
146
125
|
name: props.name,
|
|
147
|
-
onChange:
|
|
148
|
-
handleChange2(e);
|
|
149
|
-
}
|
|
126
|
+
onChange: handleInputChange
|
|
150
127
|
}
|
|
151
|
-
)
|
|
128
|
+
);
|
|
152
129
|
};
|
|
153
130
|
|
|
154
131
|
// src/Components/TextareaElement.tsx
|
|
@@ -156,12 +133,7 @@ var import_react4 = __toESM(require("react"));
|
|
|
156
133
|
var import_antd4 = require("antd");
|
|
157
134
|
var { TextArea } = import_antd4.Input;
|
|
158
135
|
var TextareaElement = (props) => {
|
|
159
|
-
|
|
160
|
-
if (props.onChange) {
|
|
161
|
-
props.onChange(e.target.value);
|
|
162
|
-
}
|
|
163
|
-
};
|
|
164
|
-
return /* @__PURE__ */ import_react4.default.createElement("div", { className: props.containerClassName }, props.label && /* @__PURE__ */ import_react4.default.createElement("label", { htmlFor: props.name, className: props.labelClassName }, props.label), /* @__PURE__ */ import_react4.default.createElement(
|
|
136
|
+
return /* @__PURE__ */ import_react4.default.createElement(import_antd4.Flex, null, /* @__PURE__ */ import_react4.default.createElement(
|
|
165
137
|
TextArea,
|
|
166
138
|
{
|
|
167
139
|
placeholder: props.placeholder,
|
|
@@ -175,9 +147,7 @@ var TextareaElement = (props) => {
|
|
|
175
147
|
name: props.name,
|
|
176
148
|
showCount: true,
|
|
177
149
|
maxLength: props.maxLength,
|
|
178
|
-
onChange: (e) =>
|
|
179
|
-
handleChange2(e);
|
|
180
|
-
}
|
|
150
|
+
onChange: (e) => props.onChange(e.target.value)
|
|
181
151
|
}
|
|
182
152
|
));
|
|
183
153
|
};
|
|
@@ -193,7 +163,7 @@ var labelRender = (props) => {
|
|
|
193
163
|
return /* @__PURE__ */ import_react5.default.createElement("span", null, "select gender");
|
|
194
164
|
};
|
|
195
165
|
var SelectElement = (props) => {
|
|
196
|
-
const
|
|
166
|
+
const handleChange = (value) => {
|
|
197
167
|
if (props.onChange) {
|
|
198
168
|
props.onChange(value);
|
|
199
169
|
}
|
|
@@ -202,7 +172,7 @@ var SelectElement = (props) => {
|
|
|
202
172
|
import_antd5.Select,
|
|
203
173
|
{
|
|
204
174
|
labelRender,
|
|
205
|
-
options: props.
|
|
175
|
+
options: props.fieldNames,
|
|
206
176
|
placeholder: props.placeholder,
|
|
207
177
|
allowClear: true,
|
|
208
178
|
defaultValue: props.defaultValue,
|
|
@@ -212,7 +182,7 @@ var SelectElement = (props) => {
|
|
|
212
182
|
style: props.styles,
|
|
213
183
|
className: props.className,
|
|
214
184
|
variant: props.variant,
|
|
215
|
-
onChange:
|
|
185
|
+
onChange: handleChange
|
|
216
186
|
}
|
|
217
187
|
);
|
|
218
188
|
};
|
|
@@ -226,7 +196,7 @@ var RadioElement = (props) => {
|
|
|
226
196
|
const [isDisabled, setIsDisabled] = (0, import_react6.useState)(props.disabled);
|
|
227
197
|
const [selectedValue, setSelectedValue] = (0, import_react6.useState)(props.value);
|
|
228
198
|
const optionType = props.optionType === "button" ? "button" : void 0;
|
|
229
|
-
const
|
|
199
|
+
const handleChange = (option) => {
|
|
230
200
|
console.log(option);
|
|
231
201
|
setSelectedValue(option);
|
|
232
202
|
setIsDisabled(true);
|
|
@@ -245,11 +215,12 @@ var RadioElement = (props) => {
|
|
|
245
215
|
value: selectedValue
|
|
246
216
|
},
|
|
247
217
|
props.options && props.options.map((option) => {
|
|
218
|
+
console.log(option);
|
|
248
219
|
return /* @__PURE__ */ import_react6.default.createElement(
|
|
249
220
|
import_antd6.Radio,
|
|
250
221
|
{
|
|
251
222
|
onChange: () => {
|
|
252
|
-
|
|
223
|
+
handleChange(option);
|
|
253
224
|
},
|
|
254
225
|
key: option.value,
|
|
255
226
|
value: option.value,
|
|
@@ -267,19 +238,22 @@ var RadioElement = (props) => {
|
|
|
267
238
|
var import_react7 = __toESM(require("react"));
|
|
268
239
|
var import_antd7 = require("antd");
|
|
269
240
|
var CheckboxGroup = import_antd7.Checkbox.Group;
|
|
241
|
+
var plainOptions = ["Apple", "Pear", "Orange"];
|
|
270
242
|
var defaultCheckedList = [];
|
|
271
243
|
var CheckboxElement = (props) => {
|
|
272
244
|
const [checkedList, setCheckedList] = (0, import_react7.useState)(defaultCheckedList);
|
|
273
|
-
const checkAll =
|
|
274
|
-
const
|
|
245
|
+
const checkAll = plainOptions.length === checkedList.length;
|
|
246
|
+
const handleChange = (list) => {
|
|
275
247
|
setCheckedList(list);
|
|
276
248
|
if (props.onChange) {
|
|
277
|
-
const selectedOptions =
|
|
249
|
+
const selectedOptions = list.map((value) => {
|
|
250
|
+
return { id: list.indexOf(value), value };
|
|
251
|
+
});
|
|
278
252
|
props.onChange(selectedOptions);
|
|
279
253
|
}
|
|
280
254
|
};
|
|
281
255
|
const onHandleAllChanges = (e) => {
|
|
282
|
-
const newList = e.target.checked ?
|
|
256
|
+
const newList = e.target.checked ? plainOptions : [];
|
|
283
257
|
setCheckedList(newList);
|
|
284
258
|
if (props.onChange) {
|
|
285
259
|
props.onChange(newList);
|
|
@@ -296,15 +270,15 @@ var CheckboxElement = (props) => {
|
|
|
296
270
|
checked: checkAll
|
|
297
271
|
},
|
|
298
272
|
"Check all"
|
|
299
|
-
), /* @__PURE__ */ import_react7.default.createElement(
|
|
273
|
+
), /* @__PURE__ */ import_react7.default.createElement(import_antd7.Divider, null), /* @__PURE__ */ import_react7.default.createElement(
|
|
300
274
|
CheckboxGroup,
|
|
301
275
|
{
|
|
302
276
|
disabled: props.disabled,
|
|
303
277
|
style: props.styles,
|
|
304
278
|
className: props.className,
|
|
305
|
-
options:
|
|
279
|
+
options: plainOptions,
|
|
306
280
|
value: checkedList,
|
|
307
|
-
onChange:
|
|
281
|
+
onChange: handleChange
|
|
308
282
|
}
|
|
309
283
|
));
|
|
310
284
|
};
|
|
@@ -369,11 +343,9 @@ var onSearch = (value) => {
|
|
|
369
343
|
};
|
|
370
344
|
var filterOption = (input, option) => (option?.label ?? "").toLowerCase().includes(input.toLowerCase());
|
|
371
345
|
var SingleSelectElement = (props) => {
|
|
372
|
-
const
|
|
346
|
+
const handleChange = (values) => {
|
|
373
347
|
if (props.onChange) {
|
|
374
|
-
const option = props.dropDownOptions?.find(
|
|
375
|
-
(option2) => String(option2.title) === values
|
|
376
|
-
);
|
|
348
|
+
const option = props.dropDownOptions?.find((option2) => String(option2.title) === values);
|
|
377
349
|
const selectedOption = { id: option?.id, value: values };
|
|
378
350
|
props.onChange([selectedOption]);
|
|
379
351
|
}
|
|
@@ -384,14 +356,10 @@ var SingleSelectElement = (props) => {
|
|
|
384
356
|
showSearch: true,
|
|
385
357
|
placeholder: props.placeholder,
|
|
386
358
|
optionFilterProp: "children",
|
|
387
|
-
onChange:
|
|
359
|
+
onChange: handleChange,
|
|
388
360
|
onSearch,
|
|
389
361
|
filterOption,
|
|
390
|
-
options: props.dropDownOptions?.map((eachOption) => ({
|
|
391
|
-
label: String(eachOption.title),
|
|
392
|
-
value: String(eachOption.title),
|
|
393
|
-
id: String(eachOption.id)
|
|
394
|
-
}))
|
|
362
|
+
options: props.dropDownOptions?.map((eachOption) => ({ label: String(eachOption.title), value: String(eachOption.title), id: String(eachOption.id) }))
|
|
395
363
|
}
|
|
396
364
|
);
|
|
397
365
|
};
|
|
@@ -400,7 +368,7 @@ var SingleSelectElement = (props) => {
|
|
|
400
368
|
var import_react11 = __toESM(require("react"));
|
|
401
369
|
var import_antd9 = require("antd");
|
|
402
370
|
var MultipleSelectElement = (props) => {
|
|
403
|
-
const
|
|
371
|
+
const handleChange = (values) => {
|
|
404
372
|
if (props.onChange) {
|
|
405
373
|
const selectedOptions = values.map((value) => {
|
|
406
374
|
const option = props.dropDownOptions?.find((option2) => String(option2.title) === value);
|
|
@@ -414,7 +382,7 @@ var MultipleSelectElement = (props) => {
|
|
|
414
382
|
{
|
|
415
383
|
mode: "multiple",
|
|
416
384
|
placeholder: props.placeholder,
|
|
417
|
-
onChange:
|
|
385
|
+
onChange: handleChange,
|
|
418
386
|
options: props.dropDownOptions?.map((eachOption) => ({ label: String(eachOption.title), value: String(eachOption.title), id: String(eachOption.id) }))
|
|
419
387
|
}
|
|
420
388
|
);
|
|
@@ -567,14 +535,14 @@ var AddMoreTable = (props) => {
|
|
|
567
535
|
// src/Components/Sidebar.tsx
|
|
568
536
|
var import_react14 = __toESM(require("react"));
|
|
569
537
|
var Sidebar = (props) => {
|
|
570
|
-
const
|
|
538
|
+
const handleChange = (item) => {
|
|
571
539
|
if (props.onChange) {
|
|
572
540
|
props.onChange(item);
|
|
573
541
|
}
|
|
574
542
|
};
|
|
575
543
|
return /* @__PURE__ */ import_react14.default.createElement("div", { className: props.className, key: props.name }, /* @__PURE__ */ import_react14.default.createElement("div", null, /* @__PURE__ */ import_react14.default.createElement("img", { src: props.img, alt: "logo" })), /* @__PURE__ */ import_react14.default.createElement("ul", { className: props.listClassName }, props.items?.map((item) => {
|
|
576
544
|
return /* @__PURE__ */ import_react14.default.createElement("li", { onClick: () => {
|
|
577
|
-
|
|
545
|
+
handleChange(item);
|
|
578
546
|
}, key: item.label, className: `${props.listItemClassName} ${item.active && props.activeClassName}` }, /* @__PURE__ */ import_react14.default.createElement("img", { src: item.icon, className: props.className }), /* @__PURE__ */ import_react14.default.createElement("p", null, item.label));
|
|
579
547
|
})));
|
|
580
548
|
};
|
|
@@ -700,7 +668,7 @@ var TableElement = (props) => {
|
|
|
700
668
|
const { thead, tbody } = props;
|
|
701
669
|
const [selectedRecord, setSelectedRecord] = (0, import_react21.useState)({});
|
|
702
670
|
const [model, setModel] = (0, import_react21.useState)(false);
|
|
703
|
-
const
|
|
671
|
+
const handleChange = (record) => {
|
|
704
672
|
if (props.onChange) {
|
|
705
673
|
props.onChange(record);
|
|
706
674
|
}
|
|
@@ -750,7 +718,7 @@ var TableElement = (props) => {
|
|
|
750
718
|
return {
|
|
751
719
|
onClick: () => {
|
|
752
720
|
setSelectedRecord(record);
|
|
753
|
-
|
|
721
|
+
handleChange(record);
|
|
754
722
|
setModel(true);
|
|
755
723
|
},
|
|
756
724
|
style: { cursor: "pointer" }
|
|
@@ -767,7 +735,7 @@ var import_icons4 = require("@ant-design/icons");
|
|
|
767
735
|
var import_moment = __toESM(require("moment"));
|
|
768
736
|
var DatePickerElement = (props) => {
|
|
769
737
|
const [date, setDate] = (0, import_react22.useState)(null);
|
|
770
|
-
const
|
|
738
|
+
const handleChange = (date2, dateString) => {
|
|
771
739
|
console.log("date---------", date2);
|
|
772
740
|
console.log("datestring", dateString);
|
|
773
741
|
if (date2) {
|
|
@@ -807,7 +775,7 @@ var DatePickerElement = (props) => {
|
|
|
807
775
|
placeholder: props.placeholder,
|
|
808
776
|
value: date,
|
|
809
777
|
variant: "borderless",
|
|
810
|
-
onChange:
|
|
778
|
+
onChange: handleChange
|
|
811
779
|
}
|
|
812
780
|
), /* @__PURE__ */ import_react22.default.createElement("button", { onClick: onHandleIncrement }, /* @__PURE__ */ import_react22.default.createElement(import_icons4.RightOutlined, null)));
|
|
813
781
|
};
|
|
@@ -818,7 +786,7 @@ var import_antd16 = require("antd");
|
|
|
818
786
|
var import_dayjs = __toESM(require("dayjs"));
|
|
819
787
|
var DateRangePickerElement = (props) => {
|
|
820
788
|
const { RangePicker } = import_antd16.DatePicker;
|
|
821
|
-
const
|
|
789
|
+
const handleChange = (dates, dateStrings) => {
|
|
822
790
|
if (dates && props.onChange) {
|
|
823
791
|
props.onChange(dateStrings);
|
|
824
792
|
} else {
|
|
@@ -831,87 +799,7 @@ var DateRangePickerElement = (props) => {
|
|
|
831
799
|
{ label: "Last 30 Days", value: [(0, import_dayjs.default)().add(-30, "d"), (0, import_dayjs.default)()] },
|
|
832
800
|
{ label: "Last 90 Days", value: [(0, import_dayjs.default)().add(-90, "d"), (0, import_dayjs.default)()] }
|
|
833
801
|
];
|
|
834
|
-
return /* @__PURE__ */ import_react23.default.createElement(import_antd16.Space, { direction: "vertical", size: 12 }, /* @__PURE__ */ import_react23.default.createElement(RangePicker, { presets: rangePresets, onChange:
|
|
835
|
-
};
|
|
836
|
-
|
|
837
|
-
// src/Components/UploadElement.tsx
|
|
838
|
-
var import_react24 = __toESM(require("react"));
|
|
839
|
-
var import_icons5 = require("@ant-design/icons");
|
|
840
|
-
var import_antd17 = require("antd");
|
|
841
|
-
var uploadProps = {
|
|
842
|
-
name: "file",
|
|
843
|
-
multiple: true,
|
|
844
|
-
// action: 'https://660d2bd96ddfa2943b33731c.mockapi.io/api/upload',
|
|
845
|
-
headers: {
|
|
846
|
-
authorization: "authorization-text"
|
|
847
|
-
},
|
|
848
|
-
onChange(info) {
|
|
849
|
-
if (info.file.status !== "uploading") {
|
|
850
|
-
console.log(info.file, info.fileList);
|
|
851
|
-
}
|
|
852
|
-
if (info.file.status === "done") {
|
|
853
|
-
import_antd17.message.success(`${info.file.name} file uploaded successfully`);
|
|
854
|
-
} else if (info.file.status === "error") {
|
|
855
|
-
import_antd17.message.error(`${info.file.name} file upload failed.`);
|
|
856
|
-
}
|
|
857
|
-
}
|
|
858
|
-
};
|
|
859
|
-
var UploadElement = (props) => {
|
|
860
|
-
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"));
|
|
861
|
-
};
|
|
862
|
-
|
|
863
|
-
// src/Components/Image.tsx
|
|
864
|
-
var import_react25 = __toESM(require("react"));
|
|
865
|
-
var Image = (props) => {
|
|
866
|
-
return /* @__PURE__ */ import_react25.default.createElement("div", null, /* @__PURE__ */ import_react25.default.createElement("img", { className: props.className, src: props.img, alt: "image" }));
|
|
867
|
-
};
|
|
868
|
-
|
|
869
|
-
// src/Components/SingleCheckbox.tsx
|
|
870
|
-
var import_react26 = __toESM(require("react"));
|
|
871
|
-
var import_antd18 = require("antd");
|
|
872
|
-
var SingleCheckbox = (props) => {
|
|
873
|
-
const handleChange2 = (e) => {
|
|
874
|
-
if (props.onChange) {
|
|
875
|
-
props.onChange(e.target.checked);
|
|
876
|
-
}
|
|
877
|
-
};
|
|
878
|
-
return /* @__PURE__ */ import_react26.default.createElement(import_antd18.Checkbox, { onChange: (e) => handleChange2(e), className: props.className }, props.label);
|
|
879
|
-
};
|
|
880
|
-
|
|
881
|
-
// src/Components/MultiSelect.tsx
|
|
882
|
-
var import_react27 = __toESM(require("react"));
|
|
883
|
-
var import_antd19 = require("antd");
|
|
884
|
-
var options = [];
|
|
885
|
-
for (let i = 10; i < 36; i++) {
|
|
886
|
-
options.push({
|
|
887
|
-
value: i.toString(36) + i,
|
|
888
|
-
label: i.toString(36) + i
|
|
889
|
-
});
|
|
890
|
-
}
|
|
891
|
-
var handleChange = (value) => {
|
|
892
|
-
console.log(`Selected: ${value}`);
|
|
893
|
-
};
|
|
894
|
-
var MultiSelect = (props) => {
|
|
895
|
-
return /* @__PURE__ */ import_react27.default.createElement("div", { style: { display: "flex", backgroundColor: "white", borderRadius: 10, border: "1px solid gray" } }, /* @__PURE__ */ import_react27.default.createElement(
|
|
896
|
-
import_antd19.Select,
|
|
897
|
-
{
|
|
898
|
-
defaultValue: "a1",
|
|
899
|
-
onChange: handleChange,
|
|
900
|
-
style: { width: 70, border: "none", borderRadius: 0 },
|
|
901
|
-
variant: "borderless",
|
|
902
|
-
options
|
|
903
|
-
}
|
|
904
|
-
), /* @__PURE__ */ import_react27.default.createElement("div", { style: { borderLeft: "1px solid gray", height: "33px" } }), /* @__PURE__ */ import_react27.default.createElement(
|
|
905
|
-
import_antd19.Select,
|
|
906
|
-
{
|
|
907
|
-
placeholder: "Please select",
|
|
908
|
-
defaultValue: ["a10"],
|
|
909
|
-
onChange: handleChange,
|
|
910
|
-
variant: "borderless",
|
|
911
|
-
style: { width: 70, borderRadius: 0, border: "0px none" },
|
|
912
|
-
options
|
|
913
|
-
}
|
|
914
|
-
));
|
|
802
|
+
return /* @__PURE__ */ import_react23.default.createElement(import_antd16.Space, { direction: "vertical", size: 12 }, /* @__PURE__ */ import_react23.default.createElement(RangePicker, { presets: rangePresets, onChange: handleChange }));
|
|
915
803
|
};
|
|
916
804
|
// Annotate the CommonJS export names for ESM import in node:
|
|
917
805
|
0 && (module.exports = {
|
|
@@ -921,8 +809,6 @@ var MultiSelect = (props) => {
|
|
|
921
809
|
CkEditor,
|
|
922
810
|
DatePickerElement,
|
|
923
811
|
DateRangePickerElement,
|
|
924
|
-
Image,
|
|
925
|
-
MultiSelect,
|
|
926
812
|
MultipleSelectElement,
|
|
927
813
|
Navbar,
|
|
928
814
|
NumberElement,
|
|
@@ -930,10 +816,8 @@ var MultiSelect = (props) => {
|
|
|
930
816
|
RadioElement,
|
|
931
817
|
SelectElement,
|
|
932
818
|
Sidebar,
|
|
933
|
-
SingleCheckbox,
|
|
934
819
|
SingleSelectElement,
|
|
935
820
|
TableElement,
|
|
936
821
|
TextElement,
|
|
937
|
-
TextareaElement
|
|
938
|
-
UploadElement
|
|
822
|
+
TextareaElement
|
|
939
823
|
});
|
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
|
-
handleChange2(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 handleChange2 = (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
|
-
handleChange2(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
|
-
handleChange2(e);
|
|
124
|
-
}
|
|
98
|
+
onChange: (e) => props.onChange(e.target.value)
|
|
125
99
|
}
|
|
126
100
|
));
|
|
127
101
|
};
|
|
@@ -137,7 +111,7 @@ var labelRender = (props) => {
|
|
|
137
111
|
return /* @__PURE__ */ React5.createElement("span", null, "select gender");
|
|
138
112
|
};
|
|
139
113
|
var SelectElement = (props) => {
|
|
140
|
-
const
|
|
114
|
+
const handleChange = (value) => {
|
|
141
115
|
if (props.onChange) {
|
|
142
116
|
props.onChange(value);
|
|
143
117
|
}
|
|
@@ -146,7 +120,7 @@ var SelectElement = (props) => {
|
|
|
146
120
|
Select,
|
|
147
121
|
{
|
|
148
122
|
labelRender,
|
|
149
|
-
options: props.
|
|
123
|
+
options: props.fieldNames,
|
|
150
124
|
placeholder: props.placeholder,
|
|
151
125
|
allowClear: true,
|
|
152
126
|
defaultValue: props.defaultValue,
|
|
@@ -156,7 +130,7 @@ var SelectElement = (props) => {
|
|
|
156
130
|
style: props.styles,
|
|
157
131
|
className: props.className,
|
|
158
132
|
variant: props.variant,
|
|
159
|
-
onChange:
|
|
133
|
+
onChange: handleChange
|
|
160
134
|
}
|
|
161
135
|
);
|
|
162
136
|
};
|
|
@@ -170,7 +144,7 @@ var RadioElement = (props) => {
|
|
|
170
144
|
const [isDisabled, setIsDisabled] = useState2(props.disabled);
|
|
171
145
|
const [selectedValue, setSelectedValue] = useState2(props.value);
|
|
172
146
|
const optionType = props.optionType === "button" ? "button" : void 0;
|
|
173
|
-
const
|
|
147
|
+
const handleChange = (option) => {
|
|
174
148
|
console.log(option);
|
|
175
149
|
setSelectedValue(option);
|
|
176
150
|
setIsDisabled(true);
|
|
@@ -189,11 +163,12 @@ var RadioElement = (props) => {
|
|
|
189
163
|
value: selectedValue
|
|
190
164
|
},
|
|
191
165
|
props.options && props.options.map((option) => {
|
|
166
|
+
console.log(option);
|
|
192
167
|
return /* @__PURE__ */ React6.createElement(
|
|
193
168
|
Radio,
|
|
194
169
|
{
|
|
195
170
|
onChange: () => {
|
|
196
|
-
|
|
171
|
+
handleChange(option);
|
|
197
172
|
},
|
|
198
173
|
key: option.value,
|
|
199
174
|
value: option.value,
|
|
@@ -209,21 +184,24 @@ var RadioElement = (props) => {
|
|
|
209
184
|
|
|
210
185
|
// src/Components/Checkbox.tsx
|
|
211
186
|
import React7, { useState as useState3 } from "react";
|
|
212
|
-
import { Checkbox } from "antd";
|
|
187
|
+
import { Checkbox, Divider } from "antd";
|
|
213
188
|
var CheckboxGroup = Checkbox.Group;
|
|
189
|
+
var plainOptions = ["Apple", "Pear", "Orange"];
|
|
214
190
|
var defaultCheckedList = [];
|
|
215
191
|
var CheckboxElement = (props) => {
|
|
216
192
|
const [checkedList, setCheckedList] = useState3(defaultCheckedList);
|
|
217
|
-
const checkAll =
|
|
218
|
-
const
|
|
193
|
+
const checkAll = plainOptions.length === checkedList.length;
|
|
194
|
+
const handleChange = (list) => {
|
|
219
195
|
setCheckedList(list);
|
|
220
196
|
if (props.onChange) {
|
|
221
|
-
const selectedOptions =
|
|
197
|
+
const selectedOptions = list.map((value) => {
|
|
198
|
+
return { id: list.indexOf(value), value };
|
|
199
|
+
});
|
|
222
200
|
props.onChange(selectedOptions);
|
|
223
201
|
}
|
|
224
202
|
};
|
|
225
203
|
const onHandleAllChanges = (e) => {
|
|
226
|
-
const newList = e.target.checked ?
|
|
204
|
+
const newList = e.target.checked ? plainOptions : [];
|
|
227
205
|
setCheckedList(newList);
|
|
228
206
|
if (props.onChange) {
|
|
229
207
|
props.onChange(newList);
|
|
@@ -240,15 +218,15 @@ var CheckboxElement = (props) => {
|
|
|
240
218
|
checked: checkAll
|
|
241
219
|
},
|
|
242
220
|
"Check all"
|
|
243
|
-
), /* @__PURE__ */ React7.createElement(
|
|
221
|
+
), /* @__PURE__ */ React7.createElement(Divider, null), /* @__PURE__ */ React7.createElement(
|
|
244
222
|
CheckboxGroup,
|
|
245
223
|
{
|
|
246
224
|
disabled: props.disabled,
|
|
247
225
|
style: props.styles,
|
|
248
226
|
className: props.className,
|
|
249
|
-
options:
|
|
227
|
+
options: plainOptions,
|
|
250
228
|
value: checkedList,
|
|
251
|
-
onChange:
|
|
229
|
+
onChange: handleChange
|
|
252
230
|
}
|
|
253
231
|
));
|
|
254
232
|
};
|
|
@@ -313,11 +291,9 @@ var onSearch = (value) => {
|
|
|
313
291
|
};
|
|
314
292
|
var filterOption = (input, option) => (option?.label ?? "").toLowerCase().includes(input.toLowerCase());
|
|
315
293
|
var SingleSelectElement = (props) => {
|
|
316
|
-
const
|
|
294
|
+
const handleChange = (values) => {
|
|
317
295
|
if (props.onChange) {
|
|
318
|
-
const option = props.dropDownOptions?.find(
|
|
319
|
-
(option2) => String(option2.title) === values
|
|
320
|
-
);
|
|
296
|
+
const option = props.dropDownOptions?.find((option2) => String(option2.title) === values);
|
|
321
297
|
const selectedOption = { id: option?.id, value: values };
|
|
322
298
|
props.onChange([selectedOption]);
|
|
323
299
|
}
|
|
@@ -328,14 +304,10 @@ var SingleSelectElement = (props) => {
|
|
|
328
304
|
showSearch: true,
|
|
329
305
|
placeholder: props.placeholder,
|
|
330
306
|
optionFilterProp: "children",
|
|
331
|
-
onChange:
|
|
307
|
+
onChange: handleChange,
|
|
332
308
|
onSearch,
|
|
333
309
|
filterOption,
|
|
334
|
-
options: props.dropDownOptions?.map((eachOption) => ({
|
|
335
|
-
label: String(eachOption.title),
|
|
336
|
-
value: String(eachOption.title),
|
|
337
|
-
id: String(eachOption.id)
|
|
338
|
-
}))
|
|
310
|
+
options: props.dropDownOptions?.map((eachOption) => ({ label: String(eachOption.title), value: String(eachOption.title), id: String(eachOption.id) }))
|
|
339
311
|
}
|
|
340
312
|
);
|
|
341
313
|
};
|
|
@@ -344,7 +316,7 @@ var SingleSelectElement = (props) => {
|
|
|
344
316
|
import React10 from "react";
|
|
345
317
|
import { Select as Select3 } from "antd";
|
|
346
318
|
var MultipleSelectElement = (props) => {
|
|
347
|
-
const
|
|
319
|
+
const handleChange = (values) => {
|
|
348
320
|
if (props.onChange) {
|
|
349
321
|
const selectedOptions = values.map((value) => {
|
|
350
322
|
const option = props.dropDownOptions?.find((option2) => String(option2.title) === value);
|
|
@@ -358,7 +330,7 @@ var MultipleSelectElement = (props) => {
|
|
|
358
330
|
{
|
|
359
331
|
mode: "multiple",
|
|
360
332
|
placeholder: props.placeholder,
|
|
361
|
-
onChange:
|
|
333
|
+
onChange: handleChange,
|
|
362
334
|
options: props.dropDownOptions?.map((eachOption) => ({ label: String(eachOption.title), value: String(eachOption.title), id: String(eachOption.id) }))
|
|
363
335
|
}
|
|
364
336
|
);
|
|
@@ -380,7 +352,7 @@ var ButtonElement = (props) => {
|
|
|
380
352
|
|
|
381
353
|
// src/Components/AddMoreTable.tsx
|
|
382
354
|
import React12, { useEffect, useState as useState4 } from "react";
|
|
383
|
-
import { Table, Button } from "antd";
|
|
355
|
+
import { Table, Button as Button2 } from "antd";
|
|
384
356
|
import { PlusOutlined, DeleteOutlined } from "@ant-design/icons";
|
|
385
357
|
var AddMoreTable = (props) => {
|
|
386
358
|
const { thead, tbody } = props;
|
|
@@ -475,13 +447,13 @@ var AddMoreTable = (props) => {
|
|
|
475
447
|
eachRow.variable_data.forEach((variable, subIndex) => {
|
|
476
448
|
Object.keys(variable).forEach((key) => {
|
|
477
449
|
if (key === "SubRows") {
|
|
478
|
-
rowData[`${key}`] = /* @__PURE__ */ React12.createElement("div", { key: subIndex }, eachRow.variable_data.length > 1 && /* @__PURE__ */ React12.createElement(
|
|
450
|
+
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)));
|
|
479
451
|
} else {
|
|
480
452
|
rowData[`${key}`] = renderInputElement(variable[key]);
|
|
481
453
|
}
|
|
482
454
|
});
|
|
483
455
|
});
|
|
484
|
-
rowData.actions = /* @__PURE__ */ React12.createElement("div", null, /* @__PURE__ */ React12.createElement(
|
|
456
|
+
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)));
|
|
485
457
|
console.log("=====rowdata", rowData);
|
|
486
458
|
return rowData;
|
|
487
459
|
});
|
|
@@ -511,14 +483,14 @@ var AddMoreTable = (props) => {
|
|
|
511
483
|
// src/Components/Sidebar.tsx
|
|
512
484
|
import React13 from "react";
|
|
513
485
|
var Sidebar = (props) => {
|
|
514
|
-
const
|
|
486
|
+
const handleChange = (item) => {
|
|
515
487
|
if (props.onChange) {
|
|
516
488
|
props.onChange(item);
|
|
517
489
|
}
|
|
518
490
|
};
|
|
519
491
|
return /* @__PURE__ */ React13.createElement("div", { className: props.className, key: props.name }, /* @__PURE__ */ React13.createElement("div", null, /* @__PURE__ */ React13.createElement("img", { src: props.img, alt: "logo" })), /* @__PURE__ */ React13.createElement("ul", { className: props.listClassName }, props.items?.map((item) => {
|
|
520
492
|
return /* @__PURE__ */ React13.createElement("li", { onClick: () => {
|
|
521
|
-
|
|
493
|
+
handleChange(item);
|
|
522
494
|
}, key: item.label, className: `${props.listItemClassName} ${item.active && props.activeClassName}` }, /* @__PURE__ */ React13.createElement("img", { src: item.icon, className: props.className }), /* @__PURE__ */ React13.createElement("p", null, item.label));
|
|
523
495
|
})));
|
|
524
496
|
};
|
|
@@ -528,7 +500,7 @@ import React17 from "react";
|
|
|
528
500
|
|
|
529
501
|
// src/Components/Notification.tsx
|
|
530
502
|
import React14 from "react";
|
|
531
|
-
import { Popover, Badge, Button as
|
|
503
|
+
import { Popover, Badge, Button as Button3, Avatar, List } from "antd";
|
|
532
504
|
import { IoIosNotifications } from "react-icons/io";
|
|
533
505
|
var popoverContentStyle = {
|
|
534
506
|
minWidth: "300px",
|
|
@@ -556,7 +528,7 @@ var Notification = (props) => /* @__PURE__ */ React14.createElement(
|
|
|
556
528
|
trigger: "focus",
|
|
557
529
|
placement: "bottomRight"
|
|
558
530
|
},
|
|
559
|
-
/* @__PURE__ */ React14.createElement(
|
|
531
|
+
/* @__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))))
|
|
560
532
|
);
|
|
561
533
|
|
|
562
534
|
// src/Components/SpanElement.tsx
|
|
@@ -644,7 +616,7 @@ var TableElement = (props) => {
|
|
|
644
616
|
const { thead, tbody } = props;
|
|
645
617
|
const [selectedRecord, setSelectedRecord] = useState5({});
|
|
646
618
|
const [model, setModel] = useState5(false);
|
|
647
|
-
const
|
|
619
|
+
const handleChange = (record) => {
|
|
648
620
|
if (props.onChange) {
|
|
649
621
|
props.onChange(record);
|
|
650
622
|
}
|
|
@@ -694,7 +666,7 @@ var TableElement = (props) => {
|
|
|
694
666
|
return {
|
|
695
667
|
onClick: () => {
|
|
696
668
|
setSelectedRecord(record);
|
|
697
|
-
|
|
669
|
+
handleChange(record);
|
|
698
670
|
setModel(true);
|
|
699
671
|
},
|
|
700
672
|
style: { cursor: "pointer" }
|
|
@@ -711,7 +683,7 @@ import { LeftOutlined, RightOutlined } from "@ant-design/icons";
|
|
|
711
683
|
import moment from "moment";
|
|
712
684
|
var DatePickerElement = (props) => {
|
|
713
685
|
const [date, setDate] = useState6(null);
|
|
714
|
-
const
|
|
686
|
+
const handleChange = (date2, dateString) => {
|
|
715
687
|
console.log("date---------", date2);
|
|
716
688
|
console.log("datestring", dateString);
|
|
717
689
|
if (date2) {
|
|
@@ -751,18 +723,18 @@ var DatePickerElement = (props) => {
|
|
|
751
723
|
placeholder: props.placeholder,
|
|
752
724
|
value: date,
|
|
753
725
|
variant: "borderless",
|
|
754
|
-
onChange:
|
|
726
|
+
onChange: handleChange
|
|
755
727
|
}
|
|
756
728
|
), /* @__PURE__ */ React21.createElement("button", { onClick: onHandleIncrement }, /* @__PURE__ */ React21.createElement(RightOutlined, null)));
|
|
757
729
|
};
|
|
758
730
|
|
|
759
731
|
// src/Components/DateRangePickerElement.tsx
|
|
760
732
|
import React22 from "react";
|
|
761
|
-
import { DatePicker as DatePicker2, Space } from "antd";
|
|
733
|
+
import { DatePicker as DatePicker2, Space as Space2 } from "antd";
|
|
762
734
|
import dayjs from "dayjs";
|
|
763
735
|
var DateRangePickerElement = (props) => {
|
|
764
736
|
const { RangePicker } = DatePicker2;
|
|
765
|
-
const
|
|
737
|
+
const handleChange = (dates, dateStrings) => {
|
|
766
738
|
if (dates && props.onChange) {
|
|
767
739
|
props.onChange(dateStrings);
|
|
768
740
|
} else {
|
|
@@ -775,87 +747,7 @@ var DateRangePickerElement = (props) => {
|
|
|
775
747
|
{ label: "Last 30 Days", value: [dayjs().add(-30, "d"), dayjs()] },
|
|
776
748
|
{ label: "Last 90 Days", value: [dayjs().add(-90, "d"), dayjs()] }
|
|
777
749
|
];
|
|
778
|
-
return /* @__PURE__ */ React22.createElement(
|
|
779
|
-
};
|
|
780
|
-
|
|
781
|
-
// src/Components/UploadElement.tsx
|
|
782
|
-
import React23 from "react";
|
|
783
|
-
import { UploadOutlined } from "@ant-design/icons";
|
|
784
|
-
import { Button as Button3, message, Upload } from "antd";
|
|
785
|
-
var uploadProps = {
|
|
786
|
-
name: "file",
|
|
787
|
-
multiple: true,
|
|
788
|
-
// action: 'https://660d2bd96ddfa2943b33731c.mockapi.io/api/upload',
|
|
789
|
-
headers: {
|
|
790
|
-
authorization: "authorization-text"
|
|
791
|
-
},
|
|
792
|
-
onChange(info) {
|
|
793
|
-
if (info.file.status !== "uploading") {
|
|
794
|
-
console.log(info.file, info.fileList);
|
|
795
|
-
}
|
|
796
|
-
if (info.file.status === "done") {
|
|
797
|
-
message.success(`${info.file.name} file uploaded successfully`);
|
|
798
|
-
} else if (info.file.status === "error") {
|
|
799
|
-
message.error(`${info.file.name} file upload failed.`);
|
|
800
|
-
}
|
|
801
|
-
}
|
|
802
|
-
};
|
|
803
|
-
var UploadElement = (props) => {
|
|
804
|
-
return /* @__PURE__ */ React23.createElement(Upload, { ...uploadProps }, /* @__PURE__ */ React23.createElement(Button3, { icon: /* @__PURE__ */ React23.createElement(UploadOutlined, null) }, "Click to Upload"));
|
|
805
|
-
};
|
|
806
|
-
|
|
807
|
-
// src/Components/Image.tsx
|
|
808
|
-
import React24 from "react";
|
|
809
|
-
var Image = (props) => {
|
|
810
|
-
return /* @__PURE__ */ React24.createElement("div", null, /* @__PURE__ */ React24.createElement("img", { className: props.className, src: props.img, alt: "image" }));
|
|
811
|
-
};
|
|
812
|
-
|
|
813
|
-
// src/Components/SingleCheckbox.tsx
|
|
814
|
-
import React25 from "react";
|
|
815
|
-
import { Checkbox as Checkbox2 } from "antd";
|
|
816
|
-
var SingleCheckbox = (props) => {
|
|
817
|
-
const handleChange2 = (e) => {
|
|
818
|
-
if (props.onChange) {
|
|
819
|
-
props.onChange(e.target.checked);
|
|
820
|
-
}
|
|
821
|
-
};
|
|
822
|
-
return /* @__PURE__ */ React25.createElement(Checkbox2, { onChange: (e) => handleChange2(e), className: props.className }, props.label);
|
|
823
|
-
};
|
|
824
|
-
|
|
825
|
-
// src/Components/MultiSelect.tsx
|
|
826
|
-
import React26 from "react";
|
|
827
|
-
import { Select as Select4 } from "antd";
|
|
828
|
-
var options = [];
|
|
829
|
-
for (let i = 10; i < 36; i++) {
|
|
830
|
-
options.push({
|
|
831
|
-
value: i.toString(36) + i,
|
|
832
|
-
label: i.toString(36) + i
|
|
833
|
-
});
|
|
834
|
-
}
|
|
835
|
-
var handleChange = (value) => {
|
|
836
|
-
console.log(`Selected: ${value}`);
|
|
837
|
-
};
|
|
838
|
-
var MultiSelect = (props) => {
|
|
839
|
-
return /* @__PURE__ */ React26.createElement("div", { style: { display: "flex", backgroundColor: "white", borderRadius: 10, border: "1px solid gray" } }, /* @__PURE__ */ React26.createElement(
|
|
840
|
-
Select4,
|
|
841
|
-
{
|
|
842
|
-
defaultValue: "a1",
|
|
843
|
-
onChange: handleChange,
|
|
844
|
-
style: { width: 70, border: "none", borderRadius: 0 },
|
|
845
|
-
variant: "borderless",
|
|
846
|
-
options
|
|
847
|
-
}
|
|
848
|
-
), /* @__PURE__ */ React26.createElement("div", { style: { borderLeft: "1px solid gray", height: "33px" } }), /* @__PURE__ */ React26.createElement(
|
|
849
|
-
Select4,
|
|
850
|
-
{
|
|
851
|
-
placeholder: "Please select",
|
|
852
|
-
defaultValue: ["a10"],
|
|
853
|
-
onChange: handleChange,
|
|
854
|
-
variant: "borderless",
|
|
855
|
-
style: { width: 70, borderRadius: 0, border: "0px none" },
|
|
856
|
-
options
|
|
857
|
-
}
|
|
858
|
-
));
|
|
750
|
+
return /* @__PURE__ */ React22.createElement(Space2, { direction: "vertical", size: 12 }, /* @__PURE__ */ React22.createElement(RangePicker, { presets: rangePresets, onChange: handleChange }));
|
|
859
751
|
};
|
|
860
752
|
export {
|
|
861
753
|
AddMoreTable,
|
|
@@ -864,8 +756,6 @@ export {
|
|
|
864
756
|
CkEditor,
|
|
865
757
|
DatePickerElement,
|
|
866
758
|
DateRangePickerElement,
|
|
867
|
-
Image,
|
|
868
|
-
MultiSelect,
|
|
869
759
|
MultipleSelectElement,
|
|
870
760
|
Navbar,
|
|
871
761
|
NumberElement,
|
|
@@ -873,10 +763,8 @@ export {
|
|
|
873
763
|
RadioElement,
|
|
874
764
|
SelectElement,
|
|
875
765
|
Sidebar,
|
|
876
|
-
SingleCheckbox,
|
|
877
766
|
SingleSelectElement,
|
|
878
767
|
TableElement,
|
|
879
768
|
TextElement,
|
|
880
|
-
TextareaElement
|
|
881
|
-
UploadElement
|
|
769
|
+
TextareaElement
|
|
882
770
|
};
|