@esic-lab/data-core-ui 0.0.40 → 0.0.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1231,83 +1231,119 @@ function InputFieldNumber({
1231
1231
  var import_dayjs = __toESM(require_dayjs_min());
1232
1232
  var import_th2 = __toESM(require_th());
1233
1233
  var import_buddhistEra = __toESM(require_buddhistEra());
1234
- import { ConfigProvider as ConfigProvider5, DatePicker } from "antd";
1235
- import th from "antd/es/date-picker/locale/th_TH";
1236
- import { th as thFns } from "date-fns/locale";
1234
+ import { useState as useState6 } from "react";
1237
1235
  import { format } from "date-fns";
1236
+ import { th as thFns } from "date-fns/locale";
1238
1237
  import { jsx as jsx23, jsxs as jsxs19 } from "react/jsx-runtime";
1239
1238
  import_dayjs.default.extend(import_buddhistEra.default);
1239
+ import_dayjs.default.locale("th");
1240
1240
  function DatePickerBasic({
1241
1241
  value,
1242
1242
  onChange,
1243
- required,
1244
1243
  label,
1244
+ required,
1245
1245
  error,
1246
- placeholder = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48",
1247
1246
  disabled,
1248
- defaultValue,
1247
+ placeholder = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48",
1249
1248
  minDate,
1250
1249
  maxDate,
1251
- disabledDate,
1252
- className,
1253
- size
1250
+ disabledDate
1254
1251
  }) {
1255
- const dateFormat = "DD/MM/YYYY";
1256
- import_dayjs.default.locale("th_TH");
1257
- const buddhistLocale = {
1258
- ...th,
1259
- lang: {
1260
- ...th.lang,
1261
- fieldDateFormat: "BBBB-MM-DD",
1262
- fieldDateTimeFormat: "BBBB-MM-DD HH:mm:ss",
1263
- yearFormat: "BBBB",
1264
- cellYearFormat: "BBBB"
1265
- }
1252
+ const [open, setOpen] = useState6(false);
1253
+ const current = value ? (0, import_dayjs.default)(value) : null;
1254
+ const today = (0, import_dayjs.default)();
1255
+ const formatThaiBE = (date) => {
1256
+ const formatted = format(date, "dd MMMM yyyy", { locale: thFns });
1257
+ const year = parseInt(format(date, "yyyy")) + 543;
1258
+ return formatted.replace(/\d{4}$/, String(year));
1266
1259
  };
1267
- return /* @__PURE__ */ jsx23(
1268
- ConfigProvider5,
1269
- {
1270
- theme: {
1271
- token: {
1272
- fontFamily: "Kanit",
1273
- fontSize: 16
1274
- }
1275
- },
1276
- children: /* @__PURE__ */ jsxs19("div", { className: "container-input", children: [
1277
- /* @__PURE__ */ jsxs19("div", { children: [
1278
- /* @__PURE__ */ jsx23("span", { className: "body-1", children: label }),
1279
- " ",
1280
- required && /* @__PURE__ */ jsx23("span", { className: "text-red-500", children: "*" })
1281
- ] }),
1282
- /* @__PURE__ */ jsx23(
1283
- DatePicker,
1284
- {
1285
- className: `body-1 w-full ${className ?? ""}`,
1286
- value,
1287
- placeholder,
1288
- onChange,
1289
- allowClear: true,
1290
- disabled,
1291
- format: (date) => date ? format(date.toDate(), "dd/MM/yyyy", { locale: thFns }).replace(
1292
- /\d{4}$/,
1293
- (y) => String(parseInt(y) + 543)
1294
- ) : "",
1295
- defaultValue,
1296
- disabledDate: (d) => disabledDate ? disabledDate(d.toDate()) : false,
1297
- minDate: minDate ? (0, import_dayjs.default)(minDate) : void 0,
1298
- maxDate: maxDate ? (0, import_dayjs.default)(maxDate) : void 0,
1299
- size,
1300
- locale: buddhistLocale
1301
- }
1302
- ),
1303
- error && /* @__PURE__ */ jsx23("p", { className: "text-red-500 caption-1", children: error })
1304
- ] })
1305
- }
1306
- );
1260
+ const monthNames = [
1261
+ "\u0E21\u0E01\u0E23\u0E32\u0E04\u0E21",
1262
+ "\u0E01\u0E38\u0E21\u0E20\u0E32\u0E1E\u0E31\u0E19\u0E18\u0E4C",
1263
+ "\u0E21\u0E35\u0E19\u0E32\u0E04\u0E21",
1264
+ "\u0E40\u0E21\u0E29\u0E32\u0E22\u0E19",
1265
+ "\u0E1E\u0E24\u0E29\u0E20\u0E32\u0E04\u0E21",
1266
+ "\u0E21\u0E34\u0E16\u0E38\u0E19\u0E32\u0E22\u0E19",
1267
+ "\u0E01\u0E23\u0E01\u0E0E\u0E32\u0E04\u0E21",
1268
+ "\u0E2A\u0E34\u0E07\u0E2B\u0E32\u0E04\u0E21",
1269
+ "\u0E01\u0E31\u0E19\u0E22\u0E32\u0E22\u0E19",
1270
+ "\u0E15\u0E38\u0E25\u0E32\u0E04\u0E21",
1271
+ "\u0E1E\u0E24\u0E28\u0E08\u0E34\u0E01\u0E32\u0E22\u0E19",
1272
+ "\u0E18\u0E31\u0E19\u0E27\u0E32\u0E04\u0E21"
1273
+ ];
1274
+ const [calendar, setCalendar] = useState6(current || today);
1275
+ const daysInMonth = calendar.daysInMonth();
1276
+ const firstDayOfMonth = calendar.startOf("month").day();
1277
+ const isDisabled = (date) => {
1278
+ if (disabledDate && disabledDate(date.toDate())) return true;
1279
+ if (minDate && date.isBefore((0, import_dayjs.default)(minDate), "day")) return true;
1280
+ if (maxDate && date.isAfter((0, import_dayjs.default)(maxDate), "day")) return true;
1281
+ return false;
1282
+ };
1283
+ const handleSelect = (d) => {
1284
+ const selected = calendar.date(d);
1285
+ if (isDisabled(selected)) return;
1286
+ onChange(selected.toDate());
1287
+ setOpen(false);
1288
+ };
1289
+ return /* @__PURE__ */ jsxs19("div", { style: { fontFamily: "Kanit", fontSize: 16 }, className: "relative w-full", children: [
1290
+ /* @__PURE__ */ jsxs19("div", { className: "mb-1", children: [
1291
+ /* @__PURE__ */ jsx23("span", { className: "body-1", children: label }),
1292
+ required && /* @__PURE__ */ jsx23("span", { className: "text-red-500", children: "*" })
1293
+ ] }),
1294
+ /* @__PURE__ */ jsx23(
1295
+ "div",
1296
+ {
1297
+ className: `border rounded px-3 py-2 cursor-pointer bg-white ${disabled ? "opacity-50" : ""}`,
1298
+ onClick: () => !disabled && setOpen(!open),
1299
+ children: value ? formatThaiBE(value) : /* @__PURE__ */ jsx23("span", { className: "text-gray-400", children: placeholder })
1300
+ }
1301
+ ),
1302
+ open && /* @__PURE__ */ jsxs19(
1303
+ "div",
1304
+ {
1305
+ className: "absolute z-50 mt-2 w-80 p-4 bg-white shadow-xl rounded-lg border",
1306
+ style: { fontFamily: "Kanit", fontSize: 16 },
1307
+ children: [
1308
+ /* @__PURE__ */ jsxs19("div", { className: "flex justify-between items-center mb-3", children: [
1309
+ /* @__PURE__ */ jsx23("button", { onClick: () => setCalendar(calendar.subtract(1, "month")), className: "px-2", children: "\u25C0" }),
1310
+ /* @__PURE__ */ jsxs19("div", { className: "font-semibold", children: [
1311
+ monthNames[calendar.month()],
1312
+ " ",
1313
+ calendar.year() + 543
1314
+ ] }),
1315
+ /* @__PURE__ */ jsx23("button", { onClick: () => setCalendar(calendar.add(1, "month")), className: "px-2", children: "\u25B6" })
1316
+ ] }),
1317
+ /* @__PURE__ */ jsx23("div", { className: "grid grid-cols-7 text-center text-gray-600 mb-2", children: ["\u0E2D\u0E32", "\u0E08", "\u0E2D", "\u0E1E", "\u0E1E\u0E24", "\u0E28", "\u0E2A"].map((d) => /* @__PURE__ */ jsx23("div", { children: d }, d)) }),
1318
+ /* @__PURE__ */ jsxs19("div", { className: "grid grid-cols-7 gap-1 text-center", children: [
1319
+ Array(firstDayOfMonth).fill(null).map((_, i) => /* @__PURE__ */ jsx23("div", {}, `empty-${i}`)),
1320
+ Array.from({ length: daysInMonth }, (_, i) => i + 1).map((d) => {
1321
+ const dateObj = calendar.date(d);
1322
+ const disabled2 = isDisabled(dateObj);
1323
+ const selected = current && dateObj.isSame(current, "day");
1324
+ return /* @__PURE__ */ jsx23(
1325
+ "div",
1326
+ {
1327
+ onClick: () => !disabled2 && handleSelect(d),
1328
+ className: `py-1 rounded cursor-pointer
1329
+ ${selected ? "bg-blue-500 text-white" : ""}
1330
+ ${disabled2 ? "text-gray-400 cursor-not-allowed" : "hover:bg-blue-100"}
1331
+ `,
1332
+ children: d
1333
+ },
1334
+ d
1335
+ );
1336
+ })
1337
+ ] })
1338
+ ]
1339
+ }
1340
+ ),
1341
+ error && /* @__PURE__ */ jsx23("p", { className: "text-red-500 caption-1", children: error })
1342
+ ] });
1307
1343
  }
1308
1344
 
1309
1345
  // src/ColorPicker/ColorPickerBasic/ColorPicker.tsx
1310
- import { ConfigProvider as ConfigProvider6, ColorPicker } from "antd";
1346
+ import { ConfigProvider as ConfigProvider5, ColorPicker } from "antd";
1311
1347
  import { jsx as jsx24, jsxs as jsxs20 } from "react/jsx-runtime";
1312
1348
  function ColorPickerBasic({
1313
1349
  value,
@@ -1322,7 +1358,7 @@ function ColorPickerBasic({
1322
1358
  placeholder = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E2A\u0E35"
1323
1359
  }) {
1324
1360
  return /* @__PURE__ */ jsx24(
1325
- ConfigProvider6,
1361
+ ConfigProvider5,
1326
1362
  {
1327
1363
  theme: {
1328
1364
  token: {
@@ -1366,7 +1402,7 @@ function ColorPickerBasic({
1366
1402
  }
1367
1403
 
1368
1404
  // src/ColorPicker/ColorPalettePickerBasic/ColorPalettePickerBasic.tsx
1369
- import { ConfigProvider as ConfigProvider7, ColorPicker as ColorPicker2, theme } from "antd";
1405
+ import { ConfigProvider as ConfigProvider6, ColorPicker as ColorPicker2, theme } from "antd";
1370
1406
 
1371
1407
  // node_modules/@babel/runtime/helpers/esm/typeof.js
1372
1408
  function _typeof(o) {
@@ -2096,7 +2132,7 @@ function ColorPalettePickerBasic({
2096
2132
  green
2097
2133
  });
2098
2134
  return /* @__PURE__ */ jsx25(
2099
- ConfigProvider7,
2135
+ ConfigProvider6,
2100
2136
  {
2101
2137
  theme: {
2102
2138
  token: {
@@ -2142,7 +2178,7 @@ function ColorPalettePickerBasic({
2142
2178
  }
2143
2179
 
2144
2180
  // src/Select/SelectField/SelectField.tsx
2145
- import { Select, ConfigProvider as ConfigProvider8 } from "antd";
2181
+ import { Select, ConfigProvider as ConfigProvider7 } from "antd";
2146
2182
  import { jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
2147
2183
  function SelectField({
2148
2184
  value,
@@ -2162,7 +2198,7 @@ function SelectField({
2162
2198
  onClear
2163
2199
  }) {
2164
2200
  return /* @__PURE__ */ jsx26(
2165
- ConfigProvider8,
2201
+ ConfigProvider7,
2166
2202
  {
2167
2203
  theme: {
2168
2204
  token: {
@@ -2215,7 +2251,7 @@ function SelectField({
2215
2251
  }
2216
2252
 
2217
2253
  // src/Select/SelectFieldGroup/SelectFieldGroup.tsx
2218
- import { Select as Select2, ConfigProvider as ConfigProvider9 } from "antd";
2254
+ import { Select as Select2, ConfigProvider as ConfigProvider8 } from "antd";
2219
2255
  import { jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
2220
2256
  function SelectFieldGroup({
2221
2257
  value,
@@ -2234,7 +2270,7 @@ function SelectFieldGroup({
2234
2270
  className
2235
2271
  }) {
2236
2272
  return /* @__PURE__ */ jsx27(
2237
- ConfigProvider9,
2273
+ ConfigProvider8,
2238
2274
  {
2239
2275
  theme: {
2240
2276
  token: {
@@ -2285,7 +2321,7 @@ function SelectFieldGroup({
2285
2321
  }
2286
2322
 
2287
2323
  // src/Select/SelectFieldStatus/SelectFieldStatus.tsx
2288
- import { Select as Select3, ConfigProvider as ConfigProvider10 } from "antd";
2324
+ import { Select as Select3, ConfigProvider as ConfigProvider9 } from "antd";
2289
2325
 
2290
2326
  // src/Select/SelectFieldStatus/StatusMockup.ts
2291
2327
  var status = [
@@ -2312,7 +2348,7 @@ function SelectFieldStatus({
2312
2348
  }) {
2313
2349
  const selectedItem = status.find((s) => s.value === value);
2314
2350
  return /* @__PURE__ */ jsx28(
2315
- ConfigProvider10,
2351
+ ConfigProvider9,
2316
2352
  {
2317
2353
  theme: {
2318
2354
  components: {
@@ -2355,7 +2391,7 @@ function SelectFieldStatus({
2355
2391
  }
2356
2392
 
2357
2393
  // src/Select/SelectFieldStatusReport/SelectFieldStatusReport.tsx
2358
- import { Select as Select4, ConfigProvider as ConfigProvider11 } from "antd";
2394
+ import { Select as Select4, ConfigProvider as ConfigProvider10 } from "antd";
2359
2395
 
2360
2396
  // src/Select/SelectFieldStatusReport/StatusReportMockup.ts
2361
2397
  var status2 = [
@@ -2379,7 +2415,7 @@ function SelectFieldStatusReport({
2379
2415
  }) {
2380
2416
  const selectedItem = status2.find((s) => s.value === value);
2381
2417
  return /* @__PURE__ */ jsx29(
2382
- ConfigProvider11,
2418
+ ConfigProvider10,
2383
2419
  {
2384
2420
  theme: {
2385
2421
  components: {
@@ -2422,8 +2458,8 @@ function SelectFieldStatusReport({
2422
2458
  }
2423
2459
 
2424
2460
  // src/Select/SelectFieldTag/SelectFieldTag.tsx
2425
- import { Select as Select5, ConfigProvider as ConfigProvider12 } from "antd";
2426
- import { useState as useState6 } from "react";
2461
+ import { Select as Select5, ConfigProvider as ConfigProvider11 } from "antd";
2462
+ import { useState as useState7 } from "react";
2427
2463
  import { jsx as jsx30, jsxs as jsxs26 } from "react/jsx-runtime";
2428
2464
  function SelectFieldTag({
2429
2465
  label,
@@ -2436,10 +2472,10 @@ function SelectFieldTag({
2436
2472
  onChange,
2437
2473
  onClear
2438
2474
  }) {
2439
- const [internalValue, setInternalValue] = useState6([]);
2475
+ const [internalValue, setInternalValue] = useState7([]);
2440
2476
  const isControlled = controlledValue !== void 0;
2441
2477
  const value = isControlled ? controlledValue : internalValue;
2442
- const [searchWord, setSearchWord] = useState6("");
2478
+ const [searchWord, setSearchWord] = useState7("");
2443
2479
  const handleChange = (val) => {
2444
2480
  const trimValue = val.map((v) => v.trim());
2445
2481
  const filtered = trimValue.filter((v) => v.trim() !== "");
@@ -2458,7 +2494,7 @@ function SelectFieldTag({
2458
2494
  onChange?.([]);
2459
2495
  };
2460
2496
  return /* @__PURE__ */ jsx30(
2461
- ConfigProvider12,
2497
+ ConfigProvider11,
2462
2498
  {
2463
2499
  theme: {
2464
2500
  token: {
@@ -2498,8 +2534,8 @@ function SelectFieldTag({
2498
2534
 
2499
2535
  // src/Select/SelectCustom/SelectCustom.tsx
2500
2536
  import { IconTrash } from "@tabler/icons-react";
2501
- import { Select as Select6, ConfigProvider as ConfigProvider13 } from "antd";
2502
- import { useState as useState7 } from "react";
2537
+ import { Select as Select6, ConfigProvider as ConfigProvider12 } from "antd";
2538
+ import { useState as useState8 } from "react";
2503
2539
  import { jsx as jsx31, jsxs as jsxs27 } from "react/jsx-runtime";
2504
2540
  function SelectCustom({
2505
2541
  label = "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E42\u0E04\u0E23\u0E07\u0E01\u0E32\u0E23",
@@ -2510,8 +2546,8 @@ function SelectCustom({
2510
2546
  error,
2511
2547
  onClear
2512
2548
  }) {
2513
- const [value, setValue] = useState7([]);
2514
- const [valueList, setValueList] = useState7([]);
2549
+ const [value, setValue] = useState8([]);
2550
+ const [valueList, setValueList] = useState8([]);
2515
2551
  const handleChange = (selectedValues) => {
2516
2552
  const newValues = selectedValues.filter((v) => !valueList.includes(v));
2517
2553
  setValueList((prev) => {
@@ -2530,7 +2566,7 @@ function SelectCustom({
2530
2566
  };
2531
2567
  const filteredOptions = options.filter((opt) => !valueList.includes(opt.value)).map((opt) => ({ value: opt.value, label: opt.label }));
2532
2568
  return /* @__PURE__ */ jsx31(
2533
- ConfigProvider13,
2569
+ ConfigProvider12,
2534
2570
  {
2535
2571
  theme: {
2536
2572
  token: {
@@ -2572,7 +2608,7 @@ function SelectCustom({
2572
2608
  }
2573
2609
 
2574
2610
  // src/SortFilter/SortFilter.tsx
2575
- import { ConfigProvider as ConfigProvider14 } from "antd";
2611
+ import { ConfigProvider as ConfigProvider13 } from "antd";
2576
2612
  import { CalendarOutlined } from "@ant-design/icons";
2577
2613
 
2578
2614
  // src/SortFilter/DataMockSortFilter.ts
@@ -2603,7 +2639,7 @@ var quarters = [
2603
2639
  ];
2604
2640
 
2605
2641
  // src/SortFilter/SortFilter.tsx
2606
- import { useState as useState8 } from "react";
2642
+ import { useState as useState9 } from "react";
2607
2643
  import { IconSortDescending as IconSortDescending2, IconFilter } from "@tabler/icons-react";
2608
2644
  import { jsx as jsx32, jsxs as jsxs28 } from "react/jsx-runtime";
2609
2645
  function SortFilter({
@@ -2613,11 +2649,11 @@ function SortFilter({
2613
2649
  onSortClick,
2614
2650
  onFilterClick
2615
2651
  }) {
2616
- const [yearValue, setYearValue] = useState8();
2617
- const [monthValue, setMonthValue] = useState8();
2618
- const [quarterValue, setQuartersValue] = useState8();
2652
+ const [yearValue, setYearValue] = useState9();
2653
+ const [monthValue, setMonthValue] = useState9();
2654
+ const [quarterValue, setQuartersValue] = useState9();
2619
2655
  return /* @__PURE__ */ jsx32(
2620
- ConfigProvider14,
2656
+ ConfigProvider13,
2621
2657
  {
2622
2658
  theme: {
2623
2659
  token: {
@@ -2691,7 +2727,7 @@ function SortFilter({
2691
2727
 
2692
2728
  // src/Upload/FileUploader/FileUploader.tsx
2693
2729
  import { IconPaperclip, IconUpload, IconTrash as IconTrash2 } from "@tabler/icons-react";
2694
- import { useRef as useRef2, useState as useState9 } from "react";
2730
+ import { useRef as useRef2, useState as useState10 } from "react";
2695
2731
  import { Fragment as Fragment5, jsx as jsx33, jsxs as jsxs29 } from "react/jsx-runtime";
2696
2732
  function FileUploader({
2697
2733
  onUpload,
@@ -2704,9 +2740,9 @@ function FileUploader({
2704
2740
  description,
2705
2741
  label
2706
2742
  }) {
2707
- const [fileList, setFileList] = useState9([]);
2708
- const [uploading, setUploading] = useState9(false);
2709
- const [dragActive, setDragActive] = useState9(false);
2743
+ const [fileList, setFileList] = useState10([]);
2744
+ const [uploading, setUploading] = useState10(false);
2745
+ const [dragActive, setDragActive] = useState10(false);
2710
2746
  const inputRef = useRef2(null);
2711
2747
  const validateFile = (file) => {
2712
2748
  if (accept && !accept.includes(file.type)) {
@@ -2859,7 +2895,7 @@ function messageLoading(content, duration) {
2859
2895
  }
2860
2896
 
2861
2897
  // src/Breadcrumb/Breadcrumb.tsx
2862
- import { ConfigProvider as ConfigProvider15 } from "antd";
2898
+ import { ConfigProvider as ConfigProvider14 } from "antd";
2863
2899
  import { Breadcrumb } from "antd";
2864
2900
  import { jsx as jsx34 } from "react/jsx-runtime";
2865
2901
  function Breadcrumbs({
@@ -2870,7 +2906,7 @@ function Breadcrumbs({
2870
2906
  params
2871
2907
  }) {
2872
2908
  return /* @__PURE__ */ jsx34(
2873
- ConfigProvider15,
2909
+ ConfigProvider14,
2874
2910
  {
2875
2911
  theme: {
2876
2912
  token: {
@@ -2892,7 +2928,7 @@ function Breadcrumbs({
2892
2928
  }
2893
2929
 
2894
2930
  // src/HeadingPage/HeadingPage.tsx
2895
- import { ConfigProvider as ConfigProvider16 } from "antd";
2931
+ import { ConfigProvider as ConfigProvider15 } from "antd";
2896
2932
  import { jsx as jsx35, jsxs as jsxs30 } from "react/jsx-runtime";
2897
2933
  function HeadingPage({ Heading }) {
2898
2934
  const today = (/* @__PURE__ */ new Date()).toLocaleDateString("th-TH", {
@@ -2902,7 +2938,7 @@ function HeadingPage({ Heading }) {
2902
2938
  year: "numeric"
2903
2939
  });
2904
2940
  return /* @__PURE__ */ jsx35(
2905
- ConfigProvider16,
2941
+ ConfigProvider15,
2906
2942
  {
2907
2943
  theme: {
2908
2944
  token: {
@@ -2921,8 +2957,8 @@ function HeadingPage({ Heading }) {
2921
2957
  }
2922
2958
 
2923
2959
  // src/Progress/ProgressBar.tsx
2924
- import { ConfigProvider as ConfigProvider17, Progress } from "antd";
2925
- import { useEffect as useEffect2, useRef as useRef3, useState as useState10 } from "react";
2960
+ import { ConfigProvider as ConfigProvider16, Progress } from "antd";
2961
+ import { useEffect as useEffect2, useRef as useRef3, useState as useState11 } from "react";
2926
2962
  import { jsx as jsx36, jsxs as jsxs31 } from "react/jsx-runtime";
2927
2963
  function ProgressBar({
2928
2964
  percent = 0,
@@ -2936,7 +2972,7 @@ function ProgressBar({
2936
2972
  steps,
2937
2973
  isCheckPoints
2938
2974
  }) {
2939
- const [barWidth, setBarWidth] = useState10(0);
2975
+ const [barWidth, setBarWidth] = useState11(0);
2940
2976
  const progressRef = useRef3(null);
2941
2977
  let strokeColor = "--color-green-500";
2942
2978
  const defaultStrokeWidth = type === "circle" ? 13 : strokeWidth ?? 8;
@@ -2955,7 +2991,7 @@ function ProgressBar({
2955
2991
  return () => observer.disconnect();
2956
2992
  }, []);
2957
2993
  return /* @__PURE__ */ jsx36(
2958
- ConfigProvider17,
2994
+ ConfigProvider16,
2959
2995
  {
2960
2996
  theme: {
2961
2997
  token: {
@@ -3001,25 +3037,25 @@ function ProgressBar({
3001
3037
  }
3002
3038
 
3003
3039
  // src/KpiSection/KpiSection.tsx
3004
- import { ConfigProvider as ConfigProvider18, message } from "antd";
3005
- import { useEffect as useEffect3, useState as useState12 } from "react";
3040
+ import { ConfigProvider as ConfigProvider17, message } from "antd";
3041
+ import { useEffect as useEffect3, useState as useState13 } from "react";
3006
3042
 
3007
3043
  // src/KpiSection/hooks/useGetKpiSection.ts
3008
- import { useState as useState11 } from "react";
3044
+ import { useState as useState12 } from "react";
3009
3045
  import cuid from "cuid";
3010
3046
  function useGetKpiSection() {
3011
- const [nameKpi, setNameKpi] = useState11("");
3012
- const [kpiValue, setKpiValue] = useState11("");
3013
- const [unitValue, setUnitValue] = useState11("");
3014
- const [kpiList, setKpiList] = useState11([]);
3015
- const [editingBackup, setEditingBackup] = useState11({});
3016
- const [selected, setSelected] = useState11("2");
3017
- const [errors, setErrors] = useState11({
3047
+ const [nameKpi, setNameKpi] = useState12("");
3048
+ const [kpiValue, setKpiValue] = useState12("");
3049
+ const [unitValue, setUnitValue] = useState12("");
3050
+ const [kpiList, setKpiList] = useState12([]);
3051
+ const [editingBackup, setEditingBackup] = useState12({});
3052
+ const [selected, setSelected] = useState12("2");
3053
+ const [errors, setErrors] = useState12({
3018
3054
  nameKpi: "",
3019
3055
  kpiValue: "",
3020
3056
  unitValue: ""
3021
3057
  });
3022
- const [itemErrors, setItemErrors] = useState11({});
3058
+ const [itemErrors, setItemErrors] = useState12({});
3023
3059
  const options = [
3024
3060
  { value: "1", label: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21" },
3025
3061
  { value: "2", label: "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02" }
@@ -3173,7 +3209,7 @@ function KpiSection({ type, onChangeKpiList }) {
3173
3209
  setItemErrors
3174
3210
  } = useGetKpiSection();
3175
3211
  const [messageApi2, messageContainer] = message.useMessage();
3176
- const [hasShownError, setHasShownError] = useState12(false);
3212
+ const [hasShownError, setHasShownError] = useState13(false);
3177
3213
  useEffect3(() => {
3178
3214
  setMessageApi(messageApi2);
3179
3215
  }, [messageApi2]);
@@ -3183,7 +3219,7 @@ function KpiSection({ type, onChangeKpiList }) {
3183
3219
  }
3184
3220
  }, [kpiList]);
3185
3221
  return /* @__PURE__ */ jsx37(
3186
- ConfigProvider18,
3222
+ ConfigProvider17,
3187
3223
  {
3188
3224
  theme: {
3189
3225
  token: {
@@ -3415,7 +3451,7 @@ function AntDModal({ children, isOpen, width, onCancel }) {
3415
3451
 
3416
3452
  // src/Indicator/Indicator/Indicator.tsx
3417
3453
  import { IconCheck as IconCheck3, IconCirclePlus as IconCirclePlus2, IconPencil as IconPencil2, IconTrash as IconTrash4, IconX as IconX3 } from "@tabler/icons-react";
3418
- import { useState as useState13 } from "react";
3454
+ import { useState as useState14 } from "react";
3419
3455
  import { Input as Input4 } from "antd";
3420
3456
  import { Fragment as Fragment7, jsx as jsx39, jsxs as jsxs33 } from "react/jsx-runtime";
3421
3457
  function Indicator({
@@ -3427,22 +3463,22 @@ function Indicator({
3427
3463
  arrayData,
3428
3464
  setArrayData
3429
3465
  }) {
3430
- const [valueSwitch, setValueSwitch] = useState13("TEXT");
3431
- const [cacheData, setCacheData] = useState13({
3466
+ const [valueSwitch, setValueSwitch] = useState14("TEXT");
3467
+ const [cacheData, setCacheData] = useState14({
3432
3468
  indicatorType: type,
3433
3469
  inputType: valueSwitch,
3434
3470
  textValue: "",
3435
3471
  numberValue: "",
3436
3472
  unit: ""
3437
3473
  });
3438
- const [cacheEditData, setCacheEditData] = useState13({
3474
+ const [cacheEditData, setCacheEditData] = useState14({
3439
3475
  indicatorType: type,
3440
3476
  inputType: valueSwitch,
3441
3477
  textValue: "",
3442
3478
  numberValue: "",
3443
3479
  unit: ""
3444
3480
  });
3445
- const [editIndex, setEditIndex] = useState13(null);
3481
+ const [editIndex, setEditIndex] = useState14(null);
3446
3482
  const handleAddIndicator = () => {
3447
3483
  if (cacheData.textValue.trim() === "") return;
3448
3484
  setArrayData([
@@ -3602,11 +3638,11 @@ function Indicator({
3602
3638
 
3603
3639
  // src/FilterPopUp/FilterPopUp.tsx
3604
3640
  import { IconCheck as IconCheck4, IconFilter as IconFilter2, IconTrash as IconTrash5 } from "@tabler/icons-react";
3605
- import { useState as useState14 } from "react";
3641
+ import { useState as useState15 } from "react";
3606
3642
  import { jsx as jsx40, jsxs as jsxs34 } from "react/jsx-runtime";
3607
3643
  var FilterPopUp = (filter) => {
3608
- const [isAction, setIsAction] = useState14(true);
3609
- const [filterArray, setFilterArray] = useState14([""]);
3644
+ const [isAction, setIsAction] = useState15(true);
3645
+ const [filterArray, setFilterArray] = useState15([""]);
3610
3646
  const handleClearFilter = () => {
3611
3647
  setFilterArray([]);
3612
3648
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esic-lab/data-core-ui",
3
- "version": "0.0.40",
3
+ "version": "0.0.42",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",