@dmsi/wedgekit-react 0.0.476 → 0.0.477
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/{chunk-HSJ34DOK.js → chunk-WIDUWFLX.js} +748 -34
- package/dist/components/CalendarRange.cjs +452 -152
- package/dist/components/CalendarRange.js +1 -2
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +916 -151
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +1 -1
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +926 -161
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +1 -1
- package/dist/components/DataGrid/PinnedColumns.cjs +941 -176
- package/dist/components/DataGrid/PinnedColumns.js +1 -1
- package/dist/components/DataGrid/TableBody/LoadingCell.cjs +917 -152
- package/dist/components/DataGrid/TableBody/LoadingCell.js +1 -1
- package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +923 -158
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +1 -1
- package/dist/components/DataGrid/TableBody/index.cjs +938 -173
- package/dist/components/DataGrid/TableBody/index.js +1 -1
- package/dist/components/DataGrid/index.cjs +1027 -262
- package/dist/components/DataGrid/index.js +1 -1
- package/dist/components/DataGrid/utils.cjs +917 -152
- package/dist/components/DataGrid/utils.js +1 -1
- package/dist/components/DateInput.js +7 -254
- package/dist/components/DateRangeInput.cjs +406 -176
- package/dist/components/DateRangeInput.js +1 -2
- package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +923 -158
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +1 -1
- package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +921 -156
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +1 -1
- package/dist/components/MobileDataGrid/index.cjs +971 -206
- package/dist/components/MobileDataGrid/index.js +1 -1
- package/dist/components/index.cjs +1145 -378
- package/dist/components/index.js +3 -1
- package/package.json +1 -1
- package/src/components/index.ts +1 -0
- package/dist/chunk-X35NLL3N.js +0 -493
|
@@ -35,7 +35,8 @@ import {
|
|
|
35
35
|
Search
|
|
36
36
|
} from "./chunk-RQRR4FEF.js";
|
|
37
37
|
import {
|
|
38
|
-
Input
|
|
38
|
+
Input,
|
|
39
|
+
InputBase
|
|
39
40
|
} from "./chunk-44TH3VC7.js";
|
|
40
41
|
import {
|
|
41
42
|
Label
|
|
@@ -48,7 +49,14 @@ import {
|
|
|
48
49
|
useTableLayout
|
|
49
50
|
} from "./chunk-URYQ24NF.js";
|
|
50
51
|
import {
|
|
51
|
-
|
|
52
|
+
findDocumentRoot
|
|
53
|
+
} from "./chunk-VXWSAIB5.js";
|
|
54
|
+
import {
|
|
55
|
+
calculateCursorPosition,
|
|
56
|
+
formatDate,
|
|
57
|
+
formatInputValue,
|
|
58
|
+
isValidDate,
|
|
59
|
+
parseInputDate
|
|
52
60
|
} from "./chunk-R3EQIDBX.js";
|
|
53
61
|
import {
|
|
54
62
|
formatCurrencyDisplay
|
|
@@ -73,7 +81,10 @@ import {
|
|
|
73
81
|
} from "./chunk-LPY6PMAY.js";
|
|
74
82
|
import {
|
|
75
83
|
componentGap,
|
|
76
|
-
componentPadding
|
|
84
|
+
componentPadding,
|
|
85
|
+
layoutGap,
|
|
86
|
+
layoutPaddding,
|
|
87
|
+
typography
|
|
77
88
|
} from "./chunk-IXR65MOU.js";
|
|
78
89
|
import {
|
|
79
90
|
__objRest,
|
|
@@ -82,7 +93,7 @@ import {
|
|
|
82
93
|
} from "./chunk-ORMEWXMH.js";
|
|
83
94
|
|
|
84
95
|
// src/components/DataGrid/utils.tsx
|
|
85
|
-
import
|
|
96
|
+
import clsx6 from "clsx";
|
|
86
97
|
|
|
87
98
|
// src/components/DataGrid/index.tsx
|
|
88
99
|
import React3, {
|
|
@@ -1225,13 +1236,712 @@ function adaptTableStateSetter(setter) {
|
|
|
1225
1236
|
}
|
|
1226
1237
|
var DataGrid_default = DataGrid;
|
|
1227
1238
|
|
|
1228
|
-
// src/components/
|
|
1229
|
-
import {
|
|
1239
|
+
// src/components/DateInput.tsx
|
|
1240
|
+
import { useRef as useRef3, useEffect as useEffect3, useState as useState5, useLayoutEffect } from "react";
|
|
1241
|
+
import { createPortal } from "react-dom";
|
|
1242
|
+
|
|
1243
|
+
// src/components/CalendarRange.tsx
|
|
1244
|
+
import clsx5 from "clsx";
|
|
1245
|
+
import React4, { useEffect as useEffect2, useRef as useRef2, useState as useState4 } from "react";
|
|
1246
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
1230
1247
|
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1248
|
+
function isWeekend(date) {
|
|
1249
|
+
return date.dayOfWeek === 6 || date.dayOfWeek === 7;
|
|
1250
|
+
}
|
|
1251
|
+
function DateCell(_a) {
|
|
1252
|
+
var _b = _a, {
|
|
1253
|
+
date,
|
|
1254
|
+
isInMonth,
|
|
1255
|
+
isToday,
|
|
1256
|
+
isSelected,
|
|
1257
|
+
inRange,
|
|
1258
|
+
isDisabled,
|
|
1259
|
+
isRangeStart,
|
|
1260
|
+
isRangeEnd,
|
|
1261
|
+
onClick,
|
|
1262
|
+
onMouseEnter,
|
|
1263
|
+
onMouseLeave,
|
|
1264
|
+
cellPadding = "",
|
|
1265
|
+
isRangeDisabled = false,
|
|
1266
|
+
id,
|
|
1267
|
+
testid
|
|
1268
|
+
} = _b, props = __objRest(_b, [
|
|
1269
|
+
"date",
|
|
1270
|
+
"isInMonth",
|
|
1271
|
+
"isToday",
|
|
1272
|
+
"isSelected",
|
|
1273
|
+
"inRange",
|
|
1274
|
+
"isDisabled",
|
|
1275
|
+
"isRangeStart",
|
|
1276
|
+
"isRangeEnd",
|
|
1277
|
+
"onClick",
|
|
1278
|
+
"onMouseEnter",
|
|
1279
|
+
"onMouseLeave",
|
|
1280
|
+
"cellPadding",
|
|
1281
|
+
"isRangeDisabled",
|
|
1282
|
+
"id",
|
|
1283
|
+
"testid"
|
|
1284
|
+
]);
|
|
1285
|
+
return /* @__PURE__ */ jsx8(
|
|
1286
|
+
"span",
|
|
1287
|
+
__spreadProps(__spreadValues({}, props), {
|
|
1288
|
+
id,
|
|
1289
|
+
"data-testid": testid,
|
|
1290
|
+
className: clsx5(
|
|
1291
|
+
"flex items-center justify-center aspect-square select-none transition-colors border duration-100 font-medium",
|
|
1292
|
+
typography.caption,
|
|
1293
|
+
cellPadding,
|
|
1294
|
+
!isToday && !isSelected && !inRange && !isDisabled && !isRangeStart && !isRangeEnd && "border-transparent",
|
|
1295
|
+
!isInMonth && "border-transparent",
|
|
1296
|
+
// Today: subtle border ring
|
|
1297
|
+
isToday && !isSelected && !inRange && "rounded-full border-border-primary-normal ",
|
|
1298
|
+
// Selected: Figma blue, white text, strong shadow
|
|
1299
|
+
isSelected && "bg-action-400 text-white border-action-400 z-10",
|
|
1300
|
+
!isSelected && !inRange && "rounded-base",
|
|
1301
|
+
// When range is disabled OR when only 'from' is selected (no range yet), apply rounded corners
|
|
1302
|
+
(isRangeDisabled || !inRange && isSelected) && "rounded-base",
|
|
1303
|
+
inRange && isSelected && "hover:border-action-500",
|
|
1304
|
+
// In range: Figma light blue background
|
|
1305
|
+
inRange && !isSelected && "bg-action-100 text-text-primary-normal border-y-action-400 border-x-0 ",
|
|
1306
|
+
// Disabled: Figma gray, no pointer, no hover
|
|
1307
|
+
isDisabled && !inRange ? "text-text-primary-disabled bg-transparent pointer-events-none opacity-40 border-transparent" : [
|
|
1308
|
+
"text-text-primary-normal cursor-pointer",
|
|
1309
|
+
// Figma hover: blue bg, blue text (or red text if selected)
|
|
1310
|
+
isSelected ? "hover:bg-background-action-primary-hover hover:text-white" : "hover:bg-action-100 hover:text-text-action-primary-hover",
|
|
1311
|
+
// Figma active: darker blue bg, white text
|
|
1312
|
+
"active:bg-action-300 active:text-white",
|
|
1313
|
+
// Figma focus: ring
|
|
1314
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-400"
|
|
1315
|
+
],
|
|
1316
|
+
isRangeStart && "rounded-l",
|
|
1317
|
+
isRangeEnd && "rounded-r"
|
|
1318
|
+
),
|
|
1319
|
+
tabIndex: isDisabled ? -1 : 0,
|
|
1320
|
+
"aria-disabled": isDisabled,
|
|
1321
|
+
onClick: () => !isDisabled && isInMonth && onClick(),
|
|
1322
|
+
onMouseEnter: () => isInMonth && onMouseEnter(),
|
|
1323
|
+
onMouseLeave: () => isInMonth && onMouseLeave(),
|
|
1324
|
+
children: isInMonth ? date.day : ""
|
|
1325
|
+
})
|
|
1326
|
+
);
|
|
1327
|
+
}
|
|
1328
|
+
function CalendarRange({
|
|
1329
|
+
from,
|
|
1330
|
+
to,
|
|
1331
|
+
onChange,
|
|
1332
|
+
isDateAvailable,
|
|
1333
|
+
mode = "double",
|
|
1334
|
+
cardStyle = false,
|
|
1335
|
+
disableRange = false,
|
|
1336
|
+
id,
|
|
1337
|
+
testid
|
|
1338
|
+
}) {
|
|
1339
|
+
const weekDays = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
1340
|
+
const parseDate = (d) => {
|
|
1341
|
+
if (!d) {
|
|
1342
|
+
return void 0;
|
|
1343
|
+
}
|
|
1344
|
+
try {
|
|
1345
|
+
if (typeof d === "number") {
|
|
1346
|
+
return Temporal.PlainDate.from(new Date(d).toISOString().slice(0, 10));
|
|
1347
|
+
}
|
|
1348
|
+
if (typeof d === "string") {
|
|
1349
|
+
return Temporal.PlainDate.from(d);
|
|
1350
|
+
}
|
|
1351
|
+
return void 0;
|
|
1352
|
+
} catch (error) {
|
|
1353
|
+
console.error("Invalid date format:", d, error);
|
|
1354
|
+
return Temporal.Now.plainDateISO();
|
|
1355
|
+
}
|
|
1356
|
+
};
|
|
1357
|
+
const fromDate = parseDate(from);
|
|
1358
|
+
const toDate = parseDate(to);
|
|
1359
|
+
const today = Temporal.Now.plainDateISO();
|
|
1360
|
+
const [baseMonth, setBaseMonth] = useState4(
|
|
1361
|
+
fromDate != null ? fromDate : today.with({ day: 1 })
|
|
1362
|
+
);
|
|
1363
|
+
const [selecting, setSelecting] = useState4("from");
|
|
1364
|
+
const [pendingFrom, setPendingFrom] = useState4(void 0);
|
|
1365
|
+
const [hoveredDate, setHoveredDate] = useState4(void 0);
|
|
1366
|
+
useEffect2(() => {
|
|
1367
|
+
if (fromDate) {
|
|
1368
|
+
setBaseMonth(fromDate.with({ day: 1 }));
|
|
1369
|
+
} else if (toDate) {
|
|
1370
|
+
setBaseMonth(toDate.with({ day: 1 }));
|
|
1371
|
+
}
|
|
1372
|
+
}, [from, to]);
|
|
1373
|
+
useEffect2(() => {
|
|
1374
|
+
if (fromDate && toDate) {
|
|
1375
|
+
setSelecting("from");
|
|
1376
|
+
setPendingFrom(void 0);
|
|
1377
|
+
setHoveredDate(void 0);
|
|
1378
|
+
}
|
|
1379
|
+
}, [from, to]);
|
|
1380
|
+
function getMonthData(monthOffset) {
|
|
1381
|
+
const monthDate = baseMonth.add({ months: monthOffset }).with({ day: 1 });
|
|
1382
|
+
const days = monthDate.daysInMonth;
|
|
1383
|
+
const firstDayOffset = monthDate.dayOfWeek % 7;
|
|
1384
|
+
return {
|
|
1385
|
+
name: monthDate.toLocaleString("en-US", { month: "long" }),
|
|
1386
|
+
year: monthDate.year,
|
|
1387
|
+
days,
|
|
1388
|
+
firstDayOffset,
|
|
1389
|
+
date: monthDate
|
|
1390
|
+
};
|
|
1391
|
+
}
|
|
1392
|
+
function getMonthDataWith(monthOffset) {
|
|
1393
|
+
const monthDate = baseMonth.with({ month: monthOffset }).with({ day: 1 });
|
|
1394
|
+
const days = monthDate.daysInMonth;
|
|
1395
|
+
const firstDayOffset = monthDate.dayOfWeek % 7;
|
|
1396
|
+
return {
|
|
1397
|
+
name: monthDate.toLocaleString("en-US", { month: "long" }),
|
|
1398
|
+
year: monthDate.year,
|
|
1399
|
+
days,
|
|
1400
|
+
firstDayOffset,
|
|
1401
|
+
date: monthDate
|
|
1402
|
+
};
|
|
1403
|
+
}
|
|
1404
|
+
function handleDayClick(date) {
|
|
1405
|
+
if (isDateAvailable && !isDateAvailable(date)) return;
|
|
1406
|
+
if (mode === "single" && disableRange) {
|
|
1407
|
+
if (onChange) {
|
|
1408
|
+
onChange(date.toString(), date.toString());
|
|
1409
|
+
}
|
|
1410
|
+
return;
|
|
1411
|
+
}
|
|
1412
|
+
if (selecting === "from") {
|
|
1413
|
+
setPendingFrom(date);
|
|
1414
|
+
setSelecting("to");
|
|
1415
|
+
setHoveredDate(void 0);
|
|
1416
|
+
} else if (pendingFrom) {
|
|
1417
|
+
if (onChange) {
|
|
1418
|
+
const [start, end] = Temporal.PlainDate.compare(date, pendingFrom) < 0 ? [date, pendingFrom] : [pendingFrom, date];
|
|
1419
|
+
onChange(start.toString(), end.toString());
|
|
1420
|
+
}
|
|
1421
|
+
setPendingFrom(void 0);
|
|
1422
|
+
setSelecting("from");
|
|
1423
|
+
setHoveredDate(void 0);
|
|
1424
|
+
}
|
|
1425
|
+
}
|
|
1426
|
+
function isInRange(date) {
|
|
1427
|
+
if (mode === "single" && disableRange) {
|
|
1428
|
+
return false;
|
|
1429
|
+
}
|
|
1430
|
+
if (pendingFrom && selecting === "to" && hoveredDate) {
|
|
1431
|
+
const [start, end] = Temporal.PlainDate.compare(hoveredDate, pendingFrom) < 0 ? [hoveredDate, pendingFrom] : [pendingFrom, hoveredDate];
|
|
1432
|
+
return Temporal.PlainDate.compare(date, start) >= 0 && Temporal.PlainDate.compare(date, end) <= 0;
|
|
1433
|
+
}
|
|
1434
|
+
if (!pendingFrom && fromDate && toDate) {
|
|
1435
|
+
return Temporal.PlainDate.compare(date, fromDate) >= 0 && Temporal.PlainDate.compare(date, toDate) <= 0;
|
|
1436
|
+
}
|
|
1437
|
+
return false;
|
|
1438
|
+
}
|
|
1439
|
+
return /* @__PURE__ */ jsx8(
|
|
1440
|
+
"div",
|
|
1441
|
+
{
|
|
1442
|
+
id,
|
|
1443
|
+
"data-testid": testid,
|
|
1444
|
+
className: clsx5(
|
|
1445
|
+
"relative bg-background-grouped-primary-normal rounded-base w-fit",
|
|
1446
|
+
layoutPaddding,
|
|
1447
|
+
layoutGap,
|
|
1448
|
+
cardStyle && "shadow-4",
|
|
1449
|
+
// baseTransition,
|
|
1450
|
+
"overflow-hidden"
|
|
1451
|
+
),
|
|
1452
|
+
children: /* @__PURE__ */ jsx8(
|
|
1453
|
+
"div",
|
|
1454
|
+
{
|
|
1455
|
+
className: clsx5(
|
|
1456
|
+
"flex flex-row items-start justify-start bg-background-primary-normal overflow-clip",
|
|
1457
|
+
layoutGap
|
|
1458
|
+
),
|
|
1459
|
+
children: (mode === "double" ? [0, 1] : [0]).map((offset, idx) => {
|
|
1460
|
+
return /* @__PURE__ */ jsx8(
|
|
1461
|
+
CalendarPane,
|
|
1462
|
+
{
|
|
1463
|
+
getMonthData,
|
|
1464
|
+
getMonthDataWith,
|
|
1465
|
+
offset,
|
|
1466
|
+
idx,
|
|
1467
|
+
id,
|
|
1468
|
+
testid,
|
|
1469
|
+
baseMonth,
|
|
1470
|
+
setBaseMonth,
|
|
1471
|
+
mode,
|
|
1472
|
+
pendingFrom,
|
|
1473
|
+
weekDays,
|
|
1474
|
+
fromDate,
|
|
1475
|
+
toDate,
|
|
1476
|
+
isDateAvailable,
|
|
1477
|
+
disableRange,
|
|
1478
|
+
hoveredDate,
|
|
1479
|
+
isInRange,
|
|
1480
|
+
today,
|
|
1481
|
+
setHoveredDate,
|
|
1482
|
+
handleDayClick
|
|
1483
|
+
},
|
|
1484
|
+
idx
|
|
1485
|
+
);
|
|
1486
|
+
})
|
|
1487
|
+
}
|
|
1488
|
+
)
|
|
1489
|
+
}
|
|
1490
|
+
);
|
|
1491
|
+
}
|
|
1492
|
+
function CalendarPane({
|
|
1493
|
+
getMonthData,
|
|
1494
|
+
getMonthDataWith,
|
|
1495
|
+
offset,
|
|
1496
|
+
idx,
|
|
1497
|
+
id,
|
|
1498
|
+
testid,
|
|
1499
|
+
baseMonth,
|
|
1500
|
+
setBaseMonth,
|
|
1501
|
+
mode,
|
|
1502
|
+
pendingFrom,
|
|
1503
|
+
weekDays,
|
|
1504
|
+
fromDate,
|
|
1505
|
+
toDate,
|
|
1506
|
+
isDateAvailable,
|
|
1507
|
+
disableRange,
|
|
1508
|
+
hoveredDate,
|
|
1509
|
+
isInRange,
|
|
1510
|
+
today,
|
|
1511
|
+
setHoveredDate,
|
|
1512
|
+
handleDayClick
|
|
1513
|
+
}) {
|
|
1514
|
+
const months = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
|
|
1515
|
+
const years = Array.from({ length: 100 }).map(
|
|
1516
|
+
(_, i) => baseMonth.year - 50 + i
|
|
1517
|
+
);
|
|
1518
|
+
const [monthMenuOpen, setMonthMenuOpen] = useState4(false);
|
|
1519
|
+
const [yearMenuOpen, setYearMenuOpen] = useState4(false);
|
|
1520
|
+
const monthMenuRef = useRef2(null);
|
|
1521
|
+
const yearMenuRef = useRef2(null);
|
|
1522
|
+
const month = getMonthData(offset);
|
|
1523
|
+
const totalCells = 42;
|
|
1524
|
+
const emptyCells = month.firstDayOffset;
|
|
1525
|
+
return /* @__PURE__ */ jsxs6(React4.Fragment, { children: [
|
|
1526
|
+
/* @__PURE__ */ jsxs6(
|
|
1527
|
+
"div",
|
|
1528
|
+
{
|
|
1529
|
+
className: clsx5("flex flex-col"),
|
|
1530
|
+
children: [
|
|
1531
|
+
/* @__PURE__ */ jsxs6(
|
|
1532
|
+
"div",
|
|
1533
|
+
{
|
|
1534
|
+
className: clsx5(
|
|
1535
|
+
"flex flex-row items-center justify-between",
|
|
1536
|
+
typography.label,
|
|
1537
|
+
"text-text-action-primary-normal"
|
|
1538
|
+
),
|
|
1539
|
+
children: [
|
|
1540
|
+
idx === 0 ? /* @__PURE__ */ jsx8(
|
|
1541
|
+
"button",
|
|
1542
|
+
{
|
|
1543
|
+
id: id ? `${id}-prev-month-button` : void 0,
|
|
1544
|
+
"data-testid": testid ? `${testid}-prev-month-button` : void 0,
|
|
1545
|
+
type: "button",
|
|
1546
|
+
className: clsx5(
|
|
1547
|
+
"flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-action-primary-normal",
|
|
1548
|
+
componentPadding
|
|
1549
|
+
),
|
|
1550
|
+
"aria-label": "Previous month",
|
|
1551
|
+
onClick: () => setBaseMonth(baseMonth.subtract({ months: 1 })),
|
|
1552
|
+
children: /* @__PURE__ */ jsx8(Icon, { name: "chevron_left", size: 24 })
|
|
1553
|
+
}
|
|
1554
|
+
) : /* @__PURE__ */ jsx8("span", { className: clsx5(componentPadding, "mr-1") }),
|
|
1555
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex gap-desktop-compact-component-padding", children: [
|
|
1556
|
+
/* @__PURE__ */ jsx8(
|
|
1557
|
+
"button",
|
|
1558
|
+
{
|
|
1559
|
+
ref: (el) => {
|
|
1560
|
+
monthMenuRef.current = el;
|
|
1561
|
+
},
|
|
1562
|
+
type: "button",
|
|
1563
|
+
onClick: () => {
|
|
1564
|
+
setMonthMenuOpen(true);
|
|
1565
|
+
setYearMenuOpen(false);
|
|
1566
|
+
},
|
|
1567
|
+
className: "font-semibold text-text-action-primary-normal text-[14px] py-[2px] truncate",
|
|
1568
|
+
children: month.name
|
|
1569
|
+
}
|
|
1570
|
+
),
|
|
1571
|
+
/* @__PURE__ */ jsx8(
|
|
1572
|
+
Menu,
|
|
1573
|
+
{
|
|
1574
|
+
show: monthMenuOpen,
|
|
1575
|
+
positionTo: monthMenuRef,
|
|
1576
|
+
setShow: () => setMonthMenuOpen(false),
|
|
1577
|
+
children: months.map((x) => [x, getMonthDataWith(x + 1)]).map(([x, m]) => /* @__PURE__ */ jsx8(
|
|
1578
|
+
MenuOption,
|
|
1579
|
+
{
|
|
1580
|
+
selected: baseMonth.month === x + 1,
|
|
1581
|
+
onClick: () => {
|
|
1582
|
+
setBaseMonth(baseMonth.with({ month: x + 1 }));
|
|
1583
|
+
setMonthMenuOpen(false);
|
|
1584
|
+
},
|
|
1585
|
+
children: m.name
|
|
1586
|
+
},
|
|
1587
|
+
m.name
|
|
1588
|
+
))
|
|
1589
|
+
}
|
|
1590
|
+
),
|
|
1591
|
+
/* @__PURE__ */ jsx8(
|
|
1592
|
+
"button",
|
|
1593
|
+
{
|
|
1594
|
+
ref: (el) => {
|
|
1595
|
+
yearMenuRef.current = el;
|
|
1596
|
+
},
|
|
1597
|
+
type: "button",
|
|
1598
|
+
onClick: () => {
|
|
1599
|
+
setYearMenuOpen(true);
|
|
1600
|
+
setMonthMenuOpen(false);
|
|
1601
|
+
},
|
|
1602
|
+
className: "font-semibold text-text-action-primary-normal text-[14px] py-[2px] truncate",
|
|
1603
|
+
children: month.year
|
|
1604
|
+
}
|
|
1605
|
+
),
|
|
1606
|
+
/* @__PURE__ */ jsx8(
|
|
1607
|
+
Menu,
|
|
1608
|
+
{
|
|
1609
|
+
show: yearMenuOpen,
|
|
1610
|
+
positionTo: yearMenuRef,
|
|
1611
|
+
setShow: () => setYearMenuOpen(false),
|
|
1612
|
+
children: years.map((y) => /* @__PURE__ */ jsx8(
|
|
1613
|
+
MenuOption,
|
|
1614
|
+
{
|
|
1615
|
+
selected: baseMonth.year === y,
|
|
1616
|
+
onClick: () => {
|
|
1617
|
+
setBaseMonth(baseMonth.with({ year: y }));
|
|
1618
|
+
setYearMenuOpen(false);
|
|
1619
|
+
},
|
|
1620
|
+
children: y
|
|
1621
|
+
},
|
|
1622
|
+
y
|
|
1623
|
+
))
|
|
1624
|
+
}
|
|
1625
|
+
)
|
|
1626
|
+
] }),
|
|
1627
|
+
(mode === "double" ? idx === 1 : true) ? /* @__PURE__ */ jsx8(
|
|
1628
|
+
"button",
|
|
1629
|
+
{
|
|
1630
|
+
id: id ? `${id}-next-month-button` : void 0,
|
|
1631
|
+
"data-testid": testid ? `${testid}-next-month-button` : void 0,
|
|
1632
|
+
type: "button",
|
|
1633
|
+
className: clsx5(
|
|
1634
|
+
"flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-action-primary-normal",
|
|
1635
|
+
componentPadding
|
|
1636
|
+
),
|
|
1637
|
+
"aria-label": "Next month",
|
|
1638
|
+
onClick: () => setBaseMonth(baseMonth.add({ months: 1 })),
|
|
1639
|
+
children: /* @__PURE__ */ jsx8(Icon, { name: "chevron_right", size: 24 })
|
|
1640
|
+
}
|
|
1641
|
+
) : /* @__PURE__ */ jsx8("span", { className: clsx5(componentPadding, "ml-1") })
|
|
1642
|
+
]
|
|
1643
|
+
}
|
|
1644
|
+
),
|
|
1645
|
+
/* @__PURE__ */ jsx8("div", { className: clsx5("grid grid-cols-7"), children: weekDays.map((d) => /* @__PURE__ */ jsx8(
|
|
1646
|
+
"span",
|
|
1647
|
+
{
|
|
1648
|
+
className: clsx5(
|
|
1649
|
+
typography.caption,
|
|
1650
|
+
"text-text-secondary-normal text-center",
|
|
1651
|
+
"w-10"
|
|
1652
|
+
),
|
|
1653
|
+
children: d
|
|
1654
|
+
},
|
|
1655
|
+
d
|
|
1656
|
+
)) }),
|
|
1657
|
+
/* @__PURE__ */ jsx8("div", { className: clsx5("grid grid-cols-7"), children: Array.from({ length: totalCells }).map((_, i) => {
|
|
1658
|
+
const day = i - emptyCells + 1;
|
|
1659
|
+
const date = month.date.with({ day: 1 }).add({
|
|
1660
|
+
days: i - emptyCells
|
|
1661
|
+
});
|
|
1662
|
+
const isInMonth = day > 0 && day <= month.days;
|
|
1663
|
+
const isToday = isInMonth && date.equals(today);
|
|
1664
|
+
const isSelected = isInMonth && (!pendingFrom && fromDate && date.equals(fromDate) || !pendingFrom && toDate && date.equals(toDate) || pendingFrom && date.equals(pendingFrom));
|
|
1665
|
+
const inRange = isInMonth && isInRange(date);
|
|
1666
|
+
const isDisabled = !isInMonth || (isDateAvailable ? !isDateAvailable(date) : false);
|
|
1667
|
+
const hoverDateIsBeforePendingFrom = hoveredDate && pendingFrom && Temporal.PlainDate.compare(hoveredDate, pendingFrom) < 0;
|
|
1668
|
+
const hoverDateIsAfterPendingFrom = hoveredDate && pendingFrom && Temporal.PlainDate.compare(hoveredDate, pendingFrom) >= 0;
|
|
1669
|
+
const isRangeStart = mode === "single" && disableRange ? false : !pendingFrom && isInMonth && fromDate && date.equals(fromDate) || hoverDateIsAfterPendingFrom && date.equals(pendingFrom);
|
|
1670
|
+
const isRangeEnd = mode === "single" && disableRange ? false : !pendingFrom && isInMonth && toDate && date.equals(toDate) || hoverDateIsBeforePendingFrom && date.equals(pendingFrom);
|
|
1671
|
+
return /* @__PURE__ */ jsx8(
|
|
1672
|
+
DateCell,
|
|
1673
|
+
{
|
|
1674
|
+
id: id ? `${id}-date-${date.toString()}` : void 0,
|
|
1675
|
+
testid: testid ? `${testid}-date-${date.toString()}` : void 0,
|
|
1676
|
+
date,
|
|
1677
|
+
isInMonth: !!isInMonth,
|
|
1678
|
+
isToday: !!isToday,
|
|
1679
|
+
isSelected: !!isSelected,
|
|
1680
|
+
inRange: !!inRange,
|
|
1681
|
+
isDisabled: !!isDisabled,
|
|
1682
|
+
onClick: () => handleDayClick(date),
|
|
1683
|
+
onMouseEnter: () => setHoveredDate(date),
|
|
1684
|
+
onMouseLeave: () => setHoveredDate(void 0),
|
|
1685
|
+
isRangeStart: !!isRangeStart,
|
|
1686
|
+
isRangeEnd: !!isRangeEnd,
|
|
1687
|
+
isRangeDisabled: mode === "single" && disableRange,
|
|
1688
|
+
cellPadding: componentPadding
|
|
1689
|
+
},
|
|
1690
|
+
i
|
|
1691
|
+
);
|
|
1692
|
+
}) })
|
|
1693
|
+
]
|
|
1694
|
+
}
|
|
1695
|
+
),
|
|
1696
|
+
mode === "double" && idx === 0 && /* @__PURE__ */ jsx8(
|
|
1697
|
+
"div",
|
|
1698
|
+
{
|
|
1699
|
+
className: clsx5(
|
|
1700
|
+
"self-stretch bg-border-primary-normal rounded-base",
|
|
1701
|
+
// 1px width, full height, matches Figma divider
|
|
1702
|
+
"w-px"
|
|
1703
|
+
)
|
|
1704
|
+
}
|
|
1705
|
+
)
|
|
1706
|
+
] }, month.name + month.year);
|
|
1707
|
+
}
|
|
1708
|
+
var CalendarRange_default = CalendarRange;
|
|
1709
|
+
|
|
1710
|
+
// src/components/DateInput.tsx
|
|
1711
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1712
|
+
var DateInput = (_a) => {
|
|
1713
|
+
var _b = _a, {
|
|
1714
|
+
id,
|
|
1715
|
+
testid,
|
|
1716
|
+
value,
|
|
1717
|
+
onChange,
|
|
1718
|
+
placeholder = "MM/DD/YYYY",
|
|
1719
|
+
disabled,
|
|
1720
|
+
readOnly = false,
|
|
1721
|
+
label
|
|
1722
|
+
} = _b, props = __objRest(_b, [
|
|
1723
|
+
"id",
|
|
1724
|
+
"testid",
|
|
1725
|
+
"value",
|
|
1726
|
+
"onChange",
|
|
1727
|
+
"placeholder",
|
|
1728
|
+
"disabled",
|
|
1729
|
+
"readOnly",
|
|
1730
|
+
"label"
|
|
1731
|
+
]);
|
|
1732
|
+
const [visible, setVisible] = useState5(false);
|
|
1733
|
+
const [inputValue, setInputValue] = useState5("");
|
|
1734
|
+
const [isTyping, setIsTyping] = useState5(false);
|
|
1735
|
+
const popoverRef = useRef3(null);
|
|
1736
|
+
const triggerRef = useRef3(null);
|
|
1737
|
+
const rootRef = useRef3(null);
|
|
1738
|
+
const [calendarPosition, setCalendarPosition] = useState5({
|
|
1739
|
+
top: 0,
|
|
1740
|
+
left: 0,
|
|
1741
|
+
width: 0
|
|
1742
|
+
});
|
|
1743
|
+
const [from, to] = [value, ""];
|
|
1744
|
+
useEffect3(() => {
|
|
1745
|
+
if (!isTyping) {
|
|
1746
|
+
setInputValue(formatDisplayValue(from));
|
|
1747
|
+
}
|
|
1748
|
+
}, [from, isTyping]);
|
|
1749
|
+
useLayoutEffect(() => {
|
|
1750
|
+
if (visible) {
|
|
1751
|
+
updatePosition();
|
|
1752
|
+
}
|
|
1753
|
+
}, [visible]);
|
|
1754
|
+
const updatePosition = () => {
|
|
1755
|
+
if (rootRef.current) {
|
|
1756
|
+
const rect = rootRef.current.getBoundingClientRect();
|
|
1757
|
+
setCalendarPosition({
|
|
1758
|
+
top: rect.bottom + window.scrollY,
|
|
1759
|
+
left: rect.left + window.scrollX,
|
|
1760
|
+
width: rect.width
|
|
1761
|
+
});
|
|
1762
|
+
}
|
|
1763
|
+
};
|
|
1764
|
+
useEffect3(() => {
|
|
1765
|
+
updatePosition();
|
|
1766
|
+
const resizeObserver = new ResizeObserver(updatePosition);
|
|
1767
|
+
if (triggerRef.current) {
|
|
1768
|
+
resizeObserver.observe(triggerRef.current);
|
|
1769
|
+
}
|
|
1770
|
+
window.addEventListener("scroll", updatePosition);
|
|
1771
|
+
return () => {
|
|
1772
|
+
resizeObserver.disconnect();
|
|
1773
|
+
window.removeEventListener("scroll", updatePosition);
|
|
1774
|
+
};
|
|
1775
|
+
}, []);
|
|
1776
|
+
useEffect3(() => {
|
|
1777
|
+
const handleKeyDown2 = (event) => {
|
|
1778
|
+
var _a2;
|
|
1779
|
+
if (event.key === "Escape" && popoverRef.current) {
|
|
1780
|
+
setVisible(false);
|
|
1781
|
+
(_a2 = triggerRef.current) == null ? void 0 : _a2.blur();
|
|
1782
|
+
}
|
|
1783
|
+
};
|
|
1784
|
+
document.addEventListener("keydown", handleKeyDown2);
|
|
1785
|
+
return () => {
|
|
1786
|
+
document.removeEventListener("keydown", handleKeyDown2);
|
|
1787
|
+
};
|
|
1788
|
+
});
|
|
1789
|
+
useEffect3(() => {
|
|
1790
|
+
const handleClickOutside = (event) => {
|
|
1791
|
+
if (popoverRef.current && !popoverRef.current.contains(event.target) && triggerRef.current && !triggerRef.current.contains(event.target)) {
|
|
1792
|
+
setVisible(false);
|
|
1793
|
+
}
|
|
1794
|
+
};
|
|
1795
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
1796
|
+
return () => {
|
|
1797
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
1798
|
+
};
|
|
1799
|
+
}, []);
|
|
1800
|
+
function handleDateChange(fromValue) {
|
|
1801
|
+
onChange(fromValue);
|
|
1802
|
+
setVisible(false);
|
|
1803
|
+
setIsTyping(false);
|
|
1804
|
+
}
|
|
1805
|
+
const handleFocus = () => {
|
|
1806
|
+
if (readOnly) return;
|
|
1807
|
+
setVisible(true);
|
|
1808
|
+
};
|
|
1809
|
+
const handleClick = () => {
|
|
1810
|
+
handleFocus();
|
|
1811
|
+
};
|
|
1812
|
+
const handleInputChange = (event) => {
|
|
1813
|
+
if (readOnly) return;
|
|
1814
|
+
const rawValue = event.target.value;
|
|
1815
|
+
const cursorPosition = event.target.selectionStart || 0;
|
|
1816
|
+
setIsTyping(true);
|
|
1817
|
+
const formattedValue = formatInputValue(rawValue);
|
|
1818
|
+
setInputValue(formattedValue);
|
|
1819
|
+
requestAnimationFrame(() => {
|
|
1820
|
+
if (triggerRef.current) {
|
|
1821
|
+
const newPosition = calculateCursorPosition(
|
|
1822
|
+
rawValue,
|
|
1823
|
+
formattedValue,
|
|
1824
|
+
cursorPosition
|
|
1825
|
+
);
|
|
1826
|
+
triggerRef.current.setSelectionRange(newPosition, newPosition);
|
|
1827
|
+
}
|
|
1828
|
+
});
|
|
1829
|
+
const parsedDate = parseInputDate(formattedValue);
|
|
1830
|
+
if (parsedDate && isValidDate(parsedDate)) {
|
|
1831
|
+
onChange(parsedDate);
|
|
1832
|
+
}
|
|
1833
|
+
};
|
|
1834
|
+
const handleBlur = () => {
|
|
1835
|
+
setIsTyping(false);
|
|
1836
|
+
const parsedDate = parseInputDate(inputValue);
|
|
1837
|
+
if (!parsedDate || !isValidDate(parsedDate)) {
|
|
1838
|
+
setInputValue(formatDisplayValue(from));
|
|
1839
|
+
}
|
|
1840
|
+
};
|
|
1841
|
+
const handleKeyDown = (event) => {
|
|
1842
|
+
if (event.key === "Backspace") {
|
|
1843
|
+
const input = event.target;
|
|
1844
|
+
const cursorPosition = input.selectionStart || 0;
|
|
1845
|
+
const value2 = input.value;
|
|
1846
|
+
if (cursorPosition > 0 && value2[cursorPosition - 1] === "/") {
|
|
1847
|
+
event.preventDefault();
|
|
1848
|
+
const newValue = value2.slice(0, cursorPosition - 2) + value2.slice(cursorPosition);
|
|
1849
|
+
const formattedValue = formatInputValue(newValue);
|
|
1850
|
+
setInputValue(formattedValue);
|
|
1851
|
+
requestAnimationFrame(() => {
|
|
1852
|
+
if (triggerRef.current) {
|
|
1853
|
+
const newPosition = Math.max(0, cursorPosition - 2);
|
|
1854
|
+
triggerRef.current.setSelectionRange(newPosition, newPosition);
|
|
1855
|
+
}
|
|
1856
|
+
});
|
|
1857
|
+
setIsTyping(true);
|
|
1858
|
+
return;
|
|
1859
|
+
}
|
|
1860
|
+
}
|
|
1861
|
+
if (event.key === "Enter") {
|
|
1862
|
+
const parsedDate = parseInputDate(inputValue);
|
|
1863
|
+
if (parsedDate && isValidDate(parsedDate)) {
|
|
1864
|
+
onChange(parsedDate);
|
|
1865
|
+
setVisible(false);
|
|
1866
|
+
setIsTyping(false);
|
|
1867
|
+
}
|
|
1868
|
+
}
|
|
1869
|
+
};
|
|
1870
|
+
return /* @__PURE__ */ jsxs7("div", { className: "relative", children: [
|
|
1871
|
+
/* @__PURE__ */ jsx9(
|
|
1872
|
+
InputBase,
|
|
1873
|
+
__spreadProps(__spreadValues({
|
|
1874
|
+
id,
|
|
1875
|
+
testid,
|
|
1876
|
+
ref: (el) => {
|
|
1877
|
+
triggerRef.current = el;
|
|
1878
|
+
}
|
|
1879
|
+
}, props), {
|
|
1880
|
+
wrapperRef: rootRef,
|
|
1881
|
+
value: inputValue,
|
|
1882
|
+
placeholder,
|
|
1883
|
+
disabled,
|
|
1884
|
+
readOnly,
|
|
1885
|
+
after: /* @__PURE__ */ jsx9(Icon, { name: "calendar_month" }),
|
|
1886
|
+
onFocus: handleFocus,
|
|
1887
|
+
onClick: handleClick,
|
|
1888
|
+
onChange: handleInputChange,
|
|
1889
|
+
onBlur: handleBlur,
|
|
1890
|
+
onKeyDown: handleKeyDown,
|
|
1891
|
+
label,
|
|
1892
|
+
secondaryIconColor: true
|
|
1893
|
+
})
|
|
1894
|
+
),
|
|
1895
|
+
visible && !readOnly && createPortal(
|
|
1896
|
+
/* @__PURE__ */ jsx9(
|
|
1897
|
+
"div",
|
|
1898
|
+
{
|
|
1899
|
+
ref: (el) => {
|
|
1900
|
+
popoverRef.current = el;
|
|
1901
|
+
},
|
|
1902
|
+
className: "absolute z-40 bg-white",
|
|
1903
|
+
style: {
|
|
1904
|
+
top: `${calendarPosition.top + 4}px`,
|
|
1905
|
+
left: `${calendarPosition.left}px`,
|
|
1906
|
+
minWidth: `${calendarPosition.width}px`
|
|
1907
|
+
},
|
|
1908
|
+
children: /* @__PURE__ */ jsx9(
|
|
1909
|
+
CalendarRange,
|
|
1910
|
+
{
|
|
1911
|
+
id: id ? `${id}-calendar` : void 0,
|
|
1912
|
+
testid: testid ? `${testid}-calendar` : void 0,
|
|
1913
|
+
from,
|
|
1914
|
+
to: to || from,
|
|
1915
|
+
onChange: handleDateChange,
|
|
1916
|
+
cardStyle: true,
|
|
1917
|
+
mode: "single",
|
|
1918
|
+
disableRange: true
|
|
1919
|
+
}
|
|
1920
|
+
)
|
|
1921
|
+
}
|
|
1922
|
+
),
|
|
1923
|
+
findDocumentRoot(popoverRef.current)
|
|
1924
|
+
)
|
|
1925
|
+
] });
|
|
1926
|
+
};
|
|
1927
|
+
DateInput.displayName = "DateInput";
|
|
1928
|
+
function formatDisplayValue(from) {
|
|
1929
|
+
if (!from) {
|
|
1930
|
+
return "";
|
|
1931
|
+
}
|
|
1932
|
+
if (!isValidDate(from)) {
|
|
1933
|
+
return "";
|
|
1934
|
+
}
|
|
1935
|
+
return formatDate(from);
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1938
|
+
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
1939
|
+
import { useCallback as useCallback2, useRef as useRef4, useState as useState6 } from "react";
|
|
1940
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1231
1941
|
function ColumnSelector() {
|
|
1232
1942
|
const context = useGridContext();
|
|
1233
|
-
const ref =
|
|
1234
|
-
const [show, setShow] =
|
|
1943
|
+
const ref = useRef4(null);
|
|
1944
|
+
const [show, setShow] = useState6(false);
|
|
1235
1945
|
const {
|
|
1236
1946
|
columns,
|
|
1237
1947
|
id,
|
|
@@ -1248,7 +1958,7 @@ function ColumnSelector() {
|
|
|
1248
1958
|
},
|
|
1249
1959
|
[dispatch]
|
|
1250
1960
|
);
|
|
1251
|
-
return /* @__PURE__ */
|
|
1961
|
+
return /* @__PURE__ */ jsxs8(
|
|
1252
1962
|
"div",
|
|
1253
1963
|
{
|
|
1254
1964
|
id: id ? `${id}-column-selector` : void 0,
|
|
@@ -1256,7 +1966,7 @@ function ColumnSelector() {
|
|
|
1256
1966
|
className: "text-text-secondary-normal border-l border-brand-200 p-mobile-container-padding",
|
|
1257
1967
|
ref,
|
|
1258
1968
|
children: [
|
|
1259
|
-
/* @__PURE__ */
|
|
1969
|
+
/* @__PURE__ */ jsx10(
|
|
1260
1970
|
Button,
|
|
1261
1971
|
{
|
|
1262
1972
|
id: id ? `${id}-button` : void 0,
|
|
@@ -1265,10 +1975,10 @@ function ColumnSelector() {
|
|
|
1265
1975
|
variant: "navigation",
|
|
1266
1976
|
iconOnly: true,
|
|
1267
1977
|
size: 24,
|
|
1268
|
-
leftIcon: /* @__PURE__ */
|
|
1978
|
+
leftIcon: /* @__PURE__ */ jsx10(Icon, { name: "tune" })
|
|
1269
1979
|
}
|
|
1270
1980
|
),
|
|
1271
|
-
/* @__PURE__ */
|
|
1981
|
+
/* @__PURE__ */ jsxs8(
|
|
1272
1982
|
Menu,
|
|
1273
1983
|
{
|
|
1274
1984
|
id: id ? `${id}-menu` : void 0,
|
|
@@ -1279,7 +1989,7 @@ function ColumnSelector() {
|
|
|
1279
1989
|
setShow,
|
|
1280
1990
|
calculateMinMaxHeight: true,
|
|
1281
1991
|
children: [
|
|
1282
|
-
/* @__PURE__ */
|
|
1992
|
+
/* @__PURE__ */ jsx10(
|
|
1283
1993
|
Button,
|
|
1284
1994
|
{
|
|
1285
1995
|
id: id ? `${id}-reset-button` : void 0,
|
|
@@ -1297,11 +2007,11 @@ function ColumnSelector() {
|
|
|
1297
2007
|
return (_a = x.meta) == null ? void 0 : _a.inVisibilityMenu;
|
|
1298
2008
|
}).map((column) => {
|
|
1299
2009
|
var _a, _b, _c;
|
|
1300
|
-
return /* @__PURE__ */
|
|
2010
|
+
return /* @__PURE__ */ jsx10(
|
|
1301
2011
|
MenuOption,
|
|
1302
2012
|
{
|
|
1303
2013
|
testid: testid ? `${testid}-option-${column.id}` : void 0,
|
|
1304
|
-
children: /* @__PURE__ */
|
|
2014
|
+
children: /* @__PURE__ */ jsx10(
|
|
1305
2015
|
Checkbox,
|
|
1306
2016
|
{
|
|
1307
2017
|
id: id ? `${id}-checkbox-${column.id}` : void 0,
|
|
@@ -1331,7 +2041,7 @@ function ColumnSelector() {
|
|
|
1331
2041
|
}
|
|
1332
2042
|
|
|
1333
2043
|
// src/components/MobileDataGrid/MobileDataGridHeader.tsx
|
|
1334
|
-
import { jsx as
|
|
2044
|
+
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1335
2045
|
function MobileDataGridHeader({
|
|
1336
2046
|
header: Header,
|
|
1337
2047
|
enableColumnSelector,
|
|
@@ -1349,15 +2059,15 @@ function MobileDataGridHeader({
|
|
|
1349
2059
|
handleRowSelectAll
|
|
1350
2060
|
} = ctx;
|
|
1351
2061
|
if (typeof Header === "undefined" && !primaryKey) return null;
|
|
1352
|
-
if (typeof Header === "function") return /* @__PURE__ */
|
|
2062
|
+
if (typeof Header === "function") return /* @__PURE__ */ jsx11(Header, __spreadValues({}, ctx));
|
|
1353
2063
|
if (typeof Header === "string" || primaryKey)
|
|
1354
|
-
return /* @__PURE__ */
|
|
2064
|
+
return /* @__PURE__ */ jsx11(
|
|
1355
2065
|
"div",
|
|
1356
2066
|
{
|
|
1357
2067
|
id: id ? `${id}-header` : void 0,
|
|
1358
2068
|
"data-testid": testid ? `${testid}-header` : void 0,
|
|
1359
2069
|
className: "sticky top-0",
|
|
1360
|
-
children: /* @__PURE__ */
|
|
2070
|
+
children: /* @__PURE__ */ jsx11(Theme, { theme: "brand", children: /* @__PURE__ */ jsxs9(
|
|
1361
2071
|
Stack,
|
|
1362
2072
|
{
|
|
1363
2073
|
horizontal: true,
|
|
@@ -1366,7 +2076,7 @@ function MobileDataGridHeader({
|
|
|
1366
2076
|
justify: "between",
|
|
1367
2077
|
backgroundColor: "background-primary-normal",
|
|
1368
2078
|
children: [
|
|
1369
|
-
enableRowSelection && /* @__PURE__ */
|
|
2079
|
+
enableRowSelection && /* @__PURE__ */ jsx11("div", { className: "p-mobile-component-padding border-r border-brand-200 max-w-fit h-full", children: /* @__PURE__ */ jsx11(
|
|
1370
2080
|
Checkbox,
|
|
1371
2081
|
{
|
|
1372
2082
|
id: id ? `${id}-select-all-checkbox` : void 0,
|
|
@@ -1376,7 +2086,7 @@ function MobileDataGridHeader({
|
|
|
1376
2086
|
onChange: handleRowSelectAll
|
|
1377
2087
|
}
|
|
1378
2088
|
) }),
|
|
1379
|
-
/* @__PURE__ */
|
|
2089
|
+
/* @__PURE__ */ jsx11(
|
|
1380
2090
|
Stack,
|
|
1381
2091
|
{
|
|
1382
2092
|
horizontal: true,
|
|
@@ -1384,10 +2094,10 @@ function MobileDataGridHeader({
|
|
|
1384
2094
|
items: "center",
|
|
1385
2095
|
sizing: "component",
|
|
1386
2096
|
padding: true,
|
|
1387
|
-
children: /* @__PURE__ */
|
|
2097
|
+
children: /* @__PURE__ */ jsx11(Heading3, { as: "span", color: "text-primary-normal", children: typeof Header === "string" ? Header : (_b = (_a = columns.find((col) => col.id === primaryKey)) == null ? void 0 : _a.header) == null ? void 0 : _b.toString() })
|
|
1388
2098
|
}
|
|
1389
2099
|
),
|
|
1390
|
-
enableColumnSelector && /* @__PURE__ */
|
|
2100
|
+
enableColumnSelector && /* @__PURE__ */ jsx11(ColumnSelector, {})
|
|
1391
2101
|
]
|
|
1392
2102
|
}
|
|
1393
2103
|
) })
|
|
@@ -1396,7 +2106,7 @@ function MobileDataGridHeader({
|
|
|
1396
2106
|
}
|
|
1397
2107
|
|
|
1398
2108
|
// src/components/MobileDataGrid/index.tsx
|
|
1399
|
-
import { jsx as
|
|
2109
|
+
import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1400
2110
|
function MobileDataGrid(props) {
|
|
1401
2111
|
const {
|
|
1402
2112
|
columns,
|
|
@@ -1418,7 +2128,7 @@ function MobileDataGrid(props) {
|
|
|
1418
2128
|
rowActions,
|
|
1419
2129
|
rounded
|
|
1420
2130
|
} = props;
|
|
1421
|
-
return /* @__PURE__ */
|
|
2131
|
+
return /* @__PURE__ */ jsxs10(
|
|
1422
2132
|
GridContextProvider,
|
|
1423
2133
|
{
|
|
1424
2134
|
initialColumns: columns,
|
|
@@ -1430,7 +2140,7 @@ function MobileDataGrid(props) {
|
|
|
1430
2140
|
numberOfColumnsToShow,
|
|
1431
2141
|
primaryKey,
|
|
1432
2142
|
children: [
|
|
1433
|
-
/* @__PURE__ */
|
|
2143
|
+
/* @__PURE__ */ jsxs10(
|
|
1434
2144
|
Stack,
|
|
1435
2145
|
{
|
|
1436
2146
|
height: "full",
|
|
@@ -1438,7 +2148,7 @@ function MobileDataGrid(props) {
|
|
|
1438
2148
|
overflowX: "hidden",
|
|
1439
2149
|
overflowY: "hidden",
|
|
1440
2150
|
children: [
|
|
1441
|
-
!hideHeader && /* @__PURE__ */
|
|
2151
|
+
!hideHeader && /* @__PURE__ */ jsx12(
|
|
1442
2152
|
MobileDataGridHeader,
|
|
1443
2153
|
{
|
|
1444
2154
|
header,
|
|
@@ -1446,7 +2156,7 @@ function MobileDataGrid(props) {
|
|
|
1446
2156
|
enableRowSelection
|
|
1447
2157
|
}
|
|
1448
2158
|
),
|
|
1449
|
-
/* @__PURE__ */
|
|
2159
|
+
/* @__PURE__ */ jsx12(
|
|
1450
2160
|
ColumnList,
|
|
1451
2161
|
{
|
|
1452
2162
|
withBorder,
|
|
@@ -1460,23 +2170,23 @@ function MobileDataGrid(props) {
|
|
|
1460
2170
|
]
|
|
1461
2171
|
}
|
|
1462
2172
|
),
|
|
1463
|
-
/* @__PURE__ */
|
|
2173
|
+
/* @__PURE__ */ jsx12(RowDetailModalProvider, {})
|
|
1464
2174
|
]
|
|
1465
2175
|
}
|
|
1466
2176
|
);
|
|
1467
2177
|
}
|
|
1468
2178
|
|
|
1469
2179
|
// src/components/DataGrid/utils.tsx
|
|
1470
|
-
import { jsx as
|
|
2180
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1471
2181
|
function getSortIcon(sort, nextSort = false) {
|
|
1472
|
-
const iconClassName =
|
|
2182
|
+
const iconClassName = clsx6(
|
|
1473
2183
|
"text-icon-on-action-primary-normal",
|
|
1474
2184
|
nextSort && "hidden group-hover:block"
|
|
1475
2185
|
);
|
|
1476
2186
|
if (sort === "asc")
|
|
1477
|
-
return /* @__PURE__ */
|
|
2187
|
+
return /* @__PURE__ */ jsx13(Icon, { size: 16, className: iconClassName, name: "arrow_upward" });
|
|
1478
2188
|
if (sort === "desc")
|
|
1479
|
-
return /* @__PURE__ */
|
|
2189
|
+
return /* @__PURE__ */ jsx13(Icon, { size: 16, className: iconClassName, name: "arrow_downward" });
|
|
1480
2190
|
return null;
|
|
1481
2191
|
}
|
|
1482
2192
|
|
|
@@ -1490,7 +2200,11 @@ export {
|
|
|
1490
2200
|
PinnedColumns,
|
|
1491
2201
|
DataGrid,
|
|
1492
2202
|
DataGrid_default,
|
|
2203
|
+
DateInput,
|
|
1493
2204
|
ColumnSelector,
|
|
1494
2205
|
MobileDataGridHeader,
|
|
1495
|
-
MobileDataGrid
|
|
2206
|
+
MobileDataGrid,
|
|
2207
|
+
isWeekend,
|
|
2208
|
+
CalendarRange,
|
|
2209
|
+
CalendarRange_default
|
|
1496
2210
|
};
|