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

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);
@@ -2591,17 +2594,6 @@ function SelectFieldGroup({
2591
2594
 
2592
2595
  // src/Select/SelectFieldStatus/SelectFieldStatus.tsx
2593
2596
  var import_antd9 = require("antd");
2594
-
2595
- // src/Select/SelectFieldStatus/StatusMockup.ts
2596
- var status = [
2597
- { value: "1", label: "\u0E40\u0E1B\u0E34\u0E14", color: "var(--color-gray-500)" },
2598
- { value: "2", label: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E14\u0E33\u0E40\u0E19\u0E34\u0E19\u0E01\u0E32\u0E23", color: "var(--color-yellow-400)" },
2599
- { value: "3", label: "\u0E23\u0E2D\u0E15\u0E23\u0E27\u0E08\u0E2A\u0E2D\u0E1A", color: "var(--color-red-400)" },
2600
- { value: "4", label: "\u0E40\u0E2A\u0E23\u0E47\u0E08\u0E2A\u0E34\u0E49\u0E19", color: "var(--color-green-400)" },
2601
- { value: "5", label: "\u0E16\u0E39\u0E01\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01", color: "var(--color-gray-300)" }
2602
- ];
2603
-
2604
- // src/Select/SelectFieldStatus/SelectFieldStatus.tsx
2605
2597
  var import_icons = require("@ant-design/icons");
2606
2598
  var import_jsx_runtime29 = require("react/jsx-runtime");
2607
2599
  function SelectFieldStatus({
@@ -2615,7 +2607,7 @@ function SelectFieldStatus({
2615
2607
  options,
2616
2608
  className
2617
2609
  }) {
2618
- const selectedItem = status.find((s) => s.value === value);
2610
+ const selectedItem = options?.find((s) => s.value === value);
2619
2611
  return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2620
2612
  import_antd9.ConfigProvider,
2621
2613
  {
@@ -2663,7 +2655,7 @@ function SelectFieldStatus({
2663
2655
  var import_antd10 = require("antd");
2664
2656
 
2665
2657
  // src/Select/SelectFieldStatusReport/StatusReportMockup.ts
2666
- var status2 = [
2658
+ var status = [
2667
2659
  { value: "1", label: "\u0E40\u0E2A\u0E23\u0E47\u0E08\u0E2A\u0E34\u0E49\u0E19", color: "var(--color-green-400)" },
2668
2660
  { value: "2", label: "\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E40\u0E2A\u0E23\u0E47\u0E08\u0E2A\u0E34\u0E49\u0E19", color: "var(--color-red-500)" }
2669
2661
  ];
@@ -2682,7 +2674,7 @@ function SelectFieldStatusReport({
2682
2674
  className,
2683
2675
  options
2684
2676
  }) {
2685
- const selectedItem = status2.find((s) => s.value === value);
2677
+ const selectedItem = status.find((s) => s.value === value);
2686
2678
  return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2687
2679
  import_antd10.ConfigProvider,
2688
2680
  {
@@ -2728,7 +2720,7 @@ function SelectFieldStatusReport({
2728
2720
 
2729
2721
  // src/Select/SelectFieldTag/SelectFieldTag.tsx
2730
2722
  var import_antd11 = require("antd");
2731
- var import_react10 = require("react");
2723
+ var import_react11 = require("react");
2732
2724
  var import_jsx_runtime31 = require("react/jsx-runtime");
2733
2725
  function SelectFieldTag({
2734
2726
  label,
@@ -2741,10 +2733,10 @@ function SelectFieldTag({
2741
2733
  onChange,
2742
2734
  onClear
2743
2735
  }) {
2744
- const [internalValue, setInternalValue] = (0, import_react10.useState)([]);
2736
+ const [internalValue, setInternalValue] = (0, import_react11.useState)([]);
2745
2737
  const isControlled = controlledValue !== void 0;
2746
2738
  const value = isControlled ? controlledValue : internalValue;
2747
- const [searchWord, setSearchWord] = (0, import_react10.useState)("");
2739
+ const [searchWord, setSearchWord] = (0, import_react11.useState)("");
2748
2740
  const handleChange = (val) => {
2749
2741
  const trimValue = val.map((v) => v.trim());
2750
2742
  const filtered = trimValue.filter((v) => v.trim() !== "");
@@ -2804,7 +2796,7 @@ function SelectFieldTag({
2804
2796
  // src/Select/SelectCustom/SelectCustom.tsx
2805
2797
  var import_icons_react8 = require("@tabler/icons-react");
2806
2798
  var import_antd12 = require("antd");
2807
- var import_react11 = require("react");
2799
+ var import_react12 = require("react");
2808
2800
  var import_jsx_runtime32 = require("react/jsx-runtime");
2809
2801
  function SelectCustom({
2810
2802
  label = "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E42\u0E04\u0E23\u0E07\u0E01\u0E32\u0E23",
@@ -2815,8 +2807,8 @@ function SelectCustom({
2815
2807
  error,
2816
2808
  onClear
2817
2809
  }) {
2818
- const [value, setValue] = (0, import_react11.useState)([]);
2819
- const [valueList, setValueList] = (0, import_react11.useState)([]);
2810
+ const [value, setValue] = (0, import_react12.useState)([]);
2811
+ const [valueList, setValueList] = (0, import_react12.useState)([]);
2820
2812
  const handleChange = (selectedValues) => {
2821
2813
  const newValues = selectedValues.filter((v) => !valueList.includes(v));
2822
2814
  setValueList((prev) => {
@@ -2921,7 +2913,7 @@ var quarters = [
2921
2913
  ];
2922
2914
 
2923
2915
  // src/SortFilter/SortFilter.tsx
2924
- var import_react12 = require("react");
2916
+ var import_react13 = require("react");
2925
2917
  var import_icons_react9 = require("@tabler/icons-react");
2926
2918
  var import_jsx_runtime33 = require("react/jsx-runtime");
2927
2919
  function SortFilter({
@@ -2931,9 +2923,9 @@ function SortFilter({
2931
2923
  onSortClick,
2932
2924
  onFilterClick
2933
2925
  }) {
2934
- const [yearValue, setYearValue] = (0, import_react12.useState)();
2935
- const [monthValue, setMonthValue] = (0, import_react12.useState)();
2936
- const [quarterValue, setQuartersValue] = (0, import_react12.useState)();
2926
+ const [yearValue, setYearValue] = (0, import_react13.useState)();
2927
+ const [monthValue, setMonthValue] = (0, import_react13.useState)();
2928
+ const [quarterValue, setQuartersValue] = (0, import_react13.useState)();
2937
2929
  return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
2938
2930
  import_antd13.ConfigProvider,
2939
2931
  {
@@ -3009,7 +3001,7 @@ function SortFilter({
3009
3001
 
3010
3002
  // src/Upload/FileUploader/FileUploader.tsx
3011
3003
  var import_icons_react10 = require("@tabler/icons-react");
3012
- var import_react13 = require("react");
3004
+ var import_react14 = require("react");
3013
3005
  var import_jsx_runtime34 = require("react/jsx-runtime");
3014
3006
  function FileUploader({
3015
3007
  onUpload,
@@ -3021,12 +3013,13 @@ function FileUploader({
3021
3013
  mode = "drop",
3022
3014
  description,
3023
3015
  label,
3024
- value
3016
+ value,
3017
+ uploadText = "\u0E41\u0E19\u0E1A\u0E44\u0E1F\u0E25\u0E4C"
3025
3018
  }) {
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);
3019
+ const [internalFileList, setInternalFileList] = (0, import_react14.useState)([]);
3020
+ const [uploading, setUploading] = (0, import_react14.useState)(false);
3021
+ const [dragActive, setDragActive] = (0, import_react14.useState)(false);
3022
+ const inputRef = (0, import_react14.useRef)(null);
3030
3023
  const filesToDisplay = value || internalFileList;
3031
3024
  const validateFile = (file) => {
3032
3025
  if (accept && !accept.includes(file.type)) {
@@ -3107,7 +3100,8 @@ function FileUploader({
3107
3100
  " \u0E01\u0E33\u0E25\u0E31\u0E07\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14"
3108
3101
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
3109
3102
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_icons_react10.IconUpload, { size: 15, className: "text-gray-400" }),
3110
- " \u0E41\u0E19\u0E1A\u0E44\u0E1F\u0E25\u0E4C"
3103
+ " ",
3104
+ uploadText
3111
3105
  ] })
3112
3106
  }
3113
3107
  ) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
@@ -3250,7 +3244,7 @@ function HeadingPage({ Heading }) {
3250
3244
 
3251
3245
  // src/Progress/ProgressBar.tsx
3252
3246
  var import_antd17 = require("antd");
3253
- var import_react14 = require("react");
3247
+ var import_react15 = require("react");
3254
3248
  var import_jsx_runtime37 = require("react/jsx-runtime");
3255
3249
  function ProgressBar({
3256
3250
  percent = 0,
@@ -3264,8 +3258,8 @@ function ProgressBar({
3264
3258
  steps,
3265
3259
  isCheckPoints
3266
3260
  }) {
3267
- const [barWidth, setBarWidth] = (0, import_react14.useState)(0);
3268
- const progressRef = (0, import_react14.useRef)(null);
3261
+ const [barWidth, setBarWidth] = (0, import_react15.useState)(0);
3262
+ const progressRef = (0, import_react15.useRef)(null);
3269
3263
  let strokeColor = "--color-green-500";
3270
3264
  const defaultStrokeWidth = type === "circle" ? 13 : strokeWidth ?? 8;
3271
3265
  const defaultSize = type === "circle" ? 43 : size;
@@ -3273,7 +3267,7 @@ function ProgressBar({
3273
3267
  const minCheckpoint = Math.min(...checkpoints);
3274
3268
  strokeColor = percent >= minCheckpoint ? "var(--color-green-500)" : "var(--color-red-500)";
3275
3269
  }
3276
- (0, import_react14.useEffect)(() => {
3270
+ (0, import_react15.useEffect)(() => {
3277
3271
  const inner = progressRef.current?.querySelector(".ant-progress-inner");
3278
3272
  if (!inner) return;
3279
3273
  const observer = new ResizeObserver(() => {
@@ -3330,24 +3324,24 @@ function ProgressBar({
3330
3324
 
3331
3325
  // src/KpiSection/KpiSection.tsx
3332
3326
  var import_antd18 = require("antd");
3333
- var import_react16 = require("react");
3327
+ var import_react17 = require("react");
3334
3328
 
3335
3329
  // src/KpiSection/hooks/useGetKpiSection.ts
3336
- var import_react15 = require("react");
3330
+ var import_react16 = require("react");
3337
3331
  var import_cuid = __toESM(require("cuid"));
3338
3332
  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)({
3333
+ const [nameKpi, setNameKpi] = (0, import_react16.useState)("");
3334
+ const [kpiValue, setKpiValue] = (0, import_react16.useState)("");
3335
+ const [unitValue, setUnitValue] = (0, import_react16.useState)("");
3336
+ const [kpiList, setKpiList] = (0, import_react16.useState)([]);
3337
+ const [editingBackup, setEditingBackup] = (0, import_react16.useState)({});
3338
+ const [selected, setSelected] = (0, import_react16.useState)("2");
3339
+ const [errors, setErrors] = (0, import_react16.useState)({
3346
3340
  nameKpi: "",
3347
3341
  kpiValue: "",
3348
3342
  unitValue: ""
3349
3343
  });
3350
- const [itemErrors, setItemErrors] = (0, import_react15.useState)({});
3344
+ const [itemErrors, setItemErrors] = (0, import_react16.useState)({});
3351
3345
  const options = [
3352
3346
  { value: "1", label: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21" },
3353
3347
  { value: "2", label: "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02" }
@@ -3501,11 +3495,11 @@ function KpiSection({ type, onChangeKpiList }) {
3501
3495
  setItemErrors
3502
3496
  } = useGetKpiSection();
3503
3497
  const [messageApi2, messageContainer] = import_antd18.message.useMessage();
3504
- const [hasShownError, setHasShownError] = (0, import_react16.useState)(false);
3505
- (0, import_react16.useEffect)(() => {
3498
+ const [hasShownError, setHasShownError] = (0, import_react17.useState)(false);
3499
+ (0, import_react17.useEffect)(() => {
3506
3500
  setMessageApi(messageApi2);
3507
3501
  }, [messageApi2]);
3508
- (0, import_react16.useEffect)(() => {
3502
+ (0, import_react17.useEffect)(() => {
3509
3503
  if (onChangeKpiList) {
3510
3504
  onChangeKpiList(kpiList);
3511
3505
  }
@@ -3743,7 +3737,7 @@ function AntDModal({ children, isOpen, width, onCancel }) {
3743
3737
 
3744
3738
  // src/Indicator/Indicator/Indicator.tsx
3745
3739
  var import_icons_react12 = require("@tabler/icons-react");
3746
- var import_react17 = require("react");
3740
+ var import_react18 = require("react");
3747
3741
  var import_antd20 = require("antd");
3748
3742
  var import_jsx_runtime40 = require("react/jsx-runtime");
3749
3743
  function Indicator({
@@ -3757,24 +3751,24 @@ function Indicator({
3757
3751
  canEdit,
3758
3752
  onDeleteClick
3759
3753
  }) {
3760
- const [valueSwitch, setValueSwitch] = (0, import_react17.useState)("TEXT");
3761
- const [cacheData, setCacheData] = (0, import_react17.useState)({
3754
+ const [valueSwitch, setValueSwitch] = (0, import_react18.useState)("TEXT");
3755
+ const [cacheData, setCacheData] = (0, import_react18.useState)({
3762
3756
  indicatorType: type,
3763
3757
  inputType: valueSwitch,
3764
3758
  textValue: "",
3765
3759
  numberValue: 0,
3766
3760
  unit: ""
3767
3761
  });
3768
- const [cacheEditData, setCacheEditData] = (0, import_react17.useState)({
3762
+ const [cacheEditData, setCacheEditData] = (0, import_react18.useState)({
3769
3763
  indicatorType: type,
3770
3764
  inputType: valueSwitch,
3771
3765
  textValue: "",
3772
3766
  numberValue: 0,
3773
3767
  unit: ""
3774
3768
  });
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)({});
3769
+ const [editIndex, setEditIndex] = (0, import_react18.useState)(null);
3770
+ const [addError, setAddError] = (0, import_react18.useState)({});
3771
+ const [editError, setEditError] = (0, import_react18.useState)({});
3778
3772
  const handleAddIndicator = () => {
3779
3773
  const nextErr = {};
3780
3774
  const textValue = (cacheData.textValue ?? "").trim();
@@ -4049,11 +4043,11 @@ function Indicator({
4049
4043
 
4050
4044
  // src/FilterPopUp/FilterPopUp.tsx
4051
4045
  var import_icons_react13 = require("@tabler/icons-react");
4052
- var import_react18 = require("react");
4046
+ var import_react19 = require("react");
4053
4047
  var import_jsx_runtime41 = require("react/jsx-runtime");
4054
4048
  var FilterPopUp = (filter) => {
4055
- const [isAction, setIsAction] = (0, import_react18.useState)(true);
4056
- const [filterArray, setFilterArray] = (0, import_react18.useState)([""]);
4049
+ const [isAction, setIsAction] = (0, import_react19.useState)(true);
4050
+ const [filterArray, setFilterArray] = (0, import_react19.useState)([""]);
4057
4051
  const handleClearFilter = () => {
4058
4052
  setFilterArray([]);
4059
4053
  };
@@ -4086,7 +4080,7 @@ var FilterPopUp = (filter) => {
4086
4080
  };
4087
4081
 
4088
4082
  // src/ProfileSelect/ProfileSelect/ProfileSelect.tsx
4089
- var import_react19 = require("react");
4083
+ var import_react20 = require("react");
4090
4084
  var import_icons_react14 = require("@tabler/icons-react");
4091
4085
  var import_antd21 = require("antd");
4092
4086
  var import_jsx_runtime42 = require("react/jsx-runtime");
@@ -4097,15 +4091,15 @@ function ProfileSelect({
4097
4091
  className,
4098
4092
  onUpdateAssignUser
4099
4093
  }) {
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);
4094
+ const [maxVisible, setMaxVisible] = (0, import_react20.useState)(4);
4095
+ const [userNotAssign, setUserNotAssign] = (0, import_react20.useState)([]);
4096
+ const [search, setSearch] = (0, import_react20.useState)("");
4097
+ const [isShowSelect, setIsShowSelect] = (0, import_react20.useState)(false);
4098
+ const containerRef = (0, import_react20.useRef)(null);
4099
+ const selectRef = (0, import_react20.useRef)(null);
4106
4100
  const avatarSize = 30;
4107
4101
  const spacing = 8;
4108
- (0, import_react19.useEffect)(() => {
4102
+ (0, import_react20.useEffect)(() => {
4109
4103
  const handler = (e) => {
4110
4104
  if (!selectRef?.current?.contains(e.target) && !containerRef?.current?.contains(e.target)) {
4111
4105
  setIsShowSelect(false);
@@ -4116,7 +4110,7 @@ function ProfileSelect({
4116
4110
  document.removeEventListener("mousedown", handler);
4117
4111
  };
4118
4112
  }, []);
4119
- (0, import_react19.useEffect)(() => {
4113
+ (0, import_react20.useEffect)(() => {
4120
4114
  if (!containerRef.current) return;
4121
4115
  const updateWidth = () => {
4122
4116
  if (containerRef.current) {
@@ -4132,7 +4126,7 @@ function ProfileSelect({
4132
4126
  resizeObserver.disconnect();
4133
4127
  };
4134
4128
  }, [allUser]);
4135
- (0, import_react19.useEffect)(() => {
4129
+ (0, import_react20.useEffect)(() => {
4136
4130
  setUserNotAssign(
4137
4131
  allUser.filter((u) => !assignUser.some((au) => au.id === u.id))
4138
4132
  );
@@ -4320,7 +4314,7 @@ function ProfileSelect({
4320
4314
  }
4321
4315
 
4322
4316
  // src/Button/QRCode/QRCode.tsx
4323
- var import_react20 = require("react");
4317
+ var import_react21 = require("react");
4324
4318
  var import_qrcode = __toESM(require("qrcode"));
4325
4319
  var import_jsx_runtime43 = require("react/jsx-runtime");
4326
4320
  var QRCodeGenerator = ({
@@ -4329,9 +4323,9 @@ var QRCodeGenerator = ({
4329
4323
  defaultExportSize = 512,
4330
4324
  fileBaseName = "qr-code"
4331
4325
  }) => {
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);
4326
+ const canvasRef = (0, import_react21.useRef)(null);
4327
+ const [format3, setFormat] = (0, import_react21.useState)("png");
4328
+ const [exportSize, setExportSize] = (0, import_react21.useState)(defaultExportSize);
4335
4329
  const sizeOption = [
4336
4330
  {
4337
4331
  label: "64 x 64",
@@ -4376,7 +4370,7 @@ var QRCodeGenerator = ({
4376
4370
  value: "jpeg"
4377
4371
  }
4378
4372
  ];
4379
- (0, import_react20.useEffect)(() => {
4373
+ (0, import_react21.useEffect)(() => {
4380
4374
  if (!canvasRef.current) return;
4381
4375
  import_qrcode.default.toCanvas(canvasRef.current, url, { width: previewSize, margin: 1 }, (error) => {
4382
4376
  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;
@@ -2530,17 +2533,6 @@ function SelectFieldGroup({
2530
2533
 
2531
2534
  // src/Select/SelectFieldStatus/SelectFieldStatus.tsx
2532
2535
  import { Select as Select3, ConfigProvider as ConfigProvider9 } from "antd";
2533
-
2534
- // src/Select/SelectFieldStatus/StatusMockup.ts
2535
- var status = [
2536
- { value: "1", label: "\u0E40\u0E1B\u0E34\u0E14", color: "var(--color-gray-500)" },
2537
- { value: "2", label: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E14\u0E33\u0E40\u0E19\u0E34\u0E19\u0E01\u0E32\u0E23", color: "var(--color-yellow-400)" },
2538
- { value: "3", label: "\u0E23\u0E2D\u0E15\u0E23\u0E27\u0E08\u0E2A\u0E2D\u0E1A", color: "var(--color-red-400)" },
2539
- { value: "4", label: "\u0E40\u0E2A\u0E23\u0E47\u0E08\u0E2A\u0E34\u0E49\u0E19", color: "var(--color-green-400)" },
2540
- { value: "5", label: "\u0E16\u0E39\u0E01\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01", color: "var(--color-gray-300)" }
2541
- ];
2542
-
2543
- // src/Select/SelectFieldStatus/SelectFieldStatus.tsx
2544
2536
  import { DownOutlined } from "@ant-design/icons";
2545
2537
  import { jsx as jsx29, jsxs as jsxs25 } from "react/jsx-runtime";
2546
2538
  function SelectFieldStatus({
@@ -2554,7 +2546,7 @@ function SelectFieldStatus({
2554
2546
  options,
2555
2547
  className
2556
2548
  }) {
2557
- const selectedItem = status.find((s) => s.value === value);
2549
+ const selectedItem = options?.find((s) => s.value === value);
2558
2550
  return /* @__PURE__ */ jsx29(
2559
2551
  ConfigProvider9,
2560
2552
  {
@@ -2602,7 +2594,7 @@ function SelectFieldStatus({
2602
2594
  import { Select as Select4, ConfigProvider as ConfigProvider10 } from "antd";
2603
2595
 
2604
2596
  // src/Select/SelectFieldStatusReport/StatusReportMockup.ts
2605
- var status2 = [
2597
+ var status = [
2606
2598
  { value: "1", label: "\u0E40\u0E2A\u0E23\u0E47\u0E08\u0E2A\u0E34\u0E49\u0E19", color: "var(--color-green-400)" },
2607
2599
  { value: "2", label: "\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E40\u0E2A\u0E23\u0E47\u0E08\u0E2A\u0E34\u0E49\u0E19", color: "var(--color-red-500)" }
2608
2600
  ];
@@ -2621,7 +2613,7 @@ function SelectFieldStatusReport({
2621
2613
  className,
2622
2614
  options
2623
2615
  }) {
2624
- const selectedItem = status2.find((s) => s.value === value);
2616
+ const selectedItem = status.find((s) => s.value === value);
2625
2617
  return /* @__PURE__ */ jsx30(
2626
2618
  ConfigProvider10,
2627
2619
  {
@@ -2667,7 +2659,7 @@ function SelectFieldStatusReport({
2667
2659
 
2668
2660
  // src/Select/SelectFieldTag/SelectFieldTag.tsx
2669
2661
  import { Select as Select5, ConfigProvider as ConfigProvider11 } from "antd";
2670
- import { useState as useState8 } from "react";
2662
+ import { useState as useState9 } from "react";
2671
2663
  import { jsx as jsx31, jsxs as jsxs27 } from "react/jsx-runtime";
2672
2664
  function SelectFieldTag({
2673
2665
  label,
@@ -2680,10 +2672,10 @@ function SelectFieldTag({
2680
2672
  onChange,
2681
2673
  onClear
2682
2674
  }) {
2683
- const [internalValue, setInternalValue] = useState8([]);
2675
+ const [internalValue, setInternalValue] = useState9([]);
2684
2676
  const isControlled = controlledValue !== void 0;
2685
2677
  const value = isControlled ? controlledValue : internalValue;
2686
- const [searchWord, setSearchWord] = useState8("");
2678
+ const [searchWord, setSearchWord] = useState9("");
2687
2679
  const handleChange = (val) => {
2688
2680
  const trimValue = val.map((v) => v.trim());
2689
2681
  const filtered = trimValue.filter((v) => v.trim() !== "");
@@ -2743,7 +2735,7 @@ function SelectFieldTag({
2743
2735
  // src/Select/SelectCustom/SelectCustom.tsx
2744
2736
  import { IconTrash } from "@tabler/icons-react";
2745
2737
  import { Select as Select6, ConfigProvider as ConfigProvider12 } from "antd";
2746
- import { useState as useState9 } from "react";
2738
+ import { useState as useState10 } from "react";
2747
2739
  import { jsx as jsx32, jsxs as jsxs28 } from "react/jsx-runtime";
2748
2740
  function SelectCustom({
2749
2741
  label = "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E42\u0E04\u0E23\u0E07\u0E01\u0E32\u0E23",
@@ -2754,8 +2746,8 @@ function SelectCustom({
2754
2746
  error,
2755
2747
  onClear
2756
2748
  }) {
2757
- const [value, setValue] = useState9([]);
2758
- const [valueList, setValueList] = useState9([]);
2749
+ const [value, setValue] = useState10([]);
2750
+ const [valueList, setValueList] = useState10([]);
2759
2751
  const handleChange = (selectedValues) => {
2760
2752
  const newValues = selectedValues.filter((v) => !valueList.includes(v));
2761
2753
  setValueList((prev) => {
@@ -2860,7 +2852,7 @@ var quarters = [
2860
2852
  ];
2861
2853
 
2862
2854
  // src/SortFilter/SortFilter.tsx
2863
- import { useState as useState10 } from "react";
2855
+ import { useState as useState11 } from "react";
2864
2856
  import { IconSortDescending as IconSortDescending2, IconFilter } from "@tabler/icons-react";
2865
2857
  import { jsx as jsx33, jsxs as jsxs29 } from "react/jsx-runtime";
2866
2858
  function SortFilter({
@@ -2870,9 +2862,9 @@ function SortFilter({
2870
2862
  onSortClick,
2871
2863
  onFilterClick
2872
2864
  }) {
2873
- const [yearValue, setYearValue] = useState10();
2874
- const [monthValue, setMonthValue] = useState10();
2875
- const [quarterValue, setQuartersValue] = useState10();
2865
+ const [yearValue, setYearValue] = useState11();
2866
+ const [monthValue, setMonthValue] = useState11();
2867
+ const [quarterValue, setQuartersValue] = useState11();
2876
2868
  return /* @__PURE__ */ jsx33(
2877
2869
  ConfigProvider13,
2878
2870
  {
@@ -2948,7 +2940,7 @@ function SortFilter({
2948
2940
 
2949
2941
  // src/Upload/FileUploader/FileUploader.tsx
2950
2942
  import { IconPaperclip, IconUpload, IconTrash as IconTrash2 } from "@tabler/icons-react";
2951
- import { useRef as useRef4, useState as useState11 } from "react";
2943
+ import { useRef as useRef4, useState as useState12 } from "react";
2952
2944
  import { Fragment as Fragment5, jsx as jsx34, jsxs as jsxs30 } from "react/jsx-runtime";
2953
2945
  function FileUploader({
2954
2946
  onUpload,
@@ -2960,11 +2952,12 @@ function FileUploader({
2960
2952
  mode = "drop",
2961
2953
  description,
2962
2954
  label,
2963
- value
2955
+ value,
2956
+ uploadText = "\u0E41\u0E19\u0E1A\u0E44\u0E1F\u0E25\u0E4C"
2964
2957
  }) {
2965
- const [internalFileList, setInternalFileList] = useState11([]);
2966
- const [uploading, setUploading] = useState11(false);
2967
- const [dragActive, setDragActive] = useState11(false);
2958
+ const [internalFileList, setInternalFileList] = useState12([]);
2959
+ const [uploading, setUploading] = useState12(false);
2960
+ const [dragActive, setDragActive] = useState12(false);
2968
2961
  const inputRef = useRef4(null);
2969
2962
  const filesToDisplay = value || internalFileList;
2970
2963
  const validateFile = (file) => {
@@ -3046,7 +3039,8 @@ function FileUploader({
3046
3039
  " \u0E01\u0E33\u0E25\u0E31\u0E07\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14"
3047
3040
  ] }) : /* @__PURE__ */ jsxs30(Fragment5, { children: [
3048
3041
  /* @__PURE__ */ jsx34(IconUpload, { size: 15, className: "text-gray-400" }),
3049
- " \u0E41\u0E19\u0E1A\u0E44\u0E1F\u0E25\u0E4C"
3042
+ " ",
3043
+ uploadText
3050
3044
  ] })
3051
3045
  }
3052
3046
  ) : /* @__PURE__ */ jsx34(
@@ -3189,7 +3183,7 @@ function HeadingPage({ Heading }) {
3189
3183
 
3190
3184
  // src/Progress/ProgressBar.tsx
3191
3185
  import { ConfigProvider as ConfigProvider16, Progress } from "antd";
3192
- import { useEffect as useEffect4, useRef as useRef5, useState as useState12 } from "react";
3186
+ import { useEffect as useEffect4, useRef as useRef5, useState as useState13 } from "react";
3193
3187
  import { jsx as jsx37, jsxs as jsxs32 } from "react/jsx-runtime";
3194
3188
  function ProgressBar({
3195
3189
  percent = 0,
@@ -3203,7 +3197,7 @@ function ProgressBar({
3203
3197
  steps,
3204
3198
  isCheckPoints
3205
3199
  }) {
3206
- const [barWidth, setBarWidth] = useState12(0);
3200
+ const [barWidth, setBarWidth] = useState13(0);
3207
3201
  const progressRef = useRef5(null);
3208
3202
  let strokeColor = "--color-green-500";
3209
3203
  const defaultStrokeWidth = type === "circle" ? 13 : strokeWidth ?? 8;
@@ -3269,24 +3263,24 @@ function ProgressBar({
3269
3263
 
3270
3264
  // src/KpiSection/KpiSection.tsx
3271
3265
  import { ConfigProvider as ConfigProvider17, message } from "antd";
3272
- import { useEffect as useEffect5, useState as useState14 } from "react";
3266
+ import { useEffect as useEffect5, useState as useState15 } from "react";
3273
3267
 
3274
3268
  // src/KpiSection/hooks/useGetKpiSection.ts
3275
- import { useState as useState13 } from "react";
3269
+ import { useState as useState14 } from "react";
3276
3270
  import cuid from "cuid";
3277
3271
  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({
3272
+ const [nameKpi, setNameKpi] = useState14("");
3273
+ const [kpiValue, setKpiValue] = useState14("");
3274
+ const [unitValue, setUnitValue] = useState14("");
3275
+ const [kpiList, setKpiList] = useState14([]);
3276
+ const [editingBackup, setEditingBackup] = useState14({});
3277
+ const [selected, setSelected] = useState14("2");
3278
+ const [errors, setErrors] = useState14({
3285
3279
  nameKpi: "",
3286
3280
  kpiValue: "",
3287
3281
  unitValue: ""
3288
3282
  });
3289
- const [itemErrors, setItemErrors] = useState13({});
3283
+ const [itemErrors, setItemErrors] = useState14({});
3290
3284
  const options = [
3291
3285
  { value: "1", label: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21" },
3292
3286
  { value: "2", label: "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02" }
@@ -3440,7 +3434,7 @@ function KpiSection({ type, onChangeKpiList }) {
3440
3434
  setItemErrors
3441
3435
  } = useGetKpiSection();
3442
3436
  const [messageApi2, messageContainer] = message.useMessage();
3443
- const [hasShownError, setHasShownError] = useState14(false);
3437
+ const [hasShownError, setHasShownError] = useState15(false);
3444
3438
  useEffect5(() => {
3445
3439
  setMessageApi(messageApi2);
3446
3440
  }, [messageApi2]);
@@ -3688,7 +3682,7 @@ import {
3688
3682
  IconTrash as IconTrash4,
3689
3683
  IconX as IconX3
3690
3684
  } from "@tabler/icons-react";
3691
- import { useState as useState15 } from "react";
3685
+ import { useState as useState16 } from "react";
3692
3686
  import { Input as Input4 } from "antd";
3693
3687
  import { Fragment as Fragment7, jsx as jsx40, jsxs as jsxs34 } from "react/jsx-runtime";
3694
3688
  function Indicator({
@@ -3702,24 +3696,24 @@ function Indicator({
3702
3696
  canEdit,
3703
3697
  onDeleteClick
3704
3698
  }) {
3705
- const [valueSwitch, setValueSwitch] = useState15("TEXT");
3706
- const [cacheData, setCacheData] = useState15({
3699
+ const [valueSwitch, setValueSwitch] = useState16("TEXT");
3700
+ const [cacheData, setCacheData] = useState16({
3707
3701
  indicatorType: type,
3708
3702
  inputType: valueSwitch,
3709
3703
  textValue: "",
3710
3704
  numberValue: 0,
3711
3705
  unit: ""
3712
3706
  });
3713
- const [cacheEditData, setCacheEditData] = useState15({
3707
+ const [cacheEditData, setCacheEditData] = useState16({
3714
3708
  indicatorType: type,
3715
3709
  inputType: valueSwitch,
3716
3710
  textValue: "",
3717
3711
  numberValue: 0,
3718
3712
  unit: ""
3719
3713
  });
3720
- const [editIndex, setEditIndex] = useState15(null);
3721
- const [addError, setAddError] = useState15({});
3722
- const [editError, setEditError] = useState15({});
3714
+ const [editIndex, setEditIndex] = useState16(null);
3715
+ const [addError, setAddError] = useState16({});
3716
+ const [editError, setEditError] = useState16({});
3723
3717
  const handleAddIndicator = () => {
3724
3718
  const nextErr = {};
3725
3719
  const textValue = (cacheData.textValue ?? "").trim();
@@ -3994,11 +3988,11 @@ function Indicator({
3994
3988
 
3995
3989
  // src/FilterPopUp/FilterPopUp.tsx
3996
3990
  import { IconCheck as IconCheck4, IconFilter as IconFilter2, IconTrash as IconTrash5 } from "@tabler/icons-react";
3997
- import { useState as useState16 } from "react";
3991
+ import { useState as useState17 } from "react";
3998
3992
  import { jsx as jsx41, jsxs as jsxs35 } from "react/jsx-runtime";
3999
3993
  var FilterPopUp = (filter) => {
4000
- const [isAction, setIsAction] = useState16(true);
4001
- const [filterArray, setFilterArray] = useState16([""]);
3994
+ const [isAction, setIsAction] = useState17(true);
3995
+ const [filterArray, setFilterArray] = useState17([""]);
4002
3996
  const handleClearFilter = () => {
4003
3997
  setFilterArray([]);
4004
3998
  };
@@ -4031,7 +4025,7 @@ var FilterPopUp = (filter) => {
4031
4025
  };
4032
4026
 
4033
4027
  // src/ProfileSelect/ProfileSelect/ProfileSelect.tsx
4034
- import { useEffect as useEffect7, useRef as useRef6, useState as useState17 } from "react";
4028
+ import { useEffect as useEffect7, useRef as useRef6, useState as useState18 } from "react";
4035
4029
  import { IconSearch, IconUsers, IconX as IconX4 } from "@tabler/icons-react";
4036
4030
  import { Input as Input5 } from "antd";
4037
4031
  import { Fragment as Fragment8, jsx as jsx42, jsxs as jsxs36 } from "react/jsx-runtime";
@@ -4042,10 +4036,10 @@ function ProfileSelect({
4042
4036
  className,
4043
4037
  onUpdateAssignUser
4044
4038
  }) {
4045
- const [maxVisible, setMaxVisible] = useState17(4);
4046
- const [userNotAssign, setUserNotAssign] = useState17([]);
4047
- const [search, setSearch] = useState17("");
4048
- const [isShowSelect, setIsShowSelect] = useState17(false);
4039
+ const [maxVisible, setMaxVisible] = useState18(4);
4040
+ const [userNotAssign, setUserNotAssign] = useState18([]);
4041
+ const [search, setSearch] = useState18("");
4042
+ const [isShowSelect, setIsShowSelect] = useState18(false);
4049
4043
  const containerRef = useRef6(null);
4050
4044
  const selectRef = useRef6(null);
4051
4045
  const avatarSize = 30;
@@ -4265,7 +4259,7 @@ function ProfileSelect({
4265
4259
  }
4266
4260
 
4267
4261
  // src/Button/QRCode/QRCode.tsx
4268
- import { useEffect as useEffect8, useRef as useRef7, useState as useState18 } from "react";
4262
+ import { useEffect as useEffect8, useRef as useRef7, useState as useState19 } from "react";
4269
4263
  import QRCode from "qrcode";
4270
4264
  import { jsx as jsx43, jsxs as jsxs37 } from "react/jsx-runtime";
4271
4265
  var QRCodeGenerator = ({
@@ -4275,8 +4269,8 @@ var QRCodeGenerator = ({
4275
4269
  fileBaseName = "qr-code"
4276
4270
  }) => {
4277
4271
  const canvasRef = useRef7(null);
4278
- const [format3, setFormat] = useState18("png");
4279
- const [exportSize, setExportSize] = useState18(defaultExportSize);
4272
+ const [format3, setFormat] = useState19("png");
4273
+ const [exportSize, setExportSize] = useState19(defaultExportSize);
4280
4274
  const sizeOption = [
4281
4275
  {
4282
4276
  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.51",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",