@wavelengthusaf/components 3.0.3 → 3.2.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.
@@ -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 Fragment14 = REACT_FRAGMENT_TYPE;
209
+ var Fragment18 = 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 = Fragment14;
268
+ exports.Fragment = Fragment18;
269
269
  exports.Lazy = Lazy;
270
270
  exports.Memo = Memo2;
271
271
  exports.Portal = Portal;
@@ -7342,6 +7342,649 @@ var WavelengthDataTable = ({ data, columns, itemsPerPage, totalPages }) => {
7342
7342
  ] });
7343
7343
  };
7344
7344
 
7345
+ // src/components/DataTable/SubRowTable/ChildSubTable.tsx
7346
+
7347
+
7348
+
7349
+ var downWardAnimation = _styledcomponents.keyframes`
7350
+ 0% { top: -122px; }
7351
+ 100% { top: 0px; }
7352
+ `;
7353
+ var disSubTableAnim = _styledcomponents.keyframes`
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 = _styledcomponents2.default.div`
7362
+ background-color: white;
7363
+ width: 1200px;
7364
+ border-radius: 16px;
7365
+ `;
7366
+ var TableRow = _styledcomponents2.default.div`
7367
+ display: grid;
7368
+ grid-template-columns: ${({ $amountofColumns }) => `repeat(${$amountofColumns}, 1fr)`};
7369
+ `;
7370
+ var TablePrimaryRow = _styledcomponents2.default.div`
7371
+ display: grid;
7372
+ grid-template-columns: ${({ $amountofColumns }) => `repeat(${$amountofColumns}, 1fr)`};
7373
+ margin-bottom: 25px;
7374
+ `;
7375
+ var BodyRowContainer = _styledcomponents2.default.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 = _styledcomponents2.default.div`
7383
+ padding-left: 12px;
7384
+ padding-right: 25px;
7385
+ `;
7386
+ var TableBodyCell = _styledcomponents2.default.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 = _styledcomponents2.default.div`
7396
+ display: flex;
7397
+ flex-direction: row;
7398
+ `;
7399
+ var BottomArrowBar = _styledcomponents2.default.div`
7400
+ background-color: #e9e9e9;
7401
+ text-align: center;
7402
+ `;
7403
+ var BottomUpArrowBar = _styledcomponents2.default.div`
7404
+ background-color: #e9e9e9;
7405
+ text-align: center;
7406
+ position: relative;
7407
+ animation: ${downWardAnimation} 1.5s;
7408
+ `;
7409
+ var SubDataTable = _styledcomponents2.default.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 = _styledcomponents2.default.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 = _styledcomponents2.default.tbody`
7430
+ font-size: 14px;
7431
+ `;
7432
+ var SubDataTableBodyRowContainer = _styledcomponents2.default.tr`
7433
+ td {
7434
+ padding: 10px 25px 10px 20px;
7435
+ }
7436
+
7437
+ &:nth-child(even) {
7438
+ background-color: #96e0e5;
7439
+ }
7440
+ `;
7441
+ var SubDataTableCell = _styledcomponents2.default.td`
7442
+ text-align: center;
7443
+ `;
7444
+ var SubDataHeaderColumn = _styledcomponents2.default.thead`
7445
+ background-color: #304359;
7446
+ `;
7447
+ var SortButton = _styledcomponents2.default.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 = _styledcomponents2.default.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 = _styledcomponents2.default.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 = _styledcomponents2.default.button`
7515
+ background-color: transparent;
7516
+ border: none;
7517
+
7518
+ &:active {
7519
+ transform: scale(0.95);
7520
+ }
7521
+ `;
7522
+ var ChildDataTable = ({ data, columns, downloadArrowOnClick, downloadMissionOnClick, addFilesOnClick }) => {
7523
+ const HeadColumns = columns.filter((col) => col.subDataTableColumn === false);
7524
+ const SubDataColumns = columns.filter((col) => col.subDataTableColumn === true);
7525
+ const [openRow, setOpenRow] = _react.useState.call(void 0, null);
7526
+ const [sortOrder, setSortOrder] = _react.useState.call(void 0, "asc");
7527
+ const [sortKey, setSortKey] = _react.useState.call(void 0, "");
7528
+ const [sortSubOrder, setSortSubOrder] = _react.useState.call(void 0, "asc");
7529
+ const [sortSubKey, setSortSubKey] = _react.useState.call(void 0, "");
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 = _react.useMemo.call(void 0, () => {
7549
+ const result = [..._nullishCoalesce(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) => _optionalChain([item, 'access', _51 => _51.Details, 'optionalAccess', _52 => _52.fileObjects, 'access', _53 => _53.sort, 'call', _54 => _54((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__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, SortButton, { $sortColor: "black", onClick: () => toggleSortOrder(column.key), children: [
7598
+ column.title,
7599
+ " ",
7600
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width: "15", height: "10", viewBox: "0 0 15 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "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__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, SortButton, { $sortColor: "black", onClick: () => toggleSortOrder(column.key), children: [
7602
+ column.title,
7603
+ " ",
7604
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width: "15", height: "10", viewBox: "0 0 15 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "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__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, SortButton, { $sortColor: "black", onClick: () => toggleSortOrder(column.key), children: [
7606
+ column.title,
7607
+ " ",
7608
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width: "15", height: "10", viewBox: "0 0 15 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "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__ */ _jsxruntime.jsxs.call(void 0, SortButton, { $sortColor: "white", onClick: () => toggleSubSortOrder(columnKey), children: [
7614
+ column.title,
7615
+ " ",
7616
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width: "15", height: "10", viewBox: "0 0 15 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "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__ */ _jsxruntime.jsxs.call(void 0, SortButton, { $sortColor: "white", onClick: () => toggleSubSortOrder(columnKey), children: [
7618
+ column.title,
7619
+ " ",
7620
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width: "15", height: "10", viewBox: "0 0 15 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "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__ */ _jsxruntime.jsxs.call(void 0, SortButton, { $sortColor: "white", onClick: () => toggleSubSortOrder(columnKey), children: [
7622
+ column.title,
7623
+ " ",
7624
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width: "15", height: "10", viewBox: "0 0 15 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "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__ */ _jsxruntime.jsx.call(void 0, TableHeaderCell, { children: renderSortButton(column, sortOrder, sortKey) }, `HeaderCell-${column.key}`);
7629
+ });
7630
+ const SubDataHeaders = SubDataColumns.map((column, index) => {
7631
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "th", { children: renderSortSubButton(column, sortSubOrder, sortSubKey) }, `SubHeadCell-${index}`);
7632
+ });
7633
+ const subDataRows = (itemId) => {
7634
+ return processedRowData.filter((item) => _optionalChain([item, 'access', _55 => _55.Details, 'optionalAccess', _56 => _56.relationId]) === itemId).map((item) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Fragment, { children: _optionalChain([item, 'access', _57 => _57.Details, 'optionalAccess', _58 => _58.fileObjects, 'access', _59 => _59.map, 'call', _60 => _60((fileItem, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, SubDataTableBodyRowContainer, { children: [
7635
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DownloadArrow, { onClick: downloadArrowOnClick, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width: "17", height: "16", viewBox: "0 0 17 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
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-${_optionalChain([item, 'access', _61 => _61.Details, 'optionalAccess', _62 => _62.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__ */ _jsxruntime.jsx.call(void 0, SubDataTableCell, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: value }, `span-${_optionalChain([item, 'access', _63 => _63.Details, 'optionalAccess', _64 => _64.relationId])}-${fileItem.id}-${index}-${column.title}`) }, `fileitem-${item}-${_optionalChain([item, 'access', _65 => _65.Details, 'optionalAccess', _66 => _66.relationId])}-${fileItem.id}-${index}-${column.title}`);
7647
+ }
7648
+ })
7649
+ ] }, `${item}-${_optionalChain([item, 'access', _67 => _67.Details, 'optionalAccess', _68 => _68.relationId])}-${fileItem.id}-${index}`))]) }, `SDR-${item.id}-${_optionalChain([item, 'access', _69 => _69.Details, 'optionalAccess', _70 => _70.relationId])}`));
7650
+ };
7651
+ const dataRows = _optionalChain([processedRowData, 'optionalAccess', _71 => _71.map, 'call', _72 => _72((item, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, BodyRowContainer, { children: [
7652
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TableRow, { $amountofColumns: HeadColumns.length, children: HeadColumns.map((column) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TableBodyCell, { $primaryBoldState: column.PrimaryBoldText, children: item[column.key] }, `TableBodycell-${item.id}-${column.key}`)) }),
7653
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, ButtonStylingRow, { children: [
7654
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DownloadMissionButton, { onClick: downloadMissionOnClick, children: "Download Mission" }),
7655
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AddButton, { onClick: addFilesOnClick, children: "Add files" })
7656
+ ] }),
7657
+ openRow !== item.id && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BottomArrowBar, { onClick: () => toggleDropdown(item.id), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width: "92", height: "14", viewBox: "0 0 92 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M64 0L44 6L24 0H0L44 14L92 0H64Z", fill: "#7A7A7A" }) }) }),
7658
+ openRow === item.id && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
7659
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, SubDataTable, { children: [
7660
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SubDataHeaderColumn, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, SubDataTableHeaderRow, { children: [
7661
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "th", {}),
7662
+ SubDataHeaders
7663
+ ] }) }),
7664
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SubDataTableBodyRow, { children: subDataRows(item.id) })
7665
+ ] }),
7666
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BottomUpArrowBar, { onClick: () => toggleUpward(), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width: "92", height: "14", viewBox: "0 0 92 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M64 14L44 8L24 14H0L44 0L92 14H64Z", fill: "#7A7A7A" }) }) })
7667
+ ] })
7668
+ ] }, `Bodycontainer-${item.id}-${index}`))]);
7669
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, TableContainer, { children: [
7670
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TablePrimaryRow, { $amountofColumns: HeadColumns.length, children: headers }),
7671
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { title: "tablebodies", children: dataRows })
7672
+ ] });
7673
+ };
7674
+
7675
+ // src/components/DataTable/NestedDataTable/NestedDataTable.tsx
7676
+
7677
+
7678
+
7679
+ var TableStyle = _styledcomponents2.default.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 = _styledcomponents2.default.th`
7696
+ &:not(:last-child) {
7697
+ border-right: 1px solid #c6c7cc;
7698
+ }
7699
+ `;
7700
+ var SubDataTr = _styledcomponents2.default.tr`
7701
+ background-color: white;
7702
+
7703
+ &:nth-child(even) {
7704
+ background-color: #e0ffff;
7705
+ }
7706
+ `;
7707
+ var PrimaryTrRows = _styledcomponents2.default.tr`
7708
+ background-color: ${(props) => props.$index % 2 === 0 ? "white" : "#e0ffff"};
7709
+ `;
7710
+ var SubTrRows = _styledcomponents2.default.tr`
7711
+ background-color: ${(props) => props.$index % 2 === 0 ? "white" : "#e0ffff"};
7712
+ height: 120px;
7713
+ `;
7714
+ var SubTableStyle = _styledcomponents2.default.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 = _styledcomponents2.default.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 = _styledcomponents2.default.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] = _react.useState.call(void 0, false);
7757
+ const [isAscending, setIsAscending] = _react.useState.call(void 0, false);
7758
+ const [primaryRowIndex, setPrimaryRowIndex] = _react.useState.call(void 0, 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__ */ _jsxruntime.jsx.call(void 0, MainThHeaders, { children: column.title }, `headCell-${index}`);
7766
+ });
7767
+ const SubDataHeaders = SubDataColumns.map((column, index) => {
7768
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "th", { children: column.title }, `SubHeadCell-${index}`);
7769
+ });
7770
+ const subDataRows = !_optionalChain([data, 'optionalAccess', _73 => _73.length]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "tr", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { title: "NoSubDataRows", colSpan: columns.length, children: "No data" }) }) : data.map((item, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SubDataTr, { children: SubDataColumns.map((column, colIndex) => {
7771
+ const columnKey = trimBeforePeriod(column.key);
7772
+ const value = _optionalChain([item, 'access', _74 => _74.Details, 'optionalAccess', _75 => _75[columnKey]]);
7773
+ console.log("value: ", value);
7774
+ if (value !== void 0) {
7775
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: value }) }, `Span-${item.id}-${colIndex}`);
7776
+ }
7777
+ }) }, `Sub-${item.id}-${index}`) }));
7778
+ const childRows = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, SubTableStyle, { children: [
7779
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "thead", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "tr", { children: SubDataHeaders }) }),
7780
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "tbody", { children: subDataRows })
7781
+ ] });
7782
+ const rows = !_optionalChain([data, 'optionalAccess', _76 => _76.length]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "tr", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { title: "NoDataRows", colSpan: columns.length, children: "No data" }) }) : _optionalChain([data, 'optionalAccess', _77 => _77.map, 'call', _78 => _78((item, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
7783
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, PrimaryTrRows, { $index: index, children: [
7784
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DropdownButton, { onClick: () => toggleDropdown(index), children: isAscending && isOpen && primaryRowIndex === index ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: "\u2227" }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: "\u2228" }) }),
7785
+ HeadColumns.map((column, index2) => {
7786
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PrimaryTdSpan, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { title: `spanRow-${item.id}-${column.key}-${index2}`, children: item[column.key] }) }, `${item.id}-${index}=${index2}`);
7787
+ })
7788
+ ] }, index),
7789
+ isOpen && primaryRowIndex === index && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SubTrRows, { $index: index, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { colSpan: HeadColumns.length + 1, children: childRows }) }, index)
7790
+ ] }))]);
7791
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, TableStyle, { children: [
7792
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "thead", { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "tr", { children: [
7793
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "th", { title: "dropdownth" }),
7794
+ headers
7795
+ ] }) }),
7796
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "tbody", { children: rows })
7797
+ ] }) });
7798
+ };
7799
+
7800
+ // src/components/AutoComplete/WlAutoComplete.tsx
7801
+
7802
+
7803
+
7804
+ var AutoContainer = _styledcomponents2.default.div`
7805
+ border-top: 10px solid ${(props) => props.$primary !== void 0 ? props.$primary : "#FFFFFF"};
7806
+ border-radius: 6px;
7807
+ `;
7808
+ var InputWrapper2 = _styledcomponents2.default.div`
7809
+ position: relative;
7810
+ width: ${(props) => props.$inputwidth || "320px"};
7811
+ height: ${(props) => props.$inputheight || "51px"};
7812
+ background: linear-gradient(
7813
+ to bottom,
7814
+ ${(props) => props.$primary !== null ? props.$primary : "#FFFFFF"},
7815
+ ${(props) => props.$primary !== null ? props.$primary : "#FFFFFF"} 50%,
7816
+ transparent 50%,
7817
+ transparent 100%
7818
+ );
7819
+ `;
7820
+ var Label = _styledcomponents2.default.label`
7821
+ position: absolute;
7822
+ top: 50%;
7823
+ left: 10px;
7824
+ transform: translateY(-50%);
7825
+ color: ${(props) => props.$primary || "#ccc"};
7826
+ font-size: 16px;
7827
+ pointer-events: none;
7828
+ transition: 0.3s ease all;
7829
+ z-index: 2;
7830
+ padding: 0 5px;
7831
+ `;
7832
+ var Input = _styledcomponents2.default.input`
7833
+ width: inherit;
7834
+ height: inherit;
7835
+ padding: 0.5rem 0.75rem;
7836
+ border: ${(props) => props.$inputBorderStyling || "2px solid #ccc"};
7837
+ border-radius: 4px;
7838
+ box-sizing: border-box;
7839
+ z-index: 1;
7840
+ background-color: ${(props) => props.$primary !== null ? props.$primary : "#FFFFFF"};
7841
+
7842
+ &:focus {
7843
+ border-color: ${(props) => props.$focusBorderColor || "#4a90e2"};
7844
+ outline: none;
7845
+ background-color: ${(props) => props.$primary !== null ? props.$primary : "#FFFFFF"};
7846
+ }
7847
+
7848
+ &:focus + ${Label} {
7849
+ top: 0;
7850
+ left: 10px;
7851
+ padding: 0 2px;
7852
+ color: #4a90e2;
7853
+ background-color: ${(props) => props.$primary || "#FFFFFF"};
7854
+ }
7855
+ `;
7856
+ var DropDownList = _styledcomponents2.default.ul`
7857
+ background-color: white;
7858
+ border: 1px solid #ccc;
7859
+ margin-top: 0px;
7860
+ color: black;
7861
+ list-style: none;
7862
+ padding: 0;
7863
+ border-radius: 8px;
7864
+ `;
7865
+ var ActiveListItem = _styledcomponents2.default.li`
7866
+ padding: 10px;
7867
+ cursor: pointer;
7868
+ border-radius: 8px;
7869
+
7870
+ &:hover {
7871
+ background-color: #f0f0f0;
7872
+ }
7873
+
7874
+ &:active {
7875
+ background-color: #d8d8d8;
7876
+ }
7877
+ `;
7878
+ var NoHoverListItem = _styledcomponents2.default.li`
7879
+ padding: 10px;
7880
+ cursor: pointer;
7881
+ background-color: white;
7882
+ color: #d8d8d8;
7883
+ border-radius: 8px;
7884
+
7885
+ &:hover {
7886
+ background-color: white;
7887
+ }
7888
+
7889
+ &:active {
7890
+ background-color: white;
7891
+ }
7892
+ `;
7893
+ var WLAutoComplete = ({ variant, data, height: height2, width: width2, inputBorderStyle, inputFocusBorderColor, onDataChange, autoBackGroundColor, labelColor }) => {
7894
+ const inputRef = _react.useRef.call(void 0, null);
7895
+ const listRef = _react.useRef.call(void 0, null);
7896
+ const noItemListRef = _react.useRef.call(void 0, null);
7897
+ const [inputValue, setInputValue] = _react.useState.call(void 0, "");
7898
+ const [suggestions, setSuggestions] = _react.useState.call(void 0, []);
7899
+ const [isDropdownVisible, setIsDropdownVisible] = _react.useState.call(void 0, false);
7900
+ _react.useEffect.call(void 0, () => {
7901
+ const handleClickOutside = (event) => {
7902
+ const node = event.target;
7903
+ if (inputRef.current && !_optionalChain([inputRef, 'access', _79 => _79.current, 'optionalAccess', _80 => _80.contains, 'call', _81 => _81(node)]) && !_optionalChain([listRef, 'access', _82 => _82.current, 'optionalAccess', _83 => _83.contains, 'call', _84 => _84(node)]) && !_optionalChain([noItemListRef, 'access', _85 => _85.current, 'optionalAccess', _86 => _86.contains, 'call', _87 => _87(node)])) {
7904
+ inputRef.current.blur();
7905
+ setInputValue("");
7906
+ }
7907
+ if (noItemListRef.current && _optionalChain([noItemListRef, 'access', _88 => _88.current, 'optionalAccess', _89 => _89.contains, 'call', _90 => _90(node)])) {
7908
+ _optionalChain([inputRef, 'access', _91 => _91.current, 'optionalAccess', _92 => _92.focus, 'call', _93 => _93()]);
7909
+ }
7910
+ };
7911
+ const handleClickOutsideList = (event) => {
7912
+ if (listRef.current && !listRef.current.contains(event.target)) {
7913
+ setIsDropdownVisible(false);
7914
+ }
7915
+ };
7916
+ const handleClickonListElement = (event) => {
7917
+ const node = event.target;
7918
+ if (_optionalChain([listRef, 'access', _94 => _94.current, 'optionalAccess', _95 => _95.contains, 'call', _96 => _96(node)])) {
7919
+ _optionalChain([inputRef, 'access', _97 => _97.current, 'optionalAccess', _98 => _98.focus, 'call', _99 => _99()]);
7920
+ }
7921
+ };
7922
+ document.addEventListener("mousedown", handleClickOutside);
7923
+ document.addEventListener("mousedown", handleClickOutsideList);
7924
+ document.addEventListener("mousedown", handleClickonListElement);
7925
+ return () => {
7926
+ document.removeEventListener("mousedown", handleClickOutside);
7927
+ document.removeEventListener("mousedown", handleClickOutsideList);
7928
+ document.removeEventListener("mousedown", handleClickonListElement);
7929
+ };
7930
+ }, []);
7931
+ _react.useEffect.call(void 0, () => {
7932
+ if (inputRef.current && inputValue) {
7933
+ inputRef.current.focus();
7934
+ }
7935
+ }, [inputValue]);
7936
+ const handleChange = (event) => {
7937
+ const value = event.target.value;
7938
+ setInputValue(value);
7939
+ if (value.length > 0) {
7940
+ const filtered = data.filter((option) => option.toLowerCase().includes(value.toLowerCase()));
7941
+ if (filtered.length > 0) {
7942
+ setSuggestions(filtered);
7943
+ setIsDropdownVisible(true);
7944
+ } else {
7945
+ setSuggestions([]);
7946
+ setIsDropdownVisible(true);
7947
+ }
7948
+ } else {
7949
+ setIsDropdownVisible(false);
7950
+ }
7951
+ };
7952
+ const handleInputClick = () => {
7953
+ setSuggestions(data);
7954
+ setIsDropdownVisible(true);
7955
+ };
7956
+ const handleListClick = (suggestValue) => {
7957
+ setInputValue(suggestValue);
7958
+ setIsDropdownVisible(false);
7959
+ };
7960
+ const handleKeyDown = (event) => {
7961
+ if (event.key === "Enter") {
7962
+ onDataChange(inputValue);
7963
+ }
7964
+ };
7965
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, AutoContainer, { $primary: autoBackGroundColor, children: [
7966
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, InputWrapper2, { $primary: autoBackGroundColor, $inputheight: height2, $inputwidth: width2, children: [
7967
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
7968
+ Input,
7969
+ {
7970
+ type: "text",
7971
+ $primary: autoBackGroundColor,
7972
+ $inputBorderStyling: inputBorderStyle,
7973
+ $focusBorderColor: inputFocusBorderColor,
7974
+ value: inputValue,
7975
+ ref: inputRef,
7976
+ onClick: handleInputClick,
7977
+ onInput: handleChange,
7978
+ onKeyDown: handleKeyDown,
7979
+ placeholder: ""
7980
+ }
7981
+ ),
7982
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Label, { $primary: labelColor, children: variant })
7983
+ ] }),
7984
+ isDropdownVisible && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DropDownList, { ref: listRef, children: suggestions.length > 0 ? suggestions.map((item, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ActiveListItem, { onMouseDown: (e) => e.preventDefault(), onClick: () => handleListClick(item), children: item }, index)) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoHoverListItem, { ref: noItemListRef, id: "No-Option-List-item", onMouseDown: (e) => e.preventDefault(), children: "No Options found" }) })
7985
+ ] }) });
7986
+ };
7987
+
7345
7988
  // src/components/samples/SampleComponent.tsx
7346
7989
 
7347
7990
 
@@ -7413,7 +8056,10 @@ var SampleComponent2 = ({
7413
8056
 
7414
8057
 
7415
8058
 
7416
- exports.ButtonIcon = ButtonIcon; exports.ButtonMenu = ButtonMenu; exports.DefaultCarousel = DefaultCarousel; exports.DefaultPagination = DefaultPagination; exports.SampleComponent = SampleComponent2; exports.SliderCardCarousel = SliderCardCarousel; exports.WavelengthAccessAlert = WavelengthAccessAlert; exports.WavelengthAlert = WavelengthAlert; exports.WavelengthAppLogo = WavelengthAppLogo; exports.WavelengthAppTheme = WavelengthAppTheme; exports.WavelengthAutocomplete = WavelengthAutocomplete; exports.WavelengthBanner = WavelengthBanner2; exports.WavelengthBox = WavelengthBox; exports.WavelengthButton = WavelengthButton2; exports.WavelengthCommentDisplay = WavelengthCommentDisplay; exports.WavelengthConfirmationModal = WavelengthConfirmationModal; exports.WavelengthContentModal = WavelengthContentModal; exports.WavelengthContentPlaceholder = WavelengthContentPlaceholder; exports.WavelengthDataTable = WavelengthDataTable; exports.WavelengthDefaultIcon = WavelengthDefaultIcon; exports.WavelengthDragAndDrop = WavelengthDragAndDrop; exports.WavelengthDropdown = WavelengthDropdown; exports.WavelengthDropdownButton = WavelengthDropdownButton; exports.WavelengthExampleComponent = WavelengthExampleComponent; exports.WavelengthFileDownloader = WavelengthFileDownloader; exports.WavelengthFooter = WavelengthFooter; exports.WavelengthManyPlanes = WavelengthManyPlanes; exports.WavelengthNotAvailablePage = WavelengthNotAvailablePage; exports.WavelengthPermissionAlert = WavelengthPermissionAlert; exports.WavelengthPlaneTrail = WavelengthPlaneTrail; exports.WavelengthPopUpMenu = WavelengthPopUpMenu; exports.WavelengthProgressBar = WavelengthProgressBar2; exports.WavelengthSearch = WavelengthSearch; exports.WavelengthSearchTextField = WavelengthSearchTextField; exports.WavelengthSideBar = WavelengthSideBar; exports.WavelengthSlider = WavelengthSlider; exports.WavelengthSnackbar = WavelengthSnackbar; exports.WavelengthSpinningLogo = WavelengthSpinningLogo; exports.WavelengthSpinningOuterCircle = WavelengthSpinningOuterCircle; exports.WavelengthStandardSnackbar = WavelengthStandardSnackbar; exports.WavelengthStyledButton = WavelengthStyledButton; exports.WavelengthTestSnackbar = WavelengthTestSnackbar; exports.WavelengthTextField = WavelengthTextField; exports.WavelengthTitleBar = WavelengthTitleBar2; exports.add = add; exports.ascendingRange = ascendingRange; exports.concat = concat; exports.findBestStringMatch = findBestStringMatch; exports.range = range; exports.useOutsideClick = useOutsideClick; exports.useThemeContext = useThemeContext;
8059
+
8060
+
8061
+
8062
+ exports.ButtonIcon = ButtonIcon; exports.ButtonMenu = ButtonMenu; exports.ChildDataTable = ChildDataTable; exports.DefaultCarousel = DefaultCarousel; exports.DefaultPagination = DefaultPagination; exports.NestedDataTable = NestedDataTable; exports.SampleComponent = SampleComponent2; exports.SliderCardCarousel = SliderCardCarousel; exports.WLAutoComplete = WLAutoComplete; exports.WavelengthAccessAlert = WavelengthAccessAlert; exports.WavelengthAlert = WavelengthAlert; exports.WavelengthAppLogo = WavelengthAppLogo; exports.WavelengthAppTheme = WavelengthAppTheme; exports.WavelengthAutocomplete = WavelengthAutocomplete; exports.WavelengthBanner = WavelengthBanner2; exports.WavelengthBox = WavelengthBox; exports.WavelengthButton = WavelengthButton2; exports.WavelengthCommentDisplay = WavelengthCommentDisplay; exports.WavelengthConfirmationModal = WavelengthConfirmationModal; exports.WavelengthContentModal = WavelengthContentModal; exports.WavelengthContentPlaceholder = WavelengthContentPlaceholder; exports.WavelengthDataTable = WavelengthDataTable; exports.WavelengthDefaultIcon = WavelengthDefaultIcon; exports.WavelengthDragAndDrop = WavelengthDragAndDrop; exports.WavelengthDropdown = WavelengthDropdown; exports.WavelengthDropdownButton = WavelengthDropdownButton; exports.WavelengthExampleComponent = WavelengthExampleComponent; exports.WavelengthFileDownloader = WavelengthFileDownloader; exports.WavelengthFooter = WavelengthFooter; exports.WavelengthManyPlanes = WavelengthManyPlanes; exports.WavelengthNotAvailablePage = WavelengthNotAvailablePage; exports.WavelengthPermissionAlert = WavelengthPermissionAlert; exports.WavelengthPlaneTrail = WavelengthPlaneTrail; exports.WavelengthPopUpMenu = WavelengthPopUpMenu; exports.WavelengthProgressBar = WavelengthProgressBar2; exports.WavelengthSearch = WavelengthSearch; exports.WavelengthSearchTextField = WavelengthSearchTextField; exports.WavelengthSideBar = WavelengthSideBar; exports.WavelengthSlider = WavelengthSlider; exports.WavelengthSnackbar = WavelengthSnackbar; exports.WavelengthSpinningLogo = WavelengthSpinningLogo; exports.WavelengthSpinningOuterCircle = WavelengthSpinningOuterCircle; exports.WavelengthStandardSnackbar = WavelengthStandardSnackbar; exports.WavelengthStyledButton = WavelengthStyledButton; exports.WavelengthTestSnackbar = WavelengthTestSnackbar; exports.WavelengthTextField = WavelengthTextField; exports.WavelengthTitleBar = WavelengthTitleBar2; exports.add = add; exports.ascendingRange = ascendingRange; exports.concat = concat; exports.findBestStringMatch = findBestStringMatch; exports.range = range; exports.useOutsideClick = useOutsideClick; exports.useThemeContext = useThemeContext;
7417
8063
  /*! Bundled license information:
7418
8064
 
7419
8065
  react-is/cjs/react-is.production.min.js: