@longline/aqua-ui 1.0.339 → 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 +3 -3
- 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/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 +5 -0
- package/inputs/PhoneInput/PhoneInput.js +2 -2
- 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
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
interface ISpeechRecognizerProps {
|
|
3
|
+
/**
|
|
4
|
+
* BCP 47 language tag used for recognition, e.g. `en-US` or `nl-NL`.
|
|
5
|
+
* @default en-US
|
|
6
|
+
*/
|
|
7
|
+
lang?: string;
|
|
8
|
+
}
|
|
2
9
|
/**
|
|
3
10
|
* A floating action button that enables speech-to-text input.
|
|
4
11
|
*
|
|
@@ -27,7 +34,8 @@ import * as React from 'react';
|
|
|
27
34
|
* Supported in Chrome, Edge, and Safari. Not supported in Firefox.
|
|
28
35
|
*/
|
|
29
36
|
declare const SpeechRecognizer: {
|
|
30
|
-
(): React.JSX.Element;
|
|
37
|
+
(props: ISpeechRecognizerProps): React.JSX.Element | null;
|
|
31
38
|
displayName: string;
|
|
32
39
|
};
|
|
33
40
|
export { SpeechRecognizer };
|
|
41
|
+
export type { ISpeechRecognizerProps };
|
|
@@ -2,7 +2,9 @@ import * as React from 'react';
|
|
|
2
2
|
import { Fab } from '../Fab';
|
|
3
3
|
import { SVG } from '../../svg';
|
|
4
4
|
import { EditorRegistry } from './EditorRegistry';
|
|
5
|
-
var SpeechRecognition = window
|
|
5
|
+
var SpeechRecognition = typeof window !== 'undefined'
|
|
6
|
+
? (window.SpeechRecognition || window.webkitSpeechRecognition)
|
|
7
|
+
: undefined;
|
|
6
8
|
/**
|
|
7
9
|
* A floating action button that enables speech-to-text input.
|
|
8
10
|
*
|
|
@@ -30,7 +32,7 @@ var SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecogniti
|
|
|
30
32
|
* Requires `SpeechRecognition` or `webkitSpeechRecognition` API.
|
|
31
33
|
* Supported in Chrome, Edge, and Safari. Not supported in Firefox.
|
|
32
34
|
*/
|
|
33
|
-
var SpeechRecognizer = function () {
|
|
35
|
+
var SpeechRecognizer = function (props) {
|
|
34
36
|
var _a = React.useState(false), listening = _a[0], setListening = _a[1];
|
|
35
37
|
var recognitionRef = React.useRef(null);
|
|
36
38
|
var focusedElementRef = React.useRef(null);
|
|
@@ -69,20 +71,24 @@ var SpeechRecognizer = function () {
|
|
|
69
71
|
setListening(false);
|
|
70
72
|
};
|
|
71
73
|
React.useEffect(function () {
|
|
74
|
+
var _a;
|
|
72
75
|
// Initialize speech recognition
|
|
73
76
|
if (!SpeechRecognition) {
|
|
74
77
|
console.warn('SpeechRecognition API not supported in this browser.');
|
|
75
|
-
return;
|
|
78
|
+
return undefined;
|
|
76
79
|
}
|
|
77
80
|
var recognition = new SpeechRecognition();
|
|
78
81
|
recognition.interimResults = true;
|
|
79
82
|
recognition.continuous = true;
|
|
80
|
-
recognition.lang = 'en-US';
|
|
83
|
+
recognition.lang = (_a = props.lang) !== null && _a !== void 0 ? _a : 'en-US';
|
|
81
84
|
recognition.onresult = handleResult;
|
|
82
85
|
recognition.onend = handleEnd;
|
|
83
|
-
|
|
86
|
+
// Reset the listening state on error, otherwise the UI can stay stuck
|
|
87
|
+
// showing "Listening" after a network / no-speech / not-allowed error.
|
|
88
|
+
recognition.onerror = function () { setListening(false); };
|
|
84
89
|
recognitionRef.current = recognition;
|
|
85
|
-
|
|
90
|
+
return function () { recognition.abort(); };
|
|
91
|
+
}, [props.lang]);
|
|
86
92
|
React.useEffect(function () {
|
|
87
93
|
if (listening && recognitionRef.current) {
|
|
88
94
|
try {
|
|
@@ -100,9 +106,10 @@ var SpeechRecognizer = function () {
|
|
|
100
106
|
// Track focused input, textarea or Editor.
|
|
101
107
|
React.useEffect(function () {
|
|
102
108
|
var handleFocus = function (e) {
|
|
109
|
+
var _a;
|
|
103
110
|
if (e.target instanceof HTMLInputElement ||
|
|
104
111
|
e.target instanceof HTMLTextAreaElement ||
|
|
105
|
-
(e.target instanceof HTMLDivElement && e.target.
|
|
112
|
+
(e.target instanceof HTMLDivElement && e.target.isContentEditable)) {
|
|
106
113
|
var el = e.target;
|
|
107
114
|
focusedElementRef.current = el;
|
|
108
115
|
initialRef.current = true;
|
|
@@ -114,7 +121,7 @@ var SpeechRecognizer = function () {
|
|
|
114
121
|
}
|
|
115
122
|
// Abort recognition in progress.
|
|
116
123
|
try {
|
|
117
|
-
recognitionRef.current.abort();
|
|
124
|
+
(_a = recognitionRef.current) === null || _a === void 0 ? void 0 : _a.abort();
|
|
118
125
|
}
|
|
119
126
|
catch (err) {
|
|
120
127
|
console.warn(err);
|
|
@@ -132,7 +139,7 @@ var SpeechRecognizer = function () {
|
|
|
132
139
|
window.removeEventListener('focusout', handleBlur);
|
|
133
140
|
};
|
|
134
141
|
}, []);
|
|
135
|
-
var handleClick = function (
|
|
142
|
+
var handleClick = function () {
|
|
136
143
|
setListening(function (prev) { return !prev; });
|
|
137
144
|
};
|
|
138
145
|
// If speechrecongition is not supported, don't render button at all,
|
|
@@ -54,6 +54,11 @@ interface ITabBarProps extends ITestable {
|
|
|
54
54
|
* If set, draw a bottom border.
|
|
55
55
|
*/
|
|
56
56
|
line?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Optional inline styles applied to the outer element, for one-off overrides
|
|
59
|
+
* of the default styling.
|
|
60
|
+
*/
|
|
61
|
+
style?: React.CSSProperties;
|
|
57
62
|
}
|
|
58
63
|
/**
|
|
59
64
|
* A horizontal tab navigation bar with animated underline indicator.
|
|
@@ -28,10 +28,13 @@ import * as React from 'react';
|
|
|
28
28
|
import styled, { css } from 'styled-components';
|
|
29
29
|
import { Tab } from './Tab';
|
|
30
30
|
import { Underliner } from './Underliner';
|
|
31
|
+
// Default prop values, referenced both by the TabBarBase fallbacks and the
|
|
32
|
+
// TabBar wrapper below.
|
|
33
|
+
var DEFAULT_ACTIVE = 0;
|
|
31
34
|
var TabBarBase = function (props) {
|
|
32
35
|
var _a;
|
|
33
36
|
// TabBar keeps its own internal "active" index state.
|
|
34
|
-
var _b = React.useState((_a = props.active) !== null && _a !== void 0 ? _a :
|
|
37
|
+
var _b = React.useState((_a = props.active) !== null && _a !== void 0 ? _a : DEFAULT_ACTIVE), active = _b[0], setActive = _b[1];
|
|
35
38
|
var underlinerRef = React.useRef(null);
|
|
36
39
|
var barRef = React.useRef(null);
|
|
37
40
|
var sliderRef = React.useRef(null);
|
|
@@ -54,6 +57,8 @@ var TabBarBase = function (props) {
|
|
|
54
57
|
*/
|
|
55
58
|
var startX = React.useRef(0);
|
|
56
59
|
var handleMouseDown = function (e) {
|
|
60
|
+
if (!sliderRef.current)
|
|
61
|
+
return;
|
|
57
62
|
dragging.current = true;
|
|
58
63
|
wasDragging.current = false; // Reset flag on fresh mouse down
|
|
59
64
|
// We store the current mouse position on the screen,
|
|
@@ -64,6 +69,8 @@ var TabBarBase = function (props) {
|
|
|
64
69
|
var handleMouseMove = function (event) {
|
|
65
70
|
if (!dragging.current)
|
|
66
71
|
return;
|
|
72
|
+
if (!sliderRef.current || !barRef.current)
|
|
73
|
+
return;
|
|
67
74
|
// Use the current mouse position to determine the
|
|
68
75
|
// new scroll position of the slider.
|
|
69
76
|
var dMouse = event.screenX - mouseX.current;
|
|
@@ -80,7 +87,7 @@ var TabBarBase = function (props) {
|
|
|
80
87
|
// Apply new scroll position:
|
|
81
88
|
sliderRef.current.style.left = "".concat(x, "px");
|
|
82
89
|
};
|
|
83
|
-
var handleMouseUp = function (
|
|
90
|
+
var handleMouseUp = function () {
|
|
84
91
|
dragging.current = false;
|
|
85
92
|
setTimeout(function () { wasDragging.current = false; }, 100); // Slight delay to allow click cancel
|
|
86
93
|
};
|
|
@@ -106,7 +113,8 @@ var TabBarBase = function (props) {
|
|
|
106
113
|
// If active prop changes, update internal active tab index.
|
|
107
114
|
//
|
|
108
115
|
React.useEffect(function () {
|
|
109
|
-
|
|
116
|
+
var _a;
|
|
117
|
+
setActive((_a = props.active) !== null && _a !== void 0 ? _a : DEFAULT_ACTIVE);
|
|
110
118
|
}, [props.active]);
|
|
111
119
|
//
|
|
112
120
|
// Use refs to move underliner under active tab.
|
|
@@ -190,8 +198,8 @@ var TabBarBase = function (props) {
|
|
|
190
198
|
setActive(idx);
|
|
191
199
|
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, idx);
|
|
192
200
|
};
|
|
193
|
-
return (React.createElement("div", { "data-testid": props['data-testid'] || "TabBar", className: props.className, ref: barRef, "aria-orientation": "horizontal" },
|
|
194
|
-
React.createElement(Slider, { ref: sliderRef, onMouseDown: handleMouseDown },
|
|
201
|
+
return (React.createElement("div", { "data-testid": props['data-testid'] || "TabBar", className: props.className, style: props.style, ref: barRef, role: "tablist", "aria-orientation": "horizontal" },
|
|
202
|
+
React.createElement(Slider, { ref: sliderRef, role: "presentation", onMouseDown: handleMouseDown },
|
|
195
203
|
React.Children.map(props.children, function (child, idx) {
|
|
196
204
|
return React.cloneElement(child, {
|
|
197
205
|
key: idx,
|
|
@@ -302,7 +310,7 @@ var TabBarStyled = styled(TabBarBase)(templateObject_4 || (templateObject_4 = __
|
|
|
302
310
|
* For tab content panels, use the `Tabs` container instead.
|
|
303
311
|
*/
|
|
304
312
|
var TabBar = function (_a) {
|
|
305
|
-
var _b = _a.active, active = _b === void 0 ?
|
|
313
|
+
var _b = _a.active, active = _b === void 0 ? DEFAULT_ACTIVE : _b, _c = _a.ghost, ghost = _c === void 0 ? false : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, _e = _a.align, align = _e === void 0 ? 'left' : _e, _f = _a.size, size = _f === void 0 ? 'large' : _f, props = __rest(_a, ["active", "ghost", "disabled", "align", "size"]);
|
|
306
314
|
return React.createElement(TabBarStyled, __assign({ active: active, ghost: ghost, disabled: disabled, align: align, size: size }, props));
|
|
307
315
|
};
|
|
308
316
|
TabBar.Tab = Tab;
|
|
@@ -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 UnderlinerBase = React.forwardRef(function (props, ref) {
|
|
19
|
-
return React.createElement("div", { "data-testid": "TabBar.Underliner", className: props.className, ref: ref });
|
|
19
|
+
return React.createElement("div", { "data-testid": "TabBar.Underliner", className: props.className, ref: ref, "aria-hidden": "true" });
|
|
20
20
|
});
|
|
21
21
|
/**
|
|
22
22
|
* Underliner passes a reference to itself back to its parent.
|
|
@@ -12,10 +12,11 @@ interface ITertiaryButtonProps extends ITestable {
|
|
|
12
12
|
*/
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
/**
|
|
15
|
-
* Fired when the button is clicked. The click event is passed along so
|
|
16
|
-
*
|
|
15
|
+
* Fired when the button is clicked. The click event is passed along so it can
|
|
16
|
+
* be inspected or used to stop propagation. Handlers that don't need the event
|
|
17
|
+
* can omit the parameter.
|
|
17
18
|
*/
|
|
18
|
-
onClick: (e
|
|
19
|
+
onClick: (e: React.MouseEvent) => void;
|
|
19
20
|
/**
|
|
20
21
|
* If set, this button will have the primary color.
|
|
21
22
|
* @default false
|
|
@@ -31,6 +32,11 @@ interface ITertiaryButtonProps extends ITestable {
|
|
|
31
32
|
* exists that offers preset paths. This may also be a full `IIconProps`.
|
|
32
33
|
*/
|
|
33
34
|
icon?: string | IIconProps;
|
|
35
|
+
/**
|
|
36
|
+
* Optional inline styles applied to the outer element, for one-off overrides
|
|
37
|
+
* of the default styling.
|
|
38
|
+
*/
|
|
39
|
+
style?: React.CSSProperties;
|
|
34
40
|
}
|
|
35
41
|
/**
|
|
36
42
|
* A lightweight button for contextual actions within components.
|
|
@@ -27,6 +27,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
27
27
|
import * as React from 'react';
|
|
28
28
|
import styled, { css, useTheme } from 'styled-components';
|
|
29
29
|
import { Icon } from '../Icon';
|
|
30
|
+
// Default prop value, referenced both by the styled fallback and the wrapper.
|
|
31
|
+
var DEFAULT_MIN_WIDTH = "92px";
|
|
30
32
|
var TertiaryButtonBase = React.forwardRef(function (props, ref) {
|
|
31
33
|
var theme = useTheme();
|
|
32
34
|
var icon = function () {
|
|
@@ -39,7 +41,7 @@ var TertiaryButtonBase = React.forwardRef(function (props, ref) {
|
|
|
39
41
|
// An IIconProps was provided. Use it as the props for the icon.
|
|
40
42
|
return React.createElement(Icon, __assign({ color: props.primary ? theme.colors.neutral[100] : theme.colors.primary[3] }, props.icon));
|
|
41
43
|
};
|
|
42
|
-
return (React.createElement("button", { "data-testid": props['data-testid'] || "TertiaryButton", ref: ref, className: props.className, type: "button", disabled: props.disabled, onClick: props.onClick },
|
|
44
|
+
return (React.createElement("button", { "data-testid": props['data-testid'] || "TertiaryButton", ref: ref, className: props.className, style: props.style, type: "button", disabled: props.disabled, onClick: props.onClick },
|
|
43
45
|
icon(),
|
|
44
46
|
props.children));
|
|
45
47
|
});
|
|
@@ -78,7 +80,7 @@ var TertiaryButtonStyled = styled(TertiaryButtonBase)(templateObject_3 || (templ
|
|
|
78
80
|
* | `minWidth` | Minimum button width (default: "92px") |
|
|
79
81
|
* | `disabled` | Prevents interaction |
|
|
80
82
|
*/
|
|
81
|
-
])), function (p) { return p.minWidth ?
|
|
83
|
+
])), function (p) { var _a; return (_a = p.minWidth) !== null && _a !== void 0 ? _a : DEFAULT_MIN_WIDTH; }, function (p) { return p.theme.font.labelSmall; }, function (p) { return p.primary ? p.theme.colors.neutral[100] : p.theme.colors.primary[3]; }, function (p) { return p.primary ? p.theme.colors.primary[1] : p.theme.colors.neutral[100]; }, function (p) { return p.theme.radius.normal; }, function (p) { return p.theme.animation.duration; }, function (p) { return p.theme.animation.duration; }, function (p) { return p.theme.shadows.medium; }, function (p) { return p.theme.shadows.large; }, function (p) { return !p.disabled && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n box-shadow: none;\n "], ["\n background-color: ", ";\n box-shadow: none;\n "])), p.primary ? p.theme.colors.primary[2] : p.theme.colors.neutral[95]); }, function (p) { return p.disabled && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n cursor: auto;\n box-shadow: none;\n pointer-events: none;\n "], ["\n background-color: ", ";\n cursor: auto;\n box-shadow: none;\n pointer-events: none;\n "])), p.theme.colors.neutral[50]); });
|
|
82
84
|
/**
|
|
83
85
|
* A lightweight button for contextual actions within components.
|
|
84
86
|
*
|
|
@@ -114,7 +116,7 @@ var TertiaryButtonStyled = styled(TertiaryButtonBase)(templateObject_3 || (templ
|
|
|
114
116
|
* | `disabled` | Prevents interaction |
|
|
115
117
|
*/
|
|
116
118
|
var TertiaryButton = React.forwardRef(function (_a, ref) {
|
|
117
|
-
var _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.minWidth, minWidth = _c === void 0 ?
|
|
119
|
+
var _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.minWidth, minWidth = _c === void 0 ? DEFAULT_MIN_WIDTH : _c, props = __rest(_a, ["disabled", "minWidth"]);
|
|
118
120
|
return React.createElement(TertiaryButtonStyled, __assign({ ref: ref, disabled: disabled, minWidth: minWidth }, props));
|
|
119
121
|
});
|
|
120
122
|
TertiaryButton.displayName = "TertiaryButton";
|
|
@@ -27,9 +27,15 @@ interface IToggleButtonProps extends ITestable {
|
|
|
27
27
|
*/
|
|
28
28
|
url: string;
|
|
29
29
|
/**
|
|
30
|
-
* Fired when the button is clicked.
|
|
30
|
+
* Fired when the button is clicked. The click event is passed along so it can
|
|
31
|
+
* be inspected or used to stop propagation.
|
|
31
32
|
*/
|
|
32
|
-
onClick: (e
|
|
33
|
+
onClick: (e: React.MouseEvent) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Optional inline styles applied to the outer element, for one-off overrides
|
|
36
|
+
* of the default styling.
|
|
37
|
+
*/
|
|
38
|
+
style?: React.CSSProperties;
|
|
33
39
|
}
|
|
34
40
|
/**
|
|
35
41
|
* An icon button that visually indicates on/off or active/inactive state.
|
|
@@ -28,7 +28,7 @@ import * as React from 'react';
|
|
|
28
28
|
import styled, { css } from 'styled-components';
|
|
29
29
|
import { Icon } from '../Icon';
|
|
30
30
|
var ToggleButtonBase = React.forwardRef(function (props, ref) {
|
|
31
|
-
return React.createElement("button", { "data-testid": props['data-testid'] || "ToggleButton", className: props.className, ref: ref, type: "button", onClick: props.onClick, title: props.title, disabled: props.disabled, "aria-pressed": props.active, "aria-expanded": props.open, "aria-disabled": props.disabled },
|
|
31
|
+
return React.createElement("button", { "data-testid": props['data-testid'] || "ToggleButton", className: props.className, style: props.style, ref: ref, type: "button", onClick: props.onClick, title: props.title, disabled: props.disabled, "aria-pressed": props.active, "aria-expanded": props.open, "aria-disabled": props.disabled },
|
|
32
32
|
React.createElement(Icon, { url: props.url }));
|
|
33
33
|
});
|
|
34
34
|
var ToggleButtonStyled = styled(ToggleButtonBase).attrs(function (p) {
|
package/controls/View/View.d.ts
CHANGED
|
@@ -44,6 +44,11 @@ interface IViewProps extends ITestable {
|
|
|
44
44
|
* Badged views don't support label text ellipsizing.
|
|
45
45
|
*/
|
|
46
46
|
badge?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Optional inline styles applied to the outer element, for one-off overrides
|
|
49
|
+
* of the default styling.
|
|
50
|
+
*/
|
|
51
|
+
style?: React.CSSProperties;
|
|
47
52
|
}
|
|
48
53
|
/**
|
|
49
54
|
* A read-only display field for showing labeled data.
|
package/controls/View/View.js
CHANGED
|
@@ -31,7 +31,7 @@ import { ScrollingContent } from './ScrollingContent';
|
|
|
31
31
|
import { EllipsizedContent } from './EllipsizedContent';
|
|
32
32
|
import { Ghost } from '../Ghost';
|
|
33
33
|
var ViewBase = function (props) {
|
|
34
|
-
return React.createElement("div", { "data-testid": props['data-testid'] || "View", className: props.className },
|
|
34
|
+
return React.createElement("div", { "data-testid": props['data-testid'] || "View", className: props.className, style: props.style },
|
|
35
35
|
props.ghost && React.createElement(Ghost, { style: { position: 'absolute', left: 0, top: 0, right: 0, bottom: 0, zIndex: 100 } }),
|
|
36
36
|
React.createElement(Label, null, props.badge ? (React.createElement(BadgeWrapper, null,
|
|
37
37
|
props.label,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
interface ICountryFormatterProps {
|
|
3
3
|
/**
|
|
4
|
-
* The country code (e.g. "FR") or name (e.g. "France") to format.
|
|
4
|
+
* The country code (e.g. "FR") or name (e.g. "France") to format. `null`
|
|
5
|
+
* renders nothing.
|
|
5
6
|
*/
|
|
6
|
-
value: string;
|
|
7
|
+
value: string | null;
|
|
7
8
|
/**
|
|
8
9
|
* The type of output to return. This can be either `flag` (to show a flag),
|
|
9
10
|
* `name` (to show the country name), or `both` (to show both the flag and
|
|
@@ -30,7 +30,7 @@ declare class CountryUtil {
|
|
|
30
30
|
* @param value - Country name or 2-letter ISO code.
|
|
31
31
|
* @returns The matching ISO code, or `null` if ambiguous or not found.
|
|
32
32
|
*/
|
|
33
|
-
static nameToCode: (value: string) => string;
|
|
33
|
+
static nameToCode: (value: string | null) => string | null;
|
|
34
34
|
/**
|
|
35
35
|
* Returns the primary name associated with a given ISO country code.
|
|
36
36
|
*
|
|
@@ -45,7 +45,7 @@ declare class CountryUtil {
|
|
|
45
45
|
* @param locale - Locale code (e.g. "pt"). Defaults to "en".
|
|
46
46
|
* @returns Country name, or `null` if not matched.
|
|
47
47
|
*/
|
|
48
|
-
static getName: (value: string, locale?: string) => string;
|
|
48
|
+
static getName: (value: string | null, locale?: string) => string | null;
|
|
49
49
|
/**
|
|
50
50
|
* Returns the Unicode flag emoji for a given country name or ISO code.
|
|
51
51
|
*
|
|
@@ -54,6 +54,6 @@ declare class CountryUtil {
|
|
|
54
54
|
* @param value - Country name or ISO code.
|
|
55
55
|
* @returns Flag emoji string, or `null` if not matched.
|
|
56
56
|
*/
|
|
57
|
-
static getFlag: (value: string) => string;
|
|
57
|
+
static getFlag: (value: string | null) => string | null;
|
|
58
58
|
}
|
|
59
59
|
export { CountryUtil };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
interface IDateTimeFormatterProps {
|
|
3
3
|
/**
|
|
4
|
-
* Input date. This can either be a `Date` or a `string`, e.g.
|
|
4
|
+
* Input date. This can either be a `Date` or a `string`, e.g.
|
|
5
|
+
* `2025-09-22T10:05:41.074Z`. `null` renders nothing.
|
|
5
6
|
*/
|
|
6
|
-
value: string | Date;
|
|
7
|
+
value: string | Date | null;
|
|
7
8
|
/**
|
|
8
9
|
* Optional `Locale`, e.g. `es`
|
|
9
10
|
*/
|
|
@@ -74,13 +75,13 @@ interface IProps extends IDateTimeFormatterProps, IDateTimeFormatterAnimateProps
|
|
|
74
75
|
*/
|
|
75
76
|
declare const DateTimeFormatter: {
|
|
76
77
|
({ type, ...props }: IProps): React.JSX.Element;
|
|
77
|
-
LongDate: React.MemoExoticComponent<({ value, locale }: IDateTimeFormatterProps) => React.JSX.Element>;
|
|
78
|
-
ShortDate: React.MemoExoticComponent<({ value, locale }: IDateTimeFormatterProps) => React.JSX.Element>;
|
|
79
|
-
LongDateTime: React.MemoExoticComponent<({ value, locale }: IDateTimeFormatterProps) => React.JSX.Element>;
|
|
80
|
-
ShortDateTime: React.MemoExoticComponent<({ value, locale }: IDateTimeFormatterProps) => React.JSX.Element>;
|
|
81
|
-
LongTime: React.MemoExoticComponent<({ value, locale }: IDateTimeFormatterProps) => React.JSX.Element>;
|
|
82
|
-
ShortTime: React.MemoExoticComponent<({ value, locale }: IDateTimeFormatterProps) => React.JSX.Element>;
|
|
83
|
-
DistanceDate: React.MemoExoticComponent<({ value, animated, locale }: IDateTimeFormatterProps & IDateTimeFormatterAnimateProps) => React.JSX.Element>;
|
|
84
|
-
Month: React.MemoExoticComponent<({ value, locale }: IDateTimeFormatterProps) => React.JSX.Element>;
|
|
78
|
+
LongDate: React.MemoExoticComponent<({ value, locale }: IDateTimeFormatterProps) => React.JSX.Element | null>;
|
|
79
|
+
ShortDate: React.MemoExoticComponent<({ value, locale }: IDateTimeFormatterProps) => React.JSX.Element | null>;
|
|
80
|
+
LongDateTime: React.MemoExoticComponent<({ value, locale }: IDateTimeFormatterProps) => React.JSX.Element | null>;
|
|
81
|
+
ShortDateTime: React.MemoExoticComponent<({ value, locale }: IDateTimeFormatterProps) => React.JSX.Element | null>;
|
|
82
|
+
LongTime: React.MemoExoticComponent<({ value, locale }: IDateTimeFormatterProps) => React.JSX.Element | null>;
|
|
83
|
+
ShortTime: React.MemoExoticComponent<({ value, locale }: IDateTimeFormatterProps) => React.JSX.Element | null>;
|
|
84
|
+
DistanceDate: React.MemoExoticComponent<({ value, animated, locale }: IDateTimeFormatterProps & IDateTimeFormatterAnimateProps) => React.JSX.Element | null>;
|
|
85
|
+
Month: React.MemoExoticComponent<({ value, locale }: IDateTimeFormatterProps) => React.JSX.Element | null>;
|
|
85
86
|
};
|
|
86
87
|
export { DateTimeFormatter, IDateTimeFormatterProps, IDateTimeFormatterAnimateProps, IProps };
|
|
@@ -32,5 +32,5 @@ interface IProps {
|
|
|
32
32
|
* }}/>
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
|
-
declare const Custom: React.MemoExoticComponent<({ value, locale, format }: IDateTimeFormatterProps & IProps) => React.JSX.Element>;
|
|
35
|
+
declare const Custom: React.MemoExoticComponent<({ value, locale, format }: IDateTimeFormatterProps & IProps) => React.JSX.Element | null>;
|
|
36
36
|
export { Custom };
|
|
@@ -11,5 +11,5 @@ import { IDateTimeFormatterAnimateProps, IDateTimeFormatterProps } from '../Date
|
|
|
11
11
|
* <DateTimeFormatter.Distance value={someDate} animated strict locale={fr} />
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
|
-
declare const DistanceDate: React.MemoExoticComponent<({ value, animated, locale }: IDateTimeFormatterProps & IDateTimeFormatterAnimateProps) => React.JSX.Element>;
|
|
14
|
+
declare const DistanceDate: React.MemoExoticComponent<({ value, animated, locale }: IDateTimeFormatterProps & IDateTimeFormatterAnimateProps) => React.JSX.Element | null>;
|
|
15
15
|
export { DistanceDate };
|
|
@@ -20,5 +20,5 @@ import { IDateTimeFormatterProps } from '../DateTimeFormatter';
|
|
|
20
20
|
* <DateTimeFormatter.LongDate value="2023-01-01" locale="es" />
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
|
-
declare const LongDate: React.MemoExoticComponent<({ value, locale }: IDateTimeFormatterProps) => React.JSX.Element>;
|
|
23
|
+
declare const LongDate: React.MemoExoticComponent<({ value, locale }: IDateTimeFormatterProps) => React.JSX.Element | null>;
|
|
24
24
|
export { LongDate };
|
|
@@ -23,5 +23,5 @@ import { IDateTimeFormatterProps } from '../DateTimeFormatter';
|
|
|
23
23
|
* <DateTimeFormatter.LongDateTime value="2023-01-01T14:30:45" locale="fr" />
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
|
-
declare const LongDateTime: React.MemoExoticComponent<({ value, locale }: IDateTimeFormatterProps) => React.JSX.Element>;
|
|
26
|
+
declare const LongDateTime: React.MemoExoticComponent<({ value, locale }: IDateTimeFormatterProps) => React.JSX.Element | null>;
|
|
27
27
|
export { LongDateTime };
|
|
@@ -19,5 +19,5 @@ import { IDateTimeFormatterProps } from '../DateTimeFormatter';
|
|
|
19
19
|
* <DateTimeFormatter.LongTime value="2023-01-01T14:30:45" />
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
|
-
declare const LongTime: React.MemoExoticComponent<({ value, locale }: IDateTimeFormatterProps) => React.JSX.Element>;
|
|
22
|
+
declare const LongTime: React.MemoExoticComponent<({ value, locale }: IDateTimeFormatterProps) => React.JSX.Element | null>;
|
|
23
23
|
export { LongTime };
|
|
@@ -22,5 +22,5 @@ import { IDateTimeFormatterProps } from '../DateTimeFormatter';
|
|
|
22
22
|
* <DateTimeFormatter.Month value="2025-05-28" locale="fr" />
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
|
-
declare const Month: React.MemoExoticComponent<({ value, locale }: IDateTimeFormatterProps) => React.JSX.Element>;
|
|
25
|
+
declare const Month: React.MemoExoticComponent<({ value, locale }: IDateTimeFormatterProps) => React.JSX.Element | null>;
|
|
26
26
|
export { Month };
|
|
@@ -22,5 +22,5 @@ import { IDateTimeFormatterProps } from '../DateTimeFormatter';
|
|
|
22
22
|
* <DateTimeFormatter.ShortDate value="2025-05-28" locale="fr" />
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
|
-
declare const ShortDate: React.MemoExoticComponent<({ value, locale }: IDateTimeFormatterProps) => React.JSX.Element>;
|
|
25
|
+
declare const ShortDate: React.MemoExoticComponent<({ value, locale }: IDateTimeFormatterProps) => React.JSX.Element | null>;
|
|
26
26
|
export { ShortDate };
|
|
@@ -21,5 +21,5 @@ import { IDateTimeFormatterProps } from '../DateTimeFormatter';
|
|
|
21
21
|
* <DateTimeFormatter.ShortDateTime value="2025-05-28T14:30:45" locale="fr" />
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
24
|
-
declare const ShortDateTime: React.MemoExoticComponent<({ value, locale }: IDateTimeFormatterProps) => React.JSX.Element>;
|
|
24
|
+
declare const ShortDateTime: React.MemoExoticComponent<({ value, locale }: IDateTimeFormatterProps) => React.JSX.Element | null>;
|
|
25
25
|
export { ShortDateTime };
|
|
@@ -16,5 +16,5 @@ import { IDateTimeFormatterProps } from '../DateTimeFormatter';
|
|
|
16
16
|
* <DateTimeFormatter.ShortTime value="2023-05-28T14:30:00" locale="fr" />
|
|
17
17
|
* ```
|
|
18
18
|
*/
|
|
19
|
-
declare const ShortTime: React.MemoExoticComponent<({ value, locale }: IDateTimeFormatterProps) => React.JSX.Element>;
|
|
19
|
+
declare const ShortTime: React.MemoExoticComponent<({ value, locale }: IDateTimeFormatterProps) => React.JSX.Element | null>;
|
|
20
20
|
export { ShortTime };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
interface IDivisionFormatterProps {
|
|
3
3
|
/**
|
|
4
|
-
* The division code (e.g. "CA-NS") to format.
|
|
4
|
+
* The division code (e.g. "CA-NS") to format. `null` renders nothing.
|
|
5
5
|
*/
|
|
6
|
-
value: string;
|
|
6
|
+
value: string | null;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* Displays the full name of a country subdivision (state, province, region).
|
|
@@ -32,7 +32,7 @@ import { DivisionUtil } from './DivisionUtil';
|
|
|
32
32
|
*/
|
|
33
33
|
var DivisionFormatter = function (_a) {
|
|
34
34
|
var value = _a.value;
|
|
35
|
-
return React.createElement(Name, null, DivisionUtil.getDivisionName(value));
|
|
35
|
+
return React.createElement(Name, null, value == null ? null : DivisionUtil.getDivisionName(value));
|
|
36
36
|
};
|
|
37
37
|
var Name = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n text-overflow: ellipsis;\n overflow: hidden;\n"], ["\n text-overflow: ellipsis;\n overflow: hidden;\n"])));
|
|
38
38
|
DivisionFormatter.displayName = 'DivisionFormatter';
|
|
@@ -14,7 +14,7 @@ declare class DivisionUtil {
|
|
|
14
14
|
* @returns Object with mapping key->name of divisions
|
|
15
15
|
*/
|
|
16
16
|
static getDivisions: (countryCode: string) => IIsoDivisionsMap;
|
|
17
|
-
static getCountryName: (countryCode: string) => string;
|
|
17
|
+
static getCountryName: (countryCode: string) => string | null;
|
|
18
18
|
private static divisionDict;
|
|
19
19
|
static getDivisionName: (divisionCode: string) => string;
|
|
20
20
|
}
|
|
@@ -5081,14 +5081,16 @@ var DivisionUtil = /** @class */ (function () {
|
|
|
5081
5081
|
};
|
|
5082
5082
|
DivisionUtil.divisionDict = null;
|
|
5083
5083
|
DivisionUtil.getDivisionName = function (divisionCode) {
|
|
5084
|
+
var _b;
|
|
5084
5085
|
// If we don't have a division dictionary yet, build one.
|
|
5085
5086
|
if (!_a.divisionDict) {
|
|
5086
|
-
|
|
5087
|
+
var dict_1 = {};
|
|
5087
5088
|
Object.values(_a.data).forEach(function (v) {
|
|
5088
|
-
Object.assign(
|
|
5089
|
+
Object.assign(dict_1, v.divisions);
|
|
5089
5090
|
});
|
|
5091
|
+
_a.divisionDict = dict_1;
|
|
5090
5092
|
}
|
|
5091
|
-
return _a.divisionDict[divisionCode];
|
|
5093
|
+
return (_b = _a.divisionDict[divisionCode]) !== null && _b !== void 0 ? _b : '';
|
|
5092
5094
|
};
|
|
5093
5095
|
return DivisionUtil;
|
|
5094
5096
|
}());
|
|
@@ -2,9 +2,9 @@ import * as React from 'react';
|
|
|
2
2
|
interface IFilesizeFormatterProps {
|
|
3
3
|
/**
|
|
4
4
|
* File size in bytes. This can be a number or a string that can be parsed
|
|
5
|
-
* to a number.
|
|
5
|
+
* to a number. `null` renders nothing.
|
|
6
6
|
*/
|
|
7
|
-
value: number | string;
|
|
7
|
+
value: number | string | null;
|
|
8
8
|
/**
|
|
9
9
|
* Unit type, `si` (base 1000) or `binary` (base 1024)
|
|
10
10
|
* @default 'si'
|
|
@@ -52,7 +52,7 @@ interface IFilesizeFormatterProps {
|
|
|
52
52
|
* ```
|
|
53
53
|
*/
|
|
54
54
|
declare const FilesizeFormatter: {
|
|
55
|
-
({ value, unit, locale, decimals, }: IFilesizeFormatterProps): React.JSX.Element;
|
|
55
|
+
({ value, unit, locale, decimals, }: IFilesizeFormatterProps): React.JSX.Element | null;
|
|
56
56
|
displayName: string;
|
|
57
57
|
};
|
|
58
58
|
export { FilesizeFormatter, IFilesizeFormatterProps };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
interface ICoordinateFormatterProps {
|
|
3
3
|
/**
|
|
4
|
-
* Value to format.
|
|
4
|
+
* Value to format. `null` renders the fallback string.
|
|
5
5
|
*/
|
|
6
|
-
value: number | string;
|
|
6
|
+
value: number | string | null;
|
|
7
7
|
/**
|
|
8
8
|
* Type of coordinate: 'latitude' or 'longitude'.
|
|
9
9
|
* Latitude values must be between -90 and 90 degrees.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
interface ILatitudeFormatterProps {
|
|
3
3
|
/**
|
|
4
|
-
* Value to format.
|
|
4
|
+
* Value to format. `null` renders the fallback string.
|
|
5
5
|
*/
|
|
6
|
-
value: number | string;
|
|
6
|
+
value: number | string | null;
|
|
7
7
|
/**
|
|
8
8
|
* String to show if formatting fails.
|
|
9
9
|
* @default "(no coordinates)"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
interface ILongitudeFormatterProps {
|
|
3
3
|
/**
|
|
4
|
-
* Value to format.
|
|
4
|
+
* Value to format. `null` renders the fallback string.
|
|
5
5
|
*/
|
|
6
|
-
value: number | string;
|
|
6
|
+
value: number | string | null;
|
|
7
7
|
/**
|
|
8
8
|
* String to show if formatting fails.
|
|
9
9
|
* @default "(no coordinates)"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
interface IHumanFormatterProps {
|
|
3
|
-
/** Input value to be humanized (e.g., 10000 → 10K) */
|
|
4
|
-
value: number | string;
|
|
3
|
+
/** Input value to be humanized (e.g., 10000 → 10K). `null` renders nothing. */
|
|
4
|
+
value: number | string | null;
|
|
5
5
|
/**
|
|
6
6
|
* Locale string (e.g., 'en-US', 'de-DE')
|
|
7
7
|
* @default 'en'
|
|
@@ -43,7 +43,7 @@ interface IHumanFormatterProps {
|
|
|
43
43
|
* ```
|
|
44
44
|
*/
|
|
45
45
|
declare const HumanFormatter: {
|
|
46
|
-
({ value, locale, decimals }: IHumanFormatterProps): React.JSX.Element;
|
|
46
|
+
({ value, locale, decimals }: IHumanFormatterProps): React.JSX.Element | null;
|
|
47
47
|
displayName: string;
|
|
48
48
|
};
|
|
49
49
|
export { HumanFormatter, IHumanFormatterProps };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
interface INumberFormatterProps {
|
|
3
3
|
/**
|
|
4
|
-
* Value to format. This can be a string or a number.
|
|
4
|
+
* Value to format. This can be a string or a number. `null` renders nothing.
|
|
5
5
|
*/
|
|
6
|
-
value: number | string;
|
|
6
|
+
value: number | string | null;
|
|
7
7
|
/**
|
|
8
8
|
* Number of fixed fractional digits.
|
|
9
9
|
* @default 2
|
|
@@ -42,7 +42,7 @@ interface INumberFormatterProps {
|
|
|
42
42
|
* ```
|
|
43
43
|
*/
|
|
44
44
|
declare const NumberFormatter: {
|
|
45
|
-
({ value, decimals, locale }: INumberFormatterProps): React.JSX.Element;
|
|
45
|
+
({ value, decimals, locale }: INumberFormatterProps): React.JSX.Element | null;
|
|
46
46
|
displayName: string;
|
|
47
47
|
};
|
|
48
48
|
export { NumberFormatter, INumberFormatterProps };
|