@apexcura/ui-components 0.0.14-Beta196 → 0.0.14-Beta197
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 -17
- package/dist/index.js +1 -76
- package/dist/index.mjs +25 -100
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -341,9 +341,6 @@ video {
|
|
|
341
341
|
.m-\[10px\] {
|
|
342
342
|
margin: 10px;
|
|
343
343
|
}
|
|
344
|
-
.mr-3 {
|
|
345
|
-
margin-right: 0.75rem;
|
|
346
|
-
}
|
|
347
344
|
.flex {
|
|
348
345
|
display: flex;
|
|
349
346
|
}
|
|
@@ -353,20 +350,6 @@ video {
|
|
|
353
350
|
.grid {
|
|
354
351
|
display: grid;
|
|
355
352
|
}
|
|
356
|
-
.h-5 {
|
|
357
|
-
height: 1.25rem;
|
|
358
|
-
}
|
|
359
|
-
.w-5 {
|
|
360
|
-
width: 1.25rem;
|
|
361
|
-
}
|
|
362
|
-
@keyframes spin {
|
|
363
|
-
to {
|
|
364
|
-
transform: rotate(360deg);
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
.animate-spin {
|
|
368
|
-
animation: spin 1s linear infinite;
|
|
369
|
-
}
|
|
370
353
|
.rounded-\[8px\] {
|
|
371
354
|
border-radius: 8px;
|
|
372
355
|
}
|
|
@@ -424,6 +407,9 @@ video {
|
|
|
424
407
|
.filter {
|
|
425
408
|
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
|
426
409
|
}
|
|
410
|
+
.bg-sky-700 .icon-active {
|
|
411
|
+
filter: brightness(0) invert(1);
|
|
412
|
+
}
|
|
427
413
|
.submit:where(.css-dev-only-do-not-override-1r287do).ant-btn-default:not(:disabled):not(.ant-btn-disabled):hover {
|
|
428
414
|
color: #472D7A;
|
|
429
415
|
background-color: white;
|
package/dist/index.js
CHANGED
|
@@ -384,92 +384,17 @@ var MultipleSelectElement = (props) => {
|
|
|
384
384
|
// src/Components/Button.tsx
|
|
385
385
|
var import_react11 = __toESM(require("react"));
|
|
386
386
|
var ButtonElement = (props) => {
|
|
387
|
-
const [svgContent, setSvgContent] = (0, import_react11.useState)(null);
|
|
388
|
-
const [originalSvgContent, setOriginalSvgContent] = (0, import_react11.useState)(
|
|
389
|
-
null
|
|
390
|
-
);
|
|
391
|
-
const [hoverColor, setHoverColor] = (0, import_react11.useState)(null);
|
|
392
|
-
const [loading, setLoading] = (0, import_react11.useState)(false);
|
|
393
|
-
(0, import_react11.useEffect)(() => {
|
|
394
|
-
if (props.icon) {
|
|
395
|
-
setLoading(true);
|
|
396
|
-
fetch(props.icon).then((response) => response.text()).then((data) => {
|
|
397
|
-
const tempDiv = document.createElement("div");
|
|
398
|
-
tempDiv.innerHTML = data;
|
|
399
|
-
const svgElement = tempDiv.querySelector("svg");
|
|
400
|
-
if (svgElement) {
|
|
401
|
-
const textColorClass = props.className?.match(/text-[\w-]+/g)?.[0];
|
|
402
|
-
const hoverColorClass = props.className?.match(/hover:text-[\w-]+/g)?.[0];
|
|
403
|
-
if (textColorClass) {
|
|
404
|
-
const tempSpan = document.createElement("span");
|
|
405
|
-
tempSpan.className = textColorClass;
|
|
406
|
-
document.body.appendChild(tempSpan);
|
|
407
|
-
const computedColor = getComputedStyle(tempSpan).color;
|
|
408
|
-
document.body.removeChild(tempSpan);
|
|
409
|
-
const paths = svgElement.querySelectorAll("path");
|
|
410
|
-
paths.forEach((path) => path.setAttribute("fill", computedColor));
|
|
411
|
-
}
|
|
412
|
-
if (hoverColorClass) {
|
|
413
|
-
const tempSpan = document.createElement("span");
|
|
414
|
-
tempSpan.className = hoverColorClass.replace("hover:", "");
|
|
415
|
-
document.body.appendChild(tempSpan);
|
|
416
|
-
const computedHoverColor = getComputedStyle(tempSpan).color;
|
|
417
|
-
document.body.removeChild(tempSpan);
|
|
418
|
-
setHoverColor(computedHoverColor);
|
|
419
|
-
}
|
|
420
|
-
svgElement.setAttribute(
|
|
421
|
-
"class",
|
|
422
|
-
`${props.iconsClassName ? props.iconsClassName : ""}`
|
|
423
|
-
);
|
|
424
|
-
setSvgContent(tempDiv.innerHTML);
|
|
425
|
-
setOriginalSvgContent(tempDiv.innerHTML);
|
|
426
|
-
}
|
|
427
|
-
}).catch((error) => console.error("Error fetching SVG:", error));
|
|
428
|
-
}
|
|
429
|
-
setLoading(false);
|
|
430
|
-
}, []);
|
|
431
|
-
const handleMouseEnter = () => {
|
|
432
|
-
if (hoverColor && originalSvgContent) {
|
|
433
|
-
const tempDiv = document.createElement("div");
|
|
434
|
-
tempDiv.innerHTML = originalSvgContent;
|
|
435
|
-
const svgElement = tempDiv.querySelector("svg");
|
|
436
|
-
const paths = svgElement?.querySelectorAll("path");
|
|
437
|
-
paths?.forEach((path) => path.setAttribute("fill", hoverColor));
|
|
438
|
-
setSvgContent(tempDiv.innerHTML);
|
|
439
|
-
}
|
|
440
|
-
};
|
|
441
|
-
const handleMouseLeave = () => {
|
|
442
|
-
if (originalSvgContent) {
|
|
443
|
-
setSvgContent(originalSvgContent);
|
|
444
|
-
}
|
|
445
|
-
};
|
|
446
387
|
return /* @__PURE__ */ import_react11.default.createElement(
|
|
447
388
|
"button",
|
|
448
389
|
{
|
|
449
390
|
onClick: props.onClick,
|
|
450
391
|
className: `${props.className ? props.className : ""}`,
|
|
451
|
-
onMouseEnter: handleMouseEnter,
|
|
452
|
-
onMouseLeave: handleMouseLeave,
|
|
453
392
|
disabled: props.loading,
|
|
454
393
|
style: {
|
|
455
394
|
cursor: props.loading ? "no-drop" : "pointer"
|
|
456
395
|
}
|
|
457
396
|
},
|
|
458
|
-
|
|
459
|
-
"img",
|
|
460
|
-
{
|
|
461
|
-
className: props.iconsClassName,
|
|
462
|
-
src: props.icon,
|
|
463
|
-
alt: props.label
|
|
464
|
-
}
|
|
465
|
-
) : loading ? /* @__PURE__ */ import_react11.default.createElement(
|
|
466
|
-
"img",
|
|
467
|
-
{
|
|
468
|
-
className: props.iconsClassName,
|
|
469
|
-
src: props.icon,
|
|
470
|
-
alt: props.label
|
|
471
|
-
}
|
|
472
|
-
) : /* @__PURE__ */ import_react11.default.createElement("span", { className: props.iconsClassName }, /* @__PURE__ */ import_react11.default.createElement("span", { dangerouslySetInnerHTML: { __html: svgContent || "" } })), props.label)
|
|
397
|
+
/* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, /* @__PURE__ */ import_react11.default.createElement("span", { className: props.iconsClassName }, /* @__PURE__ */ import_react11.default.createElement("img", { src: props.icon, className: "icon-active" })), props.label)
|
|
473
398
|
);
|
|
474
399
|
};
|
|
475
400
|
|
package/dist/index.mjs
CHANGED
|
@@ -316,104 +316,29 @@ var MultipleSelectElement = (props) => {
|
|
|
316
316
|
};
|
|
317
317
|
|
|
318
318
|
// src/Components/Button.tsx
|
|
319
|
-
import React11
|
|
319
|
+
import React11 from "react";
|
|
320
320
|
var ButtonElement = (props) => {
|
|
321
|
-
const [svgContent, setSvgContent] = useState4(null);
|
|
322
|
-
const [originalSvgContent, setOriginalSvgContent] = useState4(
|
|
323
|
-
null
|
|
324
|
-
);
|
|
325
|
-
const [hoverColor, setHoverColor] = useState4(null);
|
|
326
|
-
const [loading, setLoading] = useState4(false);
|
|
327
|
-
useEffect(() => {
|
|
328
|
-
if (props.icon) {
|
|
329
|
-
setLoading(true);
|
|
330
|
-
fetch(props.icon).then((response) => response.text()).then((data) => {
|
|
331
|
-
const tempDiv = document.createElement("div");
|
|
332
|
-
tempDiv.innerHTML = data;
|
|
333
|
-
const svgElement = tempDiv.querySelector("svg");
|
|
334
|
-
if (svgElement) {
|
|
335
|
-
const textColorClass = props.className?.match(/text-[\w-]+/g)?.[0];
|
|
336
|
-
const hoverColorClass = props.className?.match(/hover:text-[\w-]+/g)?.[0];
|
|
337
|
-
if (textColorClass) {
|
|
338
|
-
const tempSpan = document.createElement("span");
|
|
339
|
-
tempSpan.className = textColorClass;
|
|
340
|
-
document.body.appendChild(tempSpan);
|
|
341
|
-
const computedColor = getComputedStyle(tempSpan).color;
|
|
342
|
-
document.body.removeChild(tempSpan);
|
|
343
|
-
const paths = svgElement.querySelectorAll("path");
|
|
344
|
-
paths.forEach((path) => path.setAttribute("fill", computedColor));
|
|
345
|
-
}
|
|
346
|
-
if (hoverColorClass) {
|
|
347
|
-
const tempSpan = document.createElement("span");
|
|
348
|
-
tempSpan.className = hoverColorClass.replace("hover:", "");
|
|
349
|
-
document.body.appendChild(tempSpan);
|
|
350
|
-
const computedHoverColor = getComputedStyle(tempSpan).color;
|
|
351
|
-
document.body.removeChild(tempSpan);
|
|
352
|
-
setHoverColor(computedHoverColor);
|
|
353
|
-
}
|
|
354
|
-
svgElement.setAttribute(
|
|
355
|
-
"class",
|
|
356
|
-
`${props.iconsClassName ? props.iconsClassName : ""}`
|
|
357
|
-
);
|
|
358
|
-
setSvgContent(tempDiv.innerHTML);
|
|
359
|
-
setOriginalSvgContent(tempDiv.innerHTML);
|
|
360
|
-
}
|
|
361
|
-
}).catch((error) => console.error("Error fetching SVG:", error));
|
|
362
|
-
}
|
|
363
|
-
setLoading(false);
|
|
364
|
-
}, []);
|
|
365
|
-
const handleMouseEnter = () => {
|
|
366
|
-
if (hoverColor && originalSvgContent) {
|
|
367
|
-
const tempDiv = document.createElement("div");
|
|
368
|
-
tempDiv.innerHTML = originalSvgContent;
|
|
369
|
-
const svgElement = tempDiv.querySelector("svg");
|
|
370
|
-
const paths = svgElement?.querySelectorAll("path");
|
|
371
|
-
paths?.forEach((path) => path.setAttribute("fill", hoverColor));
|
|
372
|
-
setSvgContent(tempDiv.innerHTML);
|
|
373
|
-
}
|
|
374
|
-
};
|
|
375
|
-
const handleMouseLeave = () => {
|
|
376
|
-
if (originalSvgContent) {
|
|
377
|
-
setSvgContent(originalSvgContent);
|
|
378
|
-
}
|
|
379
|
-
};
|
|
380
321
|
return /* @__PURE__ */ React11.createElement(
|
|
381
322
|
"button",
|
|
382
323
|
{
|
|
383
324
|
onClick: props.onClick,
|
|
384
325
|
className: `${props.className ? props.className : ""}`,
|
|
385
|
-
onMouseEnter: handleMouseEnter,
|
|
386
|
-
onMouseLeave: handleMouseLeave,
|
|
387
326
|
disabled: props.loading,
|
|
388
327
|
style: {
|
|
389
328
|
cursor: props.loading ? "no-drop" : "pointer"
|
|
390
329
|
}
|
|
391
330
|
},
|
|
392
|
-
|
|
393
|
-
"img",
|
|
394
|
-
{
|
|
395
|
-
className: props.iconsClassName,
|
|
396
|
-
src: props.icon,
|
|
397
|
-
alt: props.label
|
|
398
|
-
}
|
|
399
|
-
) : loading ? /* @__PURE__ */ React11.createElement(
|
|
400
|
-
"img",
|
|
401
|
-
{
|
|
402
|
-
className: props.iconsClassName,
|
|
403
|
-
src: props.icon,
|
|
404
|
-
alt: props.label
|
|
405
|
-
}
|
|
406
|
-
) : /* @__PURE__ */ React11.createElement("span", { className: props.iconsClassName }, /* @__PURE__ */ React11.createElement("span", { dangerouslySetInnerHTML: { __html: svgContent || "" } })), props.label)
|
|
331
|
+
/* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement("span", { className: props.iconsClassName }, /* @__PURE__ */ React11.createElement("img", { src: props.icon, className: "icon-active" })), props.label)
|
|
407
332
|
);
|
|
408
333
|
};
|
|
409
334
|
|
|
410
335
|
// src/Components/AddMoreTable.tsx
|
|
411
|
-
import React12, { useEffect
|
|
336
|
+
import React12, { useEffect, useState as useState4 } from "react";
|
|
412
337
|
import { Table, Button } from "antd";
|
|
413
338
|
import { PlusOutlined, DeleteOutlined } from "@ant-design/icons";
|
|
414
339
|
var AddMoreTable = (props) => {
|
|
415
340
|
const { thead, tbody } = props;
|
|
416
|
-
const [rows, setRows] =
|
|
341
|
+
const [rows, setRows] = useState4(tbody || []);
|
|
417
342
|
const onHandleRows = () => {
|
|
418
343
|
const newId = rows.length > 0 ? rows[rows.length - 1].id + 1 : 1;
|
|
419
344
|
let newRow = {
|
|
@@ -478,7 +403,7 @@ var AddMoreTable = (props) => {
|
|
|
478
403
|
});
|
|
479
404
|
});
|
|
480
405
|
};
|
|
481
|
-
|
|
406
|
+
useEffect(() => {
|
|
482
407
|
console.log(rows);
|
|
483
408
|
}, [rows]);
|
|
484
409
|
const renderInputElement = (element, value) => {
|
|
@@ -622,7 +547,7 @@ var Navbar = (props) => {
|
|
|
622
547
|
};
|
|
623
548
|
|
|
624
549
|
// src/Components/TableElement.tsx
|
|
625
|
-
import React20, { useState as
|
|
550
|
+
import React20, { useState as useState5, useEffect as useEffect2 } from "react";
|
|
626
551
|
import { Table as Table2 } from "antd";
|
|
627
552
|
|
|
628
553
|
// src/Components/Model.tsx
|
|
@@ -724,10 +649,10 @@ var ModelElement = (props) => {
|
|
|
724
649
|
import { EyeOutlined } from "@ant-design/icons";
|
|
725
650
|
var TableElement = (props) => {
|
|
726
651
|
const { thead, tbody } = props;
|
|
727
|
-
const [selectedRecord, setSelectedRecord] =
|
|
728
|
-
const [model, setModel] =
|
|
729
|
-
const [dataSource, setDataSource] =
|
|
730
|
-
|
|
652
|
+
const [selectedRecord, setSelectedRecord] = useState5({});
|
|
653
|
+
const [model, setModel] = useState5(false);
|
|
654
|
+
const [dataSource, setDataSource] = useState5([]);
|
|
655
|
+
useEffect2(() => {
|
|
731
656
|
if (tbody) {
|
|
732
657
|
setDataSource(
|
|
733
658
|
tbody.map((row, index) => ({
|
|
@@ -861,14 +786,14 @@ var TableElement = (props) => {
|
|
|
861
786
|
};
|
|
862
787
|
|
|
863
788
|
// src/Components/DatePicker.tsx
|
|
864
|
-
import React21, { useState as
|
|
789
|
+
import React21, { useState as useState6 } from "react";
|
|
865
790
|
import { DatePicker } from "antd";
|
|
866
791
|
import dayjs from "dayjs";
|
|
867
792
|
import customParseFormat from "dayjs/plugin/customParseFormat.js";
|
|
868
793
|
import moment2 from "moment";
|
|
869
794
|
dayjs.extend(customParseFormat);
|
|
870
795
|
var DatePickerElement = (props) => {
|
|
871
|
-
const [dateState, setDateState] =
|
|
796
|
+
const [dateState, setDateState] = useState6("");
|
|
872
797
|
const handleChange = (date, dateString) => {
|
|
873
798
|
if (date) {
|
|
874
799
|
const formattedDate = dateString;
|
|
@@ -952,10 +877,10 @@ var SingleCheckbox = (props) => {
|
|
|
952
877
|
};
|
|
953
878
|
|
|
954
879
|
// src/Components/DropDownGroup.tsx
|
|
955
|
-
import React25, { useState as
|
|
880
|
+
import React25, { useState as useState7 } from "react";
|
|
956
881
|
import { Select as Select4 } from "antd";
|
|
957
882
|
var DropDownGroup = (props) => {
|
|
958
|
-
const [selectedValue, setSelectedValue] =
|
|
883
|
+
const [selectedValue, setSelectedValue] = useState7({
|
|
959
884
|
firstValue: {},
|
|
960
885
|
secondValue: {},
|
|
961
886
|
temp: ""
|
|
@@ -1007,12 +932,12 @@ var DropDownGroup = (props) => {
|
|
|
1007
932
|
};
|
|
1008
933
|
|
|
1009
934
|
// src/Components/FilesUpload.tsx
|
|
1010
|
-
import React26, { useState as
|
|
935
|
+
import React26, { useState as useState8 } from "react";
|
|
1011
936
|
import { Upload } from "antd";
|
|
1012
937
|
import { InboxOutlined } from "@ant-design/icons";
|
|
1013
938
|
var FileUpload = (props) => {
|
|
1014
939
|
const { Dragger } = Upload;
|
|
1015
|
-
const [files, setFiles] =
|
|
940
|
+
const [files, setFiles] = useState8([]);
|
|
1016
941
|
const handleChange = ({ fileList }) => {
|
|
1017
942
|
setFiles(fileList);
|
|
1018
943
|
if (props.onChange) {
|
|
@@ -1066,9 +991,9 @@ var onChange = (checked) => {
|
|
|
1066
991
|
var SwitchElement = () => /* @__PURE__ */ React28.createElement(Switch, { defaultChecked: true, onChange });
|
|
1067
992
|
|
|
1068
993
|
// src/Components/Upload.tsx
|
|
1069
|
-
import React29, { useState as
|
|
994
|
+
import React29, { useState as useState9 } from "react";
|
|
1070
995
|
var Upload2 = (props) => {
|
|
1071
|
-
const [file, setFile] =
|
|
996
|
+
const [file, setFile] = useState9();
|
|
1072
997
|
const handleFileChange = (e) => {
|
|
1073
998
|
setFile(e.target.files[0]);
|
|
1074
999
|
if (props.onChange) {
|
|
@@ -1094,11 +1019,11 @@ var Upload2 = (props) => {
|
|
|
1094
1019
|
};
|
|
1095
1020
|
|
|
1096
1021
|
// src/Components/OtpElement.tsx
|
|
1097
|
-
import React30, { useState as
|
|
1022
|
+
import React30, { useState as useState10, useRef, useEffect as useEffect3 } from "react";
|
|
1098
1023
|
import { Input as Input3 } from "antd";
|
|
1099
1024
|
var OtpElement = (props) => {
|
|
1100
1025
|
const length = props.length;
|
|
1101
|
-
const [otp, setOtp] =
|
|
1026
|
+
const [otp, setOtp] = useState10(Array(length).fill(""));
|
|
1102
1027
|
const inputRefs = useRef([]);
|
|
1103
1028
|
const handleChange = (e, index) => {
|
|
1104
1029
|
const value = e.target.value;
|
|
@@ -1131,7 +1056,7 @@ var OtpElement = (props) => {
|
|
|
1131
1056
|
});
|
|
1132
1057
|
}
|
|
1133
1058
|
};
|
|
1134
|
-
|
|
1059
|
+
useEffect3(() => {
|
|
1135
1060
|
inputRefs.current[0]?.focus();
|
|
1136
1061
|
}, []);
|
|
1137
1062
|
return /* @__PURE__ */ React30.createElement("div", { className: props.containerClassName }, Array.from({ length }).map((_, index) => /* @__PURE__ */ React30.createElement(
|
|
@@ -1383,7 +1308,7 @@ var HorizontalBarChart = (props) => {
|
|
|
1383
1308
|
};
|
|
1384
1309
|
|
|
1385
1310
|
// src/Components/LineChart.tsx
|
|
1386
|
-
import React34, { useEffect as
|
|
1311
|
+
import React34, { useEffect as useEffect4, useRef as useRef2 } from "react";
|
|
1387
1312
|
import Chart from "chart.js/auto";
|
|
1388
1313
|
var LineChart = (props) => {
|
|
1389
1314
|
const chartRef = useRef2(null);
|
|
@@ -1394,7 +1319,7 @@ var LineChart = (props) => {
|
|
|
1394
1319
|
{ label: "Conversion Rate", data: [50, 100, 150, 180, 50] }
|
|
1395
1320
|
];
|
|
1396
1321
|
const labels = ["Instagram", "Whatsapp", "Messages", "Telegram", "Linkedin"];
|
|
1397
|
-
|
|
1322
|
+
useEffect4(() => {
|
|
1398
1323
|
if (chartRef.current) {
|
|
1399
1324
|
if (chartInstance.current) {
|
|
1400
1325
|
chartInstance.current.destroy();
|
|
@@ -1456,12 +1381,12 @@ var LineChart = (props) => {
|
|
|
1456
1381
|
};
|
|
1457
1382
|
|
|
1458
1383
|
// src/Components/DoubleBarChart.tsx
|
|
1459
|
-
import React35, { useEffect as
|
|
1384
|
+
import React35, { useEffect as useEffect5, useRef as useRef3 } from "react";
|
|
1460
1385
|
import Chart2 from "chart.js/auto";
|
|
1461
1386
|
var DoubleBarChart = (props) => {
|
|
1462
1387
|
const chartRef = useRef3(null);
|
|
1463
1388
|
const chartInstance = useRef3(null);
|
|
1464
|
-
|
|
1389
|
+
useEffect5(() => {
|
|
1465
1390
|
if (chartRef.current) {
|
|
1466
1391
|
if (chartInstance.current) {
|
|
1467
1392
|
chartInstance.current.destroy();
|