@rio-cloud/rio-uikit 1.2.2 → 1.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/.DS_Store +0 -0
- package/ChartLabel.d.ts +2 -0
- package/ChartLabel.js +2 -0
- package/ComposedChart.d.ts +2 -0
- package/ComposedChart.js +2 -0
- package/DateRangePicker.d.ts +6 -7
- package/DateRangePicker.js +7 -3
- package/GroupedItemList.d.ts +2 -0
- package/GroupedItemList.js +2 -0
- package/LicensePlate.d.ts +2 -0
- package/LicensePlate.js +2 -0
- package/README.md +3 -3
- package/ReferenceLine.d.ts +2 -0
- package/ReferenceLine.js +2 -0
- package/components/actionBarItem/ActionBarItem.js +5 -1
- package/components/actionBarItem/ActionBarItemIcon.d.ts +6 -8
- package/components/actionBarItem/ActionBarItemIcon.js +4 -4
- package/components/actionBarItem/ActionBarOverlay.d.ts +3 -2
- package/components/actionBarItem/ActionBarOverlay.js +7 -7
- package/components/applicationLayout/ApplicationLayout.js +1 -0
- package/components/applicationLayout/ApplicationLayoutHeader.js +0 -4
- package/components/assetTree/TreeOptions.js +8 -4
- package/components/assetTree/treeUtils.js +1 -1
- package/components/calendarStripe/CalendarStripe.d.ts +8 -0
- package/components/calendarStripe/CalendarStripe.js +7 -4
- package/components/charts/Area.d.ts +5 -0
- package/components/charts/Area.js +1 -9
- package/components/charts/AreaChart.d.ts +2 -0
- package/components/charts/AreaChart.js +9 -6
- package/components/charts/BarChart.js +4 -4
- package/components/charts/ChartLabel.d.ts +5 -0
- package/components/charts/ChartLabel.js +2 -0
- package/components/charts/ComposedChart.d.ts +34 -0
- package/components/charts/ComposedChart.js +30 -0
- package/components/charts/Legend.d.ts +8 -10
- package/components/charts/Legend.js +3 -12
- package/components/charts/Line.d.ts +5 -0
- package/components/charts/Line.js +1 -9
- package/components/charts/LineChart.d.ts +2 -0
- package/components/charts/LineChart.js +8 -5
- package/components/charts/PieChart.js +5 -5
- package/components/charts/RadialBarChart.js +5 -5
- package/components/charts/ReferenceLine.d.ts +7 -0
- package/components/charts/ReferenceLine.js +2 -0
- package/components/dataTabs/DataTab.js +2 -1
- package/components/dialog/Dialog.d.ts +12 -4
- package/components/dialog/SimpleDialog.d.ts +2 -2
- package/components/dialog/SplitDialog.d.ts +6 -0
- package/components/expander/ExpanderList.js +2 -1
- package/components/groupedItemList/GroupedItemList.d.ts +79 -0
- package/components/groupedItemList/GroupedItemList.js +77 -0
- package/components/licensePlate/LicensePlate.d.ts +19 -0
- package/components/licensePlate/LicensePlate.js +14 -0
- package/components/listMenu/ListMenu.js +1 -1
- package/components/onboarding/OnboardingTip.d.ts +2 -2
- package/components/onboarding/OnboardingTip.js +2 -0
- package/components/overlay/OverlayTrigger.d.ts +92 -3
- package/components/overlay/OverlayTrigger.js +140 -8
- package/components/popover/Popover.d.ts +27 -9
- package/components/popover/Popover.js +18 -5
- package/components/selects/BaseSelectDropdown.d.ts +1 -0
- package/components/selects/BaseSelectDropdown.js +16 -14
- package/components/selects/Multiselect.d.ts +5 -0
- package/components/selects/Multiselect.js +2 -2
- package/components/selects/Select.d.ts +5 -0
- package/components/selects/Select.js +2 -2
- package/components/slider/RangeSlider.d.ts +7 -0
- package/components/slider/RangeSlider.js +10 -4
- package/components/slider/Slider.d.ts +7 -0
- package/components/slider/Slider.js +5 -3
- package/components/states/CustomState.js +4 -5
- package/components/switch/Switch.d.ts +7 -0
- package/components/switch/Switch.js +4 -3
- package/components/tooltip/SimpleTooltip.d.ts +2 -2
- package/components/tooltip/Tooltip.d.ts +2 -2
- package/components/tooltip/Tooltip.js +6 -2
- package/hooks/useClickOutside.d.ts +1 -0
- package/hooks/useClickOutside.js +9 -3
- package/hooks/useElapsedTime.d.ts +26 -0
- package/hooks/useElapsedTime.js +36 -0
- package/hooks/useEvent.d.ts +1 -1
- package/hooks/useKey.d.ts +7 -4
- package/hooks/useKey.js +36 -8
- package/hooks/useTimeout.d.ts +5 -0
- package/hooks/useTimeout.js +39 -1
- package/hooks/useUncontrollable.d.ts +13 -0
- package/hooks/useUncontrollable.js +41 -0
- package/lib/es/ChartLabel.d.ts +2 -0
- package/lib/es/ChartLabel.js +7 -0
- package/lib/es/ComposedChart.d.ts +2 -0
- package/lib/es/ComposedChart.js +7 -0
- package/lib/es/DateRangePicker.d.ts +6 -7
- package/lib/es/DateRangePicker.js +5 -1
- package/lib/es/GroupedItemList.d.ts +2 -0
- package/lib/es/GroupedItemList.js +7 -0
- package/lib/es/LicensePlate.d.ts +2 -0
- package/lib/es/LicensePlate.js +7 -0
- package/lib/es/ReferenceLine.d.ts +2 -0
- package/lib/es/ReferenceLine.js +7 -0
- package/lib/es/components/actionBarItem/ActionBarItem.js +5 -1
- package/lib/es/components/actionBarItem/ActionBarItemIcon.d.ts +6 -8
- package/lib/es/components/actionBarItem/ActionBarItemIcon.js +4 -4
- package/lib/es/components/actionBarItem/ActionBarOverlay.d.ts +3 -2
- package/lib/es/components/actionBarItem/ActionBarOverlay.js +7 -7
- package/lib/es/components/applicationLayout/ApplicationLayout.js +1 -0
- package/lib/es/components/applicationLayout/ApplicationLayoutHeader.js +0 -4
- package/lib/es/components/assetTree/TreeOptions.js +8 -4
- package/lib/es/components/assetTree/treeUtils.js +1 -1
- package/lib/es/components/calendarStripe/CalendarStripe.d.ts +8 -0
- package/lib/es/components/calendarStripe/CalendarStripe.js +7 -4
- package/lib/es/components/charts/Area.d.ts +5 -0
- package/lib/es/components/charts/Area.js +1 -9
- package/lib/es/components/charts/AreaChart.d.ts +2 -0
- package/lib/es/components/charts/AreaChart.js +7 -4
- package/lib/es/components/charts/BarChart.js +3 -3
- package/lib/es/components/charts/ChartLabel.d.ts +5 -0
- package/lib/es/components/charts/ChartLabel.js +4 -0
- package/lib/es/components/charts/ComposedChart.d.ts +34 -0
- package/lib/es/components/charts/ComposedChart.js +32 -0
- package/lib/es/components/charts/Legend.d.ts +8 -10
- package/lib/es/components/charts/Legend.js +5 -12
- package/lib/es/components/charts/Line.d.ts +5 -0
- package/lib/es/components/charts/Line.js +1 -9
- package/lib/es/components/charts/LineChart.d.ts +2 -0
- package/lib/es/components/charts/LineChart.js +7 -4
- package/lib/es/components/charts/PieChart.js +4 -4
- package/lib/es/components/charts/RadialBarChart.js +4 -4
- package/lib/es/components/charts/ReferenceLine.d.ts +7 -0
- package/lib/es/components/charts/ReferenceLine.js +4 -0
- package/lib/es/components/dataTabs/DataTab.js +2 -1
- package/lib/es/components/dialog/Dialog.d.ts +12 -4
- package/lib/es/components/dialog/SimpleDialog.d.ts +2 -2
- package/lib/es/components/dialog/SplitDialog.d.ts +6 -0
- package/lib/es/components/expander/ExpanderList.js +2 -1
- package/lib/es/components/groupedItemList/GroupedItemList.d.ts +79 -0
- package/lib/es/components/groupedItemList/GroupedItemList.js +80 -0
- package/lib/es/components/licensePlate/LicensePlate.d.ts +19 -0
- package/lib/es/components/licensePlate/LicensePlate.js +16 -0
- package/lib/es/components/listMenu/ListMenu.js +1 -1
- package/lib/es/components/onboarding/OnboardingTip.d.ts +2 -2
- package/lib/es/components/onboarding/OnboardingTip.js +2 -0
- package/lib/es/components/overlay/OverlayTrigger.d.ts +92 -3
- package/lib/es/components/overlay/OverlayTrigger.js +139 -7
- package/lib/es/components/popover/Popover.d.ts +27 -9
- package/lib/es/components/popover/Popover.js +20 -6
- package/lib/es/components/selects/BaseSelectDropdown.d.ts +1 -0
- package/lib/es/components/selects/BaseSelectDropdown.js +16 -14
- package/lib/es/components/selects/Multiselect.d.ts +5 -0
- package/lib/es/components/selects/Multiselect.js +2 -2
- package/lib/es/components/selects/Select.d.ts +5 -0
- package/lib/es/components/selects/Select.js +2 -2
- package/lib/es/components/slider/RangeSlider.d.ts +7 -0
- package/lib/es/components/slider/RangeSlider.js +10 -4
- package/lib/es/components/slider/Slider.d.ts +7 -0
- package/lib/es/components/slider/Slider.js +5 -3
- package/lib/es/components/states/CustomState.js +4 -5
- package/lib/es/components/switch/Switch.d.ts +7 -0
- package/lib/es/components/switch/Switch.js +4 -3
- package/lib/es/components/tooltip/SimpleTooltip.d.ts +2 -2
- package/lib/es/components/tooltip/Tooltip.d.ts +2 -2
- package/lib/es/components/tooltip/Tooltip.js +5 -1
- package/lib/es/hooks/useClickOutside.d.ts +1 -0
- package/lib/es/hooks/useClickOutside.js +11 -3
- package/lib/es/hooks/useElapsedTime.d.ts +26 -0
- package/lib/es/hooks/useElapsedTime.js +38 -0
- package/lib/es/hooks/useEvent.d.ts +1 -1
- package/lib/es/hooks/useKey.d.ts +7 -4
- package/lib/es/hooks/useKey.js +35 -7
- package/lib/es/hooks/useTimeout.d.ts +5 -0
- package/lib/es/hooks/useTimeout.js +40 -0
- package/lib/es/hooks/useUncontrollable.d.ts +13 -0
- package/lib/es/hooks/useUncontrollable.js +46 -0
- package/lib/es/styles/variables/colors/colors.json +3 -3
- package/lib/es/useElapsedTime.d.ts +2 -0
- package/lib/es/useElapsedTime.js +7 -0
- package/lib/es/utils/colorScheme.js +10 -8
- package/lib/es/utils/currentColors.d.ts +3 -0
- package/lib/es/utils/currentColors.js +14 -0
- package/lib/es/utils/hasUtilityClass.d.ts +30 -0
- package/lib/es/utils/hasUtilityClass.js +71 -0
- package/lib/es/utils/init/initCSS.js +12 -0
- package/lib/es/utils/mergeRefs.d.ts +1 -1
- package/lib/es/values/Trigger.d.ts +1 -2
- package/lib/es/version.json +1 -1
- package/package.json +26 -20
- package/styles/variables/colors/colors.json +3 -3
- package/useElapsedTime.d.ts +2 -0
- package/useElapsedTime.js +2 -0
- package/utils/colorScheme.js +10 -8
- package/utils/currentColors.d.ts +3 -0
- package/utils/currentColors.js +10 -0
- package/utils/hasUtilityClass.d.ts +30 -0
- package/utils/hasUtilityClass.js +40 -0
- package/utils/init/initCSS.js +12 -0
- package/utils/mergeRefs.d.ts +1 -1
- package/values/Trigger.d.ts +1 -2
- package/version.json +1 -1
- package/components/.DS_Store +0 -0
- package/components/feedback/Feedback.d.ts +0 -2
- package/components/feedback/Feedback.js +0 -5
- package/components/map/.DS_Store +0 -0
- package/components/map/components/.DS_Store +0 -0
- package/lib/.DS_Store +0 -0
- package/lib/es/.DS_Store +0 -0
- package/lib/es/components/.DS_Store +0 -0
- package/lib/es/components/feedback/Feedback.d.ts +0 -2
- package/lib/es/components/feedback/Feedback.js +0 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef, } from 'react';
|
|
3
|
+
import { useEffect, useState, forwardRef, } from 'react';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import omit from 'lodash/fp/omit';
|
|
6
6
|
import { isDesktop } from '../../utils/deviceUtils';
|
|
@@ -17,13 +17,17 @@ const TEXT_ALIGNMENT_MAP = {
|
|
|
17
17
|
};
|
|
18
18
|
const Tooltip = forwardRef((props, ref) => {
|
|
19
19
|
const _a = omit(['popper', 'positionLeft', 'positionTop'], props), { allowOnTouch = false, arrowProps, children, className = '', innerClassName = '', placement = 'bottom', style, textAlignment = 'center', tooltipStyle = 'default', width = 'auto' } = _a, remainingProps = __rest(_a, ["allowOnTouch", "arrowProps", "children", "className", "innerClassName", "placement", "style", "textAlignment", "tooltipStyle", "width"]);
|
|
20
|
+
// Mount the component but don't show it yet via CSS.
|
|
21
|
+
// After it is mounted, we set the visibility class to use CSS animation
|
|
22
|
+
const [isMounted, setIsMounted] = useState(false);
|
|
23
|
+
useEffect(() => setIsMounted(true), []);
|
|
20
24
|
if (!isDesktop() && !allowOnTouch) {
|
|
21
25
|
// Workaround: we have to return a DOM node as otherwise the
|
|
22
26
|
// react-transition library would throw an error on mobile
|
|
23
27
|
// when triggering a browser reflow and accessing the node directly.
|
|
24
28
|
return _jsx("span", { className: 'display-none' });
|
|
25
29
|
}
|
|
26
|
-
const wrapperClasses = classNames('tooltip', tooltipStyle && `tooltip-${tooltipStyle}`, placement, className);
|
|
30
|
+
const wrapperClasses = classNames('tooltip', tooltipStyle && `tooltip-${tooltipStyle}`, placement, 'fade', isMounted && 'show', className);
|
|
27
31
|
const innerClasses = classNames('tooltip-inner', textAlignment && `text-${textAlignment}`, width && `width-${width}`, innerClassName && innerClassName);
|
|
28
32
|
/* eslint-disable react/no-unknown-property */
|
|
29
33
|
return (_jsxs("div", Object.assign({}, remainingProps, { role: 'tooltip', "x-placement": placement, ref: ref, className: wrapperClasses, style: Object.assign({}, style), "data-offset": 20 }, { children: [_jsx("div", Object.assign({ className: 'tooltip-arrow' }, arrowProps)), _jsx("div", Object.assign({ className: innerClasses }, { children: children }))] })));
|
|
@@ -9,4 +9,5 @@ export type EventListenerType = keyof DocumentEventMap;
|
|
|
9
9
|
* @returns A mutable ref object representing the target element.
|
|
10
10
|
*/
|
|
11
11
|
declare const useClickOutside: <T extends HTMLElement = any>(callback: (event: MouseEvent | TouchEvent) => void, events?: EventListenerType[]) => import("react").MutableRefObject<T>;
|
|
12
|
+
export declare const useClickOutsideWithRef: <T extends HTMLElement = any>(ref: React.MutableRefObject<HTMLElement | null> | HTMLElement | null, callback: (event: MouseEvent | TouchEvent) => void, events?: EventListenerType[]) => void;
|
|
12
13
|
export default useClickOutside;
|
package/hooks/useClickOutside.js
CHANGED
|
@@ -12,10 +12,17 @@ import { useEffect, useRef } from 'react';
|
|
|
12
12
|
*/
|
|
13
13
|
const useClickOutside = (callback, events = ['mousedown', 'touchstart']) => {
|
|
14
14
|
const targetRef = useRef(null);
|
|
15
|
+
useClickOutsideWithRef(targetRef, callback, events);
|
|
16
|
+
return targetRef;
|
|
17
|
+
};
|
|
18
|
+
// Internal use for now - extend it later to be used outside
|
|
19
|
+
export const useClickOutsideWithRef = (ref, callback, events = ['mousedown', 'touchstart']) => {
|
|
15
20
|
useEffect(() => {
|
|
21
|
+
// In case the ref is actually a state and will be set via the state setter function
|
|
22
|
+
const element = ref && 'current' in ref ? ref.current : ref;
|
|
16
23
|
// Event listener function to check if the click is outside the target element
|
|
17
24
|
const listener = (event) => {
|
|
18
|
-
if (
|
|
25
|
+
if (element && !element.contains(event.target)) {
|
|
19
26
|
callback(event);
|
|
20
27
|
}
|
|
21
28
|
};
|
|
@@ -25,7 +32,6 @@ const useClickOutside = (callback, events = ['mousedown', 'touchstart']) => {
|
|
|
25
32
|
return () => {
|
|
26
33
|
events.forEach(eventType => document.removeEventListener(eventType, listener));
|
|
27
34
|
};
|
|
28
|
-
}, [
|
|
29
|
-
return targetRef;
|
|
35
|
+
}, [ref, callback, events]);
|
|
30
36
|
};
|
|
31
37
|
export default useClickOutside;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom React hook to measure the elapsed time since a specified start time or the component's mount time.
|
|
3
|
+
*
|
|
4
|
+
* @param {number} [startTime=Date.now()] - The start time in milliseconds from which to measure the elapsed time.
|
|
5
|
+
* @returns {Function} A function that returns the elapsed time in milliseconds since the specified start time
|
|
6
|
+
* or the component's mount time.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* import useElapsedTime from '@rio-cloud/rio-uikit/useElapsedTime';
|
|
10
|
+
* import Button from '@rio-cloud/rio-uikit/Button';
|
|
11
|
+
*
|
|
12
|
+
* const MyComponent = () => {
|
|
13
|
+
* const getElapsedTime = useElapsedTime();
|
|
14
|
+
*
|
|
15
|
+
* const handleClick = () => {
|
|
16
|
+
* const elapsedTime = getElapsedTime();
|
|
17
|
+
* console.log(`Elapsed time: ${elapsedTime} ms`);
|
|
18
|
+
* };
|
|
19
|
+
*
|
|
20
|
+
* return (
|
|
21
|
+
* <Button onClick={handleClick}>Get elapsed time</Button>
|
|
22
|
+
* );
|
|
23
|
+
* };
|
|
24
|
+
*/
|
|
25
|
+
declare const useElapsedTime: (startTime?: number) => (() => number);
|
|
26
|
+
export default useElapsedTime;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useRef, useEffect } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Custom React hook to measure the elapsed time since a specified start time or the component's mount time.
|
|
4
|
+
*
|
|
5
|
+
* @param {number} [startTime=Date.now()] - The start time in milliseconds from which to measure the elapsed time.
|
|
6
|
+
* @returns {Function} A function that returns the elapsed time in milliseconds since the specified start time
|
|
7
|
+
* or the component's mount time.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* import useElapsedTime from '@rio-cloud/rio-uikit/useElapsedTime';
|
|
11
|
+
* import Button from '@rio-cloud/rio-uikit/Button';
|
|
12
|
+
*
|
|
13
|
+
* const MyComponent = () => {
|
|
14
|
+
* const getElapsedTime = useElapsedTime();
|
|
15
|
+
*
|
|
16
|
+
* const handleClick = () => {
|
|
17
|
+
* const elapsedTime = getElapsedTime();
|
|
18
|
+
* console.log(`Elapsed time: ${elapsedTime} ms`);
|
|
19
|
+
* };
|
|
20
|
+
*
|
|
21
|
+
* return (
|
|
22
|
+
* <Button onClick={handleClick}>Get elapsed time</Button>
|
|
23
|
+
* );
|
|
24
|
+
* };
|
|
25
|
+
*/
|
|
26
|
+
const useElapsedTime = (startTime = Date.now()) => {
|
|
27
|
+
const startTimeRef = useRef(startTime);
|
|
28
|
+
const getElapsedTime = () => {
|
|
29
|
+
return Date.now() - startTimeRef.current;
|
|
30
|
+
};
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
startTimeRef.current = startTime;
|
|
33
|
+
}, [startTime]);
|
|
34
|
+
return getElapsedTime;
|
|
35
|
+
};
|
|
36
|
+
export default useElapsedTime;
|
package/hooks/useEvent.d.ts
CHANGED
|
@@ -14,5 +14,5 @@ type WindowEventMapWithFullscreen = {
|
|
|
14
14
|
* @param options - Optional. An object that specifies characteristics about the event listener.
|
|
15
15
|
* @param target - Optional. The target element to which to attach the event listener.
|
|
16
16
|
*/
|
|
17
|
-
declare const useEvent: <K extends keyof WindowEventMap, W extends keyof WindowEventMapWithFullscreen, T extends HTMLElement = HTMLDivElement>(eventType: K | W, callback: EventListener, options?: boolean | AddEventListenerOptions, target?:
|
|
17
|
+
declare const useEvent: <K extends keyof WindowEventMap, W extends keyof WindowEventMapWithFullscreen, T extends HTMLElement = HTMLDivElement>(eventType: K | W, callback: EventListener, options?: boolean | AddEventListenerOptions, target?: Document | Window | T | null) => void;
|
|
18
18
|
export default useEvent;
|
package/hooks/useKey.d.ts
CHANGED
|
@@ -2,9 +2,12 @@ type KeyboardEventType = 'keyup' | 'keydown' | 'keypress';
|
|
|
2
2
|
/**
|
|
3
3
|
* Custom hook to handle keyboard events.
|
|
4
4
|
*
|
|
5
|
-
* @param
|
|
6
|
-
* @param
|
|
7
|
-
*
|
|
5
|
+
* @param keyOrCallback - Either a key string (e.g., 'Enter') or a callback function.
|
|
6
|
+
* @param callbackOrEventTypes - If the first argument is a key, this should be the callback function.
|
|
7
|
+
* If the first argument is a callback, this is an optional array of event types.
|
|
8
|
+
* @param [eventTypesOrNode=['keydown']] - If the first argument is a key, this should be an array of event types.
|
|
9
|
+
* If the first argument is a callback, this is the node (defaults to document).
|
|
10
|
+
* @param [node=document] - Optional DOM node to attach the event listener to (defaults to document).
|
|
8
11
|
*/
|
|
9
|
-
declare const useKey: (
|
|
12
|
+
declare const useKey: (keyOrCallback: string | ((event: KeyboardEvent) => void), callbackOrEventTypes?: ((event: KeyboardEvent) => void | KeyboardEventType[]) | undefined, eventTypesOrNode?: KeyboardEventType[] | Document, node?: Document | HTMLElement) => void;
|
|
10
13
|
export default useKey;
|
package/hooks/useKey.js
CHANGED
|
@@ -1,21 +1,49 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* Custom hook to handle keyboard events.
|
|
4
4
|
*
|
|
5
|
-
* @param
|
|
6
|
-
* @param
|
|
7
|
-
*
|
|
5
|
+
* @param keyOrCallback - Either a key string (e.g., 'Enter') or a callback function.
|
|
6
|
+
* @param callbackOrEventTypes - If the first argument is a key, this should be the callback function.
|
|
7
|
+
* If the first argument is a callback, this is an optional array of event types.
|
|
8
|
+
* @param [eventTypesOrNode=['keydown']] - If the first argument is a key, this should be an array of event types.
|
|
9
|
+
* If the first argument is a callback, this is the node (defaults to document).
|
|
10
|
+
* @param [node=document] - Optional DOM node to attach the event listener to (defaults to document).
|
|
8
11
|
*/
|
|
9
|
-
const useKey = (
|
|
12
|
+
const useKey = (keyOrCallback, callbackOrEventTypes, eventTypesOrNode = ['keydown'], node = document) => {
|
|
13
|
+
const callbacksRef = useRef([]);
|
|
10
14
|
useEffect(() => {
|
|
15
|
+
const isKeyMode = typeof keyOrCallback === 'string';
|
|
16
|
+
const callback = isKeyMode
|
|
17
|
+
? callbackOrEventTypes
|
|
18
|
+
: keyOrCallback;
|
|
19
|
+
const keyHandler = (event) => {
|
|
20
|
+
if (isKeyMode) {
|
|
21
|
+
if (event.key === keyOrCallback) {
|
|
22
|
+
callback(event);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
callback(event);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
// Register the keyHandler
|
|
30
|
+
callbacksRef.current.push(keyHandler);
|
|
31
|
+
const genericHandler = (event) => {
|
|
32
|
+
for (const callBecky of callbacksRef.current) {
|
|
33
|
+
callBecky(event);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const eventTypes = Array.isArray(eventTypesOrNode) ? eventTypesOrNode : ['keydown'];
|
|
11
37
|
for (const eventType of eventTypes) {
|
|
12
|
-
node.addEventListener(eventType,
|
|
38
|
+
node.addEventListener(eventType, genericHandler);
|
|
13
39
|
}
|
|
14
40
|
return () => {
|
|
15
41
|
for (const eventType of eventTypes) {
|
|
16
|
-
node.removeEventListener(eventType,
|
|
42
|
+
node.removeEventListener(eventType, genericHandler);
|
|
17
43
|
}
|
|
44
|
+
// Clean up callback reference
|
|
45
|
+
callbacksRef.current = callbacksRef.current.filter(singleCallback => singleCallback !== keyHandler);
|
|
18
46
|
};
|
|
19
|
-
}, [
|
|
47
|
+
}, [keyOrCallback, callbackOrEventTypes, eventTypesOrNode, node]);
|
|
20
48
|
};
|
|
21
49
|
export default useKey;
|
package/hooks/useTimeout.d.ts
CHANGED
|
@@ -8,4 +8,9 @@ import React from 'react';
|
|
|
8
8
|
* @returns A mutable ref object to manage the timeout ID.
|
|
9
9
|
*/
|
|
10
10
|
declare const useTimeout: (callback: () => void, delay: number | null) => React.MutableRefObject<number | null>;
|
|
11
|
+
export declare const useChainedTimeout: () => {
|
|
12
|
+
set: (fn: () => void, delayMs?: number) => void;
|
|
13
|
+
clear: () => void;
|
|
14
|
+
handleRef: React.MutableRefObject<any>;
|
|
15
|
+
};
|
|
11
16
|
export default useTimeout;
|
package/hooks/useTimeout.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect, useRef } from 'react';
|
|
1
|
+
import { useEffect, useMemo, useRef } from 'react';
|
|
2
2
|
// See www.joshwcomeau.com/snippets/react-hooks/use-timeout/
|
|
3
3
|
/**
|
|
4
4
|
* A custom hook for handling timeout events.
|
|
@@ -31,4 +31,42 @@ const useTimeout = (callback, delay) => {
|
|
|
31
31
|
}, [delay]);
|
|
32
32
|
return timeoutRef;
|
|
33
33
|
};
|
|
34
|
+
export const useChainedTimeout = () => {
|
|
35
|
+
const MAX_DELAY_MS = Math.pow(2, 31) - 1;
|
|
36
|
+
const setChainedTimeout = (ref, fn, timeoutAtMs) => {
|
|
37
|
+
const delayMs = timeoutAtMs - Date.now();
|
|
38
|
+
ref.current =
|
|
39
|
+
delayMs <= MAX_DELAY_MS
|
|
40
|
+
? setTimeout(fn, delayMs)
|
|
41
|
+
: setTimeout(() => setChainedTimeout(ref, fn, timeoutAtMs), MAX_DELAY_MS);
|
|
42
|
+
};
|
|
43
|
+
const handleRef = useRef();
|
|
44
|
+
const { set, clear } = useMemo(() => {
|
|
45
|
+
const clear = () => clearTimeout(handleRef.current);
|
|
46
|
+
const set = (fn, delayMs = 0) => {
|
|
47
|
+
clear();
|
|
48
|
+
if (delayMs <= MAX_DELAY_MS) {
|
|
49
|
+
// For simplicity, if the timeout is short, just set a normal timeout.
|
|
50
|
+
handleRef.current = setTimeout(fn, delayMs);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
setChainedTimeout(handleRef, fn, Date.now() + delayMs);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
return {
|
|
57
|
+
set,
|
|
58
|
+
clear,
|
|
59
|
+
};
|
|
60
|
+
}, []);
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
return () => {
|
|
63
|
+
clear();
|
|
64
|
+
};
|
|
65
|
+
}, [clear]);
|
|
66
|
+
return {
|
|
67
|
+
set,
|
|
68
|
+
clear,
|
|
69
|
+
handleRef,
|
|
70
|
+
};
|
|
71
|
+
};
|
|
34
72
|
export default useTimeout;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type Handler = (value: any, ...args: any[]) => any;
|
|
2
|
+
export declare function defaultKey(key: string): string;
|
|
3
|
+
declare function useUncontrolledProp<TProp, THandler extends Handler = Handler>(propValue: TProp | undefined, defaultValue: TProp, handler?: THandler): readonly [TProp, THandler];
|
|
4
|
+
declare function useUncontrolledProp<TProp, THandler extends Handler = Handler>(propValue: TProp | undefined, defaultValue?: TProp | undefined, handler?: THandler): readonly [TProp | undefined, (...args: Parameters<THandler>) => ReturnType<THandler> | void];
|
|
5
|
+
export { useUncontrolledProp };
|
|
6
|
+
type FilterFlags<Base, Condition> = {
|
|
7
|
+
[Key in keyof Base]: NonNullable<Base[Key]> extends Condition ? Key : never;
|
|
8
|
+
};
|
|
9
|
+
type AllowedNames<Base, Condition> = FilterFlags<Base, Condition>[keyof Base];
|
|
10
|
+
type ConfigMap<TProps extends object> = {
|
|
11
|
+
[p in keyof TProps]?: AllowedNames<TProps, Function>;
|
|
12
|
+
};
|
|
13
|
+
export declare function useUncontrolled<TProps extends object, TDefaults extends string = never>(props: TProps, config: ConfigMap<TProps>): Omit<TProps, TDefaults>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
/* eslint-disable prefer-arrow/prefer-arrow-functions */
|
|
3
|
+
// forked from https://github.com/jquense/uncontrollable/blob/master/src/index.ts
|
|
4
|
+
import { useCallback, useRef, useState } from 'react';
|
|
5
|
+
export function defaultKey(key) {
|
|
6
|
+
return 'default' + key.charAt(0).toUpperCase() + key.substr(1);
|
|
7
|
+
}
|
|
8
|
+
function useUncontrolledProp(propValue, defaultValue, handler) {
|
|
9
|
+
const wasPropRef = useRef(propValue !== undefined);
|
|
10
|
+
const [stateValue, setState] = useState(defaultValue);
|
|
11
|
+
const isProp = propValue !== undefined;
|
|
12
|
+
const wasProp = wasPropRef.current;
|
|
13
|
+
wasPropRef.current = isProp;
|
|
14
|
+
/**
|
|
15
|
+
* If a prop switches from controlled to Uncontrolled
|
|
16
|
+
* reset its value to the defaultValue
|
|
17
|
+
*/
|
|
18
|
+
if (!isProp && wasProp && stateValue !== defaultValue) {
|
|
19
|
+
setState(defaultValue);
|
|
20
|
+
}
|
|
21
|
+
return [
|
|
22
|
+
isProp ? propValue : stateValue,
|
|
23
|
+
useCallback((...args) => {
|
|
24
|
+
const [value, ...rest] = args;
|
|
25
|
+
const returnValue = handler === null || handler === void 0 ? void 0 : handler(value, ...rest);
|
|
26
|
+
setState(value);
|
|
27
|
+
return returnValue;
|
|
28
|
+
}, [handler]),
|
|
29
|
+
];
|
|
30
|
+
}
|
|
31
|
+
export { useUncontrolledProp };
|
|
32
|
+
export function useUncontrolled(props, config) {
|
|
33
|
+
return Object.keys(config).reduce((result, fieldName) => {
|
|
34
|
+
const _a = result, _b = defaultKey(fieldName), defaultValue = _a[_b], _c = fieldName, propsValue = _a[_c], rest = __rest(_a, [typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + ""]);
|
|
35
|
+
// @ts-ignore-next-line
|
|
36
|
+
const handlerName = config[fieldName];
|
|
37
|
+
// @ts-ignore-next-line
|
|
38
|
+
const [value, handler] = useUncontrolledProp(propsValue, defaultValue, props[handlerName]);
|
|
39
|
+
return Object.assign(Object.assign({}, rest), { [fieldName]: value, [handlerName]: handler });
|
|
40
|
+
}, props);
|
|
41
|
+
}
|
|
@@ -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 ChartLabel_1 = require("./components/charts/ChartLabel");
|
|
6
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return tslib_1.__importDefault(ChartLabel_1).default; } });
|
|
7
|
+
tslib_1.__exportStar(require("./components/charts/ChartLabel"), exports);
|
|
@@ -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 ComposedChart_1 = require("./components/charts/ComposedChart");
|
|
6
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return tslib_1.__importDefault(ComposedChart_1).default; } });
|
|
7
|
+
tslib_1.__exportStar(require("./components/charts/ComposedChart"), exports);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { JSX, PropsWithChildren, ReactNode } from 'react';
|
|
2
2
|
import type { Moment } from 'moment/moment';
|
|
3
|
-
export
|
|
3
|
+
export type DateRangePickerCustomPresets = {
|
|
4
4
|
startValue: Moment;
|
|
5
5
|
endValue: Moment;
|
|
6
6
|
text: string | JSX.Element;
|
|
7
7
|
onSelect?: Function;
|
|
8
|
-
}
|
|
9
|
-
export
|
|
8
|
+
};
|
|
9
|
+
export type DateRangePickerProps = {
|
|
10
10
|
startValue?: Moment;
|
|
11
11
|
endValue?: Moment;
|
|
12
12
|
defaultStartValue?: Moment;
|
|
@@ -34,11 +34,10 @@ export interface DateRangePickerProps {
|
|
|
34
34
|
dropup?: boolean;
|
|
35
35
|
pullRight?: boolean;
|
|
36
36
|
autoDropDirection?: boolean;
|
|
37
|
-
}
|
|
37
|
+
};
|
|
38
38
|
/**
|
|
39
39
|
* Wrapper component for React-Datetime.
|
|
40
40
|
*
|
|
41
41
|
* @deprecated This will be removed from the UIKIT at some time.
|
|
42
42
|
*/
|
|
43
|
-
declare const DateRangePicker:
|
|
44
|
-
export { DateRangePicker };
|
|
43
|
+
export declare const DateRangePicker: (props: PropsWithChildren<DateRangePickerProps>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DateRangePicker = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
6
|
const DateRangePicker_1 = tslib_1.__importDefault(require("./components/datepicker/DateRangePicker"));
|
|
6
7
|
/**
|
|
7
8
|
* Wrapper component for React-Datetime.
|
|
8
9
|
*
|
|
9
10
|
* @deprecated This will be removed from the UIKIT at some time.
|
|
10
11
|
*/
|
|
11
|
-
const DateRangePicker =
|
|
12
|
+
const DateRangePicker = (props) => {
|
|
13
|
+
const { children } = props, remainingProps = tslib_1.__rest(props, ["children"]);
|
|
14
|
+
return (0, jsx_runtime_1.jsx)(DateRangePicker_1.default, Object.assign({}, remainingProps, { children: children }));
|
|
15
|
+
};
|
|
12
16
|
exports.DateRangePicker = DateRangePicker;
|
|
@@ -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 GroupedItemList_1 = require("./components/groupedItemList/GroupedItemList");
|
|
6
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return tslib_1.__importDefault(GroupedItemList_1).default; } });
|
|
7
|
+
tslib_1.__exportStar(require("./components/groupedItemList/GroupedItemList"), exports);
|
|
@@ -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 LicensePlate_1 = require("./components/licensePlate/LicensePlate");
|
|
6
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return tslib_1.__importDefault(LicensePlate_1).default; } });
|
|
7
|
+
tslib_1.__exportStar(require("./components/licensePlate/LicensePlate"), exports);
|
|
@@ -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 ReferenceLine_1 = require("./components/charts/ReferenceLine");
|
|
6
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return tslib_1.__importDefault(ReferenceLine_1).default; } });
|
|
7
|
+
tslib_1.__exportStar(require("./components/charts/ReferenceLine"), exports);
|
|
@@ -99,7 +99,7 @@ const ActionBarItemBase = (props) => {
|
|
|
99
99
|
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, remainingProps, { className: classes, ref: clickOutsideRef }, { children: [react_1.default.cloneElement(itemIcon, { onClick: onToggle }), (0, jsx_runtime_1.jsx)("div", Object.assign({ onClick: () => setIsShown(false) }, { children: (0, jsx_runtime_1.jsx)(Dialog_1.default, { show: isShown, onClose: () => setIsShown(false), body: itemPopover, bodyClassName: mobileDialogBodyClassName, title: title }) })), childrenWithoutPopoverAndIcon] })));
|
|
100
100
|
}
|
|
101
101
|
const overlay = ((0, jsx_runtime_1.jsx)(ActionBarOverlay_1.default, Object.assign({ id: id, title: title, width: popoverWidth, preRender: useOffscreen, show: isShown }, { children: itemPopover }), 'child'));
|
|
102
|
-
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, remainingProps, { className: classes, ref: clickOutsideRef }, { children: [(0, jsx_runtime_1.jsx)(OverlayTrigger_1.default, Object.assign({ onToggle: onToggle, show: isShown || useOffscreen, placement: OverlayTrigger_1.default.BOTTOM_END, overlay: overlay, trigger: 'click',
|
|
102
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, remainingProps, { className: classes, ref: clickOutsideRef }, { children: [(0, jsx_runtime_1.jsx)(OverlayTrigger_1.default, Object.assign({ onToggle: onToggle, show: isShown || useOffscreen, placement: OverlayTrigger_1.default.BOTTOM_END, overlay: overlay, rootClose: false, trigger: 'click', popperConfig: {
|
|
103
103
|
modifiers: [
|
|
104
104
|
{
|
|
105
105
|
name: 'offset',
|
|
@@ -107,6 +107,10 @@ const ActionBarItemBase = (props) => {
|
|
|
107
107
|
offset: [0, 5],
|
|
108
108
|
},
|
|
109
109
|
},
|
|
110
|
+
{
|
|
111
|
+
name: 'arrow',
|
|
112
|
+
options: {},
|
|
113
|
+
},
|
|
110
114
|
],
|
|
111
115
|
} }, { children: itemIcon })), childrenWithoutPopoverAndIcon] })));
|
|
112
116
|
};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
className?: string;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
displayName: string;
|
|
8
|
-
};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const ActionBarItemIcon: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
3
|
+
className?: string | undefined;
|
|
4
|
+
} & {
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
9
7
|
export default ActionBarItemIcon;
|
|
@@ -3,13 +3,13 @@ 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 ActionBarItemIcon = (props) => {
|
|
8
|
+
const ActionBarItemIcon = (0, react_1.forwardRef)((props, ref) => {
|
|
9
9
|
const { className, children } = props, remainingProps = tslib_1.__rest(props, ["className", "children"]);
|
|
10
10
|
const classes = (0, classnames_1.default)('ActionBarItemIcon', className);
|
|
11
|
-
return ((0, jsx_runtime_1.jsx)("div", Object.assign({}, remainingProps, { className: classes }, { children: children })));
|
|
12
|
-
};
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({}, remainingProps, { className: classes, ref: ref }, { children: children })));
|
|
12
|
+
});
|
|
13
13
|
// The displayName is used in ActionBarItem for checking the component "isActionBarItemIcon"
|
|
14
14
|
ActionBarItemIcon.displayName = 'ActionBarItemIcon';
|
|
15
15
|
exports.default = ActionBarItemIcon;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { PLACEMENT_MAP } from '../popover/Popover';
|
|
3
|
+
import type { ObjectValues } from '../../utils/ObjectValues';
|
|
3
4
|
export type ActionBarOverlayWidth = 100 | 150 | 200 | 250 | 300 | 350 | 400 | 450 | 500;
|
|
4
5
|
export type ActionBarOverlayProps = {
|
|
5
6
|
id: string;
|
|
@@ -9,7 +10,7 @@ export type ActionBarOverlayProps = {
|
|
|
9
10
|
width?: ActionBarOverlayWidth;
|
|
10
11
|
onClick?: () => void;
|
|
11
12
|
style?: object;
|
|
12
|
-
placement?:
|
|
13
|
+
placement?: ObjectValues<typeof PLACEMENT_MAP>;
|
|
13
14
|
className?: string;
|
|
14
15
|
};
|
|
15
16
|
declare const ActionBarOverlay: React.ForwardRefExoticComponent<ActionBarOverlayProps & {
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
// @ts-ignore-next-line importsNotUsedAsValues
|
|
5
6
|
const react_1 = require("react");
|
|
6
7
|
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
7
|
-
const Popover_1 = tslib_1.__importDefault(require("react-bootstrap/Popover"));
|
|
8
8
|
const noop_1 = tslib_1.__importDefault(require("lodash/fp/noop"));
|
|
9
|
-
const
|
|
10
|
-
const DEFAULT_PLACEMENT =
|
|
9
|
+
const Popover_1 = tslib_1.__importStar(require("../popover/Popover"));
|
|
10
|
+
const DEFAULT_PLACEMENT = Popover_1.PLACEMENT_MAP.BOTTOM;
|
|
11
11
|
const DEFAULT_WIDTH = 250;
|
|
12
12
|
const ActionBarOverlay = (0, react_1.forwardRef)((props, ref) => {
|
|
13
|
-
const { children, show, preRender, id, title, onClick = noop_1.default, width = DEFAULT_WIDTH, style = {}, className, placement = DEFAULT_PLACEMENT } = props,
|
|
13
|
+
const { children, show, preRender, id, title, onClick = noop_1.default, width = DEFAULT_WIDTH, style = {}, className, placement = DEFAULT_PLACEMENT } = props, remainingProps = tslib_1.__rest(props, ["children", "show", "preRender", "id", "title", "onClick", "width", "style", "className", "placement"]);
|
|
14
14
|
const adjustedStyles = Object.assign(Object.assign({}, style), { width });
|
|
15
15
|
const adjustedClassName = preRender && !show ? (0, classnames_1.default)(className, 'position-offscreen') : className;
|
|
16
|
-
const popoverTitleClasses = (0, classnames_1.default)('ActionBarItemPopover
|
|
17
|
-
const popoverContentClasses = (0, classnames_1.default)('ActionBarItemPopover
|
|
18
|
-
return ((0, jsx_runtime_1.jsxs)(Popover_1.default, Object.assign({ ref: ref, id: id, onClick: onClick, placement: placement },
|
|
16
|
+
const popoverTitleClasses = (0, classnames_1.default)('ActionBarItemPopover text-color-dark', className);
|
|
17
|
+
const popoverContentClasses = (0, classnames_1.default)('ActionBarItemPopover', className);
|
|
18
|
+
return ((0, jsx_runtime_1.jsxs)(Popover_1.default, Object.assign({ ref: ref, id: id, onClick: onClick, placement: placement }, remainingProps, { style: adjustedStyles, className: adjustedClassName }, { children: [title && (0, jsx_runtime_1.jsx)(Popover_1.default.Title, Object.assign({ className: popoverTitleClasses }, { children: title })), (0, jsx_runtime_1.jsx)(Popover_1.default.Content, Object.assign({ className: popoverContentClasses }, { children: children }))] })));
|
|
19
19
|
});
|
|
20
20
|
exports.default = ActionBarOverlay;
|
|
@@ -9,6 +9,7 @@ const ApplicationLayoutHeader_1 = tslib_1.__importDefault(require("./Application
|
|
|
9
9
|
const ApplicationLayoutSidebar_1 = tslib_1.__importDefault(require("./ApplicationLayoutSidebar"));
|
|
10
10
|
const ApplicationLayoutBody_1 = tslib_1.__importDefault(require("./ApplicationLayoutBody"));
|
|
11
11
|
const initDocumentBootstrapping_1 = require("../../utils/init/initDocumentBootstrapping");
|
|
12
|
+
require("../../utils/init/initConfig");
|
|
12
13
|
// initializes document bootstrapping - keep the import to avoid being tree-shaken
|
|
13
14
|
// noinspection JSIgnoredPromiseFromCall
|
|
14
15
|
(0, initDocumentBootstrapping_1.initDocumentBootstrapping)();
|
|
@@ -3,14 +3,10 @@ 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
|
const react_1 = require("react");
|
|
6
|
-
const prop_types_1 = tslib_1.__importDefault(require("prop-types"));
|
|
7
6
|
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
8
7
|
const ApplicationLayoutHeader = (0, react_1.forwardRef)((props, ref) => {
|
|
9
8
|
const { className, children } = props, remainingProps = tslib_1.__rest(props, ["className", "children"]);
|
|
10
9
|
const classes = (0, classnames_1.default)('ApplicationLayoutHeader', className);
|
|
11
10
|
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ ref: ref }, remainingProps, { className: classes, id: 'ApplicationLayoutHeader' }, { children: children })));
|
|
12
11
|
});
|
|
13
|
-
ApplicationLayoutHeader.propTypes = {
|
|
14
|
-
className: prop_types_1.default.string,
|
|
15
|
-
};
|
|
16
12
|
exports.default = ApplicationLayoutHeader;
|
|
@@ -15,18 +15,22 @@ const TreeOptions = (props) => {
|
|
|
15
15
|
}
|
|
16
16
|
const dropdownClasses = (0, classnames_1.default)('display-flex flex-column gap-10', 'width-250', 'padding-15', className);
|
|
17
17
|
const customDropdown = (0, jsx_runtime_1.jsx)("div", Object.assign({ className: dropdownClasses }, { children: treeOptions }));
|
|
18
|
-
const dropdown = ((0, jsx_runtime_1.jsx)(ButtonDropdown_1.default, { title: (0, jsx_runtime_1.jsx)("span", { className: 'rioglyph rioglyph-option-vertical', "aria-hidden": 'true' }), bsStyle: 'default', bsSize: 'sm', customDropdown: customDropdown, toggleClassName: 'hover-bg-white border-none text-color-gray hover-text-color-dark', className: 'TreeHeaderOptions', pullRight: true, iconOnly: true }));
|
|
18
|
+
const dropdown = ((0, jsx_runtime_1.jsx)(ButtonDropdown_1.default, { title: (0, jsx_runtime_1.jsx)("span", { className: 'rioglyph rioglyph-option-vertical', "aria-hidden": 'true' }), bsStyle: 'default', bsSize: 'sm', customDropdown: customDropdown, toggleClassName: 'hover-bg-white border-none text-color-gray hover-text-color-dark', className: 'TreeHeaderOptions height-20', pullRight: true, iconOnly: true }));
|
|
19
19
|
if (treeOptionsTooltip) {
|
|
20
|
-
return ((0, jsx_runtime_1.jsx)(SimpleTooltip_1.default, Object.assign({ content: treeOptionsTooltip, placement: 'bottom', delay: { show: 1000, hide: 0 }, popperConfig: {
|
|
20
|
+
return ((0, jsx_runtime_1.jsx)(SimpleTooltip_1.default, Object.assign({ content: treeOptionsTooltip, placement: 'bottom-end', delay: { show: 1000, hide: 0 }, popperConfig: {
|
|
21
21
|
modifiers: [
|
|
22
22
|
{
|
|
23
23
|
name: 'offset',
|
|
24
24
|
options: {
|
|
25
|
-
offset: [
|
|
25
|
+
offset: [10, 5],
|
|
26
26
|
},
|
|
27
27
|
},
|
|
28
|
+
{
|
|
29
|
+
name: 'arrow',
|
|
30
|
+
options: {},
|
|
31
|
+
},
|
|
28
32
|
],
|
|
29
|
-
} }, { children: dropdown })));
|
|
33
|
+
} }, { children: (0, jsx_runtime_1.jsx)("div", { children: dropdown }) })));
|
|
30
34
|
}
|
|
31
35
|
return dropdown;
|
|
32
36
|
};
|
|
@@ -38,7 +38,7 @@ const orderByName = (0, orderBy_1.default)([
|
|
|
38
38
|
var _a;
|
|
39
39
|
return isNameObject(item)
|
|
40
40
|
? item.name.lastName.toLowerCase()
|
|
41
|
-
: (_a = item.name.toLowerCase()) !== null && _a !== void 0 ? _a : '';
|
|
41
|
+
: ((_a = item.name.toLowerCase()) !== null && _a !== void 0 ? _a : '');
|
|
42
42
|
},
|
|
43
43
|
], ['asc']);
|
|
44
44
|
// TODO: extend to use provided external search function instead?
|