@box/metadata-view 2.2.38 → 2.2.40
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/action-bar.js +1 -52
- package/dist/chunks/empty-state.js +1 -24
- package/dist/chunks/error-state.js +1 -23
- package/dist/chunks/filter-row.module.js +1 -7
- package/dist/chunks/filter-side-panel.js +1 -65
- package/dist/chunks/header.js +1 -62
- package/dist/chunks/inline-editing-cell.js +1 -34
- package/dist/chunks/item-action-menu.js +1 -86
- package/dist/chunks/metadata-grid.js +1 -44
- package/dist/chunks/metadata-location-field.js +1 -35
- package/dist/chunks/metadata-view.js +1 -104
- package/dist/chunks/pagination-controls.js +1 -40
- package/dist/chunks/table-row.js +1 -71
- package/dist/chunks/types.js +1 -6
- package/dist/chunks/types2.js +1 -4
- package/dist/chunks/zoom-button.js +1 -20
- package/dist/esm/index.js +1 -29
- package/dist/esm/lib/components/action-bar/action-bar.js +1 -2
- package/dist/esm/lib/components/action-bar/index.js +1 -2
- package/dist/esm/lib/components/action-bar/messages.js +1 -24
- package/dist/esm/lib/components/action-bar/zoom-button.js +1 -2
- package/dist/esm/lib/components/constants.js +1 -14
- package/dist/esm/lib/components/empty-state/empty-state.js +1 -2
- package/dist/esm/lib/components/empty-state/index.js +1 -2
- package/dist/esm/lib/components/empty-state/messages.js +1 -12
- package/dist/esm/lib/components/error-state/error-state.js +1 -2
- package/dist/esm/lib/components/error-state/index.js +1 -2
- package/dist/esm/lib/components/error-state/messages.js +1 -12
- package/dist/esm/lib/components/filter-row/advanced-field-content.js +1 -39
- package/dist/esm/lib/components/filter-row/advanced-filter-context.js +1 -3
- package/dist/esm/lib/components/filter-row/all-filters-chip.js +1 -34
- package/dist/esm/lib/components/filter-row/custom-trigger-chip.js +1 -40
- package/dist/esm/lib/components/filter-row/filter-chip-popover-context.js +1 -3
- package/dist/esm/lib/components/filter-row/filter-row.js +1 -46
- package/dist/esm/lib/components/filter-row/form-filter-chip.js +1 -99
- package/dist/esm/lib/components/filter-row/format-advanced-filter-label.js +1 -163
- package/dist/esm/lib/components/filter-row/index.js +1 -6
- package/dist/esm/lib/components/filter-row/initial-field-values.js +1 -51
- package/dist/esm/lib/components/filter-row/is-blank-or-not-blank-filter.js +1 -3
- package/dist/esm/lib/components/filter-row/is-filter-selected.js +1 -40
- package/dist/esm/lib/components/filter-row/messages.js +1 -112
- package/dist/esm/lib/components/filter-row/metadata-filter-chip.js +1 -87
- package/dist/esm/lib/components/filter-row/predefinedFilters/index.js +1 -2
- package/dist/esm/lib/components/filter-row/predefinedFilters/predefined-filter-options-factory.js +1 -15
- package/dist/esm/lib/components/filter-row/predefinedFilters/use-predefined-filter.js +1 -63
- package/dist/esm/lib/components/filter-row/select-filter-chip.js +1 -42
- package/dist/esm/lib/components/filter-row/use-form-filter-chip.js +1 -40
- package/dist/esm/lib/components/filter-row/use-nested-overlay-popover-open-change.js +1 -30
- package/dist/esm/lib/components/filter-sidepanel/filter-side-panel.js +1 -2
- package/dist/esm/lib/components/filter-sidepanel/filter.js +1 -96
- package/dist/esm/lib/components/filter-sidepanel/index.js +1 -3
- package/dist/esm/lib/components/filter-sidepanel/messages.js +1 -20
- package/dist/esm/lib/components/header/header.js +1 -2
- package/dist/esm/lib/components/header/index.js +1 -2
- package/dist/esm/lib/components/header/messages.js +1 -16
- package/dist/esm/lib/components/index.js +1 -26
- package/dist/esm/lib/components/item-action-menu/identifier.js +1 -5
- package/dist/esm/lib/components/item-action-menu/index.js +1 -2
- package/dist/esm/lib/components/item-action-menu/item-action-menu.js +1 -2
- package/dist/esm/lib/components/item-action-menu/messages.js +1 -6
- package/dist/esm/lib/components/metadata-grid/index.js +1 -2
- package/dist/esm/lib/components/metadata-grid/messages.js +1 -6
- package/dist/esm/lib/components/metadata-grid/metadata-grid.js +1 -2
- package/dist/esm/lib/components/metadata-table/actionColumn.js +1 -4
- package/dist/esm/lib/components/metadata-table/hooks/useInfiniteScrollTableItems.js +1 -52
- package/dist/esm/lib/components/metadata-table/index.js +1 -4
- package/dist/esm/lib/components/metadata-table/messages.js +1 -16
- package/dist/esm/lib/components/metadata-table/metadata-table.js +1 -94
- package/dist/esm/lib/components/metadata-table/table-body/action-cell-content.js +1 -13
- package/dist/esm/lib/components/metadata-table/table-body/ghost-table-body.js +1 -11
- package/dist/esm/lib/components/metadata-table/table-body/ghost-table-row/ghost-table-row.js +1 -9
- package/dist/esm/lib/components/metadata-table/table-body/ghost-table-row/index.js +1 -2
- package/dist/esm/lib/components/metadata-table/table-body/inline-editing-cell/index.js +1 -2
- package/dist/esm/lib/components/metadata-table/table-body/inline-editing-cell/inline-editing-cell.js +1 -2
- package/dist/esm/lib/components/metadata-table/table-body/table-body-with-data.js +1 -133
- package/dist/esm/lib/components/metadata-table/table-body/table-row/index.js +1 -2
- package/dist/esm/lib/components/metadata-table/table-body/table-row/table-row.js +1 -2
- package/dist/esm/lib/components/metadata-table/table-renderer.js +1 -37
- package/dist/esm/lib/components/metadata-value/index.js +1 -6
- package/dist/esm/lib/components/metadata-value/messages.js +1 -16
- package/dist/esm/lib/components/metadata-value/metadata-checkbox-field.js +1 -25
- package/dist/esm/lib/components/metadata-value/metadata-file-chip.js +1 -15
- package/dist/esm/lib/components/metadata-value/metadata-file-field.js +1 -13
- package/dist/esm/lib/components/metadata-value/metadata-location-field.js +1 -2
- package/dist/esm/lib/components/metadata-value/metadata-radio-field.js +1 -27
- package/dist/esm/lib/components/metadata-value/metadata-search-field.js +1 -20
- package/dist/esm/lib/components/pagination/index.js +1 -5
- package/dist/esm/lib/components/pagination/marker-based-pagination.js +1 -13
- package/dist/esm/lib/components/pagination/messages.js +1 -20
- package/dist/esm/lib/components/pagination/offset-based-pagination.js +1 -23
- package/dist/esm/lib/components/pagination/pagination-controls.js +1 -2
- package/dist/esm/lib/components/pagination/pagination.js +1 -21
- package/dist/esm/lib/components/pagination/utils.js +1 -5
- package/dist/esm/lib/components/sort-dropdown/index.js +1 -2
- package/dist/esm/lib/components/sort-dropdown/sort-dropdown.js +1 -39
- package/dist/esm/lib/components/switch-case/index.js +1 -2
- package/dist/esm/lib/components/switch-case/switch-case.js +1 -6
- package/dist/esm/lib/hooks/use-header.js +1 -45
- package/dist/esm/lib/index.js +1 -28
- package/dist/esm/lib/metadata-view.js +1 -2
- package/dist/styles/inline-editing-cell.css +1 -1
- package/package.json +17 -17
|
@@ -1,133 +1 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { THUMBNAIL_LIST_VIEW_HEIGHTS as t } from "../../constants.js";
|
|
3
|
-
import { GhostTableRow as n } from "./ghost-table-row/ghost-table-row.js";
|
|
4
|
-
import { ActionCellContent as r } from "./action-cell-content.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 { Cell as s, Row as c, TableBody as l, Text as u } from "@box/blueprint-web";
|
|
8
|
-
import d from "react";
|
|
9
|
-
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
10
|
-
import { ItemTypeIcon as m } from "@box/item-icon";
|
|
11
|
-
import h from "clsx";
|
|
12
|
-
import g from "lodash/get";
|
|
13
|
-
var _ = (e, t, n) => g(e, n ? t.split(".")[1] : t), v = /*#__PURE__*/ d.memo(({ column: t, iconColumnVariant: n, item: r }) => {
|
|
14
|
-
let { id: i, isItemMetadata: o, subtitle: c, textValue: l } = t, d = `${l}-${r.id}`;
|
|
15
|
-
return /* @__PURE__ */ f(s, { children: /* @__PURE__ */ p("div", {
|
|
16
|
-
className: a.tableNameCell,
|
|
17
|
-
children: [/* @__PURE__ */ f(m, {
|
|
18
|
-
className: a.tableNameCellIconInline,
|
|
19
|
-
item: r
|
|
20
|
-
}), /* @__PURE__ */ p("div", {
|
|
21
|
-
className: h(a.tableNameCellTitle, { [a.hasSubtitle]: n === e.INLINE_SUBTITLE }),
|
|
22
|
-
children: [/* @__PURE__ */ f(u, {
|
|
23
|
-
as: "span",
|
|
24
|
-
className: a.tableNameCellText,
|
|
25
|
-
children: _(r, i, o)
|
|
26
|
-
}), n === e.INLINE_SUBTITLE && /* @__PURE__ */ f(u, {
|
|
27
|
-
as: "span",
|
|
28
|
-
className: a.tableNameCellText,
|
|
29
|
-
color: "textOnLightSecondary",
|
|
30
|
-
children: c
|
|
31
|
-
})]
|
|
32
|
-
})]
|
|
33
|
-
}) }, d);
|
|
34
|
-
}), y = /*#__PURE__*/ d.memo(({ column: e, item: t }) => {
|
|
35
|
-
let n = `${e.textValue}-${t.id}`;
|
|
36
|
-
return /* @__PURE__ */ f(s, { children: e.cellRenderer?.(t, e) }, n);
|
|
37
|
-
}), b = /*#__PURE__*/ d.memo(({ column: e, item: t }) => {
|
|
38
|
-
let n = `${e.textValue}-${t.id}`, r = g(t, e.id);
|
|
39
|
-
return r ? /* @__PURE__ */ f(s, { children: r.join(" ") }, n) : /* @__PURE__ */ f(s, {}, n);
|
|
40
|
-
}), x = /*#__PURE__*/ d.memo(({ column: e, item: t }) => {
|
|
41
|
-
let { id: n, isItemMetadata: r, textValue: i } = e, a = `${i}-${t.id}`;
|
|
42
|
-
return /* @__PURE__ */ f(s, { children: /* @__PURE__ */ f(u, {
|
|
43
|
-
as: "span",
|
|
44
|
-
children: _(t, n, r)
|
|
45
|
-
}) }, a);
|
|
46
|
-
}), S = /*#__PURE__*/ d.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__ */ f(y, {
|
|
49
|
-
column: t,
|
|
50
|
-
item: r
|
|
51
|
-
}) : u ? /* @__PURE__ */ f(v, {
|
|
52
|
-
column: t,
|
|
53
|
-
iconColumnVariant: n,
|
|
54
|
-
item: r
|
|
55
|
-
}) : c && (l === "multiSelect" || l === "enum") ? /* @__PURE__ */ f(i, {
|
|
56
|
-
column: t,
|
|
57
|
-
item: r,
|
|
58
|
-
onInlineEditChange: a
|
|
59
|
-
}, `${t.id}-${r.id}`) : f(l === "multiSelect" ? b : x, {
|
|
60
|
-
column: t,
|
|
61
|
-
item: r
|
|
62
|
-
});
|
|
63
|
-
}), C = /*#__PURE__*/ d.memo(({ item: e, zoomLevel: n }) => /* @__PURE__ */ f(s, {
|
|
64
|
-
style: { height: t[n] },
|
|
65
|
-
children: /* @__PURE__ */ f(m, {
|
|
66
|
-
className: a.iconCell,
|
|
67
|
-
item: e
|
|
68
|
-
})
|
|
69
|
-
}, `item-type-icon-${e.id}`)), w = ({ areSelectionCheckboxesDisabled: t, columnCount: i, columns: s, dataTargetPrefix: u, iconColumnVariant: d, items: m, itemActionMenuProps: g, onInlineEditChange: _, onTableRowClick: v, renderActionCell: y, shouldRenderActionColumn: b, virtualItems: x, totalVirtualSize: w, zoomLevel: T }) => {
|
|
70
|
-
let E = d === e.COLUMN;
|
|
71
|
-
if (x) {
|
|
72
|
-
let e = (e) => /* @__PURE__ */ f(n, {
|
|
73
|
-
columnLength: i || 0,
|
|
74
|
-
rowKey: `ghost-${e}`
|
|
75
|
-
}), r = (e) => /* @__PURE__ */ f(o, {
|
|
76
|
-
areSelectionCheckboxesDisabled: t,
|
|
77
|
-
columns: s,
|
|
78
|
-
dataTargetPrefix: u,
|
|
79
|
-
iconColumnVariant: d,
|
|
80
|
-
item: e,
|
|
81
|
-
itemActionMenuProps: g,
|
|
82
|
-
onTableRowClick: v,
|
|
83
|
-
renderActionCell: y,
|
|
84
|
-
shouldRenderActionColumn: b,
|
|
85
|
-
zoomLevel: T
|
|
86
|
-
}), a = () => x[0]?.start || 0, h = () => {
|
|
87
|
-
let e = x[x.length - 1]?.end || 0;
|
|
88
|
-
return Math.max((w || 0) - e, 0);
|
|
89
|
-
}, _ = a(), S = h();
|
|
90
|
-
return /* @__PURE__ */ p(l, { children: [
|
|
91
|
-
!!_ && /* @__PURE__ */ f(c, {
|
|
92
|
-
isDisabled: !0,
|
|
93
|
-
style: { height: `${_}px` }
|
|
94
|
-
}),
|
|
95
|
-
x.map(({ index: t }) => t >= m.length ? e(t) : r(m[t])),
|
|
96
|
-
!!S && /* @__PURE__ */ f(c, {
|
|
97
|
-
isDisabled: !0,
|
|
98
|
-
style: { height: `${S}px` }
|
|
99
|
-
})
|
|
100
|
-
] });
|
|
101
|
-
}
|
|
102
|
-
return /* @__PURE__ */ f(l, {
|
|
103
|
-
items: m.map((e) => ({
|
|
104
|
-
key: e.id,
|
|
105
|
-
...e
|
|
106
|
-
})),
|
|
107
|
-
children: (e) => /* @__PURE__ */ p(c, {
|
|
108
|
-
className: h(a.tableRow, { [a.isClickable]: v }),
|
|
109
|
-
"data-target-id": u ? `${u}-itemRow-${e.id}` : void 0,
|
|
110
|
-
id: e.id,
|
|
111
|
-
onAction: () => v?.(e),
|
|
112
|
-
children: [
|
|
113
|
-
E && /* @__PURE__ */ f(C, {
|
|
114
|
-
item: e,
|
|
115
|
-
zoomLevel: T
|
|
116
|
-
}),
|
|
117
|
-
s.map((t) => /* @__PURE__ */ f(S, {
|
|
118
|
-
column: t,
|
|
119
|
-
iconColumnVariant: d,
|
|
120
|
-
item: e,
|
|
121
|
-
onInlineEditChange: _
|
|
122
|
-
}, `${t.textValue}-${e.id}`)),
|
|
123
|
-
b && /* @__PURE__ */ f(r, {
|
|
124
|
-
isCheckboxDisabled: t,
|
|
125
|
-
item: e,
|
|
126
|
-
itemActionMenuProps: g,
|
|
127
|
-
renderActionCell: y
|
|
128
|
-
})
|
|
129
|
-
]
|
|
130
|
-
}, e.id)
|
|
131
|
-
});
|
|
132
|
-
};
|
|
133
|
-
export { w as default };
|
|
1
|
+
import{t as IconColumnVariant}from"../../../../../chunks/types.js";import{THUMBNAIL_LIST_VIEW_HEIGHTS}from"../../constants.js";import{GhostTableRow}from"./ghost-table-row/ghost-table-row.js";import{ActionCellContent}from"./action-cell-content.js";import{t as InlineEditingCell}from"../../../../../chunks/inline-editing-cell.js";import{n as metadata_table_module_default,t as TableRow}from"../../../../../chunks/table-row.js";import{Cell,Row,TableBody,Text}from"@box/blueprint-web";import React from"react";import{jsx,jsxs}from"react/jsx-runtime";import{ItemTypeIcon}from"@box/item-icon";import clsx from"clsx";import get from"lodash/get";var getItemMetadataField=(item,columnId,isItemMetadata)=>get(item,isItemMetadata?columnId.split(`.`)[1]:columnId),NameCellWithIcon=React.memo(({column,iconColumnVariant,item})=>{let{id:columnId,isItemMetadata,subtitle,textValue}=column,key=`${textValue}-${item.id}`;return jsx(Cell,{children:jsxs(`div`,{className:metadata_table_module_default.tableNameCell,children:[jsx(ItemTypeIcon,{className:metadata_table_module_default.tableNameCellIconInline,item}),jsxs(`div`,{className:clsx(metadata_table_module_default.tableNameCellTitle,{[metadata_table_module_default.hasSubtitle]:iconColumnVariant===IconColumnVariant.INLINE_SUBTITLE}),children:[jsx(Text,{as:`span`,className:metadata_table_module_default.tableNameCellText,children:getItemMetadataField(item,columnId,isItemMetadata)}),iconColumnVariant===IconColumnVariant.INLINE_SUBTITLE&&jsx(Text,{as:`span`,className:metadata_table_module_default.tableNameCellText,color:`textOnLightSecondary`,children:subtitle})]})]})},key)}),CustomCell=React.memo(({column,item})=>{let key=`${column.textValue}-${item.id}`;return jsx(Cell,{children:column.cellRenderer?.(item,column)},key)}),MultiSelectCell=React.memo(({column,item})=>{let key=`${column.textValue}-${item.id}`,options=get(item,column.id);return options?jsx(Cell,{children:options.join(` `)},key):jsx(Cell,{},key)}),DefaultCell=React.memo(({column,item})=>{let{id:columnId,isItemMetadata,textValue}=column,key=`${textValue}-${item.id}`;return jsx(Cell,{children:jsx(Text,{as:`span`,children:getItemMetadataField(item,columnId,isItemMetadata)})},key)}),DataCell=React.memo(({column,iconColumnVariant,item,onInlineEditChange})=>{let{cellRenderer,id:columnId,isInlineEditingEnabled,type}=column,isNameColumnWithInlineIcon=columnId===`item.name`&&(iconColumnVariant===IconColumnVariant.INLINE||iconColumnVariant===IconColumnVariant.INLINE_SUBTITLE);return cellRenderer?jsx(CustomCell,{column,item}):isNameColumnWithInlineIcon?jsx(NameCellWithIcon,{column,iconColumnVariant,item}):isInlineEditingEnabled&&(type===`multiSelect`||type===`enum`)?jsx(InlineEditingCell,{column,item,onInlineEditChange},`${column.id}-${item.id}`):jsx(type===`multiSelect`?MultiSelectCell:DefaultCell,{column,item})}),IconColumn=React.memo(({item,zoomLevel})=>jsx(Cell,{style:{height:THUMBNAIL_LIST_VIEW_HEIGHTS[zoomLevel]},children:jsx(ItemTypeIcon,{className:metadata_table_module_default.iconCell,item})},`item-type-icon-${item.id}`)),TableBodyWithData=({areSelectionCheckboxesDisabled,columnCount,columns,dataTargetPrefix,iconColumnVariant,items,itemActionMenuProps,onInlineEditChange,onTableRowClick,renderActionCell,shouldRenderActionColumn,virtualItems,totalVirtualSize,zoomLevel})=>{let shouldShowIconColumn=iconColumnVariant===IconColumnVariant.COLUMN;if(virtualItems){let renderGhostRow=index=>jsx(GhostTableRow,{columnLength:columnCount||0,rowKey:`ghost-${index}`}),renderRow=item=>jsx(TableRow,{areSelectionCheckboxesDisabled,columns,dataTargetPrefix,iconColumnVariant,item,itemActionMenuProps,onTableRowClick,renderActionCell,shouldRenderActionColumn,zoomLevel}),getTopContentOffset=()=>virtualItems[0]?.start||0,getBottomContentOffset=()=>{let lastEnd=virtualItems[virtualItems.length-1]?.end||0;return Math.max((totalVirtualSize||0)-lastEnd,0)},topOffset=getTopContentOffset(),bottomOffset=getBottomContentOffset();return jsxs(TableBody,{children:[!!topOffset&&jsx(Row,{isDisabled:!0,style:{height:`${topOffset}px`}}),virtualItems.map(({index})=>index>=items.length?renderGhostRow(index):renderRow(items[index])),!!bottomOffset&&jsx(Row,{isDisabled:!0,style:{height:`${bottomOffset}px`}})]})}return jsx(TableBody,{items:items.map(item=>({key:item.id,...item})),children:item=>jsxs(Row,{className:clsx(metadata_table_module_default.tableRow,{[metadata_table_module_default.isClickable]:onTableRowClick}),"data-target-id":dataTargetPrefix?`${dataTargetPrefix}-itemRow-${item.id}`:void 0,id:item.id,onAction:()=>onTableRowClick?.(item),children:[shouldShowIconColumn&&jsx(IconColumn,{item,zoomLevel}),columns.map(column=>jsx(DataCell,{column,iconColumnVariant,item,onInlineEditChange},`${column.textValue}-${item.id}`)),shouldRenderActionColumn&&jsx(ActionCellContent,{isCheckboxDisabled:areSelectionCheckboxesDisabled,item,itemActionMenuProps,renderActionCell})]},item.id)})};export{TableBodyWithData as default};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { e as TableRow };
|
|
1
|
+
import{t as TableRow}from"../../../../../../chunks/table-row.js";export{TableRow};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { e as TableRow };
|
|
1
|
+
import{t as TableRow}from"../../../../../../chunks/table-row.js";export{TableRow};
|
|
@@ -1,37 +1 @@
|
|
|
1
|
-
import
|
|
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, dataTargetPrefix: u, formatMessage: d, iconColumnVariant: f, isLoading: p, areSelectionCheckboxesDisabled: m, itemActionMenuProps: h, items: g, onInlineEditChange: _, onTableRowClick: v, renderActionCell: y, style: b, tableHeader: x, tableProps: S, virtualItems: C, totalVirtualSize: w, zoomLevel: T }) => {
|
|
9
|
-
let E = i(S, !!y), D = c || (() => {
|
|
10
|
-
let t = l.length;
|
|
11
|
-
return f === e.COLUMN && (t += 1), E && (t += 1), t;
|
|
12
|
-
})(), O = p && !C?.length;
|
|
13
|
-
return /* @__PURE__ */ s(a, {
|
|
14
|
-
"aria-label": d(n.listView),
|
|
15
|
-
selectionBehavior: "toggle",
|
|
16
|
-
style: b,
|
|
17
|
-
...S,
|
|
18
|
-
children: [x, O ? /* @__PURE__ */ o(t, { columnLength: D }) : /* @__PURE__ */ o(r, {
|
|
19
|
-
areSelectionCheckboxesDisabled: m,
|
|
20
|
-
columnCount: D,
|
|
21
|
-
columns: l,
|
|
22
|
-
dataTargetPrefix: u,
|
|
23
|
-
iconColumnVariant: f,
|
|
24
|
-
isLoading: p,
|
|
25
|
-
itemActionMenuProps: h,
|
|
26
|
-
items: g,
|
|
27
|
-
onInlineEditChange: _,
|
|
28
|
-
onTableRowClick: v,
|
|
29
|
-
renderActionCell: y,
|
|
30
|
-
shouldRenderActionColumn: E,
|
|
31
|
-
totalVirtualSize: w,
|
|
32
|
-
virtualItems: C,
|
|
33
|
-
zoomLevel: T
|
|
34
|
-
})]
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
export { c as TableRenderer };
|
|
1
|
+
import{t as IconColumnVariant}from"../../../../chunks/types.js";import{GhostTableBody}from"./table-body/ghost-table-body.js";import messages from"./messages.js";import TableBodyWithData from"./table-body/table-body-with-data.js";import{getShouldRenderActionColumn}from"./actionColumn.js";import{Table}from"@box/blueprint-web";import{jsx,jsxs}from"react/jsx-runtime";var TableRenderer=({columnCount:passedColumnCount,columns,dataTargetPrefix,formatMessage,iconColumnVariant,isLoading,areSelectionCheckboxesDisabled,itemActionMenuProps,items,onInlineEditChange,onTableRowClick,renderActionCell,style,tableHeader,tableProps,virtualItems,totalVirtualSize,zoomLevel})=>{let shouldRenderActionColumn=getShouldRenderActionColumn(tableProps,!!renderActionCell),columnCount=passedColumnCount||(()=>{let columnCount=columns.length;return iconColumnVariant===IconColumnVariant.COLUMN&&(columnCount+=1),shouldRenderActionColumn&&(columnCount+=1),columnCount})(),isGhostTableVisible=isLoading&&!virtualItems?.length;return jsxs(Table,{"aria-label":formatMessage(messages.listView),selectionBehavior:`toggle`,style,...tableProps,children:[tableHeader,isGhostTableVisible?jsx(GhostTableBody,{columnLength:columnCount}):jsx(TableBodyWithData,{areSelectionCheckboxesDisabled,columnCount,columns,dataTargetPrefix,iconColumnVariant,isLoading,itemActionMenuProps,items,onInlineEditChange,onTableRowClick,renderActionCell,shouldRenderActionColumn,totalVirtualSize,virtualItems,zoomLevel})]})};export{TableRenderer};
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
import
|
|
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
|
+
import{MetadataFileField}from"./metadata-file-field.js";import{t as MetadataLocationField}from"../../../../chunks/metadata-location-field.js";import{MetadataRadioField}from"./metadata-radio-field.js";import{MetadataSearchField}from"./metadata-search-field.js";import{MetadataFileChip}from"./metadata-file-chip.js";export{MetadataFileChip,MetadataFileField,MetadataLocationField,MetadataRadioField,MetadataSearchField};
|
|
@@ -1,16 +1 @@
|
|
|
1
|
-
import
|
|
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
|
-
});
|
|
16
|
-
export { t as default };
|
|
1
|
+
import{defineMessages}from"react-intl";var messages=defineMessages({searchInputAriaLabel:{id:`groupSharedFeatures.metadataView.metadataValue.metadataSearch.searchInputAriaLabel`,defaultMessage:`Search`},searchInputClearAriaLabel:{id:`groupSharedFeatures.metadataView.metadataValue.metadataSearch.searchInputClearAriaLabel`,defaultMessage:`Clear`},selectFolderHint:{id:`groupSharedFeatures.metadataView.metadataValue.metadataLocation.locationTriggerHint`,defaultMessage:`Select a folder`}});export{messages as default};
|
|
@@ -1,25 +1 @@
|
|
|
1
|
-
import
|
|
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
|
-
});
|
|
24
|
-
};
|
|
25
|
-
export { r as MetadataCheckboxField };
|
|
1
|
+
import{Checkbox}from"@box/blueprint-web";import{useFormikContext}from"formik";import{jsx}from"react/jsx-runtime";var MetadataCheckboxField=({id,name})=>{let{values,setFieldValue}=useFormikContext(),fieldOptions=values.metadata.fields[id]?.options||[],selectedValues=values.metadata.fields[id]?.value?.enum||[],handleCheckedChange=(key,checked)=>{let valueSet=new Set(selectedValues);checked?valueSet.add(key):valueSet.delete(key),setFieldValue(`metadata.fields.${id}.value.enum`,Array.from(valueSet))};return jsx(Checkbox.Legend,{header:name,children:fieldOptions.map(({key})=>{let isChecked=selectedValues.includes(key);return jsx(Checkbox.Item,{checked:isChecked,"data-target-id":`CheckboxItem-filter_${id}_${key}`,label:key,onCheckedChange:checked=>{handleCheckedChange(key,checked===!0)},value:key},key)})})};export{MetadataCheckboxField};
|
|
@@ -1,15 +1 @@
|
|
|
1
|
-
import
|
|
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
|
-
});
|
|
14
|
-
};
|
|
15
|
-
export { r as MetadataFileChip };
|
|
1
|
+
import{useFormikContext}from"formik";import{BoxItemTypeSelectorQuickFilter}from"@box/box-item-type-selector";import{jsx}from"react/jsx-runtime";var MetadataFileChip=({id})=>{let{values,setFieldValue,submitForm}=useFormikContext(),fieldValue=values.metadata.fields[id]?.value?.enum;return jsx(BoxItemTypeSelectorQuickFilter,{allowAllOptionsSelect:!0,applyButtonType:`submit`,onApply:newSelection=>{setFieldValue(`metadata.fields.${id}.value.enum`,newSelection),submitForm()},selected:fieldValue||[]})};export{MetadataFileChip};
|
|
@@ -1,13 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { BoxItemTypeSelector 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 } = e(), o = i.metadata.fields[r]?.value?.enum;
|
|
6
|
-
return /* @__PURE__ */ n(t, {
|
|
7
|
-
onSelectionChange: (e) => {
|
|
8
|
-
a(`metadata.fields.${r}.value.enum`, e);
|
|
9
|
-
},
|
|
10
|
-
selected: o || []
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
export { r as MetadataFileField };
|
|
1
|
+
import{useFormikContext}from"formik";import{BoxItemTypeSelector}from"@box/box-item-type-selector";import{jsx}from"react/jsx-runtime";var MetadataFileField=({id})=>{let{values,setFieldValue}=useFormikContext(),fieldValue=values.metadata.fields[id]?.value?.enum;return jsx(BoxItemTypeSelector,{onSelectionChange:newSelection=>{setFieldValue(`metadata.fields.${id}.value.enum`,newSelection)},selected:fieldValue||[]})};export{MetadataFileField};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { e as MetadataLocationField };
|
|
1
|
+
import{t as MetadataLocationField}from"../../../../chunks/metadata-location-field.js";export{MetadataLocationField};
|
|
@@ -1,27 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useFormikContext as t } from "formik";
|
|
3
|
-
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
-
var i = ({ id: i, name: a, placeholder: o }) => {
|
|
5
|
-
let { values: s, setFieldValue: c } = t(), l = s.metadata.fields[i]?.value?.enum?.[0] || "", u = s.metadata.fields[i]?.options || [];
|
|
6
|
-
return /* @__PURE__ */ n(e.Legend, {
|
|
7
|
-
header: a,
|
|
8
|
-
children: /* @__PURE__ */ r(e.Group, {
|
|
9
|
-
loop: !0,
|
|
10
|
-
name: a,
|
|
11
|
-
onValueChange: (e) => {
|
|
12
|
-
c(`metadata.fields.${i}.value.enum[0]`, e);
|
|
13
|
-
},
|
|
14
|
-
value: l,
|
|
15
|
-
children: [o && /* @__PURE__ */ n(e.Item, {
|
|
16
|
-
"data-target-id": `RadioItem-filter_${i}_placeholder`,
|
|
17
|
-
label: o,
|
|
18
|
-
value: ""
|
|
19
|
-
}, o), u.map(({ key: t }) => /* @__PURE__ */ n(e.Item, {
|
|
20
|
-
"data-target-id": `RadioItem-filter_${i}_${t}`,
|
|
21
|
-
label: t,
|
|
22
|
-
value: t
|
|
23
|
-
}, t))]
|
|
24
|
-
})
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
export { i as MetadataRadioField };
|
|
1
|
+
import{Radio}from"@box/blueprint-web";import{useFormikContext}from"formik";import{jsx,jsxs}from"react/jsx-runtime";var MetadataRadioField=({id,name,placeholder})=>{let{values,setFieldValue}=useFormikContext(),fieldValue=values.metadata.fields[id]?.value?.enum?.[0]||``,fieldOptions=values.metadata.fields[id]?.options||[];return jsx(Radio.Legend,{header:name,children:jsxs(Radio.Group,{loop:!0,name,onValueChange:newSelection=>{setFieldValue(`metadata.fields.${id}.value.enum[0]`,newSelection)},value:fieldValue,children:[placeholder&&jsx(Radio.Item,{"data-target-id":`RadioItem-filter_${id}_placeholder`,label:placeholder,value:``},placeholder),fieldOptions.map(({key})=>jsx(Radio.Item,{"data-target-id":`RadioItem-filter_${id}_${key}`,label:key,value:key},key))]})})};export{MetadataRadioField};
|
|
@@ -1,20 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { SearchInput as t } from "@box/blueprint-web";
|
|
3
|
-
import { useIntl as n } from "react-intl";
|
|
4
|
-
import { useFormikContext as r } from "formik";
|
|
5
|
-
import { jsx as i } from "react/jsx-runtime";
|
|
6
|
-
var a = ({ id: a, name: o, placeholder: s }) => {
|
|
7
|
-
let { formatMessage: c } = n(), { values: l, setFieldValue: u } = r(), d = l.metadata.fields[a]?.value?.enum;
|
|
8
|
-
return /* @__PURE__ */ i(t.Controlled, {
|
|
9
|
-
"data-target-id": `SearchInputControlled-filter_${a}`,
|
|
10
|
-
id: a,
|
|
11
|
-
name: o,
|
|
12
|
-
onChange: (e) => u(`metadata.fields.${a}.value.enum[0]`, e.target.value),
|
|
13
|
-
onClearInput: () => u(`metadata.fields.${a}.value.enum`, []),
|
|
14
|
-
placeholder: s,
|
|
15
|
-
searchInputAriaLabel: c(e.searchInputAriaLabel),
|
|
16
|
-
searchInputClearAriaLabel: c(e.searchInputClearAriaLabel),
|
|
17
|
-
value: d?.[0] || ""
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
export { a as MetadataSearchField };
|
|
1
|
+
import messages from"./messages.js";import{SearchInput}from"@box/blueprint-web";import{useIntl}from"react-intl";import{useFormikContext}from"formik";import{jsx}from"react/jsx-runtime";var MetadataSearchField=({id,name,placeholder})=>{let{formatMessage}=useIntl(),{values,setFieldValue}=useFormikContext(),fieldValue=values.metadata.fields[id]?.value?.enum;return jsx(SearchInput.Controlled,{"data-target-id":`SearchInputControlled-filter_${id}`,id,name,onChange:e=>setFieldValue(`metadata.fields.${id}.value.enum[0]`,e.target.value),onClearInput:()=>setFieldValue(`metadata.fields.${id}.value.enum`,[]),placeholder,searchInputAriaLabel:formatMessage(messages.searchInputAriaLabel),searchInputClearAriaLabel:formatMessage(messages.searchInputClearAriaLabel),value:fieldValue?.[0]||``})};export{MetadataSearchField};
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { MarkerBasedPagination as t } from "./marker-based-pagination.js";
|
|
3
|
-
import { OffsetBasedPagination as n } from "./offset-based-pagination.js";
|
|
4
|
-
import { Pagination as r } from "./pagination.js";
|
|
5
|
-
export { t as MarkerBasedPagination, n as OffsetBasedPagination, r as Pagination, e as PaginationControls };
|
|
1
|
+
import{t as PaginationControls}from"../../../../chunks/pagination-controls.js";import{MarkerBasedPagination}from"./marker-based-pagination.js";import{OffsetBasedPagination}from"./offset-based-pagination.js";import{Pagination}from"./pagination.js";export{MarkerBasedPagination,OffsetBasedPagination,Pagination,PaginationControls};
|
|
@@ -1,13 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
-
var n = ({ hasNextMarker: n, hasPrevMarker: r, onMarkerBasedPageChange: i }) => /* @__PURE__ */ t(e, {
|
|
4
|
-
handleNextClick: () => {
|
|
5
|
-
i(1);
|
|
6
|
-
},
|
|
7
|
-
handlePreviousClick: () => {
|
|
8
|
-
i(-1);
|
|
9
|
-
},
|
|
10
|
-
hasNextPage: n,
|
|
11
|
-
hasPreviousPage: r
|
|
12
|
-
});
|
|
13
|
-
export { n as MarkerBasedPagination, n as default };
|
|
1
|
+
import{t as PaginationControls}from"../../../../chunks/pagination-controls.js";import{jsx}from"react/jsx-runtime";var MarkerBasedPagination=({hasNextMarker,hasPrevMarker,onMarkerBasedPageChange})=>jsx(PaginationControls,{handleNextClick:()=>{onMarkerBasedPageChange(1)},handlePreviousClick:()=>{onMarkerBasedPageChange(-1)},hasNextPage:hasNextMarker,hasPreviousPage:hasPrevMarker});export{MarkerBasedPagination,MarkerBasedPagination as default};
|
|
@@ -1,20 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
var t = e({
|
|
3
|
-
nextPageButton: {
|
|
4
|
-
id: "groupSharedFeatures.metadataView.pagination.nextPageButton",
|
|
5
|
-
defaultMessage: "Next"
|
|
6
|
-
},
|
|
7
|
-
pageEntryStatus: {
|
|
8
|
-
id: "groupSharedFeatures.metadataView.pagination.pageEntryStatus",
|
|
9
|
-
defaultMessage: "Showing {startEntryIndex} to {endEntryIndex} of {totalCount} entries"
|
|
10
|
-
},
|
|
11
|
-
paginationAriaLabel: {
|
|
12
|
-
id: "groupSharedFeatures.metadataView.pagination.paginationLabel",
|
|
13
|
-
defaultMessage: "Pagination navigation controls and current page information"
|
|
14
|
-
},
|
|
15
|
-
previousPageButton: {
|
|
16
|
-
id: "groupSharedFeatures.metadataView.pagination.previousPageButton",
|
|
17
|
-
defaultMessage: "Previous"
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
export { t as default };
|
|
1
|
+
import{defineMessages}from"react-intl";var messages=defineMessages({nextPageButton:{id:`groupSharedFeatures.metadataView.pagination.nextPageButton`,defaultMessage:`Next`},pageEntryStatus:{id:`groupSharedFeatures.metadataView.pagination.pageEntryStatus`,defaultMessage:`Showing {startEntryIndex} to {endEntryIndex} of {totalCount} entries`},paginationAriaLabel:{id:`groupSharedFeatures.metadataView.pagination.paginationLabel`,defaultMessage:`Pagination navigation controls and current page information`},previousPageButton:{id:`groupSharedFeatures.metadataView.pagination.previousPageButton`,defaultMessage:`Previous`}});export{messages as default};
|
|
@@ -1,23 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { getOffsetForPage as t } from "./utils.js";
|
|
3
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
-
var r = ({ offset: r, onOffsetChange: i, pageSize: a, totalCount: o }) => {
|
|
5
|
-
let s = Math.ceil(o / a);
|
|
6
|
-
if (s <= 1) return null;
|
|
7
|
-
let c = Math.floor(r / a) + 1, l = c > 0 ? Math.min(s, c) : 1;
|
|
8
|
-
return /* @__PURE__ */ n(e, {
|
|
9
|
-
handleNextClick: () => {
|
|
10
|
-
i(t(l + 1, a, o));
|
|
11
|
-
},
|
|
12
|
-
handlePreviousClick: () => {
|
|
13
|
-
i(t(l - 1, a, o));
|
|
14
|
-
},
|
|
15
|
-
hasNextPage: l < s,
|
|
16
|
-
hasPageEntryStatus: !0,
|
|
17
|
-
hasPreviousPage: l > 1,
|
|
18
|
-
offset: r,
|
|
19
|
-
pageSize: a,
|
|
20
|
-
totalCount: o
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
export { r as OffsetBasedPagination, r as default };
|
|
1
|
+
import{t as PaginationControls}from"../../../../chunks/pagination-controls.js";import{getOffsetForPage}from"./utils.js";import{jsx}from"react/jsx-runtime";var OffsetBasedPagination=({offset,onOffsetChange,pageSize,totalCount})=>{let pageCount=Math.ceil(totalCount/pageSize);if(pageCount<=1)return null;let pageByOffset=Math.floor(offset/pageSize)+1,pageNumber=pageByOffset>0?Math.min(pageCount,pageByOffset):1;return jsx(PaginationControls,{handleNextClick:()=>{onOffsetChange(getOffsetForPage(pageNumber+1,pageSize,totalCount))},handlePreviousClick:()=>{onOffsetChange(getOffsetForPage(pageNumber-1,pageSize,totalCount))},hasNextPage:pageNumber<pageCount,hasPageEntryStatus:!0,hasPreviousPage:pageNumber>1,offset,pageSize,totalCount})};export{OffsetBasedPagination,OffsetBasedPagination as default};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { e as PaginationControls };
|
|
1
|
+
import{t as PaginationControls}from"../../../../chunks/pagination-controls.js";export{PaginationControls};
|
|
@@ -1,21 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { OffsetBasedPagination as t } from "./offset-based-pagination.js";
|
|
3
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
-
var r = ({ type: r, ...i }) => {
|
|
5
|
-
if (r === "marker") {
|
|
6
|
-
let { hasNextMarker: t, hasPrevMarker: r, onMarkerBasedPageChange: a } = i;
|
|
7
|
-
return /* @__PURE__ */ n(e, {
|
|
8
|
-
hasNextMarker: t,
|
|
9
|
-
hasPrevMarker: r,
|
|
10
|
-
onMarkerBasedPageChange: a
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
let { offset: a, onOffsetChange: o, pageSize: s, totalCount: c } = i;
|
|
14
|
-
return /* @__PURE__ */ n(t, {
|
|
15
|
-
offset: a,
|
|
16
|
-
onOffsetChange: o,
|
|
17
|
-
pageSize: s,
|
|
18
|
-
totalCount: c
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
export { r as Pagination };
|
|
1
|
+
import{MarkerBasedPagination}from"./marker-based-pagination.js";import{OffsetBasedPagination}from"./offset-based-pagination.js";import{jsx}from"react/jsx-runtime";var Pagination=({type,...rest})=>{if(type===`marker`){let{hasNextMarker,hasPrevMarker,onMarkerBasedPageChange}=rest;return jsx(MarkerBasedPagination,{hasNextMarker,hasPrevMarker,onMarkerBasedPageChange})}let{offset,onOffsetChange,pageSize,totalCount}=rest;return jsx(OffsetBasedPagination,{offset,onOffsetChange,pageSize,totalCount})};export{Pagination};
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
var
|
|
2
|
-
let r = (e - 1) * t;
|
|
3
|
-
return r <= 0 ? 0 : r >= n ? Math.max(n - t, 0) : r;
|
|
4
|
-
};
|
|
5
|
-
export { e as getOffsetForPage };
|
|
1
|
+
var getOffsetForPage=(newPageNumber,pageSize,totalCount)=>{let newOffset=(newPageNumber-1)*pageSize;return newOffset<=0?0:newOffset>=totalCount?Math.max(totalCount-pageSize,0):newOffset};export{getOffsetForPage};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { e as SortDropdown };
|
|
1
|
+
import{SortDropdown}from"./sort-dropdown.js";export{SortDropdown};
|
|
@@ -1,39 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useState as n } from "react";
|
|
3
|
-
import { ArrowDown as r, ArrowUp as i } from "@box/blueprint-web-assets/icons/Fill";
|
|
4
|
-
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
-
var s = ({ onSortDescriptorChange: s, sortableColumns: c, sortDescriptor: l, initialSortByColumnId: u = c[0].id, initialSortDirection: d = "ascending", triggerButtonDataTargetId: f, onSortChange: p }) => {
|
|
6
|
-
let m = new Map(c.map((e) => [e.id, e.textValue])), [h, g] = n(u), [_, v] = n(d), y = l?.column == null ? h : String(l.column), b = l?.direction ?? _;
|
|
7
|
-
return /* @__PURE__ */ o(e.Root, { children: [/* @__PURE__ */ a(e.Trigger, { children: /* @__PURE__ */ a(t, {
|
|
8
|
-
caretDirection: b === "ascending" ? "up" : "down",
|
|
9
|
-
"data-target-id": f,
|
|
10
|
-
label: m.get(y),
|
|
11
|
-
startIcon: b === "ascending" ? i : r,
|
|
12
|
-
variant: "tertiary"
|
|
13
|
-
}) }), /* @__PURE__ */ a(e.Content, { children: /* @__PURE__ */ a(e.RadioGroup, {
|
|
14
|
-
onValueChange: (e) => {
|
|
15
|
-
if (e === y) {
|
|
16
|
-
let t = b === "ascending" ? "descending" : "ascending";
|
|
17
|
-
v(t), s({
|
|
18
|
-
column: e,
|
|
19
|
-
direction: t
|
|
20
|
-
}), p({
|
|
21
|
-
column: e,
|
|
22
|
-
direction: t
|
|
23
|
-
});
|
|
24
|
-
} else g(e), v("ascending"), s({
|
|
25
|
-
column: e,
|
|
26
|
-
direction: "ascending"
|
|
27
|
-
}), p({
|
|
28
|
-
column: e,
|
|
29
|
-
direction: "ascending"
|
|
30
|
-
});
|
|
31
|
-
},
|
|
32
|
-
value: y,
|
|
33
|
-
children: c.map(({ id: t, textValue: n }) => /* @__PURE__ */ a(e.RadioSelectItem, {
|
|
34
|
-
value: t,
|
|
35
|
-
children: n
|
|
36
|
-
}, t))
|
|
37
|
-
}) })] });
|
|
38
|
-
};
|
|
39
|
-
export { s as SortDropdown };
|
|
1
|
+
import{DropdownMenu,TriggerButton}from"@box/blueprint-web";import{useState}from"react";import{ArrowDown,ArrowUp}from"@box/blueprint-web-assets/icons/Fill";import{jsx,jsxs}from"react/jsx-runtime";var SortDropdown=({onSortDescriptorChange,sortableColumns,sortDescriptor,initialSortByColumnId=sortableColumns[0].id,initialSortDirection=`ascending`,triggerButtonDataTargetId,onSortChange})=>{let columnMap=new Map(sortableColumns.map(item=>[item.id,item.textValue])),[columnId,setColumnId]=useState(initialSortByColumnId),[direction,setDirection]=useState(initialSortDirection),currentColumnId=sortDescriptor?.column==null?columnId:String(sortDescriptor.column),currentDirection=sortDescriptor?.direction??direction;return jsxs(DropdownMenu.Root,{children:[jsx(DropdownMenu.Trigger,{children:jsx(TriggerButton,{caretDirection:currentDirection===`ascending`?`up`:`down`,"data-target-id":triggerButtonDataTargetId,label:columnMap.get(currentColumnId),startIcon:currentDirection===`ascending`?ArrowUp:ArrowDown,variant:`tertiary`})}),jsx(DropdownMenu.Content,{children:jsx(DropdownMenu.RadioGroup,{onValueChange:selectedColumnId=>{if(selectedColumnId===currentColumnId){let newDirection=currentDirection===`ascending`?`descending`:`ascending`;setDirection(newDirection),onSortDescriptorChange({column:selectedColumnId,direction:newDirection}),onSortChange({column:selectedColumnId,direction:newDirection})}else setColumnId(selectedColumnId),setDirection(`ascending`),onSortDescriptorChange({column:selectedColumnId,direction:`ascending`}),onSortChange({column:selectedColumnId,direction:`ascending`})},value:currentColumnId,children:sortableColumns.map(({id,textValue})=>jsx(DropdownMenu.RadioSelectItem,{value:id,children:textValue},id))})})]})};export{SortDropdown};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { e as Case, t as SwitchCase };
|
|
1
|
+
import{Case,SwitchCase}from"./switch-case.js";export{Case,SwitchCase};
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
var t = ({ condition: e, children: t }) => e ? t : null, n = ({ children: t }) => {
|
|
3
|
-
let n = e.Children.toArray(t).find((e) => e.props.condition);
|
|
4
|
-
return n ? n.props.children : null;
|
|
5
|
-
};
|
|
6
|
-
export { t as Case, n as SwitchCase };
|
|
1
|
+
import React from"react";var Case=({condition,children})=>condition?children:null,SwitchCase=({children})=>{let match=React.Children.toArray(children).find(child=>child.props.condition);return match?match.props.children:null};export{Case,SwitchCase};
|
|
@@ -1,45 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useCallback as e, useEffect as t, useMemo as n, useState as r } from "react";
|
|
3
|
-
function i({ headerProps: i, items: a, selectedKeys: o, isSelectionEnabled: s, onSelectionChange: c }) {
|
|
4
|
-
let [l, u] = r(0), [d, f] = r(void 0), [p, m] = r(0), h = i?.itemCount ?? a.length;
|
|
5
|
-
t(() => {
|
|
6
|
-
if (o) {
|
|
7
|
-
let e = o === "all" ? h : [...o].length;
|
|
8
|
-
u(e), e === 1 && f(String([...o][0]));
|
|
9
|
-
}
|
|
10
|
-
}, [o, h]);
|
|
11
|
-
let g = e((e) => {
|
|
12
|
-
if (!o) {
|
|
13
|
-
let t = e === "all" ? h : e.size;
|
|
14
|
-
u(t), t === 1 && e !== "all" && f(e.values().next().value);
|
|
15
|
-
}
|
|
16
|
-
c?.(e);
|
|
17
|
-
}, [
|
|
18
|
-
c,
|
|
19
|
-
o,
|
|
20
|
-
h
|
|
21
|
-
]), _ = i?.onClearSelection, v = e(() => {
|
|
22
|
-
_?.(), c?.(/* @__PURE__ */ new Set()), o || (u(0), m((e) => e + 1));
|
|
23
|
-
}, [
|
|
24
|
-
_,
|
|
25
|
-
c,
|
|
26
|
-
o
|
|
27
|
-
]), y = s ? l : 0;
|
|
28
|
-
return {
|
|
29
|
-
headerSelectionProps: {
|
|
30
|
-
onClearSelection: v,
|
|
31
|
-
selectionCount: y,
|
|
32
|
-
selectedItemName: n(() => {
|
|
33
|
-
if (y === 1 && d) return a.find((e) => e.id === d)?.name ?? i?.selectedItemName;
|
|
34
|
-
}, [
|
|
35
|
-
y,
|
|
36
|
-
d,
|
|
37
|
-
a,
|
|
38
|
-
i?.selectedItemName
|
|
39
|
-
])
|
|
40
|
-
},
|
|
41
|
-
handleSelectionChange: g,
|
|
42
|
-
selectionResetKey: p
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
export { i as useHeader };
|
|
1
|
+
import"../../../chunks/types.js";import{useCallback,useEffect,useMemo,useState}from"react";function useHeader({headerProps,items,selectedKeys,isSelectionEnabled,onSelectionChange}){let[selectionCount,setSelectionCount]=useState(0),[singleSelectedId,setSingleSelectedId]=useState(void 0),[selectionResetKey,setSelectionResetKey]=useState(0),totalItemCount=headerProps?.itemCount??items.length;useEffect(()=>{if(selectedKeys){let count=selectedKeys===`all`?totalItemCount:[...selectedKeys].length;setSelectionCount(count),count===1&&setSingleSelectedId(String([...selectedKeys][0]))}},[selectedKeys,totalItemCount]);let handleSelectionChange=useCallback(keys=>{if(!selectedKeys){let count=keys===`all`?totalItemCount:keys.size;setSelectionCount(count),count===1&&keys!==`all`&&setSingleSelectedId(keys.values().next().value)}onSelectionChange?.(keys)},[onSelectionChange,selectedKeys,totalItemCount]),onClearSelection=headerProps?.onClearSelection,handleClearSelection=useCallback(()=>{onClearSelection?.(),onSelectionChange?.(new Set),selectedKeys||(setSelectionCount(0),setSelectionResetKey(prev=>prev+1))},[onClearSelection,onSelectionChange,selectedKeys]),effectiveSelectionCount=isSelectionEnabled?selectionCount:0;return{headerSelectionProps:{onClearSelection:handleClearSelection,selectionCount:effectiveSelectionCount,selectedItemName:useMemo(()=>{if(effectiveSelectionCount===1&&singleSelectedId)return items.find(item=>item.id===singleSelectedId)?.name??headerProps?.selectedItemName},[effectiveSelectionCount,singleSelectedId,items,headerProps?.selectedItemName])},handleSelectionChange,selectionResetKey}}export{useHeader};
|
package/dist/esm/lib/index.js
CHANGED
|
@@ -1,28 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { MetadataFileField as r } from "./components/metadata-value/metadata-file-field.js";
|
|
3
|
-
import { t as i } from "../../chunks/metadata-location-field.js";
|
|
4
|
-
import { MetadataRadioField as a } from "./components/metadata-value/metadata-radio-field.js";
|
|
5
|
-
import { MetadataSearchField as o } from "./components/metadata-value/metadata-search-field.js";
|
|
6
|
-
import { Filter as s } from "./components/filter-sidepanel/filter.js";
|
|
7
|
-
import { t as c } from "../../chunks/filter-side-panel.js";
|
|
8
|
-
import { MetadataFileChip as l } from "./components/metadata-value/metadata-file-chip.js";
|
|
9
|
-
import { FormFilterChip as u } from "./components/filter-row/form-filter-chip.js";
|
|
10
|
-
import { SelectFilterChip as d } from "./components/filter-row/select-filter-chip.js";
|
|
11
|
-
import { MetadataFilterChip as f } from "./components/filter-row/metadata-filter-chip.js";
|
|
12
|
-
import { t as p } from "../../chunks/types2.js";
|
|
13
|
-
import { FilterRow as m } from "./components/filter-row/filter-row.js";
|
|
14
|
-
import { SortDropdown as h } from "./components/sort-dropdown/sort-dropdown.js";
|
|
15
|
-
import { t as g } from "../../chunks/action-bar.js";
|
|
16
|
-
import { t as _ } from "../../chunks/item-action-menu.js";
|
|
17
|
-
import { t as v } from "../../chunks/metadata-grid.js";
|
|
18
|
-
import { t as y } from "../../chunks/inline-editing-cell.js";
|
|
19
|
-
import { TableRenderer as b } from "./components/metadata-table/table-renderer.js";
|
|
20
|
-
import { MetadataTable as x } from "./components/metadata-table/metadata-table.js";
|
|
21
|
-
import { t as S } from "../../chunks/pagination-controls.js";
|
|
22
|
-
import { MarkerBasedPagination as C } from "./components/pagination/marker-based-pagination.js";
|
|
23
|
-
import { OffsetBasedPagination as w } from "./components/pagination/offset-based-pagination.js";
|
|
24
|
-
import { Pagination as T } from "./components/pagination/pagination.js";
|
|
25
|
-
import { Case as E, SwitchCase as D } from "./components/switch-case/switch-case.js";
|
|
26
|
-
import { t as O } from "../../chunks/header.js";
|
|
27
|
-
import { t as k } from "../../chunks/metadata-view.js";
|
|
28
|
-
export { g as ActionBar, E as Case, s as Filter, m as FilterRow, c as FilterSidePanel, u as FormFilterChip, O as Header, n as IconColumnVariant, y as InlineEditingCell, _ as ItemActionMenu, C as MarkerBasedPagination, l as MetadataFileChip, r as MetadataFileField, f as MetadataFilterChip, v as MetadataGrid, i as MetadataLocationField, a as MetadataRadioField, o as MetadataSearchField, x as MetadataTable, k as MetadataView, w as OffsetBasedPagination, T as Pagination, S as PaginationControls, p as PredefinedFilterName, e as SELECT_ALL, d as SelectFilterChip, h as SortDropdown, D as SwitchCase, b as TableRenderer, t as ViewMode };
|
|
1
|
+
import{n as SELECT_ALL,r as ViewMode,t as IconColumnVariant}from"../../chunks/types.js";import{MetadataFileField}from"./components/metadata-value/metadata-file-field.js";import{t as MetadataLocationField}from"../../chunks/metadata-location-field.js";import{MetadataRadioField}from"./components/metadata-value/metadata-radio-field.js";import{MetadataSearchField}from"./components/metadata-value/metadata-search-field.js";import{Filter}from"./components/filter-sidepanel/filter.js";import{t as FilterSidePanel}from"../../chunks/filter-side-panel.js";import{MetadataFileChip}from"./components/metadata-value/metadata-file-chip.js";import{FormFilterChip}from"./components/filter-row/form-filter-chip.js";import{SelectFilterChip}from"./components/filter-row/select-filter-chip.js";import{MetadataFilterChip}from"./components/filter-row/metadata-filter-chip.js";import{t as PredefinedFilterName}from"../../chunks/types2.js";import{FilterRow}from"./components/filter-row/filter-row.js";import{SortDropdown}from"./components/sort-dropdown/sort-dropdown.js";import{t as ActionBar}from"../../chunks/action-bar.js";import{t as ItemActionMenu}from"../../chunks/item-action-menu.js";import{t as MetadataGrid}from"../../chunks/metadata-grid.js";import{t as InlineEditingCell}from"../../chunks/inline-editing-cell.js";import{TableRenderer}from"./components/metadata-table/table-renderer.js";import{MetadataTable}from"./components/metadata-table/metadata-table.js";import{t as PaginationControls}from"../../chunks/pagination-controls.js";import{MarkerBasedPagination}from"./components/pagination/marker-based-pagination.js";import{OffsetBasedPagination}from"./components/pagination/offset-based-pagination.js";import{Pagination}from"./components/pagination/pagination.js";import{Case,SwitchCase}from"./components/switch-case/switch-case.js";import{t as Header}from"../../chunks/header.js";import{t as MetadataView}from"../../chunks/metadata-view.js";export{ActionBar,Case,Filter,FilterRow,FilterSidePanel,FormFilterChip,Header,IconColumnVariant,InlineEditingCell,ItemActionMenu,MarkerBasedPagination,MetadataFileChip,MetadataFileField,MetadataFilterChip,MetadataGrid,MetadataLocationField,MetadataRadioField,MetadataSearchField,MetadataTable,MetadataView,OffsetBasedPagination,Pagination,PaginationControls,PredefinedFilterName,SELECT_ALL,SelectFilterChip,SortDropdown,SwitchCase,TableRenderer,ViewMode};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { e as MetadataView, e as default };
|
|
1
|
+
import{t as MetadataView}from"../../chunks/metadata-view.js";export{MetadataView,MetadataView as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._inlineEditingCell_sj84k_1._inlineEditingCell_sj84k_1,._inlineEditingCell_sj84k_1._inlineEditingCell_sj84k_1:focus-visible,._inlineEditingCell_sj84k_1._inlineEditingCell_sj84k_1:hover{color:var(--bp-text-text-on-light)}
|