@box/metadata-editor 1.36.1 → 1.36.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/dist/chunks/utils2.js +40 -32
- package/dist/esm/lib/components/metadata-editor-fields/utils.js +4 -3
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-instance-entry.js +29 -29
- package/dist/styles/metadata-instance-entry.css +1 -1
- package/dist/styles/utils.css +1 -1
- package/dist/types/lib/test-utils/sample-data.d.ts +11 -1
- package/package.json +1 -1
package/dist/chunks/utils2.js
CHANGED
|
@@ -1,41 +1,49 @@
|
|
|
1
|
-
import { BoxAiLogo as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
className:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
})
|
|
1
|
+
import { BoxAiLogo as _ } from "@box/blueprint-web-assets/icons/Logo";
|
|
2
|
+
import p from "clsx";
|
|
3
|
+
import b from "../esm/lib/components/interactive-text/interactive-text.js";
|
|
4
|
+
import { convertISOStringtoRFC3339String as d } from "../esm/lib/utils/convertDate.js";
|
|
5
|
+
import { jsxs as u, jsx as n } from "react/jsx-runtime";
|
|
6
|
+
import '../styles/utils.css';const g = "_noAttributesText_1n8yf_2", f = "_fieldWrapper_1n8yf_6", m = "_hasSuggestion_1n8yf_11", x = "_dateField_1n8yf_33", T = "_suggestionApplied_1n8yf_37", y = "_labelWrapper_1n8yf_52", h = "_labelText_1n8yf_58", A = "_labelTruncated_1n8yf_61", N = "_labelIcon_1n8yf_68", l = {
|
|
7
|
+
noAttributesText: g,
|
|
8
|
+
fieldWrapper: f,
|
|
9
|
+
hasSuggestion: m,
|
|
10
|
+
dateField: x,
|
|
11
|
+
suggestionApplied: T,
|
|
12
|
+
labelWrapper: y,
|
|
13
|
+
labelText: h,
|
|
14
|
+
labelTruncated: A,
|
|
15
|
+
labelIcon: N
|
|
16
|
+
}, v = (t, e, a = !1, o = "label") => (c) => {
|
|
17
|
+
const {
|
|
18
|
+
className: i,
|
|
19
|
+
...s
|
|
20
|
+
} = c, r = p(i || l.labelText, l.labelTruncated);
|
|
21
|
+
return /* @__PURE__ */ u("div", {
|
|
22
|
+
className: l.labelWrapper,
|
|
23
|
+
children: [e ? /* @__PURE__ */ n(b, {
|
|
24
|
+
as: o,
|
|
25
|
+
className: r,
|
|
26
|
+
tooltipText: e,
|
|
27
|
+
...s,
|
|
28
|
+
children: t
|
|
29
|
+
}) : /* @__PURE__ */ n("label", {
|
|
30
|
+
className: r,
|
|
31
|
+
...s,
|
|
32
|
+
children: t
|
|
33
|
+
}), a && /* @__PURE__ */ n(_, {
|
|
34
|
+
className: l.labelIcon
|
|
35
|
+
})]
|
|
36
|
+
});
|
|
37
|
+
}, C = (t) => {
|
|
30
38
|
try {
|
|
31
|
-
const e =
|
|
39
|
+
const e = d(t), a = new Date(e);
|
|
32
40
|
return isNaN(a.getTime()) ? null : e;
|
|
33
41
|
} catch {
|
|
34
42
|
return null;
|
|
35
43
|
}
|
|
36
44
|
};
|
|
37
45
|
export {
|
|
38
|
-
|
|
46
|
+
v as g,
|
|
39
47
|
l as s,
|
|
40
|
-
|
|
48
|
+
C as t
|
|
41
49
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import "@box/blueprint-web-assets/icons/Logo";
|
|
2
|
+
import "clsx";
|
|
2
3
|
import "../interactive-text/interactive-text.js";
|
|
3
|
-
import { g as
|
|
4
|
+
import { g as a, t as g } from "../../../../chunks/utils2.js";
|
|
4
5
|
import "../../utils/convertDate.js";
|
|
5
6
|
import "react/jsx-runtime";
|
|
6
7
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
a as getFieldLabel,
|
|
9
|
+
g as tryParseDateSuggestion
|
|
9
10
|
};
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { Text as i } from "@box/blueprint-web";
|
|
2
|
-
import { FormattedDate as
|
|
2
|
+
import { FormattedDate as u } from "react-intl";
|
|
3
3
|
import { convertISOStringToUTCDate as h } from "../../../../utils/convertDate.js";
|
|
4
|
-
import
|
|
5
|
-
import { MetadataEntryDisplay as
|
|
6
|
-
import { jsxs as x, jsx as
|
|
7
|
-
import '../../../../../../styles/metadata-instance-entry.css';const
|
|
8
|
-
metadataInstanceEntry:
|
|
4
|
+
import p from "../../../interactive-text/interactive-text.js";
|
|
5
|
+
import { MetadataEntryDisplay as g } from "./metadata-entry-display.js";
|
|
6
|
+
import { jsxs as x, jsx as a } from "react/jsx-runtime";
|
|
7
|
+
import '../../../../../../styles/metadata-instance-entry.css';const D = "_metadataInstanceEntry_1alge_1", I = "_name_1alge_6", r = {
|
|
8
|
+
metadataInstanceEntry: D,
|
|
9
|
+
name: I
|
|
9
10
|
}, B = ({
|
|
10
11
|
description: n,
|
|
11
|
-
name:
|
|
12
|
+
name: e,
|
|
12
13
|
shouldHideEmptyValues: c,
|
|
13
14
|
type: o,
|
|
14
15
|
value: t,
|
|
15
16
|
taxonomyNodeFetcher: s,
|
|
16
|
-
taxonomyKey:
|
|
17
|
-
scope:
|
|
18
|
-
isExternallyOwned:
|
|
17
|
+
taxonomyKey: l,
|
|
18
|
+
scope: d,
|
|
19
|
+
isExternallyOwned: f
|
|
19
20
|
}) => {
|
|
20
|
-
const
|
|
21
|
+
const m = (() => {
|
|
21
22
|
if (typeof t == "number")
|
|
22
23
|
return t.toString();
|
|
23
24
|
if (!t)
|
|
@@ -25,42 +26,41 @@ import '../../../../../../styles/metadata-instance-entry.css';const g = "_metada
|
|
|
25
26
|
if (Array.isArray(t))
|
|
26
27
|
return t.join(", ");
|
|
27
28
|
if (o === "date" && typeof t == "string") {
|
|
28
|
-
const
|
|
29
|
-
return /* @__PURE__ */
|
|
29
|
+
const y = h(t);
|
|
30
|
+
return /* @__PURE__ */ a(u, {
|
|
30
31
|
day: "numeric",
|
|
31
32
|
month: "long",
|
|
32
|
-
value:
|
|
33
|
+
value: y,
|
|
33
34
|
year: "numeric"
|
|
34
35
|
});
|
|
35
36
|
}
|
|
36
37
|
return t;
|
|
37
38
|
})();
|
|
38
|
-
return c && !
|
|
39
|
-
className:
|
|
40
|
-
children: [/* @__PURE__ */
|
|
39
|
+
return c && !m ? null : /* @__PURE__ */ x("div", {
|
|
40
|
+
className: r.metadataInstanceEntry,
|
|
41
|
+
children: [/* @__PURE__ */ a(i, {
|
|
41
42
|
as: "h5",
|
|
42
43
|
color: "textOnLightSecondary",
|
|
43
44
|
variant: "bodyDefaultBold",
|
|
44
|
-
children: n ? /* @__PURE__ */
|
|
45
|
+
children: n ? /* @__PURE__ */ a(p, {
|
|
45
46
|
as: "span",
|
|
46
47
|
color: "textOnLightSecondary",
|
|
47
48
|
tooltipText: n,
|
|
48
49
|
variant: "bodyDefaultBold",
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
className: r.name,
|
|
51
|
+
children: e
|
|
52
|
+
}) : /* @__PURE__ */ a(i, {
|
|
51
53
|
as: "h5",
|
|
52
54
|
color: "textOnLightSecondary",
|
|
53
|
-
style: {
|
|
54
|
-
width: "fit-content"
|
|
55
|
-
},
|
|
56
55
|
variant: "bodyDefaultBold",
|
|
57
|
-
|
|
56
|
+
className: r.name,
|
|
57
|
+
children: e
|
|
58
58
|
})
|
|
59
|
-
}), /* @__PURE__ */
|
|
60
|
-
formattedValue:
|
|
61
|
-
isExternallyOwned:
|
|
62
|
-
scope:
|
|
63
|
-
taxonomyKey:
|
|
59
|
+
}), /* @__PURE__ */ a(g, {
|
|
60
|
+
formattedValue: m,
|
|
61
|
+
isExternallyOwned: f,
|
|
62
|
+
scope: d,
|
|
63
|
+
taxonomyKey: l,
|
|
64
64
|
taxonomyNodeFetcher: s,
|
|
65
65
|
type: o,
|
|
66
66
|
value: t
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._metadataInstanceEntry_1alge_1{display:flex;flex-direction:column;gap:var(--space-2)}._metadataInstanceEntry_1alge_1 ._name_1alge_6{display:block;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
package/dist/styles/utils.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._noAttributesText_1n8yf_2{text-align:center}._fieldWrapper_1n8yf_6{position:relative;isolation:isolate}._fieldWrapper_1n8yf_6 ._hasSuggestion_1n8yf_11>input,._fieldWrapper_1n8yf_6 ._hasSuggestion_1n8yf_11>button,._fieldWrapper_1n8yf_6 ._hasSuggestion_1n8yf_11>div[role=group]>div,._fieldWrapper_1n8yf_6 ._hasSuggestion_1n8yf_11>div>div,._fieldWrapper_1n8yf_6 ._hasSuggestion_1n8yf_11>div>input{border-bottom:none!important;border-bottom-right-radius:0!important;border-bottom-left-radius:0!important}._fieldWrapper_1n8yf_6 ._hasSuggestion_1n8yf_11>input:not(:disabled):not(:focus-visible):not(._error_1n8yf_20):hover,._fieldWrapper_1n8yf_6 ._hasSuggestion_1n8yf_11>button:not(:disabled):not(:focus-visible):not(._error_1n8yf_20):hover,._fieldWrapper_1n8yf_6 ._hasSuggestion_1n8yf_11>div[role=group]>div:not(:disabled):not(:focus-visible):not(._error_1n8yf_20):hover,._fieldWrapper_1n8yf_6 ._hasSuggestion_1n8yf_11>div>div:not(:disabled):not(:focus-visible):not(._error_1n8yf_20):hover,._fieldWrapper_1n8yf_6 ._hasSuggestion_1n8yf_11>div>input:not(:disabled):not(:focus-visible):not(._error_1n8yf_20):hover{border-bottom:none}._fieldWrapper_1n8yf_6 ._hasSuggestion_1n8yf_11 div[role=group]>div{margin-right:var(--border-1);margin-left:var(--border-1)}._fieldWrapper_1n8yf_6 ._dateField_1n8yf_33>div[role=group]>div{padding-inline:.75rem}._fieldWrapper_1n8yf_6 ._suggestionApplied_1n8yf_37>._comboboxContainer_1n8yf_37,._fieldWrapper_1n8yf_6 ._suggestionApplied_1n8yf_37>input,._fieldWrapper_1n8yf_6 ._suggestionApplied_1n8yf_37>button,._fieldWrapper_1n8yf_6 ._suggestionApplied_1n8yf_37>div[role=group]>div,._fieldWrapper_1n8yf_6 ._suggestionApplied_1n8yf_37>div>div,._fieldWrapper_1n8yf_6 ._suggestionApplied_1n8yf_37>div>input{box-sizing:border-box!important;background-image:linear-gradient(#fff,#fff),linear-gradient(135deg,#fe03dc,#2784fa)!important;background-clip:padding-box,border-box!important;background-origin:border-box!important;border:double var(--border-1) transparent!important;border-radius:var(--radius-2);outline:none}._labelWrapper_1n8yf_52{display:flex;align-items:baseline;justify-content:space-between;width:100%}._labelWrapper_1n8yf_52 ._labelText_1n8yf_58{flex:unset!important}._labelWrapper_1n8yf_52 ._labelTruncated_1n8yf_61{flex:0 1 auto!important;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._labelWrapper_1n8yf_52 ._labelIcon_1n8yf_68{flex-shrink:0;width:var(--space-4);height:var(--space-4);margin-inline-end:var(--space-3);margin-inline-start:var(--space-3)}
|
|
@@ -17,6 +17,14 @@ declare const taxonomySingleSelectSingleLevelFieldWithValue: MetadataTemplateFie
|
|
|
17
17
|
declare const taxonomyMultiSelectSingleLevelFieldWithValue: MetadataTemplateField;
|
|
18
18
|
declare const hiddenField: MetadataTemplateField;
|
|
19
19
|
declare const noValueField: MetadataTemplateField;
|
|
20
|
+
declare const longFieldNameStringField: MetadataTemplateField;
|
|
21
|
+
declare const longFieldNameStringFieldWithValue: MetadataTemplateField;
|
|
22
|
+
declare const longFieldNameStringFieldWithDescription: MetadataTemplateField;
|
|
23
|
+
declare const longFieldNameStringFieldWithDescriptionAndValue: MetadataTemplateField;
|
|
24
|
+
declare const longFieldNameEnumField: MetadataTemplateField;
|
|
25
|
+
declare const longFieldNameEnumFieldWithValue: MetadataTemplateField;
|
|
26
|
+
declare const longFieldNameEnumFieldWithDescription: MetadataTemplateField;
|
|
27
|
+
declare const longFieldNameEnumFieldWithDescriptionAndValue: MetadataTemplateField;
|
|
20
28
|
declare const allFieldsTemplate: MetadataTemplate;
|
|
21
29
|
declare const nonHiddenFieldsTemplate: MetadataTemplate;
|
|
22
30
|
declare const nonHiddenFieldsTemplateWithUpdateMode: MetadataTemplate;
|
|
@@ -45,6 +53,8 @@ declare const templateInstanceWithoutEditPermissions: MetadataTemplateInstance;
|
|
|
45
53
|
declare const customTemplateInstanceWithoutEditPermissions: MetadataTemplateInstance;
|
|
46
54
|
declare const hiddenTemplateInstance: MetadataTemplateInstance;
|
|
47
55
|
declare const shortTemplateInstance: MetadataTemplateInstance;
|
|
56
|
+
declare const longFieldNameTemplateInstance: MetadataTemplateInstance;
|
|
57
|
+
declare const longFieldNameTemplateInstanceWithAiSuggestions: MetadataTemplateInstance;
|
|
48
58
|
declare const templateInstancesList: MetadataTemplateInstance[];
|
|
49
59
|
declare const allFieldsWithAiSuggestions: MetadataTemplateField[];
|
|
50
60
|
declare const allFieldsSuggestions: AutofillSuggestions;
|
|
@@ -54,4 +64,4 @@ declare const firstTemplateInstanceFieldsWithSuggestions: MetadataTemplateField[
|
|
|
54
64
|
declare const secondTemplateInstance: MetadataTemplate;
|
|
55
65
|
declare const secondTemplateSuggestions: AutofillSuggestions;
|
|
56
66
|
declare const secondTemplateInstanceFieldsWithSuggestions: MetadataTemplateField[];
|
|
57
|
-
export { allFieldsSuggestions, allFieldsTemplate, allFieldsTemplateInstance, allFieldsTemplateInstanceAiSuggestions, allFieldsTemplateInstanceWithoutTaxonomies, allFieldsWithAiSuggestions, customTemplate, customTemplateInstance, customTemplateInstanceWithAllFieldsEmpty, customTemplateInstanceWithoutEditPermissions, customTemplateInstanceWithoutEmptyValues, dateField, dateSuggestionTemplateInstance, emptyCustomTemplateInstance, emptyTemplateInstance, enumField, fields, firstTemplateInstance, firstTemplateInstanceFieldsWithSuggestions, firstTemplateSuggestions, floatField, floatInstanceField, hiddenField, hiddenTemplate, hiddenTemplateInstance, multiSelectField, noFieldsTemplate, nonHiddenFieldsTemplate, nonHiddenFieldsTemplateWithUpdateMode, nonHiddenFieldsWithValuesTemplate, noValueField, onlyRequiredPropsTemplateInstance, secondTemplateInstance, secondTemplateInstanceFieldsWithSuggestions, secondTemplateSuggestions, shortTemplateInstance, stringField, taxonomyLevels, taxonomyMultiSelectMultiLevelField, taxonomyMultiSelectSingleLevelField, taxonomyMultiSelectSingleLevelFieldWithValue, taxonomySingleSelectMultiLevelField, taxonomySingleSelectSingleLevelField, taxonomySingleSelectSingleLevelFieldWithValue, templateInstancesList, templateInstanceWithAllFieldsEmpty, templateInstanceWithoutEditPermissions, templateInstanceWithoutEmptyValues, templateInstanceWithSomeFieldsEmpty, templateOptions, templates, };
|
|
67
|
+
export { allFieldsSuggestions, allFieldsTemplate, allFieldsTemplateInstance, allFieldsTemplateInstanceAiSuggestions, allFieldsTemplateInstanceWithoutTaxonomies, allFieldsWithAiSuggestions, customTemplate, customTemplateInstance, customTemplateInstanceWithAllFieldsEmpty, customTemplateInstanceWithoutEditPermissions, customTemplateInstanceWithoutEmptyValues, dateField, dateSuggestionTemplateInstance, emptyCustomTemplateInstance, emptyTemplateInstance, enumField, fields, firstTemplateInstance, firstTemplateInstanceFieldsWithSuggestions, firstTemplateSuggestions, floatField, floatInstanceField, hiddenField, hiddenTemplate, hiddenTemplateInstance, longFieldNameEnumField, longFieldNameEnumFieldWithDescription, longFieldNameEnumFieldWithDescriptionAndValue, longFieldNameEnumFieldWithValue, longFieldNameStringField, longFieldNameStringFieldWithDescription, longFieldNameStringFieldWithDescriptionAndValue, longFieldNameStringFieldWithValue, longFieldNameTemplateInstance, longFieldNameTemplateInstanceWithAiSuggestions, multiSelectField, noFieldsTemplate, nonHiddenFieldsTemplate, nonHiddenFieldsTemplateWithUpdateMode, nonHiddenFieldsWithValuesTemplate, noValueField, onlyRequiredPropsTemplateInstance, secondTemplateInstance, secondTemplateInstanceFieldsWithSuggestions, secondTemplateSuggestions, shortTemplateInstance, stringField, taxonomyLevels, taxonomyMultiSelectMultiLevelField, taxonomyMultiSelectSingleLevelField, taxonomyMultiSelectSingleLevelFieldWithValue, taxonomySingleSelectMultiLevelField, taxonomySingleSelectSingleLevelField, taxonomySingleSelectSingleLevelFieldWithValue, templateInstancesList, templateInstanceWithAllFieldsEmpty, templateInstanceWithoutEditPermissions, templateInstanceWithoutEmptyValues, templateInstanceWithSomeFieldsEmpty, templateOptions, templates, };
|