@wavelengthusaf/components 5.0.5 → 5.0.7

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.
@@ -2695,31 +2695,37 @@ WavelengthInput.displayName = "WavelengthInput";
2695
2695
 
2696
2696
  var ModalInputDiv = _styledcomponents2.default.div`
2697
2697
  display: flex;
2698
- flex-direction: column; /* Corrected this line */
2699
- gap: 3px;
2700
- margin: 3px;
2698
+ flex-direction: column;
2699
+ gap: 5px;
2700
+ margin: 10px;
2701
2701
 
2702
2702
  label {
2703
2703
  align-self: flex-start;
2704
- color: #c6c7cc;
2704
+ color: #304359;
2705
+ font-weight: 600;
2706
+ font-family: Montserrat, sans-serif;
2705
2707
  }
2706
2708
 
2707
2709
  input,
2708
2710
  select {
2709
2711
  width: 100%;
2710
- padding: 12px 20px;
2711
- margin: 8px 0;
2712
+ padding: 10px 15px;
2713
+ margin: 4px 0 12px 0;
2712
2714
  box-sizing: border-box;
2713
- border: none;
2715
+ border: 1px solid #c6c7cc;
2716
+ border-radius: 4px;
2714
2717
  outline: none;
2715
- border-bottom: 2px solid #c6c7cc;
2718
+ background-color: #ffffff;
2719
+ color: #000000;
2720
+ font-family: Montserrat, sans-serif;
2716
2721
 
2717
2722
  &:hover {
2718
- border-bottom: 2px solid black;
2723
+ border-color: #304359;
2719
2724
  }
2720
2725
 
2721
2726
  &:focus {
2722
- border-bottom: 2px solid #8fd8ff;
2727
+ border-color: #8fd8ff;
2728
+ box-shadow: 0 0 0 2px rgba(143, 216, 255, 0.3);
2723
2729
  }
2724
2730
  }
2725
2731
  `;
@@ -2749,12 +2755,17 @@ var ModalWrapper = _styledcomponents2.default.div`
2749
2755
  var ModalClose = _styledcomponents2.default.button`
2750
2756
  position: absolute;
2751
2757
  top: 10px;
2752
- right: 10px;
2753
- font-size: 20px;
2758
+ right: 15px;
2759
+ font-size: 24px;
2754
2760
  cursor: pointer;
2755
2761
  border: none;
2756
2762
  background: none;
2763
+ color: #304359;
2757
2764
  z-index: 2;
2765
+
2766
+ &:hover {
2767
+ color: #000000;
2768
+ }
2758
2769
  `;
2759
2770
  var TableHeadStyle = _styledcomponents2.default.th`
2760
2771
  position: relative;
@@ -2782,41 +2793,58 @@ var MenuOptions = _styledcomponents2.default.ul`
2782
2793
  position: absolute;
2783
2794
  right: 0;
2784
2795
  top: 100%;
2785
- background-color: #f9f9f9;
2796
+ background-color: #ffffff;
2786
2797
  min-width: 160px;
2787
2798
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
2788
- z-index: 1;
2799
+ z-index: 10;
2789
2800
  list-style: none;
2790
2801
  padding: 0;
2791
2802
  margin: 0;
2803
+ border-radius: 4px;
2804
+ overflow: hidden;
2792
2805
 
2793
2806
  li {
2794
- padding: 10px;
2807
+ padding: 12px 16px;
2795
2808
  text-decoration: none;
2796
2809
  display: block;
2797
2810
  cursor: pointer;
2811
+ color: #304359 !important;
2812
+ font-family: Montserrat, sans-serif;
2813
+ font-size: 14px;
2814
+ font-weight: 500;
2815
+ text-align: left;
2798
2816
 
2799
2817
  &:hover {
2800
- background-color: #ddd;
2818
+ background-color: #f0f4f8;
2819
+ color: #000000 !important;
2820
+ }
2821
+
2822
+ span {
2823
+ margin-right: 8px;
2824
+ color: #304359 !important;
2825
+ }
2826
+
2827
+ &:hover span {
2828
+ color: #000000 !important;
2801
2829
  }
2802
2830
  }
2803
2831
  `;
2804
2832
  var StyledBoxDiv = _styledcomponents2.default.div`
2805
2833
  background-color: white;
2806
- width: 700px;
2807
- height: 480px;
2834
+ width: 100%;
2835
+ height: auto;
2836
+ min-height: 480px;
2808
2837
  position: relative;
2809
2838
  border-top-left-radius: 10px;
2810
2839
  border-top-right-radius: 10px;
2811
2840
  `;
2812
2841
  var StyledNavBoxDiv = _styledcomponents2.default.div`
2813
2842
  background-color: white;
2814
- width: 700px;
2815
- display: flex; /* Make parent a flex-container */
2843
+ width: 100%;
2844
+ display: flex;
2816
2845
  justify-content: center;
2817
2846
  border-bottom-left-radius: 10px;
2818
2847
  border-bottom-right-radius: 10px;
2819
-
2820
2848
  box-shadow: 0.5px 3px 5px black;
2821
2849
  `;
2822
2850
  var StyledTd = _styledcomponents2.default.td`
@@ -2836,18 +2864,17 @@ var StyledTableTwo = _styledcomponents2.default.table`
2836
2864
  margin-right: auto;
2837
2865
 
2838
2866
  th {
2839
- position: relative; /* Enable absolute positioning of pseudo-elements */
2867
+ position: relative;
2840
2868
  padding: 10px 15px;
2841
2869
 
2842
- /* Create the partial right border */
2843
2870
  &:not(:last-child):after {
2844
- content: ""; /* Ensure the pseudo-element is visible */
2871
+ content: "";
2845
2872
  position: absolute;
2846
- right: 0; /* Position it on the right side of the th */
2847
- top: 50%; /* Position it in the vertical center */
2848
- height: 50%; /* Set the height of the border to be half the height of th */
2873
+ right: 0;
2874
+ top: 50%;
2875
+ height: 50%;
2849
2876
  border-right: 1px solid #c6c7cc;
2850
- transform: translateY(-50%); /* Center it vertically */
2877
+ transform: translateY(-50%);
2851
2878
  }
2852
2879
  }
2853
2880
  `;
@@ -2858,7 +2885,7 @@ var StyledInput = _styledcomponents2.default.input`
2858
2885
  border: none;
2859
2886
  color: #8fd8ff;
2860
2887
  `;
2861
- var WavelengthDataTable = ({ data, columns, itemsPerPage, totalPages, id }) => {
2888
+ var WavelengthDataTable = ({ data, columns, itemsPerPage, totalPages, id, onRowClick, paginationOptions }) => {
2862
2889
  const [localData, setLocalData] = _react.useState.call(void 0, data || []);
2863
2890
  const copiedArray = [...data || []];
2864
2891
  const [editingId, setEditingId] = _react.useState.call(void 0, null);
@@ -2873,6 +2900,38 @@ var WavelengthDataTable = ({ data, columns, itemsPerPage, totalPages, id }) => {
2873
2900
  const [editingMenuKey, setEditingMenuKey] = _react.useState.call(void 0, null);
2874
2901
  const menuRef = _react.useRef.call(void 0, null);
2875
2902
  const modalRef = _react.useRef.call(void 0, null);
2903
+ const [modalPos, setModalPos] = _react.useState.call(void 0, { x: 0, y: 0 });
2904
+ const isDragging = _react.useRef.call(void 0, false);
2905
+ const dragStartPos = _react.useRef.call(void 0, { x: 0, y: 0 });
2906
+ const handleDragStart = (e) => {
2907
+ isDragging.current = true;
2908
+ dragStartPos.current = {
2909
+ x: e.clientX - modalPos.x,
2910
+ y: e.clientY - modalPos.y
2911
+ };
2912
+ };
2913
+ _react.useEffect.call(void 0, () => {
2914
+ const handleDragMove = (e) => {
2915
+ if (!isDragging.current) return;
2916
+ setModalPos({
2917
+ x: e.clientX - dragStartPos.current.x,
2918
+ y: e.clientY - dragStartPos.current.y
2919
+ });
2920
+ };
2921
+ const handleDragEnd = () => {
2922
+ isDragging.current = false;
2923
+ };
2924
+ if (isModalOpen) {
2925
+ document.addEventListener("mousemove", handleDragMove);
2926
+ document.addEventListener("mouseup", handleDragEnd);
2927
+ } else {
2928
+ setModalPos({ x: 0, y: 0 });
2929
+ }
2930
+ return () => {
2931
+ document.removeEventListener("mousemove", handleDragMove);
2932
+ document.removeEventListener("mouseup", handleDragEnd);
2933
+ };
2934
+ }, [isModalOpen]);
2876
2935
  function isNumeric(value) {
2877
2936
  return /^\d+$/.test(value);
2878
2937
  }
@@ -2992,36 +3051,47 @@ var WavelengthDataTable = ({ data, columns, itemsPerPage, totalPages, id }) => {
2992
3051
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "\u23F7" }),
2993
3052
  " Filter"
2994
3053
  ] }),
2995
- isModalOpen && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ModalOverlay, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, ModalWrapper, { ref: modalRef, children: [
2996
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ModalClose, { title: `ModalClose-${index}`, onClick: closeModal, children: "\xD7" }),
2997
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, ModalInputDiv, { children: [
2998
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { htmlFor: "filterSelectId", children: "Columns: " }),
2999
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "select", { title: `filterSelect-${index}`, id: "filterSelectId", value: selectedValue, onChange: handleChange, children: columns.map((item) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "option", { children: item.key }, item.key)) })
3000
- ] }),
3001
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, ModalInputDiv, { children: [
3002
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { htmlFor: "filterInputId", children: "Values: " }),
3003
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3004
- "input",
3005
- {
3006
- title: `Inputfiltertest-${index}`,
3007
- id: "filterInputId",
3008
- type: isNumeric(searchItem) ? "number" : "text",
3009
- value: searchItem,
3010
- onKeyDown: (e) => {
3011
- if (e.key === "Backspace") {
3012
- setLocalData(copiedArray);
3054
+ isModalOpen && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ModalOverlay, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
3055
+ ModalWrapper,
3056
+ {
3057
+ ref: modalRef,
3058
+ style: {
3059
+ transform: `translate(${modalPos.x}px, ${modalPos.y}px)`,
3060
+ cursor: "grab"
3061
+ },
3062
+ onMouseDown: handleDragStart,
3063
+ children: [
3064
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ModalClose, { title: `ModalClose-${index}`, onClick: closeModal, children: "\xD7" }),
3065
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, ModalInputDiv, { children: [
3066
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { htmlFor: "filterSelectId", children: "Columns: " }),
3067
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "select", { title: `filterSelect-${index}`, id: "filterSelectId", value: selectedValue, onChange: handleChange, children: columns.map((item) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "option", { children: item.key }, item.key)) })
3068
+ ] }),
3069
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, ModalInputDiv, { children: [
3070
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { htmlFor: "filterInputId", children: "Values: " }),
3071
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3072
+ "input",
3073
+ {
3074
+ title: `Inputfiltertest-${index}`,
3075
+ id: "filterInputId",
3076
+ type: isNumeric(searchItem) ? "number" : "text",
3077
+ value: searchItem,
3078
+ onKeyDown: (e) => {
3079
+ if (e.key === "Backspace") {
3080
+ setLocalData(copiedArray);
3081
+ }
3082
+ },
3083
+ onChange: (e) => setSearchItem(e.target.value)
3013
3084
  }
3014
- },
3015
- onChange: (e) => setSearchItem(e.target.value)
3016
- }
3017
- )
3018
- ] })
3019
- ] }) })
3085
+ )
3086
+ ] })
3087
+ ]
3088
+ }
3089
+ ) })
3020
3090
  ] })
3021
3091
  ] }, index)
3022
3092
  ] }, `headCell-${index}`);
3023
3093
  });
3024
- const rows = !_optionalChain([currentPageData, 'optionalAccess', _44 => _44.length]) || noRowsOpen ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "tr", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { title: "NoDataRows", colSpan: columns.length, children: "No data" }) }) : _optionalChain([currentPageData, 'optionalAccess', _45 => _45.map, 'call', _46 => _46((item) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "tr", { children: columns.map((column, index2) => {
3094
+ const rows = !_optionalChain([currentPageData, 'optionalAccess', _44 => _44.length]) || noRowsOpen ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "tr", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { title: "NoDataRows", colSpan: columns.length, children: "No data" }) }) : _optionalChain([currentPageData, 'optionalAccess', _45 => _45.map, 'call', _46 => _46((item) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "tr", { onClick: () => onRowClick && onRowClick(item), style: { cursor: onRowClick ? "pointer" : "default" }, children: columns.map((column, index2) => {
3025
3095
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StyledTd, { children: editingId === item.id && editedColumnKey === column.key ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3026
3096
  StyledInput,
3027
3097
  {
@@ -3039,14 +3109,14 @@ var WavelengthDataTable = ({ data, columns, itemsPerPage, totalPages, id }) => {
3039
3109
  },
3040
3110
  autoFocus: true
3041
3111
  }
3042
- ) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { title: `spanRow-${item.id}-${column.key}-${index2}`, onDoubleClick: () => handleEdit(item.id, item[column.key], column.key), children: item[column.key] }) }, index2);
3112
+ ) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { title: `spanRow-${item.id}-${column.key}-${index2}`, onDoubleClick: () => column.editable !== false && handleEdit(item.id, item[column.key], column.key), children: column.render ? column.render(column, item) : item[column.key] }) }, index2);
3043
3113
  }) }, item.id))]);
3044
3114
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { id, children: [
3045
3115
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StyledBoxDiv, { title: "StyledBoxDiv", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, StyledTableTwo, { title: "StyledTable", children: [
3046
3116
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "thead", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "tr", { children: headers }) }),
3047
3117
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "tbody", { children: rows })
3048
3118
  ] }) }),
3049
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StyledNavBoxDiv, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WavelengthPagination, { customStyle: {}, totalPages, currentPage, onPageChange: setCurrentPage, variant: "basic" }) })
3119
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StyledNavBoxDiv, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WavelengthPagination, { customStyle: {}, totalPages, currentPage, onPageChange: setCurrentPage, variant: "basic", ...paginationOptions || {} }) })
3050
3120
  ] });
3051
3121
  };
3052
3122
  WavelengthDataTable.displayName = "WavelengthDataTable";
@@ -674,6 +674,23 @@ declare const WavelengthInput: React__default.ForwardRefExoticComponent<Waveleng
674
674
  validate?: () => boolean;
675
675
  }>>;
676
676
 
677
+ interface PaginationOptions {
678
+ testProp?: string;
679
+ customStyle?: StyleProp;
680
+ variant?: "basic" | "common";
681
+ textColor?: string;
682
+ font?: string;
683
+ fontSize?: string;
684
+ border?: string;
685
+ borderRadius?: string;
686
+ padding?: string;
687
+ activeColor?: string;
688
+ activeTextColor?: string;
689
+ backgroundColor?: string;
690
+ disabledColor?: string;
691
+ className?: string;
692
+ style?: React.CSSProperties;
693
+ }
677
694
  interface DataType$1 {
678
695
  id: number;
679
696
  [key: string]: any;
@@ -691,9 +708,11 @@ type Props$1<T> = {
691
708
  itemsPerPage: number;
692
709
  totalPages: number;
693
710
  id?: string;
711
+ onRowClick?: (item: T) => void;
712
+ paginationOptions?: PaginationOptions;
694
713
  };
695
714
  declare const WavelengthDataTable: {
696
- <T extends DataType$1>({ data, columns, itemsPerPage, totalPages, id }: Props$1<T>): react_jsx_runtime.JSX.Element;
715
+ <T extends DataType$1>({ data, columns, itemsPerPage, totalPages, id, onRowClick, paginationOptions }: Props$1<T>): react_jsx_runtime.JSX.Element;
697
716
  displayName: string;
698
717
  };
699
718
 
@@ -875,4 +894,4 @@ interface WavelengthCheckboxListProps extends React__default.HTMLAttributes<HTML
875
894
  }
876
895
  declare const WavelengthCheckboxList: React__default.FC<WavelengthCheckboxListProps>;
877
896
 
878
- export { ChildDataTable, type DataGridColumn, type DataGridRow, type FileSelectedEventDetail, type IFileSelectedEventDetail, type NavItem, NestedDataTable, SampleComponent, type SearchResult, type StyledButtonPropsTwo, type ThemeProperties, WavelengthAppLogo, WavelengthAppTheme, WavelengthAutoComplete, WavelengthBadge, type WavelengthBadgeProps, WavelengthBanner, WavelengthButton, WavelengthCard, WavelengthCheckbox, WavelengthCheckboxList, WavelengthCommentDisplay, WavelengthConfirmationModal, WavelengthContentPlaceholder, WavelengthDataGrid, WavelengthDataTable, WavelengthDatePicker, WavelengthDefaultIcon, WavelengthDialog, WavelengthDragAndDrop, WavelengthDropdown, WavelengthExampleComponent, WavelengthFileDropZone, type WavelengthFileDropZoneProps, WavelengthForm, WavelengthInput, WavelengthManyPlanes, WavelengthMenu, WavelengthMultiSelectAutocomplete, WavelengthNavBar, type WavelengthNavBarProps, WavelengthNotAvailablePage, WavelengthNotificationPanel, WavelengthPagination, WavelengthPermissionAlert, WavelengthPlaneTrail, WavelengthPopUpMenu, WavelengthProgressBar, WavelengthSearch, WavelengthSideBar, type WavelengthSideBarProps, WavelengthSlider, WavelengthSnackbar, type WavelengthSnackbarProps, WavelengthSpinningLogo, WavelengthStyledButton, WavelengthSwitch, WavelengthTitleBar, WavelengthToolTip, add, concat, useThemeContext };
897
+ export { ChildDataTable, type DataGridColumn, type DataGridRow, type FileSelectedEventDetail, type IFileSelectedEventDetail, type NavItem, NestedDataTable, type PaginationOptions, SampleComponent, type SearchResult, type StyledButtonPropsTwo, type ThemeProperties, WavelengthAppLogo, WavelengthAppTheme, WavelengthAutoComplete, WavelengthBadge, type WavelengthBadgeProps, WavelengthBanner, WavelengthButton, WavelengthCard, WavelengthCheckbox, WavelengthCheckboxList, WavelengthCommentDisplay, WavelengthConfirmationModal, WavelengthContentPlaceholder, WavelengthDataGrid, WavelengthDataTable, WavelengthDatePicker, WavelengthDefaultIcon, WavelengthDialog, WavelengthDragAndDrop, WavelengthDropdown, WavelengthExampleComponent, WavelengthFileDropZone, type WavelengthFileDropZoneProps, WavelengthForm, WavelengthInput, WavelengthManyPlanes, WavelengthMenu, WavelengthMultiSelectAutocomplete, WavelengthNavBar, type WavelengthNavBarProps, WavelengthNotAvailablePage, WavelengthNotificationPanel, WavelengthPagination, WavelengthPermissionAlert, WavelengthPlaneTrail, WavelengthPopUpMenu, WavelengthProgressBar, WavelengthSearch, WavelengthSideBar, type WavelengthSideBarProps, WavelengthSlider, WavelengthSnackbar, type WavelengthSnackbarProps, WavelengthSpinningLogo, WavelengthStyledButton, WavelengthSwitch, WavelengthTitleBar, WavelengthToolTip, add, concat, useThemeContext };
@@ -674,6 +674,23 @@ declare const WavelengthInput: React__default.ForwardRefExoticComponent<Waveleng
674
674
  validate?: () => boolean;
675
675
  }>>;
676
676
 
677
+ interface PaginationOptions {
678
+ testProp?: string;
679
+ customStyle?: StyleProp;
680
+ variant?: "basic" | "common";
681
+ textColor?: string;
682
+ font?: string;
683
+ fontSize?: string;
684
+ border?: string;
685
+ borderRadius?: string;
686
+ padding?: string;
687
+ activeColor?: string;
688
+ activeTextColor?: string;
689
+ backgroundColor?: string;
690
+ disabledColor?: string;
691
+ className?: string;
692
+ style?: React.CSSProperties;
693
+ }
677
694
  interface DataType$1 {
678
695
  id: number;
679
696
  [key: string]: any;
@@ -691,9 +708,11 @@ type Props$1<T> = {
691
708
  itemsPerPage: number;
692
709
  totalPages: number;
693
710
  id?: string;
711
+ onRowClick?: (item: T) => void;
712
+ paginationOptions?: PaginationOptions;
694
713
  };
695
714
  declare const WavelengthDataTable: {
696
- <T extends DataType$1>({ data, columns, itemsPerPage, totalPages, id }: Props$1<T>): react_jsx_runtime.JSX.Element;
715
+ <T extends DataType$1>({ data, columns, itemsPerPage, totalPages, id, onRowClick, paginationOptions }: Props$1<T>): react_jsx_runtime.JSX.Element;
697
716
  displayName: string;
698
717
  };
699
718
 
@@ -875,4 +894,4 @@ interface WavelengthCheckboxListProps extends React__default.HTMLAttributes<HTML
875
894
  }
876
895
  declare const WavelengthCheckboxList: React__default.FC<WavelengthCheckboxListProps>;
877
896
 
878
- export { ChildDataTable, type DataGridColumn, type DataGridRow, type FileSelectedEventDetail, type IFileSelectedEventDetail, type NavItem, NestedDataTable, SampleComponent, type SearchResult, type StyledButtonPropsTwo, type ThemeProperties, WavelengthAppLogo, WavelengthAppTheme, WavelengthAutoComplete, WavelengthBadge, type WavelengthBadgeProps, WavelengthBanner, WavelengthButton, WavelengthCard, WavelengthCheckbox, WavelengthCheckboxList, WavelengthCommentDisplay, WavelengthConfirmationModal, WavelengthContentPlaceholder, WavelengthDataGrid, WavelengthDataTable, WavelengthDatePicker, WavelengthDefaultIcon, WavelengthDialog, WavelengthDragAndDrop, WavelengthDropdown, WavelengthExampleComponent, WavelengthFileDropZone, type WavelengthFileDropZoneProps, WavelengthForm, WavelengthInput, WavelengthManyPlanes, WavelengthMenu, WavelengthMultiSelectAutocomplete, WavelengthNavBar, type WavelengthNavBarProps, WavelengthNotAvailablePage, WavelengthNotificationPanel, WavelengthPagination, WavelengthPermissionAlert, WavelengthPlaneTrail, WavelengthPopUpMenu, WavelengthProgressBar, WavelengthSearch, WavelengthSideBar, type WavelengthSideBarProps, WavelengthSlider, WavelengthSnackbar, type WavelengthSnackbarProps, WavelengthSpinningLogo, WavelengthStyledButton, WavelengthSwitch, WavelengthTitleBar, WavelengthToolTip, add, concat, useThemeContext };
897
+ export { ChildDataTable, type DataGridColumn, type DataGridRow, type FileSelectedEventDetail, type IFileSelectedEventDetail, type NavItem, NestedDataTable, type PaginationOptions, SampleComponent, type SearchResult, type StyledButtonPropsTwo, type ThemeProperties, WavelengthAppLogo, WavelengthAppTheme, WavelengthAutoComplete, WavelengthBadge, type WavelengthBadgeProps, WavelengthBanner, WavelengthButton, WavelengthCard, WavelengthCheckbox, WavelengthCheckboxList, WavelengthCommentDisplay, WavelengthConfirmationModal, WavelengthContentPlaceholder, WavelengthDataGrid, WavelengthDataTable, WavelengthDatePicker, WavelengthDefaultIcon, WavelengthDialog, WavelengthDragAndDrop, WavelengthDropdown, WavelengthExampleComponent, WavelengthFileDropZone, type WavelengthFileDropZoneProps, WavelengthForm, WavelengthInput, WavelengthManyPlanes, WavelengthMenu, WavelengthMultiSelectAutocomplete, WavelengthNavBar, type WavelengthNavBarProps, WavelengthNotAvailablePage, WavelengthNotificationPanel, WavelengthPagination, WavelengthPermissionAlert, WavelengthPlaneTrail, WavelengthPopUpMenu, WavelengthProgressBar, WavelengthSearch, WavelengthSideBar, type WavelengthSideBarProps, WavelengthSlider, WavelengthSnackbar, type WavelengthSnackbarProps, WavelengthSpinningLogo, WavelengthStyledButton, WavelengthSwitch, WavelengthTitleBar, WavelengthToolTip, add, concat, useThemeContext };
package/dist/esm/index.js CHANGED
@@ -2695,31 +2695,37 @@ import styled2 from "styled-components";
2695
2695
  import { jsx as jsx32, jsxs as jsxs10 } from "react/jsx-runtime";
2696
2696
  var ModalInputDiv = styled2.div`
