@box/metadata-editor 0.53.2 → 0.55.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/esm/lib/components/combobox-with-api-pagination/combobox-with-api-pagination.js +121 -117
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/metadata-instance-form.js +52 -50
- package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-footer/metadata-instance-form-footer.js +21 -20
- package/package.json +2 -2
- package/types/lib/components/combobox-with-api-pagination/types.d.ts +4 -4
- package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form/types.d.ts +1 -1
- package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-footer/metadata-instance-form-footer.d.ts +1 -1
- package/types/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-footer/types.d.ts +1 -0
@@ -1,46 +1,46 @@
|
|
1
1
|
import "../../../../styles/combobox-with-api-pagination.css";
|
2
|
-
import { ComboboxItemValue as
|
3
|
-
import { Combobox as p, LoadingIndicator as
|
4
|
-
import { Search as
|
5
|
-
import { IconIconOnLightSecondary as
|
6
|
-
import { useRef as
|
7
|
-
import { useIntl as T, FormattedMessage as
|
2
|
+
import { ComboboxItemValue as J } from "@ariakit/react";
|
3
|
+
import { Combobox as p, LoadingIndicator as K, InlineNotice as Q, Text as X } from "@box/blueprint-web";
|
4
|
+
import { Search as Y, Loader as Z } from "@box/blueprint-web-assets/icons/Fill";
|
5
|
+
import { IconIconOnLightSecondary as $, Size6 as E, Size1 as oo } from "@box/blueprint-web-assets/tokens/tokens";
|
6
|
+
import { useRef as y, useCallback as eo, useMemo as _, useEffect as to, forwardRef as ro } from "react";
|
7
|
+
import { useIntl as T, FormattedMessage as v } from "react-intl";
|
8
8
|
import i from "./messages.js";
|
9
|
-
import { useAsyncList as
|
10
|
-
import { useControllableState as
|
11
|
-
import { useTrackVisibility as
|
12
|
-
import { jsx as
|
13
|
-
const
|
14
|
-
container:
|
15
|
-
highlightOptionText:
|
16
|
-
option:
|
17
|
-
errorComboboxOption:
|
18
|
-
errorComboboxOptionText:
|
19
|
-
}, M = /* @__PURE__ */
|
20
|
-
onTryAgain:
|
21
|
-
},
|
9
|
+
import { useAsyncList as no } from "./use-async-list.js";
|
10
|
+
import { useControllableState as io } from "./utils/use-controllable-state.js";
|
11
|
+
import { useTrackVisibility as ao } from "./utils/use-intersection-observer.js";
|
12
|
+
import { jsx as r, jsxs as I, Fragment as so } from "react/jsx-runtime";
|
13
|
+
const lo = "_container_16dlc_1", co = "_highlightOptionText_16dlc_7", uo = "_option_16dlc_20", po = "_errorComboboxOption_16dlc_24", mo = "_errorComboboxOptionText_16dlc_29", m = {
|
14
|
+
container: lo,
|
15
|
+
highlightOptionText: co,
|
16
|
+
option: uo,
|
17
|
+
errorComboboxOption: po,
|
18
|
+
errorComboboxOptionText: mo
|
19
|
+
}, M = /* @__PURE__ */ ro(({
|
20
|
+
onTryAgain: h
|
21
|
+
}, f) => {
|
22
22
|
const {
|
23
23
|
formatMessage: s
|
24
24
|
} = T();
|
25
|
-
return /* @__PURE__ */ I(
|
26
|
-
children: [/* @__PURE__ */
|
25
|
+
return /* @__PURE__ */ I(so, {
|
26
|
+
children: [/* @__PURE__ */ r(Q, {
|
27
27
|
variant: "error",
|
28
28
|
variantIconAriaLabel: s(i.loadingResultsErrorIconLabel),
|
29
|
-
children: /* @__PURE__ */
|
29
|
+
children: /* @__PURE__ */ r(v, {
|
30
30
|
...i.loadingResultsErrorMessage
|
31
31
|
})
|
32
|
-
}), /* @__PURE__ */
|
33
|
-
ref:
|
34
|
-
className:
|
35
|
-
onClick:
|
36
|
-
children: /* @__PURE__ */ I(
|
32
|
+
}), /* @__PURE__ */ r(p.Option, {
|
33
|
+
ref: f,
|
34
|
+
className: m.errorComboboxOption,
|
35
|
+
onClick: h,
|
36
|
+
children: /* @__PURE__ */ I(X, {
|
37
37
|
as: "span",
|
38
|
-
className:
|
38
|
+
className: m.errorComboboxOptionText,
|
39
39
|
color: "textOnLightLink",
|
40
40
|
variant: "bodyDefaultBold",
|
41
|
-
children: [/* @__PURE__ */
|
41
|
+
children: [/* @__PURE__ */ r(v, {
|
42
42
|
...i.loadingResultsErrorAction
|
43
|
-
}), /* @__PURE__ */
|
43
|
+
}), /* @__PURE__ */ r(Z, {
|
44
44
|
color: "currentColor",
|
45
45
|
height: "12px",
|
46
46
|
width: "12px"
|
@@ -48,144 +48,148 @@ const io = "_container_16dlc_1", ao = "_highlightOptionText_16dlc_7", so = "_opt
|
|
48
48
|
})
|
49
49
|
})]
|
50
50
|
});
|
51
|
-
}),
|
52
|
-
color:
|
53
|
-
height:
|
51
|
+
}), R = "__LOADING__", L = "__LOADING_ERROR__", ho = "0px 0px 20px 0px", fo = /* @__PURE__ */ r(Y, {
|
52
|
+
color: $,
|
53
|
+
height: E,
|
54
54
|
role: "presentation",
|
55
55
|
style: {
|
56
|
-
padding:
|
56
|
+
padding: oo,
|
57
57
|
boxSizing: "border-box"
|
58
58
|
},
|
59
|
-
width:
|
60
|
-
}),
|
59
|
+
width: E
|
60
|
+
}), Io = (h) => {
|
61
61
|
const {
|
62
|
-
defaultFetcher:
|
62
|
+
defaultFetcher: f,
|
63
63
|
onInputValueChange: s,
|
64
|
-
value:
|
65
|
-
onValueChange:
|
66
|
-
noResultMessage:
|
67
|
-
defaultValue: D,
|
64
|
+
value: V,
|
65
|
+
onValueChange: N,
|
66
|
+
noResultMessage: S,
|
67
|
+
defaultValue: D = [],
|
68
68
|
loadingAriaLabel: P,
|
69
|
-
multiselect:
|
69
|
+
multiselect: c = !1,
|
70
70
|
...k
|
71
|
-
} =
|
72
|
-
formatMessage:
|
73
|
-
} = T(), g =
|
71
|
+
} = h, {
|
72
|
+
formatMessage: u
|
73
|
+
} = T(), g = y(null), o = no({
|
74
74
|
async load({
|
75
75
|
marker: e,
|
76
|
-
searchInput:
|
77
|
-
signal:
|
76
|
+
searchInput: t,
|
77
|
+
signal: O
|
78
78
|
}) {
|
79
|
-
const
|
80
|
-
signal:
|
79
|
+
const l = await f({
|
80
|
+
signal: O,
|
81
81
|
marker: e,
|
82
|
-
searchInput:
|
82
|
+
searchInput: t
|
83
83
|
});
|
84
84
|
return {
|
85
|
-
items:
|
86
|
-
marker:
|
85
|
+
items: l.options,
|
86
|
+
marker: l.marker
|
87
87
|
};
|
88
88
|
}
|
89
|
-
}),
|
90
|
-
|
91
|
-
}, []), [n,
|
92
|
-
prop:
|
89
|
+
}), C = y(!1), F = eo(() => {
|
90
|
+
C.current || (o.reload(), C.current = !0);
|
91
|
+
}, []), [n, b] = io({
|
92
|
+
prop: V,
|
93
93
|
defaultProp: D,
|
94
|
-
onChange:
|
95
|
-
}),
|
94
|
+
onChange: N
|
95
|
+
}), w = (e) => {
|
96
|
+
e === void 0 ? b([]) : Array.isArray(e) ? b(e) : b([e]);
|
97
|
+
}, B = _(() => n.length === 0 ? c ? [] : void 0 : c ? n : n[0], [c, n]), x = _(() => n.filter((e) => !o.items.some((t) => t.value === e.value)), [n, o.items]), z = (e) => {
|
96
98
|
const {
|
97
|
-
value:
|
98
|
-
|
99
|
+
value: t,
|
100
|
+
displayValue: O,
|
101
|
+
...l
|
99
102
|
} = e;
|
100
|
-
if (
|
101
|
-
return o.hasNextPage ? /* @__PURE__ */
|
102
|
-
...
|
103
|
-
ref:
|
103
|
+
if (t === R)
|
104
|
+
return o.hasNextPage ? /* @__PURE__ */ r(p.Option, {
|
105
|
+
...l,
|
106
|
+
ref: j,
|
104
107
|
disabled: !0,
|
105
|
-
value:
|
106
|
-
children: /* @__PURE__ */
|
107
|
-
"aria-label":
|
108
|
+
value: t,
|
109
|
+
children: /* @__PURE__ */ r(K, {
|
110
|
+
"aria-label": u(i.loadingMoreAriaLabel),
|
108
111
|
style: {
|
109
112
|
position: "unset"
|
110
113
|
}
|
111
114
|
})
|
112
115
|
}) : null;
|
113
|
-
if (
|
114
|
-
return /* @__PURE__ */
|
116
|
+
if (t === L && o.hasError && !o.isEmpty)
|
117
|
+
return /* @__PURE__ */ r(M, {
|
115
118
|
onTryAgain: () => {
|
116
119
|
var a;
|
117
120
|
o.loadMore(), (a = g.current) == null || a.focus();
|
118
121
|
}
|
119
122
|
});
|
120
|
-
if (
|
123
|
+
if (x.some((a) => a.value === t))
|
121
124
|
return null;
|
122
|
-
const
|
123
|
-
return /* @__PURE__ */
|
124
|
-
...
|
125
|
-
className:
|
126
|
-
disabled:
|
127
|
-
value:
|
128
|
-
children: /* @__PURE__ */
|
129
|
-
className:
|
130
|
-
value:
|
125
|
+
const H = () => n.some((a) => a.value === t);
|
126
|
+
return /* @__PURE__ */ r(p.Option, {
|
127
|
+
...l,
|
128
|
+
className: m.option,
|
129
|
+
disabled: H(),
|
130
|
+
value: t,
|
131
|
+
children: /* @__PURE__ */ r(J, {
|
132
|
+
className: m.highlightOptionText,
|
133
|
+
value: O || t
|
131
134
|
})
|
132
135
|
});
|
133
|
-
},
|
134
|
-
s == null || s(e), o.search(e)
|
135
|
-
},
|
136
|
+
}, G = (e) => {
|
137
|
+
s == null || s(e), o.search(e);
|
138
|
+
}, W = () => {
|
136
139
|
var e;
|
137
140
|
o.reload(), (e = g.current) == null || e.focus();
|
138
141
|
};
|
139
|
-
let
|
140
|
-
o.hasError && !o.isLoading ?
|
141
|
-
onTryAgain:
|
142
|
-
}) : o.isEmpty && !o.isLoading ?
|
143
|
-
const [
|
144
|
-
rootRef:
|
145
|
-
isVisible:
|
146
|
-
}] =
|
147
|
-
rootMargin:
|
142
|
+
let d;
|
143
|
+
o.hasError && !o.isLoading ? d = /* @__PURE__ */ r(M, {
|
144
|
+
onTryAgain: W
|
145
|
+
}) : o.isEmpty && !o.isLoading ? d = S || u(i.noResults) : d = void 0;
|
146
|
+
const [j, {
|
147
|
+
rootRef: U,
|
148
|
+
isVisible: A
|
149
|
+
}] = ao({
|
150
|
+
rootMargin: ho
|
148
151
|
});
|
149
|
-
|
150
|
-
if (!(
|
152
|
+
to(() => {
|
153
|
+
if (!(A && o.hasNextPage))
|
151
154
|
return;
|
152
|
-
const
|
155
|
+
const t = setTimeout(() => {
|
153
156
|
o.loadMore();
|
154
157
|
}, 100);
|
155
158
|
return () => {
|
156
|
-
clearTimeout(
|
159
|
+
clearTimeout(t);
|
157
160
|
};
|
158
|
-
}, [
|
159
|
-
const
|
161
|
+
}, [A]);
|
162
|
+
const q = _(() => {
|
160
163
|
const e = o.hasNextPage ? {
|
161
|
-
|
162
|
-
value:
|
163
|
-
} : null,
|
164
|
-
|
165
|
-
value:
|
164
|
+
displayValue: R,
|
165
|
+
value: R
|
166
|
+
} : null, t = !e && o.hasError && !o.isEmpty ? {
|
167
|
+
displayValue: L,
|
168
|
+
value: L
|
166
169
|
} : null;
|
167
|
-
return [...o.items, ...
|
168
|
-
}, [o.hasNextPage, o.hasError, o.isEmpty, o.items,
|
169
|
-
return /* @__PURE__ */
|
170
|
+
return [...o.items, ...x, e, t].filter(Boolean);
|
171
|
+
}, [o.hasNextPage, o.hasError, o.isEmpty, o.items, x]);
|
172
|
+
return /* @__PURE__ */ r(p, {
|
170
173
|
as: "input",
|
171
174
|
...k,
|
172
175
|
ref: g,
|
173
|
-
clearButtonAriaLabel:
|
174
|
-
|
176
|
+
clearButtonAriaLabel: u(i.clearButtonAriaLabel),
|
177
|
+
displayValue: (e) => e.displayValue || e.value,
|
178
|
+
endComboboxIcon: fo,
|
175
179
|
focusLoop: !1,
|
176
|
-
getPopoverRef:
|
180
|
+
getPopoverRef: U,
|
177
181
|
loading: o.isReloading,
|
178
|
-
loadingAriaLabel: P ||
|
179
|
-
multiselect:
|
180
|
-
noResultMessage:
|
182
|
+
loadingAriaLabel: P || u(i.loadingAriaLabel),
|
183
|
+
multiselect: c,
|
184
|
+
noResultMessage: d,
|
181
185
|
onFocus: F,
|
182
|
-
onInputValueChange:
|
183
|
-
onValueChange:
|
184
|
-
options:
|
185
|
-
renderOption:
|
186
|
-
value:
|
186
|
+
onInputValueChange: G,
|
187
|
+
onValueChange: w,
|
188
|
+
options: q,
|
189
|
+
renderOption: z,
|
190
|
+
value: B
|
187
191
|
});
|
188
192
|
};
|
189
193
|
export {
|
190
|
-
|
194
|
+
Io as ComboboxWithApiPagination
|
191
195
|
};
|
@@ -1,93 +1,95 @@
|
|
1
1
|
import "../../../../../../styles/metadata-instance-form.css";
|
2
|
-
import { Card as
|
3
|
-
import { Formik as
|
4
|
-
import { useState as d, useRef as
|
5
|
-
import { TEMPLATE_CUSTOM_PROPERTIES as
|
6
|
-
import { useAutofill as
|
7
|
-
import { TemplateInstance as
|
8
|
-
import { MetadataEmptyState as
|
9
|
-
import { UnsavedChangesModal as
|
2
|
+
import { Card as N } from "@box/blueprint-web";
|
3
|
+
import { Formik as T, Form as v } from "formik";
|
4
|
+
import { useState as d, useRef as P, useEffect as U, useMemo as _ } from "react";
|
5
|
+
import { TEMPLATE_CUSTOM_PROPERTIES as x } from "../../../../constants.js";
|
6
|
+
import { useAutofill as L } from "../../../../utils/autofill-context.js";
|
7
|
+
import { TemplateInstance as R } from "../../../metadata-editor-fields/metadata-editor-fields.js";
|
8
|
+
import { MetadataEmptyState as j } from "../../../metadata-empty-state/metadata-empty-state.js";
|
9
|
+
import { UnsavedChangesModal as B } from "../../../unsaved-changes-modal/unsaved-changes-modal.js";
|
10
10
|
import { CustomInstance as k } from "../custom-instance/custom-instance.js";
|
11
11
|
import { DeleteConfirmationModal as w } from "../delete-confirmation-modal/delete-confirmation-modal.js";
|
12
|
-
import { MetadataInstanceFormFooter as
|
13
|
-
import { MetadataInstanceFormHeader as
|
14
|
-
import { createJSONPatch as
|
12
|
+
import { MetadataInstanceFormFooter as H } from "../metadata-instance-form-footer/metadata-instance-form-footer.js";
|
13
|
+
import { MetadataInstanceFormHeader as J } from "../metadata-instance-form-header/metadata-instance-form-header.js";
|
14
|
+
import { createJSONPatch as K } from "./utils.js";
|
15
15
|
import { jsx as n, jsxs as f } from "react/jsx-runtime";
|
16
|
-
const
|
17
|
-
metadataInstanceForm:
|
18
|
-
},
|
16
|
+
const V = "_metadataInstanceForm_1hu4u_1", q = {
|
17
|
+
metadataInstanceForm: V
|
18
|
+
}, me = (u) => {
|
19
19
|
const {
|
20
20
|
isAiSuggestionsFeatureEnabled: o,
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
21
|
+
isDeleteButtonDisabled: p,
|
22
|
+
isUnsavedChangesModalOpen: g = !1,
|
23
|
+
onCancel: C,
|
24
|
+
onDelete: h,
|
25
|
+
onSubmit: F,
|
25
26
|
selectedTemplateInstance: e,
|
26
27
|
setIsUnsavedChangesModalOpen: s,
|
27
|
-
onUnsavedChangesModalCancel:
|
28
|
-
} =
|
28
|
+
onUnsavedChangesModalCancel: M
|
29
|
+
} = u, [S, m] = d(!1), {
|
29
30
|
isFetchingSuggestions: a,
|
30
|
-
getAiSuggestions:
|
31
|
-
} =
|
32
|
-
await
|
33
|
-
},
|
34
|
-
t ? s(!0) :
|
35
|
-
},
|
31
|
+
getAiSuggestions: I
|
32
|
+
} = L(), i = e.templateKey === x, r = async (t) => {
|
33
|
+
await F(t, K(t, e)), s(!1);
|
34
|
+
}, E = (t) => {
|
35
|
+
t ? s(!0) : C();
|
36
|
+
}, D = () => {
|
36
37
|
m(!0);
|
37
|
-
},
|
38
|
+
}, b = {
|
38
39
|
metadata: {
|
39
40
|
...e
|
40
41
|
}
|
41
|
-
}, l =
|
42
|
-
|
43
|
-
|
42
|
+
}, l = P(null), [c, A] = d(null);
|
43
|
+
U(() => {
|
44
|
+
A(l.current);
|
44
45
|
}, []);
|
45
|
-
const
|
46
|
+
const y = _(() => {
|
46
47
|
const t = e.fields.length === 0;
|
47
48
|
return i ? /* @__PURE__ */ n(k, {
|
48
49
|
isLoading: a
|
49
|
-
}) : t ? /* @__PURE__ */ n(
|
50
|
+
}) : t ? /* @__PURE__ */ n(j, {
|
50
51
|
isBoxAiSuggestionsFeatureEnabled: o,
|
51
52
|
level: "instance"
|
52
|
-
}) : /* @__PURE__ */ n(
|
53
|
+
}) : /* @__PURE__ */ n(R, {
|
53
54
|
disableForm: a,
|
54
55
|
portalElement: c
|
55
56
|
});
|
56
57
|
}, [i, e.fields.length, a, o, c]);
|
57
|
-
return /* @__PURE__ */ n(
|
58
|
-
initialValues:
|
58
|
+
return /* @__PURE__ */ n(T, {
|
59
|
+
initialValues: b,
|
59
60
|
onSubmit: r,
|
60
61
|
children: ({
|
61
62
|
values: t,
|
62
|
-
dirty:
|
63
|
-
}) => /* @__PURE__ */ f(
|
64
|
-
children: [/* @__PURE__ */ f(
|
63
|
+
dirty: O
|
64
|
+
}) => /* @__PURE__ */ f(v, {
|
65
|
+
children: [/* @__PURE__ */ f(N, {
|
65
66
|
ref: l,
|
66
|
-
className:
|
67
|
-
children: [/* @__PURE__ */ n(
|
67
|
+
className: q.metadataInstanceForm,
|
68
|
+
children: [/* @__PURE__ */ n(J, {
|
68
69
|
isAiSuggestionsFeatureEnabled: o && !i,
|
69
70
|
isLoading: a,
|
70
|
-
onAutofill:
|
71
|
+
onAutofill: I,
|
71
72
|
templateName: e.displayName
|
72
|
-
}),
|
73
|
+
}), y, /* @__PURE__ */ n(H, {
|
74
|
+
isDeleteButtonDisabled: p,
|
73
75
|
isLoading: a,
|
74
|
-
onCancel: () =>
|
75
|
-
onDelete:
|
76
|
+
onCancel: () => E(O),
|
77
|
+
onDelete: D
|
76
78
|
})]
|
77
|
-
}), /* @__PURE__ */ n(
|
78
|
-
onCancel:
|
79
|
+
}), /* @__PURE__ */ n(B, {
|
80
|
+
onCancel: M,
|
79
81
|
onDismiss: () => s(!1),
|
80
82
|
onSaveAndContinue: () => r(t),
|
81
|
-
open:
|
83
|
+
open: g
|
82
84
|
}), /* @__PURE__ */ n(w, {
|
83
|
-
onConfirm: () =>
|
85
|
+
onConfirm: () => h(e),
|
84
86
|
onDismiss: () => m(!1),
|
85
|
-
open:
|
87
|
+
open: S,
|
86
88
|
templateName: e.displayName
|
87
89
|
})]
|
88
90
|
})
|
89
91
|
});
|
90
92
|
};
|
91
93
|
export {
|
92
|
-
|
94
|
+
me as MetadataInstanceForm
|
93
95
|
};
|
@@ -1,35 +1,36 @@
|
|
1
1
|
import "../../../../../../styles/metadata-instance-form-footer.css";
|
2
|
-
import { TextButton as
|
3
|
-
import { useFormikContext as
|
4
|
-
import { useIntl as
|
2
|
+
import { TextButton as b, Button as r } from "@box/blueprint-web";
|
3
|
+
import { useFormikContext as F } from "formik";
|
4
|
+
import { useIntl as g } from "react-intl";
|
5
5
|
import o from "./messages.js";
|
6
6
|
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
7
|
-
const
|
8
|
-
metadataInstanceFormFooter:
|
9
|
-
buttonsContainer:
|
10
|
-
buttons:
|
11
|
-
},
|
12
|
-
|
13
|
-
|
14
|
-
|
7
|
+
const f = "_metadataInstanceFormFooter_17478_1", _ = "_buttonsContainer_17478_8", C = "_buttons_17478_8", a = {
|
8
|
+
metadataInstanceFormFooter: f,
|
9
|
+
buttonsContainer: _,
|
10
|
+
buttons: C
|
11
|
+
}, M = ({
|
12
|
+
isDeleteButtonDisabled: m,
|
13
|
+
isLoading: c,
|
14
|
+
onCancel: l,
|
15
|
+
onDelete: d
|
15
16
|
}) => {
|
16
|
-
const t =
|
17
|
+
const t = g(), {
|
17
18
|
isSubmitting: s,
|
18
|
-
submitForm:
|
19
|
-
} =
|
19
|
+
submitForm: u
|
20
|
+
} = F(), n = c || s;
|
20
21
|
return /* @__PURE__ */ e("div", {
|
21
22
|
className: a.metadataInstanceFormFooter,
|
22
23
|
children: /* @__PURE__ */ i("div", {
|
23
24
|
className: a.buttonsContainer,
|
24
|
-
children: [/* @__PURE__ */ e(
|
25
|
-
disabled: n,
|
26
|
-
onClick:
|
25
|
+
children: [/* @__PURE__ */ e(b, {
|
26
|
+
disabled: n || m,
|
27
|
+
onClick: d,
|
27
28
|
children: t.formatMessage(o.deleteButton)
|
28
29
|
}), /* @__PURE__ */ i("div", {
|
29
30
|
className: a.buttons,
|
30
31
|
children: [/* @__PURE__ */ e(r, {
|
31
32
|
disabled: n,
|
32
|
-
onClick:
|
33
|
+
onClick: l,
|
33
34
|
size: "large",
|
34
35
|
variant: "secondary",
|
35
36
|
children: t.formatMessage(o.cancelButton)
|
@@ -37,7 +38,7 @@ const g = "_metadataInstanceFormFooter_17478_1", f = "_buttonsContainer_17478_8"
|
|
37
38
|
disabled: n,
|
38
39
|
loading: s,
|
39
40
|
loadingAriaLabel: t.formatMessage(o.loadingAriaLabel),
|
40
|
-
onClick:
|
41
|
+
onClick: u,
|
41
42
|
size: "large",
|
42
43
|
children: t.formatMessage(o.saveButton)
|
43
44
|
})]
|
@@ -46,5 +47,5 @@ const g = "_metadataInstanceFormFooter_17478_1", f = "_buttonsContainer_17478_8"
|
|
46
47
|
});
|
47
48
|
};
|
48
49
|
export {
|
49
|
-
|
50
|
+
M as MetadataInstanceFormFooter
|
50
51
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@box/metadata-editor",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.55.0",
|
4
4
|
"peerDependencies": {
|
5
5
|
"@ariakit/react": "0.4.5",
|
6
6
|
"@box/blueprint-web": "^7.20.0",
|
@@ -52,5 +52,5 @@
|
|
52
52
|
"**/*.css"
|
53
53
|
],
|
54
54
|
"license": "SEE LICENSE IN LICENSE",
|
55
|
-
"gitHead": "
|
55
|
+
"gitHead": "c8b17c1172f3189aeab0378c577c87b79f3a837f"
|
56
56
|
}
|
@@ -12,7 +12,7 @@ export interface FetcherResponse<T> {
|
|
12
12
|
options: T[];
|
13
13
|
}
|
14
14
|
export interface BaseOptionType {
|
15
|
-
|
15
|
+
displayValue?: string;
|
16
16
|
value: string;
|
17
17
|
}
|
18
18
|
interface BaseComboboxProps<T extends BaseOptionType, M extends boolean> {
|
@@ -21,9 +21,9 @@ interface BaseComboboxProps<T extends BaseOptionType, M extends boolean> {
|
|
21
21
|
noResultMessage?: ReactElement | string;
|
22
22
|
onInputValueChange?: (inputValue: string) => void;
|
23
23
|
multiselect: M;
|
24
|
-
onValueChange?: (selectedOptions:
|
25
|
-
value?:
|
26
|
-
defaultValue?:
|
24
|
+
onValueChange?: (selectedOptions: T[]) => void;
|
25
|
+
value?: T[];
|
26
|
+
defaultValue?: T[];
|
27
27
|
label: string;
|
28
28
|
loadingAriaLabel?: string;
|
29
29
|
portalElement?: HTMLElement | (() => HTMLElement);
|
@@ -2,8 +2,8 @@ import { type MetadataFormFieldValue, type MetadataTemplateInstance } from '../.
|
|
2
2
|
import { type FormValues } from '../../types';
|
3
3
|
export type MetadataInstanceFormProps = {
|
4
4
|
isAiSuggestionsFeatureEnabled: boolean;
|
5
|
+
isDeleteButtonDisabled: boolean;
|
5
6
|
isUnsavedChangesModalOpen: boolean;
|
6
|
-
/** The MetadataTemplate is used when creating a new instance, while MetadataTemplateInstance is applied when editing an existing one. */
|
7
7
|
selectedTemplateInstance: MetadataTemplateInstance;
|
8
8
|
onCancel: () => void;
|
9
9
|
onDelete: (templateInstance: MetadataTemplateInstance) => void;
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import { type MetadataInstanceFormFooterProps } from './types';
|
2
|
-
export declare const MetadataInstanceFormFooter: ({ isLoading, onCancel, onDelete }: MetadataInstanceFormFooterProps) => import("react/jsx-runtime").JSX.Element;
|
2
|
+
export declare const MetadataInstanceFormFooter: ({ isDeleteButtonDisabled, isLoading, onCancel, onDelete, }: MetadataInstanceFormFooterProps) => import("react/jsx-runtime").JSX.Element;
|