UNPKG

devextreme

Version:

HTML5 JavaScript Component Suite for Responsive Web Development

182 lines (180 loc) • 6.16 kB
/** * DevExtreme (cjs/__internal/scheduler/utils/options/constants.js) * Version: 25.1.5 * Build date: Wed Sep 03 2025 * * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DEPRECATED_SCHEDULER_OPTIONS = exports.DEFAULT_SCHEDULER_OPTIONS_RULES = exports.DEFAULT_SCHEDULER_OPTIONS = exports.DEFAULT_SCHEDULER_INTERNAL_OPTIONS = exports.DEFAULT_SCHEDULER_INTEGRATION_OPTIONS = void 0; var _message = _interopRequireDefault(require("../../../../common/core/localization/message")); var _devices = _interopRequireDefault(require("../../../../core/devices")); var _renderer = _interopRequireDefault(require("../../../../core/renderer")); var _date = _interopRequireDefault(require("../../../../core/utils/date")); var _themes = require("../../../../ui/themes"); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e } } const DEFAULT_APPOINTMENT_TEMPLATE_NAME = "item"; const DEFAULT_APPOINTMENT_COLLECTOR_TEMPLATE_NAME = "appointmentCollector"; const DEFAULT_DROP_DOWN_APPOINTMENT_TEMPLATE_NAME = "dropDownAppointment"; const DEFAULT_SCHEDULER_INTERNAL_OPTIONS = exports.DEFAULT_SCHEDULER_INTERNAL_OPTIONS = { indicatorTime: void 0, renovateRender: true, _draggingMode: "outlook", _appointmentTooltipOffset: { x: 0, y: 0 }, _appointmentCountPerCell: 2, _collectorOffset: 0, _appointmentOffset: 26, appointmentPopupTemplate: "appointmentPopup", disabledExpr: "disabled", allowMultipleCellSelection: true }; const DEFAULT_SCHEDULER_OPTIONS = exports.DEFAULT_SCHEDULER_OPTIONS = { views: ["day", "week"], currentView: "day", currentDate: _date.default.trimTime(new Date), min: void 0, max: void 0, dateSerializationFormat: void 0, firstDayOfWeek: void 0, groups: [], resources: [], dataSource: null, customizeDateNavigatorText: void 0, appointmentTemplate: "item", dropDownAppointmentTemplate: "dropDownAppointment", appointmentCollectorTemplate: "appointmentCollector", dataCellTemplate: void 0, timeCellTemplate: void 0, resourceCellTemplate: void 0, dateCellTemplate: void 0, startDayHour: 0, endDayHour: 24, offset: 0, editing: { allowAdding: true, allowDeleting: true, allowDragging: true, allowResizing: true, allowUpdating: true, allowTimeZoneEditing: false }, showAllDayPanel: true, showCurrentTimeIndicator: true, shadeUntilCurrentTime: false, indicatorUpdateInterval: 3e5, recurrenceEditMode: "dialog", cellDuration: 30, maxAppointmentsPerCell: "auto", selectedCellData: [], groupByDate: false, onAppointmentRendered: void 0, onAppointmentClick: void 0, onAppointmentDblClick: void 0, onAppointmentContextMenu: void 0, onCellClick: void 0, onCellContextMenu: void 0, onAppointmentAdding: void 0, onAppointmentAdded: void 0, onAppointmentUpdating: void 0, onAppointmentUpdated: void 0, onAppointmentDeleting: void 0, onAppointmentDeleted: void 0, onAppointmentFormOpening: void 0, onAppointmentTooltipShowing: void 0, appointmentTooltipTemplate: "appointmentTooltip", crossScrollingEnabled: false, useDropDownViewSwitcher: false, startDateExpr: "startDate", endDateExpr: "endDate", textExpr: "text", descriptionExpr: "description", allDayExpr: "allDay", recurrenceRuleExpr: "recurrenceRule", recurrenceExceptionExpr: "recurrenceException", remoteFiltering: false, timeZone: "", startDateTimeZoneExpr: "startDateTimeZone", endDateTimeZoneExpr: "endDateTimeZone", noDataText: _message.default.format("dxCollectionWidget-noDataText"), adaptivityEnabled: false, scrolling: { mode: "standard" }, allDayPanelMode: "all", toolbar: { disabled: false, multiline: false, items: [{ location: "before", name: "dateNavigator" }, { location: "after", name: "viewSwitcher" }] } }; const DEFAULT_SCHEDULER_INTEGRATION_OPTIONS = exports.DEFAULT_SCHEDULER_INTEGRATION_OPTIONS = { integrationOptions: { useDeferUpdateForTemplates: false } }; const DEPRECATED_SCHEDULER_OPTIONS = exports.DEPRECATED_SCHEDULER_OPTIONS = { dropDownAppointmentTemplate: { since: "19.2", message: "appointmentTooltipTemplate" } }; const DEFAULT_SCHEDULER_OPTIONS_RULES = exports.DEFAULT_SCHEDULER_OPTIONS_RULES = [{ device: () => "desktop" === _devices.default.real().deviceType && !_devices.default.isSimulator(), options: { focusStateEnabled: true } }, { device: () => !_devices.default.current().generic, options: { useDropDownViewSwitcher: true, editing: { allowDragging: false, allowResizing: false } } }, { device: () => (0, _themes.isMaterialBased)(), options: { useDropDownViewSwitcher: true, dateCellTemplate: (data, _, element) => { const { text: text = "" } = data; text.split(" ").forEach(((word, wordIndex) => { const span = (0, _renderer.default)("<span>").text(word).addClass("dx-scheduler-header-panel-cell-date"); (0, _renderer.default)(element).append(span); if (!wordIndex) { (0, _renderer.default)(element).append(" ") } })) }, _appointmentCountPerCell: 1, _collectorOffset: 20, _appointmentOffset: 30 } }, { device: () => (0, _themes.isMaterial)(), options: { _appointmentTooltipOffset: { x: 0, y: 11 } } }];