@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
|
@@ -1,34 +1,26 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* `Human`
|
|
4
|
-
*
|
|
5
|
-
* E.g. `10000` => `10K`
|
|
3
|
+
* `Human` formats large numbers using `Intl.NumberFormat` for locale-aware
|
|
4
|
+
* output and optional compact display (e.g. "10K", "1.2M").
|
|
6
5
|
*
|
|
7
6
|
* ```tsx
|
|
8
|
-
* <Human value={
|
|
7
|
+
* <Human value={1200}/> // => "1.2K"
|
|
8
|
+
* <Human value={999999} locale="de-DE" /> // => "1 Mio."
|
|
9
9
|
* ```
|
|
10
10
|
*/
|
|
11
|
-
var Human = function (
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
*/
|
|
15
|
-
var humanSize = function (value) {
|
|
16
|
-
var thresh = 1000;
|
|
17
|
-
if (Math.abs(value) < thresh) {
|
|
18
|
-
return value.toFixed(0);
|
|
19
|
-
}
|
|
20
|
-
var units = ['K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'];
|
|
21
|
-
var u = -1;
|
|
22
|
-
do {
|
|
23
|
-
value /= thresh;
|
|
24
|
-
++u;
|
|
25
|
-
} while (Math.abs(value) >= thresh && u < units.length - 1);
|
|
26
|
-
return (+value).toFixed(2) + units[u];
|
|
27
|
-
};
|
|
28
|
-
if (props.value == null)
|
|
11
|
+
var Human = function (_a) {
|
|
12
|
+
var value = _a.value, _b = _a.locale, locale = _b === void 0 ? 'en' : _b, _c = _a.decimals, decimals = _c === void 0 ? 2 : _c;
|
|
13
|
+
if (value == null)
|
|
29
14
|
return null;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
15
|
+
var num = typeof value === 'string' ? parseFloat(value) : value;
|
|
16
|
+
if (isNaN(num))
|
|
17
|
+
return null;
|
|
18
|
+
var formatOptions = {
|
|
19
|
+
notation: 'compact',
|
|
20
|
+
maximumFractionDigits: decimals
|
|
21
|
+
};
|
|
22
|
+
var formatted = new Intl.NumberFormat(locale, formatOptions).format(num);
|
|
23
|
+
return React.createElement(React.Fragment, null, formatted);
|
|
33
24
|
};
|
|
25
|
+
Human.displayName = 'Human';
|
|
34
26
|
export { Human };
|
|
@@ -5,20 +5,28 @@ interface IProps {
|
|
|
5
5
|
*/
|
|
6
6
|
value: number | string;
|
|
7
7
|
/**
|
|
8
|
-
* Number of fractional digits.
|
|
8
|
+
* Number of fixed fractional digits.
|
|
9
9
|
* @default 2
|
|
10
10
|
*/
|
|
11
11
|
decimals?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Optional locale to use in formatting (e.g., "en-US", "fr-FR").
|
|
14
|
+
* @default undefined (browser locale)
|
|
15
|
+
*/
|
|
16
|
+
locale?: string;
|
|
12
17
|
}
|
|
13
18
|
/**
|
|
14
19
|
* `Number` formats a number with thousands separators and optional
|
|
15
20
|
* fractional digits. If provided with a string, `Number` will convert
|
|
16
21
|
* it to a float first. By default, two decimals are printed.
|
|
17
22
|
*
|
|
23
|
+
* If the input is not a valid number, it returns `null`.
|
|
24
|
+
*
|
|
18
25
|
* ```tsx
|
|
19
26
|
* <Number value={35100.20}/>
|
|
20
27
|
* <Number value={35100.20} decimals={0}/>
|
|
28
|
+
* <Number value={1234.567} locale="de-DE" />
|
|
21
29
|
* ```
|
|
22
30
|
*/
|
|
23
|
-
declare const Number: ({ decimals, ...props }: IProps) => React.JSX.Element;
|
|
31
|
+
declare const Number: ({ value, decimals, locale, ...props }: IProps) => React.JSX.Element;
|
|
24
32
|
export { Number, IProps };
|
|
@@ -15,22 +15,28 @@ import * as React from 'react';
|
|
|
15
15
|
* fractional digits. If provided with a string, `Number` will convert
|
|
16
16
|
* it to a float first. By default, two decimals are printed.
|
|
17
17
|
*
|
|
18
|
+
* If the input is not a valid number, it returns `null`.
|
|
19
|
+
*
|
|
18
20
|
* ```tsx
|
|
19
21
|
* <Number value={35100.20}/>
|
|
20
22
|
* <Number value={35100.20} decimals={0}/>
|
|
23
|
+
* <Number value={1234.567} locale="de-DE" />
|
|
21
24
|
* ```
|
|
22
25
|
*/
|
|
23
26
|
var Number = function (_a) {
|
|
24
|
-
var _b = _a.decimals, decimals = _b === void 0 ? 2 : _b, props = __rest(_a, ["decimals"]);
|
|
25
|
-
if
|
|
27
|
+
var value = _a.value, _b = _a.decimals, decimals = _b === void 0 ? 2 : _b, locale = _a.locale, props = __rest(_a, ["value", "decimals", "locale"]);
|
|
28
|
+
// Return null if value is not provided:
|
|
29
|
+
if (value == null)
|
|
30
|
+
return null;
|
|
31
|
+
// Return null if value is not a number:
|
|
32
|
+
var num = typeof value === 'string' ? parseFloat(value) : value;
|
|
33
|
+
if (isNaN(num))
|
|
26
34
|
return null;
|
|
27
|
-
// Make sure value is a number.
|
|
28
|
-
var val = (typeof props.value === 'string') ? parseFloat(props.value) : props.value;
|
|
29
35
|
// Format number with requested fraction digits:
|
|
30
|
-
return React.createElement(React.Fragment, null,
|
|
36
|
+
return (React.createElement(React.Fragment, null, num.toLocaleString(locale, {
|
|
31
37
|
useGrouping: true,
|
|
32
38
|
minimumFractionDigits: decimals,
|
|
33
|
-
maximumFractionDigits: decimals
|
|
34
|
-
}));
|
|
39
|
+
maximumFractionDigits: decimals,
|
|
40
|
+
})));
|
|
35
41
|
};
|
|
36
42
|
export { Number };
|
package/helper/DMS.d.ts
CHANGED
|
@@ -2,20 +2,58 @@
|
|
|
2
2
|
* Degrees-Minutes-Seconds conversion helpers.
|
|
3
3
|
*/
|
|
4
4
|
declare class DMS {
|
|
5
|
+
/**
|
|
6
|
+
* Converts a decimal coordinate (latitude or longitude) to a formatted DMS
|
|
7
|
+
* (degrees, minutes, seconds) string.
|
|
8
|
+
*
|
|
9
|
+
* @param value - The coordinate value as number or string.
|
|
10
|
+
* @param defaultStr - String to return if value is invalid or out of range.
|
|
11
|
+
* @param max - Maximum absolute valid value for the coordinate (e.g., 90 for
|
|
12
|
+
* latitude, 180 for longitude).
|
|
13
|
+
* @param positive - Suffix for positive values (e.g., 'N' or 'E').
|
|
14
|
+
* @param negative - Suffix for negative values (e.g., 'S' or 'W').
|
|
15
|
+
*
|
|
16
|
+
* @returns Formatted DMS string or the default string.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* toDMS(51.1789, '(no coordinates)', 90, 'N', 'S');
|
|
21
|
+
* // Returns: "51° 10′ 44″ N"
|
|
22
|
+
*
|
|
23
|
+
* toDMS('-1.8262', '(no coordinates)', 180, 'E', 'W');
|
|
24
|
+
* // Returns: "1° 49′ 34″ W"
|
|
25
|
+
*
|
|
26
|
+
* toDMS(1000, '(no coordinates)', 90, 'N', 'S');
|
|
27
|
+
* // Returns: "(no coordinates)" (out of range)
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
static toDMSString(value: number | string, defaultStr: string, max: number, positive: string, negative: string): string;
|
|
5
31
|
/**
|
|
6
32
|
* Convert a decimal latitude or longitude value to degrees,
|
|
7
33
|
* minutes, and seconds.
|
|
8
34
|
*
|
|
9
|
-
* @param value Value to convert
|
|
10
|
-
* @returns
|
|
35
|
+
* @param value Value to convert, positive or negative decimal degrees
|
|
36
|
+
* @returns A tuple: [degrees, minutes, seconds], all positive numbers.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* DMS.toDMS(23.4394); // returns [23, 26, 22]
|
|
41
|
+
* DMS.toDMS(-73.9857); // returns [73, 59, 9]
|
|
42
|
+
* ```
|
|
11
43
|
*/
|
|
12
44
|
static toDMS: (value: number) => number[];
|
|
13
45
|
/**
|
|
14
46
|
* Convert degrees, minutes and seconds to a float value.
|
|
15
|
-
* @param d Degrees
|
|
16
|
-
* @param m Minutes
|
|
17
|
-
* @param s Seconds
|
|
18
|
-
* @returns Float
|
|
47
|
+
* @param d Degrees (can be positive or negative)
|
|
48
|
+
* @param m Minutes (0-59)
|
|
49
|
+
* @param s Seconds (0-59)
|
|
50
|
+
* @returns Float decimal degrees, preserving sign of degrees.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* DMS.toFloat(23, 26, 22); // returns approximately 23.4394
|
|
55
|
+
* DMS.toFloat(-73, 59, 9); // returns approximately -73.9858
|
|
56
|
+
* ```
|
|
19
57
|
*/
|
|
20
58
|
static toFloat: (d: number, m: number, s: number) => number;
|
|
21
59
|
}
|
package/helper/DMS.js
CHANGED
|
@@ -4,42 +4,104 @@
|
|
|
4
4
|
var DMS = /** @class */ (function () {
|
|
5
5
|
function DMS() {
|
|
6
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* Converts a decimal coordinate (latitude or longitude) to a formatted DMS
|
|
9
|
+
* (degrees, minutes, seconds) string.
|
|
10
|
+
*
|
|
11
|
+
* @param value - The coordinate value as number or string.
|
|
12
|
+
* @param defaultStr - String to return if value is invalid or out of range.
|
|
13
|
+
* @param max - Maximum absolute valid value for the coordinate (e.g., 90 for
|
|
14
|
+
* latitude, 180 for longitude).
|
|
15
|
+
* @param positive - Suffix for positive values (e.g., 'N' or 'E').
|
|
16
|
+
* @param negative - Suffix for negative values (e.g., 'S' or 'W').
|
|
17
|
+
*
|
|
18
|
+
* @returns Formatted DMS string or the default string.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* toDMS(51.1789, '(no coordinates)', 90, 'N', 'S');
|
|
23
|
+
* // Returns: "51° 10′ 44″ N"
|
|
24
|
+
*
|
|
25
|
+
* toDMS('-1.8262', '(no coordinates)', 180, 'E', 'W');
|
|
26
|
+
* // Returns: "1° 49′ 34″ W"
|
|
27
|
+
*
|
|
28
|
+
* toDMS(1000, '(no coordinates)', 90, 'N', 'S');
|
|
29
|
+
* // Returns: "(no coordinates)" (out of range)
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
DMS.toDMSString = function (value, defaultStr, max, positive, negative) {
|
|
33
|
+
// Convert value to number if it is a string:
|
|
34
|
+
var num = typeof value === 'number' ? value : parseFloat(value);
|
|
35
|
+
// Return default string if value is not a number or out of range:
|
|
36
|
+
if (isNaN(num) || num < -max || num > max)
|
|
37
|
+
return defaultStr;
|
|
38
|
+
// toDMS returns [degrees, minutes, seconds], all positive numbers,
|
|
39
|
+
// degrees retain the sign for direction determination.
|
|
40
|
+
var _a = DMS.toDMS(num), d = _a[0], m = _a[1], s = _a[2];
|
|
41
|
+
// Pad minutes and seconds with leading zeros if needed:
|
|
42
|
+
var mm = m.toString().padStart(2, '0');
|
|
43
|
+
// Round seconds to nearest integer, then pad:
|
|
44
|
+
var ss = Math.round(s).toString().padStart(2, '0');
|
|
45
|
+
// Use absolute degrees for display but sign for suffix:
|
|
46
|
+
var direction = d >= 0 ? positive : negative;
|
|
47
|
+
// Absolute degrees for display (e.g., 0 to max), prevent "-0"
|
|
48
|
+
var absDegrees = Math.abs(d);
|
|
49
|
+
return "".concat(absDegrees, "\u00B0 ").concat(mm, "\u2032 ").concat(ss, "\u2033 ").concat(direction);
|
|
50
|
+
};
|
|
7
51
|
/**
|
|
8
52
|
* Convert a decimal latitude or longitude value to degrees,
|
|
9
53
|
* minutes, and seconds.
|
|
10
54
|
*
|
|
11
|
-
* @param value Value to convert
|
|
12
|
-
* @returns
|
|
55
|
+
* @param value Value to convert, positive or negative decimal degrees
|
|
56
|
+
* @returns A tuple: [degrees, minutes, seconds], all positive numbers.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* DMS.toDMS(23.4394); // returns [23, 26, 22]
|
|
61
|
+
* DMS.toDMS(-73.9857); // returns [73, 59, 9]
|
|
62
|
+
* ```
|
|
13
63
|
*/
|
|
14
64
|
DMS.toDMS = function (value) {
|
|
15
|
-
value
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var degrees = Math.
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
var
|
|
23
|
-
|
|
65
|
+
if (typeof value !== 'number' || isNaN(value)) {
|
|
66
|
+
return [0, 0, 0];
|
|
67
|
+
}
|
|
68
|
+
var absValue = Math.abs(value);
|
|
69
|
+
var degrees = Math.floor(absValue);
|
|
70
|
+
var minutesFull = (absValue - degrees) * 60;
|
|
71
|
+
var minutes = Math.floor(minutesFull);
|
|
72
|
+
var seconds = Math.round((minutesFull - minutes) * 60);
|
|
73
|
+
// Handle case where seconds round up to 60:
|
|
74
|
+
if (seconds === 60) {
|
|
75
|
+
return [degrees, minutes + 1, 0];
|
|
76
|
+
}
|
|
77
|
+
// Handle case where minutes roll over to 60:
|
|
78
|
+
if (minutes === 60) {
|
|
79
|
+
return [degrees + 1, 0, seconds];
|
|
80
|
+
}
|
|
24
81
|
return [degrees, minutes, seconds];
|
|
25
82
|
};
|
|
26
83
|
/**
|
|
27
84
|
* Convert degrees, minutes and seconds to a float value.
|
|
28
|
-
* @param d Degrees
|
|
29
|
-
* @param m Minutes
|
|
30
|
-
* @param s Seconds
|
|
31
|
-
* @returns Float
|
|
85
|
+
* @param d Degrees (can be positive or negative)
|
|
86
|
+
* @param m Minutes (0-59)
|
|
87
|
+
* @param s Seconds (0-59)
|
|
88
|
+
* @returns Float decimal degrees, preserving sign of degrees.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```ts
|
|
92
|
+
* DMS.toFloat(23, 26, 22); // returns approximately 23.4394
|
|
93
|
+
* DMS.toFloat(-73, 59, 9); // returns approximately -73.9858
|
|
94
|
+
* ```
|
|
32
95
|
*/
|
|
33
96
|
DMS.toFloat = function (d, m, s) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return d + m / 60 + s / 3600;
|
|
97
|
+
// Clamp minutes and seconds within valid ranges
|
|
98
|
+
var minutes = Math.min(Math.max(m, 0), 59);
|
|
99
|
+
var seconds = Math.min(Math.max(s, 0), 59);
|
|
100
|
+
// Preserve sign of degrees for final float
|
|
101
|
+
var sign = d < 0 ? -1 : 1;
|
|
102
|
+
var absDegrees = Math.abs(d);
|
|
103
|
+
var floatValue = absDegrees + minutes / 60 + seconds / 3600;
|
|
104
|
+
return floatValue * sign;
|
|
43
105
|
};
|
|
44
106
|
return DMS;
|
|
45
107
|
}());
|
package/package.json
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
interface IProps {
|
|
3
|
-
/** @ignore */
|
|
4
|
-
className?: string;
|
|
5
|
-
/**
|
|
6
|
-
* If set, allows a file filter, e.g. `.xls,.xlsx`.
|
|
7
|
-
* This does _not_ prevent the user to upload another kind of file.
|
|
8
|
-
*/
|
|
9
|
-
accept?: string;
|
|
10
|
-
onDragover: () => void;
|
|
11
|
-
onDragLeave: () => void;
|
|
12
|
-
onAddFiles: (files: File[]) => void;
|
|
13
|
-
/** Is box currently hovered (with a file)? */
|
|
14
|
-
hover: boolean;
|
|
15
|
-
/** Optional custom hint message. */
|
|
16
|
-
message?: React.ReactNode;
|
|
17
|
-
}
|
|
18
|
-
declare const Dropbox: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<IProps, never>> & string & Omit<(props: IProps) => React.JSX.Element, keyof React.Component<any, {}, any>>;
|
|
19
|
-
export { Dropbox };
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
import * as React from 'react';
|
|
6
|
-
import styled, { css } from 'styled-components';
|
|
7
|
-
import { SVG } from '../../svg';
|
|
8
|
-
var DropboxBase = function (props) {
|
|
9
|
-
var _a;
|
|
10
|
-
var inputElement = React.useRef(null);
|
|
11
|
-
var handleClick = function () {
|
|
12
|
-
inputElement.current.click();
|
|
13
|
-
};
|
|
14
|
-
var fileListToArray = function (list) {
|
|
15
|
-
var array = [];
|
|
16
|
-
for (var i = 0; i < list.length; i++) {
|
|
17
|
-
array.push(list.item(i));
|
|
18
|
-
}
|
|
19
|
-
return array;
|
|
20
|
-
};
|
|
21
|
-
var handleAddFile = function (e) {
|
|
22
|
-
var list = e.target.files;
|
|
23
|
-
var arr = fileListToArray(list);
|
|
24
|
-
props.onAddFiles(arr);
|
|
25
|
-
};
|
|
26
|
-
var handleDragOver = function (e) {
|
|
27
|
-
e.preventDefault();
|
|
28
|
-
props.onDragover();
|
|
29
|
-
};
|
|
30
|
-
var handleDragLeave = function (e) {
|
|
31
|
-
props.onDragLeave();
|
|
32
|
-
};
|
|
33
|
-
var handleDrop = function (e) {
|
|
34
|
-
e.preventDefault();
|
|
35
|
-
var files = e.dataTransfer.files;
|
|
36
|
-
var array = fileListToArray(files);
|
|
37
|
-
props.onAddFiles(array);
|
|
38
|
-
};
|
|
39
|
-
return (React.createElement("div", { className: props.className, onClick: handleClick, onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop },
|
|
40
|
-
React.createElement("div", null, (_a = props.message) !== null && _a !== void 0 ? _a : "Drop a file here to upload, or click to select."),
|
|
41
|
-
React.createElement("svg", null,
|
|
42
|
-
React.createElement("use", { xlinkHref: SVG.Other.CloudUpload })),
|
|
43
|
-
React.createElement("input", { ref: inputElement, type: "file", accept: props.accept, multiple: true, onChange: handleAddFile })));
|
|
44
|
-
};
|
|
45
|
-
var Dropbox = styled(DropboxBase)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: relative;\n border: dashed 2px ", ";\n border-radius: ", "px;\n cursor: pointer;\n width: 100%;\n text-align: center;\n\n ", "\n\n div {\n margin-top: 8px;\n font-weight: 500;\n color: ", ";\n }\n\n svg {\n display: block;\n margin: 8px;\n width: 100%;\n height: 150px;\n fill: ", ";\n }\n\n input {\n display: none;\n }\n"], ["\n position: relative;\n border: dashed 2px ", ";\n border-radius: ", "px;\n cursor: pointer;\n width: 100%;\n text-align: center;\n\n ", "\n\n div {\n margin-top: 8px;\n font-weight: 500;\n color: ", ";\n }\n\n svg {\n display: block;\n margin: 8px;\n width: 100%;\n height: 150px;\n fill: ", ";\n }\n\n input {\n display: none;\n }\n"])), function (p) { return p.hover ? p.theme.colors.neutral[100] : p.theme.colors.neutral[80]; }, function (p) { return p.theme.radius.normal; }, function (p) { return p.hover && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background: ", ";\n "], ["\n background: ", ";\n "])), p.theme.colors.primary[3]); }, function (p) { return p.hover ? p.theme.colors.neutral[100] : p.theme.colors.neutral[80]; }, function (p) { return p.hover ? p.theme.colors.primary[1] : p.theme.colors.primary[2]; });
|
|
46
|
-
export { Dropbox };
|
|
47
|
-
var templateObject_1, templateObject_2;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { IListViewProps } from './IListViewProps';
|
|
3
|
-
import { IColumnProps } from './Column';
|
|
4
|
-
interface IProps extends IListViewProps {
|
|
5
|
-
className?: string;
|
|
6
|
-
columns: IColumnProps[];
|
|
7
|
-
}
|
|
8
|
-
declare const Ghost: (props: IProps) => React.JSX.Element;
|
|
9
|
-
export { Ghost };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
import * as React from 'react';
|
|
6
|
-
import styled, { keyframes } from 'styled-components';
|
|
7
|
-
var SortButtonBase = function (props) {
|
|
8
|
-
return (React.createElement("div", { className: props.className },
|
|
9
|
-
React.createElement("svg", { viewBox: "0 0 100 100" },
|
|
10
|
-
React.createElement("path", { className: "bottom", d: "M9.5,77.9h81c4.3,0,8.1,3.3,8.1,7.2v6.1c0,3.9-3.8,7.2-8.1,7.2h-81c-4.3,0-8.1-3.3-8.1-7.2\r\n v-6.1C1.4,81.2,5.2,77.9,9.5,77.9z" }),
|
|
11
|
-
React.createElement("path", { className: "middle", d: "M9.5,39.5h52.9c4.3,0,8.1,3.3,8.1,7.2v6.1c0,3.9-3.8,7.2-8.1,7.2H9.5c-4.3,0-8.1-3.3-8.1-7.2\r\n v-6.1C1.4,42.9,5.2,39.5,9.5,39.5z" }),
|
|
12
|
-
React.createElement("path", { className: "top", d: "M10,1.1h24.8c4.9,0,8.6,3.3,8.6,7.2v6.1c0,3.9-3.8,7.2-8.6,7.2H10c-4.9,0-8.6-3.3-8.6-7.2V8.4\r\n C1.4,3.9,5.2,1.1,10,1.1z" }))));
|
|
13
|
-
};
|
|
14
|
-
var SortIconAnimation = keyframes(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n 0% {\n opacity: 1;\n }\n 40% {\n opacity: 0;\n }\n 60% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n"], ["\n 0% {\n opacity: 1;\n }\n 40% {\n opacity: 0;\n }\n 60% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n"
|
|
15
|
-
/**
|
|
16
|
-
* The SortButton displays a caret that rotates and lights up depending on
|
|
17
|
-
* its active/reverse props.
|
|
18
|
-
*/
|
|
19
|
-
])));
|
|
20
|
-
/**
|
|
21
|
-
* The SortButton displays a caret that rotates and lights up depending on
|
|
22
|
-
* its active/reverse props.
|
|
23
|
-
*/
|
|
24
|
-
var SortButton = styled(SortButtonBase)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n // Position\n position: relative;\n display: flex; // Needed for SVG to be centered in div.\n width: 12px;\n height: 12px;\n\n // Appearance\n transition: opacity ease-in-out 150ms,\n transform ease-in-out 150ms;\n transform: scaleY(", ");\n opacity: ", ";\n\n svg {\n transition: fill ease-in-out 150ms;\n fill: ", ";\n path.top, path.middle, path.bottom {\n transform-origin: 0 0;\n animation-name: ", ";\n // Animation duration is set by parent TableHeaderCell.\n animation-duration: 0s;\n animation-timing-function: linear;\n animation-iteration-count: infinite;\n }\n path.middle {\n animation-delay: 0.25s;\n }\n path.bottom {\n animation-delay: 0.5s;\n } \n }\n"], ["\n // Position\n position: relative;\n display: flex; // Needed for SVG to be centered in div.\n width: 12px;\n height: 12px;\n\n // Appearance\n transition: opacity ease-in-out 150ms,\n transform ease-in-out 150ms;\n transform: scaleY(", ");\n opacity: ", ";\n\n svg {\n transition: fill ease-in-out 150ms;\n fill: ", ";\n path.top, path.middle, path.bottom {\n transform-origin: 0 0;\n animation-name: ", ";\n // Animation duration is set by parent TableHeaderCell.\n animation-duration: 0s;\n animation-timing-function: linear;\n animation-iteration-count: infinite;\n }\n path.middle {\n animation-delay: 0.25s;\n }\n path.bottom {\n animation-delay: 0.5s;\n } \n }\n"])), function (p) { return p.reverse ? -1 : 1; }, function (p) { return p.active ? 1 : 0; }, function (p) { return p.dark ? p.theme.colors.primary[1] : p.theme.colors.neutral[10]; }, SortIconAnimation);
|
|
25
|
-
export { SortButton };
|
|
26
|
-
var templateObject_1, templateObject_2;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Locale } from 'date-fns';
|
|
3
|
-
interface IProps {
|
|
4
|
-
/**
|
|
5
|
-
* Date/time to format.
|
|
6
|
-
*/
|
|
7
|
-
value: Date | string;
|
|
8
|
-
/**
|
|
9
|
-
* Optional locale.
|
|
10
|
-
*/
|
|
11
|
-
locale?: Locale;
|
|
12
|
-
/**
|
|
13
|
-
* A strict formatter does not use helpers like 'almost', 'over',
|
|
14
|
-
* 'less than' and the like.
|
|
15
|
-
*/
|
|
16
|
-
strict?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* If set, value gets updated every second.
|
|
19
|
-
* @default false
|
|
20
|
-
*/
|
|
21
|
-
animated?: boolean;
|
|
22
|
-
}
|
|
23
|
-
declare const DistanceDate: ({ animated, ...props }: IProps) => React.JSX.Element;
|
|
24
|
-
export { DistanceDate, IProps };
|
package/formatters/GIS/toDMS.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { DMS } from '../../helper/DMS';
|
|
2
|
-
function toDMS(value, defaultStr, max, positive, negative) {
|
|
3
|
-
// Convert value to number if it is a string:
|
|
4
|
-
value = typeof value == 'number' ? value : parseFloat(value);
|
|
5
|
-
if (isNaN(value) || value < -max || value > max)
|
|
6
|
-
return defaultStr ? defaultStr : "(no coordinates)";
|
|
7
|
-
var _a = DMS.toDMS(value), d = _a[0], m = _a[1], s = _a[2];
|
|
8
|
-
var ms = m.toString();
|
|
9
|
-
if (ms.length < 2)
|
|
10
|
-
ms = "0" + ms;
|
|
11
|
-
var ss = s.toFixed(0);
|
|
12
|
-
if (ss.length < 2)
|
|
13
|
-
ss = "0" + ss;
|
|
14
|
-
return "".concat(d, "\u00B0 ").concat(ms, "\u2032 ").concat(ss, "\u2033 ").concat(d >= 0 ? positive : negative);
|
|
15
|
-
}
|
|
16
|
-
export { toDMS };
|
|
File without changes
|
|
File without changes
|