@rio-cloud/rio-uikit 1.1.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.DS_Store +0 -0
- 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/.DS_Store +0 -0
- package/components/assetTree/TreeLeaf.js +1 -1
- package/components/assetTree/TreeNode.js +1 -1
- package/components/assetTree/TreeRoot.js +1 -1
- package/components/checkbox/Checkbox.js +1 -1
- 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/.DS_Store +0 -0
- package/components/map/components/.DS_Store +0 -0
- 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/.DS_Store +0 -0
- package/lib/es/.DS_Store +0 -0
- 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/.DS_Store +0 -0
- package/lib/es/components/assetTree/TreeLeaf.js +1 -1
- package/lib/es/components/assetTree/TreeNode.js +1 -1
- package/lib/es/components/assetTree/TreeRoot.js +1 -1
- package/lib/es/components/checkbox/Checkbox.js +1 -1
- 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
package/.DS_Store
CHANGED
|
Binary file
|
package/components/.DS_Store
CHANGED
|
Binary file
|
|
@@ -8,6 +8,6 @@ import RadioButton from '../radiobutton/RadioButton';
|
|
|
8
8
|
const TreeLeaf = React.memo((props) => {
|
|
9
9
|
const { item, hasMultiselect, showRadioButtons, isSelected, onSelectItem, onActiveItem } = props;
|
|
10
10
|
const treeNodeClassNames = classNames('TreeLeaf', 'form-group margin-bottom-0', isSelected && 'active', item.className && item.className);
|
|
11
|
-
return (_jsxs("div", Object.assign({ className: treeNodeClassNames, "data-key": item.id }, { children: [hasMultiselect && _jsx(Checkbox, { className: 'TreeCheckbox', checked: isSelected, onClick: onSelectItem }), !hasMultiselect && showRadioButtons && (_jsx(RadioButton, { className: 'TreeRadioButton', checked: isSelected, onChange: onSelectItem })),
|
|
11
|
+
return (_jsxs("div", Object.assign({ className: treeNodeClassNames, "data-key": item.id }, { children: [hasMultiselect && _jsx(Checkbox, { className: 'TreeCheckbox', checked: isSelected, onClick: onSelectItem }), !hasMultiselect && showRadioButtons && (_jsx(RadioButton, { className: 'TreeRadioButton', checked: isSelected, onChange: onSelectItem })), _jsxs("span", Object.assign({ className: 'TreeLabel TreeLabelName', onClick: onActiveItem }, { children: [!item.subType && _jsx("span", { className: `rioglyph rioglyph-${item.type}` }), item.subType && (_jsxs("span", Object.assign({ className: 'rioglyph-icon-pair' }, { children: [_jsx("span", { className: `rioglyph rioglyph-${item.type}` }), _jsx("span", { className: `rioglyph rioglyph-${item.subType}` })] }))), _jsxs("span", Object.assign({ className: 'TreeLabelNameText' }, { children: [_jsx("span", Object.assign({ className: 'TreeLabelNameTextHeadline' }, { children: isObject(item.name) ? (_jsxs(_Fragment, { children: [_jsx("span", Object.assign({ className: 'text-light margin-right-3' }, { children: item.name.firstName })), _jsx("span", { children: item.name.lastName })] })) : (item.name) })), item.info && _jsx("span", Object.assign({ className: 'TreeLabelNameTextSubline' }, { children: item.info }))] }))] }))] })));
|
|
12
12
|
});
|
|
13
13
|
export default TreeLeaf;
|
|
@@ -6,6 +6,6 @@ const TreeNode = React.memo((props) => {
|
|
|
6
6
|
const { node, hasMultiselect = false, isSelected = false, isIndeterminate = false, onToggleNode, onSelect } = props;
|
|
7
7
|
const treeNodeClassNames = classNames('TreeNode', 'from-group', isSelected && 'checked', node.className && node.className);
|
|
8
8
|
const hasChildren = !!node.items.length;
|
|
9
|
-
return (_jsxs("div", Object.assign({ className: treeNodeClassNames, "data-key": node.id, onClick: () => hasChildren && onToggleNode(node.id) }, { children: [hasMultiselect && (_jsx(Checkbox, { className: 'TreeCheckbox', checked: isSelected, disabled: node.disabled, indeterminate: isIndeterminate, onClick: () => onSelect(node, isIndeterminate) })), _jsxs("span", Object.assign({ className: 'TreeLabel
|
|
9
|
+
return (_jsxs("div", Object.assign({ className: treeNodeClassNames, "data-key": node.id, onClick: () => hasChildren && onToggleNode(node.id) }, { children: [hasMultiselect && (_jsx(Checkbox, { className: 'TreeCheckbox', checked: isSelected, disabled: node.disabled, indeterminate: isIndeterminate, onClick: () => onSelect(node, isIndeterminate) })), _jsxs("span", Object.assign({ className: 'TreeLabel TreeLabelName' }, { children: [node.icon && _jsx("span", { className: `rioglyph ${node.icon}` }), _jsx("span", Object.assign({ className: 'TreeLabelNameText' }, { children: _jsx("span", Object.assign({ className: 'TreeLabelNameTextHeadline' }, { children: node.name })) })), _jsx("span", Object.assign({ className: 'TreeLabelCount label label-muted label-filled label-condensed' }, { children: node.items.length })), _jsx("span", { className: `TreeLabelExpander rioglyph rioglyph-chevron-down ${hasChildren ? '' : 'text-color-light'}` })] }))] })));
|
|
10
10
|
});
|
|
11
11
|
export default TreeNode;
|
|
@@ -4,7 +4,7 @@ import 'react';
|
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { useAutoAnimate } from '@formkit/auto-animate/react';
|
|
6
6
|
const TreeRoot = ({ maxHeight, disableAnimation, children }) => {
|
|
7
|
-
const treeRootClasses = classNames('TreeRoot', 'user-select-none overflow-hidden');
|
|
7
|
+
const treeRootClasses = classNames('TreeRoot', 'user-select-none', maxHeight ? 'overflow-auto' : 'overflow-hidden');
|
|
8
8
|
const [parent, enableAnimations] = useAutoAnimate();
|
|
9
9
|
enableAnimations(!disableAnimation);
|
|
10
10
|
return (_jsx("div", Object.assign({ ref: parent, className: treeRootClasses, style: { maxHeight } }, { children: children })));
|
|
@@ -51,7 +51,7 @@ const Checkbox = (props) => {
|
|
|
51
51
|
const renderCustomIcon = !!icon;
|
|
52
52
|
const renderCustomContent = custom && children;
|
|
53
53
|
const renderDefault = !icon && !custom;
|
|
54
|
-
return (_jsxs("label", Object.assign({}, remainingProps, { className: labelClassnames, tabIndex: tabIndex, htmlFor: id, onKeyDown: handleToggleKeyDown, ref: labelRef }, { children: [_jsx("input", { id: id, name: name, type: 'checkbox', checked: checked, required: required, defaultChecked: defaultChecked, disabled: disabled, className: inputClassnames, onClick: onClick, onChange: onChange, ref: inputRef }), renderCustomIcon && (_jsx(CheckboxIcon, { icon: icon, iconSize: iconSize, iconLabelPosition: iconLabelPosition, text: text })), renderDefault &&
|
|
54
|
+
return (_jsxs("label", Object.assign({}, remainingProps, { className: labelClassnames, tabIndex: tabIndex, htmlFor: id, onKeyDown: handleToggleKeyDown, ref: labelRef }, { children: [_jsx("input", { id: id, name: name, type: 'checkbox', checked: checked, required: required, defaultChecked: defaultChecked, disabled: disabled, className: inputClassnames, onClick: onClick, onChange: onChange, ref: inputRef }), renderCustomIcon && (_jsx(CheckboxIcon, { icon: icon, iconSize: iconSize, iconLabelPosition: iconLabelPosition, text: text })), renderDefault && _jsx("span", Object.assign({ className: 'checkbox-text' }, { children: text && _jsx("span", { children: text }) })), renderCustomContent && children] })));
|
|
55
55
|
};
|
|
56
56
|
Checkbox.ICON_LABEL_VERTICAL = ICON_LABEL_VERTICAL;
|
|
57
57
|
Checkbox.ICON_LABEL_HORIZONTAL = ICON_LABEL_HORIZONTAL;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { type ComponentProps } from 'react';
|
|
2
|
+
type FeedbackInlineButtonsProps = ComponentProps<'div'> & {
|
|
3
|
+
/**
|
|
4
|
+
* Optional headline inlined with the buttons.
|
|
5
|
+
*/
|
|
6
|
+
headline?: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* List of buttons to be shown.
|
|
9
|
+
*/
|
|
10
|
+
buttons?: React.ReactNode[];
|
|
11
|
+
};
|
|
12
|
+
declare const FeedbackInlineButtons: (props: FeedbackInlineButtonsProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default FeedbackInlineButtons;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
// @ts-ignore-next-line importsNotUsedAsValues
|
|
4
|
+
import 'react';
|
|
5
|
+
const FeedbackInlineButtons = (props) => {
|
|
6
|
+
const { buttons = [], headline } = props, remainingProps = __rest(props, ["buttons", "headline"]);
|
|
7
|
+
return (_jsxs("div", Object.assign({}, remainingProps, { className: 'display-flex flex-wrap align-items-center column-gap-15 row-gap-5 user-select-none' }, { children: [headline && _jsx("div", Object.assign({ className: 'text-color-dark' }, { children: headline })), _jsx("div", Object.assign({ className: 'btn-toolbar gap-5' }, { children: buttons.map(button => button) }))] })));
|
|
8
|
+
};
|
|
9
|
+
export default FeedbackInlineButtons;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React, { type ComponentProps } from 'react';
|
|
2
|
+
import type { BUTTON_SIZE, BUTTON_STYLE, BUTTON_VARIANT } from '../button/Button';
|
|
3
|
+
type FeedbackRatingProps = ComponentProps<'div'> & {
|
|
4
|
+
/**
|
|
5
|
+
* Optional headline
|
|
6
|
+
*/
|
|
7
|
+
headline?: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* The amount of toggle buttons used to rate.
|
|
10
|
+
*
|
|
11
|
+
* @default 1
|
|
12
|
+
*/
|
|
13
|
+
count: number;
|
|
14
|
+
/**
|
|
15
|
+
* Defines whether the buttons are round.
|
|
16
|
+
*
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
circleButtons?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Optional class names applied to all the buttons.
|
|
22
|
+
* If you need more control on styling individual buttons, see `buttonStyles`.
|
|
23
|
+
*/
|
|
24
|
+
buttonClassName?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Array of button labels that will be used instead of the index.
|
|
27
|
+
* There needs to be a label for each button defined.
|
|
28
|
+
*/
|
|
29
|
+
buttonLabels?: React.ReactNode[];
|
|
30
|
+
/**
|
|
31
|
+
* Array of button styles to individually define the button size, style and variant.
|
|
32
|
+
* There needs to be a item for each button defined.
|
|
33
|
+
*/
|
|
34
|
+
buttonStyles?: {
|
|
35
|
+
bsSize?: BUTTON_SIZE;
|
|
36
|
+
bsStyle?: BUTTON_STYLE;
|
|
37
|
+
variant?: BUTTON_VARIANT;
|
|
38
|
+
className?: string;
|
|
39
|
+
}[];
|
|
40
|
+
/**
|
|
41
|
+
* Left aligned label to name the lowest rating option.
|
|
42
|
+
*/
|
|
43
|
+
leftLabel?: React.ReactNode;
|
|
44
|
+
/**
|
|
45
|
+
* Right aligned label to name the highest rating option.
|
|
46
|
+
*/
|
|
47
|
+
rightLabel?: React.ReactNode;
|
|
48
|
+
/**
|
|
49
|
+
* Additional icon placed in front of the rating buttons.
|
|
50
|
+
*/
|
|
51
|
+
leadingIcon?: React.ReactNode;
|
|
52
|
+
/**
|
|
53
|
+
* Additional icon placed after the rating buttons.
|
|
54
|
+
*/
|
|
55
|
+
trailingIcon?: React.ReactNode;
|
|
56
|
+
/**
|
|
57
|
+
* Callback triggered when the rating changes.
|
|
58
|
+
*
|
|
59
|
+
* @param rating The rating value. Undefined, when a toggle is unchecked.
|
|
60
|
+
* @returns
|
|
61
|
+
*/
|
|
62
|
+
onRatingChanged?: (rating: number | undefined) => void;
|
|
63
|
+
};
|
|
64
|
+
declare const FeedbackRating: (props: FeedbackRatingProps) => import("react/jsx-runtime").JSX.Element;
|
|
65
|
+
export default FeedbackRating;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { createElement as _createElement } from "react";
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
import classNames from 'classnames';
|
|
6
|
+
import ToggleButton from '../button/ToggleButton';
|
|
7
|
+
const FeedbackRating = (props) => {
|
|
8
|
+
const { headline, count = 1, circleButtons = false, buttonLabels, buttonStyles, buttonClassName = '', leftLabel, rightLabel, leadingIcon, trailingIcon, onRatingChanged = () => { } } = props, remainingProps = __rest(props, ["headline", "count", "circleButtons", "buttonLabels", "buttonStyles", "buttonClassName", "leftLabel", "rightLabel", "leadingIcon", "trailingIcon", "onRatingChanged"]);
|
|
9
|
+
const [rating, setRating] = useState();
|
|
10
|
+
const handleRating = (value) => {
|
|
11
|
+
setRating(value);
|
|
12
|
+
onRatingChanged(value);
|
|
13
|
+
};
|
|
14
|
+
const hasSubLabels = !!leftLabel || !!rightLabel;
|
|
15
|
+
const buttonWrapperClasses = classNames('display-flex gap-10', hasSubLabels ? 'align-items-start' : 'align-items-center', 'text-size-14', 'margin-bottom-25');
|
|
16
|
+
const leadingTrailingIconClasses = classNames('display-flex align-items-center', 'text-size-200pct', hasSubLabels && 'padding-top-3');
|
|
17
|
+
return (_jsxs("div", Object.assign({}, remainingProps, { className: 'FeedbackRating' }, { children: [headline && _jsx("div", Object.assign({ className: 'text-medium text-size-16 margin-bottom-10' }, { children: headline })), _jsxs("div", Object.assign({ className: buttonWrapperClasses }, { children: [leadingIcon && _jsx("div", Object.assign({ className: leadingTrailingIconClasses }, { children: leadingIcon })), _jsxs("div", { children: [_jsx("div", Object.assign({ className: 'display-flex flex-wrap gap-10' }, { children: Array.from({ length: count }, (_, index) => {
|
|
18
|
+
var _a, _b;
|
|
19
|
+
const indexNumber = index + 1;
|
|
20
|
+
return (_createElement(ToggleButton, Object.assign({}, buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles[index], { key: indexNumber, active: rating === indexNumber, onClick: (toggled) => handleRating(toggled ? indexNumber : undefined), className: `${circleButtons ? 'rounded-circle aspect-ratio-1' : ''} ${buttonClassName} ${(_a = buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles[index].className) !== null && _a !== void 0 ? _a : ''}` }), (_b = buttonLabels === null || buttonLabels === void 0 ? void 0 : buttonLabels[index]) !== null && _b !== void 0 ? _b : indexNumber));
|
|
21
|
+
}) })), hasSubLabels && (_jsxs("div", Object.assign({ className: 'display-flex justify-content-between margin-top-5 gap-25' }, { children: [leftLabel ? _jsx("label", Object.assign({ className: 'word-wrap text-color-dark' }, { children: leftLabel })) : _jsx("div", {}), rightLabel ? _jsx("label", Object.assign({ className: 'word-wrap text-color-dark' }, { children: rightLabel })) : _jsx("div", {})] })))] }), trailingIcon && _jsx("div", Object.assign({ className: leadingTrailingIconClasses }, { children: trailingIcon }))] }))] })));
|
|
22
|
+
};
|
|
23
|
+
export default FeedbackRating;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React, { type ComponentProps } from 'react';
|
|
2
|
+
type FeedbackReactionsProps = ComponentProps<'div'> & {
|
|
3
|
+
/**
|
|
4
|
+
* Optional headline inlined with the buttons.
|
|
5
|
+
*/
|
|
6
|
+
headline?: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Size of the reaction buttons.
|
|
9
|
+
*
|
|
10
|
+
* @default 'md'
|
|
11
|
+
*/
|
|
12
|
+
size?: 'sm' | 'md';
|
|
13
|
+
/**
|
|
14
|
+
* Position of the reaction button labels.
|
|
15
|
+
*
|
|
16
|
+
* @default 'bottom'
|
|
17
|
+
*/
|
|
18
|
+
labelPosition?: 'right' | 'bottom';
|
|
19
|
+
/**
|
|
20
|
+
* Label for the up button.
|
|
21
|
+
*/
|
|
22
|
+
labelUp?: React.ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Label for the down button.
|
|
25
|
+
*/
|
|
26
|
+
labelDown?: React.ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* Custom fill color for the up button.
|
|
29
|
+
*
|
|
30
|
+
* @default 'bg-lightest'
|
|
31
|
+
*/
|
|
32
|
+
colorFillUp?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Custom fill color for the down button.
|
|
35
|
+
*
|
|
36
|
+
* @default 'bg-lightest'
|
|
37
|
+
*/
|
|
38
|
+
colorFillDown?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Custom hover color for the up button.
|
|
41
|
+
*
|
|
42
|
+
* @default 'primary'
|
|
43
|
+
*/
|
|
44
|
+
colorHoverUp?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Custom hover color for the down button.
|
|
47
|
+
*
|
|
48
|
+
* @default 'primary'
|
|
49
|
+
*/
|
|
50
|
+
colorHoverDown?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Callback function triggered on up vote.
|
|
53
|
+
*/
|
|
54
|
+
onVoteUp?: VoidFunction;
|
|
55
|
+
/**
|
|
56
|
+
* Callback function triggered on down vote.
|
|
57
|
+
*/
|
|
58
|
+
onVoteDown?: VoidFunction;
|
|
59
|
+
/**
|
|
60
|
+
* Additional classes applied to the individual reaction item (button and label).
|
|
61
|
+
*/
|
|
62
|
+
itemClassName?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Defines whether the reaction icon is animated.
|
|
65
|
+
*
|
|
66
|
+
* @default false
|
|
67
|
+
*/
|
|
68
|
+
animated?: boolean;
|
|
69
|
+
};
|
|
70
|
+
declare const FeedbackReactions: (props: FeedbackReactionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
71
|
+
export default FeedbackReactions;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useRef } from 'react';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import { motion } from 'framer-motion';
|
|
6
|
+
import useHover from '../../hooks/useHover';
|
|
7
|
+
const FeedbackReactions = (props) => {
|
|
8
|
+
const { headline, animated, labelUp, labelDown, labelPosition = 'bottom', size = 'md', colorFillUp = '', colorFillDown = '', colorHoverUp = 'primary', colorHoverDown = 'primary', onVoteUp = () => { }, onVoteDown = () => { }, itemClassName } = props, remainingProps = __rest(props, ["headline", "animated", "labelUp", "labelDown", "labelPosition", "size", "colorFillUp", "colorFillDown", "colorHoverUp", "colorHoverDown", "onVoteUp", "onVoteDown", "itemClassName"]);
|
|
9
|
+
const hasLabels = !!labelUp || !!labelDown;
|
|
10
|
+
const wrapperClassName = classNames(hasLabels ? 'display-grid grid-cols-2' : 'display-flex', 'gap-15', 'padding-top-5', 'user-select-none');
|
|
11
|
+
return (_jsxs("div", Object.assign({}, remainingProps, { className: wrapperClassName }, { children: [_jsx(FeedbackItem, { size: size, fillColor: colorFillDown, hoverColor: colorHoverDown, animated: animated, iconName: 'thumbs-down', text: labelDown, labelPosition: labelPosition, onClick: onVoteDown, className: itemClassName }), _jsx(FeedbackItem, { size: size, fillColor: colorFillUp, hoverColor: colorHoverUp, animated: animated, iconName: 'thumbs-up', text: labelUp, labelPosition: labelPosition, onClick: onVoteUp, className: itemClassName })] })));
|
|
12
|
+
};
|
|
13
|
+
const FeedbackItem = (props) => {
|
|
14
|
+
const { size, text, iconName, onClick, fillColor, hoverColor, animated = false, labelPosition = 'bottom', className, } = props;
|
|
15
|
+
const ref = useRef(null);
|
|
16
|
+
const isHover = useHover(ref);
|
|
17
|
+
const iconClasses = classNames(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');
|
|
18
|
+
const wrapperClassName = classNames('display-flex', 'gap-10', labelPosition === 'bottom' ? 'flex-column' : '', 'align-items-center', 'text-center', 'cursor-pointer', className);
|
|
19
|
+
const isUp = iconName.includes('up');
|
|
20
|
+
return (_jsxs("div", Object.assign({ ref: ref, className: wrapperClassName, onClick: onClick }, { children: [_jsx("div", Object.assign({ className: iconClasses }, { children: _jsx(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: {
|
|
21
|
+
duration: 0.6,
|
|
22
|
+
repeat: isHover ? Number.POSITIVE_INFINITY : 0,
|
|
23
|
+
repeatType: 'loop',
|
|
24
|
+
}, className: `rioglyph rioglyph-${iconName} text-size-200pct` }) })), _jsx("div", Object.assign({ className: `text-wrap-balance line-height-125rel text-medium ${isHover ? `text-color-${hoverColor}` : 'text-color-darker'}` }, { children: text }))] })));
|
|
25
|
+
};
|
|
26
|
+
export 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
|
*/
|
|
@@ -16,7 +16,7 @@ const MOBILE_MAX_WIDTH = 580;
|
|
|
16
16
|
const filterMenuItems = (items, value, filterKey) => items.map(item => (Object.assign(Object.assign({}, item), { navItems: item.navItems.filter(navItem => navItem[filterKey].toLowerCase().includes(value.toLowerCase())) })));
|
|
17
17
|
const hasMenuItems = (items) => items.find(({ navItems }) => !isEmpty(navItems));
|
|
18
18
|
const ListMenu = (props) => {
|
|
19
|
-
const { menuItems, focusFilter = false, enableFilter = false, filterPlaceholder, notFoundMessage, className = '', groupClassName = '', responsive = true, autoClose = true, filterKey = 'key' } = props, remainingProps = __rest(props, ["menuItems", "focusFilter", "enableFilter", "filterPlaceholder", "notFoundMessage", "className", "groupClassName", "responsive", "autoClose", "filterKey"]);
|
|
19
|
+
const { menuItems, focusFilter = false, enableFilter = false, filterPlaceholder, notFoundMessage, className = '', groupClassName = '', responsive = true, autoClose = true, filterKey = 'key', trailingInputAddon } = props, remainingProps = __rest(props, ["menuItems", "focusFilter", "enableFilter", "filterPlaceholder", "notFoundMessage", "className", "groupClassName", "responsive", "autoClose", "filterKey", "trailingInputAddon"]);
|
|
20
20
|
const [filterValue, setFilterValue] = useState('');
|
|
21
21
|
const [isMobileMode, setIsMobileMode] = useState(false);
|
|
22
22
|
const [isExpanderOpen, setIsExpanderOpen] = useState(false);
|
|
@@ -67,7 +67,7 @@ const ListMenu = (props) => {
|
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
69
|
const formClassNames = classNames('form-group', 'margin-bottom-5', 'padding-left-15', 'padding-right-15', 'padding-bottom-15', 'position-sticky', 'top-0');
|
|
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 })] })) }))), !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())))] })));
|
|
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 })) })));
|
|
73
73
|
}
|
package/components/map/.DS_Store
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -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;
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import noop from 'lodash/fp/noop';
|
|
5
5
|
const MapSettingsItem = (props) => {
|
|
6
|
-
const { onClick = noop, activeIcon, inactiveIcon, isActive = false, className = '' } = props;
|
|
7
|
-
const activeIconClassNames = classNames('MapSettingsTileIcon', 'hover-scale-110', isActive ? 'display-block' : 'display-none', (activeIcon === null || activeIcon === void 0 ? void 0 : activeIcon.props.className) || '');
|
|
8
|
-
const inactiveIconClassNames = classNames('MapSettingsTileIcon', 'hover-scale-110', isActive ? 'display-none' : 'display-block', (inactiveIcon === null || inactiveIcon === void 0 ? void 0 : inactiveIcon.props.className) || '');
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
const { onClick = noop, activeIcon, inactiveIcon, isActive = false, label, className = '' } = props;
|
|
7
|
+
const activeIconClassNames = classNames('MapSettingsTileIcon', !label && 'hover-scale-110', isActive ? 'display-block' : 'display-none', (activeIcon === null || activeIcon === void 0 ? void 0 : activeIcon.props.className) || '');
|
|
8
|
+
const inactiveIconClassNames = classNames('MapSettingsTileIcon', !label && 'hover-scale-110', isActive ? 'display-none' : 'display-block', (inactiveIcon === null || inactiveIcon === void 0 ? void 0 : inactiveIcon.props.className) || '');
|
|
9
|
+
const defaultIcon = activeIcon &&
|
|
10
|
+
React.cloneElement(activeIcon, {
|
|
11
|
+
className: activeIconClassNames,
|
|
12
|
+
});
|
|
13
|
+
const highlightedIcon = inactiveIcon &&
|
|
14
|
+
React.cloneElement(inactiveIcon, {
|
|
15
|
+
className: inactiveIconClassNames,
|
|
16
|
+
});
|
|
17
|
+
const mapSettingsItemClassNames = classNames('MapSettingsItem', 'display-flex align-items-center gap-10', 'text-color-darker', label && 'margin--5', className);
|
|
18
|
+
return (_jsxs("div", Object.assign({ className: mapSettingsItemClassNames, onClick: onClick }, { children: [label && (_jsxs(_Fragment, { children: [_jsxs("div", Object.assign({ className: 'margin-left--5' }, { children: [highlightedIcon, defaultIcon] })), _jsx("div", Object.assign({ className: 'flex-1-1 line-height-16 padding-right-5' }, { children: label }))] })), !label && (_jsxs(_Fragment, { children: [highlightedIcon, defaultIcon] }))] })));
|
|
16
19
|
};
|
|
17
20
|
export 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;
|
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import React, { useState } from 'react';
|
|
4
4
|
import { AnimatePresence } from 'framer-motion';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import noop from 'lodash/fp/noop';
|
|
7
|
+
import { usePopper } from 'react-popper';
|
|
7
8
|
import OverlayTrigger from '../../../../overlay/OverlayTrigger';
|
|
8
9
|
import Tooltip from '../../../../tooltip/Tooltip';
|
|
9
10
|
import useClickOutside from '../../../../../hooks/useClickOutside';
|
|
11
|
+
import MenuItemList from '../../../../menuItems/MenuItemList';
|
|
12
|
+
import MenuItem from '../../../../menuItems/MenuItem';
|
|
13
|
+
import { isMobileScreen } from '../../../../../utils/deviceUtils';
|
|
14
|
+
const TOOLTIP_SHOW_TIMEOUT_IN_MS = 800;
|
|
15
|
+
const TOOLTIP_HIDE_TIMEOUT_IN_MS = 100;
|
|
10
16
|
const getComponentWithTooltip = (component, tooltip) => {
|
|
11
|
-
return (_jsx(OverlayTrigger, Object.assign({ placement: Tooltip.TOP, delay: { show:
|
|
17
|
+
return (_jsx(OverlayTrigger, Object.assign({ placement: Tooltip.TOP, delay: { show: TOOLTIP_SHOW_TIMEOUT_IN_MS, hide: TOOLTIP_HIDE_TIMEOUT_IN_MS }, overlay: _jsx(Tooltip, Object.assign({ id: 'tooltip', width: 'auto' }, { children: tooltip })) }, { children: component })));
|
|
12
18
|
};
|
|
13
19
|
const MapSettingsTile = (props) => {
|
|
14
|
-
const { onToggle = noop, activeIcon, inactiveIcon, isActive = false, panel, className, buttonClassName, tooltip } = props, remainingProps = __rest(props, ["onToggle", "activeIcon", "inactiveIcon", "isActive", "panel", "className", "buttonClassName", "tooltip"]);
|
|
20
|
+
const { onToggle = noop, activeIcon, inactiveIcon, isActive = false, panel, items, className, buttonClassName, tooltip } = props, remainingProps = __rest(props, ["onToggle", "activeIcon", "inactiveIcon", "isActive", "panel", "items", "className", "buttonClassName", "tooltip"]);
|
|
15
21
|
const [isOpen, setIsOpen] = useState(false);
|
|
16
22
|
const handleToggle = () => {
|
|
17
23
|
const newState = !isOpen;
|
|
@@ -27,8 +33,32 @@ const MapSettingsTile = (props) => {
|
|
|
27
33
|
}
|
|
28
34
|
};
|
|
29
35
|
const buttonRef = useClickOutside(handleClosePanel);
|
|
36
|
+
const [toggleRef, setToggleRef] = useState(null);
|
|
37
|
+
const [refDropdownMenu, setRefDropdownMenu] = useState(null);
|
|
38
|
+
const { styles, attributes } = usePopper(toggleRef, refDropdownMenu, {
|
|
39
|
+
placement: 'top-end',
|
|
40
|
+
modifiers: isOpen && isMobileScreen()
|
|
41
|
+
? [
|
|
42
|
+
{
|
|
43
|
+
name: 'offset',
|
|
44
|
+
options: {
|
|
45
|
+
offset: [-60, -60],
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
]
|
|
49
|
+
: [],
|
|
50
|
+
});
|
|
51
|
+
const dropdownWrapperRef = useClickOutside((event) => {
|
|
52
|
+
if (toggleRef === null || toggleRef === void 0 ? void 0 : toggleRef.contains(event.target)) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (isOpen) {
|
|
56
|
+
setIsOpen(false);
|
|
57
|
+
onToggle(false);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
30
60
|
const wrapperClasses = classNames('MapSettingsTile', className);
|
|
31
|
-
const buttonClasses = classNames('MapSettingsButton', buttonClassName);
|
|
61
|
+
const buttonClasses = classNames('MapSettingsButton', isOpen && 'active', buttonClassName);
|
|
32
62
|
const activeIconClassNames = classNames('MapSettingsTileIcon', 'hover-scale-110', isActive ? 'display-block' : 'display-none', (activeIcon === null || activeIcon === void 0 ? void 0 : activeIcon.props.className) || '');
|
|
33
63
|
const inactiveIconClassNames = classNames('MapSettingsTileIcon', 'hover-scale-110', isActive ? 'display-none' : 'display-block', (inactiveIcon === null || inactiveIcon === void 0 ? void 0 : inactiveIcon.props.className) || '');
|
|
34
64
|
const button = (_jsxs("div", Object.assign({ className: buttonClasses, onClick: handleToggle }, { children: [activeIcon &&
|
|
@@ -38,6 +68,11 @@ const MapSettingsTile = (props) => {
|
|
|
38
68
|
React.cloneElement(inactiveIcon, {
|
|
39
69
|
className: inactiveIconClassNames,
|
|
40
70
|
})] })));
|
|
41
|
-
return (_jsxs("div", Object.assign({ className: wrapperClasses, ref: buttonRef }, remainingProps, { children: [tooltip ? getComponentWithTooltip(button, tooltip) : button, _jsx("div", Object.assign({ className: 'overflow-hidden' }, { children: _jsx(AnimatePresence, { children: isOpen && panel && panel }) }))] })))
|
|
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.name === 'MapSettingsDropdownHeader') {
|
|
73
|
+
return item;
|
|
74
|
+
}
|
|
75
|
+
return _jsx(MenuItem, { value: item }, index);
|
|
76
|
+
}) }))) })) })] })))] })));
|
|
42
77
|
};
|
|
43
78
|
export default MapSettingsTile;
|
package/components/map/components/features/settings/builtinSettings/MapAdditionalLayerSettings.d.ts
ADDED
|
@@ -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;
|
package/components/map/components/features/settings/builtinSettings/MapAdditionalLayerSettings.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
// @ts-ignore-next-line importsNotUsedAsValues
|
|
4
|
+
import 'react';
|
|
5
|
+
import isEmpty from 'lodash/fp/isEmpty';
|
|
6
|
+
import union from 'lodash/fp/union';
|
|
7
|
+
import MapSettingsTile from '../MapSettingsTile';
|
|
8
|
+
import { MapIcon } from '../../../../icons/MapIcon';
|
|
9
|
+
const MapAdditionalLayerSettings = (props) => {
|
|
10
|
+
const { activeBuiltinLayers = [], activeLayers = [], layers = [] } = props, remainingProps = __rest(props, ["activeBuiltinLayers", "activeLayers", "layers"]);
|
|
11
|
+
const allActiveLayer = union(activeBuiltinLayers, activeLayers);
|
|
12
|
+
const isActive = !isEmpty(allActiveLayer);
|
|
13
|
+
return (_jsx(MapSettingsTile, Object.assign({ className: 'MapAdditionalLayerSettings', isActive: !isEmpty(allActiveLayer), activeIcon: isActive ? (_jsx(MapIcon, { name: 'rioglyph-layer-pois text-color-primary', className: 'MapAdditionalLayerIcon' })) : undefined, inactiveIcon: !isActive ? (_jsx(MapIcon, { name: 'rioglyph-layer-pois text-color-gray', className: 'MapAdditionalLayerIconInactive' })) : undefined, items: layers }, remainingProps)));
|
|
14
|
+
};
|
|
15
|
+
export default MapAdditionalLayerSettings;
|
|
@@ -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;
|
|
@@ -3,16 +3,22 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
// @ts-ignore-next-line importsNotUsedAsValues
|
|
4
4
|
import 'react';
|
|
5
5
|
import noop from 'lodash/fp/noop';
|
|
6
|
+
import compact from 'lodash/fp/compact';
|
|
6
7
|
import MapSettingsPanel from '../MapSettingsPanel';
|
|
7
8
|
import MapSettingsItem from '../MapSettingsItem';
|
|
8
9
|
import MapSettingsTile from '../MapSettingsTile';
|
|
9
10
|
import { MapIcon, CLUSTER_ACTIVE, CLUSTER_INACTIVE, NO_CLUSTER_ACTIVE, NO_CLUSTER_INACTIVE, } from '../../../../icons/MapIcon';
|
|
11
|
+
import MapSettingsDropdownHeader from '../items/MapSettingsDropdownHeader';
|
|
10
12
|
const MapClusterSettings = (props) => {
|
|
11
|
-
const { showCluster = true, onShowClusterChange = noop, onToggle = noop } = props, remainingProps = __rest(props, ["showCluster", "onShowClusterChange", "onToggle"]);
|
|
13
|
+
const { showCluster = true, onShowClusterChange = noop, onToggle = noop, clusterEnabledLabel, clusterDisabledLabel, dropdownHeaderText } = props, remainingProps = __rest(props, ["showCluster", "onShowClusterChange", "onToggle", "clusterEnabledLabel", "clusterDisabledLabel", "dropdownHeaderText"]);
|
|
12
14
|
const handleShowCluster = (setShowCluster) => {
|
|
13
15
|
onShowClusterChange(setShowCluster);
|
|
14
16
|
onToggle(setShowCluster);
|
|
15
17
|
};
|
|
16
|
-
|
|
18
|
+
const hasLabels = !!clusterEnabledLabel || !!clusterDisabledLabel;
|
|
19
|
+
const dropdownHeader = dropdownHeaderText && (_jsx(MapSettingsDropdownHeader, { label: dropdownHeaderText }, 'mapClusterDropdownHeader'));
|
|
20
|
+
const enableClusterButtons = (_jsx(MapSettingsItem, { onClick: () => handleShowCluster(true), isActive: showCluster, activeIcon: _jsx(MapIcon, { name: CLUSTER_ACTIVE, className: 'MapClusterIcon' }), inactiveIcon: _jsx(MapIcon, { name: CLUSTER_INACTIVE, className: 'MapClusterIconInactive' }), label: clusterEnabledLabel }, 'enableClusterButtons'));
|
|
21
|
+
const disableClusterButton = (_jsx(MapSettingsItem, { onClick: () => handleShowCluster(false), isActive: !showCluster, activeIcon: _jsx(MapIcon, { name: NO_CLUSTER_ACTIVE, className: 'MapNoClusterIcon' }), inactiveIcon: _jsx(MapIcon, { name: NO_CLUSTER_INACTIVE, className: 'MapNoClusterIconInactive' }), label: clusterDisabledLabel }, 'disableClusterButton'));
|
|
22
|
+
return (_jsx(MapSettingsTile, Object.assign({ className: 'MapClusterSettings', isActive: showCluster, activeIcon: _jsx(MapIcon, { name: CLUSTER_INACTIVE }), inactiveIcon: _jsx(MapIcon, { name: NO_CLUSTER_INACTIVE }), items: hasLabels ? compact([dropdownHeader, enableClusterButtons, disableClusterButton]) : undefined, panel: !hasLabels && (_jsxs(MapSettingsPanel, { children: [enableClusterButtons, disableClusterButton] })) }, remainingProps)));
|
|
17
23
|
};
|
|
18
24
|
export default MapClusterSettings;
|