@rio-cloud/rio-uikit 1.4.0 → 1.5.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.
Files changed (174) hide show
  1. package/.DS_Store +0 -0
  2. package/FadeExpander.d.ts +2 -0
  3. package/FadeExpander.js +2 -0
  4. package/FadeUp.d.ts +2 -0
  5. package/FadeUp.js +2 -0
  6. package/XAxis.d.ts +2 -0
  7. package/XAxis.js +2 -0
  8. package/YAxis.d.ts +2 -0
  9. package/YAxis.js +2 -0
  10. package/components/applicationLayout/ApplicationLayoutBody.d.ts +5 -0
  11. package/components/applicationLayout/ApplicationLayoutBody.js +10 -1
  12. package/components/charts/Area.d.ts +11 -3
  13. package/components/charts/Area.js +9 -1
  14. package/components/charts/AreaChart.d.ts +4 -3
  15. package/components/charts/AreaChart.js +9 -8
  16. package/components/charts/Bar.d.ts +6 -2
  17. package/components/charts/Bar.js +3 -4
  18. package/components/charts/BarChart.d.ts +2 -1
  19. package/components/charts/BarChart.js +8 -4
  20. package/components/charts/ComposedChart.d.ts +6 -5
  21. package/components/charts/ComposedChart.js +16 -11
  22. package/components/charts/Legend.js +1 -1
  23. package/components/charts/Line.d.ts +11 -3
  24. package/components/charts/Line.js +9 -1
  25. package/components/charts/LineChart.d.ts +6 -4
  26. package/components/charts/LineChart.js +10 -9
  27. package/components/charts/ReferenceLine.d.ts +8 -4
  28. package/components/charts/ReferenceLine.js +18 -2
  29. package/components/charts/XAxis.d.ts +7 -0
  30. package/components/charts/XAxis.js +18 -0
  31. package/components/charts/YAxis.d.ts +5 -0
  32. package/components/charts/YAxis.js +2 -0
  33. package/components/collapse/Collapse.js +3 -2
  34. package/components/dropdown/ButtonDropdown.d.ts +3 -1
  35. package/components/dropdown/ButtonDropdown.js +6 -5
  36. package/components/dropdown/DropdownToggleButton.d.ts +1 -0
  37. package/components/dropdown/DropdownToggleButton.js +4 -2
  38. package/components/fade/FadeExpander.d.ts +27 -0
  39. package/components/fade/FadeExpander.js +41 -0
  40. package/components/fade/FadeUp.d.ts +27 -0
  41. package/components/fade/FadeUp.js +28 -0
  42. package/components/listMenu/ListMenu.d.ts +7 -0
  43. package/components/listMenu/ListMenu.js +6 -3
  44. package/components/map/components/features/Route.d.ts +13 -2
  45. package/components/map/components/features/Route.js +19 -11
  46. package/components/map/components/features/basics/Polygon.d.ts +1 -0
  47. package/components/map/components/features/basics/Polygon.js +1 -0
  48. package/components/map/components/features/basics/Polyline.d.ts +3 -1
  49. package/components/map/components/features/basics/Polyline.js +5 -16
  50. package/components/map/components/features/basics/polygonColors.d.ts +252 -0
  51. package/components/map/components/features/basics/polygonColors.js +252 -0
  52. package/components/map/utils/mapTypes.d.ts +1 -1
  53. package/components/map/utils/mapTypes.js +2 -0
  54. package/components/mapMarker/SingleMapMarker.d.ts +3 -2
  55. package/components/mapMarker/SingleMapMarker.js +3 -3
  56. package/components/selects/BaseSelectDropdown.d.ts +0 -1
  57. package/components/selects/BaseSelectDropdown.js +7 -1
  58. package/components/selects/Multiselect.js +1 -4
  59. package/components/selects/Select.d.ts +1 -1
  60. package/components/selects/Select.js +1 -4
  61. package/components/smoothScrollbars/SmoothScrollbars.js +28 -3
  62. package/components/switch/Switch.d.ts +6 -5
  63. package/components/switch/Switch.js +5 -5
  64. package/components/tag/Tag.d.ts +2 -2
  65. package/components/tag/Tag.js +5 -6
  66. package/hooks/useDOMNodeCount.d.ts +2 -0
  67. package/hooks/useDOMNodeCount.js +29 -0
  68. package/hooks/useEventListenerCount.d.ts +5 -0
  69. package/hooks/useEventListenerCount.js +42 -0
  70. package/hooks/useSorting.d.ts +29 -0
  71. package/hooks/useSorting.js +41 -0
  72. package/lib/es/FadeExpander.d.ts +2 -0
  73. package/lib/es/FadeExpander.js +7 -0
  74. package/lib/es/FadeUp.d.ts +2 -0
  75. package/lib/es/FadeUp.js +7 -0
  76. package/lib/es/XAxis.d.ts +2 -0
  77. package/lib/es/XAxis.js +7 -0
  78. package/lib/es/YAxis.d.ts +2 -0
  79. package/lib/es/YAxis.js +7 -0
  80. package/lib/es/components/applicationLayout/ApplicationLayoutBody.d.ts +5 -0
  81. package/lib/es/components/applicationLayout/ApplicationLayoutBody.js +10 -1
  82. package/lib/es/components/charts/Area.d.ts +11 -3
  83. package/lib/es/components/charts/Area.js +11 -1
  84. package/lib/es/components/charts/AreaChart.d.ts +4 -3
  85. package/lib/es/components/charts/AreaChart.js +8 -7
  86. package/lib/es/components/charts/Bar.d.ts +6 -2
  87. package/lib/es/components/charts/Bar.js +5 -4
  88. package/lib/es/components/charts/BarChart.d.ts +2 -1
  89. package/lib/es/components/charts/BarChart.js +7 -3
  90. package/lib/es/components/charts/ComposedChart.d.ts +6 -5
  91. package/lib/es/components/charts/ComposedChart.js +15 -10
  92. package/lib/es/components/charts/Legend.js +1 -1
  93. package/lib/es/components/charts/Line.d.ts +11 -3
  94. package/lib/es/components/charts/Line.js +11 -1
  95. package/lib/es/components/charts/LineChart.d.ts +6 -4
  96. package/lib/es/components/charts/LineChart.js +9 -8
  97. package/lib/es/components/charts/ReferenceLine.d.ts +8 -4
  98. package/lib/es/components/charts/ReferenceLine.js +21 -2
  99. package/lib/es/components/charts/XAxis.d.ts +7 -0
  100. package/lib/es/components/charts/XAxis.js +23 -0
  101. package/lib/es/components/charts/YAxis.d.ts +5 -0
  102. package/lib/es/components/charts/YAxis.js +4 -0
  103. package/lib/es/components/collapse/Collapse.js +3 -2
  104. package/lib/es/components/dropdown/ButtonDropdown.d.ts +3 -1
  105. package/lib/es/components/dropdown/ButtonDropdown.js +5 -4
  106. package/lib/es/components/dropdown/DropdownToggleButton.d.ts +1 -0
  107. package/lib/es/components/dropdown/DropdownToggleButton.js +4 -2
  108. package/lib/es/components/fade/FadeExpander.d.ts +27 -0
  109. package/lib/es/components/fade/FadeExpander.js +43 -0
  110. package/lib/es/components/fade/FadeUp.d.ts +27 -0
  111. package/lib/es/components/fade/FadeUp.js +30 -0
  112. package/lib/es/components/listMenu/ListMenu.d.ts +7 -0
  113. package/lib/es/components/listMenu/ListMenu.js +6 -3
  114. package/lib/es/components/map/components/features/Route.d.ts +13 -2
  115. package/lib/es/components/map/components/features/Route.js +20 -12
  116. package/lib/es/components/map/components/features/basics/Polygon.d.ts +1 -0
  117. package/lib/es/components/map/components/features/basics/Polygon.js +10 -0
  118. package/lib/es/components/map/components/features/basics/Polyline.d.ts +3 -1
  119. package/lib/es/components/map/components/features/basics/Polyline.js +5 -16
  120. package/lib/es/components/map/components/features/basics/polygonColors.d.ts +252 -0
  121. package/lib/es/components/map/components/features/basics/polygonColors.js +255 -0
  122. package/lib/es/components/map/utils/mapTypes.d.ts +1 -1
  123. package/lib/es/components/map/utils/mapTypes.js +2 -0
  124. package/lib/es/components/mapMarker/SingleMapMarker.d.ts +3 -2
  125. package/lib/es/components/mapMarker/SingleMapMarker.js +3 -3
  126. package/lib/es/components/selects/BaseSelectDropdown.d.ts +0 -1
  127. package/lib/es/components/selects/BaseSelectDropdown.js +6 -0
  128. package/lib/es/components/selects/Multiselect.js +1 -4
  129. package/lib/es/components/selects/Select.d.ts +1 -1
  130. package/lib/es/components/selects/Select.js +1 -4
  131. package/lib/es/components/smoothScrollbars/SmoothScrollbars.js +27 -2
  132. package/lib/es/components/switch/Switch.d.ts +6 -5
  133. package/lib/es/components/switch/Switch.js +5 -5
  134. package/lib/es/components/tag/Tag.d.ts +2 -2
  135. package/lib/es/components/tag/Tag.js +5 -6
  136. package/lib/es/hooks/useDOMNodeCount.d.ts +2 -0
  137. package/lib/es/hooks/useDOMNodeCount.js +31 -0
  138. package/lib/es/hooks/useEventListenerCount.d.ts +5 -0
  139. package/lib/es/hooks/useEventListenerCount.js +45 -0
  140. package/lib/es/hooks/useSorting.d.ts +29 -0
  141. package/lib/es/hooks/useSorting.js +43 -0
  142. package/lib/es/storageUtils.d.ts +1 -0
  143. package/lib/es/storageUtils.js +4 -0
  144. package/lib/es/styles/variables/colors/colors.json +4 -3
  145. package/lib/es/urlFeatureToggles.d.ts +1 -0
  146. package/lib/es/urlFeatureToggles.js +4 -0
  147. package/lib/es/useDOMNodeCount.d.ts +2 -0
  148. package/lib/es/useDOMNodeCount.js +7 -0
  149. package/lib/es/useEventListenerCount.d.ts +2 -0
  150. package/lib/es/useEventListenerCount.js +7 -0
  151. package/lib/es/useSorting.d.ts +2 -0
  152. package/lib/es/useSorting.js +7 -0
  153. package/lib/es/utils/storageUtils.d.ts +5 -0
  154. package/lib/es/utils/storageUtils.js +32 -0
  155. package/lib/es/utils/urlFeatureToggles.d.ts +10 -0
  156. package/lib/es/utils/urlFeatureToggles.js +41 -0
  157. package/lib/es/version.json +1 -1
  158. package/package.json +4 -1
  159. package/storageUtils.d.ts +1 -0
  160. package/storageUtils.js +1 -0
  161. package/styles/variables/colors/colors.json +4 -3
  162. package/urlFeatureToggles.d.ts +1 -0
  163. package/urlFeatureToggles.js +1 -0
  164. package/useDOMNodeCount.d.ts +2 -0
  165. package/useDOMNodeCount.js +2 -0
  166. package/useEventListenerCount.d.ts +2 -0
  167. package/useEventListenerCount.js +2 -0
  168. package/useSorting.d.ts +2 -0
  169. package/useSorting.js +2 -0
  170. package/utils/storageUtils.d.ts +5 -0
  171. package/utils/storageUtils.js +29 -0
  172. package/utils/urlFeatureToggles.d.ts +10 -0
  173. package/utils/urlFeatureToggles.js +32 -0
  174. package/version.json +1 -1
@@ -22,6 +22,7 @@ exports.markerColorOptions = [
22
22
  'bg-map-marker-success',
23
23
  'bg-map-marker-warning',
24
24
  'bg-map-marker-danger',
25
+ 'bg-map-marker-restrictions',
25
26
  ];
26
27
  exports.markerColorMapping = {
27
28
  'bg-map-marker-asset': '--color-map-marker-asset',
@@ -32,4 +33,5 @@ exports.markerColorMapping = {
32
33
  'bg-map-marker-success': '--color-map-marker-success',
33
34
  'bg-map-marker-warning': '--color-map-marker-warning',
34
35
  'bg-map-marker-danger': '--color-map-marker-danger',
36
+ 'bg-map-marker-restrictions': '--color-map-marker-restrictions',
35
37
  };
@@ -1,6 +1,6 @@
1
- import { type ReactNode } from 'react';
1
+ import { type ComponentProps, type ReactNode } from 'react';
2
2
  import { type MarkerColor } from '../map/utils/mapTypes';
3
- export type SingleMapMarkerProps = {
3
+ export type SingleMapMarkerProps = ComponentProps<'div'> & {
4
4
  /**
5
5
  * Defines the rotation of the arrow in deg.
6
6
  *
@@ -73,6 +73,7 @@ export type SingleMapMarkerProps = {
73
73
  * - `bg-map-marker-success`
74
74
  * - `bg-map-marker-warning`
75
75
  * - `bg-map-marker-danger`
76
+ * - `bg-map-marker-restrictions`
76
77
  *
77
78
  * @default 'bg-map-marker-asset'
78
79
  */
@@ -19,12 +19,12 @@ const MapStateIndicator = (props) => {
19
19
  };
20
20
  const getIcons = (iconNames = []) => iconNames.map((name, index) => ((0, jsx_runtime_1.jsx)("div", { className: `rio-map-icon rioglyph rioglyph-${name}` }, `rio-map-icon-${name}-${index}`)));
21
21
  const SingleMapMarker = (props) => {
22
- const { bearing = DEFAULT_BEARING, name, warningCount = 0, exceptionCount = 0, active = false, clickable = true, fixed = false, moving = false, pinging = false, anchorIconName, stateIconName, iconNames, markerColor = 'bg-map-marker-asset', textColor, anchorSize, markerOnHover = false, anchorOnly = !name && !iconNames, cursor = 'cursor-pointer', } = props;
22
+ const { bearing = DEFAULT_BEARING, name, warningCount = 0, exceptionCount = 0, active = false, clickable = true, fixed = false, moving = false, pinging = false, anchorIconName, stateIconName, iconNames, markerColor = 'bg-map-marker-asset', textColor, anchorSize, markerOnHover = false, anchorOnly = !name && !iconNames, cursor = 'cursor-pointer', className, style, } = props;
23
23
  const largeAnchor = anchorSize === 'lg';
24
- const classes = (0, classnames_1.default)(active && 'active', 'rio-map-marker', 'rio-map-marker-bottom-center', !clickable && 'not-clickable');
24
+ const classes = (0, classnames_1.default)(active && 'active', 'rio-map-marker', 'rio-map-marker-bottom-center', !clickable && 'not-clickable', className);
25
25
  const anchorClasses = (0, classnames_1.default)('rio-map-anchor', largeAnchor ? 'rio-map-anchor-lg' : '', cursor);
26
26
  const singleClasses = (0, classnames_1.default)('rio-map-single', fixed && 'fixed', moving && 'moving', textColor, markerOnHover && 'visible-on-hover', active && 'active', pinging && 'pinging', cursor);
27
27
  const markerBackgroundColor = `var(${mapTypes_1.markerColorMapping[markerColor]})`;
28
- return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: classes, style: { color: markerBackgroundColor }, "data-marker-type": markerColor.replace('bg-', 'single-') }, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: 'rio-map-marker-translate' }, { children: [!anchorOnly && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: singleClasses }, { children: [(0, jsx_runtime_1.jsx)(MapStateIndicator, { moving: moving, bearing: bearing, stateIconName: stateIconName }), getIcons(iconNames), name && (0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'rio-map-name' }, { children: name })), exceptionCount > 0 && (0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'rio-map-bubble exception' }, { children: exceptionCount })), warningCount > 0 && (0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'rio-map-bubble warning' }, { children: warningCount }))] })), (0, jsx_runtime_1.jsx)("div", { className: 'rio-map-anchor-arrow' })] })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: anchorClasses }, { children: anchorIconName && largeAnchor && (0, jsx_runtime_1.jsx)("span", { className: `rioglyph rioglyph-${anchorIconName}` }) }))] })) })));
28
+ return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: classes, style: Object.assign(Object.assign({}, style), { color: markerBackgroundColor }), "data-marker-type": markerColor.replace('bg-', 'single-') }, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: 'rio-map-marker-translate' }, { children: [!anchorOnly && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: singleClasses }, { children: [(0, jsx_runtime_1.jsx)(MapStateIndicator, { moving: moving, bearing: bearing, stateIconName: stateIconName }), getIcons(iconNames), name && (0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'rio-map-name' }, { children: name })), exceptionCount > 0 && (0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'rio-map-bubble exception' }, { children: exceptionCount })), warningCount > 0 && (0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'rio-map-bubble warning' }, { children: warningCount }))] })), (0, jsx_runtime_1.jsx)("div", { className: 'rio-map-anchor-arrow' })] })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: anchorClasses }, { children: anchorIconName && largeAnchor && (0, jsx_runtime_1.jsx)("span", { className: `rioglyph rioglyph-${anchorIconName}` }) }))] })) })));
29
29
  };
