@clickhouse/click-ui 0.0.159 → 0.0.160
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/click-ui.es.js
CHANGED
|
@@ -32759,6 +32759,7 @@ const Pagination = ({
|
|
|
32759
32759
|
onPageNumberFocus,
|
|
32760
32760
|
onPageNumberBlur,
|
|
32761
32761
|
disableNextButton,
|
|
32762
|
+
allowAllRows = true,
|
|
32762
32763
|
...props
|
|
32763
32764
|
}) => {
|
|
32764
32765
|
const hasRowCount = ["number", "string"].includes(typeof rowCount);
|
|
@@ -32811,6 +32812,9 @@ const Pagination = ({
|
|
|
32811
32812
|
onNextPageClick(e);
|
|
32812
32813
|
}
|
|
32813
32814
|
}, [currentPage, onChangeProp, onNextPageClick, rightButtonDisabled]);
|
|
32815
|
+
if (pageSize === -1 && !allowAllRows && maxRowsPerPageList.length > 0) {
|
|
32816
|
+
pageSize = maxRowsPerPageList[0];
|
|
32817
|
+
}
|
|
32814
32818
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Container, { gap, justifyContent: justifyContent ?? (rowCount || maxRowsPerPageList.length > 0 ? "space-between" : "center"), fillWidth, ...props, children: [
|
|
32815
32819
|
hasRowCount && /* @__PURE__ */ jsxRuntimeExports.jsxs(Text, { component: "div", color: "muted", size: "sm", children: [
|
|
32816
32820
|
typeof rowCount === "number" ? formatNumber(rowCount) : rowCount,
|
|
@@ -32826,7 +32830,7 @@ const Pagination = ({
|
|
|
32826
32830
|
/* @__PURE__ */ jsxRuntimeExports.jsx(IconButton$1, { icon: "chevron-right", type: "ghost", disabled: rightButtonDisabled, onClick: onNextClick, "data-testid": "next-btn" })
|
|
32827
32831
|
] }),
|
|
32828
32832
|
maxRowsPerPageList.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs(CustomSelect, { as: Select, onSelect: onPageSizeChange, value: pageSize.toString(), children: [
|
|
32829
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, { value: "-1", children: "All rows" }),
|
|
32833
|
+
allowAllRows && /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, { value: "-1", children: "All rows" }),
|
|
32830
32834
|
maxRowsPerPageList.map((option2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(Select.Item, { value: option2.toString(), children: [
|
|
32831
32835
|
option2,
|
|
32832
32836
|
" rows"
|
package/dist/click-ui.umd.js
CHANGED
|
@@ -32776,6 +32776,7 @@ var __publicField = (obj, key, value) => {
|
|
|
32776
32776
|
onPageNumberFocus,
|
|
32777
32777
|
onPageNumberBlur,
|
|
32778
32778
|
disableNextButton,
|
|
32779
|
+
allowAllRows = true,
|
|
32779
32780
|
...props
|
|
32780
32781
|
}) => {
|
|
32781
32782
|
const hasRowCount = ["number", "string"].includes(typeof rowCount);
|
|
@@ -32828,6 +32829,9 @@ var __publicField = (obj, key, value) => {
|
|
|
32828
32829
|
onNextPageClick(e);
|
|
32829
32830
|
}
|
|
32830
32831
|
}, [currentPage, onChangeProp, onNextPageClick, rightButtonDisabled]);
|
|
32832
|
+
if (pageSize === -1 && !allowAllRows && maxRowsPerPageList.length > 0) {
|
|
32833
|
+
pageSize = maxRowsPerPageList[0];
|
|
32834
|
+
}
|
|
32831
32835
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Container, { gap, justifyContent: justifyContent ?? (rowCount || maxRowsPerPageList.length > 0 ? "space-between" : "center"), fillWidth, ...props, children: [
|
|
32832
32836
|
hasRowCount && /* @__PURE__ */ jsxRuntimeExports.jsxs(Text, { component: "div", color: "muted", size: "sm", children: [
|
|
32833
32837
|
typeof rowCount === "number" ? formatNumber(rowCount) : rowCount,
|
|
@@ -32843,7 +32847,7 @@ var __publicField = (obj, key, value) => {
|
|
|
32843
32847
|
/* @__PURE__ */ jsxRuntimeExports.jsx(IconButton$1, { icon: "chevron-right", type: "ghost", disabled: rightButtonDisabled, onClick: onNextClick, "data-testid": "next-btn" })
|
|
32844
32848
|
] }),
|
|
32845
32849
|
maxRowsPerPageList.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs(CustomSelect, { as: Select, onSelect: onPageSizeChange, value: pageSize.toString(), children: [
|
|
32846
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, { value: "-1", children: "All rows" }),
|
|
32850
|
+
allowAllRows && /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, { value: "-1", children: "All rows" }),
|
|
32847
32851
|
maxRowsPerPageList.map((option) => /* @__PURE__ */ jsxRuntimeExports.jsxs(Select.Item, { value: option.toString(), children: [
|
|
32848
32852
|
option,
|
|
32849
32853
|
" rows"
|
|
@@ -14,5 +14,6 @@ export interface PaginationProps extends Omit<ContainerProps<"div">, "children"
|
|
|
14
14
|
onPageNumberFocus?: FocusEventHandler<HTMLInputElement>;
|
|
15
15
|
onPageNumberBlur?: FocusEventHandler<HTMLInputElement>;
|
|
16
16
|
disableNextButton?: boolean;
|
|
17
|
+
allowAllRows?: boolean;
|
|
17
18
|
}
|
|
18
|
-
export declare const Pagination: ({ totalPages, currentPage, maxRowsPerPageList, rowCount, onChange: onChangeProp, onPageSizeChange: onPageSizeChangeProp, pageSize, fillWidth, gap, justifyContent, onNextPageClick, onPrevPageClick, onPageNumberFocus, onPageNumberBlur, disableNextButton, ...props }: PaginationProps) => ReactElement;
|
|
19
|
+
export declare const Pagination: ({ totalPages, currentPage, maxRowsPerPageList, rowCount, onChange: onChangeProp, onPageSizeChange: onPageSizeChangeProp, pageSize, fillWidth, gap, justifyContent, onNextPageClick, onPrevPageClick, onPageNumberFocus, onPageNumberBlur, disableNextButton, allowAllRows, ...props }: PaginationProps) => ReactElement;
|