2697
2697
  display: flex;
2698
- flex-direction: column; /* Corrected this line */
2699
- gap: 3px;
2700
- margin: 3px;
2698
+ flex-direction: column;
2699
+ gap: 5px;
2700
+ margin: 10px;
2701
2701
 
2702
2702
  label {
2703
2703
  align-self: flex-start;
2704
- color: #c6c7cc;
2704
+ color: #304359;
2705
+ font-weight: 600;
2706
+ font-family: Montserrat, sans-serif;
2705
2707
  }
2706
2708
 
2707
2709
  input,
2708
2710
  select {
2709
2711
  width: 100%;
2710
- padding: 12px 20px;
2711
- margin: 8px 0;
2712
+ padding: 10px 15px;
2713
+ margin: 4px 0 12px 0;
2712
2714
  box-sizing: border-box;
2713
- border: none;
2715
+ border: 1px solid #c6c7cc;
2716
+ border-radius: 4px;
2714
2717
  outline: none;
2715
- border-bottom: 2px solid #c6c7cc;
2718
+ background-color: #ffffff;
2719
+ color: #000000;
2720
+ font-family: Montserrat, sans-serif;
2716
2721
 
2717
2722
  &:hover {
2718
- border-bottom: 2px solid black;
2723
+ border-color: #304359;
2719
2724
  }
2720
2725
 
2721
2726
  &:focus {
2722
- border-bottom: 2px solid #8fd8ff;
2727
+ border-color: #8fd8ff;
2728
+ box-shadow: 0 0 0 2px rgba(143, 216, 255, 0.3);
2723
2729
  }
2724
2730
  }
