@wavelengthusaf/components 3.0.2 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -2
- package/dist/cjs/index.cjs +576 -59
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +58 -7
- package/dist/esm/index.d.ts +58 -7
- package/dist/esm/index.js +559 -42
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -206,7 +206,7 @@ var require_react_is_development = __commonJS({
|
|
|
206
206
|
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
207
207
|
var Element = REACT_ELEMENT_TYPE;
|
|
208
208
|
var ForwardRef2 = REACT_FORWARD_REF_TYPE;
|
|
209
|
-
var
|
|
209
|
+
var Fragment17 = REACT_FRAGMENT_TYPE;
|
|
210
210
|
var Lazy = REACT_LAZY_TYPE;
|
|
211
211
|
var Memo2 = REACT_MEMO_TYPE;
|
|
212
212
|
var Portal = REACT_PORTAL_TYPE;
|
|
@@ -265,7 +265,7 @@ var require_react_is_development = __commonJS({
|
|
|
265
265
|
exports.ContextProvider = ContextProvider;
|
|
266
266
|
exports.Element = Element;
|
|
267
267
|
exports.ForwardRef = ForwardRef2;
|
|
268
|
-
exports.Fragment =
|
|
268
|
+
exports.Fragment = Fragment17;
|
|
269
269
|
exports.Lazy = Lazy;
|
|
270
270
|
exports.Memo = Memo2;
|
|
271
271
|
exports.Portal = Portal;
|
|
@@ -1227,26 +1227,26 @@ if (!customElements.get("sample-component")) {
|
|
|
1227
1227
|
// src/web-components/wavelength-banner.ts
|
|
1228
1228
|
var WavelengthBanner = class extends HTMLElement {
|
|
1229
1229
|
static get observedAttributes() {
|
|
1230
|
-
return ["
|
|
1230
|
+
return ["banner-text", "banner-color", "text-color", "opacity", "z-index", "id", "classification", "control"];
|
|
1231
1231
|
}
|
|
1232
1232
|
constructor() {
|
|
1233
1233
|
super();
|
|
1234
1234
|
const shadow = this.attachShadow({ mode: "open" });
|
|
1235
1235
|
const style3 = document.createElement("style");
|
|
1236
1236
|
style3.textContent = `
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1237
|
+
:host {
|
|
1238
|
+
display: block;
|
|
1239
|
+
width: 100%;
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
.banner {
|
|
1243
|
+
width: 100%;
|
|
1244
|
+
text-align: center;
|
|
1245
|
+
font-weight: normal;
|
|
1246
|
+
font-family: sans-serif;
|
|
1247
|
+
font-size: 1rem;
|
|
1248
|
+
}
|
|
1249
|
+
`;
|
|
1250
1250
|
this.container = document.createElement("div");
|
|
1251
1251
|
this.container.classList.add("banner");
|
|
1252
1252
|
this.textElement = document.createElement("p");
|
|
@@ -1261,18 +1261,76 @@ var WavelengthBanner = class extends HTMLElement {
|
|
|
1261
1261
|
this.updateAttributes();
|
|
1262
1262
|
}
|
|
1263
1263
|
updateAttributes() {
|
|
1264
|
-
const
|
|
1265
|
-
const
|
|
1266
|
-
const
|
|
1267
|
-
|
|
1268
|
-
const
|
|
1269
|
-
const
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1264
|
+
const classificationRaw = this.getAttribute("classification")?.toLowerCase() || "";
|
|
1265
|
+
const controlRaw = this.getAttribute("control") || "";
|
|
1266
|
+
const controlList = controlRaw.split(",").map((s) => s.trim().toLowerCase()).filter(Boolean);
|
|
1267
|
+
let bannerText = this.getAttribute("banner-text");
|
|
1268
|
+
const bannerColor = this.getAttribute("banner-color");
|
|
1269
|
+
const textColor = this.getAttribute("text-color");
|
|
1270
|
+
const palette2 = {
|
|
1271
|
+
primary: "#4373aa",
|
|
1272
|
+
secondary: "#ffffff"
|
|
1273
|
+
};
|
|
1274
|
+
let effectiveClassification = classificationRaw;
|
|
1275
|
+
let effectiveColor = palette2.primary;
|
|
1276
|
+
let effectiveTextColor = palette2.secondary;
|
|
1277
|
+
switch (classificationRaw) {
|
|
1278
|
+
case "unclassified":
|
|
1279
|
+
case "u":
|
|
1280
|
+
if (controlRaw) {
|
|
1281
|
+
effectiveColor = "#502b85";
|
|
1282
|
+
effectiveTextColor = "white";
|
|
1283
|
+
} else {
|
|
1284
|
+
effectiveColor = "#007a33";
|
|
1285
|
+
effectiveTextColor = "white";
|
|
1286
|
+
}
|
|
1287
|
+
break;
|
|
1288
|
+
case "controlled":
|
|
1289
|
+
case "controlled unclassified information":
|
|
1290
|
+
case "cui":
|
|
1291
|
+
effectiveColor = "#502b85";
|
|
1292
|
+
effectiveTextColor = "white";
|
|
1293
|
+
break;
|
|
1294
|
+
case "confidential":
|
|
1295
|
+
case "c":
|
|
1296
|
+
effectiveColor = "#0033a0";
|
|
1297
|
+
effectiveTextColor = "white";
|
|
1298
|
+
break;
|
|
1299
|
+
case "secret":
|
|
1300
|
+
case "s":
|
|
1301
|
+
effectiveColor = "#c8102e";
|
|
1302
|
+
effectiveTextColor = "white";
|
|
1303
|
+
break;
|
|
1304
|
+
case "top secret":
|
|
1305
|
+
case "ts":
|
|
1306
|
+
if (controlList.includes("sci")) {
|
|
1307
|
+
effectiveColor = "#fce83a";
|
|
1308
|
+
effectiveTextColor = "black";
|
|
1309
|
+
} else {
|
|
1310
|
+
effectiveColor = "#ff8c00";
|
|
1311
|
+
effectiveTextColor = "black";
|
|
1312
|
+
}
|
|
1313
|
+
break;
|
|
1314
|
+
case "":
|
|
1315
|
+
effectiveClassification = "CLASSIFICATION//CONTROL";
|
|
1316
|
+
break;
|
|
1317
|
+
default:
|
|
1318
|
+
effectiveColor = palette2.primary;
|
|
1319
|
+
effectiveTextColor = palette2.secondary;
|
|
1320
|
+
}
|
|
1321
|
+
if (!bannerText) {
|
|
1322
|
+
if (controlList.length === 0) {
|
|
1323
|
+
bannerText = effectiveClassification;
|
|
1324
|
+
} else {
|
|
1325
|
+
bannerText = `${effectiveClassification}//${controlList.join("/")}`;
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
this.container.style.backgroundColor = bannerColor || effectiveColor;
|
|
1329
|
+
this.textElement.style.color = textColor || effectiveTextColor;
|
|
1330
|
+
this.container.style.opacity = this.getAttribute("opacity") || "1";
|
|
1331
|
+
this.container.style.zIndex = this.getAttribute("z-index") || "10";
|
|
1332
|
+
if (this.getAttribute("id")) this.container.id = this.getAttribute("id");
|
|
1333
|
+
this.textElement.textContent = bannerText.toUpperCase();
|
|
1276
1334
|
}
|
|
1277
1335
|
};
|
|
1278
1336
|
if (!customElements.get("wavelength-banner")) {
|
|
@@ -5688,18 +5746,20 @@ function WavelengthTitleBar2({ titleText, subtitleText, textColor, textShadow })
|
|
|
5688
5746
|
// src/components/headers/WavelengthTitleBar/WavelengthBanner.tsx
|
|
5689
5747
|
import { useEffect as useEffect4, useRef as useRef5 } from "react";
|
|
5690
5748
|
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
5691
|
-
function WavelengthBanner2({
|
|
5749
|
+
function WavelengthBanner2({ bannerText, bannerColor, textColor, opacity = 1, zIndex = 10, id, classification, control }) {
|
|
5692
5750
|
const ref = useRef5(null);
|
|
5693
5751
|
useEffect4(() => {
|
|
5694
|
-
if (ref.current)
|
|
5695
|
-
|
|
5696
|
-
|
|
5697
|
-
|
|
5698
|
-
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
|
|
5752
|
+
if (!ref.current) return;
|
|
5753
|
+
const el = ref.current;
|
|
5754
|
+
if (bannerText !== void 0) el.setAttribute("banner-text", bannerText);
|
|
5755
|
+
if (bannerColor !== void 0) el.setAttribute("banner-color", bannerColor);
|
|
5756
|
+
if (textColor !== void 0) el.setAttribute("text-color", textColor);
|
|
5757
|
+
if (classification !== void 0) el.setAttribute("classification", classification);
|
|
5758
|
+
if (control !== void 0) el.setAttribute("control", String(control));
|
|
5759
|
+
if (opacity !== void 0) el.setAttribute("opacity", String(opacity));
|
|
5760
|
+
if (zIndex !== void 0) el.setAttribute("z-index", String(zIndex));
|
|
5761
|
+
if (id) el.setAttribute("id", id);
|
|
5762
|
+
}, [bannerText, bannerColor, textColor, classification, control, opacity, zIndex, id]);
|
|
5703
5763
|
return /* @__PURE__ */ jsx23("wavelength-banner", { ref });
|
|
5704
5764
|
}
|
|
5705
5765
|
|
|
@@ -7282,16 +7342,471 @@ var WavelengthDataTable = ({ data, columns, itemsPerPage, totalPages }) => {
|
|
|
7282
7342
|
] });
|
|
7283
7343
|
};
|
|
7284
7344
|
|
|
7345
|
+
// src/components/DataTable/SubRowTable/ChildSubTable.tsx
|
|
7346
|
+
import { useMemo as useMemo3, useState as useState11, Fragment as Fragment14 } from "react";
|
|
7347
|
+
import styled12, { keyframes as keyframes2 } from "styled-components";
|
|
7348
|
+
import { Fragment as Fragment15, jsx as jsx42, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
7349
|
+
var downWardAnimation = keyframes2`
|
|
7350
|
+
0% { top: -122px; }
|
|
7351
|
+
100% { top: 0px; }
|
|
7352
|
+
`;
|
|
7353
|
+
var disSubTableAnim = keyframes2`
|
|
7354
|
+
0% { opacity: 0; }
|
|
7355
|
+
25% { opacity: 0; }
|
|
7356
|
+
50% { opacity: 0; }
|
|
7357
|
+
60% { opacity: 0.2; }
|
|
7358
|
+
75% { opacity: 0.8; }
|
|
7359
|
+
100% { opacity: 1; }
|
|
7360
|
+
`;
|
|
7361
|
+
var TableContainer = styled12.div`
|
|
7362
|
+
background-color: white;
|
|
7363
|
+
width: 1200px;
|
|
7364
|
+
border-radius: 16px;
|
|
7365
|
+
`;
|
|
7366
|
+
var TableRow = styled12.div`
|
|
7367
|
+
display: grid;
|
|
7368
|
+
grid-template-columns: ${({ $amountofColumns }) => `repeat(${$amountofColumns}, 1fr)`};
|
|
7369
|
+
`;
|
|
7370
|
+
var TablePrimaryRow = styled12.div`
|
|
7371
|
+
display: grid;
|
|
7372
|
+
grid-template-columns: ${({ $amountofColumns }) => `repeat(${$amountofColumns}, 1fr)`};
|
|
7373
|
+
margin-bottom: 25px;
|
|
7374
|
+
`;
|
|
7375
|
+
var BodyRowContainer = styled12.div`
|
|
7376
|
+
border: 1px solid black;
|
|
7377
|
+
background-color: white;
|
|
7378
|
+
border-radius: 16px;
|
|
7379
|
+
overflow: hidden;
|
|
7380
|
+
margin-bottom: 10px;
|
|
7381
|
+
`;
|
|
7382
|
+
var TableHeaderCell = styled12.div`
|
|
7383
|
+
padding-left: 12px;
|
|
7384
|
+
padding-right: 25px;
|
|
7385
|
+
`;
|
|
7386
|
+
var TableBodyCell = styled12.div`
|
|
7387
|
+
background-color: #fff;
|
|
7388
|
+
color: black;
|
|
7389
|
+
position: relative;
|
|
7390
|
+
padding: 10px 5px 0px 20px;
|
|
7391
|
+
text-wrap: balance;
|
|
7392
|
+
font-size: ${(props) => props.$primaryBoldState ? "24px" : "16px"};
|
|
7393
|
+
font-weight: ${(props) => props.$primaryBoldState ? "bold" : "normal"};
|
|
7394
|
+
`;
|
|
7395
|
+
var ButtonStylingRow = styled12.div`
|
|
7396
|
+
display: flex;
|
|
7397
|
+
flex-direction: row;
|
|
7398
|
+
`;
|
|
7399
|
+
var BottomArrowBar = styled12.div`
|
|
7400
|
+
background-color: #e9e9e9;
|
|
7401
|
+
text-align: center;
|
|
7402
|
+
`;
|
|
7403
|
+
var BottomUpArrowBar = styled12.div`
|
|
7404
|
+
background-color: #e9e9e9;
|
|
7405
|
+
text-align: center;
|
|
7406
|
+
position: relative;
|
|
7407
|
+
animation: ${downWardAnimation} 1.5s;
|
|
7408
|
+
`;
|
|
7409
|
+
var SubDataTable = styled12.table`
|
|
7410
|
+
background-color: white;
|
|
7411
|
+
color: black;
|
|
7412
|
+
width: 100%;
|
|
7413
|
+
border-collapse: collapse;
|
|
7414
|
+
animation: ${disSubTableAnim} 1.5s;
|
|
7415
|
+
|
|
7416
|
+
line-height: 1.2;
|
|
7417
|
+
`;
|
|
7418
|
+
var SubDataTableHeaderRow = styled12.tr`
|
|
7419
|
+
height: 50px;
|
|
7420
|
+
background-color: #304359;
|
|
7421
|
+
color: white;
|
|
7422
|
+
font-size: 16px;
|
|
7423
|
+
font-weight: bold;
|
|
7424
|
+
|
|
7425
|
+
th {
|
|
7426
|
+
white-space: nowrap;
|
|
7427
|
+
}
|
|
7428
|
+
`;
|
|
7429
|
+
var SubDataTableBodyRow = styled12.tbody`
|
|
7430
|
+
font-size: 14px;
|
|
7431
|
+
`;
|
|
7432
|
+
var SubDataTableBodyRowContainer = styled12.tr`
|
|
7433
|
+
td {
|
|
7434
|
+
padding: 10px 25px 10px 20px;
|
|
7435
|
+
}
|
|
7436
|
+
|
|
7437
|
+
&:nth-child(even) {
|
|
7438
|
+
background-color: #96e0e5;
|
|
7439
|
+
}
|
|
7440
|
+
`;
|
|
7441
|
+
var SubDataTableCell = styled12.td`
|
|
7442
|
+
text-align: center;
|
|
7443
|
+
`;
|
|
7444
|
+
var SubDataHeaderColumn = styled12.thead`
|
|
7445
|
+
background-color: #304359;
|
|
7446
|
+
`;
|
|
7447
|
+
var SortButton = styled12.button`
|
|
7448
|
+
font-size: 16px;
|
|
7449
|
+
font-weight: bold;
|
|
7450
|
+
color: ${(props) => props.$sortColor};
|
|
7451
|
+
background-color: #11ffee00;
|
|
7452
|
+
border: none;
|
|
7453
|
+
white-space: nowrap;
|
|
7454
|
+
`;
|
|
7455
|
+
var DownloadMissionButton = styled12.button`
|
|
7456
|
+
width: 217px;
|
|
7457
|
+
height: 45px;
|
|
7458
|
+
padding: 12px 32px 12px 32px;
|
|
7459
|
+
background-color: #1a8083cc;
|
|
7460
|
+
color: white;
|
|
7461
|
+
|
|
7462
|
+
margin-left: 22px;
|
|
7463
|
+
margin-bottom: 15px;
|
|
7464
|
+
margin-top: 10px;
|
|
7465
|
+
white-space: nowrap;
|
|
7466
|
+
border: none;
|
|
7467
|
+
border-radius: 8px;
|
|
7468
|
+
gap: 4px;
|
|
7469
|
+
|
|
7470
|
+
font-weight: 600;
|
|
7471
|
+
font-size: 16px;
|
|
7472
|
+
|
|
7473
|
+
&:hover {
|
|
7474
|
+
background-color: rgba(38, 186, 190, 1);
|
|
7475
|
+
color: rgba(247, 247, 249, 1);
|
|
7476
|
+
cursor: pointer;
|
|
7477
|
+
}
|
|
7478
|
+
|
|
7479
|
+
&:active {
|
|
7480
|
+
background-color: #67a8aa;
|
|
7481
|
+
transition: background-color 0.2s ease;
|
|
7482
|
+
}
|
|
7483
|
+
`;
|
|
7484
|
+
var AddButton = styled12.button`
|
|
7485
|
+
width: 130px;
|
|
7486
|
+
height: 45px;
|
|
7487
|
+
border: 1px solid #1a8083;
|
|
7488
|
+
|
|
7489
|
+
padding: 12px 32px 12px 32px;
|
|
7490
|
+
gap: 4px;
|
|
7491
|
+
background-color: white;
|
|
7492
|
+
color: #1a8083cc;
|
|
7493
|
+
|
|
7494
|
+
margin-left: 22px;
|
|
7495
|
+
margin-bottom: 15px;
|
|
7496
|
+
margin-top: 10px;
|
|
7497
|
+
white-space: nowrap;
|
|
7498
|
+
border-radius: 8px;
|
|
7499
|
+
|
|
7500
|
+
font-weight: 600;
|
|
7501
|
+
font-size: 16px;
|
|
7502
|
+
|
|
7503
|
+
&:hover {
|
|
7504
|
+
background-color: rgba(26, 128, 131, 0.1);
|
|
7505
|
+
color: rgba(26, 128, 131, 1);
|
|
7506
|
+
cursor: pointer;
|
|
7507
|
+
}
|
|
7508
|
+
|
|
7509
|
+
&:active {
|
|
7510
|
+
background-color: #bad7da;
|
|
7511
|
+
transition: background-color 0.2s ease;
|
|
7512
|
+
}
|
|
7513
|
+
`;
|
|
7514
|
+
var DownloadArrow = styled12.button`
|
|
7515
|
+
background-color: transparent;
|
|
7516
|
+
border: none;
|
|
7517
|
+
|
|
7518
|
+
&:active {
|
|
7519
|
+
transform: scale(0.95);
|
|
7520
|
+
}
|
|
7521
|
+
`;
|
|
7522
|
+
var ChildDataTable = ({ data, columns, downloadArrowOnClick }) => {
|
|
7523
|
+
const HeadColumns = columns.filter((col) => col.subDataTableColumn === false);
|
|
7524
|
+
const SubDataColumns = columns.filter((col) => col.subDataTableColumn === true);
|
|
7525
|
+
const [openRow, setOpenRow] = useState11(null);
|
|
7526
|
+
const [sortOrder, setSortOrder] = useState11("asc");
|
|
7527
|
+
const [sortKey, setSortKey] = useState11("");
|
|
7528
|
+
const [sortSubOrder, setSortSubOrder] = useState11("asc");
|
|
7529
|
+
const [sortSubKey, setSortSubKey] = useState11("");
|
|
7530
|
+
const toggleSortOrder = (key) => {
|
|
7531
|
+
setSortOrder(sortOrder === "asc" ? "desc" : "asc");
|
|
7532
|
+
setSortKey(key);
|
|
7533
|
+
};
|
|
7534
|
+
const toggleSubSortOrder = (key) => {
|
|
7535
|
+
setSortSubOrder(sortSubOrder === "asc" ? "desc" : "asc");
|
|
7536
|
+
setSortSubKey(key);
|
|
7537
|
+
};
|
|
7538
|
+
const toggleDropdown = (id) => {
|
|
7539
|
+
setOpenRow(openRow === id ? null : id);
|
|
7540
|
+
};
|
|
7541
|
+
const toggleUpward = () => {
|
|
7542
|
+
setOpenRow(null);
|
|
7543
|
+
};
|
|
7544
|
+
function trimBeforePeriod2(text) {
|
|
7545
|
+
const index = text.indexOf(".");
|
|
7546
|
+
return index === -1 ? text : text.substring(index + 1);
|
|
7547
|
+
}
|
|
7548
|
+
const processedRowData = useMemo3(() => {
|
|
7549
|
+
const result = [...data ?? []];
|
|
7550
|
+
if (sortOrder) {
|
|
7551
|
+
result.sort((a, b) => {
|
|
7552
|
+
const valueA = a[sortKey];
|
|
7553
|
+
const valueB = b[sortKey];
|
|
7554
|
+
if (typeof valueA === "string" && typeof valueB === "string") {
|
|
7555
|
+
if (sortOrder === "asc") {
|
|
7556
|
+
return valueA.localeCompare(valueB);
|
|
7557
|
+
} else {
|
|
7558
|
+
return valueB.localeCompare(valueA);
|
|
7559
|
+
}
|
|
7560
|
+
} else if (typeof valueA === "number" && typeof valueB === "number") {
|
|
7561
|
+
if (sortOrder === "asc") {
|
|
7562
|
+
return valueA - valueB;
|
|
7563
|
+
} else {
|
|
7564
|
+
return valueB - valueA;
|
|
7565
|
+
}
|
|
7566
|
+
} else {
|
|
7567
|
+
return 0;
|
|
7568
|
+
}
|
|
7569
|
+
});
|
|
7570
|
+
}
|
|
7571
|
+
if (sortSubOrder) {
|
|
7572
|
+
result.map(
|
|
7573
|
+
(item) => item.Details?.fileObjects.sort((c, d) => {
|
|
7574
|
+
const valueC = c[sortSubKey];
|
|
7575
|
+
const valueD = d[sortSubKey];
|
|
7576
|
+
if (typeof valueC === "string" && typeof valueD === "string") {
|
|
7577
|
+
if (sortSubOrder === "asc") {
|
|
7578
|
+
return valueC.localeCompare(valueD);
|
|
7579
|
+
} else {
|
|
7580
|
+
return valueD.localeCompare(valueC);
|
|
7581
|
+
}
|
|
7582
|
+
} else if (typeof valueC === "number" && typeof valueD === "number") {
|
|
7583
|
+
if (sortSubOrder === "asc") {
|
|
7584
|
+
return valueC - valueD;
|
|
7585
|
+
} else {
|
|
7586
|
+
return valueD - valueC;
|
|
7587
|
+
}
|
|
7588
|
+
} else {
|
|
7589
|
+
return 0;
|
|
7590
|
+
}
|
|
7591
|
+
})
|
|
7592
|
+
);
|
|
7593
|
+
}
|
|
7594
|
+
return result;
|
|
7595
|
+
}, [data, sortKey, sortOrder, sortSubKey, sortSubOrder]);
|
|
7596
|
+
const renderSortButton = (column, sortOrder2, sortKey2) => {
|
|
7597
|
+
return sortKey2 === column.key ? sortOrder2 === "asc" ? /* @__PURE__ */ jsx42(Fragment15, { children: /* @__PURE__ */ jsxs32(SortButton, { $sortColor: "black", onClick: () => toggleSortOrder(column.key), children: [
|
|
7598
|
+
column.title,
|
|
7599
|
+
" ",
|
|
7600
|
+
/* @__PURE__ */ jsx42("svg", { width: "15", height: "10", viewBox: "0 0 15 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx42("path", { d: "M13.2375 0.368774L7.5 6.09377L1.7625 0.368774L0 2.13127L7.5 9.63127L15 2.13127L13.2375 0.368774Z", fill: "black" }) })
|
|
7601
|
+
] }) }) : /* @__PURE__ */ jsx42(Fragment15, { children: /* @__PURE__ */ jsxs32(SortButton, { $sortColor: "black", onClick: () => toggleSortOrder(column.key), children: [
|
|
7602
|
+
column.title,
|
|
7603
|
+
" ",
|
|
7604
|
+
/* @__PURE__ */ jsx42("svg", { width: "15", height: "10", viewBox: "0 0 15 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx42("path", { d: "M13.2375 9.2627L7.5 3.5377L1.7625 9.2627L0 7.5002L7.5 0.000196457L15 7.5002L13.2375 9.2627Z", fill: "black" }) })
|
|
7605
|
+
] }) }) : /* @__PURE__ */ jsx42(Fragment15, { children: /* @__PURE__ */ jsxs32(SortButton, { $sortColor: "black", onClick: () => toggleSortOrder(column.key), children: [
|
|
7606
|
+
column.title,
|
|
7607
|
+
" ",
|
|
7608
|
+
/* @__PURE__ */ jsx42("svg", { width: "15", height: "10", viewBox: "0 0 15 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx42("path", { d: "M13.2375 0.368774L7.5 6.09377L1.7625 0.368774L0 2.13127L7.5 9.63127L15 2.13127L13.2375 0.368774Z", fill: "black" }) })
|
|
7609
|
+
] }) });
|
|
7610
|
+
};
|
|
7611
|
+
const renderSortSubButton = (column, sortSubOrder2, sortSubKey2) => {
|
|
7612
|
+
const columnKey = trimBeforePeriod2(column.key);
|
|
7613
|
+
return sortSubKey2 === columnKey ? sortSubOrder2 === "asc" ? /* @__PURE__ */ jsxs32(SortButton, { $sortColor: "white", onClick: () => toggleSubSortOrder(columnKey), children: [
|
|
7614
|
+
column.title,
|
|
7615
|
+
" ",
|
|
7616
|
+
/* @__PURE__ */ jsx42("svg", { width: "15", height: "10", viewBox: "0 0 15 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx42("path", { d: "M13.2375 0.368774L7.5 6.09377L1.7625 0.368774L0 2.13127L7.5 9.63127L15 2.13127L13.2375 0.368774Z", fill: "white" }) })
|
|
7617
|
+
] }) : /* @__PURE__ */ jsxs32(SortButton, { $sortColor: "white", onClick: () => toggleSubSortOrder(columnKey), children: [
|
|
7618
|
+
column.title,
|
|
7619
|
+
" ",
|
|
7620
|
+
/* @__PURE__ */ jsx42("svg", { width: "15", height: "10", viewBox: "0 0 15 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx42("path", { d: "M13.2375 9.2627L7.5 3.5377L1.7625 9.2627L0 7.5002L7.5 0.000196457L15 7.5002L13.2375 9.2627Z", fill: "white" }) })
|
|
7621
|
+
] }) : /* @__PURE__ */ jsxs32(SortButton, { $sortColor: "white", onClick: () => toggleSubSortOrder(columnKey), children: [
|
|
7622
|
+
column.title,
|
|
7623
|
+
" ",
|
|
7624
|
+
/* @__PURE__ */ jsx42("svg", { width: "15", height: "10", viewBox: "0 0 15 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx42("path", { d: "M13.2375 0.368774L7.5 6.09377L1.7625 0.368774L0 2.13127L7.5 9.63127L15 2.13127L13.2375 0.368774Z", fill: "white" }) })
|
|
7625
|
+
] });
|
|
7626
|
+
};
|
|
7627
|
+
const headers = HeadColumns.map((column) => {
|
|
7628
|
+
return /* @__PURE__ */ jsx42(TableHeaderCell, { children: renderSortButton(column, sortOrder, sortKey) }, `HeaderCell-${column.key}`);
|
|
7629
|
+
});
|
|
7630
|
+
const SubDataHeaders = SubDataColumns.map((column, index) => {
|
|
7631
|
+
return /* @__PURE__ */ jsx42("th", { children: renderSortSubButton(column, sortSubOrder, sortSubKey) }, `SubHeadCell-${index}`);
|
|
7632
|
+
});
|
|
7633
|
+
const subDataRows = (itemId) => {
|
|
7634
|
+
return processedRowData.filter((item) => item.Details?.relationId === itemId).map((item) => /* @__PURE__ */ jsx42(Fragment14, { children: item.Details?.fileObjects.map((fileItem, index) => /* @__PURE__ */ jsxs32(SubDataTableBodyRowContainer, { children: [
|
|
7635
|
+
/* @__PURE__ */ jsx42("td", { children: /* @__PURE__ */ jsx42(DownloadArrow, { onClick: downloadArrowOnClick, children: /* @__PURE__ */ jsx42("svg", { width: "17", height: "16", viewBox: "0 0 17 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx42(
|
|
7636
|
+
"path",
|
|
7637
|
+
{
|
|
7638
|
+
d: "M8.5 12L3.5 7L4.9 5.55L7.5 8.15V0H9.5V8.15L12.1 5.55L13.5 7L8.5 12ZM2.5 16C1.95 16 1.47917 15.8042 1.0875 15.4125C0.695833 15.0208 0.5 14.55 0.5 14V11H2.5V14H14.5V11H16.5V14C16.5 14.55 16.3042 15.0208 15.9125 15.4125C15.5208 15.8042 15.05 16 14.5 16H2.5Z",
|
|
7639
|
+
fill: "#1C1B1F"
|
|
7640
|
+
}
|
|
7641
|
+
) }) }) }, `td-${item.Details?.relationId}-${fileItem.id}`),
|
|
7642
|
+
SubDataColumns.map((column) => {
|
|
7643
|
+
const columnKey = trimBeforePeriod2(column.key);
|
|
7644
|
+
const value = fileItem[columnKey];
|
|
7645
|
+
if (value !== void 0) {
|
|
7646
|
+
return /* @__PURE__ */ jsx42(SubDataTableCell, { children: /* @__PURE__ */ jsx42("span", { children: value }, `span-${item.Details?.relationId}-${fileItem.id}-${index}-${column.title}`) }, `fileitem-${item}-${item.Details?.relationId}-${fileItem.id}-${index}-${column.title}`);
|
|
7647
|
+
}
|
|
7648
|
+
})
|
|
7649
|
+
] }, `${item}-${item.Details?.relationId}-${fileItem.id}-${index}`)) }, `SDR-${item.id}-${item.Details?.relationId}`));
|
|
7650
|
+
};
|
|
7651
|
+
const dataRows = processedRowData?.map((item, index) => /* @__PURE__ */ jsxs32(BodyRowContainer, { children: [
|
|
7652
|
+
/* @__PURE__ */ jsx42(TableRow, { $amountofColumns: HeadColumns.length, children: HeadColumns.map((column) => /* @__PURE__ */ jsx42(TableBodyCell, { $primaryBoldState: column.PrimaryBoldText, children: item[column.key] }, `TableBodycell-${item.id}-${column.key}`)) }),
|
|
7653
|
+
/* @__PURE__ */ jsxs32(ButtonStylingRow, { children: [
|
|
7654
|
+
/* @__PURE__ */ jsx42(DownloadMissionButton, { children: "Download Mission" }),
|
|
7655
|
+
/* @__PURE__ */ jsx42(AddButton, { children: "Add files" })
|
|
7656
|
+
] }),
|
|
7657
|
+
openRow !== item.id && /* @__PURE__ */ jsx42(BottomArrowBar, { onClick: () => toggleDropdown(item.id), children: /* @__PURE__ */ jsx42("svg", { width: "92", height: "14", viewBox: "0 0 92 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx42("path", { d: "M64 0L44 6L24 0H0L44 14L92 0H64Z", fill: "#7A7A7A" }) }) }),
|
|
7658
|
+
openRow === item.id && /* @__PURE__ */ jsxs32("div", { children: [
|
|
7659
|
+
/* @__PURE__ */ jsxs32(SubDataTable, { children: [
|
|
7660
|
+
/* @__PURE__ */ jsx42(SubDataHeaderColumn, { children: /* @__PURE__ */ jsxs32(SubDataTableHeaderRow, { children: [
|
|
7661
|
+
/* @__PURE__ */ jsx42("th", {}),
|
|
7662
|
+
SubDataHeaders
|
|
7663
|
+
] }) }),
|
|
7664
|
+
/* @__PURE__ */ jsx42(SubDataTableBodyRow, { children: subDataRows(item.id) })
|
|
7665
|
+
] }),
|
|
7666
|
+
/* @__PURE__ */ jsx42(BottomUpArrowBar, { onClick: () => toggleUpward(), children: /* @__PURE__ */ jsx42("svg", { width: "92", height: "14", viewBox: "0 0 92 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx42("path", { d: "M64 14L44 8L24 14H0L44 0L92 14H64Z", fill: "#7A7A7A" }) }) })
|
|
7667
|
+
] })
|
|
7668
|
+
] }, `Bodycontainer-${item.id}-${index}`));
|
|
7669
|
+
return /* @__PURE__ */ jsxs32(TableContainer, { children: [
|
|
7670
|
+
/* @__PURE__ */ jsx42(TablePrimaryRow, { $amountofColumns: HeadColumns.length, children: headers }),
|
|
7671
|
+
/* @__PURE__ */ jsx42("div", { title: "tablebodies", children: dataRows })
|
|
7672
|
+
] });
|
|
7673
|
+
};
|
|
7674
|
+
|
|
7675
|
+
// src/components/DataTable/NestedDataTable/NestedDataTable.tsx
|
|
7676
|
+
import { useState as useState12 } from "react";
|
|
7677
|
+
import styled13 from "styled-components";
|
|
7678
|
+
import { Fragment as Fragment16, jsx as jsx43, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
7679
|
+
var TableStyle = styled13.table`
|
|
7680
|
+
width: 100%;
|
|
7681
|
+
height: 100%;
|
|
7682
|
+
border-collapse: collapse;
|
|
7683
|
+
color: black;
|
|
7684
|
+
text-align: center;
|
|
7685
|
+
|
|
7686
|
+
thead {
|
|
7687
|
+
background-color: black;
|
|
7688
|
+
color: white;
|
|
7689
|
+
}
|
|
7690
|
+
|
|
7691
|
+
margin-left: auto;
|
|
7692
|
+
margin-right: auto;
|
|
7693
|
+
position: absolute;
|
|
7694
|
+
`;
|
|
7695
|
+
var MainThHeaders = styled13.th`
|
|
7696
|
+
&:not(:last-child) {
|
|
7697
|
+
border-right: 1px solid #c6c7cc;
|
|
7698
|
+
}
|
|
7699
|
+
`;
|
|
7700
|
+
var SubDataTr = styled13.tr`
|
|
7701
|
+
background-color: white;
|
|
7702
|
+
|
|
7703
|
+
&:nth-child(even) {
|
|
7704
|
+
background-color: #e0ffff;
|
|
7705
|
+
}
|
|
7706
|
+
`;
|
|
7707
|
+
var PrimaryTrRows = styled13.tr`
|
|
7708
|
+
background-color: ${(props) => props.$index % 2 === 0 ? "white" : "#e0ffff"};
|
|
7709
|
+
`;
|
|
7710
|
+
var SubTrRows = styled13.tr`
|
|
7711
|
+
background-color: ${(props) => props.$index % 2 === 0 ? "white" : "#e0ffff"};
|
|
7712
|
+
height: 120px;
|
|
7713
|
+
`;
|
|
7714
|
+
var SubTableStyle = styled13.table`
|
|
7715
|
+
width: 95%;
|
|
7716
|
+
border-collapse: collapse;
|
|
7717
|
+
margin-top: -15px;
|
|
7718
|
+
margin-left: auto;
|
|
7719
|
+
margin-right: auto;
|
|
7720
|
+
|
|
7721
|
+
td {
|
|
7722
|
+
&:not(:last-child) {
|
|
7723
|
+
border-right: 1px solid black;
|
|
7724
|
+
}
|
|
7725
|
+
}
|
|
7726
|
+
|
|
7727
|
+
th {
|
|
7728
|
+
background-color: #065465;
|
|
7729
|
+
&:not(:last-child) {
|
|
7730
|
+
border-right: 1px solid #c6c7cc;
|
|
7731
|
+
}
|
|
7732
|
+
}
|
|
7733
|
+
`;
|
|
7734
|
+
var DropdownButton = styled13.button`
|
|
7735
|
+
background-color: transparent;
|
|
7736
|
+
background-repeat: no-repeat;
|
|
7737
|
+
border: none;
|
|
7738
|
+
cursor: pointer;
|
|
7739
|
+
overflow: hidden;
|
|
7740
|
+
outline: none;
|
|
7741
|
+
font-weight: bold; /* This makes the UTF symbols bold */
|
|
7742
|
+
font-size: 20px;
|
|
7743
|
+
`;
|
|
7744
|
+
var PrimaryTdSpan = styled13.td`
|
|
7745
|
+
&:not(:last-child) {
|
|
7746
|
+
border-right: 1px solid black;
|
|
7747
|
+
}
|
|
7748
|
+
`;
|
|
7749
|
+
function trimBeforePeriod(text) {
|
|
7750
|
+
const index = text.indexOf(".");
|
|
7751
|
+
return index === -1 ? text : text.substring(index + 1);
|
|
7752
|
+
}
|
|
7753
|
+
var NestedDataTable = ({ data, columns }) => {
|
|
7754
|
+
const HeadColumns = columns.filter((col) => col.subDataTableColumn === false);
|
|
7755
|
+
const SubDataColumns = columns.filter((col) => col.subDataTableColumn === true);
|
|
7756
|
+
const [isOpen, setIsOpen] = useState12(false);
|
|
7757
|
+
const [isAscending, setIsAscending] = useState12(false);
|
|
7758
|
+
const [primaryRowIndex, setPrimaryRowIndex] = useState12(null);
|
|
7759
|
+
const toggleDropdown = (rowIndex) => {
|
|
7760
|
+
setIsOpen(!isOpen);
|
|
7761
|
+
setIsAscending(!isAscending);
|
|
7762
|
+
setPrimaryRowIndex(rowIndex);
|
|
7763
|
+
};
|
|
7764
|
+
const headers = HeadColumns.map((column, index) => {
|
|
7765
|
+
return /* @__PURE__ */ jsx43(MainThHeaders, { children: column.title }, `headCell-${index}`);
|
|
7766
|
+
});
|
|
7767
|
+
const SubDataHeaders = SubDataColumns.map((column, index) => {
|
|
7768
|
+
return /* @__PURE__ */ jsx43("th", { children: column.title }, `SubHeadCell-${index}`);
|
|
7769
|
+
});
|
|
7770
|
+
const subDataRows = !data?.length ? /* @__PURE__ */ jsx43("tr", { children: /* @__PURE__ */ jsx43("td", { title: "NoSubDataRows", colSpan: columns.length, children: "No data" }) }) : data.map((item, index) => /* @__PURE__ */ jsx43(Fragment16, { children: /* @__PURE__ */ jsx43(SubDataTr, { children: SubDataColumns.map((column, colIndex) => {
|
|
7771
|
+
const columnKey = trimBeforePeriod(column.key);
|
|
7772
|
+
const value = item.Details?.[columnKey];
|
|
7773
|
+
console.log("value: ", value);
|
|
7774
|
+
if (value !== void 0) {
|
|
7775
|
+
return /* @__PURE__ */ jsx43("td", { children: /* @__PURE__ */ jsx43("span", { children: value }) }, `Span-${item.id}-${colIndex}`);
|
|
7776
|
+
}
|
|
7777
|
+
}) }, `Sub-${item.id}-${index}`) }));
|
|
7778
|
+
const childRows = /* @__PURE__ */ jsxs33(SubTableStyle, { children: [
|
|
7779
|
+
/* @__PURE__ */ jsx43("thead", { children: /* @__PURE__ */ jsx43("tr", { children: SubDataHeaders }) }),
|
|
7780
|
+
/* @__PURE__ */ jsx43("tbody", { children: subDataRows })
|
|
7781
|
+
] });
|
|
7782
|
+
const rows = !data?.length ? /* @__PURE__ */ jsx43("tr", { children: /* @__PURE__ */ jsx43("td", { title: "NoDataRows", colSpan: columns.length, children: "No data" }) }) : data?.map((item, index) => /* @__PURE__ */ jsxs33(Fragment16, { children: [
|
|
7783
|
+
/* @__PURE__ */ jsxs33(PrimaryTrRows, { $index: index, children: [
|
|
7784
|
+
/* @__PURE__ */ jsx43(DropdownButton, { onClick: () => toggleDropdown(index), children: isAscending && isOpen && primaryRowIndex === index ? /* @__PURE__ */ jsx43(Fragment16, { children: "\u2227" }) : /* @__PURE__ */ jsx43(Fragment16, { children: "\u2228" }) }),
|
|
7785
|
+
HeadColumns.map((column, index2) => {
|
|
7786
|
+
return /* @__PURE__ */ jsx43(PrimaryTdSpan, { children: /* @__PURE__ */ jsx43("span", { title: `spanRow-${item.id}-${column.key}-${index2}`, children: item[column.key] }) }, `${item.id}-${index}=${index2}`);
|
|
7787
|
+
})
|
|
7788
|
+
] }, index),
|
|
7789
|
+
isOpen && primaryRowIndex === index && /* @__PURE__ */ jsx43(SubTrRows, { $index: index, children: /* @__PURE__ */ jsx43("td", { colSpan: HeadColumns.length + 1, children: childRows }) }, index)
|
|
7790
|
+
] }));
|
|
7791
|
+
return /* @__PURE__ */ jsx43("div", { children: /* @__PURE__ */ jsxs33(TableStyle, { children: [
|
|
7792
|
+
/* @__PURE__ */ jsx43("thead", { children: /* @__PURE__ */ jsxs33("tr", { children: [
|
|
7793
|
+
/* @__PURE__ */ jsx43("th", { title: "dropdownth" }),
|
|
7794
|
+
headers
|
|
7795
|
+
] }) }),
|
|
7796
|
+
/* @__PURE__ */ jsx43("tbody", { children: rows })
|
|
7797
|
+
] }) });
|
|
7798
|
+
};
|
|
7799
|
+
|
|
7285
7800
|
// src/components/samples/SampleComponent.tsx
|
|
7286
|
-
import { useRef as
|
|
7287
|
-
import { jsx as
|
|
7801
|
+
import { useRef as useRef9, useEffect as useEffect9 } from "react";
|
|
7802
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
7288
7803
|
var SampleComponent2 = ({
|
|
7289
7804
|
testProp,
|
|
7290
7805
|
children,
|
|
7291
7806
|
...rest
|
|
7292
7807
|
// This rest operator includes className, style, onClick, etc.
|
|
7293
7808
|
}) => {
|
|
7294
|
-
const ref =
|
|
7809
|
+
const ref = useRef9(null);
|
|
7295
7810
|
useEffect9(() => {
|
|
7296
7811
|
const el = ref.current;
|
|
7297
7812
|
if (!el) return;
|
|
@@ -7299,13 +7814,15 @@ var SampleComponent2 = ({
|
|
|
7299
7814
|
el.setAttribute("test-prop", testProp);
|
|
7300
7815
|
}
|
|
7301
7816
|
}, [testProp]);
|
|
7302
|
-
return /* @__PURE__ */
|
|
7817
|
+
return /* @__PURE__ */ jsx44("sample-component", { ref, ...rest, children });
|
|
7303
7818
|
};
|
|
7304
7819
|
export {
|
|
7305
7820
|
ButtonIcon,
|
|
7306
7821
|
ButtonMenu,
|
|
7822
|
+
ChildDataTable,
|
|
7307
7823
|
DefaultCarousel,
|
|
7308
7824
|
DefaultPagination,
|
|
7825
|
+
NestedDataTable,
|
|
7309
7826
|
SampleComponent2 as SampleComponent,
|
|
7310
7827
|
SliderCardCarousel,
|
|
7311
7828
|
WavelengthAccessAlert,
|