30
30
  exports.default = SingleMapMarker;
@@ -48,7 +48,6 @@ export type BaseSelectDropdownProps<T extends SelectOption> = {
48
48
  noItemMessage?: string | React.ReactNode;
49
49
  focusedItemIndex?: number;
50
50
  dropdownClassName?: string;
51
- requestItemDOMValues?: boolean;
52
51
  keyboardUsed?: boolean;
53
52
  useActiveClass?: boolean;
54
53
  };
@@ -44,6 +44,12 @@ const BaseSelectDropdown = (props) => {
44
44
  }
45
45
  }
46
46
  }, [dropDirection, dropdownMenuRef]);
47
+ // biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
48
+ (0, react_1.useEffect)(() => {
49
+ if (dropdownMenuRef.current) {
50
+ updateDOMValues(updateItemDOMValues());
51
+ }
52
+ }, [dropdownMenuRef.current]);
47
53
  // update internal state for isOpen
48
54
  const [previousIsOpen, setPreviousIsOpen] = (0, react_1.useState)(isOpen);
49
55
  if (isOpen && !previousIsOpen) {
@@ -26,7 +26,6 @@ const Multiselect = (props) => {
26
26
  const [filteredOptions, setFilteredOptions] = (0, react_1.useState)(options);
27
27
  const [itemDOMValues, setItemDOMValues] = (0, react_1.useState)([]);
28
28
  const [focusedItemIndex, setFocusedItemIndex] = (0, react_1.useState)(DEFAULT_FOCUSED_ITEM_INDEX);
29
- const [requestItemDOMValues, setRequestItemDOMValues] = (0, react_1.useState)(false);
30
29
  const [keyboardUsed, setKeyboardUsed] = (0, react_1.useState)(false);
31
30
  const refToggle = (0, react_1.useRef)(null);
32
31
  const refMultiSelectWrapper = (0, react_1.useRef)(null);
@@ -59,12 +58,10 @@ const Multiselect = (props) => {
59
58
  if (!(0, isEqual_1.default)(options, previousOptions)) {
60
59
  updateSelectedItems(options, value);
61
60
  setFilteredOptions(options);
62
- setRequestItemDOMValues(true);
63
61
  setPreviousOptions(options);
64
62
  }
65
63
  const updateDOMValues = (updatedItemDOMValues = []) => {
66
64
  setItemDOMValues(updatedItemDOMValues);
67
- setRequestItemDOMValues(false);
68
65
  };
69
66
  const renderFilter = () => ((0, jsx_runtime_1.jsx)(MultiselectToggleFilter_1.default, { isActive: isFilterActive || !!filterValue, selectedItemIds: selectedItemIds, filterValue: filterValue, onFilterChange: handleFilterChange, multiline: multiline }));
70
67
  const renderSelection = () => {
@@ -88,7 +85,7 @@ const Multiselect = (props) => {
88
85
  option.selected = selectedItemIds.indexOf(option.id) !== -1;
89
86
  return option;
90
87
  });
91
- return ((0, jsx_runtime_1.jsx)(BaseSelectDropdown_1.default, { isOpen: isOpen, isLoading: isLoading, options: nonSelectedOptions, focusedItemIndex: focusedItemIndex, keyboardUsed: keyboardUsed, updateDOMValues: updateDOMValues, onSelect: onOptionChange, onClose: closeMenu, noItemMessage: noItemMessage, pullRight: pullRight, useActiveClass: true, dropup: dropup, autoDropDirection: autoDropDirection, requestItemDOMValues: requestItemDOMValues }));
88
+ return ((0, jsx_runtime_1.jsx)(BaseSelectDropdown_1.default, { isOpen: isOpen, isLoading: isLoading, options: nonSelectedOptions, focusedItemIndex: focusedItemIndex, keyboardUsed: keyboardUsed, updateDOMValues: updateDOMValues, onSelect: onOptionChange, onClose: closeMenu, noItemMessage: noItemMessage, pullRight: pullRight, useActiveClass: true, dropup: dropup, autoDropDirection: autoDropDirection }));
92
89
  };
93
90
  const handleFilterChange = (event) => {
94
91
  event.preventDefault();
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { type SelectOption } from './BaseSelectDropdown';
3
- import { WithFeedbackAndAddonProps } from './WithFeedbackAndAddon';
3
+ import { type WithFeedbackAndAddonProps } from './WithFeedbackAndAddon';
4
4
  export type { SelectOption } from './BaseSelectDropdown';
5
5
  export type SelectProps<T extends SelectOption> = Omit<WithFeedbackAndAddonProps, 'bsSize'> & {
6
6
  /**
@@ -25,7 +25,6 @@ const Select = (props) => {
25
25
  const [filteredOptions, setFilteredOptions] = (0, react_1.useState)(options);
26
26
  const [itemDOMValues, setItemDOMValues] = (0, react_1.useState)([]);
27
27
  const [focusedItemIndex, setFocusedItemIndex] = (0, react_1.useState)(DEFAULT_FOCUSED_ITEM_INDEX);
28
- const [requestItemDOMValues, setRequestItemDOMValues] = (0, react_1.useState)(false);
29
28
  const [keyboardUsed, setKeyboardUsed] = (0, react_1.useState)(false);
30
29
  const refSelect = (0, react_1.useRef)();
31
30
  const refToggle = (0, react_1.useRef)(null);
@@ -46,7 +45,6 @@ const Select = (props) => {
46
45
  if (!(0, isEqual_1.default)(options, previousOptions)) {
47
46
  updateSelectedItem(options, value);
48
47
  setFilteredOptions(options);
49
- setRequestItemDOMValues(true);
50
48
  setPreviousOptions(options);
51
49
  }
52
50
  const [previousValue, setPreviousValue] = (0, react_1.useState)(value);
@@ -56,7 +54,6 @@ const Select = (props) => {
56
54
  }
57
55
  const updateDOMValues = (itemDOMValuesToUpdated = []) => {
58
56
  setItemDOMValues(itemDOMValuesToUpdated);
59
- setRequestItemDOMValues(false);
60
57
  };
61
58
  const handleClearSelectedItem = () => {
62
59
  setSelectedItem(null);
@@ -84,7 +81,7 @@ const Select = (props) => {
84
81
  else if (keyboardUsed) {
85
82
  currentFocusedItemIndex = 0;
86
83
  }
87
- return ((0, jsx_runtime_1.jsx)(BaseSelectDropdown_1.default, { isOpen: isOpen, isLoading: isLoading, options: filteredOptions, focusedItemIndex: currentFocusedItemIndex, keyboardUsed: keyboardUsed, updateDOMValues: updateDOMValues, onSelect: onOptionChange, onClose: closeMenu, noItemMessage: noItemMessage, pullRight: pullRight, dropup: dropup, autoDropDirection: autoDropDirection, dropdownClassName: dropdownClassName, requestItemDOMValues: requestItemDOMValues }));
84
+ return ((0, jsx_runtime_1.jsx)(BaseSelectDropdown_1.default, { isOpen: isOpen, isLoading: isLoading, options: filteredOptions, focusedItemIndex: currentFocusedItemIndex, keyboardUsed: keyboardUsed, updateDOMValues: updateDOMValues, onSelect: onOptionChange, onClose: closeMenu, noItemMessage: noItemMessage, pullRight: pullRight, dropup: dropup, autoDropDirection: autoDropDirection, dropdownClassName: dropdownClassName }));
88
85
  };
89
86
  const handleFilterChange = (event) => {
90
87
  event.preventDefault();
@@ -7,14 +7,39 @@ const react_1 = require("react");
7
7
  const react_custom_scrollbars_2_1 = require("react-custom-scrollbars-2");
8
8
  const classnames_1 = tslib_1.__importDefault(require("classnames"));
9
9
  const noop_1 = tslib_1.__importDefault(require("lodash/fp/noop"));
10
+ const debounce_1 = tslib_1.__importDefault(require("lodash/fp/debounce"));
11
+ const RESIZE_THROTTLING = 100;
10
12
  const SmoothScrollbars = (0, react_1.forwardRef)((componentProps, ref) => {
11
13
  const { slideIn = false, largeTrack = false, trackOffset = false, className = '', onScroll = noop_1.default, tagName = 'div', autoHeight = false, autoHeightMin = 0, autoHeightMax = 200, children, } = componentProps;
14
+ const scrollbarsRef = (0, react_1.useRef)(null);
15
+ const contentRef = (0, react_1.useRef)(null);
16
+ (0, react_1.useImperativeHandle)(ref, () => scrollbarsRef.current);
17
+ (0, react_1.useEffect)(() => {
18
+ if (!contentRef.current || !scrollbarsRef.current) {
19
+ return;
20
+ }
21
+ const updateScrollbars = (0, debounce_1.default)(RESIZE_THROTTLING)(() => {
22
+ if (scrollbarsRef.current) {
23
+ // Trigger a update for the scrollbars.
24
+ // This is needed since the lib does not automatically update on content height changes
25
+ // See: https://github.com/RobPethick/react-custom-scrollbars-2/issues/12
26
+ // Use type assertion to tell TypeScript that 'update' exists
27
+ scrollbarsRef.current.update();
28
+ }
29
+ });
30
+ const resizeObserver = new ResizeObserver(updateScrollbars);
31
+ resizeObserver.observe(contentRef.current);
32
+ return () => {
33
+ resizeObserver.disconnect();
34
+ updateScrollbars.cancel();
35
+ };
36
+ }, []);
12
37
  const wrapperClassNames = (0, classnames_1.default)(className, slideIn && 'scrollbar-fly-in', 'smooth-scrollbar-wrapper');
13
38
  const renderTrackVerticalNames = (0, classnames_1.default)('scrollbar-track-vertical', largeTrack && 'scrollbar-track-size-large', trackOffset && 'scrollbar-track-offset');
14
39
  const renderThumbVerticalNames = (0, classnames_1.default)('scrollbar-thumb-vertical', largeTrack && 'scrollbar-thumb-size-large');
15
40
  const renderTrackHorizontalNames = (0, classnames_1.default)('scrollbar-track-horizontal', largeTrack && 'scrollbar-track-size-large', trackOffset && 'scrollbar-track-offset');
16
41
  const renderThumbHorizontalNames = (0, classnames_1.default)('scrollbar-thumb-horizontal', largeTrack && 'scrollbar-thumb-size-large');
17
- return ((0, jsx_runtime_1.jsx)(react_custom_scrollbars_2_1.Scrollbars, Object.assign({ ref: ref, tagName: tagName, onScroll: onScroll, className: wrapperClassNames, hideTracksWhenNotNeeded: true, autoHeight: autoHeight, autoHeightMin: autoHeightMin, autoHeightMax: autoHeightMax, renderView: props => {
42
+ return ((0, jsx_runtime_1.jsx)(react_custom_scrollbars_2_1.Scrollbars, Object.assign({ ref: scrollbarsRef, tagName: tagName, onScroll: onScroll, className: wrapperClassNames, hideTracksWhenNotNeeded: true, autoHeight: autoHeight, autoHeightMin: autoHeightMin, autoHeightMax: autoHeightMax, renderView: props => {
18
43
  return (0, jsx_runtime_1.jsx)("div", Object.assign({}, props, { className: 'scrollbar-view' }));
19
44
  }, renderTrackVertical: props => {
20
45
  return (0, jsx_runtime_1.jsx)("div", Object.assign({}, props, { className: renderTrackVerticalNames }));
@@ -24,6 +49,6 @@ const SmoothScrollbars = (0, react_1.forwardRef)((componentProps, ref) => {
24
49
  return (0, jsx_runtime_1.jsx)("div", Object.assign({}, props, { className: renderTrackHorizontalNames }));
25
50
  }, renderThumbHorizontal: props => {
26
51
  return (0, jsx_runtime_1.jsx)("div", Object.assign({}, props, { className: renderThumbHorizontalNames }));
27
- } }, { children: children })));
52
+ } }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'scrollbar-content-wrapper', ref: contentRef }, { children: children })) })));
28
53
  });
29
54
  exports.default = SmoothScrollbars;
@@ -1,4 +1,4 @@
1
- import { type PropsWithChildren } from 'react';
1
+ import React from 'react';
2
2
  import { type CurrentColor } from '../../utils/currentColors';
3
3
  export type SwitchProps = {
4
4
  /**
@@ -46,9 +46,10 @@ export type SwitchProps = {
46
46
  */
47
47
  labelPosition?: 'left' | 'right';
48
48
  };
49
- declare const Switch: {
50
- (props: PropsWithChildren<SwitchProps>): import("react/jsx-runtime").JSX.Element;
51
- LABEL_POSITION_LEFT: "left";
52
- LABEL_POSITION_RIGHT: "right";
49
+ declare const Switch: React.ForwardRefExoticComponent<SwitchProps & {
50
+ children?: React.ReactNode;
51
+ } & React.RefAttributes<HTMLDivElement>> & {
52
+ LABEL_POSITION_LEFT: 'left';
53
+ LABEL_POSITION_RIGHT: 'right';
53
54
  };
54
55
  export default Switch;
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  // @ts-ignore-next-line importsNotUsedAsValues
6
- require("react");
6
+ const react_1 = require("react");
7
7
  const classnames_1 = tslib_1.__importDefault(require("classnames"));
8
8
  const noop_1 = tslib_1.__importDefault(require("lodash/fp/noop"));
9
9
  const currentColors_1 = require("../../utils/currentColors");
10
- const Switch = (props) => {
11
- const { keyName, checked = false, enabledText, minWidth = 40, disabled = false, color = 'primary', disabledText, children, labelPosition = !!children ? 'right' : undefined, onChange = noop_1.default } = props, remainingProps = tslib_1.__rest(props, ["keyName", "checked", "enabledText", "minWidth", "disabled", "color", "disabledText", "children", "labelPosition", "onChange"]);
10
+ const Switch = (0, react_1.forwardRef)((props, ref) => {
11
+ const { keyName, checked = false, enabledText, minWidth = 40, disabled = false, color = 'primary', disabledText, children, labelPosition = children ? 'right' : undefined, onChange = noop_1.default } = props, remainingProps = tslib_1.__rest(props, ["keyName", "checked", "enabledText", "minWidth", "disabled", "color", "disabledText", "children", "labelPosition", "onChange"]);
12
12
  const handleChange = (event) => {
13
13
  onChange(event.target.checked);
14
14
  };
@@ -19,8 +19,8 @@ const Switch = (props) => {
19
19
  // !hasMultipleText && !hasSingleText && 'width-40'
20
20
  );
21
21
  const switchBackgroundColor = (0, currentColors_1.getCurrentBackgroundColor)(color);
22
- return ((0, jsx_runtime_1.jsx)("div", Object.assign({}, remainingProps, { className: 'uikit-switch' }, { children: (0, jsx_runtime_1.jsxs)("label", Object.assign({ className: switchLabelClasses }, { children: [(0, jsx_runtime_1.jsx)("input", { onChange: handleChange, checked: checked, type: 'checkbox', id: keyName, className: 'switch-input', disabled: disabled }, keyName), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: switchContentClasses, style: { color: switchBackgroundColor, minWidth } }, { children: [hasMultipleText ? ((0, jsx_runtime_1.jsx)("div", { className: 'switch-text', "data-on": enabledText, "data-off": disabledText })) : (hasSingleText && (0, jsx_runtime_1.jsx)("div", { className: 'switch-text', "data-on": enabledText, "data-off": enabledText })), (0, jsx_runtime_1.jsx)("div", { className: 'switch-handle' })] })), children && children] })) })));
23
- };
22
+ return ((0, jsx_runtime_1.jsx)("div", Object.assign({ ref: ref }, remainingProps, { className: 'uikit-switch' }, { children: (0, jsx_runtime_1.jsxs)("label", Object.assign({ className: switchLabelClasses }, { children: [(0, jsx_runtime_1.jsx)("input", { onChange: handleChange, checked: checked, type: 'checkbox', id: keyName, className: 'switch-input', disabled: disabled }, keyName), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: switchContentClasses, style: { color: switchBackgroundColor, minWidth } }, { children: [hasMultipleText ? ((0, jsx_runtime_1.jsx)("div", { className: 'switch-text', "data-on": enabledText, "data-off": disabledText })) : (hasSingleText && (0, jsx_runtime_1.jsx)("div", { className: 'switch-text', "data-on": enabledText, "data-off": enabledText })), (0, jsx_runtime_1.jsx)("div", { className: 'switch-handle' })] })), children && children] })) })));
23
+ });
24
24
  Switch.LABEL_POSITION_LEFT = 'left';