2725
2731
  `;
@@ -2749,12 +2755,17 @@ var ModalWrapper = styled2.div`
2749
2755
  var ModalClose = styled2.button`
2750
2756
  position: absolute;
2751
2757
  top: 10px;
2752
- right: 10px;
2753
- font-size: 20px;
2758
+ right: 15px;
2759
+ font-size: 24px;
2754
2760
  cursor: pointer;
2755
2761
  border: none;
2756
2762
  background: none;
2763
+ color: #304359;
2757
2764
  z-index: 2;
2765
+
2766
+ &:hover {
2767
+ color: #000000;
2768
+ }
2758
2769
  `;
2759
2770
  var TableHeadStyle = styled2.th`
2760
2771
  position: relative;
@@ -2782,41 +2793,58 @@ var MenuOptions = styled2.ul`
2782
2793
  position: absolute;
2783
2794
  right: 0;
2784
2795
  top: 100%;
2785
- background-color: #f9f9f9;
2796
+ background-color: #ffffff;
2786
2797
  min-width: 160px;
2787
2798
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
2788
- z-index: 1;
2799
+ z-index: 10;
2789
2800
  list-style: none;
2790
2801
  padding: 0;
2791
2802
  margin: 0;
2803
+ border-radius: 4px;
2804
+ overflow: hidden;
2792
2805
 
