@longline/aqua-ui 1.0.183 → 1.0.186
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/Dock/Dock.d.ts +7 -4
- package/containers/Dock/Dock.js +2 -1
- package/containers/Dock/Dockable.d.ts +14 -3
- package/containers/Dock/Dockable.js +45 -14
- package/containers/DragBar/DragBar.d.ts +4 -1
- package/containers/DragBar/DragBar.js +1 -0
- package/containers/GlassPane/GlassPane.d.ts +16 -4
- package/containers/GlassPane/GlassPane.js +41 -8
- package/containers/InfoBox/InfoBox.d.ts +23 -2
- package/containers/InfoBox/InfoBox.js +40 -2
- package/containers/InfoBox/elements/Content.d.ts +4 -1
- package/containers/InfoBox/elements/Content.js +1 -0
- package/containers/InfoBox/elements/Footer.d.ts +4 -1
- package/containers/InfoBox/elements/Footer.js +1 -0
- package/containers/InfoBox/elements/Header.d.ts +4 -1
- package/containers/InfoBox/elements/Header.js +2 -1
- package/containers/List/ListCell.d.ts +4 -1
- package/containers/List/ListCell.js +2 -1
- package/containers/List/ListRow.d.ts +4 -1
- package/containers/List/ListRow.js +2 -1
- package/containers/Message/Error.d.ts +4 -1
- package/containers/Message/Error.js +1 -0
- package/containers/Message/Message.d.ts +13 -3
- package/containers/Message/Message.js +2 -1
- package/containers/Message/NoData.d.ts +4 -1
- package/containers/Message/NoData.js +1 -0
- package/containers/Message/NoFilteredData.d.ts +4 -1
- package/containers/Message/NoFilteredData.js +1 -0
- package/controls/Chip/Chip.d.ts +7 -4
- package/controls/Chip/Chip.js +12 -12
- package/controls/Dropzone/Dropzone.d.ts +14 -10
- package/controls/Dropzone/Dropzone.js +88 -20
- package/controls/Fab/Fab.d.ts +7 -5
- package/controls/Fab/Fab.js +19 -18
- package/controls/FilterButton/FilterButton.d.ts +4 -5
- package/controls/FilterButton/FilterButton.js +11 -16
- package/controls/Gradient/Gradient.d.ts +8 -2
- package/controls/Gradient/Gradient.js +32 -6
- package/controls/Gradient/PresetGradients.d.ts +11 -4
- package/controls/Gradient/PresetGradients.js +7 -0
- package/controls/Icon/Icon.d.ts +7 -4
- package/controls/Icon/Icon.js +6 -5
- package/controls/Key/Key.d.ts +5 -2
- package/controls/Key/Key.js +36 -35
- package/controls/LinearChart/LinearChart.d.ts +4 -1
- package/controls/LinearChart/LinearChart.js +3 -2
- package/controls/ListView/ColumnsManager/ColumnsManager.js +1 -1
- package/controls/ListView/ListView.d.ts +2 -1
- package/controls/ListView/ListView.js +6 -5
- package/controls/ListView/NoData.d.ts +4 -1
- package/controls/ListView/NoData.js +1 -0
- package/controls/ListView/{Body.d.ts → elements/Body.d.ts} +2 -2
- package/controls/ListView/{Body.js → elements/Body.js} +1 -1
- package/controls/ListView/elements/Ghost.d.ts +12 -0
- package/controls/ListView/{Ghost.js → elements/Ghost.js} +4 -3
- package/controls/ListView/{Header.d.ts → elements/Header.d.ts} +2 -2
- package/controls/ListView/{Header.js → elements/Header.js} +3 -14
- package/controls/ListView/{HeaderButton.d.ts → elements/HeaderButton.d.ts} +4 -1
- package/controls/ListView/{HeaderButton.js → elements/HeaderButton.js} +1 -1
- package/controls/ListView/{HeaderCell.d.ts → elements/HeaderCell.d.ts} +7 -4
- package/controls/ListView/{HeaderCell.js → elements/HeaderCell.js} +5 -3
- package/controls/ListView/{SortButton.d.ts → elements/SortButton.d.ts} +1 -1
- package/controls/ListView/elements/SortButton.js +27 -0
- package/controls/ListView/{Table.d.ts → elements/Table.d.ts} +6 -3
- package/controls/ListView/{Table.js → elements/Table.js} +5 -4
- package/controls/ListView/{Total.d.ts → elements/Total.d.ts} +5 -1
- package/controls/ListView/{Total.js → elements/Total.js} +2 -1
- package/controls/Mouse/Mouse.d.ts +8 -3
- package/controls/Mouse/Mouse.js +21 -7
- package/controls/PrimaryButton/PrimaryButton.d.ts +6 -2
- package/controls/PrimaryButton/PrimaryButton.js +14 -9
- package/controls/Progress/Progress.d.ts +22 -6
- package/controls/Progress/Progress.js +38 -7
- package/controls/SecondaryButton/SecondaryButton.d.ts +12 -5
- package/controls/SecondaryButton/SecondaryButton.js +29 -19
- package/controls/TabBar/Tab.js +1 -1
- package/controls/TabBar/TabBar.d.ts +15 -4
- package/controls/TabBar/TabBar.js +105 -10
- package/controls/TabBar/Underliner.js +2 -1
- package/controls/TertiaryButton/TertiaryButton.d.ts +4 -1
- package/controls/TertiaryButton/TertiaryButton.js +3 -8
- package/controls/View/EllipsizedContent.d.ts +4 -1
- package/controls/View/EllipsizedContent.js +14 -1
- package/controls/View/ScrollingContent.d.ts +4 -1
- package/controls/View/ScrollingContent.js +14 -1
- package/controls/View/View.d.ts +6 -1
- package/controls/View/View.js +5 -4
- package/formatters/DateTime/DateTime.d.ts +46 -8
- package/formatters/DateTime/DateTime.js +14 -10
- package/formatters/DateTime/elements/Custom.d.ts +6 -17
- package/formatters/DateTime/elements/Custom.js +1 -0
- package/formatters/DateTime/elements/DistanceDate.d.ts +14 -0
- package/formatters/DateTime/elements/{Distance.js → DistanceDate.js} +1 -0
- package/formatters/DateTime/elements/LongDate.d.ts +23 -13
- package/formatters/DateTime/elements/LongDate.js +31 -5
- package/formatters/DateTime/elements/LongDateTime.d.ts +29 -13
- package/formatters/DateTime/elements/LongDateTime.js +28 -1
- package/formatters/DateTime/elements/LongTime.d.ts +25 -13
- package/formatters/DateTime/elements/LongTime.js +23 -1
- package/formatters/DateTime/elements/ShortDate.d.ts +27 -13
- package/formatters/DateTime/elements/ShortDate.js +28 -1
- package/formatters/DateTime/elements/ShortDateTime.d.ts +27 -13
- package/formatters/DateTime/elements/ShortDateTime.js +28 -1
- package/formatters/DateTime/elements/ShortTime.d.ts +13 -12
- package/formatters/DateTime/elements/ShortTime.js +19 -5
- package/formatters/DateTime/elements/index.d.ts +8 -0
- package/formatters/DateTime/elements/index.js +8 -0
- package/formatters/Filesize/Filesize.d.ts +23 -14
- package/formatters/Filesize/Filesize.js +33 -42
- package/formatters/GIS/Latitude.d.ts +11 -5
- package/formatters/GIS/Latitude.js +26 -3
- package/formatters/GIS/Longitude.d.ts +9 -5
- package/formatters/GIS/Longitude.js +24 -3
- package/formatters/Highlight/Highlight.d.ts +21 -6
- package/formatters/Highlight/Highlight.js +37 -19
- package/formatters/Human/Human.d.ts +18 -7
- package/formatters/Human/Human.js +17 -25
- package/formatters/Number/Number.d.ts +10 -2
- package/formatters/Number/Number.js +13 -7
- package/helper/DMS.d.ts +44 -6
- package/helper/DMS.js +86 -24
- package/package.json +1 -1
- package/controls/Dropzone/Dropbox.d.ts +0 -19
- package/controls/Dropzone/Dropbox.js +0 -47
- package/controls/ListView/Ghost.d.ts +0 -9
- package/controls/ListView/SortButton.js +0 -26
- package/formatters/DateTime/elements/Distance.d.ts +0 -24
- package/formatters/GIS/toDMS.d.ts +0 -2
- package/formatters/GIS/toDMS.js +0 -16
- /package/controls/ListView/{sortItems.d.ts → elements/sortItems.d.ts} +0 -0
- /package/controls/ListView/{sortItems.js → elements/sortItems.js} +0 -0
|
@@ -27,15 +27,9 @@ 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 TertiaryButtonBase = function (props) {
|
|
30
|
-
|
|
31
|
-
if (props.disabled)
|
|
32
|
-
return;
|
|
33
|
-
if (props.onClick)
|
|
34
|
-
props.onClick(e);
|
|
35
|
-
};
|
|
36
|
-
return (React.createElement("button", { className: props.className, onClick: handleClick }, props.children));
|
|
30
|
+
return React.createElement("button", { className: props.className, type: "button", disabled: props.disabled, onClick: props.onClick }, props.children);
|
|
37
31
|
};
|
|
38
|
-
var TertiaryButtonStyled = styled(TertiaryButtonBase)(templateObject_3 || (templateObject_3 = __makeTemplateObject([" \n // Size:\n height: 42px;\n min-width: 92px;\n padding-left: 16px
|
|
32
|
+
var TertiaryButtonStyled = styled(TertiaryButtonBase)(templateObject_3 || (templateObject_3 = __makeTemplateObject([" \n // Size:\n height: 42px;\n min-width: 92px;\n padding-left: 16px;\n padding-right: 16px;\n\n // Font\n font: ", ";\n color: ", ";\n\n // Presentation:\n background-color: ", ";\n border-radius: ", "px;\n transition: \n background-color ease-in-out ", "ms, \n box-shadow ease-in-out ", "ms;\n border: none;\n cursor: pointer;\n text-transform: uppercase;\n user-select: none;\n outline: none;\n\n // Content alignment:\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n flex-wrap: nowrap;\n white-space: nowrap;\n \n // Shadow:\n box-shadow: ", ";\n &:hover {\n box-shadow: ", ";\n }\n &:active {\n ", " \n }\n\n // Disabled:\n ", "\n"], [" \n // Size:\n height: 42px;\n min-width: 92px;\n padding-left: 16px;\n padding-right: 16px;\n\n // Font\n font: ", ";\n color: ", ";\n\n // Presentation:\n background-color: ", ";\n border-radius: ", "px;\n transition: \n background-color ease-in-out ", "ms, \n box-shadow ease-in-out ", "ms;\n border: none;\n cursor: pointer;\n text-transform: uppercase;\n user-select: none;\n outline: none;\n\n // Content alignment:\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n flex-wrap: nowrap;\n white-space: nowrap;\n \n // Shadow:\n box-shadow: ", ";\n &:hover {\n box-shadow: ", ";\n }\n &:active {\n ", " \n }\n\n // Disabled:\n ", "\n"
|
|
39
33
|
/**
|
|
40
34
|
* The `TertiaryButton` is connected to a specific area or component such as
|
|
41
35
|
* an `InfoBox`. It renders as a `<button>` element.
|
|
@@ -61,5 +55,6 @@ var TertiaryButton = function (_a) {
|
|
|
61
55
|
var _b = _a.disabled, disabled = _b === void 0 ? false : _b, props = __rest(_a, ["disabled"]);
|
|
62
56
|
return React.createElement(TertiaryButtonStyled, __assign({ disabled: disabled }, props));
|
|
63
57
|
};
|
|
58
|
+
TertiaryButton.displayName = "TertiaryButton";
|
|
64
59
|
export { TertiaryButton };
|
|
65
60
|
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -7,5 +7,8 @@ interface IProps {
|
|
|
7
7
|
/** Is the View in `ghost` mode? */
|
|
8
8
|
ghost?: boolean;
|
|
9
9
|
}
|
|
10
|
-
declare const EllipsizedContent:
|
|
10
|
+
declare const EllipsizedContent: {
|
|
11
|
+
(props: IProps): React.JSX.Element;
|
|
12
|
+
displayName: string;
|
|
13
|
+
};
|
|
11
14
|
export { EllipsizedContent };
|
|
@@ -2,6 +2,17 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
2
2
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
3
|
return cooked;
|
|
4
4
|
};
|
|
5
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
5
16
|
import * as React from 'react';
|
|
6
17
|
import styled from 'styled-components';
|
|
7
18
|
var EllipsizedContentBase = function (props) {
|
|
@@ -9,6 +20,8 @@ var EllipsizedContentBase = function (props) {
|
|
|
9
20
|
React.createElement(Ellipsize, null, !props.ghost && props.children));
|
|
10
21
|
};
|
|
11
22
|
var Ellipsize = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis; \n width: 100%;\n"], ["\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis; \n width: 100%;\n"])));
|
|
12
|
-
var
|
|
23
|
+
var EllipsizedContentStyled = styled(EllipsizedContentBase)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: relative;\n display: flex;\n align-items: center;\n height: 36px;\n"], ["\n position: relative;\n display: flex;\n align-items: center;\n height: 36px;\n"])));
|
|
24
|
+
var EllipsizedContent = function (props) { return React.createElement(EllipsizedContentStyled, __assign({}, props)); };
|
|
25
|
+
EllipsizedContent.displayName = "EllipsizedContent";
|
|
13
26
|
export { EllipsizedContent };
|
|
14
27
|
var templateObject_1, templateObject_2;
|
|
@@ -9,5 +9,8 @@ interface IProps {
|
|
|
9
9
|
/** Height of the view, in CSS units. */
|
|
10
10
|
height: string;
|
|
11
11
|
}
|
|
12
|
-
declare const ScrollingContent:
|
|
12
|
+
declare const ScrollingContent: {
|
|
13
|
+
(props: IProps): React.JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
13
16
|
export { ScrollingContent };
|
|
@@ -2,6 +2,17 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
2
2
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
3
|
return cooked;
|
|
4
4
|
};
|
|
5
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
5
16
|
import * as React from 'react';
|
|
6
17
|
import styled from 'styled-components';
|
|
7
18
|
import { OverlayScrollbarsComponent } from "overlayscrollbars-react";
|
|
@@ -17,6 +28,8 @@ var ScrollingContentBase = function (props) {
|
|
|
17
28
|
overflowY: "auto",
|
|
18
29
|
} }, !props.ghost && props.children));
|
|
19
30
|
};
|
|
20
|
-
var
|
|
31
|
+
var ScrollingContentStyled = styled(ScrollingContentBase)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n height: 100%;\n"], ["\n position: relative;\n height: 100%;\n"])));
|
|
32
|
+
var ScrollingContent = function (props) { return React.createElement(ScrollingContentStyled, __assign({}, props)); };
|
|
33
|
+
ScrollingContent.displayName = "ScrollingContent";
|
|
21
34
|
export { ScrollingContent };
|
|
22
35
|
var templateObject_1;
|
package/controls/View/View.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ interface IProps {
|
|
|
4
4
|
className?: string;
|
|
5
5
|
/**
|
|
6
6
|
* The `View`'s children are its value. Can be JSX.
|
|
7
|
+
* @ignore
|
|
7
8
|
*/
|
|
8
9
|
children?: React.ReactNode;
|
|
9
10
|
/**
|
|
@@ -16,6 +17,7 @@ interface IProps {
|
|
|
16
17
|
hint?: React.ReactNode;
|
|
17
18
|
/**
|
|
18
19
|
* If set, hint area will not have a background color.
|
|
20
|
+
* @default false
|
|
19
21
|
*/
|
|
20
22
|
noHintBg?: boolean;
|
|
21
23
|
/**
|
|
@@ -54,5 +56,8 @@ interface IProps {
|
|
|
54
56
|
* <View label="Email address">{email}</View>
|
|
55
57
|
* ```
|
|
56
58
|
*/
|
|
57
|
-
declare const View:
|
|
59
|
+
declare const View: {
|
|
60
|
+
({ ghost, ...props }: IProps): React.JSX.Element;
|
|
61
|
+
displayName: string;
|
|
62
|
+
};
|
|
58
63
|
export { View, IProps };
|
package/controls/View/View.js
CHANGED
|
@@ -31,16 +31,16 @@ import { ScrollingContent } from './ScrollingContent';
|
|
|
31
31
|
import { EllipsizedContent } from './EllipsizedContent';
|
|
32
32
|
import { Ghost } from '../Ghost';
|
|
33
33
|
var ViewBase = function (props) {
|
|
34
|
-
return
|
|
34
|
+
return React.createElement("div", { className: props.className },
|
|
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,
|
|
38
38
|
" ",
|
|
39
39
|
React.createElement(Badge, null, props.badge))) : (props.label)),
|
|
40
40
|
React.createElement(Content, null, props.height
|
|
41
|
-
? React.createElement(ScrollingContent, { ghost: props.ghost, height: props.height,
|
|
42
|
-
: React.createElement(EllipsizedContent, { ghost: props.ghost,
|
|
43
|
-
props.hint && React.createElement(HintContent, null, props.hint))
|
|
41
|
+
? React.createElement(ScrollingContent, { ghost: props.ghost, height: props.height }, props.children)
|
|
42
|
+
: React.createElement(EllipsizedContent, { ghost: props.ghost }, props.children)),
|
|
43
|
+
props.hint && React.createElement(HintContent, null, props.hint));
|
|
44
44
|
};
|
|
45
45
|
var Content = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n top: 22px;\n bottom: 22px;\n left: 0;\n right: 0;\n padding-left: 12px;\n padding-right: 12px;\n"], ["\n position: absolute;\n top: 22px;\n bottom: 22px;\n left: 0;\n right: 0;\n padding-left: 12px;\n padding-right: 12px;\n"])));
|
|
46
46
|
var HintContent = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: absolute;\n bottom: 3px;\n left: 12px;\n right: 12px;\n\n font: ", ";\n color: ", ";\n user-select: none;\n // Hints don't wrap and are ellipsized:\n white-space: nowrap;\n overflow-x: hidden;\n text-overflow: ellipsis;\n"], ["\n position: absolute;\n bottom: 3px;\n left: 12px;\n right: 12px;\n\n font: ", ";\n color: ", ";\n user-select: none;\n // Hints don't wrap and are ellipsized:\n white-space: nowrap;\n overflow-x: hidden;\n text-overflow: ellipsis;\n"])), function (p) { return p.theme.font.bodySmall; }, function (p) { return p.theme.colors.neutral[80]; });
|
|
@@ -76,5 +76,6 @@ var View = function (_a) {
|
|
|
76
76
|
var _b = _a.ghost, ghost = _b === void 0 ? false : _b, props = __rest(_a, ["ghost"]);
|
|
77
77
|
return React.createElement(ViewStyled, __assign({ ghost: ghost }, props));
|
|
78
78
|
};
|
|
79
|
+
View.displayName = "View";
|
|
79
80
|
export { View };
|
|
80
81
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9;
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Locale } from "date-fns";
|
|
3
3
|
type TType = 'longdate' | 'shortdate' | 'longdatetime' | 'shortdatetime' | 'longtime' | 'shorttime' | 'fuzzydistance' | 'strictdistance' | 'custom';
|
|
4
|
-
interface
|
|
5
|
-
/**
|
|
6
|
-
* Preset format.
|
|
7
|
-
* @default longdate
|
|
8
|
-
*/
|
|
9
|
-
type?: TType;
|
|
4
|
+
interface IDateTimeProps {
|
|
10
5
|
/**
|
|
11
6
|
* Input date. This can either be a `Date` or a `string`.
|
|
12
7
|
*/
|
|
@@ -15,16 +10,27 @@ interface IProps {
|
|
|
15
10
|
* Optional `Locale`. This is a locale from https://date-fns.org/v4.1.0/docs/I18n.
|
|
16
11
|
*/
|
|
17
12
|
locale?: Locale;
|
|
13
|
+
}
|
|
14
|
+
interface IDateTimeFormatProps {
|
|
18
15
|
/**
|
|
19
16
|
* Optional custom format string.
|
|
20
17
|
*/
|
|
21
18
|
format?: string;
|
|
19
|
+
}
|
|
20
|
+
interface IAnimateProps {
|
|
22
21
|
/**
|
|
23
22
|
* If set, distance formatting will be animated.
|
|
24
23
|
* @default false
|
|
25
24
|
*/
|
|
26
25
|
animated?: boolean;
|
|
27
26
|
}
|
|
27
|
+
interface IProps extends IDateTimeProps, IDateTimeFormatProps, IAnimateProps {
|
|
28
|
+
/**
|
|
29
|
+
* Preset format.
|
|
30
|
+
* @default longdate
|
|
31
|
+
*/
|
|
32
|
+
type?: TType;
|
|
33
|
+
}
|
|
28
34
|
/**
|
|
29
35
|
* `DateTime` formats a date or time to a string.
|
|
30
36
|
*
|
|
@@ -41,5 +47,37 @@ interface IProps {
|
|
|
41
47
|
* <DateTime type='longdate' value='1992-03-08' locale={es}/>
|
|
42
48
|
* ```
|
|
43
49
|
*/
|
|
44
|
-
declare const DateTime:
|
|
45
|
-
|
|
50
|
+
declare const DateTime: {
|
|
51
|
+
({ type, animated, ...props }: IProps): React.JSX.Element;
|
|
52
|
+
displayName: string;
|
|
53
|
+
LongDate: {
|
|
54
|
+
({ value, locale }: IDateTimeProps): React.JSX.Element;
|
|
55
|
+
displayName: string;
|
|
56
|
+
};
|
|
57
|
+
ShortDate: {
|
|
58
|
+
(props: IDateTimeProps): React.JSX.Element;
|
|
59
|
+
displayName: string;
|
|
60
|
+
};
|
|
61
|
+
LongDateTime: {
|
|
62
|
+
(props: IDateTimeProps): React.JSX.Element;
|
|
63
|
+
displayName: string;
|
|
64
|
+
};
|
|
65
|
+
ShortDateTime: {
|
|
66
|
+
(props: IDateTimeProps): React.JSX.Element;
|
|
67
|
+
displayName: string;
|
|
68
|
+
};
|
|
69
|
+
LongTime: {
|
|
70
|
+
(props: IDateTimeProps): React.JSX.Element;
|
|
71
|
+
displayName: string;
|
|
72
|
+
};
|
|
73
|
+
ShortTime: React.MemoExoticComponent<({ value, locale, seconds }: import("./elements").IShortTimeProps) => React.JSX.Element>;
|
|
74
|
+
DistanceDate: {
|
|
75
|
+
({ animated, ...props }: import("./elements").IDistanceDateProps): React.JSX.Element;
|
|
76
|
+
displayName: string;
|
|
77
|
+
};
|
|
78
|
+
Custom: {
|
|
79
|
+
({ format, ...props }: IDateTimeProps & IDateTimeFormatProps): React.JSX.Element;
|
|
80
|
+
displayName: string;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
export { DateTime, IDateTimeProps, IDateTimeFormatProps, IAnimateProps, IProps };
|
|
@@ -21,14 +21,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
import * as React from 'react';
|
|
24
|
-
import { ShortDate } from
|
|
25
|
-
import { LongDate } from "./elements/LongDate";
|
|
26
|
-
import { DistanceDate } from "./elements/Distance";
|
|
27
|
-
import { ShortDateTime } from "./elements/ShortDateTime";
|
|
28
|
-
import { LongDateTime } from "./elements/LongDateTime";
|
|
29
|
-
import { LongTime } from './elements/LongTime';
|
|
30
|
-
import { ShortTime } from './elements/ShortTime';
|
|
31
|
-
import { Custom } from "./elements/Custom";
|
|
24
|
+
import { Custom, DistanceDate, LongDate, LongDateTime, LongTime, ShortDate, ShortDateTime, ShortTime } from './elements';
|
|
32
25
|
/**
|
|
33
26
|
* `DateTime` formats a date or time to a string.
|
|
34
27
|
*
|
|
@@ -54,11 +47,22 @@ var DateTime = function (_a) {
|
|
|
54
47
|
case 'shortdatetime': return React.createElement(ShortDateTime, __assign({}, props));
|
|
55
48
|
case 'longtime': return React.createElement(LongTime, __assign({}, props));
|
|
56
49
|
case 'shorttime': return React.createElement(ShortTime, __assign({}, props));
|
|
57
|
-
case 'fuzzydistance': return React.createElement(DistanceDate, __assign({
|
|
58
|
-
case 'strictdistance': return React.createElement(DistanceDate, __assign({
|
|
50
|
+
case 'fuzzydistance': return React.createElement(DistanceDate, __assign({}, props));
|
|
51
|
+
case 'strictdistance': return React.createElement(DistanceDate, __assign({ strict: true }, props));
|
|
59
52
|
case 'custom': return React.createElement(Custom, __assign({}, props));
|
|
60
53
|
default:
|
|
61
54
|
return null;
|
|
62
55
|
}
|
|
63
56
|
};
|
|
57
|
+
DateTime.displayName = "DateTime";
|
|
58
|
+
// Bonus: users can either use the `type` prop, or import the individual
|
|
59
|
+
// components directly:
|
|
60
|
+
DateTime.LongDate = LongDate;
|
|
61
|
+
DateTime.ShortDate = ShortDate;
|
|
62
|
+
DateTime.LongDateTime = LongDateTime;
|
|
63
|
+
DateTime.ShortDateTime = ShortDateTime;
|
|
64
|
+
DateTime.LongTime = LongTime;
|
|
65
|
+
DateTime.ShortTime = ShortTime;
|
|
66
|
+
DateTime.DistanceDate = DistanceDate;
|
|
67
|
+
DateTime.Custom = Custom;
|
|
64
68
|
export { DateTime };
|
|
@@ -1,18 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Format string.
|
|
10
|
-
*/
|
|
11
|
-
format?: string;
|
|
12
|
-
/**
|
|
13
|
-
* Optional locale.
|
|
14
|
-
*/
|
|
15
|
-
locale?: Locale;
|
|
16
|
-
}
|
|
17
|
-
declare const Custom: ({ format, ...props }: IProps) => React.JSX.Element;
|
|
18
|
-
export { Custom, IProps };
|
|
2
|
+
import { IDateTimeFormatProps, IDateTimeProps } from '../DateTime';
|
|
3
|
+
declare const Custom: {
|
|
4
|
+
({ format, ...props }: IDateTimeProps & IDateTimeFormatProps): React.JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
7
|
+
export { Custom };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IAnimateProps, IDateTimeProps } from '../DateTime';
|
|
3
|
+
interface IDistanceDateProps extends IDateTimeProps, IAnimateProps {
|
|
4
|
+
/**
|
|
5
|
+
* A strict formatter does not use helpers like 'almost', 'over',
|
|
6
|
+
* 'less than' and the like.
|
|
7
|
+
*/
|
|
8
|
+
strict?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const DistanceDate: {
|
|
11
|
+
({ animated, ...props }: IDistanceDateProps): React.JSX.Element;
|
|
12
|
+
displayName: string;
|
|
13
|
+
};
|
|
14
|
+
export { DistanceDate, IDistanceDateProps };
|
|
@@ -42,4 +42,5 @@ var DistanceDate = function (_a) {
|
|
|
42
42
|
options.locale = props.locale;
|
|
43
43
|
return (React.createElement("span", { title: format(date, 'eeee, d MMMM yyyy', props.locale ? { locale: props.locale } : {}) }, props.strict ? formatDistanceToNowStrict(date, options) : formatDistanceToNow(date, options)));
|
|
44
44
|
};
|
|
45
|
+
DistanceDate.displayName = "DateTime.Distance";
|
|
45
46
|
export { DistanceDate };
|
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
import { IDateTimeProps } from '../DateTime';
|
|
3
|
+
/**
|
|
4
|
+
* `LongDate` formats a date value into a long date string, such as
|
|
5
|
+
* "Mon, 1 January 2023". It also sets a full date description as the
|
|
6
|
+
* title attribute for better accessibility.
|
|
7
|
+
*
|
|
8
|
+
* The component accepts either a `Date` object or a date string as `value`.
|
|
9
|
+
* If the input is `null` or invalid, it returns `null` and renders nothing.
|
|
10
|
+
*
|
|
11
|
+
* Optionally, a `locale` can be provided to format the date in different
|
|
12
|
+
* languages and regional formats using date-fns locales.
|
|
13
|
+
*
|
|
14
|
+
* The output is wrapped in a `<time>` element with a machine-readable
|
|
15
|
+
* `dateTime` attribute.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <LongDate value={new Date()} />
|
|
20
|
+
* <LongDate value="2023-01-01" locale={es} />
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
13
23
|
declare const LongDate: {
|
|
14
|
-
(
|
|
24
|
+
({ value, locale }: IDateTimeProps): React.JSX.Element;
|
|
15
25
|
displayName: string;
|
|
16
26
|
};
|
|
17
|
-
export { LongDate
|
|
27
|
+
export { LongDate };
|
|
@@ -1,11 +1,37 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { format } from 'date-fns';
|
|
3
3
|
import { toDate } from './toDate';
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* `LongDate` formats a date value into a long date string, such as
|
|
6
|
+
* "Mon, 1 January 2023". It also sets a full date description as the
|
|
7
|
+
* title attribute for better accessibility.
|
|
8
|
+
*
|
|
9
|
+
* The component accepts either a `Date` object or a date string as `value`.
|
|
10
|
+
* If the input is `null` or invalid, it returns `null` and renders nothing.
|
|
11
|
+
*
|
|
12
|
+
* Optionally, a `locale` can be provided to format the date in different
|
|
13
|
+
* languages and regional formats using date-fns locales.
|
|
14
|
+
*
|
|
15
|
+
* The output is wrapped in a `<time>` element with a machine-readable
|
|
16
|
+
* `dateTime` attribute.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <LongDate value={new Date()} />
|
|
21
|
+
* <LongDate value="2023-01-01" locale={es} />
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
var LongDate = function (_a) {
|
|
25
|
+
var value = _a.value, locale = _a.locale;
|
|
26
|
+
if (value == null)
|
|
6
27
|
return null;
|
|
7
|
-
var date = toDate(
|
|
8
|
-
|
|
28
|
+
var date = toDate(value);
|
|
29
|
+
if (!date || isNaN(date.getTime()))
|
|
30
|
+
return null;
|
|
31
|
+
var formatOptions = locale ? { locale: locale } : {};
|
|
32
|
+
var title = React.useMemo(function () { return format(date, 'eeee, d MMMM yyyy', formatOptions); }, [date, formatOptions]);
|
|
33
|
+
var display = React.useMemo(function () { return format(date, 'eee, d MMMM yyyy', formatOptions); }, [date, formatOptions]);
|
|
34
|
+
return (React.createElement("time", { dateTime: date.toISOString(), title: title }, display));
|
|
9
35
|
};
|
|
10
|
-
LongDate.displayName = "
|
|
36
|
+
LongDate.displayName = "DateTime.LongDate";
|
|
11
37
|
export { LongDate };
|
|
@@ -1,14 +1,30 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
import { IDateTimeProps } from '../DateTime';
|
|
3
|
+
/**
|
|
4
|
+
* `LongDateTime` formats a date/time value into a long, detailed string including
|
|
5
|
+
* the full date and time with seconds, for example:
|
|
6
|
+
* "Mon, 1 January 2023 14:30:45".
|
|
7
|
+
*
|
|
8
|
+
* It also sets the full date/time as the `title` attribute for accessibility and UX,
|
|
9
|
+
* so users can see the full timestamp on hover.
|
|
10
|
+
*
|
|
11
|
+
* Accepts a `Date` object or a date string as `value`. If `value` is `null` or invalid,
|
|
12
|
+
* the component returns `null` and renders nothing.
|
|
13
|
+
*
|
|
14
|
+
* Optionally, a `locale` prop can be provided to format the date/time string according
|
|
15
|
+
* to locale-specific rules using date-fns locale support.
|
|
16
|
+
*
|
|
17
|
+
* The formatted output is wrapped in a `<time>` element with a machine-readable `dateTime`
|
|
18
|
+
* attribute to improve semantics and SEO.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <LongDateTime value={new Date()} />
|
|
23
|
+
* <LongDateTime value="2023-01-01T14:30:45" locale={fr} />
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
declare const LongDateTime: {
|
|
27
|
+
(props: IDateTimeProps): React.JSX.Element;
|
|
28
|
+
displayName: string;
|
|
29
|
+
};
|
|
30
|
+
export { LongDateTime };
|
|
@@ -1,10 +1,37 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { format } from 'date-fns';
|
|
3
3
|
import { toDate } from './toDate';
|
|
4
|
+
/**
|
|
5
|
+
* `LongDateTime` formats a date/time value into a long, detailed string including
|
|
6
|
+
* the full date and time with seconds, for example:
|
|
7
|
+
* "Mon, 1 January 2023 14:30:45".
|
|
8
|
+
*
|
|
9
|
+
* It also sets the full date/time as the `title` attribute for accessibility and UX,
|
|
10
|
+
* so users can see the full timestamp on hover.
|
|
11
|
+
*
|
|
12
|
+
* Accepts a `Date` object or a date string as `value`. If `value` is `null` or invalid,
|
|
13
|
+
* the component returns `null` and renders nothing.
|
|
14
|
+
*
|
|
15
|
+
* Optionally, a `locale` prop can be provided to format the date/time string according
|
|
16
|
+
* to locale-specific rules using date-fns locale support.
|
|
17
|
+
*
|
|
18
|
+
* The formatted output is wrapped in a `<time>` element with a machine-readable `dateTime`
|
|
19
|
+
* attribute to improve semantics and SEO.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* <LongDateTime value={new Date()} />
|
|
24
|
+
* <LongDateTime value="2023-01-01T14:30:45" locale={fr} />
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
4
27
|
var LongDateTime = function (props) {
|
|
5
28
|
if (props.value == null)
|
|
6
29
|
return null;
|
|
7
30
|
var date = toDate(props.value);
|
|
8
|
-
|
|
31
|
+
if (isNaN(date.getTime()))
|
|
32
|
+
return null; // Extra check for invalid dates
|
|
33
|
+
var localeOptions = props.locale ? { locale: props.locale } : {};
|
|
34
|
+
return (React.createElement("time", { dateTime: date.toISOString(), title: format(date, 'eeee, d MMMM yyyy HH:mm:ss', localeOptions) }, format(date, 'eee, d MMMM yyyy HH:mm:ss', localeOptions)));
|
|
9
35
|
};
|
|
36
|
+
LongDateTime.displayName = "DateTime.LongDateTime";
|
|
10
37
|
export { LongDateTime };
|
|
@@ -1,14 +1,26 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
import { IDateTimeProps } from '../DateTime';
|
|
3
|
+
/**
|
|
4
|
+
* `LongTime` formats a date/time value to show hours, minutes, and seconds,
|
|
5
|
+
* using 24-hour format (e.g., "14:30:45").
|
|
6
|
+
*
|
|
7
|
+
* Accepts a `Date` object or a date string as `value`. Returns `null` if the input
|
|
8
|
+
* is `null` or cannot be parsed as a valid date.
|
|
9
|
+
*
|
|
10
|
+
* Optionally, a `locale` prop can be passed, though it does not affect the
|
|
11
|
+
* time format here but is accepted for consistency.
|
|
12
|
+
*
|
|
13
|
+
* The formatted time is wrapped in a semantic `<time>` element with a
|
|
14
|
+
* machine-readable `dateTime` attribute.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <LongTime value={new Date()} />
|
|
19
|
+
* <LongTime value="2023-01-01T14:30:45" />
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
declare const LongTime: {
|
|
23
|
+
(props: IDateTimeProps): React.JSX.Element;
|
|
24
|
+
displayName: string;
|
|
25
|
+
};
|
|
26
|
+
export { LongTime };
|
|
@@ -1,10 +1,32 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { format } from 'date-fns';
|
|
3
3
|
import { toDate } from './toDate';
|
|
4
|
+
/**
|
|
5
|
+
* `LongTime` formats a date/time value to show hours, minutes, and seconds,
|
|
6
|
+
* using 24-hour format (e.g., "14:30:45").
|
|
7
|
+
*
|
|
8
|
+
* Accepts a `Date` object or a date string as `value`. Returns `null` if the input
|
|
9
|
+
* is `null` or cannot be parsed as a valid date.
|
|
10
|
+
*
|
|
11
|
+
* Optionally, a `locale` prop can be passed, though it does not affect the
|
|
12
|
+
* time format here but is accepted for consistency.
|
|
13
|
+
*
|
|
14
|
+
* The formatted time is wrapped in a semantic `<time>` element with a
|
|
15
|
+
* machine-readable `dateTime` attribute.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <LongTime value={new Date()} />
|
|
20
|
+
* <LongTime value="2023-01-01T14:30:45" />
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
4
23
|
var LongTime = function (props) {
|
|
5
24
|
if (props.value == null)
|
|
6
25
|
return null;
|
|
7
26
|
var date = toDate(props.value);
|
|
8
|
-
|
|
27
|
+
if (isNaN(date.getTime()))
|
|
28
|
+
return null;
|
|
29
|
+
return (React.createElement("time", { dateTime: date.toISOString() }, format(date, 'HH:mm:ss')));
|
|
9
30
|
};
|
|
31
|
+
LongTime.displayName = "DateTime.LongTime";
|
|
10
32
|
export { LongTime };
|
|
@@ -1,14 +1,28 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
import { IDateTimeProps } from '../DateTime';
|
|
3
|
+
/**
|
|
4
|
+
* `ShortDate` formats a date value into a short date string,
|
|
5
|
+
* using the format `dd-MM-yyyy` (e.g., `28-05-2025`).
|
|
6
|
+
*
|
|
7
|
+
* It shows a tooltip with the full date in a long, human-readable format,
|
|
8
|
+
* e.g., `"Wednesday, 28 May 2025"`.
|
|
9
|
+
*
|
|
10
|
+
* Accepts a `Date` object or a date string as `value`. Returns `null` if input
|
|
11
|
+
* is `null` or invalid.
|
|
12
|
+
*
|
|
13
|
+
* Optionally supports a `locale` prop that affects the date formatting and tooltip.
|
|
14
|
+
*
|
|
15
|
+
* The date is wrapped in a semantic `<time>` element with a machine-readable
|
|
16
|
+
* `dateTime` attribute.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <ShortDate value={new Date()} />
|
|
21
|
+
* <ShortDate value="2025-05-28" locale={someLocale} />
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
declare const ShortDate: {
|
|
25
|
+
(props: IDateTimeProps): React.JSX.Element;
|
|
26
|
+
displayName: string;
|
|
27
|
+
};
|
|
28
|
+
export { ShortDate };
|