25
25
  Switch.LABEL_POSITION_RIGHT = 'right';
26
26
  exports.default = Switch;
@@ -1,4 +1,4 @@
1
- import { type PropsWithChildren } from 'react';
1
+ import React from 'react';
2
2
  export type TagProps = {
3
3
  /**
4
4
  * Defines if the tag is active.
@@ -65,5 +65,5 @@ export type TagProps = {
65
65
  */
66
66
  className?: string;
67
67
  };
68
- declare const Tag: (props: PropsWithChildren<TagProps>) => import("react/jsx-runtime").JSX.Element;
68
+ declare const Tag: React.ForwardRefExoticComponent<Omit<React.PropsWithChildren<TagProps>, "ref"> & React.RefAttributes<HTMLDivElement>>;
69
69
  export default Tag;
@@ -3,12 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  // @ts-ignore-next-line importsNotUsedAsValues
6
- require("react");
6
+ const react_1 = require("react");
7
7
  const classnames_1 = tslib_1.__importDefault(require("classnames"));
8
- const Tag = (props) => {
8
+ const Tag = (0, react_1.forwardRef)((props, ref) => {
9
9
  const { children, icon, active = false, disabled = false, clickable = false, selectable = false, deletable = false, revertable = false, multiline = false, muted = false, round = true, size, className } = props, remainingProps = tslib_1.__rest(props, ["children", "icon", "active", "disabled", "clickable", "selectable", "deletable", "revertable", "multiline", "muted", "round", "size", "className"]);
10
- const tagClasses = (0, classnames_1.default)('tag', size === 'small' && 'tag-small', icon && `rioglyph ${icon}`, active && 'active clickable rioglyph rioglyph-ok', disabled && 'disabled', clickable && 'clickable', selectable && 'selectable clickable rioglyph rioglyph-checkbox', deletable && 'deletable clickable rioglyph rioglyph-remove', revertable && 'revertable clickable rioglyph rioglyph-revert', multiline && 'multiline', muted && 'tag-muted', !round && 'rounded', // sounds wrong, but is right
11
- props.className);
12
- return ((0, jsx_runtime_1.jsx)("div", Object.assign({}, remainingProps, { className: tagClasses }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'tag-inner' }, { children: children })) })));
13
- };
10
+ const tagClasses = (0, classnames_1.default)('tag', size === 'small' && 'tag-small', icon && `rioglyph ${icon}`, active && 'active clickable rioglyph rioglyph-ok', disabled && 'disabled', clickable && 'clickable', selectable && 'selectable clickable rioglyph rioglyph-checkbox', deletable && 'deletable clickable rioglyph rioglyph-remove', revertable && 'revertable clickable rioglyph rioglyph-revert', multiline && 'multiline', muted && 'tag-muted', !round && 'rounded', className);
11
+ return ((0, jsx_runtime_1.jsx)("div", Object.assign({ ref: ref }, remainingProps, { className: tagClasses }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'tag-inner' }, { children: children })) })));
12
+ });
14
13
  exports.default = Tag;
