@wavelengthusaf/components 4.2.0 → 4.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +67 -4
- package/dist/cjs/index.d.cts +14 -36
- package/dist/esm/index.d.ts +14 -36
- package/dist/esm/index.js +109 -46
- package/package.json +7 -2
package/dist/cjs/index.cjs
CHANGED
|
@@ -7568,6 +7568,68 @@ var ChildDataTable = ({ data, columns, downloadArrowOnClick, downloadMissionOnCl
|
|
|
7568
7568
|
};
|
|
7569
7569
|
ChildDataTable.displayName = "ChildDataTable";
|
|
7570
7570
|
|
|
7571
|
+
// src/components/DataTable/SubRowTable/ChildDataTable.tsx
|
|
7572
|
+
|
|
7573
|
+
|
|
7574
|
+
var _client = require('react-dom/client');
|
|
7575
|
+
|
|
7576
|
+
var ChildDataTable2 = ({ columns, data, dropdownArrowLocation, sortIcon, dropdownButtonIcon, ...rest }) => {
|
|
7577
|
+
const tableRef = _react.useRef.call(void 0, null);
|
|
7578
|
+
const reactDropdownRoots = _react.useRef.call(void 0, /* @__PURE__ */ new Map());
|
|
7579
|
+
_react.useEffect.call(void 0, () => {
|
|
7580
|
+
const customChildDataTableElement = tableRef.current;
|
|
7581
|
+
if (!customChildDataTableElement) return;
|
|
7582
|
+
if (columns !== void 0) customChildDataTableElement.setColumns = columns;
|
|
7583
|
+
if (data !== void 0) customChildDataTableElement.setData = data;
|
|
7584
|
+
if (dropdownArrowLocation !== void 0) customChildDataTableElement.setDropdownArrowLocation = dropdownArrowLocation;
|
|
7585
|
+
if (sortIcon !== void 0) customChildDataTableElement.setSortIcon = sortIcon;
|
|
7586
|
+
if (dropdownButtonIcon !== void 0) customChildDataTableElement.setDropdownButtonIcon = dropdownButtonIcon;
|
|
7587
|
+
}, [columns, data, dropdownArrowLocation, sortIcon, dropdownButtonIcon]);
|
|
7588
|
+
_react.useEffect.call(void 0, () => {
|
|
7589
|
+
const el = tableRef.current;
|
|
7590
|
+
if (!el) return;
|
|
7591
|
+
const handleReactDropdown = (event) => {
|
|
7592
|
+
console.log("handling react dropdown");
|
|
7593
|
+
const customEvent = event;
|
|
7594
|
+
event.stopPropagation();
|
|
7595
|
+
const { container, itemId } = customEvent.detail;
|
|
7596
|
+
let root = reactDropdownRoots.current.get(container);
|
|
7597
|
+
if (!root) {
|
|
7598
|
+
root = _client.createRoot.call(void 0, container);
|
|
7599
|
+
reactDropdownRoots.current.set(container, root);
|
|
7600
|
+
}
|
|
7601
|
+
const item = _optionalChain([data, 'optionalAccess', _75 => _75.find, 'call', _76 => _76((item2) => String(item2.id) === String(itemId))]);
|
|
7602
|
+
if (item && item.dropdown && root) {
|
|
7603
|
+
root.render(item.dropdown);
|
|
7604
|
+
}
|
|
7605
|
+
const dropdown = container.querySelector("#dropdown");
|
|
7606
|
+
if (dropdown) {
|
|
7607
|
+
dropdown.hidden = false;
|
|
7608
|
+
}
|
|
7609
|
+
};
|
|
7610
|
+
const handleCleanupDropdown = (event) => {
|
|
7611
|
+
event.stopPropagation();
|
|
7612
|
+
const { container } = event.detail;
|
|
7613
|
+
const root = reactDropdownRoots.current.get(container);
|
|
7614
|
+
const dropdown = container.querySelector("#dropdown");
|
|
7615
|
+
if (root && dropdown) {
|
|
7616
|
+
dropdown.hidden = true;
|
|
7617
|
+
}
|
|
7618
|
+
};
|
|
7619
|
+
el.addEventListener("getReactDropdown", handleReactDropdown);
|
|
7620
|
+
el.addEventListener("cleanupDropdown", handleCleanupDropdown);
|
|
7621
|
+
return () => {
|
|
7622
|
+
el.removeEventListener("getReactDropdown", handleReactDropdown);
|
|
7623
|
+
el.removeEventListener("cleanupDropdown", handleCleanupDropdown);
|
|
7624
|
+
};
|
|
7625
|
+
}, [data]);
|
|
7626
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "wavelength-child-data-table", { ref: tableRef, ...rest });
|
|
7627
|
+
};
|
|
7628
|
+
ChildDataTable2.displayName = "ChildDataTable";
|
|
7629
|
+
|
|
7630
|
+
// src/index.ts
|
|
7631
|
+
|
|
7632
|
+
|
|
7571
7633
|
// src/components/DataTable/NestedDataTable/NestedDataTable.tsx
|
|
7572
7634
|
|
|
7573
7635
|
|
|
@@ -7663,9 +7725,9 @@ var NestedDataTable = ({ data, columns }) => {
|
|
|
7663
7725
|
const SubDataHeaders = SubDataColumns.map((column, index) => {
|
|
7664
7726
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "th", { children: column.title }, `SubHeadCell-${index}`);
|
|
7665
7727
|
});
|
|
7666
|
-
const subDataRows = !_optionalChain([data, 'optionalAccess',
|
|
7728
|
+
const subDataRows = !_optionalChain([data, 'optionalAccess', _77 => _77.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) => {
|
|
7667
7729
|
const columnKey = trimBeforePeriod(column.key);
|
|
7668
|
-
const value = _optionalChain([item, 'access',
|
|
7730
|
+
const value = _optionalChain([item, 'access', _78 => _78.Details, 'optionalAccess', _79 => _79[columnKey]]);
|
|
7669
7731
|
console.log("value: ", value);
|
|
7670
7732
|
if (value !== void 0) {
|
|
7671
7733
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: value }) }, `Span-${item.id}-${colIndex}`);
|
|
@@ -7675,7 +7737,7 @@ var NestedDataTable = ({ data, columns }) => {
|
|
|
7675
7737
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "thead", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "tr", { children: SubDataHeaders }) }),
|
|
7676
7738
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "tbody", { children: subDataRows })
|
|
7677
7739
|
] });
|
|
7678
|
-
const rows = !_optionalChain([data, 'optionalAccess',
|
|
7740
|
+
const rows = !_optionalChain([data, 'optionalAccess', _80 => _80.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', _81 => _81.map, 'call', _82 => _82((item, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
7679
7741
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, PrimaryTrRows, { $index: index, children: [
|
|
7680
7742
|
/* @__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" }) }),
|
|
7681
7743
|
HeadColumns.map((column, index2) => {
|
|
@@ -8256,7 +8318,8 @@ var WavelengthMultiSelectAutocomplete = ({ options, placeholder = "Select Option
|
|
|
8256
8318
|
|
|
8257
8319
|
|
|
8258
8320
|
|
|
8259
|
-
|
|
8321
|
+
|
|
8322
|
+
exports.ButtonIcon = ButtonIcon; exports.ButtonMenu = ButtonMenu; exports.ChildDataTable = ChildDataTable2; exports.ChildDataTableElement = _webcomponents.ChildDataTable; exports.DefaultCarousel = DefaultCarousel; exports.NestedDataTable = NestedDataTable; exports.SampleComponent = SampleComponent; exports.SampleComponentElement = _webcomponents.SampleComponent; exports.SliderCardCarousel = SliderCardCarousel; exports.WavelengthAccessAlert = WavelengthAccessAlert; exports.WavelengthAlert = WavelengthAlert; exports.WavelengthAppLogo = WavelengthAppLogo; exports.WavelengthAppTheme = WavelengthAppTheme; exports.WavelengthAutoComplete = WavelengthAutoComplete; exports.WavelengthAutocomplete = WavelengthAutocomplete; exports.WavelengthBanner = WavelengthBanner; exports.WavelengthBannerElement = _webcomponents.WavelengthBanner; exports.WavelengthBox = WavelengthBox; exports.WavelengthButton = WavelengthButton; exports.WavelengthButtonElement = _webcomponents.WavelengthButton; exports.WavelengthCommentDisplay = WavelengthCommentDisplay; exports.WavelengthConfirmationModal = WavelengthConfirmationModal; exports.WavelengthContentModal = WavelengthContentModal; exports.WavelengthContentPlaceholder = WavelengthContentPlaceholder; exports.WavelengthDataTable = WavelengthDataTable; exports.WavelengthDatePicker = WavelengthDatePicker; exports.WavelengthDatePickerElement = _webcomponents.WavelengthDatePicker; exports.WavelengthDefaultIcon = WavelengthDefaultIcon; exports.WavelengthDefaultPagination = WavelengthDefaultPagination; exports.WavelengthDragAndDrop = WavelengthDragAndDrop; exports.WavelengthDropdown = WavelengthDropdown; exports.WavelengthDropdownButton = WavelengthDropdownButton; exports.WavelengthExampleComponent = WavelengthExampleComponent; exports.WavelengthFileDownloader = WavelengthFileDownloader; exports.WavelengthFooter = WavelengthFooter; exports.WavelengthForm = WavelengthForm; exports.WavelengthFormElement = _webcomponents.WavelengthForm; exports.WavelengthInput = WavelengthInput; exports.WavelengthInputElement = _webcomponents.WavelengthInput; exports.WavelengthManyPlanes = WavelengthManyPlanes; exports.WavelengthMultiSelectAutocomplete = WavelengthMultiSelectAutocomplete; exports.WavelengthMultiSelectAutocompleteElement = _webcomponents.WavelengthMultiSelectAutocomplete; exports.WavelengthNavBar = WavelengthNavBar; exports.WavelengthNotAvailablePage = WavelengthNotAvailablePage; exports.WavelengthPermissionAlert = WavelengthPermissionAlert; exports.WavelengthPlaneTrail = WavelengthPlaneTrail; exports.WavelengthPopUpMenu = WavelengthPopUpMenu; exports.WavelengthProgressBar = WavelengthProgressBar; exports.WavelengthProgressBarElement = _webcomponents.WavelengthProgressBar; 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.WavelengthTitleBar = WavelengthTitleBar; exports.WavelengthTitleBarElement = _webcomponents.WavelengthTitleBar; exports.add = add; exports.ascendingRange = ascendingRange; exports.concat = concat; exports.findBestStringMatch = findBestStringMatch; exports.range = range; exports.useOutsideClick = useOutsideClick; exports.useThemeContext = useThemeContext;
|
|
8260
8323
|
/*! Bundled license information:
|
|
8261
8324
|
|
|
8262
8325
|
react-is/cjs/react-is.production.min.js:
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import React__default, { ReactNode, ChangeEvent, ReactElement, CSSProperties as CSSProperties$1 } from 'react';
|
|
3
|
-
export { SampleComponent as SampleComponentElement, WavelengthBanner as WavelengthBannerElement, WavelengthButton as WavelengthButtonElement, WavelengthDatePicker as WavelengthDatePickerElement, WavelengthForm as WavelengthFormElement, WavelengthInput as WavelengthInputElement, WavelengthMultiSelectAutocomplete as WavelengthMultiSelectAutocompleteElement, WavelengthProgressBar as WavelengthProgressBarElement, WavelengthTitleBar as WavelengthTitleBarElement } from '@wavelengthusaf/web-components';
|
|
3
|
+
export { ChildDataTable as ChildDataTableElement, SampleComponent as SampleComponentElement, WavelengthBanner as WavelengthBannerElement, WavelengthButton as WavelengthButtonElement, WavelengthDatePicker as WavelengthDatePickerElement, WavelengthForm as WavelengthFormElement, WavelengthInput as WavelengthInputElement, WavelengthMultiSelectAutocomplete as WavelengthMultiSelectAutocompleteElement, WavelengthProgressBar as WavelengthProgressBarElement, WavelengthTitleBar as WavelengthTitleBarElement } from '@wavelengthusaf/web-components';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
import { TextFieldVariants, SxProps, Theme } from '@mui/material';
|
|
6
6
|
import { z } from 'zod';
|
|
@@ -771,58 +771,36 @@ declare const WavelengthInput: React__default.ForwardRefExoticComponent<Waveleng
|
|
|
771
771
|
validate?: () => boolean;
|
|
772
772
|
}>>;
|
|
773
773
|
|
|
774
|
-
interface DataType$
|
|
774
|
+
interface DataType$1 {
|
|
775
775
|
id: number;
|
|
776
776
|
[key: string]: any;
|
|
777
777
|
}
|
|
778
|
-
interface ColumnProps$
|
|
778
|
+
interface ColumnProps$1<T> {
|
|
779
779
|
key: string;
|
|
780
780
|
title: string | ReactElement;
|
|
781
781
|
width?: string;
|
|
782
782
|
editable?: boolean;
|
|
783
|
-
render?: (column: ColumnProps$
|
|
783
|
+
render?: (column: ColumnProps$1<T>, item: T) => ReactElement;
|
|
784
784
|
}
|
|
785
|
-
type Props$
|
|
786
|
-
columns: Array<ColumnProps$
|
|
785
|
+
type Props$1<T> = {
|
|
786
|
+
columns: Array<ColumnProps$1<T>>;
|
|
787
787
|
data?: T[] | undefined;
|
|
788
788
|
itemsPerPage: number;
|
|
789
789
|
totalPages: number;
|
|
790
790
|
};
|
|
791
791
|
declare const WavelengthDataTable: {
|
|
792
|
-
<T extends DataType$
|
|
792
|
+
<T extends DataType$1>({ data, columns, itemsPerPage, totalPages }: Props$1<T>): react_jsx_runtime.JSX.Element;
|
|
793
793
|
displayName: string;
|
|
794
794
|
};
|
|
795
795
|
|
|
796
|
-
interface
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
fileObjects: fileObject[];
|
|
803
|
-
}
|
|
804
|
-
interface DataType$1 {
|
|
805
|
-
id: number;
|
|
806
|
-
[key: string]: any;
|
|
807
|
-
Details?: Details$1;
|
|
796
|
+
interface ChildDataTableProps extends React__default.HTMLAttributes<HTMLElement> {
|
|
797
|
+
columns?: object;
|
|
798
|
+
data?: object;
|
|
799
|
+
dropdownArrowLocation?: string;
|
|
800
|
+
sortIcon?: string | HTMLElement;
|
|
801
|
+
dropdownButtonIcon?: string | HTMLElement;
|
|
808
802
|
}
|
|
809
|
-
|
|
810
|
-
key: string;
|
|
811
|
-
title: string | ReactElement;
|
|
812
|
-
subDataTableColumn: boolean;
|
|
813
|
-
PrimaryBoldText?: boolean;
|
|
814
|
-
}
|
|
815
|
-
type Props$1<T> = {
|
|
816
|
-
columns: Array<ColumnProps$1>;
|
|
817
|
-
data?: T[] | undefined;
|
|
818
|
-
downloadArrowOnClick?: () => void | Promise<void>;
|
|
819
|
-
downloadMissionOnClick?: () => void | Promise<void>;
|
|
820
|
-
addFilesOnClick?: () => void | Promise<void>;
|
|
821
|
-
};
|
|
822
|
-
declare const ChildDataTable: {
|
|
823
|
-
<T extends DataType$1>({ data, columns, downloadArrowOnClick, downloadMissionOnClick, addFilesOnClick }: Props$1<T>): react_jsx_runtime.JSX.Element;
|
|
824
|
-
displayName: string;
|
|
825
|
-
};
|
|
803
|
+
declare const ChildDataTable: React__default.FC<ChildDataTableProps>;
|
|
826
804
|
|
|
827
805
|
interface Details {
|
|
828
806
|
relationId: number;
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import React__default, { ReactNode, ChangeEvent, ReactElement, CSSProperties as CSSProperties$1 } from 'react';
|
|
3
|
-
export { SampleComponent as SampleComponentElement, WavelengthBanner as WavelengthBannerElement, WavelengthButton as WavelengthButtonElement, WavelengthDatePicker as WavelengthDatePickerElement, WavelengthForm as WavelengthFormElement, WavelengthInput as WavelengthInputElement, WavelengthMultiSelectAutocomplete as WavelengthMultiSelectAutocompleteElement, WavelengthProgressBar as WavelengthProgressBarElement, WavelengthTitleBar as WavelengthTitleBarElement } from '@wavelengthusaf/web-components';
|
|
3
|
+
export { ChildDataTable as ChildDataTableElement, SampleComponent as SampleComponentElement, WavelengthBanner as WavelengthBannerElement, WavelengthButton as WavelengthButtonElement, WavelengthDatePicker as WavelengthDatePickerElement, WavelengthForm as WavelengthFormElement, WavelengthInput as WavelengthInputElement, WavelengthMultiSelectAutocomplete as WavelengthMultiSelectAutocompleteElement, WavelengthProgressBar as WavelengthProgressBarElement, WavelengthTitleBar as WavelengthTitleBarElement } from '@wavelengthusaf/web-components';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
import { TextFieldVariants, SxProps, Theme } from '@mui/material';
|
|
6
6
|
import { z } from 'zod';
|
|
@@ -771,58 +771,36 @@ declare const WavelengthInput: React__default.ForwardRefExoticComponent<Waveleng
|
|
|
771
771
|
validate?: () => boolean;
|
|
772
772
|
}>>;
|
|
773
773
|
|
|
774
|
-
interface DataType$
|
|
774
|
+
interface DataType$1 {
|
|
775
775
|
id: number;
|
|
776
776
|
[key: string]: any;
|
|
777
777
|
}
|
|
778
|
-
interface ColumnProps$
|
|
778
|
+
interface ColumnProps$1<T> {
|
|
779
779
|
key: string;
|
|
780
780
|
title: string | ReactElement;
|
|
781
781
|
width?: string;
|
|
782
782
|
editable?: boolean;
|
|
783
|
-
render?: (column: ColumnProps$
|
|
783
|
+
render?: (column: ColumnProps$1<T>, item: T) => ReactElement;
|
|
784
784
|
}
|
|
785
|
-
type Props$
|
|
786
|
-
columns: Array<ColumnProps$
|
|
785
|
+
type Props$1<T> = {
|
|
786
|
+
columns: Array<ColumnProps$1<T>>;
|
|
787
787
|
data?: T[] | undefined;
|
|
788
788
|
itemsPerPage: number;
|
|
789
789
|
totalPages: number;
|
|
790
790
|
};
|
|
791
791
|
declare const WavelengthDataTable: {
|
|
792
|
-
<T extends DataType$
|
|
792
|
+
<T extends DataType$1>({ data, columns, itemsPerPage, totalPages }: Props$1<T>): react_jsx_runtime.JSX.Element;
|
|
793
793
|
displayName: string;
|
|
794
794
|
};
|
|
795
795
|
|
|
796
|
-
interface
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
fileObjects: fileObject[];
|
|
803
|
-
}
|
|
804
|
-
interface DataType$1 {
|
|
805
|
-
id: number;
|
|
806
|
-
[key: string]: any;
|
|
807
|
-
Details?: Details$1;
|
|
796
|
+
interface ChildDataTableProps extends React__default.HTMLAttributes<HTMLElement> {
|
|
797
|
+
columns?: object;
|
|
798
|
+
data?: object;
|
|
799
|
+
dropdownArrowLocation?: string;
|
|
800
|
+
sortIcon?: string | HTMLElement;
|
|
801
|
+
dropdownButtonIcon?: string | HTMLElement;
|
|
808
802
|
}
|
|
809
|
-
|
|
810
|
-
key: string;
|
|
811
|
-
title: string | ReactElement;
|
|
812
|
-
subDataTableColumn: boolean;
|
|
813
|
-
PrimaryBoldText?: boolean;
|
|
814
|
-
}
|
|
815
|
-
type Props$1<T> = {
|
|
816
|
-
columns: Array<ColumnProps$1>;
|
|
817
|
-
data?: T[] | undefined;
|
|
818
|
-
downloadArrowOnClick?: () => void | Promise<void>;
|
|
819
|
-
downloadMissionOnClick?: () => void | Promise<void>;
|
|
820
|
-
addFilesOnClick?: () => void | Promise<void>;
|
|
821
|
-
};
|
|
822
|
-
declare const ChildDataTable: {
|
|
823
|
-
<T extends DataType$1>({ data, columns, downloadArrowOnClick, downloadMissionOnClick, addFilesOnClick }: Props$1<T>): react_jsx_runtime.JSX.Element;
|
|
824
|
-
displayName: string;
|
|
825
|
-
};
|
|
803
|
+
declare const ChildDataTable: React__default.FC<ChildDataTableProps>;
|
|
826
804
|
|
|
827
805
|
interface Details {
|
|
828
806
|
relationId: number;
|
package/dist/esm/index.js
CHANGED
|
@@ -7568,10 +7568,72 @@ var ChildDataTable = ({ data, columns, downloadArrowOnClick, downloadMissionOnCl
|
|
|
7568
7568
|
};
|
|
7569
7569
|
ChildDataTable.displayName = "ChildDataTable";
|
|
7570
7570
|
|
|
7571
|
+
// src/components/DataTable/SubRowTable/ChildDataTable.tsx
|
|
7572
|
+
import { useRef as useRef11, useEffect as useEffect12 } from "react";
|
|
7573
|
+
import "@wavelengthusaf/web-components";
|
|
7574
|
+
import { createRoot } from "react-dom/client";
|
|
7575
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
7576
|
+
var ChildDataTable2 = ({ columns, data, dropdownArrowLocation, sortIcon, dropdownButtonIcon, ...rest }) => {
|
|
7577
|
+
const tableRef = useRef11(null);
|
|
7578
|
+
const reactDropdownRoots = useRef11(/* @__PURE__ */ new Map());
|
|
7579
|
+
useEffect12(() => {
|
|
7580
|
+
const customChildDataTableElement = tableRef.current;
|
|
7581
|
+
if (!customChildDataTableElement) return;
|
|
7582
|
+
if (columns !== void 0) customChildDataTableElement.setColumns = columns;
|
|
7583
|
+
if (data !== void 0) customChildDataTableElement.setData = data;
|
|
7584
|
+
if (dropdownArrowLocation !== void 0) customChildDataTableElement.setDropdownArrowLocation = dropdownArrowLocation;
|
|
7585
|
+
if (sortIcon !== void 0) customChildDataTableElement.setSortIcon = sortIcon;
|
|
7586
|
+
if (dropdownButtonIcon !== void 0) customChildDataTableElement.setDropdownButtonIcon = dropdownButtonIcon;
|
|
7587
|
+
}, [columns, data, dropdownArrowLocation, sortIcon, dropdownButtonIcon]);
|
|
7588
|
+
useEffect12(() => {
|
|
7589
|
+
const el = tableRef.current;
|
|
7590
|
+
if (!el) return;
|
|
7591
|
+
const handleReactDropdown = (event) => {
|
|
7592
|
+
console.log("handling react dropdown");
|
|
7593
|
+
const customEvent = event;
|
|
7594
|
+
event.stopPropagation();
|
|
7595
|
+
const { container, itemId } = customEvent.detail;
|
|
7596
|
+
let root = reactDropdownRoots.current.get(container);
|
|
7597
|
+
if (!root) {
|
|
7598
|
+
root = createRoot(container);
|
|
7599
|
+
reactDropdownRoots.current.set(container, root);
|
|
7600
|
+
}
|
|
7601
|
+
const item = data?.find((item2) => String(item2.id) === String(itemId));
|
|
7602
|
+
if (item && item.dropdown && root) {
|
|
7603
|
+
root.render(item.dropdown);
|
|
7604
|
+
}
|
|
7605
|
+
const dropdown = container.querySelector("#dropdown");
|
|
7606
|
+
if (dropdown) {
|
|
7607
|
+
dropdown.hidden = false;
|
|
7608
|
+
}
|
|
7609
|
+
};
|
|
7610
|
+
const handleCleanupDropdown = (event) => {
|
|
7611
|
+
event.stopPropagation();
|
|
7612
|
+
const { container } = event.detail;
|
|
7613
|
+
const root = reactDropdownRoots.current.get(container);
|
|
7614
|
+
const dropdown = container.querySelector("#dropdown");
|
|
7615
|
+
if (root && dropdown) {
|
|
7616
|
+
dropdown.hidden = true;
|
|
7617
|
+
}
|
|
7618
|
+
};
|
|
7619
|
+
el.addEventListener("getReactDropdown", handleReactDropdown);
|
|
7620
|
+
el.addEventListener("cleanupDropdown", handleCleanupDropdown);
|
|
7621
|
+
return () => {
|
|
7622
|
+
el.removeEventListener("getReactDropdown", handleReactDropdown);
|
|
7623
|
+
el.removeEventListener("cleanupDropdown", handleCleanupDropdown);
|
|
7624
|
+
};
|
|
7625
|
+
}, [data]);
|
|
7626
|
+
return /* @__PURE__ */ jsx45("wavelength-child-data-table", { ref: tableRef, ...rest });
|
|
7627
|
+
};
|
|
7628
|
+
ChildDataTable2.displayName = "ChildDataTable";
|
|
7629
|
+
|
|
7630
|
+
// src/index.ts
|
|
7631
|
+
import { ChildDataTable as ChildDataTable3 } from "@wavelengthusaf/web-components";
|
|
7632
|
+
|
|
7571
7633
|
// src/components/DataTable/NestedDataTable/NestedDataTable.tsx
|
|
7572
7634
|
import { useState as useState11 } from "react";
|
|
7573
7635
|
import styled12 from "styled-components";
|
|
7574
|
-
import { Fragment as Fragment16, jsx as
|
|
7636
|
+
import { Fragment as Fragment16, jsx as jsx46, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
7575
7637
|
var TableStyle = styled12.table`
|
|
7576
7638
|
width: 100%;
|
|
7577
7639
|
height: 100%;
|
|
@@ -7658,46 +7720,46 @@ var NestedDataTable = ({ data, columns }) => {
|
|
|
7658
7720
|
setPrimaryRowIndex(rowIndex);
|
|
7659
7721
|
};
|
|
7660
7722
|
const headers = HeadColumns.map((column, index) => {
|
|
7661
|
-
return /* @__PURE__ */
|
|
7723
|
+
return /* @__PURE__ */ jsx46(MainThHeaders, { children: column.title }, `headCell-${index}`);
|
|
7662
7724
|
});
|
|
7663
7725
|
const SubDataHeaders = SubDataColumns.map((column, index) => {
|
|
7664
|
-
return /* @__PURE__ */
|
|
7726
|
+
return /* @__PURE__ */ jsx46("th", { children: column.title }, `SubHeadCell-${index}`);
|
|
7665
7727
|
});
|
|
7666
|
-
const subDataRows = !data?.length ? /* @__PURE__ */
|
|
7728
|
+
const subDataRows = !data?.length ? /* @__PURE__ */ jsx46("tr", { children: /* @__PURE__ */ jsx46("td", { title: "NoSubDataRows", colSpan: columns.length, children: "No data" }) }) : data.map((item, index) => /* @__PURE__ */ jsx46(Fragment16, { children: /* @__PURE__ */ jsx46(SubDataTr, { children: SubDataColumns.map((column, colIndex) => {
|
|
7667
7729
|
const columnKey = trimBeforePeriod(column.key);
|
|
7668
7730
|
const value = item.Details?.[columnKey];
|
|
7669
7731
|
console.log("value: ", value);
|
|
7670
7732
|
if (value !== void 0) {
|
|
7671
|
-
return /* @__PURE__ */
|
|
7733
|
+
return /* @__PURE__ */ jsx46("td", { children: /* @__PURE__ */ jsx46("span", { children: value }) }, `Span-${item.id}-${colIndex}`);
|
|
7672
7734
|
}
|
|
7673
7735
|
}) }, `Sub-${item.id}-${index}`) }));
|
|
7674
7736
|
const childRows = /* @__PURE__ */ jsxs32(SubTableStyle, { children: [
|
|
7675
|
-
/* @__PURE__ */
|
|
7676
|
-
/* @__PURE__ */
|
|
7737
|
+
/* @__PURE__ */ jsx46("thead", { children: /* @__PURE__ */ jsx46("tr", { children: SubDataHeaders }) }),
|
|
7738
|
+
/* @__PURE__ */ jsx46("tbody", { children: subDataRows })
|
|
7677
7739
|
] });
|
|
7678
|
-
const rows = !data?.length ? /* @__PURE__ */
|
|
7740
|
+
const rows = !data?.length ? /* @__PURE__ */ jsx46("tr", { children: /* @__PURE__ */ jsx46("td", { title: "NoDataRows", colSpan: columns.length, children: "No data" }) }) : data?.map((item, index) => /* @__PURE__ */ jsxs32(Fragment16, { children: [
|
|
7679
7741
|
/* @__PURE__ */ jsxs32(PrimaryTrRows, { $index: index, children: [
|
|
7680
|
-
/* @__PURE__ */
|
|
7742
|
+
/* @__PURE__ */ jsx46(DropdownButton, { onClick: () => toggleDropdown(index), children: isAscending && isOpen && primaryRowIndex === index ? /* @__PURE__ */ jsx46(Fragment16, { children: "\u2227" }) : /* @__PURE__ */ jsx46(Fragment16, { children: "\u2228" }) }),
|
|
7681
7743
|
HeadColumns.map((column, index2) => {
|
|
7682
|
-
return /* @__PURE__ */
|
|
7744
|
+
return /* @__PURE__ */ jsx46(PrimaryTdSpan, { children: /* @__PURE__ */ jsx46("span", { title: `spanRow-${item.id}-${column.key}-${index2}`, children: item[column.key] }) }, `${item.id}-${index}=${index2}`);
|
|
7683
7745
|
})
|
|
7684
7746
|
] }, index),
|
|
7685
|
-
isOpen && primaryRowIndex === index && /* @__PURE__ */
|
|
7747
|
+
isOpen && primaryRowIndex === index && /* @__PURE__ */ jsx46(SubTrRows, { $index: index, children: /* @__PURE__ */ jsx46("td", { colSpan: HeadColumns.length + 1, children: childRows }) }, index)
|
|
7686
7748
|
] }));
|
|
7687
|
-
return /* @__PURE__ */
|
|
7688
|
-
/* @__PURE__ */
|
|
7689
|
-
/* @__PURE__ */
|
|
7749
|
+
return /* @__PURE__ */ jsx46("div", { children: /* @__PURE__ */ jsxs32(TableStyle, { children: [
|
|
7750
|
+
/* @__PURE__ */ jsx46("thead", { children: /* @__PURE__ */ jsxs32("tr", { children: [
|
|
7751
|
+
/* @__PURE__ */ jsx46("th", { title: "dropdownth" }),
|
|
7690
7752
|
headers
|
|
7691
7753
|
] }) }),
|
|
7692
|
-
/* @__PURE__ */
|
|
7754
|
+
/* @__PURE__ */ jsx46("tbody", { children: rows })
|
|
7693
7755
|
] }) });
|
|
7694
7756
|
};
|
|
7695
7757
|
NestedDataTable.displayName = "NestedDataTable";
|
|
7696
7758
|
|
|
7697
7759
|
// src/components/AutoComplete/WavelengthAutoComplete.tsx
|
|
7698
|
-
import { useEffect as
|
|
7760
|
+
import { useEffect as useEffect13, useRef as useRef13, useState as useState12 } from "react";
|
|
7699
7761
|
import styled13 from "styled-components";
|
|
7700
|
-
import { Fragment as Fragment17, jsx as
|
|
7762
|
+
import { Fragment as Fragment17, jsx as jsx47, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
7701
7763
|
var AutoContainer = styled13.div`
|
|
7702
7764
|
//position: relative;
|
|
7703
7765
|
position: relative;
|
|
@@ -7826,9 +7888,9 @@ var WavelengthAutoComplete = ({
|
|
|
7826
7888
|
placeholder,
|
|
7827
7889
|
onBlurCallback
|
|
7828
7890
|
}) => {
|
|
7829
|
-
const inputRef =
|
|
7830
|
-
const listRef =
|
|
7831
|
-
const noItemListRef =
|
|
7891
|
+
const inputRef = useRef13(null);
|
|
7892
|
+
const listRef = useRef13(null);
|
|
7893
|
+
const noItemListRef = useRef13(null);
|
|
7832
7894
|
const [inputValue, setInputValue] = useState12(placeholder ?? "");
|
|
7833
7895
|
const [suggestions, setSuggestions] = useState12([]);
|
|
7834
7896
|
const [isDropdownVisible, setIsDropdownVisible] = useState12(false);
|
|
@@ -7836,7 +7898,7 @@ var WavelengthAutoComplete = ({
|
|
|
7836
7898
|
const arrayLength = suggestions.length;
|
|
7837
7899
|
const [focusedIndex, setFocusedIndex] = useState12(0);
|
|
7838
7900
|
const idName = id ? id : "auto-comp";
|
|
7839
|
-
|
|
7901
|
+
useEffect13(() => {
|
|
7840
7902
|
const handleClickOutsideList = (event) => {
|
|
7841
7903
|
if (listRef.current && !listRef.current.contains(event.target)) {
|
|
7842
7904
|
setIsDropdownVisible(false);
|
|
@@ -7848,7 +7910,7 @@ var WavelengthAutoComplete = ({
|
|
|
7848
7910
|
};
|
|
7849
7911
|
}, [focusedIndex]);
|
|
7850
7912
|
if (onDataChange !== void 0) {
|
|
7851
|
-
|
|
7913
|
+
useEffect13(() => {
|
|
7852
7914
|
onDataChange(inputValue);
|
|
7853
7915
|
}, [inputValue]);
|
|
7854
7916
|
}
|
|
@@ -7914,9 +7976,9 @@ var WavelengthAutoComplete = ({
|
|
|
7914
7976
|
break;
|
|
7915
7977
|
}
|
|
7916
7978
|
};
|
|
7917
|
-
return /* @__PURE__ */
|
|
7979
|
+
return /* @__PURE__ */ jsx47(Fragment17, { children: /* @__PURE__ */ jsxs33(AutoContainer, { $inputHeight: height2, $inputWidth: width2, children: [
|
|
7918
7980
|
/* @__PURE__ */ jsxs33(InputWrapper, { id: `${idName}-input-wrapper`, $inputHeight: height2, $inputWidth: width2, children: [
|
|
7919
|
-
/* @__PURE__ */
|
|
7981
|
+
/* @__PURE__ */ jsx47(
|
|
7920
7982
|
Input,
|
|
7921
7983
|
{
|
|
7922
7984
|
id: idName,
|
|
@@ -7945,11 +8007,11 @@ var WavelengthAutoComplete = ({
|
|
|
7945
8007
|
autoComplete: "off"
|
|
7946
8008
|
}
|
|
7947
8009
|
),
|
|
7948
|
-
/* @__PURE__ */
|
|
8010
|
+
/* @__PURE__ */ jsx47(Label, { id: `${idName}-label`, htmlFor: idName, children: floatLabel })
|
|
7949
8011
|
] }),
|
|
7950
|
-
isDropdownVisible && /* @__PURE__ */
|
|
8012
|
+
isDropdownVisible && /* @__PURE__ */ jsx47(DropDownList, { id: `${idName}-drop-list`, ref: listRef, $inputWidth: width2, "data-testid": "InputSearchOptionsList", children: suggestHasItems ? (
|
|
7951
8013
|
//suggestions length controls showing the suggestions
|
|
7952
|
-
suggestions.map((item, index) => /* @__PURE__ */
|
|
8014
|
+
suggestions.map((item, index) => /* @__PURE__ */ jsx47(
|
|
7953
8015
|
ActiveListItem,
|
|
7954
8016
|
{
|
|
7955
8017
|
"data-testid": `${idName}-input-search-list-${index + 1}`,
|
|
@@ -7962,15 +8024,15 @@ var WavelengthAutoComplete = ({
|
|
|
7962
8024
|
},
|
|
7963
8025
|
`active-list-item-${item}-${index}`
|
|
7964
8026
|
))
|
|
7965
|
-
) : /* @__PURE__ */
|
|
8027
|
+
) : /* @__PURE__ */ jsx47(NoHoverListItem, { "data-testid": "NoOptionsListitem", ref: noItemListRef, id: "No-Option-List-item", onMouseDown: (e) => e.preventDefault(), children: "No Options found" }) })
|
|
7966
8028
|
] }) });
|
|
7967
8029
|
};
|
|
7968
8030
|
WavelengthAutoComplete.displayName = "WavelengthAutoComplete";
|
|
7969
8031
|
|
|
7970
8032
|
// src/components/inputs/WavelengthDatePicker.tsx
|
|
7971
|
-
import { useEffect as
|
|
8033
|
+
import { useEffect as useEffect14, useState as useState13 } from "react";
|
|
7972
8034
|
import styled14 from "styled-components";
|
|
7973
|
-
import { jsx as
|
|
8035
|
+
import { jsx as jsx48, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
7974
8036
|
var Label2 = styled14.label`
|
|
7975
8037
|
position: absolute;
|
|
7976
8038
|
top: 50%;
|
|
@@ -8041,7 +8103,7 @@ var WavelengthDatePicker = ({
|
|
|
8041
8103
|
const [minAdjusted, setMinAdjusted] = useState13("");
|
|
8042
8104
|
const [maxAdjusted, setMaxAdjusted] = useState13("");
|
|
8043
8105
|
const idName = id ? id : "WlDatePick";
|
|
8044
|
-
|
|
8106
|
+
useEffect14(() => {
|
|
8045
8107
|
const minDate = new Date(min || "");
|
|
8046
8108
|
const maxDate = new Date(max || "");
|
|
8047
8109
|
if (inputTimeType === "datetime-local") {
|
|
@@ -8092,7 +8154,7 @@ var WavelengthDatePicker = ({
|
|
|
8092
8154
|
$FocusLabelColor: FocusLabelColor,
|
|
8093
8155
|
$inputBackGroundColor: backgroundColor2,
|
|
8094
8156
|
children: [
|
|
8095
|
-
/* @__PURE__ */
|
|
8157
|
+
/* @__PURE__ */ jsx48(
|
|
8096
8158
|
"input",
|
|
8097
8159
|
{
|
|
8098
8160
|
type: inputType,
|
|
@@ -8113,7 +8175,7 @@ var WavelengthDatePicker = ({
|
|
|
8113
8175
|
max: maxAdjusted
|
|
8114
8176
|
}
|
|
8115
8177
|
),
|
|
8116
|
-
/* @__PURE__ */
|
|
8178
|
+
/* @__PURE__ */ jsx48(Label2, { id: `${idName}-label`, htmlFor: idName, children: floatLabel })
|
|
8117
8179
|
]
|
|
8118
8180
|
}
|
|
8119
8181
|
);
|
|
@@ -8124,8 +8186,8 @@ WavelengthDatePicker.displayName = "WavelengthDatePicker";
|
|
|
8124
8186
|
import { WavelengthDatePicker as WavelengthDatePicker2 } from "@wavelengthusaf/web-components";
|
|
8125
8187
|
|
|
8126
8188
|
// src/components/samples/SampleComponent.tsx
|
|
8127
|
-
import { useRef as
|
|
8128
|
-
import { jsx as
|
|
8189
|
+
import { useRef as useRef14, useEffect as useEffect15 } from "react";
|
|
8190
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
8129
8191
|
var SampleComponent = ({
|
|
8130
8192
|
testProp,
|
|
8131
8193
|
children,
|
|
@@ -8134,8 +8196,8 @@ var SampleComponent = ({
|
|
|
8134
8196
|
...rest
|
|
8135
8197
|
// This rest operator includes className, style, onClick, etc.
|
|
8136
8198
|
}) => {
|
|
8137
|
-
const ref =
|
|
8138
|
-
|
|
8199
|
+
const ref = useRef14(null);
|
|
8200
|
+
useEffect15(() => {
|
|
8139
8201
|
const el = ref.current;
|
|
8140
8202
|
if (!el) return;
|
|
8141
8203
|
el.customStyles = customStyle2;
|
|
@@ -8143,7 +8205,7 @@ var SampleComponent = ({
|
|
|
8143
8205
|
el.setAttribute("test-prop", testProp);
|
|
8144
8206
|
}
|
|
8145
8207
|
}, [testProp]);
|
|
8146
|
-
return /* @__PURE__ */
|
|
8208
|
+
return /* @__PURE__ */ jsx49("sample-component", { ref, ...rest, children });
|
|
8147
8209
|
};
|
|
8148
8210
|
SampleComponent.displayName = "SampleComponent";
|
|
8149
8211
|
|
|
@@ -8151,11 +8213,11 @@ SampleComponent.displayName = "SampleComponent";
|
|
|
8151
8213
|
import { SampleComponent as SampleComponent2 } from "@wavelengthusaf/web-components";
|
|
8152
8214
|
|
|
8153
8215
|
// src/components/MultiSelect/WavelengthMultiSelectAutocomplete.tsx
|
|
8154
|
-
import { useEffect as
|
|
8155
|
-
import { jsx as
|
|
8216
|
+
import { useEffect as useEffect16, useRef as useRef15 } from "react";
|
|
8217
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
8156
8218
|
var WavelengthMultiSelectAutocomplete = ({ options, placeholder = "Select Options", label, name, style: style3, onChange, value, ...rest }) => {
|
|
8157
|
-
const componentRef =
|
|
8158
|
-
|
|
8219
|
+
const componentRef = useRef15(null);
|
|
8220
|
+
useEffect16(() => {
|
|
8159
8221
|
const component = componentRef.current;
|
|
8160
8222
|
if (!component) return;
|
|
8161
8223
|
const handleValueChange = (event) => {
|
|
@@ -8168,7 +8230,7 @@ var WavelengthMultiSelectAutocomplete = ({ options, placeholder = "Select Option
|
|
|
8168
8230
|
component.removeEventListener("change", handleValueChange);
|
|
8169
8231
|
};
|
|
8170
8232
|
}, [onChange]);
|
|
8171
|
-
|
|
8233
|
+
useEffect16(() => {
|
|
8172
8234
|
const component = componentRef.current;
|
|
8173
8235
|
if (!component) return;
|
|
8174
8236
|
if (placeholder) component.setAttribute("placeholder", placeholder);
|
|
@@ -8177,13 +8239,13 @@ var WavelengthMultiSelectAutocomplete = ({ options, placeholder = "Select Option
|
|
|
8177
8239
|
if (options) component.autocompleteOptions = options;
|
|
8178
8240
|
if (style3) component.customStyles = style3;
|
|
8179
8241
|
}, [options, placeholder, name, label, style3]);
|
|
8180
|
-
|
|
8242
|
+
useEffect16(() => {
|
|
8181
8243
|
const component = componentRef.current;
|
|
8182
8244
|
if (component && value) {
|
|
8183
8245
|
component.value = value;
|
|
8184
8246
|
}
|
|
8185
8247
|
}, [value]);
|
|
8186
|
-
return /* @__PURE__ */
|
|
8248
|
+
return /* @__PURE__ */ jsx50("wavelength-multi-select-autocomplete", { ref: componentRef, ...rest });
|
|
8187
8249
|
};
|
|
8188
8250
|
|
|
8189
8251
|
// src/index.ts
|
|
@@ -8191,7 +8253,8 @@ import { WavelengthMultiSelectAutocomplete as WavelengthMultiSelectAutocomplete2
|
|
|
8191
8253
|
export {
|
|
8192
8254
|
ButtonIcon,
|
|
8193
8255
|
ButtonMenu,
|
|
8194
|
-
ChildDataTable,
|
|
8256
|
+
ChildDataTable2 as ChildDataTable,
|
|
8257
|
+
ChildDataTable3 as ChildDataTableElement,
|
|
8195
8258
|
DefaultCarousel,
|
|
8196
8259
|
NestedDataTable,
|
|
8197
8260
|
SampleComponent,
|
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": "4.2.
|
|
5
|
+
"version": "4.2.1",
|
|
6
6
|
"description": "Common component library used by Wavelength developers",
|
|
7
7
|
"main": "/dist/cjs/index.cjs",
|
|
8
8
|
"module": "/dist/esm/index.js",
|
|
@@ -42,6 +42,11 @@
|
|
|
42
42
|
"directories": {
|
|
43
43
|
"test": "jest"
|
|
44
44
|
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"react-dom": "^18.0.0",
|
|
47
|
+
"react": "^18.0.0"
|
|
48
|
+
},
|
|
49
|
+
|
|
45
50
|
"devDependencies": {
|
|
46
51
|
"@babel/preset-typescript": "^7.25.7",
|
|
47
52
|
"@testing-library/react": "^16.0.0",
|
|
@@ -67,7 +72,7 @@
|
|
|
67
72
|
"@emotion/styled": "^11.11.0",
|
|
68
73
|
"@mui/icons-material": "^5.16.5",
|
|
69
74
|
"@mui/material": "^5.15.7",
|
|
70
|
-
"@wavelengthusaf/web-components": "^1.
|
|
75
|
+
"@wavelengthusaf/web-components": "^1.3.1",
|
|
71
76
|
"react": "^18.2.0",
|
|
72
77
|
"react-router-dom": "^6.26.2",
|
|
73
78
|
"styled-components": "^6.1.12",
|