@box/metadata-template-editor 1.19.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/LICENSE +379 -0
- package/README.md +57 -0
- package/dist/chunks/metadata-field-configurator.module.js +17 -0
- package/dist/chunks/types.js +34 -0
- package/dist/esm/index.js +34 -0
- package/dist/esm/lib/components/field-selector/field-selector.js +39 -0
- package/dist/esm/lib/components/field-selector/index.js +4 -0
- package/dist/esm/lib/components/field-selector/messages.js +14 -0
- package/dist/esm/lib/components/field-type-dropdown/field-type-dropdown.js +47 -0
- package/dist/esm/lib/components/field-type-dropdown/index.js +4 -0
- package/dist/esm/lib/components/field-type-dropdown/messages.js +14 -0
- package/dist/esm/lib/components/field-type-tiles/field-type-tiles.js +40 -0
- package/dist/esm/lib/components/field-type-tiles/index.js +4 -0
- package/dist/esm/lib/components/field-type-tiles/messages.js +14 -0
- package/dist/esm/lib/components/metadata-field-configurator/components/confirmation-modal/confirmation-modal.js +46 -0
- package/dist/esm/lib/components/metadata-field-configurator/components/confirmation-modal/messages.js +18 -0
- package/dist/esm/lib/components/metadata-field-configurator/components/field-action-slot/field-action-slot.js +80 -0
- package/dist/esm/lib/components/metadata-field-configurator/components/field-context-menu/field-context-menu.js +115 -0
- package/dist/esm/lib/components/metadata-field-configurator/components/field-edit-content/field-edit-content.js +101 -0
- package/dist/esm/lib/components/metadata-field-configurator/components/levels-chain/chip.js +33 -0
- package/dist/esm/lib/components/metadata-field-configurator/components/levels-chain/index.js +4 -0
- package/dist/esm/lib/components/metadata-field-configurator/components/levels-chain/levels-chain.js +118 -0
- package/dist/esm/lib/components/metadata-field-configurator/components/levels-chain/utils.js +34 -0
- package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/dropdown/__mocks__/getInitialValues.js +33 -0
- package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/dropdown/dropdown-default-values.js +15 -0
- package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/dropdown/dropdown-field-configuration.js +66 -0
- package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/dropdown/sortable-option-list.js +294 -0
- package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/index.js +6 -0
- package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/taxonomy-default-values.js +15 -0
- package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/taxonomy-field-configuration.js +149 -0
- package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/taxonomy-field-configurator-initial-state.js +54 -0
- package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/taxonomy-selector-messages.js +38 -0
- package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/taxonomy-selector.js +103 -0
- package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/useTaxonomySelect.js +19 -0
- package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/utils.js +4 -0
- package/dist/esm/lib/components/metadata-field-configurator/context/field-configurator-context.js +68 -0
- package/dist/esm/lib/components/metadata-field-configurator/context/field-extensions-context.js +9 -0
- package/dist/esm/lib/components/metadata-field-configurator/context/taxonomy-options-context.js +23 -0
- package/dist/esm/lib/components/metadata-field-configurator/hooks/useFieldConfiguratorBehavior.js +119 -0
- package/dist/esm/lib/components/metadata-field-configurator/hooks/useFieldValidation.js +68 -0
- package/dist/esm/lib/components/metadata-field-configurator/hooks/useTaxonomyFetch.js +27 -0
- package/dist/esm/lib/components/metadata-field-configurator/hooks/useTemplateFieldSchema.js +44 -0
- package/dist/esm/lib/components/metadata-field-configurator/index.js +11 -0
- package/dist/esm/lib/components/metadata-field-configurator/messages/configurator-messages.js +136 -0
- package/dist/esm/lib/components/metadata-field-configurator/messages/dropdown-messages.js +38 -0
- package/dist/esm/lib/components/metadata-field-configurator/messages/levels-chain-messages.js +18 -0
- package/dist/esm/lib/components/metadata-field-configurator/messages/taxonomy-messages.js +38 -0
- package/dist/esm/lib/components/metadata-field-configurator/metadata-field-configurator.js +154 -0
- package/dist/esm/lib/components/metadata-field-configurator/utils.js +53 -0
- package/dist/esm/lib/components/metadata-field-list/index.js +5 -0
- package/dist/esm/lib/components/metadata-field-list/metadata-field-list.js +279 -0
- package/dist/esm/lib/components/metadata-template-editor-form/metadata-template-editor-form.js +137 -0
- package/dist/esm/lib/components/metadata-template-editor-modal/index.js +4 -0
- package/dist/esm/lib/components/metadata-template-editor-modal/metadata-template-editor-modal.js +103 -0
- package/dist/esm/lib/hooks/useMetadataTemplateFormSchema.js +16 -0
- package/dist/esm/lib/hooks/useTemplateNameSchema.js +12 -0
- package/dist/esm/lib/index.js +14 -0
- package/dist/esm/lib/messages.js +118 -0
- package/dist/esm/lib/metadata-template-editor.js +179 -0
- package/dist/esm/lib/utils/constants.js +8 -0
- package/dist/esm/lib/utils/field-options/field-type-icon.js +34 -0
- package/dist/esm/lib/utils/field-options/index.js +9 -0
- package/dist/esm/lib/utils/field-options/messages.js +48 -0
- package/dist/esm/lib/utils/field-options/useFieldOptions.js +19 -0
- package/dist/esm/lib/utils/key-generation.js +29 -0
- package/dist/esm/lib/utils/template-type-conversion/convertLocalConfiguratorToTemplateField.js +78 -0
- package/dist/esm/lib/utils/template-type-conversion/convertTemplateFieldToLocalConfigurator.js +90 -0
- package/dist/esm/lib/utils/template-type-conversion/generateJSONPatchTemplateOperations.js +179 -0
- package/dist/esm/lib/utils/template-type-conversion/mapFieldsWithUniqueKeys.js +14 -0
- package/dist/i18n/bn-IN.js +108 -0
- package/dist/i18n/bn-IN.properties +196 -0
- package/dist/i18n/da-DK.js +108 -0
- package/dist/i18n/da-DK.properties +196 -0
- package/dist/i18n/de-DE.js +108 -0
- package/dist/i18n/de-DE.properties +196 -0
- package/dist/i18n/en-AU.js +108 -0
- package/dist/i18n/en-AU.properties +196 -0
- package/dist/i18n/en-CA.js +108 -0
- package/dist/i18n/en-CA.properties +196 -0
- package/dist/i18n/en-GB.js +108 -0
- package/dist/i18n/en-GB.properties +196 -0
- package/dist/i18n/en-US.js +108 -0
- package/dist/i18n/en-US.properties +212 -0
- package/dist/i18n/en-x-pseudo.js +108 -0
- package/dist/i18n/en-x-pseudo.properties +196 -0
- package/dist/i18n/es-419.js +108 -0
- package/dist/i18n/es-419.properties +196 -0
- package/dist/i18n/es-ES.js +108 -0
- package/dist/i18n/es-ES.properties +196 -0
- package/dist/i18n/fi-FI.js +108 -0
- package/dist/i18n/fi-FI.properties +196 -0
- package/dist/i18n/fr-CA.js +108 -0
- package/dist/i18n/fr-CA.properties +196 -0
- package/dist/i18n/fr-FR.js +108 -0
- package/dist/i18n/fr-FR.properties +196 -0
- package/dist/i18n/hi-IN.js +108 -0
- package/dist/i18n/hi-IN.properties +196 -0
- package/dist/i18n/it-IT.js +108 -0
- package/dist/i18n/it-IT.properties +196 -0
- package/dist/i18n/ja-JP.js +108 -0
- package/dist/i18n/ja-JP.properties +196 -0
- package/dist/i18n/json/src/lib/components/field-selector/messages.json +1 -0
- package/dist/i18n/json/src/lib/components/field-type-dropdown/messages.json +1 -0
- package/dist/i18n/json/src/lib/components/field-type-tiles/messages.json +1 -0
- package/dist/i18n/json/src/lib/components/metadata-field-configurator/components/confirmation-modal/messages.json +1 -0
- package/dist/i18n/json/src/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/taxonomy-selector-messages.json +1 -0
- package/dist/i18n/json/src/lib/components/metadata-field-configurator/messages/configurator-messages.json +1 -0
- package/dist/i18n/json/src/lib/components/metadata-field-configurator/messages/dropdown-messages.json +1 -0
- package/dist/i18n/json/src/lib/components/metadata-field-configurator/messages/levels-chain-messages.json +1 -0
- package/dist/i18n/json/src/lib/components/metadata-field-configurator/messages/taxonomy-messages.json +1 -0
- package/dist/i18n/json/src/lib/messages.json +1 -0
- package/dist/i18n/json/src/lib/utils/field-options/messages.json +1 -0
- package/dist/i18n/ko-KR.js +108 -0
- package/dist/i18n/ko-KR.properties +196 -0
- package/dist/i18n/nb-NO.js +108 -0
- package/dist/i18n/nb-NO.properties +196 -0
- package/dist/i18n/nl-NL.js +108 -0
- package/dist/i18n/nl-NL.properties +196 -0
- package/dist/i18n/pl-PL.js +108 -0
- package/dist/i18n/pl-PL.properties +196 -0
- package/dist/i18n/pt-BR.js +108 -0
- package/dist/i18n/pt-BR.properties +196 -0
- package/dist/i18n/ru-RU.js +108 -0
- package/dist/i18n/ru-RU.properties +196 -0
- package/dist/i18n/sv-SE.js +108 -0
- package/dist/i18n/sv-SE.properties +196 -0
- package/dist/i18n/tr-TR.js +108 -0
- package/dist/i18n/tr-TR.properties +196 -0
- package/dist/i18n/zh-CN.js +108 -0
- package/dist/i18n/zh-CN.properties +196 -0
- package/dist/i18n/zh-TW.js +108 -0
- package/dist/i18n/zh-TW.properties +196 -0
- package/dist/styles/chip.css +1 -0
- package/dist/styles/dropdown-field-configuration.css +1 -0
- package/dist/styles/field-context-menu.css +1 -0
- package/dist/styles/field-selector.css +1 -0
- package/dist/styles/field-type-dropdown.css +1 -0
- package/dist/styles/levels-chain.css +1 -0
- package/dist/styles/metadata-field-configurator.css +1 -0
- package/dist/styles/metadata-field-list.css +1 -0
- package/dist/styles/metadata-template-editor-form.css +1 -0
- package/dist/styles/metadata-template-editor-modal.css +1 -0
- package/dist/styles/metadata-template-editor.css +1 -0
- package/dist/styles/sortable-option-list.css +1 -0
- package/dist/styles/taxonomy-field-configuration.css +1 -0
- package/dist/styles/taxonomy-field-configurator-initial-state.css +1 -0
- package/dist/styles/taxonomy-selector.css +1 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/lib/components/field-selector/field-selector.d.ts +16 -0
- package/dist/types/lib/components/field-selector/index.d.ts +1 -0
- package/dist/types/lib/components/field-selector/messages.d.ts +13 -0
- package/dist/types/lib/components/field-type-dropdown/field-type-dropdown.d.ts +15 -0
- package/dist/types/lib/components/field-type-dropdown/index.d.ts +2 -0
- package/dist/types/lib/components/field-type-dropdown/messages.d.ts +12 -0
- package/dist/types/lib/components/field-type-tiles/field-type-tiles.d.ts +12 -0
- package/dist/types/lib/components/field-type-tiles/index.d.ts +2 -0
- package/dist/types/lib/components/field-type-tiles/messages.d.ts +12 -0
- package/dist/types/lib/components/metadata-field-configurator/components/confirmation-modal/confirmation-modal.d.ts +31 -0
- package/dist/types/lib/components/metadata-field-configurator/components/confirmation-modal/messages.d.ts +18 -0
- package/dist/types/lib/components/metadata-field-configurator/components/field-action-slot/field-action-slot.d.ts +30 -0
- package/dist/types/lib/components/metadata-field-configurator/components/field-context-menu/field-context-menu.d.ts +23 -0
- package/dist/types/lib/components/metadata-field-configurator/components/field-edit-content/field-edit-content.d.ts +20 -0
- package/dist/types/lib/components/metadata-field-configurator/components/levels-chain/chip.d.ts +17 -0
- package/dist/types/lib/components/metadata-field-configurator/components/levels-chain/index.d.ts +1 -0
- package/dist/types/lib/components/metadata-field-configurator/components/levels-chain/levels-chain.d.ts +31 -0
- package/dist/types/lib/components/metadata-field-configurator/components/levels-chain/utils.d.ts +10 -0
- package/dist/types/lib/components/metadata-field-configurator/components/type-specific-configuration/dropdown/__mocks__/getInitialValues.d.ts +2 -0
- package/dist/types/lib/components/metadata-field-configurator/components/type-specific-configuration/dropdown/dropdown-default-values.d.ts +2 -0
- package/dist/types/lib/components/metadata-field-configurator/components/type-specific-configuration/dropdown/dropdown-field-configuration.d.ts +1 -0
- package/dist/types/lib/components/metadata-field-configurator/components/type-specific-configuration/dropdown/sortable-option-list.d.ts +6 -0
- package/dist/types/lib/components/metadata-field-configurator/components/type-specific-configuration/index.d.ts +2 -0
- package/dist/types/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/taxonomy-default-values.d.ts +2 -0
- package/dist/types/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/taxonomy-field-configuration.d.ts +1 -0
- package/dist/types/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/taxonomy-field-configurator-initial-state.d.ts +1 -0
- package/dist/types/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/taxonomy-selector-messages.d.ts +43 -0
- package/dist/types/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/taxonomy-selector.d.ts +12 -0
- package/dist/types/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/useTaxonomySelect.d.ts +5 -0
- package/dist/types/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/utils.d.ts +2 -0
- package/dist/types/lib/components/metadata-field-configurator/context/field-configurator-context.d.ts +57 -0
- package/dist/types/lib/components/metadata-field-configurator/context/field-extensions-context.d.ts +52 -0
- package/dist/types/lib/components/metadata-field-configurator/context/taxonomy-options-context.d.ts +21 -0
- package/dist/types/lib/components/metadata-field-configurator/hooks/useFieldConfiguratorBehavior.d.ts +57 -0
- package/dist/types/lib/components/metadata-field-configurator/hooks/useFieldValidation.d.ts +27 -0
- package/dist/types/lib/components/metadata-field-configurator/hooks/useTaxonomyFetch.d.ts +19 -0
- package/dist/types/lib/components/metadata-field-configurator/hooks/useTemplateFieldSchema.d.ts +15 -0
- package/dist/types/lib/components/metadata-field-configurator/index.d.ts +6 -0
- package/dist/types/lib/components/metadata-field-configurator/messages/configurator-messages.d.ts +164 -0
- package/dist/types/lib/components/metadata-field-configurator/messages/dropdown-messages.d.ts +43 -0
- package/dist/types/lib/components/metadata-field-configurator/messages/levels-chain-messages.d.ts +18 -0
- package/dist/types/lib/components/metadata-field-configurator/messages/taxonomy-messages.d.ts +43 -0
- package/dist/types/lib/components/metadata-field-configurator/metadata-field-configurator.d.ts +191 -0
- package/dist/types/lib/components/metadata-field-configurator/stories/story-fixtures.d.ts +5 -0
- package/dist/types/lib/components/metadata-field-configurator/utils.d.ts +24 -0
- package/dist/types/lib/components/metadata-field-list/index.d.ts +2 -0
- package/dist/types/lib/components/metadata-field-list/metadata-field-list.d.ts +109 -0
- package/dist/types/lib/components/metadata-template-editor-form/metadata-template-editor-form.d.ts +20 -0
- package/dist/types/lib/components/metadata-template-editor-modal/index.d.ts +1 -0
- package/dist/types/lib/components/metadata-template-editor-modal/metadata-template-editor-modal.d.ts +56 -0
- package/dist/types/lib/hooks/useMetadataTemplateFormSchema.d.ts +17 -0
- package/dist/types/lib/hooks/useTemplateNameSchema.d.ts +2 -0
- package/dist/types/lib/index.d.ts +7 -0
- package/dist/types/lib/messages.d.ts +143 -0
- package/dist/types/lib/metadata-template-editor.d.ts +290 -0
- package/dist/types/lib/types.d.ts +311 -0
- package/dist/types/lib/utils/constants.d.ts +9 -0
- package/dist/types/lib/utils/field-options/field-type-icon.d.ts +6 -0
- package/dist/types/lib/utils/field-options/index.d.ts +4 -0
- package/dist/types/lib/utils/field-options/messages.d.ts +60 -0
- package/dist/types/lib/utils/field-options/useFieldOptions.d.ts +34 -0
- package/dist/types/lib/utils/key-generation.d.ts +24 -0
- package/dist/types/lib/utils/template-type-conversion/convertLocalConfiguratorToTemplateField.d.ts +25 -0
- package/dist/types/lib/utils/template-type-conversion/convertTemplateFieldToLocalConfigurator.d.ts +8 -0
- package/dist/types/lib/utils/template-type-conversion/generateJSONPatchTemplateOperations.d.ts +16 -0
- package/dist/types/lib/utils/template-type-conversion/mapFieldsWithUniqueKeys.d.ts +8 -0
- package/package.json +61 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { Button as n, Popover as s, LoadingIndicator as w, Text as h, TextInput as L } from "@box/blueprint-web";
|
|
2
|
+
import { Plus as P } from "@box/blueprint-web-assets/icons/Fill";
|
|
3
|
+
import { useState as x } from "react";
|
|
4
|
+
import { useIntl as O } from "react-intl";
|
|
5
|
+
import { useTaxonomyOptions as N } from "../../../context/taxonomy-options-context.js";
|
|
6
|
+
import o from "./taxonomy-selector-messages.js";
|
|
7
|
+
import { jsx as a, jsxs as l, Fragment as k } from "react/jsx-runtime";
|
|
8
|
+
import '../../../../../../../styles/taxonomy-selector.css';const z = "_taxonomySelectorLabel_b3aww_1", j = "_listWrapper_b3aww_14", M = "_listWrapperWithPadding_b3aww_19", $ = "_taxonomyItem_b3aww_24", q = "_statusContainer_b3aww_30", r = {
|
|
9
|
+
taxonomySelectorLabel: z,
|
|
10
|
+
listWrapper: j,
|
|
11
|
+
listWrapperWithPadding: M,
|
|
12
|
+
taxonomyItem: $,
|
|
13
|
+
statusContainer: q
|
|
14
|
+
}, G = ({
|
|
15
|
+
data: g,
|
|
16
|
+
onClick: u,
|
|
17
|
+
onSearchValue: i,
|
|
18
|
+
triggerButton: y,
|
|
19
|
+
disabled: b,
|
|
20
|
+
resetValueOnHide: f
|
|
21
|
+
}) => {
|
|
22
|
+
const {
|
|
23
|
+
formatMessage: t
|
|
24
|
+
} = O(), {
|
|
25
|
+
status: c,
|
|
26
|
+
onSelectorOpen: d
|
|
27
|
+
} = N(), [C, m] = x(""), [_, p] = x(!1), v = (e) => {
|
|
28
|
+
m(e), i(e);
|
|
29
|
+
}, I = (e) => {
|
|
30
|
+
p(e), e && d(), !e && f && (m(""), i(""));
|
|
31
|
+
}, S = (e) => {
|
|
32
|
+
u(e), p(!1);
|
|
33
|
+
}, W = y ?? /* @__PURE__ */ a(n, {
|
|
34
|
+
variant: "secondary",
|
|
35
|
+
size: "large",
|
|
36
|
+
endIcon: P,
|
|
37
|
+
"aria-label": t(o.taxonomySelectorAriaLabel),
|
|
38
|
+
children: t(o.taxonomySelector)
|
|
39
|
+
}), T = () => c === "loading" ? /* @__PURE__ */ a("div", {
|
|
40
|
+
className: r.statusContainer,
|
|
41
|
+
children: /* @__PURE__ */ a(w, {
|
|
42
|
+
"aria-label": t(o.loadingTaxonomies)
|
|
43
|
+
})
|
|
44
|
+
}) : c === "error" ? /* @__PURE__ */ l("div", {
|
|
45
|
+
className: r.statusContainer,
|
|
46
|
+
children: [/* @__PURE__ */ a(h, {
|
|
47
|
+
as: "p",
|
|
48
|
+
variant: "bodyDefault",
|
|
49
|
+
color: "textOnLightSecondary",
|
|
50
|
+
children: t(o.loadTaxonomiesError)
|
|
51
|
+
}), /* @__PURE__ */ a(n, {
|
|
52
|
+
variant: "secondary",
|
|
53
|
+
size: "small",
|
|
54
|
+
onClick: d,
|
|
55
|
+
children: t(o.retryLoadTaxonomies)
|
|
56
|
+
})]
|
|
57
|
+
}) : /* @__PURE__ */ l(k, {
|
|
58
|
+
children: [/* @__PURE__ */ a("div", {
|
|
59
|
+
className: `${r.listWrapper} ${r.listWrapperWithPadding}`,
|
|
60
|
+
children: /* @__PURE__ */ a(L, {
|
|
61
|
+
label: t(o.searchTaxonomiesInputPlaceholder),
|
|
62
|
+
placeholder: t(o.searchTaxonomiesInputPlaceholder),
|
|
63
|
+
value: C,
|
|
64
|
+
onChange: (e) => v(e.target.value),
|
|
65
|
+
hideLabel: !0,
|
|
66
|
+
"aria-label": t(o.searchTaxonomiesInputPlaceholder)
|
|
67
|
+
})
|
|
68
|
+
}), /* @__PURE__ */ a(h, {
|
|
69
|
+
as: "span",
|
|
70
|
+
variant: "caption",
|
|
71
|
+
color: "textOnLightSecondary",
|
|
72
|
+
className: r.taxonomySelectorLabel,
|
|
73
|
+
children: t(o.allTaxonomies)
|
|
74
|
+
}), /* @__PURE__ */ a("div", {
|
|
75
|
+
className: r.listWrapper,
|
|
76
|
+
children: g.map((e) => /* @__PURE__ */ a(n, {
|
|
77
|
+
type: "button",
|
|
78
|
+
variant: "quaternary",
|
|
79
|
+
size: "large",
|
|
80
|
+
disabled: e?.levels?.length === 0,
|
|
81
|
+
onClick: () => S(e),
|
|
82
|
+
className: r.taxonomyItem,
|
|
83
|
+
children: e.label
|
|
84
|
+
}, e.id))
|
|
85
|
+
})]
|
|
86
|
+
});
|
|
87
|
+
return /* @__PURE__ */ l(s.Root, {
|
|
88
|
+
modal: !1,
|
|
89
|
+
open: _,
|
|
90
|
+
onOpenChange: I,
|
|
91
|
+
children: [/* @__PURE__ */ a(s.Trigger, {
|
|
92
|
+
disabled: b,
|
|
93
|
+
children: W
|
|
94
|
+
}), /* @__PURE__ */ a(s.ContentContainer, {
|
|
95
|
+
align: "start",
|
|
96
|
+
"aria-label": t(o.taxonomySelector),
|
|
97
|
+
children: T()
|
|
98
|
+
})]
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
export {
|
|
102
|
+
G as TaxonomySelector
|
|
103
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { taxonomyDefaultValues as s } from "./taxonomy-default-values.js";
|
|
2
|
+
const m = (o) => ({
|
|
3
|
+
onTaxonomySelect: (l) => {
|
|
4
|
+
const e = o.values.taxonomy.availableTaxonomies.find((a) => a.id === l.id);
|
|
5
|
+
o.setFieldValue("taxonomy", {
|
|
6
|
+
...s.taxonomy,
|
|
7
|
+
availableTaxonomies: o.values.taxonomy.availableTaxonomies.map((a) => ({
|
|
8
|
+
...a,
|
|
9
|
+
selected: a.id === l.id
|
|
10
|
+
})),
|
|
11
|
+
selectedLevels: e?.levels[0] ? [e.levels[0].level] : [],
|
|
12
|
+
taxonomyKey: e?.taxonomyKey ?? "",
|
|
13
|
+
namespace: e?.namespace ?? ""
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
export {
|
|
18
|
+
m as useTaxonomySelect
|
|
19
|
+
};
|
package/dist/esm/lib/components/metadata-field-configurator/context/field-configurator-context.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import c from "lodash/cloneDeep";
|
|
2
|
+
import i from "lodash/set";
|
|
3
|
+
import { createContext as P, useContext as j, useState as l, useCallback as n, useMemo as k } from "react";
|
|
4
|
+
import { jsx as y } from "react/jsx-runtime";
|
|
5
|
+
const V = /* @__PURE__ */ P(null);
|
|
6
|
+
function q() {
|
|
7
|
+
const s = j(V);
|
|
8
|
+
if (!s)
|
|
9
|
+
throw new Error("useFieldConfigurator must be used within a FieldConfiguratorContext provider");
|
|
10
|
+
return s;
|
|
11
|
+
}
|
|
12
|
+
const z = ({
|
|
13
|
+
initialValues: s,
|
|
14
|
+
initialErrors: w = {},
|
|
15
|
+
initialTouched: S = {},
|
|
16
|
+
children: T
|
|
17
|
+
}) => {
|
|
18
|
+
const [d, u] = l(s), [m] = l(w), [f, a] = l(S), x = n((t, e) => {
|
|
19
|
+
u((o) => ({
|
|
20
|
+
...o,
|
|
21
|
+
[t]: e
|
|
22
|
+
}));
|
|
23
|
+
}, []), C = n((t) => u(t), []), g = n((t, e = !0) => {
|
|
24
|
+
a((o) => {
|
|
25
|
+
const r = c(o);
|
|
26
|
+
return i(r, t, e), r;
|
|
27
|
+
});
|
|
28
|
+
}, []), h = n((t) => a(t), []), F = n((t) => {
|
|
29
|
+
const {
|
|
30
|
+
name: e,
|
|
31
|
+
value: o
|
|
32
|
+
} = t.target;
|
|
33
|
+
u((r) => {
|
|
34
|
+
const v = c(r);
|
|
35
|
+
return i(v, e, o), v;
|
|
36
|
+
});
|
|
37
|
+
}, []), p = n((t) => {
|
|
38
|
+
const e = t.target;
|
|
39
|
+
e.name && a((o) => {
|
|
40
|
+
const r = c(o);
|
|
41
|
+
return i(r, e.name, !0), r;
|
|
42
|
+
});
|
|
43
|
+
}, []), b = k(() => ({
|
|
44
|
+
values: d,
|
|
45
|
+
errors: m,
|
|
46
|
+
touched: f,
|
|
47
|
+
isValid: !0,
|
|
48
|
+
setFieldValue: x,
|
|
49
|
+
setValues: C,
|
|
50
|
+
setFieldTouched: g,
|
|
51
|
+
setTouched: h,
|
|
52
|
+
handleChange: F,
|
|
53
|
+
handleBlur: p,
|
|
54
|
+
// No-op: FieldConfiguratorProvider has no validation layer.
|
|
55
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
56
|
+
validateForm: async () => {
|
|
57
|
+
}
|
|
58
|
+
}), [d, m, f, x, C, g, h, F, p]);
|
|
59
|
+
return /* @__PURE__ */ y(V.Provider, {
|
|
60
|
+
value: b,
|
|
61
|
+
children: T
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
export {
|
|
65
|
+
V as FieldConfiguratorContext,
|
|
66
|
+
z as FieldConfiguratorProvider,
|
|
67
|
+
q as useFieldConfigurator
|
|
68
|
+
};
|
package/dist/esm/lib/components/metadata-field-configurator/context/taxonomy-options-context.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createContext as o, useContext as n } from "react";
|
|
2
|
+
const e = {
|
|
3
|
+
options: [],
|
|
4
|
+
status: "success",
|
|
5
|
+
onSelectorOpen: () => {
|
|
6
|
+
}
|
|
7
|
+
}, s = /* @__PURE__ */ o(e);
|
|
8
|
+
function r() {
|
|
9
|
+
return n(s);
|
|
10
|
+
}
|
|
11
|
+
function u(t) {
|
|
12
|
+
return {
|
|
13
|
+
options: t,
|
|
14
|
+
status: "success",
|
|
15
|
+
onSelectorOpen: () => {
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
s as TaxonomyOptionsContext,
|
|
21
|
+
u as createStaticTaxonomyContext,
|
|
22
|
+
r as useTaxonomyOptions
|
|
23
|
+
};
|
package/dist/esm/lib/components/metadata-field-configurator/hooks/useFieldConfiguratorBehavior.js
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { useState as I, useCallback as n, useMemo as w, useRef as x, useEffect as f } from "react";
|
|
2
|
+
import { useIntl as oe } from "react-intl";
|
|
3
|
+
import re from "lodash/cloneDeep";
|
|
4
|
+
import ce from "lodash/set";
|
|
5
|
+
import { FieldTypeIcon as de } from "../../../utils/field-options/field-type-icon.js";
|
|
6
|
+
import { useFieldExtensions as se } from "../context/field-extensions-context.js";
|
|
7
|
+
import { general as le } from "../messages/configurator-messages.js";
|
|
8
|
+
import { createDefaultFieldValues as fe, hasVisibleErrors as me } from "../utils.js";
|
|
9
|
+
import { useFieldValidation as pe } from "./useFieldValidation.js";
|
|
10
|
+
import { useTaxonomyFetch as ae } from "./useTaxonomyFetch.js";
|
|
11
|
+
function Re({
|
|
12
|
+
values: e,
|
|
13
|
+
onValuesChange: i,
|
|
14
|
+
onDelete: T,
|
|
15
|
+
isExpanded: m,
|
|
16
|
+
onExpandedChange: V,
|
|
17
|
+
submitAttemptCount: d,
|
|
18
|
+
taxonomyOptions: C,
|
|
19
|
+
fetchTaxonomies: S,
|
|
20
|
+
fieldExtensionsProp: B,
|
|
21
|
+
onValidationChange: N
|
|
22
|
+
}) {
|
|
23
|
+
const u = oe(), {
|
|
24
|
+
errors: p,
|
|
25
|
+
touched: a,
|
|
26
|
+
isValid: s,
|
|
27
|
+
validateForm: M,
|
|
28
|
+
touchAll: R,
|
|
29
|
+
setFieldTouched: P,
|
|
30
|
+
setTouched: q,
|
|
31
|
+
handleBlur: H
|
|
32
|
+
} = pe(e), K = ae(S, C), j = se(), b = B ?? j, [z, A] = I(() => e.isFieldNew === !0), [G, F] = I(!1), [h, O] = I("edit"), o = m !== void 0 ? m : z, J = !e.isFieldReadOnly && e.isFieldNew, r = e.id, L = `field-name-${r}`, Q = `field-description-${r}`, l = n((t, c) => {
|
|
33
|
+
i({
|
|
34
|
+
...e,
|
|
35
|
+
[t]: c
|
|
36
|
+
});
|
|
37
|
+
}, [e, i]), k = n((t) => {
|
|
38
|
+
const {
|
|
39
|
+
name: c,
|
|
40
|
+
value: ne
|
|
41
|
+
} = t.target, D = re(e);
|
|
42
|
+
ce(D, c, ne), i(D);
|
|
43
|
+
}, [e, i]), U = w(
|
|
44
|
+
() => ({
|
|
45
|
+
values: e,
|
|
46
|
+
errors: p,
|
|
47
|
+
touched: a,
|
|
48
|
+
isValid: s,
|
|
49
|
+
setFieldValue: l,
|
|
50
|
+
setValues: i,
|
|
51
|
+
setFieldTouched: P,
|
|
52
|
+
setTouched: q,
|
|
53
|
+
handleChange: k,
|
|
54
|
+
handleBlur: H,
|
|
55
|
+
validateForm: M
|
|
56
|
+
}),
|
|
57
|
+
// setFieldTouched, setTouched, handleBlur are stable (no deps).
|
|
58
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
59
|
+
[e, p, a, s, l, i, k, M]
|
|
60
|
+
), E = x(o);
|
|
61
|
+
f(() => {
|
|
62
|
+
const t = E.current;
|
|
63
|
+
E.current = o, t && !o && (R(), O("edit"));
|
|
64
|
+
}, [o]);
|
|
65
|
+
const W = x(d);
|
|
66
|
+
f(() => {
|
|
67
|
+
!d || d === W.current || R();
|
|
68
|
+
}, [d]);
|
|
69
|
+
const $ = x(N);
|
|
70
|
+
$.current = N, f(() => {
|
|
71
|
+
$.current?.(s);
|
|
72
|
+
}, [s]), f(() => {
|
|
73
|
+
e.isFieldNew && (m !== void 0 ? V?.(!0) : A(!0));
|
|
74
|
+
}, [e.isFieldNew]);
|
|
75
|
+
const X = n((t) => l("hidden", t), [l]), y = n(() => {
|
|
76
|
+
T?.(e.key), F(!1);
|
|
77
|
+
}, [T, e.key]), Y = n(() => {
|
|
78
|
+
e.isFieldNew ? y() : F(!0);
|
|
79
|
+
}, [y, e.isFieldNew]), Z = n(() => F(!1), []), _ = n((t) => A(t === r), [r]), v = n((t) => {
|
|
80
|
+
i({
|
|
81
|
+
...fe(t),
|
|
82
|
+
key: e.key,
|
|
83
|
+
hidden: e.hidden,
|
|
84
|
+
isFieldNew: e.isFieldNew,
|
|
85
|
+
isFieldReadOnly: e.isFieldReadOnly,
|
|
86
|
+
name: e.name,
|
|
87
|
+
description: e.description
|
|
88
|
+
});
|
|
89
|
+
}, [i, e]), ee = w(() => {
|
|
90
|
+
const t = e.name || u.formatMessage(le.fieldNameInputPlaceholder), c = e.type === "dropdown" ? ` (${e.dropdown?.options?.length ?? 0})` : "";
|
|
91
|
+
return `${t}${c}`;
|
|
92
|
+
}, [e.name, e.type, e.dropdown?.options?.length, u]), te = w(() => de(e.type), [e.type]), g = h === "edit" ? 0 : Number(h.replace("ext-", "")) + 1, ie = g > 0 ? b[g - 1] ?? null : null;
|
|
93
|
+
return {
|
|
94
|
+
contextValue: U,
|
|
95
|
+
taxonomyContextValue: K,
|
|
96
|
+
extensions: b,
|
|
97
|
+
isActive: o,
|
|
98
|
+
handleAccordionValueChange: _,
|
|
99
|
+
isDeleteConfirmationModalOpen: G,
|
|
100
|
+
openConfirmationModal: Y,
|
|
101
|
+
closeConfirmationModal: Z,
|
|
102
|
+
handleDeleteField: y,
|
|
103
|
+
activeTabId: h,
|
|
104
|
+
setActiveTabId: O,
|
|
105
|
+
activeExtension: ie,
|
|
106
|
+
isTypeEditable: J,
|
|
107
|
+
uniqueKey: r,
|
|
108
|
+
nameInputId: L,
|
|
109
|
+
descriptionInputId: Q,
|
|
110
|
+
accordionTitle: ee,
|
|
111
|
+
TitleIcon: te,
|
|
112
|
+
hasErrors: me(p, a),
|
|
113
|
+
handleTypeChange: v,
|
|
114
|
+
handleChangeVisibility: X
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
export {
|
|
118
|
+
Re as useFieldConfiguratorBehavior
|
|
119
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { useState as d, useCallback as n, useEffect as h, useRef as S } from "react";
|
|
2
|
+
import * as b from "yup";
|
|
3
|
+
import f from "lodash/set";
|
|
4
|
+
import y from "lodash/cloneDeep";
|
|
5
|
+
import { useTemplateFieldSchema as k } from "./useTemplateFieldSchema.js";
|
|
6
|
+
import { markAllTouched as w } from "../utils.js";
|
|
7
|
+
function A(t) {
|
|
8
|
+
const c = {};
|
|
9
|
+
return (t.inner.length > 0 ? t.inner : [t]).forEach((a) => {
|
|
10
|
+
a.path && f(c, a.path, a.message);
|
|
11
|
+
}), c;
|
|
12
|
+
}
|
|
13
|
+
function Y(t) {
|
|
14
|
+
const c = k(), [a, m] = d({}), [T, u] = d(!1), [E, s] = d({}), l = n(async (e, r) => {
|
|
15
|
+
try {
|
|
16
|
+
if (await c.validate(e, {
|
|
17
|
+
abortEarly: !1
|
|
18
|
+
}), r?.cancelled)
|
|
19
|
+
return;
|
|
20
|
+
m({}), u(!0);
|
|
21
|
+
} catch (o) {
|
|
22
|
+
if (r?.cancelled)
|
|
23
|
+
return;
|
|
24
|
+
o instanceof b.ValidationError && (m(A(o)), u(!1));
|
|
25
|
+
}
|
|
26
|
+
}, [c]);
|
|
27
|
+
h(() => {
|
|
28
|
+
const e = {
|
|
29
|
+
cancelled: !1
|
|
30
|
+
};
|
|
31
|
+
return l(t, e), () => {
|
|
32
|
+
e.cancelled = !0;
|
|
33
|
+
};
|
|
34
|
+
}, [t, l]);
|
|
35
|
+
const p = S(t.type);
|
|
36
|
+
h(() => {
|
|
37
|
+
p.current !== t.type && (p.current = t.type, s(({
|
|
38
|
+
dropdown: e,
|
|
39
|
+
taxonomy: r,
|
|
40
|
+
...o
|
|
41
|
+
}) => o));
|
|
42
|
+
}, [t.type]);
|
|
43
|
+
const g = n(() => l(t), [l, t]), x = n(() => s(w(t)), [t]), F = n((e, r = !0) => {
|
|
44
|
+
s((o) => {
|
|
45
|
+
const i = y(o);
|
|
46
|
+
return f(i, e, r), i;
|
|
47
|
+
});
|
|
48
|
+
}, []), V = n((e) => s(e), []), R = n((e) => {
|
|
49
|
+
const r = e.target;
|
|
50
|
+
r.name && s((o) => {
|
|
51
|
+
const i = y(o);
|
|
52
|
+
return f(i, r.name, !0), i;
|
|
53
|
+
});
|
|
54
|
+
}, []);
|
|
55
|
+
return {
|
|
56
|
+
errors: a,
|
|
57
|
+
touched: E,
|
|
58
|
+
isValid: T,
|
|
59
|
+
validateForm: g,
|
|
60
|
+
touchAll: x,
|
|
61
|
+
setFieldTouched: F,
|
|
62
|
+
setTouched: V,
|
|
63
|
+
handleBlur: R
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
export {
|
|
67
|
+
Y as useFieldValidation
|
|
68
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useState as c, useRef as p, useCallback as o } from "react";
|
|
2
|
+
import { createStaticTaxonomyContext as y } from "../context/taxonomy-options-context.js";
|
|
3
|
+
function g(t, u = []) {
|
|
4
|
+
const [e, r] = c("idle"), [a, i] = c([]), n = p(!1), s = o(async () => {
|
|
5
|
+
if (!(!t || n.current)) {
|
|
6
|
+
n.current = !0, r("loading");
|
|
7
|
+
try {
|
|
8
|
+
const f = await t();
|
|
9
|
+
i(f), r("success");
|
|
10
|
+
} catch {
|
|
11
|
+
r("error");
|
|
12
|
+
} finally {
|
|
13
|
+
n.current = !1;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}, [t]), l = o(() => {
|
|
17
|
+
e === "success" || e === "loading" || s();
|
|
18
|
+
}, [s, e]);
|
|
19
|
+
return t ? {
|
|
20
|
+
options: a,
|
|
21
|
+
status: e,
|
|
22
|
+
onSelectorOpen: l
|
|
23
|
+
} : y(u);
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
g as useTaxonomyFetch
|
|
27
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useMemo as y } from "react";
|
|
2
|
+
import { useIntl as h } from "react-intl";
|
|
3
|
+
import * as e from "yup";
|
|
4
|
+
import { T as b, F as i } from "../../../../../chunks/types.js";
|
|
5
|
+
import { METADATA_TEMPLATE_FIELD_NAME_MAX_LENGTH as q } from "../../../utils/constants.js";
|
|
6
|
+
import { validationErrors as n } from "../messages/configurator-messages.js";
|
|
7
|
+
const j = () => {
|
|
8
|
+
const t = h();
|
|
9
|
+
return y(() => {
|
|
10
|
+
const m = e.string().min(1).max(q, t.formatMessage(n.fieldNameTooLong)).required(t.formatMessage(n.fieldNameCannotBeEmpty)).test("no-whitespace-only", t.formatMessage(n.fieldNameCannotBeEmpty), (o) => !o || o.trim().length > 0), c = e.object().shape({
|
|
11
|
+
key: e.string().required(t.formatMessage(n.optionKeyCannotBeEmpty)).test("unique-key", t.formatMessage(n.duplicateOption), (o, r) => {
|
|
12
|
+
if (!o)
|
|
13
|
+
return !0;
|
|
14
|
+
const l = r?.from?.[0]?.value, s = r?.from?.[1].value?.options ?? [], u = s.findIndex((a) => a.id === l?.id);
|
|
15
|
+
return !s.some((a, f) => f !== u && a.key === o);
|
|
16
|
+
})
|
|
17
|
+
}), p = e.object().shape({
|
|
18
|
+
dropdown: e.object().shape({
|
|
19
|
+
allowMultipleSelections: e.boolean().required(),
|
|
20
|
+
options: e.array().of(c).min(1).required()
|
|
21
|
+
})
|
|
22
|
+
}), d = e.object().shape({
|
|
23
|
+
taxonomy: e.object().shape({
|
|
24
|
+
namespace: e.string().required(),
|
|
25
|
+
taxonomyKey: e.string().required(),
|
|
26
|
+
allowMultipleSelections: e.boolean().required(),
|
|
27
|
+
selection: e.mixed().oneOf(Object.values(b)).required(),
|
|
28
|
+
selectedLevels: e.array().of(e.number().required()).min(1).required()
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
return e.lazy((o) => {
|
|
32
|
+
const r = e.object().shape({
|
|
33
|
+
type: e.mixed().oneOf(Object.values(i)).required(),
|
|
34
|
+
name: m,
|
|
35
|
+
description: e.string().nullable(),
|
|
36
|
+
hidden: e.boolean().required()
|
|
37
|
+
});
|
|
38
|
+
return o?.type === i.Dropdown ? r.concat(p) : o?.type === i.Taxonomy ? r.concat(d) : r;
|
|
39
|
+
});
|
|
40
|
+
}, [t]);
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
j as useTemplateFieldSchema
|
|
44
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useTemplateFieldSchema as o } from "./hooks/useTemplateFieldSchema.js";
|
|
2
|
+
import { MetadataFieldConfigurator as a } from "./metadata-field-configurator.js";
|
|
3
|
+
import { createDefaultFieldValues as l } from "./utils.js";
|
|
4
|
+
import { FieldExtensionsContext as x, useFieldExtensions as d } from "./context/field-extensions-context.js";
|
|
5
|
+
export {
|
|
6
|
+
x as FieldExtensionsContext,
|
|
7
|
+
a as MetadataFieldConfigurator,
|
|
8
|
+
l as createDefaultFieldValues,
|
|
9
|
+
d as useFieldExtensions,
|
|
10
|
+
o as useTemplateFieldSchema
|
|
11
|
+
};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { defineMessages as e } from "react-intl";
|
|
2
|
+
const t = e({
|
|
3
|
+
fieldTypeLabel: {
|
|
4
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.fieldTypeLabel",
|
|
5
|
+
defaultMessage: "Field Type"
|
|
6
|
+
},
|
|
7
|
+
fieldTypePlaceholder: {
|
|
8
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.fieldTypePlaceholder",
|
|
9
|
+
defaultMessage: "Select Type"
|
|
10
|
+
},
|
|
11
|
+
fieldNameLabel: {
|
|
12
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.fieldNameLabel",
|
|
13
|
+
defaultMessage: "Field Name"
|
|
14
|
+
},
|
|
15
|
+
fieldNameInputPlaceholder: {
|
|
16
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.fieldNameInputPlaceholder",
|
|
17
|
+
defaultMessage: "Add a field name/label"
|
|
18
|
+
},
|
|
19
|
+
fieldDescriptionLabel: {
|
|
20
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.fieldDescriptionLabel",
|
|
21
|
+
defaultMessage: "Field Description"
|
|
22
|
+
},
|
|
23
|
+
fieldDescriptionInputPlaceholder: {
|
|
24
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.fieldDescriptionInputPlaceholder",
|
|
25
|
+
defaultMessage: "Add custom help text that appears in a tooltip for users"
|
|
26
|
+
},
|
|
27
|
+
descriptionInfoTooltip: {
|
|
28
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.descriptionInfoTooltip",
|
|
29
|
+
defaultMessage: "The description is visible to anyone accessing the template. It also helps Box AI find and autofill Metadata for you."
|
|
30
|
+
},
|
|
31
|
+
descriptionLearnMoreBadgeAriaLabel: {
|
|
32
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.descriptionLearnMoreBadgeAriaLabel",
|
|
33
|
+
defaultMessage: "Learn more about the description field"
|
|
34
|
+
},
|
|
35
|
+
dragAndDropFieldAriaLabel: {
|
|
36
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.dragAndDropFieldAriaLabel",
|
|
37
|
+
defaultMessage: "Drag and drop to reorder field"
|
|
38
|
+
},
|
|
39
|
+
hideField: {
|
|
40
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.hideField",
|
|
41
|
+
defaultMessage: "Hide Field"
|
|
42
|
+
},
|
|
43
|
+
showField: {
|
|
44
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.showField",
|
|
45
|
+
defaultMessage: "Make Visible"
|
|
46
|
+
},
|
|
47
|
+
hiddenStatus: {
|
|
48
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.hiddenStatus",
|
|
49
|
+
defaultMessage: "Hidden"
|
|
50
|
+
},
|
|
51
|
+
deleteFieldTitle: {
|
|
52
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.deleteFieldTitle",
|
|
53
|
+
defaultMessage: 'Delete "{fieldName}" Field'
|
|
54
|
+
},
|
|
55
|
+
deleteFieldDescription: {
|
|
56
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.deleteFieldDescription",
|
|
57
|
+
defaultMessage: "All files or folders associated with this field will now have an unassigned value. This action cannot be undone once the template is saved."
|
|
58
|
+
},
|
|
59
|
+
cancelDeleteField: {
|
|
60
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.cancelDeleteField",
|
|
61
|
+
defaultMessage: "Cancel"
|
|
62
|
+
},
|
|
63
|
+
confirmDeleteField: {
|
|
64
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.confirmDeleteField",
|
|
65
|
+
defaultMessage: "Confirm"
|
|
66
|
+
},
|
|
67
|
+
moveUp: {
|
|
68
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.moveUp",
|
|
69
|
+
defaultMessage: "Move Up"
|
|
70
|
+
},
|
|
71
|
+
moveUpAriaLabel: {
|
|
72
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.moveUpAriaLabel",
|
|
73
|
+
defaultMessage: "Move field up"
|
|
74
|
+
},
|
|
75
|
+
moveDown: {
|
|
76
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.moveDown",
|
|
77
|
+
defaultMessage: "Move Down"
|
|
78
|
+
},
|
|
79
|
+
moveDownAriaLabel: {
|
|
80
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.moveDownAriaLabel",
|
|
81
|
+
defaultMessage: "Move field down"
|
|
82
|
+
},
|
|
83
|
+
deleteField: {
|
|
84
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.deleteField",
|
|
85
|
+
defaultMessage: "Remove"
|
|
86
|
+
},
|
|
87
|
+
deleteFieldAriaLabel: {
|
|
88
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.deleteFieldAriaLabel",
|
|
89
|
+
defaultMessage: "Delete field"
|
|
90
|
+
},
|
|
91
|
+
contextMenuAriaLabel: {
|
|
92
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.contextMenuAriaLabel",
|
|
93
|
+
defaultMessage: "Field configurator context menu"
|
|
94
|
+
},
|
|
95
|
+
editTabAriaLabel: {
|
|
96
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.editTabAriaLabel",
|
|
97
|
+
defaultMessage: "Edit field"
|
|
98
|
+
},
|
|
99
|
+
duplicateField: {
|
|
100
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.duplicateField",
|
|
101
|
+
defaultMessage: "Duplicate"
|
|
102
|
+
},
|
|
103
|
+
duplicateFieldAriaLabel: {
|
|
104
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.duplicateFieldAriaLabel",
|
|
105
|
+
defaultMessage: "Duplicate field"
|
|
106
|
+
}
|
|
107
|
+
}), d = e({
|
|
108
|
+
fieldNameCannotBeEmpty: {
|
|
109
|
+
id: "groupSharedFeatures.metadataTemplateEditor.fields.validationErrors.fieldNameCannotBeEmpty",
|
|
110
|
+
defaultMessage: "Field name cannot be empty."
|
|
111
|
+
},
|
|
112
|
+
fieldNameTooLong: {
|
|
113
|
+
id: "groupSharedFeatures.metadataTemplateEditor.fields.validationErrors.fieldNameTooLong",
|
|
114
|
+
defaultMessage: "The field name is too long."
|
|
115
|
+
},
|
|
116
|
+
duplicateOption: {
|
|
117
|
+
id: "groupSharedFeatures.metadataTemplateEditor.fields.validationErrors.duplicateOption",
|
|
118
|
+
defaultMessage: "The option label must be unique."
|
|
119
|
+
},
|
|
120
|
+
optionKeyCannotBeEmpty: {
|
|
121
|
+
id: "groupSharedFeatures.metadataTemplateEditor.fields.validationErrors.optionKeyCannotBeEmpty",
|
|
122
|
+
defaultMessage: "Option cannot be empty."
|
|
123
|
+
},
|
|
124
|
+
selectedLevelRequired: {
|
|
125
|
+
id: "groupSharedFeatures.metadataTemplateEditor.fields.validationErrors.selectedLevelRequired",
|
|
126
|
+
defaultMessage: "Please select a level."
|
|
127
|
+
},
|
|
128
|
+
thisFieldContainsErrors: {
|
|
129
|
+
id: "groupSharedFeatures.metadataTemplateEditor.templates.details.fields.thisFieldContainsErrors",
|
|
130
|
+
defaultMessage: "This field contains validation errors."
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
export {
|
|
134
|
+
t as general,
|
|
135
|
+
d as validationErrors
|
|
136
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { defineMessages as e } from "react-intl";
|
|
2
|
+
const o = e({
|
|
3
|
+
addOption: {
|
|
4
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.dropdown.addOption",
|
|
5
|
+
defaultMessage: "+ Add Option"
|
|
6
|
+
},
|
|
7
|
+
deleteDropdownOptionAriaLabel: {
|
|
8
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.dropdown.deleteDropdownOptionAriaLabel",
|
|
9
|
+
defaultMessage: "Delete option"
|
|
10
|
+
},
|
|
11
|
+
dragAndDropOptionAriaLabel: {
|
|
12
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.dropdown.dragAndDropOptionAriaLabel",
|
|
13
|
+
defaultMessage: "Drag and drop to reorder option"
|
|
14
|
+
},
|
|
15
|
+
allowMultipleSelection: {
|
|
16
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.dropdown.allowMultipleSelection",
|
|
17
|
+
defaultMessage: "Allow Multiple Selections"
|
|
18
|
+
},
|
|
19
|
+
addAnOptionOptionPlaceholder: {
|
|
20
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.dropdown.addAnOptionOptionPlaceholder",
|
|
21
|
+
defaultMessage: "Add an option"
|
|
22
|
+
},
|
|
23
|
+
deleteOptionTitle: {
|
|
24
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.dropdown.deleteOptionTitle",
|
|
25
|
+
defaultMessage: 'Delete "{optionName}" Option'
|
|
26
|
+
},
|
|
27
|
+
deleteOptionDescription: {
|
|
28
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.dropdown.deleteOptionDescription",
|
|
29
|
+
defaultMessage: "All files or folders associated with this will now have an unassigned value. This action cannot be undone once the template is saved."
|
|
30
|
+
},
|
|
31
|
+
optionListValidationError: {
|
|
32
|
+
id: "groupSharedFeatures.metadataTemplateEditor.configurator.dropdown.optionListValidationError",
|
|
33
|
+
defaultMessage: "Some options in this list contain validation errors."
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
export {
|
|
37
|
+
o as default
|
|
38
|
+
};
|