@box/metadata-template-editor 1.21.12 → 1.22.0
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/README.md +5 -5
- package/dist/chunks/field-context-menu.js +35 -32
- package/dist/chunks/metadata-field-configurator.module.js +19 -15
- package/dist/chunks/metadata-field-list.js +20 -20
- package/dist/chunks/metadata-template-editor-form.js +4 -4
- package/dist/chunks/sortable-option-list.js +47 -47
- package/dist/esm/index.js +3 -3
- package/dist/esm/lib/components/metadata-field-configurator/components/field-action-slot/field-action-slot.js +57 -56
- package/dist/esm/lib/components/metadata-field-configurator/components/field-edit-content/field-edit-content.js +12 -12
- package/dist/esm/lib/components/metadata-field-configurator/hooks/useFieldConfiguratorBehavior.js +77 -76
- package/dist/esm/lib/components/metadata-field-configurator/index.js +3 -3
- package/dist/esm/lib/components/metadata-field-configurator/metadata-field-configurator.js +79 -76
- package/dist/i18n/en-x-pseudo.js +106 -106
- package/dist/i18n/en-x-pseudo.properties +106 -106
- package/dist/styles/metadata-field-configurator.css +1 -1
- package/dist/types/lib/components/metadata-field-configurator/components/field-action-slot/field-action-slot.d.ts +3 -10
- package/dist/types/lib/components/metadata-field-configurator/components/field-context-menu/field-context-menu.d.ts +5 -1
- package/dist/types/lib/components/metadata-field-configurator/hooks/useFieldConfiguratorBehavior.d.ts +1 -0
- package/dist/types/lib/components/metadata-field-configurator/metadata-field-configurator.d.ts +6 -2
- package/package.json +6 -6
|
@@ -1,63 +1,64 @@
|
|
|
1
1
|
import { general as e } from "../../messages/configurator-messages.js";
|
|
2
2
|
import { t } from "../../../../../../chunks/metadata-field-configurator.module.js";
|
|
3
3
|
import { t as n } from "../../../../../../chunks/field-context-menu.js";
|
|
4
|
-
import { Status as r, Tabs as i } from "@box/blueprint-web";
|
|
5
|
-
import { useIntl as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import "react";
|
|
4
|
+
import { Status as r, Tabs as i, Text as a } from "@box/blueprint-web";
|
|
5
|
+
import { useIntl as o } from "react-intl";
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
+
import { useState as l } from "react";
|
|
9
8
|
import { SurfaceStatusSurfaceGray as u } from "@box/blueprint-web-assets/tokens/tokens";
|
|
10
9
|
import { Hidden as d, Pencil as f } from "@box/blueprint-web-assets/icons/Line";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}),
|
|
35
|
-
/* @__PURE__ */ c("div", {
|
|
36
|
-
className: t.expandedToolbarActions,
|
|
37
|
-
children: [T.length > 0 && /* @__PURE__ */ c(i.TabList, {
|
|
38
|
-
variant: "contentSwitcher",
|
|
39
|
-
containerClassname: t.extensionTabsContainer,
|
|
40
|
-
children: [/* @__PURE__ */ s(i.Tab, {
|
|
41
|
-
id: "edit",
|
|
42
|
-
variant: "contentSwitcher",
|
|
43
|
-
"aria-label": E.formatMessage(e.editTabAriaLabel),
|
|
44
|
-
children: /* @__PURE__ */ s(f, { "aria-hidden": "true" })
|
|
45
|
-
}), T.map((e, t) => /* @__PURE__ */ s(i.Tab, {
|
|
46
|
-
id: `ext-${t}`,
|
|
10
|
+
import p from "clsx";
|
|
11
|
+
var m = ({ isHidden: m, isExpanded: h, index: g, maxIndex: _, onReorderFields: v, onToggleVisibility: y, onRequestDelete: b, onRequestDuplicate: x, extensions: S, fieldCollapsedText: C }) => {
|
|
12
|
+
let w = o(), [T, E] = l(!1);
|
|
13
|
+
return /* @__PURE__ */ c("div", {
|
|
14
|
+
className: t.fieldActionSlot,
|
|
15
|
+
children: [
|
|
16
|
+
m && /* @__PURE__ */ s(r, {
|
|
17
|
+
icon: d,
|
|
18
|
+
iconPosition: "left",
|
|
19
|
+
color: u,
|
|
20
|
+
text: w.formatMessage(e.hiddenStatus).toUpperCase(),
|
|
21
|
+
className: t.hiddenBadge
|
|
22
|
+
}),
|
|
23
|
+
C && !h && /* @__PURE__ */ s(a, {
|
|
24
|
+
as: "span",
|
|
25
|
+
variant: "bodySmall",
|
|
26
|
+
color: "textOnLightSecondary",
|
|
27
|
+
className: p(t.fieldCollapsedText, { [t.menuOpen]: T }),
|
|
28
|
+
children: C
|
|
29
|
+
}),
|
|
30
|
+
/* @__PURE__ */ c("div", {
|
|
31
|
+
className: p(t.expandedToolbarActions, { [t.menuOpen]: T }),
|
|
32
|
+
children: [S.length > 0 && /* @__PURE__ */ c(i.TabList, {
|
|
47
33
|
variant: "contentSwitcher",
|
|
48
|
-
|
|
49
|
-
children: /* @__PURE__ */ s(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
34
|
+
containerClassname: t.extensionTabsContainer,
|
|
35
|
+
children: [/* @__PURE__ */ s(i.Tab, {
|
|
36
|
+
id: "edit",
|
|
37
|
+
variant: "contentSwitcher",
|
|
38
|
+
"aria-label": w.formatMessage(e.editTabAriaLabel),
|
|
39
|
+
children: /* @__PURE__ */ s(f, { "aria-hidden": "true" })
|
|
40
|
+
}), S.map((e, t) => /* @__PURE__ */ s(i.Tab, {
|
|
41
|
+
id: `ext-${t}`,
|
|
42
|
+
variant: "contentSwitcher",
|
|
43
|
+
"aria-label": e.label,
|
|
44
|
+
children: /* @__PURE__ */ s(e.icon, { "aria-hidden": "true" })
|
|
45
|
+
}, e.label))]
|
|
46
|
+
}), /* @__PURE__ */ s(n, {
|
|
47
|
+
className: p(t.fieldContextMenu, {
|
|
48
|
+
[t.menuOpen]: T,
|
|
49
|
+
[t.contextMenuWithCollapsedText]: !!C && !h
|
|
50
|
+
}),
|
|
51
|
+
index: g,
|
|
52
|
+
maxIndex: _,
|
|
53
|
+
isHidden: m,
|
|
54
|
+
onReorderFields: v,
|
|
55
|
+
onToggleVisibility: y,
|
|
56
|
+
onRequestDelete: b,
|
|
57
|
+
onRequestDuplicate: x,
|
|
58
|
+
onOpenChange: E
|
|
59
|
+
})]
|
|
60
|
+
})
|
|
61
|
+
]
|
|
62
|
+
});
|
|
62
63
|
};
|
|
63
|
-
export {
|
|
64
|
+
export { m as FieldActionSlot };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { a as e } from "../../../../../../chunks/types.js";
|
|
2
2
|
import { useFieldOptions as t } from "../../../../utils/field-options/useFieldOptions.js";
|
|
3
3
|
import { general as n } from "../../messages/configurator-messages.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { t as r } from "../../../../../../chunks/metadata-field-configurator.module.js";
|
|
5
|
+
import { useFieldConfigurator as i } from "../../context/field-configurator-context.js";
|
|
6
|
+
import { getConfigurationByType as a } from "../../utils.js";
|
|
7
7
|
import { Select as o, TextInput as s, TextWithInfoBadge as c, TooltipProvider as l } from "@box/blueprint-web";
|
|
8
8
|
import { useIntl as u } from "react-intl";
|
|
9
9
|
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
10
10
|
import { useMemo as p } from "react";
|
|
11
11
|
var m = ({ nameInputId: m, descriptionInputId: h, isTypeEditable: g, externalErrors: _, externalTouched: v, handleTypeChange: y }) => {
|
|
12
|
-
let b = u(), x = t(), { values: S, errors: C, touched: w, handleChange: T, handleBlur: E } =
|
|
12
|
+
let b = u(), x = t(), { values: S, errors: C, touched: w, handleChange: T, handleBlur: E } = i(), D = (e) => {
|
|
13
13
|
if (_ && v?.[e]) return _[e];
|
|
14
14
|
let t = C[e];
|
|
15
15
|
if (w[e] && t != null && typeof t == "string") return t;
|
|
@@ -17,19 +17,19 @@ var m = ({ nameInputId: m, descriptionInputId: h, isTypeEditable: g, externalErr
|
|
|
17
17
|
infoBadgeAriaLabel: b.formatMessage(n.descriptionLearnMoreBadgeAriaLabel),
|
|
18
18
|
infoText: b.formatMessage(n.descriptionInfoTooltip),
|
|
19
19
|
children: /* @__PURE__ */ d("label", {
|
|
20
|
-
className:
|
|
20
|
+
className: r.labelWithTooltip,
|
|
21
21
|
htmlFor: h,
|
|
22
22
|
children: b.formatMessage(n.fieldDescriptionLabel)
|
|
23
23
|
})
|
|
24
24
|
}) }), [b, h]);
|
|
25
25
|
return /* @__PURE__ */ d("fieldset", {
|
|
26
26
|
disabled: S.isFieldReadOnly,
|
|
27
|
-
className:
|
|
27
|
+
className: r.fieldset,
|
|
28
28
|
children: /* @__PURE__ */ f("div", {
|
|
29
|
-
className:
|
|
29
|
+
className: r.expandedContent,
|
|
30
30
|
children: [
|
|
31
31
|
/* @__PURE__ */ f("div", {
|
|
32
|
-
className:
|
|
32
|
+
className: r.basic,
|
|
33
33
|
children: [/* @__PURE__ */ d(s, {
|
|
34
34
|
name: "name",
|
|
35
35
|
id: m,
|
|
@@ -50,7 +50,7 @@ var m = ({ nameInputId: m, descriptionInputId: h, isTypeEditable: g, externalErr
|
|
|
50
50
|
readonly: !g,
|
|
51
51
|
disabled: S.isFieldReadOnly,
|
|
52
52
|
onValueChange: y,
|
|
53
|
-
className:
|
|
53
|
+
className: r.fieldTypeSelect,
|
|
54
54
|
required: !0,
|
|
55
55
|
children: /* @__PURE__ */ d(o.Content, { children: x.availableFieldTypes.map((e) => /* @__PURE__ */ d(o.Option, {
|
|
56
56
|
text: typeof e.label == "string" ? e.label : String(e.label),
|
|
@@ -59,11 +59,11 @@ var m = ({ nameInputId: m, descriptionInputId: h, isTypeEditable: g, externalErr
|
|
|
59
59
|
})]
|
|
60
60
|
}),
|
|
61
61
|
[e.Dropdown, e.Taxonomy].includes(S.type) && /* @__PURE__ */ d("div", {
|
|
62
|
-
className:
|
|
63
|
-
children:
|
|
62
|
+
className: r.typeSpecific,
|
|
63
|
+
children: a(S.type)
|
|
64
64
|
}),
|
|
65
65
|
/* @__PURE__ */ d("div", {
|
|
66
|
-
className:
|
|
66
|
+
className: r.description,
|
|
67
67
|
children: /* @__PURE__ */ d(s, {
|
|
68
68
|
name: "description",
|
|
69
69
|
id: h,
|
package/dist/esm/lib/components/metadata-field-configurator/hooks/useFieldConfiguratorBehavior.js
CHANGED
|
@@ -1,100 +1,101 @@
|
|
|
1
1
|
import { FieldTypeIcon as e } from "../../../utils/field-options/field-type-icon.js";
|
|
2
2
|
import { general as t } from "../messages/configurator-messages.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { createDefaultFieldValues as n, hasVisibleErrors as r } from "../utils.js";
|
|
4
|
+
import { useFieldExtensions as i } from "../context/field-extensions-context.js";
|
|
5
5
|
import { useFieldValidation as a } from "./useFieldValidation.js";
|
|
6
6
|
import { useTaxonomyFetch as o } from "./useTaxonomyFetch.js";
|
|
7
7
|
import { useIntl as s } from "react-intl";
|
|
8
8
|
import { useCallback as c, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
9
9
|
import p from "lodash/cloneDeep";
|
|
10
10
|
import m from "lodash/set";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
var h = "edit";
|
|
12
|
+
function g({ values: g, onValuesChange: _, onDelete: v, isExpanded: y, onExpandedChange: b, submitAttemptCount: x, taxonomyOptions: S, fetchTaxonomies: C, fieldExtensionsProp: w, onValidationChange: T }) {
|
|
13
|
+
let E = s(), { errors: D, touched: O, isValid: k, validateForm: A, touchAll: j, setFieldTouched: M, setTouched: ee, handleBlur: te } = a(g), ne = o(C, S), N = i(), P = w ?? N, [F, I] = f(() => g.isFieldNew === !0), [L, R] = f(!1), [z, B] = f(h), V = y === void 0 ? F : y, H = !g.isFieldReadOnly && g.isFieldNew, U = g.id, W = `field-name-${U}`, G = `field-description-${U}`, K = c((e, t) => {
|
|
14
|
+
_({
|
|
15
|
+
...g,
|
|
15
16
|
[e]: t
|
|
16
17
|
});
|
|
17
|
-
}, [
|
|
18
|
-
let { name: t, value: n } = e.target, r = p(
|
|
19
|
-
m(r, t, n),
|
|
20
|
-
}, [
|
|
21
|
-
values:
|
|
22
|
-
errors:
|
|
23
|
-
touched:
|
|
24
|
-
isValid:
|
|
25
|
-
setFieldValue:
|
|
26
|
-
setValues:
|
|
27
|
-
setFieldTouched:
|
|
18
|
+
}, [g, _]), q = c((e) => {
|
|
19
|
+
let { name: t, value: n } = e.target, r = p(g);
|
|
20
|
+
m(r, t, n), _(r);
|
|
21
|
+
}, [g, _]), J = u(() => ({
|
|
22
|
+
values: g,
|
|
23
|
+
errors: D,
|
|
24
|
+
touched: O,
|
|
25
|
+
isValid: k,
|
|
26
|
+
setFieldValue: K,
|
|
27
|
+
setValues: _,
|
|
28
|
+
setFieldTouched: M,
|
|
28
29
|
setTouched: ee,
|
|
29
|
-
handleChange:
|
|
30
|
+
handleChange: q,
|
|
30
31
|
handleBlur: te,
|
|
31
|
-
validateForm:
|
|
32
|
+
validateForm: A
|
|
32
33
|
}), [
|
|
33
|
-
|
|
34
|
-
E,
|
|
34
|
+
g,
|
|
35
35
|
D,
|
|
36
36
|
O,
|
|
37
|
-
|
|
38
|
-
g,
|
|
37
|
+
k,
|
|
39
38
|
K,
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
_,
|
|
40
|
+
q,
|
|
41
|
+
A
|
|
42
|
+
]), Y = d(V);
|
|
42
43
|
l(() => {
|
|
43
|
-
let e =
|
|
44
|
-
|
|
45
|
-
}, [
|
|
46
|
-
let
|
|
44
|
+
let e = Y.current;
|
|
45
|
+
Y.current = V, e && !V && (j(), B("edit"));
|
|
46
|
+
}, [V]);
|
|
47
|
+
let X = d(x);
|
|
47
48
|
l(() => {
|
|
48
|
-
!
|
|
49
|
-
}, [
|
|
50
|
-
let
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}, [
|
|
54
|
-
|
|
55
|
-
}, [
|
|
56
|
-
let re = c((e) =>
|
|
57
|
-
|
|
58
|
-
}, [
|
|
59
|
-
|
|
60
|
-
}, [
|
|
61
|
-
|
|
62
|
-
...
|
|
63
|
-
key:
|
|
64
|
-
hidden:
|
|
65
|
-
isFieldNew:
|
|
66
|
-
isFieldReadOnly:
|
|
67
|
-
name:
|
|
68
|
-
description:
|
|
49
|
+
!x || x === X.current || j();
|
|
50
|
+
}, [x]);
|
|
51
|
+
let Z = d(T);
|
|
52
|
+
Z.current = T, l(() => {
|
|
53
|
+
Z.current?.(k);
|
|
54
|
+
}, [k]), l(() => {
|
|
55
|
+
g.isFieldNew && (y === void 0 ? I(!0) : b?.(!0));
|
|
56
|
+
}, [g.isFieldNew]);
|
|
57
|
+
let re = c((e) => K("hidden", e), [K]), Q = c(() => {
|
|
58
|
+
v?.(g.key), R(!1);
|
|
59
|
+
}, [v, g.key]), ie = c(() => {
|
|
60
|
+
g.isFieldNew ? Q() : R(!0);
|
|
61
|
+
}, [Q, g.isFieldNew]), ae = c(() => R(!1), []), oe = c((e) => I(e === U), [U]), se = c((e) => {
|
|
62
|
+
_({
|
|
63
|
+
...n(e),
|
|
64
|
+
key: g.key,
|
|
65
|
+
hidden: g.hidden,
|
|
66
|
+
isFieldNew: g.isFieldNew,
|
|
67
|
+
isFieldReadOnly: g.isFieldReadOnly,
|
|
68
|
+
name: g.name,
|
|
69
|
+
description: g.description
|
|
69
70
|
});
|
|
70
|
-
}, [
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
]),
|
|
71
|
+
}, [_, g]), ce = u(() => `${g.name || E.formatMessage(t.fieldNameInputPlaceholder)}${g.type === "dropdown" ? ` (${g.dropdown?.options?.length ?? 0})` : ""}`, [
|
|
72
|
+
g.name,
|
|
73
|
+
g.type,
|
|
74
|
+
g.dropdown?.options?.length,
|
|
75
|
+
E
|
|
76
|
+
]), le = u(() => e(g.type), [g.type]), $ = z === "edit" ? 0 : Number(z.replace("ext-", "")) + 1;
|
|
76
77
|
return {
|
|
77
|
-
contextValue:
|
|
78
|
+
contextValue: J,
|
|
78
79
|
taxonomyContextValue: ne,
|
|
79
|
-
extensions:
|
|
80
|
-
isActive:
|
|
81
|
-
handleAccordionValueChange:
|
|
82
|
-
isDeleteConfirmationModalOpen:
|
|
83
|
-
openConfirmationModal:
|
|
84
|
-
closeConfirmationModal:
|
|
85
|
-
handleDeleteField:
|
|
86
|
-
activeTabId:
|
|
87
|
-
setActiveTabId:
|
|
88
|
-
activeExtension: $ > 0 ?
|
|
89
|
-
isTypeEditable:
|
|
90
|
-
uniqueKey:
|
|
91
|
-
nameInputId:
|
|
92
|
-
descriptionInputId:
|
|
93
|
-
accordionTitle:
|
|
94
|
-
TitleIcon:
|
|
95
|
-
hasErrors:
|
|
96
|
-
handleTypeChange:
|
|
80
|
+
extensions: P,
|
|
81
|
+
isActive: V,
|
|
82
|
+
handleAccordionValueChange: oe,
|
|
83
|
+
isDeleteConfirmationModalOpen: L,
|
|
84
|
+
openConfirmationModal: ie,
|
|
85
|
+
closeConfirmationModal: ae,
|
|
86
|
+
handleDeleteField: Q,
|
|
87
|
+
activeTabId: z,
|
|
88
|
+
setActiveTabId: B,
|
|
89
|
+
activeExtension: $ > 0 ? P[$ - 1] ?? null : null,
|
|
90
|
+
isTypeEditable: H,
|
|
91
|
+
uniqueKey: U,
|
|
92
|
+
nameInputId: W,
|
|
93
|
+
descriptionInputId: G,
|
|
94
|
+
accordionTitle: ce,
|
|
95
|
+
TitleIcon: le,
|
|
96
|
+
hasErrors: r(D, O),
|
|
97
|
+
handleTypeChange: se,
|
|
97
98
|
handleChangeVisibility: re
|
|
98
99
|
};
|
|
99
100
|
}
|
|
100
|
-
export { h as useFieldConfiguratorBehavior };
|
|
101
|
+
export { h as EDIT_TAB_ID, g as useFieldConfiguratorBehavior };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useTemplateFieldSchema as e } from "./hooks/useTemplateFieldSchema.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { createDefaultFieldValues as t } from "./utils.js";
|
|
3
|
+
import { FieldExtensionsContext as n, useFieldExtensions as r } from "./context/field-extensions-context.js";
|
|
4
4
|
import { MetadataFieldConfigurator as i } from "./metadata-field-configurator.js";
|
|
5
|
-
export {
|
|
5
|
+
export { n as FieldExtensionsContext, i as MetadataFieldConfigurator, t as createDefaultFieldValues, r as useFieldExtensions, e as useTemplateFieldSchema };
|
|
@@ -1,96 +1,99 @@
|
|
|
1
1
|
import { general as e } from "./messages/configurator-messages.js";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { Accordion as
|
|
11
|
-
import { useIntl as
|
|
12
|
-
import { Fragment as
|
|
2
|
+
import t from "./components/confirmation-modal/confirmation-modal.js";
|
|
3
|
+
import { t as n } from "../../../../chunks/metadata-field-configurator.module.js";
|
|
4
|
+
import { FieldActionSlot as ee } from "./components/field-action-slot/field-action-slot.js";
|
|
5
|
+
import { FieldConfiguratorContext as te } from "./context/field-configurator-context.js";
|
|
6
|
+
import { TaxonomyOptionsContext as r } from "./context/taxonomy-options-context.js";
|
|
7
|
+
import { FieldEditContent as i } from "./components/field-edit-content/field-edit-content.js";
|
|
8
|
+
import { FieldExtensionsContext as a } from "./context/field-extensions-context.js";
|
|
9
|
+
import { EDIT_TAB_ID as o, useFieldConfiguratorBehavior as ne } from "./hooks/useFieldConfiguratorBehavior.js";
|
|
10
|
+
import { Accordion as s, Tabs as c } from "@box/blueprint-web";
|
|
11
|
+
import { useIntl as l } from "react-intl";
|
|
12
|
+
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
13
13
|
import "react";
|
|
14
|
-
var
|
|
15
|
-
let
|
|
16
|
-
values:
|
|
17
|
-
onValuesChange:
|
|
18
|
-
onDelete:
|
|
19
|
-
isExpanded:
|
|
20
|
-
onExpandedChange:
|
|
21
|
-
submitAttemptCount:
|
|
22
|
-
taxonomyOptions:
|
|
23
|
-
fetchTaxonomies:
|
|
24
|
-
fieldExtensionsProp:
|
|
25
|
-
onValidationChange:
|
|
26
|
-
}),
|
|
27
|
-
nameInputId:
|
|
28
|
-
descriptionInputId:
|
|
29
|
-
isTypeEditable:
|
|
30
|
-
externalErrors:
|
|
31
|
-
externalTouched:
|
|
32
|
-
handleTypeChange:
|
|
33
|
-
}),
|
|
34
|
-
tabId:
|
|
35
|
-
children:
|
|
36
|
-
}),
|
|
14
|
+
var p = ({ index: p, maxIndex: m, values: h, onValuesChange: g, onDelete: _, onDuplicate: v, onReorderFields: re, onTouchStart: y, onDragStart: b, onDragEnd: x, externalErrors: ie, externalTouched: ae, dndDragHandleProps: S, fieldCollapsedText: C, isExpanded: w, onExpandedChange: T, taxonomyOptions: E, fetchTaxonomies: D, submitAttemptCount: O, fieldExtensions: k, onValidationChange: A }) => {
|
|
15
|
+
let j = l(), { contextValue: M, taxonomyContextValue: N, extensions: P, isActive: F, handleAccordionValueChange: I, isDeleteConfirmationModalOpen: L, openConfirmationModal: oe, closeConfirmationModal: R, handleDeleteField: z, activeTabId: B, setActiveTabId: V, isTypeEditable: H, uniqueKey: U, nameInputId: W, descriptionInputId: G, accordionTitle: K, TitleIcon: q, hasErrors: se, handleTypeChange: ce, handleChangeVisibility: le } = ne({
|
|
16
|
+
values: h,
|
|
17
|
+
onValuesChange: g,
|
|
18
|
+
onDelete: _,
|
|
19
|
+
isExpanded: w,
|
|
20
|
+
onExpandedChange: T,
|
|
21
|
+
submitAttemptCount: O,
|
|
22
|
+
taxonomyOptions: E,
|
|
23
|
+
fetchTaxonomies: D,
|
|
24
|
+
fieldExtensionsProp: k,
|
|
25
|
+
onValidationChange: A
|
|
26
|
+
}), J = /* @__PURE__ */ d(i, {
|
|
27
|
+
nameInputId: W,
|
|
28
|
+
descriptionInputId: G,
|
|
29
|
+
isTypeEditable: H,
|
|
30
|
+
externalErrors: ie,
|
|
31
|
+
externalTouched: ae,
|
|
32
|
+
handleTypeChange: ce
|
|
33
|
+
}), ue = P.length > 0 ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(c.TabPanel, {
|
|
34
|
+
tabId: o,
|
|
35
|
+
children: J
|
|
36
|
+
}), P.map((e, t) => /* @__PURE__ */ d(c.TabPanel, {
|
|
37
37
|
tabId: `ext-${t}`,
|
|
38
|
-
className:
|
|
39
|
-
children: e.renderContent(
|
|
40
|
-
}, e.label))] }) : Y, X = /* @__PURE__ */
|
|
38
|
+
className: n.extensionContent,
|
|
39
|
+
children: e.renderContent(h)
|
|
40
|
+
}, e.label))] }) : J, Y = w === !1, X = /* @__PURE__ */ d(s.Item, {
|
|
41
41
|
highlighted: !0,
|
|
42
|
-
startElement: /* @__PURE__ */
|
|
42
|
+
startElement: /* @__PURE__ */ d(q, {
|
|
43
43
|
fontSize: "20px",
|
|
44
44
|
role: "presentation"
|
|
45
45
|
}),
|
|
46
|
-
value:
|
|
47
|
-
title:
|
|
48
|
-
action: /* @__PURE__ */
|
|
49
|
-
|
|
50
|
-
isHidden:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
onDragStart: v,
|
|
55
|
-
onDragEnd: y,
|
|
56
|
-
onTouchStart: ie,
|
|
46
|
+
value: U,
|
|
47
|
+
title: K,
|
|
48
|
+
action: /* @__PURE__ */ d(ee, {
|
|
49
|
+
fieldCollapsedText: C,
|
|
50
|
+
isHidden: h.hidden,
|
|
51
|
+
isExpanded: F,
|
|
52
|
+
index: p,
|
|
53
|
+
maxIndex: m,
|
|
57
54
|
onReorderFields: re,
|
|
58
|
-
onToggleVisibility:
|
|
59
|
-
onRequestDelete:
|
|
60
|
-
onRequestDuplicate:
|
|
61
|
-
extensions:
|
|
55
|
+
onToggleVisibility: le,
|
|
56
|
+
onRequestDelete: oe,
|
|
57
|
+
onRequestDuplicate: v,
|
|
58
|
+
extensions: P
|
|
62
59
|
}),
|
|
63
|
-
className:
|
|
64
|
-
iconVariant:
|
|
65
|
-
children:
|
|
66
|
-
}), Z =
|
|
67
|
-
selectedId:
|
|
68
|
-
setSelectedId: (e) =>
|
|
60
|
+
className: n.fieldAccordionItem,
|
|
61
|
+
iconVariant: se ? "alert-error" : void 0,
|
|
62
|
+
children: ue
|
|
63
|
+
}), Z = P.length > 0 ? /* @__PURE__ */ d(c, {
|
|
64
|
+
selectedId: B,
|
|
65
|
+
setSelectedId: (e) => V(e ?? "edit"),
|
|
69
66
|
children: X
|
|
70
|
-
}) : X, Q = /* @__PURE__ */
|
|
71
|
-
value:
|
|
72
|
-
children: [/* @__PURE__ */
|
|
73
|
-
className:
|
|
74
|
-
|
|
67
|
+
}) : X, Q = /* @__PURE__ */ f(te.Provider, {
|
|
68
|
+
value: M,
|
|
69
|
+
children: [/* @__PURE__ */ d("div", {
|
|
70
|
+
className: n.fieldAccordionWrapper,
|
|
71
|
+
draggable: Y && !S,
|
|
72
|
+
onDragStart: Y && !S && b ? (e) => b(e, p) : void 0,
|
|
73
|
+
onDragEnd: Y && !S && x ? (e) => x(e, p) : void 0,
|
|
74
|
+
onTouchStart: Y && !S && y ? (e) => y(e, p) : void 0,
|
|
75
|
+
...Y ? S?.listeners ?? {} : {},
|
|
76
|
+
...Y ? S?.attributes ?? {} : {},
|
|
77
|
+
children: w === void 0 ? /* @__PURE__ */ d(s, {
|
|
75
78
|
type: "single",
|
|
76
79
|
collapsible: !0,
|
|
77
|
-
value:
|
|
78
|
-
onValueChange:
|
|
80
|
+
value: F ? U : "",
|
|
81
|
+
onValueChange: I,
|
|
79
82
|
children: Z
|
|
80
83
|
}) : Z
|
|
81
|
-
}),
|
|
82
|
-
onClose:
|
|
83
|
-
onConfirm:
|
|
84
|
-
title:
|
|
85
|
-
body:
|
|
84
|
+
}), L && /* @__PURE__ */ d(t, {
|
|
85
|
+
onClose: R,
|
|
86
|
+
onConfirm: z,
|
|
87
|
+
title: j.formatMessage(e.deleteFieldTitle, { fieldName: h.name }),
|
|
88
|
+
body: j.formatMessage(e.deleteFieldDescription)
|
|
86
89
|
})]
|
|
87
|
-
}), $ =
|
|
88
|
-
value:
|
|
90
|
+
}), $ = E !== void 0 || D !== void 0 ? /* @__PURE__ */ d(r.Provider, {
|
|
91
|
+
value: N,
|
|
89
92
|
children: Q
|
|
90
93
|
}) : Q;
|
|
91
|
-
return
|
|
92
|
-
value:
|
|
94
|
+
return k === void 0 ? $ : /* @__PURE__ */ d(a.Provider, {
|
|
95
|
+
value: k,
|
|
93
96
|
children: $
|
|
94
97
|
});
|
|
95
98
|
};
|
|
96
|
-
export {
|
|
99
|
+
export { p as MetadataFieldConfigurator };
|