@@ -0,0 +1,2 @@
1
+ declare const useDOMNodeCount: () => number;
2
+ export default useDOMNodeCount;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const react_1 = require("react");
4
+ const useDOMNodeCount = () => {
5
+ const [nodeCount, setNodeCount] = (0, react_1.useState)(0);
6
+ (0, react_1.useEffect)(() => {
7
+ const countNodes = () => {
8
+ const body = document.body;
9
+ if (body) {
10
+ setNodeCount(body.getElementsByTagName('*').length);
11
+ }
12
+ };
13
+ // Initial count
14
+ countNodes();
15
+ // Create a MutationObserver to watch for changes in the DOM
16
+ const observer = new MutationObserver(() => {
17
+ countNodes();
18
+ });
19
+ // Observe the body element for changes in the child list or subtree
20
+ observer.observe(document.body, {
21
+ childList: true,
22
+ subtree: true,
23
+ });
24
+ // Cleanup on unmount
25
+ return () => {
26
+ observer.disconnect();
27
+ };
28
+ }, []);
29
+ return nodeCount;
30
+ };
31
+ exports.default = useDOMNodeCount;
@@ -0,0 +1,5 @@
1
+ declare const useEventListenerCount: () => {
2
+ counts: Record<string, number>;
3
+ total: number;
4
+ };
5
+ export default useEventListenerCount;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const react_1 = require("react");
5
+ const throttle_1 = tslib_1.__importDefault(require("lodash/fp/throttle"));
6
+ const useEventListenerCount = () => {
7
+ const [listenerCounts, setListenerCounts] = (0, react_1.useState)({});
8
+ const [totalCount, setTotalCount] = (0, react_1.useState)(0);
9
+ (0, react_1.useEffect)(() => {
10
+ console.log('init useEventListener interceptor');
11
+ const eventListeners = new Set();
12
+ const originalAddEventListener = EventTarget.prototype.addEventListener;
13
+ const originalRemoveEventListener = EventTarget.prototype.removeEventListener;
14
+ const updateListeners = (0, throttle_1.default)(1000)(() => {
15
+ const counts = Array.from(eventListeners).reduce((acc, { type }) => {
16
+ acc[type] = (acc[type] || 0) + 1;
17
+ return acc;
18
+ }, {});
19
+ setListenerCounts(counts);
20
+ setTotalCount(eventListeners.size);
21
+ });
22
+ EventTarget.prototype.addEventListener = function (type, listener, options) {
23
+ if (listener) {
24
+ eventListeners.add({ type, listener });
25
+ updateListeners();
26
+ }
27
+ originalAddEventListener.call(this, type, listener, options);
28
+ };
29
+ EventTarget.prototype.removeEventListener = function (type, listener, options) {
30
+ eventListeners.forEach(item => {
31
+ if (item.type === type && item.listener === listener) {
32
+ eventListeners.delete(item);
33
+ }
34
+ });
35
+ updateListeners();
36
+ originalRemoveEventListener.call(this, type, listener, options);
37
+ };
38
+ return () => {
39
+ EventTarget.prototype.addEventListener = originalAddEventListener;
40
+ EventTarget.prototype.removeEventListener = originalRemoveEventListener;
41
+ };
42
+ }, []);
43
+ return { counts: listenerCounts, total: totalCount };
44
+ };
45
+ exports.default = useEventListenerCount;
@@ -0,0 +1,29 @@
1
+ import { type SortDirectionType } from '../utils/SortUtils';
2
+ type SortKey<T> = keyof T | [keyof T, keyof T];
3
+ type UseSortingResult<T> = {
4
+ /**
5
+ * The sorted data
6
+ */
7
+ sortedItems: T[];
8
+ /**
9
+ * The key(s) to sort the data for
10
+ */
11
+ sortKey: SortKey<T>;
12
+ /**
13
+ * The current direction that the data is sorted
14
+ */
15
+ sortDirection: SortDirectionType;
16
+ /**
17
+ * Function to change the sorting key(s) afterwards
18
+ * @param newKey the new sorting key(s)
19
+ * @returns
20
+ */
21
+ setSortKey: (newKey: SortKey<T>) => void;
22
+ /**
23
+ * Function to toggle the sorting between ascending and descending order
24
+ * @returns
25
+ */
26
+ toggleDirection: () => void;
27
+ };
28
+ declare const useSorting: <T>(items: T[], initialKey: SortKey<T>, initialDirection?: SortDirectionType, enableNaturalSort?: boolean, isCaseSensitive?: boolean) => UseSortingResult<T>;
29
+ export default useSorting;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const react_1 = require("react");
4
+ const SortUtils_1 = require("../utils/SortUtils");
5
+ const useSorting = (items, initialKey, initialDirection = SortUtils_1.SortDirection.ASCENDING, enableNaturalSort = true, isCaseSensitive = false) => {
6
+ const [sortKey, setSortKey] = (0, react_1.useState)(initialKey);
7
+ const [sortDirection, setSortDirection] = (0, react_1.useState)(initialDirection);
8
+ const sortedItems = (0, react_1.useMemo)(() => {
9
+ const sortByKey = (arr, key) => {
10
+ return enableNaturalSort
11
+ ? (0, SortUtils_1.naturalSortByProperty)(arr, key, sortDirection, isCaseSensitive)
12
+ : arr.sort((a, b) => {
13
+ const aVal = a[key];
14
+ const bVal = b[key];
15
+ if (aVal < bVal)
16
+ return sortDirection === SortUtils_1.SortDirection.ASCENDING ? -1 : 1;
17
+ if (aVal > bVal)
18
+ return sortDirection === SortUtils_1.SortDirection.ASCENDING ? 1 : -1;
19
+ return 0;
20
+ });
21
+ };
22
+ if (Array.isArray(sortKey)) {
23
+ const [primaryKey, secondaryKey] = sortKey;
24
+ const primarySorted = sortByKey(items, primaryKey);
25
+ // Group items with the same primary key value
26
+ const groups = primarySorted.reduce((acc, item) => {
27
+ const key = String(item[primaryKey]);
28
+ if (!acc[key])
29
+ acc[key] = [];
30
+ acc[key].push(item);
31
+ return acc;
32
+ }, {});
33
+ // Sort each group by the secondary key and flatten the result
34
+ return Object.values(groups).flatMap(group => sortByKey(group, secondaryKey));
35
+ }
36
+ return sortByKey(items, sortKey);
37
+ }, [items, sortKey, sortDirection, enableNaturalSort, isCaseSensitive]);
38
+ const toggleDirection = () => {
39
+ setSortDirection(prev => prev === SortUtils_1.SortDirection.ASCENDING ? SortUtils_1.SortDirection.DESCENDING : SortUtils_1.SortDirection.ASCENDING);
40
+ };
41
+ return { sortedItems, sortKey, sortDirection, setSortKey, toggleDirection };
42
+ };
43
+ exports.default = useSorting;
@@ -0,0 +1 @@
1
+ export * from './utils/storageUtils';
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./utils/storageUtils"), exports);
@@ -10,7 +10,7 @@
10
10
  "gray-light": "#D0D8DE",
