@esic-lab/data-core-ui 0.0.42 → 0.0.43
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 +18 -2
- package/dist/index.d.ts +18 -2
- package/dist/index.js +469 -259
- package/dist/index.mjs +469 -260
- 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,
|
|
@@ -2740,10 +2948,10 @@ function FileUploader({
|
|
|
2740
2948
|
description,
|
|
2741
2949
|
label
|
|
2742
2950
|
}) {
|
|
2743
|
-
const [fileList, setFileList] =
|
|
2744
|
-
const [uploading, setUploading] =
|
|
2745
|
-
const [dragActive, setDragActive] =
|
|
2746
|
-
const inputRef =
|
|
2951
|
+
const [fileList, setFileList] = useState11([]);
|
|
2952
|
+
const [uploading, setUploading] = useState11(false);
|
|
2953
|
+
const [dragActive, setDragActive] = useState11(false);
|
|
2954
|
+
const inputRef = useRef4(null);
|
|
2747
2955
|
const validateFile = (file) => {
|
|
2748
2956
|
if (accept && !accept.includes(file.type)) {
|
|
2749
2957
|
onError?.(`Invalid file type. file: ${file.name}`);
|
|
@@ -2799,10 +3007,10 @@ function FileUploader({
|
|
|
2799
3007
|
}
|
|
2800
3008
|
if (inputRef.current) inputRef.current.value = "";
|
|
2801
3009
|
};
|
|
2802
|
-
return /* @__PURE__ */
|
|
2803
|
-
label && /* @__PURE__ */
|
|
2804
|
-
/* @__PURE__ */
|
|
2805
|
-
mode === "upload" ? /* @__PURE__ */
|
|
3010
|
+
return /* @__PURE__ */ jsxs30("div", { className: "w-full", children: [
|
|
3011
|
+
label && /* @__PURE__ */ jsx34("p", { className: "body-1", children: label }),
|
|
3012
|
+
/* @__PURE__ */ jsxs30("div", { children: [
|
|
3013
|
+
mode === "upload" ? /* @__PURE__ */ jsx34(
|
|
2806
3014
|
"button",
|
|
2807
3015
|
{
|
|
2808
3016
|
type: "button",
|
|
@@ -2810,15 +3018,15 @@ function FileUploader({
|
|
|
2810
3018
|
className: `h-[34px] flex justify-center items-center gap-2 w-full rounded-[2px] border border-gray-200 body-1
|
|
2811
3019
|
${disabled ? "cursor-not-allowed text-gray-400 bg-gray-100" : "cursor-pointer hover:text-primary-400 hover:border-primary-200 duration-300"}`,
|
|
2812
3020
|
disabled: disabled ? disabled : uploading,
|
|
2813
|
-
children: uploading ? /* @__PURE__ */
|
|
2814
|
-
/* @__PURE__ */
|
|
3021
|
+
children: uploading ? /* @__PURE__ */ jsxs30(Fragment5, { children: [
|
|
3022
|
+
/* @__PURE__ */ jsx34(Loader, { size: 15 }),
|
|
2815
3023
|
" \u0E01\u0E33\u0E25\u0E31\u0E07\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14"
|
|
2816
|
-
] }) : /* @__PURE__ */
|
|
2817
|
-
/* @__PURE__ */
|
|
3024
|
+
] }) : /* @__PURE__ */ jsxs30(Fragment5, { children: [
|
|
3025
|
+
/* @__PURE__ */ jsx34(IconUpload, { size: 15, className: "text-gray-400" }),
|
|
2818
3026
|
" \u0E41\u0E19\u0E1A\u0E44\u0E1F\u0E25\u0E4C"
|
|
2819
3027
|
] })
|
|
2820
3028
|
}
|
|
2821
|
-
) : /* @__PURE__ */
|
|
3029
|
+
) : /* @__PURE__ */ jsx34(
|
|
2822
3030
|
"div",
|
|
2823
3031
|
{
|
|
2824
3032
|
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 +3040,17 @@ function FileUploader({
|
|
|
2832
3040
|
},
|
|
2833
3041
|
onDragLeave: () => setDragActive(false),
|
|
2834
3042
|
onDrop: handleDrop,
|
|
2835
|
-
children: uploading ? /* @__PURE__ */
|
|
2836
|
-
/* @__PURE__ */
|
|
3043
|
+
children: uploading ? /* @__PURE__ */ jsxs30("div", { className: "flex justify-center items-center gap-2", children: [
|
|
3044
|
+
/* @__PURE__ */ jsx34(Loader, { size: 15 }),
|
|
2837
3045
|
" \u0E01\u0E33\u0E25\u0E31\u0E07\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14"
|
|
2838
|
-
] }) : /* @__PURE__ */
|
|
2839
|
-
/* @__PURE__ */
|
|
2840
|
-
/* @__PURE__ */
|
|
2841
|
-
/* @__PURE__ */
|
|
3046
|
+
] }) : /* @__PURE__ */ jsxs30("div", { className: "flex flex-col items-center gap-2", children: [
|
|
3047
|
+
/* @__PURE__ */ jsx34(IconUpload, { size: 20 }),
|
|
3048
|
+
/* @__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" }),
|
|
3049
|
+
/* @__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
3050
|
] })
|
|
2843
3051
|
}
|
|
2844
3052
|
),
|
|
2845
|
-
/* @__PURE__ */
|
|
3053
|
+
/* @__PURE__ */ jsx34(
|
|
2846
3054
|
"input",
|
|
2847
3055
|
{
|
|
2848
3056
|
type: "file",
|
|
@@ -2855,13 +3063,13 @@ function FileUploader({
|
|
|
2855
3063
|
}
|
|
2856
3064
|
)
|
|
2857
3065
|
] }),
|
|
2858
|
-
description && /* @__PURE__ */
|
|
2859
|
-
/* @__PURE__ */
|
|
2860
|
-
/* @__PURE__ */
|
|
2861
|
-
/* @__PURE__ */
|
|
2862
|
-
/* @__PURE__ */
|
|
3066
|
+
description && /* @__PURE__ */ jsx34("p", { className: "text-gray-400 body-4", children: description }),
|
|
3067
|
+
/* @__PURE__ */ jsx34("div", { className: "mt-[8px]", children: fileList.length !== 0 && fileList.map((file, index) => /* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-2 rounded-[4px] px-[8px] py-[4px] body-1", children: [
|
|
3068
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-2 w-[75%] overflow-hidden", children: [
|
|
3069
|
+
/* @__PURE__ */ jsx34("div", { className: "w-[15px] h-[15px]", children: /* @__PURE__ */ jsx34(IconPaperclip, { size: 15 }) }),
|
|
3070
|
+
/* @__PURE__ */ jsx34("span", { className: "truncate", children: file.name })
|
|
2863
3071
|
] }),
|
|
2864
|
-
/* @__PURE__ */
|
|
3072
|
+
/* @__PURE__ */ jsx34(
|
|
2865
3073
|
IconTrash2,
|
|
2866
3074
|
{
|
|
2867
3075
|
size: 20,
|
|
@@ -2897,7 +3105,7 @@ function messageLoading(content, duration) {
|
|
|
2897
3105
|
// src/Breadcrumb/Breadcrumb.tsx
|
|
2898
3106
|
import { ConfigProvider as ConfigProvider14 } from "antd";
|
|
2899
3107
|
import { Breadcrumb } from "antd";
|
|
2900
|
-
import { jsx as
|
|
3108
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
2901
3109
|
function Breadcrumbs({
|
|
2902
3110
|
items,
|
|
2903
3111
|
separator,
|
|
@@ -2905,7 +3113,7 @@ function Breadcrumbs({
|
|
|
2905
3113
|
classname,
|
|
2906
3114
|
params
|
|
2907
3115
|
}) {
|
|
2908
|
-
return /* @__PURE__ */
|
|
3116
|
+
return /* @__PURE__ */ jsx35(
|
|
2909
3117
|
ConfigProvider14,
|
|
2910
3118
|
{
|
|
2911
3119
|
theme: {
|
|
@@ -2913,7 +3121,7 @@ function Breadcrumbs({
|
|
|
2913
3121
|
fontFamily: "Kanit"
|
|
2914
3122
|
}
|
|
2915
3123
|
},
|
|
2916
|
-
children: /* @__PURE__ */
|
|
3124
|
+
children: /* @__PURE__ */ jsx35(
|
|
2917
3125
|
Breadcrumb,
|
|
2918
3126
|
{
|
|
2919
3127
|
items,
|
|
@@ -2929,7 +3137,7 @@ function Breadcrumbs({
|
|
|
2929
3137
|
|
|
2930
3138
|
// src/HeadingPage/HeadingPage.tsx
|
|
2931
3139
|
import { ConfigProvider as ConfigProvider15 } from "antd";
|
|
2932
|
-
import { jsx as
|
|
3140
|
+
import { jsx as jsx36, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
2933
3141
|
function HeadingPage({ Heading }) {
|
|
2934
3142
|
const today = (/* @__PURE__ */ new Date()).toLocaleDateString("th-TH", {
|
|
2935
3143
|
weekday: "long",
|
|
@@ -2937,7 +3145,7 @@ function HeadingPage({ Heading }) {
|
|
|
2937
3145
|
month: "long",
|
|
2938
3146
|
year: "numeric"
|
|
2939
3147
|
});
|
|
2940
|
-
return /* @__PURE__ */
|
|
3148
|
+
return /* @__PURE__ */ jsx36(
|
|
2941
3149
|
ConfigProvider15,
|
|
2942
3150
|
{
|
|
2943
3151
|
theme: {
|
|
@@ -2945,9 +3153,9 @@ function HeadingPage({ Heading }) {
|
|
|
2945
3153
|
fontFamily: "Kanit"
|
|
2946
3154
|
}
|
|
2947
3155
|
},
|
|
2948
|
-
children: /* @__PURE__ */
|
|
2949
|
-
/* @__PURE__ */
|
|
2950
|
-
/* @__PURE__ */
|
|
3156
|
+
children: /* @__PURE__ */ jsxs31("div", { className: "flex flex-col gap-[10px] px-[20px] py-[10px]", children: [
|
|
3157
|
+
/* @__PURE__ */ jsx36("p", { className: "headline-5", children: Heading }),
|
|
3158
|
+
/* @__PURE__ */ jsxs31("p", { className: "body-1", children: [
|
|
2951
3159
|
" \u0E27\u0E31\u0E19\u0E19\u0E35\u0E49 ",
|
|
2952
3160
|
today
|
|
2953
3161
|
] })
|
|
@@ -2958,8 +3166,8 @@ function HeadingPage({ Heading }) {
|
|
|
2958
3166
|
|
|
2959
3167
|
// src/Progress/ProgressBar.tsx
|
|
2960
3168
|
import { ConfigProvider as ConfigProvider16, Progress } from "antd";
|
|
2961
|
-
import { useEffect as
|
|
2962
|
-
import { jsx as
|
|
3169
|
+
import { useEffect as useEffect4, useRef as useRef5, useState as useState12 } from "react";
|
|
3170
|
+
import { jsx as jsx37, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
2963
3171
|
function ProgressBar({
|
|
2964
3172
|
percent = 0,
|
|
2965
3173
|
size = "default",
|
|
@@ -2972,8 +3180,8 @@ function ProgressBar({
|
|
|
2972
3180
|
steps,
|
|
2973
3181
|
isCheckPoints
|
|
2974
3182
|
}) {
|
|
2975
|
-
const [barWidth, setBarWidth] =
|
|
2976
|
-
const progressRef =
|
|
3183
|
+
const [barWidth, setBarWidth] = useState12(0);
|
|
3184
|
+
const progressRef = useRef5(null);
|
|
2977
3185
|
let strokeColor = "--color-green-500";
|
|
2978
3186
|
const defaultStrokeWidth = type === "circle" ? 13 : strokeWidth ?? 8;
|
|
2979
3187
|
const defaultSize = type === "circle" ? 43 : size;
|
|
@@ -2981,7 +3189,7 @@ function ProgressBar({
|
|
|
2981
3189
|
const minCheckpoint = Math.min(...checkpoints);
|
|
2982
3190
|
strokeColor = percent >= minCheckpoint ? "var(--color-green-500)" : "var(--color-red-500)";
|
|
2983
3191
|
}
|
|
2984
|
-
|
|
3192
|
+
useEffect4(() => {
|
|
2985
3193
|
const inner = progressRef.current?.querySelector(".ant-progress-inner");
|
|
2986
3194
|
if (!inner) return;
|
|
2987
3195
|
const observer = new ResizeObserver(() => {
|
|
@@ -2990,7 +3198,7 @@ function ProgressBar({
|
|
|
2990
3198
|
observer.observe(inner);
|
|
2991
3199
|
return () => observer.disconnect();
|
|
2992
3200
|
}, []);
|
|
2993
|
-
return /* @__PURE__ */
|
|
3201
|
+
return /* @__PURE__ */ jsx37(
|
|
2994
3202
|
ConfigProvider16,
|
|
2995
3203
|
{
|
|
2996
3204
|
theme: {
|
|
@@ -2998,8 +3206,8 @@ function ProgressBar({
|
|
|
2998
3206
|
fontFamily: "Kanit"
|
|
2999
3207
|
}
|
|
3000
3208
|
},
|
|
3001
|
-
children: /* @__PURE__ */
|
|
3002
|
-
/* @__PURE__ */
|
|
3209
|
+
children: /* @__PURE__ */ jsxs32("div", { className: "relative w-full", ref: progressRef, children: [
|
|
3210
|
+
/* @__PURE__ */ jsx37(
|
|
3003
3211
|
Progress,
|
|
3004
3212
|
{
|
|
3005
3213
|
className: "w-full",
|
|
@@ -3015,7 +3223,7 @@ function ProgressBar({
|
|
|
3015
3223
|
strokeColor
|
|
3016
3224
|
}
|
|
3017
3225
|
),
|
|
3018
|
-
barWidth > 0 && isCheckPoints && type !== "circle" && checkpoints.map((cp) => /* @__PURE__ */
|
|
3226
|
+
barWidth > 0 && isCheckPoints && type !== "circle" && checkpoints.map((cp) => /* @__PURE__ */ jsx37(
|
|
3019
3227
|
"div",
|
|
3020
3228
|
{
|
|
3021
3229
|
className: "checkpoint absolute top-0",
|
|
@@ -3038,24 +3246,24 @@ function ProgressBar({
|
|
|
3038
3246
|
|
|
3039
3247
|
// src/KpiSection/KpiSection.tsx
|
|
3040
3248
|
import { ConfigProvider as ConfigProvider17, message } from "antd";
|
|
3041
|
-
import { useEffect as
|
|
3249
|
+
import { useEffect as useEffect5, useState as useState14 } from "react";
|
|
3042
3250
|
|
|
3043
3251
|
// src/KpiSection/hooks/useGetKpiSection.ts
|
|
3044
|
-
import { useState as
|
|
3252
|
+
import { useState as useState13 } from "react";
|
|
3045
3253
|
import cuid from "cuid";
|
|
3046
3254
|
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] =
|
|
3255
|
+
const [nameKpi, setNameKpi] = useState13("");
|
|
3256
|
+
const [kpiValue, setKpiValue] = useState13("");
|
|
3257
|
+
const [unitValue, setUnitValue] = useState13("");
|
|
3258
|
+
const [kpiList, setKpiList] = useState13([]);
|
|
3259
|
+
const [editingBackup, setEditingBackup] = useState13({});
|
|
3260
|
+
const [selected, setSelected] = useState13("2");
|
|
3261
|
+
const [errors, setErrors] = useState13({
|
|
3054
3262
|
nameKpi: "",
|
|
3055
3263
|
kpiValue: "",
|
|
3056
3264
|
unitValue: ""
|
|
3057
3265
|
});
|
|
3058
|
-
const [itemErrors, setItemErrors] =
|
|
3266
|
+
const [itemErrors, setItemErrors] = useState13({});
|
|
3059
3267
|
const options = [
|
|
3060
3268
|
{ value: "1", label: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21" },
|
|
3061
3269
|
{ value: "2", label: "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02" }
|
|
@@ -3188,7 +3396,7 @@ function useGetKpiSection() {
|
|
|
3188
3396
|
|
|
3189
3397
|
// src/KpiSection/KpiSection.tsx
|
|
3190
3398
|
import { IconCheck as IconCheck2, IconCirclePlus, IconPencil, IconTrash as IconTrash3, IconX as IconX2 } from "@tabler/icons-react";
|
|
3191
|
-
import { Fragment as Fragment6, jsx as
|
|
3399
|
+
import { Fragment as Fragment6, jsx as jsx38, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
3192
3400
|
function KpiSection({ type, onChangeKpiList }) {
|
|
3193
3401
|
const {
|
|
3194
3402
|
handleAddKpi,
|
|
@@ -3209,16 +3417,16 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3209
3417
|
setItemErrors
|
|
3210
3418
|
} = useGetKpiSection();
|
|
3211
3419
|
const [messageApi2, messageContainer] = message.useMessage();
|
|
3212
|
-
const [hasShownError, setHasShownError] =
|
|
3213
|
-
|
|
3420
|
+
const [hasShownError, setHasShownError] = useState14(false);
|
|
3421
|
+
useEffect5(() => {
|
|
3214
3422
|
setMessageApi(messageApi2);
|
|
3215
3423
|
}, [messageApi2]);
|
|
3216
|
-
|
|
3424
|
+
useEffect5(() => {
|
|
3217
3425
|
if (onChangeKpiList) {
|
|
3218
3426
|
onChangeKpiList(kpiList);
|
|
3219
3427
|
}
|
|
3220
3428
|
}, [kpiList]);
|
|
3221
|
-
return /* @__PURE__ */
|
|
3429
|
+
return /* @__PURE__ */ jsx38(
|
|
3222
3430
|
ConfigProvider17,
|
|
3223
3431
|
{
|
|
3224
3432
|
theme: {
|
|
@@ -3227,11 +3435,11 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3227
3435
|
fontSize: 16
|
|
3228
3436
|
}
|
|
3229
3437
|
},
|
|
3230
|
-
children: /* @__PURE__ */
|
|
3438
|
+
children: /* @__PURE__ */ jsxs33("div", { className: "container-input", children: [
|
|
3231
3439
|
messageContainer,
|
|
3232
|
-
type === "number" && /* @__PURE__ */
|
|
3233
|
-
/* @__PURE__ */
|
|
3234
|
-
/* @__PURE__ */
|
|
3440
|
+
type === "number" && /* @__PURE__ */ jsxs33("div", { className: "space-y-4", children: [
|
|
3441
|
+
/* @__PURE__ */ jsxs33("div", { className: "grid grid-cols-[1fr_200px_200px_50px] w-full gap-[24px] items-start", children: [
|
|
3442
|
+
/* @__PURE__ */ jsx38(
|
|
3235
3443
|
InputField,
|
|
3236
3444
|
{
|
|
3237
3445
|
value: nameKpi,
|
|
@@ -3243,7 +3451,7 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3243
3451
|
error: errors.nameKpi
|
|
3244
3452
|
}
|
|
3245
3453
|
),
|
|
3246
|
-
/* @__PURE__ */
|
|
3454
|
+
/* @__PURE__ */ jsx38(
|
|
3247
3455
|
InputField,
|
|
3248
3456
|
{
|
|
3249
3457
|
value: kpiValue,
|
|
@@ -3267,7 +3475,7 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3267
3475
|
error: errors.kpiValue
|
|
3268
3476
|
}
|
|
3269
3477
|
),
|
|
3270
|
-
/* @__PURE__ */
|
|
3478
|
+
/* @__PURE__ */ jsx38(
|
|
3271
3479
|
InputField,
|
|
3272
3480
|
{
|
|
3273
3481
|
value: unitValue,
|
|
@@ -3279,7 +3487,7 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3279
3487
|
error: errors.unitValue
|
|
3280
3488
|
}
|
|
3281
3489
|
),
|
|
3282
|
-
/* @__PURE__ */
|
|
3490
|
+
/* @__PURE__ */ jsx38("div", { className: `flex justify-end mt-[28px]`, children: /* @__PURE__ */ jsx38(
|
|
3283
3491
|
IconCirclePlus,
|
|
3284
3492
|
{
|
|
3285
3493
|
className: "w-[40px] h-[40px] cursor-pointer hover:scale-110 transition",
|
|
@@ -3288,17 +3496,17 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3288
3496
|
}
|
|
3289
3497
|
) })
|
|
3290
3498
|
] }),
|
|
3291
|
-
/* @__PURE__ */
|
|
3499
|
+
/* @__PURE__ */ jsx38("div", { children: kpiList.map((kpi, index) => /* @__PURE__ */ jsxs33(
|
|
3292
3500
|
"div",
|
|
3293
3501
|
{
|
|
3294
3502
|
className: "grid grid-cols-[30px_1fr_100px_120px_80px] items-start py-2 body-1 gap-[8px]",
|
|
3295
3503
|
children: [
|
|
3296
|
-
/* @__PURE__ */
|
|
3504
|
+
/* @__PURE__ */ jsxs33("p", { className: `body-1 ${kpi.isEditing ? "mt-[12px]" : ""}`, children: [
|
|
3297
3505
|
index + 1,
|
|
3298
3506
|
"."
|
|
3299
3507
|
] }),
|
|
3300
|
-
kpi.isEditing ? /* @__PURE__ */
|
|
3301
|
-
/* @__PURE__ */
|
|
3508
|
+
kpi.isEditing ? /* @__PURE__ */ jsxs33(Fragment6, { children: [
|
|
3509
|
+
/* @__PURE__ */ jsx38(
|
|
3302
3510
|
InputField,
|
|
3303
3511
|
{
|
|
3304
3512
|
value: kpi.name,
|
|
@@ -3308,7 +3516,7 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3308
3516
|
error: itemErrors[kpi.id]?.name
|
|
3309
3517
|
}
|
|
3310
3518
|
),
|
|
3311
|
-
/* @__PURE__ */
|
|
3519
|
+
/* @__PURE__ */ jsx38(
|
|
3312
3520
|
InputField,
|
|
3313
3521
|
{
|
|
3314
3522
|
value: kpi.value?.toString(),
|
|
@@ -3333,7 +3541,7 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3333
3541
|
error: itemErrors[kpi.id]?.value
|
|
3334
3542
|
}
|
|
3335
3543
|
),
|
|
3336
|
-
/* @__PURE__ */
|
|
3544
|
+
/* @__PURE__ */ jsx38(
|
|
3337
3545
|
InputField,
|
|
3338
3546
|
{
|
|
3339
3547
|
value: kpi.unit,
|
|
@@ -3343,29 +3551,29 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3343
3551
|
error: itemErrors[kpi.id]?.unit
|
|
3344
3552
|
}
|
|
3345
3553
|
),
|
|
3346
|
-
/* @__PURE__ */
|
|
3554
|
+
/* @__PURE__ */ jsxs33(
|
|
3347
3555
|
"div",
|
|
3348
3556
|
{
|
|
3349
3557
|
className: `flex gap-2 justify-end self-center ${!!itemErrors[kpi.id]?.value || !!itemErrors[kpi.id]?.unit || !!itemErrors[kpi.id]?.name ? "mt-[-12px]" : ""}`,
|
|
3350
3558
|
children: [
|
|
3351
|
-
/* @__PURE__ */
|
|
3559
|
+
/* @__PURE__ */ jsx38(
|
|
3352
3560
|
IconCheck2,
|
|
3353
3561
|
{
|
|
3354
3562
|
className: "w-[30px] h-[30px] cursor-pointer",
|
|
3355
3563
|
onClick: () => handleSave(kpi.id, type)
|
|
3356
3564
|
}
|
|
3357
3565
|
),
|
|
3358
|
-
/* @__PURE__ */
|
|
3566
|
+
/* @__PURE__ */ jsx38(IconX2, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleCancel(kpi.id) })
|
|
3359
3567
|
]
|
|
3360
3568
|
}
|
|
3361
3569
|
)
|
|
3362
|
-
] }) : /* @__PURE__ */
|
|
3363
|
-
/* @__PURE__ */
|
|
3364
|
-
/* @__PURE__ */
|
|
3365
|
-
/* @__PURE__ */
|
|
3366
|
-
/* @__PURE__ */
|
|
3367
|
-
/* @__PURE__ */
|
|
3368
|
-
/* @__PURE__ */
|
|
3570
|
+
] }) : /* @__PURE__ */ jsxs33(Fragment6, { children: [
|
|
3571
|
+
/* @__PURE__ */ jsx38("p", { className: "body-1", children: kpi.name }),
|
|
3572
|
+
/* @__PURE__ */ jsx38("p", { className: "body-1", children: kpi.value }),
|
|
3573
|
+
/* @__PURE__ */ jsx38("p", { className: "body-1", children: kpi.unit }),
|
|
3574
|
+
/* @__PURE__ */ jsxs33("div", { className: "flex gap-3 justify-end", children: [
|
|
3575
|
+
/* @__PURE__ */ jsx38(IconPencil, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleEdit(kpi.id) }),
|
|
3576
|
+
/* @__PURE__ */ jsx38(IconTrash3, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleDelete(kpi.id) })
|
|
3369
3577
|
] })
|
|
3370
3578
|
] })
|
|
3371
3579
|
]
|
|
@@ -3373,9 +3581,9 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3373
3581
|
kpi.id
|
|
3374
3582
|
)) })
|
|
3375
3583
|
] }),
|
|
3376
|
-
type === "text" && /* @__PURE__ */
|
|
3377
|
-
/* @__PURE__ */
|
|
3378
|
-
/* @__PURE__ */
|
|
3584
|
+
type === "text" && /* @__PURE__ */ jsxs33("div", { className: "space-y-4", children: [
|
|
3585
|
+
/* @__PURE__ */ jsxs33("div", { className: "grid grid-cols-[1fr_50px] w-full gap-[24px] items-start", children: [
|
|
3586
|
+
/* @__PURE__ */ jsx38(
|
|
3379
3587
|
InputField,
|
|
3380
3588
|
{
|
|
3381
3589
|
value: nameKpi,
|
|
@@ -3387,7 +3595,7 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3387
3595
|
error: errors.nameKpi
|
|
3388
3596
|
}
|
|
3389
3597
|
),
|
|
3390
|
-
/* @__PURE__ */
|
|
3598
|
+
/* @__PURE__ */ jsx38("div", { className: `flex justify-end mt-[28px]`, children: /* @__PURE__ */ jsx38(
|
|
3391
3599
|
IconCirclePlus,
|
|
3392
3600
|
{
|
|
3393
3601
|
className: "w-[40px] h-[40px] cursor-pointer hover:scale-110 transition",
|
|
@@ -3396,13 +3604,13 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3396
3604
|
}
|
|
3397
3605
|
) })
|
|
3398
3606
|
] }),
|
|
3399
|
-
/* @__PURE__ */
|
|
3400
|
-
/* @__PURE__ */
|
|
3607
|
+
/* @__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: [
|
|
3608
|
+
/* @__PURE__ */ jsxs33("p", { className: `body-1 ${kpi.isEditing ? "mt-[12px]" : ""}`, children: [
|
|
3401
3609
|
index + 1,
|
|
3402
3610
|
"."
|
|
3403
3611
|
] }),
|
|
3404
|
-
kpi.isEditing ? /* @__PURE__ */
|
|
3405
|
-
/* @__PURE__ */
|
|
3612
|
+
kpi.isEditing ? /* @__PURE__ */ jsxs33(Fragment6, { children: [
|
|
3613
|
+
/* @__PURE__ */ jsx38(
|
|
3406
3614
|
InputField,
|
|
3407
3615
|
{
|
|
3408
3616
|
value: kpi.name,
|
|
@@ -3412,27 +3620,27 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3412
3620
|
error: itemErrors[kpi.id]?.name
|
|
3413
3621
|
}
|
|
3414
3622
|
),
|
|
3415
|
-
/* @__PURE__ */
|
|
3623
|
+
/* @__PURE__ */ jsxs33(
|
|
3416
3624
|
"div",
|
|
3417
3625
|
{
|
|
3418
3626
|
className: `flex gap-2 justify-end self-center ${!!itemErrors[kpi.id]?.name ? "mt-[-12px]" : ""}`,
|
|
3419
3627
|
children: [
|
|
3420
|
-
/* @__PURE__ */
|
|
3628
|
+
/* @__PURE__ */ jsx38(
|
|
3421
3629
|
IconCheck2,
|
|
3422
3630
|
{
|
|
3423
3631
|
className: "w-[30px] h-[30px] cursor-pointer",
|
|
3424
3632
|
onClick: () => handleSave(kpi.id, type)
|
|
3425
3633
|
}
|
|
3426
3634
|
),
|
|
3427
|
-
/* @__PURE__ */
|
|
3635
|
+
/* @__PURE__ */ jsx38(IconX2, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleCancel(kpi.id) })
|
|
3428
3636
|
]
|
|
3429
3637
|
}
|
|
3430
3638
|
)
|
|
3431
|
-
] }) : /* @__PURE__ */
|
|
3432
|
-
/* @__PURE__ */
|
|
3433
|
-
/* @__PURE__ */
|
|
3434
|
-
/* @__PURE__ */
|
|
3435
|
-
/* @__PURE__ */
|
|
3639
|
+
] }) : /* @__PURE__ */ jsxs33(Fragment6, { children: [
|
|
3640
|
+
/* @__PURE__ */ jsx38("p", { className: "body-1", children: kpi.name }),
|
|
3641
|
+
/* @__PURE__ */ jsxs33("div", { className: "flex gap-3 justify-end", children: [
|
|
3642
|
+
/* @__PURE__ */ jsx38(IconPencil, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleEdit(kpi.id) }),
|
|
3643
|
+
/* @__PURE__ */ jsx38(IconTrash3, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleDelete(kpi.id) })
|
|
3436
3644
|
] })
|
|
3437
3645
|
] })
|
|
3438
3646
|
] }, kpi.id)) })
|
|
@@ -3444,16 +3652,16 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3444
3652
|
|
|
3445
3653
|
// src/Modal/Modal/Modal.tsx
|
|
3446
3654
|
import { Modal } from "antd";
|
|
3447
|
-
import { jsx as
|
|
3655
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
3448
3656
|
function AntDModal({ children, isOpen, width, onCancel }) {
|
|
3449
|
-
return /* @__PURE__ */
|
|
3657
|
+
return /* @__PURE__ */ jsx39("div", { children: /* @__PURE__ */ jsx39(Modal, { open: isOpen, onCancel, width, centered: true, footer: null, children: /* @__PURE__ */ jsx39("div", { children }) }) });
|
|
3450
3658
|
}
|
|
3451
3659
|
|
|
3452
3660
|
// src/Indicator/Indicator/Indicator.tsx
|
|
3453
3661
|
import { IconCheck as IconCheck3, IconCirclePlus as IconCirclePlus2, IconPencil as IconPencil2, IconTrash as IconTrash4, IconX as IconX3 } from "@tabler/icons-react";
|
|
3454
|
-
import { useState as
|
|
3662
|
+
import { useState as useState15 } from "react";
|
|
3455
3663
|
import { Input as Input4 } from "antd";
|
|
3456
|
-
import { Fragment as Fragment7, jsx as
|
|
3664
|
+
import { Fragment as Fragment7, jsx as jsx40, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
3457
3665
|
function Indicator({
|
|
3458
3666
|
option = [
|
|
3459
3667
|
{ value: "TEXT", label: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21" },
|
|
@@ -3463,22 +3671,22 @@ function Indicator({
|
|
|
3463
3671
|
arrayData,
|
|
3464
3672
|
setArrayData
|
|
3465
3673
|
}) {
|
|
3466
|
-
const [valueSwitch, setValueSwitch] =
|
|
3467
|
-
const [cacheData, setCacheData] =
|
|
3674
|
+
const [valueSwitch, setValueSwitch] = useState15("TEXT");
|
|
3675
|
+
const [cacheData, setCacheData] = useState15({
|
|
3468
3676
|
indicatorType: type,
|
|
3469
3677
|
inputType: valueSwitch,
|
|
3470
3678
|
textValue: "",
|
|
3471
3679
|
numberValue: "",
|
|
3472
3680
|
unit: ""
|
|
3473
3681
|
});
|
|
3474
|
-
const [cacheEditData, setCacheEditData] =
|
|
3682
|
+
const [cacheEditData, setCacheEditData] = useState15({
|
|
3475
3683
|
indicatorType: type,
|
|
3476
3684
|
inputType: valueSwitch,
|
|
3477
3685
|
textValue: "",
|
|
3478
3686
|
numberValue: "",
|
|
3479
3687
|
unit: ""
|
|
3480
3688
|
});
|
|
3481
|
-
const [editIndex, setEditIndex] =
|
|
3689
|
+
const [editIndex, setEditIndex] = useState15(null);
|
|
3482
3690
|
const handleAddIndicator = () => {
|
|
3483
3691
|
if (cacheData.textValue.trim() === "") return;
|
|
3484
3692
|
setArrayData([
|
|
@@ -3535,14 +3743,14 @@ function Indicator({
|
|
|
3535
3743
|
}));
|
|
3536
3744
|
console.log(cacheEditData);
|
|
3537
3745
|
};
|
|
3538
|
-
return /* @__PURE__ */
|
|
3539
|
-
/* @__PURE__ */
|
|
3746
|
+
return /* @__PURE__ */ jsxs34("div", { className: "w-full", children: [
|
|
3747
|
+
/* @__PURE__ */ jsxs34(
|
|
3540
3748
|
"div",
|
|
3541
3749
|
{
|
|
3542
3750
|
className: `space-x-2 grid ${valueSwitch === "TEXT" ? `grid-cols-[140px_1fr_50px]` : `grid-cols-[140px_1fr_200px_200px_50px]`} items-start`,
|
|
3543
3751
|
children: [
|
|
3544
|
-
/* @__PURE__ */
|
|
3545
|
-
/* @__PURE__ */
|
|
3752
|
+
/* @__PURE__ */ jsx40(SwitchSelect, { option, onClick: handleClick, value: valueSwitch, label: "\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17", required: true }),
|
|
3753
|
+
/* @__PURE__ */ jsx40(
|
|
3546
3754
|
InputField,
|
|
3547
3755
|
{
|
|
3548
3756
|
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 +3761,8 @@ function Indicator({
|
|
|
3553
3761
|
required: true
|
|
3554
3762
|
}
|
|
3555
3763
|
),
|
|
3556
|
-
valueSwitch === "NUMBER" && /* @__PURE__ */
|
|
3557
|
-
/* @__PURE__ */
|
|
3764
|
+
valueSwitch === "NUMBER" && /* @__PURE__ */ jsxs34(Fragment7, { children: [
|
|
3765
|
+
/* @__PURE__ */ jsx40(
|
|
3558
3766
|
InputFieldNumber,
|
|
3559
3767
|
{
|
|
3560
3768
|
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 +3773,7 @@ function Indicator({
|
|
|
3565
3773
|
required: true
|
|
3566
3774
|
}
|
|
3567
3775
|
),
|
|
3568
|
-
/* @__PURE__ */
|
|
3776
|
+
/* @__PURE__ */ jsx40(
|
|
3569
3777
|
InputField,
|
|
3570
3778
|
{
|
|
3571
3779
|
label: `\u0E2B\u0E19\u0E48\u0E27\u0E22`,
|
|
@@ -3577,17 +3785,17 @@ function Indicator({
|
|
|
3577
3785
|
}
|
|
3578
3786
|
)
|
|
3579
3787
|
] }),
|
|
3580
|
-
/* @__PURE__ */
|
|
3788
|
+
/* @__PURE__ */ jsx40(IconCirclePlus2, { onClick: handleAddIndicator, className: "mt-7 cursor-pointer", size: 32 })
|
|
3581
3789
|
]
|
|
3582
3790
|
}
|
|
3583
3791
|
),
|
|
3584
|
-
/* @__PURE__ */
|
|
3792
|
+
/* @__PURE__ */ jsx40(Fragment7, { children: arrayData.map((item, index) => /* @__PURE__ */ jsxs34(
|
|
3585
3793
|
"div",
|
|
3586
3794
|
{
|
|
3587
3795
|
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
3796
|
children: [
|
|
3589
|
-
/* @__PURE__ */
|
|
3590
|
-
index === editIndex ? /* @__PURE__ */
|
|
3797
|
+
/* @__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" }),
|
|
3798
|
+
index === editIndex ? /* @__PURE__ */ jsx40(
|
|
3591
3799
|
Input4,
|
|
3592
3800
|
{
|
|
3593
3801
|
className: "body-1 mt-2",
|
|
@@ -3596,9 +3804,9 @@ function Indicator({
|
|
|
3596
3804
|
name: "textValue",
|
|
3597
3805
|
onChange: (e) => handleChangeEditCashData(e)
|
|
3598
3806
|
}
|
|
3599
|
-
) : /* @__PURE__ */
|
|
3600
|
-
item.inputType === "NUMBER" && /* @__PURE__ */
|
|
3601
|
-
index === editIndex ? /* @__PURE__ */
|
|
3807
|
+
) : /* @__PURE__ */ jsx40("div", { className: "body-1 mt-2", children: item.textValue }),
|
|
3808
|
+
item.inputType === "NUMBER" && /* @__PURE__ */ jsxs34(Fragment7, { children: [
|
|
3809
|
+
index === editIndex ? /* @__PURE__ */ jsx40(
|
|
3602
3810
|
Input4,
|
|
3603
3811
|
{
|
|
3604
3812
|
className: "body-1 mt-2",
|
|
@@ -3607,8 +3815,8 @@ function Indicator({
|
|
|
3607
3815
|
name: "numberValue",
|
|
3608
3816
|
onChange: (e) => handleChangeEditCashData(e)
|
|
3609
3817
|
}
|
|
3610
|
-
) : /* @__PURE__ */
|
|
3611
|
-
index === editIndex ? /* @__PURE__ */
|
|
3818
|
+
) : /* @__PURE__ */ jsx40("div", { className: "body-1 mt-2", children: item.numberValue }),
|
|
3819
|
+
index === editIndex ? /* @__PURE__ */ jsx40(
|
|
3612
3820
|
Input4,
|
|
3613
3821
|
{
|
|
3614
3822
|
className: "body-1 mt-2",
|
|
@@ -3617,19 +3825,19 @@ function Indicator({
|
|
|
3617
3825
|
name: "unit",
|
|
3618
3826
|
onChange: (e) => handleChangeEditCashData(e)
|
|
3619
3827
|
}
|
|
3620
|
-
) : /* @__PURE__ */
|
|
3828
|
+
) : /* @__PURE__ */ jsx40("div", { className: "body-1 mt-2", children: item.unit })
|
|
3621
3829
|
] }),
|
|
3622
|
-
/* @__PURE__ */
|
|
3623
|
-
/* @__PURE__ */
|
|
3830
|
+
/* @__PURE__ */ jsx40("div", { className: "body-1 mt-2 flex", children: editIndex !== null ? editIndex === index ? /* @__PURE__ */ jsxs34("div", { className: "flex", children: [
|
|
3831
|
+
/* @__PURE__ */ jsx40(
|
|
3624
3832
|
IconCheck3,
|
|
3625
3833
|
{
|
|
3626
3834
|
className: "cursor-pointer text-green-600",
|
|
3627
3835
|
onClick: () => handleConfirmEditIndicator(index)
|
|
3628
3836
|
}
|
|
3629
3837
|
),
|
|
3630
|
-
/* @__PURE__ */
|
|
3631
|
-
] }) : void 0 : /* @__PURE__ */
|
|
3632
|
-
/* @__PURE__ */
|
|
3838
|
+
/* @__PURE__ */ jsx40(IconX3, { className: "cursor-pointer text-red-600", onClick: handleCancelEditIndicator })
|
|
3839
|
+
] }) : void 0 : /* @__PURE__ */ jsx40(IconPencil2, { className: "cursor-pointer", onClick: () => handleEditIndicator(index) }) }),
|
|
3840
|
+
/* @__PURE__ */ jsx40("div", { className: "body-1 mt-2 cursor-pointer", children: /* @__PURE__ */ jsx40(IconTrash4, { onClick: () => handleDeleteIndicator(index) }) })
|
|
3633
3841
|
]
|
|
3634
3842
|
}
|
|
3635
3843
|
)) })
|
|
@@ -3638,31 +3846,31 @@ function Indicator({
|
|
|
3638
3846
|
|
|
3639
3847
|
// src/FilterPopUp/FilterPopUp.tsx
|
|
3640
3848
|
import { IconCheck as IconCheck4, IconFilter as IconFilter2, IconTrash as IconTrash5 } from "@tabler/icons-react";
|
|
3641
|
-
import { useState as
|
|
3642
|
-
import { jsx as
|
|
3849
|
+
import { useState as useState16 } from "react";
|
|
3850
|
+
import { jsx as jsx41, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
3643
3851
|
var FilterPopUp = (filter) => {
|
|
3644
|
-
const [isAction, setIsAction] =
|
|
3645
|
-
const [filterArray, setFilterArray] =
|
|
3852
|
+
const [isAction, setIsAction] = useState16(true);
|
|
3853
|
+
const [filterArray, setFilterArray] = useState16([""]);
|
|
3646
3854
|
const handleClearFilter = () => {
|
|
3647
3855
|
setFilterArray([]);
|
|
3648
3856
|
};
|
|
3649
3857
|
const handleSubmitFilter = () => {
|
|
3650
3858
|
filter.handleSearch(filterArray);
|
|
3651
3859
|
};
|
|
3652
|
-
return /* @__PURE__ */
|
|
3653
|
-
/* @__PURE__ */
|
|
3654
|
-
/* @__PURE__ */
|
|
3860
|
+
return /* @__PURE__ */ jsxs35("div", { className: "relative", children: [
|
|
3861
|
+
/* @__PURE__ */ jsxs35("button", { className: "flex px-2 py-1 rounded-lg border-1", onClick: () => setIsAction(!isAction), children: [
|
|
3862
|
+
/* @__PURE__ */ jsx41(IconFilter2, {}),
|
|
3655
3863
|
"filter"
|
|
3656
3864
|
] }),
|
|
3657
|
-
isAction ? /* @__PURE__ */
|
|
3658
|
-
/* @__PURE__ */
|
|
3659
|
-
/* @__PURE__ */
|
|
3660
|
-
/* @__PURE__ */
|
|
3661
|
-
/* @__PURE__ */
|
|
3865
|
+
isAction ? /* @__PURE__ */ jsxs35("div", { className: "absolute bg-white p-5 rounded-lg shadow-2xl w-[600px]", children: [
|
|
3866
|
+
/* @__PURE__ */ jsxs35("div", { className: "flex justify-end", children: [
|
|
3867
|
+
/* @__PURE__ */ jsxs35("div", { className: "flex justify-end text-nowrap gap-2", children: [
|
|
3868
|
+
/* @__PURE__ */ jsx41(GhostButton, { title: "\u0E43\u0E0A\u0E49\u0E1F\u0E34\u0E25\u0E40\u0E15\u0E2D\u0E23\u0E4C", onClick: handleSubmitFilter, iconLeft: /* @__PURE__ */ jsx41(IconCheck4, {}) }),
|
|
3869
|
+
/* @__PURE__ */ jsx41(GhostButton, { title: "\u0E25\u0E49\u0E32\u0E07\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14", onClick: handleClearFilter, iconLeft: /* @__PURE__ */ jsx41(IconTrash5, {}) })
|
|
3662
3870
|
] }),
|
|
3663
3871
|
""
|
|
3664
3872
|
] }),
|
|
3665
|
-
/* @__PURE__ */
|
|
3873
|
+
/* @__PURE__ */ jsx41(
|
|
3666
3874
|
SelectCustom,
|
|
3667
3875
|
{
|
|
3668
3876
|
options: filter.selectionFilter,
|
|
@@ -3684,6 +3892,7 @@ export {
|
|
|
3684
3892
|
ColorPickerBasic,
|
|
3685
3893
|
DataTable,
|
|
3686
3894
|
DatePickerBasic,
|
|
3895
|
+
DatePickerRange,
|
|
3687
3896
|
FileUploader,
|
|
3688
3897
|
FilterPopUp,
|
|
3689
3898
|
GhostButton,
|