UNPKG

@progress/kendo-react-ripple

Version:

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

77 lines (76 loc) 2.28 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 a from "prop-types"; import { register as c } from "@progress/kendo-ripple"; import { packageMetadata as i } from "./package-metadata.mjs"; import { validatePackage as l, getLicenseMessage as m, WatermarkOverlay as p } from "@progress/kendo-react-common"; const r = class r extends t.PureComponent { constructor(e) { super(e), this._element = null, this.removeListeners = () => { }, this.showLicenseWatermark = !1, this.registerListeners = () => { const s = this._element; this.removeListeners(); const n = c(s, [ { 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 = n; }, this.showLicenseWatermark = !l(i, { component: "Ripple" }), this.licenseMessage = m(i); } /** * @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__ */ t.createElement( "span", { className: e, ref: (s) => { this._element = s; } }, this.props.children, this.showLicenseWatermark && /* @__PURE__ */ t.createElement(p, { message: this.licenseMessage }) ); } }; r.propTypes = { disabled: a.bool }; let o = r; export { o as Ripple };