@esic-lab/data-core-ui 0.0.49 → 0.0.50

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 CHANGED
@@ -453,8 +453,9 @@ interface FileUploaderProps {
453
453
  description?: string;
454
454
  label?: string;
455
455
  value?: File[] | any[];
456
+ uploadText?: string;
456
457
  }
457
- declare function FileUploader({ onUpload, onError, onRemove, accept, maxSize, disabled, mode, description, label, value, }: FileUploaderProps): react_jsx_runtime.JSX.Element;
458
+ declare function FileUploader({ onUpload, onError, onRemove, accept, maxSize, disabled, mode, description, label, value, uploadText, }: FileUploaderProps): react_jsx_runtime.JSX.Element;
458
459
 
459
460
  declare function setMessageApi(api: MessageInstance): void;
460
461
  declare function messageSuccess(content: string): void;
package/dist/index.d.ts CHANGED
@@ -453,8 +453,9 @@ interface FileUploaderProps {
453
453
  description?: string;
454
454
  label?: string;
455
455
  value?: File[] | any[];
456
+ uploadText?: string;
456
457
  }
457
- declare function FileUploader({ onUpload, onError, onRemove, accept, maxSize, disabled, mode, description, label, value, }: FileUploaderProps): react_jsx_runtime.JSX.Element;
458
+ declare function FileUploader({ onUpload, onError, onRemove, accept, maxSize, disabled, mode, description, label, value, uploadText, }: FileUploaderProps): react_jsx_runtime.JSX.Element;
458
459
 
459
460
  declare function setMessageApi(api: MessageInstance): void;
460
461
  declare function messageSuccess(content: string): void;
package/dist/index.js CHANGED
@@ -659,20 +659,23 @@ function SwitchSelect({
659
659
  }
660
660
 
661
661
  // src/NavBar/MenuNavBar/MenuNavBar.tsx
662
+ var import_react = require("react");
662
663
  var import_jsx_runtime12 = require("react/jsx-runtime");
663
664
  function MenuNavBar({ menus, onClick }) {
665
+ const [activePath, setActivePath] = (0, import_react.useState)("");
664
666
  return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "w-full h-full p-[10px] bg-white", children: menus?.map((menu, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: `p-[10px] ${index !== 0 ? "mt-[10px]" : ""}`, children: [
665
667
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "p-[10px] w-[202px] h-[47px] subtitle-1", children: menu.title }),
666
668
  menu?.subMenus.map((subMenu) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
667
669
  "div",
668
670
  {
669
- className: "group flex justify-center items-center gap-[10px] p-[10px] w-[202px] h-[47px] rounded-[6px] subtitle-2 cursor-pointer hover:bg-red-100 active:bg-primary-500 hover:text-white active:text-white",
670
- onClick: () => onClick(subMenu.path),
671
+ className: `group flex justify-center items-center gap-[10px] p-[10px] w-[202px] h-[47px] rounded-[6px] subtitle-2 cursor-pointer
672
+ ${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`,
673
+ onClick: () => {
674
+ onClick(subMenu.path);
675
+ setActivePath(subMenu.path);
676
+ },
671
677
  children: [
672
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "flex justify-center items-center w-[24px] h-[24px] text-[20px]", children: [
673
- subMenu.icon && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: `block ${subMenu.iconActive ? "group-active:hidden" : ""}`, children: subMenu.icon }),
674
- subMenu.iconActive && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "hidden group-active:block", children: subMenu.iconActive })
675
- ] }),
678
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "flex justify-center items-center w-[24px] h-[24px] text-[20px]", children: activePath === subMenu.path ? subMenu.iconActive ?? subMenu.icon : subMenu.icon }),
676
679
  subMenu.title,
677
680
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "flex ml-auto", children: subMenu.customNode && subMenu.customNode })
678
681
  ]