11
11
  "gray-lighter": "#E5EBF0",
12
12
  "gray-lightest": "#f6f8f9",
13
- "gray-decent": "#fdfdfd",
13
+ "gray-decent": "#fcfcfd",
14
14
  "brand-primary": "#30b4c0",
15
15
  "brand-secondary": "#b23672",
16
16
  "brand-primary-decent": "#f4fbfc",
@@ -31,13 +31,14 @@
31
31
  "color-map-marker-text": "#ffffff",
32
32
  "color-map-marker-active": "#ffffff",
33
33
  "color-map-marker-asset": "#2a3740",
34
- "color-map-marker-poi": "#cb3995",
35
- "color-map-marker-geofence": "#8c63b9",
34
+ "color-map-marker-poi": "#d5429f",
35
+ "color-map-marker-geofence": "#f9636e",
36
36
  "color-map-marker-route": "#36afd7",
37
37
  "color-map-marker-info": "#3f759b",
38
38
  "color-map-marker-success": "#5cb85c",
39
39
  "color-map-marker-warning": "#ff8e3c",
40
40
  "color-map-marker-danger": "#e22837",
41
+ "color-map-marker-restrictions": "#8F68ED",
41
42
  "color-rating-1": "#e22837",
42
43
  "color-rating-2": "#ff8e3c",
