devextreme
Version:
HTML5 JavaScript Component Suite for Responsive Web Development
72 lines (70 loc) • 2.26 kB
JavaScript
/**
* DevExtreme (cjs/__internal/ui/button/ink_ripple.js)
* Version: 24.2.6
* Build date: Mon Mar 17 2025
*
* Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.InkRipple = void 0;
var _inferno = require("inferno");
var _inferno2 = require("@devextreme/runtime/inferno");
var _utils = require("../../../ui/widget/utils.ink_ripple");
function _extends() {
return _extends = Object.assign ? Object.assign.bind() : function(n) {
for (var e = 1; e < arguments.length; e++) {
var t = arguments[e];
for (var r in t) {
({}).hasOwnProperty.call(t, r) && (n[r] = t[r])
}
}
return n
}, _extends.apply(null, arguments)
}
class InkRipple extends _inferno2.BaseInfernoComponent {
constructor(props) {
super(props);
this.__getterCache = {};
this.state = {};
this.hideWave = this.hideWave.bind(this);
this.showWave = this.showWave.bind(this)
}
get getConfig() {
if (void 0 !== this.__getterCache.getConfig) {
return this.__getterCache.getConfig
}
return this.__getterCache.getConfig = (() => {
const {
config: config
} = this.props;
return (0, _utils.initConfig)(config)
})()
}
get restAttributes() {
const restProps = _extends({}, this.props);
delete restProps.config;
return restProps
}
hideWave(opts) {
(0, _utils.hideWave)(this.getConfig, opts)
}
showWave(opts) {
(0, _utils.showWave)(this.getConfig, opts)
}
componentWillUpdate(nextProps) {
if (this.props.config !== nextProps.config) {
this.__getterCache.getConfig = void 0
}
}
render() {
return (0, _inferno.normalizeProps)((0, _inferno.createVNode)(1, "div", "dx-inkripple", null, 1, _extends({}, this.restAttributes)))
}
}
exports.InkRipple = InkRipple;
InkRipple.defaultProps = {
config: {}
};