@wavelengthusaf/components 3.0.3 → 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.
@@ -562,13 +562,64 @@ interface TextFieldProps {
562
562
  }
563
563
  declare function WavelengthTextField(props: TextFieldProps): react_jsx_runtime.JSX.Element | null;
564
564
 
565
+ interface DataType$2 {
566
+ id: number;
567
+ [key: string]: any;
568
+ }
569
+ interface ColumnProps$2<T> {
570
+ key: string;
571
+ title: string | ReactElement;
572
+ width?: string;
573
+ editable?: boolean;
574
+ render?: (column: ColumnProps$2<T>, item: T) => ReactElement;
575
+ }
576
+ type Props$2<T> = {
577
+ columns: Array<ColumnProps$2<T>>;
578
+ data?: T[] | undefined;
579
+ itemsPerPage: number;
580
+ totalPages: number;
581
+ };
582
+ declare const WavelengthDataTable: <T extends DataType$2>({ data, columns, itemsPerPage, totalPages }: Props$2<T>) => react_jsx_runtime.JSX.Element;
583
+
584
+ interface fileObject {
585
+ id: number;
586
+ [key: string]: any;
587
+ }
588
+ interface Details$1 {
589
+ relationId: number;
590
+ fileObjects: fileObject[];
591
+ }
592
+ interface DataType$1 {
593
+ id: number;
594
+ [key: string]: any;
595
+ Details?: Details$1;
596
+ }
597
+ interface ColumnProps$1 {
598
+ key: string;
599
+ title: string | ReactElement;
600
+ subDataTableColumn: boolean;
601
+ PrimaryBoldText?: boolean;
602
+ }
603
+ type Props$1<T> = {
604
+ columns: Array<ColumnProps$1>;
605
+ data?: T[] | undefined;
606
+ downloadArrowOnClick?: () => void;
607
+ };
608
+ declare const ChildDataTable: <T extends DataType$1>({ data, columns, downloadArrowOnClick }: Props$1<T>) => react_jsx_runtime.JSX.Element;
609
+
610
+ interface Details {
611
+ relationId: number;
612
+ [key: string]: any;
613
+ }
565
614
  interface DataType {
566
615
  id: number;
567
616
  [key: string]: any;
617
+ Details?: Details;
568
618
  }
