@opengeoweb/shared 14.1.0 → 14.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/index.esm.js CHANGED
@@ -285,6 +285,11 @@ var sharedTranslations = {
285
285
  function _OverloadYield(e, d) {
286
286
  this.v = e, this.k = d;
287
287
  }
288
+ function _arrayLikeToArray(r, a) {
289
+ (null == a || a > r.length) && (a = r.length);
290
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
291
+ return n;
292
+ }
288
293
  function asyncGeneratorStep(n, t, e, r, o, a, c) {
289
294
  try {
290
295
  var i = n[a](c),
@@ -310,6 +315,23 @@ function _asyncToGenerator(n) {
310
315
  });
311
316
  };
312
317
  }
318
+ function _createForOfIteratorHelperLoose(r, e) {
319
+ var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
320
+ if (t) return (t = t.call(r)).next.bind(t);
321
+ if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) {
322
+ t && (r = t);
323
+ var o = 0;
324
+ return function () {
325
+ return o >= r.length ? {
326
+ done: true
327
+ } : {
328
+ done: false,
329
+ value: r[o++]
330
+ };
331
+ };
332
+ }
333
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
334
+ }
313
335
  function _inheritsLoose(t, o) {
314
336
  t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
315
337
  }
@@ -502,6 +524,13 @@ function _setPrototypeOf(t, e) {
502
524
  return t.__proto__ = e, t;
503
525
  }, _setPrototypeOf(t, e);
504
526
  }
