@ctlyst.id/internal-ui 3.3.15 → 3.4.0
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.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +573 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +579 -18
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -946,26 +946,32 @@ var getCommonPinningStyles = (column) => {
|
|
946
946
|
...isLastLeftPinnedColumn ? {
|
947
947
|
padding: "16px 8px 16px 8px",
|
948
948
|
"&:after": {
|
949
|
+
transition: "all 0.3s",
|
949
950
|
content: "''",
|
950
951
|
position: "absolute",
|
951
952
|
width: "30px",
|
952
953
|
right: "0px",
|
953
954
|
bottom: "-1px",
|
954
955
|
top: 0,
|
955
|
-
transform: "translateX(100%)"
|
956
|
+
transform: "translateX(100%)"
|
957
|
+
},
|
958
|
+
"[pin-left=true] &:after": {
|
956
959
|
boxShadow: "inset 14px 0px 20px -10px #00000010"
|
957
960
|
}
|
958
961
|
} : {},
|
959
962
|
...isFirstRightPinnedColumn ? {
|
960
963
|
padding: "16px 8px 16px 8px",
|
961
964
|
"&:after": {
|
965
|
+
transition: "all 0.3s",
|
962
966
|
content: "''",
|
963
967
|
position: "absolute",
|
964
968
|
width: "30px",
|
965
969
|
left: "0%",
|
966
970
|
top: 0,
|
967
971
|
bottom: "-1px",
|
968
|
-
transform: "translateX(-100%)"
|
972
|
+
transform: "translateX(-100%)"
|
973
|
+
},
|
974
|
+
"[pin-right=true] &:after": {
|
969
975
|
boxShadow: "inset -14px 0px 20px -10px #00000010"
|
970
976
|
}
|
971
977
|
} : {}
|
@@ -1065,22 +1071,39 @@ var useDataTable = ({
|
|
1065
1071
|
};
|
1066
1072
|
};
|
1067
1073
|
var DataTable = React5.forwardRef((props, ref) => {
|
1068
|
-
var _a, _b;
|
1074
|
+
var _a, _b, _c;
|
1069
1075
|
const { isLoading, styles, headerSticky, onRowClick, container, columnPinning } = props;
|
1070
1076
|
const { table, toggleAllRowsSelected, generateColumn } = useDataTable(props);
|
1077
|
+
const refTable = React5.useRef(null);
|
1071
1078
|
React5.useImperativeHandle(ref, () => ({
|
1072
1079
|
toggleAllRowsSelected
|
1073
1080
|
}));
|
1081
|
+
let lastPinnedColumn = 0;
|
1082
|
+
(_a = refTable.current) == null ? void 0 : _a.addEventListener("scroll", (s) => {
|
1083
|
+
var _a2, _b2, _c2, _d;
|
1084
|
+
const element = s.currentTarget;
|
1085
|
+
if (element.scrollLeft > 0) {
|
1086
|
+
(_a2 = refTable.current) == null ? void 0 : _a2.setAttribute("pin-left", "true");
|
1087
|
+
} else {
|
1088
|
+
(_b2 = refTable.current) == null ? void 0 : _b2.removeAttribute("pin-left");
|
1089
|
+
}
|
1090
|
+
if (element.scrollLeft < element.scrollWidth - (lastPinnedColumn + element.offsetWidth)) {
|
1091
|
+
(_c2 = refTable.current) == null ? void 0 : _c2.setAttribute("pin-right", "true");
|
1092
|
+
} else {
|
1093
|
+
(_d = refTable.current) == null ? void 0 : _d.removeAttribute("pin-right");
|
1094
|
+
}
|
1095
|
+
});
|
1074
1096
|
return /* @__PURE__ */ jsx24(
|
1075
1097
|
Box11,
|
1076
1098
|
{
|
1077
1099
|
overflowX: "auto",
|
1078
1100
|
overflowY: "hidden",
|
1079
1101
|
position: "relative",
|
1080
|
-
pl: ((
|
1081
|
-
pr: ((
|
1102
|
+
pl: ((_b = columnPinning == null ? void 0 : columnPinning.left) == null ? void 0 : _b.length) ? 0 : 4,
|
1103
|
+
pr: ((_c = columnPinning == null ? void 0 : columnPinning.right) == null ? void 0 : _c.length) ? 0 : 4,
|
1082
1104
|
maxW: "100%",
|
1083
1105
|
w: "full",
|
1106
|
+
ref: refTable,
|
1084
1107
|
...container,
|
1085
1108
|
children: isLoading ? /* @__PURE__ */ jsxs8(Table, { ...styles == null ? void 0 : styles.table, "data-loading": "true", children: [
|
1086
1109
|
/* @__PURE__ */ jsx24(Thead, { ...(styles == null ? void 0 : styles.tableHead, headerSticky ? { position: "sticky", top: 0, bg: "white", zIndex: 1 } : {}), children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx24(Tr, { mx: "2", ...styles == null ? void 0 : styles.tableRow, children: headerGroup.headers.map((header, index) => /* @__PURE__ */ jsx24(
|
@@ -1110,7 +1133,10 @@ var DataTable = React5.forwardRef((props, ref) => {
|
|
1110
1133
|
maxH: "50px",
|
1111
1134
|
...(styles == null ? void 0 : styles.tableHead, headerSticky ? { position: "sticky", top: 0, bg: "white", zIndex: 1 } : {}),
|
1112
1135
|
children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx24(Tr, { bg: useColorModeValue("initial", "ebony-clay.700"), ...styles == null ? void 0 : styles.tableRow, children: headerGroup.headers.map((header, index) => {
|
1113
|
-
var _a2;
|
1136
|
+
var _a2, _b2;
|
1137
|
+
if (!!((_a2 = columnPinning == null ? void 0 : columnPinning.right) == null ? void 0 : _a2.length) && header.column.getIsFirstColumn("right")) {
|
1138
|
+
lastPinnedColumn = header.column.getAfter("right");
|
1139
|
+
}
|
1114
1140
|
return /* @__PURE__ */ jsx24(
|
1115
1141
|
Th,
|
1116
1142
|
{
|
@@ -1137,10 +1163,10 @@ var DataTable = React5.forwardRef((props, ref) => {
|
|
1137
1163
|
cursor: header.column.getCanSort() ? "pointer" : "default",
|
1138
1164
|
"data-test-id": `CT_Container_SortingIcon_${header.id}`,
|
1139
1165
|
onClick: header.column.getToggleSortingHandler(),
|
1140
|
-
children: (
|
1166
|
+
children: (_b2 = header.column.getCanSort() && {
|
1141
1167
|
asc: /* @__PURE__ */ jsx24(ChevronUpIcon, { h: 4, w: 4, color: "neutral.500" }),
|
1142
1168
|
desc: /* @__PURE__ */ jsx24(ChevronDownIcon, { h: 4, w: 4, color: "neutral.500" })
|
1143
|
-
}[header.column.getIsSorted()]) != null ?
|
1169
|
+
}[header.column.getIsSorted()]) != null ? _b2 : /* @__PURE__ */ jsx24(Box11, { display: "flex", justifyContent: "center", alignItems: "center", boxSize: 4, children: /* @__PURE__ */ jsx24(UpDownIcon, { color: "neutral.500" }) })
|
1144
1170
|
}
|
1145
1171
|
)
|
1146
1172
|
]
|
@@ -1237,6 +1263,539 @@ import { cx as cx8 } from "@chakra-ui/shared-utils";
|
|
1237
1263
|
import { Calendar, Close as Close3 } from "@ctlyst.id/internal-icon";
|
1238
1264
|
import ReactDatePicker from "react-datepicker";
|
1239
1265
|
|
1266
|
+
// ../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.mjs
|
1267
|
+
function buildFormatLongFn(args) {
|
1268
|
+
return (options = {}) => {
|
1269
|
+
const width = options.width ? String(options.width) : args.defaultWidth;
|
1270
|
+
const format = args.formats[width] || args.formats[args.defaultWidth];
|
1271
|
+
return format;
|
1272
|
+
};
|
1273
|
+
}
|
1274
|
+
|
1275
|
+
// ../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.mjs
|
1276
|
+
function buildLocalizeFn(args) {
|
1277
|
+
return (value, options) => {
|
1278
|
+
const context = (options == null ? void 0 : options.context) ? String(options.context) : "standalone";
|
1279
|
+
let valuesArray;
|
1280
|
+
if (context === "formatting" && args.formattingValues) {
|
1281
|
+
const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
|
1282
|
+
const width = (options == null ? void 0 : options.width) ? String(options.width) : defaultWidth;
|
1283
|
+
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
|
1284
|
+
} else {
|
1285
|
+
const defaultWidth = args.defaultWidth;
|
1286
|
+
const width = (options == null ? void 0 : options.width) ? String(options.width) : args.defaultWidth;
|
1287
|
+
valuesArray = args.values[width] || args.values[defaultWidth];
|
1288
|
+
}
|
1289
|
+
const index = args.argumentCallback ? args.argumentCallback(value) : value;
|
1290
|
+
return valuesArray[index];
|
1291
|
+
};
|
1292
|
+
}
|
1293
|
+
|
1294
|
+
// ../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildMatchFn.mjs
|
1295
|
+
function buildMatchFn(args) {
|
1296
|
+
return (string, options = {}) => {
|
1297
|
+
const width = options.width;
|
1298
|
+
const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
|
1299
|
+
const matchResult = string.match(matchPattern);
|
1300
|
+
if (!matchResult) {
|
1301
|
+
return null;
|
1302
|
+
}
|
1303
|
+
const matchedString = matchResult[0];
|
1304
|
+
const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
|
1305
|
+
const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : (
|
1306
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
|
1307
|
+
findKey(parsePatterns, (pattern) => pattern.test(matchedString))
|
1308
|
+
);
|
1309
|
+
let value;
|
1310
|
+
value = args.valueCallback ? args.valueCallback(key) : key;
|
1311
|
+
value = options.valueCallback ? (
|
1312
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
|
1313
|
+
options.valueCallback(value)
|
1314
|
+
) : value;
|
1315
|
+
const rest = string.slice(matchedString.length);
|
1316
|
+
return { value, rest };
|
1317
|
+
};
|
1318
|
+
}
|
1319
|
+
function findKey(object, predicate) {
|
1320
|
+
for (const key in object) {
|
1321
|
+
if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
|
1322
|
+
return key;
|
1323
|
+
}
|
1324
|
+
}
|
1325
|
+
return void 0;
|
1326
|
+
}
|
1327
|
+
function findIndex(array, predicate) {
|
1328
|
+
for (let key = 0; key < array.length; key++) {
|
1329
|
+
if (predicate(array[key])) {
|
1330
|
+
return key;
|
1331
|
+
}
|
1332
|
+
}
|
1333
|
+
return void 0;
|
1334
|
+
}
|
1335
|
+
|
1336
|
+
// ../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn.mjs
|
1337
|
+
function buildMatchPatternFn(args) {
|
1338
|
+
return (string, options = {}) => {
|
1339
|
+
const matchResult = string.match(args.matchPattern);
|
1340
|
+
if (!matchResult) return null;
|
1341
|
+
const matchedString = matchResult[0];
|
1342
|
+
const parseResult = string.match(args.parsePattern);
|
1343
|
+
if (!parseResult) return null;
|
1344
|
+
let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
|
1345
|
+
value = options.valueCallback ? options.valueCallback(value) : value;
|
1346
|
+
const rest = string.slice(matchedString.length);
|
1347
|
+
return { value, rest };
|
1348
|
+
};
|
1349
|
+
}
|
1350
|
+
|
1351
|
+
// ../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/id/_lib/formatDistance.mjs
|
1352
|
+
var formatDistanceLocale = {
|
1353
|
+
lessThanXSeconds: {
|
1354
|
+
one: "kurang dari 1 detik",
|
1355
|
+
other: "kurang dari {{count}} detik"
|
1356
|
+
},
|
1357
|
+
xSeconds: {
|
1358
|
+
one: "1 detik",
|
1359
|
+
other: "{{count}} detik"
|
1360
|
+
},
|
1361
|
+
halfAMinute: "setengah menit",
|
1362
|
+
lessThanXMinutes: {
|
1363
|
+
one: "kurang dari 1 menit",
|
1364
|
+
other: "kurang dari {{count}} menit"
|
1365
|
+
},
|
1366
|
+
xMinutes: {
|
1367
|
+
one: "1 menit",
|
1368
|
+
other: "{{count}} menit"
|
1369
|
+
},
|
1370
|
+
aboutXHours: {
|
1371
|
+
one: "sekitar 1 jam",
|
1372
|
+
other: "sekitar {{count}} jam"
|
1373
|
+
},
|
1374
|
+
xHours: {
|
1375
|
+
one: "1 jam",
|
1376
|
+
other: "{{count}} jam"
|
1377
|
+
},
|
1378
|
+
xDays: {
|
1379
|
+
one: "1 hari",
|
1380
|
+
other: "{{count}} hari"
|
1381
|
+
},
|
1382
|
+
aboutXWeeks: {
|
1383
|
+
one: "sekitar 1 minggu",
|
1384
|
+
other: "sekitar {{count}} minggu"
|
1385
|
+
},
|
1386
|
+
xWeeks: {
|
1387
|
+
one: "1 minggu",
|
1388
|
+
other: "{{count}} minggu"
|
1389
|
+
},
|
1390
|
+
aboutXMonths: {
|
1391
|
+
one: "sekitar 1 bulan",
|
1392
|
+
other: "sekitar {{count}} bulan"
|
1393
|
+
},
|
1394
|
+
xMonths: {
|
1395
|
+
one: "1 bulan",
|
1396
|
+
other: "{{count}} bulan"
|
1397
|
+
},
|
1398
|
+
aboutXYears: {
|
1399
|
+
one: "sekitar 1 tahun",
|
1400
|
+
other: "sekitar {{count}} tahun"
|
1401
|
+
},
|
1402
|
+
xYears: {
|
1403
|
+
one: "1 tahun",
|
1404
|
+
other: "{{count}} tahun"
|
1405
|
+
},
|
1406
|
+
overXYears: {
|
1407
|
+
one: "lebih dari 1 tahun",
|
1408
|
+
other: "lebih dari {{count}} tahun"
|
1409
|
+
},
|
1410
|
+
almostXYears: {
|
1411
|
+
one: "hampir 1 tahun",
|
1412
|
+
other: "hampir {{count}} tahun"
|
1413
|
+
}
|
1414
|
+
};
|
1415
|
+
var formatDistance = (token, count, options) => {
|
1416
|
+
let result;
|
1417
|
+
const tokenValue = formatDistanceLocale[token];
|
1418
|
+
if (typeof tokenValue === "string") {
|
1419
|
+
result = tokenValue;
|
1420
|
+
} else if (count === 1) {
|
1421
|
+
result = tokenValue.one;
|
1422
|
+
} else {
|
1423
|
+
result = tokenValue.other.replace("{{count}}", count.toString());
|
1424
|
+
}
|
1425
|
+
if (options == null ? void 0 : options.addSuffix) {
|
1426
|
+
if (options.comparison && options.comparison > 0) {
|
1427
|
+
return "dalam waktu " + result;
|
1428
|
+
} else {
|
1429
|
+
return result + " yang lalu";
|
1430
|
+
}
|
1431
|
+
}
|
1432
|
+
return result;
|
1433
|
+
};
|
1434
|
+
|
1435
|
+
// ../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/id/_lib/formatLong.mjs
|
1436
|
+
var dateFormats = {
|
1437
|
+
full: "EEEE, d MMMM yyyy",
|
1438
|
+
long: "d MMMM yyyy",
|
1439
|
+
medium: "d MMM yyyy",
|
1440
|
+
short: "d/M/yyyy"
|
1441
|
+
};
|
1442
|
+
var timeFormats = {
|
1443
|
+
full: "HH.mm.ss",
|
1444
|
+
long: "HH.mm.ss",
|
1445
|
+
medium: "HH.mm",
|
1446
|
+
short: "HH.mm"
|
1447
|
+
};
|
1448
|
+
var dateTimeFormats = {
|
1449
|
+
full: "{{date}} 'pukul' {{time}}",
|
1450
|
+
long: "{{date}} 'pukul' {{time}}",
|
1451
|
+
medium: "{{date}}, {{time}}",
|
1452
|
+
short: "{{date}}, {{time}}"
|
1453
|
+
};
|
1454
|
+
var formatLong = {
|
1455
|
+
date: buildFormatLongFn({
|
1456
|
+
formats: dateFormats,
|
1457
|
+
defaultWidth: "full"
|
1458
|
+
}),
|
1459
|
+
time: buildFormatLongFn({
|
1460
|
+
formats: timeFormats,
|
1461
|
+
defaultWidth: "full"
|
1462
|
+
}),
|
1463
|
+
dateTime: buildFormatLongFn({
|
1464
|
+
formats: dateTimeFormats,
|
1465
|
+
defaultWidth: "full"
|
1466
|
+
})
|
1467
|
+
};
|
1468
|
+
|
1469
|
+
// ../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/id/_lib/formatRelative.mjs
|
1470
|
+
var formatRelativeLocale = {
|
1471
|
+
lastWeek: "eeee 'lalu pukul' p",
|
1472
|
+
yesterday: "'Kemarin pukul' p",
|
1473
|
+
today: "'Hari ini pukul' p",
|
1474
|
+
tomorrow: "'Besok pukul' p",
|
1475
|
+
nextWeek: "eeee 'pukul' p",
|
1476
|
+
other: "P"
|
1477
|
+
};
|
1478
|
+
var formatRelative = (token, _date, _baseDate, _options) => formatRelativeLocale[token];
|
1479
|
+
|
1480
|
+
// ../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/id/_lib/localize.mjs
|
1481
|
+
var eraValues = {
|
1482
|
+
narrow: ["SM", "M"],
|
1483
|
+
abbreviated: ["SM", "M"],
|
1484
|
+
wide: ["Sebelum Masehi", "Masehi"]
|
1485
|
+
};
|
1486
|
+
var quarterValues = {
|
1487
|
+
narrow: ["1", "2", "3", "4"],
|
1488
|
+
abbreviated: ["K1", "K2", "K3", "K4"],
|
1489
|
+
wide: ["Kuartal ke-1", "Kuartal ke-2", "Kuartal ke-3", "Kuartal ke-4"]
|
1490
|
+
};
|
1491
|
+
var monthValues = {
|
1492
|
+
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
1493
|
+
abbreviated: [
|
1494
|
+
"Jan",
|
1495
|
+
"Feb",
|
1496
|
+
"Mar",
|
1497
|
+
"Apr",
|
1498
|
+
"Mei",
|
1499
|
+
"Jun",
|
1500
|
+
"Jul",
|
1501
|
+
"Agt",
|
1502
|
+
"Sep",
|
1503
|
+
"Okt",
|
1504
|
+
"Nov",
|
1505
|
+
"Des"
|
1506
|
+
],
|
1507
|
+
wide: [
|
1508
|
+
"Januari",
|
1509
|
+
"Februari",
|
1510
|
+
"Maret",
|
1511
|
+
"April",
|
1512
|
+
"Mei",
|
1513
|
+
"Juni",
|
1514
|
+
"Juli",
|
1515
|
+
"Agustus",
|
1516
|
+
"September",
|
1517
|
+
"Oktober",
|
1518
|
+
"November",
|
1519
|
+
"Desember"
|
1520
|
+
]
|
1521
|
+
};
|
1522
|
+
var dayValues = {
|
1523
|
+
narrow: ["M", "S", "S", "R", "K", "J", "S"],
|
1524
|
+
short: ["Min", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab"],
|
1525
|
+
abbreviated: ["Min", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab"],
|
1526
|
+
wide: ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"]
|
1527
|
+
};
|
1528
|
+
var dayPeriodValues = {
|
1529
|
+
narrow: {
|
1530
|
+
am: "AM",
|
1531
|
+
pm: "PM",
|
1532
|
+
midnight: "tengah malam",
|
1533
|
+
noon: "tengah hari",
|
1534
|
+
morning: "pagi",
|
1535
|
+
afternoon: "siang",
|
1536
|
+
evening: "sore",
|
1537
|
+
night: "malam"
|
1538
|
+
},
|
1539
|
+
abbreviated: {
|
1540
|
+
am: "AM",
|
1541
|
+
pm: "PM",
|
1542
|
+
midnight: "tengah malam",
|
1543
|
+
noon: "tengah hari",
|
1544
|
+
morning: "pagi",
|
1545
|
+
afternoon: "siang",
|
1546
|
+
evening: "sore",
|
1547
|
+
night: "malam"
|
1548
|
+
},
|
1549
|
+
wide: {
|
1550
|
+
am: "AM",
|
1551
|
+
pm: "PM",
|
1552
|
+
midnight: "tengah malam",
|
1553
|
+
noon: "tengah hari",
|
1554
|
+
morning: "pagi",
|
1555
|
+
afternoon: "siang",
|
1556
|
+
evening: "sore",
|
1557
|
+
night: "malam"
|
1558
|
+
}
|
1559
|
+
};
|
1560
|
+
var formattingDayPeriodValues = {
|
1561
|
+
narrow: {
|
1562
|
+
am: "AM",
|
1563
|
+
pm: "PM",
|
1564
|
+
midnight: "tengah malam",
|
1565
|
+
noon: "tengah hari",
|
1566
|
+
morning: "pagi",
|
1567
|
+
afternoon: "siang",
|
1568
|
+
evening: "sore",
|
1569
|
+
night: "malam"
|
1570
|
+
},
|
1571
|
+
abbreviated: {
|
1572
|
+
am: "AM",
|
1573
|
+
pm: "PM",
|
1574
|
+
midnight: "tengah malam",
|
1575
|
+
noon: "tengah hari",
|
1576
|
+
morning: "pagi",
|
1577
|
+
afternoon: "siang",
|
1578
|
+
evening: "sore",
|
1579
|
+
night: "malam"
|
1580
|
+
},
|
1581
|
+
wide: {
|
1582
|
+
am: "AM",
|
1583
|
+
pm: "PM",
|
1584
|
+
midnight: "tengah malam",
|
1585
|
+
noon: "tengah hari",
|
1586
|
+
morning: "pagi",
|
1587
|
+
afternoon: "siang",
|
1588
|
+
evening: "sore",
|
1589
|
+
night: "malam"
|
1590
|
+
}
|
1591
|
+
};
|
1592
|
+
var ordinalNumber = (dirtyNumber, _options) => {
|
1593
|
+
const number = Number(dirtyNumber);
|
1594
|
+
return "ke-" + number;
|
1595
|
+
};
|
1596
|
+
var localize = {
|
1597
|
+
ordinalNumber,
|
1598
|
+
era: buildLocalizeFn({
|
1599
|
+
values: eraValues,
|
1600
|
+
defaultWidth: "wide"
|
1601
|
+
}),
|
1602
|
+
quarter: buildLocalizeFn({
|
1603
|
+
values: quarterValues,
|
1604
|
+
defaultWidth: "wide",
|
1605
|
+
argumentCallback: (quarter) => quarter - 1
|
1606
|
+
}),
|
1607
|
+
month: buildLocalizeFn({
|
1608
|
+
values: monthValues,
|
1609
|
+
defaultWidth: "wide"
|
1610
|
+
}),
|
1611
|
+
day: buildLocalizeFn({
|
1612
|
+
values: dayValues,
|
1613
|
+
defaultWidth: "wide"
|
1614
|
+
}),
|
1615
|
+
dayPeriod: buildLocalizeFn({
|
1616
|
+
values: dayPeriodValues,
|
1617
|
+
defaultWidth: "wide",
|
1618
|
+
formattingValues: formattingDayPeriodValues,
|
1619
|
+
defaultFormattingWidth: "wide"
|
1620
|
+
})
|
1621
|
+
};
|
1622
|
+
|
1623
|
+
// ../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/id/_lib/match.mjs
|
1624
|
+
var matchOrdinalNumberPattern = /^ke-(\d+)?/i;
|
1625
|
+
var parseOrdinalNumberPattern = /\d+/i;
|
1626
|
+
var matchEraPatterns = {
|
1627
|
+
narrow: /^(sm|m)/i,
|
1628
|
+
abbreviated: /^(s\.?\s?m\.?|s\.?\s?e\.?\s?u\.?|m\.?|e\.?\s?u\.?)/i,
|
1629
|
+
wide: /^(sebelum masehi|sebelum era umum|masehi|era umum)/i
|
1630
|
+
};
|
1631
|
+
var parseEraPatterns = {
|
1632
|
+
any: [/^s/i, /^(m|e)/i]
|
1633
|
+
};
|
1634
|
+
var matchQuarterPatterns = {
|
1635
|
+
narrow: /^[1234]/i,
|
1636
|
+
abbreviated: /^K-?\s[1234]/i,
|
1637
|
+
wide: /^Kuartal ke-?\s?[1234]/i
|
1638
|
+
};
|
1639
|
+
var parseQuarterPatterns = {
|
1640
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
1641
|
+
};
|
1642
|
+
var matchMonthPatterns = {
|
1643
|
+
narrow: /^[jfmasond]/i,
|
1644
|
+
abbreviated: /^(jan|feb|mar|apr|mei|jun|jul|agt|sep|okt|nov|des)/i,
|
1645
|
+
wide: /^(januari|februari|maret|april|mei|juni|juli|agustus|september|oktober|november|desember)/i
|
1646
|
+
};
|
1647
|
+
var parseMonthPatterns = {
|
1648
|
+
narrow: [
|
1649
|
+
/^j/i,
|
1650
|
+
/^f/i,
|
1651
|
+
/^m/i,
|
1652
|
+
/^a/i,
|
1653
|
+
/^m/i,
|
1654
|
+
/^j/i,
|
1655
|
+
/^j/i,
|
1656
|
+
/^a/i,
|
1657
|
+
/^s/i,
|
1658
|
+
/^o/i,
|
1659
|
+
/^n/i,
|
1660
|
+
/^d/i
|
1661
|
+
],
|
1662
|
+
any: [
|
1663
|
+
/^ja/i,
|
1664
|
+
/^f/i,
|
1665
|
+
/^ma/i,
|
1666
|
+
/^ap/i,
|
1667
|
+
/^me/i,
|
1668
|
+
/^jun/i,
|
1669
|
+
/^jul/i,
|
1670
|
+
/^ag/i,
|
1671
|
+
/^s/i,
|
1672
|
+
/^o/i,
|
1673
|
+
/^n/i,
|
1674
|
+
/^d/i
|
1675
|
+
]
|
1676
|
+
};
|
1677
|
+
var matchDayPatterns = {
|
1678
|
+
narrow: /^[srkjm]/i,
|
1679
|
+
short: /^(min|sen|sel|rab|kam|jum|sab)/i,
|
1680
|
+
abbreviated: /^(min|sen|sel|rab|kam|jum|sab)/i,
|
1681
|
+
wide: /^(minggu|senin|selasa|rabu|kamis|jumat|sabtu)/i
|
1682
|
+
};
|
1683
|
+
var parseDayPatterns = {
|
1684
|
+
narrow: [/^m/i, /^s/i, /^s/i, /^r/i, /^k/i, /^j/i, /^s/i],
|
1685
|
+
any: [/^m/i, /^sen/i, /^sel/i, /^r/i, /^k/i, /^j/i, /^sa/i]
|
1686
|
+
};
|
1687
|
+
var matchDayPeriodPatterns = {
|
1688
|
+
narrow: /^(a|p|tengah m|tengah h|(di(\swaktu)?) (pagi|siang|sore|malam))/i,
|
1689
|
+
any: /^([ap]\.?\s?m\.?|tengah malam|tengah hari|(di(\swaktu)?) (pagi|siang|sore|malam))/i
|
1690
|
+
};
|
1691
|
+
var parseDayPeriodPatterns = {
|
1692
|
+
any: {
|
1693
|
+
am: /^a/i,
|
1694
|
+
pm: /^pm/i,
|
1695
|
+
midnight: /^tengah m/i,
|
1696
|
+
noon: /^tengah h/i,
|
1697
|
+
morning: /pagi/i,
|
1698
|
+
afternoon: /siang/i,
|
1699
|
+
evening: /sore/i,
|
1700
|
+
night: /malam/i
|
1701
|
+
}
|
1702
|
+
};
|
1703
|
+
var match = {
|
1704
|
+
ordinalNumber: buildMatchPatternFn({
|
1705
|
+
matchPattern: matchOrdinalNumberPattern,
|
1706
|
+
parsePattern: parseOrdinalNumberPattern,
|
1707
|
+
valueCallback: (value) => parseInt(value, 10)
|
1708
|
+
}),
|
1709
|
+
era: buildMatchFn({
|
1710
|
+
matchPatterns: matchEraPatterns,
|
1711
|
+
defaultMatchWidth: "wide",
|
1712
|
+
parsePatterns: parseEraPatterns,
|
1713
|
+
defaultParseWidth: "any"
|
1714
|
+
}),
|
1715
|
+
quarter: buildMatchFn({
|
1716
|
+
matchPatterns: matchQuarterPatterns,
|
1717
|
+
defaultMatchWidth: "wide",
|
1718
|
+
parsePatterns: parseQuarterPatterns,
|
1719
|
+
defaultParseWidth: "any",
|
1720
|
+
valueCallback: (index) => index + 1
|
1721
|
+
}),
|
1722
|
+
month: buildMatchFn({
|
1723
|
+
matchPatterns: matchMonthPatterns,
|
1724
|
+
defaultMatchWidth: "wide",
|
1725
|
+
parsePatterns: parseMonthPatterns,
|
1726
|
+
defaultParseWidth: "any"
|
1727
|
+
}),
|
1728
|
+
day: buildMatchFn({
|
1729
|
+
matchPatterns: matchDayPatterns,
|
1730
|
+
defaultMatchWidth: "wide",
|
1731
|
+
parsePatterns: parseDayPatterns,
|
1732
|
+
defaultParseWidth: "any"
|
1733
|
+
}),
|
1734
|
+
dayPeriod: buildMatchFn({
|
1735
|
+
matchPatterns: matchDayPeriodPatterns,
|
1736
|
+
defaultMatchWidth: "any",
|
1737
|
+
parsePatterns: parseDayPeriodPatterns,
|
1738
|
+
defaultParseWidth: "any"
|
1739
|
+
})
|
1740
|
+
};
|
1741
|
+
|
1742
|
+
// ../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/id.mjs
|
1743
|
+
var id = {
|
1744
|
+
code: "id",
|
1745
|
+
formatDistance,
|
1746
|
+
formatLong,
|
1747
|
+
formatRelative,
|
1748
|
+
localize,
|
1749
|
+
match,
|
1750
|
+
options: {
|
1751
|
+
weekStartsOn: 1,
|
1752
|
+
firstWeekContainsDate: 1
|
1753
|
+
}
|
1754
|
+
};
|
1755
|
+
|
1756
|
+
// src/utils/locale/_lib/buildLocalizeFn/index.ts
|
1757
|
+
function buildLocalizeFn2(args) {
|
1758
|
+
return (value, options) => {
|
1759
|
+
const context = (options == null ? void 0 : options.context) ? String(options.context) : "standalone";
|
1760
|
+
let valuesArray;
|
1761
|
+
if (context === "formatting" && args.formattingValues) {
|
1762
|
+
const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
|
1763
|
+
const width = (options == null ? void 0 : options.width) ? String(options.width) : defaultWidth;
|
1764
|
+
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
|
1765
|
+
} else {
|
1766
|
+
const { defaultWidth } = args;
|
1767
|
+
const width = (options == null ? void 0 : options.width) ? String(options.width) : args.defaultWidth;
|
1768
|
+
valuesArray = args.values[width] || args.values[defaultWidth];
|
1769
|
+
}
|
1770
|
+
const index = args.argumentCallback ? args.argumentCallback(value) : value;
|
1771
|
+
return valuesArray[index];
|
1772
|
+
};
|
1773
|
+
}
|
1774
|
+
|
1775
|
+
// src/utils/locale/id/index.ts
|
1776
|
+
var monthValues2 = {
|
1777
|
+
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
1778
|
+
abbreviated: ["Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Agu", "Sep", "Okt", "Nov", "Des"],
|
1779
|
+
wide: [
|
1780
|
+
"Januari",
|
1781
|
+
"Februari",
|
1782
|
+
"Maret",
|
1783
|
+
"April",
|
1784
|
+
"Mei",
|
1785
|
+
"Juni",
|
1786
|
+
"Juli",
|
1787
|
+
"Agustus",
|
1788
|
+
"September",
|
1789
|
+
"Oktober",
|
1790
|
+
"November",
|
1791
|
+
"Desember"
|
1792
|
+
]
|
1793
|
+
};
|
1794
|
+
id.localize.month = buildLocalizeFn2({
|
1795
|
+
values: monthValues2,
|
1796
|
+
defaultWidth: "wide"
|
1797
|
+
});
|
1798
|
+
|
1240
1799
|
// src/components/datepicker/components/styles.tsx
|
1241
1800
|
import { useColorMode } from "@chakra-ui/system";
|
1242
1801
|
import { Global } from "@emotion/react";
|
@@ -2135,7 +2694,7 @@ var time_input_default = TimeInput;
|
|
2135
2694
|
// src/components/datepicker/components/datepicker.tsx
|
2136
2695
|
import { Fragment as Fragment2, jsx as jsx27, jsxs as jsxs10 } from "react/jsx-runtime";
|
2137
2696
|
var Datepicker = ({
|
2138
|
-
id,
|
2697
|
+
id: id2,
|
2139
2698
|
label,
|
2140
2699
|
error,
|
2141
2700
|
isError,
|
@@ -2147,11 +2706,12 @@ var Datepicker = ({
|
|
2147
2706
|
onClear,
|
2148
2707
|
showMonth,
|
2149
2708
|
shortMonth,
|
2709
|
+
timezoneLabel,
|
2150
2710
|
...props
|
2151
2711
|
}) => {
|
2152
2712
|
var _a, _b;
|
2153
2713
|
const selected = value ? new Date(value) : void 0;
|
2154
|
-
const dateFormat = ((_a = props.dateFormat) != null ? _a : withTime) ?
|
2714
|
+
const dateFormat = ((_a = props.dateFormat) != null ? _a : withTime) ? `dd MMM yyyy, HH:mm '${timezoneLabel}'` : "dd MMM yyyy";
|
2155
2715
|
const getTimeProps = () => {
|
2156
2716
|
if (!withTime) return {};
|
2157
2717
|
return {
|
@@ -2166,7 +2726,7 @@ var Datepicker = ({
|
|
2166
2726
|
/* @__PURE__ */ jsx27(
|
2167
2727
|
ReactDatePicker,
|
2168
2728
|
{
|
2169
|
-
id,
|
2729
|
+
id: id2,
|
2170
2730
|
name,
|
2171
2731
|
selected,
|
2172
2732
|
customInput: /* @__PURE__ */ jsx27(
|
@@ -2204,6 +2764,7 @@ var Datepicker = ({
|
|
2204
2764
|
shouldCloseOnSelect: !(props.selectsRange || withTime),
|
2205
2765
|
useShortMonthInDropdown: showMonth ? shortMonth : false,
|
2206
2766
|
dateFormat,
|
2767
|
+
locale: id,
|
2207
2768
|
...getTimeProps(),
|
2208
2769
|
...props
|
2209
2770
|
}
|
@@ -4665,14 +5226,14 @@ import { marry } from "@zamiru/timescape";
|
|
4665
5226
|
import {
|
4666
5227
|
useEffect as useEffect2,
|
4667
5228
|
useLayoutEffect,
|
4668
|
-
useRef,
|
5229
|
+
useRef as useRef2,
|
4669
5230
|
useState as useState4
|
4670
5231
|
} from "react";
|
4671
5232
|
var useTimescape = (options = {}) => {
|
4672
5233
|
var _a;
|
4673
5234
|
const { date, onChangeDate, ...rest } = options;
|
4674
5235
|
const [manager] = useState4(() => new TimescapeManager(date, rest));
|
4675
|
-
const onChangeDateRef =
|
5236
|
+
const onChangeDateRef = useRef2(onChangeDate);
|
4676
5237
|
useLayoutEffect(() => {
|
4677
5238
|
onChangeDateRef.current = onChangeDate;
|
4678
5239
|
}, [onChangeDate]);
|
@@ -5027,7 +5588,7 @@ var useToast = () => {
|
|
5027
5588
|
style: { backgroundColor: style == null ? void 0 : style.backgroundColor, color: style == null ? void 0 : style.color }
|
5028
5589
|
});
|
5029
5590
|
},
|
5030
|
-
dismiss: (
|
5591
|
+
dismiss: (id2) => toast.dismiss(id2)
|
5031
5592
|
};
|
5032
5593
|
};
|
5033
5594
|
|
@@ -5049,7 +5610,7 @@ import {
|
|
5049
5610
|
UnorderedList as UnorderedList2
|
5050
5611
|
} from "@chakra-ui/react";
|
5051
5612
|
import { Close as X, Plus } from "@ctlyst.id/internal-icon";
|
5052
|
-
import { useCallback as useCallback2, useEffect as useEffect4, useRef as
|
5613
|
+
import { useCallback as useCallback2, useEffect as useEffect4, useRef as useRef3, useState as useState5 } from "react";
|
5053
5614
|
import { useDropzone } from "react-dropzone";
|
5054
5615
|
|
5055
5616
|
// src/components/uploader/constants.ts
|
@@ -5109,7 +5670,7 @@ var Uploader = ({
|
|
5109
5670
|
size: size2 = "lg",
|
5110
5671
|
...props
|
5111
5672
|
}) => {
|
5112
|
-
const inputRef =
|
5673
|
+
const inputRef = useRef3(null);
|
5113
5674
|
const [filePreview, setFilePreview] = useState5();
|
5114
5675
|
const toast2 = useToast();
|
5115
5676
|
const handleRejection = useCallback2(
|
@@ -7022,7 +7583,7 @@ import { useMemo as useMemo5 } from "react";
|
|
7022
7583
|
|
7023
7584
|
// src/provider/components/provider.tsx
|
7024
7585
|
import axios from "axios";
|
7025
|
-
import { createContext as createContext2, useContext, useEffect as useEffect5, useMemo as useMemo4, useRef as
|
7586
|
+
import { createContext as createContext2, useContext, useEffect as useEffect5, useMemo as useMemo4, useRef as useRef4 } from "react";
|
7026
7587
|
import { ToastContainer as ToastContainer2 } from "react-toastify";
|
7027
7588
|
import { jsx as jsx67, jsxs as jsxs32 } from "react/jsx-runtime";
|
7028
7589
|
var ProviderContext = createContext2({
|
@@ -7033,7 +7594,7 @@ var useInternalUI = () => {
|
|
7033
7594
|
return { instance };
|
7034
7595
|
};
|
7035
7596
|
var Provider = ({ children, config: config2, requestInterceptors, responseInterceptors }) => {
|
7036
|
-
const instanceRef =
|
7597
|
+
const instanceRef = useRef4(axios.create(config2));
|
7037
7598
|
useEffect5(() => {
|
7038
7599
|
requestInterceptors == null ? void 0 : requestInterceptors.forEach((interceptor) => {
|
7039
7600
|
instanceRef.current.interceptors.request.use(interceptor);
|