@longline/aqua-ui 1.0.338 → 1.0.340
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/Anchor/Anchor.d.ts +5 -0
- package/containers/Anchor/Anchor.js +20 -8
- package/containers/Dock/Dock.d.ts +5 -0
- package/containers/Dock/Dock.js +1 -1
- package/containers/Dock/Dockable.d.ts +5 -0
- package/containers/Dock/Dockable.js +20 -12
- package/containers/DragBar/DragBar.d.ts +5 -0
- package/containers/DragBar/DragBar.js +16 -5
- package/containers/Form/Field.d.ts +0 -3
- package/containers/Form/Field.js +3 -6
- package/containers/Form/Form.js +5 -36
- package/containers/Form/Validation.d.ts +1 -1
- package/containers/Form/Validation.js +6 -6
- package/containers/Form/context/FormContext.d.ts +1 -2
- package/containers/Form/context/useForm.d.ts +1 -1
- package/containers/Form/elements/BoxWrapper.js +2 -0
- package/containers/GlassPane/GlassPane.d.ts +7 -2
- package/containers/GlassPane/GlassPane.js +3 -3
- package/containers/InfoBox/InfoBox.d.ts +5 -0
- package/containers/InfoBox/InfoBox.js +1 -1
- package/containers/List/List.d.ts +5 -0
- package/containers/List/List.js +1 -1
- package/containers/List/ListCell.d.ts +5 -0
- package/containers/List/ListCell.js +1 -1
- package/containers/List/ListRow.d.ts +7 -2
- package/containers/List/ListRow.js +1 -1
- package/containers/Message/Error.d.ts +2 -0
- package/containers/Message/Error.js +1 -1
- package/containers/Message/Message.d.ts +5 -0
- package/containers/Message/Message.js +1 -1
- package/containers/Message/NoData.d.ts +2 -0
- package/containers/Message/NoData.js +1 -1
- package/containers/Message/NoFilteredData.d.ts +2 -0
- package/containers/Message/NoFilteredData.js +1 -1
- package/containers/Openable/Openable.d.ts +5 -0
- package/containers/Openable/Openable.js +8 -8
- package/containers/PublicRoute/PublicRoute.d.ts +9 -1
- package/containers/PublicRoute/PublicRoute.js +3 -7
- package/containers/Tabs/Pane.d.ts +5 -0
- package/containers/Tabs/Pane.js +3 -3
- package/containers/Tabs/Tabs.d.ts +5 -0
- package/containers/Tabs/Tabs.js +3 -3
- package/controls/Chip/Chip.d.ts +15 -3
- package/controls/Chip/Chip.js +7 -6
- package/controls/CircularProgress/CircularProgress.d.ts +11 -0
- package/controls/CircularProgress/CircularProgress.js +19 -11
- package/controls/Dropzone/Dropzone.d.ts +11 -1
- package/controls/Dropzone/Dropzone.js +18 -7
- package/controls/Fab/Fab.d.ts +14 -6
- package/controls/Fab/Fab.js +7 -20
- package/controls/Ghost/Ghost.js +3 -3
- package/controls/Gradient/Gradient.d.ts +5 -0
- package/controls/Gradient/Gradient.js +7 -4
- package/controls/Histogram/Histogram.d.ts +8 -2
- package/controls/Histogram/Histogram.js +9 -9
- package/controls/Histogram/HistogramBar.d.ts +2 -2
- package/controls/Icon/Icon.d.ts +10 -4
- package/controls/Icon/Icon.js +23 -6
- package/controls/Key/Key.d.ts +5 -0
- package/controls/Key/Key.js +2 -5
- package/controls/LinearChart/LinearChart.d.ts +9 -0
- package/controls/LinearChart/LinearChart.js +11 -6
- package/controls/ListButton/ListButton.d.ts +46 -3
- package/controls/ListButton/ListButton.js +70 -9
- package/controls/ListView/ColumnsManager/ColumnDraggable.js +11 -5
- package/controls/ListView/ColumnsManager/SourceColumns.js +1 -1
- package/controls/ListView/IListViewProps.d.ts +9 -2
- package/controls/ListView/ListView.js +13 -12
- package/controls/ListView/defaults.d.ts +3 -0
- package/controls/ListView/defaults.js +6 -0
- package/controls/ListView/elements/Body.d.ts +1 -1
- package/controls/ListView/elements/Body.js +23 -12
- package/controls/ListView/elements/Ghost.js +3 -2
- package/controls/ListView/elements/Header.js +3 -2
- package/controls/ListView/elements/HeaderCell.js +3 -3
- package/controls/ListView/elements/Table.js +16 -10
- package/controls/Mouse/Mouse.d.ts +6 -4
- package/controls/Mouse/Mouse.js +15 -8
- package/controls/PrimaryButton/PrimaryButton.d.ts +9 -3
- package/controls/PrimaryButton/PrimaryButton.js +5 -5
- package/controls/Progress/Progress.d.ts +9 -0
- package/controls/Progress/Progress.js +12 -8
- package/controls/SecondaryButton/SecondaryButton.d.ts +8 -3
- package/controls/SecondaryButton/SecondaryButton.js +1 -1
- package/controls/SpeechRecognizer/EditorRegistry.js +1 -2
- package/controls/SpeechRecognizer/SpeechRecognizer.d.ts +9 -1
- package/controls/SpeechRecognizer/SpeechRecognizer.js +16 -9
- package/controls/TabBar/TabBar.d.ts +5 -0
- package/controls/TabBar/TabBar.js +14 -6
- package/controls/TabBar/Underliner.js +1 -1
- package/controls/TertiaryButton/TertiaryButton.d.ts +9 -3
- package/controls/TertiaryButton/TertiaryButton.js +5 -3
- package/controls/ToggleButton/ToggleButton.d.ts +8 -2
- package/controls/ToggleButton/ToggleButton.js +1 -1
- package/controls/View/View.d.ts +5 -0
- package/controls/View/View.js +1 -1
- package/formatters/CountryFormatter/CountryFormatter.d.ts +3 -2
- package/formatters/CountryFormatter/CountryUtil.d.ts +3 -3
- package/formatters/DateTimeFormatter/DateTimeFormatter.d.ts +11 -10
- package/formatters/DateTimeFormatter/elements/Custom.d.ts +1 -1
- package/formatters/DateTimeFormatter/elements/DistanceDate.d.ts +1 -1
- package/formatters/DateTimeFormatter/elements/LongDate.d.ts +1 -1
- package/formatters/DateTimeFormatter/elements/LongDateTime.d.ts +1 -1
- package/formatters/DateTimeFormatter/elements/LongTime.d.ts +1 -1
- package/formatters/DateTimeFormatter/elements/Month.d.ts +1 -1
- package/formatters/DateTimeFormatter/elements/ShortDate.d.ts +1 -1
- package/formatters/DateTimeFormatter/elements/ShortDateTime.d.ts +1 -1
- package/formatters/DateTimeFormatter/elements/ShortTime.d.ts +1 -1
- package/formatters/DivisionFormatter/DivisionFormatter.d.ts +2 -2
- package/formatters/DivisionFormatter/DivisionFormatter.js +1 -1
- package/formatters/DivisionFormatter/DivisionUtil.d.ts +1 -1
- package/formatters/DivisionFormatter/DivisionUtil.js +5 -3
- package/formatters/FilesizeFormatter/FilesizeFormatter.d.ts +3 -3
- package/formatters/GIS/CoordinateFormatter.d.ts +2 -2
- package/formatters/GIS/LatitudeFormatter.d.ts +2 -2
- package/formatters/GIS/LongitudeFormatter.d.ts +2 -2
- package/formatters/HumanFormatter/HumanFormatter.d.ts +3 -3
- package/formatters/NumberFormatter/NumberFormatter.d.ts +3 -3
- package/formatters/PhoneFormatter/PhoneFormatter.d.ts +25 -0
- package/formatters/PhoneFormatter/PhoneFormatter.js +34 -0
- package/formatters/PhoneFormatter/index.d.ts +1 -0
- package/formatters/PhoneFormatter/index.js +1 -0
- package/formatters/StringFormatter/StringFormatter.d.ts +3 -3
- package/formatters/StringFormatter/StringFormatter.js +1 -4
- package/helper/DMS.d.ts +1 -1
- package/helper/DMS.js +2 -2
- package/helper/phoneNumber.d.ts +31 -0
- package/helper/phoneNumber.js +142 -0
- package/hooks/useOutsideClose/useOutsideClose.js +20 -11
- package/hooks/useSpeechAIRecorder/useSpeechAIRecorder.js +10 -7
- package/index.js +1 -0
- package/inputs/DateInput/Body.d.ts +2 -2
- package/inputs/DateInput/Body.js +11 -7
- package/inputs/DateInput/Calendar.d.ts +1 -1
- package/inputs/DateInput/Calendar.js +3 -5
- package/inputs/DateInput/DateInput.d.ts +11 -3
- package/inputs/DateInput/DateInput.js +11 -3
- package/inputs/DateInput/Day.d.ts +1 -1
- package/inputs/DateInput/InfiniteList.js +6 -3
- package/inputs/DateInput/Navbar.js +3 -2
- package/inputs/DateInput/NumericInput.js +3 -0
- package/inputs/DateInput/Selector.d.ts +1 -1
- package/inputs/DateInput/Selector.js +9 -6
- package/inputs/Dropdown/Body.d.ts +2 -2
- package/inputs/Dropdown/Column.d.ts +1 -1
- package/inputs/Dropdown/Dropdown.d.ts +5 -0
- package/inputs/Dropdown/Dropdown.js +36 -63
- package/inputs/Dropdown/Pill.js +1 -1
- package/inputs/Dropdown/Selection.js +1 -1
- package/inputs/Editor/Editor.d.ts +5 -0
- package/inputs/Editor/Editor.js +16 -6
- package/inputs/Editor/buttons/SpeechAIButton.js +2 -0
- package/inputs/Editor/buttons/TextAIButton.d.ts +0 -13
- package/inputs/Editor/buttons/TextAIButton.js +30 -14
- package/inputs/Editor/buttons/TextAIMenu.js +1 -1
- package/inputs/Editor/menu/MenuBar.d.ts +1 -1
- package/inputs/Editor/menu/MenuBar.js +1 -1
- package/inputs/Editor/menu/MenuButton.js +1 -1
- package/inputs/Input/Clear.js +1 -1
- package/inputs/Input/Input.d.ts +5 -0
- package/inputs/Input/Input.js +8 -6
- package/inputs/Input/InputWrapper.d.ts +2 -0
- package/inputs/Input/InputWrapper.js +1 -1
- package/inputs/Input/Reveal.js +1 -1
- package/inputs/MonthRange/Body.d.ts +1 -1
- package/inputs/MonthRange/Calendar.d.ts +2 -2
- package/inputs/MonthRange/Calendar.js +6 -9
- package/inputs/MonthRange/MonthRange.d.ts +7 -1
- package/inputs/MonthRange/MonthRange.js +14 -6
- package/inputs/MonthRange/Selector.d.ts +1 -1
- package/inputs/MonthRange/Selector.js +12 -11
- package/inputs/PhoneInput/PhoneInput.d.ts +97 -0
- package/inputs/PhoneInput/PhoneInput.js +113 -0
- package/inputs/PhoneInput/index.d.ts +2 -0
- package/inputs/PhoneInput/index.js +1 -0
- package/inputs/Selector/Selector.d.ts +5 -0
- package/inputs/Selector/Selector.js +4 -1
- package/inputs/Slider/Slider.d.ts +75 -22
- package/inputs/Slider/Slider.js +104 -22
- package/inputs/Textarea/Textarea.d.ts +5 -5
- package/inputs/Textarea/Textarea.js +3 -2
- package/map/Map/Map.d.ts +2 -2
- package/map/Map/Map.js +20 -14
- package/map/PositionsManager/PositionBox.js +7 -3
- package/map/PositionsManager/PositionsManager.js +33 -13
- package/map/controls/CompassButton/CompassButton.js +1 -1
- package/map/controls/FullscreenButton/FullscreenButton.js +1 -1
- package/map/controls/Geocoder/Geocoder.js +28 -14
- package/map/controls/Geocoder/GeocoderApi.js +2 -0
- package/map/controls/Geocoder/GeocoderSelector.js +1 -1
- package/map/controls/Graticule/Graticule.js +1 -5
- package/map/controls/MapLoader/MapLoader.js +1 -1
- package/map/controls/ScaleControl/ScaleControl.js +1 -1
- package/map/controls/ZoomInButton/ZoomInButton.js +1 -1
- package/map/controls/ZoomOutButton/ZoomOutButton.d.ts +1 -1
- package/map/controls/ZoomOutButton/ZoomOutButton.js +2 -2
- package/map/controls/base/MapButton/MapButton.d.ts +8 -2
- package/map/controls/base/MapButton/MapButton.js +11 -2
- package/map/controls/base/MapControl/MapControl.d.ts +5 -0
- package/map/controls/base/MapControl/MapControl.js +10 -7
- package/map/layers/ClusterLayer/ClusterLayer.d.ts +1 -1
- package/map/layers/ClusterLayer/ClusterLayer.js +7 -3
- package/map/layers/HtmlMarkerLayer/HtmlMarkerLayer.js +8 -4
- package/map/layers/IdwBlendLayer/IdwBlendLayer.js +9 -4
- package/map/layers/IdwLayer/IdwLayer.d.ts +2 -1
- package/map/layers/IdwLayer/IdwLayer.js +271 -215
- package/map/layers/InterpolationLayer/ContoursFragmentShader.d.ts +1 -1
- package/map/layers/InterpolationLayer/ContoursFragmentShader.js +1 -1
- package/map/layers/InterpolationLayer/InterpolationLayer.d.ts +4 -3
- package/map/layers/InterpolationLayer/InterpolationLayer.js +362 -275
- package/map/layers/ParticlesLayer/ParticlesLayer.d.ts +8 -7
- package/map/layers/ParticlesLayer/ParticlesLayer.js +528 -404
- package/map/markers/ClusterMarker/ClusterMarker.d.ts +6 -1
- package/map/markers/ClusterMarker/ClusterMarker.js +15 -6
- package/map/markers/RiskMarker/RiskMarker.d.ts +5 -1
- package/map/markers/RiskMarker/RiskMarker.js +4 -4
- package/modules/CountryDropdown/CountryDropdown.js +10 -1
- package/modules/Filter/Filter.d.ts +5 -0
- package/modules/Filter/Filter.js +10 -6
- package/modules/Globe/Globe.d.ts +5 -0
- package/modules/Globe/Globe.js +4 -4
- package/modules/MainMenu/Item.d.ts +9 -2
- package/modules/MainMenu/Item.js +8 -5
- package/modules/MainMenu/MainMenu.d.ts +5 -0
- package/modules/MainMenu/MainMenu.js +1 -1
- package/modules/ParticleGlobe/GL.d.ts +1 -1
- package/modules/ParticleGlobe/ParticleGlobe.d.ts +5 -0
- package/modules/ParticleGlobe/ParticleGlobe.js +69 -40
- package/modules/Public/Public.d.ts +5 -0
- package/modules/Public/Public.js +3 -3
- package/package.json +1 -1
- package/services/Auth/Auth.js +13 -7
- package/services/Auth/AuthContext.js +9 -1
- package/services/Dialog/Dialog.d.ts +7 -2
- package/services/Dialog/Dialog.js +7 -6
- package/services/Dialog/DialogWindow.d.ts +3 -1
- package/services/Dialog/DialogWindow.js +1 -1
- package/services/Dialog/XhrDialog.d.ts +1 -1
- package/services/Toast/Toast.js +5 -3
- package/services/Toast/ToastContainer.js +3 -1
- package/services/Toast/ToastContext.d.ts +1 -1
- package/services/Toast/ToastProvider.js +2 -0
- package/map/layers/HtmlMarkerLayer/HtmlMarkerLayer copy.d.ts +0 -35
- package/map/layers/HtmlMarkerLayer/HtmlMarkerLayer copy.js +0 -176
- package/modules/Root/Content.d.ts +0 -16
- package/modules/Root/Content.js +0 -25
- package/modules/Root/Overlay.d.ts +0 -23
- package/modules/Root/Overlay.js +0 -33
- package/modules/Root/Root.d.ts +0 -10
- package/modules/Root/Root.js +0 -46
- package/modules/Root/Shader.d.ts +0 -15
- package/modules/Root/Shader.js +0 -24
- package/modules/Root/Sidebar.d.ts +0 -13
- package/modules/Root/Sidebar.js +0 -24
- package/modules/Root/index.d.ts +0 -1
- package/modules/Root/index.js +0 -1
- package/modules/Root/stories/SampleContent.d.ts +0 -7
- package/modules/Root/stories/SampleContent.js +0 -44
|
@@ -49,6 +49,11 @@ interface IAnchorProps extends ITestable {
|
|
|
49
49
|
* @default false
|
|
50
50
|
*/
|
|
51
51
|
adapt?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Optional inline styles applied to the outer element, for one-off overrides
|
|
54
|
+
* of the default styling.
|
|
55
|
+
*/
|
|
56
|
+
style?: React.CSSProperties;
|
|
52
57
|
}
|
|
53
58
|
/**
|
|
54
59
|
* Often, a panel must open somewhere when a button or icon is clicked. This panel
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
1
12
|
import * as React from 'react';
|
|
2
13
|
/**
|
|
3
14
|
* Often, a panel must open somewhere when a button or icon is clicked. This panel
|
|
@@ -14,6 +25,8 @@ var Anchor = function (props) {
|
|
|
14
25
|
var anchorRef = React.useRef(null);
|
|
15
26
|
var contentRef = React.useRef(null);
|
|
16
27
|
var findScrollingParentRecursive = function (node) {
|
|
28
|
+
if (!node)
|
|
29
|
+
return null;
|
|
17
30
|
var overflowY = window.getComputedStyle(node).overflowY;
|
|
18
31
|
if (overflowY == 'scroll' || overflowY == 'auto')
|
|
19
32
|
return node;
|
|
@@ -24,12 +37,15 @@ var Anchor = function (props) {
|
|
|
24
37
|
// Return my nearest parent that's scrolling (frames are not supported). If
|
|
25
38
|
// no parent is found, null is returned.
|
|
26
39
|
var findScrollingParent = function () {
|
|
27
|
-
|
|
40
|
+
var _a, _b;
|
|
41
|
+
return findScrollingParentRecursive((_b = (_a = anchorRef.current) === null || _a === void 0 ? void 0 : _a.parentElement) !== null && _b !== void 0 ? _b : null);
|
|
28
42
|
};
|
|
29
43
|
// Returns true if this control is in the lower half of its scrolling parent.
|
|
30
44
|
// (if direction == parent), or in the lower half of the viewport if no
|
|
31
45
|
// scrolling parent is found.
|
|
32
46
|
var isInLowerViewport = function () {
|
|
47
|
+
if (!anchorRef.current)
|
|
48
|
+
return false;
|
|
33
49
|
var scrollingParent = findScrollingParent();
|
|
34
50
|
if (scrollingParent == null || props.relativeToParent) {
|
|
35
51
|
return anchorRef.current.getBoundingClientRect().top > window.innerHeight / 2;
|
|
@@ -46,6 +62,8 @@ var Anchor = function (props) {
|
|
|
46
62
|
// (if direction == parent), or in the right half of the viewport if no
|
|
47
63
|
// scrolling parent is found.
|
|
48
64
|
var isInRightViewport = function () {
|
|
65
|
+
if (!anchorRef.current)
|
|
66
|
+
return false;
|
|
49
67
|
var scrollingParent = findScrollingParent();
|
|
50
68
|
if (scrollingParent == null || props.relativeToParent) {
|
|
51
69
|
return anchorRef.current.getBoundingClientRect().left > window.innerWidth / 2;
|
|
@@ -101,13 +119,7 @@ var Anchor = function (props) {
|
|
|
101
119
|
React.useEffect(function () {
|
|
102
120
|
updatePosition();
|
|
103
121
|
}, [props.horizontal, props.vertical]);
|
|
104
|
-
return (React.createElement("div", { "data-testid": props['data-testid'] || "Anchor", ref: anchorRef, style: {
|
|
105
|
-
position: 'absolute',
|
|
106
|
-
left: (_a = props.left) !== null && _a !== void 0 ? _a : 'auto',
|
|
107
|
-
top: (_b = props.top) !== null && _b !== void 0 ? _b : 'auto',
|
|
108
|
-
bottom: (_c = props.bottom) !== null && _c !== void 0 ? _c : 'auto',
|
|
109
|
-
right: (_d = props.right) !== null && _d !== void 0 ? _d : 'auto',
|
|
110
|
-
} },
|
|
122
|
+
return (React.createElement("div", { "data-testid": props['data-testid'] || "Anchor", ref: anchorRef, className: props.className, style: __assign({ position: 'absolute', left: (_a = props.left) !== null && _a !== void 0 ? _a : 'auto', top: (_b = props.top) !== null && _b !== void 0 ? _b : 'auto', bottom: (_c = props.bottom) !== null && _c !== void 0 ? _c : 'auto', right: (_d = props.right) !== null && _d !== void 0 ? _d : 'auto' }, props.style) },
|
|
111
123
|
React.createElement("div", { ref: contentRef, style: { position: 'absolute', visibility: 'hidden', transition: 'top 250ms ease, left 250ms ease' } }, props.children)));
|
|
112
124
|
};
|
|
113
125
|
Anchor.displayName = 'Anchor';
|
|
@@ -30,6 +30,11 @@ interface IDockProps extends ITestable {
|
|
|
30
30
|
* @default 16
|
|
31
31
|
*/
|
|
32
32
|
gap?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Optional inline styles applied to the outer element, for one-off overrides
|
|
35
|
+
* of the default styling.
|
|
36
|
+
*/
|
|
37
|
+
style?: React.CSSProperties;
|
|
33
38
|
}
|
|
34
39
|
/**
|
|
35
40
|
* A `Dock` is a place where `Dockable` components live. Dockables have a lat/lng location on
|
package/containers/Dock/Dock.js
CHANGED
|
@@ -27,7 +27,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
27
27
|
import * as React from 'react';
|
|
28
28
|
import styled, { css } from 'styled-components';
|
|
29
29
|
var DockBase = function (props) {
|
|
30
|
-
return React.createElement("div", { "data-testid": props['data-testid'] || "Dock", className: props.className, role: "presentation" }, props.children);
|
|
30
|
+
return React.createElement("div", { "data-testid": props['data-testid'] || "Dock", className: props.className, style: props.style, role: "presentation" }, props.children);
|
|
31
31
|
};
|
|
32
32
|
var DockStyled = styled(DockBase)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n // Position and size:\n position: absolute;\n left: 0;\n right: ", "px;\n top: ", "px;\n bottom: ", "px;\n box-sizing: border-box;\n // zIndex >= 2 will overlap Mapbox logo.\n z-index: 2;\n\n // Appearance:\n background-color: transparent;\n ", "\n pointer-events: none !important; /* Map will set pointer-events:all to its children. */\n\n // Content:\n display: flex;\n flex-direction: column;\n align-items: end;\n gap: ", "px;\n"], ["\n // Position and size:\n position: absolute;\n left: 0;\n right: ", "px;\n top: ", "px;\n bottom: ", "px;\n box-sizing: border-box;\n // zIndex >= 2 will overlap Mapbox logo.\n z-index: 2;\n\n // Appearance:\n background-color: transparent;\n ", "\n pointer-events: none !important; /* Map will set pointer-events:all to its children. */\n\n // Content:\n display: flex;\n flex-direction: column;\n align-items: end;\n gap: ", "px;\n"
|
|
33
33
|
/**
|
|
@@ -57,6 +57,11 @@ interface IDockableProps extends ITestable {
|
|
|
57
57
|
* @default 60
|
|
58
58
|
*/
|
|
59
59
|
hysteresis?: number;
|
|
60
|
+
/**
|
|
61
|
+
* Optional inline styles applied to the outer element, merged after (and so
|
|
62
|
+
* overriding) the component's own positioning styles.
|
|
63
|
+
*/
|
|
64
|
+
style?: React.CSSProperties;
|
|
60
65
|
}
|
|
61
66
|
/**
|
|
62
67
|
* A `Dockable` is fixed to a lat/lng on the `Map`. It must be a child of `Dock`. When a Dockable
|
|
@@ -28,8 +28,15 @@ import * as React from 'react';
|
|
|
28
28
|
import { useMap } from 'react-map-gl/mapbox';
|
|
29
29
|
import styled, { css } from 'styled-components';
|
|
30
30
|
import { useViewState } from '../../map/Map';
|
|
31
|
+
// Default prop values, referenced both by the DockableBase fallbacks and the
|
|
32
|
+
// Dockable wrapper below.
|
|
33
|
+
var DEFAULT_LONGITUDE = 0;
|
|
34
|
+
var DEFAULT_LATITUDE = 0;
|
|
35
|
+
var DEFAULT_OFFSET_X = 0;
|
|
36
|
+
var DEFAULT_OFFSET_Y = 0;
|
|
37
|
+
var DEFAULT_HYSTERESIS = 60;
|
|
31
38
|
var DockableBase = function (props) {
|
|
32
|
-
var _a, _b, _c, _d;
|
|
39
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
33
40
|
// Reference to Dockable div:
|
|
34
41
|
var containerRef = React.useRef(null);
|
|
35
42
|
// Using the ViewState will cause this component to be rerendered when the
|
|
@@ -40,13 +47,14 @@ var DockableBase = function (props) {
|
|
|
40
47
|
var mapWidth = map.current.getContainer().clientWidth;
|
|
41
48
|
var mapHeight = map.current.getContainer().clientHeight;
|
|
42
49
|
// Convert Dockable's lat/lng to pixel coordinates:
|
|
43
|
-
var
|
|
50
|
+
var _k = map.current.project([(_a = props.longitude) !== null && _a !== void 0 ? _a : DEFAULT_LONGITUDE, (_b = props.latitude) !== null && _b !== void 0 ? _b : DEFAULT_LATITUDE]), x = _k.x, y = _k.y;
|
|
44
51
|
// Get size of Dockable:
|
|
45
|
-
var myWidth = (
|
|
46
|
-
var myHeight = (
|
|
52
|
+
var myWidth = (_d = (_c = containerRef.current) === null || _c === void 0 ? void 0 : _c.clientWidth) !== null && _d !== void 0 ? _d : 0;
|
|
53
|
+
var myHeight = (_f = (_e = containerRef.current) === null || _e === void 0 ? void 0 : _e.clientHeight) !== null && _f !== void 0 ? _f : 0;
|
|
47
54
|
// Is Dockable currently offscreen (boolean)?
|
|
48
|
-
var offsetX = props.offsetX;
|
|
49
|
-
var offsetY = props.offsetY;
|
|
55
|
+
var offsetX = (_g = props.offsetX) !== null && _g !== void 0 ? _g : DEFAULT_OFFSET_X;
|
|
56
|
+
var offsetY = (_h = props.offsetY) !== null && _h !== void 0 ? _h : DEFAULT_OFFSET_Y;
|
|
57
|
+
var hysteresis = (_j = props.hysteresis) !== null && _j !== void 0 ? _j : DEFAULT_HYSTERESIS;
|
|
50
58
|
var swapHorizontally = props.swappable === 'horizontal' || props.swappable === 'both';
|
|
51
59
|
var swapVertically = props.swappable === 'vertical' || props.swappable === 'both';
|
|
52
60
|
var possibleXs = swapHorizontally
|
|
@@ -64,20 +72,20 @@ var DockableBase = function (props) {
|
|
|
64
72
|
// Horizontal hysteresis:
|
|
65
73
|
React.useEffect(function () {
|
|
66
74
|
var center = mapWidth / 2;
|
|
67
|
-
if (x > center +
|
|
75
|
+
if (x > center + hysteresis) {
|
|
68
76
|
wasRightRef.current = true;
|
|
69
77
|
}
|
|
70
|
-
else if (x < center -
|
|
78
|
+
else if (x < center - hysteresis) {
|
|
71
79
|
wasRightRef.current = false;
|
|
72
80
|
}
|
|
73
81
|
}, [x, mapWidth]);
|
|
74
82
|
// Vertical hysteresis:
|
|
75
83
|
React.useEffect(function () {
|
|
76
84
|
var center = mapHeight / 2;
|
|
77
|
-
if (y > center +
|
|
85
|
+
if (y > center + hysteresis) {
|
|
78
86
|
wasBottomRef.current = true;
|
|
79
87
|
}
|
|
80
|
-
else if (y < center -
|
|
88
|
+
else if (y < center - hysteresis) {
|
|
81
89
|
wasBottomRef.current = false;
|
|
82
90
|
}
|
|
83
91
|
}, [y, mapHeight]);
|
|
@@ -103,7 +111,7 @@ var DockableBase = function (props) {
|
|
|
103
111
|
style.left = "".concat(x + offsetX, "px");
|
|
104
112
|
style.top = "".concat(y + offsetY, "px");
|
|
105
113
|
}
|
|
106
|
-
return (React.createElement("div", { "data-testid": props['data-testid'] || "Dockable", style: style, className: "".concat(props.className, " ").concat(offscreen ? 'offscreen' : ''), ref: containerRef }, props.children));
|
|
114
|
+
return (React.createElement("div", { "data-testid": props['data-testid'] || "Dockable", style: __assign(__assign({}, style), props.style), className: "".concat(props.className, " ").concat(offscreen ? 'offscreen' : ''), ref: containerRef }, props.children));
|
|
107
115
|
};
|
|
108
116
|
var DockableStyled = styled(DockableBase)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: white;\n z-index: ", ";\n ", "\n"], ["\n color: white;\n z-index: ", ";\n ", "\n"
|
|
109
117
|
/**
|
|
@@ -122,7 +130,7 @@ var DockableStyled = styled(DockableBase)(templateObject_4 || (templateObject_4
|
|
|
122
130
|
* When a `Dockable` is out of the viewport, it gains the `.offscreen` CSS class.
|
|
123
131
|
*/
|
|
124
132
|
var Dockable = function (_a) {
|
|
125
|
-
var _b = _a.longitude, longitude = _b === void 0 ?
|
|
133
|
+
var _b = _a.longitude, longitude = _b === void 0 ? DEFAULT_LONGITUDE : _b, _c = _a.latitude, latitude = _c === void 0 ? DEFAULT_LATITUDE : _c, _d = _a.offsetX, offsetX = _d === void 0 ? DEFAULT_OFFSET_X : _d, _e = _a.offsetY, offsetY = _e === void 0 ? DEFAULT_OFFSET_Y : _e, _f = _a.swappable, swappable = _f === void 0 ? 'none' : _f, _g = _a.alwaysDocked, alwaysDocked = _g === void 0 ? false : _g, _h = _a.zIndex, zIndex = _h === void 0 ? 0 : _h, _j = _a.hysteresis, hysteresis = _j === void 0 ? DEFAULT_HYSTERESIS : _j, props = __rest(_a, ["longitude", "latitude", "offsetX", "offsetY", "swappable", "alwaysDocked", "zIndex", "hysteresis"]);
|
|
126
134
|
return React.createElement(DockableStyled, __assign({ longitude: longitude, latitude: latitude, offsetX: offsetX, offsetY: offsetY, swappable: swappable, alwaysDocked: alwaysDocked, zIndex: zIndex, hysteresis: hysteresis }, props));
|
|
127
135
|
};
|
|
128
136
|
Dockable.displayName = 'Dockable';
|
|
@@ -25,6 +25,11 @@ interface IDragBarProps extends ITestable {
|
|
|
25
25
|
* @default smooth
|
|
26
26
|
*/
|
|
27
27
|
behavior?: ScrollBehavior;
|
|
28
|
+
/**
|
|
29
|
+
* Optional inline styles applied to the outer element, for one-off overrides
|
|
30
|
+
* of the default styling.
|
|
31
|
+
*/
|
|
32
|
+
style?: React.CSSProperties;
|
|
28
33
|
}
|
|
29
34
|
/**
|
|
30
35
|
* A `DragBar` presents its content in a horizontally scrollable container,
|
|
@@ -28,6 +28,10 @@ import * as React from 'react';
|
|
|
28
28
|
import styled from 'styled-components';
|
|
29
29
|
import { Icon } from '../../controls/Icon';
|
|
30
30
|
import { SVG } from '../../svg';
|
|
31
|
+
// Default prop value, referenced both by the DragBarBase fallback and the
|
|
32
|
+
// DragBar wrapper below.
|
|
33
|
+
var DEFAULT_HEIGHT = 40;
|
|
34
|
+
var DEFAULT_NAVIGATION_DELTA = 100;
|
|
31
35
|
var DragBarBase = function (props) {
|
|
32
36
|
var scrollerRef = React.useRef(null);
|
|
33
37
|
var posRef = React.useRef({ top: 0, left: 0, x: 0, y: 0 });
|
|
@@ -35,9 +39,12 @@ var DragBarBase = function (props) {
|
|
|
35
39
|
// Mouse-up event removes itself and move-event when mouse is released:
|
|
36
40
|
document.removeEventListener('mousemove', handleMouseMove);
|
|
37
41
|
document.removeEventListener('mouseup', handleMouseUp);
|
|
38
|
-
scrollerRef.current
|
|
42
|
+
if (scrollerRef.current)
|
|
43
|
+
scrollerRef.current.style.cursor = 'auto';
|
|
39
44
|
};
|
|
40
45
|
var handleMouseMove = function (e) {
|
|
46
|
+
if (!scrollerRef.current)
|
|
47
|
+
return;
|
|
41
48
|
// How far the mouse has been moved
|
|
42
49
|
var dx = e.clientX - posRef.current.x;
|
|
43
50
|
var dy = e.clientY - posRef.current.y;
|
|
@@ -46,6 +53,8 @@ var DragBarBase = function (props) {
|
|
|
46
53
|
scrollerRef.current.scrollLeft = posRef.current.left - dx;
|
|
47
54
|
};
|
|
48
55
|
var handleMouseDown = function (e) {
|
|
56
|
+
if (!scrollerRef.current)
|
|
57
|
+
return;
|
|
49
58
|
posRef.current = {
|
|
50
59
|
// The current scroll
|
|
51
60
|
left: scrollerRef.current.scrollLeft,
|
|
@@ -59,6 +68,8 @@ var DragBarBase = function (props) {
|
|
|
59
68
|
document.addEventListener('mouseup', handleMouseUp);
|
|
60
69
|
};
|
|
61
70
|
var handleNavigate = function (delta) {
|
|
71
|
+
if (!scrollerRef.current)
|
|
72
|
+
return;
|
|
62
73
|
scrollerRef.current.scrollBy({
|
|
63
74
|
left: delta,
|
|
64
75
|
behavior: props.behavior
|
|
@@ -71,14 +82,14 @@ var DragBarBase = function (props) {
|
|
|
71
82
|
behavior: props.behavior
|
|
72
83
|
});
|
|
73
84
|
};
|
|
74
|
-
return (React.createElement("div", { "data-testid": props['data-testid'] || "DragBar", className: props.className },
|
|
75
|
-
props.navigation && React.createElement(NavButton, { onClick: function () { return handleNavigate(-props.navigationDelta); } },
|
|
85
|
+
return (React.createElement("div", { "data-testid": props['data-testid'] || "DragBar", className: props.className, style: props.style },
|
|
86
|
+
props.navigation && React.createElement(NavButton, { onClick: function () { var _a; return handleNavigate(-((_a = props.navigationDelta) !== null && _a !== void 0 ? _a : DEFAULT_NAVIGATION_DELTA)); } },
|
|
76
87
|
React.createElement(Icon, { url: SVG.Icons.Chevron })),
|
|
77
88
|
React.createElement(Scroller, { onMouseDown: handleMouseDown, ref: scrollerRef },
|
|
78
89
|
React.createElement(Content, null, React.Children.map(props.children, function (c) {
|
|
79
90
|
return React.createElement(Item, { onClick: handleClickItem }, React.cloneElement(c));
|
|
80
91
|
}))),
|
|
81
|
-
props.navigation && React.createElement(NavButton, { onClick: function () { return handleNavigate(props.navigationDelta); } },
|
|
92
|
+
props.navigation && React.createElement(NavButton, { onClick: function () { var _a; return handleNavigate((_a = props.navigationDelta) !== null && _a !== void 0 ? _a : DEFAULT_NAVIGATION_DELTA); } },
|
|
82
93
|
React.createElement(Icon, { rotated: 180, url: SVG.Icons.Chevron }))));
|
|
83
94
|
};
|
|
84
95
|
var Item = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 100%;\n"], ["\n height: 100%;\n"])));
|
|
@@ -112,7 +123,7 @@ var DragBarStyled = styled(DragBarBase)(templateObject_5 || (templateObject_5 =
|
|
|
112
123
|
* set in pixels.
|
|
113
124
|
*/
|
|
114
125
|
var DragBar = function (_a) {
|
|
115
|
-
var _b = _a.height, height = _b === void 0 ?
|
|
126
|
+
var _b = _a.height, height = _b === void 0 ? DEFAULT_HEIGHT : _b, _c = _a.navigation, navigation = _c === void 0 ? false : _c, _d = _a.navigationDelta, navigationDelta = _d === void 0 ? DEFAULT_NAVIGATION_DELTA : _d, _e = _a.behavior, behavior = _e === void 0 ? 'smooth' : _e, props = __rest(_a, ["height", "navigation", "navigationDelta", "behavior"]);
|
|
116
127
|
return React.createElement(DragBarStyled, __assign({ height: height, navigation: navigation, navigationDelta: navigationDelta, behavior: behavior }, props));
|
|
117
128
|
};
|
|
118
129
|
DragBar.displayName = "DragBar";
|
|
@@ -92,9 +92,6 @@ interface IFieldProps {
|
|
|
92
92
|
* provides a `dirty` prop to the Field. When the Form is dirty, so are its
|
|
93
93
|
* fields, and any validation errors are shown, pristine or not.
|
|
94
94
|
*
|
|
95
|
-
* For dark backgrounds, fields may set their contrast prop to true to use
|
|
96
|
-
* lighter error colors.
|
|
97
|
-
*
|
|
98
95
|
* Fields have a `label` and a `hint`. Both are optional. These elements are
|
|
99
96
|
* displayed in different ways based on the field's `wrapper`. Unwrapped Fields
|
|
100
97
|
* do not display label or hint. Other wrappers are `simple` and `box`.
|
package/containers/Form/Field.js
CHANGED
|
@@ -33,16 +33,13 @@ import { useForm } from './context/useForm';
|
|
|
33
33
|
* provides a `dirty` prop to the Field. When the Form is dirty, so are its
|
|
34
34
|
* fields, and any validation errors are shown, pristine or not.
|
|
35
35
|
*
|
|
36
|
-
* For dark backgrounds, fields may set their contrast prop to true to use
|
|
37
|
-
* lighter error colors.
|
|
38
|
-
*
|
|
39
36
|
* Fields have a `label` and a `hint`. Both are optional. These elements are
|
|
40
37
|
* displayed in different ways based on the field's `wrapper`. Unwrapped Fields
|
|
41
38
|
* do not display label or hint. Other wrappers are `simple` and `box`.
|
|
42
39
|
*/
|
|
43
40
|
var Field = function (props) {
|
|
44
41
|
var form = useForm();
|
|
45
|
-
var ghost = props.ghost || (form && form.ghost);
|
|
42
|
+
var ghost = !!(props.ghost || (form && form.ghost));
|
|
46
43
|
var _a = React.useState(true), pristine = _a[0], setPristine = _a[1];
|
|
47
44
|
// Current validation. onValidate is only called when validation state changes.
|
|
48
45
|
// Perform validation immediately:
|
|
@@ -105,7 +102,7 @@ var Field = function (props) {
|
|
|
105
102
|
if (rules.before && !rules.before.message)
|
|
106
103
|
rules.before.message = "Date must be before ".concat(rules.before.date, ".");
|
|
107
104
|
if (rules.after && !rules.after.message)
|
|
108
|
-
rules.after.message = "Date must be
|
|
105
|
+
rules.after.message = "Date must be after ".concat(rules.after.date, ".");
|
|
109
106
|
}, [props.rules]);
|
|
110
107
|
//
|
|
111
108
|
// Perform validation when field value changes.
|
|
@@ -152,7 +149,7 @@ var Field = function (props) {
|
|
|
152
149
|
return React.createElement(Hint, null, props.hint);
|
|
153
150
|
return null;
|
|
154
151
|
};
|
|
155
|
-
var dirty = form ? form.dirty : !pristine;
|
|
152
|
+
var dirty = form ? !!form.dirty : !pristine;
|
|
156
153
|
var hasError = (!pristine || dirty) && validation != null;
|
|
157
154
|
switch (props.wrapper) {
|
|
158
155
|
case 'simple':
|
package/containers/Form/Form.js
CHANGED
|
@@ -28,33 +28,11 @@ var Form = function (props) {
|
|
|
28
28
|
// change then.
|
|
29
29
|
var _a = React.useState(true), valid = _a[0], setValid = _a[1];
|
|
30
30
|
var handleChange = function (name, value, forceupdate) {
|
|
31
|
-
|
|
32
|
-
//
|
|
33
|
-
|
|
34
|
-
//
|
|
35
|
-
|
|
36
|
-
// * fields[1] = "name"
|
|
37
|
-
// Start off at the main data object:
|
|
38
|
-
var current = {};
|
|
39
|
-
// Loop through fields:
|
|
40
|
-
fields.forEach(function (field) {
|
|
41
|
-
// If field has brackets, then set current to
|
|
42
|
-
// object that the array index points to:
|
|
43
|
-
var bracketIdx = field.indexOf('[');
|
|
44
|
-
if (bracketIdx != -1) {
|
|
45
|
-
var fieldName = field.substring(0, bracketIdx);
|
|
46
|
-
var index = parseInt(field.substring(bracketIdx + 1, field.length - 1));
|
|
47
|
-
current = current[fieldName][index];
|
|
48
|
-
}
|
|
49
|
-
// If there are no brackets (which would be the
|
|
50
|
-
// case for the last field) then assign the new
|
|
51
|
-
// value to current.
|
|
52
|
-
else {
|
|
53
|
-
current[field] = value;
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
// Inform parent of data change:
|
|
57
|
-
props.onChange(current, forceupdate);
|
|
31
|
+
var _a;
|
|
32
|
+
// Field names are flat keys. The change is emitted as a partial object
|
|
33
|
+
// ({ [name]: value }) which the parent merges into its form data (see the
|
|
34
|
+
// onChange contract). Nested/array field names are not supported.
|
|
35
|
+
props.onChange((_a = {}, _a[name] = value, _a), forceupdate);
|
|
58
36
|
};
|
|
59
37
|
var handleValidate = function (name, _valid) {
|
|
60
38
|
validations.current.set(name, _valid);
|
|
@@ -69,15 +47,6 @@ var Form = function (props) {
|
|
|
69
47
|
props.onValidate(isValid);
|
|
70
48
|
}
|
|
71
49
|
};
|
|
72
|
-
// Test code to show currently-focused element:
|
|
73
|
-
/*
|
|
74
|
-
const showActive = () => {
|
|
75
|
-
console.log(document.activeElement);
|
|
76
|
-
setTimeout(() => {
|
|
77
|
-
showActive();
|
|
78
|
-
}, 1000);
|
|
79
|
-
}
|
|
80
|
-
setTimeout(() => { showActive(); }, 1000); */
|
|
81
50
|
return (React.createElement(FormContext.Provider, { value: {
|
|
82
51
|
onChange: handleChange,
|
|
83
52
|
onValidate: handleValidate,
|
|
@@ -207,6 +207,6 @@ declare class Validation {
|
|
|
207
207
|
* Verify that value is after date.
|
|
208
208
|
*/
|
|
209
209
|
private static validateAfter;
|
|
210
|
-
static getValidation: (value: any, rules
|
|
210
|
+
static getValidation: (value: any, rules?: IValidationProps) => React.ReactNode;
|
|
211
211
|
}
|
|
212
212
|
export { IValidationProps, Validation };
|
|
@@ -19,7 +19,7 @@ var Validation = /** @class */ (function () {
|
|
|
19
19
|
* Verify that value is an integer number.
|
|
20
20
|
*/
|
|
21
21
|
Validation.validateInt = function (value) {
|
|
22
|
-
if (
|
|
22
|
+
if (value == null || value === '')
|
|
23
23
|
return true;
|
|
24
24
|
var regex = /^[-+]?[0-9]+$/;
|
|
25
25
|
return regex.test(value);
|
|
@@ -31,7 +31,7 @@ var Validation = /** @class */ (function () {
|
|
|
31
31
|
*/
|
|
32
32
|
Validation.validateFloat = function (value, separator) {
|
|
33
33
|
if (separator === void 0) { separator = '.'; }
|
|
34
|
-
if (
|
|
34
|
+
if (value == null || value === '')
|
|
35
35
|
return true;
|
|
36
36
|
var regex = new RegExp("^[-+]?[0-9]+(\\".concat(separator, "[0-9]+)?$"));
|
|
37
37
|
return regex.test(value);
|
|
@@ -40,7 +40,7 @@ var Validation = /** @class */ (function () {
|
|
|
40
40
|
* Verify that value has a minimum numerical value.
|
|
41
41
|
*/
|
|
42
42
|
Validation.validateMin = function (value, min) {
|
|
43
|
-
if (
|
|
43
|
+
if (value == null || value === '')
|
|
44
44
|
return true;
|
|
45
45
|
return parseInt(value) >= min;
|
|
46
46
|
};
|
|
@@ -48,7 +48,7 @@ var Validation = /** @class */ (function () {
|
|
|
48
48
|
* Verify that value has a maximum numerical value.
|
|
49
49
|
*/
|
|
50
50
|
Validation.validateMax = function (value, max) {
|
|
51
|
-
if (
|
|
51
|
+
if (value == null || value === '')
|
|
52
52
|
return true;
|
|
53
53
|
return parseInt(value) <= max;
|
|
54
54
|
};
|
|
@@ -56,7 +56,7 @@ var Validation = /** @class */ (function () {
|
|
|
56
56
|
* Verify that value falls in a numerical range (inclusive).
|
|
57
57
|
*/
|
|
58
58
|
Validation.validateBetween = function (value, min, max) {
|
|
59
|
-
if (
|
|
59
|
+
if (value == null || value === '')
|
|
60
60
|
return true;
|
|
61
61
|
var num = parseInt(value);
|
|
62
62
|
return num >= min && num <= max;
|
|
@@ -223,7 +223,7 @@ var Validation = /** @class */ (function () {
|
|
|
223
223
|
return rules.before.message;
|
|
224
224
|
}
|
|
225
225
|
if (rules.after != null) {
|
|
226
|
-
if (!Validation.
|
|
226
|
+
if (!Validation.validateAfter(value, rules.after.date))
|
|
227
227
|
return rules.after.message;
|
|
228
228
|
}
|
|
229
229
|
return null;
|
|
@@ -4,7 +4,6 @@ interface IFormContext {
|
|
|
4
4
|
onValidate: (name: string, valid: boolean) => void;
|
|
5
5
|
dirty?: boolean;
|
|
6
6
|
ghost?: boolean;
|
|
7
|
-
data?: any;
|
|
8
7
|
}
|
|
9
|
-
declare const FormContext: React.Context<IFormContext>;
|
|
8
|
+
declare const FormContext: React.Context<IFormContext | null>;
|
|
10
9
|
export { IFormContext, FormContext };
|
|
@@ -19,6 +19,8 @@ var BoxWrapperBase = function (props) {
|
|
|
19
19
|
// To do so, it looks for the first child control with tabIndex=0.
|
|
20
20
|
//
|
|
21
21
|
var handleClick = function (e) {
|
|
22
|
+
if (!wrapper.current)
|
|
23
|
+
return;
|
|
22
24
|
// Find a child element with tabIndex set, and focus/click it.
|
|
23
25
|
var clickableChild = wrapper.current.querySelectorAll("[tabIndex='0']")[0];
|
|
24
26
|
if (clickableChild instanceof HTMLElement) {
|
|
@@ -11,10 +11,15 @@ interface IGlassPaneProps extends ITestable {
|
|
|
11
11
|
*/
|
|
12
12
|
bordered?: boolean;
|
|
13
13
|
/**
|
|
14
|
-
* If set, adds
|
|
14
|
+
* If set, adds 15px of inner padding to the pane.
|
|
15
15
|
* @default false
|
|
16
16
|
*/
|
|
17
17
|
padded?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Optional inline styles applied to the outer element, for one-off overrides
|
|
20
|
+
* of the default styling.
|
|
21
|
+
*/
|
|
22
|
+
style?: React.CSSProperties;
|
|
18
23
|
/**
|
|
19
24
|
* If true, fades in and blurs smoothly on mount via a CSS transition.
|
|
20
25
|
* @default false
|
|
@@ -31,7 +36,7 @@ interface IGlassPaneProps extends ITestable {
|
|
|
31
36
|
*
|
|
32
37
|
* ### Props
|
|
33
38
|
* - `bordered`: Adds a shiny border.
|
|
34
|
-
* - `padded`: Adds
|
|
39
|
+
* - `padded`: Adds 15px of inner padding.
|
|
35
40
|
* - `animated`: Animates on mount.
|
|
36
41
|
*
|
|
37
42
|
* By default, there is no internal padding (though some can be added with `padded`). The panel's
|
|
@@ -42,7 +42,7 @@ var GlassPaneBase = React.memo(function (props) {
|
|
|
42
42
|
return function () { };
|
|
43
43
|
}
|
|
44
44
|
}, [props.animated]);
|
|
45
|
-
return (React.createElement("div", { "data-testid": props['data-testid'] || "GlassPane", className: "".concat(props.className, " ").concat(mounted ? 'mounted' : '') }, props.children));
|
|
45
|
+
return (React.createElement("div", { "data-testid": props['data-testid'] || "GlassPane", className: "".concat(props.className, " ").concat(mounted ? 'mounted' : ''), style: props.style }, props.children));
|
|
46
46
|
});
|
|
47
47
|
var GRADIENT_0 = "rgb(255,255,255,0.6)";
|
|
48
48
|
var GRADIENT_1 = "rgb(255,255,255,0.3)";
|
|
@@ -57,7 +57,7 @@ var GlassPaneStyled = styled(GlassPaneBase)(templateObject_2 || (templateObject_
|
|
|
57
57
|
*
|
|
58
58
|
* ### Props
|
|
59
59
|
* - `bordered`: Adds a shiny border.
|
|
60
|
-
* - `padded`: Adds
|
|
60
|
+
* - `padded`: Adds 15px of inner padding.
|
|
61
61
|
* - `animated`: Animates on mount.
|
|
62
62
|
*
|
|
63
63
|
* By default, there is no internal padding (though some can be added with `padded`). The panel's
|
|
@@ -79,7 +79,7 @@ var GlassPaneStyled = styled(GlassPaneBase)(templateObject_2 || (templateObject_
|
|
|
79
79
|
*
|
|
80
80
|
* ### Props
|
|
81
81
|
* - `bordered`: Adds a shiny border.
|
|
82
|
-
* - `padded`: Adds
|
|
82
|
+
* - `padded`: Adds 15px of inner padding.
|
|
83
83
|
* - `animated`: Animates on mount.
|
|
84
84
|
*
|
|
85
85
|
* By default, there is no internal padding (though some can be added with `padded`). The panel's
|
|
@@ -37,6 +37,11 @@ interface IInfoBoxProps extends ITestable {
|
|
|
37
37
|
* @default false
|
|
38
38
|
*/
|
|
39
39
|
scroll?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Optional inline styles applied to the outer element, for one-off overrides
|
|
42
|
+
* of the default styling.
|
|
43
|
+
*/
|
|
44
|
+
style?: React.CSSProperties;
|
|
40
45
|
}
|
|
41
46
|
/**
|
|
42
47
|
* `InfoBox` is a layout container that presents structured content inside a
|
|
@@ -33,7 +33,7 @@ import { InfoBoxRow } from './elements/Row';
|
|
|
33
33
|
* An `InfoBox` is a glass pane with an optional header and footer.
|
|
34
34
|
*/
|
|
35
35
|
var InfoBoxBase = function (props) {
|
|
36
|
-
return React.createElement("div", { "data-testid": props['data-testid'] || "InfoBox", className: props.className, role: "region", "aria-label": "Information" },
|
|
36
|
+
return React.createElement("div", { "data-testid": props['data-testid'] || "InfoBox", className: props.className, style: props.style, role: "region", "aria-label": "Information" },
|
|
37
37
|
React.createElement(Content, { header: props.header, padded: props.padded, minHeight: props.minHeight, scroll: props.scroll }, props.children),
|
|
38
38
|
props.footer && React.createElement(Footer, null, props.footer));
|
|
39
39
|
};
|
|
@@ -30,6 +30,11 @@ interface IListProps extends ITestable {
|
|
|
30
30
|
* If set, list items are extra tall.
|
|
31
31
|
*/
|
|
32
32
|
tall?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Optional inline styles applied to the outer element, for one-off overrides
|
|
35
|
+
* of the default styling.
|
|
36
|
+
*/
|
|
37
|
+
style?: React.CSSProperties;
|
|
33
38
|
}
|
|
34
39
|
/**
|
|
35
40
|
* A List presents a series of `ListRow` elements, each containing `ListCell`
|
package/containers/List/List.js
CHANGED
|
@@ -19,7 +19,7 @@ import { Input } from '../../inputs/Input';
|
|
|
19
19
|
* other code, using the ref, can scroll list items into view.
|
|
20
20
|
*/
|
|
21
21
|
var List = React.forwardRef(function (props, ref) {
|
|
22
|
-
return React.createElement(ListStyled, { "data-testid": props['data-testid'] || "List", className: props.className, tabIndex: -1, "$count": React.Children.count(props.children), "$maxItems": props.maxItems, "$contract": props.contract, "$tall": props.tall },
|
|
22
|
+
return React.createElement(ListStyled, { "data-testid": props['data-testid'] || "List", className: props.className, style: props.style, tabIndex: -1, "$count": React.Children.count(props.children), "$maxItems": props.maxItems, "$contract": props.contract, "$tall": props.tall },
|
|
23
23
|
props.onSearch &&
|
|
24
24
|
React.createElement(SearchBox, { onClick: function (e) { return e.stopPropagation(); } },
|
|
25
25
|
React.createElement(Input, { icon: SVG.Icons.Search, placeholder: props.placeholder, clearable: true, value: props.search, transparent: true, fluid: true, type: "text", onChange: props.onSearch })),
|
|
@@ -9,6 +9,11 @@ interface IProps extends ITestable {
|
|
|
9
9
|
width?: number | string;
|
|
10
10
|
/** Text alignment. Defaults to 'left'. */
|
|
11
11
|
align?: 'left' | 'right';
|
|
12
|
+
/**
|
|
13
|
+
* Optional inline styles applied to the outer element, for one-off overrides
|
|
14
|
+
* of the default styling.
|
|
15
|
+
*/
|
|
16
|
+
style?: React.CSSProperties;
|
|
12
17
|
}
|
|
13
18
|
declare const ListCell: {
|
|
14
19
|
(props: IProps): React.JSX.Element;
|
|
@@ -16,7 +16,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
16
16
|
import * as React from 'react';
|
|
17
17
|
import styled, { css } from 'styled-components';
|
|
18
18
|
var ListCellBase = function (props) {
|
|
19
|
-
return React.createElement("div", { "data-testid": props['data-testid'] || "ListCell", className: props.className }, props.children);
|
|
19
|
+
return React.createElement("div", { "data-testid": props['data-testid'] || "ListCell", className: props.className, style: props.style }, props.children);
|
|
20
20
|
};
|
|
21
21
|
var ListCellStyled = styled(ListCellBase)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n ", ";\n ", ";\n ", "\n\n // Content alignment:\n text-align: ", ";\n\n // Text is truncated with an ellipsis\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n"], ["\n ", ";\n ", ";\n ", "\n\n // Content alignment:\n text-align: ", ";\n\n // Text is truncated with an ellipsis\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n"])), function (p) { return p.width && typeof p.width === 'string' && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["width: ", ";"], ["width: ", ";"])), p.width); }, function (p) { return p.width && typeof p.width !== 'string' && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["flex: ", ";"], ["flex: ", ";"])), p.width); }, function (p) { return !p.width && css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["flex: 1;"], ["flex: 1;"]))); }, function (p) { return p.align === 'right' ? 'right' : 'left'; });
|
|
22
22
|
var ListCell = function (props) { return React.createElement(ListCellStyled, __assign({}, props)); };
|
|
@@ -14,8 +14,13 @@ interface IProps extends ITestable {
|
|
|
14
14
|
* color.
|
|
15
15
|
*/
|
|
16
16
|
disabled?: boolean;
|
|
17
|
-
/** Triggered when row is clicked. */
|
|
18
|
-
onClick?: (e
|
|
17
|
+
/** Triggered when row is clicked. Receives the originating mouse event. */
|
|
18
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Optional inline styles applied to the outer element, for one-off overrides
|
|
21
|
+
* of the default styling.
|
|
22
|
+
*/
|
|
23
|
+
style?: React.CSSProperties;
|
|
19
24
|
}
|
|
20
25
|
declare const ListRow: {
|
|
21
26
|
(props: IProps): React.JSX.Element;
|
|
@@ -16,7 +16,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
16
16
|
import * as React from 'react';
|
|
17
17
|
import styled, { css } from 'styled-components';
|
|
18
18
|
var ListRowBase = function (props) {
|
|
19
|
-
return React.createElement("div", { "data-testid": props['data-testid'] || "ListRow", className: props.className, onClick: props.disabled ?
|
|
19
|
+
return React.createElement("div", { "data-testid": props['data-testid'] || "ListRow", className: props.className, style: props.style, onClick: props.disabled ? undefined : function (e) { var _a; return (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, e); } }, props.children);
|
|
20
20
|
};
|
|
21
21
|
var ListRowStyled = styled(ListRowBase)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n padding-left: 16px;\n padding-right: 16px;\n min-height: 42px;\n user-select: none;\n outline: none;\n color: ", ";\n\n // Entire row is clickable:\n cursor: ", ";\n\n // Cells are flex-aligned:\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n align-items: center;\n gap: ", "px;\n\n // Background color on hover:\n ", "\n\n ", "\n"], ["\n padding-left: 16px;\n padding-right: 16px;\n min-height: 42px;\n user-select: none;\n outline: none;\n color: ", ";\n\n // Entire row is clickable:\n cursor: ", ";\n\n // Cells are flex-aligned:\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n align-items: center;\n gap: ", "px;\n\n // Background color on hover:\n ", "\n\n ", "\n"])), function (p) { return p.theme.colors.neutral[30]; }, function (p) { return (p.onClick && !p.disabled) ? 'pointer' : 'auto'; }, function (p) { return p.gap; }, function (p) { return !p.disabled && css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n &:hover {\n background-color: ", ";\n }\n\n // Background color on pressed:\n ", "\n\n ", "\n "], ["\n &:hover {\n background-color: ", ";\n }\n\n // Background color on pressed:\n ", "\n\n ", "\n "])), function (p) { return p.theme.colors.neutral[95]; }, p.onClick && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &:active {\n background-color: rgb(from ", " r g b / 65%) !important;\n color: ", ";\n }\n "], ["\n &:active {\n background-color: rgb(from ", " r g b / 65%) !important;\n color: ", ";\n }\n "])), function (p) { return p.theme.colors.primary[2]; }, function (p) { return p.theme.colors.neutral[100]; }), p.active && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: rgb(from ", " r g b / 45%) !important;\n color: ", ";\n "], ["\n background-color: rgb(from ", " r g b / 45%) !important;\n color: ", ";\n "])), function (p) { return p.theme.colors.primary[2]; }, function (p) { return p.theme.colors.neutral[100]; })); }, function (p) { return p.disabled && css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), function (p) { return p.theme.colors.neutral[50]; }); });
|
|
22
22
|
var ListRow = function (props) { return React.createElement(ListRowStyled, __assign({}, props)); };
|