UNPKG

@progress/kendo-react-layout

Version:

React Layout components enable you to create a perceptive and intuitive layout of web projects. KendoReact Layout package

64 lines (63 loc) 2 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 i from "react"; import t from "prop-types"; import { classNames as b } from "@progress/kendo-react-common"; const o = class o extends i.Component { constructor() { super(...arguments), this.itemRef = null, this.focus = () => { this.itemRef && this.itemRef.focus(); }, this.blur = () => { this.itemRef && this.itemRef.blur(); }, this.onClick = () => { this.props.onSelect && this.props.onSelect(this.props.index), this.itemRef && (this.itemRef.tabIndex = 0, this.itemRef.focus()); }; } /** * @hidden */ render() { const { id: a, active: e, disabled: s, title: c = "Untitled", index: n, renderAllContent: p, first: f, last: m } = this.props, r = p ? `${this.props.contentPanelId}-${n.toString()}` : this.props.contentPanelId, d = { id: `${a}-${n.toString()}`, "aria-selected": e, "aria-controls": e ? r : void 0, "aria-disabled": s, role: "tab", onClick: s ? void 0 : this.onClick }, h = b("k-item", "k-tabstrip-item", { "k-disabled": s, "k-active": e, "k-first": f, "k-last": m }); return /* @__PURE__ */ i.createElement( "li", { ...d, className: h, ref: (u) => this.itemRef = u, onBlur: this.blur, "aria-controls": r }, /* @__PURE__ */ i.createElement("span", { className: "k-link" }, c) ); } }; o.propTypes = { active: t.bool, disabled: t.bool, index: t.number, onSelect: t.func, title: t.oneOfType([t.string, t.element]), first: t.bool, last: t.bool }; let l = o; export { l as TabStripNavigationItem };