@box/metadata-editor 1.64.5 → 1.64.6
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/ai-suggestion-field.js +83 -0
- package/dist/chunks/autofill-overlay.js +63 -0
- package/dist/chunks/combobox-with-api-pagination.js +162 -0
- package/dist/chunks/custom-instance-new-field.js +60 -0
- package/dist/chunks/custom-instance.js +74 -0
- package/dist/chunks/delete-confirmation-modal.js +76 -0
- package/dist/chunks/field-action-bar.module.js +6 -8
- package/dist/chunks/filter-dropdown-menu.module.js +14 -13
- package/dist/chunks/filter-instances-dropdown.js +84 -0
- package/dist/chunks/interactive-header-text.js +19 -0
- package/dist/chunks/interactive-text.js +17 -0
- package/dist/chunks/metadata-editor.js +9 -0
- package/dist/chunks/metadata-instance-content.js +29 -0
- package/dist/chunks/metadata-instance-entry.js +82 -0
- package/dist/chunks/metadata-instance-footer.js +25 -0
- package/dist/chunks/metadata-instance-form-autofill-button.js +113 -0
- package/dist/chunks/metadata-instance-form-card-wrapper.js +47 -70
- package/dist/chunks/metadata-instance-form-footer.js +43 -0
- package/dist/chunks/metadata-instance-form-header.js +45 -0
- package/dist/chunks/metadata-instance-header.js +52 -0
- package/dist/chunks/metadata-instance-list.js +19 -0
- package/dist/chunks/metadata-instance.js +59 -0
- package/dist/chunks/shared-field-styles.module.js +5 -7
- package/dist/chunks/taxonomy-ancestor-status-pill.js +88 -109
- package/dist/chunks/types.js +8 -12
- package/dist/chunks/update-mode-field-wrapper.js +80 -0
- package/dist/chunks/utils.js +57 -54
- package/dist/chunks/utils2.js +50 -70
- package/dist/esm/index.js +27 -52
- package/dist/esm/lib/components/add-metadata-template-dropdown/add-metadata-template-dropdown.js +31 -43
- package/dist/esm/lib/components/add-metadata-template-dropdown/index.js +1 -3
- package/dist/esm/lib/components/add-metadata-template-dropdown/messages.js +15 -17
- package/dist/esm/lib/components/combobox-with-api-pagination/combobox-with-api-pagination.js +2 -205
- package/dist/esm/lib/components/combobox-with-api-pagination/index.js +2 -4
- package/dist/esm/lib/components/combobox-with-api-pagination/messages.js +31 -33
- package/dist/esm/lib/components/combobox-with-api-pagination/request.js +4 -6
- package/dist/esm/lib/components/combobox-with-api-pagination/use-async-list.js +113 -128
- package/dist/esm/lib/components/combobox-with-api-pagination/utils/is-abort-error.js +8 -10
- package/dist/esm/lib/components/combobox-with-api-pagination/utils/use-controllable-state.js +32 -34
- package/dist/esm/lib/components/combobox-with-api-pagination/utils/use-intersection-observer.js +72 -82
- package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-content.js +13 -18
- package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-empty-state.js +16 -19
- package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-item.js +12 -17
- package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-list.js +15 -20
- package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-root.js +13 -18
- package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-search.js +36 -44
- package/dist/esm/lib/components/filter-dropdown-menu/filter-dropdown-menu-trigger.js +7 -12
- package/dist/esm/lib/components/filter-dropdown-menu/index.js +16 -18
- package/dist/esm/lib/components/filter-dropdown-menu/messages.js +10 -12
- package/dist/esm/lib/components/filter-instances-dropdown/filter-instances-dropdown.js +2 -93
- package/dist/esm/lib/components/filter-instances-dropdown/index.js +2 -4
- package/dist/esm/lib/components/filter-instances-dropdown/messages.js +18 -20
- package/dist/esm/lib/components/interactive-header-text/interactive-header-text.js +2 -28
- package/dist/esm/lib/components/interactive-text/interactive-text.js +2 -30
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-logo-badge/ai-logo-badge.js +20 -32
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-logo-badge/index.js +2 -4
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/ai-suggestion-field.js +2 -110
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/index.js +2 -4
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/messages.js +50 -52
- package/dist/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/utils.js +12 -17
- package/dist/esm/lib/components/metadata-editor-fields/components/constants.js +2 -6
- package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-badge/index.js +2 -4
- package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-badge/low-confidence-badge.js +20 -24
- package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-suggestion-field/index.js +2 -4
- package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-suggestion-field/low-confidence-suggestion-field.js +66 -75
- package/dist/esm/lib/components/metadata-editor-fields/components/low-confidence-suggestion-field/messages.js +30 -32
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-date-field/metadata-date-field.js +43 -60
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-enum-field/metadata-enum-field.js +47 -71
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-float-field/metadata-float-field.js +32 -54
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-float-field/use-float-validation.js +8 -14
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-multi-select-field/metadata-multi-select-field.js +40 -62
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-string-field/metadata-string-field.js +28 -44
- package/dist/esm/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/metadata-taxonomy-field.js +66 -95
- package/dist/esm/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/messages.js +30 -32
- package/dist/esm/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/mulitple-values-utils.js +7 -11
- package/dist/esm/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/update-mode-field-wrapper.js +2 -92
- package/dist/esm/lib/components/metadata-editor-fields/editor-field-types.js +30 -34
- package/dist/esm/lib/components/metadata-editor-fields/hooks/use-memoized-field-label.js +11 -7
- package/dist/esm/lib/components/metadata-editor-fields/hooks/use-review-field-filter.js +35 -40
- package/dist/esm/lib/components/metadata-editor-fields/hooks/use-view-reference-tooltip.js +39 -34
- package/dist/esm/lib/components/metadata-editor-fields/messages.js +5 -9
- package/dist/esm/lib/components/metadata-editor-fields/metadata-editor-field-wrapper.js +186 -176
- package/dist/esm/lib/components/metadata-editor-fields/metadata-editor-fields.js +30 -42
- package/dist/esm/lib/components/metadata-editor-fields/utils.js +2 -13
- package/dist/esm/lib/components/metadata-empty-state/messages.js +42 -44
- package/dist/esm/lib/components/metadata-empty-state/metadata-empty-state.js +46 -62
- package/dist/esm/lib/components/metadata-instance-editor/index.js +7 -14
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/autofill-overlay.js +2 -64
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/messages.js +39 -41
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/useErrorMessaging.js +21 -26
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance/custom-instance.js +2 -86
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance/messages.js +15 -17
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance-new-field/custom-instance-new-field.js +2 -62
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/custom-instance-new-field/messages.js +42 -44
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/delete-confirmation-modal/delete-confirmation-modal.js +2 -91
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/delete-confirmation-modal/messages.js +50 -52
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/constants.js +2 -7
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/messages.js +0 -1
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form-card-wrapper.js +2 -10
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js +126 -155
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/utils.js +2 -9
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/messages.js +23 -25
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-autofill-button/metadata-instance-form-autofill-button.js +2 -128
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-footer/messages.js +19 -21
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-footer/metadata-instance-form-footer.js +2 -53
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/messages.js +6 -10
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.js +2 -58
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-inline-notice/messages.js +18 -20
- package/dist/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-inline-notice/metadata-instance-form-inline-notice.js +30 -37
- package/dist/esm/lib/components/metadata-instance-list/index.js +4 -8
- package/dist/esm/lib/components/metadata-instance-list/metadata-instance-list.js +2 -35
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance/metadata-instance.js +2 -79
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-content/metadata-instance-content.js +2 -40
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/messages.js +5 -9
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-entry-display.js +14 -24
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-instance-entry.js +2 -112
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/taxonomy-entry/messages.js +22 -24
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/taxonomy-entry/taxonomy-ancestor-status-pill.js +2 -11
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/taxonomy-entry/taxonomy-value.js +24 -36
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-footer/messages.js +10 -12
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-footer/metadata-instance-footer.js +2 -31
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/messages.js +15 -17
- package/dist/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/metadata-instance-header.js +2 -63
- package/dist/esm/lib/components/metadata-instance-review-notice/messages.js +30 -32
- package/dist/esm/lib/components/metadata-instance-review-notice/metadata-instance-review-notice.js +22 -32
- package/dist/esm/lib/components/unsaved-changes-modal/index.js +2 -4
- package/dist/esm/lib/components/unsaved-changes-modal/messages.js +23 -25
- package/dist/esm/lib/components/unsaved-changes-modal/unsaved-changes-modal.js +41 -57
- package/dist/esm/lib/components/unsaved-changes-modal/utils.js +3 -5
- package/dist/esm/lib/constants.js +14 -18
- package/dist/esm/lib/defaults.js +14 -17
- package/dist/esm/lib/mappers.js +22 -28
- package/dist/esm/lib/messages.js +123 -126
- package/dist/esm/lib/metadata-editor.js +2 -14
- package/dist/esm/lib/utils/api-wrapper.js +12 -18
- package/dist/esm/lib/utils/autofill-context.js +65 -67
- package/dist/esm/lib/utils/check-if-has-bounding-boxes.js +2 -4
- package/dist/esm/lib/utils/confidence-score/format-confidence-score-percent.js +3 -5
- package/dist/esm/lib/utils/confidence-score/get-confidence-score-tooltip.js +12 -19
- package/dist/esm/lib/utils/confidence-score/get-fields-needing-review.js +5 -7
- package/dist/esm/lib/utils/confidence-score/index.js +5 -10
- package/dist/esm/lib/utils/confidence-score/is-confidence-score-needing-review.js +4 -6
- package/dist/esm/lib/utils/confidence-score/messages.js +14 -16
- package/dist/esm/lib/utils/convertDate.js +20 -31
- package/dist/esm/lib/utils/is-interactive-form-element.js +2 -4
- package/dist/esm/lib/utils/utils.js +4 -9
- package/dist/styles/autofill-overlay.css +1 -1
- package/dist/styles/combobox-with-api-pagination.css +1 -1
- package/dist/styles/custom-instance-new-field.css +1 -1
- package/dist/styles/custom-instance.css +1 -1
- package/dist/styles/delete-confirmation-modal.css +1 -1
- package/dist/styles/field-action-bar.css +1 -1
- package/dist/styles/filter-dropdown-menu.css +1 -1
- package/dist/styles/filter-instances-dropdown.css +1 -1
- package/dist/styles/interactive-header-text.css +1 -1
- package/dist/styles/interactive-text.css +1 -1
- package/dist/styles/metadata-editor.css +1 -0
- package/dist/styles/metadata-instance-content.css +1 -1
- package/dist/styles/metadata-instance-entry.css +1 -1
- package/dist/styles/metadata-instance-footer.css +1 -1
- package/dist/styles/metadata-instance-form-autofill-button.css +1 -1
- package/dist/styles/metadata-instance-form-card-wrapper.css +1 -1
- package/dist/styles/metadata-instance-form-footer.css +1 -1
- package/dist/styles/metadata-instance-form-header.css +1 -1
- package/dist/styles/metadata-instance-header.css +1 -1
- package/dist/styles/metadata-instance-list.css +1 -1
- package/dist/styles/shared-field-styles.css +1 -1
- package/dist/styles/taxonomy-ancestor-status-pill.css +1 -1
- package/dist/styles/update-mode-field-wrapper.css +1 -1
- package/dist/styles/utils.css +1 -1
- package/dist/types/lib/test-utils/index.d.ts +1 -0
- package/dist/types/lib/test-utils/pending-promise.d.ts +19 -0
- package/package.json +9 -9
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { n as e } from "./types.js";
|
|
2
|
+
import { t } from "./field-action-bar.module.js";
|
|
3
|
+
import n from "../esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/messages.js";
|
|
4
|
+
import { formatSuggestionValue as r } from "../esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/utils.js";
|
|
5
|
+
import { DropdownMenu as i, IconButton as a, Text as o, useBlueprintModernization as s } from "@box/blueprint-web";
|
|
6
|
+
import { Checkmark as c, Ellipsis as l } from "@box/blueprint-web-assets/icons/Fill";
|
|
7
|
+
import { FormattedMessage as u, useIntl as d } from "react-intl";
|
|
8
|
+
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
9
|
+
import h from "clsx";
|
|
10
|
+
import '../styles/ai-suggestion-field.css';var g = {
|
|
11
|
+
wrapper: "_wrapper_132y2_1",
|
|
12
|
+
selectTrigger: "_selectTrigger_132y2_1"
|
|
13
|
+
};
|
|
14
|
+
function _({ aiSuggestion: _, onAiSuggestionAppend: v, onAiSuggestionReplace: y, onAiSuggestionIgnore: b, type: x, isSameValue: S, confidenceLevel: C }) {
|
|
15
|
+
let w = d(), { enableModernizedComponents: T } = s(), E = C === e.High ? n.confidenceLevelHigh : n.confidenceLevelLow, D = C ? w.formatMessage(E) : void 0;
|
|
16
|
+
return /* @__PURE__ */ p("div", {
|
|
17
|
+
className: t.wrapperGradient,
|
|
18
|
+
"data-modern": T,
|
|
19
|
+
children: /* @__PURE__ */ p("div", {
|
|
20
|
+
className: h(t.wrapper, g.wrapper),
|
|
21
|
+
children: S ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(o, {
|
|
22
|
+
as: "p",
|
|
23
|
+
color: "textOnLightSecondary",
|
|
24
|
+
variant: "caption",
|
|
25
|
+
children: C ? w.formatMessage(n.sameValueAiSuggestionCaptionWithLevel, { level: D }) : w.formatMessage(n.sameValueAiSuggestionCaption)
|
|
26
|
+
}), /* @__PURE__ */ p("div", {
|
|
27
|
+
className: t.buttons,
|
|
28
|
+
children: /* @__PURE__ */ p(a, {
|
|
29
|
+
"aria-label": C ? w.formatMessage(n.aiSuggestionAccept) : w.formatMessage(n.aiSuggestionConfirm),
|
|
30
|
+
icon: c,
|
|
31
|
+
onClick: C ? y : b,
|
|
32
|
+
size: "x-small",
|
|
33
|
+
"data-target-id": "IconButton-aiSuggestionAccept|aiSuggestionConfirm"
|
|
34
|
+
})
|
|
35
|
+
})] }) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p(o, {
|
|
36
|
+
as: "p",
|
|
37
|
+
color: "textOnLightSecondary",
|
|
38
|
+
variant: "caption",
|
|
39
|
+
children: C ? w.formatMessage(n.aiSuggestionCaptionWithLevel, { level: D }) : w.formatMessage(n.aiSuggestionCaption)
|
|
40
|
+
}), /* @__PURE__ */ p(o, {
|
|
41
|
+
as: "p",
|
|
42
|
+
children: r(_, {
|
|
43
|
+
type: x,
|
|
44
|
+
locale: w.locale
|
|
45
|
+
})
|
|
46
|
+
})] }), /* @__PURE__ */ m("div", {
|
|
47
|
+
className: t.buttons,
|
|
48
|
+
children: [/* @__PURE__ */ p(a, {
|
|
49
|
+
"aria-label": w.formatMessage(x === "multiSelect" ? n.aiSuggestionAppend : n.aiSuggestionClearAndReplace),
|
|
50
|
+
"data-target-id": x === "multiSelect" ? "IconButton-aiSuggestionAppend" : "IconButton-aiSuggestionClearAndReplace",
|
|
51
|
+
icon: c,
|
|
52
|
+
onClick: x === "multiSelect" ? v : y,
|
|
53
|
+
size: "x-small"
|
|
54
|
+
}), /* @__PURE__ */ m(i.Root, { children: [/* @__PURE__ */ p(i.Trigger, {
|
|
55
|
+
className: g.selectTrigger,
|
|
56
|
+
children: /* @__PURE__ */ p(a, {
|
|
57
|
+
"aria-label": w.formatMessage(n.aiSuggestionOptions),
|
|
58
|
+
icon: l,
|
|
59
|
+
"data-target-id": "IconButton-aiSuggestionOptions"
|
|
60
|
+
})
|
|
61
|
+
}), /* @__PURE__ */ m(i.Content, { children: [
|
|
62
|
+
x === "multiSelect" && /* @__PURE__ */ p(i.Item, {
|
|
63
|
+
onSelect: v,
|
|
64
|
+
"data-target-id": "DropdownMenu.Item-aiSuggestionAppend",
|
|
65
|
+
children: /* @__PURE__ */ p(u, { ...n.aiSuggestionAppend })
|
|
66
|
+
}),
|
|
67
|
+
/* @__PURE__ */ p(i.Item, {
|
|
68
|
+
onSelect: y,
|
|
69
|
+
"data-target-id": "DropdownMenu.Item-aiSuggestionClearAndReplace",
|
|
70
|
+
children: /* @__PURE__ */ p(u, { ...n.aiSuggestionClearAndReplace })
|
|
71
|
+
}),
|
|
72
|
+
/* @__PURE__ */ p(i.Separator, {}),
|
|
73
|
+
/* @__PURE__ */ p(i.Item, {
|
|
74
|
+
onSelect: b,
|
|
75
|
+
"data-target-id": "DropdownMenu.Item-aiSuggestionIgnore",
|
|
76
|
+
children: /* @__PURE__ */ p(u, { ...n.aiSuggestionIgnore })
|
|
77
|
+
})
|
|
78
|
+
] })] })]
|
|
79
|
+
})] })
|
|
80
|
+
})
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
export { _ as t };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { EXTRACT_AI_AGENT_LOCAL_STORAGE_KEY as e } from "../esm/lib/constants.js";
|
|
2
|
+
import t from "../esm/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/messages.js";
|
|
3
|
+
import { useErrorMessaging as n } from "../esm/lib/components/metadata-instance-editor/subcomponents/autofill-overlay/useErrorMessaging.js";
|
|
4
|
+
import { LoadingIndicator as r, Text as i, TextButton as a } from "@box/blueprint-web";
|
|
5
|
+
import { useState as o } from "react";
|
|
6
|
+
import { useIntl as s } from "react-intl";
|
|
7
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
|
+
import u from "clsx";
|
|
9
|
+
import { Size5 as d, SurfaceStatusSurfaceError as f } from "@box/blueprint-web-assets/tokens/tokens";
|
|
10
|
+
import { AlertTriangle as p } from "@box/blueprint-web-assets/icons/Line";
|
|
11
|
+
import '../styles/autofill-overlay.css';var m = {
|
|
12
|
+
autofillOverlay: "_autofillOverlay_16p2j_1",
|
|
13
|
+
withError: "_withError_16p2j_12",
|
|
14
|
+
autofillOverlayTitle: "_autofillOverlayTitle_16p2j_16",
|
|
15
|
+
autofillOverlayDescription: "_autofillOverlayDescription_16p2j_21",
|
|
16
|
+
dismissButton: "_dismissButton_16p2j_25",
|
|
17
|
+
overlayIcon: "_overlayIcon_16p2j_29",
|
|
18
|
+
testContainerStyle: "_testContainerStyle_16p2j_35"
|
|
19
|
+
}, h = ({ errorCode: h, isFetchingSuggestions: g, isLongLoading: _ }) => {
|
|
20
|
+
let v = s(), [y, b] = o(!1), x = n(h), S = v.formatMessage(t.defaultLoadingMessage);
|
|
21
|
+
h && (S = x.title);
|
|
22
|
+
let C = localStorage.getItem(e);
|
|
23
|
+
_ && C === "standard" && (S = v.formatMessage(t.longLoadingTitle));
|
|
24
|
+
let w = _ && C === "standard" ? v.formatMessage(t.longLoadingDescription) : h && x.description;
|
|
25
|
+
return !g && !h || y ? null : /* @__PURE__ */ l("div", {
|
|
26
|
+
className: u(m.autofillOverlay, h && m.withError),
|
|
27
|
+
children: [
|
|
28
|
+
h ? /* @__PURE__ */ c(p, {
|
|
29
|
+
className: m.overlayIcon,
|
|
30
|
+
color: f,
|
|
31
|
+
height: d,
|
|
32
|
+
role: "presentation",
|
|
33
|
+
width: d
|
|
34
|
+
}) : /* @__PURE__ */ c(r, {
|
|
35
|
+
"aria-label": v.formatMessage(t.loadingAriaLabel),
|
|
36
|
+
"aria-live": "polite",
|
|
37
|
+
className: m.overlayIcon,
|
|
38
|
+
size: "large",
|
|
39
|
+
variant: "default"
|
|
40
|
+
}),
|
|
41
|
+
/* @__PURE__ */ c(i, {
|
|
42
|
+
as: "p",
|
|
43
|
+
className: m.autofillOverlayTitle,
|
|
44
|
+
variant: "subtitle",
|
|
45
|
+
children: S
|
|
46
|
+
}),
|
|
47
|
+
w && /* @__PURE__ */ c(i, {
|
|
48
|
+
as: "p",
|
|
49
|
+
className: m.autofillOverlayDescription,
|
|
50
|
+
color: "textOnLightSecondary",
|
|
51
|
+
variant: "bodyDefault",
|
|
52
|
+
children: w
|
|
53
|
+
}),
|
|
54
|
+
h && /* @__PURE__ */ c(a, {
|
|
55
|
+
className: m.dismissButton,
|
|
56
|
+
onClick: () => b(!0),
|
|
57
|
+
"data-target-id": "TextButton-dismissButton",
|
|
58
|
+
children: v.formatMessage(t.dismissButton)
|
|
59
|
+
})
|
|
60
|
+
]
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
export { h as t };
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import e from "../esm/lib/components/combobox-with-api-pagination/messages.js";
|
|
2
|
+
import { useAsyncList as t } from "../esm/lib/components/combobox-with-api-pagination/use-async-list.js";
|
|
3
|
+
import { useControllableState as n } from "../esm/lib/components/combobox-with-api-pagination/utils/use-controllable-state.js";
|
|
4
|
+
import { useTrackVisibility as r } from "../esm/lib/components/combobox-with-api-pagination/utils/use-intersection-observer.js";
|
|
5
|
+
import { Combobox as i, InlineNotice as a, LoadingIndicator as o, Text as s, useForkRef as c } from "@box/blueprint-web";
|
|
6
|
+
import { Loader as l, Search as u } from "@box/blueprint-web-assets/icons/Fill";
|
|
7
|
+
import { forwardRef as d, useCallback as f, useEffect as p, useMemo as m, useRef as h } from "react";
|
|
8
|
+
import { FormattedMessage as g, useIntl as _ } from "react-intl";
|
|
9
|
+
import { ComboboxItemValue as v } from "@ariakit/react";
|
|
10
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
11
|
+
import S from "clsx";
|
|
12
|
+
import { IconIconOnLightSecondary as C, Size1 as w, Size6 as T } from "@box/blueprint-web-assets/tokens/tokens";
|
|
13
|
+
import '../styles/combobox-with-api-pagination.css';var E = {
|
|
14
|
+
container: "_container_19k3s_2",
|
|
15
|
+
disabled: "_disabled_19k3s_8",
|
|
16
|
+
highlightOptionText: "_highlightOptionText_19k3s_12",
|
|
17
|
+
selected: "_selected_19k3s_24",
|
|
18
|
+
option: "_option_19k3s_35",
|
|
19
|
+
errorComboboxOption: "_errorComboboxOption_19k3s_39",
|
|
20
|
+
errorComboboxOptionText: "_errorComboboxOptionText_19k3s_44"
|
|
21
|
+
}, D = /* @__PURE__ */ d(({ onTryAgain: t }, n) => {
|
|
22
|
+
let { formatMessage: r } = _();
|
|
23
|
+
return /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(a, {
|
|
24
|
+
variant: "error",
|
|
25
|
+
variantIconAriaLabel: r(e.loadingResultsErrorIconLabel),
|
|
26
|
+
children: /* @__PURE__ */ b(g, { ...e.loadingResultsErrorMessage })
|
|
27
|
+
}), /* @__PURE__ */ b(i.Option, {
|
|
28
|
+
ref: n,
|
|
29
|
+
className: E.errorComboboxOption,
|
|
30
|
+
onClick: t,
|
|
31
|
+
children: /* @__PURE__ */ x(s, {
|
|
32
|
+
as: "span",
|
|
33
|
+
className: E.errorComboboxOptionText,
|
|
34
|
+
color: "textOnLightLink",
|
|
35
|
+
variant: "bodyDefaultBold",
|
|
36
|
+
children: [/* @__PURE__ */ b(g, { ...e.loadingResultsErrorAction }), /* @__PURE__ */ b(l, {
|
|
37
|
+
color: "currentColor",
|
|
38
|
+
height: "12px",
|
|
39
|
+
width: "12px"
|
|
40
|
+
})]
|
|
41
|
+
})
|
|
42
|
+
})] });
|
|
43
|
+
}), O = "__LOADING__", k = "__LOADING_ERROR__", A = "0px 0px 20px 0px", j = /* @__PURE__ */ b(u, {
|
|
44
|
+
color: C,
|
|
45
|
+
height: T,
|
|
46
|
+
role: "presentation",
|
|
47
|
+
style: {
|
|
48
|
+
padding: w,
|
|
49
|
+
boxSizing: "border-box"
|
|
50
|
+
},
|
|
51
|
+
width: T
|
|
52
|
+
}), M = /* @__PURE__ */ d(function(a, s) {
|
|
53
|
+
let { defaultFetcher: l, onInputValueChange: u, value: d, onValueChange: g, noResultMessage: y, defaultValue: x = [], loadingAriaLabel: C, multiselect: w = !1, disabled: T, className: M, displaySingleSelectionAsChip: N = !0, ...P } = a, { formatMessage: F } = _(), I = h(null), L = h(!0), R = t({ async load({ marker: e, searchInput: t, signal: n }) {
|
|
54
|
+
let r = await l({
|
|
55
|
+
signal: n,
|
|
56
|
+
marker: e,
|
|
57
|
+
searchInput: t
|
|
58
|
+
});
|
|
59
|
+
return {
|
|
60
|
+
items: r.options,
|
|
61
|
+
marker: r.marker
|
|
62
|
+
};
|
|
63
|
+
} }), z = h(!1), B = f(() => {
|
|
64
|
+
z.current ||= (R.reload(), !0);
|
|
65
|
+
}, []), [V, H] = n({
|
|
66
|
+
prop: d,
|
|
67
|
+
defaultProp: x,
|
|
68
|
+
onChange: g
|
|
69
|
+
}), U = !w && V.length === 1, W = (e) => {
|
|
70
|
+
e === void 0 ? (H([]), (!L.current || !N) && (R.search(""), L.current = !0)) : H(Array.isArray(e) ? e : [e]);
|
|
71
|
+
}, G = m(() => V.length === 0 ? w ? [] : void 0 : w ? V : V[0], [w, V]), K = m(() => V.filter((e) => !R.items.some((t) => t.value === e.value)), [V, R.items]), q = (t) => {
|
|
72
|
+
let { value: n, displayValue: r, ...a } = t;
|
|
73
|
+
if (n === O) return R.hasNextPage ? /* @__PURE__ */ b(i.Option, {
|
|
74
|
+
...a,
|
|
75
|
+
ref: Z,
|
|
76
|
+
disabled: !0,
|
|
77
|
+
value: n,
|
|
78
|
+
children: /* @__PURE__ */ b(o, {
|
|
79
|
+
"aria-label": F(e.loadingMoreAriaLabel),
|
|
80
|
+
style: { position: "unset" }
|
|
81
|
+
})
|
|
82
|
+
}) : null;
|
|
83
|
+
if (n === k && R.hasError && !R.isEmpty) return /* @__PURE__ */ b(D, { onTryAgain: () => {
|
|
84
|
+
R.loadMore(), I.current?.focus();
|
|
85
|
+
} });
|
|
86
|
+
if (K.some((e) => e.value === n)) return null;
|
|
87
|
+
let s = V.some((e) => e.value === n);
|
|
88
|
+
return /* @__PURE__ */ b(i.Option, {
|
|
89
|
+
...a,
|
|
90
|
+
className: E.option,
|
|
91
|
+
value: n,
|
|
92
|
+
children: /* @__PURE__ */ b(v, {
|
|
93
|
+
className: S(E.highlightOptionText, s && E.selected),
|
|
94
|
+
value: r || n
|
|
95
|
+
})
|
|
96
|
+
});
|
|
97
|
+
}, J = (e) => {
|
|
98
|
+
if (u?.(e), U && e === "") {
|
|
99
|
+
L.current = !1;
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
R.search(e);
|
|
103
|
+
}, Y = () => {
|
|
104
|
+
R.reload(), I.current?.focus();
|
|
105
|
+
}, X;
|
|
106
|
+
X = R.hasError && !R.isLoading ? /* @__PURE__ */ b(D, { onTryAgain: Y }) : R.isEmpty && !R.isLoading ? y || F(e.noResults) : void 0;
|
|
107
|
+
let [Z, { rootRef: Q, isVisible: $ }] = r({ rootMargin: A });
|
|
108
|
+
p(() => {
|
|
109
|
+
if (!($ && R.hasNextPage)) return;
|
|
110
|
+
let e = setTimeout(() => {
|
|
111
|
+
R.loadMore();
|
|
112
|
+
}, 100);
|
|
113
|
+
return () => {
|
|
114
|
+
clearTimeout(e);
|
|
115
|
+
};
|
|
116
|
+
}, [$]);
|
|
117
|
+
let ee = m(() => {
|
|
118
|
+
let e = R.hasNextPage ? {
|
|
119
|
+
displayValue: O,
|
|
120
|
+
value: O
|
|
121
|
+
} : null, t = !e && R.hasError && !R.isEmpty ? {
|
|
122
|
+
displayValue: k,
|
|
123
|
+
value: k
|
|
124
|
+
} : null;
|
|
125
|
+
return [
|
|
126
|
+
...R.items,
|
|
127
|
+
...K,
|
|
128
|
+
e,
|
|
129
|
+
t
|
|
130
|
+
].filter(Boolean);
|
|
131
|
+
}, [
|
|
132
|
+
R.hasNextPage,
|
|
133
|
+
R.hasError,
|
|
134
|
+
R.isEmpty,
|
|
135
|
+
R.items,
|
|
136
|
+
K
|
|
137
|
+
]);
|
|
138
|
+
return /* @__PURE__ */ b(i, {
|
|
139
|
+
as: "input",
|
|
140
|
+
...P,
|
|
141
|
+
ref: c(I, s),
|
|
142
|
+
className: S({ [E.disabled]: U }, M),
|
|
143
|
+
clearButtonAriaLabel: F(e.clearButtonAriaLabel),
|
|
144
|
+
disabled: T || U,
|
|
145
|
+
displaySingleSelectionAsChip: N,
|
|
146
|
+
displayValue: (e) => e.displayValue || e.value,
|
|
147
|
+
endComboboxIcon: j,
|
|
148
|
+
focusLoop: !1,
|
|
149
|
+
getPopoverRef: Q,
|
|
150
|
+
loading: R.isReloading,
|
|
151
|
+
loadingAriaLabel: C || F(e.loadingAriaLabel),
|
|
152
|
+
multiselect: w,
|
|
153
|
+
noResultMessage: X,
|
|
154
|
+
onFocus: B,
|
|
155
|
+
onInputValueChange: J,
|
|
156
|
+
onValueChange: W,
|
|
157
|
+
options: ee,
|
|
158
|
+
renderOption: q,
|
|
159
|
+
value: G
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
export { M as t };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import e from "../esm/lib/components/metadata-instance-editor/subcomponents/custom-instance-new-field/messages.js";
|
|
2
|
+
import { Button as t, Card as n, TextInput as r } from "@box/blueprint-web";
|
|
3
|
+
import { useState as i } from "react";
|
|
4
|
+
import { useIntl as a } from "react-intl";
|
|
5
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
|
+
import '../styles/custom-instance-new-field.css';var c = {
|
|
7
|
+
customInstanceNewFieldCard: "_customInstanceNewFieldCard_fcftk_1",
|
|
8
|
+
customInstanceNewFieldFooter: "_customInstanceNewFieldFooter_fcftk_6",
|
|
9
|
+
inputWrapper: "_inputWrapper_fcftk_13"
|
|
10
|
+
}, l = (l) => {
|
|
11
|
+
let { onAdd: u, onCancel: d, formKeys: f = [] } = l, p = a(), [m, h] = i(""), [g, _] = i(""), [v, y] = i(""), b = f.length !== 0, x = (e) => {
|
|
12
|
+
h(e), v && y("");
|
|
13
|
+
};
|
|
14
|
+
return /* @__PURE__ */ s(n, {
|
|
15
|
+
"aria-label": p.formatMessage(e.addAttributeGroupAriaLabel),
|
|
16
|
+
className: c.customInstanceNewFieldCard,
|
|
17
|
+
"data-testid": "customInstanceNewField",
|
|
18
|
+
role: "group",
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ o("div", {
|
|
21
|
+
className: c.inputWrapper,
|
|
22
|
+
children: /* @__PURE__ */ o(r, {
|
|
23
|
+
autoFocus: !0,
|
|
24
|
+
error: v,
|
|
25
|
+
label: p.formatMessage(e.customKeyLabel),
|
|
26
|
+
onChange: (e) => x(e.target.value),
|
|
27
|
+
placeholder: p.formatMessage(e.customKeyPlaceholder),
|
|
28
|
+
required: !0,
|
|
29
|
+
value: m
|
|
30
|
+
})
|
|
31
|
+
}),
|
|
32
|
+
/* @__PURE__ */ o("div", {
|
|
33
|
+
className: c.inputWrapper,
|
|
34
|
+
children: /* @__PURE__ */ o(r, {
|
|
35
|
+
label: p.formatMessage(e.valueLabel),
|
|
36
|
+
onChange: (e) => _(e.target.value),
|
|
37
|
+
placeholder: p.formatMessage(e.valuePlaceholder),
|
|
38
|
+
value: g
|
|
39
|
+
})
|
|
40
|
+
}),
|
|
41
|
+
/* @__PURE__ */ s("div", {
|
|
42
|
+
className: c.customInstanceNewFieldFooter,
|
|
43
|
+
children: [b && /* @__PURE__ */ o(t, {
|
|
44
|
+
onClick: d,
|
|
45
|
+
variant: "secondary",
|
|
46
|
+
"data-target-id": "Button-cancelCTA",
|
|
47
|
+
children: p.formatMessage(e.cancelCTA)
|
|
48
|
+
}), /* @__PURE__ */ o(t, {
|
|
49
|
+
onClick: () => {
|
|
50
|
+
m ? m.startsWith("$") ? y(p.formatMessage(e.customErrorInternalKey)) : f.includes(m) ? y(p.formatMessage(e.customErrorDuplicateKey)) : u(m, g) : y(p.formatMessage(e.keyFieldRequiredError));
|
|
51
|
+
},
|
|
52
|
+
variant: "primary",
|
|
53
|
+
"data-target-id": "Button-addNewFieldCTA",
|
|
54
|
+
children: p.formatMessage(e.addNewFieldCTA)
|
|
55
|
+
})]
|
|
56
|
+
})
|
|
57
|
+
]
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
export { l as t };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { t as e } from "./custom-instance-new-field.js";
|
|
2
|
+
import t from "../esm/lib/components/metadata-instance-editor/subcomponents/custom-instance/messages.js";
|
|
3
|
+
import { IconButton as n, TextButton as r, TextInput as i } from "@box/blueprint-web";
|
|
4
|
+
import { useEffect as a, useRef as o, useState as s } from "react";
|
|
5
|
+
import { useIntl as c } from "react-intl";
|
|
6
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
7
|
+
import { Field as d, FieldArray as f, useFormikContext as p } from "formik";
|
|
8
|
+
import { Trash as m } from "@box/blueprint-web-assets/icons/Line";
|
|
9
|
+
import '../styles/custom-instance.css';var h = {
|
|
10
|
+
customInstance: "_customInstance_xq8r7_1",
|
|
11
|
+
customInstanceField: "_customInstanceField_xq8r7_7",
|
|
12
|
+
customInstanceFieldInput: "_customInstanceFieldInput_xq8r7_12",
|
|
13
|
+
customInstanceFieldIcon: "_customInstanceFieldIcon_xq8r7_16"
|
|
14
|
+
}, g = (g) => {
|
|
15
|
+
let { isLoading: _ } = g, { values: v } = p(), y = c(), [b, x] = s(!v.metadata.fields.length), [S, C] = s(0), w = () => {
|
|
16
|
+
C(v.metadata.fields.length);
|
|
17
|
+
}, T = (e) => {
|
|
18
|
+
C(e === 0 ? 0 : e - 1);
|
|
19
|
+
}, E = o(null);
|
|
20
|
+
return a(() => {
|
|
21
|
+
v.metadata.fields.length > 0 ? E.current.focus() : x(!0);
|
|
22
|
+
}, [S, v.metadata.fields.length]), /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(f, {
|
|
23
|
+
name: "metadata.fields",
|
|
24
|
+
children: ({ remove: a, push: o }) => /* @__PURE__ */ u("div", {
|
|
25
|
+
className: h.customInstance,
|
|
26
|
+
children: [
|
|
27
|
+
v?.metadata.fields.map((e, r) => /* @__PURE__ */ u("div", {
|
|
28
|
+
className: h.customInstanceField,
|
|
29
|
+
children: [/* @__PURE__ */ l("div", {
|
|
30
|
+
className: h.customInstanceFieldInput,
|
|
31
|
+
children: /* @__PURE__ */ l(d, {
|
|
32
|
+
name: `metadata.fields[${r}].value`,
|
|
33
|
+
children: ({ field: n, meta: a }) => /* @__PURE__ */ l(i, {
|
|
34
|
+
...n,
|
|
35
|
+
ref: r === S ? E : null,
|
|
36
|
+
disabled: _,
|
|
37
|
+
error: a.error,
|
|
38
|
+
label: e.key,
|
|
39
|
+
placeholder: y.formatMessage(t.setValuePlaceholder)
|
|
40
|
+
})
|
|
41
|
+
})
|
|
42
|
+
}), /* @__PURE__ */ l(n, {
|
|
43
|
+
"aria-label": y.formatMessage(t.removeAttribute, { fieldName: e.key }),
|
|
44
|
+
className: h.customInstanceFieldIcon,
|
|
45
|
+
disabled: _,
|
|
46
|
+
icon: m,
|
|
47
|
+
onClick: () => {
|
|
48
|
+
a(r), T(r);
|
|
49
|
+
},
|
|
50
|
+
size: "x-small",
|
|
51
|
+
"data-target-id": "IconButton-removeAttribute"
|
|
52
|
+
})]
|
|
53
|
+
}, e.key)),
|
|
54
|
+
b && /* @__PURE__ */ l(e, {
|
|
55
|
+
formKeys: v.metadata.fields.map((e) => e.key),
|
|
56
|
+
onAdd: (e, t) => {
|
|
57
|
+
o({
|
|
58
|
+
key: e,
|
|
59
|
+
value: t
|
|
60
|
+
}), w(), x(!1);
|
|
61
|
+
},
|
|
62
|
+
onCancel: () => x(!1)
|
|
63
|
+
}),
|
|
64
|
+
!b && /* @__PURE__ */ l(r, {
|
|
65
|
+
disabled: _,
|
|
66
|
+
onClick: () => x(!0),
|
|
67
|
+
"data-target-id": "TextButton-addAttribute",
|
|
68
|
+
children: y.formatMessage(t.addAttribute)
|
|
69
|
+
})
|
|
70
|
+
]
|
|
71
|
+
})
|
|
72
|
+
}) });
|
|
73
|
+
};
|
|
74
|
+
export { g as t };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import e from "../esm/lib/components/metadata-instance-editor/subcomponents/delete-confirmation-modal/messages.js";
|
|
2
|
+
import { Checkbox as t, Modal as n, Text as r, TextInput as i } from "@box/blueprint-web";
|
|
3
|
+
import { useState as a } from "react";
|
|
4
|
+
import { FormattedMessage as o, useIntl as s } from "react-intl";
|
|
5
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
|
+
import '../styles/delete-confirmation-modal.css';var u = { modalBody: "_modalBody_1wc7x_1" }, d = ({ onConfirm: d, templateName: f, onDismiss: p, open: m, isCheckboxEnabled: h }) => {
|
|
7
|
+
let g = s(), [_, v] = a(""), [y, b] = a(!1), x = (e) => {
|
|
8
|
+
e || (p(), v(""), b(!1));
|
|
9
|
+
}, S = f || g.formatMessage(e.deleteConfirmationModalCustomMetadata), C = _ === S, w = () => {
|
|
10
|
+
b(!y);
|
|
11
|
+
}, T = () => {
|
|
12
|
+
d(), x(!1);
|
|
13
|
+
};
|
|
14
|
+
return /* @__PURE__ */ c(n, {
|
|
15
|
+
onOpenChange: x,
|
|
16
|
+
open: m,
|
|
17
|
+
children: /* @__PURE__ */ l(n.Content, {
|
|
18
|
+
onEscapeKeyDown: (e) => e.stopPropagation(),
|
|
19
|
+
size: "small",
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ c(n.Header, {
|
|
22
|
+
"aria-label": g.formatMessage(e.deleteConfirmationModalHeaderAriaLabel),
|
|
23
|
+
children: /* @__PURE__ */ c(o, {
|
|
24
|
+
...e.deleteConfirmationModalHeader,
|
|
25
|
+
values: { templateName: S }
|
|
26
|
+
})
|
|
27
|
+
}),
|
|
28
|
+
/* @__PURE__ */ c(n.ScrollableContainer, { children: /* @__PURE__ */ l(n.Body, {
|
|
29
|
+
className: u.modalBody,
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ c(r, {
|
|
32
|
+
as: "p",
|
|
33
|
+
children: h ? /* @__PURE__ */ c(o, {
|
|
34
|
+
...e.deleteConfirmationModalBodyFirstParagraphCheckboxVersion,
|
|
35
|
+
values: { templateName: S }
|
|
36
|
+
}) : /* @__PURE__ */ c(o, {
|
|
37
|
+
...e.deleteConfirmationModalBodyFirstParagraph,
|
|
38
|
+
values: { templateName: S }
|
|
39
|
+
})
|
|
40
|
+
}),
|
|
41
|
+
!h && /* @__PURE__ */ c(r, {
|
|
42
|
+
as: "p",
|
|
43
|
+
children: /* @__PURE__ */ c(o, { ...e.deleteConfirmationModalBodySecondParagraph })
|
|
44
|
+
}),
|
|
45
|
+
h ? /* @__PURE__ */ c(t.Item, {
|
|
46
|
+
checked: y,
|
|
47
|
+
"data-resin-target": "checkbox",
|
|
48
|
+
label: g.formatMessage(e.deleteConfirmationModalBodyCheckboxLabel),
|
|
49
|
+
onCheckedChange: w,
|
|
50
|
+
value: "overageCheckbox"
|
|
51
|
+
}) : /* @__PURE__ */ c(i, {
|
|
52
|
+
label: g.formatMessage(e.deleteConfirmationModalBodyInputFieldLabel),
|
|
53
|
+
onChange: (e) => v(e.target.value),
|
|
54
|
+
placeholder: S,
|
|
55
|
+
required: !0,
|
|
56
|
+
value: _
|
|
57
|
+
})
|
|
58
|
+
]
|
|
59
|
+
}) }),
|
|
60
|
+
/* @__PURE__ */ l(n.Footer, { children: [/* @__PURE__ */ c(n.Footer.SecondaryButton, {
|
|
61
|
+
onClick: () => x(!1),
|
|
62
|
+
size: "large",
|
|
63
|
+
"data-target-id": "Modal.Footer.SecondaryButton-deleteConfirmationModalCancelButton",
|
|
64
|
+
children: g.formatMessage(e.deleteConfirmationModalCancelButton)
|
|
65
|
+
}), /* @__PURE__ */ c(n.Footer.PrimaryButton, {
|
|
66
|
+
disabled: h ? !y : !C,
|
|
67
|
+
onClick: T,
|
|
68
|
+
size: "large",
|
|
69
|
+
children: g.formatMessage(h ? e.deleteConfirmationModalConfirmButtonCheckboxVersion : e.deleteConfirmationModalConfirmButton)
|
|
70
|
+
})] }),
|
|
71
|
+
/* @__PURE__ */ c(n.Close, { "aria-label": g.formatMessage(e.deleteConfirmationModalDismissButton) })
|
|
72
|
+
]
|
|
73
|
+
})
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
export { d as t };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import '../styles/field-action-bar.css';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
export {
|
|
8
|
-
p as s
|
|
1
|
+
import '../styles/field-action-bar.css';var e = {
|
|
2
|
+
wrapperGradient: "_wrapperGradient_9h730_1",
|
|
3
|
+
wrapper: "_wrapper_9h730_1",
|
|
4
|
+
buttons: "_buttons_9h730_25",
|
|
5
|
+
loader: "_loader_9h730_30"
|
|
9
6
|
};
|
|
7
|
+
export { e as t };
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import '../styles/filter-dropdown-menu.css';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import '../styles/filter-dropdown-menu.css';var e = {
|
|
2
|
+
content: "_content_pp0ox_2",
|
|
3
|
+
scrollableContainer: "_scrollableContainer_pp0ox_21",
|
|
4
|
+
item: "_item_pp0ox_26",
|
|
5
|
+
option: "_option_pp0ox_36",
|
|
6
|
+
search: "_search_pp0ox_57",
|
|
7
|
+
searchIcon: "_searchIcon_pp0ox_62",
|
|
8
|
+
global: "_global_pp0ox_71",
|
|
9
|
+
clearSearchIcon: "_clearSearchIcon_pp0ox_76",
|
|
10
|
+
searchInput: "_searchInput_pp0ox_84",
|
|
11
|
+
firefoxDefaultOpacityFix: "_firefoxDefaultOpacityFix_pp0ox_116",
|
|
12
|
+
divider: "_divider_pp0ox_134",
|
|
13
|
+
searchDivider: "_searchDivider_pp0ox_138"
|
|
14
14
|
};
|
|
15
|
+
export { e as t };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { getTemplateDisplayName as e, getVisibleTemplates as t } from "../esm/lib/utils/utils.js";
|
|
2
|
+
import n from "../esm/lib/components/filter-instances-dropdown/messages.js";
|
|
3
|
+
import { Divider as r, ScrollableContainer as i, Text as a, TriggerButton as o } from "@box/blueprint-web";
|
|
4
|
+
import { Checkmark as s } from "@box/blueprint-web-assets/icons/Fill";
|
|
5
|
+
import { Space1 as c } from "@box/blueprint-web-assets/tokens/px-tokens";
|
|
6
|
+
import { useEffect as l } from "react";
|
|
7
|
+
import { useIntl as u } from "react-intl";
|
|
8
|
+
import { Select as d, SelectItem as f, SelectItemCheck as p, SelectPopover as m, SelectProvider as h } from "@ariakit/react";
|
|
9
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
10
|
+
import v from "clsx";
|
|
11
|
+
import '../styles/filter-instances-dropdown.css';var y = {
|
|
12
|
+
details: "_details_106jz_2",
|
|
13
|
+
triggerContainer: "_triggerContainer_106jz_6",
|
|
14
|
+
triggerButton: "_triggerButton_106jz_11",
|
|
15
|
+
popover: "_popover_106jz_17",
|
|
16
|
+
divider: "_divider_106jz_34",
|
|
17
|
+
scrollableContainer: "_scrollableContainer_106jz_37",
|
|
18
|
+
item: "_item_106jz_41",
|
|
19
|
+
indicator: "_indicator_106jz_68",
|
|
20
|
+
indicatorIcon: "_indicatorIcon_106jz_77",
|
|
21
|
+
testContainer: "_testContainer_106jz_81"
|
|
22
|
+
}, b = parseInt(c, 10);
|
|
23
|
+
function x({ appliedTemplates: c, selectedTemplates: x, setSelectedTemplates: S }) {
|
|
24
|
+
let C = u(), w = C.formatMessage(n.customMetadataName), T = t(c), E = x.length, D = T.length, O = E === 0 ? C.formatMessage(n.allTemplatesTriggerButtonText) : C.formatMessage(n.selectedTemplatesTriggerButtonText, {
|
|
25
|
+
selectedTemplatesNumber: E,
|
|
26
|
+
visibleTemplatesNumber: D
|
|
27
|
+
});
|
|
28
|
+
return l(() => {
|
|
29
|
+
E === D && S([]);
|
|
30
|
+
}, [E, D]), /* @__PURE__ */ _(h, {
|
|
31
|
+
setValue: S,
|
|
32
|
+
value: x,
|
|
33
|
+
children: [/* @__PURE__ */ _("div", {
|
|
34
|
+
className: y.triggerContainer,
|
|
35
|
+
children: [/* @__PURE__ */ g(d, { render: /* @__PURE__ */ g(o, {
|
|
36
|
+
caretDirection: "down",
|
|
37
|
+
className: y.triggerButton,
|
|
38
|
+
label: O,
|
|
39
|
+
size: "small",
|
|
40
|
+
variant: "tertiary",
|
|
41
|
+
"data-target-id": "TriggerButton-allTemplatesTriggerButtonText|selectedTemplatesTriggerButtonText"
|
|
42
|
+
}) }), T.length > 0 && /* @__PURE__ */ g(a, {
|
|
43
|
+
as: "p",
|
|
44
|
+
className: y.details,
|
|
45
|
+
color: "textOnLightSecondary",
|
|
46
|
+
"data-testid": "detailsList",
|
|
47
|
+
variant: "caption",
|
|
48
|
+
children: T.filter((e) => x.some((t) => t === e.id)).map((t) => e(t, w)).join(", ")
|
|
49
|
+
})]
|
|
50
|
+
}), /* @__PURE__ */ g(m, {
|
|
51
|
+
className: y.popover,
|
|
52
|
+
gutter: b,
|
|
53
|
+
children: /* @__PURE__ */ _(i, {
|
|
54
|
+
className: y.scrollableContainer,
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ _(f, {
|
|
57
|
+
autoFocus: E === 0,
|
|
58
|
+
className: y.item,
|
|
59
|
+
hideOnClick: !0,
|
|
60
|
+
onClick: () => {
|
|
61
|
+
S([]);
|
|
62
|
+
},
|
|
63
|
+
children: [E === 0 && /* @__PURE__ */ g(s, { className: v(y.indicator, y.indicatorIcon) }), C.formatMessage(n.allTemplatesTriggerButtonText)]
|
|
64
|
+
}),
|
|
65
|
+
/* @__PURE__ */ g(r, { className: y.divider }),
|
|
66
|
+
T.map((t) => /* @__PURE__ */ _(f, {
|
|
67
|
+
className: y.item,
|
|
68
|
+
hideOnClick: !0,
|
|
69
|
+
value: t.id,
|
|
70
|
+
children: [/* @__PURE__ */ g(p, {
|
|
71
|
+
className: y.indicator,
|
|
72
|
+
style: {
|
|
73
|
+
width: "none",
|
|
74
|
+
height: "none"
|
|
75
|
+
},
|
|
76
|
+
children: /* @__PURE__ */ g(s, { className: y.indicatorIcon })
|
|
77
|
+
}), e(t, w)]
|
|
78
|
+
}, t.id))
|
|
79
|
+
]
|
|
80
|
+
})
|
|
81
|
+
})]
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
export { x as t };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Text as e, Tooltip as t, useIsEllipsized as n } from "@box/blueprint-web";
|
|
2
|
+
import { useRef as r } from "react";
|
|
3
|
+
import { Focusable as i } from "@ariakit/react";
|
|
4
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
5
|
+
import o from "clsx";
|
|
6
|
+
import '../styles/interactive-header-text.css';var s = { header: "_header_qqeyd_1" }, c = ({ className: c, title: l }) => {
|
|
7
|
+
let u = r(null), d = n(u), f = /* @__PURE__ */ a(i, { render: /* @__PURE__ */ a(e, {
|
|
8
|
+
ref: u,
|
|
9
|
+
as: "h4",
|
|
10
|
+
className: o(s.header, c),
|
|
11
|
+
variant: "titleMedium",
|
|
12
|
+
children: l
|
|
13
|
+
}) });
|
|
14
|
+
return d ? /* @__PURE__ */ a(t, {
|
|
15
|
+
content: l,
|
|
16
|
+
children: f
|
|
17
|
+
}) : f;
|
|
18
|
+
};
|
|
19
|
+
export { c as t };
|