@opengeoweb/shared 19.3.0 → 19.4.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.
package/dist/index.esm.js
CHANGED
|
@@ -5,7 +5,7 @@ import { initReactI18next, useTranslation } from 'react-i18next';
|
|
|
5
5
|
import React, { useRef, useEffect, useState, Component } from 'react';
|
|
6
6
|
import Draggable from 'react-draggable';
|
|
7
7
|
import { Resizable } from 're-resizable';
|
|
8
|
-
import { Resize, BORDER_RADIUS, Options, Close, ChevronLeft, Exclamation, Success, Info, ChevronRight, GeoWebLogo, HamburgerMenu, Admin, useThemeContext, ThemeTypes, ArrowLeft, ArrowRight, KeyOption, ArrowUp, ArrowDown, KeyCommand, ChevronDown, Search, Clear, Cached, Filter as Filter$1 } from '@opengeoweb/theme';
|
|
8
|
+
import { Resize, BORDER_RADIUS, Options, Close, ChevronLeft, Exclamation, Success, Info, ChevronRight, GeoWebLogo, HamburgerMenu, Admin, useThemeContext, ThemeTypes, ArrowLeft, ArrowRight, KeyOption, ArrowUp, ArrowDown, KeyCommand, ChevronDown, Search, Clear, Cached, Filter as Filter$1, Menu as Menu$1 } from '@opengeoweb/theme';
|
|
9
9
|
import { throttle, isEqual, merge, escapeRegExp, debounce } from 'lodash';
|
|
10
10
|
import { add as add$1, startOfDay, addMinutes, addHours, format, differenceInDays as differenceInDays$1, differenceInHours as differenceInHours$1, differenceInMinutes as differenceInMinutes$1, differenceInMonths as differenceInMonths$1, differenceInSeconds as differenceInSeconds$1, differenceInYears as differenceInYears$1, fromUnixTime, getHours as getHours$1, isAfter as isAfter$1, isBefore as isBefore$1, isEqual as isEqual$1, isValid as isValid$1, parseISO, roundToNearestMinutes as roundToNearestMinutes$1, set as set$1, setSeconds as setSeconds$1, parse, sub as sub$1, getUnixTime, getDay, getDayOfYear, getMonth, getWeek, getYear, isWithinInterval } from 'date-fns';
|
|
11
11
|
import { fi as fi$1, nl as nl$1, nb, enGB } from 'date-fns/locale';
|
|
@@ -5240,6 +5240,38 @@ var FilterOption = function FilterOption(_ref) {
|
|
|
5240
5240
|
});
|
|
5241
5241
|
};
|
|
5242
5242
|
|
|
5243
|
+
var LegendToggleButton = function LegendToggleButton(_ref) {
|
|
5244
|
+
var isLegendVisible = _ref.isLegendVisible,
|
|
5245
|
+
onToggle = _ref.onToggle,
|
|
5246
|
+
showTooltipText = _ref.showTooltipText,
|
|
5247
|
+
hideTooltipText = _ref.hideTooltipText,
|
|
5248
|
+
legendLabel = _ref.legendLabel,
|
|
5249
|
+
sx = _ref.sx;
|
|
5250
|
+
return jsx(CustomTooltip, {
|
|
5251
|
+
title: isLegendVisible ? hideTooltipText : showTooltipText,
|
|
5252
|
+
children: jsxs(CustomToggleButton, {
|
|
5253
|
+
"aria-label": isLegendVisible ? hideTooltipText : showTooltipText,
|
|
5254
|
+
onClick: onToggle,
|
|
5255
|
+
selected: isLegendVisible,
|
|
5256
|
+
size: "small",
|
|
5257
|
+
sx: [{
|
|
5258
|
+
height: '10px !important',
|
|
5259
|
+
'& span': {
|
|
5260
|
+
fontSize: '9pt',
|
|
5261
|
+
whiteSpace: 'nowrap',
|
|
5262
|
+
textOverflow: 'ellipsis',
|
|
5263
|
+
overflow: 'hidden'
|
|
5264
|
+
}
|
|
5265
|
+
}].concat(Array.isArray(sx) ? sx : [sx]),
|
|
5266
|
+
variant: "tool",
|
|
5267
|
+
children: [jsx(Menu$1, {}), jsx("span", {
|
|
5268
|
+
className: "longText",
|
|
5269
|
+
children: legendLabel
|
|
5270
|
+
})]
|
|
5271
|
+
})
|
|
5272
|
+
});
|
|
5273
|
+
};
|
|
5274
|
+
|
|
5243
5275
|
var _excluded = ["isDark", "children", "sx"];
|
|
5244
5276
|
var StorybookDocsWrapper = function StorybookDocsWrapper(_ref) {
|
|
5245
5277
|
var _ref$isDark = _ref.isDark,
|
|
@@ -6495,4 +6527,4 @@ var SystemScope = {
|
|
|
6495
6527
|
plugin: 'plugin'
|
|
6496
6528
|
};
|
|
6497
6529
|
|
|
6498
|
-
export { AlertBanner, AlertIcon, AppHeader, AppLayout, Avatar, CanvasComponent, ConfirmationButtons, ConfirmationDialog, ConfirmationServiceProvider, CustomAccordion, CustomDialog, CustomDialogHeader, CustomIconButton, CustomSlider, CustomToggleButton, CustomTooltip, DEBOUNCE_TIMEOUT, DEFAULT_ERROR_MESSAGE, DEFAULT_FILTER_HEIGHT, DraggableComponent$1 as Draggable, ErrorBoundary, Filter, FilterChip, FilterOption, LastUpdateTime, PROJECTION, ResizeComponent as Resizable, SHARED_NAMESPACE, SearchField$1 as SearchField, SearchFieldButton, SearchHighlight, SessionStorageKey, StatusTag, StorybookDocsWrapper, StyledSelect, SwitchButton, SystemScope, ToggleMenu, ToolContainer, DraggableComponent as ToolContainerDraggable, ToolFooter, ToolHeader, TooltipSelect, UserMenu, UserMenuItemCheatSheet, MenuItemTheme as UserMenuItemTheme, adjustPosition, calculateDialogSizeAndPosition, calculateStartSize, index$1 as dateUtils, defaultDelay, getAxiosErrorMessage, getAxiosWarningMessage, getErrorMessage, getInitials, getLastUpdateTitle, getPosition, getWarningMessage, isAuthError, isAxiosAuthError, isAxiosError, loadAllTranslations, pollingIntervalTimeout, index as referenceTimeUtils, renderCounter, safelyInitI18nForTestsAndStories, sessionStorageProvider, sharedTranslations, showPrompt, sliderHeaderStyle, tooltipContainerStyles, useConfirmationDialog, useControlledTooltip, useDebounce, useDialogActions, useIsMounted, useMakeSureContainerStaysInsideWindow, usePoller, usePreventBrowserClose, usePrevious, useResizeObserver, useScrollingInIsolation, useUserMenu, useWheelStopPropagation };
|
|
6530
|
+
export { AlertBanner, AlertIcon, AppHeader, AppLayout, Avatar, CanvasComponent, ConfirmationButtons, ConfirmationDialog, ConfirmationServiceProvider, CustomAccordion, CustomDialog, CustomDialogHeader, CustomIconButton, CustomSlider, CustomToggleButton, CustomTooltip, DEBOUNCE_TIMEOUT, DEFAULT_ERROR_MESSAGE, DEFAULT_FILTER_HEIGHT, DraggableComponent$1 as Draggable, ErrorBoundary, Filter, FilterChip, FilterOption, LastUpdateTime, LegendToggleButton, PROJECTION, ResizeComponent as Resizable, SHARED_NAMESPACE, SearchField$1 as SearchField, SearchFieldButton, SearchHighlight, SessionStorageKey, StatusTag, StorybookDocsWrapper, StyledSelect, SwitchButton, SystemScope, ToggleMenu, ToolContainer, DraggableComponent as ToolContainerDraggable, ToolFooter, ToolHeader, TooltipSelect, UserMenu, UserMenuItemCheatSheet, MenuItemTheme as UserMenuItemTheme, adjustPosition, calculateDialogSizeAndPosition, calculateStartSize, index$1 as dateUtils, defaultDelay, getAxiosErrorMessage, getAxiosWarningMessage, getErrorMessage, getInitials, getLastUpdateTitle, getPosition, getWarningMessage, isAuthError, isAxiosAuthError, isAxiosError, loadAllTranslations, pollingIntervalTimeout, index as referenceTimeUtils, renderCounter, safelyInitI18nForTestsAndStories, sessionStorageProvider, sharedTranslations, showPrompt, sliderHeaderStyle, tooltipContainerStyles, useConfirmationDialog, useControlledTooltip, useDebounce, useDialogActions, useIsMounted, useMakeSureContainerStaysInsideWindow, usePoller, usePreventBrowserClose, usePrevious, useResizeObserver, useScrollingInIsolation, useUserMenu, useWheelStopPropagation };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SxProps, Theme } from '@mui/material';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface LegendToggleButtonProps {
|
|
4
|
+
isLegendVisible: boolean;
|
|
5
|
+
onToggle: () => void;
|
|
6
|
+
showTooltipText: string;
|
|
7
|
+
hideTooltipText: string;
|
|
8
|
+
legendLabel: string;
|
|
9
|
+
/** Container-query responsive styles — pass the container-specific breakpoint rules here */
|
|
10
|
+
sx?: SxProps<Theme>;
|
|
11
|
+
}
|
|
12
|
+
export declare const LegendToggleButton: ({ isLegendVisible, onToggle, showTooltipText, hideTooltipText, legendLabel, sx, }: LegendToggleButtonProps) => React.ReactElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './LegendToggleButton';
|