@opengeoweb/layer-select 12.6.0 → 12.7.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/index.esm.js CHANGED
@@ -2,8 +2,8 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
3
  import React__default from 'react';
4
4
  import { useSelector, useDispatch } from 'react-redux';
5
- import { CustomIconButton, FilterOption, ToolContainerDraggable, CustomAccordion, CustomToggleButton, CustomTooltip, SearchHighlight, SearchField, AlertBanner, ToggleMenu, CustomDialog } from '@opengeoweb/shared';
6
- import { Filter, LayersAdd, Add, Cached, Edit, Visibility, Delete, Copy } from '@opengeoweb/theme';
5
+ import { CustomIconButton, FilterOption, ToolContainerDraggable, CustomAccordion, CustomToggleButton, CustomTooltip, SearchHighlight, SearchField, AlertBanner, ToggleMenu, CustomDialog, sessionStorageProvider } from '@opengeoweb/shared';
6
+ import { Filter, LayersAdd, Add, Cached, Edit, Visibility, Delete, MeteoGate, Copy } from '@opengeoweb/theme';
7
7
  import { uiTypes, serviceActions, selectorMemoizationOptions, serviceSelectors, uiActions, getUserAddedServices, setUserAddedServices, layerActions, uiSelectors, layerSelectors, mapListener, serviceListener, layersListener, openlayersListener, uiReducer, layerReducer, serviceReducer, mapReducer, useSetupDialog, mapSelectors, layerTypes } from '@opengeoweb/store';
8
8
  import { createEntityAdapter, createSlice, createSelector, createListenerMiddleware, isAnyOf, combineReducers, configureStore } from '@reduxjs/toolkit';
9
9
  import { compact, countBy, partition } from 'lodash';
@@ -12,8 +12,8 @@ import { Switch, Grid, List, Box, Typography, useTheme, Backdrop, CircularProgre
12
12
  import 'i18next';
13
13
  import { useTranslation } from 'react-i18next';
14
14
  import { FixedSizeList } from 'react-window';
15
- import { getDimensionsList, LayerInfoButton } from '@opengeoweb/webmap-react';
16
- import { LayerType, webmapUtils, getWMSServiceId, queryWMSServiceInfo, queryWMSLayers, invalidateWMSGetCapabilities, clearImageCacheForAllMaps } from '@opengeoweb/webmap';
15
+ import { getDimensionsList, LayerInfoButton, clearImageCacheForAllMaps } from '@opengeoweb/webmap-react';
16
+ import { LayerType, webmapUtils, getWMSServiceId, queryWMSServiceInfo, queryWMSLayers, invalidateWMSGetCapabilities } from '@opengeoweb/webmap';
17
17
  import { ReactHookFormProvider, defaultFormOptions, ReactHookFormTextField } from '@opengeoweb/form-fields';
18
18
  import { useFormContext } from 'react-hook-form';
19
19
 
@@ -2600,6 +2600,37 @@ var ServiceOptionsButton = function ServiceOptionsButton(_ref) {
2600
2600
  });
2601
2601
  };
2602
2602
 
