@equinor/echo-components 0.11.16 → 0.11.17
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/index.cjs.js +1 -1
- package/package.json +1 -1
- package/src/components/iconLink/compactIconLink/CompactIconLink.d.ts +1 -1
- package/src/components/index.d.ts +2 -0
- package/src/components/itemMarker/MultipleItemMarkers.d.ts +7 -7
- package/src/components/itemMarkerPopover/itemMarkerPopover.d.ts +1 -2
- package/src/components/legend/layerLegend/LayerLegend.d.ts +5 -1
- package/src/components/legendChip/legendChip.d.ts +4 -2
- package/src/components/legendSelector/legendSelector.d.ts +18 -9
- package/src/components/legendSelector/useVisibleLegends.d.ts +9 -0
- package/src/components/legendSelectorAccordion/legendSelectorAccordion.d.ts +20 -0
- package/src/components/legendSelectorMenu/legendSelectorMenu.d.ts +12 -6
- package/src/components/noDataLabel/NoDataLabel.d.ts +6 -0
- package/src/components/noDataLabel/index.d.ts +1 -0
- package/src/elements/tagIcon/TagIconShadow.d.ts +1 -1
- package/src/icons/echoAssets/index.d.ts +1 -2
- package/src/icons/echoAssets/maps.d.ts +1 -0
- package/src/icons/echoAssets/markerIcons.d.ts +7 -0
- package/src/utils/index.d.ts +1 -0
- package/src/utils/string.d.ts +1 -0
- package/src/__mocks__/svgrMock.d.ts +0 -3
- package/src/icons/echoAssets/legendMarker.d.ts +0 -2
package/package.json
CHANGED
|
@@ -30,12 +30,14 @@ export * from './itemMarkerPopover/itemMarkerPopover';
|
|
|
30
30
|
export * from './legend';
|
|
31
31
|
export * from './legendChip/legendChip';
|
|
32
32
|
export * from './legendSelector/legendSelector';
|
|
33
|
+
export * from './legendSelectorAccordion/legendSelectorAccordion';
|
|
33
34
|
export * from './legendSelectorMenu/legendSelectorMenu';
|
|
34
35
|
export * from './linkIcon/LinkIcon';
|
|
35
36
|
export * from './listItem';
|
|
36
37
|
export * from './listRow/ListRow';
|
|
37
38
|
export * from './markedContent/MarkedContent';
|
|
38
39
|
export * from './multilineTabs/MultilineTabs';
|
|
40
|
+
export * from './noDataLabel';
|
|
39
41
|
export * from './notificationListItem/NotificationListItem';
|
|
40
42
|
export * from './pcMatrix/PCMatrix';
|
|
41
43
|
export * from './rightPanel';
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { ItemMarkerPosition } from './utils/itemMarkerUtils';
|
|
3
|
-
export interface MultipleItemMarkersProps {
|
|
4
|
-
children: ReactNode;
|
|
5
|
-
isTransparent?: boolean;
|
|
6
|
-
pointerPosition?: ItemMarkerPosition;
|
|
7
|
-
className?: string;
|
|
8
|
-
onClick?: () => void;
|
|
9
|
-
}
|
|
10
3
|
/**
|
|
11
4
|
* Generic component that renders multiple item markers
|
|
12
5
|
*
|
|
@@ -19,4 +12,11 @@ export interface MultipleItemMarkersProps {
|
|
|
19
12
|
*
|
|
20
13
|
* @returns {JSX.Element} The rendered component
|
|
21
14
|
*/
|
|
15
|
+
export interface MultipleItemMarkersProps {
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
isTransparent?: boolean;
|
|
18
|
+
pointerPosition?: ItemMarkerPosition;
|
|
19
|
+
className?: string;
|
|
20
|
+
onClick?: () => void;
|
|
21
|
+
}
|
|
22
22
|
export declare const MultipleItemMarkers: React.FC<MultipleItemMarkersProps>;
|
|
@@ -3,7 +3,6 @@ export type ItemMarkerPopover = {
|
|
|
3
3
|
items: JSX.Element[] | string[];
|
|
4
4
|
isOpen: boolean;
|
|
5
5
|
handleClose: () => void;
|
|
6
|
-
togglePopover: () => void;
|
|
7
6
|
title: string;
|
|
8
7
|
closeOnOutsideClick?: boolean;
|
|
9
8
|
containerHasMultipleItemMarkers?: boolean;
|
|
@@ -11,4 +10,4 @@ export type ItemMarkerPopover = {
|
|
|
11
10
|
className?: string;
|
|
12
11
|
style?: CSSProperties;
|
|
13
12
|
};
|
|
14
|
-
export declare const ItemMarkerPopover: ({ items, isOpen, handleClose,
|
|
13
|
+
export declare const ItemMarkerPopover: ({ items, isOpen, handleClose, title, containerHasMultipleItemMarkers, zIndex, className, style }: ItemMarkerPopover) => false | import("react/jsx-runtime").JSX.Element;
|
|
@@ -24,6 +24,10 @@ interface LayerLegendProps {
|
|
|
24
24
|
* Used to disable layer legend usage
|
|
25
25
|
*/
|
|
26
26
|
disabled?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* If the layer is currently hidden
|
|
29
|
+
*/
|
|
30
|
+
layerIsHidden?: boolean;
|
|
27
31
|
/**
|
|
28
32
|
* Styling for the content of the legend
|
|
29
33
|
*/
|
|
@@ -33,5 +37,5 @@ interface LayerLegendProps {
|
|
|
33
37
|
*/
|
|
34
38
|
className?: string;
|
|
35
39
|
}
|
|
36
|
-
declare function LayerLegend({ title, iconName, itemsCount, itemsTitle, children, disabled, style, className }: LayerLegendProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
declare function LayerLegend({ title, iconName, itemsCount, itemsTitle, children, disabled, layerIsHidden, style, className }: LayerLegendProps): import("react/jsx-runtime").JSX.Element;
|
|
37
41
|
export { LayerLegend };
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
interface LegendChipProps {
|
|
2
|
+
export interface LegendChipProps {
|
|
3
3
|
legendStatus: string;
|
|
4
4
|
backgroundColor: string;
|
|
5
|
+
disabled?: boolean;
|
|
5
6
|
onClick?: (isDisabled: boolean) => void;
|
|
6
7
|
}
|
|
7
8
|
/**
|
|
8
9
|
* Legend chip component to display a legend status chip.
|
|
9
10
|
* @param {string} legend - The legend status to be displayed.
|
|
10
11
|
* @param {string} backgroundColor - The background color of the chip.
|
|
12
|
+
* @param {boolean} disabled - Boolean to disable the chip. Optional.
|
|
11
13
|
* @param {(isDisabled: boolean) => void} onClick - Function to be called when the chip is clicked.
|
|
14
|
+
* @returns {JSX.Element} - Legend chip component.
|
|
12
15
|
*/
|
|
13
16
|
export declare const LegendChip: React.FC<LegendChipProps>;
|
|
14
|
-
export {};
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { LegendChipProps } from '../legendChip/legendChip';
|
|
2
3
|
export interface LegendSelectorProps {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
legends:
|
|
7
|
-
|
|
4
|
+
options: string[];
|
|
5
|
+
selectedOption: string;
|
|
6
|
+
onOptionClick: () => void;
|
|
7
|
+
legends: LegendChipProps[];
|
|
8
|
+
showLegendToggle?: boolean;
|
|
9
|
+
visual?: JSX.Element;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
disabled?: boolean;
|
|
8
12
|
}
|
|
9
13
|
/**
|
|
10
14
|
* Legend selector component that will display the selected legend type and the statuses.
|
|
11
|
-
*
|
|
12
|
-
* @param {
|
|
13
|
-
* @param {
|
|
15
|
+
* Note that this component is meant to be displayed on a darker background, and should be used with the LegendSelectorAccordion as display in the LegendSelector story in the storybook.
|
|
16
|
+
* @param {JSX.Element[]} options - List of options to be displayed in the selection-selector.
|
|
17
|
+
* @param {string} selectedOption - The selected option.
|
|
18
|
+
* @param {() => void} onOptionsClick - Function that is called when another option is clicked.
|
|
14
19
|
* @param {JSX.Element[]} legends - List of legend chip components to be displayed.
|
|
15
|
-
* @param {
|
|
20
|
+
* @param {boolean} showLegendToggle - Boolean to show the legend toggle button. Optional.
|
|
21
|
+
* @param {JSX.Element} visual - Visual or icon to be displayed before the legend selector. Optional.
|
|
22
|
+
* @param {string} placeholder - Placeholder text to be displayed when no selection is selected. Optional.
|
|
23
|
+
* @param {boolean} disabled - Boolean to disable the legend selector. Optional.
|
|
24
|
+
* @returns {JSX.Element} - Legend selector component.
|
|
16
25
|
*/
|
|
17
26
|
export declare const LegendSelector: React.FC<LegendSelectorProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LegendChipProps } from '../legendChip/legendChip';
|
|
2
|
+
/**
|
|
3
|
+
* Hook that returns the visible legends based on the available width.
|
|
4
|
+
* @param {boolean} showAllLegends - Boolean to show all legends.
|
|
5
|
+
* @param {LegendChipProps[]} legends - Array of legends.
|
|
6
|
+
* @param {number} availableWidth - The available width for showing the legends, in px.
|
|
7
|
+
* @returns {LegendChipProps[]} - Array of visible legends.
|
|
8
|
+
*/
|
|
9
|
+
export declare const useVisibleLegends: (showAllLegends: boolean, legends: LegendChipProps[], availableWidth: number) => LegendChipProps[];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface LegendSelectorAccordionProps {
|
|
3
|
+
title: string;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
visual?: JSX.Element;
|
|
6
|
+
caption?: string;
|
|
7
|
+
actions?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Legend selector accordion component to display the legend selector for the data layers.
|
|
11
|
+
* This component is meant to be used as a wrapper and consumes the LegendSelector, LegendSelectorMenu and/or LegendChip
|
|
12
|
+
* in the combinations that might be needed.
|
|
13
|
+
* @param {string} title - The title of the accordion/type of legend.
|
|
14
|
+
* @param {React.ReactNode} children - The children to be displayed in the accordion.
|
|
15
|
+
* @param {JSX.Element} visual - The visual or icon to be displayed in the accordion header. Optional.
|
|
16
|
+
* @param {string} caption - The caption to be displayed in the accordion header. Optional.
|
|
17
|
+
* @param {React.ReactNode} actions - The actions to be displayed in the accordion header. Optional.
|
|
18
|
+
* @returns {JSX.Element} - Legend selector accordion component.
|
|
19
|
+
*/
|
|
20
|
+
export declare const LegendSelectorAccordion: React.FC<LegendSelectorAccordionProps>;
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface LegendSelectorMenuProps {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
options: string[];
|
|
4
|
+
selectedOption: string;
|
|
5
|
+
onOptionClick: (selectedItem: string) => void;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
disabled?: boolean;
|
|
6
8
|
}
|
|
7
9
|
/**
|
|
8
10
|
* Legend selector component to choose which legend type to display.
|
|
9
|
-
*
|
|
10
|
-
* @param {
|
|
11
|
-
* @param {
|
|
11
|
+
* This component is part of the LegendSelector, but can be used on it's own when needed.
|
|
12
|
+
* @param {JSX.Element[]} options- List of items to be displayed in the menu.
|
|
13
|
+
* @param {string} selectedOption- The selected item.
|
|
14
|
+
* @param {() => void} onOptionClick - Function that is called when another option is clicked.
|
|
15
|
+
* @param {string} placeholder - Placeholder text to be displayed when no item is selected. Optional.
|
|
16
|
+
* @param {boolean} disabled - Boolean to disable the menu. Optional.
|
|
17
|
+
* @returns {JSX.Element} - Legend selector menu component.
|
|
12
18
|
*/
|
|
13
19
|
export declare const LegendSelectorMenu: React.FC<LegendSelectorMenuProps>;
|
|
14
20
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NoDataLabel';
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
export * from './badges';
|
|
2
2
|
export * from './external';
|
|
3
3
|
export * from './general';
|
|
4
|
-
export * from './legendMarker';
|
|
5
|
-
export * from './legendMarkerChip';
|
|
6
4
|
export * from './maps';
|
|
5
|
+
export * from './markerIcons';
|
|
7
6
|
export * from './misc';
|
|
8
7
|
export * from './notifications';
|
|
9
8
|
export * from './punches';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IconData } from '@equinor/eds-icons';
|
|
2
|
+
export declare const marker_fill: IconData;
|
|
3
|
+
export declare const marker_stroke: IconData;
|
|
4
|
+
export declare const marker_icon: IconData;
|
|
5
|
+
export declare const badges: IconData;
|
|
6
|
+
export declare const badges_first: IconData;
|
|
7
|
+
export declare const badges_second: IconData;
|
package/src/utils/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function removeLeadingZeros(inputString: string): string;
|