devextreme
Version:
HTML5 JavaScript Component Suite for Responsive Web Development
79 lines (77 loc) • 2.45 kB
JavaScript
/**
* DevExtreme (cjs/__internal/ui/check_box/check_box_icon.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.defaultCheckBoxIconProps = exports.CheckBoxIcon = void 0;
var _inferno = require("inferno");
require("../../../ui/themes");
var _inferno2 = require("@devextreme/runtime/inferno");
var _style = require("../../../core/utils/style");
const _excluded = ["size"];
function _objectWithoutPropertiesLoose(r, e) {
if (null == r) {
return {}
}
var t = {};
for (var n in r) {
if ({}.hasOwnProperty.call(r, n)) {
if (e.includes(n)) {
continue
}
t[n] = r[n]
}
}
return t
}
const defaultCheckBoxIconProps = exports.defaultCheckBoxIconProps = {};
class CheckBoxIcon extends _inferno2.BaseInfernoComponent {
constructor(props) {
super(props);
this.state = {};
this.elementRef = (0, _inferno.createRef)();
this.__getterCache = {}
}
get cssStyles() {
if (void 0 !== this.__getterCache.cssStyles) {
return this.__getterCache.cssStyles
}
return this.__getterCache.cssStyles = (() => {
const {
size: size
} = this.props;
const fontSize = (0, _style.normalizeStyleProp)("fontSize", size);
return {
fontSize: fontSize
}
})()
}
get restAttributes() {
const _this$props = this.props,
restProps = _objectWithoutPropertiesLoose(_this$props, _excluded);
return restProps
}
componentWillUpdate(nextProps) {
if (this.props.size !== nextProps.size) {
this.__getterCache.cssStyles = void 0
}
}
render() {
const {
elementRef: elementRef,
cssStyles: cssStyles
} = this;
return (0, _inferno.createVNode)(1, "span", "dx-checkbox-icon", null, 1, {
style: (0, _inferno2.normalizeStyles)(cssStyles)
}, null, elementRef)
}
}
exports.CheckBoxIcon = CheckBoxIcon;
CheckBoxIcon.defaultProps = defaultCheckBoxIconProps;