2793
2806
  li {
2794
- padding: 10px;
2807
+ padding: 12px 16px;
2795
2808
  text-decoration: none;
2796
2809
  display: block;
2797
2810
  cursor: pointer;
2811
+ color: #304359 !important;
2812
+ font-family: Montserrat, sans-serif;
2813
+ font-size: 14px;
2814
+ font-weight: 500;
2815
+ text-align: left;
2798
2816
 
2799
2817
  &:hover {
2800
- background-color: #ddd;
2818
+ background-color: #f0f4f8;
2819
+ color: #000000 !important;
2820
+ }
2821
+
2822
+ span {
2823
+ margin-right: 8px;
2824
+ color: #304359 !important;
2825
+ }
2826
+
2827
+ &:hover span {
2828
+ color: #000000 !important;
2801
2829
  }
2802
2830
  }
2803
2831
  `;
2804
2832
  var StyledBoxDiv = styled2.div`
2805
2833
  background-color: white;
2806
- width: 700px;
2807
- height: 480px;
2834
+ width: 100%;
2835
+ height: auto;
2836
+ min-height: 480px;
2808
2837
  position: relative;
2809
2838
  border-top-left-radius: 10px;
2810
2839
  border-top-right-radius: 10px;
2811
2840
  `;
2812
2841
  var StyledNavBoxDiv = styled2.div`
