@box/metadata-template-editor 1.20.8 → 1.20.10
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/chip.js +21 -0
- package/dist/chunks/dropdown-field-configuration.js +62 -0
- package/dist/chunks/field-context-menu.js +90 -0
- package/dist/chunks/field-selector.js +23 -0
- package/dist/chunks/field-type-dropdown.js +31 -0
- package/dist/chunks/levels-chain.js +125 -0
- package/dist/chunks/metadata-field-configurator.module.js +17 -16
- package/dist/chunks/metadata-field-list.js +229 -0
- package/dist/chunks/metadata-template-editor-form.js +107 -0
- package/dist/chunks/metadata-template-editor-modal.js +77 -0
- package/dist/chunks/metadata-template-editor.js +157 -0
- package/dist/chunks/sortable-option-list.js +231 -0
- package/dist/chunks/taxonomy-field-configuration.js +126 -0
- package/dist/chunks/taxonomy-field-configurator-initial-state.js +48 -0
- package/dist/chunks/taxonomy-selector.js +90 -0
- package/dist/chunks/types.js +22 -33
- package/dist/esm/index.js +13 -34
- package/dist/esm/lib/components/field-selector/field-selector.js +2 -39
- package/dist/esm/lib/components/field-selector/index.js +2 -4
- package/dist/esm/lib/components/field-selector/messages.js +10 -12
- package/dist/esm/lib/components/field-type-dropdown/field-type-dropdown.js +2 -47
- package/dist/esm/lib/components/field-type-dropdown/index.js +2 -4
- package/dist/esm/lib/components/field-type-dropdown/messages.js +10 -12
- package/dist/esm/lib/components/field-type-tiles/field-type-tiles.js +32 -39
- package/dist/esm/lib/components/field-type-tiles/index.js +2 -4
- package/dist/esm/lib/components/field-type-tiles/messages.js +10 -12
- package/dist/esm/lib/components/metadata-field-configurator/components/confirmation-modal/confirmation-modal.js +32 -45
- package/dist/esm/lib/components/metadata-field-configurator/components/confirmation-modal/messages.js +14 -16
- package/dist/esm/lib/components/metadata-field-configurator/components/field-action-slot/field-action-slot.js +62 -79
- package/dist/esm/lib/components/metadata-field-configurator/components/field-context-menu/field-context-menu.js +2 -115
- package/dist/esm/lib/components/metadata-field-configurator/components/field-edit-content/field-edit-content.js +83 -100
- package/dist/esm/lib/components/metadata-field-configurator/components/levels-chain/chip.js +2 -33
- package/dist/esm/lib/components/metadata-field-configurator/components/levels-chain/index.js +2 -4
- package/dist/esm/lib/components/metadata-field-configurator/components/levels-chain/levels-chain.js +2 -118
- package/dist/esm/lib/components/metadata-field-configurator/components/levels-chain/utils.js +16 -33
- package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/dropdown/__mocks__/getInitialValues.js +34 -32
- package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/dropdown/dropdown-default-values.js +10 -14
- package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/dropdown/dropdown-field-configuration.js +2 -66
- package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/dropdown/sortable-option-list.js +2 -294
- package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/index.js +3 -6
- package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/taxonomy-default-values.js +11 -15
- package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/taxonomy-field-configuration.js +2 -149
- package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/taxonomy-field-configurator-initial-state.js +2 -54
- package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/taxonomy-selector-messages.js +34 -36
- package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/taxonomy-selector.js +2 -103
- package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/useTaxonomySelect.js +15 -19
- package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/utils.js +2 -4
- package/dist/esm/lib/components/metadata-field-configurator/context/field-configurator-context.js +60 -66
- package/dist/esm/lib/components/metadata-field-configurator/context/field-extensions-context.js +5 -8
- package/dist/esm/lib/components/metadata-field-configurator/context/taxonomy-options-context.js +14 -20
- package/dist/esm/lib/components/metadata-field-configurator/hooks/useFieldConfiguratorBehavior.js +99 -118
- package/dist/esm/lib/components/metadata-field-configurator/hooks/useFieldValidation.js +52 -66
- package/dist/esm/lib/components/metadata-field-configurator/hooks/useTaxonomyFetch.js +23 -26
- package/dist/esm/lib/components/metadata-field-configurator/hooks/useTemplateFieldSchema.js +34 -43
- package/dist/esm/lib/components/metadata-field-configurator/index.js +5 -11
- package/dist/esm/lib/components/metadata-field-configurator/messages/configurator-messages.js +131 -134
- package/dist/esm/lib/components/metadata-field-configurator/messages/dropdown-messages.js +34 -36
- package/dist/esm/lib/components/metadata-field-configurator/messages/levels-chain-messages.js +14 -16
- package/dist/esm/lib/components/metadata-field-configurator/messages/taxonomy-messages.js +34 -36
- package/dist/esm/lib/components/metadata-field-configurator/metadata-field-configurator.js +94 -153
- package/dist/esm/lib/components/metadata-field-configurator/utils.js +42 -49
- package/dist/esm/lib/components/metadata-field-list/index.js +2 -5
- package/dist/esm/lib/components/metadata-field-list/metadata-field-list.js +2 -279
- package/dist/esm/lib/components/metadata-template-editor-form/metadata-template-editor-form.js +2 -137
- package/dist/esm/lib/components/metadata-template-editor-modal/index.js +2 -4
- package/dist/esm/lib/components/metadata-template-editor-modal/metadata-template-editor-modal.js +2 -103
- package/dist/esm/lib/hooks/useMetadataTemplateFormSchema.js +13 -15
- package/dist/esm/lib/hooks/useTemplateNameSchema.js +8 -10
- package/dist/esm/lib/index.js +7 -14
- package/dist/esm/lib/messages.js +114 -116
- package/dist/esm/lib/metadata-template-editor.js +2 -182
- package/dist/esm/lib/utils/constants.js +2 -8
- package/dist/esm/lib/utils/field-options/field-type-icon.js +14 -33
- package/dist/esm/lib/utils/field-options/index.js +4 -9
- package/dist/esm/lib/utils/field-options/messages.js +43 -46
- package/dist/esm/lib/utils/field-options/useFieldOptions.js +14 -18
- package/dist/esm/lib/utils/key-generation.js +16 -27
- package/dist/esm/lib/utils/template-type-conversion/convertLocalConfiguratorToTemplateField.js +63 -77
- package/dist/esm/lib/utils/template-type-conversion/convertTemplateFieldToLocalConfigurator.js +69 -89
- package/dist/esm/lib/utils/template-type-conversion/generateJSONPatchTemplateOperations.js +150 -169
- package/dist/esm/lib/utils/template-type-conversion/mapFieldsWithUniqueKeys.js +8 -13
- package/dist/styles/chip.css +1 -1
- package/dist/styles/dropdown-field-configuration.css +1 -1
- package/dist/styles/field-context-menu.css +1 -1
- package/dist/styles/levels-chain.css +1 -1
- package/dist/styles/metadata-field-configurator.css +1 -1
- package/dist/styles/metadata-field-list.css +1 -1
- package/dist/styles/metadata-template-editor-form.css +1 -1
- package/dist/styles/metadata-template-editor-modal.css +1 -1
- package/dist/styles/metadata-template-editor.css +1 -1
- package/dist/styles/sortable-option-list.css +1 -1
- package/dist/styles/taxonomy-field-configuration.css +1 -1
- package/dist/styles/taxonomy-field-configurator-initial-state.css +1 -1
- package/dist/styles/taxonomy-selector.css +1 -1
- package/package.json +7 -7
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { useFieldConfigurator as e } from "../esm/lib/components/metadata-field-configurator/context/field-configurator-context.js";
|
|
2
|
+
import t from "../esm/lib/components/metadata-field-configurator/messages/taxonomy-messages.js";
|
|
3
|
+
import { useTaxonomySelect as n } from "../esm/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/useTaxonomySelect.js";
|
|
4
|
+
import { filterTaxonomiesByValue as r } from "../esm/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/utils.js";
|
|
5
|
+
import { t as i } from "./taxonomy-selector.js";
|
|
6
|
+
import { Text as a } from "@box/blueprint-web";
|
|
7
|
+
import { FormattedMessage as o } from "react-intl";
|
|
8
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
9
|
+
import "react";
|
|
10
|
+
import '../styles/taxonomy-field-configurator-initial-state.css';var l = {
|
|
11
|
+
taxonomyFieldConfiguratorInitialState: "_taxonomyFieldConfiguratorInitialState_il5v7_1",
|
|
12
|
+
subheader: "_subheader_il5v7_10"
|
|
13
|
+
}, u = () => {
|
|
14
|
+
let { values: u, setFieldValue: d } = e(), { onTaxonomySelect: f } = n({
|
|
15
|
+
values: u,
|
|
16
|
+
setFieldValue: d
|
|
17
|
+
});
|
|
18
|
+
return /* @__PURE__ */ c("div", {
|
|
19
|
+
className: l.taxonomyFieldConfiguratorInitialState,
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ s(a, {
|
|
22
|
+
as: "h1",
|
|
23
|
+
color: "textOnLightDefault",
|
|
24
|
+
variant: "titleMedium",
|
|
25
|
+
children: /* @__PURE__ */ s(o, { ...t.callToActionHeader })
|
|
26
|
+
}),
|
|
27
|
+
/* @__PURE__ */ s(a, {
|
|
28
|
+
as: "p",
|
|
29
|
+
className: l.subheader,
|
|
30
|
+
color: "textOnLightDefault",
|
|
31
|
+
variant: "bodyDefault",
|
|
32
|
+
children: /* @__PURE__ */ s(o, { ...t.callToActionSubheader })
|
|
33
|
+
}),
|
|
34
|
+
/* @__PURE__ */ s(i, {
|
|
35
|
+
data: r(u.taxonomy.availableTaxonomies, u.taxonomy.taxonomySearchValue),
|
|
36
|
+
onClick: f,
|
|
37
|
+
resetValueOnHide: !0,
|
|
38
|
+
onSearchValue: (e) => {
|
|
39
|
+
d("taxonomy", {
|
|
40
|
+
...u.taxonomy,
|
|
41
|
+
taxonomySearchValue: e
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
]
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
export { u as t };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { useTaxonomyOptions as e } from "../esm/lib/components/metadata-field-configurator/context/taxonomy-options-context.js";
|
|
2
|
+
import t from "../esm/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/taxonomy-selector-messages.js";
|
|
3
|
+
import { Button as n, LoadingIndicator as r, Popover as i, Text as a, TextInput as o } from "@box/blueprint-web";
|
|
4
|
+
import { useIntl as s } from "react-intl";
|
|
5
|
+
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
6
|
+
import { Plus as d } from "@box/blueprint-web-assets/icons/Fill";
|
|
7
|
+
import { useState as f } from "react";
|
|
8
|
+
import '../styles/taxonomy-selector.css';var p = {
|
|
9
|
+
taxonomySelectorLabel: "_taxonomySelectorLabel_b3aww_1",
|
|
10
|
+
taxonomySelectorSeparator: "_taxonomySelectorSeparator_b3aww_6",
|
|
11
|
+
listWrapper: "_listWrapper_b3aww_14",
|
|
12
|
+
listWrapperWithPadding: "_listWrapperWithPadding_b3aww_19",
|
|
13
|
+
taxonomyItem: "_taxonomyItem_b3aww_24",
|
|
14
|
+
statusContainer: "_statusContainer_b3aww_30"
|
|
15
|
+
}, m = ({ data: m, onClick: h, onSearchValue: g, triggerButton: _, disabled: v, resetValueOnHide: y }) => {
|
|
16
|
+
let { formatMessage: b } = s(), { status: x, onSelectorOpen: S } = e(), [C, w] = f(""), [T, E] = f(!1), D = (e) => {
|
|
17
|
+
w(e), g(e);
|
|
18
|
+
}, O = (e) => {
|
|
19
|
+
E(e), e && S(), !e && y && (w(""), g(""));
|
|
20
|
+
}, k = (e) => {
|
|
21
|
+
h(e), E(!1);
|
|
22
|
+
}, A = _ ?? /* @__PURE__ */ l(n, {
|
|
23
|
+
variant: "secondary",
|
|
24
|
+
size: "large",
|
|
25
|
+
endIcon: d,
|
|
26
|
+
"aria-label": b(t.taxonomySelectorAriaLabel),
|
|
27
|
+
children: b(t.taxonomySelector)
|
|
28
|
+
});
|
|
29
|
+
return /* @__PURE__ */ u(i.Root, {
|
|
30
|
+
modal: !1,
|
|
31
|
+
open: T,
|
|
32
|
+
onOpenChange: O,
|
|
33
|
+
children: [/* @__PURE__ */ l(i.Trigger, {
|
|
34
|
+
disabled: v,
|
|
35
|
+
children: A
|
|
36
|
+
}), /* @__PURE__ */ l(i.ContentContainer, {
|
|
37
|
+
align: "start",
|
|
38
|
+
"aria-label": b(t.taxonomySelector),
|
|
39
|
+
children: x === "loading" ? /* @__PURE__ */ l("div", {
|
|
40
|
+
className: p.statusContainer,
|
|
41
|
+
children: /* @__PURE__ */ l(r, { "aria-label": b(t.loadingTaxonomies) })
|
|
42
|
+
}) : x === "error" ? /* @__PURE__ */ u("div", {
|
|
43
|
+
className: p.statusContainer,
|
|
44
|
+
children: [/* @__PURE__ */ l(a, {
|
|
45
|
+
as: "p",
|
|
46
|
+
variant: "bodyDefault",
|
|
47
|
+
color: "textOnLightSecondary",
|
|
48
|
+
children: b(t.loadTaxonomiesError)
|
|
49
|
+
}), /* @__PURE__ */ l(n, {
|
|
50
|
+
variant: "secondary",
|
|
51
|
+
size: "small",
|
|
52
|
+
onClick: S,
|
|
53
|
+
children: b(t.retryLoadTaxonomies)
|
|
54
|
+
})]
|
|
55
|
+
}) : /* @__PURE__ */ u(c, { children: [
|
|
56
|
+
/* @__PURE__ */ l("div", {
|
|
57
|
+
className: `${p.listWrapper} ${p.listWrapperWithPadding}`,
|
|
58
|
+
children: /* @__PURE__ */ l(o, {
|
|
59
|
+
label: b(t.searchTaxonomiesInputPlaceholder),
|
|
60
|
+
placeholder: b(t.searchTaxonomiesInputPlaceholder),
|
|
61
|
+
value: C,
|
|
62
|
+
onChange: (e) => D(e.target.value),
|
|
63
|
+
hideLabel: !0,
|
|
64
|
+
"aria-label": b(t.searchTaxonomiesInputPlaceholder)
|
|
65
|
+
})
|
|
66
|
+
}),
|
|
67
|
+
/* @__PURE__ */ l(a, {
|
|
68
|
+
as: "span",
|
|
69
|
+
variant: "caption",
|
|
70
|
+
color: "textOnLightSecondary",
|
|
71
|
+
className: p.taxonomySelectorLabel,
|
|
72
|
+
children: b(t.allTaxonomies)
|
|
73
|
+
}),
|
|
74
|
+
/* @__PURE__ */ l("div", {
|
|
75
|
+
className: p.listWrapper,
|
|
76
|
+
children: m.map((e) => /* @__PURE__ */ l(n, {
|
|
77
|
+
type: "button",
|
|
78
|
+
variant: "quaternary",
|
|
79
|
+
size: "large",
|
|
80
|
+
disabled: e?.levels?.length === 0,
|
|
81
|
+
onClick: () => k(e),
|
|
82
|
+
className: p.taxonomyItem,
|
|
83
|
+
children: e.label
|
|
84
|
+
}, e.id))
|
|
85
|
+
})
|
|
86
|
+
] })
|
|
87
|
+
})]
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
export { m as t };
|
package/dist/chunks/types.js
CHANGED
|
@@ -1,34 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
...r
|
|
23
|
-
};
|
|
24
|
-
export {
|
|
25
|
-
c as A,
|
|
26
|
-
o as E,
|
|
27
|
-
i as F,
|
|
28
|
-
u as M,
|
|
29
|
-
d as T,
|
|
30
|
-
n as a,
|
|
31
|
-
l as b,
|
|
32
|
-
e as c,
|
|
33
|
-
r as d
|
|
1
|
+
var e = /* @__PURE__ */ function(e) {
|
|
2
|
+
return e.Create = "create", e.Edit = "edit", e;
|
|
3
|
+
}({}), t = /* @__PURE__ */ function(e) {
|
|
4
|
+
return e.Text = "text", e.Number = "number", e.Date = "date", e.Dropdown = "dropdown", e.Taxonomy = "taxonomy", e;
|
|
5
|
+
}({}), n = /* @__PURE__ */ function(e) {
|
|
6
|
+
return e.RequireSpecific = "requireSpecific", e.AllowAny = "allowAny", e;
|
|
7
|
+
}({}), r = /* @__PURE__ */ function(e) {
|
|
8
|
+
return e.Float = "float", e.Taxonomy = "taxonomy", e.MultiSelect = "multiSelect", e.Date = "date", e.String = "string", e.Enum = "enum", e;
|
|
9
|
+
}({}), i = /* @__PURE__ */ function(e) {
|
|
10
|
+
return e.EditTemplate = "editTemplate", e;
|
|
11
|
+
}({}), a = /* @__PURE__ */ function(e) {
|
|
12
|
+
return e.AddField = "addField", e.ReorderFields = "reorderFields", e.EditField = "editField", e.RemoveField = "removeField", e;
|
|
13
|
+
}({}), o = /* @__PURE__ */ function(e) {
|
|
14
|
+
return e.AddEnumOption = "addEnumOption", e.ReorderEnumOptions = "reorderEnumOptions", e.EditEnumOption = "editEnumOption", e.RemoveEnumOption = "removeEnumOption", e;
|
|
15
|
+
}({}), s = /* @__PURE__ */ function(e) {
|
|
16
|
+
return e.AddMultiSelectOption = "addMultiSelectOption", e.ReorderMultiSelectOptions = "reorderMultiSelectOptions", e.EditMultiSelectOption = "editMultiSelectOption", e.RemoveMultiSelectOption = "removeMultiSelectOption", e;
|
|
17
|
+
}({}), c = {
|
|
18
|
+
...i,
|
|
19
|
+
...a,
|
|
20
|
+
...o,
|
|
21
|
+
...s
|
|
34
22
|
};
|
|
23
|
+
export { t as a, n as c, a as i, i as l, r as n, e as o, o as r, s, c as t };
|
package/dist/esm/index.js
CHANGED
|
@@ -1,34 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { MetadataFieldConfigurator as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
i as ApiMetadataTemplateFieldType,
|
|
15
|
-
l as EnumOperations,
|
|
16
|
-
c as FieldExtensionsContext,
|
|
17
|
-
d as FieldOperations,
|
|
18
|
-
S as FieldSelector,
|
|
19
|
-
p as FieldType,
|
|
20
|
-
D as FieldTypeDropdown,
|
|
21
|
-
n as FieldTypeTiles,
|
|
22
|
-
C as MetadataFieldConfigurator,
|
|
23
|
-
M as MetadataFieldList,
|
|
24
|
-
u as MetadataFieldListDefault,
|
|
25
|
-
a as MetadataTemplateEditor,
|
|
26
|
-
g as MetadataTemplateEditorModal,
|
|
27
|
-
s as MetadataTemplateEditorMode,
|
|
28
|
-
m as MultiSelectOperations,
|
|
29
|
-
x as TaxonomySelection,
|
|
30
|
-
F as TemplateOperations,
|
|
31
|
-
w as createDefaultFieldValues,
|
|
32
|
-
y as useFieldExtensions,
|
|
33
|
-
j as useTemplateFieldSchema
|
|
34
|
-
};
|
|
1
|
+
import { t as e } from "../chunks/field-selector.js";
|
|
2
|
+
import { a as t, c as n, i as r, l as i, n as a, o, r as s, s as c, t as l } from "../chunks/types.js";
|
|
3
|
+
import { t as u } from "../chunks/field-type-dropdown.js";
|
|
4
|
+
import { FieldTypeTiles as d } from "./lib/components/field-type-tiles/field-type-tiles.js";
|
|
5
|
+
import { useTemplateFieldSchema as f } from "./lib/components/metadata-field-configurator/hooks/useTemplateFieldSchema.js";
|
|
6
|
+
import { FieldExtensionsContext as p, useFieldExtensions as m } from "./lib/components/metadata-field-configurator/context/field-extensions-context.js";
|
|
7
|
+
import { createDefaultFieldValues as h } from "./lib/components/metadata-field-configurator/utils.js";
|
|
8
|
+
import { MetadataFieldConfigurator as g } from "./lib/components/metadata-field-configurator/metadata-field-configurator.js";
|
|
9
|
+
import { t as _ } from "../chunks/metadata-field-list.js";
|
|
10
|
+
import { t as v } from "../chunks/metadata-template-editor.js";
|
|
11
|
+
import { t as y } from "../chunks/metadata-template-editor-modal.js";
|
|
12
|
+
import "./lib/components/metadata-template-editor-modal/index.js";
|
|
13
|
+
export { l as AllOps, a as ApiMetadataTemplateFieldType, s as EnumOperations, p as FieldExtensionsContext, r as FieldOperations, e as FieldSelector, t as FieldType, u as FieldTypeDropdown, d as FieldTypeTiles, g as MetadataFieldConfigurator, _ as MetadataFieldList, _ as MetadataFieldListDefault, v as MetadataTemplateEditor, y as MetadataTemplateEditorModal, o as MetadataTemplateEditorMode, c as MultiSelectOperations, n as TaxonomySelection, i as TemplateOperations, h as createDefaultFieldValues, m as useFieldExtensions, f as useTemplateFieldSchema };
|
|
@@ -1,39 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { ChevronDown as d } from "@box/blueprint-web-assets/icons/Medium";
|
|
4
|
-
import i from "./messages.js";
|
|
5
|
-
import { jsxs as s, jsx as r } from "react/jsx-runtime";
|
|
6
|
-
import '../../../../styles/field-selector.css';const a = "_fieldSelectorTrigger_cj5ij_1", g = {
|
|
7
|
-
fieldSelectorTrigger: a
|
|
8
|
-
};
|
|
9
|
-
function T({
|
|
10
|
-
fields: n,
|
|
11
|
-
onSelect: l
|
|
12
|
-
}) {
|
|
13
|
-
const {
|
|
14
|
-
formatMessage: t
|
|
15
|
-
} = m();
|
|
16
|
-
return /* @__PURE__ */ s(e.Root, {
|
|
17
|
-
modal: !1,
|
|
18
|
-
children: [/* @__PURE__ */ r(e.Trigger, {
|
|
19
|
-
children: /* @__PURE__ */ r(c, {
|
|
20
|
-
icon: d,
|
|
21
|
-
className: g.fieldSelectorTrigger,
|
|
22
|
-
variant: "bodyDefaultSemibold",
|
|
23
|
-
color: "textOnLightSecondary",
|
|
24
|
-
children: t(i.selectField)
|
|
25
|
-
})
|
|
26
|
-
}), /* @__PURE__ */ r(e.Content, {
|
|
27
|
-
children: n.map((o) => /* @__PURE__ */ r(e.Item, {
|
|
28
|
-
onClick: () => l(o.id),
|
|
29
|
-
children: /* @__PURE__ */ r(e.Item.MainContent, {
|
|
30
|
-
label: o.name || t(i.unnamedField)
|
|
31
|
-
})
|
|
32
|
-
}, o.id))
|
|
33
|
-
})]
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
export {
|
|
37
|
-
T as FieldSelector,
|
|
38
|
-
T as default
|
|
39
|
-
};
|
|
1
|
+
import { t as e } from "../../../../chunks/field-selector.js";
|
|
2
|
+
export { e as FieldSelector, e as default };
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { defineMessages as e } from "react-intl";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
var t = e({
|
|
3
|
+
selectField: {
|
|
4
|
+
id: "groupSharedFeatures.metadataTemplateEditor.fieldSelector.selectField",
|
|
5
|
+
defaultMessage: "Select a Field"
|
|
6
|
+
},
|
|
7
|
+
unnamedField: {
|
|
8
|
+
id: "groupSharedFeatures.metadataTemplateEditor.fieldSelector.unnamedField",
|
|
9
|
+
defaultMessage: "(Unnamed field)"
|
|
10
|
+
}
|
|
11
11
|
});
|
|
12
|
-
export {
|
|
13
|
-
d as default
|
|
14
|
-
};
|
|
12
|
+
export { t as default };
|
|
@@ -1,47 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { Plus as c } from "@box/blueprint-web-assets/icons/Fill";
|
|
4
|
-
import { fieldTypeDropdownMessages as a } from "./messages.js";
|
|
5
|
-
import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
|
6
|
-
import { useFieldOptions as p } from "../../utils/field-options/useFieldOptions.js";
|
|
7
|
-
import '../../../../styles/field-type-dropdown.css';const f = "_addField_1bl6g_1", u = {
|
|
8
|
-
addField: f
|
|
9
|
-
};
|
|
10
|
-
function M({
|
|
11
|
-
onFieldAdd: n,
|
|
12
|
-
trigger: d
|
|
13
|
-
}) {
|
|
14
|
-
const {
|
|
15
|
-
formatMessage: r
|
|
16
|
-
} = s(), l = p();
|
|
17
|
-
return /* @__PURE__ */ i(e.Root, {
|
|
18
|
-
modal: !1,
|
|
19
|
-
children: [/* @__PURE__ */ t(e.Trigger, {
|
|
20
|
-
children: d ?? /* @__PURE__ */ t(m, {
|
|
21
|
-
className: u.addField,
|
|
22
|
-
variant: "secondary",
|
|
23
|
-
size: "large",
|
|
24
|
-
startIcon: c,
|
|
25
|
-
"aria-label": r(a.addFieldAriaLabel),
|
|
26
|
-
children: r(a.addField)
|
|
27
|
-
})
|
|
28
|
-
}), /* @__PURE__ */ t(e.Content, {
|
|
29
|
-
children: l.availableFieldTypes.map((o) => /* @__PURE__ */ i(e.Item, {
|
|
30
|
-
onClick: () => n(o),
|
|
31
|
-
children: [/* @__PURE__ */ t(e.Item.StartElement, {
|
|
32
|
-
children: /* @__PURE__ */ t(o.Icon, {
|
|
33
|
-
fontSize: "15px",
|
|
34
|
-
"aria-hidden": "true"
|
|
35
|
-
})
|
|
36
|
-
}), /* @__PURE__ */ t(e.Item.MainContent, {
|
|
37
|
-
caption: o.description,
|
|
38
|
-
label: String(o.label)
|
|
39
|
-
})]
|
|
40
|
-
}, o.type))
|
|
41
|
-
})]
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
export {
|
|
45
|
-
M as FieldTypeDropdown,
|
|
46
|
-
M as default
|
|
47
|
-
};
|
|
1
|
+
import { t as e } from "../../../../chunks/field-type-dropdown.js";
|
|
2
|
+
export { e as FieldTypeDropdown, e as default };
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { defineMessages as e } from "react-intl";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
var t = e({
|
|
3
|
+
addField: {
|
|
4
|
+
id: "groupSharedFeatures.metadataTemplateEditor.fieldTypeDropdown.addField",
|
|
5
|
+
defaultMessage: "Add field"
|
|
6
|
+
},
|
|
7
|
+
addFieldAriaLabel: {
|
|
8
|
+
id: "groupSharedFeatures.metadataTemplateEditor.fieldTypeDropdown.addFieldAriaLabel",
|
|
9
|
+
defaultMessage: "Add field"
|
|
10
|
+
}
|
|
11
11
|
});
|
|
12
|
-
export {
|
|
13
|
-
a as fieldTypeDropdownMessages
|
|
14
|
-
};
|
|
12
|
+
export { t as fieldTypeDropdownMessages };
|
|
@@ -1,40 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { jsx as
|
|
6
|
-
import {
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
})
|
|
33
|
-
}, e.type))
|
|
34
|
-
})
|
|
35
|
-
});
|
|
1
|
+
import { useFieldOptions as e } from "../../utils/field-options/useFieldOptions.js";
|
|
2
|
+
import { emptyStateMessages as t } from "./messages.js";
|
|
3
|
+
import { RadioTiles as n } from "@box/blueprint-web";
|
|
4
|
+
import { useIntl as r } from "react-intl";
|
|
5
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
6
|
+
import { SurfaceSurfaceBrand as a } from "@box/blueprint-web-assets/tokens/tokens";
|
|
7
|
+
function o({ onFieldAdd: o }) {
|
|
8
|
+
let { formatMessage: s } = r(), c = e();
|
|
9
|
+
return /* @__PURE__ */ i("div", {
|
|
10
|
+
"data-testid": "md-template-type-picker-tiles",
|
|
11
|
+
children: /* @__PURE__ */ i(n, {
|
|
12
|
+
name: "field-type-picker",
|
|
13
|
+
value: void 0,
|
|
14
|
+
columns: 5,
|
|
15
|
+
"aria-label": s(t.selectFieldTypeAriaLabel),
|
|
16
|
+
onChange: (e) => {
|
|
17
|
+
let t = c.availableFieldTypes.find((t) => t.type === e.target.value);
|
|
18
|
+
t && o(t);
|
|
19
|
+
},
|
|
20
|
+
children: c.availableFieldTypes.map((e) => /* @__PURE__ */ i(n.Option, {
|
|
21
|
+
value: e.type,
|
|
22
|
+
label: e.label,
|
|
23
|
+
icon: /* @__PURE__ */ i(e.Icon, {
|
|
24
|
+
height: 32,
|
|
25
|
+
width: 32,
|
|
26
|
+
color: a,
|
|
27
|
+
"aria-hidden": !0
|
|
28
|
+
})
|
|
29
|
+
}, e.type))
|
|
30
|
+
})
|
|
31
|
+
});
|
|
36
32
|
}
|
|
37
|
-
export {
|
|
38
|
-
g as FieldTypeTiles,
|
|
39
|
-
g as default
|
|
40
|
-
};
|
|
33
|
+
export { o as FieldTypeTiles, o as default };
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { defineMessages as e } from "react-intl";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
var t = e({
|
|
3
|
+
heading: {
|
|
4
|
+
id: "groupSharedFeatures.metadataTemplateEditor.emptyState.heading",
|
|
5
|
+
defaultMessage: "Add your first field"
|
|
6
|
+
},
|
|
7
|
+
selectFieldTypeAriaLabel: {
|
|
8
|
+
id: "groupSharedFeatures.metadataTemplateEditor.emptyState.selectFieldTypeAriaLabel",
|
|
9
|
+
defaultMessage: "Select the field type."
|
|
10
|
+
}
|
|
11
11
|
});
|
|
12
|
-
export {
|
|
13
|
-
a as emptyStateMessages
|
|
14
|
-
};
|
|
12
|
+
export { t as emptyStateMessages };
|
|
@@ -1,46 +1,33 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import n from "
|
|
4
|
-
import { jsx as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
children: d ?? r(n.cancelButtonText)
|
|
33
|
-
}), /* @__PURE__ */ o(e.Footer.PrimaryButton, {
|
|
34
|
-
onClick: a,
|
|
35
|
-
size: "large",
|
|
36
|
-
children: s ?? r(n.confirmButtonText)
|
|
37
|
-
})]
|
|
38
|
-
}), /* @__PURE__ */ o(e.Close, {
|
|
39
|
-
"aria-label": r(n.closeButtonAriaLabel)
|
|
40
|
-
})]
|
|
41
|
-
})
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
export {
|
|
45
|
-
B as default
|
|
1
|
+
import e from "./messages.js";
|
|
2
|
+
import { Modal as t } from "@box/blueprint-web";
|
|
3
|
+
import { useIntl as n } from "react-intl";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
import "react";
|
|
6
|
+
var a = ({ onClose: a, onConfirm: o, title: s, body: c, confirmLabel: l, cancelLabel: u }) => {
|
|
7
|
+
let { formatMessage: d } = n();
|
|
8
|
+
return /* @__PURE__ */ r(t, {
|
|
9
|
+
onOpenChange: a,
|
|
10
|
+
open: !0,
|
|
11
|
+
children: /* @__PURE__ */ i(t.Content, {
|
|
12
|
+
size: "small",
|
|
13
|
+
children: [
|
|
14
|
+
/* @__PURE__ */ r(t.Header, { children: s }),
|
|
15
|
+
/* @__PURE__ */ r(t.ScrollableContainer, { children: /* @__PURE__ */ r(t.Body, {
|
|
16
|
+
className: "confirmationModal-body",
|
|
17
|
+
children: c
|
|
18
|
+
}) }),
|
|
19
|
+
/* @__PURE__ */ i(t.Footer, { children: [/* @__PURE__ */ r(t.Footer.SecondaryButton, {
|
|
20
|
+
onClick: a,
|
|
21
|
+
size: "large",
|
|
22
|
+
children: u ?? d(e.cancelButtonText)
|
|
23
|
+
}), /* @__PURE__ */ r(t.Footer.PrimaryButton, {
|
|
24
|
+
onClick: o,
|
|
25
|
+
size: "large",
|
|
26
|
+
children: l ?? d(e.confirmButtonText)
|
|
27
|
+
})] }),
|
|
28
|
+
/* @__PURE__ */ r(t.Close, { "aria-label": d(e.closeButtonAriaLabel) })
|
|
29
|
+
]
|
|
30
|
+
})
|
|
31
|
+
});
|
|
46
32
|
};
|
|
33
|
+
export { a as default };
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import { defineMessages as e } from "react-intl";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
var t = e({
|
|
3
|
+
cancelButtonText: {
|
|
4
|
+
id: "groupSharedFeatures.metadataTemplateEditor.confirmationModal.cancelButtonText",
|
|
5
|
+
defaultMessage: "Cancel"
|
|
6
|
+
},
|
|
7
|
+
closeButtonAriaLabel: {
|
|
8
|
+
id: "groupSharedFeatures.metadataTemplateEditor.confirmationModal.closeButtonAriaLabel",
|
|
9
|
+
defaultMessage: "Close"
|
|
10
|
+
},
|
|
11
|
+
confirmButtonText: {
|
|
12
|
+
id: "groupSharedFeatures.metadataTemplateEditor.confirmationModal.confirmButtonText",
|
|
13
|
+
defaultMessage: "Confirm"
|
|
14
|
+
}
|
|
15
15
|
});
|
|
16
|
-
export {
|
|
17
|
-
t as default
|
|
18
|
-
};
|
|
16
|
+
export { t as default };
|