UNPKG

devextreme

Version:

HTML5 JavaScript Component Suite for Responsive Web Development

43 lines (42 loc) 1.49 kB
/** * DevExtreme (esm/ui/calendar/ui.calendar.single.selection.strategy.js) * Version: 23.2.6 * Build date: Wed May 01 2024 * * Copyright (c) 2012 - 2024 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ import CalendarSelectionStrategy from "./ui.calendar.selection.strategy"; class CalendarSingleSelectionStrategy extends CalendarSelectionStrategy { constructor(component) { super(component); this.NAME = "SingleSelection" } getViewOptions() { return { value: this.dateOption("value"), range: [], selectionMode: "single" } } selectValue(selectedValue, e) { this.skipNavigate(); this.dateValue(selectedValue, e) } updateAriaSelected(value, previousValue) { var _value, _previousValue; null !== (_value = value) && void 0 !== _value ? _value : value = [this.dateOption("value")]; null !== (_previousValue = previousValue) && void 0 !== _previousValue ? _previousValue : previousValue = []; super.updateAriaSelected(value, previousValue) } getDefaultCurrentDate() { return this.dateOption("value") } restoreValue() { this.calendar.option("value", null) } _updateViewsValue(value) { this._updateViewsOption("value", value[0]) } } export default CalendarSingleSelectionStrategy;