@box/metadata-view 1.54.9 → 1.54.10

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