@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.js
CHANGED
|
@@ -365,6 +365,7 @@ __export(index_exports, {
|
|
|
365
365
|
ColorPickerBasic: () => ColorPickerBasic,
|
|
366
366
|
DataTable: () => DataTable,
|
|
367
367
|
DatePickerBasic: () => DatePickerBasic,
|
|
368
|
+
DatePickerRange: () => DatePickerRange,
|
|
368
369
|
FileUploader: () => FileUploader,
|
|
369
370
|
FilterPopUp: () => FilterPopUp,
|
|
370
371
|
GhostButton: () => GhostButton,
|
|
@@ -1304,9 +1305,11 @@ function DatePickerBasic({
|
|
|
1304
1305
|
placeholder = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48",
|
|
1305
1306
|
minDate,
|
|
1306
1307
|
maxDate,
|
|
1307
|
-
disabledDate
|
|
1308
|
+
disabledDate,
|
|
1309
|
+
disablePast = false
|
|
1308
1310
|
}) {
|
|
1309
1311
|
const [open, setOpen] = (0, import_react8.useState)(false);
|
|
1312
|
+
const wrapperRef = (0, import_react8.useRef)(null);
|
|
1310
1313
|
const current = value ? (0, import_dayjs.default)(value) : null;
|
|
1311
1314
|
const today = (0, import_dayjs.default)();
|
|
1312
1315
|
const formatThaiBE = (date) => {
|
|
@@ -1332,6 +1335,7 @@ function DatePickerBasic({
|
|
|
1332
1335
|
const daysInMonth = calendar.daysInMonth();
|
|
1333
1336
|
const firstDayOfMonth = calendar.startOf("month").day();
|
|
1334
1337
|
const isDisabled = (date) => {
|
|
1338
|
+
if (disablePast && date.isBefore(today, "day")) return true;
|
|
1335
1339
|
if (disabledDate && disabledDate(date.toDate())) return true;
|
|
1336
1340
|
if (minDate && date.isBefore((0, import_dayjs.default)(minDate), "day")) return true;
|
|
1337
1341
|
if (maxDate && date.isAfter((0, import_dayjs.default)(maxDate), "day")) return true;
|
|
@@ -1343,48 +1347,253 @@ function DatePickerBasic({
|
|
|
1343
1347
|
onChange(selected.toDate());
|
|
1344
1348
|
setOpen(false);
|
|
1345
1349
|
};
|
|
1346
|
-
|
|
1350
|
+
(0, import_react8.useEffect)(() => {
|
|
1351
|
+
const handleClickOutside = (e) => {
|
|
1352
|
+
if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {
|
|
1353
|
+
setOpen(false);
|
|
1354
|
+
}
|
|
1355
|
+
};
|
|
1356
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
1357
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
1358
|
+
}, []);
|
|
1359
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { ref: wrapperRef, style: { fontFamily: "Kanit", fontSize: 16 }, className: "relative w-full", children: [
|
|
1347
1360
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "mb-1", children: [
|
|
1348
1361
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "body-1", children: label }),
|
|
1349
|
-
required && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1362
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-red-500 ml-1", children: "*" })
|
|
1350
1363
|
] }),
|
|
1351
1364
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1352
1365
|
"div",
|
|
1353
1366
|
{
|
|
1354
|
-
className: `border rounded px-3 py-2 cursor-pointer bg-white ${disabled ? "opacity-50" : ""}`,
|
|
1367
|
+
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"}`,
|
|
1355
1368
|
onClick: () => !disabled && setOpen(!open),
|
|
1356
|
-
children: value ? formatThaiBE(value) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-gray-400", children: placeholder })
|
|
1369
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex-1", children: value ? formatThaiBE(value) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-gray-400", children: placeholder }) })
|
|
1357
1370
|
}
|
|
1358
1371
|
),
|
|
1359
1372
|
open && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1360
1373
|
"div",
|
|
1361
1374
|
{
|
|
1362
|
-
className: "absolute z-50 mt-2 w-80 p-4 bg-white shadow-xl rounded-lg border",
|
|
1375
|
+
className: "absolute z-50 mt-2 w-80 p-4 bg-white shadow-xl rounded-lg border animate-fade-in",
|
|
1363
1376
|
style: { fontFamily: "Kanit", fontSize: 16 },
|
|
1364
1377
|
children: [
|
|
1365
1378
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex justify-between items-center mb-3", children: [
|
|
1366
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1367
|
-
|
|
1379
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1380
|
+
"button",
|
|
1381
|
+
{
|
|
1382
|
+
onClick: () => setCalendar(calendar.subtract(1, "month")),
|
|
1383
|
+
className: "px-2 hover:bg-gray-100 rounded",
|
|
1384
|
+
children: "\u25C0"
|
|
1385
|
+
}
|
|
1386
|
+
),
|
|
1387
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "font-semibold text-lg text-gray-700", children: [
|
|
1368
1388
|
monthNames[calendar.month()],
|
|
1369
1389
|
" ",
|
|
1370
1390
|
calendar.year() + 543
|
|
1371
1391
|
] }),
|
|
1372
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("button", { onClick: () => setCalendar(calendar.add(1, "month")), className: "px-2", children: "\u25B6" })
|
|
1392
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("button", { onClick: () => setCalendar(calendar.add(1, "month")), className: "px-2 hover:bg-gray-100 rounded", children: "\u25B6" })
|
|
1373
1393
|
] }),
|
|
1374
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "grid grid-cols-7 text-center text-gray-
|
|
1394
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("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__ */ (0, import_jsx_runtime23.jsx)("div", { children: d }, d)) }),
|
|
1375
1395
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "grid grid-cols-7 gap-1 text-center", children: [
|
|
1376
1396
|
Array(firstDayOfMonth).fill(null).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", {}, `empty-${i}`)),
|
|
1377
1397
|
Array.from({ length: daysInMonth }, (_, i) => i + 1).map((d) => {
|
|
1378
1398
|
const dateObj = calendar.date(d);
|
|
1379
|
-
const
|
|
1380
|
-
const
|
|
1399
|
+
const isDisable = isDisabled(dateObj);
|
|
1400
|
+
const isSelected = current && dateObj.isSame(current, "day");
|
|
1401
|
+
const isToday = dateObj.isSame(today, "day");
|
|
1402
|
+
let bgClass = "hover:bg-blue-100";
|
|
1403
|
+
let textClass = "text-gray-700";
|
|
1404
|
+
if (isDisable) {
|
|
1405
|
+
bgClass = "";
|
|
1406
|
+
textClass = "text-gray-300 cursor-not-allowed";
|
|
1407
|
+
} else if (isSelected) {
|
|
1408
|
+
bgClass = "bg-blue-500 text-white shadow-md";
|
|
1409
|
+
textClass = "text-white font-semibold";
|
|
1410
|
+
} else if (isToday) {
|
|
1411
|
+
bgClass = "border border-blue-500 font-bold";
|
|
1412
|
+
textClass = "text-blue-600";
|
|
1413
|
+
}
|
|
1381
1414
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1382
1415
|
"div",
|
|
1383
1416
|
{
|
|
1384
|
-
onClick: () => !
|
|
1385
|
-
className: `
|
|
1386
|
-
|
|
1387
|
-
${
|
|
1417
|
+
onClick: () => !isDisable && handleSelect(d),
|
|
1418
|
+
className: `
|
|
1419
|
+
py-1 rounded transition-all duration-200
|
|
1420
|
+
${bgClass} ${textClass}
|
|
1421
|
+
${!isDisable ? "cursor-pointer" : ""}
|
|
1422
|
+
`,
|
|
1423
|
+
children: d
|
|
1424
|
+
},
|
|
1425
|
+
d
|
|
1426
|
+
);
|
|
1427
|
+
})
|
|
1428
|
+
] })
|
|
1429
|
+
]
|
|
1430
|
+
}
|
|
1431
|
+
),
|
|
1432
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-red-500 text-xs mt-1", children: error })
|
|
1433
|
+
] });
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
// src/DatePicker/DatePickerRange/DatePickerRange.tsx
|
|
1437
|
+
var import_react9 = require("react");
|
|
1438
|
+
var import_dayjs2 = __toESM(require_dayjs_min());
|
|
1439
|
+
var import_th3 = __toESM(require_th());
|
|
1440
|
+
var import_buddhistEra2 = __toESM(require_buddhistEra());
|
|
1441
|
+
var import_date_fns2 = require("date-fns");
|
|
1442
|
+
var import_locale2 = require("date-fns/locale");
|
|
1443
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1444
|
+
import_dayjs2.default.extend(import_buddhistEra2.default);
|
|
1445
|
+
import_dayjs2.default.locale("th");
|
|
1446
|
+
function DatePickerRange({
|
|
1447
|
+
value,
|
|
1448
|
+
onChange,
|
|
1449
|
+
label,
|
|
1450
|
+
required,
|
|
1451
|
+
error,
|
|
1452
|
+
disabled,
|
|
1453
|
+
minDate,
|
|
1454
|
+
maxDate,
|
|
1455
|
+
disabledDate,
|
|
1456
|
+
disablePast = false
|
|
1457
|
+
}) {
|
|
1458
|
+
const [open, setOpen] = (0, import_react9.useState)(false);
|
|
1459
|
+
const wrapperRef = (0, import_react9.useRef)(null);
|
|
1460
|
+
const [startDate, endDate] = value;
|
|
1461
|
+
const startDayjs = startDate ? (0, import_dayjs2.default)(startDate) : null;
|
|
1462
|
+
const endDayjs = endDate ? (0, import_dayjs2.default)(endDate) : null;
|
|
1463
|
+
const today = (0, import_dayjs2.default)();
|
|
1464
|
+
const [calendar, setCalendar] = (0, import_react9.useState)(startDayjs || today);
|
|
1465
|
+
const formatThaiBE = (date) => {
|
|
1466
|
+
const formatted = (0, import_date_fns2.format)(date, "dd MMM yy", { locale: import_locale2.th });
|
|
1467
|
+
const year = parseInt((0, import_date_fns2.format)(date, "yyyy")) + 543;
|
|
1468
|
+
return formatted.replace(/\d{4}$/, String(year)).replace(/\d{2}$/, String(year).slice(2));
|
|
1469
|
+
};
|
|
1470
|
+
const monthNames = [
|
|
1471
|
+
"\u0E21\u0E01\u0E23\u0E32\u0E04\u0E21",
|
|
1472
|
+
"\u0E01\u0E38\u0E21\u0E20\u0E32\u0E1E\u0E31\u0E19\u0E18\u0E4C",
|
|
1473
|
+
"\u0E21\u0E35\u0E19\u0E32\u0E04\u0E21",
|
|
1474
|
+
"\u0E40\u0E21\u0E29\u0E32\u0E22\u0E19",
|
|
1475
|
+
"\u0E1E\u0E24\u0E29\u0E20\u0E32\u0E04\u0E21",
|
|
1476
|
+
"\u0E21\u0E34\u0E16\u0E38\u0E19\u0E32\u0E22\u0E19",
|
|
1477
|
+
"\u0E01\u0E23\u0E01\u0E0E\u0E32\u0E04\u0E21",
|
|
1478
|
+
"\u0E2A\u0E34\u0E07\u0E2B\u0E32\u0E04\u0E21",
|
|
1479
|
+
"\u0E01\u0E31\u0E19\u0E22\u0E32\u0E22\u0E19",
|
|
1480
|
+
"\u0E15\u0E38\u0E25\u0E32\u0E04\u0E21",
|
|
1481
|
+
"\u0E1E\u0E24\u0E28\u0E08\u0E34\u0E01\u0E32\u0E22\u0E19",
|
|
1482
|
+
"\u0E18\u0E31\u0E19\u0E27\u0E32\u0E04\u0E21"
|
|
1483
|
+
];
|
|
1484
|
+
const daysInMonth = calendar.daysInMonth();
|
|
1485
|
+
const firstDayOfMonth = calendar.startOf("month").day();
|
|
1486
|
+
const isDisabled = (date) => {
|
|
1487
|
+
if (disablePast && date.isBefore(today, "day")) return true;
|
|
1488
|
+
if (disabledDate && disabledDate(date.toDate())) return true;
|
|
1489
|
+
if (minDate && date.isBefore((0, import_dayjs2.default)(minDate), "day")) return true;
|
|
1490
|
+
if (maxDate && date.isAfter((0, import_dayjs2.default)(maxDate), "day")) return true;
|
|
1491
|
+
return false;
|
|
1492
|
+
};
|
|
1493
|
+
const handleSelect = (d) => {
|
|
1494
|
+
const selected = calendar.date(d);
|
|
1495
|
+
if (isDisabled(selected)) return;
|
|
1496
|
+
const selectedDate = selected.toDate();
|
|
1497
|
+
if (!startDate || startDate && endDate) {
|
|
1498
|
+
onChange([selectedDate, null]);
|
|
1499
|
+
} else if (startDate && !endDate) {
|
|
1500
|
+
if (selected.isBefore(startDayjs, "day")) {
|
|
1501
|
+
onChange([selectedDate, null]);
|
|
1502
|
+
} else {
|
|
1503
|
+
onChange([startDate, selectedDate]);
|
|
1504
|
+
setOpen(false);
|
|
1505
|
+
}
|
|
1506
|
+
}
|
|
1507
|
+
};
|
|
1508
|
+
(0, import_react9.useEffect)(() => {
|
|
1509
|
+
const handleClickOutside = (e) => {
|
|
1510
|
+
if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {
|
|
1511
|
+
setOpen(false);
|
|
1512
|
+
}
|
|
1513
|
+
};
|
|
1514
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
1515
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
1516
|
+
}, []);
|
|
1517
|
+
const ArrowIcon = () => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("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__ */ (0, import_jsx_runtime24.jsx)(
|
|
1518
|
+
"path",
|
|
1519
|
+
{
|
|
1520
|
+
fillRule: "evenodd",
|
|
1521
|
+
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",
|
|
1522
|
+
clipRule: "evenodd"
|
|
1523
|
+
}
|
|
1524
|
+
) });
|
|
1525
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { ref: wrapperRef, style: { fontFamily: "Kanit", fontSize: 16 }, className: "relative w-full", children: [
|
|
1526
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "mb-1", children: [
|
|
1527
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "body-1", children: label }),
|
|
1528
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "text-red-500 ml-1", children: "*" })
|
|
1529
|
+
] }),
|
|
1530
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1531
|
+
"div",
|
|
1532
|
+
{
|
|
1533
|
+
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"}`,
|
|
1534
|
+
onClick: () => !disabled && setOpen(!open),
|
|
1535
|
+
children: [
|
|
1536
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("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" }),
|
|
1537
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ArrowIcon, {}) }),
|
|
1538
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("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" })
|
|
1539
|
+
]
|
|
1540
|
+
}
|
|
1541
|
+
),
|
|
1542
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1543
|
+
"div",
|
|
1544
|
+
{
|
|
1545
|
+
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",
|
|
1546
|
+
style: { fontFamily: "Kanit", fontSize: 16 },
|
|
1547
|
+
children: [
|
|
1548
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex justify-between items-center mb-3", children: [
|
|
1549
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1550
|
+
"button",
|
|
1551
|
+
{
|
|
1552
|
+
onClick: () => setCalendar(calendar.subtract(1, "month")),
|
|
1553
|
+
className: "px-2 hover:bg-gray-100 rounded",
|
|
1554
|
+
children: "\u25C0"
|
|
1555
|
+
}
|
|
1556
|
+
),
|
|
1557
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "font-semibold text-lg text-gray-700", children: [
|
|
1558
|
+
monthNames[calendar.month()],
|
|
1559
|
+
" ",
|
|
1560
|
+
calendar.year() + 543
|
|
1561
|
+
] }),
|
|
1562
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { onClick: () => setCalendar(calendar.add(1, "month")), className: "px-2 hover:bg-gray-100 rounded", children: "\u25B6" })
|
|
1563
|
+
] }),
|
|
1564
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("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__ */ (0, import_jsx_runtime24.jsx)("div", { children: d }, d)) }),
|
|
1565
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "grid grid-cols-7 gap-y-1 text-center", children: [
|
|
1566
|
+
Array(firstDayOfMonth).fill(null).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", {}, `empty-${i}`)),
|
|
1567
|
+
Array.from({ length: daysInMonth }, (_, i) => i + 1).map((d) => {
|
|
1568
|
+
const currentObj = calendar.date(d);
|
|
1569
|
+
const isDisable = isDisabled(currentObj);
|
|
1570
|
+
const isToday = currentObj.isSame(today, "day");
|
|
1571
|
+
const isStart = startDayjs && currentObj.isSame(startDayjs, "day");
|
|
1572
|
+
const isEnd = endDayjs && currentObj.isSame(endDayjs, "day");
|
|
1573
|
+
const isInRange = startDayjs && endDayjs && currentObj.isAfter(startDayjs, "day") && currentObj.isBefore(endDayjs, "day");
|
|
1574
|
+
let bgClass = "hover:bg-blue-100";
|
|
1575
|
+
let textClass = "text-gray-700";
|
|
1576
|
+
if (isDisable) {
|
|
1577
|
+
bgClass = "";
|
|
1578
|
+
textClass = "text-gray-300 cursor-not-allowed";
|
|
1579
|
+
} else if (isStart || isEnd) {
|
|
1580
|
+
bgClass = "bg-blue-600 shadow-md transform scale-105";
|
|
1581
|
+
textClass = "text-white font-semibold";
|
|
1582
|
+
} else if (isInRange) {
|
|
1583
|
+
bgClass = "bg-blue-100";
|
|
1584
|
+
textClass = "text-blue-700";
|
|
1585
|
+
} else if (isToday) {
|
|
1586
|
+
bgClass = "border border-blue-500 font-bold";
|
|
1587
|
+
textClass = "text-blue-600";
|
|
1588
|
+
}
|
|
1589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1590
|
+
"div",
|
|
1591
|
+
{
|
|
1592
|
+
onClick: () => !isDisable && handleSelect(d),
|
|
1593
|
+
className: `
|
|
1594
|
+
h-9 w-9 flex items-center justify-center rounded-full mx-auto transition-all duration-200
|
|
1595
|
+
${bgClass} ${textClass}
|
|
1596
|
+
${!isDisable ? "cursor-pointer" : ""}
|
|
1388
1597
|
`,
|
|
1389
1598
|
children: d
|
|
1390
1599
|
},
|
|
@@ -1395,13 +1604,13 @@ function DatePickerBasic({
|
|
|
1395
1604
|
]
|
|
1396
1605
|
}
|
|
1397
1606
|
),
|
|
1398
|
-
error && /* @__PURE__ */ (0,
|
|
1607
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-red-500 text-xs mt-1", children: error })
|
|
1399
1608
|
] });
|
|
1400
1609
|
}
|
|
1401
1610
|
|
|
1402
1611
|
// src/ColorPicker/ColorPickerBasic/ColorPicker.tsx
|
|
1403
1612
|
var import_antd5 = require("antd");
|
|
1404
|
-
var
|
|
1613
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1405
1614
|
function ColorPickerBasic({
|
|
1406
1615
|
value,
|
|
1407
1616
|
onChange,
|
|
@@ -1414,7 +1623,7 @@ function ColorPickerBasic({
|
|
|
1414
1623
|
className,
|
|
1415
1624
|
placeholder = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E2A\u0E35"
|
|
1416
1625
|
}) {
|
|
1417
|
-
return /* @__PURE__ */ (0,
|
|
1626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1418
1627
|
import_antd5.ConfigProvider,
|
|
1419
1628
|
{
|
|
1420
1629
|
theme: {
|
|
@@ -1423,13 +1632,13 @@ function ColorPickerBasic({
|
|
|
1423
1632
|
fontSize: 16
|
|
1424
1633
|
}
|
|
1425
1634
|
},
|
|
1426
|
-
children: /* @__PURE__ */ (0,
|
|
1427
|
-
/* @__PURE__ */ (0,
|
|
1428
|
-
/* @__PURE__ */ (0,
|
|
1635
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "container-input", children: [
|
|
1636
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { children: [
|
|
1637
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "body-1", children: label }),
|
|
1429
1638
|
" ",
|
|
1430
|
-
required && /* @__PURE__ */ (0,
|
|
1639
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1431
1640
|
] }),
|
|
1432
|
-
/* @__PURE__ */ (0,
|
|
1641
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1433
1642
|
import_antd5.ColorPicker,
|
|
1434
1643
|
{
|
|
1435
1644
|
defaultFormat,
|
|
@@ -1441,9 +1650,9 @@ function ColorPickerBasic({
|
|
|
1441
1650
|
showText: (color) => {
|
|
1442
1651
|
const hex = color.toHexString();
|
|
1443
1652
|
if (!value) {
|
|
1444
|
-
return /* @__PURE__ */ (0,
|
|
1653
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { children: placeholder });
|
|
1445
1654
|
}
|
|
1446
|
-
return /* @__PURE__ */ (0,
|
|
1655
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { children: [
|
|
1447
1656
|
"(",
|
|
1448
1657
|
hex,
|
|
1449
1658
|
")"
|
|
@@ -1452,7 +1661,7 @@ function ColorPickerBasic({
|
|
|
1452
1661
|
disabled
|
|
1453
1662
|
}
|
|
1454
1663
|
),
|
|
1455
|
-
error && /* @__PURE__ */ (0,
|
|
1664
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
1456
1665
|
] })
|
|
1457
1666
|
}
|
|
1458
1667
|
);
|
|
@@ -2161,7 +2370,7 @@ var greyDark = ["#151515", "#1f1f1f", "#2d2d2d", "#393939", "#494949", "#5a5a5a"
|
|
|
2161
2370
|
greyDark.primary = greyDark[5];
|
|
2162
2371
|
|
|
2163
2372
|
// src/ColorPicker/ColorPalettePickerBasic/ColorPalettePickerBasic.tsx
|
|
2164
|
-
var
|
|
2373
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2165
2374
|
function genPresets(presets = presetPalettes) {
|
|
2166
2375
|
return Object.entries(presets).map(([label, colors]) => ({
|
|
2167
2376
|
label,
|
|
@@ -2188,7 +2397,7 @@ function ColorPalettePickerBasic({
|
|
|
2188
2397
|
red,
|
|
2189
2398
|
green
|
|
2190
2399
|
});
|
|
2191
|
-
return /* @__PURE__ */ (0,
|
|
2400
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2192
2401
|
import_antd6.ConfigProvider,
|
|
2193
2402
|
{
|
|
2194
2403
|
theme: {
|
|
@@ -2197,13 +2406,13 @@ function ColorPalettePickerBasic({
|
|
|
2197
2406
|
fontSize: 16
|
|
2198
2407
|
}
|
|
2199
2408
|
},
|
|
2200
|
-
children: /* @__PURE__ */ (0,
|
|
2201
|
-
/* @__PURE__ */ (0,
|
|
2202
|
-
/* @__PURE__ */ (0,
|
|
2409
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "container-input", children: [
|
|
2410
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { children: [
|
|
2411
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "body-1", children: label }),
|
|
2203
2412
|
" ",
|
|
2204
|
-
required && /* @__PURE__ */ (0,
|
|
2413
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2205
2414
|
] }),
|
|
2206
|
-
/* @__PURE__ */ (0,
|
|
2415
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2207
2416
|
import_antd6.ColorPicker,
|
|
2208
2417
|
{
|
|
2209
2418
|
defaultFormat,
|
|
@@ -2216,9 +2425,9 @@ function ColorPalettePickerBasic({
|
|
|
2216
2425
|
showText: (color) => {
|
|
2217
2426
|
const hex = color.toHexString();
|
|
2218
2427
|
if (!value) {
|
|
2219
|
-
return /* @__PURE__ */ (0,
|
|
2428
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: placeholder });
|
|
2220
2429
|
}
|
|
2221
|
-
return /* @__PURE__ */ (0,
|
|
2430
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { children: [
|
|
2222
2431
|
"(",
|
|
2223
2432
|
hex,
|
|
2224
2433
|
")"
|
|
@@ -2228,7 +2437,7 @@ function ColorPalettePickerBasic({
|
|
|
2228
2437
|
onClear
|
|
2229
2438
|
}
|
|
2230
2439
|
),
|
|
2231
|
-
error && /* @__PURE__ */ (0,
|
|
2440
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
2232
2441
|
] })
|
|
2233
2442
|
}
|
|
2234
2443
|
);
|
|
@@ -2236,7 +2445,7 @@ function ColorPalettePickerBasic({
|
|
|
2236
2445
|
|
|
2237
2446
|
// src/Select/SelectField/SelectField.tsx
|
|
2238
2447
|
var import_antd7 = require("antd");
|
|
2239
|
-
var
|
|
2448
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2240
2449
|
function SelectField({
|
|
2241
2450
|
value,
|
|
2242
2451
|
onChange,
|
|
@@ -2254,7 +2463,7 @@ function SelectField({
|
|
|
2254
2463
|
className,
|
|
2255
2464
|
onClear
|
|
2256
2465
|
}) {
|
|
2257
|
-
return /* @__PURE__ */ (0,
|
|
2466
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2258
2467
|
import_antd7.ConfigProvider,
|
|
2259
2468
|
{
|
|
2260
2469
|
theme: {
|
|
@@ -2263,13 +2472,13 @@ function SelectField({
|
|
|
2263
2472
|
fontSize: 16
|
|
2264
2473
|
}
|
|
2265
2474
|
},
|
|
2266
|
-
children: /* @__PURE__ */ (0,
|
|
2267
|
-
/* @__PURE__ */ (0,
|
|
2268
|
-
/* @__PURE__ */ (0,
|
|
2475
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "container-input", children: [
|
|
2476
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { children: [
|
|
2477
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "body-1", children: label }),
|
|
2269
2478
|
" ",
|
|
2270
|
-
required && /* @__PURE__ */ (0,
|
|
2479
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2271
2480
|
] }),
|
|
2272
|
-
/* @__PURE__ */ (0,
|
|
2481
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2273
2482
|
import_antd7.Select,
|
|
2274
2483
|
{
|
|
2275
2484
|
showSearch: true,
|
|
@@ -2284,7 +2493,7 @@ function SelectField({
|
|
|
2284
2493
|
options,
|
|
2285
2494
|
mode,
|
|
2286
2495
|
onSearch: handleSearch,
|
|
2287
|
-
prefix: prefix ? /* @__PURE__ */ (0,
|
|
2496
|
+
prefix: prefix ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2288
2497
|
"span",
|
|
2289
2498
|
{
|
|
2290
2499
|
style: {
|
|
@@ -2301,7 +2510,7 @@ function SelectField({
|
|
|
2301
2510
|
onClear
|
|
2302
2511
|
}
|
|
2303
2512
|
),
|
|
2304
|
-
error && /* @__PURE__ */ (0,
|
|
2513
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
2305
2514
|
] })
|
|
2306
2515
|
}
|
|
2307
2516
|
);
|
|
@@ -2309,7 +2518,7 @@ function SelectField({
|
|
|
2309
2518
|
|
|
2310
2519
|
// src/Select/SelectFieldGroup/SelectFieldGroup.tsx
|
|
2311
2520
|
var import_antd8 = require("antd");
|
|
2312
|
-
var
|
|
2521
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2313
2522
|
function SelectFieldGroup({
|
|
2314
2523
|
value,
|
|
2315
2524
|
onChange,
|
|
@@ -2326,7 +2535,7 @@ function SelectFieldGroup({
|
|
|
2326
2535
|
handleSearch,
|
|
2327
2536
|
className
|
|
2328
2537
|
}) {
|
|
2329
|
-
return /* @__PURE__ */ (0,
|
|
2538
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2330
2539
|
import_antd8.ConfigProvider,
|
|
2331
2540
|
{
|
|
2332
2541
|
theme: {
|
|
@@ -2334,13 +2543,13 @@ function SelectFieldGroup({
|
|
|
2334
2543
|
fontFamily: "Kanit"
|
|
2335
2544
|
}
|
|
2336
2545
|
},
|
|
2337
|
-
children: /* @__PURE__ */ (0,
|
|
2338
|
-
/* @__PURE__ */ (0,
|
|
2339
|
-
/* @__PURE__ */ (0,
|
|
2546
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "container-input", children: [
|
|
2547
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { children: [
|
|
2548
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "body-1", children: label }),
|
|
2340
2549
|
" ",
|
|
2341
|
-
required && /* @__PURE__ */ (0,
|
|
2550
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2342
2551
|
] }),
|
|
2343
|
-
/* @__PURE__ */ (0,
|
|
2552
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2344
2553
|
import_antd8.Select,
|
|
2345
2554
|
{
|
|
2346
2555
|
showSearch: true,
|
|
@@ -2355,7 +2564,7 @@ function SelectFieldGroup({
|
|
|
2355
2564
|
options,
|
|
2356
2565
|
mode,
|
|
2357
2566
|
onSearch: handleSearch,
|
|
2358
|
-
prefix: prefix ? /* @__PURE__ */ (0,
|
|
2567
|
+
prefix: prefix ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2359
2568
|
"span",
|
|
2360
2569
|
{
|
|
2361
2570
|
style: {
|
|
@@ -2371,7 +2580,7 @@ function SelectFieldGroup({
|
|
|
2371
2580
|
allowClear: true
|
|
2372
2581
|
}
|
|
2373
2582
|
),
|
|
2374
|
-
error && /* @__PURE__ */ (0,
|
|
2583
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
2375
2584
|
] })
|
|
2376
2585
|
}
|
|
2377
2586
|
);
|
|
@@ -2391,7 +2600,7 @@ var status = [
|
|
|
2391
2600
|
|
|
2392
2601
|
// src/Select/SelectFieldStatus/SelectFieldStatus.tsx
|
|
2393
2602
|
var import_icons = require("@ant-design/icons");
|
|
2394
|
-
var
|
|
2603
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2395
2604
|
function SelectFieldStatus({
|
|
2396
2605
|
value,
|
|
2397
2606
|
onChange,
|
|
@@ -2404,7 +2613,7 @@ function SelectFieldStatus({
|
|
|
2404
2613
|
className
|
|
2405
2614
|
}) {
|
|
2406
2615
|
const selectedItem = status.find((s) => s.value === value);
|
|
2407
|
-
return /* @__PURE__ */ (0,
|
|
2616
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2408
2617
|
import_antd9.ConfigProvider,
|
|
2409
2618
|
{
|
|
2410
2619
|
theme: {
|
|
@@ -2420,17 +2629,17 @@ function SelectFieldStatus({
|
|
|
2420
2629
|
fontFamily: "Kanit"
|
|
2421
2630
|
}
|
|
2422
2631
|
},
|
|
2423
|
-
children: /* @__PURE__ */ (0,
|
|
2424
|
-
/* @__PURE__ */ (0,
|
|
2425
|
-
/* @__PURE__ */ (0,
|
|
2632
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "container-input", children: [
|
|
2633
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { children: [
|
|
2634
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "body-1", children: label }),
|
|
2426
2635
|
" ",
|
|
2427
|
-
required && /* @__PURE__ */ (0,
|
|
2636
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2428
2637
|
] }),
|
|
2429
|
-
/* @__PURE__ */ (0,
|
|
2638
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2430
2639
|
import_antd9.Select,
|
|
2431
2640
|
{
|
|
2432
2641
|
disabled,
|
|
2433
|
-
suffixIcon: /* @__PURE__ */ (0,
|
|
2642
|
+
suffixIcon: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_icons.DownOutlined, { style: { color: value ? "#fff" : "#D9D9D9" } }),
|
|
2434
2643
|
value,
|
|
2435
2644
|
onChange,
|
|
2436
2645
|
className: `body-3 custom-select flex justify-center w-full ${className ?? ""}`,
|
|
@@ -2441,7 +2650,7 @@ function SelectFieldStatus({
|
|
|
2441
2650
|
showSearch: true
|
|
2442
2651
|
}
|
|
2443
2652
|
),
|
|
2444
|
-
error && /* @__PURE__ */ (0,
|
|
2653
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
2445
2654
|
] })
|
|
2446
2655
|
}
|
|
2447
2656
|
);
|
|
@@ -2458,7 +2667,7 @@ var status2 = [
|
|
|
2458
2667
|
|
|
2459
2668
|
// src/Select/SelectFieldStatusReport/SelectFieldStatusReport.tsx
|
|
2460
2669
|
var import_icons2 = require("@ant-design/icons");
|
|
2461
|
-
var
|
|
2670
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2462
2671
|
function SelectFieldStatusReport({
|
|
2463
2672
|
value,
|
|
2464
2673
|
onChange,
|
|
@@ -2471,7 +2680,7 @@ function SelectFieldStatusReport({
|
|
|
2471
2680
|
options
|
|
2472
2681
|
}) {
|
|
2473
2682
|
const selectedItem = status2.find((s) => s.value === value);
|
|
2474
|
-
return /* @__PURE__ */ (0,
|
|
2683
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2475
2684
|
import_antd10.ConfigProvider,
|
|
2476
2685
|
{
|
|
2477
2686
|
theme: {
|
|
@@ -2487,17 +2696,17 @@ function SelectFieldStatusReport({
|
|
|
2487
2696
|
fontFamily: "Kanit"
|
|
2488
2697
|
}
|
|
2489
2698
|
},
|
|
2490
|
-
children: /* @__PURE__ */ (0,
|
|
2491
|
-
/* @__PURE__ */ (0,
|
|
2492
|
-
/* @__PURE__ */ (0,
|
|
2699
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "container-input", children: [
|
|
2700
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { children: [
|
|
2701
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "body-1", children: label }),
|
|
2493
2702
|
" ",
|
|
2494
|
-
required && /* @__PURE__ */ (0,
|
|
2703
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2495
2704
|
] }),
|
|
2496
|
-
/* @__PURE__ */ (0,
|
|
2705
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2497
2706
|
import_antd10.Select,
|
|
2498
2707
|
{
|
|
2499
2708
|
disabled,
|
|
2500
|
-
suffixIcon: /* @__PURE__ */ (0,
|
|
2709
|
+
suffixIcon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_icons2.DownOutlined, { style: { color: value ? "#fff" : "#D9D9D9" } }),
|
|
2501
2710
|
value,
|
|
2502
2711
|
onChange,
|
|
2503
2712
|
className: `body-3 custom-select flex justify-center w-full ${className ?? ""}`,
|
|
@@ -2508,7 +2717,7 @@ function SelectFieldStatusReport({
|
|
|
2508
2717
|
showSearch: true
|
|
2509
2718
|
}
|
|
2510
2719
|
),
|
|
2511
|
-
error && /* @__PURE__ */ (0,
|
|
2720
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
2512
2721
|
] })
|
|
2513
2722
|
}
|
|
2514
2723
|
);
|
|
@@ -2516,8 +2725,8 @@ function SelectFieldStatusReport({
|
|
|
2516
2725
|
|
|
2517
2726
|
// src/Select/SelectFieldTag/SelectFieldTag.tsx
|
|
2518
2727
|
var import_antd11 = require("antd");
|
|
2519
|
-
var
|
|
2520
|
-
var
|
|
2728
|
+
var import_react10 = require("react");
|
|
2729
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2521
2730
|
function SelectFieldTag({
|
|
2522
2731
|
label,
|
|
2523
2732
|
required,
|
|
@@ -2529,10 +2738,10 @@ function SelectFieldTag({
|
|
|
2529
2738
|
onChange,
|
|
2530
2739
|
onClear
|
|
2531
2740
|
}) {
|
|
2532
|
-
const [internalValue, setInternalValue] = (0,
|
|
2741
|
+
const [internalValue, setInternalValue] = (0, import_react10.useState)([]);
|
|
2533
2742
|
const isControlled = controlledValue !== void 0;
|
|
2534
2743
|
const value = isControlled ? controlledValue : internalValue;
|
|
2535
|
-
const [searchWord, setSearchWord] = (0,
|
|
2744
|
+
const [searchWord, setSearchWord] = (0, import_react10.useState)("");
|
|
2536
2745
|
const handleChange = (val) => {
|
|
2537
2746
|
const trimValue = val.map((v) => v.trim());
|
|
2538
2747
|
const filtered = trimValue.filter((v) => v.trim() !== "");
|
|
@@ -2550,7 +2759,7 @@ function SelectFieldTag({
|
|
|
2550
2759
|
}
|
|
2551
2760
|
onChange?.([]);
|
|
2552
2761
|
};
|
|
2553
|
-
return /* @__PURE__ */ (0,
|
|
2762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2554
2763
|
import_antd11.ConfigProvider,
|
|
2555
2764
|
{
|
|
2556
2765
|
theme: {
|
|
@@ -2558,13 +2767,13 @@ function SelectFieldTag({
|
|
|
2558
2767
|
fontFamily: "Kanit"
|
|
2559
2768
|
}
|
|
2560
2769
|
},
|
|
2561
|
-
children: /* @__PURE__ */ (0,
|
|
2562
|
-
/* @__PURE__ */ (0,
|
|
2563
|
-
/* @__PURE__ */ (0,
|
|
2770
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "container-input", children: [
|
|
2771
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { children: [
|
|
2772
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "body-1", children: label }),
|
|
2564
2773
|
" ",
|
|
2565
|
-
required && /* @__PURE__ */ (0,
|
|
2774
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2566
2775
|
] }),
|
|
2567
|
-
/* @__PURE__ */ (0,
|
|
2776
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2568
2777
|
import_antd11.Select,
|
|
2569
2778
|
{
|
|
2570
2779
|
mode: "tags",
|
|
@@ -2583,7 +2792,7 @@ function SelectFieldTag({
|
|
|
2583
2792
|
onClear
|
|
2584
2793
|
}
|
|
2585
2794
|
),
|
|
2586
|
-
error && /* @__PURE__ */ (0,
|
|
2795
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
2587
2796
|
] })
|
|
2588
2797
|
}
|
|
2589
2798
|
);
|
|
@@ -2592,8 +2801,8 @@ function SelectFieldTag({
|
|
|
2592
2801
|
// src/Select/SelectCustom/SelectCustom.tsx
|
|
2593
2802
|
var import_icons_react8 = require("@tabler/icons-react");
|
|
2594
2803
|
var import_antd12 = require("antd");
|
|
2595
|
-
var
|
|
2596
|
-
var
|
|
2804
|
+
var import_react11 = require("react");
|
|
2805
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2597
2806
|
function SelectCustom({
|
|
2598
2807
|
label = "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E42\u0E04\u0E23\u0E07\u0E01\u0E32\u0E23",
|
|
2599
2808
|
placeholder = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01",
|
|
@@ -2603,8 +2812,8 @@ function SelectCustom({
|
|
|
2603
2812
|
error,
|
|
2604
2813
|
onClear
|
|
2605
2814
|
}) {
|
|
2606
|
-
const [value, setValue] = (0,
|
|
2607
|
-
const [valueList, setValueList] = (0,
|
|
2815
|
+
const [value, setValue] = (0, import_react11.useState)([]);
|
|
2816
|
+
const [valueList, setValueList] = (0, import_react11.useState)([]);
|
|
2608
2817
|
const handleChange = (selectedValues) => {
|
|
2609
2818
|
const newValues = selectedValues.filter((v) => !valueList.includes(v));
|
|
2610
2819
|
setValueList((prev) => {
|
|
@@ -2622,7 +2831,7 @@ function SelectCustom({
|
|
|
2622
2831
|
});
|
|
2623
2832
|
};
|
|
2624
2833
|
const filteredOptions = options.filter((opt) => !valueList.includes(opt.value)).map((opt) => ({ value: opt.value, label: opt.label }));
|
|
2625
|
-
return /* @__PURE__ */ (0,
|
|
2834
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2626
2835
|
import_antd12.ConfigProvider,
|
|
2627
2836
|
{
|
|
2628
2837
|
theme: {
|
|
@@ -2631,13 +2840,13 @@ function SelectCustom({
|
|
|
2631
2840
|
fontSize: 16
|
|
2632
2841
|
}
|
|
2633
2842
|
},
|
|
2634
|
-
children: /* @__PURE__ */ (0,
|
|
2635
|
-
/* @__PURE__ */ (0,
|
|
2636
|
-
/* @__PURE__ */ (0,
|
|
2843
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "container-input", children: [
|
|
2844
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { children: [
|
|
2845
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "body-1", children: label }),
|
|
2637
2846
|
" ",
|
|
2638
|
-
required && /* @__PURE__ */ (0,
|
|
2847
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2639
2848
|
] }),
|
|
2640
|
-
/* @__PURE__ */ (0,
|
|
2849
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2641
2850
|
import_antd12.Select,
|
|
2642
2851
|
{
|
|
2643
2852
|
value,
|
|
@@ -2648,16 +2857,16 @@ function SelectCustom({
|
|
|
2648
2857
|
onClear
|
|
2649
2858
|
}
|
|
2650
2859
|
),
|
|
2651
|
-
error && /* @__PURE__ */ (0,
|
|
2652
|
-
/* @__PURE__ */ (0,
|
|
2653
|
-
/* @__PURE__ */ (0,
|
|
2654
|
-
/* @__PURE__ */ (0,
|
|
2860
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "text-red-500 caption-1", children: error }),
|
|
2861
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "w-full p-[2px] overflow-y-auto", children: valueList.map((v, index) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex justify-between items-center py-[2px] body-1", children: [
|
|
2862
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex flex-row gap-[8px]", children: [
|
|
2863
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("p", { children: [
|
|
2655
2864
|
index + 1,
|
|
2656
2865
|
"."
|
|
2657
2866
|
] }),
|
|
2658
|
-
/* @__PURE__ */ (0,
|
|
2867
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { children: v })
|
|
2659
2868
|
] }),
|
|
2660
|
-
/* @__PURE__ */ (0,
|
|
2869
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_icons_react8.IconTrash, { className: "cursor-pointer", onClick: () => handleDelete(v) })
|
|
2661
2870
|
] }, index)) })
|
|
2662
2871
|
] })
|
|
2663
2872
|
}
|
|
@@ -2696,9 +2905,9 @@ var quarters = [
|
|
|
2696
2905
|
];
|
|
2697
2906
|
|
|
2698
2907
|
// src/SortFilter/SortFilter.tsx
|
|
2699
|
-
var
|
|
2908
|
+
var import_react12 = require("react");
|
|
2700
2909
|
var import_icons_react9 = require("@tabler/icons-react");
|
|
2701
|
-
var
|
|
2910
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2702
2911
|
function SortFilter({
|
|
2703
2912
|
showYear = true,
|
|
2704
2913
|
showQuarter = true,
|
|
@@ -2706,10 +2915,10 @@ function SortFilter({
|
|
|
2706
2915
|
onSortClick,
|
|
2707
2916
|
onFilterClick
|
|
2708
2917
|
}) {
|
|
2709
|
-
const [yearValue, setYearValue] = (0,
|
|
2710
|
-
const [monthValue, setMonthValue] = (0,
|
|
2711
|
-
const [quarterValue, setQuartersValue] = (0,
|
|
2712
|
-
return /* @__PURE__ */ (0,
|
|
2918
|
+
const [yearValue, setYearValue] = (0, import_react12.useState)();
|
|
2919
|
+
const [monthValue, setMonthValue] = (0, import_react12.useState)();
|
|
2920
|
+
const [quarterValue, setQuartersValue] = (0, import_react12.useState)();
|
|
2921
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2713
2922
|
import_antd13.ConfigProvider,
|
|
2714
2923
|
{
|
|
2715
2924
|
theme: {
|
|
@@ -2717,12 +2926,12 @@ function SortFilter({
|
|
|
2717
2926
|
fontFamily: "Kanit"
|
|
2718
2927
|
}
|
|
2719
2928
|
},
|
|
2720
|
-
children: /* @__PURE__ */ (0,
|
|
2721
|
-
/* @__PURE__ */ (0,
|
|
2722
|
-
showYear && /* @__PURE__ */ (0,
|
|
2929
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "w-full flex items-center justify-between", children: [
|
|
2930
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "w-full flex gap-[10px]", children: [
|
|
2931
|
+
showYear && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "w-[200px]", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2723
2932
|
SelectField,
|
|
2724
2933
|
{
|
|
2725
|
-
prefix: /* @__PURE__ */ (0,
|
|
2934
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons3.CalendarOutlined, {}),
|
|
2726
2935
|
onChange: setYearValue,
|
|
2727
2936
|
options: years.map((s) => ({
|
|
2728
2937
|
value: s.value,
|
|
@@ -2732,10 +2941,10 @@ function SortFilter({
|
|
|
2732
2941
|
value: yearValue
|
|
2733
2942
|
}
|
|
2734
2943
|
) }),
|
|
2735
|
-
showMonth && /* @__PURE__ */ (0,
|
|
2944
|
+
showMonth && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "w-[200px]", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2736
2945
|
SelectField,
|
|
2737
2946
|
{
|
|
2738
|
-
prefix: /* @__PURE__ */ (0,
|
|
2947
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons3.CalendarOutlined, {}),
|
|
2739
2948
|
onChange: setMonthValue,
|
|
2740
2949
|
options: months.map((s) => ({
|
|
2741
2950
|
value: s.value,
|
|
@@ -2745,10 +2954,10 @@ function SortFilter({
|
|
|
2745
2954
|
placeholder: "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E40\u0E14\u0E37\u0E2D\u0E19"
|
|
2746
2955
|
}
|
|
2747
2956
|
) }),
|
|
2748
|
-
showQuarter && /* @__PURE__ */ (0,
|
|
2957
|
+
showQuarter && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "w-[200px]", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2749
2958
|
SelectField,
|
|
2750
2959
|
{
|
|
2751
|
-
prefix: /* @__PURE__ */ (0,
|
|
2960
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons3.CalendarOutlined, {}),
|
|
2752
2961
|
onChange: setQuartersValue,
|
|
2753
2962
|
options: quarters.map((s) => ({
|
|
2754
2963
|
value: s.value,
|
|
@@ -2759,8 +2968,8 @@ function SortFilter({
|
|
|
2759
2968
|
}
|
|
2760
2969
|
) })
|
|
2761
2970
|
] }),
|
|
2762
|
-
/* @__PURE__ */ (0,
|
|
2763
|
-
/* @__PURE__ */ (0,
|
|
2971
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex gap-[10px]", children: [
|
|
2972
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2764
2973
|
import_icons_react9.IconSortDescending,
|
|
2765
2974
|
{
|
|
2766
2975
|
size: 24,
|
|
@@ -2768,7 +2977,7 @@ function SortFilter({
|
|
|
2768
2977
|
onClick: onSortClick
|
|
2769
2978
|
}
|
|
2770
2979
|
),
|
|
2771
|
-
/* @__PURE__ */ (0,
|
|
2980
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2772
2981
|
import_icons_react9.IconFilter,
|
|
2773
2982
|
{
|
|
2774
2983
|
size: 24,
|
|
@@ -2784,8 +2993,8 @@ function SortFilter({
|
|
|
2784
2993
|
|
|
2785
2994
|
// src/Upload/FileUploader/FileUploader.tsx
|
|
2786
2995
|
var import_icons_react10 = require("@tabler/icons-react");
|
|
2787
|
-
var
|
|
2788
|
-
var
|
|
2996
|
+
var import_react13 = require("react");
|
|
2997
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2789
2998
|
function FileUploader({
|
|
2790
2999
|
onUpload,
|
|
2791
3000
|
onError,
|
|
@@ -2795,12 +3004,14 @@ function FileUploader({
|
|
|
2795
3004
|
disabled,
|
|
2796
3005
|
mode = "drop",
|
|
2797
3006
|
description,
|
|
2798
|
-
label
|
|
3007
|
+
label,
|
|
3008
|
+
value
|
|
2799
3009
|
}) {
|
|
2800
|
-
const [
|
|
2801
|
-
const [uploading, setUploading] = (0,
|
|
2802
|
-
const [dragActive, setDragActive] = (0,
|
|
2803
|
-
const inputRef = (0,
|
|
3010
|
+
const [internalFileList, setInternalFileList] = (0, import_react13.useState)([]);
|
|
3011
|
+
const [uploading, setUploading] = (0, import_react13.useState)(false);
|
|
3012
|
+
const [dragActive, setDragActive] = (0, import_react13.useState)(false);
|
|
3013
|
+
const inputRef = (0, import_react13.useRef)(null);
|
|
3014
|
+
const filesToDisplay = value || internalFileList;
|
|
2804
3015
|
const validateFile = (file) => {
|
|
2805
3016
|
if (accept && !accept.includes(file.type)) {
|
|
2806
3017
|
onError?.(`Invalid file type. file: ${file.name}`);
|
|
@@ -2820,9 +3031,11 @@ function FileUploader({
|
|
|
2820
3031
|
if (onRemove) {
|
|
2821
3032
|
await onRemove(index);
|
|
2822
3033
|
}
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
3034
|
+
if (!value) {
|
|
3035
|
+
const updatedList = [...internalFileList];
|
|
3036
|
+
updatedList.splice(index, 1);
|
|
3037
|
+
setInternalFileList(updatedList);
|
|
3038
|
+
}
|
|
2826
3039
|
} catch (error) {
|
|
2827
3040
|
console.log(error);
|
|
2828
3041
|
}
|
|
@@ -2840,13 +3053,19 @@ function FileUploader({
|
|
|
2840
3053
|
if (!files) return;
|
|
2841
3054
|
const fileArray = Array.from(files);
|
|
2842
3055
|
for (const file of fileArray) {
|
|
2843
|
-
|
|
3056
|
+
try {
|
|
3057
|
+
validateFile(file);
|
|
3058
|
+
} catch (e) {
|
|
3059
|
+
continue;
|
|
3060
|
+
}
|
|
2844
3061
|
setUploading(true);
|
|
2845
3062
|
try {
|
|
2846
3063
|
if (onUpload) {
|
|
2847
3064
|
await onUpload(file);
|
|
2848
3065
|
}
|
|
2849
|
-
|
|
3066
|
+
if (!value) {
|
|
3067
|
+
setInternalFileList((prev) => [...prev, file]);
|
|
3068
|
+
}
|
|
2850
3069
|
} catch (err) {
|
|
2851
3070
|
console.log("catch");
|
|
2852
3071
|
console.error(err);
|
|
@@ -2856,10 +3075,10 @@ function FileUploader({
|
|
|
2856
3075
|
}
|
|
2857
3076
|
if (inputRef.current) inputRef.current.value = "";
|
|
2858
3077
|
};
|
|
2859
|
-
return /* @__PURE__ */ (0,
|
|
2860
|
-
label && /* @__PURE__ */ (0,
|
|
2861
|
-
/* @__PURE__ */ (0,
|
|
2862
|
-
mode === "upload" ? /* @__PURE__ */ (0,
|
|
3078
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "w-full", children: [
|
|
3079
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "body-1", children: label }),
|
|
3080
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { children: [
|
|
3081
|
+
mode === "upload" ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2863
3082
|
"button",
|
|
2864
3083
|
{
|
|
2865
3084
|
type: "button",
|
|
@@ -2867,15 +3086,15 @@ function FileUploader({
|
|
|
2867
3086
|
className: `h-[34px] flex justify-center items-center gap-2 w-full rounded-[2px] border border-gray-200 body-1
|
|
2868
3087
|
${disabled ? "cursor-not-allowed text-gray-400 bg-gray-100" : "cursor-pointer hover:text-primary-400 hover:border-primary-200 duration-300"}`,
|
|
2869
3088
|
disabled: disabled ? disabled : uploading,
|
|
2870
|
-
children: uploading ? /* @__PURE__ */ (0,
|
|
2871
|
-
/* @__PURE__ */ (0,
|
|
3089
|
+
children: uploading ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
3090
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Loader, { size: 15 }),
|
|
2872
3091
|
" \u0E01\u0E33\u0E25\u0E31\u0E07\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14"
|
|
2873
|
-
] }) : /* @__PURE__ */ (0,
|
|
2874
|
-
/* @__PURE__ */ (0,
|
|
3092
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
3093
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_icons_react10.IconUpload, { size: 15, className: "text-gray-400" }),
|
|
2875
3094
|
" \u0E41\u0E19\u0E1A\u0E44\u0E1F\u0E25\u0E4C"
|
|
2876
3095
|
] })
|
|
2877
3096
|
}
|
|
2878
|
-
) : /* @__PURE__ */ (0,
|
|
3097
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2879
3098
|
"div",
|
|
2880
3099
|
{
|
|
2881
3100
|
className: `min-w-[400px] min-h-[120px] flex justify-center items-center border-2 border-dashed rounded-md p-4 transition-colors body-1
|
|
@@ -2889,17 +3108,17 @@ function FileUploader({
|
|
|
2889
3108
|
},
|
|
2890
3109
|
onDragLeave: () => setDragActive(false),
|
|
2891
3110
|
onDrop: handleDrop,
|
|
2892
|
-
children: uploading ? /* @__PURE__ */ (0,
|
|
2893
|
-
/* @__PURE__ */ (0,
|
|
3111
|
+
children: uploading ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex justify-center items-center gap-2", children: [
|
|
3112
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Loader, { size: 15 }),
|
|
2894
3113
|
" \u0E01\u0E33\u0E25\u0E31\u0E07\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14"
|
|
2895
|
-
] }) : /* @__PURE__ */ (0,
|
|
2896
|
-
/* @__PURE__ */ (0,
|
|
2897
|
-
/* @__PURE__ */ (0,
|
|
2898
|
-
/* @__PURE__ */ (0,
|
|
3114
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col items-center gap-2", children: [
|
|
3115
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_icons_react10.IconUpload, { size: 20 }),
|
|
3116
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("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" }),
|
|
3117
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("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" })
|
|
2899
3118
|
] })
|
|
2900
3119
|
}
|
|
2901
3120
|
),
|
|
2902
|
-
/* @__PURE__ */ (0,
|
|
3121
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2903
3122
|
"input",
|
|
2904
3123
|
{
|
|
2905
3124
|
type: "file",
|
|
@@ -2912,13 +3131,13 @@ function FileUploader({
|
|
|
2912
3131
|
}
|
|
2913
3132
|
)
|
|
2914
3133
|
] }),
|
|
2915
|
-
description && /* @__PURE__ */ (0,
|
|
2916
|
-
/* @__PURE__ */ (0,
|
|
2917
|
-
/* @__PURE__ */ (0,
|
|
2918
|
-
/* @__PURE__ */ (0,
|
|
2919
|
-
/* @__PURE__ */ (0,
|
|
3134
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-gray-400 body-4", children: description }),
|
|
3135
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "mt-[8px]", children: filesToDisplay.length !== 0 && filesToDisplay.map((file, index) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center gap-2 rounded-[4px] px-[8px] py-[4px] body-1", children: [
|
|
3136
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center gap-2 w-[75%] overflow-hidden", children: [
|
|
3137
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "w-[15px] h-[15px]", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_icons_react10.IconPaperclip, { size: 15 }) }),
|
|
3138
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "truncate", children: file.name || file.fileName })
|
|
2920
3139
|
] }),
|
|
2921
|
-
/* @__PURE__ */ (0,
|
|
3140
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2922
3141
|
import_icons_react10.IconTrash,
|
|
2923
3142
|
{
|
|
2924
3143
|
size: 20,
|
|
@@ -2954,7 +3173,7 @@ function messageLoading(content, duration) {
|
|
|
2954
3173
|
// src/Breadcrumb/Breadcrumb.tsx
|
|
2955
3174
|
var import_antd14 = require("antd");
|
|
2956
3175
|
var import_antd15 = require("antd");
|
|
2957
|
-
var
|
|
3176
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2958
3177
|
function Breadcrumbs({
|
|
2959
3178
|
items,
|
|
2960
3179
|
separator,
|
|
@@ -2962,7 +3181,7 @@ function Breadcrumbs({
|
|
|
2962
3181
|
classname,
|
|
2963
3182
|
params
|
|
2964
3183
|
}) {
|
|
2965
|
-
return /* @__PURE__ */ (0,
|
|
3184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2966
3185
|
import_antd14.ConfigProvider,
|
|
2967
3186
|
{
|
|
2968
3187
|
theme: {
|
|
@@ -2970,7 +3189,7 @@ function Breadcrumbs({
|
|
|
2970
3189
|
fontFamily: "Kanit"
|
|
2971
3190
|
}
|
|
2972
3191
|
},
|
|
2973
|
-
children: /* @__PURE__ */ (0,
|
|
3192
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2974
3193
|
import_antd15.Breadcrumb,
|
|
2975
3194
|
{
|
|
2976
3195
|
items,
|
|
@@ -2986,7 +3205,7 @@ function Breadcrumbs({
|
|
|
2986
3205
|
|
|
2987
3206
|
// src/HeadingPage/HeadingPage.tsx
|
|
2988
3207
|
var import_antd16 = require("antd");
|
|
2989
|
-
var
|
|
3208
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2990
3209
|
function HeadingPage({ Heading }) {
|
|
2991
3210
|
const today = (/* @__PURE__ */ new Date()).toLocaleDateString("th-TH", {
|
|
2992
3211
|
weekday: "long",
|
|
@@ -2994,7 +3213,7 @@ function HeadingPage({ Heading }) {
|
|
|
2994
3213
|
month: "long",
|
|
2995
3214
|
year: "numeric"
|
|
2996
3215
|
});
|
|
2997
|
-
return /* @__PURE__ */ (0,
|
|
3216
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2998
3217
|
import_antd16.ConfigProvider,
|
|
2999
3218
|
{
|
|
3000
3219
|
theme: {
|
|
@@ -3002,9 +3221,9 @@ function HeadingPage({ Heading }) {
|
|
|
3002
3221
|
fontFamily: "Kanit"
|
|
3003
3222
|
}
|
|
3004
3223
|
},
|
|
3005
|
-
children: /* @__PURE__ */ (0,
|
|
3006
|
-
/* @__PURE__ */ (0,
|
|
3007
|
-
/* @__PURE__ */ (0,
|
|
3224
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex flex-col gap-[10px] px-[20px] py-[10px]", children: [
|
|
3225
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "headline-5", children: Heading }),
|
|
3226
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("p", { className: "body-1", children: [
|
|
3008
3227
|
" \u0E27\u0E31\u0E19\u0E19\u0E35\u0E49 ",
|
|
3009
3228
|
today
|
|
3010
3229
|
] })
|
|
@@ -3015,8 +3234,8 @@ function HeadingPage({ Heading }) {
|
|
|
3015
3234
|
|
|
3016
3235
|
// src/Progress/ProgressBar.tsx
|
|
3017
3236
|
var import_antd17 = require("antd");
|
|
3018
|
-
var
|
|
3019
|
-
var
|
|
3237
|
+
var import_react14 = require("react");
|
|
3238
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3020
3239
|
function ProgressBar({
|
|
3021
3240
|
percent = 0,
|
|
3022
3241
|
size = "default",
|
|
@@ -3029,8 +3248,8 @@ function ProgressBar({
|
|
|
3029
3248
|
steps,
|
|
3030
3249
|
isCheckPoints
|
|
3031
3250
|
}) {
|
|
3032
|
-
const [barWidth, setBarWidth] = (0,
|
|
3033
|
-
const progressRef = (0,
|
|
3251
|
+
const [barWidth, setBarWidth] = (0, import_react14.useState)(0);
|
|
3252
|
+
const progressRef = (0, import_react14.useRef)(null);
|
|
3034
3253
|
let strokeColor = "--color-green-500";
|
|
3035
3254
|
const defaultStrokeWidth = type === "circle" ? 13 : strokeWidth ?? 8;
|
|
3036
3255
|
const defaultSize = type === "circle" ? 43 : size;
|
|
@@ -3038,7 +3257,7 @@ function ProgressBar({
|
|
|
3038
3257
|
const minCheckpoint = Math.min(...checkpoints);
|
|
3039
3258
|
strokeColor = percent >= minCheckpoint ? "var(--color-green-500)" : "var(--color-red-500)";
|
|
3040
3259
|
}
|
|
3041
|
-
(0,
|
|
3260
|
+
(0, import_react14.useEffect)(() => {
|
|
3042
3261
|
const inner = progressRef.current?.querySelector(".ant-progress-inner");
|
|
3043
3262
|
if (!inner) return;
|
|
3044
3263
|
const observer = new ResizeObserver(() => {
|
|
@@ -3047,7 +3266,7 @@ function ProgressBar({
|
|
|
3047
3266
|
observer.observe(inner);
|
|
3048
3267
|
return () => observer.disconnect();
|
|
3049
3268
|
}, []);
|
|
3050
|
-
return /* @__PURE__ */ (0,
|
|
3269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3051
3270
|
import_antd17.ConfigProvider,
|
|
3052
3271
|
{
|
|
3053
3272
|
theme: {
|
|
@@ -3055,8 +3274,8 @@ function ProgressBar({
|
|
|
3055
3274
|
fontFamily: "Kanit"
|
|
3056
3275
|
}
|
|
3057
3276
|
},
|
|
3058
|
-
children: /* @__PURE__ */ (0,
|
|
3059
|
-
/* @__PURE__ */ (0,
|
|
3277
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "relative w-full", ref: progressRef, children: [
|
|
3278
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3060
3279
|
import_antd17.Progress,
|
|
3061
3280
|
{
|
|
3062
3281
|
className: "w-full",
|
|
@@ -3072,7 +3291,7 @@ function ProgressBar({
|
|
|
3072
3291
|
strokeColor
|
|
3073
3292
|
}
|
|
3074
3293
|
),
|
|
3075
|
-
barWidth > 0 && isCheckPoints && type !== "circle" && checkpoints.map((cp) => /* @__PURE__ */ (0,
|
|
3294
|
+
barWidth > 0 && isCheckPoints && type !== "circle" && checkpoints.map((cp) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3076
3295
|
"div",
|
|
3077
3296
|
{
|
|
3078
3297
|
className: "checkpoint absolute top-0",
|
|
@@ -3095,24 +3314,24 @@ function ProgressBar({
|
|
|
3095
3314
|
|
|
3096
3315
|
// src/KpiSection/KpiSection.tsx
|
|
3097
3316
|
var import_antd18 = require("antd");
|
|
3098
|
-
var
|
|
3317
|
+
var import_react16 = require("react");
|
|
3099
3318
|
|
|
3100
3319
|
// src/KpiSection/hooks/useGetKpiSection.ts
|
|
3101
|
-
var
|
|
3320
|
+
var import_react15 = require("react");
|
|
3102
3321
|
var import_cuid = __toESM(require("cuid"));
|
|
3103
3322
|
function useGetKpiSection() {
|
|
3104
|
-
const [nameKpi, setNameKpi] = (0,
|
|
3105
|
-
const [kpiValue, setKpiValue] = (0,
|
|
3106
|
-
const [unitValue, setUnitValue] = (0,
|
|
3107
|
-
const [kpiList, setKpiList] = (0,
|
|
3108
|
-
const [editingBackup, setEditingBackup] = (0,
|
|
3109
|
-
const [selected, setSelected] = (0,
|
|
3110
|
-
const [errors, setErrors] = (0,
|
|
3323
|
+
const [nameKpi, setNameKpi] = (0, import_react15.useState)("");
|
|
3324
|
+
const [kpiValue, setKpiValue] = (0, import_react15.useState)("");
|
|
3325
|
+
const [unitValue, setUnitValue] = (0, import_react15.useState)("");
|
|
3326
|
+
const [kpiList, setKpiList] = (0, import_react15.useState)([]);
|
|
3327
|
+
const [editingBackup, setEditingBackup] = (0, import_react15.useState)({});
|
|
3328
|
+
const [selected, setSelected] = (0, import_react15.useState)("2");
|
|
3329
|
+
const [errors, setErrors] = (0, import_react15.useState)({
|
|
3111
3330
|
nameKpi: "",
|
|
3112
3331
|
kpiValue: "",
|
|
3113
3332
|
unitValue: ""
|
|
3114
3333
|
});
|
|
3115
|
-
const [itemErrors, setItemErrors] = (0,
|
|
3334
|
+
const [itemErrors, setItemErrors] = (0, import_react15.useState)({});
|
|
3116
3335
|
const options = [
|
|
3117
3336
|
{ value: "1", label: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21" },
|
|
3118
3337
|
{ value: "2", label: "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02" }
|
|
@@ -3245,7 +3464,7 @@ function useGetKpiSection() {
|
|
|
3245
3464
|
|
|
3246
3465
|
// src/KpiSection/KpiSection.tsx
|
|
3247
3466
|
var import_icons_react11 = require("@tabler/icons-react");
|
|
3248
|
-
var
|
|
3467
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3249
3468
|
function KpiSection({ type, onChangeKpiList }) {
|
|
3250
3469
|
const {
|
|
3251
3470
|
handleAddKpi,
|
|
@@ -3266,16 +3485,16 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3266
3485
|
setItemErrors
|
|
3267
3486
|
} = useGetKpiSection();
|
|
3268
3487
|
const [messageApi2, messageContainer] = import_antd18.message.useMessage();
|
|
3269
|
-
const [hasShownError, setHasShownError] = (0,
|
|
3270
|
-
(0,
|
|
3488
|
+
const [hasShownError, setHasShownError] = (0, import_react16.useState)(false);
|
|
3489
|
+
(0, import_react16.useEffect)(() => {
|
|
3271
3490
|
setMessageApi(messageApi2);
|
|
3272
3491
|
}, [messageApi2]);
|
|
3273
|
-
(0,
|
|
3492
|
+
(0, import_react16.useEffect)(() => {
|
|
3274
3493
|
if (onChangeKpiList) {
|
|
3275
3494
|
onChangeKpiList(kpiList);
|
|
3276
3495
|
}
|
|
3277
3496
|
}, [kpiList]);
|
|
3278
|
-
return /* @__PURE__ */ (0,
|
|
3497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3279
3498
|
import_antd18.ConfigProvider,
|
|
3280
3499
|
{
|
|
3281
3500
|
theme: {
|
|
@@ -3284,11 +3503,11 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3284
3503
|
fontSize: 16
|
|
3285
3504
|
}
|
|
3286
3505
|
},
|
|
3287
|
-
children: /* @__PURE__ */ (0,
|
|
3506
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "container-input", children: [
|
|
3288
3507
|
messageContainer,
|
|
3289
|
-
type === "number" && /* @__PURE__ */ (0,
|
|
3290
|
-
/* @__PURE__ */ (0,
|
|
3291
|
-
/* @__PURE__ */ (0,
|
|
3508
|
+
type === "number" && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "space-y-4", children: [
|
|
3509
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "grid grid-cols-[1fr_200px_200px_50px] w-full gap-[24px] items-start", children: [
|
|
3510
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3292
3511
|
InputField,
|
|
3293
3512
|
{
|
|
3294
3513
|
value: nameKpi,
|
|
@@ -3300,7 +3519,7 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3300
3519
|
error: errors.nameKpi
|
|
3301
3520
|
}
|
|
3302
3521
|
),
|
|
3303
|
-
/* @__PURE__ */ (0,
|
|
3522
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3304
3523
|
InputField,
|
|
3305
3524
|
{
|
|
3306
3525
|
value: kpiValue,
|
|
@@ -3324,7 +3543,7 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3324
3543
|
error: errors.kpiValue
|
|
3325
3544
|
}
|
|
3326
3545
|
),
|
|
3327
|
-
/* @__PURE__ */ (0,
|
|
3546
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3328
3547
|
InputField,
|
|
3329
3548
|
{
|
|
3330
3549
|
value: unitValue,
|
|
@@ -3336,7 +3555,7 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3336
3555
|
error: errors.unitValue
|
|
3337
3556
|
}
|
|
3338
3557
|
),
|
|
3339
|
-
/* @__PURE__ */ (0,
|
|
3558
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: `flex justify-end mt-[28px]`, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3340
3559
|
import_icons_react11.IconCirclePlus,
|
|
3341
3560
|
{
|
|
3342
3561
|
className: "w-[40px] h-[40px] cursor-pointer hover:scale-110 transition",
|
|
@@ -3345,17 +3564,17 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3345
3564
|
}
|
|
3346
3565
|
) })
|
|
3347
3566
|
] }),
|
|
3348
|
-
/* @__PURE__ */ (0,
|
|
3567
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { children: kpiList.map((kpi, index) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
3349
3568
|
"div",
|
|
3350
3569
|
{
|
|
3351
3570
|
className: "grid grid-cols-[30px_1fr_100px_120px_80px] items-start py-2 body-1 gap-[8px]",
|
|
3352
3571
|
children: [
|
|
3353
|
-
/* @__PURE__ */ (0,
|
|
3572
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("p", { className: `body-1 ${kpi.isEditing ? "mt-[12px]" : ""}`, children: [
|
|
3354
3573
|
index + 1,
|
|
3355
3574
|
"."
|
|
3356
3575
|
] }),
|
|
3357
|
-
kpi.isEditing ? /* @__PURE__ */ (0,
|
|
3358
|
-
/* @__PURE__ */ (0,
|
|
3576
|
+
kpi.isEditing ? /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
3577
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3359
3578
|
InputField,
|
|
3360
3579
|
{
|
|
3361
3580
|
value: kpi.name,
|
|
@@ -3365,7 +3584,7 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3365
3584
|
error: itemErrors[kpi.id]?.name
|
|
3366
3585
|
}
|
|
3367
3586
|
),
|
|
3368
|
-
/* @__PURE__ */ (0,
|
|
3587
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3369
3588
|
InputField,
|
|
3370
3589
|
{
|
|
3371
3590
|
value: kpi.value?.toString(),
|
|
@@ -3390,7 +3609,7 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3390
3609
|
error: itemErrors[kpi.id]?.value
|
|
3391
3610
|
}
|
|
3392
3611
|
),
|
|
3393
|
-
/* @__PURE__ */ (0,
|
|
3612
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3394
3613
|
InputField,
|
|
3395
3614
|
{
|
|
3396
3615
|
value: kpi.unit,
|
|
@@ -3400,29 +3619,29 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3400
3619
|
error: itemErrors[kpi.id]?.unit
|
|
3401
3620
|
}
|
|
3402
3621
|
),
|
|
3403
|
-
/* @__PURE__ */ (0,
|
|
3622
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
3404
3623
|
"div",
|
|
3405
3624
|
{
|
|
3406
3625
|
className: `flex gap-2 justify-end self-center ${!!itemErrors[kpi.id]?.value || !!itemErrors[kpi.id]?.unit || !!itemErrors[kpi.id]?.name ? "mt-[-12px]" : ""}`,
|
|
3407
3626
|
children: [
|
|
3408
|
-
/* @__PURE__ */ (0,
|
|
3627
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3409
3628
|
import_icons_react11.IconCheck,
|
|
3410
3629
|
{
|
|
3411
3630
|
className: "w-[30px] h-[30px] cursor-pointer",
|
|
3412
3631
|
onClick: () => handleSave(kpi.id, type)
|
|
3413
3632
|
}
|
|
3414
3633
|
),
|
|
3415
|
-
/* @__PURE__ */ (0,
|
|
3634
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_icons_react11.IconX, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleCancel(kpi.id) })
|
|
3416
3635
|
]
|
|
3417
3636
|
}
|
|
3418
3637
|
)
|
|
3419
|
-
] }) : /* @__PURE__ */ (0,
|
|
3420
|
-
/* @__PURE__ */ (0,
|
|
3421
|
-
/* @__PURE__ */ (0,
|
|
3422
|
-
/* @__PURE__ */ (0,
|
|
3423
|
-
/* @__PURE__ */ (0,
|
|
3424
|
-
/* @__PURE__ */ (0,
|
|
3425
|
-
/* @__PURE__ */ (0,
|
|
3638
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
3639
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "body-1", children: kpi.name }),
|
|
3640
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "body-1", children: kpi.value }),
|
|
3641
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "body-1", children: kpi.unit }),
|
|
3642
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex gap-3 justify-end", children: [
|
|
3643
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_icons_react11.IconPencil, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleEdit(kpi.id) }),
|
|
3644
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_icons_react11.IconTrash, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleDelete(kpi.id) })
|
|
3426
3645
|
] })
|
|
3427
3646
|
] })
|
|
3428
3647
|
]
|
|
@@ -3430,9 +3649,9 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3430
3649
|
kpi.id
|
|
3431
3650
|
)) })
|
|
3432
3651
|
] }),
|
|
3433
|
-
type === "text" && /* @__PURE__ */ (0,
|
|
3434
|
-
/* @__PURE__ */ (0,
|
|
3435
|
-
/* @__PURE__ */ (0,
|
|
3652
|
+
type === "text" && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "space-y-4", children: [
|
|
3653
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "grid grid-cols-[1fr_50px] w-full gap-[24px] items-start", children: [
|
|
3654
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3436
3655
|
InputField,
|
|
3437
3656
|
{
|
|
3438
3657
|
value: nameKpi,
|
|
@@ -3444,7 +3663,7 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3444
3663
|
error: errors.nameKpi
|
|
3445
3664
|
}
|
|
3446
3665
|
),
|
|
3447
|
-
/* @__PURE__ */ (0,
|
|
3666
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: `flex justify-end mt-[28px]`, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3448
3667
|
import_icons_react11.IconCirclePlus,
|
|
3449
3668
|
{
|
|
3450
3669
|
className: "w-[40px] h-[40px] cursor-pointer hover:scale-110 transition",
|
|
@@ -3453,13 +3672,13 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3453
3672
|
}
|
|
3454
3673
|
) })
|
|
3455
3674
|
] }),
|
|
3456
|
-
/* @__PURE__ */ (0,
|
|
3457
|
-
/* @__PURE__ */ (0,
|
|
3675
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { children: kpiList.map((kpi, index) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "grid grid-cols-[30px_1fr_80px] items-start py-2 body-1 gap-[8px]", children: [
|
|
3676
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("p", { className: `body-1 ${kpi.isEditing ? "mt-[12px]" : ""}`, children: [
|
|
3458
3677
|
index + 1,
|
|
3459
3678
|
"."
|
|
3460
3679
|
] }),
|
|
3461
|
-
kpi.isEditing ? /* @__PURE__ */ (0,
|
|
3462
|
-
/* @__PURE__ */ (0,
|
|
3680
|
+
kpi.isEditing ? /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
3681
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3463
3682
|
InputField,
|
|
3464
3683
|
{
|
|
3465
3684
|
value: kpi.name,
|
|
@@ -3469,27 +3688,27 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3469
3688
|
error: itemErrors[kpi.id]?.name
|
|
3470
3689
|
}
|
|
3471
3690
|
),
|
|
3472
|
-
/* @__PURE__ */ (0,
|
|
3691
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
3473
3692
|
"div",
|
|
3474
3693
|
{
|
|
3475
3694
|
className: `flex gap-2 justify-end self-center ${!!itemErrors[kpi.id]?.name ? "mt-[-12px]" : ""}`,
|
|
3476
3695
|
children: [
|
|
3477
|
-
/* @__PURE__ */ (0,
|
|
3696
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3478
3697
|
import_icons_react11.IconCheck,
|
|
3479
3698
|
{
|
|
3480
3699
|
className: "w-[30px] h-[30px] cursor-pointer",
|
|
3481
3700
|
onClick: () => handleSave(kpi.id, type)
|
|
3482
3701
|
}
|
|
3483
3702
|
),
|
|
3484
|
-
/* @__PURE__ */ (0,
|
|
3703
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_icons_react11.IconX, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleCancel(kpi.id) })
|
|
3485
3704
|
]
|
|
3486
3705
|
}
|
|
3487
3706
|
)
|
|
3488
|
-
] }) : /* @__PURE__ */ (0,
|
|
3489
|
-
/* @__PURE__ */ (0,
|
|
3490
|
-
/* @__PURE__ */ (0,
|
|
3491
|
-
/* @__PURE__ */ (0,
|
|
3492
|
-
/* @__PURE__ */ (0,
|
|
3707
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
3708
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "body-1", children: kpi.name }),
|
|
3709
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex gap-3 justify-end", children: [
|
|
3710
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_icons_react11.IconPencil, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleEdit(kpi.id) }),
|
|
3711
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_icons_react11.IconTrash, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleDelete(kpi.id) })
|
|
3493
3712
|
] })
|
|
3494
3713
|
] })
|
|
3495
3714
|
] }, kpi.id)) })
|
|
@@ -3501,16 +3720,16 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3501
3720
|
|
|
3502
3721
|
// src/Modal/Modal/Modal.tsx
|
|
3503
3722
|
var import_antd19 = require("antd");
|
|
3504
|
-
var
|
|
3723
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3505
3724
|
function AntDModal({ children, isOpen, width, onCancel }) {
|
|
3506
|
-
return /* @__PURE__ */ (0,
|
|
3725
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_antd19.Modal, { open: isOpen, onCancel, width, centered: true, footer: null, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children }) }) });
|
|
3507
3726
|
}
|
|
3508
3727
|
|
|
3509
3728
|
// src/Indicator/Indicator/Indicator.tsx
|
|
3510
3729
|
var import_icons_react12 = require("@tabler/icons-react");
|
|
3511
|
-
var
|
|
3730
|
+
var import_react17 = require("react");
|
|
3512
3731
|
var import_antd20 = require("antd");
|
|
3513
|
-
var
|
|
3732
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3514
3733
|
function Indicator({
|
|
3515
3734
|
option = [
|
|
3516
3735
|
{ value: "TEXT", label: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21" },
|
|
@@ -3520,22 +3739,22 @@ function Indicator({
|
|
|
3520
3739
|
arrayData,
|
|
3521
3740
|
setArrayData
|
|
3522
3741
|
}) {
|
|
3523
|
-
const [valueSwitch, setValueSwitch] = (0,
|
|
3524
|
-
const [cacheData, setCacheData] = (0,
|
|
3742
|
+
const [valueSwitch, setValueSwitch] = (0, import_react17.useState)("TEXT");
|
|
3743
|
+
const [cacheData, setCacheData] = (0, import_react17.useState)({
|
|
3525
3744
|
indicatorType: type,
|
|
3526
3745
|
inputType: valueSwitch,
|
|
3527
3746
|
textValue: "",
|
|
3528
3747
|
numberValue: "",
|
|
3529
3748
|
unit: ""
|
|
3530
3749
|
});
|
|
3531
|
-
const [cacheEditData, setCacheEditData] = (0,
|
|
3750
|
+
const [cacheEditData, setCacheEditData] = (0, import_react17.useState)({
|
|
3532
3751
|
indicatorType: type,
|
|
3533
3752
|
inputType: valueSwitch,
|
|
3534
3753
|
textValue: "",
|
|
3535
3754
|
numberValue: "",
|
|
3536
3755
|
unit: ""
|
|
3537
3756
|
});
|
|
3538
|
-
const [editIndex, setEditIndex] = (0,
|
|
3757
|
+
const [editIndex, setEditIndex] = (0, import_react17.useState)(null);
|
|
3539
3758
|
const handleAddIndicator = () => {
|
|
3540
3759
|
if (cacheData.textValue.trim() === "") return;
|
|
3541
3760
|
setArrayData([
|
|
@@ -3592,14 +3811,14 @@ function Indicator({
|
|
|
3592
3811
|
}));
|
|
3593
3812
|
console.log(cacheEditData);
|
|
3594
3813
|
};
|
|
3595
|
-
return /* @__PURE__ */ (0,
|
|
3596
|
-
/* @__PURE__ */ (0,
|
|
3814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "w-full", children: [
|
|
3815
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3597
3816
|
"div",
|
|
3598
3817
|
{
|
|
3599
3818
|
className: `space-x-2 grid ${valueSwitch === "TEXT" ? `grid-cols-[140px_1fr_50px]` : `grid-cols-[140px_1fr_200px_200px_50px]`} items-start`,
|
|
3600
3819
|
children: [
|
|
3601
|
-
/* @__PURE__ */ (0,
|
|
3602
|
-
/* @__PURE__ */ (0,
|
|
3820
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SwitchSelect, { option, onClick: handleClick, value: valueSwitch, label: "\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17", required: true }),
|
|
3821
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3603
3822
|
InputField,
|
|
3604
3823
|
{
|
|
3605
3824
|
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"}`,
|
|
@@ -3610,8 +3829,8 @@ function Indicator({
|
|
|
3610
3829
|
required: true
|
|
3611
3830
|
}
|
|
3612
3831
|
),
|
|
3613
|
-
valueSwitch === "NUMBER" && /* @__PURE__ */ (0,
|
|
3614
|
-
/* @__PURE__ */ (0,
|
|
3832
|
+
valueSwitch === "NUMBER" && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
3833
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3615
3834
|
InputFieldNumber,
|
|
3616
3835
|
{
|
|
3617
3836
|
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"}`,
|
|
@@ -3622,7 +3841,7 @@ function Indicator({
|
|
|
3622
3841
|
required: true
|
|
3623
3842
|
}
|
|
3624
3843
|
),
|
|
3625
|
-
/* @__PURE__ */ (0,
|
|
3844
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3626
3845
|
InputField,
|
|
3627
3846
|
{
|
|
3628
3847
|
label: `\u0E2B\u0E19\u0E48\u0E27\u0E22`,
|
|
@@ -3634,17 +3853,17 @@ function Indicator({
|
|
|
3634
3853
|
}
|
|
3635
3854
|
)
|
|
3636
3855
|
] }),
|
|
3637
|
-
/* @__PURE__ */ (0,
|
|
3856
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_icons_react12.IconCirclePlus, { onClick: handleAddIndicator, className: "mt-7 cursor-pointer", size: 32 })
|
|
3638
3857
|
]
|
|
3639
3858
|
}
|
|
3640
3859
|
),
|
|
3641
|
-
/* @__PURE__ */ (0,
|
|
3860
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_jsx_runtime40.Fragment, { children: arrayData.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3642
3861
|
"div",
|
|
3643
3862
|
{
|
|
3644
3863
|
className: `space-y-4 grid ${item.inputType === "TEXT" ? `grid-cols-[140px_1fr_50px_50px]` : `grid-cols-[140px_1fr_200px_150px_50px_50px]`} items-start`,
|
|
3645
3864
|
children: [
|
|
3646
|
-
/* @__PURE__ */ (0,
|
|
3647
|
-
index === editIndex ? /* @__PURE__ */ (0,
|
|
3865
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "body-1 mt-2", children: item.inputType === "TEXT" ? "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21" : "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02" }),
|
|
3866
|
+
index === editIndex ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3648
3867
|
import_antd20.Input,
|
|
3649
3868
|
{
|
|
3650
3869
|
className: "body-1 mt-2",
|
|
@@ -3653,9 +3872,9 @@ function Indicator({
|
|
|
3653
3872
|
name: "textValue",
|
|
3654
3873
|
onChange: (e) => handleChangeEditCashData(e)
|
|
3655
3874
|
}
|
|
3656
|
-
) : /* @__PURE__ */ (0,
|
|
3657
|
-
item.inputType === "NUMBER" && /* @__PURE__ */ (0,
|
|
3658
|
-
index === editIndex ? /* @__PURE__ */ (0,
|
|
3875
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "body-1 mt-2", children: item.textValue }),
|
|
3876
|
+
item.inputType === "NUMBER" && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
3877
|
+
index === editIndex ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3659
3878
|
import_antd20.Input,
|
|
3660
3879
|
{
|
|
3661
3880
|
className: "body-1 mt-2",
|
|
@@ -3664,8 +3883,8 @@ function Indicator({
|
|
|
3664
3883
|
name: "numberValue",
|
|
3665
3884
|
onChange: (e) => handleChangeEditCashData(e)
|
|
3666
3885
|
}
|
|
3667
|
-
) : /* @__PURE__ */ (0,
|
|
3668
|
-
index === editIndex ? /* @__PURE__ */ (0,
|
|
3886
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "body-1 mt-2", children: item.numberValue }),
|
|
3887
|
+
index === editIndex ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3669
3888
|
import_antd20.Input,
|
|
3670
3889
|
{
|
|
3671
3890
|
className: "body-1 mt-2",
|
|
@@ -3674,19 +3893,19 @@ function Indicator({
|
|
|
3674
3893
|
name: "unit",
|
|
3675
3894
|
onChange: (e) => handleChangeEditCashData(e)
|
|
3676
3895
|
}
|
|
3677
|
-
) : /* @__PURE__ */ (0,
|
|
3896
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "body-1 mt-2", children: item.unit })
|
|
3678
3897
|
] }),
|
|
3679
|
-
/* @__PURE__ */ (0,
|
|
3680
|
-
/* @__PURE__ */ (0,
|
|
3898
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "body-1 mt-2 flex", children: editIndex !== null ? editIndex === index ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex", children: [
|
|
3899
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3681
3900
|
import_icons_react12.IconCheck,
|
|
3682
3901
|
{
|
|
3683
3902
|
className: "cursor-pointer text-green-600",
|
|
3684
3903
|
onClick: () => handleConfirmEditIndicator(index)
|
|
3685
3904
|
}
|
|
3686
3905
|
),
|
|
3687
|
-
/* @__PURE__ */ (0,
|
|
3688
|
-
] }) : void 0 : /* @__PURE__ */ (0,
|
|
3689
|
-
/* @__PURE__ */ (0,
|
|
3906
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_icons_react12.IconX, { className: "cursor-pointer text-red-600", onClick: handleCancelEditIndicator })
|
|
3907
|
+
] }) : void 0 : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_icons_react12.IconPencil, { className: "cursor-pointer", onClick: () => handleEditIndicator(index) }) }),
|
|
3908
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "body-1 mt-2 cursor-pointer", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_icons_react12.IconTrash, { onClick: () => handleDeleteIndicator(index) }) })
|
|
3690
3909
|
]
|
|
3691
3910
|
}
|
|
3692
3911
|
)) })
|
|
@@ -3695,31 +3914,31 @@ function Indicator({
|
|
|
3695
3914
|
|
|
3696
3915
|
// src/FilterPopUp/FilterPopUp.tsx
|
|
3697
3916
|
var import_icons_react13 = require("@tabler/icons-react");
|
|
3698
|
-
var
|
|
3699
|
-
var
|
|
3917
|
+
var import_react18 = require("react");
|
|
3918
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3700
3919
|
var FilterPopUp = (filter) => {
|
|
3701
|
-
const [isAction, setIsAction] = (0,
|
|
3702
|
-
const [filterArray, setFilterArray] = (0,
|
|
3920
|
+
const [isAction, setIsAction] = (0, import_react18.useState)(true);
|
|
3921
|
+
const [filterArray, setFilterArray] = (0, import_react18.useState)([""]);
|
|
3703
3922
|
const handleClearFilter = () => {
|
|
3704
3923
|
setFilterArray([]);
|
|
3705
3924
|
};
|
|
3706
3925
|
const handleSubmitFilter = () => {
|
|
3707
3926
|
filter.handleSearch(filterArray);
|
|
3708
3927
|
};
|
|
3709
|
-
return /* @__PURE__ */ (0,
|
|
3710
|
-
/* @__PURE__ */ (0,
|
|
3711
|
-
/* @__PURE__ */ (0,
|
|
3928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "relative", children: [
|
|
3929
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("button", { className: "flex px-2 py-1 rounded-lg border-1", onClick: () => setIsAction(!isAction), children: [
|
|
3930
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_icons_react13.IconFilter, {}),
|
|
3712
3931
|
"filter"
|
|
3713
3932
|
] }),
|
|
3714
|
-
isAction ? /* @__PURE__ */ (0,
|
|
3715
|
-
/* @__PURE__ */ (0,
|
|
3716
|
-
/* @__PURE__ */ (0,
|
|
3717
|
-
/* @__PURE__ */ (0,
|
|
3718
|
-
/* @__PURE__ */ (0,
|
|
3933
|
+
isAction ? /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "absolute bg-white p-5 rounded-lg shadow-2xl w-[600px]", children: [
|
|
3934
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex justify-end", children: [
|
|
3935
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex justify-end text-nowrap gap-2", children: [
|
|
3936
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GhostButton, { title: "\u0E43\u0E0A\u0E49\u0E1F\u0E34\u0E25\u0E40\u0E15\u0E2D\u0E23\u0E4C", onClick: handleSubmitFilter, iconLeft: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_icons_react13.IconCheck, {}) }),
|
|
3937
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GhostButton, { title: "\u0E25\u0E49\u0E32\u0E07\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14", onClick: handleClearFilter, iconLeft: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_icons_react13.IconTrash, {}) })
|
|
3719
3938
|
] }),
|
|
3720
3939
|
""
|
|
3721
3940
|
] }),
|
|
3722
|
-
/* @__PURE__ */ (0,
|
|
3941
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3723
3942
|
SelectCustom,
|
|
3724
3943
|
{
|
|
3725
3944
|
options: filter.selectionFilter,
|
|
@@ -3742,6 +3961,7 @@ var FilterPopUp = (filter) => {
|
|
|
3742
3961
|
ColorPickerBasic,
|
|
3743
3962
|
DataTable,
|
|
3744
3963
|
DatePickerBasic,
|
|
3964
|
+
DatePickerRange,
|
|
3745
3965
|
FileUploader,
|
|
3746
3966
|
FilterPopUp,
|
|
3747
3967
|
GhostButton,
|