2813
2842
  background-color: white;
2814
- width: 700px;
2815
- display: flex; /* Make parent a flex-container */
2843
+ width: 100%;
2844
+ display: flex;
2816
2845
  justify-content: center;
2817
2846
  border-bottom-left-radius: 10px;
2818
2847
  border-bottom-right-radius: 10px;
2819
-
2820
2848
  box-shadow: 0.5px 3px 5px black;
2821
2849
  `;
2822
2850
  var StyledTd = styled2.td`
@@ -2836,18 +2864,17 @@ var StyledTableTwo = styled2.table`
2836
2864
  margin-right: auto;
2837
2865
 
2838
2866
  th {
2839
- position: relative; /* Enable absolute positioning of pseudo-elements */
2867
+ position: relative;
2840
2868
  padding: 10px 15px;
2841
2869
 
2842
- /* Create the partial right border */
2843
2870
  &:not(:last-child):after {
2844
- content: ""; /* Ensure the pseudo-element is visible */
2871
+ content: "";
2845
2872
  position: absolute;
2846
- right: 0; /* Position it on the right side of the th */
2847
- top: 50%; /* Position it in the vertical center */
2848
- height: 50%; /* Set the height of the border to be half the height of th */
2873
+ right: 0;
2874
+ top: 50%;
2875
+ height: 50%;
2849
2876
  border-right: 1px solid #c6c7cc;
2850
- transform: translateY(-50%); /* Center it vertically */
2877
+ transform: translateY(-50%);
2851
2878
  }
2852
2879
  }
2853
2880
  `;
