@box/metadata-view 1.54.8 → 1.54.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/action-bar.js +48 -0
- package/dist/chunks/empty-state.js +24 -0
- package/dist/chunks/error-state.js +23 -0
- package/dist/chunks/filter-row.module.js +6 -8
- package/dist/chunks/filter-side-panel.js +65 -0
- package/dist/chunks/header.js +56 -0
- package/dist/chunks/inline-editing-cell.js +34 -0
- package/dist/chunks/item-action-menu.js +86 -0
- package/dist/chunks/metadata-grid.js +44 -0
- package/dist/chunks/metadata-location-field.js +35 -0
- package/dist/chunks/metadata-view.js +102 -0
- package/dist/chunks/pagination-controls.js +40 -0
- package/dist/chunks/table-row.js +72 -0
- package/dist/chunks/types.js +6 -11
- package/dist/chunks/types2.js +4 -0
- package/dist/chunks/zoom-button.js +20 -0
- package/dist/esm/index.js +29 -59
- package/dist/esm/lib/components/action-bar/action-bar.js +2 -62
- package/dist/esm/lib/components/action-bar/index.js +2 -4
- package/dist/esm/lib/components/action-bar/messages.js +22 -24
- package/dist/esm/lib/components/action-bar/zoom-button.js +2 -30
- package/dist/esm/lib/components/constants.js +14 -6
- package/dist/esm/lib/components/empty-state/empty-state.js +2 -30
- package/dist/esm/lib/components/empty-state/index.js +2 -4
- package/dist/esm/lib/components/empty-state/messages.js +10 -12
- package/dist/esm/lib/components/error-state/error-state.js +2 -31
- package/dist/esm/lib/components/error-state/index.js +2 -4
- package/dist/esm/lib/components/error-state/messages.js +10 -12
- package/dist/esm/lib/components/filter-row/advanced-field-content.js +30 -52
- package/dist/esm/lib/components/filter-row/advanced-filter-context.js +3 -6
- package/dist/esm/lib/components/filter-row/all-filters-chip.js +31 -49
- package/dist/esm/lib/components/filter-row/filter-row.js +35 -59
- package/dist/esm/lib/components/filter-row/form-filter-chip.js +84 -113
- package/dist/esm/lib/components/filter-row/index.js +6 -12
- package/dist/esm/lib/components/filter-row/initial-field-values.js +31 -51
- package/dist/esm/lib/components/filter-row/is-blank-or-not-blank-filter.js +2 -4
- package/dist/esm/lib/components/filter-row/is-filter-selected.js +37 -58
- package/dist/esm/lib/components/filter-row/messages.js +38 -40
- package/dist/esm/lib/components/filter-row/metadata-filter-chip.js +74 -103
- package/dist/esm/lib/components/filter-row/predefinedFilters/index.js +2 -6
- package/dist/esm/lib/components/filter-row/predefinedFilters/predefined-filter-options-factory.js +14 -21
- package/dist/esm/lib/components/filter-row/predefinedFilters/use-predefined-filter.js +58 -71
- package/dist/esm/lib/components/filter-row/select-filter-chip.js +41 -58
- package/dist/esm/lib/components/filter-row/use-form-filter-chip.js +36 -40
- package/dist/esm/lib/components/filter-sidepanel/filter-side-panel.js +2 -82
- package/dist/esm/lib/components/filter-sidepanel/filter.js +95 -140
- package/dist/esm/lib/components/filter-sidepanel/index.js +3 -6
- package/dist/esm/lib/components/filter-sidepanel/messages.js +18 -20
- package/dist/esm/lib/components/header/header.js +2 -82
- package/dist/esm/lib/components/header/index.js +2 -4
- package/dist/esm/lib/components/header/messages.js +14 -16
- package/dist/esm/lib/components/index.js +26 -53
- package/dist/esm/lib/components/item-action-menu/identifier.js +4 -7
- package/dist/esm/lib/components/item-action-menu/index.js +2 -4
- package/dist/esm/lib/components/item-action-menu/item-action-menu.js +2 -127
- package/dist/esm/lib/components/item-action-menu/messages.js +5 -9
- package/dist/esm/lib/components/metadata-grid/index.js +2 -4
- package/dist/esm/lib/components/metadata-grid/messages.js +5 -9
- package/dist/esm/lib/components/metadata-grid/metadata-grid.js +2 -62
- package/dist/esm/lib/components/metadata-table/actionColumn.js +3 -5
- package/dist/esm/lib/components/metadata-table/hooks/useInfiniteScrollTableItems.js +24 -29
- package/dist/esm/lib/components/metadata-table/index.js +4 -8
- package/dist/esm/lib/components/metadata-table/messages.js +14 -16
- package/dist/esm/lib/components/metadata-table/metadata-table.js +89 -127
- package/dist/esm/lib/components/metadata-table/table-body/ghost-table-body.js +10 -19
- package/dist/esm/lib/components/metadata-table/table-body/ghost-table-row/ghost-table-row.js +8 -19
- package/dist/esm/lib/components/metadata-table/table-body/ghost-table-row/index.js +2 -4
- package/dist/esm/lib/components/metadata-table/table-body/inline-editing-cell/index.js +2 -4
- package/dist/esm/lib/components/metadata-table/table-body/inline-editing-cell/inline-editing-cell.js +2 -56
- package/dist/esm/lib/components/metadata-table/table-body/table-body-with-data.js +135 -209
- package/dist/esm/lib/components/metadata-table/table-body/table-row/index.js +2 -4
- package/dist/esm/lib/components/metadata-table/table-body/table-row/table-row.js +2 -12
- package/dist/esm/lib/components/metadata-table/table-renderer.js +34 -55
- package/dist/esm/lib/components/metadata-value/index.js +6 -12
- package/dist/esm/lib/components/metadata-value/messages.js +15 -17
- package/dist/esm/lib/components/metadata-value/metadata-checkbox-field.js +24 -34
- package/dist/esm/lib/components/metadata-value/metadata-file-chip.js +14 -22
- package/dist/esm/lib/components/metadata-value/metadata-file-field.js +12 -19
- package/dist/esm/lib/components/metadata-value/metadata-location-field.js +2 -48
- package/dist/esm/lib/components/metadata-value/metadata-radio-field.js +26 -37
- package/dist/esm/lib/components/metadata-value/metadata-search-field.js +19 -30
- package/dist/esm/lib/components/pagination/index.js +4 -9
- package/dist/esm/lib/components/pagination/marker-based-pagination.js +12 -19
- package/dist/esm/lib/components/pagination/messages.js +19 -21
- package/dist/esm/lib/components/pagination/offset-based-pagination.js +22 -31
- package/dist/esm/lib/components/pagination/pagination-controls.js +2 -53
- package/dist/esm/lib/components/pagination/pagination.js +20 -35
- package/dist/esm/lib/components/pagination/utils.js +4 -6
- package/dist/esm/lib/components/sort-dropdown/index.js +2 -4
- package/dist/esm/lib/components/sort-dropdown/sort-dropdown.js +37 -56
- package/dist/esm/lib/components/switch-case/index.js +2 -5
- package/dist/esm/lib/components/switch-case/switch-case.js +4 -12
- package/dist/esm/lib/hooks/use-header.js +41 -37
- package/dist/esm/lib/index.js +28 -59
- package/dist/esm/lib/metadata-view.js +2 -151
- package/dist/styles/action-bar.css +1 -1
- package/dist/styles/empty-state.css +1 -1
- package/dist/styles/filter-row.css +1 -1
- package/dist/styles/header.css +1 -1
- package/dist/styles/inline-editing-cell.css +1 -1
- package/dist/styles/item-action-menu.css +1 -1
- package/dist/styles/metadata-grid.css +1 -1
- package/dist/styles/metadata-view.css +1 -1
- package/dist/styles/pagination-controls.css +1 -1
- package/dist/styles/table-row.css +1 -0
- package/dist/styles/zoom-button.css +1 -1
- package/package.json +17 -17
- package/dist/chunks/index.js +0 -105
- package/dist/styles/index.css +0 -1
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { jsx as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
onSelectionChange: (l) => {
|
|
13
|
-
o(`metadata.fields.${e}.value.enum`, l);
|
|
14
|
-
},
|
|
15
|
-
selected: a || []
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
export {
|
|
19
|
-
d as MetadataFileField
|
|
1
|
+
import { useFormikContext as e } from "formik";
|
|
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
|
+
});
|
|
20
12
|
};
|
|
13
|
+
export { r as MetadataFileField };
|
|
@@ -1,48 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { useIntl as g } from "react-intl";
|
|
4
|
-
import { FolderShared as p } from "@box/blueprint-web-assets/icons/Content";
|
|
5
|
-
import { ContentField as h } from "@box/content-field";
|
|
6
|
-
import v from "./messages.js";
|
|
7
|
-
import { jsx as l } from "react/jsx-runtime";
|
|
8
|
-
import '../../../../styles/metadata-location-field.css';const C = "_metadataLocationFieldTrigger_1d3ch_1", L = {
|
|
9
|
-
metadataLocationFieldTrigger: C
|
|
10
|
-
}, y = ({
|
|
11
|
-
id: e,
|
|
12
|
-
triggerSetValueCallback: r = F,
|
|
13
|
-
renderer: i = (t) => t
|
|
14
|
-
}) => {
|
|
15
|
-
const {
|
|
16
|
-
formatMessage: t
|
|
17
|
-
} = g(), {
|
|
18
|
-
values: d,
|
|
19
|
-
setFieldValue: o
|
|
20
|
-
} = u(), a = d.metadata.fields[e].value.enum?.[0], n = () => {
|
|
21
|
-
o(`metadata.fields.${e}.value.enum`, []);
|
|
22
|
-
}, m = () => {
|
|
23
|
-
r((s, c, f = !1) => {
|
|
24
|
-
o(`metadata.fields.${e}.value.enum[0]`, {
|
|
25
|
-
folderId: s,
|
|
26
|
-
folderName: c,
|
|
27
|
-
isFolderShared: f
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
return i(/* @__PURE__ */ l("div", {
|
|
32
|
-
className: L.metadataLocationFieldTrigger,
|
|
33
|
-
children: /* @__PURE__ */ l(h, {
|
|
34
|
-
"data-target-id": `ContentField-filter_${e}`,
|
|
35
|
-
icon: a?.isFolderShared ? p : void 0,
|
|
36
|
-
onClear: n,
|
|
37
|
-
onClick: m,
|
|
38
|
-
placeholder: t(v.selectFolderHint),
|
|
39
|
-
title: a?.folderName ? {
|
|
40
|
-
titleValue: a.folderName,
|
|
41
|
-
type: "constant"
|
|
42
|
-
} : void 0
|
|
43
|
-
})
|
|
44
|
-
}));
|
|
45
|
-
};
|
|
46
|
-
export {
|
|
47
|
-
y as MetadataLocationField
|
|
48
|
-
};
|
|
1
|
+
import { t as e } from "../../../../chunks/metadata-location-field.js";
|
|
2
|
+
export { e as MetadataLocationField };
|
|
@@ -1,38 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { jsx as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}, l), s.map(({
|
|
27
|
-
key: e
|
|
28
|
-
}) => /* @__PURE__ */ o(a.Item, {
|
|
29
|
-
"data-target-id": `RadioItem-filter_${t}_${e}`,
|
|
30
|
-
label: e,
|
|
31
|
-
value: e
|
|
32
|
-
}, e))]
|
|
33
|
-
})
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
export {
|
|
37
|
-
c as MetadataRadioField
|
|
1
|
+
import { Radio as e } from "@box/blueprint-web";
|
|
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
|
+
});
|
|
38
26
|
};
|
|
27
|
+
export { i as MetadataRadioField };
|
|
@@ -1,31 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { useIntl as
|
|
4
|
-
import r from "
|
|
5
|
-
import { jsx as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
id: e,
|
|
20
|
-
name: l,
|
|
21
|
-
onChange: (u) => t(`metadata.fields.${e}.value.enum[0]`, u.target.value),
|
|
22
|
-
onClearInput: () => t(`metadata.fields.${e}.value.enum`, []),
|
|
23
|
-
placeholder: o,
|
|
24
|
-
searchInputAriaLabel: a(r.searchInputAriaLabel),
|
|
25
|
-
searchInputClearAriaLabel: a(r.searchInputClearAriaLabel),
|
|
26
|
-
value: s?.[0] || ""
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
export {
|
|
30
|
-
v as MetadataSearchField
|
|
1
|
+
import e from "./messages.js";
|
|
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
|
+
});
|
|
31
19
|
};
|
|
20
|
+
export { a as MetadataSearchField };
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
+
import { t as e } from "../../../../chunks/pagination-controls.js";
|
|
2
|
+
import { MarkerBasedPagination as t } from "./marker-based-pagination.js";
|
|
3
|
+
import { OffsetBasedPagination as n } from "./offset-based-pagination.js";
|
|
1
4
|
import { Pagination as r } from "./pagination.js";
|
|
2
|
-
|
|
3
|
-
import { OffsetBasedPagination as i } from "./offset-based-pagination.js";
|
|
4
|
-
import { PaginationControls as g } from "./pagination-controls.js";
|
|
5
|
-
export {
|
|
6
|
-
n as MarkerBasedPagination,
|
|
7
|
-
i as OffsetBasedPagination,
|
|
8
|
-
r as Pagination,
|
|
9
|
-
g as PaginationControls
|
|
10
|
-
};
|
|
5
|
+
export { t as MarkerBasedPagination, n as OffsetBasedPagination, r as Pagination, e as PaginationControls };
|
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { jsx as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
o(-1);
|
|
13
|
-
},
|
|
14
|
-
hasNextPage: t,
|
|
15
|
-
hasPreviousPage: e
|
|
1
|
+
import { t as e } from "../../../../chunks/pagination-controls.js";
|
|
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
|
|
16
12
|
});
|
|
17
|
-
export {
|
|
18
|
-
c as MarkerBasedPagination,
|
|
19
|
-
c as default
|
|
20
|
-
};
|
|
13
|
+
export { n as MarkerBasedPagination, n as default };
|
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
import { defineMessages as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { defineMessages as e } from "react-intl";
|
|
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
19
|
});
|
|
20
|
-
export {
|
|
21
|
-
t as default
|
|
22
|
-
};
|
|
20
|
+
export { t as default };
|
|
@@ -1,32 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getOffsetForPage as
|
|
3
|
-
import { jsx as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
hasPageEntryStatus: !0,
|
|
23
|
-
hasPreviousPage: l,
|
|
24
|
-
offset: n,
|
|
25
|
-
pageSize: t,
|
|
26
|
-
totalCount: r
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
export {
|
|
30
|
-
x as OffsetBasedPagination,
|
|
31
|
-
x as default
|
|
1
|
+
import { t as e } from "../../../../chunks/pagination-controls.js";
|
|
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
|
+
});
|
|
32
22
|
};
|
|
23
|
+
export { r as OffsetBasedPagination, r as default };
|
|
@@ -1,53 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import n from "./messages.js";
|
|
4
|
-
import { jsxs as s, jsx as a } from "react/jsx-runtime";
|
|
5
|
-
import '../../../../styles/pagination-controls.css';const h = "_pagination_1ozaq_1", y = "_paginationButtonContainer_1ozaq_9", i = {
|
|
6
|
-
pagination: h,
|
|
7
|
-
paginationButtonContainer: y
|
|
8
|
-
}, E = ({
|
|
9
|
-
handleNextClick: l,
|
|
10
|
-
handlePreviousClick: c,
|
|
11
|
-
hasNextPage: d,
|
|
12
|
-
hasPageEntryStatus: p,
|
|
13
|
-
hasPreviousPage: g,
|
|
14
|
-
offset: o = 0,
|
|
15
|
-
pageSize: m = 0,
|
|
16
|
-
totalCount: e = 0
|
|
17
|
-
}) => {
|
|
18
|
-
const {
|
|
19
|
-
formatMessage: t
|
|
20
|
-
} = x(), u = o + 1, v = Math.min(o + m, e);
|
|
21
|
-
return /* @__PURE__ */ s("div", {
|
|
22
|
-
"aria-label": t(n.paginationAriaLabel),
|
|
23
|
-
"aria-live": "polite",
|
|
24
|
-
className: i.pagination,
|
|
25
|
-
children: [p && /* @__PURE__ */ a("div", {
|
|
26
|
-
className: i.paginationText,
|
|
27
|
-
children: /* @__PURE__ */ a(B, {
|
|
28
|
-
...n.pageEntryStatus,
|
|
29
|
-
values: {
|
|
30
|
-
startEntryIndex: u,
|
|
31
|
-
endEntryIndex: v,
|
|
32
|
-
totalCount: e
|
|
33
|
-
}
|
|
34
|
-
})
|
|
35
|
-
}), /* @__PURE__ */ s("div", {
|
|
36
|
-
className: i.paginationButtonContainer,
|
|
37
|
-
children: [/* @__PURE__ */ a(r, {
|
|
38
|
-
disabled: !g,
|
|
39
|
-
onClick: c,
|
|
40
|
-
variant: "secondary",
|
|
41
|
-
children: t(n.previousPageButton)
|
|
42
|
-
}), /* @__PURE__ */ a(r, {
|
|
43
|
-
disabled: !d,
|
|
44
|
-
onClick: l,
|
|
45
|
-
variant: "secondary",
|
|
46
|
-
children: t(n.nextPageButton)
|
|
47
|
-
})]
|
|
48
|
-
})]
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
export {
|
|
52
|
-
E as PaginationControls
|
|
53
|
-
};
|
|
1
|
+
import { t as e } from "../../../../chunks/pagination-controls.js";
|
|
2
|
+
export { e as PaginationControls };
|
|
@@ -1,36 +1,21 @@
|
|
|
1
|
-
import { MarkerBasedPagination as
|
|
2
|
-
import { OffsetBasedPagination as
|
|
3
|
-
import { jsx as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
const {
|
|
22
|
-
offset: o,
|
|
23
|
-
onOffsetChange: t,
|
|
24
|
-
pageSize: n,
|
|
25
|
-
totalCount: i
|
|
26
|
-
} = r;
|
|
27
|
-
return /* @__PURE__ */ a(p, {
|
|
28
|
-
offset: o,
|
|
29
|
-
onOffsetChange: t,
|
|
30
|
-
pageSize: n,
|
|
31
|
-
totalCount: i
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
export {
|
|
35
|
-
c as Pagination
|
|
1
|
+
import { MarkerBasedPagination as e } from "./marker-based-pagination.js";
|
|
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
|
+
});
|
|
36
20
|
};
|
|
21
|
+
export { r as Pagination };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
export {
|
|
6
|
-
n as getOffsetForPage
|
|
1
|
+
var e = (e, t, n) => {
|
|
2
|
+
let r = (e - 1) * t;
|
|
3
|
+
return r <= 0 ? 0 : r >= n ? Math.max(n - t, 0) : r;
|
|
7
4
|
};
|
|
5
|
+
export { e as getOffsetForPage };
|
|
@@ -1,57 +1,38 @@
|
|
|
1
|
-
import { DropdownMenu as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
startIcon: a === "ascending" ? v : M,
|
|
38
|
-
variant: "tertiary"
|
|
39
|
-
})
|
|
40
|
-
}), /* @__PURE__ */ c(o.Content, {
|
|
41
|
-
children: /* @__PURE__ */ c(o.RadioGroup, {
|
|
42
|
-
onValueChange: x,
|
|
43
|
-
value: e,
|
|
44
|
-
children: r.map(({
|
|
45
|
-
id: n,
|
|
46
|
-
textValue: i
|
|
47
|
-
}) => /* @__PURE__ */ c(o.RadioSelectItem, {
|
|
48
|
-
value: n,
|
|
49
|
-
children: i
|
|
50
|
-
}, n))
|
|
51
|
-
})
|
|
52
|
-
})]
|
|
53
|
-
});
|
|
54
|
-
};
|
|
55
|
-
export {
|
|
56
|
-
V as SortDropdown
|
|
1
|
+
import { DropdownMenu as e, TriggerButton as t } from "@box/blueprint-web";
|
|
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", onSortChange: f }) => {
|
|
6
|
+
let p = new Map(c.map((e) => [e.id, e.textValue])), [m, h] = n(u), [g, _] = n(d), v = l?.column == null ? m : String(l.column), y = l?.direction ?? g;
|
|
7
|
+
return /* @__PURE__ */ o(e.Root, { children: [/* @__PURE__ */ a(e.Trigger, { children: /* @__PURE__ */ a(t, {
|
|
8
|
+
caretDirection: y === "ascending" ? "up" : "down",
|
|
9
|
+
label: p.get(v),
|
|
10
|
+
startIcon: y === "ascending" ? i : r,
|
|
11
|
+
variant: "tertiary"
|
|
12
|
+
}) }), /* @__PURE__ */ a(e.Content, { children: /* @__PURE__ */ a(e.RadioGroup, {
|
|
13
|
+
onValueChange: (e) => {
|
|
14
|
+
if (e === v) {
|
|
15
|
+
let t = y === "ascending" ? "descending" : "ascending";
|
|
16
|
+
_(t), s({
|
|
17
|
+
column: e,
|
|
18
|
+
direction: t
|
|
19
|
+
}), f({
|
|
20
|
+
column: e,
|
|
21
|
+
direction: t
|
|
22
|
+
});
|
|
23
|
+
} else h(e), _("ascending"), s({
|
|
24
|
+
column: e,
|
|
25
|
+
direction: "ascending"
|
|
26
|
+
}), f({
|
|
27
|
+
column: e,
|
|
28
|
+
direction: "ascending"
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
value: v,
|
|
32
|
+
children: c.map(({ id: t, textValue: n }) => /* @__PURE__ */ a(e.RadioSelectItem, {
|
|
33
|
+
value: t,
|
|
34
|
+
children: n
|
|
35
|
+
}, t))
|
|
36
|
+
}) })] });
|
|
57
37
|
};
|
|
38
|
+
export { s as SortDropdown };
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import e from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}) => r ? n : null, s = ({
|
|
6
|
-
children: r
|
|
7
|
-
}) => {
|
|
8
|
-
const t = e.Children.toArray(r).find((o) => o.props.condition);
|
|
9
|
-
return t ? t.props.children : null;
|
|
10
|
-
};
|
|
11
|
-
export {
|
|
12
|
-
i as Case,
|
|
13
|
-
s as SwitchCase
|
|
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;
|
|
14
5
|
};
|
|
6
|
+
export { t as Case, n as SwitchCase };
|