@@ -684,11 +687,11 @@ function MenuNavBar({ menus, onClick }) {
684
687
 
685
688
  // src/NavBar/MenuNavBar/Sidebar.tsx
686
689
  var import_icons_react2 = require("@tabler/icons-react");
687
- var import_react = require("react");
690
+ var import_react2 = require("react");
688
691
  var import_jsx_runtime13 = require("react/jsx-runtime");
689
- var SidebarContext = (0, import_react.createContext)({ expanded: false });
692
+ var SidebarContext = (0, import_react2.createContext)({ expanded: false });
690
693
  function Sidebar({ children, logo }) {
691
- const [expanded, setExpanded] = (0, import_react.useState)(true);
694
+ const [expanded, setExpanded] = (0, import_react2.useState)(true);
692
695
  return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("aside", { className: "h-screen", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("nav", { className: `h-full flex flex-col bg-white border-r shadow-sm duration-150 ${expanded ? "w-64" : "w-16"}`, children: [
693
696
  /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "p-4 pb-2 flex justify-center items-center", children: [
694
697
  expanded && logo && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("img", { src: logo, width: 120, className: "ml-auto" }),
@@ -724,15 +727,15 @@ function TopNavBar({ onClickNoti, logo }) {
724
727
 
725
728
  // src/Table/DataTable/DataTable.tsx
726
729
  var import_icons_react5 = require("@tabler/icons-react");
727
- var import_react3 = require("react");
730
+ var import_react4 = require("react");
728
731
 
729
732
  // src/Table/Pagination/Pagination.tsx
730
733
  var import_icons_react4 = require("@tabler/icons-react");
731
- var import_react2 = require("react");
734
+ var import_react3 = require("react");
732
735
  var import_jsx_runtime15 = require("react/jsx-runtime");
733
736
  function Pagination({ totalItems, itemsPerPage, currentPage, onPageChange }) {
734
737
  const totalPages = Math.ceil(totalItems / itemsPerPage);
735
- const getPages = (0, import_react2.useMemo)(() => {
738
+ const getPages = (0, import_react3.useMemo)(() => {
736
739
  if (totalPages <= 7) {
737
740
  return Array.from({ length: totalPages }, (_, i) => i + 1);
738
741
  }
@@ -798,8 +801,8 @@ var import_jsx_runtime16 = require("react/jsx-runtime");
798
801
  function DataTable({ columns, data, onSort, isLoading }) {
799
802
  const cols = Math.max(1, columns.length);
800
803
  const gridClass = "grid [grid-template-columns:repeat(var(--cols),minmax(0,1fr))]";
801
- const [sortConfig, setSortConfig] = (0, import_react3.useState)(null);
802
- const [page, setPage] = (0, import_react3.useState)(1);
804
+ const [sortConfig, setSortConfig] = (0, import_react4.useState)(null);
805
+ const [page, setPage] = (0, import_react4.useState)(1);
803
806
  const onSorting = (config) => {
804
807
  if (config) {
805
808
  setSortConfig({ key: config?.key, direction: config?.direction });
@@ -855,7 +858,7 @@ function DataTable({ columns, data, onSort, isLoading }) {
855
858
 
856
859
  // src/Table/DataTable/AntDataTable.tsx
857
860
  var import_antd = require("antd");
858
- var import_react4 = require("react");
861
+ var import_react5 = require("react");
859
862
  var import_jsx_runtime17 = require("react/jsx-runtime");
860
863
  function AntDataTable({
861
864
  dataSource,
@@ -870,7 +873,7 @@ function AntDataTable({
870
873
  height,
871
874
  pagination
872
875
  }) {
873
- const [selectedRowKeys, setSelectedRowKeys] = (0, import_react4.useState)([]);
876
+ const [selectedRowKeys, setSelectedRowKeys] = (0, import_react5.useState)([]);
874
877
  const rowSelection = {
875
878
  selectedRowKeys,
876
879
  onChange: (newSelectedRowKeys) => {
@@ -909,8 +912,8 @@ function AntDataTable({
909
912
  }
910
913
 
911
914
  // src/Calendar/Calendar/Calendar.tsx
912
- var import_react5 = require("react");
913
- var import_react6 = __toESM(require("@fullcalendar/react"));
915
+ var import_react6 = require("react");
916
+ var import_react7 = __toESM(require("@fullcalendar/react"));
914
917
  var import_daygrid = __toESM(require("@fullcalendar/daygrid"));
915
918
  var import_timegrid = __toESM(require("@fullcalendar/timegrid"));
916
919
  var import_interaction = __toESM(require("@fullcalendar/interaction"));
@@ -918,10 +921,10 @@ var import_th = __toESM(require("@fullcalendar/core/locales/th"));
918
921
  var import_icons_react6 = require("@tabler/icons-react");
919
922
  var import_jsx_runtime18 = require("react/jsx-runtime");
920
923
  function Calendar({ events }) {
921
- const calendarRef = (0, import_react5.useRef)(null);
922
- const [monthTitle, setMonthTitle] = (0, import_react5.useState)("");
923
- const [openPopup, setOpenPopup] = (0, import_react5.useState)(false);
924
- const [selectedEvent, setSelectedEvent] = (0, import_react5.useState)(null);
924
+ const calendarRef = (0, import_react6.useRef)(null);
925
+ const [monthTitle, setMonthTitle] = (0, import_react6.useState)("");
926
+ const [openPopup, setOpenPopup] = (0, import_react6.useState)(false);
927
+ const [selectedEvent, setSelectedEvent] = (0, import_react6.useState)(null);
925
928
  const updateTitle = () => {
926
929
  const calendarApi = calendarRef.current?.getApi();
927
930
  if (calendarApi) {
@@ -932,7 +935,7 @@ function Calendar({ events }) {
932
935
  const calendarApi = calendarRef.current?.getApi();
933
936
  calendarApi?.changeView(viewName);
934
937
  };
935
- (0, import_react5.useEffect)(() => {
938
+ (0, import_react6.useEffect)(() => {
936
939
  updateTitle();
937
940
  }, []);
938
941
  return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "fc w-full h-full relative z-10", children: [
@@ -1008,7 +1011,7 @@ function Calendar({ events }) {
1008
1011
  ] })
1009
1012
  ] }),
1010
1013
  /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "relative z-10", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1011
- import_react6.default,
1014
+ import_react7.default,
1012
1015
  {
1013
1016
  ref: calendarRef,
1014
1017
  plugins: [import_daygrid.default, import_timegrid.default, import_interaction.default],
@@ -1064,7 +1067,7 @@ function EventPopUp({ event, onClose }) {
1064
1067
 
1065
1068
  // src/Input/TextInput/TextInput.tsx
1066
1069
  var import_icons_react7 = require("@tabler/icons-react");
1067
- var import_react7 = require("react");
1070
+ var import_react8 = require("react");
1068
1071
  var import_jsx_runtime19 = require("react/jsx-runtime");
1069
1072
  function TextInput({
1070
1073
  label,
@@ -1077,7 +1080,7 @@ function TextInput({
1077
1080
  onChange,
1078
1081
  disabled
1079
1082
  }) {
1080
- const [showPassword, setShowPassword] = (0, import_react7.useState)(false);
1083
+ const [showPassword, setShowPassword] = (0, import_react8.useState)(false);
1081
1084
  const onShowPassword = () => {
1082
1085
  setShowPassword(!showPassword);
1083
1086
  };
@@ -1289,7 +1292,7 @@ function InputFieldNumber({
1289
1292
  }
1290
1293
 
1291
1294
  // src/DatePicker/DatePickerBasic/DatePickerBasic.tsx
1292
- var import_react8 = require("react");
1295
+ var import_react9 = require("react");
1293
1296
  var import_dayjs = __toESM(require_dayjs_min());
1294
1297
  var import_th2 = __toESM(require_th());
1295
1298
  var import_buddhistEra = __toESM(require_buddhistEra());
@@ -1311,8 +1314,8 @@ function DatePickerBasic({
1311
1314
  disabledDate,
1312
1315
  disablePast = false
1313
1316
  }) {
1314
- const [open, setOpen] = (0, import_react8.useState)(false);
1315
- const wrapperRef = (0, import_react8.useRef)(null);
1317
+ const [open, setOpen] = (0, import_react9.useState)(false);
1318
+ const wrapperRef = (0, import_react9.useRef)(null);
1316
1319
  const current = value ? (0, import_dayjs.default)(value) : null;
1317
1320
  const today = (0, import_dayjs.default)();
1318
1321
  const formatThaiBE = (date) => {
@@ -1334,7 +1337,7 @@ function DatePickerBasic({
1334
1337
  "\u0E1E\u0E24\u0E28\u0E08\u0E34\u0E01\u0E32\u0E22\u0E19",
1335
1338
  "\u0E18\u0E31\u0E19\u0E27\u0E32\u0E04\u0E21"
1336
1339
  ];
1337
- const [calendar, setCalendar] = (0, import_react8.useState)(current || today);
1340
+ const [calendar, setCalendar] = (0, import_react9.useState)(current || today);
1338
1341
  const daysInMonth = calendar.daysInMonth();
1339
1342
  const firstDayOfMonth = calendar.startOf("month").day();
1340
1343
  const isDisabled = (date) => {
@@ -1350,7 +1353,7 @@ function DatePickerBasic({
1350
1353
  onChange(selected.toDate());
1351
1354
  setOpen(false);
1352
1355
  };
1353
- (0, import_react8.useEffect)(() => {
1356
+ (0, import_react9.useEffect)(() => {
1354
1357
  const handleClickOutside = (e) => {
1355
1358
  if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {
1356
1359
  setOpen(false);
@@ -1437,7 +1440,7 @@ function DatePickerBasic({
1437
1440
  }
1438
1441
 
1439
1442
  // src/DatePicker/DatePickerRange/DatePickerRange.tsx
1440
- var import_react9 = require("react");
1443
+ var import_react10 = require("react");
1441
1444
  var import_dayjs2 = __toESM(require_dayjs_min());
1442
1445
  var import_th3 = __toESM(require_th());
1443
1446
  var import_buddhistEra2 = __toESM(require_buddhistEra());
@@ -1458,13 +1461,13 @@ function DatePickerRange({
1458
1461
  disabledDate,
1459
1462
  disablePast = false
1460
1463
  }) {
1461
- const [open, setOpen] = (0, import_react9.useState)(false);
1462
- const wrapperRef = (0, import_react9.useRef)(null);
1464
+ const [open, setOpen] = (0, import_react10.useState)(false);
1465
+ const wrapperRef = (0, import_react10.useRef)(null);
1463
1466
  const [startDate, endDate] = value;
1464
1467
  const startDayjs = startDate ? (0, import_dayjs2.default)(startDate) : null;
1465
1468
  const endDayjs = endDate ? (0, import_dayjs2.default)(endDate) : null;
1466
1469
  const today = (0, import_dayjs2.default)();
1467
- const [calendar, setCalendar] = (0, import_react9.useState)(startDayjs || today);
1470
+ const [calendar, setCalendar] = (0, import_react10.useState)(startDayjs || today);
1468
1471
  const formatThaiBE = (date) => {
1469
1472
  const formatted = (0, import_date_fns2.format)(date, "dd MMM yy", { locale: import_locale2.th });
1470
1473
  const year = parseInt((0, import_date_fns2.format)(date, "yyyy")) + 543;
@@ -1508,7 +1511,7 @@ function DatePickerRange({
1508
1511
  }
1509
1512
  }
1510
1513
  };
1511
- (0, import_react9.useEffect)(() => {
1514
+ (0, import_react10.useEffect)(() => {
1512
1515
  const handleClickOutside = (e) => {
1513
1516
  if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {
1514
1517
  setOpen(false);
@@ -2728,7 +2731,7 @@ function SelectFieldStatusReport({
2728
2731
 
2729
2732
  // src/Select/SelectFieldTag/SelectFieldTag.tsx
2730
2733
  var import_antd11 = require("antd");
2731
- var import_react10 = require("react");
2734
+ var import_react11 = require("react");
2732
2735
  var import_jsx_runtime31 = require("react/jsx-runtime");
2733
2736
  function SelectFieldTag({
2734
2737
  label,
@@ -2741,10 +2744,10 @@ function SelectFieldTag({
2741
2744
  onChange,
2742
2745
  onClear
2743
2746
  }) {
2744
- const [internalValue, setInternalValue] = (0, import_react10.useState)([]);
2747
+ const [internalValue, setInternalValue] = (0, import_react11.useState)([]);
2745
2748
  const isControlled = controlledValue !== void 0;
2746
2749
  const value = isControlled ? controlledValue : internalValue;
2747
- const [searchWord, setSearchWord] = (0, import_react10.useState)("");
2750
+ const [searchWord, setSearchWord] = (0, import_react11.useState)("");
2748
2751
  const handleChange = (val) => {
2749
2752
  const trimValue = val.map((v) => v.trim());
2750
2753
  const filtered = trimValue.filter((v) => v.trim() !== "");
@@ -2804,7 +2807,7 @@ function SelectFieldTag({
2804
2807
  // src/Select/SelectCustom/SelectCustom.tsx
2805
2808
  var import_icons_react8 = require("@tabler/icons-react");
2806
2809
  var import_antd12 = require("antd");
2807
- var import_react11 = require("react");
2810
+ var import_react12 = require("react");
2808
2811
  var import_jsx_runtime32 = require("react/jsx-runtime");
2809
2812
  function SelectCustom({
2810
2813
  label = "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E42\u0E04\u0E23\u0E07\u0E01\u0E32\u0E23",
@@ -2815,8 +2818,8 @@ function SelectCustom({
2815
2818
  error,
2816
2819
  onClear
2817
2820
  }) {
2818
- const [value, setValue] = (0, import_react11.useState)([]);
2819
- const [valueList, setValueList] = (0, import_react11.useState)([]);
2821
+ const [value, setValue] = (0, import_react12.useState)([]);
2822
+ const [valueList, setValueList] = (0, import_react12.useState)([]);
2820
2823
  const handleChange = (selectedValues) => {
2821
2824
  const newValues = selectedValues.filter((v) => !valueList.includes(v));
2822
2825
  setValueList((prev) => {
@@ -2921,7 +2924,7 @@ var quarters = [
2921
2924
  ];
2922
2925
 
2923
2926
  // src/SortFilter/SortFilter.tsx
2924
- var import_react12 = require("react");
2927
+ var import_react13 = require("react");
2925
2928
  var import_icons_react9 = require("@tabler/icons-react");
2926
2929
  var import_jsx_runtime33 = require("react/jsx-runtime");
2927
2930
  function SortFilter({
@@ -2931,9 +2934,9 @@ function SortFilter({
2931
2934
  onSortClick,
2932
2935
  onFilterClick
2933
2936
  }) {
2934
- const [yearValue, setYearValue] = (0, import_react12.useState)();
2935
- const [monthValue, setMonthValue] = (0, import_react12.useState)();
2936
- const [quarterValue, setQuartersValue] = (0, import_react12.useState)();
2937
+ const [yearValue, setYearValue] = (0, import_react13.useState)();
2938
+ const [monthValue, setMonthValue] = (0, import_react13.useState)();
2939
+ const [quarterValue, setQuartersValue] = (0, import_react13.useState)();
2937
2940
  return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
2938
2941
  import_antd13.ConfigProvider,
2939
2942
  {
@@ -3009,7 +3012,7 @@ function SortFilter({
3009
3012
 
3010
3013
  // src/Upload/FileUploader/FileUploader.tsx
3011
3014
  var import_icons_react10 = require("@tabler/icons-react");
3012
- var import_react13 = require("react");
3015
+ var import_react14 = require("react");
3013
3016
  var import_jsx_runtime34 = require("react/jsx-runtime");
3014
3017
  function FileUploader({
3015
3018
  onUpload,
@@ -3021,12 +3024,13 @@ function FileUploader({
3021
3024
  mode = "drop",
3022
3025
  description,
3023
3026
  label,
3024
- value
3027
+ value,
3028
+ uploadText = "\u0E41\u0E19\u0E1A\u0E44\u0E1F\u0E25\u0E4C"
3025
3029
  }) {
3026
- const [internalFileList, setInternalFileList] = (0, import_react13.useState)([]);
3027
- const [uploading, setUploading] = (0, import_react13.useState)(false);
3028
- const [dragActive, setDragActive] = (0, import_react13.useState)(false);
3029
- const inputRef = (0, import_react13.useRef)(null);
3030
+ const [internalFileList, setInternalFileList] = (0, import_react14.useState)([]);
3031
+ const [uploading, setUploading] = (0, import_react14.useState)(false);
3032
+ const [dragActive, setDragActive] = (0, import_react14.useState)(false);
3033
+ const inputRef = (0, import_react14.useRef)(null);
3030
3034
  const filesToDisplay = value || internalFileList;
3031
3035
  const validateFile = (file) => {
3032
3036
  if (accept && !accept.includes(file.type)) {
@@ -3107,7 +3111,8 @@ function FileUploader({
3107
3111
  " \u0E01\u0E33\u0E25\u0E31\u0E07\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14"
3108
3112
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
3109
3113
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_icons_react10.IconUpload, { size: 15, className: "text-gray-400" }),
3110
- " \u0E41\u0E19\u0E1A\u0E44\u0E1F\u0E25\u0E4C"
3114
+ " ",
3115
+ uploadText
3111
3116
  ] })
3112
3117
  }
3113
3118
  ) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
@@ -3250,7 +3255,7 @@ function HeadingPage({ Heading }) {
3250
3255
 
3251
3256
  // src/Progress/ProgressBar.tsx
3252
3257
  var import_antd17 = require("antd");
3253
- var import_react14 = require("react");
3258
+ var import_react15 = require("react");
3254
3259
  var import_jsx_runtime37 = require("react/jsx-runtime");
3255
3260
  function ProgressBar({
3256
3261
  percent = 0,
@@ -3264,8 +3269,8 @@ function ProgressBar({
3264
3269
  steps,
3265
3270
  isCheckPoints
3266
3271
  }) {
3267
- const [barWidth, setBarWidth] = (0, import_react14.useState)(0);
3268
- const progressRef = (0, import_react14.useRef)(null);
3272
+ const [barWidth, setBarWidth] = (0, import_react15.useState)(0);
3273
+ const progressRef = (0, import_react15.useRef)(null);
3269
3274
  let strokeColor = "--color-green-500";
3270
3275
  const defaultStrokeWidth = type === "circle" ? 13 : strokeWidth ?? 8;
3271
3276
  const defaultSize = type === "circle" ? 43 : size;
@@ -3273,7 +3278,7 @@ function ProgressBar({
3273
3278
  const minCheckpoint = Math.min(...checkpoints);
3274
3279
  strokeColor = percent >= minCheckpoint ? "var(--color-green-500)" : "var(--color-red-500)";
3275
3280
  }
3276
- (0, import_react14.useEffect)(() => {
3281
+ (0, import_react15.useEffect)(() => {
3277
3282
  const inner = progressRef.current?.querySelector(".ant-progress-inner");
3278
3283
  if (!inner) return;
3279
3284
  const observer = new ResizeObserver(() => {
@@ -3330,24 +3335,24 @@ function ProgressBar({
3330
3335
 
3331
3336
  // src/KpiSection/KpiSection.tsx
3332
3337
  var import_antd18 = require("antd");
3333
- var import_react16 = require("react");
3338
+ var import_react17 = require("react");
3334
3339
 
3335
3340
  // src/KpiSection/hooks/useGetKpiSection.ts
3336
- var import_react15 = require("react");
3341
+ var import_react16 = require("react");
3337
3342
  var import_cuid = __toESM(require("cuid"));
3338
3343
  function useGetKpiSection() {
3339
- const [nameKpi, setNameKpi] = (0, import_react15.useState)("");
3340
- const [kpiValue, setKpiValue] = (0, import_react15.useState)("");
3341
- const [unitValue, setUnitValue] = (0, import_react15.useState)("");
3342
- const [kpiList, setKpiList] = (0, import_react15.useState)([]);
3343
- const [editingBackup, setEditingBackup] = (0, import_react15.useState)({});
3344
- const [selected, setSelected] = (0, import_react15.useState)("2");
3345
- const [errors, setErrors] = (0, import_react15.useState)({
3344
+ const [nameKpi, setNameKpi] = (0, import_react16.useState)("");
3345
+ const [kpiValue, setKpiValue] = (0, import_react16.useState)("");
3346
+ const [unitValue, setUnitValue] = (0, import_react16.useState)("");
3347
+ const [kpiList, setKpiList] = (0, import_react16.useState)([]);
3348
+ const [editingBackup, setEditingBackup] = (0, import_react16.useState)({});
3349
+ const [selected, setSelected] = (0, import_react16.useState)("2");
3350
+ const [errors, setErrors] = (0, import_react16.useState)({
3346
3351
  nameKpi: "",
3347
3352
  kpiValue: "",
3348
3353
  unitValue: ""
3349
3354
  });
3350
- const [itemErrors, setItemErrors] = (0, import_react15.useState)({});
3355
+ const [itemErrors, setItemErrors] = (0, import_react16.useState)({});
3351
3356
  const options = [
3352
3357
  { value: "1", label: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21" },
3353
3358
  { value: "2", label: "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02" }
@@ -3501,11 +3506,11 @@ function KpiSection({ type, onChangeKpiList }) {
3501
3506
  setItemErrors
3502
3507
  } = useGetKpiSection();
3503
3508
  const [messageApi2, messageContainer] = import_antd18.message.useMessage();
3504
- const [hasShownError, setHasShownError] = (0, import_react16.useState)(false);
3505
- (0, import_react16.useEffect)(() => {
3509
+ const [hasShownError, setHasShownError] = (0, import_react17.useState)(false);
3510
+ (0, import_react17.useEffect)(() => {
3506
3511
  setMessageApi(messageApi2);
3507
3512
  }, [messageApi2]);
3508
- (0, import_react16.useEffect)(() => {
3513
+ (0, import_react17.useEffect)(() => {
3509
3514
  if (onChangeKpiList) {
3510
3515
  onChangeKpiList(kpiList);
3511
3516
  }
@@ -3743,7 +3748,7 @@ function AntDModal({ children, isOpen, width, onCancel }) {
3743
3748
 
3744
3749
  // src/Indicator/Indicator/Indicator.tsx
3745
3750
  var import_icons_react12 = require("@tabler/icons-react");
3746
- var import_react17 = require("react");
3751
+ var import_react18 = require("react");
3747
3752
  var import_antd20 = require("antd");
3748
3753
  var import_jsx_runtime40 = require("react/jsx-runtime");
3749
3754
  function Indicator({
@@ -3757,24 +3762,24 @@ function Indicator({
3757
3762
  canEdit,
3758
3763
  onDeleteClick
3759
3764
  }) {
3760
- const [valueSwitch, setValueSwitch] = (0, import_react17.useState)("TEXT");
3761
- const [cacheData, setCacheData] = (0, import_react17.useState)({
3765
+ const [valueSwitch, setValueSwitch] = (0, import_react18.useState)("TEXT");
3766
+ const [cacheData, setCacheData] = (0, import_react18.useState)({
3762
3767
  indicatorType: type,
3763
3768
  inputType: valueSwitch,
3764
3769
  textValue: "",
3765
3770
  numberValue: 0,
3766
3771
  unit: ""
3767
3772
  });
3768
- const [cacheEditData, setCacheEditData] = (0, import_react17.useState)({
3773
+ const [cacheEditData, setCacheEditData] = (0, import_react18.useState)({
3769
3774
  indicatorType: type,
3770
3775
  inputType: valueSwitch,
3771
3776
  textValue: "",
3772
3777
  numberValue: 0,
3773
3778
  unit: ""
3774
3779
  });
3775
- const [editIndex, setEditIndex] = (0, import_react17.useState)(null);
3776
- const [addError, setAddError] = (0, import_react17.useState)({});
3777
- const [editError, setEditError] = (0, import_react17.useState)({});
3780
+ const [editIndex, setEditIndex] = (0, import_react18.useState)(null);
3781
+ const [addError, setAddError] = (0, import_react18.useState)({});
3782
+ const [editError, setEditError] = (0, import_react18.useState)({});
3778
3783
  const handleAddIndicator = () => {
3779
3784
  const nextErr = {};
3780
3785
  const textValue = (cacheData.textValue ?? "").trim();
@@ -4049,11 +4054,11 @@ function Indicator({
4049
4054
 
4050
4055
  // src/FilterPopUp/FilterPopUp.tsx
4051
4056
  var import_icons_react13 = require("@tabler/icons-react");
4052
- var import_react18 = require("react");
4057
+ var import_react19 = require("react");
4053
4058
  var import_jsx_runtime41 = require("react/jsx-runtime");
4054
4059
  var FilterPopUp = (filter) => {
4055
- const [isAction, setIsAction] = (0, import_react18.useState)(true);
4056
- const [filterArray, setFilterArray] = (0, import_react18.useState)([""]);
4060
+ const [isAction, setIsAction] = (0, import_react19.useState)(true);
4061
+ const [filterArray, setFilterArray] = (0, import_react19.useState)([""]);
4057
4062
  const handleClearFilter = () => {
4058
4063
  setFilterArray([]);
4059
4064
  };
@@ -4086,7 +4091,7 @@ var FilterPopUp = (filter) => {
4086
4091
  };
4087
4092
 
4088
4093
  // src/ProfileSelect/ProfileSelect/ProfileSelect.tsx
4089
- var import_react19 = require("react");
4094
+ var import_react20 = require("react");
4090
4095
  var import_icons_react14 = require("@tabler/icons-react");
4091
4096
  var import_antd21 = require("antd");
4092
4097
  var import_jsx_runtime42 = require("react/jsx-runtime");
@@ -4097,15 +4102,15 @@ function ProfileSelect({
4097
4102
  className,
4098
4103
  onUpdateAssignUser
4099
4104
  }) {
4100
- const [maxVisible, setMaxVisible] = (0, import_react19.useState)(4);
4101
- const [userNotAssign, setUserNotAssign] = (0, import_react19.useState)([]);
4102
- const [search, setSearch] = (0, import_react19.useState)("");
4103
- const [isShowSelect, setIsShowSelect] = (0, import_react19.useState)(false);
4104
- const containerRef = (0, import_react19.useRef)(null);
4105
- const selectRef = (0, import_react19.useRef)(null);
4105
+ const [maxVisible, setMaxVisible] = (0, import_react20.useState)(4);
4106
+ const [userNotAssign, setUserNotAssign] = (0, import_react20.useState)([]);
4107
+ const [search, setSearch] = (0, import_react20.useState)("");
4108
+ const [isShowSelect, setIsShowSelect] = (0, import_react20.useState)(false);
4109
+ const containerRef = (0, import_react20.useRef)(null);
4110
+ const selectRef = (0, import_react20.useRef)(null);
4106
4111
  const avatarSize = 30;
4107
4112
  const spacing = 8;
4108
- (0, import_react19.useEffect)(() => {
4113
+ (0, import_react20.useEffect)(() => {
4109
4114
  const handler = (e) => {
4110
4115
  if (!selectRef?.current?.contains(e.target) && !containerRef?.current?.contains(e.target)) {
4111
4116
  setIsShowSelect(false);
@@ -4116,7 +4121,7 @@ function ProfileSelect({
4116
4121
  document.removeEventListener("mousedown", handler);
4117
4122
  };
4118
4123
  }, []);
4119
- (0, import_react19.useEffect)(() => {
4124
+ (0, import_react20.useEffect)(() => {
4120
4125
  if (!containerRef.current) return;
4121
4126
  const updateWidth = () => {
4122
4127
  if (containerRef.current) {
@@ -4132,7 +4137,7 @@ function ProfileSelect({
4132
4137
  resizeObserver.disconnect();
4133
4138
  };
4134
4139
  }, [allUser]);
4135
- (0, import_react19.useEffect)(() => {
4140
+ (0, import_react20.useEffect)(() => {
4136
4141
  setUserNotAssign(
4137
4142
  allUser.filter((u) => !assignUser.some((au) => au.id === u.id))
4138
4143
  );
@@ -4320,7 +4325,7 @@ function ProfileSelect({
4320
4325
  }
4321
4326
 
4322
4327
  // src/Button/QRCode/QRCode.tsx
4323
- var import_react20 = require("react");
4328
+ var import_react21 = require("react");
4324
4329
  var import_qrcode = __toESM(require("qrcode"));
4325
4330
  var import_jsx_runtime43 = require("react/jsx-runtime");
4326
4331
  var QRCodeGenerator = ({
@@ -4329,9 +4334,9 @@ var QRCodeGenerator = ({
4329
4334
  defaultExportSize = 512,
4330
4335
  fileBaseName = "qr-code"
4331
4336
  }) => {
4332
- const canvasRef = (0, import_react20.useRef)(null);
4333
- const [format3, setFormat] = (0, import_react20.useState)("png");
4334
- const [exportSize, setExportSize] = (0, import_react20.useState)(defaultExportSize);
4337
+ const canvasRef = (0, import_react21.useRef)(null);
4338
+ const [format3, setFormat] = (0, import_react21.useState)("png");
4339
+ const [exportSize, setExportSize] = (0, import_react21.useState)(defaultExportSize);
4335
4340
  const sizeOption = [
4336
4341
  {
4337
4342
  label: "64 x 64",
@@ -4376,7 +4381,7 @@ var QRCodeGenerator = ({
4376
4381
  value: "jpeg"
4377
4382
  }
4378
4383
  ];
4379
- (0, import_react20.useEffect)(() => {
4384
+ (0, import_react21.useEffect)(() => {
4380
4385
  if (!canvasRef.current) return;
4381
4386
  import_qrcode.default.toCanvas(canvasRef.current, url, { width: previewSize, margin: 1 }, (error) => {
4382
4387
  if (error) console.error(error);
package/dist/index.mjs CHANGED
@@ -598,20 +598,23 @@ function SwitchSelect({
598
598
  }
599
599
 
600
600
  // src/NavBar/MenuNavBar/MenuNavBar.tsx
601
+ import { useState } from "react";
601
602
  import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
602
603
  function MenuNavBar({ menus, onClick }) {
604
+ const [activePath, setActivePath] = useState("");
603
605
  return /* @__PURE__ */ jsx12("div", { className: "w-full h-full p-[10px] bg-white", children: menus?.map((menu, index) => /* @__PURE__ */ jsxs9("div", { className: `p-[10px] ${index !== 0 ? "mt-[10px]" : ""}`, children: [
604
606
  /* @__PURE__ */ jsx12("p", { className: "p-[10px] w-[202px] h-[47px] subtitle-1", children: menu.title }),
605
607
  menu?.subMenus.map((subMenu) => /* @__PURE__ */ jsxs9(
606
608
  "div",
607
609
  {
608
- className: "group flex justify-center items-center gap-[10px] p-[10px] w-[202px] h-[47px] rounded-[6px] subtitle-2 cursor-pointer hover:bg-red-100 active:bg-primary-500 hover:text-white active:text-white",
609
- onClick: () => onClick(subMenu.path),
610
+ className: `group flex justify-center items-center gap-[10px] p-[10px] w-[202px] h-[47px] rounded-[6px] subtitle-2 cursor-pointer
611
+ ${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`,
612
+ onClick: () => {
613
+ onClick(subMenu.path);
614
+ setActivePath(subMenu.path);
615
+ },
610
616
  children: [
611
- /* @__PURE__ */ jsxs9("span", { className: "flex justify-center items-center w-[24px] h-[24px] text-[20px]", children: [
612
- subMenu.icon && /* @__PURE__ */ jsx12("span", { className: `block ${subMenu.iconActive ? "group-active:hidden" : ""}`, children: subMenu.icon }),
613
- subMenu.iconActive && /* @__PURE__ */ jsx12("span", { className: "hidden group-active:block", children: subMenu.iconActive })
614
- ] }),
617
+ /* @__PURE__ */ jsx12("span", { className: "flex justify-center items-center w-[24px] h-[24px] text-[20px]", children: activePath === subMenu.path ? subMenu.iconActive ?? subMenu.icon : subMenu.icon }),
615
618
  subMenu.title,
616
619
  /* @__PURE__ */ jsx12("span", { className: "flex ml-auto", children: subMenu.customNode && subMenu.customNode })
617
620
  ]
@@ -623,11 +626,11 @@ function MenuNavBar({ menus, onClick }) {
623
626
 
624
627
  // src/NavBar/MenuNavBar/Sidebar.tsx
625
628
  import { IconChevronLeftPipe, IconChevronRightPipe } from "@tabler/icons-react";
626
- import { createContext, useContext, useState } from "react";
629
+ import { createContext, useContext, useState as useState2 } from "react";
627
630
  import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
628
631
  var SidebarContext = createContext({ expanded: false });
629
632
  function Sidebar({ children, logo }) {
630
- const [expanded, setExpanded] = useState(true);
633
+ const [expanded, setExpanded] = useState2(true);
631
634
  return /* @__PURE__ */ jsx13("aside", { className: "h-screen", children: /* @__PURE__ */ jsxs10("nav", { className: `h-full flex flex-col bg-white border-r shadow-sm duration-150 ${expanded ? "w-64" : "w-16"}`, children: [
632
635
  /* @__PURE__ */ jsxs10("div", { className: "p-4 pb-2 flex justify-center items-center", children: [
633
636
  expanded && logo && /* @__PURE__ */ jsx13("img", { src: logo, width: 120, className: "ml-auto" }),
@@ -663,7 +666,7 @@ function TopNavBar({ onClickNoti, logo }) {
663
666
 
664
667
  // src/Table/DataTable/DataTable.tsx
665
668
  import { IconSelector, IconSortAscending, IconSortDescending } from "@tabler/icons-react";
666
- import { useState as useState2 } from "react";
669
+ import { useState as useState3 } from "react";
667
670
 
668
671
  // src/Table/Pagination/Pagination.tsx
669
672
  import { IconArrowLeft, IconArrowRight } from "@tabler/icons-react";
@@ -737,8 +740,8 @@ import { Fragment, jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
737
740
  function DataTable({ columns, data, onSort, isLoading }) {
738
741
  const cols = Math.max(1, columns.length);
739
742
  const gridClass = "grid [grid-template-columns:repeat(var(--cols),minmax(0,1fr))]";
740
- const [sortConfig, setSortConfig] = useState2(null);
741
- const [page, setPage] = useState2(1);
743
+ const [sortConfig, setSortConfig] = useState3(null);
744
+ const [page, setPage] = useState3(1);
742
745
  const onSorting = (config) => {
743
746
  if (config) {
744
747
  setSortConfig({ key: config?.key, direction: config?.direction });
@@ -794,7 +797,7 @@ function DataTable({ columns, data, onSort, isLoading }) {
794
797
 
795
798
  // src/Table/DataTable/AntDataTable.tsx
796
799
  import { ConfigProvider, Table } from "antd";
797
- import { useState as useState3 } from "react";
800
+ import { useState as useState4 } from "react";
798
801
  import { Fragment as Fragment2, jsx as jsx17 } from "react/jsx-runtime";
799
802
  function AntDataTable({
800
803
  dataSource,
@@ -809,7 +812,7 @@ function AntDataTable({
809
812
  height,
810
813
  pagination
811
814
  }) {
812
- const [selectedRowKeys, setSelectedRowKeys] = useState3([]);
815
+ const [selectedRowKeys, setSelectedRowKeys] = useState4([]);
813
816
  const rowSelection = {
814
817
  selectedRowKeys,
815
818
  onChange: (newSelectedRowKeys) => {
@@ -848,7 +851,7 @@ function AntDataTable({
848
851
  }
849
852
 
850
853
  // src/Calendar/Calendar/Calendar.tsx
851
- import { useEffect, useRef, useState as useState4 } from "react";
854
+ import { useEffect, useRef, useState as useState5 } from "react";
852
855
  import FullCalendar from "@fullcalendar/react";
853
856
  import dayGridPlugin from "@fullcalendar/daygrid";
854
857
  import timeGridPlugin from "@fullcalendar/timegrid";
@@ -858,9 +861,9 @@ import { IconChevronLeft, IconChevronRight, IconX } from "@tabler/icons-react";
858
861
  import { Fragment as Fragment3, jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
859
862
  function Calendar({ events }) {
860
863
  const calendarRef = useRef(null);
861
- const [monthTitle, setMonthTitle] = useState4("");
862
- const [openPopup, setOpenPopup] = useState4(false);
863
- const [selectedEvent, setSelectedEvent] = useState4(null);
864
+ const [monthTitle, setMonthTitle] = useState5("");
865
+ const [openPopup, setOpenPopup] = useState5(false);
866
+ const [selectedEvent, setSelectedEvent] = useState5(null);
864
867
  const updateTitle = () => {
865
868
  const calendarApi = calendarRef.current?.getApi();
866
869
  if (calendarApi) {
@@ -1003,7 +1006,7 @@ function EventPopUp({ event, onClose }) {
1003
1006
 
1004
1007
  // src/Input/TextInput/TextInput.tsx
1005
1008
  import { IconEye, IconEyeOff } from "@tabler/icons-react";
1006
- import { useState as useState5 } from "react";
1009
+ import { useState as useState6 } from "react";
1007
1010
  import { jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
1008
1011
  function TextInput({
1009
1012
  label,
@@ -1016,7 +1019,7 @@ function TextInput({
1016
1019
  onChange,
1017
1020
  disabled
1018
1021
  }) {
1019
- const [showPassword, setShowPassword] = useState5(false);
1022
+ const [showPassword, setShowPassword] = useState6(false);
1020
1023
  const onShowPassword = () => {
1021
1024
  setShowPassword(!showPassword);
1022
1025
  };
@@ -1231,7 +1234,7 @@ function InputFieldNumber({
1231
1234
  var import_dayjs = __toESM(require_dayjs_min());
1232
1235
  var import_th2 = __toESM(require_th());
1233
1236
  var import_buddhistEra = __toESM(require_buddhistEra());
1234
- import { useState as useState6, useRef as useRef2, useEffect as useEffect2 } from "react";
1237
+ import { useState as useState7, useRef as useRef2, useEffect as useEffect2 } from "react";
1235
1238
  import { format } from "date-fns";
1236
1239
  import { th as thFns } from "date-fns/locale";
1237
1240
  import { jsx as jsx23, jsxs as jsxs19 } from "react/jsx-runtime";
@@ -1250,7 +1253,7 @@ function DatePickerBasic({
1250
1253
  disabledDate,
1251
1254
  disablePast = false
1252
1255
  }) {
1253
- const [open, setOpen] = useState6(false);
1256
+ const [open, setOpen] = useState7(false);
1254
1257
  const wrapperRef = useRef2(null);
1255
1258
  const current = value ? (0, import_dayjs.default)(value) : null;
1256
1259
  const today = (0, import_dayjs.default)();
@@ -1273,7 +1276,7 @@ function DatePickerBasic({
1273
1276
  "\u0E1E\u0E24\u0E28\u0E08\u0E34\u0E01\u0E32\u0E22\u0E19",
1274
1277
  "\u0E18\u0E31\u0E19\u0E27\u0E32\u0E04\u0E21"
1275
1278
  ];
1276
- const [calendar, setCalendar] = useState6(current || today);
1279
+ const [calendar, setCalendar] = useState7(current || today);
1277
1280
  const daysInMonth = calendar.daysInMonth();
1278
1281
  const firstDayOfMonth = calendar.startOf("month").day();
1279
1282
  const isDisabled = (date) => {
@@ -1379,7 +1382,7 @@ function DatePickerBasic({
1379
1382
  var import_dayjs2 = __toESM(require_dayjs_min());
1380
1383
  var import_th3 = __toESM(require_th());
1381
1384
  var import_buddhistEra2 = __toESM(require_buddhistEra());
1382
- import { useState as useState7, useRef as useRef3, useEffect as useEffect3 } from "react";
1385
+ import { useState as useState8, useRef as useRef3, useEffect as useEffect3 } from "react";
1383
1386
  import { format as format2 } from "date-fns";
1384
1387
  import { th as thFns2 } from "date-fns/locale";
1385
1388
  import { jsx as jsx24, jsxs as jsxs20 } from "react/jsx-runtime";
@@ -1397,13 +1400,13 @@ function DatePickerRange({
1397
1400
  disabledDate,
1398
1401
  disablePast = false
1399
1402
  }) {
1400
- const [open, setOpen] = useState7(false);
1403
+ const [open, setOpen] = useState8(false);
1401
1404
  const wrapperRef = useRef3(null);
1402
1405
  const [startDate, endDate] = value;
1403
1406
  const startDayjs = startDate ? (0, import_dayjs2.default)(startDate) : null;
1404
1407
  const endDayjs = endDate ? (0, import_dayjs2.default)(endDate) : null;
1405
1408
  const today = (0, import_dayjs2.default)();
1406
- const [calendar, setCalendar] = useState7(startDayjs || today);
1409
+ const [calendar, setCalendar] = useState8(startDayjs || today);
1407
1410
  const formatThaiBE = (date) => {
1408
1411
  const formatted = format2(date, "dd MMM yy", { locale: thFns2 });
1409
1412
  const year = parseInt(format2(date, "yyyy")) + 543;
@@ -2667,7 +2670,7 @@ function SelectFieldStatusReport({
2667
2670
 
2668
2671
  // src/Select/SelectFieldTag/SelectFieldTag.tsx
2669
2672
  import { Select as Select5, ConfigProvider as ConfigProvider11 } from "antd";
2670
- import { useState as useState8 } from "react";
2673
+ import { useState as useState9 } from "react";
2671
2674
  import { jsx as jsx31, jsxs as jsxs27 } from "react/jsx-runtime";
2672
2675
  function SelectFieldTag({
2673
2676
  label,
@@ -2680,10 +2683,10 @@ function SelectFieldTag({
2680
2683
  onChange,
2681
2684
  onClear
2682
2685
  }) {
2683
- const [internalValue, setInternalValue] = useState8([]);
2686
+ const [internalValue, setInternalValue] = useState9([]);
2684
2687
  const isControlled = controlledValue !== void 0;
2685
2688
  const value = isControlled ? controlledValue : internalValue;
2686
- const [searchWord, setSearchWord] = useState8("");
2689
+ const [searchWord, setSearchWord] = useState9("");
2687
2690
  const handleChange = (val) => {
2688
2691
  const trimValue = val.map((v) => v.trim());
2689
2692
  const filtered = trimValue.filter((v) => v.trim() !== "");
@@ -2743,7 +2746,7 @@ function SelectFieldTag({
2743
2746
  // src/Select/SelectCustom/SelectCustom.tsx
2744
2747
  import { IconTrash } from "@tabler/icons-react";
2745
2748
  import { Select as Select6, ConfigProvider as ConfigProvider12 } from "antd";
2746
- import { useState as useState9 } from "react";
2749
+ import { useState as useState10 } from "react";
2747
2750
  import { jsx as jsx32, jsxs as jsxs28 } from "react/jsx-runtime";
2748
2751
  function SelectCustom({
2749
2752
  label = "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E42\u0E04\u0E23\u0E07\u0E01\u0E32\u0E23",
@@ -2754,8 +2757,8 @@ function SelectCustom({
2754
2757
  error,
2755
2758
  onClear
2756
2759
  }) {
2757
- const [value, setValue] = useState9([]);
2758
- const [valueList, setValueList] = useState9([]);
2760
+ const [value, setValue] = useState10([]);
2761
+ const [valueList, setValueList] = useState10([]);
2759
2762
  const handleChange = (selectedValues) => {
2760
2763
  const newValues = selectedValues.filter((v) => !valueList.includes(v));
2761
2764
  setValueList((prev) => {
@@ -2860,7 +2863,7 @@ var quarters = [
2860
2863
  ];
2861
2864
 
2862
2865
  // src/SortFilter/SortFilter.tsx
2863
- import { useState as useState10 } from "react";
2866
+ import { useState as useState11 } from "react";
2864
2867
  import { IconSortDescending as IconSortDescending2, IconFilter } from "@tabler/icons-react";
2865
2868
  import { jsx as jsx33, jsxs as jsxs29 } from "react/jsx-runtime";
2866
2869
  function SortFilter({
@@ -2870,9 +2873,9 @@ function SortFilter({
2870
2873
  onSortClick,
2871
2874
  onFilterClick
2872
2875
  }) {
2873
- const [yearValue, setYearValue] = useState10();
2874
- const [monthValue, setMonthValue] = useState10();
2875
- const [quarterValue, setQuartersValue] = useState10();
2876
+ const [yearValue, setYearValue] = useState11();
2877
+ const [monthValue, setMonthValue] = useState11();
2878
+ const [quarterValue, setQuartersValue] = useState11();
2876
2879
  return /* @__PURE__ */ jsx33(
2877
2880
  ConfigProvider13,
2878
2881
  {
@@ -2948,7 +2951,7 @@ function SortFilter({
2948
2951
 
2949
2952
  // src/Upload/FileUploader/FileUploader.tsx
2950
2953
  import { IconPaperclip, IconUpload, IconTrash as IconTrash2 } from "@tabler/icons-react";
2951
- import { useRef as useRef4, useState as useState11 } from "react";
2954
+ import { useRef as useRef4, useState as useState12 } from "react";
2952
2955
  import { Fragment as Fragment5, jsx as jsx34, jsxs as jsxs30 } from "react/jsx-runtime";
2953
2956
  function FileUploader({
2954
2957
  onUpload,
@@ -2960,11 +2963,12 @@ function FileUploader({
2960
2963
  mode = "drop",
2961
2964
  description,
2962
2965
  label,
2963
- value
2966
+ value,
2967
+ uploadText = "\u0E41\u0E19\u0E1A\u0E44\u0E1F\u0E25\u0E4C"
2964
2968
  }) {
2965
- const [internalFileList, setInternalFileList] = useState11([]);
2966
- const [uploading, setUploading] = useState11(false);
2967
- const [dragActive, setDragActive] = useState11(false);
2969
+ const [internalFileList, setInternalFileList] = useState12([]);
2970
+ const [uploading, setUploading] = useState12(false);
2971
+ const [dragActive, setDragActive] = useState12(false);
2968
2972
  const inputRef = useRef4(null);
2969
2973
  const filesToDisplay = value || internalFileList;
2970
2974
  const validateFile = (file) => {
@@ -3046,7 +3050,8 @@ function FileUploader({
3046
3050
  " \u0E01\u0E33\u0E25\u0E31\u0E07\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14"
3047
3051
  ] }) : /* @__PURE__ */ jsxs30(Fragment5, { children: [
3048
3052
  /* @__PURE__ */ jsx34(IconUpload, { size: 15, className: "text-gray-400" }),
3049
- " \u0E41\u0E19\u0E1A\u0E44\u0E1F\u0E25\u0E4C"
3053
+ " ",
3054
+ uploadText
3050
3055
  ] })
3051
3056
  }
3052
3057
  ) : /* @__PURE__ */ jsx34(
@@ -3189,7 +3194,7 @@ function HeadingPage({ Heading }) {
3189
3194
 
3190
3195
  // src/Progress/ProgressBar.tsx
3191
3196
  import { ConfigProvider as ConfigProvider16, Progress } from "antd";
3192
- import { useEffect as useEffect4, useRef as useRef5, useState as useState12 } from "react";
3197
+ import { useEffect as useEffect4, useRef as useRef5, useState as useState13 } from "react";
3193
3198
  import { jsx as jsx37, jsxs as jsxs32 } from "react/jsx-runtime";
3194
3199
  function ProgressBar({
3195
3200
  percent = 0,
@@ -3203,7 +3208,7 @@ function ProgressBar({
3203
3208
  steps,
3204
3209
  isCheckPoints
3205
3210
  }) {
3206
- const [barWidth, setBarWidth] = useState12(0);
3211
+ const [barWidth, setBarWidth] = useState13(0);
3207
3212
  const progressRef = useRef5(null);
3208
3213
  let strokeColor = "--color-green-500";
3209
3214
  const defaultStrokeWidth = type === "circle" ? 13 : strokeWidth ?? 8;
@@ -3269,24 +3274,24 @@ function ProgressBar({
3269
3274
 
3270
3275
  // src/KpiSection/KpiSection.tsx
3271
3276
  import { ConfigProvider as ConfigProvider17, message } from "antd";
3272
- import { useEffect as useEffect5, useState as useState14 } from "react";
3277
+ import { useEffect as useEffect5, useState as useState15 } from "react";
3273
3278
 
3274
3279
  // src/KpiSection/hooks/useGetKpiSection.ts
3275
- import { useState as useState13 } from "react";
3280
+ import { useState as useState14 } from "react";
3276
3281
  import cuid from "cuid";
3277
3282
  function useGetKpiSection() {
3278
- const [nameKpi, setNameKpi] = useState13("");
3279
- const [kpiValue, setKpiValue] = useState13("");
3280
- const [unitValue, setUnitValue] = useState13("");
3281
- const [kpiList, setKpiList] = useState13([]);
3282
- const [editingBackup, setEditingBackup] = useState13({});
3283
- const [selected, setSelected] = useState13("2");
3284
- const [errors, setErrors] = useState13({
3283
+ const [nameKpi, setNameKpi] = useState14("");
3284
+ const [kpiValue, setKpiValue] = useState14("");
3285
+ const [unitValue, setUnitValue] = useState14("");
3286
+ const [kpiList, setKpiList] = useState14([]);
3287
+ const [editingBackup, setEditingBackup] = useState14({});
3288
+ const [selected, setSelected] = useState14("2");
3289
+ const [errors, setErrors] = useState14({
3285
3290
  nameKpi: "",
3286
3291
  kpiValue: "",
3287
3292
  unitValue: ""
3288
3293
  });
3289
- const [itemErrors, setItemErrors] = useState13({});
3294
+ const [itemErrors, setItemErrors] = useState14({});
3290
3295
  const options = [
3291
3296
  { value: "1", label: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21" },
3292
3297
  { value: "2", label: "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02" }
@@ -3440,7 +3445,7 @@ function KpiSection({ type, onChangeKpiList }) {
3440
3445
  setItemErrors
3441
3446
  } = useGetKpiSection();
3442
3447
  const [messageApi2, messageContainer] = message.useMessage();
3443
- const [hasShownError, setHasShownError] = useState14(false);
3448
+ const [hasShownError, setHasShownError] = useState15(false);
3444
3449
  useEffect5(() => {
3445
3450
  setMessageApi(messageApi2);
3446
3451
  }, [messageApi2]);
@@ -3688,7 +3693,7 @@ import {
3688
3693
  IconTrash as IconTrash4,
3689
3694
  IconX as IconX3
3690
3695
  } from "@tabler/icons-react";
3691
- import { useState as useState15 } from "react";
3696
+ import { useState as useState16 } from "react";
3692
3697
  import { Input as Input4 } from "antd";
3693
3698
  import { Fragment as Fragment7, jsx as jsx40, jsxs as jsxs34 } from "react/jsx-runtime";
3694
3699
  function Indicator({
@@ -3702,24 +3707,24 @@ function Indicator({
3702
3707
  canEdit,
3703
3708
  onDeleteClick
3704
3709
  }) {
3705
- const [valueSwitch, setValueSwitch] = useState15("TEXT");
3706
- const [cacheData, setCacheData] = useState15({
3710
+ const [valueSwitch, setValueSwitch] = useState16("TEXT");
3711
+ const [cacheData, setCacheData] = useState16({
3707
3712
  indicatorType: type,
3708
3713
  inputType: valueSwitch,
3709
3714
  textValue: "",
3710
3715
  numberValue: 0,
3711
3716
  unit: ""
3712
3717
  });
3713
- const [cacheEditData, setCacheEditData] = useState15({
3718
+ const [cacheEditData, setCacheEditData] = useState16({
3714
3719
  indicatorType: type,
3715
3720
  inputType: valueSwitch,
3716
3721
  textValue: "",
3717
3722
  numberValue: 0,
3718
3723
  unit: ""
3719
3724
  });
3720
- const [editIndex, setEditIndex] = useState15(null);
3721
- const [addError, setAddError] = useState15({});
3722
- const [editError, setEditError] = useState15({});
3725
+ const [editIndex, setEditIndex] = useState16(null);
3726
+ const [addError, setAddError] = useState16({});
3727
+ const [editError, setEditError] = useState16({});
3723
3728
  const handleAddIndicator = () => {
3724
3729
  const nextErr = {};
3725
3730
  const textValue = (cacheData.textValue ?? "").trim();
@@ -3994,11 +3999,11 @@ function Indicator({
3994
3999
 
3995
4000
  // src/FilterPopUp/FilterPopUp.tsx
3996
4001
  import { IconCheck as IconCheck4, IconFilter as IconFilter2, IconTrash as IconTrash5 } from "@tabler/icons-react";
3997
- import { useState as useState16 } from "react";
4002
+ import { useState as useState17 } from "react";
3998
4003
  import { jsx as jsx41, jsxs as jsxs35 } from "react/jsx-runtime";
3999
4004
  var FilterPopUp = (filter) => {
4000
- const [isAction, setIsAction] = useState16(true);
4001
- const [filterArray, setFilterArray] = useState16([""]);
4005
+ const [isAction, setIsAction] = useState17(true);
4006
+ const [filterArray, setFilterArray] = useState17([""]);
4002
4007
  const handleClearFilter = () => {
4003
4008
  setFilterArray([]);
4004
4009
  };
@@ -4031,7 +4036,7 @@ var FilterPopUp = (filter) => {
4031
4036
  };
4032
4037
 
4033
4038
  // src/ProfileSelect/ProfileSelect/ProfileSelect.tsx
4034
- import { useEffect as useEffect7, useRef as useRef6, useState as useState17 } from "react";
4039
+ import { useEffect as useEffect7, useRef as useRef6, useState as useState18 } from "react";
4035
4040
  import { IconSearch, IconUsers, IconX as IconX4 } from "@tabler/icons-react";
4036
4041
  import { Input as Input5 } from "antd";
4037
4042
  import { Fragment as Fragment8, jsx as jsx42, jsxs as jsxs36 } from "react/jsx-runtime";
@@ -4042,10 +4047,10 @@ function ProfileSelect({
4042
4047
  className,
4043
4048
  onUpdateAssignUser
4044
4049
  }) {
4045
- const [maxVisible, setMaxVisible] = useState17(4);
4046
- const [userNotAssign, setUserNotAssign] = useState17([]);
4047
- const [search, setSearch] = useState17("");
4048
- const [isShowSelect, setIsShowSelect] = useState17(false);
4050
+ const [maxVisible, setMaxVisible] = useState18(4);
4051
+ const [userNotAssign, setUserNotAssign] = useState18([]);
4052
+ const [search, setSearch] = useState18("");
4053
+ const [isShowSelect, setIsShowSelect] = useState18(false);
4049
4054
  const containerRef = useRef6(null);
4050
4055
  const selectRef = useRef6(null);
4051
4056
  const avatarSize = 30;
@@ -4265,7 +4270,7 @@ function ProfileSelect({
4265
4270
  }
4266
4271
 
4267
4272
  // src/Button/QRCode/QRCode.tsx
4268
- import { useEffect as useEffect8, useRef as useRef7, useState as useState18 } from "react";
4273
+ import { useEffect as useEffect8, useRef as useRef7, useState as useState19 } from "react";
4269
4274
  import QRCode from "qrcode";
4270
4275
  import { jsx as jsx43, jsxs as jsxs37 } from "react/jsx-runtime";
4271
4276
  var QRCodeGenerator = ({
@@ -4275,8 +4280,8 @@ var QRCodeGenerator = ({
4275
4280
  fileBaseName = "qr-code"
4276
4281
  }) => {
4277
4282
  const canvasRef = useRef7(null);
4278
- const [format3, setFormat] = useState18("png");
4279
- const [exportSize, setExportSize] = useState18(defaultExportSize);
4283
+ const [format3, setFormat] = useState19("png");
4284
+ const [exportSize, setExportSize] = useState19(defaultExportSize);
4280
4285
  const sizeOption = [
4281
4286
  {
4282
4287
  label: "64 x 64",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esic-lab/data-core-ui",
3
- "version": "0.0.49",
3
+ "version": "0.0.50",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",