UNPKG

devextreme

Version:

HTML5 JavaScript Component Suite for Responsive Web Development

68 lines (67 loc) 2.1 kB
/** * DevExtreme (esm/__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/ */ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; const _excluded = ["size"]; import { createVNode } from "inferno"; import "../../../ui/themes"; import { BaseInfernoComponent, normalizeStyles } from "@devextreme/runtime/inferno"; import { normalizeStyleProp } from "../../../core/utils/style"; import { createRef as infernoCreateRef } from "inferno"; export const defaultCheckBoxIconProps = {}; export class CheckBoxIcon extends BaseInfernoComponent { constructor(props) { super(props); this.state = {}; this.elementRef = infernoCreateRef(); 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 = 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 createVNode(1, "span", "dx-checkbox-icon", null, 1, { style: normalizeStyles(cssStyles) }, null, elementRef) } } CheckBoxIcon.defaultProps = defaultCheckBoxIconProps;