UNPKG

@progress/kendo-react-buttons

Version:

All you need in React Button in one package: disabled/enabled states, built-in styles and more. KendoReact Buttons package

40 lines (39 loc) 2.11 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import * as t from "react"; import { ToolbarSeparator as n } from "./ToolbarSeparator.mjs"; import { ToolbarScrollButton as B } from "./ToolbarScrollButton.mjs"; const g = (i) => { const { scrollButtons: c, scrollButtonsPosition: l, isOverflowing: p, scrollContentRef: m, buttonScrollSpeed: u, dir: e, isScrollStartPosition: a, isScrollEndPosition: s, prevButton: b, nextButton: E, children: S } = i, r = (v, x) => /* @__PURE__ */ t.createElement( B, { type: v, disabled: x, scrollContentRef: m, buttonScrollSpeed: u, prevButton: b, nextButton: E } ), o = c === "visible" || c === "auto" && p; return /* @__PURE__ */ t.createElement(t.Fragment, null, o && l === "split" && /* @__PURE__ */ t.createElement(t.Fragment, null, r(e !== "rtl" ? "prev" : "next", a), /* @__PURE__ */ t.createElement(n, { className: "k-toolbar-button-separator" })), o && l === "start" && /* @__PURE__ */ t.createElement(t.Fragment, null, r(e !== "rtl" ? "prev" : "next", a), r(e !== "rtl" ? "next" : "prev", s), /* @__PURE__ */ t.createElement(n, { className: "k-toolbar-button-separator" })), /* @__PURE__ */ t.createElement("span", { className: "k-toolbar-items k-toolbar-items-scroll", ref: m }, S), o && l === "split" && /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(n, { className: "k-toolbar-button-separator" }), r(e !== "rtl" ? "next" : "prev", s)), o && l === "end" && /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(n, { className: "k-toolbar-button-separator" }), r(e !== "rtl" ? "prev" : "next", a), r(e !== "rtl" ? "next" : "prev", s))); }; export { g as ToolbarScrollable };