43
44
  "color-rating-3": "#f8c575",
@@ -0,0 +1 @@
1
+ export * from './utils/urlFeatureToggles';
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./utils/urlFeatureToggles"), exports);
@@ -0,0 +1,2 @@
1
+ export { default } from './hooks/useDOMNodeCount';
2
+ export * from './hooks/useDOMNodeCount';
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = void 0;
4
+ const tslib_1 = require("tslib");
5
+ var useDOMNodeCount_1 = require("./hooks/useDOMNodeCount");
6
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return tslib_1.__importDefault(useDOMNodeCount_1).default; } });
7
+ tslib_1.__exportStar(require("./hooks/useDOMNodeCount"), exports);
@@ -0,0 +1,2 @@
1
+ export { default } from './hooks/useEventListenerCount';
2
+ export * from './hooks/useEventListenerCount';
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = void 0;
4
+ const tslib_1 = require("tslib");
5
+ var useEventListenerCount_1 = require("./hooks/useEventListenerCount");
6
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return tslib_1.__importDefault(useEventListenerCount_1).default; } });
7
+ tslib_1.__exportStar(require("./hooks/useEventListenerCount"), exports);
@@ -0,0 +1,2 @@
1
+ export { default } from './hooks/useSorting';
2
+ export * from './hooks/useSorting';
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = void 0;
4
+ const tslib_1 = require("tslib");
5
+ var useSorting_1 = require("./hooks/useSorting");
6
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return tslib_1.__importDefault(useSorting_1).default; } });
7
+ tslib_1.__exportStar(require("./hooks/useSorting"), exports);
@@ -0,0 +1,5 @@
1
+ export declare const storage: {
2
+ save: (key: string, value: string | boolean, prefix?: string) => string | boolean | undefined;
3
+ load: (key: string, prefix?: string) => string | undefined;
4
+ removeItem: (key: string, prefix?: string) => void;
5
+ };
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.storage = void 0;
4
+ const localStorage = window.localStorage;
5
+ const STORAGE_PREFIX = '';
6
+ const save = (key, value, prefix = STORAGE_PREFIX) => {
7
+ try {
8
+ localStorage.setItem(`${prefix}${key}`, JSON.stringify(value));
9
+ return value;
10
+ }
11
+ catch (_) {
12
+ // Intentionally left blank
13
+ }
14
+ };
15
+ const removeItem = (key, prefix = STORAGE_PREFIX) => {
16
+ try {
17
+ localStorage.removeItem(`${prefix}${key}`);
18
+ }
19
+ catch (_) {
20
+ // Intentionally left blank
21
+ }
22
+ };
23
+ const load = (key, prefix = STORAGE_PREFIX) => {
24
+ try {
25
+ const item = localStorage.getItem(`${prefix}${key}`);
26
+ return item && JSON.parse(item);
27
+ }
28
+ catch (_) {
29
+ // Intentionally left blank
30
+ }
31
+ };
32
+ exports.storage = { save, load, removeItem };
@@ -0,0 +1,10 @@
1
+ /// <reference types="lodash" />
2
+ export declare const DEFAULT_PREFIX = "featureToggle.";
3
+ export type ToggleType = string | boolean | number;
4
+ export declare const cleanupOldToggles: (oldToggles: string[], prefix: string) => void;
5
+ export declare const asBoolean: (urlParamName: string) => (prefix: string) => ToggleType | undefined;
6
+ export declare const asString: (urlParamName: string) => (prefix: string) => ToggleType | undefined;
7
+ export declare const asNumber: (urlParamName: string) => (prefix: string) => ToggleType | undefined;
8
+ export declare const detectFeatureToggles: (toggleDefinitions: {
9
+ [key: string]: (paramName: string) => ToggleType | undefined;
10
+ }, oldToggles?: string[], prefix?: string) => import("lodash").Dictionary<ToggleType | undefined>;