UNPKG

@progress/kendo-react-ripple

Version:

React Ripple provides the Material ink ripple effect. KendoReact Ripple package

77 lines (76 loc) 2.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 s from "react"; import n from "prop-types"; import { register as a } from "@progress/kendo-ripple"; import { packageMetadata as l } from "./package-metadata.mjs"; import { validatePackage as c, WatermarkOverlay as m } from "@progress/kendo-react-common"; const r = class r extends s.PureComponent { constructor(e) { super(e), this._element = null, this.removeListeners = () => { }, this.showLicenseWatermark = !1, this.registerListeners = () => { const t = this._element; this.removeListeners(); const i = a(t, [ { selector: ".k-button:not(li)" }, { selector: ".k-list>.k-item,.k-list>.k-list-item", options: { global: !0 } }, { selector: ".k-checkbox-label,.k-radio-label" }, { selector: ".k-checkbox,.k-radio", options: { events: ["focusin", "animationend", "click"] } } ]); this.removeListeners = i; }, this.showLicenseWatermark = !c(l, { component: "Ripple" }); } /** * @hidden */ componentDidMount() { this.registerListeners(); } /** * @hidden */ componentDidUpdate() { const { disabled: e } = this.props; e ? this.removeListeners() : this.registerListeners(); } /** * @hidden */ componentWillUnmount() { this.removeListeners(); } /** * @hidden */ render() { const e = this.props.className ? "k-ripple-container " + this.props.className : "k-ripple-container"; return /* @__PURE__ */ s.createElement( "span", { className: e, ref: (t) => { this._element = t; } }, this.props.children, this.showLicenseWatermark && /* @__PURE__ */ s.createElement(m, null) ); } }; r.propTypes = { disabled: n.bool }; let o = r; export { o as Ripple };