@esic-lab/data-core-ui 0.0.40 → 0.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +35 -0
- package/dist/index.d.mts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +180 -144
- package/dist/index.mjs +157 -121
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1285,86 +1285,122 @@ function InputFieldNumber({
|
|
|
1285
1285
|
}
|
|
1286
1286
|
|
|
1287
1287
|
// src/DatePicker/DatePickerBasic/DatePickerBasic.tsx
|
|
1288
|
-
var
|
|
1288
|
+
var import_react8 = require("react");
|
|
1289
1289
|
var import_dayjs = __toESM(require_dayjs_min());
|
|
1290
|
-
var import_th_TH = __toESM(require("antd/es/date-picker/locale/th_TH"));
|
|
1291
1290
|
var import_th2 = __toESM(require_th());
|
|
1292
1291
|
var import_buddhistEra = __toESM(require_buddhistEra());
|
|
1293
|
-
var import_locale = require("date-fns/locale");
|
|
1294
1292
|
var import_date_fns = require("date-fns");
|
|
1293
|
+
var import_locale = require("date-fns/locale");
|
|
1295
1294
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1296
1295
|
import_dayjs.default.extend(import_buddhistEra.default);
|
|
1296
|
+
import_dayjs.default.locale("th");
|
|
1297
1297
|
function DatePickerBasic({
|
|
1298
1298
|
value,
|
|
1299
1299
|
onChange,
|
|
1300
|
-
required,
|
|
1301
1300
|
label,
|
|
1301
|
+
required,
|
|
1302
1302
|
error,
|
|
1303
|
-
placeholder = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48",
|
|
1304
1303
|
disabled,
|
|
1305
|
-
|
|
1304
|
+
placeholder = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48",
|
|
1306
1305
|
minDate,
|
|
1307
1306
|
maxDate,
|
|
1308
|
-
disabledDate
|
|
1309
|
-
className,
|
|
1310
|
-
size
|
|
1307
|
+
disabledDate
|
|
1311
1308
|
}) {
|
|
1312
|
-
const
|
|
1313
|
-
import_dayjs.default
|
|
1314
|
-
const
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
fieldDateTimeFormat: "BBBB-MM-DD HH:mm:ss",
|
|
1320
|
-
yearFormat: "BBBB",
|
|
1321
|
-
cellYearFormat: "BBBB"
|
|
1322
|
-
}
|
|
1309
|
+
const [open, setOpen] = (0, import_react8.useState)(false);
|
|
1310
|
+
const current = value ? (0, import_dayjs.default)(value) : null;
|
|
1311
|
+
const today = (0, import_dayjs.default)();
|
|
1312
|
+
const formatThaiBE = (date) => {
|
|
1313
|
+
const formatted = (0, import_date_fns.format)(date, "dd MMMM yyyy", { locale: import_locale.th });
|
|
1314
|
+
const year = parseInt((0, import_date_fns.format)(date, "yyyy")) + 543;
|
|
1315
|
+
return formatted.replace(/\d{4}$/, String(year));
|
|
1323
1316
|
};
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1317
|
+
const monthNames = [
|
|
1318
|
+
"\u0E21\u0E01\u0E23\u0E32\u0E04\u0E21",
|
|
1319
|
+
"\u0E01\u0E38\u0E21\u0E20\u0E32\u0E1E\u0E31\u0E19\u0E18\u0E4C",
|
|
1320
|
+
"\u0E21\u0E35\u0E19\u0E32\u0E04\u0E21",
|
|
1321
|
+
"\u0E40\u0E21\u0E29\u0E32\u0E22\u0E19",
|
|
1322
|
+
"\u0E1E\u0E24\u0E29\u0E20\u0E32\u0E04\u0E21",
|
|
1323
|
+
"\u0E21\u0E34\u0E16\u0E38\u0E19\u0E32\u0E22\u0E19",
|
|
1324
|
+
"\u0E01\u0E23\u0E01\u0E0E\u0E32\u0E04\u0E21",
|
|
1325
|
+
"\u0E2A\u0E34\u0E07\u0E2B\u0E32\u0E04\u0E21",
|
|
1326
|
+
"\u0E01\u0E31\u0E19\u0E22\u0E32\u0E22\u0E19",
|
|
1327
|
+
"\u0E15\u0E38\u0E25\u0E32\u0E04\u0E21",
|
|
1328
|
+
"\u0E1E\u0E24\u0E28\u0E08\u0E34\u0E01\u0E32\u0E22\u0E19",
|
|
1329
|
+
"\u0E18\u0E31\u0E19\u0E27\u0E32\u0E04\u0E21"
|
|
1330
|
+
];
|
|
1331
|
+
const [calendar, setCalendar] = (0, import_react8.useState)(current || today);
|
|
1332
|
+
const daysInMonth = calendar.daysInMonth();
|
|
1333
|
+
const firstDayOfMonth = calendar.startOf("month").day();
|
|
1334
|
+
const isDisabled = (date) => {
|
|
1335
|
+
if (disabledDate && disabledDate(date.toDate())) return true;
|
|
1336
|
+
if (minDate && date.isBefore((0, import_dayjs.default)(minDate), "day")) return true;
|
|
1337
|
+
if (maxDate && date.isAfter((0, import_dayjs.default)(maxDate), "day")) return true;
|
|
1338
|
+
return false;
|
|
1339
|
+
};
|
|
1340
|
+
const handleSelect = (d) => {
|
|
1341
|
+
const selected = calendar.date(d);
|
|
1342
|
+
if (isDisabled(selected)) return;
|
|
1343
|
+
onChange(selected.toDate());
|
|
1344
|
+
setOpen(false);
|
|
1345
|
+
};
|
|
1346
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { style: { fontFamily: "Kanit", fontSize: 16 }, className: "relative w-full", children: [
|
|
1347
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "mb-1", children: [
|
|
1348
|
+
/* @__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: "*" })
|
|
1350
|
+
] }),
|
|
1351
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1352
|
+
"div",
|
|
1353
|
+
{
|
|
1354
|
+
className: `border rounded px-3 py-2 cursor-pointer bg-white ${disabled ? "opacity-50" : ""}`,
|
|
1355
|
+
onClick: () => !disabled && setOpen(!open),
|
|
1356
|
+
children: value ? formatThaiBE(value) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-gray-400", children: placeholder })
|
|
1357
|
+
}
|
|
1358
|
+
),
|
|
1359
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1360
|
+
"div",
|
|
1361
|
+
{
|
|
1362
|
+
className: "absolute z-50 mt-2 w-80 p-4 bg-white shadow-xl rounded-lg border",
|
|
1363
|
+
style: { fontFamily: "Kanit", fontSize: 16 },
|
|
1364
|
+
children: [
|
|
1365
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex justify-between items-center mb-3", children: [
|
|
1366
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("button", { onClick: () => setCalendar(calendar.subtract(1, "month")), className: "px-2", children: "\u25C0" }),
|
|
1367
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "font-semibold", children: [
|
|
1368
|
+
monthNames[calendar.month()],
|
|
1369
|
+
" ",
|
|
1370
|
+
calendar.year() + 543
|
|
1371
|
+
] }),
|
|
1372
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("button", { onClick: () => setCalendar(calendar.add(1, "month")), className: "px-2", children: "\u25B6" })
|
|
1373
|
+
] }),
|
|
1374
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "grid grid-cols-7 text-center text-gray-600 mb-2", children: ["\u0E2D\u0E32", "\u0E08", "\u0E2D", "\u0E1E", "\u0E1E\u0E24", "\u0E28", "\u0E2A"].map((d) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { children: d }, d)) }),
|
|
1375
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "grid grid-cols-7 gap-1 text-center", children: [
|
|
1376
|
+
Array(firstDayOfMonth).fill(null).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", {}, `empty-${i}`)),
|
|
1377
|
+
Array.from({ length: daysInMonth }, (_, i) => i + 1).map((d) => {
|
|
1378
|
+
const dateObj = calendar.date(d);
|
|
1379
|
+
const disabled2 = isDisabled(dateObj);
|
|
1380
|
+
const selected = current && dateObj.isSame(current, "day");
|
|
1381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1382
|
+
"div",
|
|
1383
|
+
{
|
|
1384
|
+
onClick: () => !disabled2 && handleSelect(d),
|
|
1385
|
+
className: `py-1 rounded cursor-pointer
|
|
1386
|
+
${selected ? "bg-blue-500 text-white" : ""}
|
|
1387
|
+
${disabled2 ? "text-gray-400 cursor-not-allowed" : "hover:bg-blue-100"}
|
|
1388
|
+
`,
|
|
1389
|
+
children: d
|
|
1390
|
+
},
|
|
1391
|
+
d
|
|
1392
|
+
);
|
|
1393
|
+
})
|
|
1394
|
+
] })
|
|
1395
|
+
]
|
|
1396
|
+
}
|
|
1397
|
+
),
|
|
1398
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
1399
|
+
] });
|
|
1364
1400
|
}
|
|
1365
1401
|
|
|
1366
1402
|
// src/ColorPicker/ColorPickerBasic/ColorPicker.tsx
|
|
1367
|
-
var
|
|
1403
|
+
var import_antd5 = require("antd");
|
|
1368
1404
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1369
1405
|
function ColorPickerBasic({
|
|
1370
1406
|
value,
|
|
@@ -1379,7 +1415,7 @@ function ColorPickerBasic({
|
|
|
1379
1415
|
placeholder = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E2A\u0E35"
|
|
1380
1416
|
}) {
|
|
1381
1417
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1382
|
-
|
|
1418
|
+
import_antd5.ConfigProvider,
|
|
1383
1419
|
{
|
|
1384
1420
|
theme: {
|
|
1385
1421
|
token: {
|
|
@@ -1394,7 +1430,7 @@ function ColorPickerBasic({
|
|
|
1394
1430
|
required && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1395
1431
|
] }),
|
|
1396
1432
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1397
|
-
|
|
1433
|
+
import_antd5.ColorPicker,
|
|
1398
1434
|
{
|
|
1399
1435
|
defaultFormat,
|
|
1400
1436
|
className: `body-1 w-full ${className ?? ""}`,
|
|
@@ -1423,7 +1459,7 @@ function ColorPickerBasic({
|
|
|
1423
1459
|
}
|
|
1424
1460
|
|
|
1425
1461
|
// src/ColorPicker/ColorPalettePickerBasic/ColorPalettePickerBasic.tsx
|
|
1426
|
-
var
|
|
1462
|
+
var import_antd6 = require("antd");
|
|
1427
1463
|
|
|
1428
1464
|
// node_modules/@babel/runtime/helpers/esm/typeof.js
|
|
1429
1465
|
function _typeof(o) {
|
|
@@ -2146,14 +2182,14 @@ function ColorPalettePickerBasic({
|
|
|
2146
2182
|
placeholder = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E2A\u0E35",
|
|
2147
2183
|
onClear
|
|
2148
2184
|
}) {
|
|
2149
|
-
const { token } =
|
|
2185
|
+
const { token } = import_antd6.theme.useToken();
|
|
2150
2186
|
const presets = genPresets({
|
|
2151
2187
|
primary: generate(token.colorPrimary),
|
|
2152
2188
|
red,
|
|
2153
2189
|
green
|
|
2154
2190
|
});
|
|
2155
2191
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2156
|
-
|
|
2192
|
+
import_antd6.ConfigProvider,
|
|
2157
2193
|
{
|
|
2158
2194
|
theme: {
|
|
2159
2195
|
token: {
|
|
@@ -2168,7 +2204,7 @@ function ColorPalettePickerBasic({
|
|
|
2168
2204
|
required && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2169
2205
|
] }),
|
|
2170
2206
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2171
|
-
|
|
2207
|
+
import_antd6.ColorPicker,
|
|
2172
2208
|
{
|
|
2173
2209
|
defaultFormat,
|
|
2174
2210
|
className: `body-1 w-full ${className ?? ""}`,
|
|
@@ -2199,7 +2235,7 @@ function ColorPalettePickerBasic({
|
|
|
2199
2235
|
}
|
|
2200
2236
|
|
|
2201
2237
|
// src/Select/SelectField/SelectField.tsx
|
|
2202
|
-
var
|
|
2238
|
+
var import_antd7 = require("antd");
|
|
2203
2239
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2204
2240
|
function SelectField({
|
|
2205
2241
|
value,
|
|
@@ -2219,7 +2255,7 @@ function SelectField({
|
|
|
2219
2255
|
onClear
|
|
2220
2256
|
}) {
|
|
2221
2257
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2222
|
-
|
|
2258
|
+
import_antd7.ConfigProvider,
|
|
2223
2259
|
{
|
|
2224
2260
|
theme: {
|
|
2225
2261
|
token: {
|
|
@@ -2234,7 +2270,7 @@ function SelectField({
|
|
|
2234
2270
|
required && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2235
2271
|
] }),
|
|
2236
2272
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2237
|
-
|
|
2273
|
+
import_antd7.Select,
|
|
2238
2274
|
{
|
|
2239
2275
|
showSearch: true,
|
|
2240
2276
|
value,
|
|
@@ -2272,7 +2308,7 @@ function SelectField({
|
|
|
2272
2308
|
}
|
|
2273
2309
|
|
|
2274
2310
|
// src/Select/SelectFieldGroup/SelectFieldGroup.tsx
|
|
2275
|
-
var
|
|
2311
|
+
var import_antd8 = require("antd");
|
|
2276
2312
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2277
2313
|
function SelectFieldGroup({
|
|
2278
2314
|
value,
|
|
@@ -2291,7 +2327,7 @@ function SelectFieldGroup({
|
|
|
2291
2327
|
className
|
|
2292
2328
|
}) {
|
|
2293
2329
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2294
|
-
|
|
2330
|
+
import_antd8.ConfigProvider,
|
|
2295
2331
|
{
|
|
2296
2332
|
theme: {
|
|
2297
2333
|
token: {
|
|
@@ -2305,7 +2341,7 @@ function SelectFieldGroup({
|
|
|
2305
2341
|
required && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2306
2342
|
] }),
|
|
2307
2343
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2308
|
-
|
|
2344
|
+
import_antd8.Select,
|
|
2309
2345
|
{
|
|
2310
2346
|
showSearch: true,
|
|
2311
2347
|
value,
|
|
@@ -2342,7 +2378,7 @@ function SelectFieldGroup({
|
|
|
2342
2378
|
}
|
|
2343
2379
|
|
|
2344
2380
|
// src/Select/SelectFieldStatus/SelectFieldStatus.tsx
|
|
2345
|
-
var
|
|
2381
|
+
var import_antd9 = require("antd");
|
|
2346
2382
|
|
|
2347
2383
|
// src/Select/SelectFieldStatus/StatusMockup.ts
|
|
2348
2384
|
var status = [
|
|
@@ -2369,7 +2405,7 @@ function SelectFieldStatus({
|
|
|
2369
2405
|
}) {
|
|
2370
2406
|
const selectedItem = status.find((s) => s.value === value);
|
|
2371
2407
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2372
|
-
|
|
2408
|
+
import_antd9.ConfigProvider,
|
|
2373
2409
|
{
|
|
2374
2410
|
theme: {
|
|
2375
2411
|
components: {
|
|
@@ -2391,7 +2427,7 @@ function SelectFieldStatus({
|
|
|
2391
2427
|
required && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2392
2428
|
] }),
|
|
2393
2429
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2394
|
-
|
|
2430
|
+
import_antd9.Select,
|
|
2395
2431
|
{
|
|
2396
2432
|
disabled,
|
|
2397
2433
|
suffixIcon: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_icons.DownOutlined, { style: { color: value ? "#fff" : "#D9D9D9" } }),
|
|
@@ -2412,7 +2448,7 @@ function SelectFieldStatus({
|
|
|
2412
2448
|
}
|
|
2413
2449
|
|
|
2414
2450
|
// src/Select/SelectFieldStatusReport/SelectFieldStatusReport.tsx
|
|
2415
|
-
var
|
|
2451
|
+
var import_antd10 = require("antd");
|
|
2416
2452
|
|
|
2417
2453
|
// src/Select/SelectFieldStatusReport/StatusReportMockup.ts
|
|
2418
2454
|
var status2 = [
|
|
@@ -2436,7 +2472,7 @@ function SelectFieldStatusReport({
|
|
|
2436
2472
|
}) {
|
|
2437
2473
|
const selectedItem = status2.find((s) => s.value === value);
|
|
2438
2474
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2439
|
-
|
|
2475
|
+
import_antd10.ConfigProvider,
|
|
2440
2476
|
{
|
|
2441
2477
|
theme: {
|
|
2442
2478
|
components: {
|
|
@@ -2458,7 +2494,7 @@ function SelectFieldStatusReport({
|
|
|
2458
2494
|
required && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2459
2495
|
] }),
|
|
2460
2496
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2461
|
-
|
|
2497
|
+
import_antd10.Select,
|
|
2462
2498
|
{
|
|
2463
2499
|
disabled,
|
|
2464
2500
|
suffixIcon: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_icons2.DownOutlined, { style: { color: value ? "#fff" : "#D9D9D9" } }),
|
|
@@ -2479,8 +2515,8 @@ function SelectFieldStatusReport({
|
|
|
2479
2515
|
}
|
|
2480
2516
|
|
|
2481
2517
|
// src/Select/SelectFieldTag/SelectFieldTag.tsx
|
|
2482
|
-
var
|
|
2483
|
-
var
|
|
2518
|
+
var import_antd11 = require("antd");
|
|
2519
|
+
var import_react9 = require("react");
|
|
2484
2520
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2485
2521
|
function SelectFieldTag({
|
|
2486
2522
|
label,
|
|
@@ -2493,10 +2529,10 @@ function SelectFieldTag({
|
|
|
2493
2529
|
onChange,
|
|
2494
2530
|
onClear
|
|
2495
2531
|
}) {
|
|
2496
|
-
const [internalValue, setInternalValue] = (0,
|
|
2532
|
+
const [internalValue, setInternalValue] = (0, import_react9.useState)([]);
|
|
2497
2533
|
const isControlled = controlledValue !== void 0;
|
|
2498
2534
|
const value = isControlled ? controlledValue : internalValue;
|
|
2499
|
-
const [searchWord, setSearchWord] = (0,
|
|
2535
|
+
const [searchWord, setSearchWord] = (0, import_react9.useState)("");
|
|
2500
2536
|
const handleChange = (val) => {
|
|
2501
2537
|
const trimValue = val.map((v) => v.trim());
|
|
2502
2538
|
const filtered = trimValue.filter((v) => v.trim() !== "");
|
|
@@ -2515,7 +2551,7 @@ function SelectFieldTag({
|
|
|
2515
2551
|
onChange?.([]);
|
|
2516
2552
|
};
|
|
2517
2553
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2518
|
-
|
|
2554
|
+
import_antd11.ConfigProvider,
|
|
2519
2555
|
{
|
|
2520
2556
|
theme: {
|
|
2521
2557
|
token: {
|
|
@@ -2529,7 +2565,7 @@ function SelectFieldTag({
|
|
|
2529
2565
|
required && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2530
2566
|
] }),
|
|
2531
2567
|
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2532
|
-
|
|
2568
|
+
import_antd11.Select,
|
|
2533
2569
|
{
|
|
2534
2570
|
mode: "tags",
|
|
2535
2571
|
className: `body-1 flex justify-center w-full ${className ?? ""}`,
|
|
@@ -2555,8 +2591,8 @@ function SelectFieldTag({
|
|
|
2555
2591
|
|
|
2556
2592
|
// src/Select/SelectCustom/SelectCustom.tsx
|
|
2557
2593
|
var import_icons_react8 = require("@tabler/icons-react");
|
|
2558
|
-
var
|
|
2559
|
-
var
|
|
2594
|
+
var import_antd12 = require("antd");
|
|
2595
|
+
var import_react10 = require("react");
|
|
2560
2596
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2561
2597
|
function SelectCustom({
|
|
2562
2598
|
label = "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E42\u0E04\u0E23\u0E07\u0E01\u0E32\u0E23",
|
|
@@ -2567,8 +2603,8 @@ function SelectCustom({
|
|
|
2567
2603
|
error,
|
|
2568
2604
|
onClear
|
|
2569
2605
|
}) {
|
|
2570
|
-
const [value, setValue] = (0,
|
|
2571
|
-
const [valueList, setValueList] = (0,
|
|
2606
|
+
const [value, setValue] = (0, import_react10.useState)([]);
|
|
2607
|
+
const [valueList, setValueList] = (0, import_react10.useState)([]);
|
|
2572
2608
|
const handleChange = (selectedValues) => {
|
|
2573
2609
|
const newValues = selectedValues.filter((v) => !valueList.includes(v));
|
|
2574
2610
|
setValueList((prev) => {
|
|
@@ -2587,7 +2623,7 @@ function SelectCustom({
|
|
|
2587
2623
|
};
|
|
2588
2624
|
const filteredOptions = options.filter((opt) => !valueList.includes(opt.value)).map((opt) => ({ value: opt.value, label: opt.label }));
|
|
2589
2625
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2590
|
-
|
|
2626
|
+
import_antd12.ConfigProvider,
|
|
2591
2627
|
{
|
|
2592
2628
|
theme: {
|
|
2593
2629
|
token: {
|
|
@@ -2602,7 +2638,7 @@ function SelectCustom({
|
|
|
2602
2638
|
required && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2603
2639
|
] }),
|
|
2604
2640
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2605
|
-
|
|
2641
|
+
import_antd12.Select,
|
|
2606
2642
|
{
|
|
2607
2643
|
value,
|
|
2608
2644
|
onChange: handleChange,
|
|
@@ -2629,7 +2665,7 @@ function SelectCustom({
|
|
|
2629
2665
|
}
|
|
2630
2666
|
|
|
2631
2667
|
// src/SortFilter/SortFilter.tsx
|
|
2632
|
-
var
|
|
2668
|
+
var import_antd13 = require("antd");
|
|
2633
2669
|
var import_icons3 = require("@ant-design/icons");
|
|
2634
2670
|
|
|
2635
2671
|
// src/SortFilter/DataMockSortFilter.ts
|
|
@@ -2660,7 +2696,7 @@ var quarters = [
|
|
|
2660
2696
|
];
|
|
2661
2697
|
|
|
2662
2698
|
// src/SortFilter/SortFilter.tsx
|
|
2663
|
-
var
|
|
2699
|
+
var import_react11 = require("react");
|
|
2664
2700
|
var import_icons_react9 = require("@tabler/icons-react");
|
|
2665
2701
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2666
2702
|
function SortFilter({
|
|
@@ -2670,11 +2706,11 @@ function SortFilter({
|
|
|
2670
2706
|
onSortClick,
|
|
2671
2707
|
onFilterClick
|
|
2672
2708
|
}) {
|
|
2673
|
-
const [yearValue, setYearValue] = (0,
|
|
2674
|
-
const [monthValue, setMonthValue] = (0,
|
|
2675
|
-
const [quarterValue, setQuartersValue] = (0,
|
|
2709
|
+
const [yearValue, setYearValue] = (0, import_react11.useState)();
|
|
2710
|
+
const [monthValue, setMonthValue] = (0, import_react11.useState)();
|
|
2711
|
+
const [quarterValue, setQuartersValue] = (0, import_react11.useState)();
|
|
2676
2712
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2677
|
-
|
|
2713
|
+
import_antd13.ConfigProvider,
|
|
2678
2714
|
{
|
|
2679
2715
|
theme: {
|
|
2680
2716
|
token: {
|
|
@@ -2748,7 +2784,7 @@ function SortFilter({
|
|
|
2748
2784
|
|
|
2749
2785
|
// src/Upload/FileUploader/FileUploader.tsx
|
|
2750
2786
|
var import_icons_react10 = require("@tabler/icons-react");
|
|
2751
|
-
var
|
|
2787
|
+
var import_react12 = require("react");
|
|
2752
2788
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2753
2789
|
function FileUploader({
|
|
2754
2790
|
onUpload,
|
|
@@ -2761,10 +2797,10 @@ function FileUploader({
|
|
|
2761
2797
|
description,
|
|
2762
2798
|
label
|
|
2763
2799
|
}) {
|
|
2764
|
-
const [fileList, setFileList] = (0,
|
|
2765
|
-
const [uploading, setUploading] = (0,
|
|
2766
|
-
const [dragActive, setDragActive] = (0,
|
|
2767
|
-
const inputRef = (0,
|
|
2800
|
+
const [fileList, setFileList] = (0, import_react12.useState)([]);
|
|
2801
|
+
const [uploading, setUploading] = (0, import_react12.useState)(false);
|
|
2802
|
+
const [dragActive, setDragActive] = (0, import_react12.useState)(false);
|
|
2803
|
+
const inputRef = (0, import_react12.useRef)(null);
|
|
2768
2804
|
const validateFile = (file) => {
|
|
2769
2805
|
if (accept && !accept.includes(file.type)) {
|
|
2770
2806
|
onError?.(`Invalid file type. file: ${file.name}`);
|
|
@@ -2916,8 +2952,8 @@ function messageLoading(content, duration) {
|
|
|
2916
2952
|
}
|
|
2917
2953
|
|
|
2918
2954
|
// src/Breadcrumb/Breadcrumb.tsx
|
|
2955
|
+
var import_antd14 = require("antd");
|
|
2919
2956
|
var import_antd15 = require("antd");
|
|
2920
|
-
var import_antd16 = require("antd");
|
|
2921
2957
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2922
2958
|
function Breadcrumbs({
|
|
2923
2959
|
items,
|
|
@@ -2927,7 +2963,7 @@ function Breadcrumbs({
|
|
|
2927
2963
|
params
|
|
2928
2964
|
}) {
|
|
2929
2965
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2930
|
-
|
|
2966
|
+
import_antd14.ConfigProvider,
|
|
2931
2967
|
{
|
|
2932
2968
|
theme: {
|
|
2933
2969
|
token: {
|
|
@@ -2935,7 +2971,7 @@ function Breadcrumbs({
|
|
|
2935
2971
|
}
|
|
2936
2972
|
},
|
|
2937
2973
|
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2938
|
-
|
|
2974
|
+
import_antd15.Breadcrumb,
|
|
2939
2975
|
{
|
|
2940
2976
|
items,
|
|
2941
2977
|
separator,
|
|
@@ -2949,7 +2985,7 @@ function Breadcrumbs({
|
|
|
2949
2985
|
}
|
|
2950
2986
|
|
|
2951
2987
|
// src/HeadingPage/HeadingPage.tsx
|
|
2952
|
-
var
|
|
2988
|
+
var import_antd16 = require("antd");
|
|
2953
2989
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2954
2990
|
function HeadingPage({ Heading }) {
|
|
2955
2991
|
const today = (/* @__PURE__ */ new Date()).toLocaleDateString("th-TH", {
|
|
@@ -2959,7 +2995,7 @@ function HeadingPage({ Heading }) {
|
|
|
2959
2995
|
year: "numeric"
|
|
2960
2996
|
});
|
|
2961
2997
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2962
|
-
|
|
2998
|
+
import_antd16.ConfigProvider,
|
|
2963
2999
|
{
|
|
2964
3000
|
theme: {
|
|
2965
3001
|
token: {
|
|
@@ -2978,8 +3014,8 @@ function HeadingPage({ Heading }) {
|
|
|
2978
3014
|
}
|
|
2979
3015
|
|
|
2980
3016
|
// src/Progress/ProgressBar.tsx
|
|
2981
|
-
var
|
|
2982
|
-
var
|
|
3017
|
+
var import_antd17 = require("antd");
|
|
3018
|
+
var import_react13 = require("react");
|
|
2983
3019
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2984
3020
|
function ProgressBar({
|
|
2985
3021
|
percent = 0,
|
|
@@ -2993,8 +3029,8 @@ function ProgressBar({
|
|
|
2993
3029
|
steps,
|
|
2994
3030
|
isCheckPoints
|
|
2995
3031
|
}) {
|
|
2996
|
-
const [barWidth, setBarWidth] = (0,
|
|
2997
|
-
const progressRef = (0,
|
|
3032
|
+
const [barWidth, setBarWidth] = (0, import_react13.useState)(0);
|
|
3033
|
+
const progressRef = (0, import_react13.useRef)(null);
|
|
2998
3034
|
let strokeColor = "--color-green-500";
|
|
2999
3035
|
const defaultStrokeWidth = type === "circle" ? 13 : strokeWidth ?? 8;
|
|
3000
3036
|
const defaultSize = type === "circle" ? 43 : size;
|
|
@@ -3002,7 +3038,7 @@ function ProgressBar({
|
|
|
3002
3038
|
const minCheckpoint = Math.min(...checkpoints);
|
|
3003
3039
|
strokeColor = percent >= minCheckpoint ? "var(--color-green-500)" : "var(--color-red-500)";
|
|
3004
3040
|
}
|
|
3005
|
-
(0,
|
|
3041
|
+
(0, import_react13.useEffect)(() => {
|
|
3006
3042
|
const inner = progressRef.current?.querySelector(".ant-progress-inner");
|
|
3007
3043
|
if (!inner) return;
|
|
3008
3044
|
const observer = new ResizeObserver(() => {
|
|
@@ -3012,7 +3048,7 @@ function ProgressBar({
|
|
|
3012
3048
|
return () => observer.disconnect();
|
|
3013
3049
|
}, []);
|
|
3014
3050
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3015
|
-
|
|
3051
|
+
import_antd17.ConfigProvider,
|
|
3016
3052
|
{
|
|
3017
3053
|
theme: {
|
|
3018
3054
|
token: {
|
|
@@ -3021,7 +3057,7 @@ function ProgressBar({
|
|
|
3021
3057
|
},
|
|
3022
3058
|
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "relative w-full", ref: progressRef, children: [
|
|
3023
3059
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3024
|
-
|
|
3060
|
+
import_antd17.Progress,
|
|
3025
3061
|
{
|
|
3026
3062
|
className: "w-full",
|
|
3027
3063
|
percent,
|
|
@@ -3058,25 +3094,25 @@ function ProgressBar({
|
|
|
3058
3094
|
}
|
|
3059
3095
|
|
|
3060
3096
|
// src/KpiSection/KpiSection.tsx
|
|
3061
|
-
var
|
|
3062
|
-
var
|
|
3097
|
+
var import_antd18 = require("antd");
|
|
3098
|
+
var import_react15 = require("react");
|
|
3063
3099
|
|
|
3064
3100
|
// src/KpiSection/hooks/useGetKpiSection.ts
|
|
3065
|
-
var
|
|
3101
|
+
var import_react14 = require("react");
|
|
3066
3102
|
var import_cuid = __toESM(require("cuid"));
|
|
3067
3103
|
function useGetKpiSection() {
|
|
3068
|
-
const [nameKpi, setNameKpi] = (0,
|
|
3069
|
-
const [kpiValue, setKpiValue] = (0,
|
|
3070
|
-
const [unitValue, setUnitValue] = (0,
|
|
3071
|
-
const [kpiList, setKpiList] = (0,
|
|
3072
|
-
const [editingBackup, setEditingBackup] = (0,
|
|
3073
|
-
const [selected, setSelected] = (0,
|
|
3074
|
-
const [errors, setErrors] = (0,
|
|
3104
|
+
const [nameKpi, setNameKpi] = (0, import_react14.useState)("");
|
|
3105
|
+
const [kpiValue, setKpiValue] = (0, import_react14.useState)("");
|
|
3106
|
+
const [unitValue, setUnitValue] = (0, import_react14.useState)("");
|
|
3107
|
+
const [kpiList, setKpiList] = (0, import_react14.useState)([]);
|
|
3108
|
+
const [editingBackup, setEditingBackup] = (0, import_react14.useState)({});
|
|
3109
|
+
const [selected, setSelected] = (0, import_react14.useState)("2");
|
|
3110
|
+
const [errors, setErrors] = (0, import_react14.useState)({
|
|
3075
3111
|
nameKpi: "",
|
|
3076
3112
|
kpiValue: "",
|
|
3077
3113
|
unitValue: ""
|
|
3078
3114
|
});
|
|
3079
|
-
const [itemErrors, setItemErrors] = (0,
|
|
3115
|
+
const [itemErrors, setItemErrors] = (0, import_react14.useState)({});
|
|
3080
3116
|
const options = [
|
|
3081
3117
|
{ value: "1", label: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21" },
|
|
3082
3118
|
{ value: "2", label: "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02" }
|
|
@@ -3229,18 +3265,18 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3229
3265
|
itemErrors,
|
|
3230
3266
|
setItemErrors
|
|
3231
3267
|
} = useGetKpiSection();
|
|
3232
|
-
const [messageApi2, messageContainer] =
|
|
3233
|
-
const [hasShownError, setHasShownError] = (0,
|
|
3234
|
-
(0,
|
|
3268
|
+
const [messageApi2, messageContainer] = import_antd18.message.useMessage();
|
|
3269
|
+
const [hasShownError, setHasShownError] = (0, import_react15.useState)(false);
|
|
3270
|
+
(0, import_react15.useEffect)(() => {
|
|
3235
3271
|
setMessageApi(messageApi2);
|
|
3236
3272
|
}, [messageApi2]);
|
|
3237
|
-
(0,
|
|
3273
|
+
(0, import_react15.useEffect)(() => {
|
|
3238
3274
|
if (onChangeKpiList) {
|
|
3239
3275
|
onChangeKpiList(kpiList);
|
|
3240
3276
|
}
|
|
3241
3277
|
}, [kpiList]);
|
|
3242
3278
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3243
|
-
|
|
3279
|
+
import_antd18.ConfigProvider,
|
|
3244
3280
|
{
|
|
3245
3281
|
theme: {
|
|
3246
3282
|
token: {
|
|
@@ -3464,16 +3500,16 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3464
3500
|
}
|
|
3465
3501
|
|
|
3466
3502
|
// src/Modal/Modal/Modal.tsx
|
|
3467
|
-
var
|
|
3503
|
+
var import_antd19 = require("antd");
|
|
3468
3504
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3469
3505
|
function AntDModal({ children, isOpen, width, onCancel }) {
|
|
3470
|
-
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3506
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_antd19.Modal, { open: isOpen, onCancel, width, centered: true, footer: null, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { children }) }) });
|
|
3471
3507
|
}
|
|
3472
3508
|
|
|
3473
3509
|
// src/Indicator/Indicator/Indicator.tsx
|
|
3474
3510
|
var import_icons_react12 = require("@tabler/icons-react");
|
|
3475
|
-
var
|
|
3476
|
-
var
|
|
3511
|
+
var import_react16 = require("react");
|
|
3512
|
+
var import_antd20 = require("antd");
|
|
3477
3513
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3478
3514
|
function Indicator({
|
|
3479
3515
|
option = [
|
|
@@ -3484,22 +3520,22 @@ function Indicator({
|
|
|
3484
3520
|
arrayData,
|
|
3485
3521
|
setArrayData
|
|
3486
3522
|
}) {
|
|
3487
|
-
const [valueSwitch, setValueSwitch] = (0,
|
|
3488
|
-
const [cacheData, setCacheData] = (0,
|
|
3523
|
+
const [valueSwitch, setValueSwitch] = (0, import_react16.useState)("TEXT");
|
|
3524
|
+
const [cacheData, setCacheData] = (0, import_react16.useState)({
|
|
3489
3525
|
indicatorType: type,
|
|
3490
3526
|
inputType: valueSwitch,
|
|
3491
3527
|
textValue: "",
|
|
3492
3528
|
numberValue: "",
|
|
3493
3529
|
unit: ""
|
|
3494
3530
|
});
|
|
3495
|
-
const [cacheEditData, setCacheEditData] = (0,
|
|
3531
|
+
const [cacheEditData, setCacheEditData] = (0, import_react16.useState)({
|
|
3496
3532
|
indicatorType: type,
|
|
3497
3533
|
inputType: valueSwitch,
|
|
3498
3534
|
textValue: "",
|
|
3499
3535
|
numberValue: "",
|
|
3500
3536
|
unit: ""
|
|
3501
3537
|
});
|
|
3502
|
-
const [editIndex, setEditIndex] = (0,
|
|
3538
|
+
const [editIndex, setEditIndex] = (0, import_react16.useState)(null);
|
|
3503
3539
|
const handleAddIndicator = () => {
|
|
3504
3540
|
if (cacheData.textValue.trim() === "") return;
|
|
3505
3541
|
setArrayData([
|
|
@@ -3609,7 +3645,7 @@ function Indicator({
|
|
|
3609
3645
|
children: [
|
|
3610
3646
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "body-1 mt-2", children: item.inputType === "TEXT" ? "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21" : "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02" }),
|
|
3611
3647
|
index === editIndex ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3612
|
-
|
|
3648
|
+
import_antd20.Input,
|
|
3613
3649
|
{
|
|
3614
3650
|
className: "body-1 mt-2",
|
|
3615
3651
|
variant: "underlined",
|
|
@@ -3620,7 +3656,7 @@ function Indicator({
|
|
|
3620
3656
|
) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "body-1 mt-2", children: item.textValue }),
|
|
3621
3657
|
item.inputType === "NUMBER" && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
|
|
3622
3658
|
index === editIndex ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3623
|
-
|
|
3659
|
+
import_antd20.Input,
|
|
3624
3660
|
{
|
|
3625
3661
|
className: "body-1 mt-2",
|
|
3626
3662
|
variant: "underlined",
|
|
@@ -3630,7 +3666,7 @@ function Indicator({
|
|
|
3630
3666
|
}
|
|
3631
3667
|
) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "body-1 mt-2", children: item.numberValue }),
|
|
3632
3668
|
index === editIndex ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3633
|
-
|
|
3669
|
+
import_antd20.Input,
|
|
3634
3670
|
{
|
|
3635
3671
|
className: "body-1 mt-2",
|
|
3636
3672
|
variant: "underlined",
|
|
@@ -3659,11 +3695,11 @@ function Indicator({
|
|
|
3659
3695
|
|
|
3660
3696
|
// src/FilterPopUp/FilterPopUp.tsx
|
|
3661
3697
|
var import_icons_react13 = require("@tabler/icons-react");
|
|
3662
|
-
var
|
|
3698
|
+
var import_react17 = require("react");
|
|
3663
3699
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3664
3700
|
var FilterPopUp = (filter) => {
|
|
3665
|
-
const [isAction, setIsAction] = (0,
|
|
3666
|
-
const [filterArray, setFilterArray] = (0,
|
|
3701
|
+
const [isAction, setIsAction] = (0, import_react17.useState)(true);
|
|
3702
|
+
const [filterArray, setFilterArray] = (0, import_react17.useState)([""]);
|
|
3667
3703
|
const handleClearFilter = () => {
|
|
3668
3704
|
setFilterArray([]);
|
|
3669
3705
|
};
|