UNPKG

devexpress-reporting

Version:

DevExpress Reporting provides the capability to develop a reporting application to create and customize reports.

25 lines (24 loc) 1.24 kB
/** * DevExpress HTML/JS Reporting (viewer\widgets\dateRange\dateRangeEditor.binding.js) * Version: 25.2.3 * Build date: Dec 15, 2025 * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED * License: https://www.devexpress.com/Support/EULAs/universal.xml */ import { createDateRangeEditor } from './dateRangeEditor'; import * as ko from 'knockout'; import { getTemplate } from '@devexpress/analytics-core/analytics-utils-native'; import { $dx, addDisposeCallback } from '@devexpress/analytics-core/analytics-internal-native'; ko.bindingHandlers['dxrvDateRangeEditor'] = { init: (element, valueAccessor, bindings, model, bindingContext) => { const rangeEditor = createDateRangeEditor(valueAccessor(), element, model); $dx(element).empty(); const templateHtml = getTemplate('dxrv-daterange-editor'), $element = $dx(element).append(templateHtml); const context = bindingContext.createChildContext(rangeEditor.getViewModel()); const child = $element[0].children[0]; ko.cleanNode(child); ko.applyBindingsToDescendants(context, child); addDisposeCallback(element, () => rangeEditor.dispose()); return { controlsDescendantBindings: true }; } };