@progress/kendo-react-data-tools
Version:
Includes React Pager & React Filter component, an intuitive interface to create complex filter descriptions. KendoReact Data Tools package
36 lines (35 loc) • 1.57 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
"use client";
import * as a from "react";
import { useInternationalization as M, useLocalization as P } from "@progress/kendo-react-intl";
import { pagerPage as b, pagerOf as p, pagerTotalPages as v, pagerPageNumberLabel as L } from "../messages/index.mjs";
import { NumericTextBox as N } from "@progress/kendo-react-inputs";
import { getL10NMessage as s, translateMessage as g } from "./utils.mjs";
const z = (e) => {
const [r, l] = a.useState(e.currentPage), o = (n) => {
l(n.target.value), n.target.value && e.pageChange(n.target.value, n);
}, m = M(), t = P(), i = s(b, e.messagesMap), c = s(p, e.messagesMap), u = s(v, e.messagesMap), f = s(L, e.messagesMap);
return /* @__PURE__ */ a.createElement("span", { className: "k-pager-input" }, /* @__PURE__ */ a.createElement("span", null, g(t, i)), /* @__PURE__ */ a.createElement(
N,
{
value: e.currentPage !== void 0 ? e.currentPage : r,
onChange: o,
min: 1,
spinners: !1,
ariaLabel: g(t, f),
tabIndex: e.navigatable ? -1 : void 0
}
), /* @__PURE__ */ a.createElement("span", null, `${g(t, c)} ${m.format(
g(t, u),
[e.totalPages]
)}`));
};
export {
z as PagerInput
};