@esic-lab/data-core-ui 0.0.67 → 0.0.69

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.mjs CHANGED
@@ -359,7 +359,8 @@ function PrimaryButton({
359
359
  colorPrimaryHover = "#8895f9",
360
360
  textColor = "#ffffff",
361
361
  icon,
362
- className
362
+ className,
363
+ htmlType
363
364
  }) {
364
365
  const textClass = size === "large" ? "body-1" : "body-3";
365
366
  return /* @__PURE__ */ jsx(
@@ -382,6 +383,7 @@ function PrimaryButton({
382
383
  disabled,
383
384
  icon,
384
385
  iconPosition: iconPlacement,
386
+ htmlType,
385
387
  children: title
386
388
  }
387
389
  )
@@ -403,7 +405,8 @@ function SecondaryButton({
403
405
  defaultHoverColor = "#7181f8",
404
406
  textColor = "rgba(0,0,0,0.88)",
405
407
  icon,
406
- className
408
+ className,
409
+ htmlType
407
410
  }) {
408
411
  const textClass = size === "large" ? "body-1" : "body-3";
409
412
  return /* @__PURE__ */ jsx2(
@@ -431,6 +434,7 @@ function SecondaryButton({
431
434
  disabled,
432
435
  icon,
433
436
  iconPosition: iconPlacement,
437
+ htmlType,
434
438
  children: title
435
439
  }
436
440
  )
@@ -486,7 +490,8 @@ function TertiaryButton({
486
490
  colorPrimaryHover = "#4d5461",
487
491
  textColor = "white",
488
492
  icon,
489
- className
493
+ className,
494
+ htmlType
490
495
  }) {
491
496
  const textClass = size === "large" ? "body-1" : "body-3";
492
497
  return /* @__PURE__ */ jsx5(
@@ -509,6 +514,7 @@ function TertiaryButton({
509
514
  disabled,
510
515
  icon,
511
516
  iconPosition: iconPlacement,
517
+ htmlType,
512
518
  children: title
513
519
  }
514
520
  )
@@ -687,39 +693,48 @@ function SwitchSelect({
687
693
  }
688
694
 
689
695
  // src/NavBar/MenuNavBar/MenuNavBar.tsx
690
- import { useState } from "react";
696
+ import { useLocation } from "react-router";
691
697
  import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
692
698
  function MenuNavBar({ menus, onClick }) {
693
- const [activePath, setActivePath] = useState("");
694
- return /* @__PURE__ */ jsx13("div", { className: "w-full h-full p-[10px] bg-white", children: menus?.map((menu, index) => /* @__PURE__ */ jsxs7("div", { className: `p-[10px] ${index !== 0 ? "mt-[10px]" : ""}`, children: [
695
- /* @__PURE__ */ jsx13("p", { className: "p-[10px] w-[202px] h-[47px] subtitle-1", children: menu.title }),
696
- menu?.subMenus.map((subMenu) => /* @__PURE__ */ jsxs7(
697
- "div",
698
- {
699
- className: `group flex justify-center items-center gap-[10px] p-[10px] w-[202px] h-[47px] rounded-[6px] subtitle-2 cursor-pointer
700
- ${activePath === subMenu.path ? "bg-primary-500 text-white" : "hover:bg-red-100 hover:text-white"} hover:bg-red-100 active:bg-primary-500 hover:text-white active:text-white duration-100`,
701
- onClick: () => {
702
- onClick(subMenu.path);
703
- setActivePath(subMenu.path);
704
- },
705
- children: [
706
- /* @__PURE__ */ jsx13("span", { className: "flex justify-center items-center w-[24px] h-[24px] text-[20px]", children: activePath === subMenu.path ? subMenu.iconActive ?? subMenu.icon : subMenu.icon }),
707
- subMenu.title,
708
- /* @__PURE__ */ jsx13("span", { className: "flex ml-auto", children: subMenu.customNode && subMenu.customNode })
709
- ]
710
- },
711
- `sub_${subMenu.title}`
712
- ))
713
- ] }, `menu_${menu.title}`)) });
699
+ const location = useLocation();
700
+ const pathname = location.pathname;
701
+ return /* @__PURE__ */ jsx13("div", { className: "w-full h-full p-[10px] bg-white", children: menus?.map((menu, index) => /* @__PURE__ */ jsxs7(
702
+ "div",
703
+ {
704
+ className: `p-[10px] ${index !== 0 ? "mt-[10px]" : ""}`,
705
+ children: [
706
+ /* @__PURE__ */ jsx13("p", { className: "p-[10px] w-[202px] h-[47px] subtitle-1", children: menu.title }),
707
+ menu?.subMenus.map((subMenu) => {
708
+ const isActive = pathname === subMenu.path || pathname.startsWith(subMenu.path + "/");
709
+ return /* @__PURE__ */ jsxs7(
710
+ "div",
711
+ {
712
+ className: `group flex justify-center items-center gap-[10px] p-[10px] w-[202px] h-[47px] rounded-[6px] subtitle-2 cursor-pointer
713
+ ${isActive ? "bg-primary-500 text-white" : "hover:bg-red-100 hover:text-white"}
714
+ active:bg-primary-500 active:text-white duration-100`,
715
+ onClick: () => onClick(subMenu.path),
716
+ children: [
717
+ /* @__PURE__ */ jsx13("span", { className: "flex justify-center items-center w-[24px] h-[24px] text-[20px]", children: isActive ? subMenu.iconActive ?? subMenu.icon : subMenu.icon }),
718
+ subMenu.title,
719
+ /* @__PURE__ */ jsx13("span", { className: "flex ml-auto", children: subMenu.customNode && subMenu.customNode })
720
+ ]
721
+ },
722
+ `sub_${subMenu.title}`
723
+ );
724
+ })
725
+ ]
726
+ },
727
+ `menu_${menu.title}`
728
+ )) });
714
729
  }
715
730
 
716
731
  // src/NavBar/MenuNavBar/Sidebar.tsx
717
732
  import { IconChevronLeftPipe, IconChevronRightPipe } from "@tabler/icons-react";
718
- import { createContext, useContext, useState as useState2 } from "react";
733
+ import { createContext, useContext, useState } from "react";
719
734
  import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
720
735
  var SidebarContext = createContext({ expanded: false });
721
736
  function Sidebar({ children, logo }) {
722
- const [expanded, setExpanded] = useState2(true);
737
+ const [expanded, setExpanded] = useState(true);
723
738
  return /* @__PURE__ */ jsx14("aside", { className: "h-screen", children: /* @__PURE__ */ jsxs8("nav", { className: `h-full flex flex-col bg-white border-r shadow-sm duration-150 ${expanded ? "w-64" : "w-16"}`, children: [
724
739
  /* @__PURE__ */ jsxs8("div", { className: "p-4 pb-2 flex justify-center items-center", children: [
725
740
  expanded && logo && /* @__PURE__ */ jsx14("img", { src: logo, width: 120, className: "ml-auto" }),
@@ -755,7 +770,7 @@ function TopNavBar({ onClickNoti, logo }) {
755
770
 
756
771
  // src/Table/DataTable/DataTable.tsx
757
772
  import { IconSelector, IconSortAscending, IconSortDescending } from "@tabler/icons-react";
758
- import { useState as useState3 } from "react";
773
+ import { useState as useState2 } from "react";
759
774
 
760
775
  // src/Table/Pagination/Pagination.tsx
761
776
  import { IconArrowLeft, IconArrowRight } from "@tabler/icons-react";
@@ -829,8 +844,8 @@ import { Fragment, jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
829
844
  function DataTable({ columns, data, onSort, isLoading }) {
830
845
  const cols = Math.max(1, columns.length);
831
846
  const gridClass = "grid [grid-template-columns:repeat(var(--cols),minmax(0,1fr))]";
832
- const [sortConfig, setSortConfig] = useState3(null);
833
- const [page, setPage] = useState3(1);
847
+ const [sortConfig, setSortConfig] = useState2(null);
848
+ const [page, setPage] = useState2(1);
834
849
  const onSorting = (config) => {
835
850
  if (config) {
836
851
  setSortConfig({ key: config?.key, direction: config?.direction });
@@ -886,7 +901,7 @@ function DataTable({ columns, data, onSort, isLoading }) {
886
901
 
887
902
  // src/Table/DataTable/AntDataTable.tsx
888
903
  import { ConfigProvider as ConfigProvider4, Table } from "antd";
889
- import { useState as useState4 } from "react";
904
+ import { useState as useState3 } from "react";
890
905
  import { Fragment as Fragment2, jsx as jsx18 } from "react/jsx-runtime";
891
906
  function AntDataTable({
892
907
  dataSource,
@@ -901,7 +916,7 @@ function AntDataTable({
901
916
  height,
902
917
  pagination
903
918
  }) {
904
- const [selectedRowKeys, setSelectedRowKeys] = useState4([]);
919
+ const [selectedRowKeys, setSelectedRowKeys] = useState3([]);
905
920
  const rowSelection = {
906
921
  selectedRowKeys,
907
922
  onChange: (newSelectedRowKeys) => {
@@ -940,7 +955,7 @@ function AntDataTable({
940
955
  }
941
956
 
942
957
  // src/Calendar/Calendar/Calendar.tsx
943
- import { useEffect, useRef, useState as useState5 } from "react";
958
+ import { useEffect, useRef, useState as useState4 } from "react";
944
959
  import FullCalendar from "@fullcalendar/react";
945
960
  import dayGridPlugin from "@fullcalendar/daygrid";
946
961
  import timeGridPlugin from "@fullcalendar/timegrid";
@@ -950,9 +965,9 @@ import { IconChevronLeft, IconChevronRight, IconX } from "@tabler/icons-react";
950
965
  import { Fragment as Fragment3, jsx as jsx19, jsxs as jsxs12 } from "react/jsx-runtime";
951
966
  function Calendar({ events }) {
952
967
  const calendarRef = useRef(null);
953
- const [monthTitle, setMonthTitle] = useState5("");
954
- const [openPopup, setOpenPopup] = useState5(false);
955
- const [selectedEvent, setSelectedEvent] = useState5(null);
968
+ const [monthTitle, setMonthTitle] = useState4("");
969
+ const [openPopup, setOpenPopup] = useState4(false);
970
+ const [selectedEvent, setSelectedEvent] = useState4(null);
956
971
  const updateTitle = () => {
957
972
  const calendarApi = calendarRef.current?.getApi();
958
973
  if (calendarApi) {
@@ -1095,7 +1110,7 @@ function EventPopUp({ event, onClose }) {
1095
1110
 
1096
1111
  // src/Input/TextInput/TextInput.tsx
1097
1112
  import { IconEye, IconEyeOff } from "@tabler/icons-react";
1098
- import { useState as useState6 } from "react";
1113
+ import { useState as useState5 } from "react";
1099
1114
  import { jsx as jsx20, jsxs as jsxs13 } from "react/jsx-runtime";
1100
1115
  function TextInput({
1101
1116
  label,
@@ -1108,7 +1123,7 @@ function TextInput({
1108
1123
  onChange,
1109
1124
  disabled
1110
1125
  }) {
1111
- const [showPassword, setShowPassword] = useState6(false);
1126
+ const [showPassword, setShowPassword] = useState5(false);
1112
1127
  const onShowPassword = () => {
1113
1128
  setShowPassword(!showPassword);
1114
1129
  };
@@ -1293,9 +1308,13 @@ function InputFieldNumber({
1293
1308
  };
1294
1309
  const defaultParser = (v) => {
1295
1310
  if (!v) return "";
1296
- const raw = v.replace(/,/g, "").replace(/\s/g, "");
1297
- if (!decimal) return raw.split(".")[0];
1298
- return raw.replace(/[^\d.]/g, "");
1311
+ if (!decimal) {
1312
+ return v.replace(/[^\d]/g, "");
1313
+ }
1314
+ const cleaned = v.replace(/[^\d.]/g, "");
1315
+ const firstDot = cleaned.indexOf(".");
1316
+ if (firstDot === -1) return cleaned;
1317
+ return cleaned.slice(0, firstDot + 1) + cleaned.slice(firstDot + 1).replace(/\./g, "");
1299
1318
  };
1300
1319
  return /* @__PURE__ */ jsx23(
1301
1320
  ConfigProvider7,
@@ -1329,7 +1348,36 @@ function InputFieldNumber({
1329
1348
  changeOnWheel,
1330
1349
  formatter: formatter ?? defaultFormatter,
1331
1350
  parser: parser ?? defaultParser,
1332
- precision: decimal ? safeScale : 0
1351
+ precision: decimal ? safeScale : 0,
1352
+ inputMode: decimal ? "decimal" : "numeric",
1353
+ onKeyDown: (e) => {
1354
+ const allowed = [
1355
+ "Backspace",
1356
+ "Delete",
1357
+ "ArrowLeft",
1358
+ "ArrowRight",
1359
+ "Tab",
1360
+ "Enter",
1361
+ "Home",
1362
+ "End"
1363
+ ];
1364
+ if (allowed.includes(e.key)) return;
1365
+ if (e.ctrlKey || e.metaKey) return;
1366
+ if (!decimal) {
1367
+ if (!/^\d$/.test(e.key)) e.preventDefault();
1368
+ } else {
1369
+ if (!/^\d$/.test(e.key) && e.key !== ".") e.preventDefault();
1370
+ if (e.key === ".") {
1371
+ const current = String(value ?? "");
1372
+ if (current.includes(".")) e.preventDefault();
1373
+ }
1374
+ }
1375
+ },
1376
+ onPaste: (e) => {
1377
+ const text = e.clipboardData.getData("text");
1378
+ const cleaned = !decimal ? text.replace(/[^\d]/g, "") : text.replace(/[^\d.]/g, "").replace(/(\..*)\./g, "$1");
1379
+ if (cleaned !== text) e.preventDefault();
1380
+ }
1333
1381
  }
1334
1382
  ),
1335
1383
  error && /* @__PURE__ */ jsx23("p", { className: "text-red-500 caption-1", children: error })
@@ -1342,7 +1390,7 @@ function InputFieldNumber({
1342
1390
  var import_dayjs = __toESM(require_dayjs_min());
1343
1391
  var import_th2 = __toESM(require_th());
1344
1392
  var import_buddhistEra = __toESM(require_buddhistEra());
1345
- import { useState as useState7, useRef as useRef2, useEffect as useEffect2 } from "react";
1393
+ import { useState as useState6, useRef as useRef2, useEffect as useEffect2 } from "react";
1346
1394
  import { format } from "date-fns";
1347
1395
  import { th as thFns } from "date-fns/locale";
1348
1396
  import { jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
@@ -1361,7 +1409,7 @@ function DatePickerBasic({
1361
1409
  disabledDate,
1362
1410
  disablePast = false
1363
1411
  }) {
1364
- const [open, setOpen] = useState7(false);
1412
+ const [open, setOpen] = useState6(false);
1365
1413
  const wrapperRef = useRef2(null);
1366
1414
  const current = value ? (0, import_dayjs.default)(value) : null;
1367
1415
  const today = (0, import_dayjs.default)();
@@ -1384,7 +1432,7 @@ function DatePickerBasic({
1384
1432
  "\u0E1E\u0E24\u0E28\u0E08\u0E34\u0E01\u0E32\u0E22\u0E19",
1385
1433
  "\u0E18\u0E31\u0E19\u0E27\u0E32\u0E04\u0E21"
1386
1434
  ];
1387
- const [calendar, setCalendar] = useState7(current || today);
1435
+ const [calendar, setCalendar] = useState6(current || today);
1388
1436
  const daysInMonth = calendar.daysInMonth();
1389
1437
  const firstDayOfMonth = calendar.startOf("month").day();
1390
1438
  const isDisabled = (date) => {
@@ -1490,7 +1538,7 @@ function DatePickerBasic({
1490
1538
  var import_dayjs2 = __toESM(require_dayjs_min());
1491
1539
  var import_th3 = __toESM(require_th());
1492
1540
  var import_buddhistEra2 = __toESM(require_buddhistEra());
1493
- import { useState as useState8, useRef as useRef3, useEffect as useEffect3 } from "react";
1541
+ import { useState as useState7, useRef as useRef3, useEffect as useEffect3 } from "react";
1494
1542
  import { format as format2 } from "date-fns";
1495
1543
  import { th as thFns2 } from "date-fns/locale";
1496
1544
  import { jsx as jsx25, jsxs as jsxs18 } from "react/jsx-runtime";
@@ -1508,13 +1556,13 @@ function DatePickerRange({
1508
1556
  disabledDate,
1509
1557
  disablePast = false
1510
1558
  }) {
1511
- const [open, setOpen] = useState8(false);
1559
+ const [open, setOpen] = useState7(false);
1512
1560
  const wrapperRef = useRef3(null);
1513
1561
  const [startDate, endDate] = value;
1514
1562
  const startDayjs = startDate ? (0, import_dayjs2.default)(startDate) : null;
1515
1563
  const endDayjs = endDate ? (0, import_dayjs2.default)(endDate) : null;
1516
1564
  const today = (0, import_dayjs2.default)();
1517
- const [calendar, setCalendar] = useState8(startDayjs || today);
1565
+ const [calendar, setCalendar] = useState7(startDayjs || today);
1518
1566
  const formatThaiBE = (date) => {
1519
1567
  const formatted = format2(date, "dd MMM yy", { locale: thFns2 });
1520
1568
  const year = parseInt(format2(date, "yyyy")) + 543;
@@ -2781,7 +2829,7 @@ function SelectFieldStatusReport({
2781
2829
 
2782
2830
  // src/Select/SelectFieldTag/SelectFieldTag.tsx
2783
2831
  import { Select as Select5, ConfigProvider as ConfigProvider14 } from "antd";
2784
- import { useState as useState9 } from "react";
2832
+ import { useState as useState8 } from "react";
2785
2833
  import { jsx as jsx32, jsxs as jsxs25 } from "react/jsx-runtime";
2786
2834
  function SelectFieldTag({
2787
2835
  label,
@@ -2796,10 +2844,10 @@ function SelectFieldTag({
2796
2844
  size = "middle",
2797
2845
  allowClear = true
2798
2846
  }) {
2799
- const [internalValue, setInternalValue] = useState9([]);
2847
+ const [internalValue, setInternalValue] = useState8([]);
2800
2848
  const isControlled = controlledValue !== void 0;
2801
2849
  const value = isControlled ? controlledValue : internalValue;
2802
- const [searchWord, setSearchWord] = useState9("");
2850
+ const [searchWord, setSearchWord] = useState8("");
2803
2851
  const handleChange = (val) => {
2804
2852
  const trimValue = val.map((v) => v.trim());
2805
2853
  const filtered = trimValue.filter((v) => v.trim() !== "");
@@ -2860,7 +2908,7 @@ function SelectFieldTag({
2860
2908
  // src/Select/SelectCustom/SelectCustom.tsx
2861
2909
  import { IconTrash } from "@tabler/icons-react";
2862
2910
  import { Select as Select6, ConfigProvider as ConfigProvider15 } from "antd";
2863
- import { useState as useState10 } from "react";
2911
+ import { useState as useState9 } from "react";
2864
2912
  import { jsx as jsx33, jsxs as jsxs26 } from "react/jsx-runtime";
2865
2913
  function SelectCustom({
2866
2914
  label = "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E42\u0E04\u0E23\u0E07\u0E01\u0E32\u0E23",
@@ -2873,8 +2921,8 @@ function SelectCustom({
2873
2921
  size = "middle",
2874
2922
  allowClear = true
2875
2923
  }) {
2876
- const [value, setValue] = useState10([]);
2877
- const [valueList, setValueList] = useState10([]);
2924
+ const [value, setValue] = useState9([]);
2925
+ const [valueList, setValueList] = useState9([]);
2878
2926
  const handleChange = (selectedValues) => {
2879
2927
  const newValues = selectedValues.filter((v) => !valueList.includes(v));
2880
2928
  setValueList((prev) => {
@@ -2981,7 +3029,7 @@ var quarters = [
2981
3029
  ];
2982
3030
 
2983
3031
  // src/SortFilter/SortFilter.tsx
2984
- import { useState as useState11 } from "react";
3032
+ import { useState as useState10 } from "react";
2985
3033
  import { IconSortDescending as IconSortDescending2, IconFilter } from "@tabler/icons-react";
2986
3034
  import { jsx as jsx34, jsxs as jsxs27 } from "react/jsx-runtime";
2987
3035
  function SortFilter({
@@ -2991,9 +3039,9 @@ function SortFilter({
2991
3039
  onSortClick,
2992
3040
  onFilterClick
2993
3041
  }) {
2994
- const [yearValue, setYearValue] = useState11();
2995
- const [monthValue, setMonthValue] = useState11();
2996
- const [quarterValue, setQuartersValue] = useState11();
3042
+ const [yearValue, setYearValue] = useState10();
3043
+ const [monthValue, setMonthValue] = useState10();
3044
+ const [quarterValue, setQuartersValue] = useState10();
2997
3045
  return /* @__PURE__ */ jsx34(
2998
3046
  ConfigProvider16,
2999
3047
  {
@@ -3069,7 +3117,7 @@ function SortFilter({
3069
3117
 
3070
3118
  // src/Upload/FileUploader/FileUploader.tsx
3071
3119
  import { IconUpload, IconTrash as IconTrash2, IconFileDescription } from "@tabler/icons-react";
3072
- import { useRef as useRef4, useState as useState12 } from "react";
3120
+ import { useRef as useRef4, useState as useState11 } from "react";
3073
3121
  import { Fragment as Fragment5, jsx as jsx35, jsxs as jsxs28 } from "react/jsx-runtime";
3074
3122
  function FileUploader({
3075
3123
  onUpload,
@@ -3088,9 +3136,9 @@ function FileUploader({
3088
3136
  attachWidth = "w-full",
3089
3137
  readOnly = false
3090
3138
  }) {
3091
- const [internalFileList, setInternalFileList] = useState12([]);
3092
- const [uploading, setUploading] = useState12(false);
3093
- const [dragActive, setDragActive] = useState12(false);
3139
+ const [internalFileList, setInternalFileList] = useState11([]);
3140
+ const [uploading, setUploading] = useState11(false);
3141
+ const [dragActive, setDragActive] = useState11(false);
3094
3142
  const inputRef = useRef4(null);
3095
3143
  const filesToDisplay = value || internalFileList;
3096
3144
  const validateFile = (file) => {
@@ -3331,7 +3379,7 @@ function HeadingPage({ Heading }) {
3331
3379
 
3332
3380
  // src/Progress/ProgressBar.tsx
3333
3381
  import { ConfigProvider as ConfigProvider19, Progress } from "antd";
3334
- import { useEffect as useEffect4, useRef as useRef5, useState as useState13 } from "react";
3382
+ import { useEffect as useEffect4, useRef as useRef5, useState as useState12 } from "react";
3335
3383
  import { jsx as jsx38, jsxs as jsxs30 } from "react/jsx-runtime";
3336
3384
  function ProgressBar({
3337
3385
  percent = 0,
@@ -3345,7 +3393,7 @@ function ProgressBar({
3345
3393
  steps,
3346
3394
  isCheckPoints
3347
3395
  }) {
3348
- const [barWidth, setBarWidth] = useState13(0);
3396
+ const [barWidth, setBarWidth] = useState12(0);
3349
3397
  const progressRef = useRef5(null);
3350
3398
  let strokeColor = "--color-green-500";
3351
3399
  const defaultStrokeWidth = type === "circle" ? 13 : strokeWidth ?? 8;
@@ -3411,24 +3459,24 @@ function ProgressBar({
3411
3459
 
3412
3460
  // src/KpiSection/KpiSection.tsx
3413
3461
  import { ConfigProvider as ConfigProvider20, message } from "antd";
3414
- import { useEffect as useEffect5, useState as useState15 } from "react";
3462
+ import { useEffect as useEffect5, useState as useState14 } from "react";
3415
3463
 
3416
3464
  // src/KpiSection/hooks/useGetKpiSection.ts
3417
- import { useState as useState14 } from "react";
3465
+ import { useState as useState13 } from "react";
3418
3466
  import cuid from "cuid";
3419
3467
  function useGetKpiSection() {
3420
- const [nameKpi, setNameKpi] = useState14("");
3421
- const [kpiValue, setKpiValue] = useState14("");
3422
- const [unitValue, setUnitValue] = useState14("");
3423
- const [kpiList, setKpiList] = useState14([]);
3424
- const [editingBackup, setEditingBackup] = useState14({});
3425
- const [selected, setSelected] = useState14("2");
3426
- const [errors, setErrors] = useState14({
3468
+ const [nameKpi, setNameKpi] = useState13("");
3469
+ const [kpiValue, setKpiValue] = useState13("");
3470
+ const [unitValue, setUnitValue] = useState13("");
3471
+ const [kpiList, setKpiList] = useState13([]);
3472
+ const [editingBackup, setEditingBackup] = useState13({});
3473
+ const [selected, setSelected] = useState13("2");
3474
+ const [errors, setErrors] = useState13({
3427
3475
  nameKpi: "",
3428
3476
  kpiValue: "",
3429
3477
  unitValue: ""
3430
3478
  });
3431
- const [itemErrors, setItemErrors] = useState14({});
3479
+ const [itemErrors, setItemErrors] = useState13({});
3432
3480
  const options = [
3433
3481
  { value: "1", label: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21" },
3434
3482
  { value: "2", label: "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02" }
@@ -3582,7 +3630,7 @@ function KpiSection({ type, onChangeKpiList }) {
3582
3630
  setItemErrors
3583
3631
  } = useGetKpiSection();
3584
3632
  const [messageApi2, messageContainer] = message.useMessage();
3585
- const [hasShownError, setHasShownError] = useState15(false);
3633
+ const [hasShownError, setHasShownError] = useState14(false);
3586
3634
  useEffect5(() => {
3587
3635
  setMessageApi(messageApi2);
3588
3636
  }, [messageApi2]);
@@ -3824,7 +3872,7 @@ function AntDModal({ children, isOpen, width, onCancel }) {
3824
3872
 
3825
3873
  // src/Indicator/Indicator/Indicator.tsx
3826
3874
  import { IconCheck as IconCheck3, IconCirclePlus as IconCirclePlus2, IconTrash as IconTrash4, IconX as IconX3 } from "@tabler/icons-react";
3827
- import { useState as useState16 } from "react";
3875
+ import { useState as useState15 } from "react";
3828
3876
  import { Input as Input4 } from "antd";
3829
3877
  import { Fragment as Fragment7, jsx as jsx41, jsxs as jsxs32 } from "react/jsx-runtime";
3830
3878
  function Indicator({
@@ -3838,24 +3886,24 @@ function Indicator({
3838
3886
  canEdit,
3839
3887
  onDeleteClick
3840
3888
  }) {
3841
- const [valueSwitch, setValueSwitch] = useState16("TEXT");
3842
- const [cacheData, setCacheData] = useState16({
3889
+ const [valueSwitch, setValueSwitch] = useState15("TEXT");
3890
+ const [cacheData, setCacheData] = useState15({
3843
3891
  indicatorType: type,
3844
3892
  inputType: valueSwitch,
3845
3893
  textValue: "",
3846
3894
  numberValue: 0,
3847
3895
  unit: ""
3848
3896
  });
3849
- const [cacheEditData, setCacheEditData] = useState16({
3897
+ const [cacheEditData, setCacheEditData] = useState15({
3850
3898
  indicatorType: type,
3851
3899
  inputType: valueSwitch,
3852
3900
  textValue: "",
3853
3901
  numberValue: 0,
3854
3902
  unit: ""
3855
3903
  });
3856
- const [editIndex, setEditIndex] = useState16(null);
3857
- const [addError, setAddError] = useState16({});
3858
- const [editError, setEditError] = useState16({});
3904
+ const [editIndex, setEditIndex] = useState15(null);
3905
+ const [addError, setAddError] = useState15({});
3906
+ const [editError, setEditError] = useState15({});
3859
3907
  const handleAddIndicator = () => {
3860
3908
  const nextErr = {};
3861
3909
  const textValue = (cacheData.textValue ?? "").trim();
@@ -4100,11 +4148,11 @@ function Indicator({
4100
4148
 
4101
4149
  // src/FilterPopUp/FilterPopUp.tsx
4102
4150
  import { IconCheck as IconCheck4, IconFilter as IconFilter2, IconTrash as IconTrash5 } from "@tabler/icons-react";
4103
- import { useState as useState17 } from "react";
4151
+ import { useState as useState16 } from "react";
4104
4152
  import { jsx as jsx42, jsxs as jsxs33 } from "react/jsx-runtime";
4105
4153
  var FilterPopUp = (filter) => {
4106
- const [isAction, setIsAction] = useState17(true);
4107
- const [filterArray, setFilterArray] = useState17([""]);
4154
+ const [isAction, setIsAction] = useState16(true);
4155
+ const [filterArray, setFilterArray] = useState16([""]);
4108
4156
  const handleClearFilter = () => {
4109
4157
  setFilterArray([]);
4110
4158
  };
@@ -4137,7 +4185,7 @@ var FilterPopUp = (filter) => {
4137
4185
  };
4138
4186
 
4139
4187
  // src/ProfileSelect/ProfileSelect/ProfileSelect.tsx
4140
- import { useEffect as useEffect7, useRef as useRef6, useState as useState18 } from "react";
4188
+ import { useEffect as useEffect7, useRef as useRef6, useState as useState17 } from "react";
4141
4189
  import { IconSearch, IconUsers, IconX as IconX4 } from "@tabler/icons-react";
4142
4190
  import { Input as Input5 } from "antd";
4143
4191
  import { Fragment as Fragment8, jsx as jsx43, jsxs as jsxs34 } from "react/jsx-runtime";
@@ -4149,10 +4197,10 @@ function ProfileSelect({
4149
4197
  onUpdateAssignUser,
4150
4198
  placeholder
4151
4199
  }) {
4152
- const [maxVisible, setMaxVisible] = useState18(4);
4153
- const [userNotAssign, setUserNotAssign] = useState18([]);
4154
- const [search, setSearch] = useState18("");
4155
- const [isShowSelect, setIsShowSelect] = useState18(false);
4200
+ const [maxVisible, setMaxVisible] = useState17(4);
4201
+ const [userNotAssign, setUserNotAssign] = useState17([]);
4202
+ const [search, setSearch] = useState17("");
4203
+ const [isShowSelect, setIsShowSelect] = useState17(false);
4156
4204
  const containerRef = useRef6(null);
4157
4205
  const selectRef = useRef6(null);
4158
4206
  const avatarSize = 30;
@@ -4378,7 +4426,7 @@ function ProfileSelect({
4378
4426
  }
4379
4427
 
4380
4428
  // src/Button/QRCode/QRCode.tsx
4381
- import { useEffect as useEffect8, useRef as useRef7, useState as useState19 } from "react";
4429
+ import { useEffect as useEffect8, useRef as useRef7, useState as useState18 } from "react";
4382
4430
  import QRCode from "qrcode";
4383
4431
  import { jsx as jsx44, jsxs as jsxs35 } from "react/jsx-runtime";
4384
4432
  var QRCodeGenerator = ({
@@ -4388,8 +4436,8 @@ var QRCodeGenerator = ({
4388
4436
  fileBaseName = "qr-code"
4389
4437
  }) => {
4390
4438
  const canvasRef = useRef7(null);
4391
- const [format5, setFormat] = useState19("png");
4392
- const [exportSize, setExportSize] = useState19(defaultExportSize);
4439
+ const [format5, setFormat] = useState18("png");
4440
+ const [exportSize, setExportSize] = useState18(defaultExportSize);
4393
4441
  const sizeOption = [
4394
4442
  {
4395
4443
  label: "64 x 64",
@@ -4729,7 +4777,7 @@ var PieChart = ({
4729
4777
  };
4730
4778
 
4731
4779
  // src/GanttChart/GanttChart.tsx
4732
- import { useEffect as useEffect11, useRef as useRef10, useState as useState20 } from "react";
4780
+ import { useEffect as useEffect11, useRef as useRef10, useState as useState19 } from "react";
4733
4781
  import * as d33 from "d3";
4734
4782
  import {
4735
4783
  format as format4,
@@ -4879,7 +4927,6 @@ var RowOverlay = ({ data, barHeight, barSpacing, totalHeaderHeight }) => /* @__P
4879
4927
  },
4880
4928
  children: data.map((_, i) => {
4881
4929
  if (i === 0) return null;
4882
- console.log("rendering row line", i);
4883
4930
  const yPos = i * (barHeight + barSpacing) - barSpacing / 2;
4884
4931
  return /* @__PURE__ */ jsx48(
4885
4932
  "div",
@@ -4907,7 +4954,7 @@ var GanttChart = ({
4907
4954
  const svgRef = useRef10(null);
4908
4955
  const leftPanelRef = useRef10(null);
4909
4956
  const dataContainerRef = useRef10(null);
4910
- const [viewMode] = useState20("year");
4957
+ const [viewMode] = useState19("year");
4911
4958
  const {
4912
4959
  barHeight,
4913
4960
  barSpacing,
@@ -5203,7 +5250,7 @@ var GanttChart = ({
5203
5250
 
5204
5251
  // src/CardKPI/CardKPI/CardKPI.tsx
5205
5252
  import { IconCheckbox, IconDots, IconSquare } from "@tabler/icons-react";
5206
- import { useState as useState21 } from "react";
5253
+ import { useState as useState20 } from "react";
5207
5254
  import { Fragment as Fragment9, jsx as jsx49, jsxs as jsxs40 } from "react/jsx-runtime";
5208
5255
  function KPIRow({ item }) {
5209
5256
  return /* @__PURE__ */ jsxs40(
@@ -5225,7 +5272,7 @@ function CardKPI({
5225
5272
  indicator,
5226
5273
  projectId
5227
5274
  }) {
5228
- const [isOpen, setIsOpen] = useState21(false);
5275
+ const [isOpen, setIsOpen] = useState20(false);
5229
5276
  return /* @__PURE__ */ jsxs40(
5230
5277
  "div",
5231
5278
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esic-lab/data-core-ui",
3
- "version": "0.0.67",
3
+ "version": "0.0.69",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",
@@ -62,7 +62,6 @@
62
62
  "description": "STO-core-UI",
63
63
  "dependencies": {
64
64
  "@ant-design/icons": "^5.6.1",
65
- "date-fns": "^4.1.0",
66
65
  "@fortawesome/free-solid-svg-icons": "^7.0.1",
67
66
  "@fortawesome/react-fontawesome": "^3.0.2",
68
67
  "@fullcalendar/core": "^6.1.19",
@@ -75,8 +74,10 @@
75
74
  "classnames": "^2.5.1",
76
75
  "cuid": "^3.0.0",
77
76
  "d3": "^7.9.0",
77
+ "date-fns": "^4.1.0",
78
78
  "fullcalendar": "^6.1.19",
79
- "qrcode": "^1.5.4"
79
+ "qrcode": "^1.5.4",
80
+ "react-router": "^7.11.0"
80
81
  },
81
82
  "publishConfig": {
82
83
  "access": "public"