@bwp-web/components 1.3.0 → 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 +14 -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 +574 -378
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +493 -294
- 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,9 +1313,12 @@ function BiampTableRowInner({
|
|
|
1163
1313
|
isRowClickable,
|
|
1164
1314
|
enableRowSelection,
|
|
1165
1315
|
enableExpanding,
|
|
1316
|
+
alwaysExpanded,
|
|
1166
1317
|
selectChildrenWithParent,
|
|
1318
|
+
showExpandGuidelines,
|
|
1167
1319
|
getRowLabel,
|
|
1168
1320
|
hasExpandableRows,
|
|
1321
|
+
customColor,
|
|
1169
1322
|
rowSlotProps,
|
|
1170
1323
|
cellSlotProps
|
|
1171
1324
|
}) {
|
|
@@ -1177,15 +1330,19 @@ function BiampTableRowInner({
|
|
|
1177
1330
|
onKeyDown: userRowOnKeyDown,
|
|
1178
1331
|
...restRowProps
|
|
1179
1332
|
} = resolvedRow ?? {};
|
|
1180
|
-
return /* @__PURE__ */ (0,
|
|
1181
|
-
|
|
1333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1334
|
+
import_material8.TableRow,
|
|
1182
1335
|
{
|
|
1183
1336
|
...restRowProps,
|
|
1184
1337
|
hover: clickable,
|
|
1185
1338
|
selected: enableRowSelection ? isSelected : void 0,
|
|
1186
1339
|
role: clickable ? "button" : void 0,
|
|
1187
1340
|
tabIndex: clickable ? 0 : void 0,
|
|
1188
|
-
sx: mergeSx(
|
|
1341
|
+
sx: mergeSx(
|
|
1342
|
+
clickable && rowCursorPointerSx,
|
|
1343
|
+
customColor ? { backgroundColor: customColor } : void 0,
|
|
1344
|
+
userRowSx
|
|
1345
|
+
),
|
|
1189
1346
|
onClick: clickable && onRowClick ? (e) => {
|
|
1190
1347
|
onRowClick(row.original);
|
|
1191
1348
|
userRowOnClick?.(e);
|
|
@@ -1198,87 +1355,63 @@ function BiampTableRowInner({
|
|
|
1198
1355
|
userRowOnKeyDown?.(e);
|
|
1199
1356
|
} : userRowOnKeyDown,
|
|
1200
1357
|
children: [
|
|
1201
|
-
enableRowSelection && /* @__PURE__ */ (0,
|
|
1202
|
-
|
|
1358
|
+
enableRowSelection && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1359
|
+
import_material8.TableCell,
|
|
1203
1360
|
{
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1361
|
+
padding: "checkbox",
|
|
1362
|
+
sx: mergeSx(
|
|
1363
|
+
selectionCellSx,
|
|
1364
|
+
customColor ? { backgroundColor: customColor } : void 0
|
|
1365
|
+
),
|
|
1366
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1367
|
+
import_material8.Checkbox,
|
|
1368
|
+
{
|
|
1369
|
+
checked: isSelected,
|
|
1370
|
+
disabled: !row.getCanSelect(),
|
|
1371
|
+
onChange: (e) => row.toggleSelected(e.target.checked, {
|
|
1372
|
+
selectChildren: selectChildrenWithParent
|
|
1373
|
+
}),
|
|
1374
|
+
onClick: (e) => e.stopPropagation(),
|
|
1375
|
+
sx: !row.getCanSelect() ? checkboxHiddenSx : void 0,
|
|
1376
|
+
slotProps: {
|
|
1377
|
+
input: {
|
|
1378
|
+
"aria-label": getRowLabel ? `Select ${getRowLabel(row.original)}` : `Select row ${row.index + 1}`
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1214
1381
|
}
|
|
1215
|
-
|
|
1382
|
+
)
|
|
1216
1383
|
}
|
|
1217
|
-
)
|
|
1384
|
+
),
|
|
1218
1385
|
row.getVisibleCells().map((cell, cellIndex, cells) => {
|
|
1219
1386
|
const sticky = cell.column.columnDef.meta?.sticky;
|
|
1220
1387
|
const isExpandCell = enableExpanding && !sticky && cellIndex === cells.findIndex((c) => !c.column.columnDef.meta?.sticky);
|
|
1221
|
-
const
|
|
1222
|
-
cell.column.columnDef.cell,
|
|
1223
|
-
cell.getContext()
|
|
1224
|
-
);
|
|
1388
|
+
const showGuidelinesOnCell = isExpandCell && showExpandGuidelines && alwaysExpanded && row.depth > 0;
|
|
1225
1389
|
const resolvedCell = resolveSlot(cellSlotProps, { cell });
|
|
1226
1390
|
const { sx: userCellSx, ...restCellProps } = resolvedCell ?? {};
|
|
1227
|
-
return /* @__PURE__ */ (0,
|
|
1228
|
-
|
|
1391
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1392
|
+
import_material8.TableCell,
|
|
1229
1393
|
{
|
|
1230
1394
|
...restCellProps,
|
|
1231
1395
|
"data-sticky": sticky || void 0,
|
|
1232
1396
|
sx: mergeSx(
|
|
1233
1397
|
cellSx(sticky, cell.column.columnDef.meta?.minWidth, 2),
|
|
1234
|
-
{ pl: isExpandCell ? "6px" : "12px" },
|
|
1398
|
+
{ pl: isExpandCell && !alwaysExpanded ? "6px" : "12px" },
|
|
1399
|
+
showGuidelinesOnCell ? { position: "relative" } : void 0,
|
|
1400
|
+
sticky && customColor ? { backgroundColor: customColor } : void 0,
|
|
1235
1401
|
userCellSx
|
|
1236
1402
|
),
|
|
1237
|
-
children:
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
import_material7.IconButton,
|
|
1250
|
-
{
|
|
1251
|
-
variant: "none",
|
|
1252
|
-
onClick: (e) => {
|
|
1253
|
-
e.stopPropagation();
|
|
1254
|
-
row.toggleExpanded();
|
|
1255
|
-
},
|
|
1256
|
-
"aria-label": isExpanded ? `Collapse ${rowLabel}` : `Expand ${rowLabel}`,
|
|
1257
|
-
"aria-expanded": isExpanded,
|
|
1258
|
-
children: isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1259
|
-
import_assets5.ChevronDownIcon,
|
|
1260
|
-
{
|
|
1261
|
-
variant: "xs",
|
|
1262
|
-
sx: {
|
|
1263
|
-
color: ({ palette }) => palette.text.secondary
|
|
1264
|
-
}
|
|
1265
|
-
}
|
|
1266
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1267
|
-
import_assets5.ChevronRightIcon,
|
|
1268
|
-
{
|
|
1269
|
-
variant: "xs",
|
|
1270
|
-
sx: {
|
|
1271
|
-
color: ({ palette }) => palette.text.secondary
|
|
1272
|
-
}
|
|
1273
|
-
}
|
|
1274
|
-
)
|
|
1275
|
-
}
|
|
1276
|
-
) : hasExpandableRows ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material7.Box, { sx: expandPlaceholderSx }) : null,
|
|
1277
|
-
truncated
|
|
1278
|
-
]
|
|
1279
|
-
}
|
|
1280
|
-
);
|
|
1281
|
-
})()
|
|
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
|
+
]
|
|
1282
1415
|
},
|
|
1283
1416
|
cell.id
|
|
1284
1417
|
);
|
|
@@ -1289,12 +1422,64 @@ function BiampTableRowInner({
|
|
|
1289
1422
|
);
|
|
1290
1423
|
}
|
|
1291
1424
|
function biampTableRowPropsAreEqual(prev, next) {
|
|
1292
|
-
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.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;
|
|
1293
1426
|
}
|
|
1294
|
-
var BiampTableRow =
|
|
1427
|
+
var BiampTableRow = import_react3.default.memo(
|
|
1295
1428
|
BiampTableRowInner,
|
|
1296
1429
|
biampTableRowPropsAreEqual
|
|
1297
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" };
|
|
1298
1483
|
function BiampTable({
|
|
1299
1484
|
table,
|
|
1300
1485
|
onRowClick,
|
|
@@ -1304,9 +1489,12 @@ function BiampTable({
|
|
|
1304
1489
|
empty,
|
|
1305
1490
|
enableRowSelection = false,
|
|
1306
1491
|
enableExpanding = false,
|
|
1492
|
+
alwaysExpanded = false,
|
|
1307
1493
|
hideSelectAll,
|
|
1308
1494
|
selectChildrenWithParent = false,
|
|
1495
|
+
showExpandGuidelines = false,
|
|
1309
1496
|
getRowLabel,
|
|
1497
|
+
setRowColor,
|
|
1310
1498
|
slotProps,
|
|
1311
1499
|
sx,
|
|
1312
1500
|
...boxProps
|
|
@@ -1322,16 +1510,21 @@ function BiampTable({
|
|
|
1322
1510
|
},
|
|
1323
1511
|
enableRowSelection ? 48 : 0
|
|
1324
1512
|
);
|
|
1325
|
-
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]);
|
|
1326
1519
|
const showLoading = useLoadingDelay(!!loading);
|
|
1327
1520
|
const rows = table.getRowModel().rows;
|
|
1328
1521
|
const hasExpandableRows = enableExpanding && rows.some((r) => r.getCanExpand());
|
|
1329
1522
|
const showError = !!error && !loading;
|
|
1330
1523
|
const showEmpty = !showError && !loading && rows.length === 0;
|
|
1331
|
-
return /* @__PURE__ */ (0,
|
|
1332
|
-
|
|
1524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1525
|
+
import_material9.TableContainer,
|
|
1333
1526
|
{
|
|
1334
|
-
component:
|
|
1527
|
+
component: import_material9.Box,
|
|
1335
1528
|
...boxProps,
|
|
1336
1529
|
ref: containerRef,
|
|
1337
1530
|
sx: {
|
|
@@ -1342,8 +1535,8 @@ function BiampTable({
|
|
|
1342
1535
|
...sx
|
|
1343
1536
|
},
|
|
1344
1537
|
children: [
|
|
1345
|
-
/* @__PURE__ */ (0,
|
|
1346
|
-
|
|
1538
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1539
|
+
import_material9.Table,
|
|
1347
1540
|
{
|
|
1348
1541
|
"aria-busy": showLoading || void 0,
|
|
1349
1542
|
...restTableSlotProps,
|
|
@@ -1352,14 +1545,14 @@ function BiampTable({
|
|
|
1352
1545
|
userTableSx
|
|
1353
1546
|
),
|
|
1354
1547
|
children: [
|
|
1355
|
-
/* @__PURE__ */ (0,
|
|
1356
|
-
|
|
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,
|
|
1357
1550
|
{
|
|
1358
1551
|
...restHeaderRowSlotProps,
|
|
1359
1552
|
sx: mergeSx(userHeaderRowSx),
|
|
1360
1553
|
children: [
|
|
1361
|
-
enableRowSelection && /* @__PURE__ */ (0,
|
|
1362
|
-
|
|
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,
|
|
1363
1556
|
{
|
|
1364
1557
|
checked: table.getIsAllPageRowsSelected(),
|
|
1365
1558
|
indeterminate: table.getIsSomePageRowsSelected(),
|
|
@@ -1374,8 +1567,8 @@ function BiampTable({
|
|
|
1374
1567
|
header
|
|
1375
1568
|
});
|
|
1376
1569
|
const { sx: userHeaderCellSx, ...restHeaderCellProps } = resolvedHeaderCell ?? {};
|
|
1377
|
-
return /* @__PURE__ */ (0,
|
|
1378
|
-
|
|
1570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1571
|
+
import_material9.TableCell,
|
|
1379
1572
|
{
|
|
1380
1573
|
...restHeaderCellProps,
|
|
1381
1574
|
"data-sticky": sticky || void 0,
|
|
@@ -1387,21 +1580,21 @@ function BiampTable({
|
|
|
1387
1580
|
cellSx(sticky, header.column.columnDef.meta?.minWidth, 3),
|
|
1388
1581
|
userHeaderCellSx
|
|
1389
1582
|
),
|
|
1390
|
-
children: header.isPlaceholder ? null : header.column.getCanSort() ? /* @__PURE__ */ (0,
|
|
1391
|
-
|
|
1583
|
+
children: header.isPlaceholder ? null : header.column.getCanSort() ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1584
|
+
import_material9.TableSortLabel,
|
|
1392
1585
|
{
|
|
1393
1586
|
active: !!header.column.getIsSorted(),
|
|
1394
1587
|
direction: header.column.getIsSorted() || "asc",
|
|
1395
1588
|
onClick: header.column.getToggleSortingHandler(),
|
|
1396
1589
|
...header.column.getIsSorted() && {
|
|
1397
|
-
IconComponent: header.column.getIsSorted() === "asc" ?
|
|
1590
|
+
IconComponent: header.column.getIsSorted() === "asc" ? import_assets6.DropdownChevronUpIcon : import_assets6.DropdownChevronDownIcon
|
|
1398
1591
|
},
|
|
1399
|
-
children: (0,
|
|
1592
|
+
children: (0, import_react_table2.flexRender)(
|
|
1400
1593
|
header.column.columnDef.header,
|
|
1401
1594
|
header.getContext()
|
|
1402
1595
|
)
|
|
1403
1596
|
}
|
|
1404
|
-
) : (0,
|
|
1597
|
+
) : (0, import_react_table2.flexRender)(
|
|
1405
1598
|
header.column.columnDef.header,
|
|
1406
1599
|
header.getContext()
|
|
1407
1600
|
)
|
|
@@ -1413,12 +1606,12 @@ function BiampTable({
|
|
|
1413
1606
|
},
|
|
1414
1607
|
headerGroup.id
|
|
1415
1608
|
)) }),
|
|
1416
|
-
/* @__PURE__ */ (0,
|
|
1417
|
-
|
|
1609
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1610
|
+
import_material9.TableBody,
|
|
1418
1611
|
{
|
|
1419
1612
|
...restBodySlotProps,
|
|
1420
1613
|
sx: mergeSx({ opacity: showLoading ? 0.3 : 1 }, userBodySx),
|
|
1421
|
-
children: !showError && rows.map((row) => /* @__PURE__ */ (0,
|
|
1614
|
+
children: !showError && rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1422
1615
|
BiampTableRow,
|
|
1423
1616
|
{
|
|
1424
1617
|
row,
|
|
@@ -1428,9 +1621,12 @@ function BiampTable({
|
|
|
1428
1621
|
isRowClickable,
|
|
1429
1622
|
enableRowSelection,
|
|
1430
1623
|
enableExpanding,
|
|
1624
|
+
alwaysExpanded,
|
|
1431
1625
|
selectChildrenWithParent,
|
|
1626
|
+
showExpandGuidelines,
|
|
1432
1627
|
getRowLabel,
|
|
1433
1628
|
hasExpandableRows,
|
|
1629
|
+
customColor: setRowColor?.(row.original),
|
|
1434
1630
|
rowSlotProps: slotProps?.row,
|
|
1435
1631
|
cellSlotProps: slotProps?.cell
|
|
1436
1632
|
},
|
|
@@ -1441,22 +1637,22 @@ function BiampTable({
|
|
|
1441
1637
|
]
|
|
1442
1638
|
}
|
|
1443
1639
|
),
|
|
1444
|
-
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)(
|
|
1445
1641
|
BiampTableErrorState,
|
|
1446
1642
|
{
|
|
1447
1643
|
description: error.message,
|
|
1448
1644
|
sx: { pointerEvents: "auto" }
|
|
1449
1645
|
}
|
|
1450
1646
|
) : error }),
|
|
1451
|
-
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" } }) })
|
|
1452
1648
|
]
|
|
1453
1649
|
}
|
|
1454
1650
|
);
|
|
1455
1651
|
}
|
|
1456
1652
|
|
|
1457
1653
|
// src/BiampTable/BiampTableContainer.tsx
|
|
1458
|
-
var
|
|
1459
|
-
var
|
|
1654
|
+
var import_material10 = require("@mui/material");
|
|
1655
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1460
1656
|
function BiampTableContainer({
|
|
1461
1657
|
withBorderTop = true,
|
|
1462
1658
|
withBorderBottom = false,
|
|
@@ -1464,8 +1660,8 @@ function BiampTableContainer({
|
|
|
1464
1660
|
sx,
|
|
1465
1661
|
...props
|
|
1466
1662
|
}) {
|
|
1467
|
-
return /* @__PURE__ */ (0,
|
|
1468
|
-
|
|
1663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1664
|
+
import_material10.Stack,
|
|
1469
1665
|
{
|
|
1470
1666
|
direction: "column",
|
|
1471
1667
|
height: "100%",
|
|
@@ -1483,25 +1679,25 @@ function BiampTableContainer({
|
|
|
1483
1679
|
}
|
|
1484
1680
|
|
|
1485
1681
|
// src/BiampTable/BiampTableCellActionButton.tsx
|
|
1486
|
-
var
|
|
1487
|
-
var
|
|
1682
|
+
var import_material11 = require("@mui/material");
|
|
1683
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1488
1684
|
function BiampTableCellActionButton({ label, icon, ...props }) {
|
|
1489
|
-
return /* @__PURE__ */ (0,
|
|
1490
|
-
|
|
1685
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1686
|
+
import_material11.Tooltip,
|
|
1491
1687
|
{
|
|
1492
1688
|
title: label,
|
|
1493
1689
|
placement: "top",
|
|
1494
1690
|
enterDelay: 500,
|
|
1495
1691
|
enterNextDelay: 500,
|
|
1496
1692
|
disableInteractive: true,
|
|
1497
|
-
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 }) })
|
|
1498
1694
|
}
|
|
1499
1695
|
);
|
|
1500
1696
|
}
|
|
1501
1697
|
|
|
1502
1698
|
// src/BiampTable/BiampTableColumnVisibility.tsx
|
|
1503
|
-
var
|
|
1504
|
-
var
|
|
1699
|
+
var import_material12 = require("@mui/material");
|
|
1700
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1505
1701
|
function toVisibilityState(visibility) {
|
|
1506
1702
|
return visibility;
|
|
1507
1703
|
}
|
|
@@ -1544,8 +1740,8 @@ function BiampTableColumnVisibility({
|
|
|
1544
1740
|
...popoverProps
|
|
1545
1741
|
}) {
|
|
1546
1742
|
const allVisible = table.getAllLeafColumns().every((col) => col.getIsVisible());
|
|
1547
|
-
return /* @__PURE__ */ (0,
|
|
1548
|
-
|
|
1743
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1744
|
+
import_material12.Popover,
|
|
1549
1745
|
{
|
|
1550
1746
|
anchorEl,
|
|
1551
1747
|
open: Boolean(anchorEl),
|
|
@@ -1558,48 +1754,48 @@ function BiampTableColumnVisibility({
|
|
|
1558
1754
|
borderRadius: "6px",
|
|
1559
1755
|
backgroundImage: "none",
|
|
1560
1756
|
border: `0.6px solid ${palette.dividers.secondary}`,
|
|
1561
|
-
boxShadow: `0px 1px 1px 0px ${(0,
|
|
1757
|
+
boxShadow: `0px 1px 1px 0px ${(0, import_material12.alpha)(palette.common.black, 0.05)}`,
|
|
1562
1758
|
minWidth: "150px"
|
|
1563
1759
|
}),
|
|
1564
1760
|
...slotProps?.paper ?? {}
|
|
1565
1761
|
}
|
|
1566
1762
|
},
|
|
1567
1763
|
...popoverProps,
|
|
1568
|
-
children: /* @__PURE__ */ (0,
|
|
1569
|
-
/* @__PURE__ */ (0,
|
|
1570
|
-
|
|
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,
|
|
1571
1767
|
{
|
|
1572
1768
|
dense: true,
|
|
1573
1769
|
sx: columnListItemSx,
|
|
1574
1770
|
onClick: () => table.toggleAllColumnsVisible(!allVisible),
|
|
1575
1771
|
children: [
|
|
1576
|
-
/* @__PURE__ */ (0,
|
|
1577
|
-
|
|
1772
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1773
|
+
import_material12.Checkbox,
|
|
1578
1774
|
{
|
|
1579
1775
|
checked: allVisible,
|
|
1580
1776
|
slotProps: { input: { "aria-label": `${showAllLabel} columns` } }
|
|
1581
1777
|
}
|
|
1582
1778
|
),
|
|
1583
|
-
/* @__PURE__ */ (0,
|
|
1779
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_material12.Typography, { variant: "caption", fontWeight: 600, children: showAllLabel })
|
|
1584
1780
|
]
|
|
1585
1781
|
}
|
|
1586
1782
|
),
|
|
1587
|
-
/* @__PURE__ */ (0,
|
|
1588
|
-
/* @__PURE__ */ (0,
|
|
1589
|
-
|
|
1783
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_material12.Divider, {}),
|
|
1784
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1785
|
+
import_material12.Box,
|
|
1590
1786
|
{
|
|
1591
1787
|
sx: { maxHeight: 340, overflow: "auto", overscrollBehavior: "none" },
|
|
1592
1788
|
children: table.getAllLeafColumns().map((column) => {
|
|
1593
1789
|
const columnName = column.columnDef.meta?.columnLabel ?? (typeof column.columnDef.header === "string" ? column.columnDef.header : column.id);
|
|
1594
|
-
return /* @__PURE__ */ (0,
|
|
1595
|
-
|
|
1790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1791
|
+
import_material12.ListItem,
|
|
1596
1792
|
{
|
|
1597
1793
|
dense: true,
|
|
1598
1794
|
sx: columnListItemSx,
|
|
1599
1795
|
onClick: column.getToggleVisibilityHandler(),
|
|
1600
1796
|
children: [
|
|
1601
|
-
/* @__PURE__ */ (0,
|
|
1602
|
-
|
|
1797
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1798
|
+
import_material12.Checkbox,
|
|
1603
1799
|
{
|
|
1604
1800
|
checked: column.getIsVisible(),
|
|
1605
1801
|
sx: { py: 1 },
|
|
@@ -1608,7 +1804,7 @@ function BiampTableColumnVisibility({
|
|
|
1608
1804
|
}
|
|
1609
1805
|
}
|
|
1610
1806
|
),
|
|
1611
|
-
/* @__PURE__ */ (0,
|
|
1807
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_material12.Typography, { variant: "caption", children: columnName })
|
|
1612
1808
|
]
|
|
1613
1809
|
},
|
|
1614
1810
|
column.id
|
|
@@ -1622,12 +1818,12 @@ function BiampTableColumnVisibility({
|
|
|
1622
1818
|
}
|
|
1623
1819
|
|
|
1624
1820
|
// src/BiampTable/BiampTableToolbarColumnVisibility.tsx
|
|
1625
|
-
var
|
|
1626
|
-
var
|
|
1821
|
+
var import_assets7 = require("@bwp-web/assets");
|
|
1822
|
+
var import_react6 = require("react");
|
|
1627
1823
|
|
|
1628
1824
|
// src/BiampTable/BiampTableToolbarActionButton.tsx
|
|
1629
|
-
var
|
|
1630
|
-
var
|
|
1825
|
+
var import_material13 = require("@mui/material");
|
|
1826
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1631
1827
|
function BiampTableToolbarActionButton({
|
|
1632
1828
|
label,
|
|
1633
1829
|
icon,
|
|
@@ -1635,13 +1831,13 @@ function BiampTableToolbarActionButton({
|
|
|
1635
1831
|
...props
|
|
1636
1832
|
}) {
|
|
1637
1833
|
const showBadge = badgeContent != null && badgeContent !== 0;
|
|
1638
|
-
return /* @__PURE__ */ (0,
|
|
1639
|
-
|
|
1834
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1835
|
+
import_material13.IconButton,
|
|
1640
1836
|
{
|
|
1641
1837
|
"aria-label": showBadge ? `${label} (${badgeContent})` : label,
|
|
1642
1838
|
...props,
|
|
1643
|
-
children: showBadge ? /* @__PURE__ */ (0,
|
|
1644
|
-
|
|
1839
|
+
children: showBadge ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1840
|
+
import_material13.Badge,
|
|
1645
1841
|
{
|
|
1646
1842
|
badgeContent,
|
|
1647
1843
|
color: "info",
|
|
@@ -1664,20 +1860,20 @@ function BiampTableToolbarActionButton({
|
|
|
1664
1860
|
}
|
|
1665
1861
|
|
|
1666
1862
|
// src/BiampTable/BiampTableToolbarColumnVisibility.tsx
|
|
1667
|
-
var
|
|
1863
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1668
1864
|
function BiampTableToolbarColumnVisibility({
|
|
1669
1865
|
table,
|
|
1670
|
-
icon = /* @__PURE__ */ (0,
|
|
1866
|
+
icon = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_assets7.ColumnsIcon, { variant: "xs" }),
|
|
1671
1867
|
label = "Columns",
|
|
1672
1868
|
defaultColumnVisibility,
|
|
1673
1869
|
showAllLabel,
|
|
1674
1870
|
...actionButtonProps
|
|
1675
1871
|
}) {
|
|
1676
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
1872
|
+
const [anchorEl, setAnchorEl] = (0, import_react6.useState)(null);
|
|
1677
1873
|
const defaults = defaultColumnVisibility ?? getDefaultColumnVisibility(table);
|
|
1678
1874
|
const dirtyCount = getColumnVisibilityDirtyCount(table, defaults);
|
|
1679
|
-
return /* @__PURE__ */ (0,
|
|
1680
|
-
/* @__PURE__ */ (0,
|
|
1875
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
1876
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1681
1877
|
BiampTableToolbarActionButton,
|
|
1682
1878
|
{
|
|
1683
1879
|
label,
|
|
@@ -1687,7 +1883,7 @@ function BiampTableToolbarColumnVisibility({
|
|
|
1687
1883
|
...actionButtonProps
|
|
1688
1884
|
}
|
|
1689
1885
|
),
|
|
1690
|
-
/* @__PURE__ */ (0,
|
|
1886
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1691
1887
|
BiampTableColumnVisibility,
|
|
1692
1888
|
{
|
|
1693
1889
|
table,
|
|
@@ -1700,9 +1896,9 @@ function BiampTableToolbarColumnVisibility({
|
|
|
1700
1896
|
}
|
|
1701
1897
|
|
|
1702
1898
|
// src/BiampTable/BiampTablePagination.tsx
|
|
1703
|
-
var
|
|
1704
|
-
var
|
|
1705
|
-
var
|
|
1899
|
+
var import_react7 = require("react");
|
|
1900
|
+
var import_material14 = require("@mui/material");
|
|
1901
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1706
1902
|
var positionMap = {
|
|
1707
1903
|
left: "flex-start",
|
|
1708
1904
|
center: "center",
|
|
@@ -1718,21 +1914,21 @@ function BiampTablePagination({
|
|
|
1718
1914
|
...paginationProps
|
|
1719
1915
|
}) {
|
|
1720
1916
|
const rowCount = table.getRowCount();
|
|
1721
|
-
const lastRowCountRef = (0,
|
|
1917
|
+
const lastRowCountRef = (0, import_react7.useRef)(rowCount);
|
|
1722
1918
|
if (!loading && rowCount >= 0) {
|
|
1723
1919
|
lastRowCountRef.current = rowCount;
|
|
1724
1920
|
}
|
|
1725
1921
|
const stableCount = loading ? lastRowCountRef.current : rowCount;
|
|
1726
1922
|
const { pageSize, pageIndex } = table.getState().pagination;
|
|
1727
1923
|
const maxPage = Math.max(0, Math.ceil(stableCount / pageSize) - 1);
|
|
1728
|
-
(0,
|
|
1924
|
+
(0, import_react7.useEffect)(() => {
|
|
1729
1925
|
if (!loading && pageIndex > maxPage) {
|
|
1730
1926
|
table.setPageIndex(maxPage);
|
|
1731
1927
|
}
|
|
1732
1928
|
}, [loading, pageIndex, maxPage, table]);
|
|
1733
1929
|
if (autoHide && (!stableCount || stableCount <= pageSize)) return null;
|
|
1734
|
-
return /* @__PURE__ */ (0,
|
|
1735
|
-
|
|
1930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1931
|
+
import_material14.TablePagination,
|
|
1736
1932
|
{
|
|
1737
1933
|
component: "div",
|
|
1738
1934
|
count: stableCount,
|
|
@@ -1763,15 +1959,15 @@ function BiampTablePagination({
|
|
|
1763
1959
|
}
|
|
1764
1960
|
|
|
1765
1961
|
// src/BiampTable/BiampTableToolbar.tsx
|
|
1766
|
-
var
|
|
1767
|
-
var
|
|
1962
|
+
var import_material15 = require("@mui/material");
|
|
1963
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1768
1964
|
function BiampTableToolbar({
|
|
1769
1965
|
children,
|
|
1770
1966
|
sx,
|
|
1771
1967
|
...props
|
|
1772
1968
|
}) {
|
|
1773
|
-
return /* @__PURE__ */ (0,
|
|
1774
|
-
|
|
1969
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1970
|
+
import_material15.Box,
|
|
1775
1971
|
{
|
|
1776
1972
|
role: "toolbar",
|
|
1777
1973
|
display: "flex",
|
|
@@ -1789,14 +1985,14 @@ function BiampTableToolbar({
|
|
|
1789
1985
|
}
|
|
1790
1986
|
|
|
1791
1987
|
// src/BiampTable/BiampTableToolbarActions.tsx
|
|
1792
|
-
var
|
|
1793
|
-
var
|
|
1988
|
+
var import_material16 = require("@mui/material");
|
|
1989
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1794
1990
|
function BiampTableToolbarActions({
|
|
1795
1991
|
children,
|
|
1796
1992
|
...props
|
|
1797
1993
|
}) {
|
|
1798
|
-
return /* @__PURE__ */ (0,
|
|
1799
|
-
|
|
1994
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1995
|
+
import_material16.Box,
|
|
1800
1996
|
{
|
|
1801
1997
|
display: "flex",
|
|
1802
1998
|
alignItems: "center",
|
|
@@ -1810,21 +2006,21 @@ function BiampTableToolbarActions({
|
|
|
1810
2006
|
}
|
|
1811
2007
|
|
|
1812
2008
|
// src/BiampTable/BiampTableToolbarExport.tsx
|
|
1813
|
-
var
|
|
1814
|
-
var
|
|
1815
|
-
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");
|
|
1816
2012
|
function BiampTableToolbarExport({
|
|
1817
2013
|
onExport,
|
|
1818
2014
|
loading,
|
|
1819
|
-
icon = /* @__PURE__ */ (0,
|
|
2015
|
+
icon = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_assets8.DownloadIcon, { variant: "xs" }),
|
|
1820
2016
|
label = "Export",
|
|
1821
2017
|
...props
|
|
1822
2018
|
}) {
|
|
1823
|
-
return /* @__PURE__ */ (0,
|
|
2019
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1824
2020
|
BiampTableToolbarActionButton,
|
|
1825
2021
|
{
|
|
1826
2022
|
label: loading ? `${label}, loading` : label,
|
|
1827
|
-
icon: loading ? /* @__PURE__ */ (0,
|
|
2023
|
+
icon: loading ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material17.CircularProgress, { size: 20, color: "inherit" }) : icon,
|
|
1828
2024
|
disabled: loading,
|
|
1829
2025
|
onClick: onExport,
|
|
1830
2026
|
...props
|
|
@@ -1833,16 +2029,16 @@ function BiampTableToolbarExport({
|
|
|
1833
2029
|
}
|
|
1834
2030
|
|
|
1835
2031
|
// src/BiampTable/BiampTableToolbarFilters.tsx
|
|
1836
|
-
var
|
|
1837
|
-
var
|
|
1838
|
-
var
|
|
1839
|
-
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");
|
|
1840
2036
|
function BiampTableToolbarFilters({
|
|
1841
2037
|
activeFilterCount,
|
|
1842
2038
|
children,
|
|
1843
2039
|
onReset,
|
|
1844
2040
|
onApply,
|
|
1845
|
-
icon = /* @__PURE__ */ (0,
|
|
2041
|
+
icon = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_assets9.FilterIcon, { variant: "xs" }),
|
|
1846
2042
|
title = "Filters",
|
|
1847
2043
|
resetLabel = "Clear filters",
|
|
1848
2044
|
applyLabel = "Apply",
|
|
@@ -1850,14 +2046,14 @@ function BiampTableToolbarFilters({
|
|
|
1850
2046
|
buttonLabel = "Filters",
|
|
1851
2047
|
DrawerProps: drawerProps
|
|
1852
2048
|
}) {
|
|
1853
|
-
const [open, setOpen] = (0,
|
|
1854
|
-
const titleId = (0,
|
|
2049
|
+
const [open, setOpen] = (0, import_react8.useState)(false);
|
|
2050
|
+
const titleId = (0, import_react8.useId)();
|
|
1855
2051
|
function handleClose() {
|
|
1856
2052
|
onApply?.();
|
|
1857
2053
|
setOpen(false);
|
|
1858
2054
|
}
|
|
1859
|
-
return /* @__PURE__ */ (0,
|
|
1860
|
-
/* @__PURE__ */ (0,
|
|
2055
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
2056
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1861
2057
|
BiampTableToolbarActionButton,
|
|
1862
2058
|
{
|
|
1863
2059
|
label: buttonLabel,
|
|
@@ -1866,8 +2062,8 @@ function BiampTableToolbarFilters({
|
|
|
1866
2062
|
onClick: () => setOpen(true)
|
|
1867
2063
|
}
|
|
1868
2064
|
),
|
|
1869
|
-
/* @__PURE__ */ (0,
|
|
1870
|
-
|
|
2065
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2066
|
+
import_material18.Drawer,
|
|
1871
2067
|
{
|
|
1872
2068
|
anchor: "right",
|
|
1873
2069
|
open,
|
|
@@ -1878,17 +2074,17 @@ function BiampTableToolbarFilters({
|
|
|
1878
2074
|
sx: { width: { xs: "100%", sm: 480 } },
|
|
1879
2075
|
...drawerProps?.PaperProps
|
|
1880
2076
|
},
|
|
1881
|
-
children: /* @__PURE__ */ (0,
|
|
1882
|
-
|
|
2077
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2078
|
+
import_material18.Box,
|
|
1883
2079
|
{
|
|
1884
2080
|
height: "100%",
|
|
1885
2081
|
display: "flex",
|
|
1886
2082
|
flexDirection: "column",
|
|
1887
2083
|
justifyContent: "space-between",
|
|
1888
2084
|
children: [
|
|
1889
|
-
/* @__PURE__ */ (0,
|
|
1890
|
-
/* @__PURE__ */ (0,
|
|
1891
|
-
|
|
2085
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_material18.Box, { children: [
|
|
2086
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2087
|
+
import_material18.Box,
|
|
1892
2088
|
{
|
|
1893
2089
|
display: "flex",
|
|
1894
2090
|
justifyContent: "space-between",
|
|
@@ -1896,10 +2092,10 @@ function BiampTableToolbarFilters({
|
|
|
1896
2092
|
px: 3.5,
|
|
1897
2093
|
py: 2.5,
|
|
1898
2094
|
children: [
|
|
1899
|
-
/* @__PURE__ */ (0,
|
|
2095
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_material18.Typography, { id: titleId, variant: "h2", children: [
|
|
1900
2096
|
title,
|
|
1901
|
-
/* @__PURE__ */ (0,
|
|
1902
|
-
|
|
2097
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2098
|
+
import_material18.Badge,
|
|
1903
2099
|
{
|
|
1904
2100
|
badgeContent: activeFilterCount,
|
|
1905
2101
|
color: "secondary",
|
|
@@ -1907,21 +2103,21 @@ function BiampTableToolbarFilters({
|
|
|
1907
2103
|
}
|
|
1908
2104
|
)
|
|
1909
2105
|
] }),
|
|
1910
|
-
/* @__PURE__ */ (0,
|
|
1911
|
-
|
|
2106
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2107
|
+
import_material18.IconButton,
|
|
1912
2108
|
{
|
|
1913
2109
|
size: "medium",
|
|
1914
2110
|
onClick: handleClose,
|
|
1915
2111
|
"aria-label": closeLabel,
|
|
1916
|
-
children: /* @__PURE__ */ (0,
|
|
2112
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_assets9.CloseIcon, {})
|
|
1917
2113
|
}
|
|
1918
2114
|
)
|
|
1919
2115
|
]
|
|
1920
2116
|
}
|
|
1921
2117
|
),
|
|
1922
|
-
/* @__PURE__ */ (0,
|
|
1923
|
-
/* @__PURE__ */ (0,
|
|
1924
|
-
|
|
2118
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material18.Divider, {}),
|
|
2119
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2120
|
+
import_material18.Box,
|
|
1925
2121
|
{
|
|
1926
2122
|
role: "group",
|
|
1927
2123
|
"aria-label": "Filter options",
|
|
@@ -1934,9 +2130,9 @@ function BiampTableToolbarFilters({
|
|
|
1934
2130
|
}
|
|
1935
2131
|
)
|
|
1936
2132
|
] }),
|
|
1937
|
-
/* @__PURE__ */ (0,
|
|
1938
|
-
/* @__PURE__ */ (0,
|
|
1939
|
-
|
|
2133
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_material18.Box, { display: "flex", children: [
|
|
2134
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2135
|
+
import_material18.Button,
|
|
1940
2136
|
{
|
|
1941
2137
|
variant: "overlay",
|
|
1942
2138
|
color: "secondary",
|
|
@@ -1946,8 +2142,8 @@ function BiampTableToolbarFilters({
|
|
|
1946
2142
|
children: resetLabel
|
|
1947
2143
|
}
|
|
1948
2144
|
),
|
|
1949
|
-
/* @__PURE__ */ (0,
|
|
1950
|
-
|
|
2145
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2146
|
+
import_material18.Button,
|
|
1951
2147
|
{
|
|
1952
2148
|
variant: "overlay",
|
|
1953
2149
|
color: "primary",
|
|
@@ -1966,23 +2162,23 @@ function BiampTableToolbarFilters({
|
|
|
1966
2162
|
}
|
|
1967
2163
|
|
|
1968
2164
|
// src/BiampTable/BiampTableToolbarSearch.tsx
|
|
1969
|
-
var
|
|
1970
|
-
var
|
|
1971
|
-
var
|
|
2165
|
+
var import_material19 = require("@mui/material");
|
|
2166
|
+
var import_assets10 = require("@bwp-web/assets");
|
|
2167
|
+
var import_react10 = require("react");
|
|
1972
2168
|
|
|
1973
2169
|
// src/BiampTable/useDebouncedCallback.ts
|
|
1974
|
-
var
|
|
2170
|
+
var import_react9 = require("react");
|
|
1975
2171
|
var BIAMP_TABLE_DEBOUNCE_DELAY = 300;
|
|
1976
2172
|
function useDebouncedCallback(callback, delay = BIAMP_TABLE_DEBOUNCE_DELAY) {
|
|
1977
|
-
const timeoutRef = (0,
|
|
1978
|
-
const callbackRef = (0,
|
|
2173
|
+
const timeoutRef = (0, import_react9.useRef)(null);
|
|
2174
|
+
const callbackRef = (0, import_react9.useRef)(callback);
|
|
1979
2175
|
callbackRef.current = callback;
|
|
1980
|
-
(0,
|
|
2176
|
+
(0, import_react9.useEffect)(() => {
|
|
1981
2177
|
return () => {
|
|
1982
2178
|
if (timeoutRef.current !== null) clearTimeout(timeoutRef.current);
|
|
1983
2179
|
};
|
|
1984
2180
|
}, []);
|
|
1985
|
-
return (0,
|
|
2181
|
+
return (0, import_react9.useCallback)(
|
|
1986
2182
|
(...args) => {
|
|
1987
2183
|
if (timeoutRef.current !== null) clearTimeout(timeoutRef.current);
|
|
1988
2184
|
timeoutRef.current = setTimeout(
|
|
@@ -1995,7 +2191,7 @@ function useDebouncedCallback(callback, delay = BIAMP_TABLE_DEBOUNCE_DELAY) {
|
|
|
1995
2191
|
}
|
|
1996
2192
|
|
|
1997
2193
|
// src/BiampTable/BiampTableToolbarSearch.tsx
|
|
1998
|
-
var
|
|
2194
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1999
2195
|
var searchFieldSx = {
|
|
2000
2196
|
"& .MuiInputBase-root": {
|
|
2001
2197
|
height: "36px !important",
|
|
@@ -2019,11 +2215,11 @@ function BiampTableToolbarSearch({
|
|
|
2019
2215
|
sx,
|
|
2020
2216
|
...textFieldProps
|
|
2021
2217
|
}) {
|
|
2022
|
-
const isMobile = (0,
|
|
2023
|
-
const [inputValue, setInputValue] = (0,
|
|
2024
|
-
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);
|
|
2025
2221
|
const debouncedOnChange = useDebouncedCallback(onChange, debounceDelay);
|
|
2026
|
-
(0,
|
|
2222
|
+
(0, import_react10.useEffect)(() => {
|
|
2027
2223
|
setInputValue(defaultValue);
|
|
2028
2224
|
}, [defaultValue]);
|
|
2029
2225
|
const handleChange = (e) => {
|
|
@@ -2039,18 +2235,18 @@ function BiampTableToolbarSearch({
|
|
|
2039
2235
|
setIsExpanded(false);
|
|
2040
2236
|
}
|
|
2041
2237
|
};
|
|
2042
|
-
const clearButton = inputValue ? /* @__PURE__ */ (0,
|
|
2043
|
-
|
|
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,
|
|
2044
2240
|
{
|
|
2045
2241
|
size: "small",
|
|
2046
2242
|
onClick: handleClear,
|
|
2047
2243
|
"aria-label": clearLabel,
|
|
2048
2244
|
sx: { mr: 0.5 },
|
|
2049
|
-
children: /* @__PURE__ */ (0,
|
|
2245
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_assets10.CloseIcon, { variant: "xs", sx: { width: 20, height: 20 } })
|
|
2050
2246
|
}
|
|
2051
2247
|
) }) : null;
|
|
2052
|
-
const textField = /* @__PURE__ */ (0,
|
|
2053
|
-
|
|
2248
|
+
const textField = /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2249
|
+
import_material19.TextField,
|
|
2054
2250
|
{
|
|
2055
2251
|
name: "search",
|
|
2056
2252
|
type: "text",
|
|
@@ -2058,8 +2254,8 @@ function BiampTableToolbarSearch({
|
|
|
2058
2254
|
slotProps: {
|
|
2059
2255
|
htmlInput: { maxLength, "aria-label": placeholder },
|
|
2060
2256
|
input: {
|
|
2061
|
-
startAdornment: /* @__PURE__ */ (0,
|
|
2062
|
-
|
|
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,
|
|
2063
2259
|
{
|
|
2064
2260
|
variant: "xs",
|
|
2065
2261
|
color: "inherit",
|
|
@@ -2084,10 +2280,10 @@ function BiampTableToolbarSearch({
|
|
|
2084
2280
|
}
|
|
2085
2281
|
);
|
|
2086
2282
|
if (isMobile && enableMobileView) {
|
|
2087
|
-
return /* @__PURE__ */ (0,
|
|
2088
|
-
/* @__PURE__ */ (0,
|
|
2089
|
-
/* @__PURE__ */ (0,
|
|
2090
|
-
|
|
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,
|
|
2091
2287
|
{
|
|
2092
2288
|
name: "search",
|
|
2093
2289
|
type: "text",
|
|
@@ -2108,15 +2304,15 @@ function BiampTableToolbarSearch({
|
|
|
2108
2304
|
] });
|
|
2109
2305
|
}
|
|
2110
2306
|
if (expandable) {
|
|
2111
|
-
return /* @__PURE__ */ (0,
|
|
2112
|
-
/* @__PURE__ */ (0,
|
|
2113
|
-
|
|
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,
|
|
2114
2310
|
{
|
|
2115
2311
|
"aria-label": expandLabel ?? placeholder,
|
|
2116
2312
|
onClick: () => setIsExpanded(true),
|
|
2117
2313
|
sx: { display: isExpanded || inputValue ? "none" : "flex" },
|
|
2118
|
-
children: /* @__PURE__ */ (0,
|
|
2119
|
-
|
|
2314
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2315
|
+
import_assets10.SearchIcon,
|
|
2120
2316
|
{
|
|
2121
2317
|
variant: "xs",
|
|
2122
2318
|
color: "inherit",
|
|
@@ -2125,8 +2321,8 @@ function BiampTableToolbarSearch({
|
|
|
2125
2321
|
)
|
|
2126
2322
|
}
|
|
2127
2323
|
),
|
|
2128
|
-
/* @__PURE__ */ (0,
|
|
2129
|
-
|
|
2324
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2325
|
+
import_material19.Collapse,
|
|
2130
2326
|
{
|
|
2131
2327
|
in: isExpanded || !!inputValue,
|
|
2132
2328
|
orientation: "horizontal",
|
|
@@ -2140,8 +2336,8 @@ function BiampTableToolbarSearch({
|
|
|
2140
2336
|
}
|
|
2141
2337
|
|
|
2142
2338
|
// src/BiampTable/useBiampServerSideTable.ts
|
|
2143
|
-
var
|
|
2144
|
-
var
|
|
2339
|
+
var import_react_table3 = require("@tanstack/react-table");
|
|
2340
|
+
var import_react11 = require("react");
|
|
2145
2341
|
|
|
2146
2342
|
// src/BiampTable/serverSideTableUtils.ts
|
|
2147
2343
|
function orderToSorting(order, fieldToColumnId) {
|
|
@@ -2197,8 +2393,8 @@ function getDirtyColumnVisibility(visibility, defaults) {
|
|
|
2197
2393
|
}
|
|
2198
2394
|
|
|
2199
2395
|
// src/BiampTable/useBiampServerSideTable.ts
|
|
2200
|
-
var coreRowModel = (0,
|
|
2201
|
-
var expandedRowModel = (0,
|
|
2396
|
+
var coreRowModel = (0, import_react_table3.getCoreRowModel)();
|
|
2397
|
+
var expandedRowModel = (0, import_react_table3.getExpandedRowModel)();
|
|
2202
2398
|
var defaultGetRowId = (row) => row.id;
|
|
2203
2399
|
function useBiampServerSideTable({
|
|
2204
2400
|
data,
|
|
@@ -2219,35 +2415,35 @@ function useBiampServerSideTable({
|
|
|
2219
2415
|
onExpandedChange,
|
|
2220
2416
|
getSubRows
|
|
2221
2417
|
}) {
|
|
2222
|
-
const { defaultColumnVisibility, columnIdToField, fieldToColumnId } = (0,
|
|
2418
|
+
const { defaultColumnVisibility, columnIdToField, fieldToColumnId } = (0, import_react11.useMemo)(
|
|
2223
2419
|
() => ({
|
|
2224
2420
|
defaultColumnVisibility: getDefaultColumnVisibilityFromDefs(columns),
|
|
2225
2421
|
...getOrderFieldMappings(columns)
|
|
2226
2422
|
}),
|
|
2227
2423
|
[columns]
|
|
2228
2424
|
);
|
|
2229
|
-
const sorting = (0,
|
|
2425
|
+
const sorting = (0, import_react11.useMemo)(
|
|
2230
2426
|
() => orderToSorting(order, fieldToColumnId),
|
|
2231
2427
|
[order, fieldToColumnId]
|
|
2232
2428
|
);
|
|
2233
2429
|
const hasPagination = page != null && rowsPerPage != null;
|
|
2234
|
-
const pagination = (0,
|
|
2430
|
+
const pagination = (0, import_react11.useMemo)(
|
|
2235
2431
|
() => hasPagination ? { pageIndex: page, pageSize: rowsPerPage } : void 0,
|
|
2236
2432
|
[hasPagination, page, rowsPerPage]
|
|
2237
2433
|
);
|
|
2238
2434
|
const hasSelection = selectedRowIds != null;
|
|
2239
|
-
const rowSelection = (0,
|
|
2435
|
+
const rowSelection = (0, import_react11.useMemo)(
|
|
2240
2436
|
() => hasSelection ? selectedIdsToRowSelection(selectedRowIds) : void 0,
|
|
2241
2437
|
[hasSelection, selectedRowIds]
|
|
2242
2438
|
);
|
|
2243
|
-
const mergedVisibility = (0,
|
|
2439
|
+
const mergedVisibility = (0, import_react11.useMemo)(
|
|
2244
2440
|
() => toVisibilityState({
|
|
2245
2441
|
...defaultColumnVisibility,
|
|
2246
2442
|
...columnVisibility
|
|
2247
2443
|
}),
|
|
2248
2444
|
[defaultColumnVisibility, columnVisibility]
|
|
2249
2445
|
);
|
|
2250
|
-
return (0,
|
|
2446
|
+
return (0, import_react_table3.useReactTable)({
|
|
2251
2447
|
data,
|
|
2252
2448
|
columns,
|
|
2253
2449
|
getCoreRowModel: coreRowModel,
|
|
@@ -2346,12 +2542,12 @@ function downloadCsv(csvContent, filename) {
|
|
|
2346
2542
|
}
|
|
2347
2543
|
|
|
2348
2544
|
// src/BiampBanner/BiampBanner.tsx
|
|
2349
|
-
var
|
|
2350
|
-
var
|
|
2351
|
-
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");
|
|
2352
2548
|
function BiampBanner({ show, children, severity }) {
|
|
2353
|
-
return /* @__PURE__ */ (0,
|
|
2354
|
-
|
|
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,
|
|
2355
2551
|
{
|
|
2356
2552
|
bgcolor: ({ palette }) => palette.background[severity],
|
|
2357
2553
|
display: "flex",
|
|
@@ -2369,25 +2565,25 @@ function BiampBanner({ show, children, severity }) {
|
|
|
2369
2565
|
) });
|
|
2370
2566
|
}
|
|
2371
2567
|
var iconMapping = {
|
|
2372
|
-
error: /* @__PURE__ */ (0,
|
|
2373
|
-
warning: /* @__PURE__ */ (0,
|
|
2374
|
-
success: /* @__PURE__ */ (0,
|
|
2375
|
-
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 } })
|
|
2376
2572
|
};
|
|
2377
2573
|
function BiampBannerIcon({ severity, children }) {
|
|
2378
|
-
return /* @__PURE__ */ (0,
|
|
2574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_jsx_runtime23.Fragment, { children: severity ? iconMapping[severity] : children });
|
|
2379
2575
|
}
|
|
2380
2576
|
function BiampBannerContent({ children, ...props }) {
|
|
2381
|
-
return /* @__PURE__ */ (0,
|
|
2577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_material20.Typography, { textAlign: "center", variant: "h3", ...props, children });
|
|
2382
2578
|
}
|
|
2383
2579
|
function BiampBannerActions({ children, ...props }) {
|
|
2384
|
-
return /* @__PURE__ */ (0,
|
|
2580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_material20.Box, { display: "flex", gap: 1, alignItems: "center", ...props, children });
|
|
2385
2581
|
}
|
|
2386
2582
|
|
|
2387
2583
|
// src/BiampSegmentedButton/SegmentedButton.tsx
|
|
2388
|
-
var
|
|
2584
|
+
var import_material21 = require("@mui/material");
|
|
2389
2585
|
var import_styles = require("@mui/material/styles");
|
|
2390
|
-
var
|
|
2586
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2391
2587
|
function SegmentedButton({
|
|
2392
2588
|
children,
|
|
2393
2589
|
active,
|
|
@@ -2395,13 +2591,13 @@ function SegmentedButton({
|
|
|
2395
2591
|
sx,
|
|
2396
2592
|
...props
|
|
2397
2593
|
}) {
|
|
2398
|
-
const theme = (0,
|
|
2594
|
+
const theme = (0, import_material21.useTheme)();
|
|
2399
2595
|
const isDarkMode = theme.palette.mode === "dark";
|
|
2400
2596
|
const backgroundColor = active ? isDarkMode ? theme.palette.grey[900] : theme.palette.common.white : "transparent";
|
|
2401
2597
|
const textColor = active ? theme.palette.text.primary : theme.palette.text.secondary;
|
|
2402
2598
|
const border = active ? "solid" : void 0;
|
|
2403
|
-
return /* @__PURE__ */ (0,
|
|
2404
|
-
|
|
2599
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2600
|
+
import_material21.Button,
|
|
2405
2601
|
{
|
|
2406
2602
|
sx: {
|
|
2407
2603
|
backgroundColor,
|
|
@@ -2424,13 +2620,13 @@ function SegmentedButton({
|
|
|
2424
2620
|
}
|
|
2425
2621
|
|
|
2426
2622
|
// src/BiampSegmentedButton/SegmentedButtonGroup.tsx
|
|
2427
|
-
var
|
|
2428
|
-
var
|
|
2623
|
+
var import_material22 = require("@mui/material");
|
|
2624
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2429
2625
|
function SegmentedButtonGroup({ children, sx, ...props }) {
|
|
2430
|
-
const theme = (0,
|
|
2626
|
+
const theme = (0, import_material22.useTheme)();
|
|
2431
2627
|
const isDarkMode = theme.palette.mode === "dark";
|
|
2432
|
-
return /* @__PURE__ */ (0,
|
|
2433
|
-
|
|
2628
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2629
|
+
import_material22.Stack,
|
|
2434
2630
|
{
|
|
2435
2631
|
direction: "row",
|
|
2436
2632
|
p: 0.5,
|
|
@@ -2447,11 +2643,11 @@ function SegmentedButtonGroup({ children, sx, ...props }) {
|
|
|
2447
2643
|
}
|
|
2448
2644
|
|
|
2449
2645
|
// src/BiampGlobalSearch/BiampGlobalSearch.tsx
|
|
2450
|
-
var
|
|
2451
|
-
var
|
|
2452
|
-
var
|
|
2453
|
-
var
|
|
2454
|
-
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)({
|
|
2455
2651
|
hasOptions: true,
|
|
2456
2652
|
loading: false,
|
|
2457
2653
|
noResultsText: "No results found",
|
|
@@ -2461,8 +2657,8 @@ function KeyCap({
|
|
|
2461
2657
|
children,
|
|
2462
2658
|
variant = "icon"
|
|
2463
2659
|
}) {
|
|
2464
|
-
return /* @__PURE__ */ (0,
|
|
2465
|
-
|
|
2660
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2661
|
+
import_material23.Box,
|
|
2466
2662
|
{
|
|
2467
2663
|
component: "kbd",
|
|
2468
2664
|
sx: {
|
|
@@ -2486,12 +2682,12 @@ function KeyCap({
|
|
|
2486
2682
|
}
|
|
2487
2683
|
);
|
|
2488
2684
|
}
|
|
2489
|
-
var BiampGlobalSearchPaper = (0,
|
|
2685
|
+
var BiampGlobalSearchPaper = (0, import_react12.forwardRef)(
|
|
2490
2686
|
function BiampGlobalSearchPaper2({ children, ...props }, ref) {
|
|
2491
|
-
const { hasOptions, loading, noResultsText } = (0,
|
|
2492
|
-
return /* @__PURE__ */ (0,
|
|
2493
|
-
hasOptions || loading ? children : /* @__PURE__ */ (0,
|
|
2494
|
-
|
|
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,
|
|
2495
2691
|
{
|
|
2496
2692
|
variant: "body2",
|
|
2497
2693
|
color: "text.secondary",
|
|
@@ -2499,8 +2695,8 @@ var BiampGlobalSearchPaper = (0, import_react11.forwardRef)(
|
|
|
2499
2695
|
children: noResultsText
|
|
2500
2696
|
}
|
|
2501
2697
|
),
|
|
2502
|
-
hasOptions && /* @__PURE__ */ (0,
|
|
2503
|
-
|
|
2698
|
+
hasOptions && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
2699
|
+
import_material23.Box,
|
|
2504
2700
|
{
|
|
2505
2701
|
sx: {
|
|
2506
2702
|
borderTop: ({ palette }) => `0.6px solid ${palette.dividers.secondary}`,
|
|
@@ -2510,13 +2706,13 @@ var BiampGlobalSearchPaper = (0, import_react11.forwardRef)(
|
|
|
2510
2706
|
p: 1.5
|
|
2511
2707
|
},
|
|
2512
2708
|
children: [
|
|
2513
|
-
/* @__PURE__ */ (0,
|
|
2514
|
-
/* @__PURE__ */ (0,
|
|
2515
|
-
/* @__PURE__ */ (0,
|
|
2516
|
-
/* @__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, {}) })
|
|
2517
2713
|
] }),
|
|
2518
|
-
/* @__PURE__ */ (0,
|
|
2519
|
-
|
|
2714
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2715
|
+
import_material23.Typography,
|
|
2520
2716
|
{
|
|
2521
2717
|
variant: "caption",
|
|
2522
2718
|
fontWeight: (theme) => theme.typography.fontWeightMedium,
|
|
@@ -2525,10 +2721,10 @@ var BiampGlobalSearchPaper = (0, import_react11.forwardRef)(
|
|
|
2525
2721
|
}
|
|
2526
2722
|
)
|
|
2527
2723
|
] }),
|
|
2528
|
-
/* @__PURE__ */ (0,
|
|
2529
|
-
/* @__PURE__ */ (0,
|
|
2530
|
-
/* @__PURE__ */ (0,
|
|
2531
|
-
|
|
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,
|
|
2532
2728
|
{
|
|
2533
2729
|
variant: "caption",
|
|
2534
2730
|
fontWeight: (theme) => theme.typography.fontWeightMedium,
|
|
@@ -2544,16 +2740,16 @@ var BiampGlobalSearchPaper = (0, import_react11.forwardRef)(
|
|
|
2544
2740
|
}
|
|
2545
2741
|
);
|
|
2546
2742
|
function HighlightText({ text, query }) {
|
|
2547
|
-
if (!query) return /* @__PURE__ */ (0,
|
|
2743
|
+
if (!query) return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_jsx_runtime26.Fragment, { children: text });
|
|
2548
2744
|
const index = text.toLowerCase().indexOf(query.toLowerCase());
|
|
2549
|
-
if (index === -1) return /* @__PURE__ */ (0,
|
|
2745
|
+
if (index === -1) return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_jsx_runtime26.Fragment, { children: text });
|
|
2550
2746
|
const before = text.slice(0, index);
|
|
2551
2747
|
const match = text.slice(index, index + query.length);
|
|
2552
2748
|
const after = text.slice(index + query.length);
|
|
2553
|
-
return /* @__PURE__ */ (0,
|
|
2749
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
2554
2750
|
before,
|
|
2555
|
-
/* @__PURE__ */ (0,
|
|
2556
|
-
|
|
2751
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2752
|
+
import_material23.Box,
|
|
2557
2753
|
{
|
|
2558
2754
|
component: "span",
|
|
2559
2755
|
sx: {
|
|
@@ -2573,12 +2769,12 @@ function BiampGlobalSearchListItem({
|
|
|
2573
2769
|
option,
|
|
2574
2770
|
props: liProps
|
|
2575
2771
|
}) {
|
|
2576
|
-
const { query } = (0,
|
|
2772
|
+
const { query } = (0, import_react12.useContext)(SearchContext);
|
|
2577
2773
|
const { key, ...rest } = liProps;
|
|
2578
2774
|
const maxChips = 3;
|
|
2579
2775
|
const chips = option.associatedItems?.slice(0, maxChips) ?? [];
|
|
2580
2776
|
const overflow = (option.associatedItems?.length ?? 0) - maxChips;
|
|
2581
|
-
return /* @__PURE__ */ (0,
|
|
2777
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
2582
2778
|
"li",
|
|
2583
2779
|
{
|
|
2584
2780
|
...rest,
|
|
@@ -2590,8 +2786,8 @@ function BiampGlobalSearchListItem({
|
|
|
2590
2786
|
...rest.style
|
|
2591
2787
|
},
|
|
2592
2788
|
children: [
|
|
2593
|
-
option.icon && /* @__PURE__ */ (0,
|
|
2594
|
-
|
|
2789
|
+
option.icon && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2790
|
+
import_material23.Box,
|
|
2595
2791
|
{
|
|
2596
2792
|
sx: {
|
|
2597
2793
|
width: 24,
|
|
@@ -2604,9 +2800,9 @@ function BiampGlobalSearchListItem({
|
|
|
2604
2800
|
children: option.icon
|
|
2605
2801
|
}
|
|
2606
2802
|
),
|
|
2607
|
-
/* @__PURE__ */ (0,
|
|
2608
|
-
option.subtitle && /* @__PURE__ */ (0,
|
|
2609
|
-
|
|
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,
|
|
2610
2806
|
{
|
|
2611
2807
|
className: "hoverContent",
|
|
2612
2808
|
variant: "body2",
|
|
@@ -2616,8 +2812,8 @@ function BiampGlobalSearchListItem({
|
|
|
2616
2812
|
children: option.subtitle
|
|
2617
2813
|
}
|
|
2618
2814
|
),
|
|
2619
|
-
chips.length > 0 && /* @__PURE__ */ (0,
|
|
2620
|
-
|
|
2815
|
+
chips.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
2816
|
+
import_material23.Box,
|
|
2621
2817
|
{
|
|
2622
2818
|
className: "hoverContent",
|
|
2623
2819
|
sx: {
|
|
@@ -2629,8 +2825,8 @@ function BiampGlobalSearchListItem({
|
|
|
2629
2825
|
px: 2
|
|
2630
2826
|
},
|
|
2631
2827
|
children: [
|
|
2632
|
-
chips.map((item, i) => /* @__PURE__ */ (0,
|
|
2633
|
-
|
|
2828
|
+
chips.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2829
|
+
import_material23.Chip,
|
|
2634
2830
|
{
|
|
2635
2831
|
size: "small",
|
|
2636
2832
|
label: item.label,
|
|
@@ -2647,8 +2843,8 @@ function BiampGlobalSearchListItem({
|
|
|
2647
2843
|
},
|
|
2648
2844
|
i
|
|
2649
2845
|
)),
|
|
2650
|
-
overflow > 0 && /* @__PURE__ */ (0,
|
|
2651
|
-
|
|
2846
|
+
overflow > 0 && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2847
|
+
import_material23.Chip,
|
|
2652
2848
|
{
|
|
2653
2849
|
size: "small",
|
|
2654
2850
|
label: `+${overflow}`,
|
|
@@ -2667,8 +2863,8 @@ function BiampGlobalSearchListItem({
|
|
|
2667
2863
|
]
|
|
2668
2864
|
}
|
|
2669
2865
|
),
|
|
2670
|
-
option.endIcon && /* @__PURE__ */ (0,
|
|
2671
|
-
|
|
2866
|
+
option.endIcon && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2867
|
+
import_material23.Box,
|
|
2672
2868
|
{
|
|
2673
2869
|
className: "endIcon",
|
|
2674
2870
|
sx: {
|
|
@@ -2715,7 +2911,7 @@ function BiampGlobalSearch({
|
|
|
2715
2911
|
}
|
|
2716
2912
|
onInputChange?.(event, value, reason);
|
|
2717
2913
|
};
|
|
2718
|
-
return /* @__PURE__ */ (0,
|
|
2914
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2719
2915
|
SearchContext.Provider,
|
|
2720
2916
|
{
|
|
2721
2917
|
value: {
|
|
@@ -2724,15 +2920,15 @@ function BiampGlobalSearch({
|
|
|
2724
2920
|
noResultsText,
|
|
2725
2921
|
query: inputValueProp ?? ""
|
|
2726
2922
|
},
|
|
2727
|
-
children: /* @__PURE__ */ (0,
|
|
2728
|
-
|
|
2923
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2924
|
+
import_material23.Autocomplete,
|
|
2729
2925
|
{
|
|
2730
2926
|
options,
|
|
2731
2927
|
inputValue: inputValueProp,
|
|
2732
2928
|
loading,
|
|
2733
2929
|
onChange: handleChange,
|
|
2734
2930
|
onInputChange: handleInputChange,
|
|
2735
|
-
loadingText: /* @__PURE__ */ (0,
|
|
2931
|
+
loadingText: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material23.Typography, { variant: "body2", color: "text.secondary", children: "Loading\u2026" }),
|
|
2736
2932
|
freeSolo: true,
|
|
2737
2933
|
filterOptions: (x) => x,
|
|
2738
2934
|
getOptionLabel: (option) => typeof option === "string" ? option : option.title,
|
|
@@ -2756,8 +2952,8 @@ function BiampGlobalSearch({
|
|
|
2756
2952
|
}
|
|
2757
2953
|
}
|
|
2758
2954
|
},
|
|
2759
|
-
renderInput: (params) => /* @__PURE__ */ (0,
|
|
2760
|
-
|
|
2955
|
+
renderInput: (params) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2956
|
+
import_material23.TextField,
|
|
2761
2957
|
{
|
|
2762
2958
|
...params,
|
|
2763
2959
|
placeholder,
|
|
@@ -2772,15 +2968,15 @@ function BiampGlobalSearch({
|
|
|
2772
2968
|
slotProps: {
|
|
2773
2969
|
input: {
|
|
2774
2970
|
...params.InputProps,
|
|
2775
|
-
startAdornment: /* @__PURE__ */ (0,
|
|
2776
|
-
/* @__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, {}) }),
|
|
2777
2973
|
params.InputProps.startAdornment
|
|
2778
2974
|
] })
|
|
2779
2975
|
}
|
|
2780
2976
|
}
|
|
2781
2977
|
}
|
|
2782
2978
|
),
|
|
2783
|
-
renderOption: (optionProps, option) => /* @__PURE__ */ (0,
|
|
2979
|
+
renderOption: (optionProps, option) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2784
2980
|
BiampGlobalSearchListItem,
|
|
2785
2981
|
{
|
|
2786
2982
|
option,
|
|
@@ -2796,10 +2992,10 @@ function BiampGlobalSearch({
|
|
|
2796
2992
|
}
|
|
2797
2993
|
|
|
2798
2994
|
// src/UserInitialsIcon/UserInitialsIcon.tsx
|
|
2799
|
-
var
|
|
2995
|
+
var import_material24 = require("@mui/material");
|
|
2800
2996
|
var import_styles2 = require("@mui/material/styles");
|
|
2801
2997
|
var import_randomcolor = __toESM(require_randomColor(), 1);
|
|
2802
|
-
var
|
|
2998
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2803
2999
|
var DEFAULT_SIZE = 40;
|
|
2804
3000
|
var DEFAULT_BORDER_RADIUS = 1.5;
|
|
2805
3001
|
var TEXT_RATIO = 0.4;
|
|
@@ -2817,8 +3013,8 @@ function UserInitialsIcon({
|
|
|
2817
3013
|
const textColor = (0, import_styles2.darken)((0, import_randomcolor.default)({ luminosity: "dark", seed: id }), 0.3);
|
|
2818
3014
|
const size = typeof width === "number" ? width : DEFAULT_SIZE;
|
|
2819
3015
|
const fontSize = size * TEXT_RATIO;
|
|
2820
|
-
return /* @__PURE__ */ (0,
|
|
2821
|
-
|
|
3016
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3017
|
+
import_material24.Box,
|
|
2822
3018
|
{
|
|
2823
3019
|
minWidth: width,
|
|
2824
3020
|
width,
|
|
@@ -2831,8 +3027,8 @@ function UserInitialsIcon({
|
|
|
2831
3027
|
justifyContent: "center",
|
|
2832
3028
|
sx: { ...sx },
|
|
2833
3029
|
...props,
|
|
2834
|
-
children: /* @__PURE__ */ (0,
|
|
2835
|
-
|
|
3030
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3031
|
+
import_material24.Typography,
|
|
2836
3032
|
{
|
|
2837
3033
|
variant: "h3",
|
|
2838
3034
|
color: textColor,
|
|
@@ -2854,9 +3050,9 @@ var getInitials = (name) => {
|
|
|
2854
3050
|
};
|
|
2855
3051
|
|
|
2856
3052
|
// src/DynamicSvgIcon/DynamicSvgIcon.tsx
|
|
2857
|
-
var
|
|
2858
|
-
var
|
|
2859
|
-
var
|
|
3053
|
+
var import_material25 = require("@mui/material");
|
|
3054
|
+
var import_react13 = require("react");
|
|
3055
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2860
3056
|
var svgCache = /* @__PURE__ */ new Map();
|
|
2861
3057
|
function clearDynamicSvgIconCache() {
|
|
2862
3058
|
svgCache.clear();
|
|
@@ -2867,17 +3063,17 @@ function applyCurrentColor(svg) {
|
|
|
2867
3063
|
function useDynamicSvgIcon(url, options = {}) {
|
|
2868
3064
|
const { replaceColors = false, onLoad, onError } = options;
|
|
2869
3065
|
const transform = replaceColors ? applyCurrentColor : (s) => s;
|
|
2870
|
-
const [svgContent, setSvgContent] = (0,
|
|
3066
|
+
const [svgContent, setSvgContent] = (0, import_react13.useState)(() => {
|
|
2871
3067
|
const cached = svgCache.get(url);
|
|
2872
3068
|
return cached ? transform(cached.innerContent) : null;
|
|
2873
3069
|
});
|
|
2874
|
-
const [svgViewBox, setSvgViewBox] = (0,
|
|
3070
|
+
const [svgViewBox, setSvgViewBox] = (0, import_react13.useState)(() => {
|
|
2875
3071
|
const cached = svgCache.get(url);
|
|
2876
3072
|
return cached?.viewBox ?? null;
|
|
2877
3073
|
});
|
|
2878
|
-
const [loading, setLoading] = (0,
|
|
2879
|
-
const [error, setError] = (0,
|
|
2880
|
-
(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)(() => {
|
|
2881
3077
|
if (!url) {
|
|
2882
3078
|
setLoading(false);
|
|
2883
3079
|
setError("No URL provided");
|
|
@@ -2958,8 +3154,8 @@ function DynamicSvgIcon({
|
|
|
2958
3154
|
onError
|
|
2959
3155
|
});
|
|
2960
3156
|
if (loading) {
|
|
2961
|
-
return /* @__PURE__ */ (0,
|
|
2962
|
-
|
|
3157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3158
|
+
import_material25.Skeleton,
|
|
2963
3159
|
{
|
|
2964
3160
|
variant: skeletonVariant,
|
|
2965
3161
|
animation: skeletonAnimation,
|
|
@@ -2968,8 +3164,8 @@ function DynamicSvgIcon({
|
|
|
2968
3164
|
);
|
|
2969
3165
|
}
|
|
2970
3166
|
if (error || !svgContent) {
|
|
2971
|
-
return /* @__PURE__ */ (0,
|
|
2972
|
-
|
|
3167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3168
|
+
import_material25.Box,
|
|
2973
3169
|
{
|
|
2974
3170
|
sx: {
|
|
2975
3171
|
width,
|
|
@@ -2988,8 +3184,8 @@ function DynamicSvgIcon({
|
|
|
2988
3184
|
}
|
|
2989
3185
|
);
|
|
2990
3186
|
}
|
|
2991
|
-
return /* @__PURE__ */ (0,
|
|
2992
|
-
|
|
3187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3188
|
+
import_material25.SvgIcon,
|
|
2993
3189
|
{
|
|
2994
3190
|
...svgIconProps,
|
|
2995
3191
|
...svgViewBox && { viewBox: svgViewBox },
|
|
@@ -2998,7 +3194,7 @@ function DynamicSvgIcon({
|
|
|
2998
3194
|
width,
|
|
2999
3195
|
height
|
|
3000
3196
|
},
|
|
3001
|
-
children: /* @__PURE__ */ (0,
|
|
3197
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("g", { dangerouslySetInnerHTML: { __html: svgContent } })
|
|
3002
3198
|
}
|
|
3003
3199
|
);
|
|
3004
3200
|
}
|