UNPKG

devextreme

Version:

JavaScript/TypeScript Component Suite for Responsive Web Development

50 lines (49 loc) 1.51 kB
/** * DevExtreme (esm/__internal/scheduler/r1/components/base/date_header_text.js) * Version: 25.2.7 * Build date: Tue May 05 2026 * * Copyright (c) 2012 - 2026 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ import { createVNode, createFragment } from "inferno"; import { BaseInfernoComponent } from "../../../../core/r1/runtime/inferno/index"; const DateHeaderTextDefaultProps = { text: "", splitText: false }; export class DateHeaderText extends BaseInfernoComponent { constructor() { super(...arguments); this.textCache = null } getTextParts() { if (null !== this.textCache) { return this.textCache } const { text: text } = this.props; this.textCache = text ? text.split(" ") : [""]; return this.textCache } componentWillUpdate(nextProps) { if (this.props.text !== nextProps.text) { this.textCache = null } } render() { const { splitText: splitText, text: text } = this.props; const textParts = this.getTextParts(); return createFragment(splitText ? textParts.map(part => createVNode(1, "div", "dx-scheduler-header-panel-cell-date", createVNode(1, "span", null, part, 0), 2)) : text, 0) } } DateHeaderText.defaultProps = DateHeaderTextDefaultProps;