@box/metadata-view 2.2.37 → 2.2.39
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/package.json +17 -17
|
@@ -1,52 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { FilterRow as t } from "../esm/lib/components/filter-row/filter-row.js";
|
|
3
|
-
import { SortDropdown as n } from "../esm/lib/components/sort-dropdown/sort-dropdown.js";
|
|
4
|
-
import { t as r } from "./zoom-button.js";
|
|
5
|
-
import i from "../esm/lib/components/action-bar/messages.js";
|
|
6
|
-
import { Button as a } from "@box/blueprint-web";
|
|
7
|
-
import { Grid as o } from "@box/blueprint-web-assets/icons/Fill";
|
|
8
|
-
import { useIntl as s } from "react-intl";
|
|
9
|
-
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
10
|
-
import '../styles/action-bar.css';var u = {
|
|
11
|
-
actionBar: "_actionBar_bbxsv_1",
|
|
12
|
-
filterRow: "_filterRow_bbxsv_8",
|
|
13
|
-
additionalActions: "_additionalActions_bbxsv_13",
|
|
14
|
-
viewModeButtonContainer: "_viewModeButtonContainer_bbxsv_24"
|
|
15
|
-
}, d = ({ dataTargetPrefix: d, isIconColumnEnabled: f, isViewModeButtonDisabled: p, onSortDescriptorChange: m, onViewModeClick: h, onZoomLevelChange: g, sortableColumns: _, sortDescriptor: v, sortDropdownProps: y, viewMode: b, zoomLevel: x, ...S }) => {
|
|
16
|
-
let { formatMessage: C } = s(), w = y?.triggerButtonDataTargetId ?? (d ? `${d}-sortButton` : void 0);
|
|
17
|
-
return /* @__PURE__ */ l("div", {
|
|
18
|
-
className: u.actionBar,
|
|
19
|
-
children: [/* @__PURE__ */ c("div", {
|
|
20
|
-
className: u.filterRow,
|
|
21
|
-
children: /* @__PURE__ */ c(t, {
|
|
22
|
-
...S,
|
|
23
|
-
dataTargetPrefix: d
|
|
24
|
-
})
|
|
25
|
-
}), /* @__PURE__ */ l("div", {
|
|
26
|
-
className: u.additionalActions,
|
|
27
|
-
children: [
|
|
28
|
-
y && /* @__PURE__ */ c(n, {
|
|
29
|
-
...y,
|
|
30
|
-
onSortDescriptorChange: m,
|
|
31
|
-
sortableColumns: _,
|
|
32
|
-
sortDescriptor: v,
|
|
33
|
-
triggerButtonDataTargetId: w
|
|
34
|
-
}),
|
|
35
|
-
(f || b === e.GRID) && /* @__PURE__ */ c(r, {
|
|
36
|
-
onZoomLevelChange: g,
|
|
37
|
-
zoomLevel: x
|
|
38
|
-
}),
|
|
39
|
-
!p && /* @__PURE__ */ c("div", {
|
|
40
|
-
className: u.viewModeButtonContainer,
|
|
41
|
-
children: /* @__PURE__ */ c(a, {
|
|
42
|
-
"aria-label": b === e.GRID ? C(i.switchToListView) : C(i.switchToGridView),
|
|
43
|
-
endIcon: o,
|
|
44
|
-
onClick: h,
|
|
45
|
-
variant: b === e.GRID ? "primary" : "tertiary"
|
|
46
|
-
})
|
|
47
|
-
})
|
|
48
|
-
]
|
|
49
|
-
})]
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
export { d as t };
|
|
1
|
+
import{r as ViewMode}from"./types.js";import{FilterRow}from"../esm/lib/components/filter-row/filter-row.js";import{SortDropdown}from"../esm/lib/components/sort-dropdown/sort-dropdown.js";import{t as ZoomButton}from"./zoom-button.js";import messages from"../esm/lib/components/action-bar/messages.js";import{Button}from"@box/blueprint-web";import{Grid}from"@box/blueprint-web-assets/icons/Fill";import{useIntl}from"react-intl";import{jsx,jsxs}from"react/jsx-runtime";import '../styles/action-bar.css';var action_bar_module_default={actionBar:`_actionBar_bbxsv_1`,filterRow:`_filterRow_bbxsv_8`,additionalActions:`_additionalActions_bbxsv_13`,viewModeButtonContainer:`_viewModeButtonContainer_bbxsv_24`},ActionBar=({dataTargetPrefix,isIconColumnEnabled,isViewModeButtonDisabled,onSortDescriptorChange,onViewModeClick,onZoomLevelChange,sortableColumns,sortDescriptor,sortDropdownProps,viewMode,zoomLevel,...rest})=>{let{formatMessage}=useIntl(),sortTriggerDataTargetId=sortDropdownProps?.triggerButtonDataTargetId??(dataTargetPrefix?`${dataTargetPrefix}-sortButton`:void 0);return jsxs(`div`,{className:action_bar_module_default.actionBar,children:[jsx(`div`,{className:action_bar_module_default.filterRow,children:jsx(FilterRow,{...rest,dataTargetPrefix})}),jsxs(`div`,{className:action_bar_module_default.additionalActions,children:[sortDropdownProps&&jsx(SortDropdown,{...sortDropdownProps,onSortDescriptorChange,sortableColumns,sortDescriptor,triggerButtonDataTargetId:sortTriggerDataTargetId}),(isIconColumnEnabled||viewMode===ViewMode.GRID)&&jsx(ZoomButton,{onZoomLevelChange,zoomLevel}),!isViewModeButtonDisabled&&jsx(`div`,{className:action_bar_module_default.viewModeButtonContainer,children:jsx(Button,{"aria-label":viewMode===ViewMode.GRID?formatMessage(messages.switchToListView):formatMessage(messages.switchToGridView),endIcon:Grid,onClick:onViewModeClick,variant:viewMode===ViewMode.GRID?`primary`:`tertiary`})})]})]})};export{ActionBar as t};
|
|
@@ -1,24 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { EmptyState as t, Text as n } from "@box/blueprint-web";
|
|
3
|
-
import { useIntl as r } from "react-intl";
|
|
4
|
-
import { jsx as i } from "react/jsx-runtime";
|
|
5
|
-
import { OpenBook as a } from "@box/blueprint-web-assets/illustrations/Medium";
|
|
6
|
-
import '../styles/empty-state.css';var o = { emptyStateContainer: "_emptyStateContainer_10mhj_1" }, s = () => {
|
|
7
|
-
let { formatMessage: s } = r();
|
|
8
|
-
return /* @__PURE__ */ i("div", {
|
|
9
|
-
className: o.emptyStateContainer,
|
|
10
|
-
children: /* @__PURE__ */ i(t, {
|
|
11
|
-
body: /* @__PURE__ */ i(n, {
|
|
12
|
-
as: "p",
|
|
13
|
-
children: s(e.emptyStateBody)
|
|
14
|
-
}),
|
|
15
|
-
heading: /* @__PURE__ */ i(n, {
|
|
16
|
-
as: "h2",
|
|
17
|
-
variant: "titleMedium",
|
|
18
|
-
children: s(e.emptyStateHeading)
|
|
19
|
-
}),
|
|
20
|
-
illustration: a
|
|
21
|
-
})
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
export { s as t };
|
|
1
|
+
import messages from"../esm/lib/components/empty-state/messages.js";import{EmptyState,Text}from"@box/blueprint-web";import{useIntl}from"react-intl";import{jsx}from"react/jsx-runtime";import{OpenBook}from"@box/blueprint-web-assets/illustrations/Medium";import '../styles/empty-state.css';var empty_state_module_default={emptyStateContainer:`_emptyStateContainer_10mhj_1`},EmptyStateComponent=()=>{let{formatMessage}=useIntl();return jsx(`div`,{className:empty_state_module_default.emptyStateContainer,children:jsx(EmptyState,{body:jsx(Text,{as:`p`,children:formatMessage(messages.emptyStateBody)}),heading:jsx(Text,{as:`h2`,variant:`titleMedium`,children:formatMessage(messages.emptyStateHeading)}),illustration:OpenBook})})};export{EmptyStateComponent as t};
|
|
@@ -1,23 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { EmptyState as t, Text as n } from "@box/blueprint-web";
|
|
3
|
-
import { useIntl as r } from "react-intl";
|
|
4
|
-
import { jsx as i } from "react/jsx-runtime";
|
|
5
|
-
import { Unplugged as a } from "@box/blueprint-web-assets/illustrations/Medium";
|
|
6
|
-
import '../styles/error-state.css';var o = { emptyStateContainer: "_emptyStateContainer_qf21p_1" }, s = ({ onRefresh: s }) => {
|
|
7
|
-
let { formatMessage: c } = r();
|
|
8
|
-
return /* @__PURE__ */ i("div", {
|
|
9
|
-
className: o.emptyStateContainer,
|
|
10
|
-
children: /* @__PURE__ */ i(t, {
|
|
11
|
-
body: /* @__PURE__ */ i(n, {
|
|
12
|
-
as: "p",
|
|
13
|
-
children: c(e.errorMessage)
|
|
14
|
-
}),
|
|
15
|
-
illustration: a,
|
|
16
|
-
children: /* @__PURE__ */ i(t.PrimaryAction, {
|
|
17
|
-
onClick: s,
|
|
18
|
-
children: c(e.refreshButton)
|
|
19
|
-
})
|
|
20
|
-
})
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
export { s as t };
|
|
1
|
+
import messages from"../esm/lib/components/error-state/messages.js";import{EmptyState,Text}from"@box/blueprint-web";import{useIntl}from"react-intl";import{jsx}from"react/jsx-runtime";import{Unplugged}from"@box/blueprint-web-assets/illustrations/Medium";import '../styles/error-state.css';var error_state_module_default={emptyStateContainer:`_emptyStateContainer_qf21p_1`},ErrorState=({onRefresh})=>{let{formatMessage}=useIntl();return jsx(`div`,{className:error_state_module_default.emptyStateContainer,children:jsx(EmptyState,{body:jsx(Text,{as:`p`,children:formatMessage(messages.errorMessage)}),illustration:Unplugged,children:jsx(EmptyState.PrimaryAction,{onClick:onRefresh,children:formatMessage(messages.refreshButton)})})})};export{ErrorState as t};
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
import '../styles/filter-row.css';var
|
|
2
|
-
popoverFooter: "_popoverFooter_1q01l_1",
|
|
3
|
-
popoverContent: "_popoverContent_1q01l_9",
|
|
4
|
-
filterChipGroup: "_filterChipGroup_1q01l_13",
|
|
5
|
-
filterChipIcon: "_filterChipIcon_1q01l_18"
|
|
6
|
-
};
|
|
7
|
-
export { e as t };
|
|
1
|
+
import '../styles/filter-row.css';var filter_row_module_default={popoverFooter:`_popoverFooter_1q01l_1`,popoverContent:`_popoverContent_1q01l_9`,filterChipGroup:`_filterChipGroup_1q01l_13`,filterChipIcon:`_filterChipIcon_1q01l_18`};export{filter_row_module_default as t};
|
|
@@ -1,65 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import t from "../esm/lib/components/filter-sidepanel/messages.js";
|
|
3
|
-
import { Accordion as n, SidePanel as r } from "@box/blueprint-web";
|
|
4
|
-
import { useState as i } from "react";
|
|
5
|
-
import { useIntl as a } from "react-intl";
|
|
6
|
-
import { useFormikContext as o } from "formik";
|
|
7
|
-
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
8
|
-
import l from "lodash/noop";
|
|
9
|
-
import '../styles/filter-side-panel.css';var u = {
|
|
10
|
-
sidePanelContent: "_sidePanelContent_1j6pr_1",
|
|
11
|
-
staticPosition: "_staticPosition_1j6pr_1"
|
|
12
|
-
}, d = ({ containerRef: d, filterGroups: f, isOpen: p, onIsOpenChange: m = l, getInitialFormValues: h }) => {
|
|
13
|
-
let { formatMessage: g } = a(), { handleSubmit: _, resetForm: v, values: y } = o(), [b] = i(y), [x, S] = i(null);
|
|
14
|
-
return /* @__PURE__ */ s(r, {
|
|
15
|
-
onOpenChange: (e) => {
|
|
16
|
-
v({ values: b }), m(e);
|
|
17
|
-
},
|
|
18
|
-
open: p,
|
|
19
|
-
variant: "overlay",
|
|
20
|
-
children: /* @__PURE__ */ s(r.Overlay, {
|
|
21
|
-
container: d?.current,
|
|
22
|
-
children: /* @__PURE__ */ c(r.Content, {
|
|
23
|
-
className: u.sidePanelContent,
|
|
24
|
-
children: [
|
|
25
|
-
/* @__PURE__ */ s(r.Header, {
|
|
26
|
-
className: u.staticPosition,
|
|
27
|
-
children: g(t.filtersHeader)
|
|
28
|
-
}),
|
|
29
|
-
/* @__PURE__ */ s(r.ScrollableContainer, {
|
|
30
|
-
ref: S,
|
|
31
|
-
children: /* @__PURE__ */ s(n, {
|
|
32
|
-
defaultValue: f.map((e, t) => `item-${t}`),
|
|
33
|
-
type: "multiple",
|
|
34
|
-
children: f.map((t, r) => /* @__PURE__ */ s(n.Item, {
|
|
35
|
-
...t.toggleable ? {} : { fixed: "true" },
|
|
36
|
-
title: t.title,
|
|
37
|
-
value: `item-${r}`,
|
|
38
|
-
children: t.filters.map((t) => /* @__PURE__ */ s(e, {
|
|
39
|
-
...t,
|
|
40
|
-
parentRef: x
|
|
41
|
-
}, t.id))
|
|
42
|
-
}, `accordion-item-${t.title || "unnamed"}`))
|
|
43
|
-
})
|
|
44
|
-
}),
|
|
45
|
-
/* @__PURE__ */ c(r.Footer, {
|
|
46
|
-
className: u.staticPosition,
|
|
47
|
-
children: [/* @__PURE__ */ s(r.Footer.SecondaryButton, {
|
|
48
|
-
onClick: () => {
|
|
49
|
-
v({ values: h() });
|
|
50
|
-
},
|
|
51
|
-
children: g(t.clearAllButton)
|
|
52
|
-
}), /* @__PURE__ */ s(r.Footer.PrimaryButton, {
|
|
53
|
-
onClick: () => {
|
|
54
|
-
_(), m(!1);
|
|
55
|
-
},
|
|
56
|
-
children: g(t.showResultsButton)
|
|
57
|
-
})]
|
|
58
|
-
}),
|
|
59
|
-
/* @__PURE__ */ s(r.Close, { "aria-label": g(t.closeAriaLabel) })
|
|
60
|
-
]
|
|
61
|
-
})
|
|
62
|
-
})
|
|
63
|
-
});
|
|
64
|
-
};
|
|
65
|
-
export { d as t };
|
|
1
|
+
import{Filter}from"../esm/lib/components/filter-sidepanel/filter.js";import messages from"../esm/lib/components/filter-sidepanel/messages.js";import{Accordion,SidePanel}from"@box/blueprint-web";import{useState}from"react";import{useIntl}from"react-intl";import{useFormikContext}from"formik";import{jsx,jsxs}from"react/jsx-runtime";import noop from"lodash/noop";import '../styles/filter-side-panel.css';var filter_side_panel_module_default={sidePanelContent:`_sidePanelContent_1j6pr_1`,staticPosition:`_staticPosition_1j6pr_1`},FilterSidePanel=({containerRef,filterGroups,isOpen,onIsOpenChange=noop,getInitialFormValues})=>{let{formatMessage}=useIntl(),{handleSubmit,resetForm,values}=useFormikContext(),[dirtyValues]=useState(values),[sidepanelContentRef,setSidepanelContentRef]=useState(null);return jsx(SidePanel,{onOpenChange:open=>{resetForm({values:dirtyValues}),onIsOpenChange(open)},open:isOpen,variant:`overlay`,children:jsx(SidePanel.Overlay,{container:containerRef?.current,children:jsxs(SidePanel.Content,{className:filter_side_panel_module_default.sidePanelContent,children:[jsx(SidePanel.Header,{className:filter_side_panel_module_default.staticPosition,children:formatMessage(messages.filtersHeader)}),jsx(SidePanel.ScrollableContainer,{ref:setSidepanelContentRef,children:jsx(Accordion,{defaultValue:filterGroups.map((_,index)=>`item-${index}`),type:`multiple`,children:filterGroups.map((filterGroup,index)=>jsx(Accordion.Item,{...filterGroup.toggleable?{}:{fixed:`true`},title:filterGroup.title,value:`item-${index}`,children:filterGroup.filters.map(filterDefinition=>jsx(Filter,{...filterDefinition,parentRef:sidepanelContentRef},filterDefinition.id))},`accordion-item-${filterGroup.title||`unnamed`}`))})}),jsxs(SidePanel.Footer,{className:filter_side_panel_module_default.staticPosition,children:[jsx(SidePanel.Footer.SecondaryButton,{onClick:()=>{resetForm({values:getInitialFormValues()})},children:formatMessage(messages.clearAllButton)}),jsx(SidePanel.Footer.PrimaryButton,{onClick:()=>{handleSubmit(),onIsOpenChange(!1)},children:formatMessage(messages.showResultsButton)})]}),jsx(SidePanel.Close,{"aria-label":formatMessage(messages.closeAriaLabel)})]})})})};export{FilterSidePanel as t};
|
package/dist/chunks/header.js
CHANGED
|
@@ -1,62 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import n from "../esm/lib/components/header/messages.js";
|
|
3
|
-
import { IconButton as r, PageHeader as i, Status as a, Text as o } from "@box/blueprint-web";
|
|
4
|
-
import { XMark as s } from "@box/blueprint-web-assets/icons/Fill";
|
|
5
|
-
import { useIntl as c } from "react-intl";
|
|
6
|
-
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
7
|
-
import '../styles/header.css';var d = {
|
|
8
|
-
titleBar: "_titleBar_1t4pt_1",
|
|
9
|
-
clearSelectionButton: "_clearSelectionButton_1t4pt_7",
|
|
10
|
-
headerContainer: "_headerContainer_1t4pt_12",
|
|
11
|
-
rightSlot: "_rightSlot_1t4pt_19"
|
|
12
|
-
};
|
|
13
|
-
function f({ title: f, itemCount: p, isItemCountVisible: m = !0, onClearSelection: h, selectionCount: g = 0, isSelectionCountVisible: _ = !0, selectedItemName: v, rightSlot: y }) {
|
|
14
|
-
let { formatMessage: b } = c(), x = _ && g > 0, S = m && p != null;
|
|
15
|
-
if (!(f || x || y)) return null;
|
|
16
|
-
let [C, w] = v ? [n.singleItemSelected, { name: v }] : [n.itemsSelected, { count: g }], T = b(C, {
|
|
17
|
-
...w,
|
|
18
|
-
b: (e) => /* @__PURE__ */ l(o, {
|
|
19
|
-
color: "textOnLightDefault",
|
|
20
|
-
variant: "bodyLargeBold",
|
|
21
|
-
as: "span",
|
|
22
|
-
children: e
|
|
23
|
-
})
|
|
24
|
-
});
|
|
25
|
-
return /* @__PURE__ */ u("div", {
|
|
26
|
-
className: d.headerContainer,
|
|
27
|
-
children: [/* @__PURE__ */ l(i.Root, {
|
|
28
|
-
variant: "inline",
|
|
29
|
-
sticky: !1,
|
|
30
|
-
children: /* @__PURE__ */ u(t, { children: [/* @__PURE__ */ u(e, {
|
|
31
|
-
condition: x,
|
|
32
|
-
children: [/* @__PURE__ */ l(i.Corner, { children: /* @__PURE__ */ l(r, {
|
|
33
|
-
"aria-label": b(n.clearSelectionAriaLabel),
|
|
34
|
-
icon: s,
|
|
35
|
-
onClick: h,
|
|
36
|
-
size: "small",
|
|
37
|
-
variant: "small-utility",
|
|
38
|
-
className: d.clearSelectionButton
|
|
39
|
-
}) }), /* @__PURE__ */ l(i.StartElements, { children: /* @__PURE__ */ l(o, {
|
|
40
|
-
as: "span",
|
|
41
|
-
color: "textOnLightSecondary",
|
|
42
|
-
variant: "bodyLarge",
|
|
43
|
-
children: T
|
|
44
|
-
}) })]
|
|
45
|
-
}), /* @__PURE__ */ l(e, {
|
|
46
|
-
condition: !!f,
|
|
47
|
-
children: /* @__PURE__ */ u("div", {
|
|
48
|
-
className: d.titleBar,
|
|
49
|
-
children: [f, S && /* @__PURE__ */ l(a, {
|
|
50
|
-
className: d.itemCount,
|
|
51
|
-
colorIndex: 0,
|
|
52
|
-
text: String(p)
|
|
53
|
-
})]
|
|
54
|
-
})
|
|
55
|
-
})] })
|
|
56
|
-
}), y && /* @__PURE__ */ l("div", {
|
|
57
|
-
className: d.rightSlot,
|
|
58
|
-
children: y
|
|
59
|
-
})]
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
export { f as t };
|
|
1
|
+
import{Case,SwitchCase}from"../esm/lib/components/switch-case/switch-case.js";import messages from"../esm/lib/components/header/messages.js";import{IconButton,PageHeader,Status,Text}from"@box/blueprint-web";import{XMark}from"@box/blueprint-web-assets/icons/Fill";import{useIntl}from"react-intl";import{jsx,jsxs}from"react/jsx-runtime";import '../styles/header.css';var header_module_default={titleBar:`_titleBar_1t4pt_1`,clearSelectionButton:`_clearSelectionButton_1t4pt_7`,headerContainer:`_headerContainer_1t4pt_12`,rightSlot:`_rightSlot_1t4pt_19`};function Header({title,itemCount,isItemCountVisible=!0,onClearSelection,selectionCount=0,isSelectionCountVisible=!0,selectedItemName,rightSlot}){let{formatMessage}=useIntl(),shouldShowSelectionBar=isSelectionCountVisible&&selectionCount>0,shouldShowItemCountStatus=isItemCountVisible&&itemCount!=null;if(!(title||shouldShowSelectionBar||rightSlot))return null;let[selectionMessageDescriptor,selectionMessageValues]=selectedItemName?[messages.singleItemSelected,{name:selectedItemName}]:[messages.itemsSelected,{count:selectionCount}],selectionMessage=formatMessage(selectionMessageDescriptor,{...selectionMessageValues,b:chunks=>jsx(Text,{color:`textOnLightDefault`,variant:`bodyLargeBold`,as:`span`,children:chunks})});return jsxs(`div`,{className:header_module_default.headerContainer,children:[jsx(PageHeader.Root,{variant:`inline`,sticky:!1,children:jsxs(SwitchCase,{children:[jsxs(Case,{condition:shouldShowSelectionBar,children:[jsx(PageHeader.Corner,{children:jsx(IconButton,{"aria-label":formatMessage(messages.clearSelectionAriaLabel),icon:XMark,onClick:onClearSelection,size:`small`,variant:`small-utility`,className:header_module_default.clearSelectionButton})}),jsx(PageHeader.StartElements,{children:jsx(Text,{as:`span`,color:`textOnLightSecondary`,variant:`bodyLarge`,children:selectionMessage})})]}),jsx(Case,{condition:!!title,children:jsxs(`div`,{className:header_module_default.titleBar,children:[title,shouldShowItemCountStatus&&jsx(Status,{className:header_module_default.itemCount,colorIndex:0,text:String(itemCount)})]})})]})}),rightSlot&&jsx(`div`,{className:header_module_default.rightSlot,children:rightSlot})]})}export{Header as t};
|
|
@@ -1,34 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Button as t, Cell as n, DropdownMenu as r } from "@box/blueprint-web";
|
|
3
|
-
import { CaretDown as i } from "@box/blueprint-web-assets/icons/Fill";
|
|
4
|
-
import { useIntl as a } from "react-intl";
|
|
5
|
-
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
|
-
import c from "lodash/get";
|
|
7
|
-
import l from "lodash/isEqual";
|
|
8
|
-
import '../styles/inline-editing-cell.css';var u = { inlineEditingCell: "_inlineEditingCell_1iieg_1" }, d = ({ column: d, item: f, onInlineEditChange: p }) => {
|
|
9
|
-
let { formatMessage: m } = a(), { type: h, inlineEditingOptions: g, id: _ } = d, v = c(f, _), y = typeof v == "string" ? [v] : v || [], b = m(e.unselectedOptionLabel), x = [{
|
|
10
|
-
value: null,
|
|
11
|
-
label: b
|
|
12
|
-
}, ...(g ?? []).map((e) => ({
|
|
13
|
-
value: e,
|
|
14
|
-
label: e
|
|
15
|
-
}))], S = (e) => {
|
|
16
|
-
if (!p) return;
|
|
17
|
-
let t;
|
|
18
|
-
t = h === "multiSelect" ? e === null ? [] : y.includes(e) ? y.filter((t) => t !== e) : [...y, e] : e, (h === "multiSelect" ? !l(t, y) : t !== y[0]) && p(f, t, _);
|
|
19
|
-
}, C = (e) => e === null ? y.length === 0 : y.includes(e);
|
|
20
|
-
return /* @__PURE__ */ o(n, { children: /* @__PURE__ */ s(r.Root, { children: [/* @__PURE__ */ o(r.Trigger, { children: /* @__PURE__ */ o(t, {
|
|
21
|
-
className: u.inlineEditingCell,
|
|
22
|
-
endIcon: i,
|
|
23
|
-
variant: "secondary",
|
|
24
|
-
children: y.length > 0 ? y.join(", ") : b
|
|
25
|
-
}) }), /* @__PURE__ */ o(r.Content, {
|
|
26
|
-
align: "start",
|
|
27
|
-
children: x.map((e) => /* @__PURE__ */ o(r.CheckboxItem, {
|
|
28
|
-
checked: C(e.value),
|
|
29
|
-
onSelect: () => S(e.value),
|
|
30
|
-
children: e.label
|
|
31
|
-
}, e.value ?? b))
|
|
32
|
-
})] }) });
|
|
33
|
-
};
|
|
34
|
-
export { d as t };
|
|
1
|
+
import messages from"../esm/lib/components/metadata-table/messages.js";import{Button,Cell,DropdownMenu}from"@box/blueprint-web";import{CaretDown}from"@box/blueprint-web-assets/icons/Fill";import{useIntl}from"react-intl";import{jsx,jsxs}from"react/jsx-runtime";import get from"lodash/get";import isEqual from"lodash/isEqual";import '../styles/inline-editing-cell.css';var inline_editing_cell_module_default={inlineEditingCell:`_inlineEditingCell_1iieg_1`},InlineEditingCell=({column,item,onInlineEditChange})=>{let{formatMessage}=useIntl(),{type,inlineEditingOptions,id:columnId}=column,rawValue=get(item,columnId),currentValue=typeof rawValue==`string`?[rawValue]:rawValue||[],unselectedLabel=formatMessage(messages.unselectedOptionLabel),optionsWithDefault=[{value:null,label:unselectedLabel},...(inlineEditingOptions??[]).map(option=>({value:option,label:option}))],handleOptionSelect=selectedValue=>{if(!onInlineEditChange)return;let newValue;newValue=type===`multiSelect`?selectedValue===null?[]:currentValue.includes(selectedValue)?currentValue.filter(value=>value!==selectedValue):[...currentValue,selectedValue]:selectedValue,(type===`multiSelect`?!isEqual(newValue,currentValue):newValue!==currentValue[0])&&onInlineEditChange(item,newValue,columnId)},isOptionSelected=optionValue=>optionValue===null?currentValue.length===0:currentValue.includes(optionValue);return jsx(Cell,{children:jsxs(DropdownMenu.Root,{children:[jsx(DropdownMenu.Trigger,{children:jsx(Button,{className:inline_editing_cell_module_default.inlineEditingCell,endIcon:CaretDown,variant:`secondary`,children:currentValue.length>0?currentValue.join(`, `):unselectedLabel})}),jsx(DropdownMenu.Content,{align:`start`,children:optionsWithDefault.map(option=>jsx(DropdownMenu.CheckboxItem,{checked:isOptionSelected(option.value),onSelect:()=>handleOptionSelect(option.value),children:option.label},option.value??unselectedLabel))})]})})};export{InlineEditingCell as t};
|
|
@@ -1,86 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { getDataTargetId as t } from "../esm/lib/components/item-action-menu/identifier.js";
|
|
3
|
-
import n from "../esm/lib/components/item-action-menu/messages.js";
|
|
4
|
-
import { DropdownMenu as r, GridList as i, IconButton as a, Tooltip as o } from "@box/blueprint-web";
|
|
5
|
-
import s, { useMemo as c } from "react";
|
|
6
|
-
import { Ellipsis as l } from "@box/blueprint-web-assets/icons/Fill";
|
|
7
|
-
import { useIntl as u } from "react-intl";
|
|
8
|
-
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
9
|
-
import '../styles/item-action-menu.css';var p = {
|
|
10
|
-
tableActionBar: "_tableActionBar_akgtp_1",
|
|
11
|
-
actionItemIcon: "_actionItemIcon_akgtp_6"
|
|
12
|
-
};
|
|
13
|
-
function m(e) {
|
|
14
|
-
return (t) => {
|
|
15
|
-
t.stopPropagation(), e();
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
function h({ item: e, label: n, onClick: i, icon: a, isDisabled: o }) {
|
|
19
|
-
let s = m(() => {
|
|
20
|
-
i(e);
|
|
21
|
-
}), l = c(() => o?.(e) ?? !1, [o, e]);
|
|
22
|
-
return /* @__PURE__ */ f(r.Item, {
|
|
23
|
-
"data-target-id": t(r.Item, n),
|
|
24
|
-
disabled: l,
|
|
25
|
-
onClick: s,
|
|
26
|
-
children: [/* @__PURE__ */ d(a, { className: p.actionItemIcon }), n]
|
|
27
|
-
}, n);
|
|
28
|
-
}
|
|
29
|
-
function g({ actions: c, inlineActions: g, isDisabled: _, item: v, onOpenChange: y, subMenuActions: b, subMenuTrigger: x, viewMode: S = e.LIST }) {
|
|
30
|
-
let { formatMessage: C } = u(), { label: w, icon: T } = x || {};
|
|
31
|
-
return /* @__PURE__ */ f("div", {
|
|
32
|
-
className: p.tableActionBar,
|
|
33
|
-
children: [
|
|
34
|
-
S === e.LIST && g?.map(({ onClick: e, label: n, icon: r, isDisabled: i, getTooltipContent: c }) => {
|
|
35
|
-
let l = c?.(v), u = `${v.id}-${n}`, f = i?.(v) ?? !1, p = /* @__PURE__ */ d(a, {
|
|
36
|
-
accessibleWhenDisabled: f && !!l || void 0,
|
|
37
|
-
"aria-label": n,
|
|
38
|
-
"data-target-id": t(a, n),
|
|
39
|
-
disabled: f,
|
|
40
|
-
icon: r,
|
|
41
|
-
onClick: m(() => e(v)),
|
|
42
|
-
size: "large"
|
|
43
|
-
});
|
|
44
|
-
return l ? /* @__PURE__ */ d(o, {
|
|
45
|
-
content: l,
|
|
46
|
-
children: p
|
|
47
|
-
}, u) : /* @__PURE__ */ d(s.Fragment, { children: p }, u);
|
|
48
|
-
}),
|
|
49
|
-
c ? /* @__PURE__ */ f(r.Root, {
|
|
50
|
-
onOpenChange: y,
|
|
51
|
-
children: [/* @__PURE__ */ d(r.Trigger, { children: S === e.LIST ? /* @__PURE__ */ d(a, {
|
|
52
|
-
"aria-label": C(n.actionMenu),
|
|
53
|
-
"data-target-id": t(a, "openActionMenu"),
|
|
54
|
-
disabled: _,
|
|
55
|
-
icon: l,
|
|
56
|
-
size: "large"
|
|
57
|
-
}) : /* @__PURE__ */ d(i.ActionIconButton, {
|
|
58
|
-
"aria-label": C(n.actionMenu),
|
|
59
|
-
"data-target-id": t(i.ActionIconButton, "openActionMenu"),
|
|
60
|
-
disabled: _,
|
|
61
|
-
icon: l
|
|
62
|
-
}) }), /* @__PURE__ */ f(r.Content, {
|
|
63
|
-
align: "start",
|
|
64
|
-
children: [c.map((e) => /* @__PURE__ */ d(h, {
|
|
65
|
-
item: v,
|
|
66
|
-
...e
|
|
67
|
-
}, e.label)), b && x && /* @__PURE__ */ f(r.SubMenuRoot, { children: [/* @__PURE__ */ f(r.SubMenuTrigger, {
|
|
68
|
-
"data-target-id": t(r.SubMenuTrigger, "openActionSubmenu"),
|
|
69
|
-
children: [T && /* @__PURE__ */ d(T, { className: p.actionItemIcon }), w]
|
|
70
|
-
}), /* @__PURE__ */ d(r.SubMenuContent, { children: b.map((e) => /* @__PURE__ */ d(h, {
|
|
71
|
-
item: v,
|
|
72
|
-
...e
|
|
73
|
-
}, e.label)) })] })]
|
|
74
|
-
})]
|
|
75
|
-
}) : null,
|
|
76
|
-
S === e.GRID && g?.map(({ onClick: e, label: n, icon: r, isDisabled: a }) => /* @__PURE__ */ d(i.ActionIconButton, {
|
|
77
|
-
"aria-label": n,
|
|
78
|
-
"data-target-id": t(i.ActionIconButton, n),
|
|
79
|
-
disabled: a?.(v) ?? !1,
|
|
80
|
-
icon: r,
|
|
81
|
-
onClick: () => e(v)
|
|
82
|
-
}, `${v.id}-${n}`))
|
|
83
|
-
]
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
export { g as t };
|
|
1
|
+
import{r as ViewMode}from"./types.js";import{getDataTargetId}from"../esm/lib/components/item-action-menu/identifier.js";import messages from"../esm/lib/components/item-action-menu/messages.js";import{DropdownMenu,GridList,IconButton,Tooltip}from"@box/blueprint-web";import React,{useMemo}from"react";import{Ellipsis}from"@box/blueprint-web-assets/icons/Fill";import{useIntl}from"react-intl";import{jsx,jsxs}from"react/jsx-runtime";import '../styles/item-action-menu.css';var item_action_menu_module_default={tableActionBar:`_tableActionBar_akgtp_1`,actionItemIcon:`_actionItemIcon_akgtp_6`};function handleClickWrapper(handleClickFunction){return event=>{event.stopPropagation(),handleClickFunction()}}function ActionMenuItem({item,label,onClick,icon:IconComponent,isDisabled}){let handleClick=handleClickWrapper(()=>{onClick(item)}),disabled=useMemo(()=>isDisabled?.(item)??!1,[isDisabled,item]);return jsxs(DropdownMenu.Item,{"data-target-id":getDataTargetId(DropdownMenu.Item,label),disabled,onClick:handleClick,children:[jsx(IconComponent,{className:item_action_menu_module_default.actionItemIcon}),label]},label)}function ItemActionMenu({actions,inlineActions,isDisabled,item,onOpenChange,subMenuActions,subMenuTrigger,viewMode=ViewMode.LIST}){let{formatMessage}=useIntl(),{label:SubMenuLabel,icon:SubMenuIcon}=subMenuTrigger||{};return jsxs(`div`,{className:item_action_menu_module_default.tableActionBar,children:[viewMode===ViewMode.LIST&&inlineActions?.map(({onClick,label,icon,isDisabled:getIsDisabled,getTooltipContent})=>{let tooltipContent=getTooltipContent?.(item),key=`${item.id}-${label}`,isButtonDisabled=getIsDisabled?.(item)??!1,button=jsx(IconButton,{accessibleWhenDisabled:isButtonDisabled&&!!tooltipContent||void 0,"aria-label":label,"data-target-id":getDataTargetId(IconButton,label),disabled:isButtonDisabled,icon,onClick:handleClickWrapper(()=>onClick(item)),size:`large`});return tooltipContent?jsx(Tooltip,{content:tooltipContent,children:button},key):jsx(React.Fragment,{children:button},key)}),actions?jsxs(DropdownMenu.Root,{onOpenChange,children:[jsx(DropdownMenu.Trigger,{children:viewMode===ViewMode.LIST?jsx(IconButton,{"aria-label":formatMessage(messages.actionMenu),"data-target-id":getDataTargetId(IconButton,`openActionMenu`),disabled:isDisabled,icon:Ellipsis,size:`large`}):jsx(GridList.ActionIconButton,{"aria-label":formatMessage(messages.actionMenu),"data-target-id":getDataTargetId(GridList.ActionIconButton,`openActionMenu`),disabled:isDisabled,icon:Ellipsis})}),jsxs(DropdownMenu.Content,{align:`start`,children:[actions.map(action=>jsx(ActionMenuItem,{item,...action},action.label)),subMenuActions&&subMenuTrigger&&jsxs(DropdownMenu.SubMenuRoot,{children:[jsxs(DropdownMenu.SubMenuTrigger,{"data-target-id":getDataTargetId(DropdownMenu.SubMenuTrigger,`openActionSubmenu`),children:[SubMenuIcon&&jsx(SubMenuIcon,{className:item_action_menu_module_default.actionItemIcon}),SubMenuLabel]}),jsx(DropdownMenu.SubMenuContent,{children:subMenuActions.map(action=>jsx(ActionMenuItem,{item,...action},action.label))})]})]})]}):null,viewMode===ViewMode.GRID&&inlineActions?.map(({onClick,label,icon,isDisabled:getIsDisabled})=>jsx(GridList.ActionIconButton,{"aria-label":label,"data-target-id":getDataTargetId(GridList.ActionIconButton,label),disabled:getIsDisabled?.(item)??!1,icon,onClick:()=>onClick(item)},`${item.id}-${label}`))]})}export{ItemActionMenu as t};
|
|
@@ -1,44 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { t } from "./item-action-menu.js";
|
|
3
|
-
import { THUMBNAIL_GRID_VIEW_SIZES as n } from "../esm/lib/components/constants.js";
|
|
4
|
-
import r from "../esm/lib/components/metadata-grid/messages.js";
|
|
5
|
-
import { GridList as i } from "@box/blueprint-web";
|
|
6
|
-
import { useIntl as a } from "react-intl";
|
|
7
|
-
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
8
|
-
import { ItemTypeIcon as c } from "@box/item-icon";
|
|
9
|
-
import '../styles/metadata-grid.css';var l = { itemThumbnail: "_itemThumbnail_93ess_1" }, u = 188, d = 250, f = 8, p = 5, m = (e) => u + d * (f - e) / p, h = ({ items: u, itemActionMenuProps: d, zoomLevel: f, areSelectionCheckboxesDisabled: p, ...h }) => {
|
|
10
|
-
let { formatMessage: g } = a();
|
|
11
|
-
return /* @__PURE__ */ o(i, {
|
|
12
|
-
"aria-label": g(r.gridView),
|
|
13
|
-
items: u,
|
|
14
|
-
style: { gridTemplateColumns: `repeat(auto-fit, minmax(${m(n[f])}px, 1fr))` },
|
|
15
|
-
...h,
|
|
16
|
-
children: (n) => {
|
|
17
|
-
let { name: r, createdAt: a } = n, u = "thumbnailURLs" in n ? n.thumbnailURLs?.large || n.thumbnailURLs?.medium || n.thumbnailURLs?.small : void 0;
|
|
18
|
-
return /* @__PURE__ */ s(i.Item, {
|
|
19
|
-
textValue: r,
|
|
20
|
-
children: [
|
|
21
|
-
/* @__PURE__ */ o(i.Thumbnail, {
|
|
22
|
-
className: l.itemThumbnail,
|
|
23
|
-
children: u ? /* @__PURE__ */ o("img", {
|
|
24
|
-
alt: r,
|
|
25
|
-
src: u
|
|
26
|
-
}) : /* @__PURE__ */ o(c, { item: n })
|
|
27
|
-
}),
|
|
28
|
-
/* @__PURE__ */ o(i.Header, { children: r }),
|
|
29
|
-
/* @__PURE__ */ o(i.Subtitle, { children: a }),
|
|
30
|
-
/* @__PURE__ */ o(i.Actions, {
|
|
31
|
-
isSelectionCheckboxDisabled: p,
|
|
32
|
-
children: d ? (r) => /* @__PURE__ */ o(t, {
|
|
33
|
-
...d,
|
|
34
|
-
item: n,
|
|
35
|
-
onOpenChange: r,
|
|
36
|
-
viewMode: e.GRID
|
|
37
|
-
}) : null
|
|
38
|
-
})
|
|
39
|
-
]
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
export { h as t };
|
|
1
|
+
import{r as ViewMode}from"./types.js";import{t as ItemActionMenu}from"./item-action-menu.js";import{THUMBNAIL_GRID_VIEW_SIZES}from"../esm/lib/components/constants.js";import messages from"../esm/lib/components/metadata-grid/messages.js";import{GridList}from"@box/blueprint-web";import{useIntl}from"react-intl";import{jsx,jsxs}from"react/jsx-runtime";import{ItemTypeIcon}from"@box/item-icon";import '../styles/metadata-grid.css';var metadata_grid_module_default={itemThumbnail:`_itemThumbnail_93ess_1`},FLOOR_ITEM_WIDTH_PX=188,CEIL_ITEM_WIDTH_DELTA_PX=250,LEGACY_MAX_ITEMS_PER_ROW=8,LEGACY_ITEMSPER_ROW_RANGE=5,getGridItemMin=itemSizing=>FLOOR_ITEM_WIDTH_PX+CEIL_ITEM_WIDTH_DELTA_PX*(LEGACY_MAX_ITEMS_PER_ROW-itemSizing)/LEGACY_ITEMSPER_ROW_RANGE,MetadataGrid=({items,itemActionMenuProps,zoomLevel,areSelectionCheckboxesDisabled,...rest})=>{let{formatMessage}=useIntl();return jsx(GridList,{"aria-label":formatMessage(messages.gridView),items,style:{gridTemplateColumns:`repeat(auto-fit, minmax(${getGridItemMin(THUMBNAIL_GRID_VIEW_SIZES[zoomLevel])}px, 1fr))`},...rest,children:item=>{let{name,createdAt}=item,thumbnailUrl=`thumbnailURLs`in item?item.thumbnailURLs?.large||item.thumbnailURLs?.medium||item.thumbnailURLs?.small:void 0;return jsxs(GridList.Item,{textValue:name,children:[jsx(GridList.Thumbnail,{className:metadata_grid_module_default.itemThumbnail,children:thumbnailUrl?jsx(`img`,{alt:name,src:thumbnailUrl}):jsx(ItemTypeIcon,{item})}),jsx(GridList.Header,{children:name}),jsx(GridList.Subtitle,{children:createdAt}),jsx(GridList.Actions,{isSelectionCheckboxDisabled:areSelectionCheckboxesDisabled,children:itemActionMenuProps?onOpenChange=>jsx(ItemActionMenu,{...itemActionMenuProps,item,onOpenChange,viewMode:ViewMode.GRID}):null})]})}})};export{MetadataGrid as t};
|
|
@@ -1,35 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useIntl as t } from "react-intl";
|
|
3
|
-
import { useFormikContext as n } from "formik";
|
|
4
|
-
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
-
import i from "lodash/noop";
|
|
6
|
-
import { FolderShared as a } from "@box/blueprint-web-assets/icons/Content";
|
|
7
|
-
import { ContentField as o } from "@box/content-field";
|
|
8
|
-
import '../styles/metadata-location-field.css';var s = { metadataLocationFieldTrigger: "_metadataLocationFieldTrigger_1d3ch_1" }, c = ({ id: c, triggerSetValueCallback: l = i, renderer: u = (e) => e }) => {
|
|
9
|
-
let { formatMessage: d } = t(), { values: f, setFieldValue: p } = n(), m = f.metadata.fields[c].value.enum?.[0];
|
|
10
|
-
return u(/* @__PURE__ */ r("div", {
|
|
11
|
-
className: s.metadataLocationFieldTrigger,
|
|
12
|
-
children: /* @__PURE__ */ r(o, {
|
|
13
|
-
"data-target-id": `ContentField-filter_${c}`,
|
|
14
|
-
icon: m?.isFolderShared ? a : void 0,
|
|
15
|
-
onClear: () => {
|
|
16
|
-
p(`metadata.fields.${c}.value.enum`, []);
|
|
17
|
-
},
|
|
18
|
-
onClick: () => {
|
|
19
|
-
l((e, t, n = !1) => {
|
|
20
|
-
p(`metadata.fields.${c}.value.enum[0]`, {
|
|
21
|
-
folderId: e,
|
|
22
|
-
folderName: t,
|
|
23
|
-
isFolderShared: n
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
},
|
|
27
|
-
placeholder: d(e.selectFolderHint),
|
|
28
|
-
title: m?.folderName ? {
|
|
29
|
-
titleValue: m.folderName,
|
|
30
|
-
type: "constant"
|
|
31
|
-
} : void 0
|
|
32
|
-
})
|
|
33
|
-
}));
|
|
34
|
-
};
|
|
35
|
-
export { c as t };
|
|
1
|
+
import messages from"../esm/lib/components/metadata-value/messages.js";import{useIntl}from"react-intl";import{useFormikContext}from"formik";import{jsx}from"react/jsx-runtime";import noop from"lodash/noop";import{FolderShared}from"@box/blueprint-web-assets/icons/Content";import{ContentField}from"@box/content-field";import '../styles/metadata-location-field.css';var metadata_location_field_module_default={metadataLocationFieldTrigger:`_metadataLocationFieldTrigger_1d3ch_1`},MetadataLocationField=({id,triggerSetValueCallback=noop,renderer=component=>component})=>{let{formatMessage}=useIntl(),{values,setFieldValue}=useFormikContext(),fieldValue=values.metadata.fields[id].value.enum?.[0];return renderer(jsx(`div`,{className:metadata_location_field_module_default.metadataLocationFieldTrigger,children:jsx(ContentField,{"data-target-id":`ContentField-filter_${id}`,icon:fieldValue?.isFolderShared?FolderShared:void 0,onClear:()=>{setFieldValue(`metadata.fields.${id}.value.enum`,[])},onClick:()=>{triggerSetValueCallback((folderId,folderName,isFolderShared=!1)=>{setFieldValue(`metadata.fields.${id}.value.enum[0]`,{folderId,folderName,isFolderShared})})},placeholder:formatMessage(messages.selectFolderHint),title:fieldValue?.folderName?{titleValue:fieldValue.folderName,type:`constant`}:void 0})}))};export{MetadataLocationField as t};
|
|
@@ -1,104 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { t as n } from "./action-bar.js";
|
|
3
|
-
import { t as r } from "./metadata-grid.js";
|
|
4
|
-
import { MetadataTable as i } from "../esm/lib/components/metadata-table/metadata-table.js";
|
|
5
|
-
import { Pagination as a } from "../esm/lib/components/pagination/pagination.js";
|
|
6
|
-
import { Case as o, SwitchCase as s } from "../esm/lib/components/switch-case/switch-case.js";
|
|
7
|
-
import { t as c } from "./header.js";
|
|
8
|
-
import { t as l } from "./empty-state.js";
|
|
9
|
-
import { t as u } from "./error-state.js";
|
|
10
|
-
import { useHeader as d } from "../esm/lib/hooks/use-header.js";
|
|
11
|
-
import { TooltipProvider as f } from "@box/blueprint-web";
|
|
12
|
-
import { useCallback as p, useRef as m, useState as h } from "react";
|
|
13
|
-
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
14
|
-
import '../styles/metadata-view.css';var y = {
|
|
15
|
-
container: "_container_1o9go_5",
|
|
16
|
-
contentContainer: "_contentContainer_1o9go_15"
|
|
17
|
-
};
|
|
18
|
-
function b({ actionBarProps: b, columns: x, dataTargetPrefix: S, tableProps: C, hasError: w, headerProps: T, onRefresh: E, onSelectionChange: D, onViewModeChange: O, selectedKeys: k, initialViewMode: A = e.LIST, paginationProps: j, isLoading: M, isSelectAllEnabled: N = !0, isSelectionEnabled: P, areSelectionCheckboxesDisabled: F, ...I }) {
|
|
19
|
-
let [L, R] = h(A), [z, B] = h(void 0), [V, H] = h(0), U = m(null), { headerSelectionProps: W, handleSelectionChange: G, selectionResetKey: K } = d({
|
|
20
|
-
headerProps: T,
|
|
21
|
-
items: I.items,
|
|
22
|
-
selectedKeys: k,
|
|
23
|
-
isSelectionEnabled: P,
|
|
24
|
-
onSelectionChange: D
|
|
25
|
-
}), q = () => {
|
|
26
|
-
R((t) => {
|
|
27
|
-
let n = t === e.LIST ? e.GRID : e.LIST;
|
|
28
|
-
return O?.(n), n;
|
|
29
|
-
});
|
|
30
|
-
}, J = !M && I.items.length === 0, Y = b && b.sortDropdownProps && x.filter((e) => e.type !== "multiSelect" && e.type !== "enum" && e.allowsSorting === !0), { iconColumnVariant: X } = C || {}, Z = X && X === t.COLUMN, Q = C?.onSortChange, $ = p(({ column: e, direction: t }) => {
|
|
31
|
-
B({
|
|
32
|
-
column: e,
|
|
33
|
-
direction: t
|
|
34
|
-
}), Q?.({
|
|
35
|
-
column: e,
|
|
36
|
-
direction: t
|
|
37
|
-
});
|
|
38
|
-
}, [Q]), ee = {
|
|
39
|
-
...C,
|
|
40
|
-
sortDescriptor: z,
|
|
41
|
-
onSortChange: $
|
|
42
|
-
};
|
|
43
|
-
return /* @__PURE__ */ _(f, { children: /* @__PURE__ */ _("div", {
|
|
44
|
-
ref: U,
|
|
45
|
-
className: y.container,
|
|
46
|
-
children: w ? /* @__PURE__ */ _(u, { onRefresh: E }) : /* @__PURE__ */ v(g, { children: [
|
|
47
|
-
T && /* @__PURE__ */ _(c, {
|
|
48
|
-
...T,
|
|
49
|
-
...W
|
|
50
|
-
}),
|
|
51
|
-
/* @__PURE__ */ _(n, {
|
|
52
|
-
...b,
|
|
53
|
-
containerRef: U,
|
|
54
|
-
dataTargetPrefix: S,
|
|
55
|
-
isIconColumnEnabled: Z,
|
|
56
|
-
onSortDescriptorChange: B,
|
|
57
|
-
onViewModeClick: q,
|
|
58
|
-
onZoomLevelChange: H,
|
|
59
|
-
sortableColumns: Y,
|
|
60
|
-
sortDescriptor: z,
|
|
61
|
-
viewMode: L,
|
|
62
|
-
zoomLevel: V
|
|
63
|
-
}),
|
|
64
|
-
/* @__PURE__ */ _("div", {
|
|
65
|
-
className: y.contentContainer,
|
|
66
|
-
children: /* @__PURE__ */ v(s, { children: [
|
|
67
|
-
/* @__PURE__ */ _(o, {
|
|
68
|
-
condition: J,
|
|
69
|
-
children: /* @__PURE__ */ _(l, {})
|
|
70
|
-
}),
|
|
71
|
-
/* @__PURE__ */ _(o, {
|
|
72
|
-
condition: L === e.LIST,
|
|
73
|
-
children: /* @__PURE__ */ _(i, {
|
|
74
|
-
areSelectionCheckboxesDisabled: F,
|
|
75
|
-
columns: x,
|
|
76
|
-
isLoading: M,
|
|
77
|
-
isSelectAllEnabled: N,
|
|
78
|
-
onSelectionChange: G,
|
|
79
|
-
selectedKeys: k,
|
|
80
|
-
selectionMode: P ? "multiple" : "none",
|
|
81
|
-
zoomLevel: V,
|
|
82
|
-
...I,
|
|
83
|
-
...ee,
|
|
84
|
-
dataTargetPrefix: S
|
|
85
|
-
}, K)
|
|
86
|
-
}),
|
|
87
|
-
/* @__PURE__ */ _(o, {
|
|
88
|
-
condition: L === e.GRID,
|
|
89
|
-
children: /* @__PURE__ */ _(r, {
|
|
90
|
-
areSelectionCheckboxesDisabled: F,
|
|
91
|
-
onSelectionChange: G,
|
|
92
|
-
selectedKeys: k,
|
|
93
|
-
selectionMode: P ? "multiple" : "none",
|
|
94
|
-
zoomLevel: V,
|
|
95
|
-
...I
|
|
96
|
-
}, K)
|
|
97
|
-
})
|
|
98
|
-
] })
|
|
99
|
-
}),
|
|
100
|
-
j && /* @__PURE__ */ _(a, { ...j })
|
|
101
|
-
] })
|
|
102
|
-
}) });
|
|
103
|
-
}
|
|
104
|
-
export { b as t };
|
|
1
|
+
import{r as ViewMode,t as IconColumnVariant}from"./types.js";import{t as ActionBar}from"./action-bar.js";import{t as MetadataGrid}from"./metadata-grid.js";import{MetadataTable}from"../esm/lib/components/metadata-table/metadata-table.js";import{Pagination}from"../esm/lib/components/pagination/pagination.js";import{Case,SwitchCase}from"../esm/lib/components/switch-case/switch-case.js";import{t as Header}from"./header.js";import{t as EmptyStateComponent}from"./empty-state.js";import{t as ErrorState}from"./error-state.js";import{useHeader}from"../esm/lib/hooks/use-header.js";import{TooltipProvider}from"@box/blueprint-web";import{useCallback,useRef,useState}from"react";import{Fragment,jsx,jsxs}from"react/jsx-runtime";import '../styles/metadata-view.css';var metadata_view_module_default={container:`_container_1o9go_5`,contentContainer:`_contentContainer_1o9go_15`};function MetadataView({actionBarProps,columns,dataTargetPrefix,tableProps,hasError,headerProps,onRefresh,onSelectionChange,onViewModeChange,selectedKeys,initialViewMode=ViewMode.LIST,paginationProps,isLoading,isSelectAllEnabled=!0,isSelectionEnabled,areSelectionCheckboxesDisabled,...rest}){let[viewMode,setViewMode]=useState(initialViewMode),[sortDescriptor,setSortDescriptor]=useState(void 0),[zoomLevel,setZoomLevel]=useState(0),containerRef=useRef(null),{headerSelectionProps,handleSelectionChange,selectionResetKey}=useHeader({headerProps,items:rest.items,selectedKeys,isSelectionEnabled,onSelectionChange}),handleViewModeChange=()=>{setViewMode(currentMode=>{let nextViewMode=currentMode===ViewMode.LIST?ViewMode.GRID:ViewMode.LIST;return onViewModeChange?.(nextViewMode),nextViewMode})},isMetadataTableEmpty=!isLoading&&rest.items.length===0,sortableColumns=actionBarProps&&actionBarProps.sortDropdownProps&&columns.filter(column=>column.type!==`multiSelect`&&column.type!==`enum`&&column.allowsSorting===!0),{iconColumnVariant}=tableProps||{},isIconColumnEnabled=iconColumnVariant&&iconColumnVariant===IconColumnVariant.COLUMN,externalOnSortChange=tableProps?.onSortChange,handleSortChange=useCallback(({column,direction})=>{setSortDescriptor({column,direction}),externalOnSortChange?.({column,direction})},[externalOnSortChange]),mergedTableProps={...tableProps,sortDescriptor,onSortChange:handleSortChange};return jsx(TooltipProvider,{children:jsx(`div`,{ref:containerRef,className:metadata_view_module_default.container,children:hasError?jsx(ErrorState,{onRefresh}):jsxs(Fragment,{children:[headerProps&&jsx(Header,{...headerProps,...headerSelectionProps}),jsx(ActionBar,{...actionBarProps,containerRef,dataTargetPrefix,isIconColumnEnabled,onSortDescriptorChange:setSortDescriptor,onViewModeClick:handleViewModeChange,onZoomLevelChange:setZoomLevel,sortableColumns,sortDescriptor,viewMode,zoomLevel}),jsx(`div`,{className:metadata_view_module_default.contentContainer,children:jsxs(SwitchCase,{children:[jsx(Case,{condition:isMetadataTableEmpty,children:jsx(EmptyStateComponent,{})}),jsx(Case,{condition:viewMode===ViewMode.LIST,children:jsx(MetadataTable,{areSelectionCheckboxesDisabled,columns,isLoading,isSelectAllEnabled,onSelectionChange:handleSelectionChange,selectedKeys,selectionMode:isSelectionEnabled?`multiple`:`none`,zoomLevel,...rest,...mergedTableProps,dataTargetPrefix},selectionResetKey)}),jsx(Case,{condition:viewMode===ViewMode.GRID,children:jsx(MetadataGrid,{areSelectionCheckboxesDisabled,onSelectionChange:handleSelectionChange,selectedKeys,selectionMode:isSelectionEnabled?`multiple`:`none`,zoomLevel,...rest},selectionResetKey)})]})}),paginationProps&&jsx(Pagination,{...paginationProps})]})})})}export{MetadataView as t};
|
|
@@ -1,40 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Button as t } from "@box/blueprint-web";
|
|
3
|
-
import { FormattedMessage as n, useIntl as r } from "react-intl";
|
|
4
|
-
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
-
import '../styles/pagination-controls.css';var o = {
|
|
6
|
-
pagination: "_pagination_1ozaq_1",
|
|
7
|
-
paginationButtonContainer: "_paginationButtonContainer_1ozaq_9"
|
|
8
|
-
}, s = ({ handleNextClick: s, handlePreviousClick: c, hasNextPage: l, hasPageEntryStatus: u, hasPreviousPage: d, offset: f = 0, pageSize: p = 0, totalCount: m = 0 }) => {
|
|
9
|
-
let { formatMessage: h } = r(), g = f + 1, _ = Math.min(f + p, m);
|
|
10
|
-
return /* @__PURE__ */ a("div", {
|
|
11
|
-
"aria-label": h(e.paginationAriaLabel),
|
|
12
|
-
"aria-live": "polite",
|
|
13
|
-
className: o.pagination,
|
|
14
|
-
children: [u && /* @__PURE__ */ i("div", {
|
|
15
|
-
className: o.paginationText,
|
|
16
|
-
children: /* @__PURE__ */ i(n, {
|
|
17
|
-
...e.pageEntryStatus,
|
|
18
|
-
values: {
|
|
19
|
-
startEntryIndex: g,
|
|
20
|
-
endEntryIndex: _,
|
|
21
|
-
totalCount: m
|
|
22
|
-
}
|
|
23
|
-
})
|
|
24
|
-
}), /* @__PURE__ */ a("div", {
|
|
25
|
-
className: o.paginationButtonContainer,
|
|
26
|
-
children: [/* @__PURE__ */ i(t, {
|
|
27
|
-
disabled: !d,
|
|
28
|
-
onClick: c,
|
|
29
|
-
variant: "secondary",
|
|
30
|
-
children: h(e.previousPageButton)
|
|
31
|
-
}), /* @__PURE__ */ i(t, {
|
|
32
|
-
disabled: !l,
|
|
33
|
-
onClick: s,
|
|
34
|
-
variant: "secondary",
|
|
35
|
-
children: h(e.nextPageButton)
|
|
36
|
-
})]
|
|
37
|
-
})]
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
export { s as t };
|
|
1
|
+
import messages from"../esm/lib/components/pagination/messages.js";import{Button}from"@box/blueprint-web";import{FormattedMessage,useIntl}from"react-intl";import{jsx,jsxs}from"react/jsx-runtime";import '../styles/pagination-controls.css';var pagination_controls_module_default={pagination:`_pagination_1ozaq_1`,paginationButtonContainer:`_paginationButtonContainer_1ozaq_9`},PaginationControls=({handleNextClick,handlePreviousClick,hasNextPage,hasPageEntryStatus,hasPreviousPage,offset=0,pageSize=0,totalCount=0})=>{let{formatMessage}=useIntl(),startEntryIndex=offset+1,endEntryIndex=Math.min(offset+pageSize,totalCount);return jsxs(`div`,{"aria-label":formatMessage(messages.paginationAriaLabel),"aria-live":`polite`,className:pagination_controls_module_default.pagination,children:[hasPageEntryStatus&&jsx(`div`,{className:pagination_controls_module_default.paginationText,children:jsx(FormattedMessage,{...messages.pageEntryStatus,values:{startEntryIndex,endEntryIndex,totalCount}})}),jsxs(`div`,{className:pagination_controls_module_default.paginationButtonContainer,children:[jsx(Button,{disabled:!hasPreviousPage,onClick:handlePreviousClick,variant:`secondary`,children:formatMessage(messages.previousPageButton)}),jsx(Button,{disabled:!hasNextPage,onClick:handleNextClick,variant:`secondary`,children:formatMessage(messages.nextPageButton)})]})]})};export{PaginationControls as t};
|