@@ -2858,7 +2885,7 @@ var StyledInput = styled2.input`
2858
2885
  border: none;
2859
2886
  color: #8fd8ff;
2860
2887
  `;
2861
- var WavelengthDataTable = ({ data, columns, itemsPerPage, totalPages, id }) => {
2888
+ var WavelengthDataTable = ({ data, columns, itemsPerPage, totalPages, id, onRowClick, paginationOptions }) => {
2862
2889
  const [localData, setLocalData] = useState(data || []);
2863
2890
  const copiedArray = [...data || []];
2864
2891
  const [editingId, setEditingId] = useState(null);
@@ -2873,6 +2900,38 @@ var WavelengthDataTable = ({ data, columns, itemsPerPage, totalPages, id }) => {
2873
2900
  const [editingMenuKey, setEditingMenuKey] = useState(null);
2874
2901
  const menuRef = useRef27(null);
2875
2902
  const modalRef = useRef27(null);
2903
+ const [modalPos, setModalPos] = useState({ x: 0, y: 0 });
2904
+ const isDragging = useRef27(false);
2905
+ const dragStartPos = useRef27({ x: 0, y: 0 });
2906
+ const handleDragStart = (e) => {
2907
+ isDragging.current = true;
2908
+ dragStartPos.current = {
2909
+ x: e.clientX - modalPos.x,
2910
+ y: e.clientY - modalPos.y
2911
+ };
2912
+ };
2913
+ useEffect27(() => {
2914
+ const handleDragMove = (e) => {
2915
+ if (!isDragging.current) return;
2916
+ setModalPos({
2917
+ x: e.clientX - dragStartPos.current.x,
2918
+ y: e.clientY - dragStartPos.current.y
2919
+ });
2920
+ };
2921
+ const handleDragEnd = () => {
2922
+ isDragging.current = false;
2923
+ };
2924
+ if (isModalOpen) {
2925
+ document.addEventListener("mousemove", handleDragMove);
2926
+ document.addEventListener("mouseup", handleDragEnd);
2927
+ } else {
2928
+ setModalPos({ x: 0, y: 0 });
2929
+ }
2930
+ return () => {
2931
+ document.removeEventListener("mousemove", handleDragMove);
2932
+ document.removeEventListener("mouseup", handleDragEnd);
2933
+ };
2934
+ }, [isModalOpen]);
2876
2935
  function isNumeric(value) {
2877
2936
  return /^\d+$/.test(value);
2878
2937
  }
@@ -2992,36 +3051,47 @@ var WavelengthDataTable = ({ data, columns, itemsPerPage, totalPages, id }) => {
2992
3051
  /* @__PURE__ */ jsx32("span", { children: "\u23F7" }),
2993
3052
  " Filter"
2994
3053
  ] }),
2995
- isModalOpen && /* @__PURE__ */ jsx32(ModalOverlay, { children: /* @__PURE__ */ jsxs10(ModalWrapper, { ref: modalRef, children: [
2996
- /* @__PURE__ */ jsx32(ModalClose, { title: `ModalClose-${index}`, onClick: closeModal, children: "\xD7" }),
2997
- /* @__PURE__ */ jsxs10(ModalInputDiv, { children: [
2998
- /* @__PURE__ */ jsx32("label", { htmlFor: "filterSelectId", children: "Columns: " }),
2999
- /* @__PURE__ */ jsx32("select", { title: `filterSelect-${index}`, id: "filterSelectId", value: selectedValue, onChange: handleChange, children: columns.map((item) => /* @__PURE__ */ jsx32("option", { children: item.key }, item.key)) })
3000
- ] }),
3001
- /* @__PURE__ */ jsxs10(ModalInputDiv, { children: [
3002
- /* @__PURE__ */ jsx32("label", { htmlFor: "filterInputId", children: "Values: " }),
3003
- /* @__PURE__ */ jsx32(
3004
- "input",
3005
- {
3006
- title: `Inputfiltertest-${index}`,
3007
- id: "filterInputId",
3008
- type: isNumeric(searchItem) ? "number" : "text",
3009
- value: searchItem,
3010
- onKeyDown: (e) => {
3011
- if (e.key === "Backspace") {
3012
- setLocalData(copiedArray);
3054
+ isModalOpen && /* @__PURE__ */ jsx32(ModalOverlay, { children: /* @__PURE__ */ jsxs10(
3055
+ ModalWrapper,
3056
+ {
3057
+ ref: modalRef,
3058
+ style: {
3059
+ transform: `translate(${modalPos.x}px, ${modalPos.y}px)`,
3060
+ cursor: "grab"
3061
+ },
3062
+ onMouseDown: handleDragStart,
3063
+ children: [
3064
+ /* @__PURE__ */ jsx32(ModalClose, { title: `ModalClose-${index}`, onClick: closeModal, children: "\xD7" }),
3065
+ /* @__PURE__ */ jsxs10(ModalInputDiv, { children: [
3066
+ /* @__PURE__ */ jsx32("label", { htmlFor: "filterSelectId", children: "Columns: " }),
3067
+ /* @__PURE__ */ jsx32("select", { title: `filterSelect-${index}`, id: "filterSelectId", value: selectedValue, onChange: handleChange, children: columns.map((item) => /* @__PURE__ */ jsx32("option", { children: item.key }, item.key)) })
3068
+ ] }),
3069
+ /* @__PURE__ */ jsxs10(ModalInputDiv, { children: [
3070
+ /* @__PURE__ */ jsx32("label", { htmlFor: "filterInputId", children: "Values: " }),
3071
+ /* @__PURE__ */ jsx32(
3072
+ "input",
3073
+ {
3074
+ title: `Inputfiltertest-${index}`,
3075
+ id: "filterInputId",
3076
+ type: isNumeric(searchItem) ? "number" : "text",
3077
+ value: searchItem,
3078
+ onKeyDown: (e) => {
3079
+ if (e.key === "Backspace") {
3080
+ setLocalData(copiedArray);
3081
+ }
3082
+ },
3083
+ onChange: (e) => setSearchItem(e.target.value)
3013
3084
  }
3014
- },
3015
- onChange: (e) => setSearchItem(e.target.value)
3016
- }
3017
- )
3018
- ] })
3019
- ] }) })
3085
+ )
3086
+ ] })
3087
+ ]
3088
+ }
3089
+ ) })
3020
3090
  ] })