527
+ function _unsupportedIterableToArray(r, a) {
528
+ if (r) {
529
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
530
+ var t = {}.toString.call(r).slice(8, -1);
531
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
532
+ }
533
+ }
505
534
  function _regeneratorRuntime() {
506
535
 
507
536
  var r = _regenerator(),
@@ -1828,6 +1857,43 @@ var useScrollingInIsolation = function useScrollingInIsolation(options) {
1828
1857
  return scrollInIsolationRef;
1829
1858
  };
1830
1859
 
1860
+ /*
1861
+ Accepts an array and html div element that is being observed for resizes.
1862
+ */
1863
+ var useResizeObserver = function useResizeObserver(listContainerRef, collections,
1864
+ /**
1865
+ * Optional ResizeObserver implementation for dependency injection (testing, polyfills).
1866
+ * Defaults to window.ResizeObserver when not provided.
1867
+ */
1868
+ ResizeObserverImpl) {
1869
+ if (ResizeObserverImpl === void 0) {
1870
+ ResizeObserverImpl = window.ResizeObserver;
1871
+ }
1872
+ var _React$useState = React.useState(350),
1873
+ listHeight = _React$useState[0],
1874
+ setListHeight = _React$useState[1]; // default fallback
1875
+ React.useEffect(function () {
1876
+ var node = listContainerRef.current;
1877
+ if (!node) {
1878
+ return;
1879
+ }
1880
+ var resizeObserver = new ResizeObserverImpl(function (entries) {
1881
+ for (var _iterator = _createForOfIteratorHelperLoose(entries), _step; !(_step = _iterator()).done;) {
1882
+ var entry = _step.value;
1883
+ if (entry.contentRect) {
1884
+ if (collections && collections.length > 1) {
1885
+ setListHeight(entry.contentRect.height - 150); // Subtract header height + accordion summary height
1886
+ } else {
1887
+ setListHeight(entry.contentRect.height - 115); // Subtract header height
1888
+ }
1889
+ }
1890
+ }
1891
+ });
1892
+ resizeObserver.observe(node);
1893
+ }, [listContainerRef, collections, ResizeObserverImpl]);
1894
+ return listHeight;
1895
+ };
1896
+
1831
1897
  var ConfirmationServiceContext = /*#__PURE__*/React.createContext(Promise.reject);
1832
1898
  var useConfirmationDialog = function useConfirmationDialog() {
1833
1899
  return React.useContext(ConfirmationServiceContext);
@@ -4299,7 +4365,9 @@ var CustomAccordion = function CustomAccordion(_ref) {
4299
4365
  }
4300
4366
  },
4301
4367
  children: [jsx(AccordionSummary, {
4368
+ "aria-label": expanded ? 'Drawer opened' : 'Drawer closed',
4302
4369
  component: "div",
4370
+ "data-testid": title && amountOfItems ? title + " " + amountOfItems : title,
4303
4371
  expandIcon: CustomExpandIcon ? jsx(CustomExpandIcon, {
4304
4372
  style: {
4305
4373
  fill: "" + iconColor
@@ -5354,6 +5422,7 @@ var getWarningMessage = function getWarningMessage(error) {
5354
5422
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
5355
5423
  * */
5356
5424
  var DATE_FORMAT_DATEPICKER = 'dd/MM/yyyy HH:mm';
5425
+ var DATE_FORMAT_DATEPICKER_NO_YEAR = 'dd/MM HH:mm';
5357
5426
  var DATE_FORMAT_UTC = "yyyy-MM-dd'T'HH:mm:ss'Z'";
5358
5427
  var DATE_FORMAT_YEAR = 'yyyy-MM-dd';
5359
5428
  var DATE_FORMAT_HOURS = 'HH:mm';
@@ -6057,6 +6126,7 @@ var setSeconds = function setSeconds(date, seconds) {
6057
6126
  var index = /*#__PURE__*/Object.freeze({
6058
6127
  __proto__: null,
6059
6128
  DATE_FORMAT_DATEPICKER: DATE_FORMAT_DATEPICKER,
6129
+ DATE_FORMAT_DATEPICKER_NO_YEAR: DATE_FORMAT_DATEPICKER_NO_YEAR,
6060
6130
  DATE_FORMAT_HOURS: DATE_FORMAT_HOURS,
6061
6131
  DATE_FORMAT_NAME_OF_DAY: DATE_FORMAT_NAME_OF_DAY,
6062
6132
  DATE_FORMAT_NAME_OF_DAY_MONTH: DATE_FORMAT_NAME_OF_DAY_MONTH,
@@ -6358,4 +6428,4 @@ var SystemScope = {
6358
6428
  system: 'system'
6359
6429
  };
6360
6430
 
6361
- 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, UserMenuItemSentryRecording, MenuItemTheme as UserMenuItemTheme, adjustPosition, calculateDialogSizeAndPosition, calculateStartSize, index as dateUtils, defaultDelay, getAxiosErrorMessage, getAxiosWarningMessage, getErrorMessage, getInitials, getLastUpdateTitle, getPosition, getWarningMessage, isAxiosAuthError, isAxiosError, loadAllTranslations, pollingIntervalTimeout, renderCounter, safelyInitI18nForTestsAndStories, sessionStorageProvider, sharedTranslations, showPrompt, sliderHeaderStyle, tooltipContainerStyles, useConfirmationDialog, useControlledTooltip, useDebounce, useDialogActions, useIsMounted, useMakeSureContainerStaysInsideWindow, usePoller, usePreventBrowserClose, usePrevious, useScrollingInIsolation, useUserMenu, useWheelStopPropagation };
6431
+ 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, UserMenuItemSentryRecording, MenuItemTheme as UserMenuItemTheme, adjustPosition, calculateDialogSizeAndPosition, calculateStartSize, index as dateUtils, defaultDelay, getAxiosErrorMessage, getAxiosWarningMessage, getErrorMessage, getInitials, getLastUpdateTitle, getPosition, getWarningMessage, isAxiosAuthError, isAxiosError, loadAllTranslations, pollingIntervalTimeout, renderCounter, safelyInitI18nForTestsAndStories, sessionStorageProvider, sharedTranslations, showPrompt, sliderHeaderStyle, tooltipContainerStyles, useConfirmationDialog, useControlledTooltip, useDebounce, useDialogActions, useIsMounted, useMakeSureContainerStaysInsideWindow, usePoller, usePreventBrowserClose, usePrevious, useResizeObserver, useScrollingInIsolation, useUserMenu, useWheelStopPropagation };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/shared",
3
- "version": "14.1.0",
3
+ "version": "14.2.1",
4
4
  "description": "GeoWeb shared library with shared components and utils for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -8,7 +8,7 @@
8
8
  "url": "git@gitlab.com:opengeoweb/opengeoweb.git"
9
9
  },
10
10
  "dependencies": {
11
- "@opengeoweb/theme": "14.1.0",
11
+ "@opengeoweb/theme": "14.2.1",
12
12
  "react-draggable": "^4.4.6",
13
13
  "re-resizable": "^6.9.11",
14
14
  "lodash": "^4.17.21",
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  export interface FilterChipProps {
3
3
  id: string;
4
- label: string;
4
+ label: React.ReactNode;
5
5
  isSelected?: boolean;
6
6
  isDisabled?: boolean;
7
7
  handleClick?: (label: string, isSelected?: boolean) => void;
@@ -6,3 +6,4 @@ export * from './useMakeSureContainerStaysInsideWindow/useMakeSureContainerStays
6
6
  export * from './useDebounce/useDebounce';
7
7
  export * from './useWheelStopPropagation/useWheelStopPropagation';
8
8
  export * from './useScrollingInIsolation/useScrollingInIsolation';
9
+ export * from './useResizeObserver/useResizeObserver';
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const useResizeObserver: (listContainerRef: React.RefObject<HTMLDivElement>, collections: unknown[], ResizeObserverImpl?: typeof ResizeObserver) => number;
@@ -21,6 +21,7 @@ export interface ConfigType {
21
21
  GW_DRAWINGS_BASE_URL?: string;
22
22
  GW_WARNINGS_WORKSPACE_ID?: string;
23
23
  GW_SPACE_WEATHER_WORKSPACE_ID?: string;
24
+ GW_TRAJKS_WORKSPACE_ID?: string;
24
25
  GW_TECHNICAL_RELEASE_NOTES_URL?: string;
25
26
  GW_VERSION_PROGRESS_NOTES_URL?: string;
26
27
  GW_BE_RELEASE_URL?: string;
@@ -1,4 +1,5 @@
1
1
  export declare const DATE_FORMAT_DATEPICKER = "dd/MM/yyyy HH:mm";
2
+ export declare const DATE_FORMAT_DATEPICKER_NO_YEAR = "dd/MM HH:mm";
2
3
  export declare const DATE_FORMAT_UTC = "yyyy-MM-dd'T'HH:mm:ss'Z'";
3
4
  export declare const DATE_FORMAT_YEAR = "yyyy-MM-dd";
4
5
  export declare const DATE_FORMAT_HOURS = "HH:mm";