@apexcura/ui-components 0.0.13-Beta89 → 0.0.13-Beta9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +26 -18
- package/dist/index.d.ts +26 -18
- package/dist/index.js +160 -245
- package/dist/index.mjs +113 -194
- package/package.json +1 -2
package/dist/index.js
CHANGED
|
@@ -36,9 +36,6 @@ __export(src_exports, {
|
|
|
36
36
|
CkEditor: () => CkEditor,
|
|
37
37
|
DatePickerElement: () => DatePickerElement,
|
|
38
38
|
DateRangePickerElement: () => DateRangePickerElement,
|
|
39
|
-
DropDownGroup: () => DropDownGroup,
|
|
40
|
-
FileUpload: () => FileUpload,
|
|
41
|
-
Image: () => Image,
|
|
42
39
|
MultipleSelectElement: () => MultipleSelectElement,
|
|
43
40
|
Navbar: () => Navbar,
|
|
44
41
|
NumberElement: () => NumberElement,
|
|
@@ -46,12 +43,11 @@ __export(src_exports, {
|
|
|
46
43
|
RadioElement: () => RadioElement,
|
|
47
44
|
SelectElement: () => SelectElement,
|
|
48
45
|
Sidebar: () => Sidebar,
|
|
49
|
-
SingleCheckbox: () => SingleCheckbox,
|
|
50
46
|
SingleSelectElement: () => SingleSelectElement,
|
|
51
47
|
TableElement: () => TableElement,
|
|
52
|
-
TabsElement: () => TabsElement,
|
|
53
48
|
TextElement: () => TextElement,
|
|
54
|
-
TextareaElement: () => TextareaElement
|
|
49
|
+
TextareaElement: () => TextareaElement,
|
|
50
|
+
UploadElement: () => UploadElement
|
|
55
51
|
});
|
|
56
52
|
module.exports = __toCommonJS(src_exports);
|
|
57
53
|
|
|
@@ -59,12 +55,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
59
55
|
var import_react = __toESM(require("react"));
|
|
60
56
|
var import_antd = require("antd");
|
|
61
57
|
var TextElement = (props) => {
|
|
62
|
-
|
|
63
|
-
if (props.onChange) {
|
|
64
|
-
props.onChange(e.target.value);
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
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(
|
|
58
|
+
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(
|
|
68
59
|
import_antd.Input,
|
|
69
60
|
{
|
|
70
61
|
placeholder: props.placeholder,
|
|
@@ -80,9 +71,7 @@ var TextElement = (props) => {
|
|
|
80
71
|
className: props.className,
|
|
81
72
|
variant: props.variant,
|
|
82
73
|
name: props.name,
|
|
83
|
-
onChange: (e) =>
|
|
84
|
-
handleChange(e);
|
|
85
|
-
}
|
|
74
|
+
onChange: (e) => props.onChange(e.target.value)
|
|
86
75
|
}
|
|
87
76
|
));
|
|
88
77
|
};
|
|
@@ -91,46 +80,36 @@ var TextElement = (props) => {
|
|
|
91
80
|
var import_react2 = __toESM(require("react"));
|
|
92
81
|
var import_icons = require("@ant-design/icons");
|
|
93
82
|
var import_antd2 = require("antd");
|
|
94
|
-
var PasswordElement = (
|
|
83
|
+
var PasswordElement = ({ inputData }) => {
|
|
95
84
|
const [passwordVisible, setPasswordVisible] = (0, import_react2.useState)(false);
|
|
96
85
|
const handleVisibilityToggle = () => {
|
|
97
86
|
setPasswordVisible((prev) => !prev);
|
|
98
87
|
};
|
|
99
|
-
const handleChange = (e) => {
|
|
100
|
-
if (props.onChange) {
|
|
101
|
-
props.onChange(e.target.value);
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
88
|
const renderVisibilityIcon = (visible) => visible ? /* @__PURE__ */ import_react2.default.createElement(import_icons.EyeTwoTone, null) : /* @__PURE__ */ import_react2.default.createElement(import_icons.EyeInvisibleOutlined, null);
|
|
105
|
-
|
|
89
|
+
const renderPasswordInput = () => /* @__PURE__ */ import_react2.default.createElement(
|
|
106
90
|
import_antd2.Input.Password,
|
|
107
91
|
{
|
|
108
|
-
placeholder:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
},
|
|
92
|
+
placeholder: inputData.placeholder,
|
|
93
|
+
id: inputData.id,
|
|
94
|
+
prefix: inputData.prefix,
|
|
95
|
+
addonBefore: inputData.addonBefore,
|
|
96
|
+
type: inputData.type,
|
|
114
97
|
iconRender: renderVisibilityIcon,
|
|
115
|
-
visibilityToggle: {
|
|
116
|
-
visible: passwordVisible,
|
|
117
|
-
onVisibleChange: handleVisibilityToggle
|
|
118
|
-
}
|
|
98
|
+
visibilityToggle: { visible: passwordVisible, onVisibleChange: handleVisibilityToggle }
|
|
119
99
|
}
|
|
120
|
-
)
|
|
100
|
+
);
|
|
101
|
+
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")));
|
|
121
102
|
};
|
|
122
103
|
|
|
123
104
|
// src/Components/NumberElement.tsx
|
|
124
105
|
var import_react3 = __toESM(require("react"));
|
|
125
106
|
var import_antd3 = require("antd");
|
|
126
107
|
var NumberElement = (props) => {
|
|
127
|
-
const
|
|
108
|
+
const handleInputChange = (e) => {
|
|
128
109
|
const newValue = e.target.value.replace(/[^0-9]/g, "");
|
|
129
|
-
|
|
130
|
-
props.onChange(newValue);
|
|
131
|
-
}
|
|
110
|
+
props.onChange(newValue);
|
|
132
111
|
};
|
|
133
|
-
return /* @__PURE__ */ import_react3.default.createElement(
|
|
112
|
+
return /* @__PURE__ */ import_react3.default.createElement(
|
|
134
113
|
import_antd3.Input,
|
|
135
114
|
{
|
|
136
115
|
placeholder: props.placeholder,
|
|
@@ -145,11 +124,9 @@ var NumberElement = (props) => {
|
|
|
145
124
|
className: props.className,
|
|
146
125
|
variant: props.variant,
|
|
147
126
|
name: props.name,
|
|
148
|
-
onChange:
|
|
149
|
-
handleChange(e);
|
|
150
|
-
}
|
|
127
|
+
onChange: handleInputChange
|
|
151
128
|
}
|
|
152
|
-
)
|
|
129
|
+
);
|
|
153
130
|
};
|
|
154
131
|
|
|
155
132
|
// src/Components/TextareaElement.tsx
|
|
@@ -157,12 +134,7 @@ var import_react4 = __toESM(require("react"));
|
|
|
157
134
|
var import_antd4 = require("antd");
|
|
158
135
|
var { TextArea } = import_antd4.Input;
|
|
159
136
|
var TextareaElement = (props) => {
|
|
160
|
-
|
|
161
|
-
if (props.onChange) {
|
|
162
|
-
props.onChange(e.target.value);
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
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(
|
|
137
|
+
return /* @__PURE__ */ import_react4.default.createElement(import_antd4.Flex, null, /* @__PURE__ */ import_react4.default.createElement(
|
|
166
138
|
TextArea,
|
|
167
139
|
{
|
|
168
140
|
placeholder: props.placeholder,
|
|
@@ -176,9 +148,7 @@ var TextareaElement = (props) => {
|
|
|
176
148
|
name: props.name,
|
|
177
149
|
showCount: true,
|
|
178
150
|
maxLength: props.maxLength,
|
|
179
|
-
onChange: (e) =>
|
|
180
|
-
handleChange(e);
|
|
181
|
-
}
|
|
151
|
+
onChange: (e) => props.onChange(e.target.value)
|
|
182
152
|
}
|
|
183
153
|
));
|
|
184
154
|
};
|
|
@@ -186,19 +156,24 @@ var TextareaElement = (props) => {
|
|
|
186
156
|
// src/Components/SelectElement.tsx
|
|
187
157
|
var import_react5 = __toESM(require("react"));
|
|
188
158
|
var import_antd5 = require("antd");
|
|
159
|
+
var labelRender = (props) => {
|
|
160
|
+
const { label, value } = props;
|
|
161
|
+
if (label) {
|
|
162
|
+
return value;
|
|
163
|
+
}
|
|
164
|
+
return /* @__PURE__ */ import_react5.default.createElement("span", null, "select gender");
|
|
165
|
+
};
|
|
189
166
|
var SelectElement = (props) => {
|
|
190
167
|
const handleChange = (value) => {
|
|
191
|
-
console.log("sigleselectvalue----", value);
|
|
192
168
|
if (props.onChange) {
|
|
193
|
-
|
|
194
|
-
props.onChange(filterOption2);
|
|
169
|
+
props.onChange(value);
|
|
195
170
|
}
|
|
196
171
|
};
|
|
197
|
-
return /* @__PURE__ */ import_react5.default.createElement(
|
|
172
|
+
return /* @__PURE__ */ import_react5.default.createElement(
|
|
198
173
|
import_antd5.Select,
|
|
199
174
|
{
|
|
200
|
-
|
|
201
|
-
options: props.
|
|
175
|
+
labelRender,
|
|
176
|
+
options: props.fieldNames,
|
|
202
177
|
placeholder: props.placeholder,
|
|
203
178
|
allowClear: true,
|
|
204
179
|
defaultValue: props.defaultValue,
|
|
@@ -210,7 +185,7 @@ var SelectElement = (props) => {
|
|
|
210
185
|
variant: props.variant,
|
|
211
186
|
onChange: handleChange
|
|
212
187
|
}
|
|
213
|
-
)
|
|
188
|
+
);
|
|
214
189
|
};
|
|
215
190
|
|
|
216
191
|
// src/Components/RadioElement.tsx
|
|
@@ -270,8 +245,7 @@ var CheckboxElement = (props) => {
|
|
|
270
245
|
const handleChange = (list) => {
|
|
271
246
|
setCheckedList(list);
|
|
272
247
|
if (props.onChange) {
|
|
273
|
-
|
|
274
|
-
props.onChange(selectedOptions);
|
|
248
|
+
props.onChange(list);
|
|
275
249
|
}
|
|
276
250
|
};
|
|
277
251
|
const onHandleAllChanges = (e) => {
|
|
@@ -306,13 +280,59 @@ var CheckboxElement = (props) => {
|
|
|
306
280
|
};
|
|
307
281
|
|
|
308
282
|
// src/Components/CkEditor.tsx
|
|
309
|
-
var import_react8 =
|
|
283
|
+
var import_react8 = require("react");
|
|
284
|
+
var import_tinymce_react = require("@tinymce/tinymce-react");
|
|
285
|
+
var import_react9 = __toESM(require("react"));
|
|
310
286
|
var CkEditor = (props) => {
|
|
311
|
-
|
|
287
|
+
const editorRef = (0, import_react8.useRef)(null);
|
|
288
|
+
const log = () => {
|
|
289
|
+
if (editorRef.current) {
|
|
290
|
+
let content = editorRef.current.getContent();
|
|
291
|
+
if (props.onChange) {
|
|
292
|
+
props.onChange(content);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
return /* @__PURE__ */ import_react9.default.createElement("div", null, /* @__PURE__ */ import_react9.default.createElement(
|
|
297
|
+
import_tinymce_react.Editor,
|
|
298
|
+
{
|
|
299
|
+
apiKey: "rwpgt7maa54n0pe5mglhkl686p7h57sg6z636n6gf2mio1b9",
|
|
300
|
+
onInit: (_evt, editor) => {
|
|
301
|
+
if (editor) editorRef.current = editor;
|
|
302
|
+
},
|
|
303
|
+
initialValue: "<p>This is the initial content of the editor.</p>",
|
|
304
|
+
init: {
|
|
305
|
+
height: 500,
|
|
306
|
+
menubar: false,
|
|
307
|
+
plugins: [
|
|
308
|
+
"advlist",
|
|
309
|
+
"autolink",
|
|
310
|
+
"lists",
|
|
311
|
+
"link",
|
|
312
|
+
"image",
|
|
313
|
+
"charmap",
|
|
314
|
+
"preview",
|
|
315
|
+
"anchor",
|
|
316
|
+
"searchreplace",
|
|
317
|
+
"visualblocks",
|
|
318
|
+
"code",
|
|
319
|
+
"fullscreen",
|
|
320
|
+
"insertdatetime",
|
|
321
|
+
"media",
|
|
322
|
+
"table",
|
|
323
|
+
"code",
|
|
324
|
+
"help",
|
|
325
|
+
"wordcount"
|
|
326
|
+
],
|
|
327
|
+
toolbar: "undo redo | blocks | bold italic forecolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | help",
|
|
328
|
+
content_style: "body { font-family:Helvetica,Arial,sans-serif; font-size:14px }"
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
), /* @__PURE__ */ import_react9.default.createElement("button", { onClick: log }, "Log editor content"));
|
|
312
332
|
};
|
|
313
333
|
|
|
314
334
|
// src/Components/Select/SingleSelectElement.tsx
|
|
315
|
-
var
|
|
335
|
+
var import_react10 = __toESM(require("react"));
|
|
316
336
|
var import_antd8 = require("antd");
|
|
317
337
|
var onSearch = (value) => {
|
|
318
338
|
console.log("search:", value);
|
|
@@ -321,14 +341,12 @@ var filterOption = (input, option) => (option?.label ?? "").toLowerCase().includ
|
|
|
321
341
|
var SingleSelectElement = (props) => {
|
|
322
342
|
const handleChange = (values) => {
|
|
323
343
|
if (props.onChange) {
|
|
324
|
-
const option = props.dropDownOptions?.find(
|
|
325
|
-
(option2) => String(option2.title) === values
|
|
326
|
-
);
|
|
344
|
+
const option = props.dropDownOptions?.find((option2) => String(option2.title) === values);
|
|
327
345
|
const selectedOption = { id: option?.id, value: values };
|
|
328
346
|
props.onChange([selectedOption]);
|
|
329
347
|
}
|
|
330
348
|
};
|
|
331
|
-
return /* @__PURE__ */
|
|
349
|
+
return /* @__PURE__ */ import_react10.default.createElement(
|
|
332
350
|
import_antd8.Select,
|
|
333
351
|
{
|
|
334
352
|
showSearch: true,
|
|
@@ -337,17 +355,13 @@ var SingleSelectElement = (props) => {
|
|
|
337
355
|
onChange: handleChange,
|
|
338
356
|
onSearch,
|
|
339
357
|
filterOption,
|
|
340
|
-
options: props.dropDownOptions?.map((eachOption) => ({
|
|
341
|
-
label: String(eachOption.title),
|
|
342
|
-
value: String(eachOption.title),
|
|
343
|
-
id: String(eachOption.id)
|
|
344
|
-
}))
|
|
358
|
+
options: props.dropDownOptions?.map((eachOption) => ({ label: String(eachOption.title), value: String(eachOption.title), id: String(eachOption.id) }))
|
|
345
359
|
}
|
|
346
360
|
);
|
|
347
361
|
};
|
|
348
362
|
|
|
349
363
|
// src/Components/Select/MultipleSelectElement.tsx
|
|
350
|
-
var
|
|
364
|
+
var import_react11 = __toESM(require("react"));
|
|
351
365
|
var import_antd9 = require("antd");
|
|
352
366
|
var MultipleSelectElement = (props) => {
|
|
353
367
|
const handleChange = (values) => {
|
|
@@ -359,7 +373,7 @@ var MultipleSelectElement = (props) => {
|
|
|
359
373
|
props.onChange(selectedOptions);
|
|
360
374
|
}
|
|
361
375
|
};
|
|
362
|
-
return /* @__PURE__ */
|
|
376
|
+
return /* @__PURE__ */ import_react11.default.createElement(
|
|
363
377
|
import_antd9.Select,
|
|
364
378
|
{
|
|
365
379
|
mode: "multiple",
|
|
@@ -371,26 +385,26 @@ var MultipleSelectElement = (props) => {
|
|
|
371
385
|
};
|
|
372
386
|
|
|
373
387
|
// src/Components/Button.tsx
|
|
374
|
-
var
|
|
388
|
+
var import_react12 = __toESM(require("react"));
|
|
375
389
|
var ButtonElement = (props) => {
|
|
376
|
-
return /* @__PURE__ */
|
|
390
|
+
return /* @__PURE__ */ import_react12.default.createElement(
|
|
377
391
|
"button",
|
|
378
392
|
{
|
|
379
393
|
onClick: () => props.onClick && props.onClick(),
|
|
380
394
|
className: `${props.className ? props.className : ""}`
|
|
381
395
|
},
|
|
382
|
-
props.icon && /* @__PURE__ */
|
|
396
|
+
props.icon && /* @__PURE__ */ import_react12.default.createElement("img", { src: props.icon }),
|
|
383
397
|
props.label
|
|
384
398
|
);
|
|
385
399
|
};
|
|
386
400
|
|
|
387
401
|
// src/Components/AddMoreTable.tsx
|
|
388
|
-
var
|
|
402
|
+
var import_react13 = __toESM(require("react"));
|
|
389
403
|
var import_antd10 = require("antd");
|
|
390
404
|
var import_icons2 = require("@ant-design/icons");
|
|
391
405
|
var AddMoreTable = (props) => {
|
|
392
406
|
const { thead, tbody } = props;
|
|
393
|
-
const [rows, setRows] = (0,
|
|
407
|
+
const [rows, setRows] = (0, import_react13.useState)(tbody || []);
|
|
394
408
|
const onHandleRows = () => {
|
|
395
409
|
const newId = rows.length > 0 ? rows[rows.length - 1].id + 1 : 1;
|
|
396
410
|
let newRow = {
|
|
@@ -455,16 +469,16 @@ var AddMoreTable = (props) => {
|
|
|
455
469
|
});
|
|
456
470
|
});
|
|
457
471
|
};
|
|
458
|
-
(0,
|
|
472
|
+
(0, import_react13.useEffect)(() => {
|
|
459
473
|
console.log(rows);
|
|
460
474
|
}, [rows]);
|
|
461
475
|
const renderInputElement = (element, value) => {
|
|
462
476
|
if (!element) return null;
|
|
463
477
|
const { element: type, label } = element;
|
|
464
478
|
if (type === "single-select") {
|
|
465
|
-
return /* @__PURE__ */
|
|
479
|
+
return /* @__PURE__ */ import_react13.default.createElement(SingleSelectElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false });
|
|
466
480
|
} else if (type === "textarea") {
|
|
467
|
-
return /* @__PURE__ */
|
|
481
|
+
return /* @__PURE__ */ import_react13.default.createElement(TextareaElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false });
|
|
468
482
|
} else {
|
|
469
483
|
return null;
|
|
470
484
|
}
|
|
@@ -481,13 +495,13 @@ var AddMoreTable = (props) => {
|
|
|
481
495
|
eachRow.variable_data.forEach((variable, subIndex) => {
|
|
482
496
|
Object.keys(variable).forEach((key) => {
|
|
483
497
|
if (key === "SubRows") {
|
|
484
|
-
rowData[`${key}`] = /* @__PURE__ */
|
|
498
|
+
rowData[`${key}`] = /* @__PURE__ */ import_react13.default.createElement("div", { key: subIndex }, eachRow.variable_data.length > 1 && /* @__PURE__ */ import_react13.default.createElement(import_antd10.Button, { onClick: () => onHandleSubRowsDelete(rowIndex, subIndex) }, /* @__PURE__ */ import_react13.default.createElement(import_icons2.DeleteOutlined, null)), subIndex === eachRow.variable_data.length - 1 && /* @__PURE__ */ import_react13.default.createElement(import_antd10.Button, { onClick: () => onHandleSubRowsAdd(rowIndex) }, /* @__PURE__ */ import_react13.default.createElement(import_icons2.PlusOutlined, null)));
|
|
485
499
|
} else {
|
|
486
500
|
rowData[`${key}`] = renderInputElement(variable[key]);
|
|
487
501
|
}
|
|
488
502
|
});
|
|
489
503
|
});
|
|
490
|
-
rowData.actions = /* @__PURE__ */
|
|
504
|
+
rowData.actions = /* @__PURE__ */ import_react13.default.createElement("div", null, /* @__PURE__ */ import_react13.default.createElement(import_antd10.Button, { onClick: () => onHandleDelete(eachRow.id) }, /* @__PURE__ */ import_react13.default.createElement(import_icons2.DeleteOutlined, null)), rowIndex === rows.length - 1 && /* @__PURE__ */ import_react13.default.createElement(import_antd10.Button, { onClick: onHandleRows }, /* @__PURE__ */ import_react13.default.createElement(import_icons2.PlusOutlined, null)));
|
|
491
505
|
console.log("=====rowdata", rowData);
|
|
492
506
|
return rowData;
|
|
493
507
|
});
|
|
@@ -503,7 +517,7 @@ var AddMoreTable = (props) => {
|
|
|
503
517
|
key: "actions"
|
|
504
518
|
});
|
|
505
519
|
}
|
|
506
|
-
return /* @__PURE__ */
|
|
520
|
+
return /* @__PURE__ */ import_react13.default.createElement(
|
|
507
521
|
import_antd10.Table,
|
|
508
522
|
{
|
|
509
523
|
columns,
|
|
@@ -515,44 +529,44 @@ var AddMoreTable = (props) => {
|
|
|
515
529
|
};
|
|
516
530
|
|
|
517
531
|
// src/Components/Sidebar.tsx
|
|
518
|
-
var
|
|
532
|
+
var import_react14 = __toESM(require("react"));
|
|
519
533
|
var Sidebar = (props) => {
|
|
520
534
|
const handleChange = (item) => {
|
|
521
535
|
if (props.onChange) {
|
|
522
536
|
props.onChange(item);
|
|
523
537
|
}
|
|
524
538
|
};
|
|
525
|
-
return /* @__PURE__ */
|
|
526
|
-
return /* @__PURE__ */
|
|
539
|
+
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) => {
|
|
540
|
+
return /* @__PURE__ */ import_react14.default.createElement("li", { onClick: () => {
|
|
527
541
|
handleChange(item);
|
|
528
|
-
}, key: item.label, className: `${props.listItemClassName} ${item.active && props.activeClassName}` }, /* @__PURE__ */
|
|
542
|
+
}, 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));
|
|
529
543
|
})));
|
|
530
544
|
};
|
|
531
545
|
|
|
532
546
|
// src/Components/Navbar.tsx
|
|
533
|
-
var
|
|
547
|
+
var import_react18 = __toESM(require("react"));
|
|
534
548
|
|
|
535
549
|
// src/Components/Notification.tsx
|
|
536
|
-
var
|
|
550
|
+
var import_react15 = __toESM(require("react"));
|
|
537
551
|
var import_antd11 = require("antd");
|
|
538
552
|
var import_io = require("react-icons/io");
|
|
539
553
|
var popoverContentStyle = {
|
|
540
554
|
minWidth: "300px",
|
|
541
555
|
maxWidth: "100%"
|
|
542
556
|
};
|
|
543
|
-
var Notification = (props) => /* @__PURE__ */
|
|
557
|
+
var Notification = (props) => /* @__PURE__ */ import_react15.default.createElement(
|
|
544
558
|
import_antd11.Popover,
|
|
545
559
|
{
|
|
546
560
|
className: props.className,
|
|
547
|
-
content: /* @__PURE__ */
|
|
561
|
+
content: /* @__PURE__ */ import_react15.default.createElement("div", { style: popoverContentStyle }, " ", /* @__PURE__ */ import_react15.default.createElement(
|
|
548
562
|
import_antd11.List,
|
|
549
563
|
{
|
|
550
564
|
itemLayout: "horizontal",
|
|
551
565
|
dataSource: props.items,
|
|
552
|
-
renderItem: (item, index) => /* @__PURE__ */
|
|
566
|
+
renderItem: (item, index) => /* @__PURE__ */ import_react15.default.createElement(import_antd11.List.Item, { key: item.text }, /* @__PURE__ */ import_react15.default.createElement(
|
|
553
567
|
import_antd11.List.Item.Meta,
|
|
554
568
|
{
|
|
555
|
-
avatar: /* @__PURE__ */
|
|
569
|
+
avatar: /* @__PURE__ */ import_react15.default.createElement(import_antd11.Avatar, { src: `https://api.dicebear.com/7.x/miniavs/svg?seed=${index}` }),
|
|
556
570
|
title: item.text,
|
|
557
571
|
description: item.time
|
|
558
572
|
}
|
|
@@ -562,51 +576,51 @@ var Notification = (props) => /* @__PURE__ */ import_react14.default.createEleme
|
|
|
562
576
|
trigger: "focus",
|
|
563
577
|
placement: "bottomRight"
|
|
564
578
|
},
|
|
565
|
-
/* @__PURE__ */
|
|
579
|
+
/* @__PURE__ */ import_react15.default.createElement(import_antd11.Button, { className: props.buttonClassName }, /* @__PURE__ */ import_react15.default.createElement(import_antd11.Badge, { size: "small", count: props.count }, /* @__PURE__ */ import_react15.default.createElement("span", { className: props.iconsClassName }, /* @__PURE__ */ import_react15.default.createElement(import_io.IoIosNotifications, null))))
|
|
566
580
|
);
|
|
567
581
|
|
|
568
582
|
// src/Components/SpanElement.tsx
|
|
569
|
-
var
|
|
570
|
-
var SpanElement = (props) => /* @__PURE__ */
|
|
583
|
+
var import_react16 = __toESM(require("react"));
|
|
584
|
+
var SpanElement = (props) => /* @__PURE__ */ import_react16.default.createElement("span", { className: props.className }, props.label);
|
|
571
585
|
|
|
572
586
|
// src/Components/Profile.tsx
|
|
573
|
-
var
|
|
587
|
+
var import_react17 = __toESM(require("react"));
|
|
574
588
|
var import_antd12 = require("antd");
|
|
575
589
|
var import_icons3 = require("@ant-design/icons");
|
|
576
|
-
var Profile = (props) => /* @__PURE__ */
|
|
590
|
+
var Profile = (props) => /* @__PURE__ */ import_react17.default.createElement("div", { className: props.className }, /* @__PURE__ */ import_react17.default.createElement(import_antd12.Avatar, { style: { backgroundColor: "#87d068", marginRight: "10px" }, icon: /* @__PURE__ */ import_react17.default.createElement(import_icons3.UserOutlined, null) }), /* @__PURE__ */ import_react17.default.createElement("div", { className: props.profileSubClassName }, /* @__PURE__ */ import_react17.default.createElement("p", null, props.primaryText), /* @__PURE__ */ import_react17.default.createElement("p", { className: props.secondTextClassName }, " ", props.secondaryText)));
|
|
577
591
|
|
|
578
592
|
// src/Components/Navbar.tsx
|
|
579
593
|
var Navbar = (props) => {
|
|
580
|
-
return /* @__PURE__ */
|
|
594
|
+
return /* @__PURE__ */ import_react18.default.createElement("div", { className: `${props.className}`, key: props.name }, props.items && props.items.map((item) => {
|
|
581
595
|
if (item.element === "span") {
|
|
582
|
-
return /* @__PURE__ */
|
|
596
|
+
return /* @__PURE__ */ import_react18.default.createElement(SpanElement, { ...item });
|
|
583
597
|
} else if (item.element === "notifications") {
|
|
584
|
-
return /* @__PURE__ */
|
|
598
|
+
return /* @__PURE__ */ import_react18.default.createElement(Notification, { ...item });
|
|
585
599
|
} else if (item.name === "profile") {
|
|
586
|
-
return /* @__PURE__ */
|
|
600
|
+
return /* @__PURE__ */ import_react18.default.createElement(Profile, { ...item });
|
|
587
601
|
}
|
|
588
602
|
return null;
|
|
589
603
|
}));
|
|
590
604
|
};
|
|
591
605
|
|
|
592
606
|
// src/Components/TableElement.tsx
|
|
593
|
-
var
|
|
607
|
+
var import_react21 = __toESM(require("react"));
|
|
594
608
|
var import_antd14 = require("antd");
|
|
595
609
|
|
|
596
610
|
// src/Components/Model.tsx
|
|
597
|
-
var
|
|
611
|
+
var import_react20 = __toESM(require("react"));
|
|
598
612
|
var import_antd13 = require("antd");
|
|
599
613
|
|
|
600
614
|
// src/Components/ModelBody.tsx
|
|
601
|
-
var
|
|
615
|
+
var import_react19 = __toESM(require("react"));
|
|
602
616
|
var ModelBody = (props) => {
|
|
603
|
-
return /* @__PURE__ */
|
|
617
|
+
return /* @__PURE__ */ import_react19.default.createElement("div", { className: props.modalContent && props.modalContent.className }, props.modalContent && props.modalContent.fields.map((eachField) => {
|
|
604
618
|
if (eachField.element === "div") {
|
|
605
|
-
return /* @__PURE__ */
|
|
619
|
+
return /* @__PURE__ */ import_react19.default.createElement("div", { className: eachField.className }, eachField.label);
|
|
606
620
|
} else if (eachField.element === "input-radio") {
|
|
607
|
-
return /* @__PURE__ */
|
|
621
|
+
return /* @__PURE__ */ import_react19.default.createElement("div", { className: eachField.className }, /* @__PURE__ */ import_react19.default.createElement(RadioElement, { ...eachField }));
|
|
608
622
|
} else if (eachField.element === "button") {
|
|
609
|
-
return /* @__PURE__ */
|
|
623
|
+
return /* @__PURE__ */ import_react19.default.createElement("div", { className: eachField.className }, /* @__PURE__ */ import_react19.default.createElement(ButtonElement, { ...eachField }));
|
|
610
624
|
} else {
|
|
611
625
|
return null;
|
|
612
626
|
}
|
|
@@ -616,7 +630,7 @@ var ModelBody = (props) => {
|
|
|
616
630
|
// src/Components/Model.tsx
|
|
617
631
|
var ModelElement = (props) => {
|
|
618
632
|
const { model, onCancel, selectedRecord, columns } = props;
|
|
619
|
-
return /* @__PURE__ */
|
|
633
|
+
return /* @__PURE__ */ import_react20.default.createElement(
|
|
620
634
|
import_antd13.Modal,
|
|
621
635
|
{
|
|
622
636
|
centered: true,
|
|
@@ -624,7 +638,7 @@ var ModelElement = (props) => {
|
|
|
624
638
|
onCancel,
|
|
625
639
|
footer: null,
|
|
626
640
|
width: 850,
|
|
627
|
-
title: /* @__PURE__ */
|
|
641
|
+
title: /* @__PURE__ */ import_react20.default.createElement(
|
|
628
642
|
"div",
|
|
629
643
|
{
|
|
630
644
|
style: {
|
|
@@ -637,19 +651,19 @@ var ModelElement = (props) => {
|
|
|
637
651
|
},
|
|
638
652
|
Object.entries(selectedRecord).map(([key, value]) => {
|
|
639
653
|
const record = columns.filter((eachColumn) => eachColumn.key === key);
|
|
640
|
-
return record.length > 0 ? /* @__PURE__ */
|
|
654
|
+
return record.length > 0 ? /* @__PURE__ */ import_react20.default.createElement("p", { style: { fontWeight: "500", padding: "10px" }, key }, /* @__PURE__ */ import_react20.default.createElement("span", { style: { fontWeight: "200", color: "gray", paddingRight: "10px" } }, record[0].title), String(value)) : "";
|
|
641
655
|
})
|
|
642
656
|
)
|
|
643
657
|
},
|
|
644
|
-
/* @__PURE__ */
|
|
658
|
+
/* @__PURE__ */ import_react20.default.createElement(ModelBody, { ...props })
|
|
645
659
|
);
|
|
646
660
|
};
|
|
647
661
|
|
|
648
662
|
// src/Components/TableElement.tsx
|
|
649
663
|
var TableElement = (props) => {
|
|
650
664
|
const { thead, tbody } = props;
|
|
651
|
-
const [selectedRecord, setSelectedRecord] = (0,
|
|
652
|
-
const [model, setModel] = (0,
|
|
665
|
+
const [selectedRecord, setSelectedRecord] = (0, import_react21.useState)({});
|
|
666
|
+
const [model, setModel] = (0, import_react21.useState)(false);
|
|
653
667
|
const handleChange = (record) => {
|
|
654
668
|
if (props.onChange) {
|
|
655
669
|
props.onChange(record);
|
|
@@ -684,7 +698,7 @@ var TableElement = (props) => {
|
|
|
684
698
|
[columns[0].key]: index + 1
|
|
685
699
|
}));
|
|
686
700
|
const count = dataSource ? dataSource.length : 0;
|
|
687
|
-
return /* @__PURE__ */
|
|
701
|
+
return /* @__PURE__ */ import_react21.default.createElement(import_react21.default.Fragment, null, /* @__PURE__ */ import_react21.default.createElement(
|
|
688
702
|
import_antd14.Table,
|
|
689
703
|
{
|
|
690
704
|
pagination: {
|
|
@@ -707,16 +721,16 @@ var TableElement = (props) => {
|
|
|
707
721
|
};
|
|
708
722
|
}
|
|
709
723
|
}
|
|
710
|
-
), model && /* @__PURE__ */
|
|
724
|
+
), model && /* @__PURE__ */ import_react21.default.createElement(ModelElement, { selectedRecord, ...props, columns, model, onCancel: () => setModel(false) }));
|
|
711
725
|
};
|
|
712
726
|
|
|
713
727
|
// src/Components/DatePicker.tsx
|
|
714
|
-
var
|
|
728
|
+
var import_react22 = __toESM(require("react"));
|
|
715
729
|
var import_antd15 = require("antd");
|
|
716
730
|
var import_icons4 = require("@ant-design/icons");
|
|
717
731
|
var import_moment = __toESM(require("moment"));
|
|
718
732
|
var DatePickerElement = (props) => {
|
|
719
|
-
const [date, setDate] = (0,
|
|
733
|
+
const [date, setDate] = (0, import_react22.useState)(null);
|
|
720
734
|
const handleChange = (date2, dateString) => {
|
|
721
735
|
console.log("date---------", date2);
|
|
722
736
|
console.log("datestring", dateString);
|
|
@@ -751,7 +765,7 @@ var DatePickerElement = (props) => {
|
|
|
751
765
|
props.onChange(newDate.format("lll"));
|
|
752
766
|
}
|
|
753
767
|
};
|
|
754
|
-
return /* @__PURE__ */
|
|
768
|
+
return /* @__PURE__ */ import_react22.default.createElement("div", null, /* @__PURE__ */ import_react22.default.createElement("button", { onClick: onHandleDecrement }, /* @__PURE__ */ import_react22.default.createElement(import_icons4.LeftOutlined, null)), /* @__PURE__ */ import_react22.default.createElement(
|
|
755
769
|
import_antd15.DatePicker,
|
|
756
770
|
{
|
|
757
771
|
placeholder: props.placeholder,
|
|
@@ -759,11 +773,11 @@ var DatePickerElement = (props) => {
|
|
|
759
773
|
variant: "borderless",
|
|
760
774
|
onChange: handleChange
|
|
761
775
|
}
|
|
762
|
-
), /* @__PURE__ */
|
|
776
|
+
), /* @__PURE__ */ import_react22.default.createElement("button", { onClick: onHandleIncrement }, /* @__PURE__ */ import_react22.default.createElement(import_icons4.RightOutlined, null)));
|
|
763
777
|
};
|
|
764
778
|
|
|
765
779
|
// src/Components/DateRangePickerElement.tsx
|
|
766
|
-
var
|
|
780
|
+
var import_react23 = __toESM(require("react"));
|
|
767
781
|
var import_antd16 = require("antd");
|
|
768
782
|
var import_dayjs = __toESM(require("dayjs"));
|
|
769
783
|
var DateRangePickerElement = (props) => {
|
|
@@ -781,128 +795,33 @@ var DateRangePickerElement = (props) => {
|
|
|
781
795
|
{ label: "Last 30 Days", value: [(0, import_dayjs.default)().add(-30, "d"), (0, import_dayjs.default)()] },
|
|
782
796
|
{ label: "Last 90 Days", value: [(0, import_dayjs.default)().add(-90, "d"), (0, import_dayjs.default)()] }
|
|
783
797
|
];
|
|
784
|
-
return /* @__PURE__ */
|
|
798
|
+
return /* @__PURE__ */ import_react23.default.createElement(import_antd16.Space, { direction: "vertical", size: 12 }, /* @__PURE__ */ import_react23.default.createElement(RangePicker, { presets: rangePresets, onChange: handleChange }));
|
|
785
799
|
};
|
|
786
800
|
|
|
787
|
-
// src/Components/
|
|
788
|
-
var import_react23 = __toESM(require("react"));
|
|
789
|
-
var Image = (props) => {
|
|
790
|
-
return /* @__PURE__ */ import_react23.default.createElement("div", null, /* @__PURE__ */ import_react23.default.createElement("img", { className: props.className, src: props.img, alt: "image" }));
|
|
791
|
-
};
|
|
792
|
-
|
|
793
|
-
// src/Components/SingleCheckbox.tsx
|
|
801
|
+
// src/Components/UploadElement.tsx
|
|
794
802
|
var import_react24 = __toESM(require("react"));
|
|
795
|
-
var import_antd17 = require("antd");
|
|
796
|
-
var SingleCheckbox = (props) => {
|
|
797
|
-
const handleChange = (e) => {
|
|
798
|
-
if (props.onChange) {
|
|
799
|
-
props.onChange(e.target.checked);
|
|
800
|
-
}
|
|
801
|
-
};
|
|
802
|
-
return /* @__PURE__ */ import_react24.default.createElement(import_antd17.Checkbox, { onChange: (e) => handleChange(e), className: props.className }, props.label);
|
|
803
|
-
};
|
|
804
|
-
|
|
805
|
-
// src/Components/DropDownGroup.tsx
|
|
806
|
-
var import_react25 = __toESM(require("react"));
|
|
807
|
-
var import_antd18 = require("antd");
|
|
808
|
-
var DropDownGroup = (props) => {
|
|
809
|
-
const [selectedValue, setSelectedValue] = (0, import_react25.useState)({ firstValue: {}, secondValue: {} });
|
|
810
|
-
console.log(selectedValue);
|
|
811
|
-
const handleFirstChange = (value) => {
|
|
812
|
-
const filterOption2 = props.options?.find((eachOption) => eachOption.value === value);
|
|
813
|
-
setSelectedValue((prev) => {
|
|
814
|
-
const newValue = { ...prev, firstValue: filterOption2 };
|
|
815
|
-
if (newValue.firstValue) {
|
|
816
|
-
props.onChange?.(newValue);
|
|
817
|
-
}
|
|
818
|
-
return newValue;
|
|
819
|
-
});
|
|
820
|
-
};
|
|
821
|
-
const handleSecondChange = (value) => {
|
|
822
|
-
const filterOption2 = props.options?.find((eachOption) => eachOption.value === value);
|
|
823
|
-
setSelectedValue((prev) => {
|
|
824
|
-
const newValue = { ...prev, secondValue: filterOption2 };
|
|
825
|
-
if (newValue.secondValue) {
|
|
826
|
-
props.onChange?.(newValue);
|
|
827
|
-
}
|
|
828
|
-
return newValue;
|
|
829
|
-
});
|
|
830
|
-
};
|
|
831
|
-
return /* @__PURE__ */ import_react25.default.createElement("div", { className: props.className, style: { display: "flex", flexDirection: "row", backgroundColor: "white", borderRadius: 10, border: "1px solid gray", width: "100px" } }, /* @__PURE__ */ import_react25.default.createElement(
|
|
832
|
-
import_antd18.Select,
|
|
833
|
-
{
|
|
834
|
-
onChange: handleFirstChange,
|
|
835
|
-
variant: props.variant,
|
|
836
|
-
options: props.options
|
|
837
|
-
}
|
|
838
|
-
), /* @__PURE__ */ import_react25.default.createElement("div", { style: { borderLeft: "1px solid gray", height: "33px" } }), /* @__PURE__ */ import_react25.default.createElement(
|
|
839
|
-
import_antd18.Select,
|
|
840
|
-
{
|
|
841
|
-
onChange: handleSecondChange,
|
|
842
|
-
variant: props.variant,
|
|
843
|
-
options: props.options
|
|
844
|
-
}
|
|
845
|
-
));
|
|
846
|
-
};
|
|
847
|
-
|
|
848
|
-
// src/Components/FilesUpload.tsx
|
|
849
|
-
var import_react26 = __toESM(require("react"));
|
|
850
|
-
var import_antd19 = require("antd");
|
|
851
803
|
var import_icons5 = require("@ant-design/icons");
|
|
852
|
-
var
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
804
|
+
var import_antd17 = require("antd");
|
|
805
|
+
var uploadProps = {
|
|
806
|
+
name: "file",
|
|
807
|
+
multiple: true,
|
|
808
|
+
action: "https://660d2bd96ddfa2943b33731c.mockapi.io/api/upload",
|
|
809
|
+
headers: {
|
|
810
|
+
authorization: "authorization-text"
|
|
811
|
+
},
|
|
812
|
+
onChange(info) {
|
|
813
|
+
if (info.file.status !== "uploading") {
|
|
814
|
+
console.log(info.file, info.fileList);
|
|
860
815
|
}
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
if (props.onChange) {
|
|
866
|
-
props.onChange({
|
|
867
|
-
name: props.name,
|
|
868
|
-
value: fileList
|
|
869
|
-
});
|
|
816
|
+
if (info.file.status === "done") {
|
|
817
|
+
import_antd17.message.success(`${info.file.name} file uploaded successfully`);
|
|
818
|
+
} else if (info.file.status === "error") {
|
|
819
|
+
import_antd17.message.error(`${info.file.name} file upload failed.`);
|
|
870
820
|
}
|
|
871
|
-
}
|
|
872
|
-
const customRequest = ({ file, onSuccess }) => {
|
|
873
|
-
setTimeout(() => {
|
|
874
|
-
onSuccess("ok");
|
|
875
|
-
}, 0);
|
|
876
|
-
};
|
|
877
|
-
return /* @__PURE__ */ import_react26.default.createElement("div", null, /* @__PURE__ */ import_react26.default.createElement(
|
|
878
|
-
Dragger,
|
|
879
|
-
{
|
|
880
|
-
action: "",
|
|
881
|
-
accept: props.accept,
|
|
882
|
-
listType: "picture",
|
|
883
|
-
maxCount: props.max_count,
|
|
884
|
-
multiple: true,
|
|
885
|
-
fileList: files,
|
|
886
|
-
beforeUpload,
|
|
887
|
-
onChange: handleChange,
|
|
888
|
-
showUploadList: true,
|
|
889
|
-
customRequest
|
|
890
|
-
},
|
|
891
|
-
/* @__PURE__ */ import_react26.default.createElement("p", null, /* @__PURE__ */ import_react26.default.createElement(import_icons5.InboxOutlined, null)),
|
|
892
|
-
/* @__PURE__ */ import_react26.default.createElement("p", null, "Click or drag file to upload")
|
|
893
|
-
));
|
|
821
|
+
}
|
|
894
822
|
};
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
var import_react27 = __toESM(require("react"));
|
|
898
|
-
var import_antd20 = require("antd");
|
|
899
|
-
var TabsElement = (props) => {
|
|
900
|
-
const handleChange = (key) => {
|
|
901
|
-
if (props.onChange) {
|
|
902
|
-
props.onChange(props.options?.find((eachOption) => eachOption.key === key));
|
|
903
|
-
}
|
|
904
|
-
};
|
|
905
|
-
return /* @__PURE__ */ import_react27.default.createElement(import_antd20.Tabs, { className: props.containerClassName, items: props.options, onChange: handleChange });
|
|
823
|
+
var UploadElement = (props) => {
|
|
824
|
+
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"));
|
|
906
825
|
};
|
|
907
826
|
// Annotate the CommonJS export names for ESM import in node:
|
|
908
827
|
0 && (module.exports = {
|
|
@@ -912,9 +831,6 @@ var TabsElement = (props) => {
|
|
|
912
831
|
CkEditor,
|
|
913
832
|
DatePickerElement,
|
|
914
833
|
DateRangePickerElement,
|
|
915
|
-
DropDownGroup,
|
|
916
|
-
FileUpload,
|
|
917
|
-
Image,
|
|
918
834
|
MultipleSelectElement,
|
|
919
835
|
Navbar,
|
|
920
836
|
NumberElement,
|
|
@@ -922,10 +838,9 @@ var TabsElement = (props) => {
|
|
|
922
838
|
RadioElement,
|
|
923
839
|
SelectElement,
|
|
924
840
|
Sidebar,
|
|
925
|
-
SingleCheckbox,
|
|
926
841
|
SingleSelectElement,
|
|
927
842
|
TableElement,
|
|
928
|
-
TabsElement,
|
|
929
843
|
TextElement,
|
|
930
|
-
TextareaElement
|
|
844
|
+
TextareaElement,
|
|
845
|
+
UploadElement
|
|
931
846
|
});
|