@longline/aqua-ui 1.0.326 → 1.0.328
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/containers/Form/Field.d.ts +4 -0
- package/containers/Form/Field.js +1 -0
- package/containers/Form/elements/BoxWrapper.js +2 -2
- package/containers/Form/elements/Label.js +1 -1
- package/inputs/DateInput/DateInput.d.ts +4 -0
- package/inputs/DateInput/DateInput.js +1 -1
- package/inputs/Dropdown/Dropdown.d.ts +4 -0
- package/inputs/Dropdown/Dropdown.js +1 -1
- package/inputs/Editor/Editor.d.ts +4 -1
- package/inputs/Editor/Editor.js +1 -1
- package/inputs/Input/Input.d.ts +4 -0
- package/inputs/Input/Input.js +1 -1
- package/inputs/MonthRange/MonthRange.d.ts +4 -0
- package/inputs/MonthRange/MonthRange.js +1 -1
- package/inputs/Selector/Selector.d.ts +4 -0
- package/inputs/Selector/Selector.js +1 -1
- package/inputs/Slider/Slider.d.ts +4 -0
- package/inputs/Slider/Slider.js +1 -1
- package/inputs/Textarea/Textarea.d.ts +4 -0
- package/inputs/Textarea/Textarea.js +1 -1
- package/map/controls/base/MapButton/Hint.js +1 -1
- package/map/controls/base/MapButton/MapButton.d.ts +4 -0
- package/map/controls/base/MapButton/MapButton.js +2 -2
- package/map/controls/base/MapButtonGroup/MapButtonGroup.js +1 -1
- package/map/controls/base/MapControl/MapControl.js +1 -1
- package/modules/Filter/Filter.js +2 -2
- package/modules/MainMenu/MainMenu.js +2 -2
- package/modules/Root/Content.js +1 -1
- package/modules/Root/Overlay.js +1 -1
- package/modules/Root/Root.js +2 -2
- package/modules/Root/Shader.js +1 -1
- package/modules/Root/Sidebar.js +1 -1
- package/package.json +1 -1
|
@@ -64,6 +64,10 @@ interface IFieldProps {
|
|
|
64
64
|
* Triggered whenever an _uncontrolled_ Field changes.
|
|
65
65
|
*/
|
|
66
66
|
onChange?: (data: any, forceupdate: boolean) => void;
|
|
67
|
+
/**
|
|
68
|
+
* Test ID for Playwright/testing. Forwarded to the root DOM element.
|
|
69
|
+
*/
|
|
70
|
+
'data-testid'?: string;
|
|
67
71
|
}
|
|
68
72
|
/**
|
|
69
73
|
* A `Form.Field` wraps a form control. It serves several purposes.
|
package/containers/Form/Field.js
CHANGED
|
@@ -130,6 +130,7 @@ var Field = function (props) {
|
|
|
130
130
|
var getControl = function (hasError, transparent) {
|
|
131
131
|
return React.cloneElement(props.control, {
|
|
132
132
|
name: props.name,
|
|
133
|
+
'data-testid': props['data-testid'],
|
|
133
134
|
onChange: handleChange,
|
|
134
135
|
value: props.value, // Changed from just "value", since that breaks TiptapEditor.
|
|
135
136
|
checked: props.value,
|
|
@@ -32,8 +32,8 @@ var BoxWrapperBase = function (props) {
|
|
|
32
32
|
return (React.createElement("div", { "data-testid": "BoxWrapper", className: props.className, onClick: handleClick, ref: wrapper },
|
|
33
33
|
props.ghost && React.createElement(Ghost, { style: { position: 'absolute', left: 0, top: 0, right: 0, bottom: 0, zIndex: 100 } }),
|
|
34
34
|
props.label,
|
|
35
|
-
React.createElement(Control,
|
|
36
|
-
React.createElement(HintBackground,
|
|
35
|
+
React.createElement(Control, { "data-testid": "Control" }, props.children),
|
|
36
|
+
React.createElement(HintBackground, { "data-testid": "HintBackground" }, props.hint)));
|
|
37
37
|
};
|
|
38
38
|
var HintBackground = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n left: 0;\n bottom: 0;\n right: 0;\n height: 22px;\n border-bottom-left-radius: ", "px;\n border-bottom-right-radius: ", "px;\n"], ["\n position: absolute;\n left: 0;\n bottom: 0;\n right: 0;\n height: 22px;\n border-bottom-left-radius: ", "px;\n border-bottom-right-radius: ", "px;\n"])), function (p) { return p.theme.radius.normal; }, function (p) { return p.theme.radius.normal; });
|
|
39
39
|
var Control = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: center;\n padding-top: 23px;\n padding-bottom: 23px;\n flex: 1;\n overflow-x: hidden;\n"], ["\n display: flex;\n flex-direction: column;\n align-items: center;\n padding-top: 23px;\n padding-bottom: 23px;\n flex: 1;\n overflow-x: hidden;\n"])));
|
|
@@ -6,7 +6,7 @@ import * as React from 'react';
|
|
|
6
6
|
import styled from 'styled-components';
|
|
7
7
|
var Required = styled.span(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n /* Required fields put an asterisk on the label. */ \n color: ", ";\n"], ["\n /* Required fields put an asterisk on the label. */ \n color: ", ";\n"])), function (p) { return p.theme.colors.negative; });
|
|
8
8
|
var LabelBase = function (props) {
|
|
9
|
-
return React.createElement("label", { tabIndex: -1, className: props.className },
|
|
9
|
+
return React.createElement("label", { "data-testid": "Field.Label", tabIndex: -1, className: props.className },
|
|
10
10
|
props.children,
|
|
11
11
|
props.required && !props.ghost && !props.noAsterisk && !props.disabled && React.createElement(Required, null, "*"));
|
|
12
12
|
};
|
|
@@ -64,6 +64,10 @@ interface IDateInputProps {
|
|
|
64
64
|
* Listeners are notified when the Input receives focus.
|
|
65
65
|
*/
|
|
66
66
|
onFocus?: () => void;
|
|
67
|
+
/**
|
|
68
|
+
* Test ID for Playwright/testing. Forwarded to the root DOM element.
|
|
69
|
+
*/
|
|
70
|
+
'data-testid'?: string;
|
|
67
71
|
}
|
|
68
72
|
declare const DateInput: {
|
|
69
73
|
({ direction, noTabIndex, disabled, transparent, fluid, error, clearable, nofuture, ...props }: IDateInputProps): React.JSX.Element;
|
|
@@ -102,7 +102,7 @@ var DateInputBase = function (props) {
|
|
|
102
102
|
}
|
|
103
103
|
]
|
|
104
104
|
}), styles = _c.styles, attributes = _c.attributes, update = _c.update;
|
|
105
|
-
return (React.createElement("div", { "data-testid": "DateInput", tabIndex: -1, className: props.className, onKeyDown: handleKeyDown, ref: wrapperRef },
|
|
105
|
+
return (React.createElement("div", { "data-testid": props['data-testid'] || "DateInput", tabIndex: -1, className: props.className, onKeyDown: handleKeyDown, ref: wrapperRef },
|
|
106
106
|
React.createElement(Selector, { value: value, disabled: props.disabled, ghost: props.ghost, transparent: props.transparent, error: props.error, clearable: props.clearable, noTabIndex: props.noTabIndex, onChange: handleChange, onClear: (!props.disabled && props.clearable && value != null) ? function () { return handleChange(null); } : null, onCalendar: handleToggle }),
|
|
107
107
|
createPortal(React.createElement(Body, { ref: bodyRef, value: value, open: open, transparent: props.transparent, nofuture: props.nofuture, onSelect: handleSelect, styles: styles, attributes: attributes }), document.body)));
|
|
108
108
|
};
|
|
@@ -112,6 +112,10 @@ interface IDropdownProps {
|
|
|
112
112
|
* is closed.
|
|
113
113
|
*/
|
|
114
114
|
onClose?: () => void;
|
|
115
|
+
/**
|
|
116
|
+
* Test ID for Playwright/testing. Forwarded to the root DOM element.
|
|
117
|
+
*/
|
|
118
|
+
'data-testid'?: string;
|
|
115
119
|
}
|
|
116
120
|
/**
|
|
117
121
|
* A `Dropdown` is a replacement for `<select>` (select). It opens upwards or
|
|
@@ -419,7 +419,7 @@ var DropdownBase = function (props) {
|
|
|
419
419
|
sameWidth
|
|
420
420
|
]
|
|
421
421
|
}), styles = _d.styles, attributes = _d.attributes, update = _d.update;
|
|
422
|
-
return (React.createElement("div", { "data-testid": "Dropdown", className: props.className, tabIndex: props.disabled ? -1 : 0, ref: wrapperRef, onKeyDown: handleKeyDown, onClick: handleClickDropdown },
|
|
422
|
+
return (React.createElement("div", { "data-testid": props['data-testid'] || "Dropdown", className: props.className, tabIndex: props.disabled ? -1 : 0, ref: wrapperRef, onKeyDown: handleKeyDown, onClick: handleClickDropdown },
|
|
423
423
|
React.createElement(Selection, { open: open, error: props.error, disabled: props.disabled, transparent: props.transparent, ghost: props.ghost, multiple: props.multiple, onClick: handleSelectorClicked, onClear: (props.clearable && !showPlaceholder) ? handleClear : null, placeholder: showPlaceholder }, label),
|
|
424
424
|
createPortal(React.createElement(Body, { ref: bodyRef, open: open, transparent: props.transparent, maxItems: props.maxItems, onSearch: props.onSearch ? handleSearch : null, search: search, tall: props.tall, minBodyWidth: props.minBodyWidth, styles: styles, attributes: attributes }, getBodyChildren()), document.body)));
|
|
425
425
|
};
|
|
@@ -65,7 +65,10 @@ interface IEditorProps {
|
|
|
65
65
|
/**
|
|
66
66
|
* Listeners are notified whenever the user interacts with the Editor.
|
|
67
67
|
*/
|
|
68
|
-
onChange?: (value: any) => void;
|
|
68
|
+
onChange?: (value: any) => void; /**
|
|
69
|
+
* Test ID for Playwright/testing. Forwarded to the root DOM element.
|
|
70
|
+
*/
|
|
71
|
+
'data-testid'?: string;
|
|
69
72
|
}
|
|
70
73
|
declare const Editor: {
|
|
71
74
|
({ fluid, error, disabled, transparent, ghost, allowFullscreen, codeButtons, ...props }: IEditorProps): React.JSX.Element;
|
package/inputs/Editor/Editor.js
CHANGED
|
@@ -88,7 +88,7 @@ var EditorBase = function (props) {
|
|
|
88
88
|
EditorRegistry.removeEditor(contentEditableRef.current);
|
|
89
89
|
}; }, []);
|
|
90
90
|
return (React.createElement(InputWrapper, { fluid: props.fluid, ghost: props.ghost, error: props.error, disabled: props.disabled, transparent: props.transparent, flex: props.flex },
|
|
91
|
-
React.createElement("div", { "data-testid": "Editor", className: props.className, ref: wrapperRef },
|
|
91
|
+
React.createElement("div", { "data-testid": props['data-testid'] || "Editor", className: props.className, ref: wrapperRef },
|
|
92
92
|
React.createElement(OverlayScrollbarsComponent, { className: "scroller ".concat(fullscreen ? 'fullscreen' : ''), defer: true, options: { scrollbars: { theme: 'os-theme-dark', autoHide: 'leave' } } },
|
|
93
93
|
!props.disabled && !props.ghost &&
|
|
94
94
|
React.createElement(MenuBar, { allowFullscreen: props.allowFullscreen, codeButtons: props.codeButtons, fullscreen: fullscreen, editor: editor, onToggleFullscreen: handleToggleFullscreen, openAIurl: props.openAIurl, assemblyAIurl: props.assemblyAIurl, authToken: props.authToken }),
|
package/inputs/Input/Input.d.ts
CHANGED
|
@@ -128,6 +128,10 @@ interface IInputProps {
|
|
|
128
128
|
* Listeners are notified when the Input receives focus.
|
|
129
129
|
*/
|
|
130
130
|
onFocus?: () => void;
|
|
131
|
+
/**
|
|
132
|
+
* Test ID for Playwright/testing. Forwarded to the root DOM element.
|
|
133
|
+
*/
|
|
134
|
+
'data-testid'?: string;
|
|
131
135
|
}
|
|
132
136
|
declare const Input: {
|
|
133
137
|
(props: IInputProps): React.JSX.Element;
|
package/inputs/Input/Input.js
CHANGED
|
@@ -72,7 +72,7 @@ var InputBase = function (props) {
|
|
|
72
72
|
inputRef.current.select();
|
|
73
73
|
};
|
|
74
74
|
return (React.createElement(InputWrapper, { fluid: props.fluid, ghost: props.ghost, error: props.error, disabled: props.disabled, transparent: props.transparent, icon: props.icon, iconPosition: props.iconPosition, onClear: (props.clearable && props.value) ? handleClear : null, onToggleReveal: props.revealable ? handleToggleReveal : null, revealed: revealed, unit: props.unit },
|
|
75
|
-
React.createElement("input", { "data-testid": "Input", className: props.className, ref: inputRef, tabIndex: props.noTabIndex ? -1 : 0, value: value, placeholder: props.placeholder, disabled: props.disabled, type: props.type == 'password' ? (revealed ? 'text' : 'password') : props.type, maxLength: props.maxLength, autoComplete: props.autocomplete, onChange: handleChange, onFocus: props.onFocus })));
|
|
75
|
+
React.createElement("input", { "data-testid": props['data-testid'] || "Input", className: props.className, ref: inputRef, tabIndex: props.noTabIndex ? -1 : 0, value: value, placeholder: props.placeholder, disabled: props.disabled, type: props.type == 'password' ? (revealed ? 'text' : 'password') : props.type, maxLength: props.maxLength, autoComplete: props.autocomplete, onChange: handleChange, onFocus: props.onFocus })));
|
|
76
76
|
};
|
|
77
77
|
var InputStyled = styled(InputBase)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n // Dimensions:\n width: 100%;\n box-sizing: border-box;\n z-index: 0;\n border: none;\n\n outline: solid 3px rebeccapurple;\n background: transparent;\n padding: 0;\n margin: 0;\n outline: none;\n\n // Font\n font: ", ";\n text-align: left;\n color: ", ";\n\n // Define colors for placeholder text.\n &::placeholder {\n color: rgb(from ", " r g b / 50%);\n opacity: 1 !important; /* Firefox applies opacity */\n }\n\n // Focus:\n &:focus {\n &::placeholder {\n color: rgb(from ", " r g b / 30%);\n }\n }\n\n ", "\n\n // Make sure HTML5 validation does not show up.\n &:valid {\n box-shadow: none;\n }\n &:invalid {\n box-shadow: none;\n }\n\n // Turn off number spinners.\n &[type=number]::-webkit-inner-spin-button, \n &[type=number]::-webkit-outer-spin-button { \n -webkit-appearance: none; /* Webkit (Chrome) */\n margin: 0; \n } \n &[type=number] {\n appearance:textfield;\n -moz-appearance:textfield; /* Firefox */\n } \n"], ["\n // Dimensions:\n width: 100%;\n box-sizing: border-box;\n z-index: 0;\n border: none;\n\n outline: solid 3px rebeccapurple;\n background: transparent;\n padding: 0;\n margin: 0;\n outline: none;\n\n // Font\n font: ", ";\n text-align: left;\n color: ", ";\n\n // Define colors for placeholder text.\n &::placeholder {\n color: rgb(from ", " r g b / 50%);\n opacity: 1 !important; /* Firefox applies opacity */\n }\n\n // Focus:\n &:focus {\n &::placeholder {\n color: rgb(from ", " r g b / 30%);\n }\n }\n\n ", "\n\n // Make sure HTML5 validation does not show up.\n &:valid {\n box-shadow: none;\n }\n &:invalid {\n box-shadow: none;\n }\n\n // Turn off number spinners.\n &[type=number]::-webkit-inner-spin-button, \n &[type=number]::-webkit-outer-spin-button { \n -webkit-appearance: none; /* Webkit (Chrome) */\n margin: 0; \n } \n &[type=number] {\n appearance:textfield;\n -moz-appearance:textfield; /* Firefox */\n } \n"])), function (p) { return p.theme.font.bodyMedium; }, function (p) { return p.theme.colors.primary[3]; }, function (p) { return p.theme.colors.primary[3]; }, function (p) { return p.theme.colors.primary[3]; }, function (p) { return p.disabled && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), p.theme.colors.neutral[50]); });
|
|
78
78
|
var Input = function (props) { return React.createElement(InputStyled, __assign({}, props)); };
|
|
@@ -63,6 +63,10 @@ interface IMonthRangeProps {
|
|
|
63
63
|
* Listeners are notified when the `MonthRange` receives focus.
|
|
64
64
|
*/
|
|
65
65
|
onFocus?: () => void;
|
|
66
|
+
/**
|
|
67
|
+
* Test ID for Playwright/testing. Forwarded to the root DOM element.
|
|
68
|
+
*/
|
|
69
|
+
'data-testid'?: string;
|
|
66
70
|
}
|
|
67
71
|
/**
|
|
68
72
|
* A `MonthRange` allows a selection of a time period, measured in months.
|
|
@@ -80,7 +80,7 @@ var MonthRangeBase = function (props) {
|
|
|
80
80
|
}
|
|
81
81
|
]
|
|
82
82
|
}), styles = _c.styles, attributes = _c.attributes, update = _c.update;
|
|
83
|
-
return (React.createElement("div", { "data-testid": "MonthRange", tabIndex: -1, className: props.className, onKeyDown: handleKeyDown, ref: wrapperRef },
|
|
83
|
+
return (React.createElement("div", { "data-testid": props['data-testid'] || "MonthRange", tabIndex: -1, className: props.className, onKeyDown: handleKeyDown, ref: wrapperRef },
|
|
84
84
|
React.createElement(Selector, { value: value, disabled: props.disabled, ghost: props.ghost, transparent: props.transparent, error: props.error, clearable: props.clearable, placeholder: props.placeholder, count: props.count, onClear: (!props.disabled && props.clearable && value != null) ? function () { return handleSelect(null); } : null, onCalendar: handleToggle }),
|
|
85
85
|
createPortal(React.createElement(Body, { ref: bodyRef, value: value, open: open, transparent: props.transparent, onSelect: handleSelect, styles: styles, attributes: attributes }), document.body)));
|
|
86
86
|
};
|
|
@@ -25,6 +25,10 @@ interface IProps extends ISelectorProps {
|
|
|
25
25
|
* If set, checkbox has a dark label.
|
|
26
26
|
*/
|
|
27
27
|
dark?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Test ID for Playwright/testing. Forwarded to the root DOM element.
|
|
30
|
+
*/
|
|
31
|
+
'data-testid'?: string;
|
|
28
32
|
}
|
|
29
33
|
/**
|
|
30
34
|
* A Selector can be used to create either a HTML checkbox or a HTML radio button.
|
|
@@ -61,7 +61,7 @@ var SelectorBase = function (props) {
|
|
|
61
61
|
default: return React.createElement(Checkbox, __assign({}, otherProps));
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
|
-
return (React.createElement("label", { "data-testid": "Selector", className: props.className },
|
|
64
|
+
return (React.createElement("label", { "data-testid": props['data-testid'] || "Selector", className: props.className },
|
|
65
65
|
React.createElement("input", { ref: inputRef, name: props.name, type: props.radio ? "radio" : "checkbox", value: props.value === null ? undefined : props.value, checked: checked === null ? false : checked, disabled: props.disabled, onChange: handleChange }),
|
|
66
66
|
getWidget(),
|
|
67
67
|
React.createElement("span", null, props.label)));
|
|
@@ -72,6 +72,10 @@ interface ISliderProps {
|
|
|
72
72
|
* Event is triggered when slider's value changes.
|
|
73
73
|
*/
|
|
74
74
|
onChange?: (value: number) => void;
|
|
75
|
+
/**
|
|
76
|
+
* Test ID for Playwright/testing. Forwarded to the root DOM element.
|
|
77
|
+
*/
|
|
78
|
+
'data-testid'?: string;
|
|
75
79
|
}
|
|
76
80
|
/**
|
|
77
81
|
* Sliders allow users to view and select a value (or range) along a track.
|
package/inputs/Slider/Slider.js
CHANGED
|
@@ -154,7 +154,7 @@ var SliderBase = function (props) {
|
|
|
154
154
|
// Create a number of ticks and return them.
|
|
155
155
|
return Array(props.ticks).fill(0).map(function (t, idx) { return React.createElement(Tick, { key: idx }); });
|
|
156
156
|
};
|
|
157
|
-
return (React.createElement("div", { "data-testid": "Slider", className: props.className, onMouseDown: handleMouseDown, onKeyDown: handleKeyDown, tabIndex: 0 },
|
|
157
|
+
return (React.createElement("div", { "data-testid": props['data-testid'] || "Slider", className: props.className, onMouseDown: handleMouseDown, onKeyDown: handleKeyDown, tabIndex: 0 },
|
|
158
158
|
React.createElement(Track, { ref: trackRef },
|
|
159
159
|
React.createElement(TrackFill, { "$disabled": props.disabled, "$error": props.error, ref: trackFillRef }),
|
|
160
160
|
props.ticks && props.hideTicks != true && renderTicks(),
|
|
@@ -69,6 +69,10 @@ interface ITextareaProps {
|
|
|
69
69
|
* Listeners are notified whenever the user interacts with the Textarea.
|
|
70
70
|
*/
|
|
71
71
|
onChange?: (value: any) => void;
|
|
72
|
+
/**
|
|
73
|
+
* Test ID for Playwright/testing. Forwarded to the root DOM element.
|
|
74
|
+
*/
|
|
75
|
+
'data-testid'?: string;
|
|
72
76
|
}
|
|
73
77
|
/**
|
|
74
78
|
* `Textarea` encapsulated and styles the `<textarea>` element. Like `Input`,
|
|
@@ -42,7 +42,7 @@ var TextareaBase = function (props) {
|
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
return (React.createElement(InputWrapper, { fluid: props.fluid, ghost: props.ghost, error: props.error, disabled: props.disabled, transparent: props.transparent, flex: props.flex },
|
|
45
|
-
React.createElement("textarea", { "data-testid": "Textarea", className: props.className, ref: textareaRef, name: props.name, value: value == null ? '' : value, placeholder: props.placeholder, disabled: props.disabled, tabIndex: 0, onChange: handleChange }),
|
|
45
|
+
React.createElement("textarea", { "data-testid": props['data-testid'] || "Textarea", className: props.className, ref: textareaRef, name: props.name, value: value == null ? '' : value, placeholder: props.placeholder, disabled: props.disabled, tabIndex: 0, onChange: handleChange }),
|
|
46
46
|
props.fullscreen &&
|
|
47
47
|
React.createElement(FullscreenToggle, { onClick: toggleFullscreen },
|
|
48
48
|
React.createElement("use", { xlinkHref: SVG.Icons.Fullscreen }))));
|
|
@@ -17,7 +17,7 @@ import * as React from 'react';
|
|
|
17
17
|
import styled from 'styled-components';
|
|
18
18
|
var HEIGHT = 24; // Hint height (px)
|
|
19
19
|
var HintBase = React.forwardRef(function (props, ref) {
|
|
20
|
-
return React.createElement("div", __assign({ ref: ref, style: props.styles }, props.attributes, { className: props.className }), props.children);
|
|
20
|
+
return React.createElement("div", __assign({ "data-testid": "MapButton.Hint", ref: ref, style: props.styles }, props.attributes, { className: props.className }), props.children);
|
|
21
21
|
});
|
|
22
22
|
var HintStyled = styled(HintBase)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n height: ", "px;\n padding: 0 12px 0 12px;\n margin: 0 12px 0 12px;\n font: ", ";\n z-index: 1000;\n\n // Border:\n border-radius: ", "px;\n\n // Color:\n background-color: ", ";\n color: ", ";\n white-space: nowrap;\n pointer-events: none;\n user-select: none;\n transition: opacity ease-in-out ", "ms;\n opacity: 0;\n\n // Content:\n display: flex;\n align-items: center;\n gap: 4px;\n"], ["\n position: absolute;\n height: ", "px;\n padding: 0 12px 0 12px;\n margin: 0 12px 0 12px;\n font: ", ";\n z-index: 1000;\n\n // Border:\n border-radius: ", "px;\n\n // Color:\n background-color: ", ";\n color: ", ";\n white-space: nowrap;\n pointer-events: none;\n user-select: none;\n transition: opacity ease-in-out ", "ms;\n opacity: 0;\n\n // Content:\n display: flex;\n align-items: center;\n gap: 4px;\n"
|
|
23
23
|
/**
|
|
@@ -34,6 +34,10 @@ interface IProps {
|
|
|
34
34
|
* Fired when the map button is clicked.
|
|
35
35
|
*/
|
|
36
36
|
onClick: (e?: React.MouseEvent) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Test ID for Playwright/testing. Forwarded to the root DOM element.
|
|
39
|
+
*/
|
|
40
|
+
'data-testid'?: string;
|
|
37
41
|
}
|
|
38
42
|
/**
|
|
39
43
|
* A `MapButton` is a square button to be used on a Mapbox map. It must
|
|
@@ -60,8 +60,8 @@ var MapButtonBase = function (props) {
|
|
|
60
60
|
]
|
|
61
61
|
}), styles = _c.styles, attributes = _c.attributes, update = _c.update;
|
|
62
62
|
var renderButton = function () {
|
|
63
|
-
return React.createElement("div", { ref: setWrapperRef, className: props.className, tabIndex: props.disabled ? -1 : 0, onClick: handleClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave },
|
|
64
|
-
React.createElement(Button, { "$grouped": props.grouped, "$size": props.size, "$disabled": props.disabled, "$active": props.active }, props.children),
|
|
63
|
+
return React.createElement("div", { ref: setWrapperRef, className: props.className, "data-testid": props['data-testid'], tabIndex: props.disabled ? -1 : 0, onClick: handleClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave },
|
|
64
|
+
React.createElement(Button, { "data-testid": "MapButton.Button", "$grouped": props.grouped, "$size": props.size, "$disabled": props.disabled, "$active": props.active }, props.children),
|
|
65
65
|
props.hint &&
|
|
66
66
|
createPortal(React.createElement(Hint, { ref: setHintRef, styles: styles.popper, attributes: __assign({}, attributes.popper) }, props.hint), document.body));
|
|
67
67
|
};
|
|
@@ -9,7 +9,7 @@ import { MapControl } from '../MapControl';
|
|
|
9
9
|
*/
|
|
10
10
|
var MapButtonGroup = function (props) {
|
|
11
11
|
return (React.createElement(MapControl, { x: props.x, y: props.y },
|
|
12
|
-
React.createElement("div", { className: props.className }, React.Children.map(props.children, function (child) {
|
|
12
|
+
React.createElement("div", { "data-testid": "MapButtonGroup", className: props.className }, React.Children.map(props.children, function (child) {
|
|
13
13
|
if (child == null)
|
|
14
14
|
return null;
|
|
15
15
|
return React.cloneElement(child, {
|
|
@@ -29,7 +29,7 @@ import { useViewState } from '../../../Map';
|
|
|
29
29
|
import styled from 'styled-components';
|
|
30
30
|
var MapControlBase = function (props) {
|
|
31
31
|
var viewState = useViewState();
|
|
32
|
-
return (React.createElement("div", { className: props.className, style: {
|
|
32
|
+
return (React.createElement("div", { "data-testid": "MapControl", className: props.className, style: {
|
|
33
33
|
// Must calculate this style dynamically, because it needs local state.
|
|
34
34
|
left: props.x >= 0 ? "".concat(props.x + (props.respectPadding ? viewState.padding.left : 0), "px") : 'auto',
|
|
35
35
|
right: props.x < 0 ? "".concat((props.respectPadding ? viewState.padding.right : 0) - props.x, "px") : 'auto',
|
package/modules/Filter/Filter.js
CHANGED
|
@@ -60,9 +60,9 @@ var FilterBase = function (props) {
|
|
|
60
60
|
if (update)
|
|
61
61
|
update();
|
|
62
62
|
};
|
|
63
|
-
return (React.createElement("div", { className: props.className },
|
|
63
|
+
return (React.createElement("div", { "data-test-id": "Filter", className: props.className },
|
|
64
64
|
React.createElement(ToggleButton, { url: SVG.Icons.Filter, ref: buttonRef, active: props.active, open: open, onClick: toggleOpen }),
|
|
65
|
-
createPortal(React.createElement(Pane, __assign({ "$open": open, "$width": props.width, style: styles.popper }, attributes.popper, { ref: paneRef }), open && React.createElement(GlassPane, { padded: true, bordered: true }, props.children)), document.body)));
|
|
65
|
+
createPortal(React.createElement(Pane, __assign({ "data-test-id": "Filter.Pane", "$open": open, "$width": props.width, style: styles.popper }, attributes.popper, { ref: paneRef }), open && React.createElement(GlassPane, { padded: true, bordered: true }, props.children)), document.body)));
|
|
66
66
|
};
|
|
67
67
|
var Pane = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: ", ";\n width: ", "px;\n z-index: 2500;\n"], ["\n display: ", ";\n width: ", "px;\n z-index: 2500;\n"
|
|
68
68
|
/**
|
|
@@ -49,8 +49,8 @@ var MainMenuBase = function (props) {
|
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
return (React.createElement("div", { "data-testid": "MainMenu", className: props.className },
|
|
52
|
-
React.createElement(Top,
|
|
53
|
-
React.createElement(Bottom,
|
|
52
|
+
React.createElement(Top, { "data-testid": "MainMenu.Top" }, primaryItems),
|
|
53
|
+
React.createElement(Bottom, { "data-testid": "MainMenu.Bottom" }, secondaryItems)));
|
|
54
54
|
};
|
|
55
55
|
var Top = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 16px;\n"], ["\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 16px;\n"])));
|
|
56
56
|
var Bottom = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: end;\n gap: 16px;\n"], ["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: end;\n gap: 16px;\n"])));
|
package/modules/Root/Content.js
CHANGED
|
@@ -16,7 +16,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
16
16
|
import * as React from 'react';
|
|
17
17
|
import styled from 'styled-components';
|
|
18
18
|
var ContentBase = function (props) {
|
|
19
|
-
return (React.createElement("div", { className: props.className }, props.children));
|
|
19
|
+
return (React.createElement("div", { "data-testid": "Root.Content", className: props.className }, props.children));
|
|
20
20
|
};
|
|
21
21
|
var ContentStyled = styled(ContentBase)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n width: 100%;\n height: 100%;\n background: red;\n visibility: ", ";\n"], ["\n position: relative;\n width: 100%;\n height: 100%;\n background: red;\n visibility: ", ";\n"])), function (p) { return p.active ? 'visible' : 'hidden'; });
|
|
22
22
|
var Content = function (props) { return React.createElement(ContentStyled, __assign({}, props)); };
|
package/modules/Root/Overlay.js
CHANGED
|
@@ -22,7 +22,7 @@ var OverlayBase = function (props) {
|
|
|
22
22
|
var handleShaderClick = function () {
|
|
23
23
|
props.onClose();
|
|
24
24
|
};
|
|
25
|
-
return (React.createElement("div", { className: props.className },
|
|
25
|
+
return (React.createElement("div", { "data-testid": "Root.Overlay", className: props.className },
|
|
26
26
|
React.createElement(Sidebar, { open: props.open }, props.children),
|
|
27
27
|
React.createElement(Shader, { active: props.open, onClick: handleShaderClick })));
|
|
28
28
|
};
|
package/modules/Root/Root.js
CHANGED
|
@@ -31,10 +31,10 @@ var RootBase = function (props) {
|
|
|
31
31
|
React.createElement(MainMenu.Item, { icon: SVG.Menu.Account, onClick: function () { return navigate("page1"); } }, "Page 1"),
|
|
32
32
|
React.createElement(MainMenu.Item, { icon: SVG.Menu.Signout, onClick: function () { return navigate("page2"); } }, "Page 2")),
|
|
33
33
|
React.createElement(Overlay, { open: m.length == 3 && m[2].pathname != "/", onClose: function () { return navigate("/"); } }, m.length == 3 && React.createElement(Outlet, null)),
|
|
34
|
-
React.createElement(Content,
|
|
34
|
+
React.createElement(Content, { "data-testid": "Root.Content" },
|
|
35
35
|
React.createElement(Map, { token: "pk.eyJ1IjoibG9uZ2xpbmVlbnZpcm9ubWVudCIsImEiOiJjbDdldTJhMmYwM3VlM3lvMW5mcTFyOWlnIn0.LzghnMQjPdtw795xN-BCWg", style: "mapbox://styles/longlineenvironment/clm8wahno013a01pb5c0u3k22" }),
|
|
36
36
|
m.length == 2 &&
|
|
37
|
-
React.createElement(Page,
|
|
37
|
+
React.createElement(Page, { "data-testid": "Root.Page" },
|
|
38
38
|
React.createElement(Outlet, null)))));
|
|
39
39
|
};
|
|
40
40
|
var Content = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 80px;\n right: 0;\n bottom: 0;\n"], ["\n position: absolute;\n top: 0;\n left: 80px;\n right: 0;\n bottom: 0;\n"])));
|
package/modules/Root/Shader.js
CHANGED
|
@@ -16,7 +16,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
16
16
|
import * as React from 'react';
|
|
17
17
|
import styled from 'styled-components';
|
|
18
18
|
var ShaderBase = function (props) {
|
|
19
|
-
return (React.createElement("div", { className: props.className, onClick: props.onClick }));
|
|
19
|
+
return (React.createElement("div", { "data-testid": "Root.Shader", className: props.className, onClick: props.onClick }));
|
|
20
20
|
};
|
|
21
21
|
var ShaderStyled = styled(ShaderBase)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n // Position and size:\n position: absolute;\n z-index: 1;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n\n // Behavior:\n pointer-events: ", ";\n cursor: ", ";\n\n // Appearance:\n transition: opacity ", "ms ease-in-out;\n opacity: ", ";\n background-color: rgba(0,0,0,0.5);\n"], ["\n // Position and size:\n position: absolute;\n z-index: 1;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n\n // Behavior:\n pointer-events: ", ";\n cursor: ", ";\n\n // Appearance:\n transition: opacity ", "ms ease-in-out;\n opacity: ", ";\n background-color: rgba(0,0,0,0.5);\n"])), function (p) { return p.active ? 'all' : 'none'; }, function (p) { return p.active ? 'pointer' : 'auto'; }, function (p) { return p.theme.animation.duration * 2; }, function (p) { return p.active ? 1 : 0; });
|
|
22
22
|
var Shader = function (props) { return React.createElement(ShaderStyled, __assign({}, props)); };
|
package/modules/Root/Sidebar.js
CHANGED
|
@@ -16,7 +16,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
16
16
|
import * as React from 'react';
|
|
17
17
|
import styled from 'styled-components';
|
|
18
18
|
var SidebarBase = function (props) {
|
|
19
|
-
return (React.createElement("div", { className: props.className }, props.children));
|
|
19
|
+
return (React.createElement("div", { "data-testid": "Root.Sidebar", className: props.className }, props.children));
|
|
20
20
|
};
|
|
21
21
|
var SidebarStyled = styled(SidebarBase)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n // Position and size:\n position: absolute;\n z-index: 2;\n left: ", ";\n top: 0;\n width: 250px;\n bottom: 0;\n transition: left ", "ms ease-in-out;\n pointer-events: all;\n\n // Appearance:\n background: ", ";\n"], ["\n // Position and size:\n position: absolute;\n z-index: 2;\n left: ", ";\n top: 0;\n width: 250px;\n bottom: 0;\n transition: left ", "ms ease-in-out;\n pointer-events: all;\n\n // Appearance:\n background: ", ";\n"])), function (p) { return p.open ? 0 : '-350px'; }, function (p) { return p.theme.animation.duration * 2; }, function (p) { return p.theme.colors.primary[3]; });
|
|
22
22
|
var Sidebar = function (props) { return React.createElement(SidebarStyled, __assign({}, props)); };
|