@rio-cloud/rio-uikit 1.1.0 → 1.2.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/DropdownHeader.d.ts +2 -0
- package/DropdownHeader.js +2 -0
- package/FeedbackInlineButtons.d.ts +2 -0
- package/FeedbackInlineButtons.js +2 -0
- package/FeedbackRating.d.ts +2 -0
- package/FeedbackRating.js +2 -0
- package/FeedbackReactions.d.ts +2 -0
- package/FeedbackReactions.js +2 -0
- package/MapAdditionalLayerSettings.d.ts +2 -0
- package/MapAdditionalLayerSettings.js +2 -0
- package/MapSettingsDropdownHeader.d.ts +2 -0
- package/MapSettingsDropdownHeader.js +2 -0
- package/SmoothScrollbars.d.ts +2 -0
- package/SmoothScrollbars.js +2 -0
- package/components/feedback/FeedbackInlineButtons.d.ts +13 -0
- package/components/feedback/FeedbackInlineButtons.js +9 -0
- package/components/feedback/FeedbackRating.d.ts +65 -0
- package/components/feedback/FeedbackRating.js +23 -0
- package/components/feedback/FeedbackReactions.d.ts +71 -0
- package/components/feedback/FeedbackReactions.js +26 -0
- package/components/listMenu/ListMenu.d.ts +5 -1
- package/components/listMenu/ListMenu.js +2 -2
- package/components/map/components/features/settings/MapSettingsItem.d.ts +1 -0
- package/components/map/components/features/settings/MapSettingsItem.js +14 -11
- package/components/map/components/features/settings/MapSettingsTile.d.ts +3 -2
- package/components/map/components/features/settings/MapSettingsTile.js +40 -5
- package/components/map/components/features/settings/builtinSettings/MapAdditionalLayerSettings.d.ts +9 -0
- package/components/map/components/features/settings/builtinSettings/MapAdditionalLayerSettings.js +15 -0
- package/components/map/components/features/settings/builtinSettings/MapClusterSettings.d.ts +3 -0
- package/components/map/components/features/settings/builtinSettings/MapClusterSettings.js +8 -2
- package/components/map/components/features/settings/builtinSettings/MapLayerSettings.js +15 -9
- package/components/map/components/features/settings/builtinSettings/MapTypeSettings.d.ts +6 -0
- package/components/map/components/features/settings/builtinSettings/MapTypeSettings.js +20 -2
- package/components/map/components/features/settings/buttons/MapCenterMarkerButton.js +2 -2
- package/components/map/components/features/settings/items/MapCustomerPoiSettingsItem.d.ts +2 -0
- package/components/map/components/features/settings/items/MapLayerIncidentsItem.d.ts +2 -0
- package/components/map/components/features/settings/items/MapLayerRoadRestrictionsItem.d.ts +2 -0
- package/components/map/components/features/settings/items/MapLayerTrafficItem.d.ts +2 -0
- package/components/map/components/features/settings/items/MapSettingsDropdownHeader.d.ts +4 -0
- package/components/map/components/features/settings/items/MapSettingsDropdownHeader.js +9 -0
- package/components/map/components/features/settings/items/MapWorkshopPoiSettingsItem.d.ts +2 -0
- package/components/map/icons/MapIcon.d.ts +1 -2
- package/components/map/icons/MapIcon.js +3 -1
- package/components/mapMarker/ClusterMapMarker.d.ts +4 -0
- package/components/mapMarker/ClusterMapMarker.js +2 -2
- package/components/mapMarker/SingleMapMarker.d.ts +4 -0
- package/components/mapMarker/SingleMapMarker.js +3 -3
- package/components/selects/DropdownHeader.d.ts +1 -0
- package/components/selects/DropdownHeader.js +2 -2
- package/components/selects/Multiselect.js +2 -2
- package/components/selects/MultiselectToggleFilter.js +1 -1
- package/components/states/CustomState.js +2 -2
- package/hooks/useAfterMount.js +8 -4
- package/lib/es/DropdownHeader.d.ts +2 -0
- package/lib/es/DropdownHeader.js +7 -0
- package/lib/es/FeedbackInlineButtons.d.ts +2 -0
- package/lib/es/FeedbackInlineButtons.js +7 -0
- package/lib/es/FeedbackRating.d.ts +2 -0
- package/lib/es/FeedbackRating.js +7 -0
- package/lib/es/FeedbackReactions.d.ts +2 -0
- package/lib/es/FeedbackReactions.js +7 -0
- package/lib/es/MapAdditionalLayerSettings.d.ts +2 -0
- package/lib/es/MapAdditionalLayerSettings.js +7 -0
- package/lib/es/MapSettingsDropdownHeader.d.ts +2 -0
- package/lib/es/MapSettingsDropdownHeader.js +7 -0
- package/lib/es/SmoothScrollbars.d.ts +2 -0
- package/lib/es/SmoothScrollbars.js +7 -0
- package/lib/es/components/feedback/FeedbackInlineButtons.d.ts +13 -0
- package/lib/es/components/feedback/FeedbackInlineButtons.js +11 -0
- package/lib/es/components/feedback/FeedbackRating.d.ts +65 -0
- package/lib/es/components/feedback/FeedbackRating.js +25 -0
- package/lib/es/components/feedback/FeedbackReactions.d.ts +71 -0
- package/lib/es/components/feedback/FeedbackReactions.js +28 -0
- package/lib/es/components/listMenu/ListMenu.d.ts +5 -1
- package/lib/es/components/listMenu/ListMenu.js +2 -2
- package/lib/es/components/map/components/features/settings/MapSettingsItem.d.ts +1 -0
- package/lib/es/components/map/components/features/settings/MapSettingsItem.js +13 -10
- package/lib/es/components/map/components/features/settings/MapSettingsTile.d.ts +3 -2
- package/lib/es/components/map/components/features/settings/MapSettingsTile.js +39 -4
- package/lib/es/components/map/components/features/settings/builtinSettings/MapAdditionalLayerSettings.d.ts +9 -0
- package/lib/es/components/map/components/features/settings/builtinSettings/MapAdditionalLayerSettings.js +17 -0
- package/lib/es/components/map/components/features/settings/builtinSettings/MapClusterSettings.d.ts +3 -0
- package/lib/es/components/map/components/features/settings/builtinSettings/MapClusterSettings.js +8 -2
- package/lib/es/components/map/components/features/settings/builtinSettings/MapLayerSettings.js +14 -8
- package/lib/es/components/map/components/features/settings/builtinSettings/MapTypeSettings.d.ts +6 -0
- package/lib/es/components/map/components/features/settings/builtinSettings/MapTypeSettings.js +20 -2
- package/lib/es/components/map/components/features/settings/buttons/MapCenterMarkerButton.js +1 -1
- package/lib/es/components/map/components/features/settings/items/MapCustomerPoiSettingsItem.d.ts +2 -0
- package/lib/es/components/map/components/features/settings/items/MapLayerIncidentsItem.d.ts +2 -0
- package/lib/es/components/map/components/features/settings/items/MapLayerRoadRestrictionsItem.d.ts +2 -0
- package/lib/es/components/map/components/features/settings/items/MapLayerTrafficItem.d.ts +2 -0
- package/lib/es/components/map/components/features/settings/items/MapSettingsDropdownHeader.d.ts +4 -0
- package/lib/es/components/map/components/features/settings/items/MapSettingsDropdownHeader.js +11 -0
- package/lib/es/components/map/components/features/settings/items/MapWorkshopPoiSettingsItem.d.ts +2 -0
- package/lib/es/components/map/icons/MapIcon.d.ts +1 -2
- package/lib/es/components/map/icons/MapIcon.js +3 -1
- package/lib/es/components/mapMarker/ClusterMapMarker.d.ts +4 -0
- package/lib/es/components/mapMarker/ClusterMapMarker.js +2 -2
- package/lib/es/components/mapMarker/SingleMapMarker.d.ts +4 -0
- package/lib/es/components/mapMarker/SingleMapMarker.js +3 -3
- package/lib/es/components/selects/DropdownHeader.d.ts +1 -0
- package/lib/es/components/selects/DropdownHeader.js +2 -2
- package/lib/es/components/selects/Multiselect.js +1 -1
- package/lib/es/components/selects/MultiselectToggleFilter.js +1 -1
- package/lib/es/components/states/CustomState.js +2 -2
- package/lib/es/hooks/useAfterMount.js +8 -4
- package/lib/es/utils/deviceUtils.d.ts +1 -0
- package/lib/es/utils/deviceUtils.js +3 -1
- package/lib/es/version.json +1 -1
- package/package.json +1 -1
- package/utils/deviceUtils.d.ts +1 -0
- package/utils/deviceUtils.js +1 -0
- package/version.json +1 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
7
|
+
const framer_motion_1 = require("framer-motion");
|
|
8
|
+
const useHover_1 = tslib_1.__importDefault(require("../../hooks/useHover"));
|
|
9
|
+
const FeedbackReactions = (props) => {
|
|
10
|
+
const { headline, animated, labelUp, labelDown, labelPosition = 'bottom', size = 'md', colorFillUp = '', colorFillDown = '', colorHoverUp = 'primary', colorHoverDown = 'primary', onVoteUp = () => { }, onVoteDown = () => { }, itemClassName } = props, remainingProps = tslib_1.__rest(props, ["headline", "animated", "labelUp", "labelDown", "labelPosition", "size", "colorFillUp", "colorFillDown", "colorHoverUp", "colorHoverDown", "onVoteUp", "onVoteDown", "itemClassName"]);
|
|
11
|
+
const hasLabels = !!labelUp || !!labelDown;
|
|
12
|
+
const wrapperClassName = (0, classnames_1.default)(hasLabels ? 'display-grid grid-cols-2' : 'display-flex', 'gap-15', 'padding-top-5', 'user-select-none');
|
|
13
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, remainingProps, { className: wrapperClassName }, { children: [(0, jsx_runtime_1.jsx)(FeedbackItem, { size: size, fillColor: colorFillDown, hoverColor: colorHoverDown, animated: animated, iconName: 'thumbs-down', text: labelDown, labelPosition: labelPosition, onClick: onVoteDown, className: itemClassName }), (0, jsx_runtime_1.jsx)(FeedbackItem, { size: size, fillColor: colorFillUp, hoverColor: colorHoverUp, animated: animated, iconName: 'thumbs-up', text: labelUp, labelPosition: labelPosition, onClick: onVoteUp, className: itemClassName })] })));
|
|
14
|
+
};
|
|
15
|
+
const FeedbackItem = (props) => {
|
|
16
|
+
const { size, text, iconName, onClick, fillColor, hoverColor, animated = false, labelPosition = 'bottom', className, } = props;
|
|
17
|
+
const ref = (0, react_1.useRef)(null);
|
|
18
|
+
const isHover = (0, useHover_1.default)(ref);
|
|
19
|
+
const iconClasses = (0, classnames_1.default)(size === 'sm' ? 'width-40' : 'width-50', 'aspect-ratio-1', 'border rounded-circle', fillColor ? `bg-${fillColor} text-color-white` : 'bg-lightest', isHover ? `border-color-${hoverColor} text-color-${hoverColor}` : 'border-color-lightest', 'display-grid place-items-center', 'text-size-14');
|
|
20
|
+
const wrapperClassName = (0, classnames_1.default)('display-flex', 'gap-10', labelPosition === 'bottom' ? 'flex-column' : '', 'align-items-center', 'text-center', 'cursor-pointer', className);
|
|
21
|
+
const isUp = iconName.includes('up');
|
|
22
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ ref: ref, className: wrapperClassName, onClick: onClick }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: iconClasses }, { children: (0, jsx_runtime_1.jsx)(framer_motion_1.motion.span, { initial: { y: 0, rotate: 0 }, animate: animated && isHover ? { y: [0, isUp ? -3 : 3, 0], rotate: [0, isUp ? -10 : 10, 0] } : { y: 0 }, transition: {
|
|
23
|
+
duration: 0.6,
|
|
24
|
+
repeat: isHover ? Number.POSITIVE_INFINITY : 0,
|
|
25
|
+
repeatType: 'loop',
|
|
26
|
+
}, className: `rioglyph rioglyph-${iconName} text-size-200pct` }) })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: `text-wrap-balance line-height-125rel text-medium ${isHover ? `text-color-${hoverColor}` : 'text-color-darker'}` }, { children: text }))] })));
|
|
27
|
+
};
|
|
28
|
+
exports.default = FeedbackReactions;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
2
|
import { type ListMenuNavItem, type ListMenuItem } from './ListMenuGroup';
|
|
3
3
|
export type ListMenuProps<T extends ListMenuNavItem> = {
|
|
4
4
|
/**
|
|
@@ -52,6 +52,10 @@ export type ListMenuProps<T extends ListMenuNavItem> = {
|
|
|
52
52
|
* Additional classes to be set on the menu group element.
|
|
53
53
|
*/
|
|
54
54
|
groupClassName?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Additional addon for the input group.
|
|
57
|
+
*/
|
|
58
|
+
trailingInputAddon?: React.ReactNode;
|
|
55
59
|
/**
|
|
56
60
|
* Additional classes to be set on the wrapper element.
|
|
57
61
|
*/
|
|
@@ -18,7 +18,7 @@ const MOBILE_MAX_WIDTH = 580;
|
|
|
18
18
|
const filterMenuItems = (items, value, filterKey) => items.map(item => (Object.assign(Object.assign({}, item), { navItems: item.navItems.filter(navItem => navItem[filterKey].toLowerCase().includes(value.toLowerCase())) })));
|
|
19
19
|
const hasMenuItems = (items) => items.find(({ navItems }) => !(0, isEmpty_1.default)(navItems));
|
|
20
20
|
const ListMenu = (props) => {
|
|
21
|
-
const { menuItems, focusFilter = false, enableFilter = false, filterPlaceholder, notFoundMessage, className = '', groupClassName = '', responsive = true, autoClose = true, filterKey = 'key' } = props, remainingProps = tslib_1.__rest(props, ["menuItems", "focusFilter", "enableFilter", "filterPlaceholder", "notFoundMessage", "className", "groupClassName", "responsive", "autoClose", "filterKey"]);
|
|
21
|
+
const { menuItems, focusFilter = false, enableFilter = false, filterPlaceholder, notFoundMessage, className = '', groupClassName = '', responsive = true, autoClose = true, filterKey = 'key', trailingInputAddon } = props, remainingProps = tslib_1.__rest(props, ["menuItems", "focusFilter", "enableFilter", "filterPlaceholder", "notFoundMessage", "className", "groupClassName", "responsive", "autoClose", "filterKey", "trailingInputAddon"]);
|
|
22
22
|
const [filterValue, setFilterValue] = (0, react_1.useState)('');
|
|
23
23
|
const [isMobileMode, setIsMobileMode] = (0, react_1.useState)(false);
|
|
24
24
|
const [isExpanderOpen, setIsExpanderOpen] = (0, react_1.useState)(false);
|
|
@@ -69,7 +69,7 @@ const ListMenu = (props) => {
|
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
71
|
const formClassNames = (0, classnames_1.default)('form-group', 'margin-bottom-5', 'padding-left-15', 'padding-right-15', 'padding-bottom-15', 'position-sticky', 'top-0');
|
|
72
|
-
const listMenu = ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, remainingProps, { className: `ListMenu ${className}`, ref: listRef }, { children: [enableFilter && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: formClassNames }, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: 'input-group width-100pct' }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: 'input-group-addon' }, { children: (0, jsx_runtime_1.jsx)("span", { className: 'rioglyph rioglyph-search', "aria-hidden": 'true' }) })), (0, jsx_runtime_1.jsx)(ClearableInput_1.default, { value: filterValue, inputRef: inputRef, placeholder: filterPlaceholder, onChange: handleFilterChange, onClear: handleClear })] })) }))), !hasMenuItems(filteredMenuItems) && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'padding-top-25 text-center text-color-gray' }, { children: notFoundMessage }))), filteredMenuItems.map(menuGroup => ((0, jsx_runtime_1.jsx)(ListMenuGroup_1.default, { className: groupClassName, menuGroup: menuGroup }, crypto.randomUUID())))] })));
|
|
72
|
+
const listMenu = ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, remainingProps, { className: `ListMenu ${className}`, ref: listRef }, { children: [enableFilter && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: formClassNames }, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: 'input-group width-100pct' }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: 'input-group-addon' }, { children: (0, jsx_runtime_1.jsx)("span", { className: 'rioglyph rioglyph-search', "aria-hidden": 'true' }) })), (0, jsx_runtime_1.jsx)(ClearableInput_1.default, { value: filterValue, inputRef: inputRef, placeholder: filterPlaceholder, onChange: handleFilterChange, onClear: handleClear }), trailingInputAddon && trailingInputAddon] })) }))), !hasMenuItems(filteredMenuItems) && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'padding-top-25 text-center text-color-gray' }, { children: notFoundMessage }))), filteredMenuItems.map(menuGroup => ((0, jsx_runtime_1.jsx)(ListMenuGroup_1.default, { className: groupClassName, menuGroup: menuGroup }, crypto.randomUUID())))] })));
|
|
73
73
|
if (responsive && isMobileMode) {
|
|
74
74
|
return ((0, jsx_runtime_1.jsx)(ExpanderPanel_1.default, Object.assign({ title: mobileHeader, bsStyle: 'default', open: isExpanderOpen, onToggle: () => setIsExpanderOpen(!isExpanderOpen), unmountOnExit: false, className: 'shadow-default' }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ onClick: handleExpanderBodyClick }, { children: listMenu })) })));
|
|
75
75
|
}
|
|
@@ -4,6 +4,7 @@ export type MapSettingsItemProps = {
|
|
|
4
4
|
inactiveIcon?: JSX.Element;
|
|
5
5
|
isActive?: boolean;
|
|
6
6
|
className?: string;
|
|
7
|
+
label?: string | JSX.Element;
|
|
7
8
|
onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
8
9
|
};
|
|
9
10
|
declare const MapSettingsItem: (props: MapSettingsItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,15 +6,18 @@ const react_1 = tslib_1.__importDefault(require("react"));
|
|
|
6
6
|
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
7
7
|
const noop_1 = tslib_1.__importDefault(require("lodash/fp/noop"));
|
|
8
8
|
const MapSettingsItem = (props) => {
|
|
9
|
-
const { onClick = noop_1.default, activeIcon, inactiveIcon, isActive = false, className = '' } = props;
|
|
10
|
-
const activeIconClassNames = (0, classnames_1.default)('MapSettingsTileIcon', 'hover-scale-110', isActive ? 'display-block' : 'display-none', (activeIcon === null || activeIcon === void 0 ? void 0 : activeIcon.props.className) || '');
|
|
11
|
-
const inactiveIconClassNames = (0, classnames_1.default)('MapSettingsTileIcon', 'hover-scale-110', isActive ? 'display-none' : 'display-block', (inactiveIcon === null || inactiveIcon === void 0 ? void 0 : inactiveIcon.props.className) || '');
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
const { onClick = noop_1.default, activeIcon, inactiveIcon, isActive = false, label, className = '' } = props;
|
|
10
|
+
const activeIconClassNames = (0, classnames_1.default)('MapSettingsTileIcon', !label && 'hover-scale-110', isActive ? 'display-block' : 'display-none', (activeIcon === null || activeIcon === void 0 ? void 0 : activeIcon.props.className) || '');
|
|
11
|
+
const inactiveIconClassNames = (0, classnames_1.default)('MapSettingsTileIcon', !label && 'hover-scale-110', isActive ? 'display-none' : 'display-block', (inactiveIcon === null || inactiveIcon === void 0 ? void 0 : inactiveIcon.props.className) || '');
|
|
12
|
+
const defaultIcon = activeIcon &&
|
|
13
|
+
react_1.default.cloneElement(activeIcon, {
|
|
14
|
+
className: activeIconClassNames,
|
|
15
|
+
});
|
|
16
|
+
const highlightedIcon = inactiveIcon &&
|
|
17
|
+
react_1.default.cloneElement(inactiveIcon, {
|
|
18
|
+
className: inactiveIconClassNames,
|
|
19
|
+
});
|
|
20
|
+
const mapSettingsItemClassNames = (0, classnames_1.default)('MapSettingsItem', 'display-flex align-items-center gap-10', 'text-color-darker', label && 'margin--5', className);
|
|
21
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: mapSettingsItemClassNames, onClick: onClick }, { children: [label && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: 'margin-left--5' }, { children: [highlightedIcon, defaultIcon] })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'flex-1-1 line-height-16 padding-right-5' }, { children: label }))] })), !label && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [highlightedIcon, defaultIcon] }))] })));
|
|
19
22
|
};
|
|
20
23
|
exports.default = MapSettingsItem;
|
|
@@ -3,8 +3,9 @@ export type MapSettingsTileProps = {
|
|
|
3
3
|
onToggle?: () => void;
|
|
4
4
|
tooltip?: React.ReactNode;
|
|
5
5
|
panel?: React.ReactNode;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
items?: JSX.Element[] | undefined;
|
|
7
|
+
activeIcon?: JSX.Element | undefined;
|
|
8
|
+
inactiveIcon?: JSX.Element | undefined;
|
|
8
9
|
isActive?: boolean;
|
|
9
10
|
buttonClassName?: string;
|
|
10
11
|
className?: string;
|
|
@@ -6,14 +6,20 @@ const react_1 = tslib_1.__importStar(require("react"));
|
|
|
6
6
|
const framer_motion_1 = require("framer-motion");
|
|
7
7
|
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
8
8
|
const noop_1 = tslib_1.__importDefault(require("lodash/fp/noop"));
|
|
9
|
+
const react_popper_1 = require("react-popper");
|
|
9
10
|
const OverlayTrigger_1 = tslib_1.__importDefault(require("../../../../overlay/OverlayTrigger"));
|
|
10
11
|
const Tooltip_1 = tslib_1.__importDefault(require("../../../../tooltip/Tooltip"));
|
|
11
12
|
const useClickOutside_1 = tslib_1.__importDefault(require("../../../../../hooks/useClickOutside"));
|
|
13
|
+
const MenuItemList_1 = tslib_1.__importDefault(require("../../../../menuItems/MenuItemList"));
|
|
14
|
+
const MenuItem_1 = tslib_1.__importDefault(require("../../../../menuItems/MenuItem"));
|
|
15
|
+
const deviceUtils_1 = require("../../../../../utils/deviceUtils");
|
|
16
|
+
const TOOLTIP_SHOW_TIMEOUT_IN_MS = 800;
|
|
17
|
+
const TOOLTIP_HIDE_TIMEOUT_IN_MS = 100;
|
|
12
18
|
const getComponentWithTooltip = (component, tooltip) => {
|
|
13
|
-
return ((0, jsx_runtime_1.jsx)(OverlayTrigger_1.default, Object.assign({ placement: Tooltip_1.default.TOP, delay: { show:
|
|
19
|
+
return ((0, jsx_runtime_1.jsx)(OverlayTrigger_1.default, Object.assign({ placement: Tooltip_1.default.TOP, delay: { show: TOOLTIP_SHOW_TIMEOUT_IN_MS, hide: TOOLTIP_HIDE_TIMEOUT_IN_MS }, overlay: (0, jsx_runtime_1.jsx)(Tooltip_1.default, Object.assign({ id: 'tooltip', width: 'auto' }, { children: tooltip })) }, { children: component })));
|
|
14
20
|
};
|
|
15
21
|
const MapSettingsTile = (props) => {
|
|
16
|
-
const { onToggle = noop_1.default, activeIcon, inactiveIcon, isActive = false, panel, className, buttonClassName, tooltip } = props, remainingProps = tslib_1.__rest(props, ["onToggle", "activeIcon", "inactiveIcon", "isActive", "panel", "className", "buttonClassName", "tooltip"]);
|
|
22
|
+
const { onToggle = noop_1.default, activeIcon, inactiveIcon, isActive = false, panel, items, className, buttonClassName, tooltip } = props, remainingProps = tslib_1.__rest(props, ["onToggle", "activeIcon", "inactiveIcon", "isActive", "panel", "items", "className", "buttonClassName", "tooltip"]);
|
|
17
23
|
const [isOpen, setIsOpen] = (0, react_1.useState)(false);
|
|
18
24
|
const handleToggle = () => {
|
|
19
25
|
const newState = !isOpen;
|
|
@@ -29,8 +35,32 @@ const MapSettingsTile = (props) => {
|
|
|
29
35
|
}
|
|
30
36
|
};
|
|
31
37
|
const buttonRef = (0, useClickOutside_1.default)(handleClosePanel);
|
|
38
|
+
const [toggleRef, setToggleRef] = (0, react_1.useState)(null);
|
|
39
|
+
const [refDropdownMenu, setRefDropdownMenu] = (0, react_1.useState)(null);
|
|
40
|
+
const { styles, attributes } = (0, react_popper_1.usePopper)(toggleRef, refDropdownMenu, {
|
|
41
|
+
placement: 'top-end',
|
|
42
|
+
modifiers: (0, deviceUtils_1.isMobileScreen)()
|
|
43
|
+
? [
|
|
44
|
+
{
|
|
45
|
+
name: 'offset',
|
|
46
|
+
options: {
|
|
47
|
+
offset: [-60, -60],
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
]
|
|
51
|
+
: [],
|
|
52
|
+
});
|
|
53
|
+
const dropdownWrapperRef = (0, useClickOutside_1.default)((event) => {
|
|
54
|
+
if (toggleRef === null || toggleRef === void 0 ? void 0 : toggleRef.contains(event.target)) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (isOpen) {
|
|
58
|
+
setIsOpen(false);
|
|
59
|
+
onToggle(false);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
32
62
|
const wrapperClasses = (0, classnames_1.default)('MapSettingsTile', className);
|
|
33
|
-
const buttonClasses = (0, classnames_1.default)('MapSettingsButton', buttonClassName);
|
|
63
|
+
const buttonClasses = (0, classnames_1.default)('MapSettingsButton', isOpen && 'active', buttonClassName);
|
|
34
64
|
const activeIconClassNames = (0, classnames_1.default)('MapSettingsTileIcon', 'hover-scale-110', isActive ? 'display-block' : 'display-none', (activeIcon === null || activeIcon === void 0 ? void 0 : activeIcon.props.className) || '');
|
|
35
65
|
const inactiveIconClassNames = (0, classnames_1.default)('MapSettingsTileIcon', 'hover-scale-110', isActive ? 'display-none' : 'display-block', (inactiveIcon === null || inactiveIcon === void 0 ? void 0 : inactiveIcon.props.className) || '');
|
|
36
66
|
const button = ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: buttonClasses, onClick: handleToggle }, { children: [activeIcon &&
|
|
@@ -40,6 +70,11 @@ const MapSettingsTile = (props) => {
|
|
|
40
70
|
react_1.default.cloneElement(inactiveIcon, {
|
|
41
71
|
className: inactiveIconClassNames,
|
|
42
72
|
})] })));
|
|
43
|
-
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: wrapperClasses, ref: buttonRef }, remainingProps, { children: [tooltip ? getComponentWithTooltip(button, tooltip) : button, (0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'overflow-hidden' }, { children: (0, jsx_runtime_1.jsx)(framer_motion_1.AnimatePresence, { children: isOpen && panel && panel }) }))] })))
|
|
73
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: wrapperClasses, ref: buttonRef }, remainingProps, { children: [!items && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [tooltip && !isOpen ? getComponentWithTooltip(button, tooltip) : button, (0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'overflow-hidden' }, { children: (0, jsx_runtime_1.jsx)(framer_motion_1.AnimatePresence, { children: isOpen && panel && panel }) }))] })), items && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: 'MapSettingsTile-inner position-relative', ref: setToggleRef }, { children: [tooltip && !isOpen ? getComponentWithTooltip(button, tooltip) : button, (0, jsx_runtime_1.jsx)(framer_motion_1.AnimatePresence, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'dropdown', ref: dropdownWrapperRef }, { children: isOpen && items && ((0, jsx_runtime_1.jsx)(MenuItemList_1.default, 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) => {
|
|
74
|
+
if (item.type.name === 'MapSettingsDropdownHeader') {
|
|
75
|
+
return item;
|
|
76
|
+
}
|
|
77
|
+
return (0, jsx_runtime_1.jsx)(MenuItem_1.default, { value: item }, index);
|
|
78
|
+
}) }))) })) })] })))] })));
|
|
44
79
|
};
|
|
45
80
|
exports.default = MapSettingsTile;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type MapAdditionalLayerSettingsProps = {
|
|
3
|
+
activeBuiltinLayers?: string[];
|
|
4
|
+
activeLayers?: string[];
|
|
5
|
+
layers?: JSX.Element[];
|
|
6
|
+
tooltip?: string | React.ReactNode;
|
|
7
|
+
};
|
|
8
|
+
declare const MapAdditionalLayerSettings: (props: MapAdditionalLayerSettingsProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default MapAdditionalLayerSettings;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
// @ts-ignore-next-line importsNotUsedAsValues
|
|
6
|
+
require("react");
|
|
7
|
+
const isEmpty_1 = tslib_1.__importDefault(require("lodash/fp/isEmpty"));
|
|
8
|
+
const union_1 = tslib_1.__importDefault(require("lodash/fp/union"));
|
|
9
|
+
const MapSettingsTile_1 = tslib_1.__importDefault(require("../MapSettingsTile"));
|
|
10
|
+
const MapIcon_1 = require("../../../../icons/MapIcon");
|
|
11
|
+
const MapAdditionalLayerSettings = (props) => {
|
|
12
|
+
const { activeBuiltinLayers = [], activeLayers = [], layers = [] } = props, remainingProps = tslib_1.__rest(props, ["activeBuiltinLayers", "activeLayers", "layers"]);
|
|
13
|
+
const allActiveLayer = (0, union_1.default)(activeBuiltinLayers, activeLayers);
|
|
14
|
+
const isActive = !(0, isEmpty_1.default)(allActiveLayer);
|
|
15
|
+
return ((0, jsx_runtime_1.jsx)(MapSettingsTile_1.default, Object.assign({ className: 'MapAdditionalLayerSettings', isActive: !(0, isEmpty_1.default)(allActiveLayer), activeIcon: isActive ? ((0, jsx_runtime_1.jsx)(MapIcon_1.MapIcon, { name: 'rioglyph-layer-pois text-color-primary', className: 'MapAdditionalLayerIcon' })) : undefined, inactiveIcon: !isActive ? ((0, jsx_runtime_1.jsx)(MapIcon_1.MapIcon, { name: 'rioglyph-layer-pois text-color-gray', className: 'MapAdditionalLayerIconInactive' })) : undefined, items: layers }, remainingProps)));
|
|
16
|
+
};
|
|
17
|
+
exports.default = MapAdditionalLayerSettings;
|
package/lib/es/components/map/components/features/settings/builtinSettings/MapClusterSettings.d.ts
CHANGED
|
@@ -3,6 +3,9 @@ export type MapClusterSettingsProps = {
|
|
|
3
3
|
onToggle?: (setShowCluster: boolean) => void;
|
|
4
4
|
onShowClusterChange?: (setShowCluster: boolean) => boolean;
|
|
5
5
|
showCluster?: boolean;
|
|
6
|
+
clusterEnabledLabel?: string | JSX.Element;
|
|
7
|
+
clusterDisabledLabel?: string | JSX.Element;
|
|
8
|
+
dropdownHeaderText?: string | JSX.Element;
|
|
6
9
|
tooltip?: string | React.ReactNode;
|
|
7
10
|
};
|
|
8
11
|
declare const MapClusterSettings: (props: MapClusterSettingsProps) => import("react/jsx-runtime").JSX.Element;
|
package/lib/es/components/map/components/features/settings/builtinSettings/MapClusterSettings.js
CHANGED
|
@@ -5,16 +5,22 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
// @ts-ignore-next-line importsNotUsedAsValues
|
|
6
6
|
require("react");
|
|
7
7
|
const noop_1 = tslib_1.__importDefault(require("lodash/fp/noop"));
|
|
8
|
+
const compact_1 = tslib_1.__importDefault(require("lodash/fp/compact"));
|
|
8
9
|
const MapSettingsPanel_1 = tslib_1.__importDefault(require("../MapSettingsPanel"));
|
|
9
10
|
const MapSettingsItem_1 = tslib_1.__importDefault(require("../MapSettingsItem"));
|
|
10
11
|
const MapSettingsTile_1 = tslib_1.__importDefault(require("../MapSettingsTile"));
|
|
11
12
|
const MapIcon_1 = require("../../../../icons/MapIcon");
|
|
13
|
+
const MapSettingsDropdownHeader_1 = tslib_1.__importDefault(require("../items/MapSettingsDropdownHeader"));
|
|
12
14
|
const MapClusterSettings = (props) => {
|
|
13
|
-
const { showCluster = true, onShowClusterChange = noop_1.default, onToggle = noop_1.default } = props, remainingProps = tslib_1.__rest(props, ["showCluster", "onShowClusterChange", "onToggle"]);
|
|
15
|
+
const { showCluster = true, onShowClusterChange = noop_1.default, onToggle = noop_1.default, clusterEnabledLabel, clusterDisabledLabel, dropdownHeaderText } = props, remainingProps = tslib_1.__rest(props, ["showCluster", "onShowClusterChange", "onToggle", "clusterEnabledLabel", "clusterDisabledLabel", "dropdownHeaderText"]);
|
|
14
16
|
const handleShowCluster = (setShowCluster) => {
|
|
15
17
|
onShowClusterChange(setShowCluster);
|
|
16
18
|
onToggle(setShowCluster);
|
|
17
19
|
};
|
|
18
|
-
|
|
20
|
+
const hasLabels = !!clusterEnabledLabel || !!clusterDisabledLabel;
|
|
21
|
+
const dropdownHeader = dropdownHeaderText && ((0, jsx_runtime_1.jsx)(MapSettingsDropdownHeader_1.default, { label: dropdownHeaderText }, 'mapClusterDropdownHeader'));
|
|
22
|
+
const enableClusterButtons = ((0, jsx_runtime_1.jsx)(MapSettingsItem_1.default, { onClick: () => handleShowCluster(true), isActive: showCluster, activeIcon: (0, jsx_runtime_1.jsx)(MapIcon_1.MapIcon, { name: MapIcon_1.CLUSTER_ACTIVE, className: 'MapClusterIcon' }), inactiveIcon: (0, jsx_runtime_1.jsx)(MapIcon_1.MapIcon, { name: MapIcon_1.CLUSTER_INACTIVE, className: 'MapClusterIconInactive' }), label: clusterEnabledLabel }, 'enableClusterButtons'));
|
|
23
|
+
const disableClusterButton = ((0, jsx_runtime_1.jsx)(MapSettingsItem_1.default, { onClick: () => handleShowCluster(false), isActive: !showCluster, activeIcon: (0, jsx_runtime_1.jsx)(MapIcon_1.MapIcon, { name: MapIcon_1.NO_CLUSTER_ACTIVE, className: 'MapNoClusterIcon' }), inactiveIcon: (0, jsx_runtime_1.jsx)(MapIcon_1.MapIcon, { name: MapIcon_1.NO_CLUSTER_INACTIVE, className: 'MapNoClusterIconInactive' }), label: clusterDisabledLabel }, 'disableClusterButton'));
|
|
24
|
+
return ((0, jsx_runtime_1.jsx)(MapSettingsTile_1.default, Object.assign({ className: 'MapClusterSettings', isActive: showCluster, activeIcon: (0, jsx_runtime_1.jsx)(MapIcon_1.MapIcon, { name: MapIcon_1.CLUSTER_INACTIVE }), inactiveIcon: (0, jsx_runtime_1.jsx)(MapIcon_1.MapIcon, { name: MapIcon_1.NO_CLUSTER_INACTIVE }), items: hasLabels ? (0, compact_1.default)([dropdownHeader, enableClusterButtons, disableClusterButton]) : undefined, panel: !hasLabels && ((0, jsx_runtime_1.jsxs)(MapSettingsPanel_1.default, { children: [enableClusterButtons, disableClusterButton] })) }, remainingProps)));
|
|
19
25
|
};
|
|
20
26
|
exports.default = MapClusterSettings;
|
package/lib/es/components/map/components/features/settings/builtinSettings/MapLayerSettings.js
CHANGED
|
@@ -11,15 +11,21 @@ const MapSettingsPanel_1 = tslib_1.__importDefault(require("../MapSettingsPanel"
|
|
|
11
11
|
const MapSettingsTile_1 = tslib_1.__importDefault(require("../MapSettingsTile"));
|
|
12
12
|
const MapIcon_1 = require("../../../../icons/MapIcon");
|
|
13
13
|
const MapLayerSettings = (props) => {
|
|
14
|
+
var _a;
|
|
14
15
|
const { activeBuiltinLayers = [], activeLayers = [], layers = [], onMapLayerChange = noop_1.default } = props, remainingProps = tslib_1.__rest(props, ["activeBuiltinLayers", "activeLayers", "layers", "onMapLayerChange"]);
|
|
15
16
|
const allActiveLayer = (0, union_1.default)(activeBuiltinLayers, activeLayers);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
const hasLabels = !!((_a = layers.at(0)) === null || _a === void 0 ? void 0 : _a.props.label);
|
|
18
|
+
const isActive = !(0, isEmpty_1.default)(allActiveLayer);
|
|
19
|
+
// Inject onMapLayerChange from the MapContext which will be handled
|
|
20
|
+
// in the main Map component.
|
|
21
|
+
const enrichedLayers = (0, map_1.default)(layer => {
|
|
22
|
+
var _a;
|
|
23
|
+
return react_1.default.cloneElement(layer, {
|
|
24
|
+
key: (_a = layer === null || layer === void 0 ? void 0 : layer.key) !== null && _a !== void 0 ? _a : `MapLayerSettings_${crypto.randomUUID()}`,
|
|
25
|
+
activeBuiltinLayers,
|
|
26
|
+
onMapLayerChange,
|
|
27
|
+
});
|
|
28
|
+
}, layers);
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)(MapSettingsTile_1.default, Object.assign({ className: 'MapLayerSettings', isActive: isActive, activeIcon: isActive ? ((0, jsx_runtime_1.jsx)(MapIcon_1.MapIcon, { name: 'rioglyph-construction text-color-primary', className: 'MapLayerIcon' })) : undefined, inactiveIcon: !isActive ? ((0, jsx_runtime_1.jsx)(MapIcon_1.MapIcon, { name: 'rioglyph-construction text-color-gray', className: 'MapLayerIconInactive' })) : undefined, items: hasLabels ? enrichedLayers : undefined, panel: !hasLabels && (0, jsx_runtime_1.jsx)(MapSettingsPanel_1.default, { children: enrichedLayers }) }, remainingProps)));
|
|
24
30
|
};
|
|
25
31
|
exports.default = MapLayerSettings;
|
package/lib/es/components/map/components/features/settings/builtinSettings/MapTypeSettings.d.ts
CHANGED
|
@@ -4,7 +4,13 @@ export type MapTypeSettingsProps = {
|
|
|
4
4
|
mapType?: string;
|
|
5
5
|
enableNightMap?: boolean;
|
|
6
6
|
onMapTypeChange?: () => MapType;
|
|
7
|
+
defaultTypeLabel?: string | JSX.Element;
|
|
8
|
+
truckTypeLabel?: string | JSX.Element;
|
|
9
|
+
terrainTypeLabel?: string | JSX.Element;
|
|
10
|
+
satelliteTypeLabel?: string | JSX.Element;
|
|
11
|
+
nightTypeLabel?: string | JSX.Element;
|
|
7
12
|
tooltip?: string | React.ReactNode;
|
|
13
|
+
dropdownHeaderText?: string | JSX.Element;
|
|
8
14
|
};
|
|
9
15
|
declare const MapTypeSettings: (props: MapTypeSettingsProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
16
|
export default MapTypeSettings;
|
package/lib/es/components/map/components/features/settings/builtinSettings/MapTypeSettings.js
CHANGED
|
@@ -4,13 +4,15 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const noop_1 = tslib_1.__importDefault(require("lodash/fp/noop"));
|
|
7
|
+
const compact_1 = tslib_1.__importDefault(require("lodash/fp/compact"));
|
|
7
8
|
const constants_1 = require("../../../constants");
|
|
8
9
|
const MapSettingsPanel_1 = tslib_1.__importDefault(require("../MapSettingsPanel"));
|
|
9
10
|
const MapSettingsItem_1 = tslib_1.__importDefault(require("../MapSettingsItem"));
|
|
10
11
|
const MapSettingsTile_1 = tslib_1.__importDefault(require("../MapSettingsTile"));
|
|
11
12
|
const MapIcon_1 = require("../../../../icons/MapIcon");
|
|
13
|
+
const MapSettingsDropdownHeader_1 = tslib_1.__importDefault(require("../items/MapSettingsDropdownHeader"));
|
|
12
14
|
const MapTypeSettings = (props) => {
|
|
13
|
-
const { mapType, onMapTypeChange = noop_1.default, enableNightMap = true } = props, remainingProps = tslib_1.__rest(props, ["mapType", "onMapTypeChange", "enableNightMap"]);
|
|
15
|
+
const { mapType, onMapTypeChange = noop_1.default, enableNightMap = true, defaultTypeLabel, truckTypeLabel, terrainTypeLabel, satelliteTypeLabel, nightTypeLabel, dropdownHeaderText } = props, remainingProps = tslib_1.__rest(props, ["mapType", "onMapTypeChange", "enableNightMap", "defaultTypeLabel", "truckTypeLabel", "terrainTypeLabel", "satelliteTypeLabel", "nightTypeLabel", "dropdownHeaderText"]);
|
|
14
16
|
const type = (0, react_1.useMemo)(() => ({
|
|
15
17
|
isDefault: mapType === constants_1.MAP_TYPE_DEFAULT,
|
|
16
18
|
isFleetStyle: mapType === constants_1.MAP_TYPE_FLEET_STYLE,
|
|
@@ -35,6 +37,22 @@ const MapTypeSettings = (props) => {
|
|
|
35
37
|
return (0, jsx_runtime_1.jsx)(MapIcon_1.MapIcon, { name: MapIcon_1.MAP_TYPE_NIGHT_INACTIVE });
|
|
36
38
|
}
|
|
37
39
|
};
|
|
38
|
-
|
|
40
|
+
const dropdownHeader = dropdownHeaderText && ((0, jsx_runtime_1.jsx)(MapSettingsDropdownHeader_1.default, { label: dropdownHeaderText }, 'mapTypeDropdownHeader'));
|
|
41
|
+
const mapTypeNight = ((0, jsx_runtime_1.jsx)(MapSettingsItem_1.default, { className: 'MapTypeNight', onClick: () => onMapTypeChange(constants_1.MAP_TYPE_NIGHT), isActive: type.isNight, activeIcon: (0, jsx_runtime_1.jsx)(MapIcon_1.MapIcon, { name: MapIcon_1.MAP_TYPE_NIGHT_ACTIVE }), inactiveIcon: (0, jsx_runtime_1.jsx)(MapIcon_1.MapIcon, { name: MapIcon_1.MAP_TYPE_NIGHT_INACTIVE }), label: nightTypeLabel }, 'MapTypeNight'));
|
|
42
|
+
const mapTypeSatellite = ((0, jsx_runtime_1.jsx)(MapSettingsItem_1.default, { className: 'MapTypeSatellite', onClick: () => onMapTypeChange(constants_1.MAP_TYPE_SATELLITE), isActive: type.isSatellite, activeIcon: (0, jsx_runtime_1.jsx)(MapIcon_1.MapIcon, { name: MapIcon_1.MAP_TYPE_SATELLITE_ACTIVE }), inactiveIcon: (0, jsx_runtime_1.jsx)(MapIcon_1.MapIcon, { name: MapIcon_1.MAP_TYPE_SATELLITE_INACTIVE }), label: satelliteTypeLabel }, 'MapTypeSatellite'));
|
|
43
|
+
const mapTypeTerrain = ((0, jsx_runtime_1.jsx)(MapSettingsItem_1.default, { className: 'MapTypeTerrain', onClick: () => onMapTypeChange(constants_1.MAP_TYPE_TERRAIN), isActive: type.isTerrain, activeIcon: (0, jsx_runtime_1.jsx)(MapIcon_1.MapIcon, { name: MapIcon_1.MAP_TYPE_TERRAIN_ACTIVE }), inactiveIcon: (0, jsx_runtime_1.jsx)(MapIcon_1.MapIcon, { name: MapIcon_1.MAP_TYPE_TERRAIN_INACTIVE }), label: terrainTypeLabel }, 'MapTypeTerrain'));
|
|
44
|
+
const mapTypeTruck = ((0, jsx_runtime_1.jsx)(MapSettingsItem_1.default, { className: 'MapTypeFlatTruck', onClick: () => onMapTypeChange(constants_1.MAP_TYPE_FLEET_STYLE), isActive: type.isFleetStyle, activeIcon: (0, jsx_runtime_1.jsx)(MapIcon_1.MapIcon, { name: MapIcon_1.MAP_TYPE_FLAT_TRUCK_ACTIVE }), inactiveIcon: (0, jsx_runtime_1.jsx)(MapIcon_1.MapIcon, { name: MapIcon_1.MAP_TYPE_FLAT_TRUCK_INACTIVE }), label: truckTypeLabel }, 'MapTypeFlatTruck'));
|
|
45
|
+
const mapTypeDefault = ((0, jsx_runtime_1.jsx)(MapSettingsItem_1.default, { className: 'MapTypeFlat', onClick: () => onMapTypeChange(constants_1.MAP_TYPE_DEFAULT), isActive: type.isDefault, activeIcon: (0, jsx_runtime_1.jsx)(MapIcon_1.MapIcon, { name: MapIcon_1.MAP_TYPE_FLAT_ACTIVE }), inactiveIcon: (0, jsx_runtime_1.jsx)(MapIcon_1.MapIcon, { name: MapIcon_1.MAP_TYPE_FLAT_INACTIVE }), label: defaultTypeLabel }, 'MapTypeFlat'));
|
|
46
|
+
const hasLabels = !!defaultTypeLabel || !!truckTypeLabel || !!terrainTypeLabel || !!satelliteTypeLabel || !!nightTypeLabel;
|
|
47
|
+
return ((0, jsx_runtime_1.jsx)(MapSettingsTile_1.default, Object.assign({ className: 'MapTypeSettings', inactiveIcon: getIcon(type), items: hasLabels
|
|
48
|
+
? (0, compact_1.default)([
|
|
49
|
+
dropdownHeader,
|
|
50
|
+
mapTypeNight,
|
|
51
|
+
mapTypeSatellite,
|
|
52
|
+
mapTypeTerrain,
|
|
53
|
+
mapTypeTruck,
|
|
54
|
+
mapTypeDefault,
|
|
55
|
+
])
|
|
56
|
+
: undefined, panel: !hasLabels && ((0, jsx_runtime_1.jsxs)(MapSettingsPanel_1.default, { children: [enableNightMap && mapTypeNight, mapTypeSatellite, mapTypeTerrain, mapTypeTruck, mapTypeDefault] })) }, remainingProps)));
|
|
39
57
|
};
|
|
40
58
|
exports.default = MapTypeSettings;
|
|
@@ -8,6 +8,6 @@ const MapSettingsTile_1 = tslib_1.__importDefault(require("../MapSettingsTile"))
|
|
|
8
8
|
const MapIcon_1 = require("../../../../icons/MapIcon");
|
|
9
9
|
const MapCenterMarkerButton = (props) => {
|
|
10
10
|
const { isActive = false, onToggle } = props, remainingProps = tslib_1.__rest(props, ["isActive", "onToggle"]);
|
|
11
|
-
return ((0, jsx_runtime_1.jsx)(MapSettingsTile_1.default, Object.assign({ className: 'MapCenterMarkerButton', isActive: isActive, activeIcon: (0, jsx_runtime_1.jsx)(MapIcon_1.MapIcon, { name:
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)(MapSettingsTile_1.default, Object.assign({ className: 'MapCenterMarkerButton', isActive: isActive, activeIcon: isActive ? ((0, jsx_runtime_1.jsx)(MapIcon_1.MapIcon, { name: 'rioglyph-position text-color-primary', className: 'MapCenterMarkerButtonIcon' })) : undefined, inactiveIcon: !isActive ? ((0, jsx_runtime_1.jsx)(MapIcon_1.MapIcon, { name: 'rioglyph-position text-color-gray', className: 'MapCenterMarkerButtonIconInactive' })) : undefined, onToggle: onToggle }, remainingProps)));
|
|
12
12
|
};
|
|
13
13
|
exports.default = MapCenterMarkerButton;
|
package/lib/es/components/map/components/features/settings/items/MapCustomerPoiSettingsItem.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export type MapCustomerPoiSettingsItemProps = {
|
|
2
3
|
onToggle?: (setIsShown: boolean) => void;
|
|
3
4
|
isActive?: boolean;
|
|
5
|
+
label?: string | JSX.Element;
|
|
4
6
|
};
|
|
5
7
|
declare const MapCustomerPoiSettingsItem: (props: MapCustomerPoiSettingsItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
8
|
export default MapCustomerPoiSettingsItem;
|
package/lib/es/components/map/components/features/settings/items/MapSettingsDropdownHeader.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type DropdownHeaderProps } from '../../../../../selects/DropdownHeader';
|
|
2
|
+
export type MapSettingsDropdownHeaderProps = DropdownHeaderProps & {};
|
|
3
|
+
declare const MapSettingsDropdownHeader: (props: MapSettingsDropdownHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export default MapSettingsDropdownHeader;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
require("react");
|
|
6
|
+
const DropdownHeader_1 = tslib_1.__importDefault(require("../../../../../selects/DropdownHeader"));
|
|
7
|
+
const MapSettingsDropdownHeader = (props) => {
|
|
8
|
+
const remainingProps = tslib_1.__rest(props, []);
|
|
9
|
+
return (0, jsx_runtime_1.jsx)(DropdownHeader_1.default, Object.assign({ className: 'MapSettingsDropdownHeader' }, remainingProps));
|
|
10
|
+
};
|
|
11
|
+
exports.default = MapSettingsDropdownHeader;
|
package/lib/es/components/map/components/features/settings/items/MapWorkshopPoiSettingsItem.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export type MapWorkshopPoiSettingsItemProps = {
|
|
2
3
|
onToggle?: (setIsShown: boolean) => void;
|
|
3
4
|
isActive?: boolean;
|
|
5
|
+
label?: string | JSX.Element;
|
|
4
6
|
};
|
|
5
7
|
declare const MapWorkshopPoiSettingsItem: (props: MapWorkshopPoiSettingsItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
8
|
export default MapWorkshopPoiSettingsItem;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
export type MapIconProps = {
|
|
3
2
|
name?: string;
|
|
4
3
|
height?: number;
|
|
5
4
|
width?: number;
|
|
6
5
|
className?: string;
|
|
7
6
|
};
|
|
8
|
-
export declare const MapIcon: (props: MapIconProps) =>
|
|
7
|
+
export declare const MapIcon: (props: MapIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
8
|
export declare const ZOOM_IN = "zoomIn";
|
|
10
9
|
export declare const ZOOM_OUT = "zoomOut";
|
|
11
10
|
export declare const BOUNDING_BOX_ACTIVE = "boundingBoxActive";
|
|
@@ -7,7 +7,9 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
7
7
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
8
8
|
const MapIcon = (props) => {
|
|
9
9
|
const { className = '', name = '', height = 40, width = 40 } = props;
|
|
10
|
-
|
|
10
|
+
if (name.includes('rioglyph')) {
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'height-40 width-40 text-size-16 display-grid place-items-center hover-scale-110' }, { children: (0, jsx_runtime_1.jsx)("span", { className: `rioglyph ${name} text-size-200pct` }) })));
|
|
12
|
+
}
|
|
11
13
|
return react_1.default.cloneElement(icons[name], {
|
|
12
14
|
className,
|
|
13
15
|
height,
|
|
@@ -48,6 +48,10 @@ export type ClusterMapMarkerProps = {
|
|
|
48
48
|
* Name of a rioglyph icon.
|
|
49
49
|
*/
|
|
50
50
|
iconName?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Marker cursor
|
|
53
|
+
*/
|
|
54
|
+
cursor?: 'cursor-pointer' | 'cursor-grab' | 'cursor-not-allowed';
|
|
51
55
|
};
|
|
52
56
|
declare const ClusterMapMarker: (props: ClusterMapMarkerProps) => import("react/jsx-runtime").JSX.Element;
|
|
53
57
|
export default ClusterMapMarker;
|
|
@@ -6,8 +6,8 @@ require("react");
|
|
|
6
6
|
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
7
7
|
const mapTypes_1 = require("../map/utils/mapTypes");
|
|
8
8
|
const ClusterMapMarker = (props) => {
|
|
9
|
-
const { count, exceptionCount = 0, markerColor = 'bg-map-marker-asset', warningCount = 0, active = false, clickable = true, iconName, } = props;
|
|
10
|
-
const clusterClasses = (0, classnames_1.default)('rio-map-cluster-circle', active && 'active');
|
|
9
|
+
const { count, exceptionCount = 0, markerColor = 'bg-map-marker-asset', warningCount = 0, active = false, clickable = true, iconName, cursor = 'cursor-pointer', } = props;
|
|
10
|
+
const clusterClasses = (0, classnames_1.default)('rio-map-cluster-circle', active && 'active', cursor);
|
|
11
11
|
const classes = (0, classnames_1.default)(active && 'active', 'rio-map-marker', 'rio-map-marker-center-center', !clickable && 'not-clickable');
|
|
12
12
|
const markerBackgroundColor = `var(${mapTypes_1.markerColorMapping[markerColor]})`;
|
|
13
13
|
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: classes, style: { color: markerBackgroundColor }, "data-marker-type": markerColor.replace('bg-', 'cluster-') }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'rio-map-marker-translate' }, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: 'rio-map-cluster' }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: clusterClasses }, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: 'rio-map-cluster-content' }, { children: [iconName && (0, jsx_runtime_1.jsx)("div", { className: `rio-map-icon rioglyph rioglyph-${iconName}` }), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'rio-map-count' }, { children: count }))] })) })), 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 }))] })) })) })));
|
|
@@ -114,6 +114,10 @@ export type SingleMapMarkerProps = {
|
|
|
114
114
|
* Shows only the anchor without the rest of the marker.
|
|
115
115
|
*/
|
|
116
116
|
anchorOnly?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Marker cursor
|
|
119
|
+
*/
|
|
120
|
+
cursor?: 'cursor-pointer' | 'cursor-grab' | 'cursor-not-allowed';
|
|
117
121
|
};
|
|
118
122
|
declare const SingleMapMarker: (props: SingleMapMarkerProps) => import("react/jsx-runtime").JSX.Element;
|
|
119
123
|
export default SingleMapMarker;
|
|
@@ -19,11 +19,11 @@ 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, } = 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;
|
|
23
23
|
const largeAnchor = anchorSize === 'lg';
|
|
24
24
|
const classes = (0, classnames_1.default)(active && 'active', 'rio-map-marker', 'rio-map-marker-bottom-center', !clickable && 'not-clickable');
|
|
25
|
-
const anchorClasses = (0, classnames_1.default)('rio-map-anchor', largeAnchor ? 'rio-map-anchor-lg' : '');
|
|
26
|
-
const singleClasses = (0, classnames_1.default)('rio-map-single', fixed && 'fixed', moving && 'moving', textColor, markerOnHover && 'visible-on-hover', active && 'active', pinging && 'pinging');
|
|
25
|
+
const anchorClasses = (0, classnames_1.default)('rio-map-anchor', largeAnchor ? 'rio-map-anchor-lg' : '', cursor);
|
|
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
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}` }) }))] })) })));
|
|
29
29
|
};
|
|
@@ -3,6 +3,7 @@ export type DropdownHeaderProps = {
|
|
|
3
3
|
icon?: React.ReactNode;
|
|
4
4
|
center?: boolean;
|
|
5
5
|
label: string | React.ReactNode;
|
|
6
|
+
className?: string;
|
|
6
7
|
};
|
|
7
8
|
declare const DropdownHeader: (props: DropdownHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export default DropdownHeader;
|
|
@@ -4,7 +4,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
4
4
|
// @ts-ignore-next-line importsNotUsedAsValues
|
|
5
5
|
require("react");
|
|
6
6
|
const DropdownHeader = (props) => {
|
|
7
|
-
const { icon, label, center = true } = props;
|
|
8
|
-
return ((0, jsx_runtime_1.jsx)("li", Object.assign({ className: `dropdown-header ${center ? 'center' : ''}` }, { children: (0, jsx_runtime_1.jsxs)("span", Object.assign({ className: 'dropdown-header-text' }, { children: [icon && (0, jsx_runtime_1.jsx)("span", Object.assign({ className: 'margin-right-5' }, { children: icon })), label] })) })));
|
|
7
|
+
const { icon, label, center = true, className = '' } = props;
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)("li", Object.assign({ className: `dropdown-header ${center ? 'center' : ''} ${className}` }, { children: (0, jsx_runtime_1.jsxs)("span", Object.assign({ className: 'dropdown-header-text' }, { children: [icon && (0, jsx_runtime_1.jsx)("span", Object.assign({ className: 'margin-right-5' }, { children: icon })), label] })) })));
|
|
9
9
|
};
|
|
10
10
|
exports.default = DropdownHeader;
|
|
@@ -77,7 +77,7 @@ const Multiselect = (props) => {
|
|
|
77
77
|
const wrapperClassNames = (0, classnames_1.default)('dropdown-toggle', 'form-control', 'text-left', bsSize === 'sm' && 'input-sm', bsSize === 'lg' && 'input-lg', multiline && 'height-auto', disabled && 'disabled');
|
|
78
78
|
const showPlaceholder = (0, isEmpty_1.default)(selectedItemIds) && !showUnselectedItemIcons;
|
|
79
79
|
const showFilter = useFilter && isOpen && !counterMessage && !renderCounterMessage;
|
|
80
|
-
const toggleButton = ((0, jsx_runtime_1.jsxs)("button", Object.assign({ type: 'button', id: id, name: name, className: wrapperClassNames, "data-toggle": 'dropdown', tabIndex: tabIndex, "aria-haspopup": 'true', "aria-expanded": isOpen, onClick: onToggle, onKeyDown: handleToggleKeyDown, ref: refToggle }, { children: [showPlaceholder ? (0, jsx_runtime_1.jsx)(MultiselectTogglePlaceholder_1.default, { placeholder: placeholder }) : renderSelection(), showFilter && !multiline && renderFilter(), (0, jsx_runtime_1.jsx)("span", { className: 'caret' })] })));
|
|
80
|
+
const toggleButton = ((0, jsx_runtime_1.jsxs)("button", Object.assign({ type: 'button', id: id, name: name, className: wrapperClassNames, "data-toggle": 'dropdown', tabIndex: tabIndex, "aria-haspopup": 'true', "aria-expanded": isOpen, onClick: onToggle, onKeyDown: handleToggleKeyDown, ref: refToggle }, { children: [showPlaceholder ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(MultiselectTogglePlaceholder_1.default, { placeholder: placeholder }), showFilter && renderFilter()] })) : (renderSelection()), showFilter && !multiline && renderFilter(), (0, jsx_runtime_1.jsx)("span", { className: 'caret' })] })));
|
|
81
81
|
if (!inputAddon && !errorMessage && !warningMessage) {
|
|
82
82
|
return toggleButton;
|
|
83
83
|
}
|
|
@@ -8,7 +8,7 @@ const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
|
8
8
|
const isEmpty_1 = tslib_1.__importDefault(require("lodash/fp/isEmpty"));
|
|
9
9
|
const MultiselectToggleFilter = (props) => {
|
|
10
10
|
const { isActive, selectedItemIds, filterValue, multiline, onFilterChange } = props;
|
|
11
|
-
const inputClasses = (0, classnames_1.default)('multiselect-filter-input', (0, isEmpty_1.default)(selectedItemIds) && 'multiselect-filter-input-placeholder', isActive && 'multiselect-filter-input-active'
|
|
11
|
+
const inputClasses = (0, classnames_1.default)('multiselect-filter-input', (0, isEmpty_1.default)(selectedItemIds) && 'multiselect-filter-input-placeholder', isActive && 'multiselect-filter-input-active');
|
|
12
12
|
return ((0, jsx_runtime_1.jsx)("input", { type: 'text', role: 'searchbox', className: inputClasses,
|
|
13
13
|
// biome-ignore lint/a11y/noAutofocus: autofocus is intentionally set to allow instant typing to filter
|
|
14
14
|
autoFocus: true, onChange: onFilterChange, defaultValue: filterValue }));
|