UNPKG

@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.64 kB
/** * @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 v, pagerTotalPages as h, pagerPageNumberLabel as p } from "../messages/index.mjs"; import { NumericTextBox as E } from "@progress/kendo-react-inputs"; import { getL10NMessage as s, translateMessage as g } from "./utils.mjs"; const I = (e) => { const [r, l] = a.useState(e.currentPage), i = (n) => { l(n.target.value), n.target.value && e.pageChange(n.target.value, n); }, m = M(), t = P(), o = s(b, e.messagesMap), c = s(v, e.messagesMap), u = s(h, e.messagesMap), f = s(p, e.messagesMap); return /* @__PURE__ */ a.createElement("span", { className: "k-pager-input" }, e.visibleElementsRef.current.length >= 3 && /* @__PURE__ */ a.createElement("span", { ref: e.pagerInputTitleRef }, g(t, o)), /* @__PURE__ */ a.createElement( E, { value: e.currentPage !== void 0 ? e.currentPage : r, onChange: i, 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 { I as PagerInput };