@rio-cloud/rio-uikit 1.2.1 → 1.3.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/DateRangePicker.d.ts +6 -7
- package/DateRangePicker.js +7 -3
- package/README.md +3 -3
- 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 +1 -1
- package/components/assetTree/treeUtils.js +1 -1
- package/components/calendarStripe/CalendarStripe.d.ts +8 -0
- package/components/calendarStripe/CalendarStripe.js +7 -4
- package/components/dataTabs/DataTab.js +2 -1
- 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/listMenu/ListMenu.js +1 -1
- package/components/map/components/features/settings/MapSettingsTile.js +1 -1
- package/components/map/components/features/settings/items/MapSettingsDropdownHeader.d.ts +4 -1
- package/components/map/components/features/settings/items/MapSettingsDropdownHeader.js +1 -0
- 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/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/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/DateRangePicker.d.ts +6 -7
- package/lib/es/DateRangePicker.js +5 -1
- 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 +1 -1
- 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/dataTabs/DataTab.js +2 -1
- 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/listMenu/ListMenu.js +1 -1
- package/lib/es/components/map/components/features/settings/MapSettingsTile.js +1 -1
- package/lib/es/components/map/components/features/settings/items/MapSettingsDropdownHeader.d.ts +4 -1
- package/lib/es/components/map/components/features/settings/items/MapSettingsDropdownHeader.js +1 -0
- 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/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/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/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 +18 -12
- package/styles/variables/colors/colors.json +3 -3
- package/useElapsedTime.d.ts +2 -0
- package/useElapsedTime.js +2 -0
- 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
package/.DS_Store
CHANGED
|
Binary file
|
package/DateRangePicker.d.ts
CHANGED
|
@@ -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;
|
package/DateRangePicker.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import DeprecatedDateRangePicker from './components/datepicker/DateRangePicker';
|
|
2
4
|
/**
|
|
3
5
|
* Wrapper component for React-Datetime.
|
|
4
6
|
*
|
|
5
7
|
* @deprecated This will be removed from the UIKIT at some time.
|
|
6
8
|
*/
|
|
7
|
-
const DateRangePicker =
|
|
8
|
-
|
|
9
|
+
export const DateRangePicker = (props) => {
|
|
10
|
+
const { children } = props, remainingProps = __rest(props, ["children"]);
|
|
11
|
+
return _jsx(DeprecatedDateRangePicker, Object.assign({}, remainingProps, { children: children }));
|
|
12
|
+
};
|
package/README.md
CHANGED
|
@@ -19,9 +19,9 @@ When releasing a new version:
|
|
|
19
19
|
|
|
20
20
|
Create a new development beta version:
|
|
21
21
|
|
|
22
|
-
1. Update the `package.json`. Example `
|
|
23
|
-
2. Update the `src/version.json`. Example `
|
|
24
|
-
3. run `npm i` or update `package-lock.json`. Example `
|
|
22
|
+
1. Update the `package.json`. Example `1.2.4-beta.1`
|
|
23
|
+
2. Update the `src/version.json`. Example `1.2.4-beta.1`
|
|
24
|
+
3. run `npm i` or update `package-lock.json`. Example `1.2.4-beta.1`
|
|
25
25
|
|
|
26
26
|
## Development
|
|
27
27
|
|
|
@@ -97,7 +97,7 @@ const ActionBarItemBase = (props) => {
|
|
|
97
97
|
return (_jsxs("div", Object.assign({}, remainingProps, { className: classes, ref: clickOutsideRef }, { children: [React.cloneElement(itemIcon, { onClick: onToggle }), _jsx("div", Object.assign({ onClick: () => setIsShown(false) }, { children: _jsx(Dialog, { show: isShown, onClose: () => setIsShown(false), body: itemPopover, bodyClassName: mobileDialogBodyClassName, title: title }) })), childrenWithoutPopoverAndIcon] })));
|
|
98
98
|
}
|
|
99
99
|
const overlay = (_jsx(ActionBarOverlay, Object.assign({ id: id, title: title, width: popoverWidth, preRender: useOffscreen, show: isShown }, { children: itemPopover }), 'child'));
|
|
100
|
-
return (_jsxs("div", Object.assign({}, remainingProps, { className: classes, ref: clickOutsideRef }, { children: [_jsx(OverlayTrigger, Object.assign({ onToggle: onToggle, show: isShown || useOffscreen, placement: OverlayTrigger.BOTTOM_END, overlay: overlay, trigger: 'click',
|
|
100
|
+
return (_jsxs("div", Object.assign({}, remainingProps, { className: classes, ref: clickOutsideRef }, { children: [_jsx(OverlayTrigger, Object.assign({ onToggle: onToggle, show: isShown || useOffscreen, placement: OverlayTrigger.BOTTOM_END, overlay: overlay, rootClose: false, trigger: 'click', popperConfig: {
|
|
101
101
|
modifiers: [
|
|
102
102
|
{
|
|
103
103
|
name: 'offset',
|
|
@@ -105,6 +105,10 @@ const ActionBarItemBase = (props) => {
|
|
|
105
105
|
offset: [0, 5],
|
|
106
106
|
},
|
|
107
107
|
},
|
|
108
|
+
{
|
|
109
|
+
name: 'arrow',
|
|
110
|
+
options: {},
|
|
111
|
+
},
|
|
108
112
|
],
|
|
109
113
|
} }, { children: itemIcon })), childrenWithoutPopoverAndIcon] })));
|
|
110
114
|
};
|
|
@@ -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;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
// @ts-ignore-next-line importsNotUsedAsValues
|
|
4
|
-
import 'react';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
|
-
const ActionBarItemIcon = (props) => {
|
|
6
|
+
const ActionBarItemIcon = forwardRef((props, ref) => {
|
|
7
7
|
const { className, children } = props, remainingProps = __rest(props, ["className", "children"]);
|
|
8
8
|
const classes = classNames('ActionBarItemIcon', className);
|
|
9
|
-
return (_jsx("div", Object.assign({}, remainingProps, { className: classes }, { children: children })));
|
|
10
|
-
};
|
|
9
|
+
return (_jsx("div", Object.assign({}, remainingProps, { className: classes, ref: ref }, { children: children })));
|
|
10
|
+
});
|
|
11
11
|
// The displayName is used in ActionBarItem for checking the component "isActionBarItemIcon"
|
|
12
12
|
ActionBarItemIcon.displayName = 'ActionBarItemIcon';
|
|
13
13
|
export 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 & {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
// @ts-ignore-next-line importsNotUsedAsValues
|
|
3
4
|
import { forwardRef } from 'react';
|
|
4
5
|
import classNames from 'classnames';
|
|
5
|
-
import Popover from 'react-bootstrap/Popover';
|
|
6
6
|
import noop from 'lodash/fp/noop';
|
|
7
|
-
import {
|
|
8
|
-
const DEFAULT_PLACEMENT =
|
|
7
|
+
import Popover, { PLACEMENT_MAP } from '../popover/Popover';
|
|
8
|
+
const DEFAULT_PLACEMENT = PLACEMENT_MAP.BOTTOM;
|
|
9
9
|
const DEFAULT_WIDTH = 250;
|
|
10
10
|
const ActionBarOverlay = forwardRef((props, ref) => {
|
|
11
|
-
const { children, show, preRender, id, title, onClick = noop, width = DEFAULT_WIDTH, style = {}, className, placement = DEFAULT_PLACEMENT } = props,
|
|
11
|
+
const { children, show, preRender, id, title, onClick = noop, width = DEFAULT_WIDTH, style = {}, className, placement = DEFAULT_PLACEMENT } = props, remainingProps = __rest(props, ["children", "show", "preRender", "id", "title", "onClick", "width", "style", "className", "placement"]);
|
|
12
12
|
const adjustedStyles = Object.assign(Object.assign({}, style), { width });
|
|
13
13
|
const adjustedClassName = preRender && !show ? classNames(className, 'position-offscreen') : className;
|
|
14
|
-
const popoverTitleClasses = classNames('ActionBarItemPopover
|
|
15
|
-
const popoverContentClasses = classNames('ActionBarItemPopover
|
|
16
|
-
return (_jsxs(Popover, Object.assign({ ref: ref, id: id, onClick: onClick, placement: placement },
|
|
14
|
+
const popoverTitleClasses = classNames('ActionBarItemPopover text-color-dark', className);
|
|
15
|
+
const popoverContentClasses = classNames('ActionBarItemPopover', className);
|
|
16
|
+
return (_jsxs(Popover, Object.assign({ ref: ref, id: id, onClick: onClick, placement: placement }, remainingProps, { style: adjustedStyles, className: adjustedClassName }, { children: [title && _jsx(Popover.Title, Object.assign({ className: popoverTitleClasses }, { children: title })), _jsx(Popover.Content, Object.assign({ className: popoverContentClasses }, { children: children }))] })));
|
|
17
17
|
});
|
|
18
18
|
export default ActionBarOverlay;
|
|
@@ -7,6 +7,7 @@ import ApplicationLayoutHeader from './ApplicationLayoutHeader';
|
|
|
7
7
|
import ApplicationLayoutSidebar from './ApplicationLayoutSidebar';
|
|
8
8
|
import ApplicationLayoutBody from './ApplicationLayoutBody';
|
|
9
9
|
import { initDocumentBootstrapping } from '../../utils/init/initDocumentBootstrapping';
|
|
10
|
+
import '../../utils/init/initConfig';
|
|
10
11
|
// initializes document bootstrapping - keep the import to avoid being tree-shaken
|
|
11
12
|
// noinspection JSIgnoredPromiseFromCall
|
|
12
13
|
initDocumentBootstrapping();
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
4
|
import classNames from 'classnames';
|
|
6
5
|
const ApplicationLayoutHeader = forwardRef((props, ref) => {
|
|
7
6
|
const { className, children } = props, remainingProps = __rest(props, ["className", "children"]);
|
|
8
7
|
const classes = classNames('ApplicationLayoutHeader', className);
|
|
9
8
|
return (_jsx("div", Object.assign({ ref: ref }, remainingProps, { className: classes, id: 'ApplicationLayoutHeader' }, { children: children })));
|
|
10
9
|
});
|
|
11
|
-
ApplicationLayoutHeader.propTypes = {
|
|
12
|
-
className: PropTypes.string,
|
|
13
|
-
};
|
|
14
10
|
export default ApplicationLayoutHeader;
|
|
@@ -12,7 +12,7 @@ const TreeOptions = (props) => {
|
|
|
12
12
|
}
|
|
13
13
|
const dropdownClasses = classNames('display-flex flex-column gap-10', 'width-250', 'padding-15', className);
|
|
14
14
|
const customDropdown = _jsx("div", Object.assign({ className: dropdownClasses }, { children: treeOptions }));
|
|
15
|
-
const dropdown = (_jsx(ButtonDropdown, { title: _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 }));
|
|
15
|
+
const dropdown = (_jsx(ButtonDropdown, { title: _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 }));
|
|
16
16
|
if (treeOptionsTooltip) {
|
|
17
17
|
return (_jsx(SimpleTooltip, Object.assign({ content: treeOptionsTooltip, placement: 'bottom', delay: { show: 1000, hide: 0 }, popperConfig: {
|
|
18
18
|
modifiers: [
|
|
@@ -27,7 +27,7 @@ const orderByName = orderBy([
|
|
|
27
27
|
var _a;
|
|
28
28
|
return isNameObject(item)
|
|
29
29
|
? item.name.lastName.toLowerCase()
|
|
30
|
-
: (_a = item.name.toLowerCase()) !== null && _a !== void 0 ? _a : '';
|
|
30
|
+
: ((_a = item.name.toLowerCase()) !== null && _a !== void 0 ? _a : '');
|
|
31
31
|
},
|
|
32
32
|
], ['asc']);
|
|
33
33
|
// TODO: extend to use provided external search function instead?
|
|
@@ -62,6 +62,14 @@ export type CalendarStripeProps = {
|
|
|
62
62
|
* Additional classes set to the calendar element.
|
|
63
63
|
*/
|
|
64
64
|
className?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Additional classes set to the days wrapper element.
|
|
67
|
+
*/
|
|
68
|
+
daysWrapperClassName?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Additional classes set to the days wrapper element.
|
|
71
|
+
*/
|
|
72
|
+
dayWrapperClassName?: string;
|
|
65
73
|
};
|
|
66
74
|
declare const CalendarStripe: React.ForwardRefExoticComponent<CalendarStripeProps & React.RefAttributes<HTMLDivElement>>;
|
|
67
75
|
export default CalendarStripe;
|
|
@@ -6,6 +6,7 @@ import noop from 'lodash/noop';
|
|
|
6
6
|
import useAfterMount from '../../hooks/useAfterMount';
|
|
7
7
|
import useElementSize from '../../hooks/useElementSize';
|
|
8
8
|
import usePrevious from '../../hooks/usePrevious';
|
|
9
|
+
import { hasAlignItemsClass, hasAlignSelfClass, hasBgClass, hasBorderClass, hasCursorClass, hasDisplayClass, hasFlexClass, hasHoverScaleClass, hasHoverTextColorClass, hasOverflowClass, hasPaddingClass, hasRoundedClass, hasSpaceClass, hasTextColorClass, hasTextSizeClass, hasUserSelectClass, } from '../../utils/hasUtilityClass';
|
|
9
10
|
const DEFAULT_MIN_WITH = 200;
|
|
10
11
|
const DEFAULT_MIN_DAYS = 1;
|
|
11
12
|
const DEFAULT_MAX_DAYS = 7;
|
|
@@ -28,7 +29,7 @@ const getFirstColumnItem = (node) => {
|
|
|
28
29
|
return getFirstColumnItem(node.children[0]);
|
|
29
30
|
};
|
|
30
31
|
const CalendarStripe = forwardRef((props, ref) => {
|
|
31
|
-
const { minDayWith = DEFAULT_MIN_WITH, minDays = DEFAULT_MIN_DAYS, maxDays = DEFAULT_MAX_DAYS, render, renderDay, skipWeekends = false, startDate = new Date(), onNextClick = noop, onPreviousClick = noop, buttonClassName = '', className = '', } = props;
|
|
32
|
+
const { minDayWith = DEFAULT_MIN_WITH, minDays = DEFAULT_MIN_DAYS, maxDays = DEFAULT_MAX_DAYS, render, renderDay, skipWeekends = false, startDate = new Date(), onNextClick = noop, onPreviousClick = noop, buttonClassName = '', className = '', daysWrapperClassName = '', dayWrapperClassName = '', } = props;
|
|
32
33
|
if (render) {
|
|
33
34
|
console.warn('CalendarStripe has set the "render" prop deprecated. This will be removed in the upcoming releases,' +
|
|
34
35
|
' Please use the "renderDay" prop instead.');
|
|
@@ -114,8 +115,10 @@ const CalendarStripe = forwardRef((props, ref) => {
|
|
|
114
115
|
addDays = false;
|
|
115
116
|
}
|
|
116
117
|
}
|
|
117
|
-
const
|
|
118
|
-
const
|
|
119
|
-
|
|
118
|
+
const wrapperClassNames = classNames('CalenderStripe', !hasDisplayClass(className) && 'display-flex', !hasAlignItemsClass(className) && 'align-items-center', !hasOverflowClass(className) && 'overflow-hidden', !hasBgClass(className) && 'bg-white', !hasBorderClass(className) && 'border', !hasRoundedClass(className) && 'rounded', className);
|
|
119
|
+
const baseButtonClassNames = classNames(!hasAlignItemsClass(buttonClassName) && 'align-items-center', !hasDisplayClass(buttonClassName) && 'display-flex', !hasHoverScaleClass(buttonClassName) && 'hover-scale-105', !hasHoverTextColorClass(buttonClassName) && 'hover-text-color-darkest', !hasPaddingClass(buttonClassName) && 'padding-10', !hasCursorClass(buttonClassName) && 'cursor-pointer', !hasTextColorClass(buttonClassName) && 'text-color-darker', !hasTextSizeClass(buttonClassName) && 'text-size-12', !hasAlignSelfClass(buttonClassName) && 'align-self-stretch', buttonClassName);
|
|
120
|
+
const daysWrapperClassNames = classNames(!hasDisplayClass(daysWrapperClassName) && 'display-flex', !hasSpaceClass(daysWrapperClassName) && 'space-x--1', !hasUserSelectClass(daysWrapperClassName) && 'user-select-none', daysWrapperClassName);
|
|
121
|
+
const dayWrapperClassNames = classNames(ITEM_NAME, !hasFlexClass(dayWrapperClassName) && 'flex-1-1-0', !hasSpaceClass(dayWrapperClassName) && 'space-x--1', !hasUserSelectClass(dayWrapperClassName) && 'user-select-none', dayWrapperClassName);
|
|
122
|
+
return (_jsxs("div", Object.assign({ ref: ref, className: wrapperClassNames }, { children: [_jsx("div", Object.assign({ className: baseButtonClassNames, onClick: handlePrev }, { children: _jsx("span", { className: 'rioglyph rioglyph-chevron-left' }) })), _jsx("div", Object.assign({ className: 'flex-1-1 overflow-hidden', ref: columnWrapperRef }, { children: _jsx(AnimatePresence, Object.assign({ exitBeforeEnter: true, custom: animationDirection }, { children: _jsx(motion.div, Object.assign({ variants: variants, initial: enableInitialAnimation ? 'pageEnter' : false, animate: 'pageCenter', custom: animationDirection, transition: { duration: ANIMATION_DURATION } }, { children: _jsx("div", Object.assign({ className: daysWrapperClassNames }, { children: dates.map(date => (_jsxs("div", Object.assign({ className: dayWrapperClassNames }, { children: [renderDay ? renderDay(date) : null, render && React.cloneElement(_jsx(_Fragment, { children: render }), { date })] }), `${getDateString(date)}`))) })) }), getDateString(firstDate)) })) })), _jsx("div", Object.assign({ className: baseButtonClassNames, onClick: handleNext }, { children: _jsx("span", { className: 'rioglyph rioglyph-chevron-right' }) }))] })));
|
|
120
123
|
});
|
|
121
124
|
export default CalendarStripe;
|
|
@@ -5,7 +5,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
5
5
|
import 'react';
|
|
6
6
|
import { motion } from 'framer-motion';
|
|
7
7
|
const DataTab = (props) => {
|
|
8
|
-
const { active = false,
|
|
8
|
+
const { active = false, title, // exclude from remainingProps to avoid being set to the div element
|
|
9
|
+
tabKey, disableTransition = false, className = '', children } = props, remainingProps = __rest(props, ["active", "title", "tabKey", "disableTransition", "className", "children"]);
|
|
9
10
|
if (disableTransition) {
|
|
10
11
|
return _jsx("div", { children: active && children });
|
|
11
12
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type
|
|
3
|
-
export type SimpleDialogProps =
|
|
2
|
+
import { type DialogProps } from './Dialog';
|
|
3
|
+
export type SimpleDialogProps = Omit<DialogProps, 'body'> & {
|
|
4
4
|
/**
|
|
5
5
|
* The content of the dialog body itself.
|
|
6
6
|
*/
|
|
@@ -25,6 +25,12 @@ export type SplitDialogProps = BaseDialogProps & {
|
|
|
25
25
|
* Additional classes for the modal-footer element.
|
|
26
26
|
*/
|
|
27
27
|
footerClassName?: string;
|
|
28
|
+
/**
|
|
29
|
+
* A callback function to be executed before closing the dialog. If the function returns
|
|
30
|
+
* `false` the dialog will not be closed
|
|
31
|
+
* @returns
|
|
32
|
+
*/
|
|
33
|
+
onCloseValidation?: () => boolean;
|
|
28
34
|
};
|
|
29
35
|
declare const SplitDialog: (props: SplitDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
36
|
export default SplitDialog;
|
|
@@ -3,6 +3,7 @@ import { useState } from 'react';
|
|
|
3
3
|
import isEqual from 'lodash/fp/isEqual';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import Collapse from '../collapse/Collapse';
|
|
6
|
+
import { hasBorderClass, hasRoundedClass } from '../../utils/hasUtilityClass';
|
|
6
7
|
const getRandomString = () => (Math.random() + 1).toString(36).toUpperCase().substring(2);
|
|
7
8
|
// Generate a unique id (if not present) instead of using the index for the key as it will create
|
|
8
9
|
// side effects when removing items from the list and re-render the ExpanderList.
|
|
@@ -38,7 +39,7 @@ const ExpanderList = (props) => {
|
|
|
38
39
|
});
|
|
39
40
|
setListItems(updatedListItems);
|
|
40
41
|
};
|
|
41
|
-
const listClassNames = classNames('expander-list list-group', rounded && 'rounded', bordered && 'border', className);
|
|
42
|
+
const listClassNames = classNames('expander-list list-group', rounded && !hasRoundedClass(className) && 'rounded', bordered && !hasBorderClass(className) && 'border', className);
|
|
42
43
|
return (_jsx("ul", Object.assign({ className: listClassNames }, { children: listItems.map(item => {
|
|
43
44
|
const isOpen = item.open;
|
|
44
45
|
const itemClassNames = classNames('list-group-item', item.className && item.className, item.body && 'expandable', isOpen && 'open');
|
|
@@ -66,7 +66,7 @@ const ListMenu = (props) => {
|
|
|
66
66
|
setIsExpanderOpen(false);
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
|
-
const formClassNames = classNames('form-group', 'margin-bottom-5', 'padding-left-15', 'padding-right-15', 'padding-bottom-15', 'position-sticky', 'top-0');
|
|
69
|
+
const formClassNames = classNames('form-group', 'margin-top-5', 'margin-bottom-5', 'padding-left-15', 'padding-right-15', 'padding-bottom-15', 'position-sticky', 'top-0');
|
|
70
70
|
const listMenu = (_jsxs("div", Object.assign({}, remainingProps, { className: `ListMenu ${className}`, ref: listRef }, { children: [enableFilter && (_jsx("div", Object.assign({ className: formClassNames }, { children: _jsxs("div", Object.assign({ className: 'input-group width-100pct' }, { children: [_jsx("span", Object.assign({ className: 'input-group-addon' }, { children: _jsx("span", { className: 'rioglyph rioglyph-search', "aria-hidden": 'true' }) })), _jsx(ClearableInput, { value: filterValue, inputRef: inputRef, placeholder: filterPlaceholder, onChange: handleFilterChange, onClear: handleClear }), trailingInputAddon && trailingInputAddon] })) }))), !hasMenuItems(filteredMenuItems) && (_jsx("div", Object.assign({ className: 'padding-top-25 text-center text-color-gray' }, { children: notFoundMessage }))), filteredMenuItems.map(menuGroup => (_jsx(ListMenuGroup, { className: groupClassName, menuGroup: menuGroup }, crypto.randomUUID())))] })));
|
|
71
71
|
if (responsive && isMobileMode) {
|
|
72
72
|
return (_jsx(ExpanderPanel, Object.assign({ title: mobileHeader, bsStyle: 'default', open: isExpanderOpen, onToggle: () => setIsExpanderOpen(!isExpanderOpen), unmountOnExit: false, className: 'shadow-default' }, { children: _jsx("div", Object.assign({ onClick: handleExpanderBodyClick }, { children: listMenu })) })));
|
|
@@ -69,7 +69,7 @@ const MapSettingsTile = (props) => {
|
|
|
69
69
|
className: inactiveIconClassNames,
|
|
70
70
|
})] })));
|
|
71
71
|
return (_jsxs("div", Object.assign({ className: wrapperClasses, ref: buttonRef }, remainingProps, { children: [!items && (_jsxs(_Fragment, { children: [tooltip && !isOpen ? getComponentWithTooltip(button, tooltip) : button, _jsx("div", Object.assign({ className: 'overflow-hidden' }, { children: _jsx(AnimatePresence, { children: isOpen && panel && panel }) }))] })), items && (_jsxs("div", Object.assign({ className: 'MapSettingsTile-inner position-relative', ref: setToggleRef }, { children: [tooltip && !isOpen ? getComponentWithTooltip(button, tooltip) : button, _jsx(AnimatePresence, { children: _jsx("div", Object.assign({ className: 'dropdown', ref: dropdownWrapperRef }, { children: isOpen && items && (_jsx(MenuItemList, Object.assign({ className: 'margin-bottom-10 shadow-smooth border-none', ref: setRefDropdownMenu, style: Object.assign(Object.assign({}, styles.popper), { minWidth: '180px' }) }, attributes.popper, { children: items === null || items === void 0 ? void 0 : items.map((item, index) => {
|
|
72
|
-
if (item.type.
|
|
72
|
+
if (item.type.isMapSettingsDropdownHeader) {
|
|
73
73
|
return item;
|
|
74
74
|
}
|
|
75
75
|
return _jsx(MenuItem, { value: item }, index);
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { type DropdownHeaderProps } from '../../../../../selects/DropdownHeader';
|
|
2
2
|
export type MapSettingsDropdownHeaderProps = DropdownHeaderProps & {};
|
|
3
|
-
declare const MapSettingsDropdownHeader:
|
|
3
|
+
declare const MapSettingsDropdownHeader: {
|
|
4
|
+
(props: MapSettingsDropdownHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
isMapSettingsDropdownHeader: boolean;
|
|
6
|
+
};
|
|
4
7
|
export default MapSettingsDropdownHeader;
|
|
@@ -6,4 +6,5 @@ const MapSettingsDropdownHeader = (props) => {
|
|
|
6
6
|
const remainingProps = __rest(props, []);
|
|
7
7
|
return _jsx(DropdownHeader, Object.assign({ className: 'MapSettingsDropdownHeader' }, remainingProps));
|
|
8
8
|
};
|
|
9
|
+
MapSettingsDropdownHeader.isMapSettingsDropdownHeader = true;
|
|
9
10
|
export default MapSettingsDropdownHeader;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React, { type PropsWithChildren, type ReactNode } from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Options } from '@popperjs/core';
|
|
3
3
|
import { type TooltipWidth } from '../tooltip/Tooltip';
|
|
4
4
|
import { type TextAlignment } from '../../values/TextAlignment';
|
|
5
5
|
import { type Placement } from '../../values/Placement';
|
|
6
|
-
type PopperConfig = OverlayProps['popperConfig'];
|
|
7
6
|
export type OnboardingButton = {
|
|
8
7
|
text: string | React.ReactNode;
|
|
9
8
|
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
10
9
|
iconName?: string;
|
|
11
10
|
};
|
|
11
|
+
type PopperConfig = Partial<Options>;
|
|
12
12
|
export type OnboardingTipProps = {
|
|
13
13
|
/**
|
|
14
14
|
* The ID of the DOM element.
|
|
@@ -21,6 +21,8 @@ const OnboardingTip = (props) => {
|
|
|
21
21
|
// Popper.js default is false but we enable it by default
|
|
22
22
|
options: { altAxis: preventOverflow },
|
|
23
23
|
},
|
|
24
|
+
// Use an arrow modifier, the arrow ref will be injected in OverlayTrigger with the right props
|
|
25
|
+
{ name: 'arrow', options: {} },
|
|
24
26
|
],
|
|
25
27
|
};
|
|
26
28
|
const trigger = (_jsx(OverlayTrigger, Object.assign({ placement: placement, trigger: 'click', overlay: overlay, onToggle: onHide, show: show, rootClose: false, popperConfig: actualPopperConfig }, { children: children })));
|
|
@@ -1,6 +1,95 @@
|
|
|
1
|
-
import { type PropsWithChildren } from 'react';
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import React, { type PropsWithChildren } from 'react';
|
|
2
|
+
import type { Options } from '@popperjs/core';
|
|
3
|
+
import { type Placement } from '../../values/Placement';
|
|
4
|
+
import { type TriggerType } from '../../values/Trigger';
|
|
5
|
+
type PopperConfig = Partial<Options>;
|
|
6
|
+
export type OverlayTriggerProps = {
|
|
7
|
+
/**
|
|
8
|
+
* The visibility of the Overlay. `show` is a _controlled_ prop so should be paired
|
|
9
|
+
* with `onToggle` to avoid breaking user interactions.
|
|
10
|
+
*
|
|
11
|
+
* Manually toggling `show` does **not** wait for `delay` to change the visibility.
|
|
12
|
+
*
|
|
13
|
+
* @controllable onToggle
|
|
14
|
+
* @default: false
|
|
15
|
+
*/
|
|
16
|
+
show?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The initial visibility state of the Overlay.
|
|
19
|
+
*
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
defaultShow?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Defines the usage of React Portal.
|
|
25
|
+
*
|
|
26
|
+
* @default true
|
|
27
|
+
*/
|
|
28
|
+
enablePortal?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Specify which action or actions trigger Overlay visibility
|
|
31
|
+
*
|
|
32
|
+
* The `click` trigger ignores the configured `delay`.
|
|
33
|
+
*
|
|
34
|
+
* @default 'hover'
|
|
35
|
+
*/
|
|
36
|
+
trigger?: TriggerType;
|
|
37
|
+
/**
|
|
38
|
+
* A millisecond delay amount to show and hide the Overlay once triggered
|
|
39
|
+
*/
|
|
40
|
+
delay?: number | {
|
|
41
|
+
show?: number;
|
|
42
|
+
hide?: number;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* An element or text to overlay next to the target.
|
|
46
|
+
*/
|
|
47
|
+
overlay: React.ReactElement;
|
|
48
|
+
/**
|
|
49
|
+
* The placement of the Overlay in relation to it's `target`.
|
|
50
|
+
*
|
|
51
|
+
* @default 'top'
|
|
52
|
+
*/
|
|
53
|
+
placement?: Placement;
|
|
54
|
+
/**
|
|
55
|
+
* A Popper.js config object passed to the underlying popper instance.
|
|
56
|
+
* If no custom config is provided, a default config will be used. This default config
|
|
57
|
+
* includes an arrow element. In case you want to use a custom config and an arrow, include the arrow
|
|
58
|
+
* modifier so the correct arrow element can be injected for the arrow modifier.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* popperConfig={{
|
|
62
|
+
* modifiers: [
|
|
63
|
+
* {
|
|
64
|
+
* name: 'offset',
|
|
65
|
+
* options: {
|
|
66
|
+
* offset: [0, 5],
|
|
67
|
+
* },
|
|
68
|
+
* },
|
|
69
|
+
* {
|
|
70
|
+
* name: 'arrow',
|
|
71
|
+
* options: {},
|
|
72
|
+
* },
|
|
73
|
+
* ],
|
|
74
|
+
* }}
|
|
75
|
+
*/
|
|
76
|
+
popperConfig?: PopperConfig;
|
|
77
|
+
/**
|
|
78
|
+
* Specify whether the overlay should trigger onHide when the user clicks outside the overlay.
|
|
79
|
+
*
|
|
80
|
+
* @default true
|
|
81
|
+
*/
|
|
82
|
+
rootClose?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* A callback that fires when the user triggers a change in tooltip visibility.
|
|
85
|
+
*
|
|
86
|
+
* `onToggle` is called with the desired next `show`, and generally should be passed
|
|
87
|
+
* back to the `show` prop. `onToggle` fires _after_ the configured `delay`
|
|
88
|
+
*
|
|
89
|
+
* @controllable `show`
|
|
90
|
+
*/
|
|
91
|
+
onToggle?: (show: boolean) => void;
|
|
92
|
+
};
|
|
4
93
|
declare const OverlayTrigger: {
|
|
5
94
|
(props: PropsWithChildren<OverlayTriggerProps>): import("react/jsx-runtime").JSX.Element;
|
|
6
95
|
TRIGGER_CLICK: "click";
|