@box/metadata-editor 0.59.1 → 0.59.2
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/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-instance-entry.js +13 -14
- package/package.json +2 -2
- package/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/convertDate.js +0 -25
- package/types/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/convertDate.d.ts +0 -30
@@ -1,12 +1,11 @@
|
|
1
1
|
import "../../../../../../styles/metadata-instance-entry.css";
|
2
2
|
import { Text as o } from "@box/blueprint-web";
|
3
|
-
import { FormattedDate as
|
4
|
-
import
|
5
|
-
import
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
}, S = ({
|
3
|
+
import { FormattedDate as m } from "react-intl";
|
4
|
+
import d from "../../../interactive-text/interactive-text.js";
|
5
|
+
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
6
|
+
const f = "_metadataInstanceEntry_kd217_1", y = {
|
7
|
+
metadataInstanceEntry: f
|
8
|
+
}, D = ({
|
10
9
|
description: a,
|
11
10
|
name: e,
|
12
11
|
shouldHideEmptyValues: i,
|
@@ -21,23 +20,23 @@ const l = "_metadataInstanceEntry_kd217_1", p = {
|
|
21
20
|
if (Array.isArray(t))
|
22
21
|
return t.join(", ");
|
23
22
|
if (c === "date" && typeof t == "string") {
|
24
|
-
const
|
25
|
-
return /* @__PURE__ */ r(
|
23
|
+
const s = new Date(t);
|
24
|
+
return /* @__PURE__ */ r(m, {
|
26
25
|
day: "numeric",
|
27
26
|
month: "long",
|
28
|
-
value:
|
27
|
+
value: s,
|
29
28
|
year: "numeric"
|
30
29
|
});
|
31
30
|
}
|
32
31
|
return t;
|
33
32
|
})();
|
34
|
-
return i && !n ? null : /* @__PURE__ */
|
35
|
-
className:
|
33
|
+
return i && !n ? null : /* @__PURE__ */ l("div", {
|
34
|
+
className: y.metadataInstanceEntry,
|
36
35
|
children: [/* @__PURE__ */ r(o, {
|
37
36
|
as: "p",
|
38
37
|
color: "textOnLightSecondary",
|
39
38
|
variant: "bodyDefaultBold",
|
40
|
-
children: a ? /* @__PURE__ */ r(
|
39
|
+
children: a ? /* @__PURE__ */ r(d, {
|
41
40
|
as: "span",
|
42
41
|
color: "textOnLightSecondary",
|
43
42
|
tooltipText: a,
|
@@ -51,5 +50,5 @@ const l = "_metadataInstanceEntry_kd217_1", p = {
|
|
51
50
|
});
|
52
51
|
};
|
53
52
|
export {
|
54
|
-
|
53
|
+
D as MetadataInstanceEntry
|
55
54
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@box/metadata-editor",
|
3
|
-
"version": "0.59.
|
3
|
+
"version": "0.59.2",
|
4
4
|
"peerDependencies": {
|
5
5
|
"@ariakit/react": "0.4.5",
|
6
6
|
"@box/blueprint-web": "^7.20.0",
|
@@ -53,5 +53,5 @@
|
|
53
53
|
"**/*.css"
|
54
54
|
],
|
55
55
|
"license": "SEE LICENSE IN LICENSE",
|
56
|
-
"gitHead": "
|
56
|
+
"gitHead": "b441185a01ca9a0035a2e73c02d7f55c74ecc0ee"
|
57
57
|
}
|
@@ -1,25 +0,0 @@
|
|
1
|
-
const O = /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,3})?/, E = /(Z$)/, T = /(?:[+-](?:([0-2]\d$)|([0-2]\d(?:00|30)$)|([0-2]\d:(?:00|30)$)))/, I = new RegExp(`^(${O.source})?(${E.source}|${T.source})$`), _ = 1, M = 2, S = 3, i = 4, r = 5, f = 6, D = 7;
|
2
|
-
function u(n) {
|
3
|
-
if (I.test(n)) {
|
4
|
-
const t = n.split(I);
|
5
|
-
let e = t[_];
|
6
|
-
const o = t[M], s = t[S];
|
7
|
-
if (o || (e += ".000"), t[i])
|
8
|
-
return n;
|
9
|
-
if (t[r])
|
10
|
-
return `${e + s}:00`;
|
11
|
-
if (t[f])
|
12
|
-
return `${e + s.substring(0, 3)}:${s.substring(3)}`;
|
13
|
-
if (t[D])
|
14
|
-
return n;
|
15
|
-
}
|
16
|
-
return n;
|
17
|
-
}
|
18
|
-
function N(n) {
|
19
|
-
const t = new Date(u(n)), e = t.getTime(), s = t.getTimezoneOffset() * 6e4, c = e + s;
|
20
|
-
return new Date(c);
|
21
|
-
}
|
22
|
-
export {
|
23
|
-
N as convertISOStringToUTCDate,
|
24
|
-
u as convertISOStringtoRFC3339String
|
25
|
-
};
|
@@ -1,30 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Will convert ISO8601-compatible dates (with zone designators)
|
3
|
-
* 2018-06-13T00:00:00.000-0500
|
4
|
-
* or
|
5
|
-
* 2018-06-13T00:00:00.000-05
|
6
|
-
*
|
7
|
-
* to
|
8
|
-
* 2018-06-13T00:00:00.000-05:00
|
9
|
-
*
|
10
|
-
* Equivalent formats between the two (e.g., uzing 'Z') will remain unchanged.
|
11
|
-
* If the date format cannot be converted, it will pass along the existing value
|
12
|
-
*
|
13
|
-
* @public
|
14
|
-
* @param isoString - the date to be converted
|
15
|
-
* @returns converted date format, if applicable
|
16
|
-
*/
|
17
|
-
export declare function convertISOStringtoRFC3339String(isoString: string): string;
|
18
|
-
/**
|
19
|
-
* Will convert
|
20
|
-
* 2018-06-13T00:00:00.000Z
|
21
|
-
* to
|
22
|
-
* 2018-06-13T07:00:00.000Z
|
23
|
-
*
|
24
|
-
* This is the opposite of convertDateToUnixMidnightTime
|
25
|
-
*
|
26
|
-
* @public
|
27
|
-
* @param isoString - ISO string in UTC time zone
|
28
|
-
* @returns date in UTC time zone
|
29
|
-
*/
|
30
|
-
export declare function convertISOStringToUTCDate(isoString: string): Date;
|