@esic-lab/data-core-ui 0.0.42 → 0.0.44
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.css +83 -0
- package/dist/index.d.mts +20 -3
- package/dist/index.d.ts +20 -3
- package/dist/index.js +485 -265
- package/dist/index.mjs +485 -266
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1231,7 +1231,7 @@ 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 { useState as useState6 } from "react";
|
|
1234
|
+
import { useState as useState6, useRef as useRef2, useEffect as useEffect2 } from "react";
|
|
1235
1235
|
import { format } from "date-fns";
|
|
1236
1236
|
import { th as thFns } from "date-fns/locale";
|
|
1237
1237
|
import { jsx as jsx23, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
@@ -1247,9 +1247,11 @@ function DatePickerBasic({
|
|
|
1247
1247
|
placeholder = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48",
|
|
1248
1248
|
minDate,
|
|
1249
1249
|
maxDate,
|
|
1250
|
-
disabledDate
|
|
1250
|
+
disabledDate,
|
|
1251
|
+
disablePast = false
|
|
1251
1252
|
}) {
|
|
1252
1253
|
const [open, setOpen] = useState6(false);
|
|
1254
|
+
const wrapperRef = useRef2(null);
|
|
1253
1255
|
const current = value ? (0, import_dayjs.default)(value) : null;
|
|
1254
1256
|
const today = (0, import_dayjs.default)();
|
|
1255
1257
|
const formatThaiBE = (date) => {
|
|
@@ -1275,6 +1277,7 @@ function DatePickerBasic({
|
|
|
1275
1277
|
const daysInMonth = calendar.daysInMonth();
|
|
1276
1278
|
const firstDayOfMonth = calendar.startOf("month").day();
|
|
1277
1279
|
const isDisabled = (date) => {
|
|
1280
|
+
if (disablePast && date.isBefore(today, "day")) return true;
|
|
1278
1281
|
if (disabledDate && disabledDate(date.toDate())) return true;
|
|
1279
1282
|
if (minDate && date.isBefore((0, import_dayjs.default)(minDate), "day")) return true;
|
|
1280
1283
|
if (maxDate && date.isAfter((0, import_dayjs.default)(maxDate), "day")) return true;
|
|
@@ -1286,48 +1289,78 @@ function DatePickerBasic({
|
|
|
1286
1289
|
onChange(selected.toDate());
|
|
1287
1290
|
setOpen(false);
|
|
1288
1291
|
};
|
|
1289
|
-
|
|
1292
|
+
useEffect2(() => {
|
|
1293
|
+
const handleClickOutside = (e) => {
|
|
1294
|
+
if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {
|
|
1295
|
+
setOpen(false);
|
|
1296
|
+
}
|
|
1297
|
+
};
|
|
1298
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
1299
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
1300
|
+
}, []);
|
|
1301
|
+
return /* @__PURE__ */ jsxs19("div", { ref: wrapperRef, style: { fontFamily: "Kanit", fontSize: 16 }, className: "relative w-full", children: [
|
|
1290
1302
|
/* @__PURE__ */ jsxs19("div", { className: "mb-1", children: [
|
|
1291
1303
|
/* @__PURE__ */ jsx23("span", { className: "body-1", children: label }),
|
|
1292
|
-
required && /* @__PURE__ */ jsx23("span", { className: "text-red-500", children: "*" })
|
|
1304
|
+
required && /* @__PURE__ */ jsx23("span", { className: "text-red-500 ml-1", children: "*" })
|
|
1293
1305
|
] }),
|
|
1294
1306
|
/* @__PURE__ */ jsx23(
|
|
1295
1307
|
"div",
|
|
1296
1308
|
{
|
|
1297
|
-
className: `border rounded px-3 py-2 cursor-pointer bg-white ${disabled ? "opacity-50" : ""}`,
|
|
1309
|
+
className: `border rounded px-3 py-2 cursor-pointer bg-white flex items-center ${disabled ? "opacity-50 cursor-not-allowed" : ""} ${error ? "border-red-500" : "border-gray-300"}`,
|
|
1298
1310
|
onClick: () => !disabled && setOpen(!open),
|
|
1299
|
-
children: value ? formatThaiBE(value) : /* @__PURE__ */ jsx23("span", { className: "text-gray-400", children: placeholder })
|
|
1311
|
+
children: /* @__PURE__ */ jsx23("div", { className: "flex-1", children: value ? formatThaiBE(value) : /* @__PURE__ */ jsx23("span", { className: "text-gray-400", children: placeholder }) })
|
|
1300
1312
|
}
|
|
1301
1313
|
),
|
|
1302
1314
|
open && /* @__PURE__ */ jsxs19(
|
|
1303
1315
|
"div",
|
|
1304
1316
|
{
|
|
1305
|
-
className: "absolute z-50 mt-2 w-80 p-4 bg-white shadow-xl rounded-lg border",
|
|
1317
|
+
className: "absolute z-50 mt-2 w-80 p-4 bg-white shadow-xl rounded-lg border animate-fade-in",
|
|
1306
1318
|
style: { fontFamily: "Kanit", fontSize: 16 },
|
|
1307
1319
|
children: [
|
|
1308
1320
|
/* @__PURE__ */ jsxs19("div", { className: "flex justify-between items-center mb-3", children: [
|
|
1309
|
-
/* @__PURE__ */ jsx23(
|
|
1310
|
-
|
|
1321
|
+
/* @__PURE__ */ jsx23(
|
|
1322
|
+
"button",
|
|
1323
|
+
{
|
|
1324
|
+
onClick: () => setCalendar(calendar.subtract(1, "month")),
|
|
1325
|
+
className: "px-2 hover:bg-gray-100 rounded",
|
|
1326
|
+
children: "\u25C0"
|
|
1327
|
+
}
|
|
1328
|
+
),
|
|
1329
|
+
/* @__PURE__ */ jsxs19("div", { className: "font-semibold text-lg text-gray-700", children: [
|
|
1311
1330
|
monthNames[calendar.month()],
|
|
1312
1331
|
" ",
|
|
1313
1332
|
calendar.year() + 543
|
|
1314
1333
|
] }),
|
|
1315
|
-
/* @__PURE__ */ jsx23("button", { onClick: () => setCalendar(calendar.add(1, "month")), className: "px-2", children: "\u25B6" })
|
|
1334
|
+
/* @__PURE__ */ jsx23("button", { onClick: () => setCalendar(calendar.add(1, "month")), className: "px-2 hover:bg-gray-100 rounded", children: "\u25B6" })
|
|
1316
1335
|
] }),
|
|
1317
|
-
/* @__PURE__ */ jsx23("div", { className: "grid grid-cols-7 text-center text-gray-
|
|
1336
|
+
/* @__PURE__ */ jsx23("div", { className: "grid grid-cols-7 text-center text-gray-500 text-sm mb-2 font-medium", children: ["\u0E2D\u0E32", "\u0E08", "\u0E2D", "\u0E1E", "\u0E1E\u0E24", "\u0E28", "\u0E2A"].map((d) => /* @__PURE__ */ jsx23("div", { children: d }, d)) }),
|
|
1318
1337
|
/* @__PURE__ */ jsxs19("div", { className: "grid grid-cols-7 gap-1 text-center", children: [
|
|
1319
1338
|
Array(firstDayOfMonth).fill(null).map((_, i) => /* @__PURE__ */ jsx23("div", {}, `empty-${i}`)),
|
|
1320
1339
|
Array.from({ length: daysInMonth }, (_, i) => i + 1).map((d) => {
|
|
1321
1340
|
const dateObj = calendar.date(d);
|
|
1322
|
-
const
|
|
1323
|
-
const
|
|
1341
|
+
const isDisable = isDisabled(dateObj);
|
|
1342
|
+
const isSelected = current && dateObj.isSame(current, "day");
|
|
1343
|
+
const isToday = dateObj.isSame(today, "day");
|
|
1344
|
+
let bgClass = "hover:bg-blue-100";
|
|
1345
|
+
let textClass = "text-gray-700";
|
|
1346
|
+
if (isDisable) {
|
|
1347
|
+
bgClass = "";
|
|
1348
|
+
textClass = "text-gray-300 cursor-not-allowed";
|
|
1349
|
+
} else if (isSelected) {
|
|
1350
|
+
bgClass = "bg-blue-500 text-white shadow-md";
|
|
1351
|
+
textClass = "text-white font-semibold";
|
|
1352
|
+
} else if (isToday) {
|
|
1353
|
+
bgClass = "border border-blue-500 font-bold";
|
|
1354
|
+
textClass = "text-blue-600";
|
|
1355
|
+
}
|
|
1324
1356
|
return /* @__PURE__ */ jsx23(
|
|
1325
1357
|
"div",
|
|
1326
1358
|
{
|
|
1327
|
-
onClick: () => !
|
|
1328
|
-
className: `
|
|
1329
|
-
|
|
1330
|
-
${
|
|
1359
|
+
onClick: () => !isDisable && handleSelect(d),
|
|
1360
|
+
className: `
|
|
1361
|
+
py-1 rounded transition-all duration-200
|
|
1362
|
+
${bgClass} ${textClass}
|
|
1363
|
+
${!isDisable ? "cursor-pointer" : ""}
|
|
1331
1364
|
`,
|
|
1332
1365
|
children: d
|
|
1333
1366
|
},
|
|
@@ -1338,13 +1371,188 @@ function DatePickerBasic({
|
|
|
1338
1371
|
]
|
|
1339
1372
|
}
|
|
1340
1373
|
),
|
|
1341
|
-
error && /* @__PURE__ */ jsx23("p", { className: "text-red-500
|
|
1374
|
+
error && /* @__PURE__ */ jsx23("p", { className: "text-red-500 text-xs mt-1", children: error })
|
|
1375
|
+
] });
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
// src/DatePicker/DatePickerRange/DatePickerRange.tsx
|
|
1379
|
+
var import_dayjs2 = __toESM(require_dayjs_min());
|
|
1380
|
+
var import_th3 = __toESM(require_th());
|
|
1381
|
+
var import_buddhistEra2 = __toESM(require_buddhistEra());
|
|
1382
|
+
import { useState as useState7, useRef as useRef3, useEffect as useEffect3 } from "react";
|
|
1383
|
+
import { format as format2 } from "date-fns";
|
|
1384
|
+
import { th as thFns2 } from "date-fns/locale";
|
|
1385
|
+
import { jsx as jsx24, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1386
|
+
import_dayjs2.default.extend(import_buddhistEra2.default);
|
|
1387
|
+
import_dayjs2.default.locale("th");
|
|
1388
|
+
function DatePickerRange({
|
|
1389
|
+
value,
|
|
1390
|
+
onChange,
|
|
1391
|
+
label,
|
|
1392
|
+
required,
|
|
1393
|
+
error,
|
|
1394
|
+
disabled,
|
|
1395
|
+
minDate,
|
|
1396
|
+
maxDate,
|
|
1397
|
+
disabledDate,
|
|
1398
|
+
disablePast = false
|
|
1399
|
+
}) {
|
|
1400
|
+
const [open, setOpen] = useState7(false);
|
|
1401
|
+
const wrapperRef = useRef3(null);
|
|
1402
|
+
const [startDate, endDate] = value;
|
|
1403
|
+
const startDayjs = startDate ? (0, import_dayjs2.default)(startDate) : null;
|
|
1404
|
+
const endDayjs = endDate ? (0, import_dayjs2.default)(endDate) : null;
|
|
1405
|
+
const today = (0, import_dayjs2.default)();
|
|
1406
|
+
const [calendar, setCalendar] = useState7(startDayjs || today);
|
|
1407
|
+
const formatThaiBE = (date) => {
|
|
1408
|
+
const formatted = format2(date, "dd MMM yy", { locale: thFns2 });
|
|
1409
|
+
const year = parseInt(format2(date, "yyyy")) + 543;
|
|
1410
|
+
return formatted.replace(/\d{4}$/, String(year)).replace(/\d{2}$/, String(year).slice(2));
|
|
1411
|
+
};
|
|
1412
|
+
const monthNames = [
|
|
1413
|
+
"\u0E21\u0E01\u0E23\u0E32\u0E04\u0E21",
|
|
1414
|
+
"\u0E01\u0E38\u0E21\u0E20\u0E32\u0E1E\u0E31\u0E19\u0E18\u0E4C",
|
|
1415
|
+
"\u0E21\u0E35\u0E19\u0E32\u0E04\u0E21",
|
|
1416
|
+
"\u0E40\u0E21\u0E29\u0E32\u0E22\u0E19",
|
|
1417
|
+
"\u0E1E\u0E24\u0E29\u0E20\u0E32\u0E04\u0E21",
|
|
1418
|
+
"\u0E21\u0E34\u0E16\u0E38\u0E19\u0E32\u0E22\u0E19",
|
|
1419
|
+
"\u0E01\u0E23\u0E01\u0E0E\u0E32\u0E04\u0E21",
|
|
1420
|
+
"\u0E2A\u0E34\u0E07\u0E2B\u0E32\u0E04\u0E21",
|
|
1421
|
+
"\u0E01\u0E31\u0E19\u0E22\u0E32\u0E22\u0E19",
|
|
1422
|
+
"\u0E15\u0E38\u0E25\u0E32\u0E04\u0E21",
|
|
1423
|
+
"\u0E1E\u0E24\u0E28\u0E08\u0E34\u0E01\u0E32\u0E22\u0E19",
|
|
1424
|
+
"\u0E18\u0E31\u0E19\u0E27\u0E32\u0E04\u0E21"
|
|
1425
|
+
];
|
|
1426
|
+
const daysInMonth = calendar.daysInMonth();
|
|
1427
|
+
const firstDayOfMonth = calendar.startOf("month").day();
|
|
1428
|
+
const isDisabled = (date) => {
|
|
1429
|
+
if (disablePast && date.isBefore(today, "day")) return true;
|
|
1430
|
+
if (disabledDate && disabledDate(date.toDate())) return true;
|
|
1431
|
+
if (minDate && date.isBefore((0, import_dayjs2.default)(minDate), "day")) return true;
|
|
1432
|
+
if (maxDate && date.isAfter((0, import_dayjs2.default)(maxDate), "day")) return true;
|
|
1433
|
+
return false;
|
|
1434
|
+
};
|
|
1435
|
+
const handleSelect = (d) => {
|
|
1436
|
+
const selected = calendar.date(d);
|
|
1437
|
+
if (isDisabled(selected)) return;
|
|
1438
|
+
const selectedDate = selected.toDate();
|
|
1439
|
+
if (!startDate || startDate && endDate) {
|
|
1440
|
+
onChange([selectedDate, null]);
|
|
1441
|
+
} else if (startDate && !endDate) {
|
|
1442
|
+
if (selected.isBefore(startDayjs, "day")) {
|
|
1443
|
+
onChange([selectedDate, null]);
|
|
1444
|
+
} else {
|
|
1445
|
+
onChange([startDate, selectedDate]);
|
|
1446
|
+
setOpen(false);
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
};
|
|
1450
|
+
useEffect3(() => {
|
|
1451
|
+
const handleClickOutside = (e) => {
|
|
1452
|
+
if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {
|
|
1453
|
+
setOpen(false);
|
|
1454
|
+
}
|
|
1455
|
+
};
|
|
1456
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
1457
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
1458
|
+
}, []);
|
|
1459
|
+
const ArrowIcon = () => /* @__PURE__ */ jsx24("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", className: "w-4 h-4 text-gray-400", children: /* @__PURE__ */ jsx24(
|
|
1460
|
+
"path",
|
|
1461
|
+
{
|
|
1462
|
+
fillRule: "evenodd",
|
|
1463
|
+
d: "M12.97 3.97a.75.75 0 011.06 0l7.5 7.5a.75.75 0 010 1.06l-7.5 7.5a.75.75 0 11-1.06-1.06l6.22-6.22H3a.75.75 0 010-1.5h16.19l-6.22-6.22a.75.75 0 010-1.06z",
|
|
1464
|
+
clipRule: "evenodd"
|
|
1465
|
+
}
|
|
1466
|
+
) });
|
|
1467
|
+
return /* @__PURE__ */ jsxs20("div", { ref: wrapperRef, style: { fontFamily: "Kanit", fontSize: 16 }, className: "relative w-full", children: [
|
|
1468
|
+
/* @__PURE__ */ jsxs20("div", { className: "mb-1", children: [
|
|
1469
|
+
/* @__PURE__ */ jsx24("span", { className: "body-1", children: label }),
|
|
1470
|
+
required && /* @__PURE__ */ jsx24("span", { className: "text-red-500 ml-1", children: "*" })
|
|
1471
|
+
] }),
|
|
1472
|
+
/* @__PURE__ */ jsxs20(
|
|
1473
|
+
"div",
|
|
1474
|
+
{
|
|
1475
|
+
className: `border rounded px-3 py-2 cursor-pointer bg-white flex items-center justify-between gap-2 ${disabled ? "opacity-50 cursor-not-allowed" : ""} ${error ? "border-red-500" : "border-gray-300"}`,
|
|
1476
|
+
onClick: () => !disabled && setOpen(!open),
|
|
1477
|
+
children: [
|
|
1478
|
+
/* @__PURE__ */ jsx24("div", { className: `flex-1 ${!startDate ? "text-gray-400 font-light" : "text-gray-800"}`, children: startDate ? formatThaiBE(startDate) : "\u0E27\u0E31\u0E19\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19" }),
|
|
1479
|
+
/* @__PURE__ */ jsx24("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx24(ArrowIcon, {}) }),
|
|
1480
|
+
/* @__PURE__ */ jsx24("div", { className: `flex-1 text-right ${!endDate ? "text-gray-400 font-light" : "text-gray-800"}`, children: endDate ? formatThaiBE(endDate) : "\u0E27\u0E31\u0E19\u0E2A\u0E34\u0E49\u0E19\u0E2A\u0E38\u0E14" })
|
|
1481
|
+
]
|
|
1482
|
+
}
|
|
1483
|
+
),
|
|
1484
|
+
open && /* @__PURE__ */ jsxs20(
|
|
1485
|
+
"div",
|
|
1486
|
+
{
|
|
1487
|
+
className: "absolute z-50 mt-2 w-80 p-4 bg-white shadow-xl rounded-lg border animate-fade-in right-0 left-0 mx-auto sm:mx-0 sm:left-auto sm:right-auto",
|
|
1488
|
+
style: { fontFamily: "Kanit", fontSize: 16 },
|
|
1489
|
+
children: [
|
|
1490
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex justify-between items-center mb-3", children: [
|
|
1491
|
+
/* @__PURE__ */ jsx24(
|
|
1492
|
+
"button",
|
|
1493
|
+
{
|
|
1494
|
+
onClick: () => setCalendar(calendar.subtract(1, "month")),
|
|
1495
|
+
className: "px-2 hover:bg-gray-100 rounded",
|
|
1496
|
+
children: "\u25C0"
|
|
1497
|
+
}
|
|
1498
|
+
),
|
|
1499
|
+
/* @__PURE__ */ jsxs20("div", { className: "font-semibold text-lg text-gray-700", children: [
|
|
1500
|
+
monthNames[calendar.month()],
|
|
1501
|
+
" ",
|
|
1502
|
+
calendar.year() + 543
|
|
1503
|
+
] }),
|
|
1504
|
+
/* @__PURE__ */ jsx24("button", { onClick: () => setCalendar(calendar.add(1, "month")), className: "px-2 hover:bg-gray-100 rounded", children: "\u25B6" })
|
|
1505
|
+
] }),
|
|
1506
|
+
/* @__PURE__ */ jsx24("div", { className: "grid grid-cols-7 text-center text-gray-500 text-sm mb-2 font-medium", children: ["\u0E2D\u0E32", "\u0E08", "\u0E2D", "\u0E1E", "\u0E1E\u0E24", "\u0E28", "\u0E2A"].map((d) => /* @__PURE__ */ jsx24("div", { children: d }, d)) }),
|
|
1507
|
+
/* @__PURE__ */ jsxs20("div", { className: "grid grid-cols-7 gap-y-1 text-center", children: [
|
|
1508
|
+
Array(firstDayOfMonth).fill(null).map((_, i) => /* @__PURE__ */ jsx24("div", {}, `empty-${i}`)),
|
|
1509
|
+
Array.from({ length: daysInMonth }, (_, i) => i + 1).map((d) => {
|
|
1510
|
+
const currentObj = calendar.date(d);
|
|
1511
|
+
const isDisable = isDisabled(currentObj);
|
|
1512
|
+
const isToday = currentObj.isSame(today, "day");
|
|
1513
|
+
const isStart = startDayjs && currentObj.isSame(startDayjs, "day");
|
|
1514
|
+
const isEnd = endDayjs && currentObj.isSame(endDayjs, "day");
|
|
1515
|
+
const isInRange = startDayjs && endDayjs && currentObj.isAfter(startDayjs, "day") && currentObj.isBefore(endDayjs, "day");
|
|
1516
|
+
let bgClass = "hover:bg-blue-100";
|
|
1517
|
+
let textClass = "text-gray-700";
|
|
1518
|
+
if (isDisable) {
|
|
1519
|
+
bgClass = "";
|
|
1520
|
+
textClass = "text-gray-300 cursor-not-allowed";
|
|
1521
|
+
} else if (isStart || isEnd) {
|
|
1522
|
+
bgClass = "bg-blue-600 shadow-md transform scale-105";
|
|
1523
|
+
textClass = "text-white font-semibold";
|
|
1524
|
+
} else if (isInRange) {
|
|
1525
|
+
bgClass = "bg-blue-100";
|
|
1526
|
+
textClass = "text-blue-700";
|
|
1527
|
+
} else if (isToday) {
|
|
1528
|
+
bgClass = "border border-blue-500 font-bold";
|
|
1529
|
+
textClass = "text-blue-600";
|
|
1530
|
+
}
|
|
1531
|
+
return /* @__PURE__ */ jsx24(
|
|
1532
|
+
"div",
|
|
1533
|
+
{
|
|
1534
|
+
onClick: () => !isDisable && handleSelect(d),
|
|
1535
|
+
className: `
|
|
1536
|
+
h-9 w-9 flex items-center justify-center rounded-full mx-auto transition-all duration-200
|
|
1537
|
+
${bgClass} ${textClass}
|
|
1538
|
+
${!isDisable ? "cursor-pointer" : ""}
|
|
1539
|
+
`,
|
|
1540
|
+
children: d
|
|
1541
|
+
},
|
|
1542
|
+
d
|
|
1543
|
+
);
|
|
1544
|
+
})
|
|
1545
|
+
] })
|
|
1546
|
+
]
|
|
1547
|
+
}
|
|
1548
|
+
),
|
|
1549
|
+
error && /* @__PURE__ */ jsx24("p", { className: "text-red-500 text-xs mt-1", children: error })
|
|
1342
1550
|
] });
|
|
1343
1551
|
}
|
|
1344
1552
|
|
|
1345
1553
|
// src/ColorPicker/ColorPickerBasic/ColorPicker.tsx
|
|
1346
1554
|
import { ConfigProvider as ConfigProvider5, ColorPicker } from "antd";
|
|
1347
|
-
import { jsx as
|
|
1555
|
+
import { jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1348
1556
|
function ColorPickerBasic({
|
|
1349
1557
|
value,
|
|
1350
1558
|
onChange,
|
|
@@ -1357,7 +1565,7 @@ function ColorPickerBasic({
|
|
|
1357
1565
|
className,
|
|
1358
1566
|
placeholder = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E2A\u0E35"
|
|
1359
1567
|
}) {
|
|
1360
|
-
return /* @__PURE__ */
|
|
1568
|
+
return /* @__PURE__ */ jsx25(
|
|
1361
1569
|
ConfigProvider5,
|
|
1362
1570
|
{
|
|
1363
1571
|
theme: {
|
|
@@ -1366,13 +1574,13 @@ function ColorPickerBasic({
|
|
|
1366
1574
|
fontSize: 16
|
|
1367
1575
|
}
|
|
1368
1576
|
},
|
|
1369
|
-
children: /* @__PURE__ */
|
|
1370
|
-
/* @__PURE__ */
|
|
1371
|
-
/* @__PURE__ */
|
|
1577
|
+
children: /* @__PURE__ */ jsxs21("div", { className: "container-input", children: [
|
|
1578
|
+
/* @__PURE__ */ jsxs21("div", { children: [
|
|
1579
|
+
/* @__PURE__ */ jsx25("span", { className: "body-1", children: label }),
|
|
1372
1580
|
" ",
|
|
1373
|
-
required && /* @__PURE__ */
|
|
1581
|
+
required && /* @__PURE__ */ jsx25("span", { className: "text-red-500", children: "*" })
|
|
1374
1582
|
] }),
|
|
1375
|
-
/* @__PURE__ */
|
|
1583
|
+
/* @__PURE__ */ jsx25(
|
|
1376
1584
|
ColorPicker,
|
|
1377
1585
|
{
|
|
1378
1586
|
defaultFormat,
|
|
@@ -1384,9 +1592,9 @@ function ColorPickerBasic({
|
|
|
1384
1592
|
showText: (color) => {
|
|
1385
1593
|
const hex = color.toHexString();
|
|
1386
1594
|
if (!value) {
|
|
1387
|
-
return /* @__PURE__ */
|
|
1595
|
+
return /* @__PURE__ */ jsx25("span", { children: placeholder });
|
|
1388
1596
|
}
|
|
1389
|
-
return /* @__PURE__ */
|
|
1597
|
+
return /* @__PURE__ */ jsxs21("span", { children: [
|
|
1390
1598
|
"(",
|
|
1391
1599
|
hex,
|
|
1392
1600
|
")"
|
|
@@ -1395,7 +1603,7 @@ function ColorPickerBasic({
|
|
|
1395
1603
|
disabled
|
|
1396
1604
|
}
|
|
1397
1605
|
),
|
|
1398
|
-
error && /* @__PURE__ */
|
|
1606
|
+
error && /* @__PURE__ */ jsx25("p", { className: "text-red-500 caption-1", children: error })
|
|
1399
1607
|
] })
|
|
1400
1608
|
}
|
|
1401
1609
|
);
|
|
@@ -2104,7 +2312,7 @@ var greyDark = ["#151515", "#1f1f1f", "#2d2d2d", "#393939", "#494949", "#5a5a5a"
|
|
|
2104
2312
|
greyDark.primary = greyDark[5];
|
|
2105
2313
|
|
|
2106
2314
|
// src/ColorPicker/ColorPalettePickerBasic/ColorPalettePickerBasic.tsx
|
|
2107
|
-
import { jsx as
|
|
2315
|
+
import { jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2108
2316
|
function genPresets(presets = presetPalettes) {
|
|
2109
2317
|
return Object.entries(presets).map(([label, colors]) => ({
|
|
2110
2318
|
label,
|
|
@@ -2131,7 +2339,7 @@ function ColorPalettePickerBasic({
|
|
|
2131
2339
|
red,
|
|
2132
2340
|
green
|
|
2133
2341
|
});
|
|
2134
|
-
return /* @__PURE__ */
|
|
2342
|
+
return /* @__PURE__ */ jsx26(
|
|
2135
2343
|
ConfigProvider6,
|
|
2136
2344
|
{
|
|
2137
2345
|
theme: {
|
|
@@ -2140,13 +2348,13 @@ function ColorPalettePickerBasic({
|
|
|
2140
2348
|
fontSize: 16
|
|
2141
2349
|
}
|
|
2142
2350
|
},
|
|
2143
|
-
children: /* @__PURE__ */
|
|
2144
|
-
/* @__PURE__ */
|
|
2145
|
-
/* @__PURE__ */
|
|
2351
|
+
children: /* @__PURE__ */ jsxs22("div", { className: "container-input", children: [
|
|
2352
|
+
/* @__PURE__ */ jsxs22("div", { children: [
|
|
2353
|
+
/* @__PURE__ */ jsx26("span", { className: "body-1", children: label }),
|
|
2146
2354
|
" ",
|
|
2147
|
-
required && /* @__PURE__ */
|
|
2355
|
+
required && /* @__PURE__ */ jsx26("span", { className: "text-red-500", children: "*" })
|
|
2148
2356
|
] }),
|
|
2149
|
-
/* @__PURE__ */
|
|
2357
|
+
/* @__PURE__ */ jsx26(
|
|
2150
2358
|
ColorPicker2,
|
|
2151
2359
|
{
|
|
2152
2360
|
defaultFormat,
|
|
@@ -2159,9 +2367,9 @@ function ColorPalettePickerBasic({
|
|
|
2159
2367
|
showText: (color) => {
|
|
2160
2368
|
const hex = color.toHexString();
|
|
2161
2369
|
if (!value) {
|
|
2162
|
-
return /* @__PURE__ */
|
|
2370
|
+
return /* @__PURE__ */ jsx26("span", { children: placeholder });
|
|
2163
2371
|
}
|
|
2164
|
-
return /* @__PURE__ */
|
|
2372
|
+
return /* @__PURE__ */ jsxs22("span", { children: [
|
|
2165
2373
|
"(",
|
|
2166
2374
|
hex,
|
|
2167
2375
|
")"
|
|
@@ -2171,7 +2379,7 @@ function ColorPalettePickerBasic({
|
|
|
2171
2379
|
onClear
|
|
2172
2380
|
}
|
|
2173
2381
|
),
|
|
2174
|
-
error && /* @__PURE__ */
|
|
2382
|
+
error && /* @__PURE__ */ jsx26("p", { className: "text-red-500 caption-1", children: error })
|
|
2175
2383
|
] })
|
|
2176
2384
|
}
|
|
2177
2385
|
);
|
|
@@ -2179,7 +2387,7 @@ function ColorPalettePickerBasic({
|
|
|
2179
2387
|
|
|
2180
2388
|
// src/Select/SelectField/SelectField.tsx
|
|
2181
2389
|
import { Select, ConfigProvider as ConfigProvider7 } from "antd";
|
|
2182
|
-
import { jsx as
|
|
2390
|
+
import { jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2183
2391
|
function SelectField({
|
|
2184
2392
|
value,
|
|
2185
2393
|
onChange,
|
|
@@ -2197,7 +2405,7 @@ function SelectField({
|
|
|
2197
2405
|
className,
|
|
2198
2406
|
onClear
|
|
2199
2407
|
}) {
|
|
2200
|
-
return /* @__PURE__ */
|
|
2408
|
+
return /* @__PURE__ */ jsx27(
|
|
2201
2409
|
ConfigProvider7,
|
|
2202
2410
|
{
|
|
2203
2411
|
theme: {
|
|
@@ -2206,13 +2414,13 @@ function SelectField({
|
|
|
2206
2414
|
fontSize: 16
|
|
2207
2415
|
}
|
|
2208
2416
|
},
|
|
2209
|
-
children: /* @__PURE__ */
|
|
2210
|
-
/* @__PURE__ */
|
|
2211
|
-
/* @__PURE__ */
|
|
2417
|
+
children: /* @__PURE__ */ jsxs23("div", { className: "container-input", children: [
|
|
2418
|
+
/* @__PURE__ */ jsxs23("div", { children: [
|
|
2419
|
+
/* @__PURE__ */ jsx27("span", { className: "body-1", children: label }),
|
|
2212
2420
|
" ",
|
|
2213
|
-
required && /* @__PURE__ */
|
|
2421
|
+
required && /* @__PURE__ */ jsx27("span", { className: "text-red-500", children: "*" })
|
|
2214
2422
|
] }),
|
|
2215
|
-
/* @__PURE__ */
|
|
2423
|
+
/* @__PURE__ */ jsx27(
|
|
2216
2424
|
Select,
|
|
2217
2425
|
{
|
|
2218
2426
|
showSearch: true,
|
|
@@ -2227,7 +2435,7 @@ function SelectField({
|
|
|
2227
2435
|
options,
|
|
2228
2436
|
mode,
|
|
2229
2437
|
onSearch: handleSearch,
|
|
2230
|
-
prefix: prefix ? /* @__PURE__ */
|
|
2438
|
+
prefix: prefix ? /* @__PURE__ */ jsx27(
|
|
2231
2439
|
"span",
|
|
2232
2440
|
{
|
|
2233
2441
|
style: {
|
|
@@ -2244,7 +2452,7 @@ function SelectField({
|
|
|
2244
2452
|
onClear
|
|
2245
2453
|
}
|
|
2246
2454
|
),
|
|
2247
|
-
error && /* @__PURE__ */
|
|
2455
|
+
error && /* @__PURE__ */ jsx27("p", { className: "text-red-500 caption-1", children: error })
|
|
2248
2456
|
] })
|
|
2249
2457
|
}
|
|
2250
2458
|
);
|
|
@@ -2252,7 +2460,7 @@ function SelectField({
|
|
|
2252
2460
|
|
|
2253
2461
|
// src/Select/SelectFieldGroup/SelectFieldGroup.tsx
|
|
2254
2462
|
import { Select as Select2, ConfigProvider as ConfigProvider8 } from "antd";
|
|
2255
|
-
import { jsx as
|
|
2463
|
+
import { jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2256
2464
|
function SelectFieldGroup({
|
|
2257
2465
|
value,
|
|
2258
2466
|
onChange,
|
|
@@ -2269,7 +2477,7 @@ function SelectFieldGroup({
|
|
|
2269
2477
|
handleSearch,
|
|
2270
2478
|
className
|
|
2271
2479
|
}) {
|
|
2272
|
-
return /* @__PURE__ */
|
|
2480
|
+
return /* @__PURE__ */ jsx28(
|
|
2273
2481
|
ConfigProvider8,
|
|
2274
2482
|
{
|
|
2275
2483
|
theme: {
|
|
@@ -2277,13 +2485,13 @@ function SelectFieldGroup({
|
|
|
2277
2485
|
fontFamily: "Kanit"
|
|
2278
2486
|
}
|
|
2279
2487
|
},
|
|
2280
|
-
children: /* @__PURE__ */
|
|
2281
|
-
/* @__PURE__ */
|
|
2282
|
-
/* @__PURE__ */
|
|
2488
|
+
children: /* @__PURE__ */ jsxs24("div", { className: "container-input", children: [
|
|
2489
|
+
/* @__PURE__ */ jsxs24("div", { children: [
|
|
2490
|
+
/* @__PURE__ */ jsx28("span", { className: "body-1", children: label }),
|
|
2283
2491
|
" ",
|
|
2284
|
-
required && /* @__PURE__ */
|
|
2492
|
+
required && /* @__PURE__ */ jsx28("span", { className: "text-red-500", children: "*" })
|
|
2285
2493
|
] }),
|
|
2286
|
-
/* @__PURE__ */
|
|
2494
|
+
/* @__PURE__ */ jsx28(
|
|
2287
2495
|
Select2,
|
|
2288
2496
|
{
|
|
2289
2497
|
showSearch: true,
|
|
@@ -2298,7 +2506,7 @@ function SelectFieldGroup({
|
|
|
2298
2506
|
options,
|
|
2299
2507
|
mode,
|
|
2300
2508
|
onSearch: handleSearch,
|
|
2301
|
-
prefix: prefix ? /* @__PURE__ */
|
|
2509
|
+
prefix: prefix ? /* @__PURE__ */ jsx28(
|
|
2302
2510
|
"span",
|
|
2303
2511
|
{
|
|
2304
2512
|
style: {
|
|
@@ -2314,7 +2522,7 @@ function SelectFieldGroup({
|
|
|
2314
2522
|
allowClear: true
|
|
2315
2523
|
}
|
|
2316
2524
|
),
|
|
2317
|
-
error && /* @__PURE__ */
|
|
2525
|
+
error && /* @__PURE__ */ jsx28("p", { className: "text-red-500 caption-1", children: error })
|
|
2318
2526
|
] })
|
|
2319
2527
|
}
|
|
2320
2528
|
);
|
|
@@ -2334,7 +2542,7 @@ var status = [
|
|
|
2334
2542
|
|
|
2335
2543
|
// src/Select/SelectFieldStatus/SelectFieldStatus.tsx
|
|
2336
2544
|
import { DownOutlined } from "@ant-design/icons";
|
|
2337
|
-
import { jsx as
|
|
2545
|
+
import { jsx as jsx29, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2338
2546
|
function SelectFieldStatus({
|
|
2339
2547
|
value,
|
|
2340
2548
|
onChange,
|
|
@@ -2347,7 +2555,7 @@ function SelectFieldStatus({
|
|
|
2347
2555
|
className
|
|
2348
2556
|
}) {
|
|
2349
2557
|
const selectedItem = status.find((s) => s.value === value);
|
|
2350
|
-
return /* @__PURE__ */
|
|
2558
|
+
return /* @__PURE__ */ jsx29(
|
|
2351
2559
|
ConfigProvider9,
|
|
2352
2560
|
{
|
|
2353
2561
|
theme: {
|
|
@@ -2363,17 +2571,17 @@ function SelectFieldStatus({
|
|
|
2363
2571
|
fontFamily: "Kanit"
|
|
2364
2572
|
}
|
|
2365
2573
|
},
|
|
2366
|
-
children: /* @__PURE__ */
|
|
2367
|
-
/* @__PURE__ */
|
|
2368
|
-
/* @__PURE__ */
|
|
2574
|
+
children: /* @__PURE__ */ jsxs25("div", { className: "container-input", children: [
|
|
2575
|
+
/* @__PURE__ */ jsxs25("div", { children: [
|
|
2576
|
+
/* @__PURE__ */ jsx29("span", { className: "body-1", children: label }),
|
|
2369
2577
|
" ",
|
|
2370
|
-
required && /* @__PURE__ */
|
|
2578
|
+
required && /* @__PURE__ */ jsx29("span", { className: "text-red-500", children: "*" })
|
|
2371
2579
|
] }),
|
|
2372
|
-
/* @__PURE__ */
|
|
2580
|
+
/* @__PURE__ */ jsx29(
|
|
2373
2581
|
Select3,
|
|
2374
2582
|
{
|
|
2375
2583
|
disabled,
|
|
2376
|
-
suffixIcon: /* @__PURE__ */
|
|
2584
|
+
suffixIcon: /* @__PURE__ */ jsx29(DownOutlined, { style: { color: value ? "#fff" : "#D9D9D9" } }),
|
|
2377
2585
|
value,
|
|
2378
2586
|
onChange,
|
|
2379
2587
|
className: `body-3 custom-select flex justify-center w-full ${className ?? ""}`,
|
|
@@ -2384,7 +2592,7 @@ function SelectFieldStatus({
|
|
|
2384
2592
|
showSearch: true
|
|
2385
2593
|
}
|
|
2386
2594
|
),
|
|
2387
|
-
error && /* @__PURE__ */
|
|
2595
|
+
error && /* @__PURE__ */ jsx29("p", { className: "text-red-500 caption-1", children: error })
|
|
2388
2596
|
] })
|
|
2389
2597
|
}
|
|
2390
2598
|
);
|
|
@@ -2401,7 +2609,7 @@ var status2 = [
|
|
|
2401
2609
|
|
|
2402
2610
|
// src/Select/SelectFieldStatusReport/SelectFieldStatusReport.tsx
|
|
2403
2611
|
import { DownOutlined as DownOutlined2 } from "@ant-design/icons";
|
|
2404
|
-
import { jsx as
|
|
2612
|
+
import { jsx as jsx30, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2405
2613
|
function SelectFieldStatusReport({
|
|
2406
2614
|
value,
|
|
2407
2615
|
onChange,
|
|
@@ -2414,7 +2622,7 @@ function SelectFieldStatusReport({
|
|
|
2414
2622
|
options
|
|
2415
2623
|
}) {
|
|
2416
2624
|
const selectedItem = status2.find((s) => s.value === value);
|
|
2417
|
-
return /* @__PURE__ */
|
|
2625
|
+
return /* @__PURE__ */ jsx30(
|
|
2418
2626
|
ConfigProvider10,
|
|
2419
2627
|
{
|
|
2420
2628
|
theme: {
|
|
@@ -2430,17 +2638,17 @@ function SelectFieldStatusReport({
|
|
|
2430
2638
|
fontFamily: "Kanit"
|
|
2431
2639
|
}
|
|
2432
2640
|
},
|
|
2433
|
-
children: /* @__PURE__ */
|
|
2434
|
-
/* @__PURE__ */
|
|
2435
|
-
/* @__PURE__ */
|
|
2641
|
+
children: /* @__PURE__ */ jsxs26("div", { className: "container-input", children: [
|
|
2642
|
+
/* @__PURE__ */ jsxs26("div", { children: [
|
|
2643
|
+
/* @__PURE__ */ jsx30("span", { className: "body-1", children: label }),
|
|
2436
2644
|
" ",
|
|
2437
|
-
required && /* @__PURE__ */
|
|
2645
|
+
required && /* @__PURE__ */ jsx30("span", { className: "text-red-500", children: "*" })
|
|
2438
2646
|
] }),
|
|
2439
|
-
/* @__PURE__ */
|
|
2647
|
+
/* @__PURE__ */ jsx30(
|
|
2440
2648
|
Select4,
|
|
2441
2649
|
{
|
|
2442
2650
|
disabled,
|
|
2443
|
-
suffixIcon: /* @__PURE__ */
|
|
2651
|
+
suffixIcon: /* @__PURE__ */ jsx30(DownOutlined2, { style: { color: value ? "#fff" : "#D9D9D9" } }),
|
|
2444
2652
|
value,
|
|
2445
2653
|
onChange,
|
|
2446
2654
|
className: `body-3 custom-select flex justify-center w-full ${className ?? ""}`,
|
|
@@ -2451,7 +2659,7 @@ function SelectFieldStatusReport({
|
|
|
2451
2659
|
showSearch: true
|
|
2452
2660
|
}
|
|
2453
2661
|
),
|
|
2454
|
-
error && /* @__PURE__ */
|
|
2662
|
+
error && /* @__PURE__ */ jsx30("p", { className: "text-red-500 caption-1", children: error })
|
|
2455
2663
|
] })
|
|
2456
2664
|
}
|
|
2457
2665
|
);
|
|
@@ -2459,8 +2667,8 @@ function SelectFieldStatusReport({
|
|
|
2459
2667
|
|
|
2460
2668
|
// src/Select/SelectFieldTag/SelectFieldTag.tsx
|
|
2461
2669
|
import { Select as Select5, ConfigProvider as ConfigProvider11 } from "antd";
|
|
2462
|
-
import { useState as
|
|
2463
|
-
import { jsx as
|
|
2670
|
+
import { useState as useState8 } from "react";
|
|
2671
|
+
import { jsx as jsx31, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2464
2672
|
function SelectFieldTag({
|
|
2465
2673
|
label,
|
|
2466
2674
|
required,
|
|
@@ -2472,10 +2680,10 @@ function SelectFieldTag({
|
|
|
2472
2680
|
onChange,
|
|
2473
2681
|
onClear
|
|
2474
2682
|
}) {
|
|
2475
|
-
const [internalValue, setInternalValue] =
|
|
2683
|
+
const [internalValue, setInternalValue] = useState8([]);
|
|
2476
2684
|
const isControlled = controlledValue !== void 0;
|
|
2477
2685
|
const value = isControlled ? controlledValue : internalValue;
|
|
2478
|
-
const [searchWord, setSearchWord] =
|
|
2686
|
+
const [searchWord, setSearchWord] = useState8("");
|
|
2479
2687
|
const handleChange = (val) => {
|
|
2480
2688
|
const trimValue = val.map((v) => v.trim());
|
|
2481
2689
|
const filtered = trimValue.filter((v) => v.trim() !== "");
|
|
@@ -2493,7 +2701,7 @@ function SelectFieldTag({
|
|
|
2493
2701
|
}
|
|
2494
2702
|
onChange?.([]);
|
|
2495
2703
|
};
|
|
2496
|
-
return /* @__PURE__ */
|
|
2704
|
+
return /* @__PURE__ */ jsx31(
|
|
2497
2705
|
ConfigProvider11,
|
|
2498
2706
|
{
|
|
2499
2707
|
theme: {
|
|
@@ -2501,13 +2709,13 @@ function SelectFieldTag({
|
|
|
2501
2709
|
fontFamily: "Kanit"
|
|
2502
2710
|
}
|
|
2503
2711
|
},
|
|
2504
|
-
children: /* @__PURE__ */
|
|
2505
|
-
/* @__PURE__ */
|
|
2506
|
-
/* @__PURE__ */
|
|
2712
|
+
children: /* @__PURE__ */ jsxs27("div", { className: "container-input", children: [
|
|
2713
|
+
/* @__PURE__ */ jsxs27("div", { children: [
|
|
2714
|
+
/* @__PURE__ */ jsx31("span", { className: "body-1", children: label }),
|
|
2507
2715
|
" ",
|
|
2508
|
-
required && /* @__PURE__ */
|
|
2716
|
+
required && /* @__PURE__ */ jsx31("span", { className: "text-red-500", children: "*" })
|
|
2509
2717
|
] }),
|
|
2510
|
-
/* @__PURE__ */
|
|
2718
|
+
/* @__PURE__ */ jsx31(
|
|
2511
2719
|
Select5,
|
|
2512
2720
|
{
|
|
2513
2721
|
mode: "tags",
|
|
@@ -2526,7 +2734,7 @@ function SelectFieldTag({
|
|
|
2526
2734
|
onClear
|
|
2527
2735
|
}
|
|
2528
2736
|
),
|
|
2529
|
-
error && /* @__PURE__ */
|
|
2737
|
+
error && /* @__PURE__ */ jsx31("p", { className: "text-red-500 caption-1", children: error })
|
|
2530
2738
|
] })
|
|
2531
2739
|
}
|
|
2532
2740
|
);
|
|
@@ -2535,8 +2743,8 @@ function SelectFieldTag({
|
|
|
2535
2743
|
// src/Select/SelectCustom/SelectCustom.tsx
|
|
2536
2744
|
import { IconTrash } from "@tabler/icons-react";
|
|
2537
2745
|
import { Select as Select6, ConfigProvider as ConfigProvider12 } from "antd";
|
|
2538
|
-
import { useState as
|
|
2539
|
-
import { jsx as
|
|
2746
|
+
import { useState as useState9 } from "react";
|
|
2747
|
+
import { jsx as jsx32, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2540
2748
|
function SelectCustom({
|
|
2541
2749
|
label = "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E42\u0E04\u0E23\u0E07\u0E01\u0E32\u0E23",
|
|
2542
2750
|
placeholder = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01",
|
|
@@ -2546,8 +2754,8 @@ function SelectCustom({
|
|
|
2546
2754
|
error,
|
|
2547
2755
|
onClear
|
|
2548
2756
|
}) {
|
|
2549
|
-
const [value, setValue] =
|
|
2550
|
-
const [valueList, setValueList] =
|
|
2757
|
+
const [value, setValue] = useState9([]);
|
|
2758
|
+
const [valueList, setValueList] = useState9([]);
|
|
2551
2759
|
const handleChange = (selectedValues) => {
|
|
2552
2760
|
const newValues = selectedValues.filter((v) => !valueList.includes(v));
|
|
2553
2761
|
setValueList((prev) => {
|
|
@@ -2565,7 +2773,7 @@ function SelectCustom({
|
|
|
2565
2773
|
});
|
|
2566
2774
|
};
|
|
2567
2775
|
const filteredOptions = options.filter((opt) => !valueList.includes(opt.value)).map((opt) => ({ value: opt.value, label: opt.label }));
|
|
2568
|
-
return /* @__PURE__ */
|
|
2776
|
+
return /* @__PURE__ */ jsx32(
|
|
2569
2777
|
ConfigProvider12,
|
|
2570
2778
|
{
|
|
2571
2779
|
theme: {
|
|
@@ -2574,13 +2782,13 @@ function SelectCustom({
|
|
|
2574
2782
|
fontSize: 16
|
|
2575
2783
|
}
|
|
2576
2784
|
},
|
|
2577
|
-
children: /* @__PURE__ */
|
|
2578
|
-
/* @__PURE__ */
|
|
2579
|
-
/* @__PURE__ */
|
|
2785
|
+
children: /* @__PURE__ */ jsxs28("div", { className: "container-input", children: [
|
|
2786
|
+
/* @__PURE__ */ jsxs28("div", { children: [
|
|
2787
|
+
/* @__PURE__ */ jsx32("span", { className: "body-1", children: label }),
|
|
2580
2788
|
" ",
|
|
2581
|
-
required && /* @__PURE__ */
|
|
2789
|
+
required && /* @__PURE__ */ jsx32("span", { className: "text-red-500", children: "*" })
|
|
2582
2790
|
] }),
|
|
2583
|
-
/* @__PURE__ */
|
|
2791
|
+
/* @__PURE__ */ jsx32(
|
|
2584
2792
|
Select6,
|
|
2585
2793
|
{
|
|
2586
2794
|
value,
|
|
@@ -2591,16 +2799,16 @@ function SelectCustom({
|
|
|
2591
2799
|
onClear
|
|
2592
2800
|
}
|
|
2593
2801
|
),
|
|
2594
|
-
error && /* @__PURE__ */
|
|
2595
|
-
/* @__PURE__ */
|
|
2596
|
-
/* @__PURE__ */
|
|
2597
|
-
/* @__PURE__ */
|
|
2802
|
+
error && /* @__PURE__ */ jsx32("p", { className: "text-red-500 caption-1", children: error }),
|
|
2803
|
+
/* @__PURE__ */ jsx32("div", { className: "w-full p-[2px] overflow-y-auto", children: valueList.map((v, index) => /* @__PURE__ */ jsxs28("div", { className: "flex justify-between items-center py-[2px] body-1", children: [
|
|
2804
|
+
/* @__PURE__ */ jsxs28("div", { className: "flex flex-row gap-[8px]", children: [
|
|
2805
|
+
/* @__PURE__ */ jsxs28("p", { children: [
|
|
2598
2806
|
index + 1,
|
|
2599
2807
|
"."
|
|
2600
2808
|
] }),
|
|
2601
|
-
/* @__PURE__ */
|
|
2809
|
+
/* @__PURE__ */ jsx32("p", { children: v })
|
|
2602
2810
|
] }),
|
|
2603
|
-
/* @__PURE__ */
|
|
2811
|
+
/* @__PURE__ */ jsx32(IconTrash, { className: "cursor-pointer", onClick: () => handleDelete(v) })
|
|
2604
2812
|
] }, index)) })
|
|
2605
2813
|
] })
|
|
2606
2814
|
}
|
|
@@ -2639,9 +2847,9 @@ var quarters = [
|
|
|
2639
2847
|
];
|
|
2640
2848
|
|
|
2641
2849
|
// src/SortFilter/SortFilter.tsx
|
|
2642
|
-
import { useState as
|
|
2850
|
+
import { useState as useState10 } from "react";
|
|
2643
2851
|
import { IconSortDescending as IconSortDescending2, IconFilter } from "@tabler/icons-react";
|
|
2644
|
-
import { jsx as
|
|
2852
|
+
import { jsx as jsx33, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2645
2853
|
function SortFilter({
|
|
2646
2854
|
showYear = true,
|
|
2647
2855
|
showQuarter = true,
|
|
@@ -2649,10 +2857,10 @@ function SortFilter({
|
|
|
2649
2857
|
onSortClick,
|
|
2650
2858
|
onFilterClick
|
|
2651
2859
|
}) {
|
|
2652
|
-
const [yearValue, setYearValue] =
|
|
2653
|
-
const [monthValue, setMonthValue] =
|
|
2654
|
-
const [quarterValue, setQuartersValue] =
|
|
2655
|
-
return /* @__PURE__ */
|
|
2860
|
+
const [yearValue, setYearValue] = useState10();
|
|
2861
|
+
const [monthValue, setMonthValue] = useState10();
|
|
2862
|
+
const [quarterValue, setQuartersValue] = useState10();
|
|
2863
|
+
return /* @__PURE__ */ jsx33(
|
|
2656
2864
|
ConfigProvider13,
|
|
2657
2865
|
{
|
|
2658
2866
|
theme: {
|
|
@@ -2660,12 +2868,12 @@ function SortFilter({
|
|
|
2660
2868
|
fontFamily: "Kanit"
|
|
2661
2869
|
}
|
|
2662
2870
|
},
|
|
2663
|
-
children: /* @__PURE__ */
|
|
2664
|
-
/* @__PURE__ */
|
|
2665
|
-
showYear && /* @__PURE__ */
|
|
2871
|
+
children: /* @__PURE__ */ jsxs29("div", { className: "w-full flex items-center justify-between", children: [
|
|
2872
|
+
/* @__PURE__ */ jsxs29("div", { className: "w-full flex gap-[10px]", children: [
|
|
2873
|
+
showYear && /* @__PURE__ */ jsx33("div", { className: "w-[200px]", children: /* @__PURE__ */ jsx33(
|
|
2666
2874
|
SelectField,
|
|
2667
2875
|
{
|
|
2668
|
-
prefix: /* @__PURE__ */
|
|
2876
|
+
prefix: /* @__PURE__ */ jsx33(CalendarOutlined, {}),
|
|
2669
2877
|
onChange: setYearValue,
|
|
2670
2878
|
options: years.map((s) => ({
|
|
2671
2879
|
value: s.value,
|
|
@@ -2675,10 +2883,10 @@ function SortFilter({
|
|
|
2675
2883
|
value: yearValue
|
|
2676
2884
|
}
|
|
2677
2885
|
) }),
|
|
2678
|
-
showMonth && /* @__PURE__ */
|
|
2886
|
+
showMonth && /* @__PURE__ */ jsx33("div", { className: "w-[200px]", children: /* @__PURE__ */ jsx33(
|
|
2679
2887
|
SelectField,
|
|
2680
2888
|
{
|
|
2681
|
-
prefix: /* @__PURE__ */
|
|
2889
|
+
prefix: /* @__PURE__ */ jsx33(CalendarOutlined, {}),
|
|
2682
2890
|
onChange: setMonthValue,
|
|
2683
2891
|
options: months.map((s) => ({
|
|
2684
2892
|
value: s.value,
|
|
@@ -2688,10 +2896,10 @@ function SortFilter({
|
|
|
2688
2896
|
placeholder: "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E40\u0E14\u0E37\u0E2D\u0E19"
|
|
2689
2897
|
}
|
|
2690
2898
|
) }),
|
|
2691
|
-
showQuarter && /* @__PURE__ */
|
|
2899
|
+
showQuarter && /* @__PURE__ */ jsx33("div", { className: "w-[200px]", children: /* @__PURE__ */ jsx33(
|
|
2692
2900
|
SelectField,
|
|
2693
2901
|
{
|
|
2694
|
-
prefix: /* @__PURE__ */
|
|
2902
|
+
prefix: /* @__PURE__ */ jsx33(CalendarOutlined, {}),
|
|
2695
2903
|
onChange: setQuartersValue,
|
|
2696
2904
|
options: quarters.map((s) => ({
|
|
2697
2905
|
value: s.value,
|
|
@@ -2702,8 +2910,8 @@ function SortFilter({
|
|
|
2702
2910
|
}
|
|
2703
2911
|
) })
|
|
2704
2912
|
] }),
|
|
2705
|
-
/* @__PURE__ */
|
|
2706
|
-
/* @__PURE__ */
|
|
2913
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex gap-[10px]", children: [
|
|
2914
|
+
/* @__PURE__ */ jsx33(
|
|
2707
2915
|
IconSortDescending2,
|
|
2708
2916
|
{
|
|
2709
2917
|
size: 24,
|
|
@@ -2711,7 +2919,7 @@ function SortFilter({
|
|
|
2711
2919
|
onClick: onSortClick
|
|
2712
2920
|
}
|
|
2713
2921
|
),
|
|
2714
|
-
/* @__PURE__ */
|
|
2922
|
+
/* @__PURE__ */ jsx33(
|
|
2715
2923
|
IconFilter,
|
|
2716
2924
|
{
|
|
2717
2925
|
size: 24,
|
|
@@ -2727,8 +2935,8 @@ function SortFilter({
|
|
|
2727
2935
|
|
|
2728
2936
|
// src/Upload/FileUploader/FileUploader.tsx
|
|
2729
2937
|
import { IconPaperclip, IconUpload, IconTrash as IconTrash2 } from "@tabler/icons-react";
|
|
2730
|
-
import { useRef as
|
|
2731
|
-
import { Fragment as Fragment5, jsx as
|
|
2938
|
+
import { useRef as useRef4, useState as useState11 } from "react";
|
|
2939
|
+
import { Fragment as Fragment5, jsx as jsx34, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
2732
2940
|
function FileUploader({
|
|
2733
2941
|
onUpload,
|
|
2734
2942
|
onError,
|
|
@@ -2738,12 +2946,14 @@ function FileUploader({
|
|
|
2738
2946
|
disabled,
|
|
2739
2947
|
mode = "drop",
|
|
2740
2948
|
description,
|
|
2741
|
-
label
|
|
2949
|
+
label,
|
|
2950
|
+
value
|
|
2742
2951
|
}) {
|
|
2743
|
-
const [
|
|
2744
|
-
const [uploading, setUploading] =
|
|
2745
|
-
const [dragActive, setDragActive] =
|
|
2746
|
-
const inputRef =
|
|
2952
|
+
const [internalFileList, setInternalFileList] = useState11([]);
|
|
2953
|
+
const [uploading, setUploading] = useState11(false);
|
|
2954
|
+
const [dragActive, setDragActive] = useState11(false);
|
|
2955
|
+
const inputRef = useRef4(null);
|
|
2956
|
+
const filesToDisplay = value || internalFileList;
|
|
2747
2957
|
const validateFile = (file) => {
|
|
2748
2958
|
if (accept && !accept.includes(file.type)) {
|
|
2749
2959
|
onError?.(`Invalid file type. file: ${file.name}`);
|
|
@@ -2763,9 +2973,11 @@ function FileUploader({
|
|
|
2763
2973
|
if (onRemove) {
|
|
2764
2974
|
await onRemove(index);
|
|
2765
2975
|
}
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2976
|
+
if (!value) {
|
|
2977
|
+
const updatedList = [...internalFileList];
|
|
2978
|
+
updatedList.splice(index, 1);
|
|
2979
|
+
setInternalFileList(updatedList);
|
|
2980
|
+
}
|
|
2769
2981
|
} catch (error) {
|
|
2770
2982
|
console.log(error);
|
|
2771
2983
|
}
|
|
@@ -2783,13 +2995,19 @@ function FileUploader({
|
|
|
2783
2995
|
if (!files) return;
|
|
2784
2996
|
const fileArray = Array.from(files);
|
|
2785
2997
|
for (const file of fileArray) {
|
|
2786
|
-
|
|
2998
|
+
try {
|
|
2999
|
+
validateFile(file);
|
|
3000
|
+
} catch (e) {
|
|
3001
|
+
continue;
|
|
3002
|
+
}
|
|
2787
3003
|
setUploading(true);
|
|
2788
3004
|
try {
|
|
2789
3005
|
if (onUpload) {
|
|
2790
3006
|
await onUpload(file);
|
|
2791
3007
|
}
|
|
2792
|
-
|
|
3008
|
+
if (!value) {
|
|
3009
|
+
setInternalFileList((prev) => [...prev, file]);
|
|
3010
|
+
}
|
|
2793
3011
|
} catch (err) {
|
|
2794
3012
|
console.log("catch");
|
|
2795
3013
|
console.error(err);
|
|
@@ -2799,10 +3017,10 @@ function FileUploader({
|
|
|
2799
3017
|
}
|
|
2800
3018
|
if (inputRef.current) inputRef.current.value = "";
|
|
2801
3019
|
};
|
|
2802
|
-
return /* @__PURE__ */
|
|
2803
|
-
label && /* @__PURE__ */
|
|
2804
|
-
/* @__PURE__ */
|
|
2805
|
-
mode === "upload" ? /* @__PURE__ */
|
|
3020
|
+
return /* @__PURE__ */ jsxs30("div", { className: "w-full", children: [
|
|
3021
|
+
label && /* @__PURE__ */ jsx34("p", { className: "body-1", children: label }),
|
|
3022
|
+
/* @__PURE__ */ jsxs30("div", { children: [
|
|
3023
|
+
mode === "upload" ? /* @__PURE__ */ jsx34(
|
|
2806
3024
|
"button",
|
|
2807
3025
|
{
|
|
2808
3026
|
type: "button",
|
|
@@ -2810,15 +3028,15 @@ function FileUploader({
|
|
|
2810
3028
|
className: `h-[34px] flex justify-center items-center gap-2 w-full rounded-[2px] border border-gray-200 body-1
|
|
2811
3029
|
${disabled ? "cursor-not-allowed text-gray-400 bg-gray-100" : "cursor-pointer hover:text-primary-400 hover:border-primary-200 duration-300"}`,
|
|
2812
3030
|
disabled: disabled ? disabled : uploading,
|
|
2813
|
-
children: uploading ? /* @__PURE__ */
|
|
2814
|
-
/* @__PURE__ */
|
|
3031
|
+
children: uploading ? /* @__PURE__ */ jsxs30(Fragment5, { children: [
|
|
3032
|
+
/* @__PURE__ */ jsx34(Loader, { size: 15 }),
|
|
2815
3033
|
" \u0E01\u0E33\u0E25\u0E31\u0E07\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14"
|
|
2816
|
-
] }) : /* @__PURE__ */
|
|
2817
|
-
/* @__PURE__ */
|
|
3034
|
+
] }) : /* @__PURE__ */ jsxs30(Fragment5, { children: [
|
|
3035
|
+
/* @__PURE__ */ jsx34(IconUpload, { size: 15, className: "text-gray-400" }),
|
|
2818
3036
|
" \u0E41\u0E19\u0E1A\u0E44\u0E1F\u0E25\u0E4C"
|
|
2819
3037
|
] })
|
|
2820
3038
|
}
|
|
2821
|
-
) : /* @__PURE__ */
|
|
3039
|
+
) : /* @__PURE__ */ jsx34(
|
|
2822
3040
|
"div",
|
|
2823
3041
|
{
|
|
2824
3042
|
className: `min-w-[400px] min-h-[120px] flex justify-center items-center border-2 border-dashed rounded-md p-4 transition-colors body-1
|
|
@@ -2832,17 +3050,17 @@ function FileUploader({
|
|
|
2832
3050
|
},
|
|
2833
3051
|
onDragLeave: () => setDragActive(false),
|
|
2834
3052
|
onDrop: handleDrop,
|
|
2835
|
-
children: uploading ? /* @__PURE__ */
|
|
2836
|
-
/* @__PURE__ */
|
|
3053
|
+
children: uploading ? /* @__PURE__ */ jsxs30("div", { className: "flex justify-center items-center gap-2", children: [
|
|
3054
|
+
/* @__PURE__ */ jsx34(Loader, { size: 15 }),
|
|
2837
3055
|
" \u0E01\u0E33\u0E25\u0E31\u0E07\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14"
|
|
2838
|
-
] }) : /* @__PURE__ */
|
|
2839
|
-
/* @__PURE__ */
|
|
2840
|
-
/* @__PURE__ */
|
|
2841
|
-
/* @__PURE__ */
|
|
3056
|
+
] }) : /* @__PURE__ */ jsxs30("div", { className: "flex flex-col items-center gap-2", children: [
|
|
3057
|
+
/* @__PURE__ */ jsx34(IconUpload, { size: 20 }),
|
|
3058
|
+
/* @__PURE__ */ jsx34("span", { className: "body-1", children: "\u0E04\u0E25\u0E34\u0E01\u0E2B\u0E23\u0E37\u0E2D\u0E25\u0E32\u0E01\u0E44\u0E1F\u0E25\u0E4C\u0E21\u0E32\u0E17\u0E35\u0E48\u0E1A\u0E23\u0E34\u0E40\u0E27\u0E13\u0E19\u0E35\u0E49\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14" }),
|
|
3059
|
+
/* @__PURE__ */ jsx34("span", { className: "text-gray-400 body-3", children: "\u0E23\u0E2D\u0E07\u0E23\u0E31\u0E1A\u0E01\u0E32\u0E23\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14\u0E41\u0E1A\u0E1A\u0E40\u0E14\u0E35\u0E48\u0E22\u0E27\u0E2B\u0E23\u0E37\u0E2D\u0E2B\u0E25\u0E32\u0E22\u0E44\u0E1F\u0E25\u0E4C" })
|
|
2842
3060
|
] })
|
|
2843
3061
|
}
|
|
2844
3062
|
),
|
|
2845
|
-
/* @__PURE__ */
|
|
3063
|
+
/* @__PURE__ */ jsx34(
|
|
2846
3064
|
"input",
|
|
2847
3065
|
{
|
|
2848
3066
|
type: "file",
|
|
@@ -2855,13 +3073,13 @@ function FileUploader({
|
|
|
2855
3073
|
}
|
|
2856
3074
|
)
|
|
2857
3075
|
] }),
|
|
2858
|
-
description && /* @__PURE__ */
|
|
2859
|
-
/* @__PURE__ */
|
|
2860
|
-
/* @__PURE__ */
|
|
2861
|
-
/* @__PURE__ */
|
|
2862
|
-
/* @__PURE__ */
|
|
3076
|
+
description && /* @__PURE__ */ jsx34("p", { className: "text-gray-400 body-4", children: description }),
|
|
3077
|
+
/* @__PURE__ */ jsx34("div", { className: "mt-[8px]", children: filesToDisplay.length !== 0 && filesToDisplay.map((file, index) => /* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-2 rounded-[4px] px-[8px] py-[4px] body-1", children: [
|
|
3078
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-2 w-[75%] overflow-hidden", children: [
|
|
3079
|
+
/* @__PURE__ */ jsx34("div", { className: "w-[15px] h-[15px]", children: /* @__PURE__ */ jsx34(IconPaperclip, { size: 15 }) }),
|
|
3080
|
+
/* @__PURE__ */ jsx34("span", { className: "truncate", children: file.name || file.fileName })
|
|
2863
3081
|
] }),
|
|
2864
|
-
/* @__PURE__ */
|
|
3082
|
+
/* @__PURE__ */ jsx34(
|
|
2865
3083
|
IconTrash2,
|
|
2866
3084
|
{
|
|
2867
3085
|
size: 20,
|
|
@@ -2897,7 +3115,7 @@ function messageLoading(content, duration) {
|
|
|
2897
3115
|
// src/Breadcrumb/Breadcrumb.tsx
|
|
2898
3116
|
import { ConfigProvider as ConfigProvider14 } from "antd";
|
|
2899
3117
|
import { Breadcrumb } from "antd";
|
|
2900
|
-
import { jsx as
|
|
3118
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
2901
3119
|
function Breadcrumbs({
|
|
2902
3120
|
items,
|
|
2903
3121
|
separator,
|
|
@@ -2905,7 +3123,7 @@ function Breadcrumbs({
|
|
|
2905
3123
|
classname,
|
|
2906
3124
|
params
|
|
2907
3125
|
}) {
|
|
2908
|
-
return /* @__PURE__ */
|
|
3126
|
+
return /* @__PURE__ */ jsx35(
|
|
2909
3127
|
ConfigProvider14,
|
|
2910
3128
|
{
|
|
2911
3129
|
theme: {
|
|
@@ -2913,7 +3131,7 @@ function Breadcrumbs({
|
|
|
2913
3131
|
fontFamily: "Kanit"
|
|
2914
3132
|
}
|
|
2915
3133
|
},
|
|
2916
|
-
children: /* @__PURE__ */
|
|
3134
|
+
children: /* @__PURE__ */ jsx35(
|
|
2917
3135
|
Breadcrumb,
|
|
2918
3136
|
{
|
|
2919
3137
|
items,
|
|
@@ -2929,7 +3147,7 @@ function Breadcrumbs({
|
|
|
2929
3147
|
|
|
2930
3148
|
// src/HeadingPage/HeadingPage.tsx
|
|
2931
3149
|
import { ConfigProvider as ConfigProvider15 } from "antd";
|
|
2932
|
-
import { jsx as
|
|
3150
|
+
import { jsx as jsx36, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
2933
3151
|
function HeadingPage({ Heading }) {
|
|
2934
3152
|
const today = (/* @__PURE__ */ new Date()).toLocaleDateString("th-TH", {
|
|
2935
3153
|
weekday: "long",
|
|
@@ -2937,7 +3155,7 @@ function HeadingPage({ Heading }) {
|
|
|
2937
3155
|
month: "long",
|
|
2938
3156
|
year: "numeric"
|
|
2939
3157
|
});
|
|
2940
|
-
return /* @__PURE__ */
|
|
3158
|
+
return /* @__PURE__ */ jsx36(
|
|
2941
3159
|
ConfigProvider15,
|
|
2942
3160
|
{
|
|
2943
3161
|
theme: {
|
|
@@ -2945,9 +3163,9 @@ function HeadingPage({ Heading }) {
|
|
|
2945
3163
|
fontFamily: "Kanit"
|
|
2946
3164
|
}
|
|
2947
3165
|
},
|
|
2948
|
-
children: /* @__PURE__ */
|
|
2949
|
-
/* @__PURE__ */
|
|
2950
|
-
/* @__PURE__ */
|
|
3166
|
+
children: /* @__PURE__ */ jsxs31("div", { className: "flex flex-col gap-[10px] px-[20px] py-[10px]", children: [
|
|
3167
|
+
/* @__PURE__ */ jsx36("p", { className: "headline-5", children: Heading }),
|
|
3168
|
+
/* @__PURE__ */ jsxs31("p", { className: "body-1", children: [
|
|
2951
3169
|
" \u0E27\u0E31\u0E19\u0E19\u0E35\u0E49 ",
|
|
2952
3170
|
today
|
|
2953
3171
|
] })
|
|
@@ -2958,8 +3176,8 @@ function HeadingPage({ Heading }) {
|
|
|
2958
3176
|
|
|
2959
3177
|
// src/Progress/ProgressBar.tsx
|
|
2960
3178
|
import { ConfigProvider as ConfigProvider16, Progress } from "antd";
|
|
2961
|
-
import { useEffect as
|
|
2962
|
-
import { jsx as
|
|
3179
|
+
import { useEffect as useEffect4, useRef as useRef5, useState as useState12 } from "react";
|
|
3180
|
+
import { jsx as jsx37, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
2963
3181
|
function ProgressBar({
|
|
2964
3182
|
percent = 0,
|
|
2965
3183
|
size = "default",
|
|
@@ -2972,8 +3190,8 @@ function ProgressBar({
|
|
|
2972
3190
|
steps,
|
|
2973
3191
|
isCheckPoints
|
|
2974
3192
|
}) {
|
|
2975
|
-
const [barWidth, setBarWidth] =
|
|
2976
|
-
const progressRef =
|
|
3193
|
+
const [barWidth, setBarWidth] = useState12(0);
|
|
3194
|
+
const progressRef = useRef5(null);
|
|
2977
3195
|
let strokeColor = "--color-green-500";
|
|
2978
3196
|
const defaultStrokeWidth = type === "circle" ? 13 : strokeWidth ?? 8;
|
|
2979
3197
|
const defaultSize = type === "circle" ? 43 : size;
|
|
@@ -2981,7 +3199,7 @@ function ProgressBar({
|
|
|
2981
3199
|
const minCheckpoint = Math.min(...checkpoints);
|
|
2982
3200
|
strokeColor = percent >= minCheckpoint ? "var(--color-green-500)" : "var(--color-red-500)";
|
|
2983
3201
|
}
|
|
2984
|
-
|
|
3202
|
+
useEffect4(() => {
|
|
2985
3203
|
const inner = progressRef.current?.querySelector(".ant-progress-inner");
|
|
2986
3204
|
if (!inner) return;
|
|
2987
3205
|
const observer = new ResizeObserver(() => {
|
|
@@ -2990,7 +3208,7 @@ function ProgressBar({
|
|
|
2990
3208
|
observer.observe(inner);
|
|
2991
3209
|
return () => observer.disconnect();
|
|
2992
3210
|
}, []);
|
|
2993
|
-
return /* @__PURE__ */
|
|
3211
|
+
return /* @__PURE__ */ jsx37(
|
|
2994
3212
|
ConfigProvider16,
|
|
2995
3213
|
{
|
|
2996
3214
|
theme: {
|
|
@@ -2998,8 +3216,8 @@ function ProgressBar({
|
|
|
2998
3216
|
fontFamily: "Kanit"
|
|
2999
3217
|
}
|
|
3000
3218
|
},
|
|
3001
|
-
children: /* @__PURE__ */
|
|
3002
|
-
/* @__PURE__ */
|
|
3219
|
+
children: /* @__PURE__ */ jsxs32("div", { className: "relative w-full", ref: progressRef, children: [
|
|
3220
|
+
/* @__PURE__ */ jsx37(
|
|
3003
3221
|
Progress,
|
|
3004
3222
|
{
|
|
3005
3223
|
className: "w-full",
|
|
@@ -3015,7 +3233,7 @@ function ProgressBar({
|
|
|
3015
3233
|
strokeColor
|
|
3016
3234
|
}
|
|
3017
3235
|
),
|
|
3018
|
-
barWidth > 0 && isCheckPoints && type !== "circle" && checkpoints.map((cp) => /* @__PURE__ */
|
|
3236
|
+
barWidth > 0 && isCheckPoints && type !== "circle" && checkpoints.map((cp) => /* @__PURE__ */ jsx37(
|
|
3019
3237
|
"div",
|
|
3020
3238
|
{
|
|
3021
3239
|
className: "checkpoint absolute top-0",
|
|
@@ -3038,24 +3256,24 @@ function ProgressBar({
|
|
|
3038
3256
|
|
|
3039
3257
|
// src/KpiSection/KpiSection.tsx
|
|
3040
3258
|
import { ConfigProvider as ConfigProvider17, message } from "antd";
|
|
3041
|
-
import { useEffect as
|
|
3259
|
+
import { useEffect as useEffect5, useState as useState14 } from "react";
|
|
3042
3260
|
|
|
3043
3261
|
// src/KpiSection/hooks/useGetKpiSection.ts
|
|
3044
|
-
import { useState as
|
|
3262
|
+
import { useState as useState13 } from "react";
|
|
3045
3263
|
import cuid from "cuid";
|
|
3046
3264
|
function useGetKpiSection() {
|
|
3047
|
-
const [nameKpi, setNameKpi] =
|
|
3048
|
-
const [kpiValue, setKpiValue] =
|
|
3049
|
-
const [unitValue, setUnitValue] =
|
|
3050
|
-
const [kpiList, setKpiList] =
|
|
3051
|
-
const [editingBackup, setEditingBackup] =
|
|
3052
|
-
const [selected, setSelected] =
|
|
3053
|
-
const [errors, setErrors] =
|
|
3265
|
+
const [nameKpi, setNameKpi] = useState13("");
|
|
3266
|
+
const [kpiValue, setKpiValue] = useState13("");
|
|
3267
|
+
const [unitValue, setUnitValue] = useState13("");
|
|
3268
|
+
const [kpiList, setKpiList] = useState13([]);
|
|
3269
|
+
const [editingBackup, setEditingBackup] = useState13({});
|
|
3270
|
+
const [selected, setSelected] = useState13("2");
|
|
3271
|
+
const [errors, setErrors] = useState13({
|
|
3054
3272
|
nameKpi: "",
|
|
3055
3273
|
kpiValue: "",
|
|
3056
3274
|
unitValue: ""
|
|
3057
3275
|
});
|
|
3058
|
-
const [itemErrors, setItemErrors] =
|
|
3276
|
+
const [itemErrors, setItemErrors] = useState13({});
|
|
3059
3277
|
const options = [
|
|
3060
3278
|
{ value: "1", label: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21" },
|
|
3061
3279
|
{ value: "2", label: "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02" }
|
|
@@ -3188,7 +3406,7 @@ function useGetKpiSection() {
|
|
|
3188
3406
|
|
|
3189
3407
|
// src/KpiSection/KpiSection.tsx
|
|
3190
3408
|
import { IconCheck as IconCheck2, IconCirclePlus, IconPencil, IconTrash as IconTrash3, IconX as IconX2 } from "@tabler/icons-react";
|
|
3191
|
-
import { Fragment as Fragment6, jsx as
|
|
3409
|
+
import { Fragment as Fragment6, jsx as jsx38, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
3192
3410
|
function KpiSection({ type, onChangeKpiList }) {
|
|
3193
3411
|
const {
|
|
3194
3412
|
handleAddKpi,
|
|
@@ -3209,16 +3427,16 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3209
3427
|
setItemErrors
|
|
3210
3428
|
} = useGetKpiSection();
|
|
3211
3429
|
const [messageApi2, messageContainer] = message.useMessage();
|
|
3212
|
-
const [hasShownError, setHasShownError] =
|
|
3213
|
-
|
|
3430
|
+
const [hasShownError, setHasShownError] = useState14(false);
|
|
3431
|
+
useEffect5(() => {
|
|
3214
3432
|
setMessageApi(messageApi2);
|
|
3215
3433
|
}, [messageApi2]);
|
|
3216
|
-
|
|
3434
|
+
useEffect5(() => {
|
|
3217
3435
|
if (onChangeKpiList) {
|
|
3218
3436
|
onChangeKpiList(kpiList);
|
|
3219
3437
|
}
|
|
3220
3438
|
}, [kpiList]);
|
|
3221
|
-
return /* @__PURE__ */
|
|
3439
|
+
return /* @__PURE__ */ jsx38(
|
|
3222
3440
|
ConfigProvider17,
|
|
3223
3441
|
{
|
|
3224
3442
|
theme: {
|
|
@@ -3227,11 +3445,11 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3227
3445
|
fontSize: 16
|
|
3228
3446
|
}
|
|
3229
3447
|
},
|
|
3230
|
-
children: /* @__PURE__ */
|
|
3448
|
+
children: /* @__PURE__ */ jsxs33("div", { className: "container-input", children: [
|
|
3231
3449
|
messageContainer,
|
|
3232
|
-
type === "number" && /* @__PURE__ */
|
|
3233
|
-
/* @__PURE__ */
|
|
3234
|
-
/* @__PURE__ */
|
|
3450
|
+
type === "number" && /* @__PURE__ */ jsxs33("div", { className: "space-y-4", children: [
|
|
3451
|
+
/* @__PURE__ */ jsxs33("div", { className: "grid grid-cols-[1fr_200px_200px_50px] w-full gap-[24px] items-start", children: [
|
|
3452
|
+
/* @__PURE__ */ jsx38(
|
|
3235
3453
|
InputField,
|
|
3236
3454
|
{
|
|
3237
3455
|
value: nameKpi,
|
|
@@ -3243,7 +3461,7 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3243
3461
|
error: errors.nameKpi
|
|
3244
3462
|
}
|
|
3245
3463
|
),
|
|
3246
|
-
/* @__PURE__ */
|
|
3464
|
+
/* @__PURE__ */ jsx38(
|
|
3247
3465
|
InputField,
|
|
3248
3466
|
{
|
|
3249
3467
|
value: kpiValue,
|
|
@@ -3267,7 +3485,7 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3267
3485
|
error: errors.kpiValue
|
|
3268
3486
|
}
|
|
3269
3487
|
),
|
|
3270
|
-
/* @__PURE__ */
|
|
3488
|
+
/* @__PURE__ */ jsx38(
|
|
3271
3489
|
InputField,
|
|
3272
3490
|
{
|
|
3273
3491
|
value: unitValue,
|
|
@@ -3279,7 +3497,7 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3279
3497
|
error: errors.unitValue
|
|
3280
3498
|
}
|
|
3281
3499
|
),
|
|
3282
|
-
/* @__PURE__ */
|
|
3500
|
+
/* @__PURE__ */ jsx38("div", { className: `flex justify-end mt-[28px]`, children: /* @__PURE__ */ jsx38(
|
|
3283
3501
|
IconCirclePlus,
|
|
3284
3502
|
{
|
|
3285
3503
|
className: "w-[40px] h-[40px] cursor-pointer hover:scale-110 transition",
|
|
@@ -3288,17 +3506,17 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3288
3506
|
}
|
|
3289
3507
|
) })
|
|
3290
3508
|
] }),
|
|
3291
|
-
/* @__PURE__ */
|
|
3509
|
+
/* @__PURE__ */ jsx38("div", { children: kpiList.map((kpi, index) => /* @__PURE__ */ jsxs33(
|
|
3292
3510
|
"div",
|
|
3293
3511
|
{
|
|
3294
3512
|
className: "grid grid-cols-[30px_1fr_100px_120px_80px] items-start py-2 body-1 gap-[8px]",
|
|
3295
3513
|
children: [
|
|
3296
|
-
/* @__PURE__ */
|
|
3514
|
+
/* @__PURE__ */ jsxs33("p", { className: `body-1 ${kpi.isEditing ? "mt-[12px]" : ""}`, children: [
|
|
3297
3515
|
index + 1,
|
|
3298
3516
|
"."
|
|
3299
3517
|
] }),
|
|
3300
|
-
kpi.isEditing ? /* @__PURE__ */
|
|
3301
|
-
/* @__PURE__ */
|
|
3518
|
+
kpi.isEditing ? /* @__PURE__ */ jsxs33(Fragment6, { children: [
|
|
3519
|
+
/* @__PURE__ */ jsx38(
|
|
3302
3520
|
InputField,
|
|
3303
3521
|
{
|
|
3304
3522
|
value: kpi.name,
|
|
@@ -3308,7 +3526,7 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3308
3526
|
error: itemErrors[kpi.id]?.name
|
|
3309
3527
|
}
|
|
3310
3528
|
),
|
|
3311
|
-
/* @__PURE__ */
|
|
3529
|
+
/* @__PURE__ */ jsx38(
|
|
3312
3530
|
InputField,
|
|
3313
3531
|
{
|
|
3314
3532
|
value: kpi.value?.toString(),
|
|
@@ -3333,7 +3551,7 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3333
3551
|
error: itemErrors[kpi.id]?.value
|
|
3334
3552
|
}
|
|
3335
3553
|
),
|
|
3336
|
-
/* @__PURE__ */
|
|
3554
|
+
/* @__PURE__ */ jsx38(
|
|
3337
3555
|
InputField,
|
|
3338
3556
|
{
|
|
3339
3557
|
value: kpi.unit,
|
|
@@ -3343,29 +3561,29 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3343
3561
|
error: itemErrors[kpi.id]?.unit
|
|
3344
3562
|
}
|
|
3345
3563
|
),
|
|
3346
|
-
/* @__PURE__ */
|
|
3564
|
+
/* @__PURE__ */ jsxs33(
|
|
3347
3565
|
"div",
|
|
3348
3566
|
{
|
|
3349
3567
|
className: `flex gap-2 justify-end self-center ${!!itemErrors[kpi.id]?.value || !!itemErrors[kpi.id]?.unit || !!itemErrors[kpi.id]?.name ? "mt-[-12px]" : ""}`,
|
|
3350
3568
|
children: [
|
|
3351
|
-
/* @__PURE__ */
|
|
3569
|
+
/* @__PURE__ */ jsx38(
|
|
3352
3570
|
IconCheck2,
|
|
3353
3571
|
{
|
|
3354
3572
|
className: "w-[30px] h-[30px] cursor-pointer",
|
|
3355
3573
|
onClick: () => handleSave(kpi.id, type)
|
|
3356
3574
|
}
|
|
3357
3575
|
),
|
|
3358
|
-
/* @__PURE__ */
|
|
3576
|
+
/* @__PURE__ */ jsx38(IconX2, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleCancel(kpi.id) })
|
|
3359
3577
|
]
|
|
3360
3578
|
}
|
|
3361
3579
|
)
|
|
3362
|
-
] }) : /* @__PURE__ */
|
|
3363
|
-
/* @__PURE__ */
|
|
3364
|
-
/* @__PURE__ */
|
|
3365
|
-
/* @__PURE__ */
|
|
3366
|
-
/* @__PURE__ */
|
|
3367
|
-
/* @__PURE__ */
|
|
3368
|
-
/* @__PURE__ */
|
|
3580
|
+
] }) : /* @__PURE__ */ jsxs33(Fragment6, { children: [
|
|
3581
|
+
/* @__PURE__ */ jsx38("p", { className: "body-1", children: kpi.name }),
|
|
3582
|
+
/* @__PURE__ */ jsx38("p", { className: "body-1", children: kpi.value }),
|
|
3583
|
+
/* @__PURE__ */ jsx38("p", { className: "body-1", children: kpi.unit }),
|
|
3584
|
+
/* @__PURE__ */ jsxs33("div", { className: "flex gap-3 justify-end", children: [
|
|
3585
|
+
/* @__PURE__ */ jsx38(IconPencil, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleEdit(kpi.id) }),
|
|
3586
|
+
/* @__PURE__ */ jsx38(IconTrash3, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleDelete(kpi.id) })
|
|
3369
3587
|
] })
|
|
3370
3588
|
] })
|
|
3371
3589
|
]
|
|
@@ -3373,9 +3591,9 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3373
3591
|
kpi.id
|
|
3374
3592
|
)) })
|
|
3375
3593
|
] }),
|
|
3376
|
-
type === "text" && /* @__PURE__ */
|
|
3377
|
-
/* @__PURE__ */
|
|
3378
|
-
/* @__PURE__ */
|
|
3594
|
+
type === "text" && /* @__PURE__ */ jsxs33("div", { className: "space-y-4", children: [
|
|
3595
|
+
/* @__PURE__ */ jsxs33("div", { className: "grid grid-cols-[1fr_50px] w-full gap-[24px] items-start", children: [
|
|
3596
|
+
/* @__PURE__ */ jsx38(
|
|
3379
3597
|
InputField,
|
|
3380
3598
|
{
|
|
3381
3599
|
value: nameKpi,
|
|
@@ -3387,7 +3605,7 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3387
3605
|
error: errors.nameKpi
|
|
3388
3606
|
}
|
|
3389
3607
|
),
|
|
3390
|
-
/* @__PURE__ */
|
|
3608
|
+
/* @__PURE__ */ jsx38("div", { className: `flex justify-end mt-[28px]`, children: /* @__PURE__ */ jsx38(
|
|
3391
3609
|
IconCirclePlus,
|
|
3392
3610
|
{
|
|
3393
3611
|
className: "w-[40px] h-[40px] cursor-pointer hover:scale-110 transition",
|
|
@@ -3396,13 +3614,13 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3396
3614
|
}
|
|
3397
3615
|
) })
|
|
3398
3616
|
] }),
|
|
3399
|
-
/* @__PURE__ */
|
|
3400
|
-
/* @__PURE__ */
|
|
3617
|
+
/* @__PURE__ */ jsx38("div", { children: kpiList.map((kpi, index) => /* @__PURE__ */ jsxs33("div", { className: "grid grid-cols-[30px_1fr_80px] items-start py-2 body-1 gap-[8px]", children: [
|
|
3618
|
+
/* @__PURE__ */ jsxs33("p", { className: `body-1 ${kpi.isEditing ? "mt-[12px]" : ""}`, children: [
|
|
3401
3619
|
index + 1,
|
|
3402
3620
|
"."
|
|
3403
3621
|
] }),
|
|
3404
|
-
kpi.isEditing ? /* @__PURE__ */
|
|
3405
|
-
/* @__PURE__ */
|
|
3622
|
+
kpi.isEditing ? /* @__PURE__ */ jsxs33(Fragment6, { children: [
|
|
3623
|
+
/* @__PURE__ */ jsx38(
|
|
3406
3624
|
InputField,
|
|
3407
3625
|
{
|
|
3408
3626
|
value: kpi.name,
|
|
@@ -3412,27 +3630,27 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3412
3630
|
error: itemErrors[kpi.id]?.name
|
|
3413
3631
|
}
|
|
3414
3632
|
),
|
|
3415
|
-
/* @__PURE__ */
|
|
3633
|
+
/* @__PURE__ */ jsxs33(
|
|
3416
3634
|
"div",
|
|
3417
3635
|
{
|
|
3418
3636
|
className: `flex gap-2 justify-end self-center ${!!itemErrors[kpi.id]?.name ? "mt-[-12px]" : ""}`,
|
|
3419
3637
|
children: [
|
|
3420
|
-
/* @__PURE__ */
|
|
3638
|
+
/* @__PURE__ */ jsx38(
|
|
3421
3639
|
IconCheck2,
|
|
3422
3640
|
{
|
|
3423
3641
|
className: "w-[30px] h-[30px] cursor-pointer",
|
|
3424
3642
|
onClick: () => handleSave(kpi.id, type)
|
|
3425
3643
|
}
|
|
3426
3644
|
),
|
|
3427
|
-
/* @__PURE__ */
|
|
3645
|
+
/* @__PURE__ */ jsx38(IconX2, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleCancel(kpi.id) })
|
|
3428
3646
|
]
|
|
3429
3647
|
}
|
|
3430
3648
|
)
|
|
3431
|
-
] }) : /* @__PURE__ */
|
|
3432
|
-
/* @__PURE__ */
|
|
3433
|
-
/* @__PURE__ */
|
|
3434
|
-
/* @__PURE__ */
|
|
3435
|
-
/* @__PURE__ */
|
|
3649
|
+
] }) : /* @__PURE__ */ jsxs33(Fragment6, { children: [
|
|
3650
|
+
/* @__PURE__ */ jsx38("p", { className: "body-1", children: kpi.name }),
|
|
3651
|
+
/* @__PURE__ */ jsxs33("div", { className: "flex gap-3 justify-end", children: [
|
|
3652
|
+
/* @__PURE__ */ jsx38(IconPencil, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleEdit(kpi.id) }),
|
|
3653
|
+
/* @__PURE__ */ jsx38(IconTrash3, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleDelete(kpi.id) })
|
|
3436
3654
|
] })
|
|
3437
3655
|
] })
|
|
3438
3656
|
] }, kpi.id)) })
|
|
@@ -3444,16 +3662,16 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3444
3662
|
|
|
3445
3663
|
// src/Modal/Modal/Modal.tsx
|
|
3446
3664
|
import { Modal } from "antd";
|
|
3447
|
-
import { jsx as
|
|
3665
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
3448
3666
|
function AntDModal({ children, isOpen, width, onCancel }) {
|
|
3449
|
-
return /* @__PURE__ */
|
|
3667
|
+
return /* @__PURE__ */ jsx39("div", { children: /* @__PURE__ */ jsx39(Modal, { open: isOpen, onCancel, width, centered: true, footer: null, children: /* @__PURE__ */ jsx39("div", { children }) }) });
|
|
3450
3668
|
}
|
|
3451
3669
|
|
|
3452
3670
|
// src/Indicator/Indicator/Indicator.tsx
|
|
3453
3671
|
import { IconCheck as IconCheck3, IconCirclePlus as IconCirclePlus2, IconPencil as IconPencil2, IconTrash as IconTrash4, IconX as IconX3 } from "@tabler/icons-react";
|
|
3454
|
-
import { useState as
|
|
3672
|
+
import { useState as useState15 } from "react";
|
|
3455
3673
|
import { Input as Input4 } from "antd";
|
|
3456
|
-
import { Fragment as Fragment7, jsx as
|
|
3674
|
+
import { Fragment as Fragment7, jsx as jsx40, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
3457
3675
|
function Indicator({
|
|
3458
3676
|
option = [
|
|
3459
3677
|
{ value: "TEXT", label: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21" },
|
|
@@ -3463,22 +3681,22 @@ function Indicator({
|
|
|
3463
3681
|
arrayData,
|
|
3464
3682
|
setArrayData
|
|
3465
3683
|
}) {
|
|
3466
|
-
const [valueSwitch, setValueSwitch] =
|
|
3467
|
-
const [cacheData, setCacheData] =
|
|
3684
|
+
const [valueSwitch, setValueSwitch] = useState15("TEXT");
|
|
3685
|
+
const [cacheData, setCacheData] = useState15({
|
|
3468
3686
|
indicatorType: type,
|
|
3469
3687
|
inputType: valueSwitch,
|
|
3470
3688
|
textValue: "",
|
|
3471
3689
|
numberValue: "",
|
|
3472
3690
|
unit: ""
|
|
3473
3691
|
});
|
|
3474
|
-
const [cacheEditData, setCacheEditData] =
|
|
3692
|
+
const [cacheEditData, setCacheEditData] = useState15({
|
|
3475
3693
|
indicatorType: type,
|
|
3476
3694
|
inputType: valueSwitch,
|
|
3477
3695
|
textValue: "",
|
|
3478
3696
|
numberValue: "",
|
|
3479
3697
|
unit: ""
|
|
3480
3698
|
});
|
|
3481
|
-
const [editIndex, setEditIndex] =
|
|
3699
|
+
const [editIndex, setEditIndex] = useState15(null);
|
|
3482
3700
|
const handleAddIndicator = () => {
|
|
3483
3701
|
if (cacheData.textValue.trim() === "") return;
|
|
3484
3702
|
setArrayData([
|
|
@@ -3535,14 +3753,14 @@ function Indicator({
|
|
|
3535
3753
|
}));
|
|
3536
3754
|
console.log(cacheEditData);
|
|
3537
3755
|
};
|
|
3538
|
-
return /* @__PURE__ */
|
|
3539
|
-
/* @__PURE__ */
|
|
3756
|
+
return /* @__PURE__ */ jsxs34("div", { className: "w-full", children: [
|
|
3757
|
+
/* @__PURE__ */ jsxs34(
|
|
3540
3758
|
"div",
|
|
3541
3759
|
{
|
|
3542
3760
|
className: `space-x-2 grid ${valueSwitch === "TEXT" ? `grid-cols-[140px_1fr_50px]` : `grid-cols-[140px_1fr_200px_200px_50px]`} items-start`,
|
|
3543
3761
|
children: [
|
|
3544
|
-
/* @__PURE__ */
|
|
3545
|
-
/* @__PURE__ */
|
|
3762
|
+
/* @__PURE__ */ jsx40(SwitchSelect, { option, onClick: handleClick, value: valueSwitch, label: "\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17", required: true }),
|
|
3763
|
+
/* @__PURE__ */ jsx40(
|
|
3546
3764
|
InputField,
|
|
3547
3765
|
{
|
|
3548
3766
|
label: `\u0E0A\u0E37\u0E48\u0E2D\u0E15\u0E31\u0E27\u0E0A\u0E35\u0E49\u0E27\u0E31\u0E14${type === "OUTPUT" ? "\u0E1C\u0E25\u0E1C\u0E25\u0E34\u0E15" : "\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C"}`,
|
|
@@ -3553,8 +3771,8 @@ function Indicator({
|
|
|
3553
3771
|
required: true
|
|
3554
3772
|
}
|
|
3555
3773
|
),
|
|
3556
|
-
valueSwitch === "NUMBER" && /* @__PURE__ */
|
|
3557
|
-
/* @__PURE__ */
|
|
3774
|
+
valueSwitch === "NUMBER" && /* @__PURE__ */ jsxs34(Fragment7, { children: [
|
|
3775
|
+
/* @__PURE__ */ jsx40(
|
|
3558
3776
|
InputFieldNumber,
|
|
3559
3777
|
{
|
|
3560
3778
|
label: `\u0E04\u0E48\u0E32\u0E40\u0E1B\u0E49\u0E32\u0E2B\u0E21\u0E32\u0E22${type === "OUTPUT" ? "\u0E1C\u0E25\u0E1C\u0E25\u0E34\u0E15" : "\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C"}`,
|
|
@@ -3565,7 +3783,7 @@ function Indicator({
|
|
|
3565
3783
|
required: true
|
|
3566
3784
|
}
|
|
3567
3785
|
),
|
|
3568
|
-
/* @__PURE__ */
|
|
3786
|
+
/* @__PURE__ */ jsx40(
|
|
3569
3787
|
InputField,
|
|
3570
3788
|
{
|
|
3571
3789
|
label: `\u0E2B\u0E19\u0E48\u0E27\u0E22`,
|
|
@@ -3577,17 +3795,17 @@ function Indicator({
|
|
|
3577
3795
|
}
|
|
3578
3796
|
)
|
|
3579
3797
|
] }),
|
|
3580
|
-
/* @__PURE__ */
|
|
3798
|
+
/* @__PURE__ */ jsx40(IconCirclePlus2, { onClick: handleAddIndicator, className: "mt-7 cursor-pointer", size: 32 })
|
|
3581
3799
|
]
|
|
3582
3800
|
}
|
|
3583
3801
|
),
|
|
3584
|
-
/* @__PURE__ */
|
|
3802
|
+
/* @__PURE__ */ jsx40(Fragment7, { children: arrayData.map((item, index) => /* @__PURE__ */ jsxs34(
|
|
3585
3803
|
"div",
|
|
3586
3804
|
{
|
|
3587
3805
|
className: `space-y-4 grid ${item.inputType === "TEXT" ? `grid-cols-[140px_1fr_50px_50px]` : `grid-cols-[140px_1fr_200px_150px_50px_50px]`} items-start`,
|
|
3588
3806
|
children: [
|
|
3589
|
-
/* @__PURE__ */
|
|
3590
|
-
index === editIndex ? /* @__PURE__ */
|
|
3807
|
+
/* @__PURE__ */ jsx40("div", { className: "body-1 mt-2", children: item.inputType === "TEXT" ? "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21" : "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02" }),
|
|
3808
|
+
index === editIndex ? /* @__PURE__ */ jsx40(
|
|
3591
3809
|
Input4,
|
|
3592
3810
|
{
|
|
3593
3811
|
className: "body-1 mt-2",
|
|
@@ -3596,9 +3814,9 @@ function Indicator({
|
|
|
3596
3814
|
name: "textValue",
|
|
3597
3815
|
onChange: (e) => handleChangeEditCashData(e)
|
|
3598
3816
|
}
|
|
3599
|
-
) : /* @__PURE__ */
|
|
3600
|
-
item.inputType === "NUMBER" && /* @__PURE__ */
|
|
3601
|
-
index === editIndex ? /* @__PURE__ */
|
|
3817
|
+
) : /* @__PURE__ */ jsx40("div", { className: "body-1 mt-2", children: item.textValue }),
|
|
3818
|
+
item.inputType === "NUMBER" && /* @__PURE__ */ jsxs34(Fragment7, { children: [
|
|
3819
|
+
index === editIndex ? /* @__PURE__ */ jsx40(
|
|
3602
3820
|
Input4,
|
|
3603
3821
|
{
|
|
3604
3822
|
className: "body-1 mt-2",
|
|
@@ -3607,8 +3825,8 @@ function Indicator({
|
|
|
3607
3825
|
name: "numberValue",
|
|
3608
3826
|
onChange: (e) => handleChangeEditCashData(e)
|
|
3609
3827
|
}
|
|
3610
|
-
) : /* @__PURE__ */
|
|
3611
|
-
index === editIndex ? /* @__PURE__ */
|
|
3828
|
+
) : /* @__PURE__ */ jsx40("div", { className: "body-1 mt-2", children: item.numberValue }),
|
|
3829
|
+
index === editIndex ? /* @__PURE__ */ jsx40(
|
|
3612
3830
|
Input4,
|
|
3613
3831
|
{
|
|
3614
3832
|
className: "body-1 mt-2",
|
|
@@ -3617,19 +3835,19 @@ function Indicator({
|
|
|
3617
3835
|
name: "unit",
|
|
3618
3836
|
onChange: (e) => handleChangeEditCashData(e)
|
|
3619
3837
|
}
|
|
3620
|
-
) : /* @__PURE__ */
|
|
3838
|
+
) : /* @__PURE__ */ jsx40("div", { className: "body-1 mt-2", children: item.unit })
|
|
3621
3839
|
] }),
|
|
3622
|
-
/* @__PURE__ */
|
|
3623
|
-
/* @__PURE__ */
|
|
3840
|
+
/* @__PURE__ */ jsx40("div", { className: "body-1 mt-2 flex", children: editIndex !== null ? editIndex === index ? /* @__PURE__ */ jsxs34("div", { className: "flex", children: [
|
|
3841
|
+
/* @__PURE__ */ jsx40(
|
|
3624
3842
|
IconCheck3,
|
|
3625
3843
|
{
|
|
3626
3844
|
className: "cursor-pointer text-green-600",
|
|
3627
3845
|
onClick: () => handleConfirmEditIndicator(index)
|
|
3628
3846
|
}
|
|
3629
3847
|
),
|
|
3630
|
-
/* @__PURE__ */
|
|
3631
|
-
] }) : void 0 : /* @__PURE__ */
|
|
3632
|
-
/* @__PURE__ */
|
|
3848
|
+
/* @__PURE__ */ jsx40(IconX3, { className: "cursor-pointer text-red-600", onClick: handleCancelEditIndicator })
|
|
3849
|
+
] }) : void 0 : /* @__PURE__ */ jsx40(IconPencil2, { className: "cursor-pointer", onClick: () => handleEditIndicator(index) }) }),
|
|
3850
|
+
/* @__PURE__ */ jsx40("div", { className: "body-1 mt-2 cursor-pointer", children: /* @__PURE__ */ jsx40(IconTrash4, { onClick: () => handleDeleteIndicator(index) }) })
|
|
3633
3851
|
]
|
|
3634
3852
|
}
|
|
3635
3853
|
)) })
|
|
@@ -3638,31 +3856,31 @@ function Indicator({
|
|
|
3638
3856
|
|
|
3639
3857
|
// src/FilterPopUp/FilterPopUp.tsx
|
|
3640
3858
|
import { IconCheck as IconCheck4, IconFilter as IconFilter2, IconTrash as IconTrash5 } from "@tabler/icons-react";
|
|
3641
|
-
import { useState as
|
|
3642
|
-
import { jsx as
|
|
3859
|
+
import { useState as useState16 } from "react";
|
|
3860
|
+
import { jsx as jsx41, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
3643
3861
|
var FilterPopUp = (filter) => {
|
|
3644
|
-
const [isAction, setIsAction] =
|
|
3645
|
-
const [filterArray, setFilterArray] =
|
|
3862
|
+
const [isAction, setIsAction] = useState16(true);
|
|
3863
|
+
const [filterArray, setFilterArray] = useState16([""]);
|
|
3646
3864
|
const handleClearFilter = () => {
|
|
3647
3865
|
setFilterArray([]);
|
|
3648
3866
|
};
|
|
3649
3867
|
const handleSubmitFilter = () => {
|
|
3650
3868
|
filter.handleSearch(filterArray);
|
|
3651
3869
|
};
|
|
3652
|
-
return /* @__PURE__ */
|
|
3653
|
-
/* @__PURE__ */
|
|
3654
|
-
/* @__PURE__ */
|
|
3870
|
+
return /* @__PURE__ */ jsxs35("div", { className: "relative", children: [
|
|
3871
|
+
/* @__PURE__ */ jsxs35("button", { className: "flex px-2 py-1 rounded-lg border-1", onClick: () => setIsAction(!isAction), children: [
|
|
3872
|
+
/* @__PURE__ */ jsx41(IconFilter2, {}),
|
|
3655
3873
|
"filter"
|
|
3656
3874
|
] }),
|
|
3657
|
-
isAction ? /* @__PURE__ */
|
|
3658
|
-
/* @__PURE__ */
|
|
3659
|
-
/* @__PURE__ */
|
|
3660
|
-
/* @__PURE__ */
|
|
3661
|
-
/* @__PURE__ */
|
|
3875
|
+
isAction ? /* @__PURE__ */ jsxs35("div", { className: "absolute bg-white p-5 rounded-lg shadow-2xl w-[600px]", children: [
|
|
3876
|
+
/* @__PURE__ */ jsxs35("div", { className: "flex justify-end", children: [
|
|
3877
|
+
/* @__PURE__ */ jsxs35("div", { className: "flex justify-end text-nowrap gap-2", children: [
|
|
3878
|
+
/* @__PURE__ */ jsx41(GhostButton, { title: "\u0E43\u0E0A\u0E49\u0E1F\u0E34\u0E25\u0E40\u0E15\u0E2D\u0E23\u0E4C", onClick: handleSubmitFilter, iconLeft: /* @__PURE__ */ jsx41(IconCheck4, {}) }),
|
|
3879
|
+
/* @__PURE__ */ jsx41(GhostButton, { title: "\u0E25\u0E49\u0E32\u0E07\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14", onClick: handleClearFilter, iconLeft: /* @__PURE__ */ jsx41(IconTrash5, {}) })
|
|
3662
3880
|
] }),
|
|
3663
3881
|
""
|
|
3664
3882
|
] }),
|
|
3665
|
-
/* @__PURE__ */
|
|
3883
|
+
/* @__PURE__ */ jsx41(
|
|
3666
3884
|
SelectCustom,
|
|
3667
3885
|
{
|
|
3668
3886
|
options: filter.selectionFilter,
|
|
@@ -3684,6 +3902,7 @@ export {
|
|
|
3684
3902
|
ColorPickerBasic,
|
|
3685
3903
|
DataTable,
|
|
3686
3904
|
DatePickerBasic,
|
|
3905
|
+
DatePickerRange,
|
|
3687
3906
|
FileUploader,
|
|
3688
3907
|
FilterPopUp,
|
|
3689
3908
|
GhostButton,
|