2603
+ var DataExplorerButtonConnect = function DataExplorerButtonConnect(_ref) {
2604
+ var mapId = _ref.mapId,
2605
+ _ref$source = _ref.source,
2606
+ source = _ref$source === void 0 ? 'app' : _ref$source;
2607
+ var dispatch = useDispatch();
2608
+ var dialogType = uiTypes.DialogTypes.DataExplorer;
2609
+ var isOpenInStore = useSelector(function (store) {
2610
+ return uiSelectors.getisDialogOpen(store, dialogType);
2611
+ });
2612
+ var openDataExplorerDialog = React.useCallback(function () {
2613
+ dispatch(uiActions.setActiveMapIdForDialog({
2614
+ type: dialogType,
2615
+ setOpen: !isOpenInStore,
2616
+ source: source,
2617
+ mapId: mapId
2618
+ }));
2619
+ }, [mapId, dialogType, dispatch, source, isOpenInStore]);
2620
+ return jsx(CustomTooltip, {
2621
+ title: "MeteoGate Data Explorer",
2622
+ children: jsx(CustomIconButton, {
2623
+ variant: "tool",
2624
+ "data-testid": "dataExplorerButton",
2625
+ onClick: openDataExplorerDialog,
2626
+ isSelected: isOpenInStore,
2627
+ children: jsx(MeteoGate, {
2628
+ sx: {}
2629
+ })
2630
+ })
2631
+ });
2632
+ };
2633
+
2603
2634
  var LayerSelect = function LayerSelect(_ref) {
2604
2635
  var mapId = _ref.mapId,
2605
2636
  bounds = _ref.bounds,
@@ -2619,8 +2650,10 @@ var LayerSelect = function LayerSelect(_ref) {
2619
2650
  height: 500
2620
2651
  } : _ref$startSize,
2621
2652
  _ref$isMultiMap = _ref.isMultiMap,
2622
- isMultiMap = _ref$isMultiMap === void 0 ? false : _ref$isMultiMap;
2623
- var initialServiceListHeight = 37;
2653
+ isMultiMap = _ref$isMultiMap === void 0 ? false : _ref$isMultiMap,
2654
+ _ref$hasDataExplorer = _ref.hasDataExplorer,
2655
+ hasDataExplorer = _ref$hasDataExplorer === void 0 ? false : _ref$hasDataExplorer;
2656
+ var initialServiceListHeight = hasDataExplorer ? 52 : 37;
2624
2657
  var _React$useState = React.useState(startSize.height),
2625
2658
  height = _React$useState[0],
2626
2659
  setHeight = _React$useState[1];
@@ -2689,10 +2722,21 @@ var LayerSelect = function LayerSelect(_ref) {
2689
2722
  margin: '8px 8px 0 16px',
2690
2723
  zIndex: 2
2691
2724
  },
2692
- children: jsx(KeywordFilterButtonConnect, {
2693
- mapId: mapId,
2694
- isMultiMap: isMultiMap,
2695
- source: source
2725
+ children: jsxs(Grid, {
2726
+ container: true,
2727
+ children: [jsx(Grid, {
2728
+ size: 12,
2729
+ children: jsx(KeywordFilterButtonConnect, {
2730
+ mapId: mapId,
2731
+ isMultiMap: isMultiMap,
2732
+ source: source
2733
+ })
2734
+ }), hasDataExplorer && jsx(Grid, {
2735
+ size: 12,
2736
+ children: jsx(DataExplorerButtonConnect, {
2737
+ mapId: mapId
2738
+ })
2739
+ })]
2696
2740
  })
2697
2741
  }), jsx(Box, {
2698
2742
  sx: {
@@ -2704,6 +2748,9 @@ var LayerSelect = function LayerSelect(_ref) {
2704
2748
  mapId: mapId
2705
2749
  })
2706
2750
  }), jsx(Box, {
2751
+ sx: hasDataExplorer ? {
2752
+ minHeight: '52px'
2753
+ } : {},
2707
2754
  children: jsx(ServiceListConnect, {
2708
2755
  setHeight: handleHeightChange
2709
2756
  })
@@ -3172,6 +3219,8 @@ var LayerSelectConnect = function LayerSelectConnect(_ref) {
3172
3219
  onCloseDialog = _useSetupDialog.onCloseDialog,
3173
3220
  setDialogOrder = _useSetupDialog.setDialogOrder,
3174
3221
  uiSource = _useSetupDialog.uiSource;
3222
+ var config = sessionStorageProvider.getConfig();
3223
+ var hasDataExplorer = !!config.GW_DATAEXPLORER_CONFIGURATION_FILENAME;
3175
3224
  return jsxs(Fragment, {
3176
3225
  children: [jsx(LayerSelect, {
3177
3226
  mapId: mapId || initialMapId,
@@ -3182,7 +3231,8 @@ var LayerSelectConnect = function LayerSelectConnect(_ref) {
3182
3231
  onMouseDown: setDialogOrder,
3183
3232
  order: dialogOrder,
3184
3233
  source: uiSource,
3185
- isMultiMap: isMultiMap
3234
+ isMultiMap: isMultiMap,
3235
+ hasDataExplorer: hasDataExplorer
3186
3236
  }), jsx(KeywordFilterResultsConnect, {
3187
3237
  mapId: mapId || initialMapId,
3188
3238
  isMultiMap: isMultiMap
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/layer-select",
3
- "version": "12.6.0",
3
+ "version": "12.7.0",
4
4
  "description": "GeoWeb layer select library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -8,15 +8,15 @@
8
8
  "url": "git@gitlab.com:opengeoweb/opengeoweb.git"
9
9
  },
10
10
  "dependencies": {
11
- "@opengeoweb/shared": "12.6.0",
12
- "@opengeoweb/store": "12.6.0",
11
+ "@opengeoweb/shared": "12.7.0",
12
+ "@opengeoweb/store": "12.7.0",
13
13
  "react-redux": "^9.2.0",
14
- "@opengeoweb/theme": "12.6.0",
15
- "@opengeoweb/webmap-react": "12.6.0",
16
- "@opengeoweb/webmap": "12.6.0",
14
+ "@opengeoweb/theme": "12.7.0",
15
+ "@opengeoweb/webmap-react": "12.7.0",
16
+ "@opengeoweb/webmap": "12.7.0",
17
17
  "react-window": "^1.8.10",
18
- "@opengeoweb/snackbar": "12.6.0",
19
- "@opengeoweb/form-fields": "12.6.0",
18
+ "@opengeoweb/snackbar": "12.7.0",
19
+ "@opengeoweb/form-fields": "12.7.0",
20
20
  "react-hook-form": "^7.50.1",
21
21
  "@reduxjs/toolkit": "^2.6.1",
22
22
  "lodash": "^4.17.21",
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import { uiTypes } from '@opengeoweb/store';
3
+ interface DataExplorerButtonConnectProps {
4
+ mapId: string;
5
+ source?: uiTypes.Source;
6
+ }
7
+ export declare const DataExplorerButtonConnect: React.FC<DataExplorerButtonConnectProps>;
8
+ export {};
@@ -15,6 +15,7 @@ interface LayerSelectProps {
15
15
  source?: uiTypes.Source;
16
16
  startSize?: Size;
17
17
  isMultiMap?: boolean;
18
+ hasDataExplorer?: boolean;
18
19
  }
19
20
  export declare const LayerSelect: React.FC<LayerSelectProps>;
20
21
  export {};
@@ -6,5 +6,9 @@ type Story = StoryObj<typeof LayerSelect>;
6
6
  export declare const Component: Story;
7
7
  export declare const LayerSelectDemoLightTheme: Story;
8
8
  export declare const LayerSelectDemoDarkTheme: Story;
9
+ export declare const LayerSelectWithDataExplorerDemoLightTheme: Story;
10
+ export declare const LayerSelectWithDataExplorerDemoDarkTheme: Story;
9
11
  export declare const LayerSelectDemoSmallLightTheme: Story;
10
12
  export declare const LayerSelectDemoSmallDarkTheme: Story;
13
+ export declare const LayerSelectWithDataExplorerDemoSmallLightTheme: Story;
14
+ export declare const LayerSelectWithDataExplorerDemoSmallDarkTheme: Story;