3021
3091
  ] }, index)
3022
3092
  ] }, `headCell-${index}`);
3023
3093
  });
3024
- const rows = !currentPageData?.length || noRowsOpen ? /* @__PURE__ */ jsx32("tr", { children: /* @__PURE__ */ jsx32("td", { title: "NoDataRows", colSpan: columns.length, children: "No data" }) }) : currentPageData?.map((item) => /* @__PURE__ */ jsx32("tr", { children: columns.map((column, index2) => {
3094
+ const rows = !currentPageData?.length || noRowsOpen ? /* @__PURE__ */ jsx32("tr", { children: /* @__PURE__ */ jsx32("td", { title: "NoDataRows", colSpan: columns.length, children: "No data" }) }) : currentPageData?.map((item) => /* @__PURE__ */ jsx32("tr", { onClick: () => onRowClick && onRowClick(item), style: { cursor: onRowClick ? "pointer" : "default" }, children: columns.map((column, index2) => {
3025
3095
  return /* @__PURE__ */ jsx32(StyledTd, { children: editingId === item.id && editedColumnKey === column.key ? /* @__PURE__ */ jsx32(
3026
3096
  StyledInput,
3027
3097
  {
@@ -3039,14 +3109,14 @@ var WavelengthDataTable = ({ data, columns, itemsPerPage, totalPages, id }) => {
3039
3109
  },
3040
3110
  autoFocus: true
3041
3111
  }
3042
- ) : /* @__PURE__ */ jsx32("span", { title: `spanRow-${item.id}-${column.key}-${index2}`, onDoubleClick: () => handleEdit(item.id, item[column.key], column.key), children: item[column.key] }) }, index2);
3112
+ ) : /* @__PURE__ */ jsx32("span", { title: `spanRow-${item.id}-${column.key}-${index2}`, onDoubleClick: () => column.editable !== false && handleEdit(item.id, item[column.key], column.key), children: column.render ? column.render(column, item) : item[column.key] }) }, index2);
3043
3113
  }) }, item.id));
3044
3114
  return /* @__PURE__ */ jsxs10("div", { id, children: [
3045
3115
  /* @__PURE__ */ jsx32(StyledBoxDiv, { title: "StyledBoxDiv", children: /* @__PURE__ */ jsxs10(StyledTableTwo, { title: "StyledTable", children: [
3046
3116
  /* @__PURE__ */ jsx32("thead", { children: /* @__PURE__ */ jsx32("tr", { children: headers }) }),
3047
3117
  /* @__PURE__ */ jsx32("tbody", { children: rows })
3048
3118
  ] }) }),
3049
- /* @__PURE__ */ jsx32(StyledNavBoxDiv, { children: /* @__PURE__ */ jsx32(WavelengthPagination, { customStyle: {}, totalPages, currentPage, onPageChange: setCurrentPage, variant: "basic" }) })
3119
+ /* @__PURE__ */ jsx32(StyledNavBoxDiv, { children: /* @__PURE__ */ jsx32(WavelengthPagination, { customStyle: {}, totalPages, currentPage, onPageChange: setCurrentPage, variant: "basic", ...paginationOptions || {} }) })
3050
3120
  ] });
3051
3121
  };
3052
3122
  WavelengthDataTable.displayName = "WavelengthDataTable";
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@wavelengthusaf/components",
3
3
  "author": "563 EWS - Wavelength",
4
4
  "license": "MIT",
5
- "version": "5.0.5",
5
+ "version": "5.0.7",
6
6
  "description": "Common component library used by Wavelength developers",
7
7
  "main": "/dist/cjs/index.cjs",
8
8
  "module": "/dist/esm/index.js",
@@ -67,7 +67,7 @@
67
67
  "tsup": "^8.0.1"
68
68
  },
69
69
  "dependencies": {
70
- "@wavelengthusaf/web-components": "^2.1.5",
70
+ "@wavelengthusaf/web-components": "^2.1.6",
71
71
  "react": "^18.0.0",
72
72
  "styled-components": "^6.1.12",
73
73
  "typescript": "^5.5.2"