@apexcura/ui-components 0.0.14-Beta9 → 0.0.14-Beta90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +3 -0
- package/dist/index.d.mts +20 -7
- package/dist/index.d.ts +20 -7
- package/dist/index.js +285 -85
- package/dist/index.mjs +291 -95
- package/package.json +3 -3
package/dist/index.css
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -4,9 +4,9 @@ import { UploadFile } from 'antd/lib/upload/interface';
|
|
|
4
4
|
|
|
5
5
|
type ElementType = {
|
|
6
6
|
[x: string]: any;
|
|
7
|
-
selectedStyle
|
|
8
|
-
style
|
|
9
|
-
className
|
|
7
|
+
selectedStyle?: boolean;
|
|
8
|
+
style?: boolean;
|
|
9
|
+
className?: string | undefined;
|
|
10
10
|
placeholder?: string;
|
|
11
11
|
addonBefore?: React.ReactNode;
|
|
12
12
|
defaultValue?: string;
|
|
@@ -26,8 +26,9 @@ type ElementType = {
|
|
|
26
26
|
fields?: any[];
|
|
27
27
|
schema?: any[];
|
|
28
28
|
options?: any[];
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
firstOptions?: any[];
|
|
30
|
+
secondOptions?: any[];
|
|
31
|
+
view?: boolean;
|
|
31
32
|
onChange?: (value: string | number | boolean | object | any[] | undefined) => void;
|
|
32
33
|
onClick?: () => void;
|
|
33
34
|
dropDownOptions?: any[];
|
|
@@ -59,6 +60,10 @@ type ElementType = {
|
|
|
59
60
|
containerClassName?: string;
|
|
60
61
|
selectBefore?: any[];
|
|
61
62
|
selectAfter?: any[];
|
|
63
|
+
isSVGStylesOverride?: boolean;
|
|
64
|
+
rowSelection?: string;
|
|
65
|
+
length?: number;
|
|
66
|
+
imgClassName?: string;
|
|
62
67
|
};
|
|
63
68
|
|
|
64
69
|
declare const TextElement: (props: ElementType) => React$1.JSX.Element;
|
|
@@ -84,7 +89,7 @@ declare const SingleSelectElement: (props: ElementType) => React$1.JSX.Element;
|
|
|
84
89
|
|
|
85
90
|
declare const MultipleSelectElement: (props: ElementType) => React$1.JSX.Element;
|
|
86
91
|
|
|
87
|
-
declare const ButtonElement: React$1.
|
|
92
|
+
declare const ButtonElement: (props: ElementType) => React$1.JSX.Element;
|
|
88
93
|
|
|
89
94
|
declare const AddMoreTable: (props: ElementType) => React$1.JSX.Element;
|
|
90
95
|
|
|
@@ -108,4 +113,12 @@ declare const FileUpload: (props: ElementType) => React$1.JSX.Element;
|
|
|
108
113
|
|
|
109
114
|
declare const TabsElement: (props: ElementType) => React$1.JSX.Element;
|
|
110
115
|
|
|
111
|
-
|
|
116
|
+
declare const SwitchElement: () => React$1.JSX.Element;
|
|
117
|
+
|
|
118
|
+
declare const Upload: (props: ElementType) => React$1.JSX.Element;
|
|
119
|
+
|
|
120
|
+
declare const OtpElement: (props: ElementType) => React$1.JSX.Element;
|
|
121
|
+
|
|
122
|
+
declare const Donut: (props: Object) => React$1.JSX.Element;
|
|
123
|
+
|
|
124
|
+
export { AddMoreTable, ButtonElement, CheckboxElement, CkEditor, DatePickerElement, DateRangePickerElement, Donut, DropDownGroup, FileUpload, Image, MultipleSelectElement, Navbar, NumberElement, OtpElement, PasswordElement, RadioElement, SelectElement, Sidebar, SingleCheckbox, SingleSelectElement, SwitchElement, TableElement, TabsElement, TextElement, TextareaElement, Upload };
|
package/dist/index.d.ts
CHANGED
|
@@ -4,9 +4,9 @@ import { UploadFile } from 'antd/lib/upload/interface';
|
|
|
4
4
|
|
|
5
5
|
type ElementType = {
|
|
6
6
|
[x: string]: any;
|
|
7
|
-
selectedStyle
|
|
8
|
-
style
|
|
9
|
-
className
|
|
7
|
+
selectedStyle?: boolean;
|
|
8
|
+
style?: boolean;
|
|
9
|
+
className?: string | undefined;
|
|
10
10
|
placeholder?: string;
|
|
11
11
|
addonBefore?: React.ReactNode;
|
|
12
12
|
defaultValue?: string;
|
|
@@ -26,8 +26,9 @@ type ElementType = {
|
|
|
26
26
|
fields?: any[];
|
|
27
27
|
schema?: any[];
|
|
28
28
|
options?: any[];
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
firstOptions?: any[];
|
|
30
|
+
secondOptions?: any[];
|
|
31
|
+
view?: boolean;
|
|
31
32
|
onChange?: (value: string | number | boolean | object | any[] | undefined) => void;
|
|
32
33
|
onClick?: () => void;
|
|
33
34
|
dropDownOptions?: any[];
|
|
@@ -59,6 +60,10 @@ type ElementType = {
|
|
|
59
60
|
containerClassName?: string;
|
|
60
61
|
selectBefore?: any[];
|
|
61
62
|
selectAfter?: any[];
|
|
63
|
+
isSVGStylesOverride?: boolean;
|
|
64
|
+
rowSelection?: string;
|
|
65
|
+
length?: number;
|
|
66
|
+
imgClassName?: string;
|
|
62
67
|
};
|
|
63
68
|
|
|
64
69
|
declare const TextElement: (props: ElementType) => React$1.JSX.Element;
|
|
@@ -84,7 +89,7 @@ declare const SingleSelectElement: (props: ElementType) => React$1.JSX.Element;
|
|
|
84
89
|
|
|
85
90
|
declare const MultipleSelectElement: (props: ElementType) => React$1.JSX.Element;
|
|
86
91
|
|
|
87
|
-
declare const ButtonElement: React$1.
|
|
92
|
+
declare const ButtonElement: (props: ElementType) => React$1.JSX.Element;
|
|
88
93
|
|
|
89
94
|
declare const AddMoreTable: (props: ElementType) => React$1.JSX.Element;
|
|
90
95
|
|
|
@@ -108,4 +113,12 @@ declare const FileUpload: (props: ElementType) => React$1.JSX.Element;
|
|
|
108
113
|
|
|
109
114
|
declare const TabsElement: (props: ElementType) => React$1.JSX.Element;
|
|
110
115
|
|
|
111
|
-
|
|
116
|
+
declare const SwitchElement: () => React$1.JSX.Element;
|
|
117
|
+
|
|
118
|
+
declare const Upload: (props: ElementType) => React$1.JSX.Element;
|
|
119
|
+
|
|
120
|
+
declare const OtpElement: (props: ElementType) => React$1.JSX.Element;
|
|
121
|
+
|
|
122
|
+
declare const Donut: (props: Object) => React$1.JSX.Element;
|
|
123
|
+
|
|
124
|
+
export { AddMoreTable, ButtonElement, CheckboxElement, CkEditor, DatePickerElement, DateRangePickerElement, Donut, DropDownGroup, FileUpload, Image, MultipleSelectElement, Navbar, NumberElement, OtpElement, PasswordElement, RadioElement, SelectElement, Sidebar, SingleCheckbox, SingleSelectElement, SwitchElement, TableElement, TabsElement, TextElement, TextareaElement, Upload };
|
package/dist/index.js
CHANGED
|
@@ -36,22 +36,26 @@ __export(src_exports, {
|
|
|
36
36
|
CkEditor: () => CkEditor,
|
|
37
37
|
DatePickerElement: () => DatePickerElement,
|
|
38
38
|
DateRangePickerElement: () => DateRangePickerElement,
|
|
39
|
+
Donut: () => Donut,
|
|
39
40
|
DropDownGroup: () => DropDownGroup,
|
|
40
41
|
FileUpload: () => FileUpload,
|
|
41
42
|
Image: () => Image,
|
|
42
43
|
MultipleSelectElement: () => MultipleSelectElement,
|
|
43
44
|
Navbar: () => Navbar,
|
|
44
45
|
NumberElement: () => NumberElement,
|
|
46
|
+
OtpElement: () => OtpElement,
|
|
45
47
|
PasswordElement: () => PasswordElement,
|
|
46
48
|
RadioElement: () => RadioElement,
|
|
47
49
|
SelectElement: () => SelectElement,
|
|
48
50
|
Sidebar: () => Sidebar,
|
|
49
51
|
SingleCheckbox: () => SingleCheckbox,
|
|
50
52
|
SingleSelectElement: () => SingleSelectElement,
|
|
53
|
+
SwitchElement: () => SwitchElement,
|
|
51
54
|
TableElement: () => TableElement,
|
|
52
55
|
TabsElement: () => TabsElement,
|
|
53
56
|
TextElement: () => TextElement,
|
|
54
|
-
TextareaElement: () => TextareaElement
|
|
57
|
+
TextareaElement: () => TextareaElement,
|
|
58
|
+
Upload: () => Upload2
|
|
55
59
|
});
|
|
56
60
|
module.exports = __toCommonJS(src_exports);
|
|
57
61
|
|
|
@@ -70,6 +74,7 @@ var TextElement = (props) => {
|
|
|
70
74
|
placeholder: props.placeholder,
|
|
71
75
|
allowClear: true,
|
|
72
76
|
id: props.name,
|
|
77
|
+
value: props.value,
|
|
73
78
|
prefix: props.prefix,
|
|
74
79
|
type: props.type,
|
|
75
80
|
status: props.status,
|
|
@@ -129,8 +134,7 @@ var NumberElement = (props) => {
|
|
|
129
134
|
{
|
|
130
135
|
placeholder: props.placeholder,
|
|
131
136
|
addonBefore: props.addonBefore,
|
|
132
|
-
|
|
133
|
-
defaultValue: props.defaultValue,
|
|
137
|
+
value: props.value,
|
|
134
138
|
disabled: props.disabled,
|
|
135
139
|
id: props.name,
|
|
136
140
|
prefix: props.prefix,
|
|
@@ -375,13 +379,74 @@ var MultipleSelectElement = (props) => {
|
|
|
375
379
|
// src/Components/Button.tsx
|
|
376
380
|
var import_react11 = __toESM(require("react"));
|
|
377
381
|
var ButtonElement = (props) => {
|
|
382
|
+
const [svgContent, setSvgContent] = (0, import_react11.useState)(null);
|
|
383
|
+
const [originalSvgContent, setOriginalSvgContent] = (0, import_react11.useState)(null);
|
|
384
|
+
const [hoverColor, setHoverColor] = (0, import_react11.useState)(null);
|
|
385
|
+
(0, import_react11.useEffect)(() => {
|
|
386
|
+
if (props.icon) {
|
|
387
|
+
fetch(props.icon).then((response) => response.text()).then((data) => {
|
|
388
|
+
const tempDiv = document.createElement("div");
|
|
389
|
+
tempDiv.innerHTML = data;
|
|
390
|
+
const svgElement = tempDiv.querySelector("svg");
|
|
391
|
+
if (svgElement) {
|
|
392
|
+
const textColorClass = props.className?.match(/text-[\w-]+/g)?.[0];
|
|
393
|
+
const hoverColorClass = props.className?.match(/hover:text-[\w-]+/g)?.[0];
|
|
394
|
+
if (textColorClass) {
|
|
395
|
+
const tempSpan = document.createElement("span");
|
|
396
|
+
tempSpan.className = textColorClass;
|
|
397
|
+
document.body.appendChild(tempSpan);
|
|
398
|
+
const computedColor = getComputedStyle(tempSpan).color;
|
|
399
|
+
document.body.removeChild(tempSpan);
|
|
400
|
+
const paths = svgElement.querySelectorAll("path");
|
|
401
|
+
paths.forEach((path) => path.setAttribute("fill", computedColor));
|
|
402
|
+
}
|
|
403
|
+
if (hoverColorClass) {
|
|
404
|
+
const tempSpan = document.createElement("span");
|
|
405
|
+
tempSpan.className = hoverColorClass.replace("hover:", "");
|
|
406
|
+
document.body.appendChild(tempSpan);
|
|
407
|
+
const computedHoverColor = getComputedStyle(tempSpan).color;
|
|
408
|
+
document.body.removeChild(tempSpan);
|
|
409
|
+
setHoverColor(computedHoverColor);
|
|
410
|
+
}
|
|
411
|
+
svgElement.setAttribute(
|
|
412
|
+
"class",
|
|
413
|
+
`${props.iconsClassName ? props.iconsClassName : ""}`
|
|
414
|
+
);
|
|
415
|
+
setSvgContent(tempDiv.innerHTML);
|
|
416
|
+
setOriginalSvgContent(tempDiv.innerHTML);
|
|
417
|
+
}
|
|
418
|
+
}).catch((error) => console.error("Error fetching SVG:", error));
|
|
419
|
+
}
|
|
420
|
+
}, [props.icon, props.className]);
|
|
421
|
+
const handleMouseEnter = () => {
|
|
422
|
+
if (hoverColor && originalSvgContent) {
|
|
423
|
+
const tempDiv = document.createElement("div");
|
|
424
|
+
tempDiv.innerHTML = originalSvgContent;
|
|
425
|
+
const svgElement = tempDiv.querySelector("svg");
|
|
426
|
+
const paths = svgElement?.querySelectorAll("path");
|
|
427
|
+
paths?.forEach((path) => path.setAttribute("fill", hoverColor));
|
|
428
|
+
setSvgContent(tempDiv.innerHTML);
|
|
429
|
+
}
|
|
430
|
+
};
|
|
431
|
+
const handleMouseLeave = () => {
|
|
432
|
+
if (originalSvgContent) {
|
|
433
|
+
setSvgContent(originalSvgContent);
|
|
434
|
+
}
|
|
435
|
+
};
|
|
378
436
|
return /* @__PURE__ */ import_react11.default.createElement(
|
|
379
437
|
"button",
|
|
380
438
|
{
|
|
381
|
-
onClick:
|
|
382
|
-
className: `${props.className ? props.className : ""}
|
|
439
|
+
onClick: props.onClick,
|
|
440
|
+
className: `${props.className ? props.className : ""}`,
|
|
441
|
+
onMouseEnter: handleMouseEnter,
|
|
442
|
+
onMouseLeave: handleMouseLeave
|
|
383
443
|
},
|
|
384
|
-
props.icon && /* @__PURE__ */ import_react11.default.createElement("img", { className: props.iconsClassName, src: props.icon })
|
|
444
|
+
props.isSVGStylesOverride === false ? props.icon && /* @__PURE__ */ import_react11.default.createElement("img", { className: props.iconsClassName, src: props.icon, alt: props.label }) : svgContent && /* @__PURE__ */ import_react11.default.createElement(
|
|
445
|
+
"span",
|
|
446
|
+
{
|
|
447
|
+
dangerouslySetInnerHTML: { __html: svgContent }
|
|
448
|
+
}
|
|
449
|
+
),
|
|
385
450
|
props.label
|
|
386
451
|
);
|
|
387
452
|
};
|
|
@@ -464,9 +529,9 @@ var AddMoreTable = (props) => {
|
|
|
464
529
|
if (!element) return null;
|
|
465
530
|
const { element: type, label } = element;
|
|
466
531
|
if (type === "single-select") {
|
|
467
|
-
return /* @__PURE__ */ import_react12.default.createElement(SingleSelectElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false, options1: [], options2: [] });
|
|
532
|
+
return /* @__PURE__ */ import_react12.default.createElement(SingleSelectElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false, options1: [], options2: [], firstOptions: [], secondOptions: [] });
|
|
468
533
|
} else if (type === "textarea") {
|
|
469
|
-
return /* @__PURE__ */ import_react12.default.createElement(TextareaElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false, options1: [], options2: [] });
|
|
534
|
+
return /* @__PURE__ */ import_react12.default.createElement(TextareaElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false, options1: [], options2: [], firstOptions: [], secondOptions: [] });
|
|
470
535
|
} else {
|
|
471
536
|
return null;
|
|
472
537
|
}
|
|
@@ -524,10 +589,19 @@ var Sidebar = (props) => {
|
|
|
524
589
|
props.onChange(item);
|
|
525
590
|
}
|
|
526
591
|
};
|
|
527
|
-
return /* @__PURE__ */ import_react13.default.createElement(
|
|
528
|
-
return /* @__PURE__ */ import_react13.default.createElement(
|
|
529
|
-
|
|
530
|
-
|
|
592
|
+
return /* @__PURE__ */ import_react13.default.createElement(import_react13.default.Fragment, { key: props.name }, /* @__PURE__ */ import_react13.default.createElement("div", { className: props.imgClassName }, /* @__PURE__ */ import_react13.default.createElement("img", { src: props.img, alt: "logo" })), /* @__PURE__ */ import_react13.default.createElement("div", { className: props.listClassName }, props.items?.map((item) => {
|
|
593
|
+
return /* @__PURE__ */ import_react13.default.createElement(import_react13.default.Fragment, { key: item.label }, /* @__PURE__ */ import_react13.default.createElement(
|
|
594
|
+
ButtonElement,
|
|
595
|
+
{
|
|
596
|
+
...item,
|
|
597
|
+
className: item.active ? props.activeClassName : props.className,
|
|
598
|
+
iconsClassName: props.iconsClassName,
|
|
599
|
+
onClick: (e) => {
|
|
600
|
+
e.preventDefault();
|
|
601
|
+
handleChange(item);
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
));
|
|
531
605
|
})));
|
|
532
606
|
};
|
|
533
607
|
|
|
@@ -652,7 +726,6 @@ var TableElement = (props) => {
|
|
|
652
726
|
const { thead, tbody } = props;
|
|
653
727
|
const [selectedRecord, setSelectedRecord] = (0, import_react20.useState)({});
|
|
654
728
|
const [model, setModel] = (0, import_react20.useState)(false);
|
|
655
|
-
const [selectedRowKeys, setSelectedRowKeys] = (0, import_react20.useState)([]);
|
|
656
729
|
const handleChange = (record) => {
|
|
657
730
|
console.log("record", record);
|
|
658
731
|
if (props.onChange) {
|
|
@@ -681,8 +754,10 @@ var TableElement = (props) => {
|
|
|
681
754
|
}
|
|
682
755
|
}
|
|
683
756
|
}
|
|
684
|
-
}))
|
|
685
|
-
|
|
757
|
+
}))
|
|
758
|
+
];
|
|
759
|
+
if (props.view) {
|
|
760
|
+
columns.push({
|
|
686
761
|
title: "View",
|
|
687
762
|
dataIndex: "View",
|
|
688
763
|
key: "View",
|
|
@@ -697,11 +772,12 @@ var TableElement = (props) => {
|
|
|
697
772
|
},
|
|
698
773
|
"View"
|
|
699
774
|
)
|
|
700
|
-
}
|
|
701
|
-
|
|
775
|
+
});
|
|
776
|
+
}
|
|
702
777
|
}
|
|
703
778
|
const dataSource = tbody && tbody.map((row, index) => ({
|
|
704
779
|
...row,
|
|
780
|
+
key: index + 1,
|
|
705
781
|
[columns[0].key]: index + 1
|
|
706
782
|
}));
|
|
707
783
|
const count = dataSource ? dataSource.length : 0;
|
|
@@ -710,28 +786,29 @@ var TableElement = (props) => {
|
|
|
710
786
|
props.onChange({ name: "pagination", page, pageSize });
|
|
711
787
|
}
|
|
712
788
|
};
|
|
713
|
-
const onSelectChange = (newSelectedRowKeys) => {
|
|
714
|
-
console.log("selectedRowKeys changed: ", newSelectedRowKeys);
|
|
715
|
-
setSelectedRowKeys(newSelectedRowKeys);
|
|
716
|
-
};
|
|
717
789
|
const rowSelectionConfig = props.rowSelection ? {
|
|
718
|
-
selectedRowKeys,
|
|
719
|
-
|
|
790
|
+
onChange: (selectedRowKeys, selectedRows) => {
|
|
791
|
+
console.log(`selectedRowKeys: ${selectedRowKeys}`, "selectedRows: ", selectedRows);
|
|
792
|
+
if (props.onChange) {
|
|
793
|
+
props.onChange(selectedRows);
|
|
794
|
+
}
|
|
795
|
+
}
|
|
720
796
|
} : void 0;
|
|
721
797
|
return /* @__PURE__ */ import_react20.default.createElement(import_react20.default.Fragment, null, /* @__PURE__ */ import_react20.default.createElement(
|
|
722
798
|
import_antd14.Table,
|
|
723
799
|
{
|
|
800
|
+
className: props.className,
|
|
724
801
|
pagination: {
|
|
725
802
|
showTotal: (total) => `Total: ${total} items`,
|
|
726
803
|
total: count,
|
|
727
804
|
showSizeChanger: count > 10,
|
|
728
805
|
onChange: onChangePage
|
|
729
806
|
},
|
|
807
|
+
rowSelection: rowSelectionConfig,
|
|
730
808
|
dataSource,
|
|
731
809
|
columns,
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
size: props.size && props.size
|
|
810
|
+
size: props.size,
|
|
811
|
+
bordered: true
|
|
735
812
|
}
|
|
736
813
|
), model && /* @__PURE__ */ import_react20.default.createElement(ModelElement, { selectedRecord, ...props, columns, model, onCancel: () => setModel(false) }));
|
|
737
814
|
};
|
|
@@ -739,59 +816,40 @@ var TableElement = (props) => {
|
|
|
739
816
|
// src/Components/DatePicker.tsx
|
|
740
817
|
var import_react21 = __toESM(require("react"));
|
|
741
818
|
var import_antd15 = require("antd");
|
|
742
|
-
var
|
|
743
|
-
var
|
|
819
|
+
var import_dayjs = __toESM(require("dayjs"));
|
|
820
|
+
var import_customParseFormat = __toESM(require("dayjs/plugin/customParseFormat.js"));
|
|
821
|
+
import_dayjs.default.extend(import_customParseFormat.default);
|
|
744
822
|
var DatePickerElement = (props) => {
|
|
745
|
-
const [
|
|
746
|
-
const handleChange = (
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
const formattedDate = dateString;
|
|
751
|
-
console.log("formattedDate-----------------", formattedDate);
|
|
752
|
-
setDate(date2);
|
|
753
|
-
console.log("changedDate------------", date2);
|
|
823
|
+
const [dateState, setDateState] = (0, import_react21.useState)("");
|
|
824
|
+
const handleChange = (date, dateString) => {
|
|
825
|
+
if (date) {
|
|
826
|
+
const formattedDate = date;
|
|
827
|
+
setDateState(date);
|
|
754
828
|
if (props.onChange) {
|
|
755
829
|
props.onChange(formattedDate);
|
|
756
830
|
}
|
|
757
831
|
} else {
|
|
758
|
-
|
|
832
|
+
setDateState("");
|
|
759
833
|
if (props.onChange) {
|
|
760
834
|
props.onChange("");
|
|
761
835
|
}
|
|
762
836
|
}
|
|
763
837
|
};
|
|
764
|
-
|
|
765
|
-
const currentDate = date || (0, import_moment.default)();
|
|
766
|
-
const newDate = (0, import_moment.default)(currentDate).subtract(1, "days");
|
|
767
|
-
setDate(newDate);
|
|
768
|
-
if (props.onChange) {
|
|
769
|
-
props.onChange(newDate.format("lll"));
|
|
770
|
-
}
|
|
771
|
-
};
|
|
772
|
-
const onHandleIncrement = () => {
|
|
773
|
-
const currentDate = date || (0, import_moment.default)();
|
|
774
|
-
const newDate = (0, import_moment.default)(currentDate).add(1, "days");
|
|
775
|
-
setDate(newDate);
|
|
776
|
-
if (props.onChange) {
|
|
777
|
-
props.onChange(newDate.format("lll"));
|
|
778
|
-
}
|
|
779
|
-
};
|
|
780
|
-
return /* @__PURE__ */ import_react21.default.createElement("div", null, /* @__PURE__ */ import_react21.default.createElement("button", { onClick: onHandleDecrement }, /* @__PURE__ */ import_react21.default.createElement(import_icons4.LeftOutlined, null)), /* @__PURE__ */ import_react21.default.createElement(
|
|
838
|
+
return /* @__PURE__ */ import_react21.default.createElement("div", null, /* @__PURE__ */ import_react21.default.createElement(
|
|
781
839
|
import_antd15.DatePicker,
|
|
782
840
|
{
|
|
783
841
|
placeholder: props.placeholder,
|
|
784
|
-
value:
|
|
785
|
-
|
|
842
|
+
value: dateState,
|
|
843
|
+
format: { format: "DD-MM-YYYY" },
|
|
786
844
|
onChange: handleChange
|
|
787
845
|
}
|
|
788
|
-
)
|
|
846
|
+
));
|
|
789
847
|
};
|
|
790
848
|
|
|
791
849
|
// src/Components/DateRangePickerElement.tsx
|
|
792
850
|
var import_react22 = __toESM(require("react"));
|
|
793
851
|
var import_antd16 = require("antd");
|
|
794
|
-
var
|
|
852
|
+
var import_dayjs2 = __toESM(require("dayjs"));
|
|
795
853
|
var DateRangePickerElement = (props) => {
|
|
796
854
|
const { RangePicker } = import_antd16.DatePicker;
|
|
797
855
|
const handleChange = (dates, dateStrings) => {
|
|
@@ -802,10 +860,10 @@ var DateRangePickerElement = (props) => {
|
|
|
802
860
|
}
|
|
803
861
|
};
|
|
804
862
|
const rangePresets = [
|
|
805
|
-
{ label: "Last 7 Days", value: [(0,
|
|
806
|
-
{ label: "Last 14 Days", value: [(0,
|
|
807
|
-
{ label: "Last 30 Days", value: [(0,
|
|
808
|
-
{ label: "Last 90 Days", value: [(0,
|
|
863
|
+
{ label: "Last 7 Days", value: [(0, import_dayjs2.default)().add(-7, "d"), (0, import_dayjs2.default)()] },
|
|
864
|
+
{ label: "Last 14 Days", value: [(0, import_dayjs2.default)().add(-14, "d"), (0, import_dayjs2.default)()] },
|
|
865
|
+
{ label: "Last 30 Days", value: [(0, import_dayjs2.default)().add(-30, "d"), (0, import_dayjs2.default)()] },
|
|
866
|
+
{ label: "Last 90 Days", value: [(0, import_dayjs2.default)().add(-90, "d"), (0, import_dayjs2.default)()] }
|
|
809
867
|
];
|
|
810
868
|
return /* @__PURE__ */ import_react22.default.createElement(import_antd16.Space, { direction: "vertical", size: 12 }, /* @__PURE__ */ import_react22.default.createElement(RangePicker, { presets: rangePresets, onChange: handleChange }));
|
|
811
869
|
};
|
|
@@ -813,7 +871,7 @@ var DateRangePickerElement = (props) => {
|
|
|
813
871
|
// src/Components/Image.tsx
|
|
814
872
|
var import_react23 = __toESM(require("react"));
|
|
815
873
|
var Image = (props) => {
|
|
816
|
-
return /* @__PURE__ */ import_react23.default.createElement("
|
|
874
|
+
return /* @__PURE__ */ import_react23.default.createElement("img", { className: props.className, src: props.img, alt: "image" });
|
|
817
875
|
};
|
|
818
876
|
|
|
819
877
|
// src/Components/SingleCheckbox.tsx
|
|
@@ -834,30 +892,34 @@ var import_antd18 = require("antd");
|
|
|
834
892
|
var DropDownGroup = (props) => {
|
|
835
893
|
const [selectedValue, setSelectedValue] = (0, import_react25.useState)({
|
|
836
894
|
firstValue: {},
|
|
837
|
-
secondValue: {}
|
|
895
|
+
secondValue: {},
|
|
896
|
+
temp: ""
|
|
838
897
|
});
|
|
839
898
|
const handleFirstChange = (value) => {
|
|
840
|
-
|
|
899
|
+
console.log(selectedValue.temp);
|
|
900
|
+
const filterOption2 = props.firstOptions?.find(
|
|
841
901
|
(eachOption) => eachOption.value === value
|
|
842
902
|
);
|
|
843
903
|
setSelectedValue((prev) => {
|
|
844
904
|
const newValue = { ...prev, firstValue: filterOption2 };
|
|
905
|
+
const { temp, ...rest } = newValue;
|
|
845
906
|
if (newValue.firstValue) {
|
|
846
|
-
props.onChange?.(
|
|
907
|
+
props.onChange?.(rest);
|
|
847
908
|
}
|
|
848
|
-
return
|
|
909
|
+
return newValue;
|
|
849
910
|
});
|
|
850
911
|
};
|
|
851
912
|
const handleSecondChange = (value) => {
|
|
852
|
-
const filterOption2 = props.
|
|
913
|
+
const filterOption2 = props.secondOptions?.find(
|
|
853
914
|
(eachOption) => eachOption.value === value
|
|
854
915
|
);
|
|
855
916
|
setSelectedValue((prev) => {
|
|
856
917
|
const newValue = { ...prev, secondValue: filterOption2 };
|
|
918
|
+
const { temp, ...rest } = newValue;
|
|
857
919
|
if (newValue.secondValue) {
|
|
858
|
-
props.onChange?.(
|
|
920
|
+
props.onChange?.(rest);
|
|
859
921
|
}
|
|
860
|
-
return
|
|
922
|
+
return newValue;
|
|
861
923
|
});
|
|
862
924
|
};
|
|
863
925
|
return /* @__PURE__ */ import_react25.default.createElement("div", { className: props.containerClassName }, props.label && /* @__PURE__ */ import_react25.default.createElement("label", { htmlFor: props.name, className: props.labelClassName }, props.label), /* @__PURE__ */ import_react25.default.createElement("div", { className: props.subContainerClassName }, /* @__PURE__ */ import_react25.default.createElement(
|
|
@@ -865,7 +927,7 @@ var DropDownGroup = (props) => {
|
|
|
865
927
|
{
|
|
866
928
|
onChange: handleFirstChange,
|
|
867
929
|
variant: props.variant,
|
|
868
|
-
options: props.
|
|
930
|
+
options: props.firstOptions,
|
|
869
931
|
className: props.className
|
|
870
932
|
}
|
|
871
933
|
), /* @__PURE__ */ import_react25.default.createElement("div", { style: { borderLeft: "1px solid gray", height: "33px" } }), /* @__PURE__ */ import_react25.default.createElement(
|
|
@@ -873,7 +935,7 @@ var DropDownGroup = (props) => {
|
|
|
873
935
|
{
|
|
874
936
|
onChange: handleSecondChange,
|
|
875
937
|
variant: props.variant,
|
|
876
|
-
options: props.
|
|
938
|
+
options: props.secondOptions,
|
|
877
939
|
className: props.className
|
|
878
940
|
}
|
|
879
941
|
)));
|
|
@@ -882,18 +944,10 @@ var DropDownGroup = (props) => {
|
|
|
882
944
|
// src/Components/FilesUpload.tsx
|
|
883
945
|
var import_react26 = __toESM(require("react"));
|
|
884
946
|
var import_antd19 = require("antd");
|
|
885
|
-
var
|
|
947
|
+
var import_icons4 = require("@ant-design/icons");
|
|
886
948
|
var FileUpload = (props) => {
|
|
887
949
|
const { Dragger } = import_antd19.Upload;
|
|
888
950
|
const [files, setFiles] = (0, import_react26.useState)([]);
|
|
889
|
-
const beforeUpload = (file) => {
|
|
890
|
-
const isCorrectFile = ["image/png", "image/jpg", "image/jpeg", "application/pdf"].includes(file.type);
|
|
891
|
-
if (!isCorrectFile) {
|
|
892
|
-
import_antd19.message.error(`(${file.name}) is an invalid file. Please upload files with the following extensions only (.png/.jpg/.jpeg/.pdf)`);
|
|
893
|
-
return import_antd19.Upload.LIST_IGNORE;
|
|
894
|
-
}
|
|
895
|
-
return true;
|
|
896
|
-
};
|
|
897
951
|
const handleChange = ({ fileList }) => {
|
|
898
952
|
setFiles(fileList);
|
|
899
953
|
if (props.onChange) {
|
|
@@ -917,12 +971,11 @@ var FileUpload = (props) => {
|
|
|
917
971
|
maxCount: props.max_count,
|
|
918
972
|
multiple: props.multiple,
|
|
919
973
|
fileList: files,
|
|
920
|
-
beforeUpload,
|
|
921
974
|
onChange: handleChange,
|
|
922
975
|
showUploadList: true,
|
|
923
976
|
customRequest
|
|
924
977
|
},
|
|
925
|
-
/* @__PURE__ */ import_react26.default.createElement("p", null, /* @__PURE__ */ import_react26.default.createElement(
|
|
978
|
+
/* @__PURE__ */ import_react26.default.createElement("p", null, /* @__PURE__ */ import_react26.default.createElement(import_icons4.InboxOutlined, null)),
|
|
926
979
|
/* @__PURE__ */ import_react26.default.createElement("p", null, "Click or drag file to upload")
|
|
927
980
|
));
|
|
928
981
|
};
|
|
@@ -938,6 +991,149 @@ var TabsElement = (props) => {
|
|
|
938
991
|
};
|
|
939
992
|
return /* @__PURE__ */ import_react27.default.createElement(import_antd20.Tabs, { className: props.containerClassName, items: props.options, onChange: handleChange });
|
|
940
993
|
};
|
|
994
|
+
|
|
995
|
+
// src/Components/SwitchElement.tsx
|
|
996
|
+
var import_react28 = __toESM(require("react"));
|
|
997
|
+
var import_antd21 = require("antd");
|
|
998
|
+
var onChange = (checked) => {
|
|
999
|
+
console.log(`switch to ${checked}`);
|
|
1000
|
+
};
|
|
1001
|
+
var SwitchElement = () => /* @__PURE__ */ import_react28.default.createElement(import_antd21.Switch, { defaultChecked: true, onChange });
|
|
1002
|
+
|
|
1003
|
+
// src/Components/Upload.tsx
|
|
1004
|
+
var import_react29 = __toESM(require("react"));
|
|
1005
|
+
var Upload2 = (props) => {
|
|
1006
|
+
const [file, setFile] = (0, import_react29.useState)();
|
|
1007
|
+
const handleFileChange = (e) => {
|
|
1008
|
+
setFile(e.target.files[0]);
|
|
1009
|
+
if (props.onChange) {
|
|
1010
|
+
props.onChange(e.target.files[0]);
|
|
1011
|
+
}
|
|
1012
|
+
};
|
|
1013
|
+
const handleUpload = async () => {
|
|
1014
|
+
if (!file) {
|
|
1015
|
+
console.error("No file selected");
|
|
1016
|
+
return;
|
|
1017
|
+
}
|
|
1018
|
+
};
|
|
1019
|
+
return /* @__PURE__ */ import_react29.default.createElement("div", { style: { marginTop: 16 } }, /* @__PURE__ */ import_react29.default.createElement("input", { type: "file", onChange: handleFileChange }), /* @__PURE__ */ import_react29.default.createElement(
|
|
1020
|
+
"button",
|
|
1021
|
+
{
|
|
1022
|
+
type: "button",
|
|
1023
|
+
onClick: handleUpload,
|
|
1024
|
+
disabled: !file,
|
|
1025
|
+
style: { marginTop: 16 }
|
|
1026
|
+
},
|
|
1027
|
+
"Upload"
|
|
1028
|
+
));
|
|
1029
|
+
};
|
|
1030
|
+
|
|
1031
|
+
// src/Components/OtpElement.tsx
|
|
1032
|
+
var import_react30 = __toESM(require("react"));
|
|
1033
|
+
var import_antd22 = require("antd");
|
|
1034
|
+
var OtpElement = (props) => {
|
|
1035
|
+
const length = props.length;
|
|
1036
|
+
const [otp, setOtp] = (0, import_react30.useState)(Array(length).fill(""));
|
|
1037
|
+
const inputRefs = (0, import_react30.useRef)([]);
|
|
1038
|
+
const handleChange = (e, index) => {
|
|
1039
|
+
const value = e.target.value;
|
|
1040
|
+
if (/^[0-9]$/.test(value) || value === "") {
|
|
1041
|
+
const newOtp = [...otp];
|
|
1042
|
+
newOtp[index] = value;
|
|
1043
|
+
setOtp(newOtp);
|
|
1044
|
+
props.onChange && props.onChange(newOtp.join(""));
|
|
1045
|
+
if (value && index < length - 1) {
|
|
1046
|
+
inputRefs.current[index + 1]?.focus();
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
};
|
|
1050
|
+
const handleKeyDown = (e, index) => {
|
|
1051
|
+
if (e.key === "Backspace" && !otp[index] && index > 0) {
|
|
1052
|
+
inputRefs.current[index - 1]?.focus();
|
|
1053
|
+
}
|
|
1054
|
+
};
|
|
1055
|
+
const handlePaste = (e) => {
|
|
1056
|
+
e.preventDefault();
|
|
1057
|
+
const pasteData = e.clipboardData.getData("text");
|
|
1058
|
+
if (/^\d+$/.test(pasteData)) {
|
|
1059
|
+
const newOtp = pasteData.split("").slice(0, length);
|
|
1060
|
+
setOtp(newOtp.concat(Array(length - newOtp.length).fill("")));
|
|
1061
|
+
props.onChange && props.onChange(newOtp.join(""));
|
|
1062
|
+
newOtp.forEach((_, idx) => {
|
|
1063
|
+
if (inputRefs.current[idx]) {
|
|
1064
|
+
inputRefs.current[idx]?.focus();
|
|
1065
|
+
}
|
|
1066
|
+
});
|
|
1067
|
+
}
|
|
1068
|
+
};
|
|
1069
|
+
(0, import_react30.useEffect)(() => {
|
|
1070
|
+
inputRefs.current[0]?.focus();
|
|
1071
|
+
}, []);
|
|
1072
|
+
return /* @__PURE__ */ import_react30.default.createElement("div", { className: props.containerClassName }, Array.from({ length }).map((_, index) => /* @__PURE__ */ import_react30.default.createElement(
|
|
1073
|
+
import_antd22.Input,
|
|
1074
|
+
{
|
|
1075
|
+
key: index,
|
|
1076
|
+
className: props.className,
|
|
1077
|
+
maxLength: 1,
|
|
1078
|
+
value: otp[index],
|
|
1079
|
+
onChange: (e) => handleChange(e, index),
|
|
1080
|
+
onKeyDown: (e) => handleKeyDown(e, index),
|
|
1081
|
+
onPaste: handlePaste,
|
|
1082
|
+
ref: (el) => inputRefs.current[index] = el
|
|
1083
|
+
}
|
|
1084
|
+
)));
|
|
1085
|
+
};
|
|
1086
|
+
|
|
1087
|
+
// src/Components/Donut.tsx
|
|
1088
|
+
var import_react31 = __toESM(require("react"));
|
|
1089
|
+
var import_highcharts = __toESM(require("highcharts"));
|
|
1090
|
+
var import_highcharts_react_official = __toESM(require("highcharts-react-official"));
|
|
1091
|
+
var Donut = (props) => {
|
|
1092
|
+
console.log(props);
|
|
1093
|
+
const chartOptions = {
|
|
1094
|
+
title: {
|
|
1095
|
+
text: "Distribution of Students"
|
|
1096
|
+
},
|
|
1097
|
+
plotOptions: {
|
|
1098
|
+
pie: {
|
|
1099
|
+
innerSize: "70%",
|
|
1100
|
+
dataLabels: {
|
|
1101
|
+
enabled: false,
|
|
1102
|
+
format: "<b>{point.name}</b>: {point.percentage:.1f} %"
|
|
1103
|
+
},
|
|
1104
|
+
showInLegend: true
|
|
1105
|
+
}
|
|
1106
|
+
},
|
|
1107
|
+
series: [
|
|
1108
|
+
{
|
|
1109
|
+
type: "pie",
|
|
1110
|
+
name: "Percentage",
|
|
1111
|
+
data: [
|
|
1112
|
+
{
|
|
1113
|
+
name: "Girls",
|
|
1114
|
+
y: 20,
|
|
1115
|
+
color: "#FF6384"
|
|
1116
|
+
// Custom color for Girls
|
|
1117
|
+
},
|
|
1118
|
+
{
|
|
1119
|
+
name: "Boys",
|
|
1120
|
+
y: 40,
|
|
1121
|
+
color: "#36A2EB"
|
|
1122
|
+
// Custom color for Boys
|
|
1123
|
+
},
|
|
1124
|
+
{
|
|
1125
|
+
name: "Students",
|
|
1126
|
+
y: 40,
|
|
1127
|
+
color: "#FFCE56"
|
|
1128
|
+
// Custom color for Students
|
|
1129
|
+
}
|
|
1130
|
+
]
|
|
1131
|
+
}
|
|
1132
|
+
]
|
|
1133
|
+
};
|
|
1134
|
+
console.log(chartOptions);
|
|
1135
|
+
return /* @__PURE__ */ import_react31.default.createElement("div", null, /* @__PURE__ */ import_react31.default.createElement(import_highcharts_react_official.default, { highcharts: import_highcharts.default, options: chartOptions }));
|
|
1136
|
+
};
|
|
941
1137
|
// Annotate the CommonJS export names for ESM import in node:
|
|
942
1138
|
0 && (module.exports = {
|
|
943
1139
|
AddMoreTable,
|
|
@@ -946,20 +1142,24 @@ var TabsElement = (props) => {
|
|
|
946
1142
|
CkEditor,
|
|
947
1143
|
DatePickerElement,
|
|
948
1144
|
DateRangePickerElement,
|
|
1145
|
+
Donut,
|
|
949
1146
|
DropDownGroup,
|
|
950
1147
|
FileUpload,
|
|
951
1148
|
Image,
|
|
952
1149
|
MultipleSelectElement,
|
|
953
1150
|
Navbar,
|
|
954
1151
|
NumberElement,
|
|
1152
|
+
OtpElement,
|
|
955
1153
|
PasswordElement,
|
|
956
1154
|
RadioElement,
|
|
957
1155
|
SelectElement,
|
|
958
1156
|
Sidebar,
|
|
959
1157
|
SingleCheckbox,
|
|
960
1158
|
SingleSelectElement,
|
|
1159
|
+
SwitchElement,
|
|
961
1160
|
TableElement,
|
|
962
1161
|
TabsElement,
|
|
963
1162
|
TextElement,
|
|
964
|
-
TextareaElement
|
|
1163
|
+
TextareaElement,
|
|
1164
|
+
Upload
|
|
965
1165
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -13,6 +13,7 @@ var TextElement = (props) => {
|
|
|
13
13
|
placeholder: props.placeholder,
|
|
14
14
|
allowClear: true,
|
|
15
15
|
id: props.name,
|
|
16
|
+
value: props.value,
|
|
16
17
|
prefix: props.prefix,
|
|
17
18
|
type: props.type,
|
|
18
19
|
status: props.status,
|
|
@@ -72,8 +73,7 @@ var NumberElement = (props) => {
|
|
|
72
73
|
{
|
|
73
74
|
placeholder: props.placeholder,
|
|
74
75
|
addonBefore: props.addonBefore,
|
|
75
|
-
|
|
76
|
-
defaultValue: props.defaultValue,
|
|
76
|
+
value: props.value,
|
|
77
77
|
disabled: props.disabled,
|
|
78
78
|
id: props.name,
|
|
79
79
|
prefix: props.prefix,
|
|
@@ -316,26 +316,87 @@ var MultipleSelectElement = (props) => {
|
|
|
316
316
|
};
|
|
317
317
|
|
|
318
318
|
// src/Components/Button.tsx
|
|
319
|
-
import React11 from "react";
|
|
319
|
+
import React11, { useEffect, useState as useState4 } from "react";
|
|
320
320
|
var ButtonElement = (props) => {
|
|
321
|
+
const [svgContent, setSvgContent] = useState4(null);
|
|
322
|
+
const [originalSvgContent, setOriginalSvgContent] = useState4(null);
|
|
323
|
+
const [hoverColor, setHoverColor] = useState4(null);
|
|
324
|
+
useEffect(() => {
|
|
325
|
+
if (props.icon) {
|
|
326
|
+
fetch(props.icon).then((response) => response.text()).then((data) => {
|
|
327
|
+
const tempDiv = document.createElement("div");
|
|
328
|
+
tempDiv.innerHTML = data;
|
|
329
|
+
const svgElement = tempDiv.querySelector("svg");
|
|
330
|
+
if (svgElement) {
|
|
331
|
+
const textColorClass = props.className?.match(/text-[\w-]+/g)?.[0];
|
|
332
|
+
const hoverColorClass = props.className?.match(/hover:text-[\w-]+/g)?.[0];
|
|
333
|
+
if (textColorClass) {
|
|
334
|
+
const tempSpan = document.createElement("span");
|
|
335
|
+
tempSpan.className = textColorClass;
|
|
336
|
+
document.body.appendChild(tempSpan);
|
|
337
|
+
const computedColor = getComputedStyle(tempSpan).color;
|
|
338
|
+
document.body.removeChild(tempSpan);
|
|
339
|
+
const paths = svgElement.querySelectorAll("path");
|
|
340
|
+
paths.forEach((path) => path.setAttribute("fill", computedColor));
|
|
341
|
+
}
|
|
342
|
+
if (hoverColorClass) {
|
|
343
|
+
const tempSpan = document.createElement("span");
|
|
344
|
+
tempSpan.className = hoverColorClass.replace("hover:", "");
|
|
345
|
+
document.body.appendChild(tempSpan);
|
|
346
|
+
const computedHoverColor = getComputedStyle(tempSpan).color;
|
|
347
|
+
document.body.removeChild(tempSpan);
|
|
348
|
+
setHoverColor(computedHoverColor);
|
|
349
|
+
}
|
|
350
|
+
svgElement.setAttribute(
|
|
351
|
+
"class",
|
|
352
|
+
`${props.iconsClassName ? props.iconsClassName : ""}`
|
|
353
|
+
);
|
|
354
|
+
setSvgContent(tempDiv.innerHTML);
|
|
355
|
+
setOriginalSvgContent(tempDiv.innerHTML);
|
|
356
|
+
}
|
|
357
|
+
}).catch((error) => console.error("Error fetching SVG:", error));
|
|
358
|
+
}
|
|
359
|
+
}, [props.icon, props.className]);
|
|
360
|
+
const handleMouseEnter = () => {
|
|
361
|
+
if (hoverColor && originalSvgContent) {
|
|
362
|
+
const tempDiv = document.createElement("div");
|
|
363
|
+
tempDiv.innerHTML = originalSvgContent;
|
|
364
|
+
const svgElement = tempDiv.querySelector("svg");
|
|
365
|
+
const paths = svgElement?.querySelectorAll("path");
|
|
366
|
+
paths?.forEach((path) => path.setAttribute("fill", hoverColor));
|
|
367
|
+
setSvgContent(tempDiv.innerHTML);
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
const handleMouseLeave = () => {
|
|
371
|
+
if (originalSvgContent) {
|
|
372
|
+
setSvgContent(originalSvgContent);
|
|
373
|
+
}
|
|
374
|
+
};
|
|
321
375
|
return /* @__PURE__ */ React11.createElement(
|
|
322
376
|
"button",
|
|
323
377
|
{
|
|
324
|
-
onClick:
|
|
325
|
-
className: `${props.className ? props.className : ""}
|
|
378
|
+
onClick: props.onClick,
|
|
379
|
+
className: `${props.className ? props.className : ""}`,
|
|
380
|
+
onMouseEnter: handleMouseEnter,
|
|
381
|
+
onMouseLeave: handleMouseLeave
|
|
326
382
|
},
|
|
327
|
-
props.icon && /* @__PURE__ */ React11.createElement("img", { className: props.iconsClassName, src: props.icon })
|
|
383
|
+
props.isSVGStylesOverride === false ? props.icon && /* @__PURE__ */ React11.createElement("img", { className: props.iconsClassName, src: props.icon, alt: props.label }) : svgContent && /* @__PURE__ */ React11.createElement(
|
|
384
|
+
"span",
|
|
385
|
+
{
|
|
386
|
+
dangerouslySetInnerHTML: { __html: svgContent }
|
|
387
|
+
}
|
|
388
|
+
),
|
|
328
389
|
props.label
|
|
329
390
|
);
|
|
330
391
|
};
|
|
331
392
|
|
|
332
393
|
// src/Components/AddMoreTable.tsx
|
|
333
|
-
import React12, { useEffect, useState as
|
|
394
|
+
import React12, { useEffect as useEffect2, useState as useState5 } from "react";
|
|
334
395
|
import { Table, Button } from "antd";
|
|
335
396
|
import { PlusOutlined, DeleteOutlined } from "@ant-design/icons";
|
|
336
397
|
var AddMoreTable = (props) => {
|
|
337
398
|
const { thead, tbody } = props;
|
|
338
|
-
const [rows, setRows] =
|
|
399
|
+
const [rows, setRows] = useState5(tbody || []);
|
|
339
400
|
const onHandleRows = () => {
|
|
340
401
|
const newId = rows.length > 0 ? rows[rows.length - 1].id + 1 : 1;
|
|
341
402
|
let newRow = {
|
|
@@ -400,16 +461,16 @@ var AddMoreTable = (props) => {
|
|
|
400
461
|
});
|
|
401
462
|
});
|
|
402
463
|
};
|
|
403
|
-
|
|
464
|
+
useEffect2(() => {
|
|
404
465
|
console.log(rows);
|
|
405
466
|
}, [rows]);
|
|
406
467
|
const renderInputElement = (element, value) => {
|
|
407
468
|
if (!element) return null;
|
|
408
469
|
const { element: type, label } = element;
|
|
409
470
|
if (type === "single-select") {
|
|
410
|
-
return /* @__PURE__ */ React12.createElement(SingleSelectElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false, options1: [], options2: [] });
|
|
471
|
+
return /* @__PURE__ */ React12.createElement(SingleSelectElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false, options1: [], options2: [], firstOptions: [], secondOptions: [] });
|
|
411
472
|
} else if (type === "textarea") {
|
|
412
|
-
return /* @__PURE__ */ React12.createElement(TextareaElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false, options1: [], options2: [] });
|
|
473
|
+
return /* @__PURE__ */ React12.createElement(TextareaElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false, options1: [], options2: [], firstOptions: [], secondOptions: [] });
|
|
413
474
|
} else {
|
|
414
475
|
return null;
|
|
415
476
|
}
|
|
@@ -467,10 +528,19 @@ var Sidebar = (props) => {
|
|
|
467
528
|
props.onChange(item);
|
|
468
529
|
}
|
|
469
530
|
};
|
|
470
|
-
return /* @__PURE__ */ React13.createElement(
|
|
471
|
-
return /* @__PURE__ */ React13.createElement(
|
|
472
|
-
|
|
473
|
-
|
|
531
|
+
return /* @__PURE__ */ React13.createElement(React13.Fragment, { key: props.name }, /* @__PURE__ */ React13.createElement("div", { className: props.imgClassName }, /* @__PURE__ */ React13.createElement("img", { src: props.img, alt: "logo" })), /* @__PURE__ */ React13.createElement("div", { className: props.listClassName }, props.items?.map((item) => {
|
|
532
|
+
return /* @__PURE__ */ React13.createElement(React13.Fragment, { key: item.label }, /* @__PURE__ */ React13.createElement(
|
|
533
|
+
ButtonElement,
|
|
534
|
+
{
|
|
535
|
+
...item,
|
|
536
|
+
className: item.active ? props.activeClassName : props.className,
|
|
537
|
+
iconsClassName: props.iconsClassName,
|
|
538
|
+
onClick: (e) => {
|
|
539
|
+
e.preventDefault();
|
|
540
|
+
handleChange(item);
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
));
|
|
474
544
|
})));
|
|
475
545
|
};
|
|
476
546
|
|
|
@@ -535,7 +605,7 @@ var Navbar = (props) => {
|
|
|
535
605
|
};
|
|
536
606
|
|
|
537
607
|
// src/Components/TableElement.tsx
|
|
538
|
-
import React20, { useState as
|
|
608
|
+
import React20, { useState as useState6 } from "react";
|
|
539
609
|
import { Table as Table2 } from "antd";
|
|
540
610
|
|
|
541
611
|
// src/Components/Model.tsx
|
|
@@ -593,9 +663,8 @@ var ModelElement = (props) => {
|
|
|
593
663
|
// src/Components/TableElement.tsx
|
|
594
664
|
var TableElement = (props) => {
|
|
595
665
|
const { thead, tbody } = props;
|
|
596
|
-
const [selectedRecord, setSelectedRecord] =
|
|
597
|
-
const [model, setModel] =
|
|
598
|
-
const [selectedRowKeys, setSelectedRowKeys] = useState5([]);
|
|
666
|
+
const [selectedRecord, setSelectedRecord] = useState6({});
|
|
667
|
+
const [model, setModel] = useState6(false);
|
|
599
668
|
const handleChange = (record) => {
|
|
600
669
|
console.log("record", record);
|
|
601
670
|
if (props.onChange) {
|
|
@@ -624,8 +693,10 @@ var TableElement = (props) => {
|
|
|
624
693
|
}
|
|
625
694
|
}
|
|
626
695
|
}
|
|
627
|
-
}))
|
|
628
|
-
|
|
696
|
+
}))
|
|
697
|
+
];
|
|
698
|
+
if (props.view) {
|
|
699
|
+
columns.push({
|
|
629
700
|
title: "View",
|
|
630
701
|
dataIndex: "View",
|
|
631
702
|
key: "View",
|
|
@@ -640,11 +711,12 @@ var TableElement = (props) => {
|
|
|
640
711
|
},
|
|
641
712
|
"View"
|
|
642
713
|
)
|
|
643
|
-
}
|
|
644
|
-
|
|
714
|
+
});
|
|
715
|
+
}
|
|
645
716
|
}
|
|
646
717
|
const dataSource = tbody && tbody.map((row, index) => ({
|
|
647
718
|
...row,
|
|
719
|
+
key: index + 1,
|
|
648
720
|
[columns[0].key]: index + 1
|
|
649
721
|
}));
|
|
650
722
|
const count = dataSource ? dataSource.length : 0;
|
|
@@ -653,88 +725,70 @@ var TableElement = (props) => {
|
|
|
653
725
|
props.onChange({ name: "pagination", page, pageSize });
|
|
654
726
|
}
|
|
655
727
|
};
|
|
656
|
-
const onSelectChange = (newSelectedRowKeys) => {
|
|
657
|
-
console.log("selectedRowKeys changed: ", newSelectedRowKeys);
|
|
658
|
-
setSelectedRowKeys(newSelectedRowKeys);
|
|
659
|
-
};
|
|
660
728
|
const rowSelectionConfig = props.rowSelection ? {
|
|
661
|
-
selectedRowKeys,
|
|
662
|
-
|
|
729
|
+
onChange: (selectedRowKeys, selectedRows) => {
|
|
730
|
+
console.log(`selectedRowKeys: ${selectedRowKeys}`, "selectedRows: ", selectedRows);
|
|
731
|
+
if (props.onChange) {
|
|
732
|
+
props.onChange(selectedRows);
|
|
733
|
+
}
|
|
734
|
+
}
|
|
663
735
|
} : void 0;
|
|
664
736
|
return /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement(
|
|
665
737
|
Table2,
|
|
666
738
|
{
|
|
739
|
+
className: props.className,
|
|
667
740
|
pagination: {
|
|
668
741
|
showTotal: (total) => `Total: ${total} items`,
|
|
669
742
|
total: count,
|
|
670
743
|
showSizeChanger: count > 10,
|
|
671
744
|
onChange: onChangePage
|
|
672
745
|
},
|
|
746
|
+
rowSelection: rowSelectionConfig,
|
|
673
747
|
dataSource,
|
|
674
748
|
columns,
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
size: props.size && props.size
|
|
749
|
+
size: props.size,
|
|
750
|
+
bordered: true
|
|
678
751
|
}
|
|
679
752
|
), model && /* @__PURE__ */ React20.createElement(ModelElement, { selectedRecord, ...props, columns, model, onCancel: () => setModel(false) }));
|
|
680
753
|
};
|
|
681
754
|
|
|
682
755
|
// src/Components/DatePicker.tsx
|
|
683
|
-
import React21, { useState as
|
|
756
|
+
import React21, { useState as useState7 } from "react";
|
|
684
757
|
import { DatePicker } from "antd";
|
|
685
|
-
import
|
|
686
|
-
import
|
|
758
|
+
import dayjs from "dayjs";
|
|
759
|
+
import customParseFormat from "dayjs/plugin/customParseFormat.js";
|
|
760
|
+
dayjs.extend(customParseFormat);
|
|
687
761
|
var DatePickerElement = (props) => {
|
|
688
|
-
const [
|
|
689
|
-
const handleChange = (
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
const formattedDate = dateString;
|
|
694
|
-
console.log("formattedDate-----------------", formattedDate);
|
|
695
|
-
setDate(date2);
|
|
696
|
-
console.log("changedDate------------", date2);
|
|
762
|
+
const [dateState, setDateState] = useState7("");
|
|
763
|
+
const handleChange = (date, dateString) => {
|
|
764
|
+
if (date) {
|
|
765
|
+
const formattedDate = date;
|
|
766
|
+
setDateState(date);
|
|
697
767
|
if (props.onChange) {
|
|
698
768
|
props.onChange(formattedDate);
|
|
699
769
|
}
|
|
700
770
|
} else {
|
|
701
|
-
|
|
771
|
+
setDateState("");
|
|
702
772
|
if (props.onChange) {
|
|
703
773
|
props.onChange("");
|
|
704
774
|
}
|
|
705
775
|
}
|
|
706
776
|
};
|
|
707
|
-
|
|
708
|
-
const currentDate = date || moment();
|
|
709
|
-
const newDate = moment(currentDate).subtract(1, "days");
|
|
710
|
-
setDate(newDate);
|
|
711
|
-
if (props.onChange) {
|
|
712
|
-
props.onChange(newDate.format("lll"));
|
|
713
|
-
}
|
|
714
|
-
};
|
|
715
|
-
const onHandleIncrement = () => {
|
|
716
|
-
const currentDate = date || moment();
|
|
717
|
-
const newDate = moment(currentDate).add(1, "days");
|
|
718
|
-
setDate(newDate);
|
|
719
|
-
if (props.onChange) {
|
|
720
|
-
props.onChange(newDate.format("lll"));
|
|
721
|
-
}
|
|
722
|
-
};
|
|
723
|
-
return /* @__PURE__ */ React21.createElement("div", null, /* @__PURE__ */ React21.createElement("button", { onClick: onHandleDecrement }, /* @__PURE__ */ React21.createElement(LeftOutlined, null)), /* @__PURE__ */ React21.createElement(
|
|
777
|
+
return /* @__PURE__ */ React21.createElement("div", null, /* @__PURE__ */ React21.createElement(
|
|
724
778
|
DatePicker,
|
|
725
779
|
{
|
|
726
780
|
placeholder: props.placeholder,
|
|
727
|
-
value:
|
|
728
|
-
|
|
781
|
+
value: dateState,
|
|
782
|
+
format: { format: "DD-MM-YYYY" },
|
|
729
783
|
onChange: handleChange
|
|
730
784
|
}
|
|
731
|
-
)
|
|
785
|
+
));
|
|
732
786
|
};
|
|
733
787
|
|
|
734
788
|
// src/Components/DateRangePickerElement.tsx
|
|
735
789
|
import React22 from "react";
|
|
736
790
|
import { DatePicker as DatePicker2, Space } from "antd";
|
|
737
|
-
import
|
|
791
|
+
import dayjs2 from "dayjs";
|
|
738
792
|
var DateRangePickerElement = (props) => {
|
|
739
793
|
const { RangePicker } = DatePicker2;
|
|
740
794
|
const handleChange = (dates, dateStrings) => {
|
|
@@ -745,10 +799,10 @@ var DateRangePickerElement = (props) => {
|
|
|
745
799
|
}
|
|
746
800
|
};
|
|
747
801
|
const rangePresets = [
|
|
748
|
-
{ label: "Last 7 Days", value: [
|
|
749
|
-
{ label: "Last 14 Days", value: [
|
|
750
|
-
{ label: "Last 30 Days", value: [
|
|
751
|
-
{ label: "Last 90 Days", value: [
|
|
802
|
+
{ label: "Last 7 Days", value: [dayjs2().add(-7, "d"), dayjs2()] },
|
|
803
|
+
{ label: "Last 14 Days", value: [dayjs2().add(-14, "d"), dayjs2()] },
|
|
804
|
+
{ label: "Last 30 Days", value: [dayjs2().add(-30, "d"), dayjs2()] },
|
|
805
|
+
{ label: "Last 90 Days", value: [dayjs2().add(-90, "d"), dayjs2()] }
|
|
752
806
|
];
|
|
753
807
|
return /* @__PURE__ */ React22.createElement(Space, { direction: "vertical", size: 12 }, /* @__PURE__ */ React22.createElement(RangePicker, { presets: rangePresets, onChange: handleChange }));
|
|
754
808
|
};
|
|
@@ -756,7 +810,7 @@ var DateRangePickerElement = (props) => {
|
|
|
756
810
|
// src/Components/Image.tsx
|
|
757
811
|
import React23 from "react";
|
|
758
812
|
var Image = (props) => {
|
|
759
|
-
return /* @__PURE__ */ React23.createElement("
|
|
813
|
+
return /* @__PURE__ */ React23.createElement("img", { className: props.className, src: props.img, alt: "image" });
|
|
760
814
|
};
|
|
761
815
|
|
|
762
816
|
// src/Components/SingleCheckbox.tsx
|
|
@@ -772,35 +826,39 @@ var SingleCheckbox = (props) => {
|
|
|
772
826
|
};
|
|
773
827
|
|
|
774
828
|
// src/Components/DropDownGroup.tsx
|
|
775
|
-
import React25, { useState as
|
|
829
|
+
import React25, { useState as useState8 } from "react";
|
|
776
830
|
import { Select as Select4 } from "antd";
|
|
777
831
|
var DropDownGroup = (props) => {
|
|
778
|
-
const [selectedValue, setSelectedValue] =
|
|
832
|
+
const [selectedValue, setSelectedValue] = useState8({
|
|
779
833
|
firstValue: {},
|
|
780
|
-
secondValue: {}
|
|
834
|
+
secondValue: {},
|
|
835
|
+
temp: ""
|
|
781
836
|
});
|
|
782
837
|
const handleFirstChange = (value) => {
|
|
783
|
-
|
|
838
|
+
console.log(selectedValue.temp);
|
|
839
|
+
const filterOption2 = props.firstOptions?.find(
|
|
784
840
|
(eachOption) => eachOption.value === value
|
|
785
841
|
);
|
|
786
842
|
setSelectedValue((prev) => {
|
|
787
843
|
const newValue = { ...prev, firstValue: filterOption2 };
|
|
844
|
+
const { temp, ...rest } = newValue;
|
|
788
845
|
if (newValue.firstValue) {
|
|
789
|
-
props.onChange?.(
|
|
846
|
+
props.onChange?.(rest);
|
|
790
847
|
}
|
|
791
|
-
return
|
|
848
|
+
return newValue;
|
|
792
849
|
});
|
|
793
850
|
};
|
|
794
851
|
const handleSecondChange = (value) => {
|
|
795
|
-
const filterOption2 = props.
|
|
852
|
+
const filterOption2 = props.secondOptions?.find(
|
|
796
853
|
(eachOption) => eachOption.value === value
|
|
797
854
|
);
|
|
798
855
|
setSelectedValue((prev) => {
|
|
799
856
|
const newValue = { ...prev, secondValue: filterOption2 };
|
|
857
|
+
const { temp, ...rest } = newValue;
|
|
800
858
|
if (newValue.secondValue) {
|
|
801
|
-
props.onChange?.(
|
|
859
|
+
props.onChange?.(rest);
|
|
802
860
|
}
|
|
803
|
-
return
|
|
861
|
+
return newValue;
|
|
804
862
|
});
|
|
805
863
|
};
|
|
806
864
|
return /* @__PURE__ */ React25.createElement("div", { className: props.containerClassName }, props.label && /* @__PURE__ */ React25.createElement("label", { htmlFor: props.name, className: props.labelClassName }, props.label), /* @__PURE__ */ React25.createElement("div", { className: props.subContainerClassName }, /* @__PURE__ */ React25.createElement(
|
|
@@ -808,7 +866,7 @@ var DropDownGroup = (props) => {
|
|
|
808
866
|
{
|
|
809
867
|
onChange: handleFirstChange,
|
|
810
868
|
variant: props.variant,
|
|
811
|
-
options: props.
|
|
869
|
+
options: props.firstOptions,
|
|
812
870
|
className: props.className
|
|
813
871
|
}
|
|
814
872
|
), /* @__PURE__ */ React25.createElement("div", { style: { borderLeft: "1px solid gray", height: "33px" } }), /* @__PURE__ */ React25.createElement(
|
|
@@ -816,27 +874,19 @@ var DropDownGroup = (props) => {
|
|
|
816
874
|
{
|
|
817
875
|
onChange: handleSecondChange,
|
|
818
876
|
variant: props.variant,
|
|
819
|
-
options: props.
|
|
877
|
+
options: props.secondOptions,
|
|
820
878
|
className: props.className
|
|
821
879
|
}
|
|
822
880
|
)));
|
|
823
881
|
};
|
|
824
882
|
|
|
825
883
|
// src/Components/FilesUpload.tsx
|
|
826
|
-
import React26, { useState as
|
|
827
|
-
import { Upload
|
|
884
|
+
import React26, { useState as useState9 } from "react";
|
|
885
|
+
import { Upload } from "antd";
|
|
828
886
|
import { InboxOutlined } from "@ant-design/icons";
|
|
829
887
|
var FileUpload = (props) => {
|
|
830
888
|
const { Dragger } = Upload;
|
|
831
|
-
const [files, setFiles] =
|
|
832
|
-
const beforeUpload = (file) => {
|
|
833
|
-
const isCorrectFile = ["image/png", "image/jpg", "image/jpeg", "application/pdf"].includes(file.type);
|
|
834
|
-
if (!isCorrectFile) {
|
|
835
|
-
message.error(`(${file.name}) is an invalid file. Please upload files with the following extensions only (.png/.jpg/.jpeg/.pdf)`);
|
|
836
|
-
return Upload.LIST_IGNORE;
|
|
837
|
-
}
|
|
838
|
-
return true;
|
|
839
|
-
};
|
|
889
|
+
const [files, setFiles] = useState9([]);
|
|
840
890
|
const handleChange = ({ fileList }) => {
|
|
841
891
|
setFiles(fileList);
|
|
842
892
|
if (props.onChange) {
|
|
@@ -860,7 +910,6 @@ var FileUpload = (props) => {
|
|
|
860
910
|
maxCount: props.max_count,
|
|
861
911
|
multiple: props.multiple,
|
|
862
912
|
fileList: files,
|
|
863
|
-
beforeUpload,
|
|
864
913
|
onChange: handleChange,
|
|
865
914
|
showUploadList: true,
|
|
866
915
|
customRequest
|
|
@@ -881,6 +930,149 @@ var TabsElement = (props) => {
|
|
|
881
930
|
};
|
|
882
931
|
return /* @__PURE__ */ React27.createElement(Tabs, { className: props.containerClassName, items: props.options, onChange: handleChange });
|
|
883
932
|
};
|
|
933
|
+
|
|
934
|
+
// src/Components/SwitchElement.tsx
|
|
935
|
+
import React28 from "react";
|
|
936
|
+
import { Switch } from "antd";
|
|
937
|
+
var onChange = (checked) => {
|
|
938
|
+
console.log(`switch to ${checked}`);
|
|
939
|
+
};
|
|
940
|
+
var SwitchElement = () => /* @__PURE__ */ React28.createElement(Switch, { defaultChecked: true, onChange });
|
|
941
|
+
|
|
942
|
+
// src/Components/Upload.tsx
|
|
943
|
+
import React29, { useState as useState10 } from "react";
|
|
944
|
+
var Upload2 = (props) => {
|
|
945
|
+
const [file, setFile] = useState10();
|
|
946
|
+
const handleFileChange = (e) => {
|
|
947
|
+
setFile(e.target.files[0]);
|
|
948
|
+
if (props.onChange) {
|
|
949
|
+
props.onChange(e.target.files[0]);
|
|
950
|
+
}
|
|
951
|
+
};
|
|
952
|
+
const handleUpload = async () => {
|
|
953
|
+
if (!file) {
|
|
954
|
+
console.error("No file selected");
|
|
955
|
+
return;
|
|
956
|
+
}
|
|
957
|
+
};
|
|
958
|
+
return /* @__PURE__ */ React29.createElement("div", { style: { marginTop: 16 } }, /* @__PURE__ */ React29.createElement("input", { type: "file", onChange: handleFileChange }), /* @__PURE__ */ React29.createElement(
|
|
959
|
+
"button",
|
|
960
|
+
{
|
|
961
|
+
type: "button",
|
|
962
|
+
onClick: handleUpload,
|
|
963
|
+
disabled: !file,
|
|
964
|
+
style: { marginTop: 16 }
|
|
965
|
+
},
|
|
966
|
+
"Upload"
|
|
967
|
+
));
|
|
968
|
+
};
|
|
969
|
+
|
|
970
|
+
// src/Components/OtpElement.tsx
|
|
971
|
+
import React30, { useState as useState11, useRef, useEffect as useEffect3 } from "react";
|
|
972
|
+
import { Input as Input3 } from "antd";
|
|
973
|
+
var OtpElement = (props) => {
|
|
974
|
+
const length = props.length;
|
|
975
|
+
const [otp, setOtp] = useState11(Array(length).fill(""));
|
|
976
|
+
const inputRefs = useRef([]);
|
|
977
|
+
const handleChange = (e, index) => {
|
|
978
|
+
const value = e.target.value;
|
|
979
|
+
if (/^[0-9]$/.test(value) || value === "") {
|
|
980
|
+
const newOtp = [...otp];
|
|
981
|
+
newOtp[index] = value;
|
|
982
|
+
setOtp(newOtp);
|
|
983
|
+
props.onChange && props.onChange(newOtp.join(""));
|
|
984
|
+
if (value && index < length - 1) {
|
|
985
|
+
inputRefs.current[index + 1]?.focus();
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
};
|
|
989
|
+
const handleKeyDown = (e, index) => {
|
|
990
|
+
if (e.key === "Backspace" && !otp[index] && index > 0) {
|
|
991
|
+
inputRefs.current[index - 1]?.focus();
|
|
992
|
+
}
|
|
993
|
+
};
|
|
994
|
+
const handlePaste = (e) => {
|
|
995
|
+
e.preventDefault();
|
|
996
|
+
const pasteData = e.clipboardData.getData("text");
|
|
997
|
+
if (/^\d+$/.test(pasteData)) {
|
|
998
|
+
const newOtp = pasteData.split("").slice(0, length);
|
|
999
|
+
setOtp(newOtp.concat(Array(length - newOtp.length).fill("")));
|
|
1000
|
+
props.onChange && props.onChange(newOtp.join(""));
|
|
1001
|
+
newOtp.forEach((_, idx) => {
|
|
1002
|
+
if (inputRefs.current[idx]) {
|
|
1003
|
+
inputRefs.current[idx]?.focus();
|
|
1004
|
+
}
|
|
1005
|
+
});
|
|
1006
|
+
}
|
|
1007
|
+
};
|
|
1008
|
+
useEffect3(() => {
|
|
1009
|
+
inputRefs.current[0]?.focus();
|
|
1010
|
+
}, []);
|
|
1011
|
+
return /* @__PURE__ */ React30.createElement("div", { className: props.containerClassName }, Array.from({ length }).map((_, index) => /* @__PURE__ */ React30.createElement(
|
|
1012
|
+
Input3,
|
|
1013
|
+
{
|
|
1014
|
+
key: index,
|
|
1015
|
+
className: props.className,
|
|
1016
|
+
maxLength: 1,
|
|
1017
|
+
value: otp[index],
|
|
1018
|
+
onChange: (e) => handleChange(e, index),
|
|
1019
|
+
onKeyDown: (e) => handleKeyDown(e, index),
|
|
1020
|
+
onPaste: handlePaste,
|
|
1021
|
+
ref: (el) => inputRefs.current[index] = el
|
|
1022
|
+
}
|
|
1023
|
+
)));
|
|
1024
|
+
};
|
|
1025
|
+
|
|
1026
|
+
// src/Components/Donut.tsx
|
|
1027
|
+
import React31 from "react";
|
|
1028
|
+
import Highcharts from "highcharts";
|
|
1029
|
+
import HighchartsReact from "highcharts-react-official";
|
|
1030
|
+
var Donut = (props) => {
|
|
1031
|
+
console.log(props);
|
|
1032
|
+
const chartOptions = {
|
|
1033
|
+
title: {
|
|
1034
|
+
text: "Distribution of Students"
|
|
1035
|
+
},
|
|
1036
|
+
plotOptions: {
|
|
1037
|
+
pie: {
|
|
1038
|
+
innerSize: "70%",
|
|
1039
|
+
dataLabels: {
|
|
1040
|
+
enabled: false,
|
|
1041
|
+
format: "<b>{point.name}</b>: {point.percentage:.1f} %"
|
|
1042
|
+
},
|
|
1043
|
+
showInLegend: true
|
|
1044
|
+
}
|
|
1045
|
+
},
|
|
1046
|
+
series: [
|
|
1047
|
+
{
|
|
1048
|
+
type: "pie",
|
|
1049
|
+
name: "Percentage",
|
|
1050
|
+
data: [
|
|
1051
|
+
{
|
|
1052
|
+
name: "Girls",
|
|
1053
|
+
y: 20,
|
|
1054
|
+
color: "#FF6384"
|
|
1055
|
+
// Custom color for Girls
|
|
1056
|
+
},
|
|
1057
|
+
{
|
|
1058
|
+
name: "Boys",
|
|
1059
|
+
y: 40,
|
|
1060
|
+
color: "#36A2EB"
|
|
1061
|
+
// Custom color for Boys
|
|
1062
|
+
},
|
|
1063
|
+
{
|
|
1064
|
+
name: "Students",
|
|
1065
|
+
y: 40,
|
|
1066
|
+
color: "#FFCE56"
|
|
1067
|
+
// Custom color for Students
|
|
1068
|
+
}
|
|
1069
|
+
]
|
|
1070
|
+
}
|
|
1071
|
+
]
|
|
1072
|
+
};
|
|
1073
|
+
console.log(chartOptions);
|
|
1074
|
+
return /* @__PURE__ */ React31.createElement("div", null, /* @__PURE__ */ React31.createElement(HighchartsReact, { highcharts: Highcharts, options: chartOptions }));
|
|
1075
|
+
};
|
|
884
1076
|
export {
|
|
885
1077
|
AddMoreTable,
|
|
886
1078
|
ButtonElement,
|
|
@@ -888,20 +1080,24 @@ export {
|
|
|
888
1080
|
CkEditor,
|
|
889
1081
|
DatePickerElement,
|
|
890
1082
|
DateRangePickerElement,
|
|
1083
|
+
Donut,
|
|
891
1084
|
DropDownGroup,
|
|
892
1085
|
FileUpload,
|
|
893
1086
|
Image,
|
|
894
1087
|
MultipleSelectElement,
|
|
895
1088
|
Navbar,
|
|
896
1089
|
NumberElement,
|
|
1090
|
+
OtpElement,
|
|
897
1091
|
PasswordElement,
|
|
898
1092
|
RadioElement,
|
|
899
1093
|
SelectElement,
|
|
900
1094
|
Sidebar,
|
|
901
1095
|
SingleCheckbox,
|
|
902
1096
|
SingleSelectElement,
|
|
1097
|
+
SwitchElement,
|
|
903
1098
|
TableElement,
|
|
904
1099
|
TabsElement,
|
|
905
1100
|
TextElement,
|
|
906
|
-
TextareaElement
|
|
1101
|
+
TextareaElement,
|
|
1102
|
+
Upload2 as Upload
|
|
907
1103
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apexcura/ui-components",
|
|
3
|
-
"version": "0.0.14-
|
|
3
|
+
"version": "0.0.14-Beta90",
|
|
4
4
|
"description": "Apex cura React components library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"apex cura",
|
|
@@ -48,12 +48,12 @@
|
|
|
48
48
|
"node": ">=18.0.0"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@apexcura/core": "^0.0.15-Beta34",
|
|
52
|
-
"@apexcura/ui-components": "^0.0.11-Beta256",
|
|
53
51
|
"@tinymce/tinymce-react": "^5.0.1",
|
|
54
52
|
"autoprefixer": "^10.4.19",
|
|
55
53
|
"date-fns": "^3.6.0",
|
|
56
54
|
"esbuild": "^0.21.4",
|
|
55
|
+
"highcharts": "^11.4.3",
|
|
56
|
+
"highcharts-react-official": "^3.2.1",
|
|
57
57
|
"moment": "^2.30.1",
|
|
58
58
|
"postcss": "^8.4.38",
|
|
59
59
|
"postcss-import": "^16.1.0",
|