@esic-lab/data-core-ui 0.0.68 → 0.0.70
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 +8 -4
- package/dist/index.d.ts +8 -4
- package/dist/index.js +198 -141
- package/dist/index.mjs +156 -99
- package/package.json +4 -3
package/dist/index.js
CHANGED
|
@@ -425,7 +425,8 @@ function PrimaryButton({
|
|
|
425
425
|
colorPrimaryHover = "#8895f9",
|
|
426
426
|
textColor = "#ffffff",
|
|
427
427
|
icon,
|
|
428
|
-
className
|
|
428
|
+
className,
|
|
429
|
+
htmlType
|
|
429
430
|
}) {
|
|
430
431
|
const textClass = size === "large" ? "body-1" : "body-3";
|
|
431
432
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -448,6 +449,7 @@ function PrimaryButton({
|
|
|
448
449
|
disabled,
|
|
449
450
|
icon,
|
|
450
451
|
iconPosition: iconPlacement,
|
|
452
|
+
htmlType,
|
|
451
453
|
children: title
|
|
452
454
|
}
|
|
453
455
|
)
|
|
@@ -469,7 +471,8 @@ function SecondaryButton({
|
|
|
469
471
|
defaultHoverColor = "#7181f8",
|
|
470
472
|
textColor = "rgba(0,0,0,0.88)",
|
|
471
473
|
icon,
|
|
472
|
-
className
|
|
474
|
+
className,
|
|
475
|
+
htmlType
|
|
473
476
|
}) {
|
|
474
477
|
const textClass = size === "large" ? "body-1" : "body-3";
|
|
475
478
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
@@ -497,6 +500,7 @@ function SecondaryButton({
|
|
|
497
500
|
disabled,
|
|
498
501
|
icon,
|
|
499
502
|
iconPosition: iconPlacement,
|
|
503
|
+
htmlType,
|
|
500
504
|
children: title
|
|
501
505
|
}
|
|
502
506
|
)
|
|
@@ -552,7 +556,8 @@ function TertiaryButton({
|
|
|
552
556
|
colorPrimaryHover = "#4d5461",
|
|
553
557
|
textColor = "white",
|
|
554
558
|
icon,
|
|
555
|
-
className
|
|
559
|
+
className,
|
|
560
|
+
htmlType
|
|
556
561
|
}) {
|
|
557
562
|
const textClass = size === "large" ? "body-1" : "body-3";
|
|
558
563
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
@@ -575,6 +580,7 @@ function TertiaryButton({
|
|
|
575
580
|
disabled,
|
|
576
581
|
icon,
|
|
577
582
|
iconPosition: iconPlacement,
|
|
583
|
+
htmlType,
|
|
578
584
|
children: title
|
|
579
585
|
}
|
|
580
586
|
)
|
|
@@ -753,39 +759,48 @@ function SwitchSelect({
|
|
|
753
759
|
}
|
|
754
760
|
|
|
755
761
|
// src/NavBar/MenuNavBar/MenuNavBar.tsx
|
|
756
|
-
var
|
|
762
|
+
var import_react_router = require("react-router");
|
|
757
763
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
758
764
|
function MenuNavBar({ menus, onClick }) {
|
|
759
|
-
const
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
{
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
765
|
+
const location = (0, import_react_router.useLocation)();
|
|
766
|
+
const pathname = location.pathname;
|
|
767
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "w-full h-full p-[10px] bg-white", children: menus?.map((menu, index) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
768
|
+
"div",
|
|
769
|
+
{
|
|
770
|
+
className: `p-[10px] ${index !== 0 ? "mt-[10px]" : ""}`,
|
|
771
|
+
children: [
|
|
772
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "p-[10px] w-[202px] h-[47px] subtitle-1", children: menu.title }),
|
|
773
|
+
menu?.subMenus.map((subMenu) => {
|
|
774
|
+
const isActive = pathname === subMenu.path || pathname.startsWith(subMenu.path + "/");
|
|
775
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
776
|
+
"div",
|
|
777
|
+
{
|
|
778
|
+
className: `group flex justify-center items-center gap-[10px] p-[10px] w-[202px] h-[47px] rounded-[6px] subtitle-2 cursor-pointer
|
|
779
|
+
${isActive ? "bg-primary-500 text-white" : "hover:bg-red-100 hover:text-white"}
|
|
780
|
+
active:bg-primary-500 active:text-white duration-100`,
|
|
781
|
+
onClick: () => onClick(subMenu.path),
|
|
782
|
+
children: [
|
|
783
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "flex justify-center items-center w-[24px] h-[24px] text-[20px]", children: isActive ? subMenu.iconActive ?? subMenu.icon : subMenu.icon }),
|
|
784
|
+
subMenu.title,
|
|
785
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "flex ml-auto", children: subMenu.customNode && subMenu.customNode })
|
|
786
|
+
]
|
|
787
|
+
},
|
|
788
|
+
`sub_${subMenu.title}`
|
|
789
|
+
);
|
|
790
|
+
})
|
|
791
|
+
]
|
|
792
|
+
},
|
|
793
|
+
`menu_${menu.title}`
|
|
794
|
+
)) });
|
|
780
795
|
}
|
|
781
796
|
|
|
782
797
|
// src/NavBar/MenuNavBar/Sidebar.tsx
|
|
783
798
|
var import_icons_react2 = require("@tabler/icons-react");
|
|
784
|
-
var
|
|
799
|
+
var import_react = require("react");
|
|
785
800
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
786
|
-
var SidebarContext = (0,
|
|
801
|
+
var SidebarContext = (0, import_react.createContext)({ expanded: false });
|
|
787
802
|
function Sidebar({ children, logo }) {
|
|
788
|
-
const [expanded, setExpanded] = (0,
|
|
803
|
+
const [expanded, setExpanded] = (0, import_react.useState)(true);
|
|
789
804
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("aside", { className: "h-screen", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("nav", { className: `h-full flex flex-col bg-white border-r shadow-sm duration-150 ${expanded ? "w-64" : "w-16"}`, children: [
|
|
790
805
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "p-4 pb-2 flex justify-center items-center", children: [
|
|
791
806
|
expanded && logo && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("img", { src: logo, width: 120, className: "ml-auto" }),
|
|
@@ -821,15 +836,15 @@ function TopNavBar({ onClickNoti, logo }) {
|
|
|
821
836
|
|
|
822
837
|
// src/Table/DataTable/DataTable.tsx
|
|
823
838
|
var import_icons_react5 = require("@tabler/icons-react");
|
|
824
|
-
var
|
|
839
|
+
var import_react3 = require("react");
|
|
825
840
|
|
|
826
841
|
// src/Table/Pagination/Pagination.tsx
|
|
827
842
|
var import_icons_react4 = require("@tabler/icons-react");
|
|
828
|
-
var
|
|
843
|
+
var import_react2 = require("react");
|
|
829
844
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
830
845
|
function Pagination({ totalItems, itemsPerPage, currentPage, onPageChange }) {
|
|
831
846
|
const totalPages = Math.ceil(totalItems / itemsPerPage);
|
|
832
|
-
const getPages = (0,
|
|
847
|
+
const getPages = (0, import_react2.useMemo)(() => {
|
|
833
848
|
if (totalPages <= 7) {
|
|
834
849
|
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
835
850
|
}
|
|
@@ -895,8 +910,8 @@ var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
|
895
910
|
function DataTable({ columns, data, onSort, isLoading }) {
|
|
896
911
|
const cols = Math.max(1, columns.length);
|
|
897
912
|
const gridClass = "grid [grid-template-columns:repeat(var(--cols),minmax(0,1fr))]";
|
|
898
|
-
const [sortConfig, setSortConfig] = (0,
|
|
899
|
-
const [page, setPage] = (0,
|
|
913
|
+
const [sortConfig, setSortConfig] = (0, import_react3.useState)(null);
|
|
914
|
+
const [page, setPage] = (0, import_react3.useState)(1);
|
|
900
915
|
const onSorting = (config) => {
|
|
901
916
|
if (config) {
|
|
902
917
|
setSortConfig({ key: config?.key, direction: config?.direction });
|
|
@@ -952,7 +967,7 @@ function DataTable({ columns, data, onSort, isLoading }) {
|
|
|
952
967
|
|
|
953
968
|
// src/Table/DataTable/AntDataTable.tsx
|
|
954
969
|
var import_antd4 = require("antd");
|
|
955
|
-
var
|
|
970
|
+
var import_react4 = require("react");
|
|
956
971
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
957
972
|
function AntDataTable({
|
|
958
973
|
dataSource,
|
|
@@ -967,7 +982,7 @@ function AntDataTable({
|
|
|
967
982
|
height,
|
|
968
983
|
pagination
|
|
969
984
|
}) {
|
|
970
|
-
const [selectedRowKeys, setSelectedRowKeys] = (0,
|
|
985
|
+
const [selectedRowKeys, setSelectedRowKeys] = (0, import_react4.useState)([]);
|
|
971
986
|
const rowSelection = {
|
|
972
987
|
selectedRowKeys,
|
|
973
988
|
onChange: (newSelectedRowKeys) => {
|
|
@@ -1006,8 +1021,8 @@ function AntDataTable({
|
|
|
1006
1021
|
}
|
|
1007
1022
|
|
|
1008
1023
|
// src/Calendar/Calendar/Calendar.tsx
|
|
1009
|
-
var
|
|
1010
|
-
var
|
|
1024
|
+
var import_react5 = require("react");
|
|
1025
|
+
var import_react6 = __toESM(require("@fullcalendar/react"));
|
|
1011
1026
|
var import_daygrid = __toESM(require("@fullcalendar/daygrid"));
|
|
1012
1027
|
var import_timegrid = __toESM(require("@fullcalendar/timegrid"));
|
|
1013
1028
|
var import_interaction = __toESM(require("@fullcalendar/interaction"));
|
|
@@ -1015,10 +1030,10 @@ var import_th = __toESM(require("@fullcalendar/core/locales/th"));
|
|
|
1015
1030
|
var import_icons_react6 = require("@tabler/icons-react");
|
|
1016
1031
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1017
1032
|
function Calendar({ events }) {
|
|
1018
|
-
const calendarRef = (0,
|
|
1019
|
-
const [monthTitle, setMonthTitle] = (0,
|
|
1020
|
-
const [openPopup, setOpenPopup] = (0,
|
|
1021
|
-
const [selectedEvent, setSelectedEvent] = (0,
|
|
1033
|
+
const calendarRef = (0, import_react5.useRef)(null);
|
|
1034
|
+
const [monthTitle, setMonthTitle] = (0, import_react5.useState)("");
|
|
1035
|
+
const [openPopup, setOpenPopup] = (0, import_react5.useState)(false);
|
|
1036
|
+
const [selectedEvent, setSelectedEvent] = (0, import_react5.useState)(null);
|
|
1022
1037
|
const updateTitle = () => {
|
|
1023
1038
|
const calendarApi = calendarRef.current?.getApi();
|
|
1024
1039
|
if (calendarApi) {
|
|
@@ -1029,7 +1044,7 @@ function Calendar({ events }) {
|
|
|
1029
1044
|
const calendarApi = calendarRef.current?.getApi();
|
|
1030
1045
|
calendarApi?.changeView(viewName);
|
|
1031
1046
|
};
|
|
1032
|
-
(0,
|
|
1047
|
+
(0, import_react5.useEffect)(() => {
|
|
1033
1048
|
updateTitle();
|
|
1034
1049
|
}, []);
|
|
1035
1050
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "fc w-full h-full relative z-10", children: [
|
|
@@ -1105,7 +1120,7 @@ function Calendar({ events }) {
|
|
|
1105
1120
|
] })
|
|
1106
1121
|
] }),
|
|
1107
1122
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "relative z-10", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1108
|
-
|
|
1123
|
+
import_react6.default,
|
|
1109
1124
|
{
|
|
1110
1125
|
ref: calendarRef,
|
|
1111
1126
|
plugins: [import_daygrid.default, import_timegrid.default, import_interaction.default],
|
|
@@ -1161,7 +1176,7 @@ function EventPopUp({ event, onClose }) {
|
|
|
1161
1176
|
|
|
1162
1177
|
// src/Input/TextInput/TextInput.tsx
|
|
1163
1178
|
var import_icons_react7 = require("@tabler/icons-react");
|
|
1164
|
-
var
|
|
1179
|
+
var import_react7 = require("react");
|
|
1165
1180
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1166
1181
|
function TextInput({
|
|
1167
1182
|
label,
|
|
@@ -1174,7 +1189,7 @@ function TextInput({
|
|
|
1174
1189
|
onChange,
|
|
1175
1190
|
disabled
|
|
1176
1191
|
}) {
|
|
1177
|
-
const [showPassword, setShowPassword] = (0,
|
|
1192
|
+
const [showPassword, setShowPassword] = (0, import_react7.useState)(false);
|
|
1178
1193
|
const onShowPassword = () => {
|
|
1179
1194
|
setShowPassword(!showPassword);
|
|
1180
1195
|
};
|
|
@@ -1359,9 +1374,13 @@ function InputFieldNumber({
|
|
|
1359
1374
|
};
|
|
1360
1375
|
const defaultParser = (v) => {
|
|
1361
1376
|
if (!v) return "";
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1377
|
+
if (!decimal) {
|
|
1378
|
+
return v.replace(/[^\d]/g, "");
|
|
1379
|
+
}
|
|
1380
|
+
const cleaned = v.replace(/[^\d.]/g, "");
|
|
1381
|
+
const firstDot = cleaned.indexOf(".");
|
|
1382
|
+
if (firstDot === -1) return cleaned;
|
|
1383
|
+
return cleaned.slice(0, firstDot + 1) + cleaned.slice(firstDot + 1).replace(/\./g, "");
|
|
1365
1384
|
};
|
|
1366
1385
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1367
1386
|
import_antd7.ConfigProvider,
|
|
@@ -1395,7 +1414,36 @@ function InputFieldNumber({
|
|
|
1395
1414
|
changeOnWheel,
|
|
1396
1415
|
formatter: formatter ?? defaultFormatter,
|
|
1397
1416
|
parser: parser ?? defaultParser,
|
|
1398
|
-
precision: decimal ? safeScale : 0
|
|
1417
|
+
precision: decimal ? safeScale : 0,
|
|
1418
|
+
inputMode: decimal ? "decimal" : "numeric",
|
|
1419
|
+
onKeyDown: (e) => {
|
|
1420
|
+
const allowed = [
|
|
1421
|
+
"Backspace",
|
|
1422
|
+
"Delete",
|
|
1423
|
+
"ArrowLeft",
|
|
1424
|
+
"ArrowRight",
|
|
1425
|
+
"Tab",
|
|
1426
|
+
"Enter",
|
|
1427
|
+
"Home",
|
|
1428
|
+
"End"
|
|
1429
|
+
];
|
|
1430
|
+
if (allowed.includes(e.key)) return;
|
|
1431
|
+
if (e.ctrlKey || e.metaKey) return;
|
|
1432
|
+
if (!decimal) {
|
|
1433
|
+
if (!/^\d$/.test(e.key)) e.preventDefault();
|
|
1434
|
+
} else {
|
|
1435
|
+
if (!/^\d$/.test(e.key) && e.key !== ".") e.preventDefault();
|
|
1436
|
+
if (e.key === ".") {
|
|
1437
|
+
const current = String(value ?? "");
|
|
1438
|
+
if (current.includes(".")) e.preventDefault();
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
},
|
|
1442
|
+
onPaste: (e) => {
|
|
1443
|
+
const text = e.clipboardData.getData("text");
|
|
1444
|
+
const cleaned = !decimal ? text.replace(/[^\d]/g, "") : text.replace(/[^\d.]/g, "").replace(/(\..*)\./g, "$1");
|
|
1445
|
+
if (cleaned !== text) e.preventDefault();
|
|
1446
|
+
}
|
|
1399
1447
|
}
|
|
1400
1448
|
),
|
|
1401
1449
|
error && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
@@ -1405,7 +1453,7 @@ function InputFieldNumber({
|
|
|
1405
1453
|
}
|
|
1406
1454
|
|
|
1407
1455
|
// src/DatePicker/DatePickerBasic/DatePickerBasic.tsx
|
|
1408
|
-
var
|
|
1456
|
+
var import_react8 = require("react");
|
|
1409
1457
|
var import_dayjs = __toESM(require_dayjs_min());
|
|
1410
1458
|
var import_th2 = __toESM(require_th());
|
|
1411
1459
|
var import_buddhistEra = __toESM(require_buddhistEra());
|
|
@@ -1427,8 +1475,8 @@ function DatePickerBasic({
|
|
|
1427
1475
|
disabledDate,
|
|
1428
1476
|
disablePast = false
|
|
1429
1477
|
}) {
|
|
1430
|
-
const [open, setOpen] = (0,
|
|
1431
|
-
const wrapperRef = (0,
|
|
1478
|
+
const [open, setOpen] = (0, import_react8.useState)(false);
|
|
1479
|
+
const wrapperRef = (0, import_react8.useRef)(null);
|
|
1432
1480
|
const current = value ? (0, import_dayjs.default)(value) : null;
|
|
1433
1481
|
const today = (0, import_dayjs.default)();
|
|
1434
1482
|
const formatThaiBE = (date) => {
|
|
@@ -1450,7 +1498,7 @@ function DatePickerBasic({
|
|
|
1450
1498
|
"\u0E1E\u0E24\u0E28\u0E08\u0E34\u0E01\u0E32\u0E22\u0E19",
|
|
1451
1499
|
"\u0E18\u0E31\u0E19\u0E27\u0E32\u0E04\u0E21"
|
|
1452
1500
|
];
|
|
1453
|
-
const [calendar, setCalendar] = (0,
|
|
1501
|
+
const [calendar, setCalendar] = (0, import_react8.useState)(current || today);
|
|
1454
1502
|
const daysInMonth = calendar.daysInMonth();
|
|
1455
1503
|
const firstDayOfMonth = calendar.startOf("month").day();
|
|
1456
1504
|
const isDisabled = (date) => {
|
|
@@ -1466,7 +1514,7 @@ function DatePickerBasic({
|
|
|
1466
1514
|
onChange(selected.toDate());
|
|
1467
1515
|
setOpen(false);
|
|
1468
1516
|
};
|
|
1469
|
-
(0,
|
|
1517
|
+
(0, import_react8.useEffect)(() => {
|
|
1470
1518
|
const handleClickOutside = (e) => {
|
|
1471
1519
|
if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {
|
|
1472
1520
|
setOpen(false);
|
|
@@ -1553,7 +1601,7 @@ function DatePickerBasic({
|
|
|
1553
1601
|
}
|
|
1554
1602
|
|
|
1555
1603
|
// src/DatePicker/DatePickerRange/DatePickerRange.tsx
|
|
1556
|
-
var
|
|
1604
|
+
var import_react9 = require("react");
|
|
1557
1605
|
var import_dayjs2 = __toESM(require_dayjs_min());
|
|
1558
1606
|
var import_th3 = __toESM(require_th());
|
|
1559
1607
|
var import_buddhistEra2 = __toESM(require_buddhistEra());
|
|
@@ -1574,13 +1622,13 @@ function DatePickerRange({
|
|
|
1574
1622
|
disabledDate,
|
|
1575
1623
|
disablePast = false
|
|
1576
1624
|
}) {
|
|
1577
|
-
const [open, setOpen] = (0,
|
|
1578
|
-
const wrapperRef = (0,
|
|
1625
|
+
const [open, setOpen] = (0, import_react9.useState)(false);
|
|
1626
|
+
const wrapperRef = (0, import_react9.useRef)(null);
|
|
1579
1627
|
const [startDate, endDate] = value;
|
|
1580
1628
|
const startDayjs = startDate ? (0, import_dayjs2.default)(startDate) : null;
|
|
1581
1629
|
const endDayjs = endDate ? (0, import_dayjs2.default)(endDate) : null;
|
|
1582
1630
|
const today = (0, import_dayjs2.default)();
|
|
1583
|
-
const [calendar, setCalendar] = (0,
|
|
1631
|
+
const [calendar, setCalendar] = (0, import_react9.useState)(startDayjs || today);
|
|
1584
1632
|
const formatThaiBE = (date) => {
|
|
1585
1633
|
const formatted = (0, import_date_fns2.format)(date, "dd MMM yy", { locale: import_locale2.th });
|
|
1586
1634
|
const year = parseInt((0, import_date_fns2.format)(date, "yyyy")) + 543;
|
|
@@ -1624,7 +1672,7 @@ function DatePickerRange({
|
|
|
1624
1672
|
}
|
|
1625
1673
|
}
|
|
1626
1674
|
};
|
|
1627
|
-
(0,
|
|
1675
|
+
(0, import_react9.useEffect)(() => {
|
|
1628
1676
|
const handleClickOutside = (e) => {
|
|
1629
1677
|
if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {
|
|
1630
1678
|
setOpen(false);
|
|
@@ -2847,7 +2895,7 @@ function SelectFieldStatusReport({
|
|
|
2847
2895
|
|
|
2848
2896
|
// src/Select/SelectFieldTag/SelectFieldTag.tsx
|
|
2849
2897
|
var import_antd14 = require("antd");
|
|
2850
|
-
var
|
|
2898
|
+
var import_react10 = require("react");
|
|
2851
2899
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2852
2900
|
function SelectFieldTag({
|
|
2853
2901
|
label,
|
|
@@ -2862,10 +2910,10 @@ function SelectFieldTag({
|
|
|
2862
2910
|
size = "middle",
|
|
2863
2911
|
allowClear = true
|
|
2864
2912
|
}) {
|
|
2865
|
-
const [internalValue, setInternalValue] = (0,
|
|
2913
|
+
const [internalValue, setInternalValue] = (0, import_react10.useState)([]);
|
|
2866
2914
|
const isControlled = controlledValue !== void 0;
|
|
2867
2915
|
const value = isControlled ? controlledValue : internalValue;
|
|
2868
|
-
const [searchWord, setSearchWord] = (0,
|
|
2916
|
+
const [searchWord, setSearchWord] = (0, import_react10.useState)("");
|
|
2869
2917
|
const handleChange = (val) => {
|
|
2870
2918
|
const trimValue = val.map((v) => v.trim());
|
|
2871
2919
|
const filtered = trimValue.filter((v) => v.trim() !== "");
|
|
@@ -2926,7 +2974,7 @@ function SelectFieldTag({
|
|
|
2926
2974
|
// src/Select/SelectCustom/SelectCustom.tsx
|
|
2927
2975
|
var import_icons_react8 = require("@tabler/icons-react");
|
|
2928
2976
|
var import_antd15 = require("antd");
|
|
2929
|
-
var
|
|
2977
|
+
var import_react11 = require("react");
|
|
2930
2978
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2931
2979
|
function SelectCustom({
|
|
2932
2980
|
label = "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E42\u0E04\u0E23\u0E07\u0E01\u0E32\u0E23",
|
|
@@ -2939,8 +2987,8 @@ function SelectCustom({
|
|
|
2939
2987
|
size = "middle",
|
|
2940
2988
|
allowClear = true
|
|
2941
2989
|
}) {
|
|
2942
|
-
const [value, setValue] = (0,
|
|
2943
|
-
const [valueList, setValueList] = (0,
|
|
2990
|
+
const [value, setValue] = (0, import_react11.useState)([]);
|
|
2991
|
+
const [valueList, setValueList] = (0, import_react11.useState)([]);
|
|
2944
2992
|
const handleChange = (selectedValues) => {
|
|
2945
2993
|
const newValues = selectedValues.filter((v) => !valueList.includes(v));
|
|
2946
2994
|
setValueList((prev) => {
|
|
@@ -3047,7 +3095,7 @@ var quarters = [
|
|
|
3047
3095
|
];
|
|
3048
3096
|
|
|
3049
3097
|
// src/SortFilter/SortFilter.tsx
|
|
3050
|
-
var
|
|
3098
|
+
var import_react12 = require("react");
|
|
3051
3099
|
var import_icons_react9 = require("@tabler/icons-react");
|
|
3052
3100
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
3053
3101
|
function SortFilter({
|
|
@@ -3057,9 +3105,9 @@ function SortFilter({
|
|
|
3057
3105
|
onSortClick,
|
|
3058
3106
|
onFilterClick
|
|
3059
3107
|
}) {
|
|
3060
|
-
const [yearValue, setYearValue] = (0,
|
|
3061
|
-
const [monthValue, setMonthValue] = (0,
|
|
3062
|
-
const [quarterValue, setQuartersValue] = (0,
|
|
3108
|
+
const [yearValue, setYearValue] = (0, import_react12.useState)();
|
|
3109
|
+
const [monthValue, setMonthValue] = (0, import_react12.useState)();
|
|
3110
|
+
const [quarterValue, setQuartersValue] = (0, import_react12.useState)();
|
|
3063
3111
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3064
3112
|
import_antd16.ConfigProvider,
|
|
3065
3113
|
{
|
|
@@ -3135,7 +3183,7 @@ function SortFilter({
|
|
|
3135
3183
|
|
|
3136
3184
|
// src/Upload/FileUploader/FileUploader.tsx
|
|
3137
3185
|
var import_icons_react10 = require("@tabler/icons-react");
|
|
3138
|
-
var
|
|
3186
|
+
var import_react13 = require("react");
|
|
3139
3187
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3140
3188
|
function FileUploader({
|
|
3141
3189
|
onUpload,
|
|
@@ -3154,10 +3202,10 @@ function FileUploader({
|
|
|
3154
3202
|
attachWidth = "w-full",
|
|
3155
3203
|
readOnly = false
|
|
3156
3204
|
}) {
|
|
3157
|
-
const [internalFileList, setInternalFileList] = (0,
|
|
3158
|
-
const [uploading, setUploading] = (0,
|
|
3159
|
-
const [dragActive, setDragActive] = (0,
|
|
3160
|
-
const inputRef = (0,
|
|
3205
|
+
const [internalFileList, setInternalFileList] = (0, import_react13.useState)([]);
|
|
3206
|
+
const [uploading, setUploading] = (0, import_react13.useState)(false);
|
|
3207
|
+
const [dragActive, setDragActive] = (0, import_react13.useState)(false);
|
|
3208
|
+
const inputRef = (0, import_react13.useRef)(null);
|
|
3161
3209
|
const filesToDisplay = value || internalFileList;
|
|
3162
3210
|
const validateFile = (file) => {
|
|
3163
3211
|
if (accept && !accept.includes(file.type)) {
|
|
@@ -3397,7 +3445,7 @@ function HeadingPage({ Heading }) {
|
|
|
3397
3445
|
|
|
3398
3446
|
// src/Progress/ProgressBar.tsx
|
|
3399
3447
|
var import_antd20 = require("antd");
|
|
3400
|
-
var
|
|
3448
|
+
var import_react14 = require("react");
|
|
3401
3449
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3402
3450
|
function ProgressBar({
|
|
3403
3451
|
percent = 0,
|
|
@@ -3411,8 +3459,8 @@ function ProgressBar({
|
|
|
3411
3459
|
steps,
|
|
3412
3460
|
isCheckPoints
|
|
3413
3461
|
}) {
|
|
3414
|
-
const [barWidth, setBarWidth] = (0,
|
|
3415
|
-
const progressRef = (0,
|
|
3462
|
+
const [barWidth, setBarWidth] = (0, import_react14.useState)(0);
|
|
3463
|
+
const progressRef = (0, import_react14.useRef)(null);
|
|
3416
3464
|
let strokeColor = "--color-green-500";
|
|
3417
3465
|
const defaultStrokeWidth = type === "circle" ? 13 : strokeWidth ?? 8;
|
|
3418
3466
|
const defaultSize = type === "circle" ? 43 : size;
|
|
@@ -3420,7 +3468,7 @@ function ProgressBar({
|
|
|
3420
3468
|
const minCheckpoint = Math.min(...checkpoints);
|
|
3421
3469
|
strokeColor = percent >= minCheckpoint ? "var(--color-green-500)" : "var(--color-red-500)";
|
|
3422
3470
|
}
|
|
3423
|
-
(0,
|
|
3471
|
+
(0, import_react14.useEffect)(() => {
|
|
3424
3472
|
const inner = progressRef.current?.querySelector(".ant-progress-inner");
|
|
3425
3473
|
if (!inner) return;
|
|
3426
3474
|
const observer = new ResizeObserver(() => {
|
|
@@ -3477,24 +3525,24 @@ function ProgressBar({
|
|
|
3477
3525
|
|
|
3478
3526
|
// src/KpiSection/KpiSection.tsx
|
|
3479
3527
|
var import_antd21 = require("antd");
|
|
3480
|
-
var
|
|
3528
|
+
var import_react16 = require("react");
|
|
3481
3529
|
|
|
3482
3530
|
// src/KpiSection/hooks/useGetKpiSection.ts
|
|
3483
|
-
var
|
|
3531
|
+
var import_react15 = require("react");
|
|
3484
3532
|
var import_cuid = __toESM(require("cuid"));
|
|
3485
3533
|
function useGetKpiSection() {
|
|
3486
|
-
const [nameKpi, setNameKpi] = (0,
|
|
3487
|
-
const [kpiValue, setKpiValue] = (0,
|
|
3488
|
-
const [unitValue, setUnitValue] = (0,
|
|
3489
|
-
const [kpiList, setKpiList] = (0,
|
|
3490
|
-
const [editingBackup, setEditingBackup] = (0,
|
|
3491
|
-
const [selected, setSelected] = (0,
|
|
3492
|
-
const [errors, setErrors] = (0,
|
|
3534
|
+
const [nameKpi, setNameKpi] = (0, import_react15.useState)("");
|
|
3535
|
+
const [kpiValue, setKpiValue] = (0, import_react15.useState)("");
|
|
3536
|
+
const [unitValue, setUnitValue] = (0, import_react15.useState)("");
|
|
3537
|
+
const [kpiList, setKpiList] = (0, import_react15.useState)([]);
|
|
3538
|
+
const [editingBackup, setEditingBackup] = (0, import_react15.useState)({});
|
|
3539
|
+
const [selected, setSelected] = (0, import_react15.useState)("2");
|
|
3540
|
+
const [errors, setErrors] = (0, import_react15.useState)({
|
|
3493
3541
|
nameKpi: "",
|
|
3494
3542
|
kpiValue: "",
|
|
3495
3543
|
unitValue: ""
|
|
3496
3544
|
});
|
|
3497
|
-
const [itemErrors, setItemErrors] = (0,
|
|
3545
|
+
const [itemErrors, setItemErrors] = (0, import_react15.useState)({});
|
|
3498
3546
|
const options = [
|
|
3499
3547
|
{ value: "1", label: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21" },
|
|
3500
3548
|
{ value: "2", label: "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02" }
|
|
@@ -3648,11 +3696,11 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3648
3696
|
setItemErrors
|
|
3649
3697
|
} = useGetKpiSection();
|
|
3650
3698
|
const [messageApi2, messageContainer] = import_antd21.message.useMessage();
|
|
3651
|
-
const [hasShownError, setHasShownError] = (0,
|
|
3652
|
-
(0,
|
|
3699
|
+
const [hasShownError, setHasShownError] = (0, import_react16.useState)(false);
|
|
3700
|
+
(0, import_react16.useEffect)(() => {
|
|
3653
3701
|
setMessageApi(messageApi2);
|
|
3654
3702
|
}, [messageApi2]);
|
|
3655
|
-
(0,
|
|
3703
|
+
(0, import_react16.useEffect)(() => {
|
|
3656
3704
|
if (onChangeKpiList) {
|
|
3657
3705
|
onChangeKpiList(kpiList);
|
|
3658
3706
|
}
|
|
@@ -3890,7 +3938,7 @@ function AntDModal({ children, isOpen, width, onCancel }) {
|
|
|
3890
3938
|
|
|
3891
3939
|
// src/Indicator/Indicator/Indicator.tsx
|
|
3892
3940
|
var import_icons_react12 = require("@tabler/icons-react");
|
|
3893
|
-
var
|
|
3941
|
+
var import_react17 = require("react");
|
|
3894
3942
|
var import_antd23 = require("antd");
|
|
3895
3943
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3896
3944
|
function Indicator({
|
|
@@ -3904,24 +3952,24 @@ function Indicator({
|
|
|
3904
3952
|
canEdit,
|
|
3905
3953
|
onDeleteClick
|
|
3906
3954
|
}) {
|
|
3907
|
-
const [valueSwitch, setValueSwitch] = (0,
|
|
3908
|
-
const [cacheData, setCacheData] = (0,
|
|
3955
|
+
const [valueSwitch, setValueSwitch] = (0, import_react17.useState)("TEXT");
|
|
3956
|
+
const [cacheData, setCacheData] = (0, import_react17.useState)({
|
|
3909
3957
|
indicatorType: type,
|
|
3910
3958
|
inputType: valueSwitch,
|
|
3911
3959
|
textValue: "",
|
|
3912
3960
|
numberValue: 0,
|
|
3913
3961
|
unit: ""
|
|
3914
3962
|
});
|
|
3915
|
-
const [cacheEditData, setCacheEditData] = (0,
|
|
3963
|
+
const [cacheEditData, setCacheEditData] = (0, import_react17.useState)({
|
|
3916
3964
|
indicatorType: type,
|
|
3917
3965
|
inputType: valueSwitch,
|
|
3918
3966
|
textValue: "",
|
|
3919
3967
|
numberValue: 0,
|
|
3920
3968
|
unit: ""
|
|
3921
3969
|
});
|
|
3922
|
-
const [editIndex, setEditIndex] = (0,
|
|
3923
|
-
const [addError, setAddError] = (0,
|
|
3924
|
-
const [editError, setEditError] = (0,
|
|
3970
|
+
const [editIndex, setEditIndex] = (0, import_react17.useState)(null);
|
|
3971
|
+
const [addError, setAddError] = (0, import_react17.useState)({});
|
|
3972
|
+
const [editError, setEditError] = (0, import_react17.useState)({});
|
|
3925
3973
|
const handleAddIndicator = () => {
|
|
3926
3974
|
const nextErr = {};
|
|
3927
3975
|
const textValue = (cacheData.textValue ?? "").trim();
|
|
@@ -4166,11 +4214,11 @@ function Indicator({
|
|
|
4166
4214
|
|
|
4167
4215
|
// src/FilterPopUp/FilterPopUp.tsx
|
|
4168
4216
|
var import_icons_react13 = require("@tabler/icons-react");
|
|
4169
|
-
var
|
|
4217
|
+
var import_react18 = require("react");
|
|
4170
4218
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
4171
4219
|
var FilterPopUp = (filter) => {
|
|
4172
|
-
const [isAction, setIsAction] = (0,
|
|
4173
|
-
const [filterArray, setFilterArray] = (0,
|
|
4220
|
+
const [isAction, setIsAction] = (0, import_react18.useState)(true);
|
|
4221
|
+
const [filterArray, setFilterArray] = (0, import_react18.useState)([""]);
|
|
4174
4222
|
const handleClearFilter = () => {
|
|
4175
4223
|
setFilterArray([]);
|
|
4176
4224
|
};
|
|
@@ -4203,7 +4251,7 @@ var FilterPopUp = (filter) => {
|
|
|
4203
4251
|
};
|
|
4204
4252
|
|
|
4205
4253
|
// src/ProfileSelect/ProfileSelect/ProfileSelect.tsx
|
|
4206
|
-
var
|
|
4254
|
+
var import_react19 = require("react");
|
|
4207
4255
|
var import_icons_react14 = require("@tabler/icons-react");
|
|
4208
4256
|
var import_antd24 = require("antd");
|
|
4209
4257
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
@@ -4215,15 +4263,15 @@ function ProfileSelect({
|
|
|
4215
4263
|
onUpdateAssignUser,
|
|
4216
4264
|
placeholder
|
|
4217
4265
|
}) {
|
|
4218
|
-
const [maxVisible, setMaxVisible] = (0,
|
|
4219
|
-
const [userNotAssign, setUserNotAssign] = (0,
|
|
4220
|
-
const [search, setSearch] = (0,
|
|
4221
|
-
const [isShowSelect, setIsShowSelect] = (0,
|
|
4222
|
-
const containerRef = (0,
|
|
4223
|
-
const selectRef = (0,
|
|
4266
|
+
const [maxVisible, setMaxVisible] = (0, import_react19.useState)(4);
|
|
4267
|
+
const [userNotAssign, setUserNotAssign] = (0, import_react19.useState)([]);
|
|
4268
|
+
const [search, setSearch] = (0, import_react19.useState)("");
|
|
4269
|
+
const [isShowSelect, setIsShowSelect] = (0, import_react19.useState)(false);
|
|
4270
|
+
const containerRef = (0, import_react19.useRef)(null);
|
|
4271
|
+
const selectRef = (0, import_react19.useRef)(null);
|
|
4224
4272
|
const avatarSize = 30;
|
|
4225
4273
|
const spacing = 8;
|
|
4226
|
-
(0,
|
|
4274
|
+
(0, import_react19.useEffect)(() => {
|
|
4227
4275
|
const handler = (e) => {
|
|
4228
4276
|
if (!selectRef?.current?.contains(e.target) && !containerRef?.current?.contains(e.target)) {
|
|
4229
4277
|
setIsShowSelect(false);
|
|
@@ -4234,7 +4282,7 @@ function ProfileSelect({
|
|
|
4234
4282
|
document.removeEventListener("mousedown", handler);
|
|
4235
4283
|
};
|
|
4236
4284
|
}, []);
|
|
4237
|
-
(0,
|
|
4285
|
+
(0, import_react19.useEffect)(() => {
|
|
4238
4286
|
if (!containerRef.current) return;
|
|
4239
4287
|
const updateWidth = () => {
|
|
4240
4288
|
if (containerRef.current) {
|
|
@@ -4250,7 +4298,7 @@ function ProfileSelect({
|
|
|
4250
4298
|
resizeObserver.disconnect();
|
|
4251
4299
|
};
|
|
4252
4300
|
}, [allUser]);
|
|
4253
|
-
(0,
|
|
4301
|
+
(0, import_react19.useEffect)(() => {
|
|
4254
4302
|
setUserNotAssign(
|
|
4255
4303
|
allUser.filter((u) => !assignUser.some((au) => au.id === u.id))
|
|
4256
4304
|
);
|
|
@@ -4444,7 +4492,7 @@ function ProfileSelect({
|
|
|
4444
4492
|
}
|
|
4445
4493
|
|
|
4446
4494
|
// src/Button/QRCode/QRCode.tsx
|
|
4447
|
-
var
|
|
4495
|
+
var import_react20 = require("react");
|
|
4448
4496
|
var import_qrcode = __toESM(require("qrcode"));
|
|
4449
4497
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
4450
4498
|
var QRCodeGenerator = ({
|
|
@@ -4453,9 +4501,9 @@ var QRCodeGenerator = ({
|
|
|
4453
4501
|
defaultExportSize = 512,
|
|
4454
4502
|
fileBaseName = "qr-code"
|
|
4455
4503
|
}) => {
|
|
4456
|
-
const canvasRef = (0,
|
|
4457
|
-
const [format5, setFormat] = (0,
|
|
4458
|
-
const [exportSize, setExportSize] = (0,
|
|
4504
|
+
const canvasRef = (0, import_react20.useRef)(null);
|
|
4505
|
+
const [format5, setFormat] = (0, import_react20.useState)("png");
|
|
4506
|
+
const [exportSize, setExportSize] = (0, import_react20.useState)(defaultExportSize);
|
|
4459
4507
|
const sizeOption = [
|
|
4460
4508
|
{
|
|
4461
4509
|
label: "64 x 64",
|
|
@@ -4500,7 +4548,7 @@ var QRCodeGenerator = ({
|
|
|
4500
4548
|
value: "jpeg"
|
|
4501
4549
|
}
|
|
4502
4550
|
];
|
|
4503
|
-
(0,
|
|
4551
|
+
(0, import_react20.useEffect)(() => {
|
|
4504
4552
|
if (!canvasRef.current) return;
|
|
4505
4553
|
import_qrcode.default.toCanvas(canvasRef.current, url, { width: previewSize, margin: 1 }, (error) => {
|
|
4506
4554
|
if (error) console.error(error);
|
|
@@ -4621,7 +4669,7 @@ function TabProject({ tabOption, now, onChange }) {
|
|
|
4621
4669
|
}
|
|
4622
4670
|
|
|
4623
4671
|
// src/Chart/BarChart/BarChart.tsx
|
|
4624
|
-
var
|
|
4672
|
+
var import_react21 = require("react");
|
|
4625
4673
|
var d3 = __toESM(require("d3"));
|
|
4626
4674
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
4627
4675
|
var defaultMargin = { top: 30, right: 200, bottom: 36, left: 50 };
|
|
@@ -4643,15 +4691,16 @@ var BarChart = ({
|
|
|
4643
4691
|
margin = defaultMargin,
|
|
4644
4692
|
yLabel,
|
|
4645
4693
|
xLabel,
|
|
4694
|
+
modeLabel,
|
|
4646
4695
|
colorPalette = defaultColorPalette
|
|
4647
4696
|
}) => {
|
|
4648
|
-
const svgRef = (0,
|
|
4649
|
-
const gRef = (0,
|
|
4650
|
-
const xAxisRef = (0,
|
|
4651
|
-
const yAxisRef = (0,
|
|
4652
|
-
const containerRef = (0,
|
|
4653
|
-
const widthRef = (0,
|
|
4654
|
-
(0,
|
|
4697
|
+
const svgRef = (0, import_react21.useRef)(null);
|
|
4698
|
+
const gRef = (0, import_react21.useRef)(null);
|
|
4699
|
+
const xAxisRef = (0, import_react21.useRef)(null);
|
|
4700
|
+
const yAxisRef = (0, import_react21.useRef)(null);
|
|
4701
|
+
const containerRef = (0, import_react21.useRef)(null);
|
|
4702
|
+
const widthRef = (0, import_react21.useRef)(0);
|
|
4703
|
+
(0, import_react21.useEffect)(() => {
|
|
4655
4704
|
if (!containerRef.current) return;
|
|
4656
4705
|
const ro = new ResizeObserver((entries) => {
|
|
4657
4706
|
const cr = entries[0].contentRect;
|
|
@@ -4661,8 +4710,8 @@ var BarChart = ({
|
|
|
4661
4710
|
ro.observe(containerRef.current);
|
|
4662
4711
|
return () => ro.disconnect();
|
|
4663
4712
|
}, []);
|
|
4664
|
-
const xDomain = (0,
|
|
4665
|
-
const yDomain = (0,
|
|
4713
|
+
const xDomain = (0, import_react21.useMemo)(() => data.map((d) => d.x), [data]);
|
|
4714
|
+
const yDomain = (0, import_react21.useMemo)(() => {
|
|
4666
4715
|
const maxY = d3.max(data, (d) => d.y);
|
|
4667
4716
|
return [0, (maxY !== void 0 ? maxY : 0) + (maxY !== void 0 ? maxY : 0) * 0.1];
|
|
4668
4717
|
}, [data]);
|
|
@@ -4689,6 +4738,14 @@ var BarChart = ({
|
|
|
4689
4738
|
);
|
|
4690
4739
|
svg.select(".grid").lower();
|
|
4691
4740
|
xAxisG.attr("transform", `translate(${margin.left},${height - margin.bottom})`).call(xAxis).selectAll("text").style("text-anchor", "middle").attr("dy", "1.5em").attr("fill", "currentColor").style("font-size", "14px").style("font-family", "Arial, sans-serif");
|
|
4741
|
+
const labels = xAxisG.selectAll("text").attr("fill", "currentColor").style("font-size", "14px").style("font-family", "Arial, sans-serif");
|
|
4742
|
+
if (modeLabel === "45") {
|
|
4743
|
+
labels.attr("transform", "rotate(-45)").style("overflow", "visible").style("text-anchor", "end").attr("dx", "-0.8em").attr("dy", "0.15em");
|
|
4744
|
+
} else if (modeLabel === "line") {
|
|
4745
|
+
labels.attr("transform", "rotate(0)").style("text-anchor", "middle").attr("dx", "0").attr("dy", "1.5em");
|
|
4746
|
+
} else {
|
|
4747
|
+
labels.style("text-anchor", "middle").attr("dy", "1.5em");
|
|
4748
|
+
}
|
|
4692
4749
|
yAxisG.selectAll(".y-axis-label").data(yLabel ? [yLabel] : []).join(
|
|
4693
4750
|
(enter) => enter.append("text").attr("class", "y-axis-label").attr("fill", "currentColor").attr("x", -margin.left + 8).attr("y", -margin.top + 20).attr("text-anchor", "start").style("font-size", "14px").style("font-family", "Arial").text((d) => d),
|
|
4694
4751
|
(update) => update.text((d) => d)
|
|
@@ -4728,14 +4785,14 @@ var BarChart = ({
|
|
|
4728
4785
|
(exit) => exit.transition(t).attr("y", margin.top + y(0)).attr("height", innerH - y(0)).remove()
|
|
4729
4786
|
);
|
|
4730
4787
|
g.selectAll("text.bar-label").data(data).join(
|
|
4731
|
-
(enter) => enter.append("text").attr("class", "bar-label").attr("x", (d) => (x(d.x) ?? 0) + x.bandwidth() / 2).attr("y", (d) => y(d.y) - 6).attr("text-anchor", "middle").style("font-size", "50px").style("font-weight", "bold").style("font-family", "Arial, sans-serif").style("fill", (d, i) => colorPalette[i % colorPalette.length]).text((d) => d.y),
|
|
4788
|
+
(enter) => enter.append("text").attr("class", "bar-label").attr("x", (d) => (x(d.x) ?? 0) + x.bandwidth() / 2).attr("y", (d) => y(d.y) - 6).attr("text-anchor", "middle").style("font-size", "50px").style("font-weight", "bold").style("font-family", "Arial, sans-serif").style("fill", (d, i) => colorPalette[i % colorPalette.length]).style("overflow", "visible").text((d) => d.y),
|
|
4732
4789
|
(update) => update.transition(t).attr("x", (d) => (x(d.x) ?? 0) + x.bandwidth() / 2).attr("y", (d) => y(d.y) - 6).text((d) => d.y),
|
|
4733
4790
|
(exit) => exit.remove()
|
|
4734
4791
|
);
|
|
4735
4792
|
};
|
|
4736
|
-
(0,
|
|
4793
|
+
(0, import_react21.useEffect)(() => {
|
|
4737
4794
|
render();
|
|
4738
|
-
}, [data, height, margin, xDomain.toString(), yDomain.toString()]);
|
|
4795
|
+
}, [data, height, margin, modeLabel, xDomain.toString(), yDomain.toString()]);
|
|
4739
4796
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { ref: containerRef, style: { width: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("svg", { ref: svgRef, role: "img", "aria-label": "Bar chart", style: { display: "block", width: "100%", height }, children: [
|
|
4740
4797
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("g", { ref: gRef, transform: `translate(${margin.left},${margin.top})` }),
|
|
4741
4798
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("g", { ref: xAxisRef }),
|
|
@@ -4744,7 +4801,7 @@ var BarChart = ({
|
|
|
4744
4801
|
};
|
|
4745
4802
|
|
|
4746
4803
|
// src/Chart/PieChart/PieChart.tsx
|
|
4747
|
-
var
|
|
4804
|
+
var import_react22 = __toESM(require("react"));
|
|
4748
4805
|
var d32 = __toESM(require("d3"));
|
|
4749
4806
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
4750
4807
|
var defaultColors = d32.schemeCategory10;
|
|
@@ -4756,9 +4813,9 @@ var PieChart = ({
|
|
|
4756
4813
|
height,
|
|
4757
4814
|
colorPalette = defaultColors
|
|
4758
4815
|
}) => {
|
|
4759
|
-
const svgRef = (0,
|
|
4760
|
-
const [dataSide, setDataSide] =
|
|
4761
|
-
(0,
|
|
4816
|
+
const svgRef = (0, import_react22.useRef)(null);
|
|
4817
|
+
const [dataSide, setDataSide] = import_react22.default.useState([]);
|
|
4818
|
+
(0, import_react22.useEffect)(() => {
|
|
4762
4819
|
if (!svgRef.current) return;
|
|
4763
4820
|
d32.select(svgRef.current).selectAll("*").remove();
|
|
4764
4821
|
const radius = Math.min(width, height) / 2;
|
|
@@ -4795,7 +4852,7 @@ var PieChart = ({
|
|
|
4795
4852
|
};
|
|
4796
4853
|
|
|
4797
4854
|
// src/GanttChart/GanttChart.tsx
|
|
4798
|
-
var
|
|
4855
|
+
var import_react23 = require("react");
|
|
4799
4856
|
var d33 = __toESM(require("d3"));
|
|
4800
4857
|
var import_date_fns3 = require("date-fns");
|
|
4801
4858
|
var import_locale3 = require("date-fns/locale");
|
|
@@ -4955,10 +5012,10 @@ var GanttChart = ({
|
|
|
4955
5012
|
width,
|
|
4956
5013
|
mode
|
|
4957
5014
|
}) => {
|
|
4958
|
-
const svgRef = (0,
|
|
4959
|
-
const leftPanelRef = (0,
|
|
4960
|
-
const dataContainerRef = (0,
|
|
4961
|
-
const [viewMode] = (0,
|
|
5015
|
+
const svgRef = (0, import_react23.useRef)(null);
|
|
5016
|
+
const leftPanelRef = (0, import_react23.useRef)(null);
|
|
5017
|
+
const dataContainerRef = (0, import_react23.useRef)(null);
|
|
5018
|
+
const [viewMode] = (0, import_react23.useState)("year");
|
|
4962
5019
|
const {
|
|
4963
5020
|
barHeight,
|
|
4964
5021
|
barSpacing,
|
|
@@ -4966,7 +5023,7 @@ var GanttChart = ({
|
|
|
4966
5023
|
headersGroupLayer2Height
|
|
4967
5024
|
} = LAYOUT;
|
|
4968
5025
|
const totalHeaderHeight = headersGroupLayer1Height + headersGroupLayer2Height;
|
|
4969
|
-
(0,
|
|
5026
|
+
(0, import_react23.useEffect)(() => {
|
|
4970
5027
|
if (!data || !svgRef.current) return;
|
|
4971
5028
|
const margin = { top: 0, right: 20, bottom: 20, left: 20 };
|
|
4972
5029
|
const chartHeight = data.length * (barHeight + barSpacing) + margin.top + margin.bottom;
|
|
@@ -5254,7 +5311,7 @@ var GanttChart = ({
|
|
|
5254
5311
|
|
|
5255
5312
|
// src/CardKPI/CardKPI/CardKPI.tsx
|
|
5256
5313
|
var import_icons_react16 = require("@tabler/icons-react");
|
|
5257
|
-
var
|
|
5314
|
+
var import_react24 = require("react");
|
|
5258
5315
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
5259
5316
|
function KPIRow({ item }) {
|
|
5260
5317
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
@@ -5276,7 +5333,7 @@ function CardKPI({
|
|
|
5276
5333
|
indicator,
|
|
5277
5334
|
projectId
|
|
5278
5335
|
}) {
|
|
5279
|
-
const [isOpen, setIsOpen] = (0,
|
|
5336
|
+
const [isOpen, setIsOpen] = (0, import_react24.useState)(false);
|
|
5280
5337
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
5281
5338
|
"div",
|
|
5282
5339
|
{
|