@bwp-web/components 1.3.1 → 1.3.2
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/BiampTable/BiampTable.d.ts +5 -1
- package/dist/BiampTable/BiampTable.d.ts.map +1 -1
- package/dist/BiampTable/BiampTableExpandGuidelines.d.ts +5 -0
- package/dist/BiampTable/BiampTableExpandGuidelines.d.ts.map +1 -0
- package/dist/BiampTable/BiampTableRow.d.ts +28 -0
- package/dist/BiampTable/BiampTableRow.d.ts.map +1 -0
- package/dist/BiampTable/cellSx.d.ts +27 -0
- package/dist/BiampTable/cellSx.d.ts.map +1 -0
- package/dist/index.cjs +545 -367
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +462 -281
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -892,27 +892,24 @@ function BiampLayout({
|
|
|
892
892
|
|
|
893
893
|
// src/BiampTable/BiampTable.tsx
|
|
894
894
|
import {
|
|
895
|
-
Box as
|
|
896
|
-
Checkbox,
|
|
897
|
-
IconButton,
|
|
895
|
+
Box as Box6,
|
|
896
|
+
Checkbox as Checkbox2,
|
|
898
897
|
Table as MuiTable,
|
|
899
898
|
TableBody,
|
|
900
|
-
TableCell,
|
|
899
|
+
TableCell as TableCell2,
|
|
901
900
|
TableContainer,
|
|
902
901
|
TableHead,
|
|
903
|
-
TableRow,
|
|
902
|
+
TableRow as TableRow2,
|
|
904
903
|
TableSortLabel
|
|
905
904
|
} from "@mui/material";
|
|
906
905
|
import {
|
|
907
|
-
ChevronDownIcon,
|
|
908
|
-
ChevronRightIcon,
|
|
909
906
|
DropdownChevronDownIcon,
|
|
910
907
|
DropdownChevronUpIcon
|
|
911
908
|
} from "@bwp-web/assets";
|
|
912
909
|
import {
|
|
913
|
-
flexRender
|
|
910
|
+
flexRender as flexRender2
|
|
914
911
|
} from "@tanstack/react-table";
|
|
915
|
-
import
|
|
912
|
+
import { useEffect as useEffect2, useRef as useRef3 } from "react";
|
|
916
913
|
|
|
917
914
|
// src/BiampTable/BiampTableEmptyState.tsx
|
|
918
915
|
import { NoResultsIcon } from "@bwp-web/assets";
|
|
@@ -968,6 +965,18 @@ function BiampTableErrorState({
|
|
|
968
965
|
return /* @__PURE__ */ jsx6(BiampTableStatusMessage, { role: "alert", icon, title, ...rest });
|
|
969
966
|
}
|
|
970
967
|
|
|
968
|
+
// src/BiampTable/BiampTableRow.tsx
|
|
969
|
+
import {
|
|
970
|
+
Box as Box5,
|
|
971
|
+
Checkbox,
|
|
972
|
+
IconButton,
|
|
973
|
+
TableCell,
|
|
974
|
+
TableRow
|
|
975
|
+
} from "@mui/material";
|
|
976
|
+
import { ChevronDownIcon, ChevronRightIcon } from "@bwp-web/assets";
|
|
977
|
+
import { flexRender } from "@tanstack/react-table";
|
|
978
|
+
import React2 from "react";
|
|
979
|
+
|
|
971
980
|
// src/BiampTable/BiampTableTruncatedCell.tsx
|
|
972
981
|
import { Box as Box3, Tooltip } from "@mui/material";
|
|
973
982
|
import { useCallback, useRef, useState } from "react";
|
|
@@ -1014,37 +1023,6 @@ function BiampTableTruncatedCell({
|
|
|
1014
1023
|
);
|
|
1015
1024
|
}
|
|
1016
1025
|
|
|
1017
|
-
// src/BiampTable/useLoadingDelay.ts
|
|
1018
|
-
import { useEffect, useRef as useRef2, useState as useState2 } from "react";
|
|
1019
|
-
function useLoadingDelay(loading, { delay = 150, minDuration = 500 } = {}) {
|
|
1020
|
-
const [status, setStatus] = useState2("idle");
|
|
1021
|
-
const timeoutRef = useRef2(null);
|
|
1022
|
-
function clearPending() {
|
|
1023
|
-
if (timeoutRef.current !== null) {
|
|
1024
|
-
clearTimeout(timeoutRef.current);
|
|
1025
|
-
timeoutRef.current = null;
|
|
1026
|
-
}
|
|
1027
|
-
}
|
|
1028
|
-
useEffect(() => {
|
|
1029
|
-
if (loading && status === "idle") {
|
|
1030
|
-
clearPending();
|
|
1031
|
-
timeoutRef.current = setTimeout(() => {
|
|
1032
|
-
timeoutRef.current = setTimeout(() => {
|
|
1033
|
-
setStatus("ending");
|
|
1034
|
-
}, minDuration);
|
|
1035
|
-
setStatus("loading");
|
|
1036
|
-
}, delay);
|
|
1037
|
-
setStatus("delaying");
|
|
1038
|
-
}
|
|
1039
|
-
if (!loading && status !== "loading") {
|
|
1040
|
-
clearPending();
|
|
1041
|
-
setStatus("idle");
|
|
1042
|
-
}
|
|
1043
|
-
}, [loading, delay, minDuration, status]);
|
|
1044
|
-
useEffect(() => clearPending, []);
|
|
1045
|
-
return status === "loading" || status === "ending";
|
|
1046
|
-
}
|
|
1047
|
-
|
|
1048
1026
|
// src/BiampTable/slotProps.ts
|
|
1049
1027
|
function resolveSlot(slot, ctx) {
|
|
1050
1028
|
if (!slot) return void 0;
|
|
@@ -1054,19 +1032,7 @@ function mergeSx(...inputs) {
|
|
|
1054
1032
|
return inputs.filter((v) => Boolean(v)).flatMap((v) => Array.isArray(v) ? v : [v]);
|
|
1055
1033
|
}
|
|
1056
1034
|
|
|
1057
|
-
// src/BiampTable/
|
|
1058
|
-
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1059
|
-
var overlaySx = {
|
|
1060
|
-
position: "absolute",
|
|
1061
|
-
top: 0,
|
|
1062
|
-
left: 0,
|
|
1063
|
-
right: 0,
|
|
1064
|
-
bottom: 0,
|
|
1065
|
-
display: "flex",
|
|
1066
|
-
alignItems: "center",
|
|
1067
|
-
justifyContent: "center",
|
|
1068
|
-
pointerEvents: "none"
|
|
1069
|
-
};
|
|
1035
|
+
// src/BiampTable/cellSx.ts
|
|
1070
1036
|
var stickyHoverBg = {
|
|
1071
1037
|
".MuiTableRow-hover:hover > &, .Mui-selected > &": {
|
|
1072
1038
|
bgcolor: ({ palette }) => palette.mode === "dark" ? palette.grey[800] : palette.grey[100]
|
|
@@ -1092,6 +1058,126 @@ function cellSx(sticky, minWidth, zIndex) {
|
|
|
1092
1058
|
"&:has([data-truncate])": { maxWidth: mw, whiteSpace: "normal" }
|
|
1093
1059
|
};
|
|
1094
1060
|
}
|
|
1061
|
+
|
|
1062
|
+
// src/BiampTable/BiampTableExpandGuidelines.tsx
|
|
1063
|
+
import { Box as Box4 } from "@mui/material";
|
|
1064
|
+
import { Fragment, jsx as jsx8 } from "react/jsx-runtime";
|
|
1065
|
+
var guidelineIndent = 28;
|
|
1066
|
+
var guidelineCellPaddingLeft = 12;
|
|
1067
|
+
var guidelineLineOffsetFromParentText = 4;
|
|
1068
|
+
var guidelineElbowGapToChildText = 12;
|
|
1069
|
+
var guidelineFirstChildTopExtension = 12;
|
|
1070
|
+
var guidelineColor = ({ palette }) => palette.dividers.secondary;
|
|
1071
|
+
var guidelineStroke = "0.6px";
|
|
1072
|
+
function isLastChildOfParent(row) {
|
|
1073
|
+
const parent = row.getParentRow();
|
|
1074
|
+
if (!parent) return false;
|
|
1075
|
+
const siblings = parent.subRows;
|
|
1076
|
+
return siblings[siblings.length - 1]?.id === row.id;
|
|
1077
|
+
}
|
|
1078
|
+
function isFirstChildOfParent(row) {
|
|
1079
|
+
const parent = row.getParentRow();
|
|
1080
|
+
if (!parent) return false;
|
|
1081
|
+
return parent.subRows[0]?.id === row.id;
|
|
1082
|
+
}
|
|
1083
|
+
function getAncestorAtDepth(row, targetDepth) {
|
|
1084
|
+
let current = row;
|
|
1085
|
+
while (current && current.depth > targetDepth) {
|
|
1086
|
+
current = current.getParentRow();
|
|
1087
|
+
}
|
|
1088
|
+
return current && current.depth === targetDepth ? current : void 0;
|
|
1089
|
+
}
|
|
1090
|
+
function ExpandGuidelines({ row }) {
|
|
1091
|
+
const verticalX = (k) => guidelineCellPaddingLeft + (k - 1) * guidelineIndent + guidelineLineOffsetFromParentText;
|
|
1092
|
+
const elbowEnd = guidelineCellPaddingLeft + row.depth * guidelineIndent - guidelineElbowGapToChildText;
|
|
1093
|
+
const lines = [];
|
|
1094
|
+
for (let k = 1; k < row.depth; k++) {
|
|
1095
|
+
const ancestor = getAncestorAtDepth(row, k);
|
|
1096
|
+
if (!ancestor || isLastChildOfParent(ancestor)) continue;
|
|
1097
|
+
lines.push(
|
|
1098
|
+
/* @__PURE__ */ jsx8(
|
|
1099
|
+
Box4,
|
|
1100
|
+
{
|
|
1101
|
+
"aria-hidden": true,
|
|
1102
|
+
sx: {
|
|
1103
|
+
position: "absolute",
|
|
1104
|
+
left: `${verticalX(k)}px`,
|
|
1105
|
+
top: 0,
|
|
1106
|
+
bottom: 0,
|
|
1107
|
+
width: guidelineStroke,
|
|
1108
|
+
bgcolor: guidelineColor,
|
|
1109
|
+
pointerEvents: "none"
|
|
1110
|
+
}
|
|
1111
|
+
},
|
|
1112
|
+
`v-${k}`
|
|
1113
|
+
)
|
|
1114
|
+
);
|
|
1115
|
+
}
|
|
1116
|
+
const elbowX = verticalX(row.depth);
|
|
1117
|
+
const rowIsLast = isLastChildOfParent(row);
|
|
1118
|
+
const rowIsFirst = isFirstChildOfParent(row);
|
|
1119
|
+
const elbowTopOffset = rowIsFirst ? -guidelineFirstChildTopExtension : 0;
|
|
1120
|
+
lines.push(
|
|
1121
|
+
/* @__PURE__ */ jsx8(
|
|
1122
|
+
Box4,
|
|
1123
|
+
{
|
|
1124
|
+
"aria-hidden": true,
|
|
1125
|
+
sx: {
|
|
1126
|
+
position: "absolute",
|
|
1127
|
+
left: `${elbowX}px`,
|
|
1128
|
+
top: `${elbowTopOffset}px`,
|
|
1129
|
+
height: `calc(50% - ${elbowTopOffset}px)`,
|
|
1130
|
+
width: guidelineStroke,
|
|
1131
|
+
bgcolor: guidelineColor,
|
|
1132
|
+
pointerEvents: "none"
|
|
1133
|
+
}
|
|
1134
|
+
},
|
|
1135
|
+
"v-elbow-top"
|
|
1136
|
+
)
|
|
1137
|
+
);
|
|
1138
|
+
if (!rowIsLast) {
|
|
1139
|
+
lines.push(
|
|
1140
|
+
/* @__PURE__ */ jsx8(
|
|
1141
|
+
Box4,
|
|
1142
|
+
{
|
|
1143
|
+
"aria-hidden": true,
|
|
1144
|
+
sx: {
|
|
1145
|
+
position: "absolute",
|
|
1146
|
+
left: `${elbowX}px`,
|
|
1147
|
+
top: "50%",
|
|
1148
|
+
bottom: 0,
|
|
1149
|
+
width: guidelineStroke,
|
|
1150
|
+
bgcolor: guidelineColor,
|
|
1151
|
+
pointerEvents: "none"
|
|
1152
|
+
}
|
|
1153
|
+
},
|
|
1154
|
+
"v-elbow-bottom"
|
|
1155
|
+
)
|
|
1156
|
+
);
|
|
1157
|
+
}
|
|
1158
|
+
lines.push(
|
|
1159
|
+
/* @__PURE__ */ jsx8(
|
|
1160
|
+
Box4,
|
|
1161
|
+
{
|
|
1162
|
+
"aria-hidden": true,
|
|
1163
|
+
sx: {
|
|
1164
|
+
position: "absolute",
|
|
1165
|
+
left: `${elbowX}px`,
|
|
1166
|
+
top: "50%",
|
|
1167
|
+
width: `${elbowEnd - elbowX}px`,
|
|
1168
|
+
height: guidelineStroke,
|
|
1169
|
+
bgcolor: guidelineColor,
|
|
1170
|
+
pointerEvents: "none"
|
|
1171
|
+
}
|
|
1172
|
+
},
|
|
1173
|
+
"h-elbow"
|
|
1174
|
+
)
|
|
1175
|
+
);
|
|
1176
|
+
return /* @__PURE__ */ jsx8(Fragment, { children: lines });
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
// src/BiampTable/BiampTableRow.tsx
|
|
1180
|
+
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1095
1181
|
var rowCursorPointerSx = { cursor: "pointer" };
|
|
1096
1182
|
var selectionCellSx = {
|
|
1097
1183
|
position: "sticky",
|
|
@@ -1107,13 +1193,80 @@ var expandCellBaseSx = {
|
|
|
1107
1193
|
gap: "2px"
|
|
1108
1194
|
};
|
|
1109
1195
|
var expandPlaceholderSx = { width: 28 };
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
}
|
|
1116
|
-
|
|
1196
|
+
function ExpandToggle({
|
|
1197
|
+
row,
|
|
1198
|
+
isExpanded,
|
|
1199
|
+
hasExpandableRows,
|
|
1200
|
+
rowLabel
|
|
1201
|
+
}) {
|
|
1202
|
+
if (row.getCanExpand()) {
|
|
1203
|
+
return /* @__PURE__ */ jsx9(
|
|
1204
|
+
IconButton,
|
|
1205
|
+
{
|
|
1206
|
+
variant: "none",
|
|
1207
|
+
onClick: (e) => {
|
|
1208
|
+
e.stopPropagation();
|
|
1209
|
+
row.toggleExpanded();
|
|
1210
|
+
},
|
|
1211
|
+
"aria-label": isExpanded ? `Collapse ${rowLabel}` : `Expand ${rowLabel}`,
|
|
1212
|
+
"aria-expanded": isExpanded,
|
|
1213
|
+
children: isExpanded ? /* @__PURE__ */ jsx9(
|
|
1214
|
+
ChevronDownIcon,
|
|
1215
|
+
{
|
|
1216
|
+
variant: "xs",
|
|
1217
|
+
sx: { color: ({ palette }) => palette.text.secondary }
|
|
1218
|
+
}
|
|
1219
|
+
) : /* @__PURE__ */ jsx9(
|
|
1220
|
+
ChevronRightIcon,
|
|
1221
|
+
{
|
|
1222
|
+
variant: "xs",
|
|
1223
|
+
sx: { color: ({ palette }) => palette.text.secondary }
|
|
1224
|
+
}
|
|
1225
|
+
)
|
|
1226
|
+
}
|
|
1227
|
+
);
|
|
1228
|
+
}
|
|
1229
|
+
if (hasExpandableRows) return /* @__PURE__ */ jsx9(Box5, { sx: expandPlaceholderSx });
|
|
1230
|
+
return null;
|
|
1231
|
+
}
|
|
1232
|
+
function renderCellContent({
|
|
1233
|
+
cell,
|
|
1234
|
+
row,
|
|
1235
|
+
isExpandCell,
|
|
1236
|
+
alwaysExpanded,
|
|
1237
|
+
isExpanded,
|
|
1238
|
+
hasExpandableRows,
|
|
1239
|
+
getRowLabel
|
|
1240
|
+
}) {
|
|
1241
|
+
const sticky = cell.column.columnDef.meta?.sticky;
|
|
1242
|
+
const content = flexRender(cell.column.columnDef.cell, cell.getContext());
|
|
1243
|
+
if (sticky) return content;
|
|
1244
|
+
const truncate = cell.column.columnDef.meta?.truncate ?? true;
|
|
1245
|
+
const truncated = truncate ? /* @__PURE__ */ jsx9(BiampTableTruncatedCell, { children: content }) : content;
|
|
1246
|
+
if (!isExpandCell) return truncated;
|
|
1247
|
+
if (alwaysExpanded) {
|
|
1248
|
+
return row.depth > 0 ? /* @__PURE__ */ jsx9(Box5, { sx: { pl: `${row.depth * 28}px` }, children: truncated }) : truncated;
|
|
1249
|
+
}
|
|
1250
|
+
const rowLabel = getRowLabel ? getRowLabel(row.original) : `row ${row.index + 1}`;
|
|
1251
|
+
return /* @__PURE__ */ jsxs5(
|
|
1252
|
+
Box5,
|
|
1253
|
+
{
|
|
1254
|
+
sx: row.depth > 0 ? { ...expandCellBaseSx, pl: `${row.depth * 12}px` } : expandCellBaseSx,
|
|
1255
|
+
children: [
|
|
1256
|
+
/* @__PURE__ */ jsx9(
|
|
1257
|
+
ExpandToggle,
|
|
1258
|
+
{
|
|
1259
|
+
row,
|
|
1260
|
+
isExpanded,
|
|
1261
|
+
hasExpandableRows,
|
|
1262
|
+
rowLabel
|
|
1263
|
+
}
|
|
1264
|
+
),
|
|
1265
|
+
truncated
|
|
1266
|
+
]
|
|
1267
|
+
}
|
|
1268
|
+
);
|
|
1269
|
+
}
|
|
1117
1270
|
function BiampTableRowInner({
|
|
1118
1271
|
row,
|
|
1119
1272
|
isExpanded,
|
|
@@ -1122,7 +1275,9 @@ function BiampTableRowInner({
|
|
|
1122
1275
|
isRowClickable,
|
|
1123
1276
|
enableRowSelection,
|
|
1124
1277
|
enableExpanding,
|
|
1278
|
+
alwaysExpanded,
|
|
1125
1279
|
selectChildrenWithParent,
|
|
1280
|
+
showExpandGuidelines,
|
|
1126
1281
|
getRowLabel,
|
|
1127
1282
|
hasExpandableRows,
|
|
1128
1283
|
customColor,
|
|
@@ -1162,7 +1317,7 @@ function BiampTableRowInner({
|
|
|
1162
1317
|
userRowOnKeyDown?.(e);
|
|
1163
1318
|
} : userRowOnKeyDown,
|
|
1164
1319
|
children: [
|
|
1165
|
-
enableRowSelection && /* @__PURE__ */
|
|
1320
|
+
enableRowSelection && /* @__PURE__ */ jsx9(
|
|
1166
1321
|
TableCell,
|
|
1167
1322
|
{
|
|
1168
1323
|
padding: "checkbox",
|
|
@@ -1170,7 +1325,7 @@ function BiampTableRowInner({
|
|
|
1170
1325
|
selectionCellSx,
|
|
1171
1326
|
customColor ? { backgroundColor: customColor } : void 0
|
|
1172
1327
|
),
|
|
1173
|
-
children: /* @__PURE__ */
|
|
1328
|
+
children: /* @__PURE__ */ jsx9(
|
|
1174
1329
|
Checkbox,
|
|
1175
1330
|
{
|
|
1176
1331
|
checked: isSelected,
|
|
@@ -1192,68 +1347,33 @@ function BiampTableRowInner({
|
|
|
1192
1347
|
row.getVisibleCells().map((cell, cellIndex, cells) => {
|
|
1193
1348
|
const sticky = cell.column.columnDef.meta?.sticky;
|
|
1194
1349
|
const isExpandCell = enableExpanding && !sticky && cellIndex === cells.findIndex((c) => !c.column.columnDef.meta?.sticky);
|
|
1195
|
-
const
|
|
1196
|
-
cell.column.columnDef.cell,
|
|
1197
|
-
cell.getContext()
|
|
1198
|
-
);
|
|
1350
|
+
const showGuidelinesOnCell = isExpandCell && showExpandGuidelines && alwaysExpanded && row.depth > 0;
|
|
1199
1351
|
const resolvedCell = resolveSlot(cellSlotProps, { cell });
|
|
1200
1352
|
const { sx: userCellSx, ...restCellProps } = resolvedCell ?? {};
|
|
1201
|
-
return /* @__PURE__ */
|
|
1353
|
+
return /* @__PURE__ */ jsxs5(
|
|
1202
1354
|
TableCell,
|
|
1203
1355
|
{
|
|
1204
1356
|
...restCellProps,
|
|
1205
1357
|
"data-sticky": sticky || void 0,
|
|
1206
1358
|
sx: mergeSx(
|
|
1207
1359
|
cellSx(sticky, cell.column.columnDef.meta?.minWidth, 2),
|
|
1208
|
-
{ pl: isExpandCell ? "6px" : "12px" },
|
|
1360
|
+
{ pl: isExpandCell && !alwaysExpanded ? "6px" : "12px" },
|
|
1361
|
+
showGuidelinesOnCell ? { position: "relative" } : void 0,
|
|
1209
1362
|
sticky && customColor ? { backgroundColor: customColor } : void 0,
|
|
1210
1363
|
userCellSx
|
|
1211
1364
|
),
|
|
1212
|
-
children:
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
IconButton,
|
|
1225
|
-
{
|
|
1226
|
-
variant: "none",
|
|
1227
|
-
onClick: (e) => {
|
|
1228
|
-
e.stopPropagation();
|
|
1229
|
-
row.toggleExpanded();
|
|
1230
|
-
},
|
|
1231
|
-
"aria-label": isExpanded ? `Collapse ${rowLabel}` : `Expand ${rowLabel}`,
|
|
1232
|
-
"aria-expanded": isExpanded,
|
|
1233
|
-
children: isExpanded ? /* @__PURE__ */ jsx8(
|
|
1234
|
-
ChevronDownIcon,
|
|
1235
|
-
{
|
|
1236
|
-
variant: "xs",
|
|
1237
|
-
sx: {
|
|
1238
|
-
color: ({ palette }) => palette.text.secondary
|
|
1239
|
-
}
|
|
1240
|
-
}
|
|
1241
|
-
) : /* @__PURE__ */ jsx8(
|
|
1242
|
-
ChevronRightIcon,
|
|
1243
|
-
{
|
|
1244
|
-
variant: "xs",
|
|
1245
|
-
sx: {
|
|
1246
|
-
color: ({ palette }) => palette.text.secondary
|
|
1247
|
-
}
|
|
1248
|
-
}
|
|
1249
|
-
)
|
|
1250
|
-
}
|
|
1251
|
-
) : hasExpandableRows ? /* @__PURE__ */ jsx8(Box4, { sx: expandPlaceholderSx }) : null,
|
|
1252
|
-
truncated
|
|
1253
|
-
]
|
|
1254
|
-
}
|
|
1255
|
-
);
|
|
1256
|
-
})()
|
|
1365
|
+
children: [
|
|
1366
|
+
showGuidelinesOnCell && /* @__PURE__ */ jsx9(ExpandGuidelines, { row }),
|
|
1367
|
+
renderCellContent({
|
|
1368
|
+
cell,
|
|
1369
|
+
row,
|
|
1370
|
+
isExpandCell,
|
|
1371
|
+
alwaysExpanded,
|
|
1372
|
+
isExpanded,
|
|
1373
|
+
hasExpandableRows,
|
|
1374
|
+
getRowLabel
|
|
1375
|
+
})
|
|
1376
|
+
]
|
|
1257
1377
|
},
|
|
1258
1378
|
cell.id
|
|
1259
1379
|
);
|
|
@@ -1264,12 +1384,64 @@ function BiampTableRowInner({
|
|
|
1264
1384
|
);
|
|
1265
1385
|
}
|
|
1266
1386
|
function biampTableRowPropsAreEqual(prev, next) {
|
|
1267
|
-
return prev.row.id === next.row.id && prev.row.original === next.row.original && prev.isSelected === next.isSelected && prev.isExpanded === next.isExpanded && prev.row.getVisibleCells().length === next.row.getVisibleCells().length && prev.enableRowSelection === next.enableRowSelection && prev.enableExpanding === next.enableExpanding && prev.hasExpandableRows === next.hasExpandableRows && prev.selectChildrenWithParent === next.selectChildrenWithParent && prev.onRowClick === next.onRowClick && prev.isRowClickable === next.isRowClickable && prev.getRowLabel === next.getRowLabel && prev.customColor === next.customColor && prev.rowSlotProps === next.rowSlotProps && prev.cellSlotProps === next.cellSlotProps;
|
|
1387
|
+
return prev.row.id === next.row.id && prev.row.original === next.row.original && prev.isSelected === next.isSelected && prev.isExpanded === next.isExpanded && prev.row.getVisibleCells().length === next.row.getVisibleCells().length && prev.enableRowSelection === next.enableRowSelection && prev.enableExpanding === next.enableExpanding && prev.alwaysExpanded === next.alwaysExpanded && prev.hasExpandableRows === next.hasExpandableRows && prev.selectChildrenWithParent === next.selectChildrenWithParent && prev.showExpandGuidelines === next.showExpandGuidelines && prev.onRowClick === next.onRowClick && prev.isRowClickable === next.isRowClickable && prev.getRowLabel === next.getRowLabel && prev.customColor === next.customColor && prev.rowSlotProps === next.rowSlotProps && prev.cellSlotProps === next.cellSlotProps;
|
|
1268
1388
|
}
|
|
1269
1389
|
var BiampTableRow = React2.memo(
|
|
1270
1390
|
BiampTableRowInner,
|
|
1271
1391
|
biampTableRowPropsAreEqual
|
|
1272
1392
|
);
|
|
1393
|
+
|
|
1394
|
+
// src/BiampTable/useLoadingDelay.ts
|
|
1395
|
+
import { useEffect, useRef as useRef2, useState as useState2 } from "react";
|
|
1396
|
+
function useLoadingDelay(loading, { delay = 150, minDuration = 500 } = {}) {
|
|
1397
|
+
const [status, setStatus] = useState2("idle");
|
|
1398
|
+
const timeoutRef = useRef2(null);
|
|
1399
|
+
function clearPending() {
|
|
1400
|
+
if (timeoutRef.current !== null) {
|
|
1401
|
+
clearTimeout(timeoutRef.current);
|
|
1402
|
+
timeoutRef.current = null;
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1405
|
+
useEffect(() => {
|
|
1406
|
+
if (loading && status === "idle") {
|
|
1407
|
+
clearPending();
|
|
1408
|
+
timeoutRef.current = setTimeout(() => {
|
|
1409
|
+
timeoutRef.current = setTimeout(() => {
|
|
1410
|
+
setStatus("ending");
|
|
1411
|
+
}, minDuration);
|
|
1412
|
+
setStatus("loading");
|
|
1413
|
+
}, delay);
|
|
1414
|
+
setStatus("delaying");
|
|
1415
|
+
}
|
|
1416
|
+
if (!loading && status !== "loading") {
|
|
1417
|
+
clearPending();
|
|
1418
|
+
setStatus("idle");
|
|
1419
|
+
}
|
|
1420
|
+
}, [loading, delay, minDuration, status]);
|
|
1421
|
+
useEffect(() => clearPending, []);
|
|
1422
|
+
return status === "loading" || status === "ending";
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
// src/BiampTable/BiampTable.tsx
|
|
1426
|
+
import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1427
|
+
var overlaySx = {
|
|
1428
|
+
position: "absolute",
|
|
1429
|
+
top: 0,
|
|
1430
|
+
left: 0,
|
|
1431
|
+
right: 0,
|
|
1432
|
+
bottom: 0,
|
|
1433
|
+
display: "flex",
|
|
1434
|
+
alignItems: "center",
|
|
1435
|
+
justifyContent: "center",
|
|
1436
|
+
pointerEvents: "none"
|
|
1437
|
+
};
|
|
1438
|
+
var headerSelectionCellSx = {
|
|
1439
|
+
position: "sticky",
|
|
1440
|
+
left: 0,
|
|
1441
|
+
zIndex: 3,
|
|
1442
|
+
bgcolor: "background.paper"
|
|
1443
|
+
};
|
|
1444
|
+
var checkboxHiddenHeaderSx = { visibility: "hidden" };
|
|
1273
1445
|
function BiampTable({
|
|
1274
1446
|
table,
|
|
1275
1447
|
onRowClick,
|
|
@@ -1279,8 +1451,10 @@ function BiampTable({
|
|
|
1279
1451
|
empty,
|
|
1280
1452
|
enableRowSelection = false,
|
|
1281
1453
|
enableExpanding = false,
|
|
1454
|
+
alwaysExpanded = false,
|
|
1282
1455
|
hideSelectAll,
|
|
1283
1456
|
selectChildrenWithParent = false,
|
|
1457
|
+
showExpandGuidelines = false,
|
|
1284
1458
|
getRowLabel,
|
|
1285
1459
|
setRowColor,
|
|
1286
1460
|
slotProps,
|
|
@@ -1299,15 +1473,20 @@ function BiampTable({
|
|
|
1299
1473
|
enableRowSelection ? 48 : 0
|
|
1300
1474
|
);
|
|
1301
1475
|
const containerRef = useRef3(null);
|
|
1476
|
+
useEffect2(() => {
|
|
1477
|
+
if (enableExpanding && alwaysExpanded) {
|
|
1478
|
+
table.toggleAllRowsExpanded(true);
|
|
1479
|
+
}
|
|
1480
|
+
}, [enableExpanding, alwaysExpanded, table]);
|
|
1302
1481
|
const showLoading = useLoadingDelay(!!loading);
|
|
1303
1482
|
const rows = table.getRowModel().rows;
|
|
1304
1483
|
const hasExpandableRows = enableExpanding && rows.some((r) => r.getCanExpand());
|
|
1305
1484
|
const showError = !!error && !loading;
|
|
1306
1485
|
const showEmpty = !showError && !loading && rows.length === 0;
|
|
1307
|
-
return /* @__PURE__ */
|
|
1486
|
+
return /* @__PURE__ */ jsxs6(
|
|
1308
1487
|
TableContainer,
|
|
1309
1488
|
{
|
|
1310
|
-
component:
|
|
1489
|
+
component: Box6,
|
|
1311
1490
|
...boxProps,
|
|
1312
1491
|
ref: containerRef,
|
|
1313
1492
|
sx: {
|
|
@@ -1318,7 +1497,7 @@ function BiampTable({
|
|
|
1318
1497
|
...sx
|
|
1319
1498
|
},
|
|
1320
1499
|
children: [
|
|
1321
|
-
/* @__PURE__ */
|
|
1500
|
+
/* @__PURE__ */ jsxs6(
|
|
1322
1501
|
MuiTable,
|
|
1323
1502
|
{
|
|
1324
1503
|
"aria-busy": showLoading || void 0,
|
|
@@ -1328,14 +1507,14 @@ function BiampTable({
|
|
|
1328
1507
|
userTableSx
|
|
1329
1508
|
),
|
|
1330
1509
|
children: [
|
|
1331
|
-
/* @__PURE__ */
|
|
1332
|
-
|
|
1510
|
+
/* @__PURE__ */ jsx10(TableHead, { ...restHeadSlotProps, sx: mergeSx(userHeadSx), children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsxs6(
|
|
1511
|
+
TableRow2,
|
|
1333
1512
|
{
|
|
1334
1513
|
...restHeaderRowSlotProps,
|
|
1335
1514
|
sx: mergeSx(userHeaderRowSx),
|
|
1336
1515
|
children: [
|
|
1337
|
-
enableRowSelection && /* @__PURE__ */
|
|
1338
|
-
|
|
1516
|
+
enableRowSelection && /* @__PURE__ */ jsx10(TableCell2, { padding: "checkbox", sx: headerSelectionCellSx, children: !hideSelectAll && /* @__PURE__ */ jsx10(
|
|
1517
|
+
Checkbox2,
|
|
1339
1518
|
{
|
|
1340
1519
|
checked: table.getIsAllPageRowsSelected(),
|
|
1341
1520
|
indeterminate: table.getIsSomePageRowsSelected(),
|
|
@@ -1350,8 +1529,8 @@ function BiampTable({
|
|
|
1350
1529
|
header
|
|
1351
1530
|
});
|
|
1352
1531
|
const { sx: userHeaderCellSx, ...restHeaderCellProps } = resolvedHeaderCell ?? {};
|
|
1353
|
-
return /* @__PURE__ */
|
|
1354
|
-
|
|
1532
|
+
return /* @__PURE__ */ jsx10(
|
|
1533
|
+
TableCell2,
|
|
1355
1534
|
{
|
|
1356
1535
|
...restHeaderCellProps,
|
|
1357
1536
|
"data-sticky": sticky || void 0,
|
|
@@ -1363,7 +1542,7 @@ function BiampTable({
|
|
|
1363
1542
|
cellSx(sticky, header.column.columnDef.meta?.minWidth, 3),
|
|
1364
1543
|
userHeaderCellSx
|
|
1365
1544
|
),
|
|
1366
|
-
children: header.isPlaceholder ? null : header.column.getCanSort() ? /* @__PURE__ */
|
|
1545
|
+
children: header.isPlaceholder ? null : header.column.getCanSort() ? /* @__PURE__ */ jsx10(
|
|
1367
1546
|
TableSortLabel,
|
|
1368
1547
|
{
|
|
1369
1548
|
active: !!header.column.getIsSorted(),
|
|
@@ -1372,12 +1551,12 @@ function BiampTable({
|
|
|
1372
1551
|
...header.column.getIsSorted() && {
|
|
1373
1552
|
IconComponent: header.column.getIsSorted() === "asc" ? DropdownChevronUpIcon : DropdownChevronDownIcon
|
|
1374
1553
|
},
|
|
1375
|
-
children:
|
|
1554
|
+
children: flexRender2(
|
|
1376
1555
|
header.column.columnDef.header,
|
|
1377
1556
|
header.getContext()
|
|
1378
1557
|
)
|
|
1379
1558
|
}
|
|
1380
|
-
) :
|
|
1559
|
+
) : flexRender2(
|
|
1381
1560
|
header.column.columnDef.header,
|
|
1382
1561
|
header.getContext()
|
|
1383
1562
|
)
|
|
@@ -1389,12 +1568,12 @@ function BiampTable({
|
|
|
1389
1568
|
},
|
|
1390
1569
|
headerGroup.id
|
|
1391
1570
|
)) }),
|
|
1392
|
-
/* @__PURE__ */
|
|
1571
|
+
/* @__PURE__ */ jsx10(
|
|
1393
1572
|
TableBody,
|
|
1394
1573
|
{
|
|
1395
1574
|
...restBodySlotProps,
|
|
1396
1575
|
sx: mergeSx({ opacity: showLoading ? 0.3 : 1 }, userBodySx),
|
|
1397
|
-
children: !showError && rows.map((row) => /* @__PURE__ */
|
|
1576
|
+
children: !showError && rows.map((row) => /* @__PURE__ */ jsx10(
|
|
1398
1577
|
BiampTableRow,
|
|
1399
1578
|
{
|
|
1400
1579
|
row,
|
|
@@ -1404,7 +1583,9 @@ function BiampTable({
|
|
|
1404
1583
|
isRowClickable,
|
|
1405
1584
|
enableRowSelection,
|
|
1406
1585
|
enableExpanding,
|
|
1586
|
+
alwaysExpanded,
|
|
1407
1587
|
selectChildrenWithParent,
|
|
1588
|
+
showExpandGuidelines,
|
|
1408
1589
|
getRowLabel,
|
|
1409
1590
|
hasExpandableRows,
|
|
1410
1591
|
customColor: setRowColor?.(row.original),
|
|
@@ -1418,14 +1599,14 @@ function BiampTable({
|
|
|
1418
1599
|
]
|
|
1419
1600
|
}
|
|
1420
1601
|
),
|
|
1421
|
-
showError && /* @__PURE__ */
|
|
1602
|
+
showError && /* @__PURE__ */ jsx10(Box6, { sx: overlaySx, children: error === true ? /* @__PURE__ */ jsx10(BiampTableErrorState, { sx: { pointerEvents: "auto" } }) : error instanceof Error ? /* @__PURE__ */ jsx10(
|
|
1422
1603
|
BiampTableErrorState,
|
|
1423
1604
|
{
|
|
1424
1605
|
description: error.message,
|
|
1425
1606
|
sx: { pointerEvents: "auto" }
|
|
1426
1607
|
}
|
|
1427
1608
|
) : error }),
|
|
1428
|
-
showEmpty && /* @__PURE__ */
|
|
1609
|
+
showEmpty && /* @__PURE__ */ jsx10(Box6, { sx: overlaySx, children: empty && empty !== true ? empty : /* @__PURE__ */ jsx10(BiampTableEmptyState, { sx: { pointerEvents: "auto" } }) })
|
|
1429
1610
|
]
|
|
1430
1611
|
}
|
|
1431
1612
|
);
|
|
@@ -1433,7 +1614,7 @@ function BiampTable({
|
|
|
1433
1614
|
|
|
1434
1615
|
// src/BiampTable/BiampTableContainer.tsx
|
|
1435
1616
|
import { Stack as Stack6 } from "@mui/material";
|
|
1436
|
-
import { jsx as
|
|
1617
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1437
1618
|
function BiampTableContainer({
|
|
1438
1619
|
withBorderTop = true,
|
|
1439
1620
|
withBorderBottom = false,
|
|
@@ -1441,7 +1622,7 @@ function BiampTableContainer({
|
|
|
1441
1622
|
sx,
|
|
1442
1623
|
...props
|
|
1443
1624
|
}) {
|
|
1444
|
-
return /* @__PURE__ */
|
|
1625
|
+
return /* @__PURE__ */ jsx11(
|
|
1445
1626
|
Stack6,
|
|
1446
1627
|
{
|
|
1447
1628
|
direction: "column",
|
|
@@ -1461,9 +1642,9 @@ function BiampTableContainer({
|
|
|
1461
1642
|
|
|
1462
1643
|
// src/BiampTable/BiampTableCellActionButton.tsx
|
|
1463
1644
|
import { IconButton as IconButton2, Tooltip as Tooltip2 } from "@mui/material";
|
|
1464
|
-
import { jsx as
|
|
1645
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1465
1646
|
function BiampTableCellActionButton({ label, icon, ...props }) {
|
|
1466
|
-
return /* @__PURE__ */
|
|
1647
|
+
return /* @__PURE__ */ jsx12(
|
|
1467
1648
|
Tooltip2,
|
|
1468
1649
|
{
|
|
1469
1650
|
title: label,
|
|
@@ -1471,7 +1652,7 @@ function BiampTableCellActionButton({ label, icon, ...props }) {
|
|
|
1471
1652
|
enterDelay: 500,
|
|
1472
1653
|
enterNextDelay: 500,
|
|
1473
1654
|
disableInteractive: true,
|
|
1474
|
-
children: /* @__PURE__ */
|
|
1655
|
+
children: /* @__PURE__ */ jsx12("span", { children: /* @__PURE__ */ jsx12(IconButton2, { "aria-label": label, ...props, children: icon }) })
|
|
1475
1656
|
}
|
|
1476
1657
|
);
|
|
1477
1658
|
}
|
|
@@ -1479,15 +1660,15 @@ function BiampTableCellActionButton({ label, icon, ...props }) {
|
|
|
1479
1660
|
// src/BiampTable/BiampTableColumnVisibility.tsx
|
|
1480
1661
|
import {
|
|
1481
1662
|
alpha as alpha2,
|
|
1482
|
-
Box as
|
|
1483
|
-
Checkbox as
|
|
1663
|
+
Box as Box7,
|
|
1664
|
+
Checkbox as Checkbox3,
|
|
1484
1665
|
Divider,
|
|
1485
1666
|
List,
|
|
1486
1667
|
ListItem,
|
|
1487
1668
|
Popover as Popover2,
|
|
1488
1669
|
Typography as Typography3
|
|
1489
1670
|
} from "@mui/material";
|
|
1490
|
-
import { jsx as
|
|
1671
|
+
import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1491
1672
|
function toVisibilityState(visibility) {
|
|
1492
1673
|
return visibility;
|
|
1493
1674
|
}
|
|
@@ -1530,7 +1711,7 @@ function BiampTableColumnVisibility({
|
|
|
1530
1711
|
...popoverProps
|
|
1531
1712
|
}) {
|
|
1532
1713
|
const allVisible = table.getAllLeafColumns().every((col) => col.getIsVisible());
|
|
1533
|
-
return /* @__PURE__ */
|
|
1714
|
+
return /* @__PURE__ */ jsx13(
|
|
1534
1715
|
Popover2,
|
|
1535
1716
|
{
|
|
1536
1717
|
anchorEl,
|
|
@@ -1551,41 +1732,41 @@ function BiampTableColumnVisibility({
|
|
|
1551
1732
|
}
|
|
1552
1733
|
},
|
|
1553
1734
|
...popoverProps,
|
|
1554
|
-
children: /* @__PURE__ */
|
|
1555
|
-
/* @__PURE__ */
|
|
1735
|
+
children: /* @__PURE__ */ jsxs7(List, { dense: true, disablePadding: true, children: [
|
|
1736
|
+
/* @__PURE__ */ jsxs7(
|
|
1556
1737
|
ListItem,
|
|
1557
1738
|
{
|
|
1558
1739
|
dense: true,
|
|
1559
1740
|
sx: columnListItemSx,
|
|
1560
1741
|
onClick: () => table.toggleAllColumnsVisible(!allVisible),
|
|
1561
1742
|
children: [
|
|
1562
|
-
/* @__PURE__ */
|
|
1563
|
-
|
|
1743
|
+
/* @__PURE__ */ jsx13(
|
|
1744
|
+
Checkbox3,
|
|
1564
1745
|
{
|
|
1565
1746
|
checked: allVisible,
|
|
1566
1747
|
slotProps: { input: { "aria-label": `${showAllLabel} columns` } }
|
|
1567
1748
|
}
|
|
1568
1749
|
),
|
|
1569
|
-
/* @__PURE__ */
|
|
1750
|
+
/* @__PURE__ */ jsx13(Typography3, { variant: "caption", fontWeight: 600, children: showAllLabel })
|
|
1570
1751
|
]
|
|
1571
1752
|
}
|
|
1572
1753
|
),
|
|
1573
|
-
/* @__PURE__ */
|
|
1574
|
-
/* @__PURE__ */
|
|
1575
|
-
|
|
1754
|
+
/* @__PURE__ */ jsx13(Divider, {}),
|
|
1755
|
+
/* @__PURE__ */ jsx13(
|
|
1756
|
+
Box7,
|
|
1576
1757
|
{
|
|
1577
1758
|
sx: { maxHeight: 340, overflow: "auto", overscrollBehavior: "none" },
|
|
1578
1759
|
children: table.getAllLeafColumns().map((column) => {
|
|
1579
1760
|
const columnName = column.columnDef.meta?.columnLabel ?? (typeof column.columnDef.header === "string" ? column.columnDef.header : column.id);
|
|
1580
|
-
return /* @__PURE__ */
|
|
1761
|
+
return /* @__PURE__ */ jsxs7(
|
|
1581
1762
|
ListItem,
|
|
1582
1763
|
{
|
|
1583
1764
|
dense: true,
|
|
1584
1765
|
sx: columnListItemSx,
|
|
1585
1766
|
onClick: column.getToggleVisibilityHandler(),
|
|
1586
1767
|
children: [
|
|
1587
|
-
/* @__PURE__ */
|
|
1588
|
-
|
|
1768
|
+
/* @__PURE__ */ jsx13(
|
|
1769
|
+
Checkbox3,
|
|
1589
1770
|
{
|
|
1590
1771
|
checked: column.getIsVisible(),
|
|
1591
1772
|
sx: { py: 1 },
|
|
@@ -1594,7 +1775,7 @@ function BiampTableColumnVisibility({
|
|
|
1594
1775
|
}
|
|
1595
1776
|
}
|
|
1596
1777
|
),
|
|
1597
|
-
/* @__PURE__ */
|
|
1778
|
+
/* @__PURE__ */ jsx13(Typography3, { variant: "caption", children: columnName })
|
|
1598
1779
|
]
|
|
1599
1780
|
},
|
|
1600
1781
|
column.id
|
|
@@ -1616,7 +1797,7 @@ import {
|
|
|
1616
1797
|
Badge,
|
|
1617
1798
|
IconButton as IconButton3
|
|
1618
1799
|
} from "@mui/material";
|
|
1619
|
-
import { jsx as
|
|
1800
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1620
1801
|
function BiampTableToolbarActionButton({
|
|
1621
1802
|
label,
|
|
1622
1803
|
icon,
|
|
@@ -1624,12 +1805,12 @@ function BiampTableToolbarActionButton({
|
|
|
1624
1805
|
...props
|
|
1625
1806
|
}) {
|
|
1626
1807
|
const showBadge = badgeContent != null && badgeContent !== 0;
|
|
1627
|
-
return /* @__PURE__ */
|
|
1808
|
+
return /* @__PURE__ */ jsx14(
|
|
1628
1809
|
IconButton3,
|
|
1629
1810
|
{
|
|
1630
1811
|
"aria-label": showBadge ? `${label} (${badgeContent})` : label,
|
|
1631
1812
|
...props,
|
|
1632
|
-
children: showBadge ? /* @__PURE__ */
|
|
1813
|
+
children: showBadge ? /* @__PURE__ */ jsx14(
|
|
1633
1814
|
Badge,
|
|
1634
1815
|
{
|
|
1635
1816
|
badgeContent,
|
|
@@ -1653,10 +1834,10 @@ function BiampTableToolbarActionButton({
|
|
|
1653
1834
|
}
|
|
1654
1835
|
|
|
1655
1836
|
// src/BiampTable/BiampTableToolbarColumnVisibility.tsx
|
|
1656
|
-
import { Fragment, jsx as
|
|
1837
|
+
import { Fragment as Fragment2, jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1657
1838
|
function BiampTableToolbarColumnVisibility({
|
|
1658
1839
|
table,
|
|
1659
|
-
icon = /* @__PURE__ */
|
|
1840
|
+
icon = /* @__PURE__ */ jsx15(ColumnsIcon, { variant: "xs" }),
|
|
1660
1841
|
label = "Columns",
|
|
1661
1842
|
defaultColumnVisibility,
|
|
1662
1843
|
showAllLabel,
|
|
@@ -1665,8 +1846,8 @@ function BiampTableToolbarColumnVisibility({
|
|
|
1665
1846
|
const [anchorEl, setAnchorEl] = useState3(null);
|
|
1666
1847
|
const defaults = defaultColumnVisibility ?? getDefaultColumnVisibility(table);
|
|
1667
1848
|
const dirtyCount = getColumnVisibilityDirtyCount(table, defaults);
|
|
1668
|
-
return /* @__PURE__ */
|
|
1669
|
-
/* @__PURE__ */
|
|
1849
|
+
return /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
1850
|
+
/* @__PURE__ */ jsx15(
|
|
1670
1851
|
BiampTableToolbarActionButton,
|
|
1671
1852
|
{
|
|
1672
1853
|
label,
|
|
@@ -1676,7 +1857,7 @@ function BiampTableToolbarColumnVisibility({
|
|
|
1676
1857
|
...actionButtonProps
|
|
1677
1858
|
}
|
|
1678
1859
|
),
|
|
1679
|
-
/* @__PURE__ */
|
|
1860
|
+
/* @__PURE__ */ jsx15(
|
|
1680
1861
|
BiampTableColumnVisibility,
|
|
1681
1862
|
{
|
|
1682
1863
|
table,
|
|
@@ -1689,9 +1870,9 @@ function BiampTableToolbarColumnVisibility({
|
|
|
1689
1870
|
}
|
|
1690
1871
|
|
|
1691
1872
|
// src/BiampTable/BiampTablePagination.tsx
|
|
1692
|
-
import { useEffect as
|
|
1873
|
+
import { useEffect as useEffect3, useRef as useRef4 } from "react";
|
|
1693
1874
|
import { TablePagination } from "@mui/material";
|
|
1694
|
-
import { jsx as
|
|
1875
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1695
1876
|
var positionMap = {
|
|
1696
1877
|
left: "flex-start",
|
|
1697
1878
|
center: "center",
|
|
@@ -1714,13 +1895,13 @@ function BiampTablePagination({
|
|
|
1714
1895
|
const stableCount = loading ? lastRowCountRef.current : rowCount;
|
|
1715
1896
|
const { pageSize, pageIndex } = table.getState().pagination;
|
|
1716
1897
|
const maxPage = Math.max(0, Math.ceil(stableCount / pageSize) - 1);
|
|
1717
|
-
|
|
1898
|
+
useEffect3(() => {
|
|
1718
1899
|
if (!loading && pageIndex > maxPage) {
|
|
1719
1900
|
table.setPageIndex(maxPage);
|
|
1720
1901
|
}
|
|
1721
1902
|
}, [loading, pageIndex, maxPage, table]);
|
|
1722
1903
|
if (autoHide && (!stableCount || stableCount <= pageSize)) return null;
|
|
1723
|
-
return /* @__PURE__ */
|
|
1904
|
+
return /* @__PURE__ */ jsx16(
|
|
1724
1905
|
TablePagination,
|
|
1725
1906
|
{
|
|
1726
1907
|
component: "div",
|
|
@@ -1752,15 +1933,15 @@ function BiampTablePagination({
|
|
|
1752
1933
|
}
|
|
1753
1934
|
|
|
1754
1935
|
// src/BiampTable/BiampTableToolbar.tsx
|
|
1755
|
-
import { Box as
|
|
1756
|
-
import { jsx as
|
|
1936
|
+
import { Box as Box8 } from "@mui/material";
|
|
1937
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1757
1938
|
function BiampTableToolbar({
|
|
1758
1939
|
children,
|
|
1759
1940
|
sx,
|
|
1760
1941
|
...props
|
|
1761
1942
|
}) {
|
|
1762
|
-
return /* @__PURE__ */
|
|
1763
|
-
|
|
1943
|
+
return /* @__PURE__ */ jsx17(
|
|
1944
|
+
Box8,
|
|
1764
1945
|
{
|
|
1765
1946
|
role: "toolbar",
|
|
1766
1947
|
display: "flex",
|
|
@@ -1778,14 +1959,14 @@ function BiampTableToolbar({
|
|
|
1778
1959
|
}
|
|
1779
1960
|
|
|
1780
1961
|
// src/BiampTable/BiampTableToolbarActions.tsx
|
|
1781
|
-
import { Box as
|
|
1782
|
-
import { jsx as
|
|
1962
|
+
import { Box as Box9 } from "@mui/material";
|
|
1963
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1783
1964
|
function BiampTableToolbarActions({
|
|
1784
1965
|
children,
|
|
1785
1966
|
...props
|
|
1786
1967
|
}) {
|
|
1787
|
-
return /* @__PURE__ */
|
|
1788
|
-
|
|
1968
|
+
return /* @__PURE__ */ jsx18(
|
|
1969
|
+
Box9,
|
|
1789
1970
|
{
|
|
1790
1971
|
display: "flex",
|
|
1791
1972
|
alignItems: "center",
|
|
@@ -1801,19 +1982,19 @@ function BiampTableToolbarActions({
|
|
|
1801
1982
|
// src/BiampTable/BiampTableToolbarExport.tsx
|
|
1802
1983
|
import { CircularProgress } from "@mui/material";
|
|
1803
1984
|
import { DownloadIcon } from "@bwp-web/assets";
|
|
1804
|
-
import { jsx as
|
|
1985
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1805
1986
|
function BiampTableToolbarExport({
|
|
1806
1987
|
onExport,
|
|
1807
1988
|
loading,
|
|
1808
|
-
icon = /* @__PURE__ */
|
|
1989
|
+
icon = /* @__PURE__ */ jsx19(DownloadIcon, { variant: "xs" }),
|
|
1809
1990
|
label = "Export",
|
|
1810
1991
|
...props
|
|
1811
1992
|
}) {
|
|
1812
|
-
return /* @__PURE__ */
|
|
1993
|
+
return /* @__PURE__ */ jsx19(
|
|
1813
1994
|
BiampTableToolbarActionButton,
|
|
1814
1995
|
{
|
|
1815
1996
|
label: loading ? `${label}, loading` : label,
|
|
1816
|
-
icon: loading ? /* @__PURE__ */
|
|
1997
|
+
icon: loading ? /* @__PURE__ */ jsx19(CircularProgress, { size: 20, color: "inherit" }) : icon,
|
|
1817
1998
|
disabled: loading,
|
|
1818
1999
|
onClick: onExport,
|
|
1819
2000
|
...props
|
|
@@ -1824,7 +2005,7 @@ function BiampTableToolbarExport({
|
|
|
1824
2005
|
// src/BiampTable/BiampTableToolbarFilters.tsx
|
|
1825
2006
|
import {
|
|
1826
2007
|
Badge as Badge2,
|
|
1827
|
-
Box as
|
|
2008
|
+
Box as Box10,
|
|
1828
2009
|
Button,
|
|
1829
2010
|
Divider as Divider2,
|
|
1830
2011
|
Drawer,
|
|
@@ -1833,13 +2014,13 @@ import {
|
|
|
1833
2014
|
} from "@mui/material";
|
|
1834
2015
|
import { CloseIcon, FilterIcon } from "@bwp-web/assets";
|
|
1835
2016
|
import { useId, useState as useState4 } from "react";
|
|
1836
|
-
import { Fragment as
|
|
2017
|
+
import { Fragment as Fragment3, jsx as jsx20, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1837
2018
|
function BiampTableToolbarFilters({
|
|
1838
2019
|
activeFilterCount,
|
|
1839
2020
|
children,
|
|
1840
2021
|
onReset,
|
|
1841
2022
|
onApply,
|
|
1842
|
-
icon = /* @__PURE__ */
|
|
2023
|
+
icon = /* @__PURE__ */ jsx20(FilterIcon, { variant: "xs" }),
|
|
1843
2024
|
title = "Filters",
|
|
1844
2025
|
resetLabel = "Clear filters",
|
|
1845
2026
|
applyLabel = "Apply",
|
|
@@ -1853,8 +2034,8 @@ function BiampTableToolbarFilters({
|
|
|
1853
2034
|
onApply?.();
|
|
1854
2035
|
setOpen(false);
|
|
1855
2036
|
}
|
|
1856
|
-
return /* @__PURE__ */
|
|
1857
|
-
/* @__PURE__ */
|
|
2037
|
+
return /* @__PURE__ */ jsxs9(Fragment3, { children: [
|
|
2038
|
+
/* @__PURE__ */ jsx20(
|
|
1858
2039
|
BiampTableToolbarActionButton,
|
|
1859
2040
|
{
|
|
1860
2041
|
label: buttonLabel,
|
|
@@ -1863,7 +2044,7 @@ function BiampTableToolbarFilters({
|
|
|
1863
2044
|
onClick: () => setOpen(true)
|
|
1864
2045
|
}
|
|
1865
2046
|
),
|
|
1866
|
-
/* @__PURE__ */
|
|
2047
|
+
/* @__PURE__ */ jsx20(
|
|
1867
2048
|
Drawer,
|
|
1868
2049
|
{
|
|
1869
2050
|
anchor: "right",
|
|
@@ -1875,17 +2056,17 @@ function BiampTableToolbarFilters({
|
|
|
1875
2056
|
sx: { width: { xs: "100%", sm: 480 } },
|
|
1876
2057
|
...drawerProps?.PaperProps
|
|
1877
2058
|
},
|
|
1878
|
-
children: /* @__PURE__ */
|
|
1879
|
-
|
|
2059
|
+
children: /* @__PURE__ */ jsxs9(
|
|
2060
|
+
Box10,
|
|
1880
2061
|
{
|
|
1881
2062
|
height: "100%",
|
|
1882
2063
|
display: "flex",
|
|
1883
2064
|
flexDirection: "column",
|
|
1884
2065
|
justifyContent: "space-between",
|
|
1885
2066
|
children: [
|
|
1886
|
-
/* @__PURE__ */
|
|
1887
|
-
/* @__PURE__ */
|
|
1888
|
-
|
|
2067
|
+
/* @__PURE__ */ jsxs9(Box10, { children: [
|
|
2068
|
+
/* @__PURE__ */ jsxs9(
|
|
2069
|
+
Box10,
|
|
1889
2070
|
{
|
|
1890
2071
|
display: "flex",
|
|
1891
2072
|
justifyContent: "space-between",
|
|
@@ -1893,9 +2074,9 @@ function BiampTableToolbarFilters({
|
|
|
1893
2074
|
px: 3.5,
|
|
1894
2075
|
py: 2.5,
|
|
1895
2076
|
children: [
|
|
1896
|
-
/* @__PURE__ */
|
|
2077
|
+
/* @__PURE__ */ jsxs9(Typography4, { id: titleId, variant: "h2", children: [
|
|
1897
2078
|
title,
|
|
1898
|
-
/* @__PURE__ */
|
|
2079
|
+
/* @__PURE__ */ jsx20(
|
|
1899
2080
|
Badge2,
|
|
1900
2081
|
{
|
|
1901
2082
|
badgeContent: activeFilterCount,
|
|
@@ -1904,21 +2085,21 @@ function BiampTableToolbarFilters({
|
|
|
1904
2085
|
}
|
|
1905
2086
|
)
|
|
1906
2087
|
] }),
|
|
1907
|
-
/* @__PURE__ */
|
|
2088
|
+
/* @__PURE__ */ jsx20(
|
|
1908
2089
|
IconButton4,
|
|
1909
2090
|
{
|
|
1910
2091
|
size: "medium",
|
|
1911
2092
|
onClick: handleClose,
|
|
1912
2093
|
"aria-label": closeLabel,
|
|
1913
|
-
children: /* @__PURE__ */
|
|
2094
|
+
children: /* @__PURE__ */ jsx20(CloseIcon, {})
|
|
1914
2095
|
}
|
|
1915
2096
|
)
|
|
1916
2097
|
]
|
|
1917
2098
|
}
|
|
1918
2099
|
),
|
|
1919
|
-
/* @__PURE__ */
|
|
1920
|
-
/* @__PURE__ */
|
|
1921
|
-
|
|
2100
|
+
/* @__PURE__ */ jsx20(Divider2, {}),
|
|
2101
|
+
/* @__PURE__ */ jsx20(
|
|
2102
|
+
Box10,
|
|
1922
2103
|
{
|
|
1923
2104
|
role: "group",
|
|
1924
2105
|
"aria-label": "Filter options",
|
|
@@ -1931,8 +2112,8 @@ function BiampTableToolbarFilters({
|
|
|
1931
2112
|
}
|
|
1932
2113
|
)
|
|
1933
2114
|
] }),
|
|
1934
|
-
/* @__PURE__ */
|
|
1935
|
-
/* @__PURE__ */
|
|
2115
|
+
/* @__PURE__ */ jsxs9(Box10, { display: "flex", children: [
|
|
2116
|
+
/* @__PURE__ */ jsx20(
|
|
1936
2117
|
Button,
|
|
1937
2118
|
{
|
|
1938
2119
|
variant: "overlay",
|
|
@@ -1943,7 +2124,7 @@ function BiampTableToolbarFilters({
|
|
|
1943
2124
|
children: resetLabel
|
|
1944
2125
|
}
|
|
1945
2126
|
),
|
|
1946
|
-
/* @__PURE__ */
|
|
2127
|
+
/* @__PURE__ */ jsx20(
|
|
1947
2128
|
Button,
|
|
1948
2129
|
{
|
|
1949
2130
|
variant: "overlay",
|
|
@@ -1964,7 +2145,7 @@ function BiampTableToolbarFilters({
|
|
|
1964
2145
|
|
|
1965
2146
|
// src/BiampTable/BiampTableToolbarSearch.tsx
|
|
1966
2147
|
import {
|
|
1967
|
-
Box as
|
|
2148
|
+
Box as Box11,
|
|
1968
2149
|
Collapse,
|
|
1969
2150
|
IconButton as IconButton5,
|
|
1970
2151
|
InputAdornment as InputAdornment2,
|
|
@@ -1973,16 +2154,16 @@ import {
|
|
|
1973
2154
|
useMediaQuery
|
|
1974
2155
|
} from "@mui/material";
|
|
1975
2156
|
import { CloseIcon as CloseIcon2, SearchIcon as SearchIcon2 } from "@bwp-web/assets";
|
|
1976
|
-
import { useEffect as
|
|
2157
|
+
import { useEffect as useEffect5, useState as useState5 } from "react";
|
|
1977
2158
|
|
|
1978
2159
|
// src/BiampTable/useDebouncedCallback.ts
|
|
1979
|
-
import { useCallback as useCallback2, useEffect as
|
|
2160
|
+
import { useCallback as useCallback2, useEffect as useEffect4, useRef as useRef5 } from "react";
|
|
1980
2161
|
var BIAMP_TABLE_DEBOUNCE_DELAY = 300;
|
|
1981
2162
|
function useDebouncedCallback(callback, delay = BIAMP_TABLE_DEBOUNCE_DELAY) {
|
|
1982
2163
|
const timeoutRef = useRef5(null);
|
|
1983
2164
|
const callbackRef = useRef5(callback);
|
|
1984
2165
|
callbackRef.current = callback;
|
|
1985
|
-
|
|
2166
|
+
useEffect4(() => {
|
|
1986
2167
|
return () => {
|
|
1987
2168
|
if (timeoutRef.current !== null) clearTimeout(timeoutRef.current);
|
|
1988
2169
|
};
|
|
@@ -2000,7 +2181,7 @@ function useDebouncedCallback(callback, delay = BIAMP_TABLE_DEBOUNCE_DELAY) {
|
|
|
2000
2181
|
}
|
|
2001
2182
|
|
|
2002
2183
|
// src/BiampTable/BiampTableToolbarSearch.tsx
|
|
2003
|
-
import { jsx as
|
|
2184
|
+
import { jsx as jsx21, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2004
2185
|
var searchFieldSx = {
|
|
2005
2186
|
"& .MuiInputBase-root": {
|
|
2006
2187
|
height: "36px !important",
|
|
@@ -2028,7 +2209,7 @@ function BiampTableToolbarSearch({
|
|
|
2028
2209
|
const [inputValue, setInputValue] = useState5(defaultValue);
|
|
2029
2210
|
const [isExpanded, setIsExpanded] = useState5(false);
|
|
2030
2211
|
const debouncedOnChange = useDebouncedCallback(onChange, debounceDelay);
|
|
2031
|
-
|
|
2212
|
+
useEffect5(() => {
|
|
2032
2213
|
setInputValue(defaultValue);
|
|
2033
2214
|
}, [defaultValue]);
|
|
2034
2215
|
const handleChange = (e) => {
|
|
@@ -2044,17 +2225,17 @@ function BiampTableToolbarSearch({
|
|
|
2044
2225
|
setIsExpanded(false);
|
|
2045
2226
|
}
|
|
2046
2227
|
};
|
|
2047
|
-
const clearButton = inputValue ? /* @__PURE__ */
|
|
2228
|
+
const clearButton = inputValue ? /* @__PURE__ */ jsx21(InputAdornment2, { position: "end", children: /* @__PURE__ */ jsx21(
|
|
2048
2229
|
IconButton5,
|
|
2049
2230
|
{
|
|
2050
2231
|
size: "small",
|
|
2051
2232
|
onClick: handleClear,
|
|
2052
2233
|
"aria-label": clearLabel,
|
|
2053
2234
|
sx: { mr: 0.5 },
|
|
2054
|
-
children: /* @__PURE__ */
|
|
2235
|
+
children: /* @__PURE__ */ jsx21(CloseIcon2, { variant: "xs", sx: { width: 20, height: 20 } })
|
|
2055
2236
|
}
|
|
2056
2237
|
) }) : null;
|
|
2057
|
-
const textField = /* @__PURE__ */
|
|
2238
|
+
const textField = /* @__PURE__ */ jsx21(
|
|
2058
2239
|
TextField2,
|
|
2059
2240
|
{
|
|
2060
2241
|
name: "search",
|
|
@@ -2063,7 +2244,7 @@ function BiampTableToolbarSearch({
|
|
|
2063
2244
|
slotProps: {
|
|
2064
2245
|
htmlInput: { maxLength, "aria-label": placeholder },
|
|
2065
2246
|
input: {
|
|
2066
|
-
startAdornment: /* @__PURE__ */
|
|
2247
|
+
startAdornment: /* @__PURE__ */ jsx21(InputAdornment2, { position: "start", sx: { ml: 1 }, children: /* @__PURE__ */ jsx21(
|
|
2067
2248
|
SearchIcon2,
|
|
2068
2249
|
{
|
|
2069
2250
|
variant: "xs",
|
|
@@ -2089,9 +2270,9 @@ function BiampTableToolbarSearch({
|
|
|
2089
2270
|
}
|
|
2090
2271
|
);
|
|
2091
2272
|
if (isMobile && enableMobileView) {
|
|
2092
|
-
return /* @__PURE__ */
|
|
2093
|
-
/* @__PURE__ */
|
|
2094
|
-
/* @__PURE__ */
|
|
2273
|
+
return /* @__PURE__ */ jsxs10(Box11, { display: "flex", alignItems: "center", width: "100%", pr: 1, gap: 1, children: [
|
|
2274
|
+
/* @__PURE__ */ jsx21(SearchIcon2, { sx: { width: 16, height: 16 } }),
|
|
2275
|
+
/* @__PURE__ */ jsx21(
|
|
2095
2276
|
InputBase,
|
|
2096
2277
|
{
|
|
2097
2278
|
name: "search",
|
|
@@ -2113,14 +2294,14 @@ function BiampTableToolbarSearch({
|
|
|
2113
2294
|
] });
|
|
2114
2295
|
}
|
|
2115
2296
|
if (expandable) {
|
|
2116
|
-
return /* @__PURE__ */
|
|
2117
|
-
/* @__PURE__ */
|
|
2297
|
+
return /* @__PURE__ */ jsxs10(Box11, { display: "flex", alignItems: "center", minWidth: 28, children: [
|
|
2298
|
+
/* @__PURE__ */ jsx21(
|
|
2118
2299
|
IconButton5,
|
|
2119
2300
|
{
|
|
2120
2301
|
"aria-label": expandLabel ?? placeholder,
|
|
2121
2302
|
onClick: () => setIsExpanded(true),
|
|
2122
2303
|
sx: { display: isExpanded || inputValue ? "none" : "flex" },
|
|
2123
|
-
children: /* @__PURE__ */
|
|
2304
|
+
children: /* @__PURE__ */ jsx21(
|
|
2124
2305
|
SearchIcon2,
|
|
2125
2306
|
{
|
|
2126
2307
|
variant: "xs",
|
|
@@ -2130,7 +2311,7 @@ function BiampTableToolbarSearch({
|
|
|
2130
2311
|
)
|
|
2131
2312
|
}
|
|
2132
2313
|
),
|
|
2133
|
-
/* @__PURE__ */
|
|
2314
|
+
/* @__PURE__ */ jsx21(
|
|
2134
2315
|
Collapse,
|
|
2135
2316
|
{
|
|
2136
2317
|
in: isExpanded || !!inputValue,
|
|
@@ -2356,7 +2537,7 @@ function downloadCsv(csvContent, filename) {
|
|
|
2356
2537
|
|
|
2357
2538
|
// src/BiampBanner/BiampBanner.tsx
|
|
2358
2539
|
import {
|
|
2359
|
-
Box as
|
|
2540
|
+
Box as Box12,
|
|
2360
2541
|
Collapse as Collapse2,
|
|
2361
2542
|
Typography as Typography5
|
|
2362
2543
|
} from "@mui/material";
|
|
@@ -2366,10 +2547,10 @@ import {
|
|
|
2366
2547
|
SuccessStatusIcon,
|
|
2367
2548
|
WarningStatusIcon
|
|
2368
2549
|
} from "@bwp-web/assets";
|
|
2369
|
-
import { Fragment as
|
|
2550
|
+
import { Fragment as Fragment4, jsx as jsx22 } from "react/jsx-runtime";
|
|
2370
2551
|
function BiampBanner({ show, children, severity }) {
|
|
2371
|
-
return /* @__PURE__ */
|
|
2372
|
-
|
|
2552
|
+
return /* @__PURE__ */ jsx22(Collapse2, { in: show, unmountOnExit: true, component: "aside", children: /* @__PURE__ */ jsx22(
|
|
2553
|
+
Box12,
|
|
2373
2554
|
{
|
|
2374
2555
|
bgcolor: ({ palette }) => palette.background[severity],
|
|
2375
2556
|
display: "flex",
|
|
@@ -2387,25 +2568,25 @@ function BiampBanner({ show, children, severity }) {
|
|
|
2387
2568
|
) });
|
|
2388
2569
|
}
|
|
2389
2570
|
var iconMapping = {
|
|
2390
|
-
error: /* @__PURE__ */
|
|
2391
|
-
warning: /* @__PURE__ */
|
|
2392
|
-
success: /* @__PURE__ */
|
|
2393
|
-
info: /* @__PURE__ */
|
|
2571
|
+
error: /* @__PURE__ */ jsx22(ErrorStatusIcon, { color: "error", sx: { width: 14, height: 14 } }),
|
|
2572
|
+
warning: /* @__PURE__ */ jsx22(WarningStatusIcon, { color: "warning", sx: { width: 16, height: 14 } }),
|
|
2573
|
+
success: /* @__PURE__ */ jsx22(SuccessStatusIcon, { color: "success", sx: { width: 14, height: 14 } }),
|
|
2574
|
+
info: /* @__PURE__ */ jsx22(InfoStatusIcon, { color: "info", sx: { width: 14, height: 14 } })
|
|
2394
2575
|
};
|
|
2395
2576
|
function BiampBannerIcon({ severity, children }) {
|
|
2396
|
-
return /* @__PURE__ */
|
|
2577
|
+
return /* @__PURE__ */ jsx22(Fragment4, { children: severity ? iconMapping[severity] : children });
|
|
2397
2578
|
}
|
|
2398
2579
|
function BiampBannerContent({ children, ...props }) {
|
|
2399
|
-
return /* @__PURE__ */
|
|
2580
|
+
return /* @__PURE__ */ jsx22(Typography5, { textAlign: "center", variant: "h3", ...props, children });
|
|
2400
2581
|
}
|
|
2401
2582
|
function BiampBannerActions({ children, ...props }) {
|
|
2402
|
-
return /* @__PURE__ */
|
|
2583
|
+
return /* @__PURE__ */ jsx22(Box12, { display: "flex", gap: 1, alignItems: "center", ...props, children });
|
|
2403
2584
|
}
|
|
2404
2585
|
|
|
2405
2586
|
// src/BiampSegmentedButton/SegmentedButton.tsx
|
|
2406
2587
|
import { Button as Button2, useTheme } from "@mui/material";
|
|
2407
2588
|
import { alpha as alpha3 } from "@mui/material/styles";
|
|
2408
|
-
import { jsx as
|
|
2589
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
2409
2590
|
function SegmentedButton({
|
|
2410
2591
|
children,
|
|
2411
2592
|
active,
|
|
@@ -2418,7 +2599,7 @@ function SegmentedButton({
|
|
|
2418
2599
|
const backgroundColor = active ? isDarkMode ? theme.palette.grey[900] : theme.palette.common.white : "transparent";
|
|
2419
2600
|
const textColor = active ? theme.palette.text.primary : theme.palette.text.secondary;
|
|
2420
2601
|
const border = active ? "solid" : void 0;
|
|
2421
|
-
return /* @__PURE__ */
|
|
2602
|
+
return /* @__PURE__ */ jsx23(
|
|
2422
2603
|
Button2,
|
|
2423
2604
|
{
|
|
2424
2605
|
sx: {
|
|
@@ -2443,11 +2624,11 @@ function SegmentedButton({
|
|
|
2443
2624
|
|
|
2444
2625
|
// src/BiampSegmentedButton/SegmentedButtonGroup.tsx
|
|
2445
2626
|
import { Stack as Stack7, useTheme as useTheme2 } from "@mui/material";
|
|
2446
|
-
import { jsx as
|
|
2627
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
2447
2628
|
function SegmentedButtonGroup({ children, sx, ...props }) {
|
|
2448
2629
|
const theme = useTheme2();
|
|
2449
2630
|
const isDarkMode = theme.palette.mode === "dark";
|
|
2450
|
-
return /* @__PURE__ */
|
|
2631
|
+
return /* @__PURE__ */ jsx24(
|
|
2451
2632
|
Stack7,
|
|
2452
2633
|
{
|
|
2453
2634
|
direction: "row",
|
|
@@ -2468,7 +2649,7 @@ function SegmentedButtonGroup({ children, sx, ...props }) {
|
|
|
2468
2649
|
import { createContext, forwardRef, useContext } from "react";
|
|
2469
2650
|
import {
|
|
2470
2651
|
Autocomplete,
|
|
2471
|
-
Box as
|
|
2652
|
+
Box as Box13,
|
|
2472
2653
|
Chip,
|
|
2473
2654
|
InputAdornment as InputAdornment3,
|
|
2474
2655
|
Paper,
|
|
@@ -2476,7 +2657,7 @@ import {
|
|
|
2476
2657
|
Typography as Typography6
|
|
2477
2658
|
} from "@mui/material";
|
|
2478
2659
|
import { KeyArrowDownIcon, KeyArrowUpIcon, SearchIcon as SearchIcon3 } from "@bwp-web/assets";
|
|
2479
|
-
import { Fragment as
|
|
2660
|
+
import { Fragment as Fragment5, jsx as jsx25, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2480
2661
|
var SearchContext = createContext({
|
|
2481
2662
|
hasOptions: true,
|
|
2482
2663
|
loading: false,
|
|
@@ -2487,8 +2668,8 @@ function KeyCap({
|
|
|
2487
2668
|
children,
|
|
2488
2669
|
variant = "icon"
|
|
2489
2670
|
}) {
|
|
2490
|
-
return /* @__PURE__ */
|
|
2491
|
-
|
|
2671
|
+
return /* @__PURE__ */ jsx25(
|
|
2672
|
+
Box13,
|
|
2492
2673
|
{
|
|
2493
2674
|
component: "kbd",
|
|
2494
2675
|
sx: {
|
|
@@ -2515,8 +2696,8 @@ function KeyCap({
|
|
|
2515
2696
|
var BiampGlobalSearchPaper = forwardRef(
|
|
2516
2697
|
function BiampGlobalSearchPaper2({ children, ...props }, ref) {
|
|
2517
2698
|
const { hasOptions, loading, noResultsText } = useContext(SearchContext);
|
|
2518
|
-
return /* @__PURE__ */
|
|
2519
|
-
hasOptions || loading ? children : /* @__PURE__ */
|
|
2699
|
+
return /* @__PURE__ */ jsxs11(Paper, { ref, ...props, children: [
|
|
2700
|
+
hasOptions || loading ? children : /* @__PURE__ */ jsx25(
|
|
2520
2701
|
Typography6,
|
|
2521
2702
|
{
|
|
2522
2703
|
variant: "body2",
|
|
@@ -2525,8 +2706,8 @@ var BiampGlobalSearchPaper = forwardRef(
|
|
|
2525
2706
|
children: noResultsText
|
|
2526
2707
|
}
|
|
2527
2708
|
),
|
|
2528
|
-
hasOptions && /* @__PURE__ */
|
|
2529
|
-
|
|
2709
|
+
hasOptions && /* @__PURE__ */ jsxs11(
|
|
2710
|
+
Box13,
|
|
2530
2711
|
{
|
|
2531
2712
|
sx: {
|
|
2532
2713
|
borderTop: ({ palette }) => `0.6px solid ${palette.dividers.secondary}`,
|
|
@@ -2536,12 +2717,12 @@ var BiampGlobalSearchPaper = forwardRef(
|
|
|
2536
2717
|
p: 1.5
|
|
2537
2718
|
},
|
|
2538
2719
|
children: [
|
|
2539
|
-
/* @__PURE__ */
|
|
2540
|
-
/* @__PURE__ */
|
|
2541
|
-
/* @__PURE__ */
|
|
2542
|
-
/* @__PURE__ */
|
|
2720
|
+
/* @__PURE__ */ jsxs11(Box13, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
2721
|
+
/* @__PURE__ */ jsxs11(Box13, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: [
|
|
2722
|
+
/* @__PURE__ */ jsx25(KeyCap, { children: /* @__PURE__ */ jsx25(KeyArrowDownIcon, {}) }),
|
|
2723
|
+
/* @__PURE__ */ jsx25(KeyCap, { children: /* @__PURE__ */ jsx25(KeyArrowUpIcon, {}) })
|
|
2543
2724
|
] }),
|
|
2544
|
-
/* @__PURE__ */
|
|
2725
|
+
/* @__PURE__ */ jsx25(
|
|
2545
2726
|
Typography6,
|
|
2546
2727
|
{
|
|
2547
2728
|
variant: "caption",
|
|
@@ -2551,9 +2732,9 @@ var BiampGlobalSearchPaper = forwardRef(
|
|
|
2551
2732
|
}
|
|
2552
2733
|
)
|
|
2553
2734
|
] }),
|
|
2554
|
-
/* @__PURE__ */
|
|
2555
|
-
/* @__PURE__ */
|
|
2556
|
-
/* @__PURE__ */
|
|
2735
|
+
/* @__PURE__ */ jsxs11(Box13, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
2736
|
+
/* @__PURE__ */ jsx25(KeyCap, { variant: "text", children: "Enter" }),
|
|
2737
|
+
/* @__PURE__ */ jsx25(
|
|
2557
2738
|
Typography6,
|
|
2558
2739
|
{
|
|
2559
2740
|
variant: "caption",
|
|
@@ -2570,16 +2751,16 @@ var BiampGlobalSearchPaper = forwardRef(
|
|
|
2570
2751
|
}
|
|
2571
2752
|
);
|
|
2572
2753
|
function HighlightText({ text, query }) {
|
|
2573
|
-
if (!query) return /* @__PURE__ */
|
|
2754
|
+
if (!query) return /* @__PURE__ */ jsx25(Fragment5, { children: text });
|
|
2574
2755
|
const index = text.toLowerCase().indexOf(query.toLowerCase());
|
|
2575
|
-
if (index === -1) return /* @__PURE__ */
|
|
2756
|
+
if (index === -1) return /* @__PURE__ */ jsx25(Fragment5, { children: text });
|
|
2576
2757
|
const before = text.slice(0, index);
|
|
2577
2758
|
const match = text.slice(index, index + query.length);
|
|
2578
2759
|
const after = text.slice(index + query.length);
|
|
2579
|
-
return /* @__PURE__ */
|
|
2760
|
+
return /* @__PURE__ */ jsxs11(Fragment5, { children: [
|
|
2580
2761
|
before,
|
|
2581
|
-
/* @__PURE__ */
|
|
2582
|
-
|
|
2762
|
+
/* @__PURE__ */ jsx25(
|
|
2763
|
+
Box13,
|
|
2583
2764
|
{
|
|
2584
2765
|
component: "span",
|
|
2585
2766
|
sx: {
|
|
@@ -2604,7 +2785,7 @@ function BiampGlobalSearchListItem({
|
|
|
2604
2785
|
const maxChips = 3;
|
|
2605
2786
|
const chips = option.associatedItems?.slice(0, maxChips) ?? [];
|
|
2606
2787
|
const overflow = (option.associatedItems?.length ?? 0) - maxChips;
|
|
2607
|
-
return /* @__PURE__ */
|
|
2788
|
+
return /* @__PURE__ */ jsxs11(
|
|
2608
2789
|
"li",
|
|
2609
2790
|
{
|
|
2610
2791
|
...rest,
|
|
@@ -2616,8 +2797,8 @@ function BiampGlobalSearchListItem({
|
|
|
2616
2797
|
...rest.style
|
|
2617
2798
|
},
|
|
2618
2799
|
children: [
|
|
2619
|
-
option.icon && /* @__PURE__ */
|
|
2620
|
-
|
|
2800
|
+
option.icon && /* @__PURE__ */ jsx25(
|
|
2801
|
+
Box13,
|
|
2621
2802
|
{
|
|
2622
2803
|
sx: {
|
|
2623
2804
|
width: 24,
|
|
@@ -2630,8 +2811,8 @@ function BiampGlobalSearchListItem({
|
|
|
2630
2811
|
children: option.icon
|
|
2631
2812
|
}
|
|
2632
2813
|
),
|
|
2633
|
-
/* @__PURE__ */
|
|
2634
|
-
option.subtitle && /* @__PURE__ */
|
|
2814
|
+
/* @__PURE__ */ jsx25(Typography6, { variant: "body2", noWrap: true, sx: { flexShrink: 0 }, children: /* @__PURE__ */ jsx25(HighlightText, { text: option.title, query }) }),
|
|
2815
|
+
option.subtitle && /* @__PURE__ */ jsx25(
|
|
2635
2816
|
Typography6,
|
|
2636
2817
|
{
|
|
2637
2818
|
className: "hoverContent",
|
|
@@ -2642,8 +2823,8 @@ function BiampGlobalSearchListItem({
|
|
|
2642
2823
|
children: option.subtitle
|
|
2643
2824
|
}
|
|
2644
2825
|
),
|
|
2645
|
-
chips.length > 0 && /* @__PURE__ */
|
|
2646
|
-
|
|
2826
|
+
chips.length > 0 && /* @__PURE__ */ jsxs11(
|
|
2827
|
+
Box13,
|
|
2647
2828
|
{
|
|
2648
2829
|
className: "hoverContent",
|
|
2649
2830
|
sx: {
|
|
@@ -2655,7 +2836,7 @@ function BiampGlobalSearchListItem({
|
|
|
2655
2836
|
px: 2
|
|
2656
2837
|
},
|
|
2657
2838
|
children: [
|
|
2658
|
-
chips.map((item, i) => /* @__PURE__ */
|
|
2839
|
+
chips.map((item, i) => /* @__PURE__ */ jsx25(
|
|
2659
2840
|
Chip,
|
|
2660
2841
|
{
|
|
2661
2842
|
size: "small",
|
|
@@ -2673,7 +2854,7 @@ function BiampGlobalSearchListItem({
|
|
|
2673
2854
|
},
|
|
2674
2855
|
i
|
|
2675
2856
|
)),
|
|
2676
|
-
overflow > 0 && /* @__PURE__ */
|
|
2857
|
+
overflow > 0 && /* @__PURE__ */ jsx25(
|
|
2677
2858
|
Chip,
|
|
2678
2859
|
{
|
|
2679
2860
|
size: "small",
|
|
@@ -2693,8 +2874,8 @@ function BiampGlobalSearchListItem({
|
|
|
2693
2874
|
]
|
|
2694
2875
|
}
|
|
2695
2876
|
),
|
|
2696
|
-
option.endIcon && /* @__PURE__ */
|
|
2697
|
-
|
|
2877
|
+
option.endIcon && /* @__PURE__ */ jsx25(
|
|
2878
|
+
Box13,
|
|
2698
2879
|
{
|
|
2699
2880
|
className: "endIcon",
|
|
2700
2881
|
sx: {
|
|
@@ -2741,7 +2922,7 @@ function BiampGlobalSearch({
|
|
|
2741
2922
|
}
|
|
2742
2923
|
onInputChange?.(event, value, reason);
|
|
2743
2924
|
};
|
|
2744
|
-
return /* @__PURE__ */
|
|
2925
|
+
return /* @__PURE__ */ jsx25(
|
|
2745
2926
|
SearchContext.Provider,
|
|
2746
2927
|
{
|
|
2747
2928
|
value: {
|
|
@@ -2750,7 +2931,7 @@ function BiampGlobalSearch({
|
|
|
2750
2931
|
noResultsText,
|
|
2751
2932
|
query: inputValueProp ?? ""
|
|
2752
2933
|
},
|
|
2753
|
-
children: /* @__PURE__ */
|
|
2934
|
+
children: /* @__PURE__ */ jsx25(
|
|
2754
2935
|
Autocomplete,
|
|
2755
2936
|
{
|
|
2756
2937
|
options,
|
|
@@ -2758,7 +2939,7 @@ function BiampGlobalSearch({
|
|
|
2758
2939
|
loading,
|
|
2759
2940
|
onChange: handleChange,
|
|
2760
2941
|
onInputChange: handleInputChange,
|
|
2761
|
-
loadingText: /* @__PURE__ */
|
|
2942
|
+
loadingText: /* @__PURE__ */ jsx25(Typography6, { variant: "body2", color: "text.secondary", children: "Loading\u2026" }),
|
|
2762
2943
|
freeSolo: true,
|
|
2763
2944
|
filterOptions: (x) => x,
|
|
2764
2945
|
getOptionLabel: (option) => typeof option === "string" ? option : option.title,
|
|
@@ -2782,7 +2963,7 @@ function BiampGlobalSearch({
|
|
|
2782
2963
|
}
|
|
2783
2964
|
}
|
|
2784
2965
|
},
|
|
2785
|
-
renderInput: (params) => /* @__PURE__ */
|
|
2966
|
+
renderInput: (params) => /* @__PURE__ */ jsx25(
|
|
2786
2967
|
TextField3,
|
|
2787
2968
|
{
|
|
2788
2969
|
...params,
|
|
@@ -2798,15 +2979,15 @@ function BiampGlobalSearch({
|
|
|
2798
2979
|
slotProps: {
|
|
2799
2980
|
input: {
|
|
2800
2981
|
...params.InputProps,
|
|
2801
|
-
startAdornment: /* @__PURE__ */
|
|
2802
|
-
/* @__PURE__ */
|
|
2982
|
+
startAdornment: /* @__PURE__ */ jsxs11(Fragment5, { children: [
|
|
2983
|
+
/* @__PURE__ */ jsx25(InputAdornment3, { position: "start", children: /* @__PURE__ */ jsx25(SearchIcon3, {}) }),
|
|
2803
2984
|
params.InputProps.startAdornment
|
|
2804
2985
|
] })
|
|
2805
2986
|
}
|
|
2806
2987
|
}
|
|
2807
2988
|
}
|
|
2808
2989
|
),
|
|
2809
|
-
renderOption: (optionProps, option) => /* @__PURE__ */
|
|
2990
|
+
renderOption: (optionProps, option) => /* @__PURE__ */ jsx25(
|
|
2810
2991
|
BiampGlobalSearchListItem,
|
|
2811
2992
|
{
|
|
2812
2993
|
option,
|
|
@@ -2823,9 +3004,9 @@ function BiampGlobalSearch({
|
|
|
2823
3004
|
|
|
2824
3005
|
// src/UserInitialsIcon/UserInitialsIcon.tsx
|
|
2825
3006
|
var import_randomcolor = __toESM(require_randomColor(), 1);
|
|
2826
|
-
import { Box as
|
|
3007
|
+
import { Box as Box14, Typography as Typography7 } from "@mui/material";
|
|
2827
3008
|
import { darken } from "@mui/material/styles";
|
|
2828
|
-
import { jsx as
|
|
3009
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
2829
3010
|
var DEFAULT_SIZE = 40;
|
|
2830
3011
|
var DEFAULT_BORDER_RADIUS = 1.5;
|
|
2831
3012
|
var TEXT_RATIO = 0.4;
|
|
@@ -2843,8 +3024,8 @@ function UserInitialsIcon({
|
|
|
2843
3024
|
const textColor = darken((0, import_randomcolor.default)({ luminosity: "dark", seed: id }), 0.3);
|
|
2844
3025
|
const size = typeof width === "number" ? width : DEFAULT_SIZE;
|
|
2845
3026
|
const fontSize = size * TEXT_RATIO;
|
|
2846
|
-
return /* @__PURE__ */
|
|
2847
|
-
|
|
3027
|
+
return /* @__PURE__ */ jsx26(
|
|
3028
|
+
Box14,
|
|
2848
3029
|
{
|
|
2849
3030
|
minWidth: width,
|
|
2850
3031
|
width,
|
|
@@ -2857,7 +3038,7 @@ function UserInitialsIcon({
|
|
|
2857
3038
|
justifyContent: "center",
|
|
2858
3039
|
sx: { ...sx },
|
|
2859
3040
|
...props,
|
|
2860
|
-
children: /* @__PURE__ */
|
|
3041
|
+
children: /* @__PURE__ */ jsx26(
|
|
2861
3042
|
Typography7,
|
|
2862
3043
|
{
|
|
2863
3044
|
variant: "h3",
|
|
@@ -2880,9 +3061,9 @@ var getInitials = (name) => {
|
|
|
2880
3061
|
};
|
|
2881
3062
|
|
|
2882
3063
|
// src/DynamicSvgIcon/DynamicSvgIcon.tsx
|
|
2883
|
-
import { SvgIcon, Skeleton, Box as
|
|
2884
|
-
import { useEffect as
|
|
2885
|
-
import { jsx as
|
|
3064
|
+
import { SvgIcon, Skeleton, Box as Box15 } from "@mui/material";
|
|
3065
|
+
import { useEffect as useEffect6, useState as useState6 } from "react";
|
|
3066
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
2886
3067
|
var svgCache = /* @__PURE__ */ new Map();
|
|
2887
3068
|
function clearDynamicSvgIconCache() {
|
|
2888
3069
|
svgCache.clear();
|
|
@@ -2903,7 +3084,7 @@ function useDynamicSvgIcon(url, options = {}) {
|
|
|
2903
3084
|
});
|
|
2904
3085
|
const [loading, setLoading] = useState6(() => !svgCache.has(url));
|
|
2905
3086
|
const [error, setError] = useState6(null);
|
|
2906
|
-
|
|
3087
|
+
useEffect6(() => {
|
|
2907
3088
|
if (!url) {
|
|
2908
3089
|
setLoading(false);
|
|
2909
3090
|
setError("No URL provided");
|
|
@@ -2984,7 +3165,7 @@ function DynamicSvgIcon({
|
|
|
2984
3165
|
onError
|
|
2985
3166
|
});
|
|
2986
3167
|
if (loading) {
|
|
2987
|
-
return /* @__PURE__ */
|
|
3168
|
+
return /* @__PURE__ */ jsx27(
|
|
2988
3169
|
Skeleton,
|
|
2989
3170
|
{
|
|
2990
3171
|
variant: skeletonVariant,
|
|
@@ -2994,8 +3175,8 @@ function DynamicSvgIcon({
|
|
|
2994
3175
|
);
|
|
2995
3176
|
}
|
|
2996
3177
|
if (error || !svgContent) {
|
|
2997
|
-
return /* @__PURE__ */
|
|
2998
|
-
|
|
3178
|
+
return /* @__PURE__ */ jsx27(
|
|
3179
|
+
Box15,
|
|
2999
3180
|
{
|
|
3000
3181
|
sx: {
|
|
3001
3182
|
width,
|
|
@@ -3014,7 +3195,7 @@ function DynamicSvgIcon({
|
|
|
3014
3195
|
}
|
|
3015
3196
|
);
|
|
3016
3197
|
}
|
|
3017
|
-
return /* @__PURE__ */
|
|
3198
|
+
return /* @__PURE__ */ jsx27(
|
|
3018
3199
|
SvgIcon,
|
|
3019
3200
|
{
|
|
3020
3201
|
...svgIconProps,
|
|
@@ -3024,7 +3205,7 @@ function DynamicSvgIcon({
|
|
|
3024
3205
|
width,
|
|
3025
3206
|
height
|
|
3026
3207
|
},
|
|
3027
|
-
children: /* @__PURE__ */
|
|
3208
|
+
children: /* @__PURE__ */ jsx27("g", { dangerouslySetInnerHTML: { __html: svgContent } })
|
|
3028
3209
|
}
|
|
3029
3210
|
);
|
|
3030
3211
|
}
|