569
619
  interface ColumnProps<T> {
570
620
  key: string;
571
621
  title: string | ReactElement;
622
+ subDataTableColumn: boolean;
572
623
  width?: string;
573
624
  editable?: boolean;
574
625
  render?: (column: ColumnProps<T>, item: T) => ReactElement;
@@ -576,14 +627,12 @@ interface ColumnProps<T> {
576
627
  type Props<T> = {
577
628
  columns: Array<ColumnProps<T>>;
578
629
  data?: T[] | undefined;
579
- itemsPerPage: number;
580
- totalPages: number;
581
630
  };
582
- declare const WavelengthDataTable: <T extends DataType>({ data, columns, itemsPerPage, totalPages }: Props<T>) => react_jsx_runtime.JSX.Element;
631
+ declare const NestedDataTable: <T extends DataType>({ data, columns }: Props<T>) => react_jsx_runtime.JSX.Element;
583
632
 
584
633
  interface SampleComponentProps extends React__default.HTMLAttributes<HTMLElement> {
585
634
  testProp?: string;
586
635
  }
587
636
  declare const SampleComponent: React__default.FC<SampleComponentProps>;
588
637
 
589
- export { ButtonIcon, ButtonMenu, DefaultCarousel, DefaultPagination, SampleComponent, type SearchProps, type SearchResult, SliderCardCarousel, type StyledButtonPropsTwo, type ThemeProperties, WavelengthAccessAlert, WavelengthAlert, WavelengthAppLogo, WavelengthAppTheme, WavelengthAutocomplete, WavelengthBanner, type WavelengthBannerProps, WavelengthBox, WavelengthButton, type WavelengthButtonProps, WavelengthCommentDisplay, WavelengthConfirmationModal, WavelengthContentModal, WavelengthContentPlaceholder, WavelengthDataTable, WavelengthDefaultIcon, WavelengthDragAndDrop, WavelengthDropdown, WavelengthDropdownButton, WavelengthExampleComponent, WavelengthFileDownloader, WavelengthFooter, WavelengthManyPlanes, WavelengthNotAvailablePage, WavelengthPermissionAlert, WavelengthPlaneTrail, WavelengthPopUpMenu, WavelengthProgressBar, type WavelengthProgressBarProps, WavelengthSearch, WavelengthSearchTextField, WavelengthSideBar, WavelengthSlider, WavelengthSnackbar, WavelengthSpinningLogo, WavelengthSpinningOuterCircle, WavelengthStandardSnackbar, WavelengthStyledButton, WavelengthTestSnackbar, WavelengthTextField, WavelengthTitleBar, add, ascendingRange, concat, findBestStringMatch, type menuItemProps, range, useOutsideClick, useThemeContext };
638
+ export { ButtonIcon, ButtonMenu, ChildDataTable, DefaultCarousel, DefaultPagination, NestedDataTable, SampleComponent, type SearchProps, type SearchResult, SliderCardCarousel, type StyledButtonPropsTwo, type ThemeProperties, WavelengthAccessAlert, WavelengthAlert, WavelengthAppLogo, WavelengthAppTheme, WavelengthAutocomplete, WavelengthBanner, type WavelengthBannerProps, WavelengthBox, WavelengthButton, type WavelengthButtonProps, WavelengthCommentDisplay, WavelengthConfirmationModal, WavelengthContentModal, WavelengthContentPlaceholder, WavelengthDataTable, WavelengthDefaultIcon, WavelengthDragAndDrop, WavelengthDropdown, WavelengthDropdownButton, WavelengthExampleComponent, WavelengthFileDownloader, WavelengthFooter, WavelengthManyPlanes, WavelengthNotAvailablePage, WavelengthPermissionAlert, WavelengthPlaneTrail, WavelengthPopUpMenu, WavelengthProgressBar, type WavelengthProgressBarProps, WavelengthSearch, WavelengthSearchTextField, WavelengthSideBar, WavelengthSlider, WavelengthSnackbar, WavelengthSpinningLogo, WavelengthSpinningOuterCircle, WavelengthStandardSnackbar, WavelengthStyledButton, WavelengthTestSnackbar, WavelengthTextField, WavelengthTitleBar, add, ascendingRange, concat, findBestStringMatch, type menuItemProps, range, useOutsideClick, useThemeContext };
@@ -562,13 +562,64 @@ interface TextFieldProps {
562
562
  }
563
563
  declare function WavelengthTextField(props: TextFieldProps): react_jsx_runtime.JSX.Element | null;
564
564
 
565
+ interface DataType$2 {
566
+ id: number;
567
+ [key: string]: any;
568
+ }
569
+ interface ColumnProps$2<T> {
570
+ key: string;
571
+ title: string | ReactElement;
572
+ width?: string;
573
+ editable?: boolean;
574
+ render?: (column: ColumnProps$2<T>, item: T) => ReactElement;
575
+ }
576
+ type Props$2<T> = {
577
+ columns: Array<ColumnProps$2<T>>;
578
+ data?: T[] | undefined;
579
+ itemsPerPage: number;
580
+ totalPages: number;
581
+ };
582
+ declare const WavelengthDataTable: <T extends DataType$2>({ data, columns, itemsPerPage, totalPages }: Props$2<T>) => react_jsx_runtime.JSX.Element;
583
+
584
+ interface fileObject {
585
+ id: number;
586
+ [key: string]: any;
587
+ }
588
+ interface Details$1 {
589
+ relationId: number;
590
+ fileObjects: fileObject[];
591
+ }
592
+ interface DataType$1 {
593
+ id: number;
594
+ [key: string]: any;
595
+ Details?: Details$1;
596
+ }
597
+ interface ColumnProps$1 {
598
+ key: string;
599
+ title: string | ReactElement;
600
+ subDataTableColumn: boolean;
601
+ PrimaryBoldText?: boolean;
602
+ }
603
+ type Props$1<T> = {
604
+ columns: Array<ColumnProps$1>;
605
+ data?: T[] | undefined;
606
+ downloadArrowOnClick?: () => void;
607
+ };
608
+ declare const ChildDataTable: <T extends DataType$1>({ data, columns, downloadArrowOnClick }: Props$1<T>) => react_jsx_runtime.JSX.Element;
609
+
610
+ interface Details {
611
+ relationId: number;
612
+ [key: string]: any;
613
+ }
565
614
  interface DataType {
566
615
  id: number;
567
616
  [key: string]: any;
617
+ Details?: Details;
568
618
  }
569
619
  interface ColumnProps<T> {
570
620
  key: string;
571
621
  title: string | ReactElement;
622
+ subDataTableColumn: boolean;
572
623
  width?: string;
573
624
  editable?: boolean;
574
625
  render?: (column: ColumnProps<T>, item: T) => ReactElement;
@@ -576,14 +627,12 @@ interface ColumnProps<T> {
576
627
  type Props<T> = {
577
628
  columns: Array<ColumnProps<T>>;
578
629
  data?: T[] | undefined;
579
- itemsPerPage: number;
580
- totalPages: number;
581
630
  };
582
- declare const WavelengthDataTable: <T extends DataType>({ data, columns, itemsPerPage, totalPages }: Props<T>) => react_jsx_runtime.JSX.Element;
631
+ declare const NestedDataTable: <T extends DataType>({ data, columns }: Props<T>) => react_jsx_runtime.JSX.Element;
583
632
 
584
633
  interface SampleComponentProps extends React__default.HTMLAttributes<HTMLElement> {
585
634
  testProp?: string;
586
635
  }
587
636
  declare const SampleComponent: React__default.FC<SampleComponentProps>;
588
637
 
589
- export { ButtonIcon, ButtonMenu, DefaultCarousel, DefaultPagination, SampleComponent, type SearchProps, type SearchResult, SliderCardCarousel, type StyledButtonPropsTwo, type ThemeProperties, WavelengthAccessAlert, WavelengthAlert, WavelengthAppLogo, WavelengthAppTheme, WavelengthAutocomplete, WavelengthBanner, type WavelengthBannerProps, WavelengthBox, WavelengthButton, type WavelengthButtonProps, WavelengthCommentDisplay, WavelengthConfirmationModal, WavelengthContentModal, WavelengthContentPlaceholder, WavelengthDataTable, WavelengthDefaultIcon, WavelengthDragAndDrop, WavelengthDropdown, WavelengthDropdownButton, WavelengthExampleComponent, WavelengthFileDownloader, WavelengthFooter, WavelengthManyPlanes, WavelengthNotAvailablePage, WavelengthPermissionAlert, WavelengthPlaneTrail, WavelengthPopUpMenu, WavelengthProgressBar, type WavelengthProgressBarProps, WavelengthSearch, WavelengthSearchTextField, WavelengthSideBar, WavelengthSlider, WavelengthSnackbar, WavelengthSpinningLogo, WavelengthSpinningOuterCircle, WavelengthStandardSnackbar, WavelengthStyledButton, WavelengthTestSnackbar, WavelengthTextField, WavelengthTitleBar, add, ascendingRange, concat, findBestStringMatch, type menuItemProps, range, useOutsideClick, useThemeContext };
638
+ export { ButtonIcon, ButtonMenu, ChildDataTable, DefaultCarousel, DefaultPagination, NestedDataTable, SampleComponent, type SearchProps, type SearchResult, SliderCardCarousel, type StyledButtonPropsTwo, type ThemeProperties, WavelengthAccessAlert, WavelengthAlert, WavelengthAppLogo, WavelengthAppTheme, WavelengthAutocomplete, WavelengthBanner, type WavelengthBannerProps, WavelengthBox, WavelengthButton, type WavelengthButtonProps, WavelengthCommentDisplay, WavelengthConfirmationModal, WavelengthContentModal, WavelengthContentPlaceholder, WavelengthDataTable, WavelengthDefaultIcon, WavelengthDragAndDrop, WavelengthDropdown, WavelengthDropdownButton, WavelengthExampleComponent, WavelengthFileDownloader, WavelengthFooter, WavelengthManyPlanes, WavelengthNotAvailablePage, WavelengthPermissionAlert, WavelengthPlaneTrail, WavelengthPopUpMenu, WavelengthProgressBar, type WavelengthProgressBarProps, WavelengthSearch, WavelengthSearchTextField, WavelengthSideBar, WavelengthSlider, WavelengthSnackbar, WavelengthSpinningLogo, WavelengthSpinningOuterCircle, WavelengthStandardSnackbar, WavelengthStyledButton, WavelengthTestSnackbar, WavelengthTextField, WavelengthTitleBar, add, ascendingRange, concat, findBestStringMatch, type menuItemProps, range, useOutsideClick, useThemeContext };
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 Fragment14 = REACT_FRAGMENT_TYPE;
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 = Fragment14;
268
+ exports.Fragment = Fragment17;
269
269
  exports.Lazy = Lazy;
270
270
  exports.Memo = Memo2;
271
271
  exports.Portal = Portal;
@@ -7342,16 +7342,471 @@ var WavelengthDataTable = ({ data, columns, itemsPerPage, totalPages }) => {
7342
7342
  ] });
7343
7343
  };
7344
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
+
7345
7800
  // src/components/samples/SampleComponent.tsx
7346
- import { useRef as useRef8, useEffect as useEffect9 } from "react";
7347
- import { jsx as jsx42 } from "react/jsx-runtime";
7801
+ import { useRef as useRef9, useEffect as useEffect9 } from "react";
7802
+ import { jsx as jsx44 } from "react/jsx-runtime";
7348
7803
  var SampleComponent2 = ({
7349
7804
  testProp,
7350
7805
  children,
7351
7806
  ...rest
7352
7807
  // This rest operator includes className, style, onClick, etc.
7353
7808
  }) => {
7354
- const ref = useRef8(null);
7809
+ const ref = useRef9(null);
7355
7810
  useEffect9(() => {
7356
7811
  const el = ref.current;
7357
7812
  if (!el) return;
@@ -7359,13 +7814,15 @@ var SampleComponent2 = ({
7359
7814
  el.setAttribute("test-prop", testProp);
7360
7815
  }
7361
7816
  }, [testProp]);
7362
- return /* @__PURE__ */ jsx42("sample-component", { ref, ...rest, children });
7817
+ return /* @__PURE__ */ jsx44("sample-component", { ref, ...rest, children });
7363
7818
  };
7364
7819
  export {
7365
7820
  ButtonIcon,
7366
7821
  ButtonMenu,
7822
+ ChildDataTable,
7367
7823
  DefaultCarousel,
7368
7824
  DefaultPagination,
7825
+ NestedDataTable,
7369
7826
  SampleComponent2 as SampleComponent,
7370
7827
  SliderCardCarousel,
7371
7828
  WavelengthAccessAlert,