@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.cjs
CHANGED
|
@@ -950,10 +950,10 @@ function BiampLayout({
|
|
|
950
950
|
}
|
|
951
951
|
|
|
952
952
|
// src/BiampTable/BiampTable.tsx
|
|
953
|
-
var
|
|
954
|
-
var
|
|
955
|
-
var
|
|
956
|
-
var
|
|
953
|
+
var import_material9 = require("@mui/material");
|
|
954
|
+
var import_assets6 = require("@bwp-web/assets");
|
|
955
|
+
var import_react_table2 = require("@tanstack/react-table");
|
|
956
|
+
var import_react5 = require("react");
|
|
957
957
|
|
|
958
958
|
// src/BiampTable/BiampTableEmptyState.tsx
|
|
959
959
|
var import_assets3 = require("@bwp-web/assets");
|
|
@@ -1009,6 +1009,12 @@ function BiampTableErrorState({
|
|
|
1009
1009
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(BiampTableStatusMessage, { role: "alert", icon, title, ...rest });
|
|
1010
1010
|
}
|
|
1011
1011
|
|
|
1012
|
+
// src/BiampTable/BiampTableRow.tsx
|
|
1013
|
+
var import_material8 = require("@mui/material");
|
|
1014
|
+
var import_assets5 = require("@bwp-web/assets");
|
|
1015
|
+
var import_react_table = require("@tanstack/react-table");
|
|
1016
|
+
var import_react3 = __toESM(require("react"), 1);
|
|
1017
|
+
|
|
1012
1018
|
// src/BiampTable/BiampTableTruncatedCell.tsx
|
|
1013
1019
|
var import_material6 = require("@mui/material");
|
|
1014
1020
|
var import_react2 = require("react");
|
|
@@ -1055,37 +1061,6 @@ function BiampTableTruncatedCell({
|
|
|
1055
1061
|
);
|
|
1056
1062
|
}
|
|
1057
1063
|
|
|
1058
|
-
// src/BiampTable/useLoadingDelay.ts
|
|
1059
|
-
var import_react3 = require("react");
|
|
1060
|
-
function useLoadingDelay(loading, { delay = 150, minDuration = 500 } = {}) {
|
|
1061
|
-
const [status, setStatus] = (0, import_react3.useState)("idle");
|
|
1062
|
-
const timeoutRef = (0, import_react3.useRef)(null);
|
|
1063
|
-
function clearPending() {
|
|
1064
|
-
if (timeoutRef.current !== null) {
|
|
1065
|
-
clearTimeout(timeoutRef.current);
|
|
1066
|
-
timeoutRef.current = null;
|
|
1067
|
-
}
|
|
1068
|
-
}
|
|
1069
|
-
(0, import_react3.useEffect)(() => {
|
|
1070
|
-
if (loading && status === "idle") {
|
|
1071
|
-
clearPending();
|
|
1072
|
-
timeoutRef.current = setTimeout(() => {
|
|
1073
|
-
timeoutRef.current = setTimeout(() => {
|
|
1074
|
-
setStatus("ending");
|
|
1075
|
-
}, minDuration);
|
|
1076
|
-
setStatus("loading");
|
|
1077
|
-
}, delay);
|
|
1078
|
-
setStatus("delaying");
|
|
1079
|
-
}
|
|
1080
|
-
if (!loading && status !== "loading") {
|
|
1081
|
-
clearPending();
|
|
1082
|
-
setStatus("idle");
|
|
1083
|
-
}
|
|
1084
|
-
}, [loading, delay, minDuration, status]);
|
|
1085
|
-
(0, import_react3.useEffect)(() => clearPending, []);
|
|
1086
|
-
return status === "loading" || status === "ending";
|
|
1087
|
-
}
|
|
1088
|
-
|
|
1089
1064
|
// src/BiampTable/slotProps.ts
|
|
1090
1065
|
function resolveSlot(slot, ctx) {
|
|
1091
1066
|
if (!slot) return void 0;
|
|
@@ -1095,19 +1070,7 @@ function mergeSx(...inputs) {
|
|
|
1095
1070
|
return inputs.filter((v) => Boolean(v)).flatMap((v) => Array.isArray(v) ? v : [v]);
|
|
1096
1071
|
}
|
|
1097
1072
|
|
|
1098
|
-
// src/BiampTable/
|
|
1099
|
-
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1100
|
-
var overlaySx = {
|
|
1101
|
-
position: "absolute",
|
|
1102
|
-
top: 0,
|
|
1103
|
-
left: 0,
|
|
1104
|
-
right: 0,
|
|
1105
|
-
bottom: 0,
|
|
1106
|
-
display: "flex",
|
|
1107
|
-
alignItems: "center",
|
|
1108
|
-
justifyContent: "center",
|
|
1109
|
-
pointerEvents: "none"
|
|
1110
|
-
};
|
|
1073
|
+
// src/BiampTable/cellSx.ts
|
|
1111
1074
|
var stickyHoverBg = {
|
|
1112
1075
|
".MuiTableRow-hover:hover > &, .Mui-selected > &": {
|
|
1113
1076
|
bgcolor: ({ palette }) => palette.mode === "dark" ? palette.grey[800] : palette.grey[100]
|
|
@@ -1133,6 +1096,126 @@ function cellSx(sticky, minWidth, zIndex) {
|
|
|
1133
1096
|
"&:has([data-truncate])": { maxWidth: mw, whiteSpace: "normal" }
|
|
1134
1097
|
};
|
|
1135
1098
|
}
|
|
1099
|
+
|
|
1100
|
+
// src/BiampTable/BiampTableExpandGuidelines.tsx
|
|
1101
|
+
var import_material7 = require("@mui/material");
|
|
1102
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1103
|
+
var guidelineIndent = 28;
|
|
1104
|
+
var guidelineCellPaddingLeft = 12;
|
|
1105
|
+
var guidelineLineOffsetFromParentText = 4;
|
|
1106
|
+
var guidelineElbowGapToChildText = 12;
|
|
1107
|
+
var guidelineFirstChildTopExtension = 12;
|
|
1108
|
+
var guidelineColor = ({ palette }) => palette.dividers.secondary;
|
|
1109
|
+
var guidelineStroke = "0.6px";
|
|
1110
|
+
function isLastChildOfParent(row) {
|
|
1111
|
+
const parent = row.getParentRow();
|
|
1112
|
+
if (!parent) return false;
|
|
1113
|
+
const siblings = parent.subRows;
|
|
1114
|
+
return siblings[siblings.length - 1]?.id === row.id;
|
|
1115
|
+
}
|
|
1116
|
+
function isFirstChildOfParent(row) {
|
|
1117
|
+
const parent = row.getParentRow();
|
|
1118
|
+
if (!parent) return false;
|
|
1119
|
+
return parent.subRows[0]?.id === row.id;
|
|
1120
|
+
}
|
|
1121
|
+
function getAncestorAtDepth(row, targetDepth) {
|
|
1122
|
+
let current = row;
|
|
1123
|
+
while (current && current.depth > targetDepth) {
|
|
1124
|
+
current = current.getParentRow();
|
|
1125
|
+
}
|
|
1126
|
+
return current && current.depth === targetDepth ? current : void 0;
|
|
1127
|
+
}
|
|
1128
|
+
function ExpandGuidelines({ row }) {
|
|
1129
|
+
const verticalX = (k) => guidelineCellPaddingLeft + (k - 1) * guidelineIndent + guidelineLineOffsetFromParentText;
|
|
1130
|
+
const elbowEnd = guidelineCellPaddingLeft + row.depth * guidelineIndent - guidelineElbowGapToChildText;
|
|
1131
|
+
const lines = [];
|
|
1132
|
+
for (let k = 1; k < row.depth; k++) {
|
|
1133
|
+
const ancestor = getAncestorAtDepth(row, k);
|
|
1134
|
+
if (!ancestor || isLastChildOfParent(ancestor)) continue;
|
|
1135
|
+
lines.push(
|
|
1136
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1137
|
+
import_material7.Box,
|
|
1138
|
+
{
|
|
1139
|
+
"aria-hidden": true,
|
|
1140
|
+
sx: {
|
|
1141
|
+
position: "absolute",
|
|
1142
|
+
left: `${verticalX(k)}px`,
|
|
1143
|
+
top: 0,
|
|
1144
|
+
bottom: 0,
|
|
1145
|
+
width: guidelineStroke,
|
|
1146
|
+
bgcolor: guidelineColor,
|
|
1147
|
+
pointerEvents: "none"
|
|
1148
|
+
}
|
|
1149
|
+
},
|
|
1150
|
+
`v-${k}`
|
|
1151
|
+
)
|
|
1152
|
+
);
|
|
1153
|
+
}
|
|
1154
|
+
const elbowX = verticalX(row.depth);
|
|
1155
|
+
const rowIsLast = isLastChildOfParent(row);
|
|
1156
|
+
const rowIsFirst = isFirstChildOfParent(row);
|
|
1157
|
+
const elbowTopOffset = rowIsFirst ? -guidelineFirstChildTopExtension : 0;
|
|
1158
|
+
lines.push(
|
|
1159
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1160
|
+
import_material7.Box,
|
|
1161
|
+
{
|
|
1162
|
+
"aria-hidden": true,
|
|
1163
|
+
sx: {
|
|
1164
|
+
position: "absolute",
|
|
1165
|
+
left: `${elbowX}px`,
|
|
1166
|
+
top: `${elbowTopOffset}px`,
|
|
1167
|
+
height: `calc(50% - ${elbowTopOffset}px)`,
|
|
1168
|
+
width: guidelineStroke,
|
|
1169
|
+
bgcolor: guidelineColor,
|
|
1170
|
+
pointerEvents: "none"
|
|
1171
|
+
}
|
|
1172
|
+
},
|
|
1173
|
+
"v-elbow-top"
|
|
1174
|
+
)
|
|
1175
|
+
);
|
|
1176
|
+
if (!rowIsLast) {
|
|
1177
|
+
lines.push(
|
|
1178
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1179
|
+
import_material7.Box,
|
|
1180
|
+
{
|
|
1181
|
+
"aria-hidden": true,
|
|
1182
|
+
sx: {
|
|
1183
|
+
position: "absolute",
|
|
1184
|
+
left: `${elbowX}px`,
|
|
1185
|
+
top: "50%",
|
|
1186
|
+
bottom: 0,
|
|
1187
|
+
width: guidelineStroke,
|
|
1188
|
+
bgcolor: guidelineColor,
|
|
1189
|
+
pointerEvents: "none"
|
|
1190
|
+
}
|
|
1191
|
+
},
|
|
1192
|
+
"v-elbow-bottom"
|
|
1193
|
+
)
|
|
1194
|
+
);
|
|
1195
|
+
}
|
|
1196
|
+
lines.push(
|
|
1197
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1198
|
+
import_material7.Box,
|
|
1199
|
+
{
|
|
1200
|
+
"aria-hidden": true,
|
|
1201
|
+
sx: {
|
|
1202
|
+
position: "absolute",
|
|
1203
|
+
left: `${elbowX}px`,
|
|
1204
|
+
top: "50%",
|
|
1205
|
+
width: `${elbowEnd - elbowX}px`,
|
|
1206
|
+
height: guidelineStroke,
|
|
1207
|
+
bgcolor: guidelineColor,
|
|
1208
|
+
pointerEvents: "none"
|
|
1209
|
+
}
|
|
1210
|
+
},
|
|
1211
|
+
"h-elbow"
|
|
1212
|
+
)
|
|
1213
|
+
);
|
|
1214
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children: lines });
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
// src/BiampTable/BiampTableRow.tsx
|
|
1218
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1136
1219
|
var rowCursorPointerSx = { cursor: "pointer" };
|
|
1137
1220
|
var selectionCellSx = {
|
|
1138
1221
|
position: "sticky",
|
|
@@ -1148,13 +1231,80 @@ var expandCellBaseSx = {
|
|
|
1148
1231
|
gap: "2px"
|
|
1149
1232
|
};
|
|
1150
1233
|
var expandPlaceholderSx = { width: 28 };
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
}
|
|
1157
|
-
|
|
1234
|
+
function ExpandToggle({
|
|
1235
|
+
row,
|
|
1236
|
+
isExpanded,
|
|
1237
|
+
hasExpandableRows,
|
|
1238
|
+
rowLabel
|
|
1239
|
+
}) {
|
|
1240
|
+
if (row.getCanExpand()) {
|
|
1241
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1242
|
+
import_material8.IconButton,
|
|
1243
|
+
{
|
|
1244
|
+
variant: "none",
|
|
1245
|
+
onClick: (e) => {
|
|
1246
|
+
e.stopPropagation();
|
|
1247
|
+
row.toggleExpanded();
|
|
1248
|
+
},
|
|
1249
|
+
"aria-label": isExpanded ? `Collapse ${rowLabel}` : `Expand ${rowLabel}`,
|
|
1250
|
+
"aria-expanded": isExpanded,
|
|
1251
|
+
children: isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1252
|
+
import_assets5.ChevronDownIcon,
|
|
1253
|
+
{
|
|
1254
|
+
variant: "xs",
|
|
1255
|
+
sx: { color: ({ palette }) => palette.text.secondary }
|
|
1256
|
+
}
|
|
1257
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1258
|
+
import_assets5.ChevronRightIcon,
|
|
1259
|
+
{
|
|
1260
|
+
variant: "xs",
|
|
1261
|
+
sx: { color: ({ palette }) => palette.text.secondary }
|
|
1262
|
+
}
|
|
1263
|
+
)
|
|
1264
|
+
}
|
|
1265
|
+
);
|
|
1266
|
+
}
|
|
1267
|
+
if (hasExpandableRows) return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_material8.Box, { sx: expandPlaceholderSx });
|
|
1268
|
+
return null;
|
|
1269
|
+
}
|
|
1270
|
+
function renderCellContent({
|
|
1271
|
+
cell,
|
|
1272
|
+
row,
|
|
1273
|
+
isExpandCell,
|
|
1274
|
+
alwaysExpanded,
|
|
1275
|
+
isExpanded,
|
|
1276
|
+
hasExpandableRows,
|
|
1277
|
+
getRowLabel
|
|
1278
|
+
}) {
|
|
1279
|
+
const sticky = cell.column.columnDef.meta?.sticky;
|
|
1280
|
+
const content = (0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext());
|
|
1281
|
+
if (sticky) return content;
|
|
1282
|
+
const truncate = cell.column.columnDef.meta?.truncate ?? true;
|
|
1283
|
+
const truncated = truncate ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(BiampTableTruncatedCell, { children: content }) : content;
|
|
1284
|
+
if (!isExpandCell) return truncated;
|
|
1285
|
+
if (alwaysExpanded) {
|
|
1286
|
+
return row.depth > 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_material8.Box, { sx: { pl: `${row.depth * 28}px` }, children: truncated }) : truncated;
|
|
1287
|
+
}
|
|
1288
|
+
const rowLabel = getRowLabel ? getRowLabel(row.original) : `row ${row.index + 1}`;
|
|
1289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1290
|
+
import_material8.Box,
|
|
1291
|
+
{
|
|
1292
|
+
sx: row.depth > 0 ? { ...expandCellBaseSx, pl: `${row.depth * 12}px` } : expandCellBaseSx,
|
|
1293
|
+
children: [
|
|
1294
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1295
|
+
ExpandToggle,
|
|
1296
|
+
{
|
|
1297
|
+
row,
|
|
1298
|
+
isExpanded,
|
|
1299
|
+
hasExpandableRows,
|
|
1300
|
+
rowLabel
|
|
1301
|
+
}
|
|
1302
|
+
),
|
|
1303
|
+
truncated
|
|
1304
|
+
]
|
|
1305
|
+
}
|
|
1306
|
+
);
|
|
1307
|
+
}
|
|
1158
1308
|
function BiampTableRowInner({
|
|
1159
1309
|
row,
|
|
1160
1310
|
isExpanded,
|
|
@@ -1163,7 +1313,9 @@ function BiampTableRowInner({
|
|
|
1163
1313
|
isRowClickable,
|
|
1164
1314
|
enableRowSelection,
|
|
1165
1315
|
enableExpanding,
|
|
1316
|
+
alwaysExpanded,
|
|
1166
1317
|
selectChildrenWithParent,
|
|
1318
|
+
showExpandGuidelines,
|
|
1167
1319
|
getRowLabel,
|
|
1168
1320
|
hasExpandableRows,
|
|
1169
1321
|
customColor,
|
|
@@ -1178,8 +1330,8 @@ function BiampTableRowInner({
|
|
|
1178
1330
|
onKeyDown: userRowOnKeyDown,
|
|
1179
1331
|
...restRowProps
|
|
1180
1332
|
} = resolvedRow ?? {};
|
|
1181
|
-
return /* @__PURE__ */ (0,
|
|
1182
|
-
|
|
1333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1334
|
+
import_material8.TableRow,
|
|
1183
1335
|
{
|
|
1184
1336
|
...restRowProps,
|
|
1185
1337
|
hover: clickable,
|
|
@@ -1203,16 +1355,16 @@ function BiampTableRowInner({
|
|
|
1203
1355
|
userRowOnKeyDown?.(e);
|
|
1204
1356
|
} : userRowOnKeyDown,
|
|
1205
1357
|
children: [
|
|
1206
|
-
enableRowSelection && /* @__PURE__ */ (0,
|
|
1207
|
-
|
|
1358
|
+
enableRowSelection && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1359
|
+
import_material8.TableCell,
|
|
1208
1360
|
{
|
|
1209
1361
|
padding: "checkbox",
|
|
1210
1362
|
sx: mergeSx(
|
|
1211
1363
|
selectionCellSx,
|
|
1212
1364
|
customColor ? { backgroundColor: customColor } : void 0
|
|
1213
1365
|
),
|
|
1214
|
-
children: /* @__PURE__ */ (0,
|
|
1215
|
-
|
|
1366
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1367
|
+
import_material8.Checkbox,
|
|
1216
1368
|
{
|
|
1217
1369
|
checked: isSelected,
|
|
1218
1370
|
disabled: !row.getCanSelect(),
|
|
@@ -1233,68 +1385,33 @@ function BiampTableRowInner({
|
|
|
1233
1385
|
row.getVisibleCells().map((cell, cellIndex, cells) => {
|
|
1234
1386
|
const sticky = cell.column.columnDef.meta?.sticky;
|
|
1235
1387
|
const isExpandCell = enableExpanding && !sticky && cellIndex === cells.findIndex((c) => !c.column.columnDef.meta?.sticky);
|
|
1236
|
-
const
|
|
1237
|
-
cell.column.columnDef.cell,
|
|
1238
|
-
cell.getContext()
|
|
1239
|
-
);
|
|
1388
|
+
const showGuidelinesOnCell = isExpandCell && showExpandGuidelines && alwaysExpanded && row.depth > 0;
|
|
1240
1389
|
const resolvedCell = resolveSlot(cellSlotProps, { cell });
|
|
1241
1390
|
const { sx: userCellSx, ...restCellProps } = resolvedCell ?? {};
|
|
1242
|
-
return /* @__PURE__ */ (0,
|
|
1243
|
-
|
|
1391
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1392
|
+
import_material8.TableCell,
|
|
1244
1393
|
{
|
|
1245
1394
|
...restCellProps,
|
|
1246
1395
|
"data-sticky": sticky || void 0,
|
|
1247
1396
|
sx: mergeSx(
|
|
1248
1397
|
cellSx(sticky, cell.column.columnDef.meta?.minWidth, 2),
|
|
1249
|
-
{ pl: isExpandCell ? "6px" : "12px" },
|
|
1398
|
+
{ pl: isExpandCell && !alwaysExpanded ? "6px" : "12px" },
|
|
1399
|
+
showGuidelinesOnCell ? { position: "relative" } : void 0,
|
|
1250
1400
|
sticky && customColor ? { backgroundColor: customColor } : void 0,
|
|
1251
1401
|
userCellSx
|
|
1252
1402
|
),
|
|
1253
|
-
children:
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
import_material7.IconButton,
|
|
1266
|
-
{
|
|
1267
|
-
variant: "none",
|
|
1268
|
-
onClick: (e) => {
|
|
1269
|
-
e.stopPropagation();
|
|
1270
|
-
row.toggleExpanded();
|
|
1271
|
-
},
|
|
1272
|
-
"aria-label": isExpanded ? `Collapse ${rowLabel}` : `Expand ${rowLabel}`,
|
|
1273
|
-
"aria-expanded": isExpanded,
|
|
1274
|
-
children: isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1275
|
-
import_assets5.ChevronDownIcon,
|
|
1276
|
-
{
|
|
1277
|
-
variant: "xs",
|
|
1278
|
-
sx: {
|
|
1279
|
-
color: ({ palette }) => palette.text.secondary
|
|
1280
|
-
}
|
|
1281
|
-
}
|
|
1282
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1283
|
-
import_assets5.ChevronRightIcon,
|
|
1284
|
-
{
|
|
1285
|
-
variant: "xs",
|
|
1286
|
-
sx: {
|
|
1287
|
-
color: ({ palette }) => palette.text.secondary
|
|
1288
|
-
}
|
|
1289
|
-
}
|
|
1290
|
-
)
|
|
1291
|
-
}
|
|
1292
|
-
) : hasExpandableRows ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material7.Box, { sx: expandPlaceholderSx }) : null,
|
|
1293
|
-
truncated
|
|
1294
|
-
]
|
|
1295
|
-
}
|
|
1296
|
-
);
|
|
1297
|
-
})()
|
|
1403
|
+
children: [
|
|
1404
|
+
showGuidelinesOnCell && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ExpandGuidelines, { row }),
|
|
1405
|
+
renderCellContent({
|
|
1406
|
+
cell,
|
|
1407
|
+
row,
|
|
1408
|
+
isExpandCell,
|
|
1409
|
+
alwaysExpanded,
|
|
1410
|
+
isExpanded,
|
|
1411
|
+
hasExpandableRows,
|
|
1412
|
+
getRowLabel
|
|
1413
|
+
})
|
|
1414
|
+
]
|
|
1298
1415
|
},
|
|
1299
1416
|
cell.id
|
|
1300
1417
|
);
|
|
@@ -1305,12 +1422,64 @@ function BiampTableRowInner({
|
|
|
1305
1422
|
);
|
|
1306
1423
|
}
|
|
1307
1424
|
function biampTableRowPropsAreEqual(prev, next) {
|
|
1308
|
-
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;
|
|
1425
|
+
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;
|
|
1309
1426
|
}
|
|
1310
|
-
var BiampTableRow =
|
|
1427
|
+
var BiampTableRow = import_react3.default.memo(
|
|
1311
1428
|
BiampTableRowInner,
|
|
1312
1429
|
biampTableRowPropsAreEqual
|
|
1313
1430
|
);
|
|
1431
|
+
|
|
1432
|
+
// src/BiampTable/useLoadingDelay.ts
|
|
1433
|
+
var import_react4 = require("react");
|
|
1434
|
+
function useLoadingDelay(loading, { delay = 150, minDuration = 500 } = {}) {
|
|
1435
|
+
const [status, setStatus] = (0, import_react4.useState)("idle");
|
|
1436
|
+
const timeoutRef = (0, import_react4.useRef)(null);
|
|
1437
|
+
function clearPending() {
|
|
1438
|
+
if (timeoutRef.current !== null) {
|
|
1439
|
+
clearTimeout(timeoutRef.current);
|
|
1440
|
+
timeoutRef.current = null;
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1443
|
+
(0, import_react4.useEffect)(() => {
|
|
1444
|
+
if (loading && status === "idle") {
|
|
1445
|
+
clearPending();
|
|
1446
|
+
timeoutRef.current = setTimeout(() => {
|
|
1447
|
+
timeoutRef.current = setTimeout(() => {
|
|
1448
|
+
setStatus("ending");
|
|
1449
|
+
}, minDuration);
|
|
1450
|
+
setStatus("loading");
|
|
1451
|
+
}, delay);
|
|
1452
|
+
setStatus("delaying");
|
|
1453
|
+
}
|
|
1454
|
+
if (!loading && status !== "loading") {
|
|
1455
|
+
clearPending();
|
|
1456
|
+
setStatus("idle");
|
|
1457
|
+
}
|
|
1458
|
+
}, [loading, delay, minDuration, status]);
|
|
1459
|
+
(0, import_react4.useEffect)(() => clearPending, []);
|
|
1460
|
+
return status === "loading" || status === "ending";
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
// src/BiampTable/BiampTable.tsx
|
|
1464
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1465
|
+
var overlaySx = {
|
|
1466
|
+
position: "absolute",
|
|
1467
|
+
top: 0,
|
|
1468
|
+
left: 0,
|
|
1469
|
+
right: 0,
|
|
1470
|
+
bottom: 0,
|
|
1471
|
+
display: "flex",
|
|
1472
|
+
alignItems: "center",
|
|
1473
|
+
justifyContent: "center",
|
|
1474
|
+
pointerEvents: "none"
|
|
1475
|
+
};
|
|
1476
|
+
var headerSelectionCellSx = {
|
|
1477
|
+
position: "sticky",
|
|
1478
|
+
left: 0,
|
|
1479
|
+
zIndex: 3,
|
|
1480
|
+
bgcolor: "background.paper"
|
|
1481
|
+
};
|
|
1482
|
+
var checkboxHiddenHeaderSx = { visibility: "hidden" };
|
|
1314
1483
|
function BiampTable({
|
|
1315
1484
|
table,
|
|
1316
1485
|
onRowClick,
|
|
@@ -1320,8 +1489,10 @@ function BiampTable({
|
|
|
1320
1489
|
empty,
|
|
1321
1490
|
enableRowSelection = false,
|
|
1322
1491
|
enableExpanding = false,
|
|
1492
|
+
alwaysExpanded = false,
|
|
1323
1493
|
hideSelectAll,
|
|
1324
1494
|
selectChildrenWithParent = false,
|
|
1495
|
+
showExpandGuidelines = false,
|
|
1325
1496
|
getRowLabel,
|
|
1326
1497
|
setRowColor,
|
|
1327
1498
|
slotProps,
|
|
@@ -1339,16 +1510,21 @@ function BiampTable({
|
|
|
1339
1510
|
},
|
|
1340
1511
|
enableRowSelection ? 48 : 0
|
|
1341
1512
|
);
|
|
1342
|
-
const containerRef = (0,
|
|
1513
|
+
const containerRef = (0, import_react5.useRef)(null);
|
|
1514
|
+
(0, import_react5.useEffect)(() => {
|
|
1515
|
+
if (enableExpanding && alwaysExpanded) {
|
|
1516
|
+
table.toggleAllRowsExpanded(true);
|
|
1517
|
+
}
|
|
1518
|
+
}, [enableExpanding, alwaysExpanded, table]);
|
|
1343
1519
|
const showLoading = useLoadingDelay(!!loading);
|
|
1344
1520
|
const rows = table.getRowModel().rows;
|
|
1345
1521
|
const hasExpandableRows = enableExpanding && rows.some((r) => r.getCanExpand());
|
|
1346
1522
|
const showError = !!error && !loading;
|
|
1347
1523
|
const showEmpty = !showError && !loading && rows.length === 0;
|
|
1348
|
-
return /* @__PURE__ */ (0,
|
|
1349
|
-
|
|
1524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1525
|
+
import_material9.TableContainer,
|
|
1350
1526
|
{
|
|
1351
|
-
component:
|
|
1527
|
+
component: import_material9.Box,
|
|
1352
1528
|
...boxProps,
|
|
1353
1529
|
ref: containerRef,
|
|
1354
1530
|
sx: {
|
|
@@ -1359,8 +1535,8 @@ function BiampTable({
|
|
|
1359
1535
|
...sx
|
|
1360
1536
|
},
|
|
1361
1537
|
children: [
|
|
1362
|
-
/* @__PURE__ */ (0,
|
|
1363
|
-
|
|
1538
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1539
|
+
import_material9.Table,
|
|
1364
1540
|
{
|
|
1365
1541
|
"aria-busy": showLoading || void 0,
|
|
1366
1542
|
...restTableSlotProps,
|
|
@@ -1369,14 +1545,14 @@ function BiampTable({
|
|
|
1369
1545
|
userTableSx
|
|
1370
1546
|
),
|
|
1371
1547
|
children: [
|
|
1372
|
-
/* @__PURE__ */ (0,
|
|
1373
|
-
|
|
1548
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_material9.TableHead, { ...restHeadSlotProps, sx: mergeSx(userHeadSx), children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1549
|
+
import_material9.TableRow,
|
|
1374
1550
|
{
|
|
1375
1551
|
...restHeaderRowSlotProps,
|
|
1376
1552
|
sx: mergeSx(userHeaderRowSx),
|
|
1377
1553
|
children: [
|
|
1378
|
-
enableRowSelection && /* @__PURE__ */ (0,
|
|
1379
|
-
|
|
1554
|
+
enableRowSelection && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_material9.TableCell, { padding: "checkbox", sx: headerSelectionCellSx, children: !hideSelectAll && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1555
|
+
import_material9.Checkbox,
|
|
1380
1556
|
{
|
|
1381
1557
|
checked: table.getIsAllPageRowsSelected(),
|
|
1382
1558
|
indeterminate: table.getIsSomePageRowsSelected(),
|
|
@@ -1391,8 +1567,8 @@ function BiampTable({
|
|
|
1391
1567
|
header
|
|
1392
1568
|
});
|
|
1393
1569
|
const { sx: userHeaderCellSx, ...restHeaderCellProps } = resolvedHeaderCell ?? {};
|
|
1394
|
-
return /* @__PURE__ */ (0,
|
|
1395
|
-
|
|
1570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1571
|
+
import_material9.TableCell,
|
|
1396
1572
|
{
|
|
1397
1573
|
...restHeaderCellProps,
|
|
1398
1574
|
"data-sticky": sticky || void 0,
|
|
@@ -1404,21 +1580,21 @@ function BiampTable({
|
|
|
1404
1580
|
cellSx(sticky, header.column.columnDef.meta?.minWidth, 3),
|
|
1405
1581
|
userHeaderCellSx
|
|
1406
1582
|
),
|
|
1407
|
-
children: header.isPlaceholder ? null : header.column.getCanSort() ? /* @__PURE__ */ (0,
|
|
1408
|
-
|
|
1583
|
+
children: header.isPlaceholder ? null : header.column.getCanSort() ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1584
|
+
import_material9.TableSortLabel,
|
|
1409
1585
|
{
|
|
1410
1586
|
active: !!header.column.getIsSorted(),
|
|
1411
1587
|
direction: header.column.getIsSorted() || "asc",
|
|
1412
1588
|
onClick: header.column.getToggleSortingHandler(),
|
|
1413
1589
|
...header.column.getIsSorted() && {
|
|
1414
|
-
IconComponent: header.column.getIsSorted() === "asc" ?
|
|
1590
|
+
IconComponent: header.column.getIsSorted() === "asc" ? import_assets6.DropdownChevronUpIcon : import_assets6.DropdownChevronDownIcon
|
|
1415
1591
|
},
|
|
1416
|
-
children: (0,
|
|
1592
|
+
children: (0, import_react_table2.flexRender)(
|
|
1417
1593
|
header.column.columnDef.header,
|
|
1418
1594
|
header.getContext()
|
|
1419
1595
|
)
|
|
1420
1596
|
}
|
|
1421
|
-
) : (0,
|
|
1597
|
+
) : (0, import_react_table2.flexRender)(
|
|
1422
1598
|
header.column.columnDef.header,
|
|
1423
1599
|
header.getContext()
|
|
1424
1600
|
)
|
|
@@ -1430,12 +1606,12 @@ function BiampTable({
|
|
|
1430
1606
|
},
|
|
1431
1607
|
headerGroup.id
|
|
1432
1608
|
)) }),
|
|
1433
|
-
/* @__PURE__ */ (0,
|
|
1434
|
-
|
|
1609
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1610
|
+
import_material9.TableBody,
|
|
1435
1611
|
{
|
|
1436
1612
|
...restBodySlotProps,
|
|
1437
1613
|
sx: mergeSx({ opacity: showLoading ? 0.3 : 1 }, userBodySx),
|
|
1438
|
-
children: !showError && rows.map((row) => /* @__PURE__ */ (0,
|
|
1614
|
+
children: !showError && rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1439
1615
|
BiampTableRow,
|
|
1440
1616
|
{
|
|
1441
1617
|
row,
|
|
@@ -1445,7 +1621,9 @@ function BiampTable({
|
|
|
1445
1621
|
isRowClickable,
|
|
1446
1622
|
enableRowSelection,
|
|
1447
1623
|
enableExpanding,
|
|
1624
|
+
alwaysExpanded,
|
|
1448
1625
|
selectChildrenWithParent,
|
|
1626
|
+
showExpandGuidelines,
|
|
1449
1627
|
getRowLabel,
|
|
1450
1628
|
hasExpandableRows,
|
|
1451
1629
|
customColor: setRowColor?.(row.original),
|
|
@@ -1459,22 +1637,22 @@ function BiampTable({
|
|
|
1459
1637
|
]
|
|
1460
1638
|
}
|
|
1461
1639
|
),
|
|
1462
|
-
showError && /* @__PURE__ */ (0,
|
|
1640
|
+
showError && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_material9.Box, { sx: overlaySx, children: error === true ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(BiampTableErrorState, { sx: { pointerEvents: "auto" } }) : error instanceof Error ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1463
1641
|
BiampTableErrorState,
|
|
1464
1642
|
{
|
|
1465
1643
|
description: error.message,
|
|
1466
1644
|
sx: { pointerEvents: "auto" }
|
|
1467
1645
|
}
|
|
1468
1646
|
) : error }),
|
|
1469
|
-
showEmpty && /* @__PURE__ */ (0,
|
|
1647
|
+
showEmpty && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_material9.Box, { sx: overlaySx, children: empty && empty !== true ? empty : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(BiampTableEmptyState, { sx: { pointerEvents: "auto" } }) })
|
|
1470
1648
|
]
|
|
1471
1649
|
}
|
|
1472
1650
|
);
|
|
1473
1651
|
}
|
|
1474
1652
|
|
|
1475
1653
|
// src/BiampTable/BiampTableContainer.tsx
|
|
1476
|
-
var
|
|
1477
|
-
var
|
|
1654
|
+
var import_material10 = require("@mui/material");
|
|
1655
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1478
1656
|
function BiampTableContainer({
|
|
1479
1657
|
withBorderTop = true,
|
|
1480
1658
|
withBorderBottom = false,
|
|
@@ -1482,8 +1660,8 @@ function BiampTableContainer({
|
|
|
1482
1660
|
sx,
|
|
1483
1661
|
...props
|
|
1484
1662
|
}) {
|
|
1485
|
-
return /* @__PURE__ */ (0,
|
|
1486
|
-
|
|
1663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1664
|
+
import_material10.Stack,
|
|
1487
1665
|
{
|
|
1488
1666
|
direction: "column",
|
|
1489
1667
|
height: "100%",
|
|
@@ -1501,25 +1679,25 @@ function BiampTableContainer({
|
|
|
1501
1679
|
}
|
|
1502
1680
|
|
|
1503
1681
|
// src/BiampTable/BiampTableCellActionButton.tsx
|
|
1504
|
-
var
|
|
1505
|
-
var
|
|
1682
|
+
var import_material11 = require("@mui/material");
|
|
1683
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1506
1684
|
function BiampTableCellActionButton({ label, icon, ...props }) {
|
|
1507
|
-
return /* @__PURE__ */ (0,
|
|
1508
|
-
|
|
1685
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1686
|
+
import_material11.Tooltip,
|
|
1509
1687
|
{
|
|
1510
1688
|
title: label,
|
|
1511
1689
|
placement: "top",
|
|
1512
1690
|
enterDelay: 500,
|
|
1513
1691
|
enterNextDelay: 500,
|
|
1514
1692
|
disableInteractive: true,
|
|
1515
|
-
children: /* @__PURE__ */ (0,
|
|
1693
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_material11.IconButton, { "aria-label": label, ...props, children: icon }) })
|
|
1516
1694
|
}
|
|
1517
1695
|
);
|
|
1518
1696
|
}
|
|
1519
1697
|
|
|
1520
1698
|
// src/BiampTable/BiampTableColumnVisibility.tsx
|
|
1521
|
-
var
|
|
1522
|
-
var
|
|
1699
|
+
var import_material12 = require("@mui/material");
|
|
1700
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1523
1701
|
function toVisibilityState(visibility) {
|
|
1524
1702
|
return visibility;
|
|
1525
1703
|
}
|
|
@@ -1562,8 +1740,8 @@ function BiampTableColumnVisibility({
|
|
|
1562
1740
|
...popoverProps
|
|
1563
1741
|
}) {
|
|
1564
1742
|
const allVisible = table.getAllLeafColumns().every((col) => col.getIsVisible());
|
|
1565
|
-
return /* @__PURE__ */ (0,
|
|
1566
|
-
|
|
1743
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1744
|
+
import_material12.Popover,
|
|
1567
1745
|
{
|
|
1568
1746
|
anchorEl,
|
|
1569
1747
|
open: Boolean(anchorEl),
|
|
@@ -1576,48 +1754,48 @@ function BiampTableColumnVisibility({
|
|
|
1576
1754
|
borderRadius: "6px",
|
|
1577
1755
|
backgroundImage: "none",
|
|
1578
1756
|
border: `0.6px solid ${palette.dividers.secondary}`,
|
|
1579
|
-
boxShadow: `0px 1px 1px 0px ${(0,
|
|
1757
|
+
boxShadow: `0px 1px 1px 0px ${(0, import_material12.alpha)(palette.common.black, 0.05)}`,
|
|
1580
1758
|
minWidth: "150px"
|
|
1581
1759
|
}),
|
|
1582
1760
|
...slotProps?.paper ?? {}
|
|
1583
1761
|
}
|
|
1584
1762
|
},
|
|
1585
1763
|
...popoverProps,
|
|
1586
|
-
children: /* @__PURE__ */ (0,
|
|
1587
|
-
/* @__PURE__ */ (0,
|
|
1588
|
-
|
|
1764
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_material12.List, { dense: true, disablePadding: true, children: [
|
|
1765
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1766
|
+
import_material12.ListItem,
|
|
1589
1767
|
{
|
|
1590
1768
|
dense: true,
|
|
1591
1769
|
sx: columnListItemSx,
|
|
1592
1770
|
onClick: () => table.toggleAllColumnsVisible(!allVisible),
|
|
1593
1771
|
children: [
|
|
1594
|
-
/* @__PURE__ */ (0,
|
|
1595
|
-
|
|
1772
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1773
|
+
import_material12.Checkbox,
|
|
1596
1774
|
{
|
|
1597
1775
|
checked: allVisible,
|
|
1598
1776
|
slotProps: { input: { "aria-label": `${showAllLabel} columns` } }
|
|
1599
1777
|
}
|
|
1600
1778
|
),
|
|
1601
|
-
/* @__PURE__ */ (0,
|
|
1779
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_material12.Typography, { variant: "caption", fontWeight: 600, children: showAllLabel })
|
|
1602
1780
|
]
|
|
1603
1781
|
}
|
|
1604
1782
|
),
|
|
1605
|
-
/* @__PURE__ */ (0,
|
|
1606
|
-
/* @__PURE__ */ (0,
|
|
1607
|
-
|
|
1783
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_material12.Divider, {}),
|
|
1784
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1785
|
+
import_material12.Box,
|
|
1608
1786
|
{
|
|
1609
1787
|
sx: { maxHeight: 340, overflow: "auto", overscrollBehavior: "none" },
|
|
1610
1788
|
children: table.getAllLeafColumns().map((column) => {
|
|
1611
1789
|
const columnName = column.columnDef.meta?.columnLabel ?? (typeof column.columnDef.header === "string" ? column.columnDef.header : column.id);
|
|
1612
|
-
return /* @__PURE__ */ (0,
|
|
1613
|
-
|
|
1790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1791
|
+
import_material12.ListItem,
|
|
1614
1792
|
{
|
|
1615
1793
|
dense: true,
|
|
1616
1794
|
sx: columnListItemSx,
|
|
1617
1795
|
onClick: column.getToggleVisibilityHandler(),
|
|
1618
1796
|
children: [
|
|
1619
|
-
/* @__PURE__ */ (0,
|
|
1620
|
-
|
|
1797
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1798
|
+
import_material12.Checkbox,
|
|
1621
1799
|
{
|
|
1622
1800
|
checked: column.getIsVisible(),
|
|
1623
1801
|
sx: { py: 1 },
|
|
@@ -1626,7 +1804,7 @@ function BiampTableColumnVisibility({
|
|
|
1626
1804
|
}
|
|
1627
1805
|
}
|
|
1628
1806
|
),
|
|
1629
|
-
/* @__PURE__ */ (0,
|
|
1807
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_material12.Typography, { variant: "caption", children: columnName })
|
|
1630
1808
|
]
|
|
1631
1809
|
},
|
|
1632
1810
|
column.id
|
|
@@ -1640,12 +1818,12 @@ function BiampTableColumnVisibility({
|
|
|
1640
1818
|
}
|
|
1641
1819
|
|
|
1642
1820
|
// src/BiampTable/BiampTableToolbarColumnVisibility.tsx
|
|
1643
|
-
var
|
|
1644
|
-
var
|
|
1821
|
+
var import_assets7 = require("@bwp-web/assets");
|
|
1822
|
+
var import_react6 = require("react");
|
|
1645
1823
|
|
|
1646
1824
|
// src/BiampTable/BiampTableToolbarActionButton.tsx
|
|
1647
|
-
var
|
|
1648
|
-
var
|
|
1825
|
+
var import_material13 = require("@mui/material");
|
|
1826
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1649
1827
|
function BiampTableToolbarActionButton({
|
|
1650
1828
|
label,
|
|
1651
1829
|
icon,
|
|
@@ -1653,13 +1831,13 @@ function BiampTableToolbarActionButton({
|
|
|
1653
1831
|
...props
|
|
1654
1832
|
}) {
|
|
1655
1833
|
const showBadge = badgeContent != null && badgeContent !== 0;
|
|
1656
|
-
return /* @__PURE__ */ (0,
|
|
1657
|
-
|
|
1834
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1835
|
+
import_material13.IconButton,
|
|
1658
1836
|
{
|
|
1659
1837
|
"aria-label": showBadge ? `${label} (${badgeContent})` : label,
|
|
1660
1838
|
...props,
|
|
1661
|
-
children: showBadge ? /* @__PURE__ */ (0,
|
|
1662
|
-
|
|
1839
|
+
children: showBadge ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1840
|
+
import_material13.Badge,
|
|
1663
1841
|
{
|
|
1664
1842
|
badgeContent,
|
|
1665
1843
|
color: "info",
|
|
@@ -1682,20 +1860,20 @@ function BiampTableToolbarActionButton({
|
|
|
1682
1860
|
}
|
|
1683
1861
|
|
|
1684
1862
|
// src/BiampTable/BiampTableToolbarColumnVisibility.tsx
|
|
1685
|
-
var
|
|
1863
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1686
1864
|
function BiampTableToolbarColumnVisibility({
|
|
1687
1865
|
table,
|
|
1688
|
-
icon = /* @__PURE__ */ (0,
|
|
1866
|
+
icon = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_assets7.ColumnsIcon, { variant: "xs" }),
|
|
1689
1867
|
label = "Columns",
|
|
1690
1868
|
defaultColumnVisibility,
|
|
1691
1869
|
showAllLabel,
|
|
1692
1870
|
...actionButtonProps
|
|
1693
1871
|
}) {
|
|
1694
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
1872
|
+
const [anchorEl, setAnchorEl] = (0, import_react6.useState)(null);
|
|
1695
1873
|
const defaults = defaultColumnVisibility ?? getDefaultColumnVisibility(table);
|
|
1696
1874
|
const dirtyCount = getColumnVisibilityDirtyCount(table, defaults);
|
|
1697
|
-
return /* @__PURE__ */ (0,
|
|
1698
|
-
/* @__PURE__ */ (0,
|
|
1875
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
1876
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1699
1877
|
BiampTableToolbarActionButton,
|
|
1700
1878
|
{
|
|
1701
1879
|
label,
|
|
@@ -1705,7 +1883,7 @@ function BiampTableToolbarColumnVisibility({
|
|
|
1705
1883
|
...actionButtonProps
|
|
1706
1884
|
}
|
|
1707
1885
|
),
|
|
1708
|
-
/* @__PURE__ */ (0,
|
|
1886
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1709
1887
|
BiampTableColumnVisibility,
|
|
1710
1888
|
{
|
|
1711
1889
|
table,
|
|
@@ -1718,9 +1896,9 @@ function BiampTableToolbarColumnVisibility({
|
|
|
1718
1896
|
}
|
|
1719
1897
|
|
|
1720
1898
|
// src/BiampTable/BiampTablePagination.tsx
|
|
1721
|
-
var
|
|
1722
|
-
var
|
|
1723
|
-
var
|
|
1899
|
+
var import_react7 = require("react");
|
|
1900
|
+
var import_material14 = require("@mui/material");
|
|
1901
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1724
1902
|
var positionMap = {
|
|
1725
1903
|
left: "flex-start",
|
|
1726
1904
|
center: "center",
|
|
@@ -1736,21 +1914,21 @@ function BiampTablePagination({
|
|
|
1736
1914
|
...paginationProps
|
|
1737
1915
|
}) {
|
|
1738
1916
|
const rowCount = table.getRowCount();
|
|
1739
|
-
const lastRowCountRef = (0,
|
|
1917
|
+
const lastRowCountRef = (0, import_react7.useRef)(rowCount);
|
|
1740
1918
|
if (!loading && rowCount >= 0) {
|
|
1741
1919
|
lastRowCountRef.current = rowCount;
|
|
1742
1920
|
}
|
|
1743
1921
|
const stableCount = loading ? lastRowCountRef.current : rowCount;
|
|
1744
1922
|
const { pageSize, pageIndex } = table.getState().pagination;
|
|
1745
1923
|
const maxPage = Math.max(0, Math.ceil(stableCount / pageSize) - 1);
|
|
1746
|
-
(0,
|
|
1924
|
+
(0, import_react7.useEffect)(() => {
|
|
1747
1925
|
if (!loading && pageIndex > maxPage) {
|
|
1748
1926
|
table.setPageIndex(maxPage);
|
|
1749
1927
|
}
|
|
1750
1928
|
}, [loading, pageIndex, maxPage, table]);
|
|
1751
1929
|
if (autoHide && (!stableCount || stableCount <= pageSize)) return null;
|
|
1752
|
-
return /* @__PURE__ */ (0,
|
|
1753
|
-
|
|
1930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1931
|
+
import_material14.TablePagination,
|
|
1754
1932
|
{
|
|
1755
1933
|
component: "div",
|
|
1756
1934
|
count: stableCount,
|
|
@@ -1781,15 +1959,15 @@ function BiampTablePagination({
|
|
|
1781
1959
|
}
|
|
1782
1960
|
|
|
1783
1961
|
// src/BiampTable/BiampTableToolbar.tsx
|
|
1784
|
-
var
|
|
1785
|
-
var
|
|
1962
|
+
var import_material15 = require("@mui/material");
|
|
1963
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1786
1964
|
function BiampTableToolbar({
|
|
1787
1965
|
children,
|
|
1788
1966
|
sx,
|
|
1789
1967
|
...props
|
|
1790
1968
|
}) {
|
|
1791
|
-
return /* @__PURE__ */ (0,
|
|
1792
|
-
|
|
1969
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1970
|
+
import_material15.Box,
|
|
1793
1971
|
{
|
|
1794
1972
|
role: "toolbar",
|
|
1795
1973
|
display: "flex",
|
|
@@ -1807,14 +1985,14 @@ function BiampTableToolbar({
|
|
|
1807
1985
|
}
|
|
1808
1986
|
|
|
1809
1987
|
// src/BiampTable/BiampTableToolbarActions.tsx
|
|
1810
|
-
var
|
|
1811
|
-
var
|
|
1988
|
+
var import_material16 = require("@mui/material");
|
|
1989
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1812
1990
|
function BiampTableToolbarActions({
|
|
1813
1991
|
children,
|
|
1814
1992
|
...props
|
|
1815
1993
|
}) {
|
|
1816
|
-
return /* @__PURE__ */ (0,
|
|
1817
|
-
|
|
1994
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1995
|
+
import_material16.Box,
|
|
1818
1996
|
{
|
|
1819
1997
|
display: "flex",
|
|
1820
1998
|
alignItems: "center",
|
|
@@ -1828,21 +2006,21 @@ function BiampTableToolbarActions({
|
|
|
1828
2006
|
}
|
|
1829
2007
|
|
|
1830
2008
|
// src/BiampTable/BiampTableToolbarExport.tsx
|
|
1831
|
-
var
|
|
1832
|
-
var
|
|
1833
|
-
var
|
|
2009
|
+
var import_material17 = require("@mui/material");
|
|
2010
|
+
var import_assets8 = require("@bwp-web/assets");
|
|
2011
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1834
2012
|
function BiampTableToolbarExport({
|
|
1835
2013
|
onExport,
|
|
1836
2014
|
loading,
|
|
1837
|
-
icon = /* @__PURE__ */ (0,
|
|
2015
|
+
icon = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_assets8.DownloadIcon, { variant: "xs" }),
|
|
1838
2016
|
label = "Export",
|
|
1839
2017
|
...props
|
|
1840
2018
|
}) {
|
|
1841
|
-
return /* @__PURE__ */ (0,
|
|
2019
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1842
2020
|
BiampTableToolbarActionButton,
|
|
1843
2021
|
{
|
|
1844
2022
|
label: loading ? `${label}, loading` : label,
|
|
1845
|
-
icon: loading ? /* @__PURE__ */ (0,
|
|
2023
|
+
icon: loading ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material17.CircularProgress, { size: 20, color: "inherit" }) : icon,
|
|
1846
2024
|
disabled: loading,
|
|
1847
2025
|
onClick: onExport,
|
|
1848
2026
|
...props
|
|
@@ -1851,16 +2029,16 @@ function BiampTableToolbarExport({
|
|
|
1851
2029
|
}
|
|
1852
2030
|
|
|
1853
2031
|
// src/BiampTable/BiampTableToolbarFilters.tsx
|
|
1854
|
-
var
|
|
1855
|
-
var
|
|
1856
|
-
var
|
|
1857
|
-
var
|
|
2032
|
+
var import_material18 = require("@mui/material");
|
|
2033
|
+
var import_assets9 = require("@bwp-web/assets");
|
|
2034
|
+
var import_react8 = require("react");
|
|
2035
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1858
2036
|
function BiampTableToolbarFilters({
|
|
1859
2037
|
activeFilterCount,
|
|
1860
2038
|
children,
|
|
1861
2039
|
onReset,
|
|
1862
2040
|
onApply,
|
|
1863
|
-
icon = /* @__PURE__ */ (0,
|
|
2041
|
+
icon = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_assets9.FilterIcon, { variant: "xs" }),
|
|
1864
2042
|
title = "Filters",
|
|
1865
2043
|
resetLabel = "Clear filters",
|
|
1866
2044
|
applyLabel = "Apply",
|
|
@@ -1868,14 +2046,14 @@ function BiampTableToolbarFilters({
|
|
|
1868
2046
|
buttonLabel = "Filters",
|
|
1869
2047
|
DrawerProps: drawerProps
|
|
1870
2048
|
}) {
|
|
1871
|
-
const [open, setOpen] = (0,
|
|
1872
|
-
const titleId = (0,
|
|
2049
|
+
const [open, setOpen] = (0, import_react8.useState)(false);
|
|
2050
|
+
const titleId = (0, import_react8.useId)();
|
|
1873
2051
|
function handleClose() {
|
|
1874
2052
|
onApply?.();
|
|
1875
2053
|
setOpen(false);
|
|
1876
2054
|
}
|
|
1877
|
-
return /* @__PURE__ */ (0,
|
|
1878
|
-
/* @__PURE__ */ (0,
|
|
2055
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
2056
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1879
2057
|
BiampTableToolbarActionButton,
|
|
1880
2058
|
{
|
|
1881
2059
|
label: buttonLabel,
|
|
@@ -1884,8 +2062,8 @@ function BiampTableToolbarFilters({
|
|
|
1884
2062
|
onClick: () => setOpen(true)
|
|
1885
2063
|
}
|
|
1886
2064
|
),
|
|
1887
|
-
/* @__PURE__ */ (0,
|
|
1888
|
-
|
|
2065
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2066
|
+
import_material18.Drawer,
|
|
1889
2067
|
{
|
|
1890
2068
|
anchor: "right",
|
|
1891
2069
|
open,
|
|
@@ -1896,17 +2074,17 @@ function BiampTableToolbarFilters({
|
|
|
1896
2074
|
sx: { width: { xs: "100%", sm: 480 } },
|
|
1897
2075
|
...drawerProps?.PaperProps
|
|
1898
2076
|
},
|
|
1899
|
-
children: /* @__PURE__ */ (0,
|
|
1900
|
-
|
|
2077
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2078
|
+
import_material18.Box,
|
|
1901
2079
|
{
|
|
1902
2080
|
height: "100%",
|
|
1903
2081
|
display: "flex",
|
|
1904
2082
|
flexDirection: "column",
|
|
1905
2083
|
justifyContent: "space-between",
|
|
1906
2084
|
children: [
|
|
1907
|
-
/* @__PURE__ */ (0,
|
|
1908
|
-
/* @__PURE__ */ (0,
|
|
1909
|
-
|
|
2085
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_material18.Box, { children: [
|
|
2086
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2087
|
+
import_material18.Box,
|
|
1910
2088
|
{
|
|
1911
2089
|
display: "flex",
|
|
1912
2090
|
justifyContent: "space-between",
|
|
@@ -1914,10 +2092,10 @@ function BiampTableToolbarFilters({
|
|
|
1914
2092
|
px: 3.5,
|
|
1915
2093
|
py: 2.5,
|
|
1916
2094
|
children: [
|
|
1917
|
-
/* @__PURE__ */ (0,
|
|
2095
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_material18.Typography, { id: titleId, variant: "h2", children: [
|
|
1918
2096
|
title,
|
|
1919
|
-
/* @__PURE__ */ (0,
|
|
1920
|
-
|
|
2097
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2098
|
+
import_material18.Badge,
|
|
1921
2099
|
{
|
|
1922
2100
|
badgeContent: activeFilterCount,
|
|
1923
2101
|
color: "secondary",
|
|
@@ -1925,21 +2103,21 @@ function BiampTableToolbarFilters({
|
|
|
1925
2103
|
}
|
|
1926
2104
|
)
|
|
1927
2105
|
] }),
|
|
1928
|
-
/* @__PURE__ */ (0,
|
|
1929
|
-
|
|
2106
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2107
|
+
import_material18.IconButton,
|
|
1930
2108
|
{
|
|
1931
2109
|
size: "medium",
|
|
1932
2110
|
onClick: handleClose,
|
|
1933
2111
|
"aria-label": closeLabel,
|
|
1934
|
-
children: /* @__PURE__ */ (0,
|
|
2112
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_assets9.CloseIcon, {})
|
|
1935
2113
|
}
|
|
1936
2114
|
)
|
|
1937
2115
|
]
|
|
1938
2116
|
}
|
|
1939
2117
|
),
|
|
1940
|
-
/* @__PURE__ */ (0,
|
|
1941
|
-
/* @__PURE__ */ (0,
|
|
1942
|
-
|
|
2118
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material18.Divider, {}),
|
|
2119
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2120
|
+
import_material18.Box,
|
|
1943
2121
|
{
|
|
1944
2122
|
role: "group",
|
|
1945
2123
|
"aria-label": "Filter options",
|
|
@@ -1952,9 +2130,9 @@ function BiampTableToolbarFilters({
|
|
|
1952
2130
|
}
|
|
1953
2131
|
)
|
|
1954
2132
|
] }),
|
|
1955
|
-
/* @__PURE__ */ (0,
|
|
1956
|
-
/* @__PURE__ */ (0,
|
|
1957
|
-
|
|
2133
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_material18.Box, { display: "flex", children: [
|
|
2134
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2135
|
+
import_material18.Button,
|
|
1958
2136
|
{
|
|
1959
2137
|
variant: "overlay",
|
|
1960
2138
|
color: "secondary",
|
|
@@ -1964,8 +2142,8 @@ function BiampTableToolbarFilters({
|
|
|
1964
2142
|
children: resetLabel
|
|
1965
2143
|
}
|
|
1966
2144
|
),
|
|
1967
|
-
/* @__PURE__ */ (0,
|
|
1968
|
-
|
|
2145
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2146
|
+
import_material18.Button,
|
|
1969
2147
|
{
|
|
1970
2148
|
variant: "overlay",
|
|
1971
2149
|
color: "primary",
|
|
@@ -1984,23 +2162,23 @@ function BiampTableToolbarFilters({
|
|
|
1984
2162
|
}
|
|
1985
2163
|
|
|
1986
2164
|
// src/BiampTable/BiampTableToolbarSearch.tsx
|
|
1987
|
-
var
|
|
1988
|
-
var
|
|
1989
|
-
var
|
|
2165
|
+
var import_material19 = require("@mui/material");
|
|
2166
|
+
var import_assets10 = require("@bwp-web/assets");
|
|
2167
|
+
var import_react10 = require("react");
|
|
1990
2168
|
|
|
1991
2169
|
// src/BiampTable/useDebouncedCallback.ts
|
|
1992
|
-
var
|
|
2170
|
+
var import_react9 = require("react");
|
|
1993
2171
|
var BIAMP_TABLE_DEBOUNCE_DELAY = 300;
|
|
1994
2172
|
function useDebouncedCallback(callback, delay = BIAMP_TABLE_DEBOUNCE_DELAY) {
|
|
1995
|
-
const timeoutRef = (0,
|
|
1996
|
-
const callbackRef = (0,
|
|
2173
|
+
const timeoutRef = (0, import_react9.useRef)(null);
|
|
2174
|
+
const callbackRef = (0, import_react9.useRef)(callback);
|
|
1997
2175
|
callbackRef.current = callback;
|
|
1998
|
-
(0,
|
|
2176
|
+
(0, import_react9.useEffect)(() => {
|
|
1999
2177
|
return () => {
|
|
2000
2178
|
if (timeoutRef.current !== null) clearTimeout(timeoutRef.current);
|
|
2001
2179
|
};
|
|
2002
2180
|
}, []);
|
|
2003
|
-
return (0,
|
|
2181
|
+
return (0, import_react9.useCallback)(
|
|
2004
2182
|
(...args) => {
|
|
2005
2183
|
if (timeoutRef.current !== null) clearTimeout(timeoutRef.current);
|
|
2006
2184
|
timeoutRef.current = setTimeout(
|
|
@@ -2013,7 +2191,7 @@ function useDebouncedCallback(callback, delay = BIAMP_TABLE_DEBOUNCE_DELAY) {
|
|
|
2013
2191
|
}
|
|
2014
2192
|
|
|
2015
2193
|
// src/BiampTable/BiampTableToolbarSearch.tsx
|
|
2016
|
-
var
|
|
2194
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2017
2195
|
var searchFieldSx = {
|
|
2018
2196
|
"& .MuiInputBase-root": {
|
|
2019
2197
|
height: "36px !important",
|
|
@@ -2037,11 +2215,11 @@ function BiampTableToolbarSearch({
|
|
|
2037
2215
|
sx,
|
|
2038
2216
|
...textFieldProps
|
|
2039
2217
|
}) {
|
|
2040
|
-
const isMobile = (0,
|
|
2041
|
-
const [inputValue, setInputValue] = (0,
|
|
2042
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
2218
|
+
const isMobile = (0, import_material19.useMediaQuery)((t) => t.breakpoints.down("md"));
|
|
2219
|
+
const [inputValue, setInputValue] = (0, import_react10.useState)(defaultValue);
|
|
2220
|
+
const [isExpanded, setIsExpanded] = (0, import_react10.useState)(false);
|
|
2043
2221
|
const debouncedOnChange = useDebouncedCallback(onChange, debounceDelay);
|
|
2044
|
-
(0,
|
|
2222
|
+
(0, import_react10.useEffect)(() => {
|
|
2045
2223
|
setInputValue(defaultValue);
|
|
2046
2224
|
}, [defaultValue]);
|
|
2047
2225
|
const handleChange = (e) => {
|
|
@@ -2057,18 +2235,18 @@ function BiampTableToolbarSearch({
|
|
|
2057
2235
|
setIsExpanded(false);
|
|
2058
2236
|
}
|
|
2059
2237
|
};
|
|
2060
|
-
const clearButton = inputValue ? /* @__PURE__ */ (0,
|
|
2061
|
-
|
|
2238
|
+
const clearButton = inputValue ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_material19.InputAdornment, { position: "end", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2239
|
+
import_material19.IconButton,
|
|
2062
2240
|
{
|
|
2063
2241
|
size: "small",
|
|
2064
2242
|
onClick: handleClear,
|
|
2065
2243
|
"aria-label": clearLabel,
|
|
2066
2244
|
sx: { mr: 0.5 },
|
|
2067
|
-
children: /* @__PURE__ */ (0,
|
|
2245
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_assets10.CloseIcon, { variant: "xs", sx: { width: 20, height: 20 } })
|
|
2068
2246
|
}
|
|
2069
2247
|
) }) : null;
|
|
2070
|
-
const textField = /* @__PURE__ */ (0,
|
|
2071
|
-
|
|
2248
|
+
const textField = /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2249
|
+
import_material19.TextField,
|
|
2072
2250
|
{
|
|
2073
2251
|
name: "search",
|
|
2074
2252
|
type: "text",
|
|
@@ -2076,8 +2254,8 @@ function BiampTableToolbarSearch({
|
|
|
2076
2254
|
slotProps: {
|
|
2077
2255
|
htmlInput: { maxLength, "aria-label": placeholder },
|
|
2078
2256
|
input: {
|
|
2079
|
-
startAdornment: /* @__PURE__ */ (0,
|
|
2080
|
-
|
|
2257
|
+
startAdornment: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_material19.InputAdornment, { position: "start", sx: { ml: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2258
|
+
import_assets10.SearchIcon,
|
|
2081
2259
|
{
|
|
2082
2260
|
variant: "xs",
|
|
2083
2261
|
color: "inherit",
|
|
@@ -2102,10 +2280,10 @@ function BiampTableToolbarSearch({
|
|
|
2102
2280
|
}
|
|
2103
2281
|
);
|
|
2104
2282
|
if (isMobile && enableMobileView) {
|
|
2105
|
-
return /* @__PURE__ */ (0,
|
|
2106
|
-
/* @__PURE__ */ (0,
|
|
2107
|
-
/* @__PURE__ */ (0,
|
|
2108
|
-
|
|
2283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_material19.Box, { display: "flex", alignItems: "center", width: "100%", pr: 1, gap: 1, children: [
|
|
2284
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_assets10.SearchIcon, { sx: { width: 16, height: 16 } }),
|
|
2285
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2286
|
+
import_material19.InputBase,
|
|
2109
2287
|
{
|
|
2110
2288
|
name: "search",
|
|
2111
2289
|
type: "text",
|
|
@@ -2126,15 +2304,15 @@ function BiampTableToolbarSearch({
|
|
|
2126
2304
|
] });
|
|
2127
2305
|
}
|
|
2128
2306
|
if (expandable) {
|
|
2129
|
-
return /* @__PURE__ */ (0,
|
|
2130
|
-
/* @__PURE__ */ (0,
|
|
2131
|
-
|
|
2307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_material19.Box, { display: "flex", alignItems: "center", minWidth: 28, children: [
|
|
2308
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2309
|
+
import_material19.IconButton,
|
|
2132
2310
|
{
|
|
2133
2311
|
"aria-label": expandLabel ?? placeholder,
|
|
2134
2312
|
onClick: () => setIsExpanded(true),
|
|
2135
2313
|
sx: { display: isExpanded || inputValue ? "none" : "flex" },
|
|
2136
|
-
children: /* @__PURE__ */ (0,
|
|
2137
|
-
|
|
2314
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2315
|
+
import_assets10.SearchIcon,
|
|
2138
2316
|
{
|
|
2139
2317
|
variant: "xs",
|
|
2140
2318
|
color: "inherit",
|
|
@@ -2143,8 +2321,8 @@ function BiampTableToolbarSearch({
|
|
|
2143
2321
|
)
|
|
2144
2322
|
}
|
|
2145
2323
|
),
|
|
2146
|
-
/* @__PURE__ */ (0,
|
|
2147
|
-
|
|
2324
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2325
|
+
import_material19.Collapse,
|
|
2148
2326
|
{
|
|
2149
2327
|
in: isExpanded || !!inputValue,
|
|
2150
2328
|
orientation: "horizontal",
|
|
@@ -2158,8 +2336,8 @@ function BiampTableToolbarSearch({
|
|
|
2158
2336
|
}
|
|
2159
2337
|
|
|
2160
2338
|
// src/BiampTable/useBiampServerSideTable.ts
|
|
2161
|
-
var
|
|
2162
|
-
var
|
|
2339
|
+
var import_react_table3 = require("@tanstack/react-table");
|
|
2340
|
+
var import_react11 = require("react");
|
|
2163
2341
|
|
|
2164
2342
|
// src/BiampTable/serverSideTableUtils.ts
|
|
2165
2343
|
function orderToSorting(order, fieldToColumnId) {
|
|
@@ -2215,8 +2393,8 @@ function getDirtyColumnVisibility(visibility, defaults) {
|
|
|
2215
2393
|
}
|
|
2216
2394
|
|
|
2217
2395
|
// src/BiampTable/useBiampServerSideTable.ts
|
|
2218
|
-
var coreRowModel = (0,
|
|
2219
|
-
var expandedRowModel = (0,
|
|
2396
|
+
var coreRowModel = (0, import_react_table3.getCoreRowModel)();
|
|
2397
|
+
var expandedRowModel = (0, import_react_table3.getExpandedRowModel)();
|
|
2220
2398
|
var defaultGetRowId = (row) => row.id;
|
|
2221
2399
|
function useBiampServerSideTable({
|
|
2222
2400
|
data,
|
|
@@ -2237,35 +2415,35 @@ function useBiampServerSideTable({
|
|
|
2237
2415
|
onExpandedChange,
|
|
2238
2416
|
getSubRows
|
|
2239
2417
|
}) {
|
|
2240
|
-
const { defaultColumnVisibility, columnIdToField, fieldToColumnId } = (0,
|
|
2418
|
+
const { defaultColumnVisibility, columnIdToField, fieldToColumnId } = (0, import_react11.useMemo)(
|
|
2241
2419
|
() => ({
|
|
2242
2420
|
defaultColumnVisibility: getDefaultColumnVisibilityFromDefs(columns),
|
|
2243
2421
|
...getOrderFieldMappings(columns)
|
|
2244
2422
|
}),
|
|
2245
2423
|
[columns]
|
|
2246
2424
|
);
|
|
2247
|
-
const sorting = (0,
|
|
2425
|
+
const sorting = (0, import_react11.useMemo)(
|
|
2248
2426
|
() => orderToSorting(order, fieldToColumnId),
|
|
2249
2427
|
[order, fieldToColumnId]
|
|
2250
2428
|
);
|
|
2251
2429
|
const hasPagination = page != null && rowsPerPage != null;
|
|
2252
|
-
const pagination = (0,
|
|
2430
|
+
const pagination = (0, import_react11.useMemo)(
|
|
2253
2431
|
() => hasPagination ? { pageIndex: page, pageSize: rowsPerPage } : void 0,
|
|
2254
2432
|
[hasPagination, page, rowsPerPage]
|
|
2255
2433
|
);
|
|
2256
2434
|
const hasSelection = selectedRowIds != null;
|
|
2257
|
-
const rowSelection = (0,
|
|
2435
|
+
const rowSelection = (0, import_react11.useMemo)(
|
|
2258
2436
|
() => hasSelection ? selectedIdsToRowSelection(selectedRowIds) : void 0,
|
|
2259
2437
|
[hasSelection, selectedRowIds]
|
|
2260
2438
|
);
|
|
2261
|
-
const mergedVisibility = (0,
|
|
2439
|
+
const mergedVisibility = (0, import_react11.useMemo)(
|
|
2262
2440
|
() => toVisibilityState({
|
|
2263
2441
|
...defaultColumnVisibility,
|
|
2264
2442
|
...columnVisibility
|
|
2265
2443
|
}),
|
|
2266
2444
|
[defaultColumnVisibility, columnVisibility]
|
|
2267
2445
|
);
|
|
2268
|
-
return (0,
|
|
2446
|
+
return (0, import_react_table3.useReactTable)({
|
|
2269
2447
|
data,
|
|
2270
2448
|
columns,
|
|
2271
2449
|
getCoreRowModel: coreRowModel,
|
|
@@ -2364,12 +2542,12 @@ function downloadCsv(csvContent, filename) {
|
|
|
2364
2542
|
}
|
|
2365
2543
|
|
|
2366
2544
|
// src/BiampBanner/BiampBanner.tsx
|
|
2367
|
-
var
|
|
2368
|
-
var
|
|
2369
|
-
var
|
|
2545
|
+
var import_material20 = require("@mui/material");
|
|
2546
|
+
var import_assets11 = require("@bwp-web/assets");
|
|
2547
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2370
2548
|
function BiampBanner({ show, children, severity }) {
|
|
2371
|
-
return /* @__PURE__ */ (0,
|
|
2372
|
-
|
|
2549
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_material20.Collapse, { in: show, unmountOnExit: true, component: "aside", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2550
|
+
import_material20.Box,
|
|
2373
2551
|
{
|
|
2374
2552
|
bgcolor: ({ palette }) => palette.background[severity],
|
|
2375
2553
|
display: "flex",
|
|
@@ -2387,25 +2565,25 @@ function BiampBanner({ show, children, severity }) {
|
|
|
2387
2565
|
) });
|
|
2388
2566
|
}
|
|
2389
2567
|
var iconMapping = {
|
|
2390
|
-
error: /* @__PURE__ */ (0,
|
|
2391
|
-
warning: /* @__PURE__ */ (0,
|
|
2392
|
-
success: /* @__PURE__ */ (0,
|
|
2393
|
-
info: /* @__PURE__ */ (0,
|
|
2568
|
+
error: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_assets11.ErrorStatusIcon, { color: "error", sx: { width: 14, height: 14 } }),
|
|
2569
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_assets11.WarningStatusIcon, { color: "warning", sx: { width: 16, height: 14 } }),
|
|
2570
|
+
success: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_assets11.SuccessStatusIcon, { color: "success", sx: { width: 14, height: 14 } }),
|
|
2571
|
+
info: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_assets11.InfoStatusIcon, { color: "info", sx: { width: 14, height: 14 } })
|
|
2394
2572
|
};
|
|
2395
2573
|
function BiampBannerIcon({ severity, children }) {
|
|
2396
|
-
return /* @__PURE__ */ (0,
|
|
2574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_jsx_runtime23.Fragment, { children: severity ? iconMapping[severity] : children });
|
|
2397
2575
|
}
|
|
2398
2576
|
function BiampBannerContent({ children, ...props }) {
|
|
2399
|
-
return /* @__PURE__ */ (0,
|
|
2577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_material20.Typography, { textAlign: "center", variant: "h3", ...props, children });
|
|
2400
2578
|
}
|
|
2401
2579
|
function BiampBannerActions({ children, ...props }) {
|
|
2402
|
-
return /* @__PURE__ */ (0,
|
|
2580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_material20.Box, { display: "flex", gap: 1, alignItems: "center", ...props, children });
|
|
2403
2581
|
}
|
|
2404
2582
|
|
|
2405
2583
|
// src/BiampSegmentedButton/SegmentedButton.tsx
|
|
2406
|
-
var
|
|
2584
|
+
var import_material21 = require("@mui/material");
|
|
2407
2585
|
var import_styles = require("@mui/material/styles");
|
|
2408
|
-
var
|
|
2586
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2409
2587
|
function SegmentedButton({
|
|
2410
2588
|
children,
|
|
2411
2589
|
active,
|
|
@@ -2413,13 +2591,13 @@ function SegmentedButton({
|
|
|
2413
2591
|
sx,
|
|
2414
2592
|
...props
|
|
2415
2593
|
}) {
|
|
2416
|
-
const theme = (0,
|
|
2594
|
+
const theme = (0, import_material21.useTheme)();
|
|
2417
2595
|
const isDarkMode = theme.palette.mode === "dark";
|
|
2418
2596
|
const backgroundColor = active ? isDarkMode ? theme.palette.grey[900] : theme.palette.common.white : "transparent";
|
|
2419
2597
|
const textColor = active ? theme.palette.text.primary : theme.palette.text.secondary;
|
|
2420
2598
|
const border = active ? "solid" : void 0;
|
|
2421
|
-
return /* @__PURE__ */ (0,
|
|
2422
|
-
|
|
2599
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2600
|
+
import_material21.Button,
|
|
2423
2601
|
{
|
|
2424
2602
|
sx: {
|
|
2425
2603
|
backgroundColor,
|
|
@@ -2442,13 +2620,13 @@ function SegmentedButton({
|
|
|
2442
2620
|
}
|
|
2443
2621
|
|
|
2444
2622
|
// src/BiampSegmentedButton/SegmentedButtonGroup.tsx
|
|
2445
|
-
var
|
|
2446
|
-
var
|
|
2623
|
+
var import_material22 = require("@mui/material");
|
|
2624
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2447
2625
|
function SegmentedButtonGroup({ children, sx, ...props }) {
|
|
2448
|
-
const theme = (0,
|
|
2626
|
+
const theme = (0, import_material22.useTheme)();
|
|
2449
2627
|
const isDarkMode = theme.palette.mode === "dark";
|
|
2450
|
-
return /* @__PURE__ */ (0,
|
|
2451
|
-
|
|
2628
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2629
|
+
import_material22.Stack,
|
|
2452
2630
|
{
|
|
2453
2631
|
direction: "row",
|
|
2454
2632
|
p: 0.5,
|
|
@@ -2465,11 +2643,11 @@ function SegmentedButtonGroup({ children, sx, ...props }) {
|
|
|
2465
2643
|
}
|
|
2466
2644
|
|
|
2467
2645
|
// src/BiampGlobalSearch/BiampGlobalSearch.tsx
|
|
2468
|
-
var
|
|
2469
|
-
var
|
|
2470
|
-
var
|
|
2471
|
-
var
|
|
2472
|
-
var SearchContext = (0,
|
|
2646
|
+
var import_react12 = require("react");
|
|
2647
|
+
var import_material23 = require("@mui/material");
|
|
2648
|
+
var import_assets12 = require("@bwp-web/assets");
|
|
2649
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2650
|
+
var SearchContext = (0, import_react12.createContext)({
|
|
2473
2651
|
hasOptions: true,
|
|
2474
2652
|
loading: false,
|
|
2475
2653
|
noResultsText: "No results found",
|
|
@@ -2479,8 +2657,8 @@ function KeyCap({
|
|
|
2479
2657
|
children,
|
|
2480
2658
|
variant = "icon"
|
|
2481
2659
|
}) {
|
|
2482
|
-
return /* @__PURE__ */ (0,
|
|
2483
|
-
|
|
2660
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2661
|
+
import_material23.Box,
|
|
2484
2662
|
{
|
|
2485
2663
|
component: "kbd",
|
|
2486
2664
|
sx: {
|
|
@@ -2504,12 +2682,12 @@ function KeyCap({
|
|
|
2504
2682
|
}
|
|
2505
2683
|
);
|
|
2506
2684
|
}
|
|
2507
|
-
var BiampGlobalSearchPaper = (0,
|
|
2685
|
+
var BiampGlobalSearchPaper = (0, import_react12.forwardRef)(
|
|
2508
2686
|
function BiampGlobalSearchPaper2({ children, ...props }, ref) {
|
|
2509
|
-
const { hasOptions, loading, noResultsText } = (0,
|
|
2510
|
-
return /* @__PURE__ */ (0,
|
|
2511
|
-
hasOptions || loading ? children : /* @__PURE__ */ (0,
|
|
2512
|
-
|
|
2687
|
+
const { hasOptions, loading, noResultsText } = (0, import_react12.useContext)(SearchContext);
|
|
2688
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_material23.Paper, { ref, ...props, children: [
|
|
2689
|
+
hasOptions || loading ? children : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2690
|
+
import_material23.Typography,
|
|
2513
2691
|
{
|
|
2514
2692
|
variant: "body2",
|
|
2515
2693
|
color: "text.secondary",
|
|
@@ -2517,8 +2695,8 @@ var BiampGlobalSearchPaper = (0, import_react11.forwardRef)(
|
|
|
2517
2695
|
children: noResultsText
|
|
2518
2696
|
}
|
|
2519
2697
|
),
|
|
2520
|
-
hasOptions && /* @__PURE__ */ (0,
|
|
2521
|
-
|
|
2698
|
+
hasOptions && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
2699
|
+
import_material23.Box,
|
|
2522
2700
|
{
|
|
2523
2701
|
sx: {
|
|
2524
2702
|
borderTop: ({ palette }) => `0.6px solid ${palette.dividers.secondary}`,
|
|
@@ -2528,13 +2706,13 @@ var BiampGlobalSearchPaper = (0, import_react11.forwardRef)(
|
|
|
2528
2706
|
p: 1.5
|
|
2529
2707
|
},
|
|
2530
2708
|
children: [
|
|
2531
|
-
/* @__PURE__ */ (0,
|
|
2532
|
-
/* @__PURE__ */ (0,
|
|
2533
|
-
/* @__PURE__ */ (0,
|
|
2534
|
-
/* @__PURE__ */ (0,
|
|
2709
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_material23.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
2710
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_material23.Box, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: [
|
|
2711
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(KeyCap, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_assets12.KeyArrowDownIcon, {}) }),
|
|
2712
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(KeyCap, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_assets12.KeyArrowUpIcon, {}) })
|
|
2535
2713
|
] }),
|
|
2536
|
-
/* @__PURE__ */ (0,
|
|
2537
|
-
|
|
2714
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2715
|
+
import_material23.Typography,
|
|
2538
2716
|
{
|
|
2539
2717
|
variant: "caption",
|
|
2540
2718
|
fontWeight: (theme) => theme.typography.fontWeightMedium,
|
|
@@ -2543,10 +2721,10 @@ var BiampGlobalSearchPaper = (0, import_react11.forwardRef)(
|
|
|
2543
2721
|
}
|
|
2544
2722
|
)
|
|
2545
2723
|
] }),
|
|
2546
|
-
/* @__PURE__ */ (0,
|
|
2547
|
-
/* @__PURE__ */ (0,
|
|
2548
|
-
/* @__PURE__ */ (0,
|
|
2549
|
-
|
|
2724
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_material23.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
2725
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(KeyCap, { variant: "text", children: "Enter" }),
|
|
2726
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2727
|
+
import_material23.Typography,
|
|
2550
2728
|
{
|
|
2551
2729
|
variant: "caption",
|
|
2552
2730
|
fontWeight: (theme) => theme.typography.fontWeightMedium,
|
|
@@ -2562,16 +2740,16 @@ var BiampGlobalSearchPaper = (0, import_react11.forwardRef)(
|
|
|
2562
2740
|
}
|
|
2563
2741
|
);
|
|
2564
2742
|
function HighlightText({ text, query }) {
|
|
2565
|
-
if (!query) return /* @__PURE__ */ (0,
|
|
2743
|
+
if (!query) return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_jsx_runtime26.Fragment, { children: text });
|
|
2566
2744
|
const index = text.toLowerCase().indexOf(query.toLowerCase());
|
|
2567
|
-
if (index === -1) return /* @__PURE__ */ (0,
|
|
2745
|
+
if (index === -1) return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_jsx_runtime26.Fragment, { children: text });
|
|
2568
2746
|
const before = text.slice(0, index);
|
|
2569
2747
|
const match = text.slice(index, index + query.length);
|
|
2570
2748
|
const after = text.slice(index + query.length);
|
|
2571
|
-
return /* @__PURE__ */ (0,
|
|
2749
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
2572
2750
|
before,
|
|
2573
|
-
/* @__PURE__ */ (0,
|
|
2574
|
-
|
|
2751
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2752
|
+
import_material23.Box,
|
|
2575
2753
|
{
|
|
2576
2754
|
component: "span",
|
|
2577
2755
|
sx: {
|
|
@@ -2591,12 +2769,12 @@ function BiampGlobalSearchListItem({
|
|
|
2591
2769
|
option,
|
|
2592
2770
|
props: liProps
|
|
2593
2771
|
}) {
|
|
2594
|
-
const { query } = (0,
|
|
2772
|
+
const { query } = (0, import_react12.useContext)(SearchContext);
|
|
2595
2773
|
const { key, ...rest } = liProps;
|
|
2596
2774
|
const maxChips = 3;
|
|
2597
2775
|
const chips = option.associatedItems?.slice(0, maxChips) ?? [];
|
|
2598
2776
|
const overflow = (option.associatedItems?.length ?? 0) - maxChips;
|
|
2599
|
-
return /* @__PURE__ */ (0,
|
|
2777
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
2600
2778
|
"li",
|
|
2601
2779
|
{
|
|
2602
2780
|
...rest,
|
|
@@ -2608,8 +2786,8 @@ function BiampGlobalSearchListItem({
|
|
|
2608
2786
|
...rest.style
|
|
2609
2787
|
},
|
|
2610
2788
|
children: [
|
|
2611
|
-
option.icon && /* @__PURE__ */ (0,
|
|
2612
|
-
|
|
2789
|
+
option.icon && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2790
|
+
import_material23.Box,
|
|
2613
2791
|
{
|
|
2614
2792
|
sx: {
|
|
2615
2793
|
width: 24,
|
|
@@ -2622,9 +2800,9 @@ function BiampGlobalSearchListItem({
|
|
|
2622
2800
|
children: option.icon
|
|
2623
2801
|
}
|
|
2624
2802
|
),
|
|
2625
|
-
/* @__PURE__ */ (0,
|
|
2626
|
-
option.subtitle && /* @__PURE__ */ (0,
|
|
2627
|
-
|
|
2803
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material23.Typography, { variant: "body2", noWrap: true, sx: { flexShrink: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(HighlightText, { text: option.title, query }) }),
|
|
2804
|
+
option.subtitle && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2805
|
+
import_material23.Typography,
|
|
2628
2806
|
{
|
|
2629
2807
|
className: "hoverContent",
|
|
2630
2808
|
variant: "body2",
|
|
@@ -2634,8 +2812,8 @@ function BiampGlobalSearchListItem({
|
|
|
2634
2812
|
children: option.subtitle
|
|
2635
2813
|
}
|
|
2636
2814
|
),
|
|
2637
|
-
chips.length > 0 && /* @__PURE__ */ (0,
|
|
2638
|
-
|
|
2815
|
+
chips.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
2816
|
+
import_material23.Box,
|
|
2639
2817
|
{
|
|
2640
2818
|
className: "hoverContent",
|
|
2641
2819
|
sx: {
|
|
@@ -2647,8 +2825,8 @@ function BiampGlobalSearchListItem({
|
|
|
2647
2825
|
px: 2
|
|
2648
2826
|
},
|
|
2649
2827
|
children: [
|
|
2650
|
-
chips.map((item, i) => /* @__PURE__ */ (0,
|
|
2651
|
-
|
|
2828
|
+
chips.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2829
|
+
import_material23.Chip,
|
|
2652
2830
|
{
|
|
2653
2831
|
size: "small",
|
|
2654
2832
|
label: item.label,
|
|
@@ -2665,8 +2843,8 @@ function BiampGlobalSearchListItem({
|
|
|
2665
2843
|
},
|
|
2666
2844
|
i
|
|
2667
2845
|
)),
|
|
2668
|
-
overflow > 0 && /* @__PURE__ */ (0,
|
|
2669
|
-
|
|
2846
|
+
overflow > 0 && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2847
|
+
import_material23.Chip,
|
|
2670
2848
|
{
|
|
2671
2849
|
size: "small",
|
|
2672
2850
|
label: `+${overflow}`,
|
|
@@ -2685,8 +2863,8 @@ function BiampGlobalSearchListItem({
|
|
|
2685
2863
|
]
|
|
2686
2864
|
}
|
|
2687
2865
|
),
|
|
2688
|
-
option.endIcon && /* @__PURE__ */ (0,
|
|
2689
|
-
|
|
2866
|
+
option.endIcon && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2867
|
+
import_material23.Box,
|
|
2690
2868
|
{
|
|
2691
2869
|
className: "endIcon",
|
|
2692
2870
|
sx: {
|
|
@@ -2733,7 +2911,7 @@ function BiampGlobalSearch({
|
|
|
2733
2911
|
}
|
|
2734
2912
|
onInputChange?.(event, value, reason);
|
|
2735
2913
|
};
|
|
2736
|
-
return /* @__PURE__ */ (0,
|
|
2914
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2737
2915
|
SearchContext.Provider,
|
|
2738
2916
|
{
|
|
2739
2917
|
value: {
|
|
@@ -2742,15 +2920,15 @@ function BiampGlobalSearch({
|
|
|
2742
2920
|
noResultsText,
|
|
2743
2921
|
query: inputValueProp ?? ""
|
|
2744
2922
|
},
|
|
2745
|
-
children: /* @__PURE__ */ (0,
|
|
2746
|
-
|
|
2923
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2924
|
+
import_material23.Autocomplete,
|
|
2747
2925
|
{
|
|
2748
2926
|
options,
|
|
2749
2927
|
inputValue: inputValueProp,
|
|
2750
2928
|
loading,
|
|
2751
2929
|
onChange: handleChange,
|
|
2752
2930
|
onInputChange: handleInputChange,
|
|
2753
|
-
loadingText: /* @__PURE__ */ (0,
|
|
2931
|
+
loadingText: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material23.Typography, { variant: "body2", color: "text.secondary", children: "Loading\u2026" }),
|
|
2754
2932
|
freeSolo: true,
|
|
2755
2933
|
filterOptions: (x) => x,
|
|
2756
2934
|
getOptionLabel: (option) => typeof option === "string" ? option : option.title,
|
|
@@ -2774,8 +2952,8 @@ function BiampGlobalSearch({
|
|
|
2774
2952
|
}
|
|
2775
2953
|
}
|
|
2776
2954
|
},
|
|
2777
|
-
renderInput: (params) => /* @__PURE__ */ (0,
|
|
2778
|
-
|
|
2955
|
+
renderInput: (params) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2956
|
+
import_material23.TextField,
|
|
2779
2957
|
{
|
|
2780
2958
|
...params,
|
|
2781
2959
|
placeholder,
|
|
@@ -2790,15 +2968,15 @@ function BiampGlobalSearch({
|
|
|
2790
2968
|
slotProps: {
|
|
2791
2969
|
input: {
|
|
2792
2970
|
...params.InputProps,
|
|
2793
|
-
startAdornment: /* @__PURE__ */ (0,
|
|
2794
|
-
/* @__PURE__ */ (0,
|
|
2971
|
+
startAdornment: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
2972
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material23.InputAdornment, { position: "start", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_assets12.SearchIcon, {}) }),
|
|
2795
2973
|
params.InputProps.startAdornment
|
|
2796
2974
|
] })
|
|
2797
2975
|
}
|
|
2798
2976
|
}
|
|
2799
2977
|
}
|
|
2800
2978
|
),
|
|
2801
|
-
renderOption: (optionProps, option) => /* @__PURE__ */ (0,
|
|
2979
|
+
renderOption: (optionProps, option) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2802
2980
|
BiampGlobalSearchListItem,
|
|
2803
2981
|
{
|
|
2804
2982
|
option,
|
|
@@ -2814,10 +2992,10 @@ function BiampGlobalSearch({
|
|
|
2814
2992
|
}
|
|
2815
2993
|
|
|
2816
2994
|
// src/UserInitialsIcon/UserInitialsIcon.tsx
|
|
2817
|
-
var
|
|
2995
|
+
var import_material24 = require("@mui/material");
|
|
2818
2996
|
var import_styles2 = require("@mui/material/styles");
|
|
2819
2997
|
var import_randomcolor = __toESM(require_randomColor(), 1);
|
|
2820
|
-
var
|
|
2998
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2821
2999
|
var DEFAULT_SIZE = 40;
|
|
2822
3000
|
var DEFAULT_BORDER_RADIUS = 1.5;
|
|
2823
3001
|
var TEXT_RATIO = 0.4;
|
|
@@ -2835,8 +3013,8 @@ function UserInitialsIcon({
|
|
|
2835
3013
|
const textColor = (0, import_styles2.darken)((0, import_randomcolor.default)({ luminosity: "dark", seed: id }), 0.3);
|
|
2836
3014
|
const size = typeof width === "number" ? width : DEFAULT_SIZE;
|
|
2837
3015
|
const fontSize = size * TEXT_RATIO;
|
|
2838
|
-
return /* @__PURE__ */ (0,
|
|
2839
|
-
|
|
3016
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3017
|
+
import_material24.Box,
|
|
2840
3018
|
{
|
|
2841
3019
|
minWidth: width,
|
|
2842
3020
|
width,
|
|
@@ -2849,8 +3027,8 @@ function UserInitialsIcon({
|
|
|
2849
3027
|
justifyContent: "center",
|
|
2850
3028
|
sx: { ...sx },
|
|
2851
3029
|
...props,
|
|
2852
|
-
children: /* @__PURE__ */ (0,
|
|
2853
|
-
|
|
3030
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3031
|
+
import_material24.Typography,
|
|
2854
3032
|
{
|
|
2855
3033
|
variant: "h3",
|
|
2856
3034
|
color: textColor,
|
|
@@ -2872,9 +3050,9 @@ var getInitials = (name) => {
|
|
|
2872
3050
|
};
|
|
2873
3051
|
|
|
2874
3052
|
// src/DynamicSvgIcon/DynamicSvgIcon.tsx
|
|
2875
|
-
var
|
|
2876
|
-
var
|
|
2877
|
-
var
|
|
3053
|
+
var import_material25 = require("@mui/material");
|
|
3054
|
+
var import_react13 = require("react");
|
|
3055
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2878
3056
|
var svgCache = /* @__PURE__ */ new Map();
|
|
2879
3057
|
function clearDynamicSvgIconCache() {
|
|
2880
3058
|
svgCache.clear();
|
|
@@ -2885,17 +3063,17 @@ function applyCurrentColor(svg) {
|
|
|
2885
3063
|
function useDynamicSvgIcon(url, options = {}) {
|
|
2886
3064
|
const { replaceColors = false, onLoad, onError } = options;
|
|
2887
3065
|
const transform = replaceColors ? applyCurrentColor : (s) => s;
|
|
2888
|
-
const [svgContent, setSvgContent] = (0,
|
|
3066
|
+
const [svgContent, setSvgContent] = (0, import_react13.useState)(() => {
|
|
2889
3067
|
const cached = svgCache.get(url);
|
|
2890
3068
|
return cached ? transform(cached.innerContent) : null;
|
|
2891
3069
|
});
|
|
2892
|
-
const [svgViewBox, setSvgViewBox] = (0,
|
|
3070
|
+
const [svgViewBox, setSvgViewBox] = (0, import_react13.useState)(() => {
|
|
2893
3071
|
const cached = svgCache.get(url);
|
|
2894
3072
|
return cached?.viewBox ?? null;
|
|
2895
3073
|
});
|
|
2896
|
-
const [loading, setLoading] = (0,
|
|
2897
|
-
const [error, setError] = (0,
|
|
2898
|
-
(0,
|
|
3074
|
+
const [loading, setLoading] = (0, import_react13.useState)(() => !svgCache.has(url));
|
|
3075
|
+
const [error, setError] = (0, import_react13.useState)(null);
|
|
3076
|
+
(0, import_react13.useEffect)(() => {
|
|
2899
3077
|
if (!url) {
|
|
2900
3078
|
setLoading(false);
|
|
2901
3079
|
setError("No URL provided");
|
|
@@ -2976,8 +3154,8 @@ function DynamicSvgIcon({
|
|
|
2976
3154
|
onError
|
|
2977
3155
|
});
|
|
2978
3156
|
if (loading) {
|
|
2979
|
-
return /* @__PURE__ */ (0,
|
|
2980
|
-
|
|
3157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3158
|
+
import_material25.Skeleton,
|
|
2981
3159
|
{
|
|
2982
3160
|
variant: skeletonVariant,
|
|
2983
3161
|
animation: skeletonAnimation,
|
|
@@ -2986,8 +3164,8 @@ function DynamicSvgIcon({
|
|
|
2986
3164
|
);
|
|
2987
3165
|
}
|
|
2988
3166
|
if (error || !svgContent) {
|
|
2989
|
-
return /* @__PURE__ */ (0,
|
|
2990
|
-
|
|
3167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3168
|
+
import_material25.Box,
|
|
2991
3169
|
{
|
|
2992
3170
|
sx: {
|
|
2993
3171
|
width,
|
|
@@ -3006,8 +3184,8 @@ function DynamicSvgIcon({
|
|
|
3006
3184
|
}
|
|
3007
3185
|
);
|
|
3008
3186
|
}
|
|
3009
|
-
return /* @__PURE__ */ (0,
|
|
3010
|
-
|
|
3187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3188
|
+
import_material25.SvgIcon,
|
|
3011
3189
|
{
|
|
3012
3190
|
...svgIconProps,
|
|
3013
3191
|
...svgViewBox && { viewBox: svgViewBox },
|
|
@@ -3016,7 +3194,7 @@ function DynamicSvgIcon({
|
|
|
3016
3194
|
width,
|
|
3017
3195
|
height
|
|
3018
3196
|
},
|
|
3019
|
-
children: /* @__PURE__ */ (0,
|
|
3197
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("g", { dangerouslySetInnerHTML: { __html: svgContent } })
|
|
3020
3198
|
}
|
|
3021
3199
|
);
|
|
3022
3200
|
}
|