@box/metadata-view 1.26.1 → 1.27.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/dist/chunks/index.js +41 -41
- package/dist/chunks/types.js +3 -3
- package/dist/esm/lib/components/filter-row/initial-field-values.js +12 -13
- package/dist/esm/lib/components/filter-row/metadata-filter-chip.js +1 -0
- package/dist/esm/lib/components/filter-row/predefinedFilters/index.js +2 -2
- package/dist/esm/lib/components/filter-row/select-filter-chip.js +39 -40
- package/dist/esm/lib/components/filter-sidepanel/filter-side-panel.js +36 -36
- package/dist/esm/lib/components/filter-sidepanel/filter.js +7 -4
- package/dist/esm/lib/components/item-action-menu/item-action-menu.js +103 -103
- package/dist/esm/lib/components/metadata-grid/metadata-grid.js +29 -30
- package/dist/esm/lib/components/metadata-table/actionColumn.js +3 -3
- package/dist/esm/lib/components/metadata-table/hooks/useInfiniteScrollTableItems.js +13 -16
- package/dist/esm/lib/components/metadata-table/table-body/table-body-with-data.js +140 -144
- package/dist/esm/lib/components/metadata-table/table-renderer.js +35 -35
- package/dist/esm/lib/components/metadata-value/metadata-checkbox-field.js +14 -15
- package/dist/esm/lib/components/metadata-value/metadata-file-chip.js +13 -14
- package/dist/esm/lib/components/metadata-value/metadata-file-field.js +12 -13
- package/dist/esm/lib/components/metadata-value/metadata-location-field.js +31 -32
- package/dist/esm/lib/components/metadata-value/metadata-radio-field.js +10 -11
- package/dist/esm/lib/components/metadata-value/metadata-search-field.js +22 -23
- package/dist/esm/lib/components/sort-dropdown/sort-dropdown.js +35 -35
- package/dist/esm/lib/metadata-view.js +59 -59
- package/dist/i18n/en-x-pseudo.js +31 -31
- package/dist/i18n/en-x-pseudo.properties +31 -31
- package/dist/styles/action-bar.css +1 -1
- package/package.json +12 -12
|
@@ -1,214 +1,210 @@
|
|
|
1
|
-
import { TableBody as
|
|
2
|
-
import { ItemTypeIcon as
|
|
1
|
+
import { TableBody as x, Row as C, Cell as I, ActionCell as _, Text as y } from "@box/blueprint-web";
|
|
2
|
+
import { ItemTypeIcon as E } from "@box/item-icon";
|
|
3
3
|
import L from "clsx";
|
|
4
4
|
import S from "lodash/get";
|
|
5
|
-
import
|
|
5
|
+
import m from "react";
|
|
6
6
|
import { I as p } from "../../../../../chunks/types.js";
|
|
7
|
-
import { THUMBNAIL_LIST_VIEW_HEIGHTS as
|
|
8
|
-
import { s as
|
|
9
|
-
import { jsxs as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
const B = (e,
|
|
14
|
-
const
|
|
15
|
-
return S(e,
|
|
16
|
-
},
|
|
7
|
+
import { THUMBNAIL_LIST_VIEW_HEIGHTS as D } from "../../constants.js";
|
|
8
|
+
import { s as c, T as U } from "../../../../../chunks/index.js";
|
|
9
|
+
import { jsxs as T, jsx as t } from "react/jsx-runtime";
|
|
10
|
+
import { GhostTableRow as k } from "./ghost-table-row/ghost-table-row.js";
|
|
11
|
+
import { InlineEditingCell as W } from "./inline-editing-cell/inline-editing-cell.js";
|
|
12
|
+
import { ItemActionMenu as j } from "../../item-action-menu/item-action-menu.js";
|
|
13
|
+
const B = (e, l, n) => {
|
|
14
|
+
const r = n ? l.split(".")[1] : l;
|
|
15
|
+
return S(e, r);
|
|
16
|
+
}, G = /* @__PURE__ */ m.memo(({
|
|
17
17
|
column: e,
|
|
18
|
-
iconColumnVariant:
|
|
19
|
-
item:
|
|
18
|
+
iconColumnVariant: l,
|
|
19
|
+
item: n
|
|
20
20
|
}) => {
|
|
21
21
|
const {
|
|
22
|
-
id:
|
|
23
|
-
isItemMetadata:
|
|
24
|
-
subtitle:
|
|
25
|
-
textValue:
|
|
26
|
-
} = e, a = `${
|
|
27
|
-
return /* @__PURE__ */ t(
|
|
28
|
-
children: /* @__PURE__ */
|
|
29
|
-
className:
|
|
30
|
-
children: [/* @__PURE__ */ t(
|
|
31
|
-
className:
|
|
32
|
-
item:
|
|
33
|
-
}), /* @__PURE__ */
|
|
34
|
-
className: L(
|
|
35
|
-
[
|
|
22
|
+
id: r,
|
|
23
|
+
isItemMetadata: s,
|
|
24
|
+
subtitle: d,
|
|
25
|
+
textValue: f
|
|
26
|
+
} = e, a = `${f}-${n.id}`;
|
|
27
|
+
return /* @__PURE__ */ t(I, {
|
|
28
|
+
children: /* @__PURE__ */ T("div", {
|
|
29
|
+
className: c.tableNameCell,
|
|
30
|
+
children: [/* @__PURE__ */ t(E, {
|
|
31
|
+
className: c.tableNameCellIconInline,
|
|
32
|
+
item: n
|
|
33
|
+
}), /* @__PURE__ */ T("div", {
|
|
34
|
+
className: L(c.tableNameCellTitle, {
|
|
35
|
+
[c.hasSubtitle]: l === p.INLINE_SUBTITLE
|
|
36
36
|
}),
|
|
37
|
-
children: [/* @__PURE__ */ t(
|
|
37
|
+
children: [/* @__PURE__ */ t(y, {
|
|
38
38
|
as: "span",
|
|
39
|
-
className:
|
|
40
|
-
children: B(r, s
|
|
41
|
-
}),
|
|
39
|
+
className: c.tableNameCellText,
|
|
40
|
+
children: B(n, r, s)
|
|
41
|
+
}), l === p.INLINE_SUBTITLE && /* @__PURE__ */ t(y, {
|
|
42
42
|
as: "span",
|
|
43
|
-
className:
|
|
43
|
+
className: c.tableNameCellText,
|
|
44
44
|
color: "textOnLightSecondary",
|
|
45
|
-
children:
|
|
45
|
+
children: d
|
|
46
46
|
})]
|
|
47
47
|
})]
|
|
48
48
|
})
|
|
49
49
|
}, a);
|
|
50
|
-
}),
|
|
50
|
+
}), H = /* @__PURE__ */ m.memo(({
|
|
51
51
|
column: e,
|
|
52
|
-
item:
|
|
52
|
+
item: l
|
|
53
53
|
}) => {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}), K = /* @__PURE__ */ h.memo(({
|
|
54
|
+
const n = `${e.textValue}-${l.id}`;
|
|
55
|
+
return /* @__PURE__ */ t(I, {
|
|
56
|
+
children: e.cellRenderer?.(l, e)
|
|
57
|
+
}, n);
|
|
58
|
+
}), A = /* @__PURE__ */ m.memo(({
|
|
60
59
|
column: e,
|
|
61
|
-
item:
|
|
60
|
+
item: l
|
|
62
61
|
}) => {
|
|
63
|
-
const
|
|
64
|
-
return
|
|
65
|
-
children:
|
|
66
|
-
},
|
|
67
|
-
}),
|
|
62
|
+
const n = `${e.textValue}-${l.id}`, r = S(l, e.id);
|
|
63
|
+
return r ? /* @__PURE__ */ t(I, {
|
|
64
|
+
children: r.join(" ")
|
|
65
|
+
}, n) : /* @__PURE__ */ t(I, {}, n);
|
|
66
|
+
}), F = /* @__PURE__ */ m.memo(({
|
|
68
67
|
column: e,
|
|
69
|
-
item:
|
|
68
|
+
item: l
|
|
70
69
|
}) => {
|
|
71
70
|
const {
|
|
72
|
-
id:
|
|
73
|
-
isItemMetadata:
|
|
74
|
-
textValue:
|
|
75
|
-
} = e,
|
|
76
|
-
return /* @__PURE__ */ t(
|
|
77
|
-
children: /* @__PURE__ */ t(
|
|
71
|
+
id: n,
|
|
72
|
+
isItemMetadata: r,
|
|
73
|
+
textValue: s
|
|
74
|
+
} = e, d = `${s}-${l.id}`;
|
|
75
|
+
return /* @__PURE__ */ t(I, {
|
|
76
|
+
children: /* @__PURE__ */ t(y, {
|
|
78
77
|
as: "span",
|
|
79
|
-
children: B(n, r
|
|
78
|
+
children: B(l, n, r)
|
|
80
79
|
})
|
|
81
|
-
},
|
|
82
|
-
}),
|
|
80
|
+
}, d);
|
|
81
|
+
}), K = /* @__PURE__ */ m.memo(({
|
|
83
82
|
column: e,
|
|
84
|
-
iconColumnVariant:
|
|
85
|
-
item:
|
|
86
|
-
onInlineEditChange:
|
|
83
|
+
iconColumnVariant: l,
|
|
84
|
+
item: n,
|
|
85
|
+
onInlineEditChange: r
|
|
87
86
|
}) => {
|
|
88
87
|
const {
|
|
89
|
-
cellRenderer:
|
|
90
|
-
id:
|
|
91
|
-
isInlineEditingEnabled:
|
|
88
|
+
cellRenderer: s,
|
|
89
|
+
id: d,
|
|
90
|
+
isInlineEditingEnabled: f,
|
|
92
91
|
type: a
|
|
93
|
-
} = e,
|
|
94
|
-
return
|
|
92
|
+
} = e, u = d === "item.name" && (l === p.INLINE || l === p.INLINE_SUBTITLE);
|
|
93
|
+
return s ? /* @__PURE__ */ t(H, {
|
|
95
94
|
column: e,
|
|
96
|
-
item:
|
|
97
|
-
}) :
|
|
95
|
+
item: n
|
|
96
|
+
}) : u ? /* @__PURE__ */ t(G, {
|
|
98
97
|
column: e,
|
|
99
|
-
iconColumnVariant:
|
|
100
|
-
item:
|
|
101
|
-
}) :
|
|
98
|
+
iconColumnVariant: l,
|
|
99
|
+
item: n
|
|
100
|
+
}) : f && (a === "multiSelect" || a === "enum") ? /* @__PURE__ */ t(W, {
|
|
102
101
|
column: e,
|
|
103
|
-
item:
|
|
104
|
-
onInlineEditChange:
|
|
105
|
-
}, `${e.id}-${
|
|
102
|
+
item: n,
|
|
103
|
+
onInlineEditChange: r
|
|
104
|
+
}, `${e.id}-${n.id}`) : a === "multiSelect" ? /* @__PURE__ */ t(A, {
|
|
106
105
|
column: e,
|
|
107
|
-
item:
|
|
108
|
-
}) : /* @__PURE__ */ t(
|
|
106
|
+
item: n
|
|
107
|
+
}) : /* @__PURE__ */ t(F, {
|
|
109
108
|
column: e,
|
|
110
|
-
item:
|
|
109
|
+
item: n
|
|
111
110
|
});
|
|
112
|
-
}),
|
|
111
|
+
}), q = /* @__PURE__ */ m.memo(({
|
|
113
112
|
item: e,
|
|
114
|
-
zoomLevel:
|
|
115
|
-
}) => /* @__PURE__ */ t(
|
|
113
|
+
zoomLevel: l
|
|
114
|
+
}) => /* @__PURE__ */ t(I, {
|
|
116
115
|
style: {
|
|
117
|
-
height:
|
|
116
|
+
height: D[l]
|
|
118
117
|
},
|
|
119
|
-
children: /* @__PURE__ */ t(
|
|
120
|
-
className:
|
|
118
|
+
children: /* @__PURE__ */ t(E, {
|
|
119
|
+
className: c.iconCell,
|
|
121
120
|
item: e
|
|
122
121
|
})
|
|
123
|
-
}, `item-type-icon-${e.id}`)),
|
|
122
|
+
}, `item-type-icon-${e.id}`)), J = /* @__PURE__ */ m.memo(({
|
|
124
123
|
item: e,
|
|
125
|
-
itemActionMenuProps:
|
|
126
|
-
isCheckboxDisabled:
|
|
127
|
-
}) => /* @__PURE__ */ t(
|
|
128
|
-
isCheckboxDisabled:
|
|
129
|
-
children: (
|
|
130
|
-
...
|
|
124
|
+
itemActionMenuProps: l,
|
|
125
|
+
isCheckboxDisabled: n
|
|
126
|
+
}) => /* @__PURE__ */ t(_, {
|
|
127
|
+
isCheckboxDisabled: n,
|
|
128
|
+
children: (r) => l ? /* @__PURE__ */ t(j, {
|
|
129
|
+
...l,
|
|
131
130
|
item: e,
|
|
132
|
-
onOpenChange:
|
|
131
|
+
onOpenChange: r
|
|
133
132
|
}) : null
|
|
134
|
-
})),
|
|
133
|
+
})), oe = ({
|
|
135
134
|
areSelectionCheckboxesDisabled: e,
|
|
136
|
-
columnCount:
|
|
137
|
-
columns:
|
|
138
|
-
iconColumnVariant:
|
|
139
|
-
items:
|
|
140
|
-
itemActionMenuProps:
|
|
141
|
-
onInlineEditChange:
|
|
135
|
+
columnCount: l,
|
|
136
|
+
columns: n,
|
|
137
|
+
iconColumnVariant: r,
|
|
138
|
+
items: s,
|
|
139
|
+
itemActionMenuProps: d,
|
|
140
|
+
onInlineEditChange: f,
|
|
142
141
|
onTableRowClick: a,
|
|
143
|
-
shouldRenderActionColumn:
|
|
144
|
-
virtualItems:
|
|
145
|
-
totalVirtualSize:
|
|
146
|
-
zoomLevel:
|
|
142
|
+
shouldRenderActionColumn: u,
|
|
143
|
+
virtualItems: h,
|
|
144
|
+
totalVirtualSize: w,
|
|
145
|
+
zoomLevel: $
|
|
147
146
|
}) => {
|
|
148
|
-
const
|
|
149
|
-
if (
|
|
150
|
-
const o = (
|
|
151
|
-
columnLength:
|
|
152
|
-
rowKey: `ghost-${
|
|
153
|
-
}),
|
|
147
|
+
const M = r === p.COLUMN;
|
|
148
|
+
if (h) {
|
|
149
|
+
const o = (i) => /* @__PURE__ */ t(k, {
|
|
150
|
+
columnLength: l || 0,
|
|
151
|
+
rowKey: `ghost-${i}`
|
|
152
|
+
}), N = (i) => /* @__PURE__ */ t(U, {
|
|
154
153
|
areSelectionCheckboxesDisabled: e,
|
|
155
|
-
columns:
|
|
156
|
-
iconColumnVariant:
|
|
157
|
-
item:
|
|
158
|
-
itemActionMenuProps:
|
|
154
|
+
columns: n,
|
|
155
|
+
iconColumnVariant: r,
|
|
156
|
+
item: i,
|
|
157
|
+
itemActionMenuProps: d,
|
|
159
158
|
onTableRowClick: a,
|
|
160
|
-
shouldRenderActionColumn:
|
|
161
|
-
zoomLevel:
|
|
162
|
-
}),
|
|
163
|
-
const
|
|
164
|
-
return (
|
|
165
|
-
},
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}, T = _(), C = D();
|
|
169
|
-
return /* @__PURE__ */ $(E, {
|
|
170
|
-
children: [!!T && /* @__PURE__ */ t(u, {
|
|
159
|
+
shouldRenderActionColumn: u,
|
|
160
|
+
zoomLevel: $
|
|
161
|
+
}), O = () => h[0]?.start || 0, R = () => {
|
|
162
|
+
const V = h[h.length - 1]?.end || 0;
|
|
163
|
+
return Math.max((w || 0) - V, 0);
|
|
164
|
+
}, b = O(), g = R();
|
|
165
|
+
return /* @__PURE__ */ T(x, {
|
|
166
|
+
children: [!!b && /* @__PURE__ */ t(C, {
|
|
171
167
|
isDisabled: !0,
|
|
172
168
|
style: {
|
|
173
|
-
height: `${
|
|
169
|
+
height: `${b}px`
|
|
174
170
|
}
|
|
175
|
-
}),
|
|
176
|
-
index:
|
|
177
|
-
}) =>
|
|
171
|
+
}), h.map(({
|
|
172
|
+
index: i
|
|
173
|
+
}) => i >= s.length ? o(i) : N(s[i])), !!g && /* @__PURE__ */ t(C, {
|
|
178
174
|
isDisabled: !0,
|
|
179
175
|
style: {
|
|
180
|
-
height: `${
|
|
176
|
+
height: `${g}px`
|
|
181
177
|
}
|
|
182
178
|
})]
|
|
183
179
|
});
|
|
184
180
|
}
|
|
185
|
-
return /* @__PURE__ */ t(
|
|
186
|
-
items:
|
|
181
|
+
return /* @__PURE__ */ t(x, {
|
|
182
|
+
items: s.map((o) => ({
|
|
187
183
|
key: o.id,
|
|
188
184
|
...o
|
|
189
185
|
})),
|
|
190
|
-
children: (o) => /* @__PURE__ */
|
|
191
|
-
className: L(
|
|
192
|
-
[
|
|
186
|
+
children: (o) => /* @__PURE__ */ T(C, {
|
|
187
|
+
className: L(c.tableRow, {
|
|
188
|
+
[c.isClickable]: a
|
|
193
189
|
}),
|
|
194
190
|
id: o.id,
|
|
195
|
-
onAction: () => a
|
|
196
|
-
children: [
|
|
191
|
+
onAction: () => a?.(o),
|
|
192
|
+
children: [M && /* @__PURE__ */ t(q, {
|
|
197
193
|
item: o,
|
|
198
|
-
zoomLevel:
|
|
199
|
-
}),
|
|
200
|
-
column:
|
|
201
|
-
iconColumnVariant:
|
|
194
|
+
zoomLevel: $
|
|
195
|
+
}), n.map((N) => /* @__PURE__ */ t(K, {
|
|
196
|
+
column: N,
|
|
197
|
+
iconColumnVariant: r,
|
|
202
198
|
item: o,
|
|
203
|
-
onInlineEditChange:
|
|
204
|
-
}, `${
|
|
199
|
+
onInlineEditChange: f
|
|
200
|
+
}, `${N.textValue}-${o.id}`)), u && /* @__PURE__ */ t(J, {
|
|
205
201
|
isCheckboxDisabled: e,
|
|
206
202
|
item: o,
|
|
207
|
-
itemActionMenuProps:
|
|
203
|
+
itemActionMenuProps: d
|
|
208
204
|
})]
|
|
209
205
|
}, o.id)
|
|
210
206
|
});
|
|
211
207
|
};
|
|
212
208
|
export {
|
|
213
|
-
|
|
209
|
+
oe as default
|
|
214
210
|
};
|
|
@@ -4,53 +4,53 @@ import { GhostTableBody as j } from "./table-body/ghost-table-body.js";
|
|
|
4
4
|
import y from "./table-body/table-body-with-data.js";
|
|
5
5
|
import { getShouldRenderActionColumn as A } from "./actionColumn.js";
|
|
6
6
|
import G from "./messages.js";
|
|
7
|
-
import { jsxs as V, jsx as
|
|
8
|
-
const
|
|
9
|
-
columnCount:
|
|
10
|
-
columns:
|
|
11
|
-
formatMessage:
|
|
12
|
-
iconColumnVariant:
|
|
13
|
-
isLoading:
|
|
14
|
-
areSelectionCheckboxesDisabled:
|
|
15
|
-
itemActionMenuProps:
|
|
16
|
-
items:
|
|
17
|
-
onInlineEditChange:
|
|
18
|
-
onTableRowClick:
|
|
19
|
-
style:
|
|
20
|
-
tableHeader:
|
|
21
|
-
tableProps:
|
|
22
|
-
virtualItems:
|
|
7
|
+
import { jsxs as V, jsx as s } from "react/jsx-runtime";
|
|
8
|
+
const U = ({
|
|
9
|
+
columnCount: u,
|
|
10
|
+
columns: t,
|
|
11
|
+
formatMessage: c,
|
|
12
|
+
iconColumnVariant: e,
|
|
13
|
+
isLoading: n,
|
|
14
|
+
areSelectionCheckboxesDisabled: a,
|
|
15
|
+
itemActionMenuProps: h,
|
|
16
|
+
items: C,
|
|
17
|
+
onInlineEditChange: f,
|
|
18
|
+
onTableRowClick: g,
|
|
19
|
+
style: d,
|
|
20
|
+
tableHeader: p,
|
|
21
|
+
tableProps: r,
|
|
22
|
+
virtualItems: l,
|
|
23
23
|
totalVirtualSize: b,
|
|
24
24
|
zoomLevel: T
|
|
25
25
|
}) => {
|
|
26
|
-
const m = A(
|
|
27
|
-
let
|
|
28
|
-
return
|
|
29
|
-
})(), x =
|
|
26
|
+
const m = A(r), i = u || (() => {
|
|
27
|
+
let o = t.length;
|
|
28
|
+
return e === R.COLUMN && (o += 1), m && (o += 1), o;
|
|
29
|
+
})(), x = n && !l?.length;
|
|
30
30
|
return /* @__PURE__ */ V(B, {
|
|
31
|
-
"aria-label":
|
|
31
|
+
"aria-label": c(G.listView),
|
|
32
32
|
selectionBehavior: "toggle",
|
|
33
|
-
style:
|
|
34
|
-
...
|
|
35
|
-
children: [
|
|
33
|
+
style: d,
|
|
34
|
+
...r,
|
|
35
|
+
children: [p, x ? /* @__PURE__ */ s(j, {
|
|
36
36
|
columnLength: i
|
|
37
|
-
}) : /* @__PURE__ */
|
|
38
|
-
areSelectionCheckboxesDisabled:
|
|
37
|
+
}) : /* @__PURE__ */ s(y, {
|
|
38
|
+
areSelectionCheckboxesDisabled: a,
|
|
39
39
|
columnCount: i,
|
|
40
|
-
columns:
|
|
41
|
-
iconColumnVariant:
|
|
42
|
-
isLoading:
|
|
43
|
-
itemActionMenuProps:
|
|
44
|
-
items:
|
|
45
|
-
onInlineEditChange:
|
|
46
|
-
onTableRowClick:
|
|
40
|
+
columns: t,
|
|
41
|
+
iconColumnVariant: e,
|
|
42
|
+
isLoading: n,
|
|
43
|
+
itemActionMenuProps: h,
|
|
44
|
+
items: C,
|
|
45
|
+
onInlineEditChange: f,
|
|
46
|
+
onTableRowClick: g,
|
|
47
47
|
shouldRenderActionColumn: m,
|
|
48
48
|
totalVirtualSize: b,
|
|
49
|
-
virtualItems:
|
|
49
|
+
virtualItems: l,
|
|
50
50
|
zoomLevel: T
|
|
51
51
|
})]
|
|
52
52
|
});
|
|
53
53
|
};
|
|
54
54
|
export {
|
|
55
|
-
|
|
55
|
+
U as TableRenderer
|
|
56
56
|
};
|
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
import { useFormikContext as
|
|
2
|
-
import { Checkbox as
|
|
3
|
-
import { jsx as
|
|
4
|
-
const
|
|
1
|
+
import { useFormikContext as u } from "formik";
|
|
2
|
+
import { Checkbox as n } from "@box/blueprint-web";
|
|
3
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
4
|
+
const p = ({
|
|
5
5
|
id: a,
|
|
6
|
-
name:
|
|
6
|
+
name: r
|
|
7
7
|
}) => {
|
|
8
|
-
var n, s, r;
|
|
9
8
|
const {
|
|
10
9
|
values: d,
|
|
11
|
-
setFieldValue:
|
|
12
|
-
} =
|
|
10
|
+
setFieldValue: c
|
|
11
|
+
} = u(), m = d.metadata.fields[a]?.options || [], l = d.metadata.fields[a]?.value?.enum || [], i = (e, o) => {
|
|
13
12
|
const t = new Set(l);
|
|
14
|
-
o ? t.add(e) : t.delete(e),
|
|
13
|
+
o ? t.add(e) : t.delete(e), c(`metadata.fields.${a}.value.enum`, Array.from(t));
|
|
15
14
|
};
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
header:
|
|
18
|
-
children:
|
|
15
|
+
return /* @__PURE__ */ s(n.Legend, {
|
|
16
|
+
header: r,
|
|
17
|
+
children: m.map(({
|
|
19
18
|
key: e
|
|
20
19
|
}) => {
|
|
21
20
|
const o = l.includes(e);
|
|
22
|
-
return /* @__PURE__ */
|
|
21
|
+
return /* @__PURE__ */ s(n.Item, {
|
|
23
22
|
checked: o,
|
|
24
23
|
"data-target-id": `CheckboxItem-filter_${a}_${e}`,
|
|
25
24
|
label: e,
|
|
26
25
|
onCheckedChange: (t) => {
|
|
27
|
-
|
|
26
|
+
i(e, t === !0);
|
|
28
27
|
},
|
|
29
28
|
value: e
|
|
30
29
|
}, e);
|
|
@@ -32,5 +31,5 @@ const b = ({
|
|
|
32
31
|
});
|
|
33
32
|
};
|
|
34
33
|
export {
|
|
35
|
-
|
|
34
|
+
p as MetadataCheckboxField
|
|
36
35
|
};
|
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
import { BoxItemTypeSelectorQuickFilter as
|
|
2
|
-
import { useFormikContext as
|
|
3
|
-
import { jsx as
|
|
4
|
-
const
|
|
1
|
+
import { BoxItemTypeSelectorQuickFilter as i } from "@box/box-item-type-selector";
|
|
2
|
+
import { useFormikContext as r } from "formik";
|
|
3
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
4
|
+
const c = ({
|
|
5
5
|
id: e
|
|
6
6
|
}) => {
|
|
7
|
-
var t, l;
|
|
8
7
|
const {
|
|
9
|
-
values:
|
|
10
|
-
setFieldValue:
|
|
11
|
-
submitForm:
|
|
12
|
-
} =
|
|
13
|
-
return /* @__PURE__ */
|
|
8
|
+
values: t,
|
|
9
|
+
setFieldValue: l,
|
|
10
|
+
submitForm: o
|
|
11
|
+
} = r(), a = t.metadata.fields[e]?.value?.enum;
|
|
12
|
+
return /* @__PURE__ */ u(i, {
|
|
14
13
|
allowAllOptionsSelect: !0,
|
|
15
14
|
applyButtonType: "submit",
|
|
16
|
-
onApply: (
|
|
17
|
-
|
|
15
|
+
onApply: (m) => {
|
|
16
|
+
l(`metadata.fields.${e}.value.enum`, m), o();
|
|
18
17
|
},
|
|
19
|
-
selected:
|
|
18
|
+
selected: a || []
|
|
20
19
|
});
|
|
21
20
|
};
|
|
22
21
|
export {
|
|
23
|
-
|
|
22
|
+
c as MetadataFileChip
|
|
24
23
|
};
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import { BoxItemTypeSelector as
|
|
2
|
-
import { useFormikContext as
|
|
3
|
-
import { jsx as
|
|
4
|
-
const
|
|
1
|
+
import { BoxItemTypeSelector as m } from "@box/box-item-type-selector";
|
|
2
|
+
import { useFormikContext as r } from "formik";
|
|
3
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
4
|
+
const d = ({
|
|
5
5
|
id: e
|
|
6
6
|
}) => {
|
|
7
|
-
var t, o;
|
|
8
7
|
const {
|
|
9
|
-
values:
|
|
10
|
-
setFieldValue:
|
|
11
|
-
} =
|
|
12
|
-
return /* @__PURE__ */
|
|
13
|
-
onSelectionChange: (
|
|
14
|
-
|
|
8
|
+
values: t,
|
|
9
|
+
setFieldValue: o
|
|
10
|
+
} = r(), a = t.metadata.fields[e]?.value?.enum;
|
|
11
|
+
return /* @__PURE__ */ i(m, {
|
|
12
|
+
onSelectionChange: (l) => {
|
|
13
|
+
o(`metadata.fields.${e}.value.enum`, l);
|
|
15
14
|
},
|
|
16
|
-
selected:
|
|
15
|
+
selected: a || []
|
|
17
16
|
});
|
|
18
17
|
};
|
|
19
18
|
export {
|
|
20
|
-
|
|
19
|
+
d as MetadataFileField
|
|
21
20
|
};
|
|
@@ -1,45 +1,44 @@
|
|
|
1
|
-
import { ContentField as
|
|
2
|
-
import { useFormikContext as
|
|
3
|
-
import
|
|
4
|
-
import { useIntl as
|
|
5
|
-
import
|
|
1
|
+
import { ContentField as u } from "@box/blueprint-web";
|
|
2
|
+
import { useFormikContext as F } from "formik";
|
|
3
|
+
import g from "lodash/noop";
|
|
4
|
+
import { useIntl as p } from "react-intl";
|
|
5
|
+
import C from "./messages.js";
|
|
6
6
|
import { jsx as i } from "react/jsx-runtime";
|
|
7
|
-
import '../../../../styles/metadata-location-field.css';const
|
|
8
|
-
metadataLocationFieldTrigger:
|
|
9
|
-
},
|
|
7
|
+
import '../../../../styles/metadata-location-field.css';const h = "_metadataLocationFieldTrigger_1d3ch_1", v = {
|
|
8
|
+
metadataLocationFieldTrigger: h
|
|
9
|
+
}, M = ({
|
|
10
10
|
id: e,
|
|
11
|
-
triggerSetValueCallback:
|
|
12
|
-
renderer:
|
|
11
|
+
triggerSetValueCallback: l = g,
|
|
12
|
+
renderer: r = (t) => t
|
|
13
13
|
}) => {
|
|
14
|
-
var r;
|
|
15
14
|
const {
|
|
16
|
-
formatMessage:
|
|
17
|
-
} =
|
|
18
|
-
values:
|
|
19
|
-
setFieldValue:
|
|
20
|
-
} =
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
folderId:
|
|
26
|
-
folderName:
|
|
27
|
-
isFolderShared:
|
|
15
|
+
formatMessage: t
|
|
16
|
+
} = p(), {
|
|
17
|
+
values: n,
|
|
18
|
+
setFieldValue: a
|
|
19
|
+
} = F(), o = n.metadata.fields[e].value.enum?.[0], d = () => {
|
|
20
|
+
a(`metadata.fields.${e}.value.enum`, []);
|
|
21
|
+
}, s = () => {
|
|
22
|
+
l((m, c, f = !1) => {
|
|
23
|
+
a(`metadata.fields.${e}.value.enum[0]`, {
|
|
24
|
+
folderId: m,
|
|
25
|
+
folderName: c,
|
|
26
|
+
isFolderShared: f
|
|
28
27
|
});
|
|
29
28
|
});
|
|
30
29
|
};
|
|
31
|
-
return
|
|
32
|
-
className:
|
|
33
|
-
children: /* @__PURE__ */ i(
|
|
30
|
+
return r(/* @__PURE__ */ i("div", {
|
|
31
|
+
className: v.metadataLocationFieldTrigger,
|
|
32
|
+
children: /* @__PURE__ */ i(u, {
|
|
34
33
|
"data-target-id": `ContentField-filter_${e}`,
|
|
35
|
-
hintText:
|
|
36
|
-
isSharedFolder:
|
|
37
|
-
onClick:
|
|
38
|
-
onClickClearButton:
|
|
39
|
-
title:
|
|
34
|
+
hintText: t(C.selectFolderHint),
|
|
35
|
+
isSharedFolder: o?.isFolderShared,
|
|
36
|
+
onClick: s,
|
|
37
|
+
onClickClearButton: d,
|
|
38
|
+
title: o?.folderName
|
|
40
39
|
})
|
|
41
40
|
}));
|
|
42
41
|
};
|
|
43
42
|
export {
|
|
44
|
-
|
|
43
|
+
M as MetadataLocationField
|
|
45
44
|
};
|