@syncfusion/ej2-schedule 27.2.3 → 28.1.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/ej2-schedule.min.js +3 -3
- package/dist/ej2-schedule.umd.min.js +3 -3
- package/dist/ej2-schedule.umd.min.js.map +1 -1
- package/dist/es6/ej2-schedule.es2015.js +437 -49
- package/dist/es6/ej2-schedule.es2015.js.map +1 -1
- package/dist/es6/ej2-schedule.es5.js +469 -54
- package/dist/es6/ej2-schedule.es5.js.map +1 -1
- package/dist/global/ej2-schedule.min.js +3 -3
- package/dist/global/ej2-schedule.min.js.map +1 -1
- package/dist/global/index.d.ts +2 -2
- package/package.json +16 -16
- package/src/schedule/actions/action-base.js +4 -3
- package/src/schedule/actions/drag.js +2 -2
- package/src/schedule/actions/keyboard.d.ts +16 -0
- package/src/schedule/actions/keyboard.js +254 -8
- package/src/schedule/actions/touch.js +7 -2
- package/src/schedule/base/constant.d.ts +4 -0
- package/src/schedule/base/constant.js +4 -0
- package/src/schedule/base/css-constant.d.ts +2 -0
- package/src/schedule/base/css-constant.js +2 -0
- package/src/schedule/base/interface.d.ts +14 -4
- package/src/schedule/base/schedule-model.d.ts +17 -1
- package/src/schedule/base/schedule.d.ts +67 -1
- package/src/schedule/base/schedule.js +131 -1
- package/src/schedule/base/type.d.ts +8 -0
- package/src/schedule/models/event-settings-model.d.ts +2 -1
- package/src/schedule/models/event-settings.d.ts +2 -1
- package/src/schedule/popups/event-tooltip.js +4 -0
- package/src/schedule/renderer/agenda.d.ts +2 -1
- package/src/schedule/renderer/agenda.js +1 -1
- package/src/schedule/renderer/header-renderer.js +4 -2
- package/src/schedule/renderer/month-agenda.d.ts +2 -1
- package/src/schedule/renderer/month-agenda.js +2 -2
- package/src/schedule/renderer/month.d.ts +4 -3
- package/src/schedule/renderer/month.js +16 -9
- package/src/schedule/renderer/timeline-view.js +9 -4
- package/src/schedule/renderer/vertical-view.js +6 -2
- package/src/schedule/renderer/view-base.d.ts +5 -4
- package/src/schedule/renderer/view-base.js +13 -10
- package/src/schedule/renderer/year.d.ts +3 -2
- package/src/schedule/renderer/year.js +10 -7
- package/styles/bds-lite.css +4400 -0
- package/styles/bds-lite.scss +18 -0
- package/styles/bds.css +5161 -0
- package/styles/bds.scss +20 -0
- package/styles/bootstrap-dark-lite.css +19 -6
- package/styles/bootstrap-dark.css +23 -10
- package/styles/bootstrap-lite.css +18 -5
- package/styles/bootstrap.css +22 -9
- package/styles/bootstrap4-lite.css +18 -5
- package/styles/bootstrap4.css +22 -9
- package/styles/bootstrap5-dark-lite.css +18 -5
- package/styles/bootstrap5-dark.css +23 -10
- package/styles/bootstrap5-lite.css +18 -5
- package/styles/bootstrap5.3-lite.css +18 -5
- package/styles/bootstrap5.3.css +23 -10
- package/styles/bootstrap5.css +23 -10
- package/styles/fabric-dark-lite.css +18 -5
- package/styles/fabric-dark.css +22 -9
- package/styles/fabric-lite.css +18 -5
- package/styles/fabric.css +22 -9
- package/styles/fluent-dark-lite.css +18 -5
- package/styles/fluent-dark.css +22 -9
- package/styles/fluent-lite.css +18 -5
- package/styles/fluent.css +22 -9
- package/styles/fluent2-lite.css +43 -6
- package/styles/fluent2.css +50 -13
- package/styles/highcontrast-light-lite.css +18 -5
- package/styles/highcontrast-light.css +22 -9
- package/styles/highcontrast-lite.css +19 -6
- package/styles/highcontrast.css +23 -10
- package/styles/material-dark-lite.css +18 -5
- package/styles/material-dark.css +22 -9
- package/styles/material-lite.css +18 -5
- package/styles/material.css +22 -9
- package/styles/material3-dark-lite.css +18 -5
- package/styles/material3-dark.css +23 -10
- package/styles/material3-lite.css +18 -5
- package/styles/material3.css +23 -10
- package/styles/recurrence-editor/_bigger.scss +2 -3
- package/styles/recurrence-editor/_fluent2-definition.scss +1 -1
- package/styles/recurrence-editor/_tailwind3-definition.scss +14 -0
- package/styles/recurrence-editor/bds.css +533 -0
- package/styles/recurrence-editor/bds.scss +9 -0
- package/styles/recurrence-editor/bootstrap-dark.css +2 -3
- package/styles/recurrence-editor/bootstrap.css +2 -3
- package/styles/recurrence-editor/bootstrap4.css +2 -3
- package/styles/recurrence-editor/bootstrap5-dark.css +2 -3
- package/styles/recurrence-editor/bootstrap5.3.css +2 -3
- package/styles/recurrence-editor/bootstrap5.css +2 -3
- package/styles/recurrence-editor/fabric-dark.css +2 -3
- package/styles/recurrence-editor/fabric.css +2 -3
- package/styles/recurrence-editor/fluent-dark.css +2 -3
- package/styles/recurrence-editor/fluent.css +2 -3
- package/styles/recurrence-editor/fluent2.css +3 -4
- package/styles/recurrence-editor/highcontrast-light.css +2 -3
- package/styles/recurrence-editor/highcontrast.css +3 -4
- package/styles/recurrence-editor/material-dark.css +2 -3
- package/styles/recurrence-editor/material.css +2 -3
- package/styles/recurrence-editor/material3-dark.css +2 -3
- package/styles/recurrence-editor/material3.css +2 -3
- package/styles/recurrence-editor/tailwind-dark.css +2 -3
- package/styles/recurrence-editor/tailwind.css +2 -3
- package/styles/recurrence-editor/tailwind3.css +500 -0
- package/styles/recurrence-editor/tailwind3.scss +9 -0
- package/styles/schedule/_bigger.scss +2 -1
- package/styles/schedule/_bootstrap5-definition.scss +1 -1
- package/styles/schedule/_bootstrap5.3-definition.scss +1 -1
- package/styles/schedule/_fluent2-definition.scss +3 -3
- package/styles/schedule/_layout.scss +43 -2
- package/styles/schedule/_material3-definition.scss +1 -1
- package/styles/schedule/_tailwind-definition.scss +1 -1
- package/styles/schedule/_tailwind3-definition.scss +276 -0
- package/styles/schedule/_theme.scss +0 -4
- package/styles/schedule/bds.css +4760 -0
- package/styles/schedule/bds.scss +17 -0
- package/styles/schedule/bootstrap-dark.css +21 -7
- package/styles/schedule/bootstrap.css +20 -6
- package/styles/schedule/bootstrap4.css +20 -6
- package/styles/schedule/bootstrap5-dark.css +21 -7
- package/styles/schedule/bootstrap5.3.css +21 -7
- package/styles/schedule/bootstrap5.css +21 -7
- package/styles/schedule/fabric-dark.css +20 -6
- package/styles/schedule/fabric.css +20 -6
- package/styles/schedule/fluent-dark.css +20 -6
- package/styles/schedule/fluent.css +20 -6
- package/styles/schedule/fluent2.css +47 -9
- package/styles/schedule/highcontrast-light.css +20 -6
- package/styles/schedule/highcontrast.css +21 -7
- package/styles/schedule/icons/_tailwind3.scss +220 -0
- package/styles/schedule/material-dark.css +20 -6
- package/styles/schedule/material.css +20 -6
- package/styles/schedule/material3-dark.css +21 -7
- package/styles/schedule/material3.css +21 -7
- package/styles/schedule/tailwind-dark.css +21 -7
- package/styles/schedule/tailwind.css +21 -7
- package/styles/schedule/tailwind3.css +4599 -0
- package/styles/schedule/tailwind3.scss +17 -0
- package/styles/tailwind-dark-lite.css +18 -5
- package/styles/tailwind-dark.css +23 -10
- package/styles/tailwind-lite.css +18 -5
- package/styles/tailwind.css +23 -10
- package/styles/tailwind3-lite.css +4239 -0
- package/styles/tailwind3-lite.scss +18 -0
- package/styles/tailwind3.css +5000 -0
- package/styles/tailwind3.scss +20 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, ModuleDeclaration, Property, Event, Animation, Collection, append } from '@syncfusion/ej2-base';import { EventHandler, EmitType, Browser, Internationalization, getDefaultDateObject, cldrData, L10n } from '@syncfusion/ej2-base';import { getValue, compile, extend, isNullOrUndefined, NotifyPropertyChanges, INotifyPropertyChanged, Complex } from '@syncfusion/ej2-base';import { getElement, removeClass, addClass, classList, remove, SanitizeHtmlHelper } from '@syncfusion/ej2-base';import { createSpinner, hideSpinner, showSpinner } from '@syncfusion/ej2-popups';import { HeaderRenderer } from '../renderer/header-renderer';import { Scroll } from '../actions/scroll';import { ScheduleTouch } from '../actions/touch';import { KeyboardInteraction } from '../actions/keyboard';import { Data } from '../actions/data';import { View, CurrentAction, ReturnType, WeekRule } from '../base/type';import { EventBase } from '../event-renderer/event-base';import { InlineEdit } from '../event-renderer/inline-edit';import { QuickPopups } from '../popups/quick-popups';import { EventTooltip } from '../popups/event-tooltip';import { EventWindow } from '../popups/event-window';import { Render } from '../renderer/renderer';import { Day } from '../renderer/day';import { Week } from '../renderer/week';import { WorkWeek } from '../renderer/work-week';import { Month } from '../renderer/month';import { Year } from '../renderer/year';import { Agenda } from '../renderer/agenda';import { MonthAgenda } from '../renderer/month-agenda';import { TimelineViews } from '../renderer/timeline-view';import { TimelineMonth } from '../renderer/timeline-month';import { TimelineYear } from '../renderer/timeline-year';import { WorkHours } from '../models/work-hours';import { TimeScale } from '../models/time-scale';import { QuickInfoTemplates } from '../models/quick-info-templates';import { HeaderRows } from '../models/header-rows';import { Crud } from '../actions/crud';import { Resize } from '../actions/resize';import { DragAndDrop } from '../actions/drag';import { VirtualScroll } from '../actions/virtual-scroll';import { WorkCellInteraction } from '../actions/work-cells';import { WorkHoursModel, ViewsModel, EventSettingsModel, GroupModel, ResourcesModel, TimeScaleModel, ToolbarItemModel } from '../models/models';import { QuickInfoTemplatesModel, HeaderRowsModel } from '../models/models';import { EventSettings } from '../models/event-settings';import { Group } from '../models/group';import { Resources } from '../models/resources';import { ICalendarExport } from '../exports/calendar-export';import { ICalendarImport } from '../exports/calendar-import';import { ExcelExport } from '../exports/excel-export';import { Print } from '../exports/print';import { IRenderer, ActionEventArgs, NavigatingEventArgs, CellClickEventArgs, RenderCellEventArgs, ScrollCss, TimezoneFields } from '../base/interface';import { EventClickArgs, EventRenderedArgs, PopupOpenEventArgs, UIStateArgs, DragEventArgs, ResizeEventArgs } from '../base/interface';import { EventFieldsMapping, TdData, ResourceDetails, ResizeEdges, StateArgs, ExportOptions, SelectEventArgs } from '../base/interface';import { ViewsData, PopupCloseEventArgs, HoverEventArgs, MoreEventsClickArgs, ScrollEventArgs, CallbackFunction } from '../base/interface';import { CalendarUtil, Gregorian, Islamic, CalendarType } from '../../common/calendar-util';import { ResourceBase } from '../base/resource';import { Timezone, timezoneData } from '../timezone/timezone';import { RecurrenceEditor } from '../../recurrence-editor/recurrence-editor';import * as events from '../base/constant';import * as cls from '../base/css-constant';import * as util from '../base/util';import { ToolbarItem } from '../models/toolbar';
|
|
1
|
+
import { Component, ModuleDeclaration, Property, Event, Animation, Collection, append } from '@syncfusion/ej2-base';import { EventHandler, EmitType, Browser, Internationalization, getDefaultDateObject, cldrData, L10n } from '@syncfusion/ej2-base';import { getValue, compile, extend, isNullOrUndefined, NotifyPropertyChanges, INotifyPropertyChanged, Complex } from '@syncfusion/ej2-base';import { getElement, removeClass, addClass, classList, remove, SanitizeHtmlHelper } from '@syncfusion/ej2-base';import { createSpinner, hideSpinner, showSpinner } from '@syncfusion/ej2-popups';import { HeaderRenderer } from '../renderer/header-renderer';import { Scroll } from '../actions/scroll';import { ScheduleTouch } from '../actions/touch';import { KeyboardInteraction } from '../actions/keyboard';import { Data } from '../actions/data';import { View, CurrentAction, ReturnType, WeekRule, NavigationDirection } from '../base/type';import { EventBase } from '../event-renderer/event-base';import { InlineEdit } from '../event-renderer/inline-edit';import { QuickPopups } from '../popups/quick-popups';import { EventTooltip } from '../popups/event-tooltip';import { EventWindow } from '../popups/event-window';import { Render } from '../renderer/renderer';import { Day } from '../renderer/day';import { Week } from '../renderer/week';import { WorkWeek } from '../renderer/work-week';import { Month } from '../renderer/month';import { Year } from '../renderer/year';import { Agenda } from '../renderer/agenda';import { MonthAgenda } from '../renderer/month-agenda';import { TimelineViews } from '../renderer/timeline-view';import { TimelineMonth } from '../renderer/timeline-month';import { TimelineYear } from '../renderer/timeline-year';import { WorkHours } from '../models/work-hours';import { TimeScale } from '../models/time-scale';import { QuickInfoTemplates } from '../models/quick-info-templates';import { HeaderRows } from '../models/header-rows';import { Crud } from '../actions/crud';import { Resize } from '../actions/resize';import { DragAndDrop } from '../actions/drag';import { VirtualScroll } from '../actions/virtual-scroll';import { WorkCellInteraction } from '../actions/work-cells';import { WorkHoursModel, ViewsModel, EventSettingsModel, GroupModel, ResourcesModel, TimeScaleModel, ToolbarItemModel } from '../models/models';import { QuickInfoTemplatesModel, HeaderRowsModel } from '../models/models';import { EventSettings } from '../models/event-settings';import { Group } from '../models/group';import { Resources } from '../models/resources';import { ICalendarExport } from '../exports/calendar-export';import { ICalendarImport } from '../exports/calendar-import';import { ExcelExport } from '../exports/excel-export';import { Print } from '../exports/print';import { IRenderer, ActionEventArgs, NavigatingEventArgs, CellClickEventArgs, RenderCellEventArgs, ScrollCss, TimezoneFields } from '../base/interface';import { EventClickArgs, EventRenderedArgs, PopupOpenEventArgs, UIStateArgs, DragEventArgs, ResizeEventArgs } from '../base/interface';import { EventFieldsMapping, TdData, ResourceDetails, ResizeEdges, StateArgs, ExportOptions, SelectEventArgs } from '../base/interface';import { ViewsData, PopupCloseEventArgs, HoverEventArgs, MoreEventsClickArgs, ScrollEventArgs, CallbackFunction } from '../base/interface';import { CalendarUtil, Gregorian, Islamic, CalendarType } from '../../common/calendar-util';import { ResourceBase } from '../base/resource';import { Timezone, timezoneData } from '../timezone/timezone';import { RecurrenceEditor } from '../../recurrence-editor/recurrence-editor';import * as events from '../base/constant';import * as cls from '../base/css-constant';import * as util from '../base/util';import { ToolbarItem } from '../models/toolbar';
|
|
2
2
|
import {ComponentModel} from '@syncfusion/ej2-base';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -657,6 +657,15 @@ export interface ScheduleModel extends ComponentModel{
|
|
|
657
657
|
*/
|
|
658
658
|
cssClass?: string;
|
|
659
659
|
|
|
660
|
+
/**
|
|
661
|
+
* Enables clipboard functionality for appointments, allowing them to be copied using keyboard shortcuts and pasted onto the Scheduler.
|
|
662
|
+
* When set to `true`, users can use keyboard shortcuts to cut, copy appointments and paste them into different time slots or calendars.
|
|
663
|
+
*
|
|
664
|
+
* @default false
|
|
665
|
+
* @remarks The `allowKeyboardInteraction` property should be enabled to use the keyboard shortcuts.
|
|
666
|
+
*/
|
|
667
|
+
allowClipboard?: boolean;
|
|
668
|
+
|
|
660
669
|
/**
|
|
661
670
|
* It enables the external drag and drop support for appointments on scheduler, to be able to move them out of the scheduler layout.
|
|
662
671
|
* When the drag area is explicitly set with specific DOM element name, the appointments can be dragged anywhere within the specified drag area location.
|
|
@@ -858,4 +867,11 @@ export interface ScheduleModel extends ComponentModel{
|
|
|
858
867
|
*/
|
|
859
868
|
dataBound?: EmitType<ReturnType>;
|
|
860
869
|
|
|
870
|
+
/**
|
|
871
|
+
* Triggers once when pasting an event on the scheduler.
|
|
872
|
+
*
|
|
873
|
+
* @event 'beforePaste'
|
|
874
|
+
*/
|
|
875
|
+
beforePaste?: EmitType<ReturnType>;
|
|
876
|
+
|
|
861
877
|
}
|
|
@@ -7,7 +7,7 @@ import { Scroll } from '../actions/scroll';
|
|
|
7
7
|
import { ScheduleTouch } from '../actions/touch';
|
|
8
8
|
import { KeyboardInteraction } from '../actions/keyboard';
|
|
9
9
|
import { Data } from '../actions/data';
|
|
10
|
-
import { View, CurrentAction, ReturnType, WeekRule } from '../base/type';
|
|
10
|
+
import { View, CurrentAction, ReturnType, WeekRule, NavigationDirection } from '../base/type';
|
|
11
11
|
import { EventBase } from '../event-renderer/event-base';
|
|
12
12
|
import { InlineEdit } from '../event-renderer/inline-edit';
|
|
13
13
|
import { QuickPopups } from '../popups/quick-popups';
|
|
@@ -730,6 +730,14 @@ export declare class Schedule extends Component<HTMLElement> implements INotifyP
|
|
|
730
730
|
* @default null
|
|
731
731
|
*/
|
|
732
732
|
cssClass: string;
|
|
733
|
+
/**
|
|
734
|
+
* Enables clipboard functionality for appointments, allowing them to be copied using keyboard shortcuts and pasted onto the Scheduler.
|
|
735
|
+
* When set to `true`, users can use keyboard shortcuts to cut, copy appointments and paste them into different time slots or calendars.
|
|
736
|
+
*
|
|
737
|
+
* @default false
|
|
738
|
+
* @remarks The `allowKeyboardInteraction` property should be enabled to use the keyboard shortcuts.
|
|
739
|
+
*/
|
|
740
|
+
allowClipboard: boolean;
|
|
733
741
|
/**
|
|
734
742
|
* It enables the external drag and drop support for appointments on scheduler, to be able to move them out of the scheduler layout.
|
|
735
743
|
* When the drag area is explicitly set with specific DOM element name, the appointments can be dragged anywhere within the specified drag area location.
|
|
@@ -903,6 +911,12 @@ export declare class Schedule extends Component<HTMLElement> implements INotifyP
|
|
|
903
911
|
* @event 'dataBound'
|
|
904
912
|
*/
|
|
905
913
|
dataBound: EmitType<ReturnType>;
|
|
914
|
+
/**
|
|
915
|
+
* Triggers once when pasting an event on the scheduler.
|
|
916
|
+
*
|
|
917
|
+
* @event 'beforePaste'
|
|
918
|
+
*/
|
|
919
|
+
beforePaste: EmitType<ReturnType>;
|
|
906
920
|
/**
|
|
907
921
|
* Constructor for creating the Schedule widget
|
|
908
922
|
*
|
|
@@ -1332,6 +1346,7 @@ export declare class Schedule extends Component<HTMLElement> implements INotifyP
|
|
|
1332
1346
|
*/
|
|
1333
1347
|
getStartEndTime(startEndTime: string): Date;
|
|
1334
1348
|
private onDocumentClick;
|
|
1349
|
+
private onDocumentPaste;
|
|
1335
1350
|
private onScheduleResize;
|
|
1336
1351
|
/**
|
|
1337
1352
|
* Method to process the templates
|
|
@@ -1748,6 +1763,28 @@ export declare class Schedule extends Component<HTMLElement> implements INotifyP
|
|
|
1748
1763
|
* @returns {boolean} Returns true, if the slot that lies in the provided time range does not contain any other events.
|
|
1749
1764
|
*/
|
|
1750
1765
|
isSlotAvailable(startTime: Date | Record<string, any>, endTime?: Date, groupIndex?: number): boolean;
|
|
1766
|
+
/**
|
|
1767
|
+
* Method to copy events from an HTMLElement or an array of HTMLElements.
|
|
1768
|
+
*
|
|
1769
|
+
* @param { HTMLElement[] } elements Accepts an array of HTMLElement
|
|
1770
|
+
* @returns {void} This method does not return a value.
|
|
1771
|
+
*/
|
|
1772
|
+
copy(elements: HTMLElement[]): void;
|
|
1773
|
+
/**
|
|
1774
|
+
* Method to cut events from an HTMLElement or an array of HTMLElements.
|
|
1775
|
+
*
|
|
1776
|
+
* @param { HTMLElement[] } elements Accepts an array of HTMLElement
|
|
1777
|
+
* @returns {void} This method does not return a value.
|
|
1778
|
+
*/
|
|
1779
|
+
cut(elements: HTMLElement[]): void;
|
|
1780
|
+
/**
|
|
1781
|
+
* Method to create a paste event with clipboard data
|
|
1782
|
+
*
|
|
1783
|
+
* @param { HTMLElement } targetElement Accepts HTMLElement
|
|
1784
|
+
* @returns {void}
|
|
1785
|
+
*/
|
|
1786
|
+
paste(targetElement: HTMLElement): void;
|
|
1787
|
+
private processCutCopyActions;
|
|
1751
1788
|
/**
|
|
1752
1789
|
* To manually open the event editor on specific time or on certain events.
|
|
1753
1790
|
*
|
|
@@ -1793,6 +1830,35 @@ export declare class Schedule extends Component<HTMLElement> implements INotifyP
|
|
|
1793
1830
|
* @returns {void}
|
|
1794
1831
|
*/
|
|
1795
1832
|
closeTooltip(): void;
|
|
1833
|
+
/**
|
|
1834
|
+
* Retrieves a formatted string representing the date range of the given date collection.
|
|
1835
|
+
*
|
|
1836
|
+
* @param {Date[]} dates - An array of Date objects representing the date range.
|
|
1837
|
+
* @returns {string} A formatted string describing the date range.
|
|
1838
|
+
* If the dates is empty, returns an empty string.
|
|
1839
|
+
* Otherwise, delegates to the active view to generate the appropriate date range text.
|
|
1840
|
+
*
|
|
1841
|
+
* @example
|
|
1842
|
+
* // Assuming dates contains dates from May 1, 2023 to May 7, 2023
|
|
1843
|
+
* const rangeText = schedule.getDateRangeText(schedule.getViewDates());
|
|
1844
|
+
* // rangeText might be "May 1 - 7, 2023" (actual format depends on the active view)
|
|
1845
|
+
*
|
|
1846
|
+
* @remarks
|
|
1847
|
+
* The actual format of the returned string depends on the implementation
|
|
1848
|
+
* of the getDateRangeText method in the active view.
|
|
1849
|
+
*/
|
|
1850
|
+
getDateRangeText(dates: Date[]): string;
|
|
1851
|
+
/**
|
|
1852
|
+
* Retrieves an array of dates based on the specified date collection direction.
|
|
1853
|
+
*
|
|
1854
|
+
* @param {NavigationDirection} type - The direction for date collection. Options are:
|
|
1855
|
+
* - 'Previous': Returns the previous date range collection from the current rendered date.
|
|
1856
|
+
* - 'Next': Returns the next date range collection from the current rendered date.
|
|
1857
|
+
* - 'Current': Returns the current rendered date collection.
|
|
1858
|
+
*
|
|
1859
|
+
* @returns {Date[]} An array of Date objects representing the view dates.
|
|
1860
|
+
*/
|
|
1861
|
+
getViewDates(type?: NavigationDirection): Date[];
|
|
1796
1862
|
/**
|
|
1797
1863
|
* Select the resource based on group index in mobile mode.
|
|
1798
1864
|
*
|
|
@@ -880,6 +880,9 @@ var Schedule = /** @class */ (function (_super) {
|
|
|
880
880
|
EventHandler.add(window, 'resize', this.onScheduleResize, this);
|
|
881
881
|
EventHandler.add(window, 'orientationchange', this.onScheduleResize, this);
|
|
882
882
|
EventHandler.add(document, Browser.touchStartEvent, this.onDocumentClick, this);
|
|
883
|
+
if (this.allowClipboard) {
|
|
884
|
+
EventHandler.add(document, 'paste', this.onDocumentPaste, this);
|
|
885
|
+
}
|
|
883
886
|
};
|
|
884
887
|
/**
|
|
885
888
|
* Method to remove selected class
|
|
@@ -1255,6 +1258,9 @@ var Schedule = /** @class */ (function (_super) {
|
|
|
1255
1258
|
Schedule.prototype.onDocumentClick = function (args) {
|
|
1256
1259
|
this.notify(events.documentClick, { event: args });
|
|
1257
1260
|
};
|
|
1261
|
+
Schedule.prototype.onDocumentPaste = function (args) {
|
|
1262
|
+
this.notify(events.documentPaste, { event: args });
|
|
1263
|
+
};
|
|
1258
1264
|
Schedule.prototype.onScheduleResize = function () {
|
|
1259
1265
|
if (isNullOrUndefined(this.activeView) || ((this.isAdaptive || util.isMobile()) && document.activeElement
|
|
1260
1266
|
&& (document.activeElement.classList.contains(cls.SUBJECT_CLASS) ||
|
|
@@ -1452,6 +1458,7 @@ var Schedule = /** @class */ (function (_super) {
|
|
|
1452
1458
|
EventHandler.remove(window, 'resize', this.onScheduleResize);
|
|
1453
1459
|
EventHandler.remove(window, 'orientationchange', this.onScheduleResize);
|
|
1454
1460
|
EventHandler.remove(document, Browser.touchStartEvent, this.onDocumentClick);
|
|
1461
|
+
EventHandler.remove(document, 'paste', this.onDocumentPaste);
|
|
1455
1462
|
};
|
|
1456
1463
|
/**
|
|
1457
1464
|
* Core method to return the component name.
|
|
@@ -1687,11 +1694,12 @@ var Schedule = /** @class */ (function (_super) {
|
|
|
1687
1694
|
this.onEventSettingsPropertyChanged(newProp.eventSettings, oldProp.eventSettings, state);
|
|
1688
1695
|
break;
|
|
1689
1696
|
case 'allowKeyboardInteraction':
|
|
1697
|
+
case 'allowClipboard':
|
|
1690
1698
|
if (this.keyboardInteractionModule) {
|
|
1691
1699
|
this.keyboardInteractionModule.destroy();
|
|
1692
1700
|
this.keyboardInteractionModule = null;
|
|
1693
1701
|
}
|
|
1694
|
-
if (newProp.allowKeyboardInteraction) {
|
|
1702
|
+
if (newProp.allowKeyboardInteraction || newProp.allowClipboard) {
|
|
1695
1703
|
this.keyboardInteractionModule = new KeyboardInteraction(this);
|
|
1696
1704
|
}
|
|
1697
1705
|
break;
|
|
@@ -2618,6 +2626,76 @@ var Schedule = /** @class */ (function (_super) {
|
|
|
2618
2626
|
}
|
|
2619
2627
|
return (eventCollection.length > 0) ? false : true;
|
|
2620
2628
|
};
|
|
2629
|
+
/**
|
|
2630
|
+
* Method to copy events from an HTMLElement or an array of HTMLElements.
|
|
2631
|
+
*
|
|
2632
|
+
* @param { HTMLElement[] } elements Accepts an array of HTMLElement
|
|
2633
|
+
* @returns {void} This method does not return a value.
|
|
2634
|
+
*/
|
|
2635
|
+
Schedule.prototype.copy = function (elements) {
|
|
2636
|
+
this.processCutCopyActions(elements, false);
|
|
2637
|
+
};
|
|
2638
|
+
/**
|
|
2639
|
+
* Method to cut events from an HTMLElement or an array of HTMLElements.
|
|
2640
|
+
*
|
|
2641
|
+
* @param { HTMLElement[] } elements Accepts an array of HTMLElement
|
|
2642
|
+
* @returns {void} This method does not return a value.
|
|
2643
|
+
*/
|
|
2644
|
+
Schedule.prototype.cut = function (elements) {
|
|
2645
|
+
this.processCutCopyActions(elements, true);
|
|
2646
|
+
};
|
|
2647
|
+
/**
|
|
2648
|
+
* Method to create a paste event with clipboard data
|
|
2649
|
+
*
|
|
2650
|
+
* @param { HTMLElement } targetElement Accepts HTMLElement
|
|
2651
|
+
* @returns {void}
|
|
2652
|
+
*/
|
|
2653
|
+
Schedule.prototype.paste = function (targetElement) {
|
|
2654
|
+
var _this = this;
|
|
2655
|
+
if (!this.allowClipboard || !this.allowKeyboardInteraction) {
|
|
2656
|
+
return;
|
|
2657
|
+
}
|
|
2658
|
+
if (!targetElement.classList.contains('e-work-cells') && !targetElement.classList.contains('e-all-day-cells')) {
|
|
2659
|
+
return;
|
|
2660
|
+
}
|
|
2661
|
+
var clipboardData = new DataTransfer();
|
|
2662
|
+
if (!isNullOrUndefined(navigator.clipboard)) {
|
|
2663
|
+
navigator.clipboard.readText()
|
|
2664
|
+
.then(function (text) {
|
|
2665
|
+
clipboardData.setData('text/plain', text);
|
|
2666
|
+
var pasteEvent = new ClipboardEvent('paste', {
|
|
2667
|
+
bubbles: true,
|
|
2668
|
+
cancelable: true
|
|
2669
|
+
});
|
|
2670
|
+
Object.defineProperty(pasteEvent, 'clipboardData', {
|
|
2671
|
+
value: clipboardData
|
|
2672
|
+
});
|
|
2673
|
+
_this.keyboardInteractionModule.pasteHandler(pasteEvent, targetElement);
|
|
2674
|
+
})
|
|
2675
|
+
.catch(function (err) {
|
|
2676
|
+
throw err;
|
|
2677
|
+
});
|
|
2678
|
+
}
|
|
2679
|
+
};
|
|
2680
|
+
Schedule.prototype.processCutCopyActions = function (elements, isCut) {
|
|
2681
|
+
var _this = this;
|
|
2682
|
+
if (!elements || !this.allowClipboard || !this.allowKeyboardInteraction) {
|
|
2683
|
+
return;
|
|
2684
|
+
}
|
|
2685
|
+
var elementArray = elements;
|
|
2686
|
+
var eventDetailsArray = [];
|
|
2687
|
+
elementArray.forEach(function (element) {
|
|
2688
|
+
if (element.classList.contains(cls.APPOINTMENT_CLASS)) {
|
|
2689
|
+
var eventDetail = _this.getEventDetails(element);
|
|
2690
|
+
if (eventDetail) {
|
|
2691
|
+
eventDetailsArray.push(eventDetail);
|
|
2692
|
+
}
|
|
2693
|
+
}
|
|
2694
|
+
});
|
|
2695
|
+
if (eventDetailsArray.length > 0) {
|
|
2696
|
+
this.keyboardInteractionModule.processClipboardAction(isCut, eventDetailsArray);
|
|
2697
|
+
}
|
|
2698
|
+
};
|
|
2621
2699
|
/**
|
|
2622
2700
|
* To manually open the event editor on specific time or on certain events.
|
|
2623
2701
|
*
|
|
@@ -2750,6 +2828,52 @@ var Schedule = /** @class */ (function (_super) {
|
|
|
2750
2828
|
this.eventTooltip.close();
|
|
2751
2829
|
}
|
|
2752
2830
|
};
|
|
2831
|
+
/**
|
|
2832
|
+
* Retrieves a formatted string representing the date range of the given date collection.
|
|
2833
|
+
*
|
|
2834
|
+
* @param {Date[]} dates - An array of Date objects representing the date range.
|
|
2835
|
+
* @returns {string} A formatted string describing the date range.
|
|
2836
|
+
* If the dates is empty, returns an empty string.
|
|
2837
|
+
* Otherwise, delegates to the active view to generate the appropriate date range text.
|
|
2838
|
+
*
|
|
2839
|
+
* @example
|
|
2840
|
+
* // Assuming dates contains dates from May 1, 2023 to May 7, 2023
|
|
2841
|
+
* const rangeText = schedule.getDateRangeText(schedule.getViewDates());
|
|
2842
|
+
* // rangeText might be "May 1 - 7, 2023" (actual format depends on the active view)
|
|
2843
|
+
*
|
|
2844
|
+
* @remarks
|
|
2845
|
+
* The actual format of the returned string depends on the implementation
|
|
2846
|
+
* of the getDateRangeText method in the active view.
|
|
2847
|
+
*/
|
|
2848
|
+
Schedule.prototype.getDateRangeText = function (dates) {
|
|
2849
|
+
if ((isNullOrUndefined(dates) && dates.length === 0) || !this.activeView) {
|
|
2850
|
+
return '';
|
|
2851
|
+
}
|
|
2852
|
+
return this.activeView.getDateRangeText(dates[0], dates);
|
|
2853
|
+
};
|
|
2854
|
+
/**
|
|
2855
|
+
* Retrieves an array of dates based on the specified date collection direction.
|
|
2856
|
+
*
|
|
2857
|
+
* @param {NavigationDirection} type - The direction for date collection. Options are:
|
|
2858
|
+
* - 'Previous': Returns the previous date range collection from the current rendered date.
|
|
2859
|
+
* - 'Next': Returns the next date range collection from the current rendered date.
|
|
2860
|
+
* - 'Current': Returns the current rendered date collection.
|
|
2861
|
+
*
|
|
2862
|
+
* @returns {Date[]} An array of Date objects representing the view dates.
|
|
2863
|
+
*/
|
|
2864
|
+
Schedule.prototype.getViewDates = function (type) {
|
|
2865
|
+
if (type === void 0) { type = 'Current'; }
|
|
2866
|
+
if (!this.activeView) {
|
|
2867
|
+
return [];
|
|
2868
|
+
}
|
|
2869
|
+
switch (type) {
|
|
2870
|
+
case 'Previous':
|
|
2871
|
+
case 'Next':
|
|
2872
|
+
return this.activeView.getRenderDates(undefined, this.activeView.getNextPreviousDate(type));
|
|
2873
|
+
case 'Current':
|
|
2874
|
+
return this.getCurrentViewDates();
|
|
2875
|
+
}
|
|
2876
|
+
};
|
|
2753
2877
|
/**
|
|
2754
2878
|
* Select the resource based on group index in mobile mode.
|
|
2755
2879
|
*
|
|
@@ -3054,6 +3178,9 @@ var Schedule = /** @class */ (function (_super) {
|
|
|
3054
3178
|
__decorate([
|
|
3055
3179
|
Property()
|
|
3056
3180
|
], Schedule.prototype, "cssClass", void 0);
|
|
3181
|
+
__decorate([
|
|
3182
|
+
Property(false)
|
|
3183
|
+
], Schedule.prototype, "allowClipboard", void 0);
|
|
3057
3184
|
__decorate([
|
|
3058
3185
|
Property()
|
|
3059
3186
|
], Schedule.prototype, "eventDragArea", void 0);
|
|
@@ -3138,6 +3265,9 @@ var Schedule = /** @class */ (function (_super) {
|
|
|
3138
3265
|
__decorate([
|
|
3139
3266
|
Event()
|
|
3140
3267
|
], Schedule.prototype, "dataBound", void 0);
|
|
3268
|
+
__decorate([
|
|
3269
|
+
Event()
|
|
3270
|
+
], Schedule.prototype, "beforePaste", void 0);
|
|
3141
3271
|
Schedule = __decorate([
|
|
3142
3272
|
NotifyPropertyChanges
|
|
3143
3273
|
], Schedule);
|
|
@@ -123,3 +123,11 @@ export declare type SpannedEventPlacement = 'AllDayRow' | 'TimeSlot';
|
|
|
123
123
|
* ```
|
|
124
124
|
*/
|
|
125
125
|
export declare type ToolbarName = 'Custom' | 'Previous' | 'Next' | 'Today' | 'Views' | 'DateRangeText' | 'NewEvent';
|
|
126
|
+
/**
|
|
127
|
+
* An enum that defines the possible directions for a date collection.
|
|
128
|
+
*
|
|
129
|
+
* - **Previous:** Denotes the previous date collection.
|
|
130
|
+
* - **Next:** Denotes the next date collection.
|
|
131
|
+
* - **Current:** Denotes the current date collection.
|
|
132
|
+
*/
|
|
133
|
+
export declare type NavigationDirection = 'Previous' | 'Next' | 'Current';
|
|
@@ -122,7 +122,8 @@ export interface EventSettingsModel {
|
|
|
122
122
|
allowDeleting?: boolean;
|
|
123
123
|
|
|
124
124
|
/**
|
|
125
|
-
* It enables the event to occupy the full height
|
|
125
|
+
* It enables the event to occupy the full height in timeline views and
|
|
126
|
+
* full width in vertical views, excluding the header of the cell.
|
|
126
127
|
*
|
|
127
128
|
* @default false
|
|
128
129
|
*/
|
|
@@ -111,7 +111,8 @@ export declare class EventSettings extends ChildProperty<EventSettings> {
|
|
|
111
111
|
*/
|
|
112
112
|
allowDeleting: boolean;
|
|
113
113
|
/**
|
|
114
|
-
* It enables the event to occupy the full height
|
|
114
|
+
* It enables the event to occupy the full height in timeline views and
|
|
115
|
+
* full width in vertical views, excluding the header of the cell.
|
|
115
116
|
*
|
|
116
117
|
* @default false
|
|
117
118
|
*/
|
|
@@ -36,6 +36,10 @@ var EventTooltip = /** @class */ (function () {
|
|
|
36
36
|
return targets.join(',');
|
|
37
37
|
};
|
|
38
38
|
EventTooltip.prototype.onBeforeRender = function (args) {
|
|
39
|
+
if (this.parent.uiStateValues.isSwipeScroll) {
|
|
40
|
+
args.cancel = true;
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
39
43
|
if (!isNullOrUndefined(args.target.getAttribute('data-tooltip-id'))) {
|
|
40
44
|
return;
|
|
41
45
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IRenderer } from '../base/interface';
|
|
2
2
|
import { AgendaBase } from '../event-renderer/agenda-base';
|
|
3
3
|
import { Schedule } from '../base/schedule';
|
|
4
|
+
import { NavigationDirection } from '../base/type';
|
|
4
5
|
/**
|
|
5
6
|
* agenda view
|
|
6
7
|
*/
|
|
@@ -29,7 +30,7 @@ export declare class Agenda extends AgendaBase implements IRenderer {
|
|
|
29
30
|
private appointmentFiltering;
|
|
30
31
|
getStartDateFromEndDate(endDate: Date): Date;
|
|
31
32
|
getEndDateFromStartDate(startDate: Date): Date;
|
|
32
|
-
getNextPreviousDate(type:
|
|
33
|
+
getNextPreviousDate(type: NavigationDirection): Date;
|
|
33
34
|
startDate(): Date;
|
|
34
35
|
endDate(): Date;
|
|
35
36
|
getDateRangeText(date?: Date): string;
|
|
@@ -400,7 +400,7 @@ var Agenda = /** @class */ (function (_super) {
|
|
|
400
400
|
return util.resetTime(util.addDays(filterDate, 1));
|
|
401
401
|
};
|
|
402
402
|
Agenda.prototype.getNextPreviousDate = function (type) {
|
|
403
|
-
var noOfDays = (type === '
|
|
403
|
+
var noOfDays = (type === 'Next') ? 1 : -1;
|
|
404
404
|
return util.addDays(this.parent.selectedDate, noOfDays);
|
|
405
405
|
};
|
|
406
406
|
Agenda.prototype.startDate = function () {
|
|
@@ -481,6 +481,8 @@ var HeaderRenderer = /** @class */ (function () {
|
|
|
481
481
|
targetType: 'relative',
|
|
482
482
|
relateTo: this.getPopUpRelativeElement(),
|
|
483
483
|
position: { X: 'left', Y: 'bottom' },
|
|
484
|
+
collision: { X: 'fit' },
|
|
485
|
+
viewPortElement: this.element,
|
|
484
486
|
enableRtl: this.parent.enableRtl
|
|
485
487
|
});
|
|
486
488
|
var calendarView = this.getCalendarView();
|
|
@@ -592,10 +594,10 @@ var HeaderRenderer = /** @class */ (function () {
|
|
|
592
594
|
}
|
|
593
595
|
break;
|
|
594
596
|
case 'e-prev':
|
|
595
|
-
this.parent.changeDate(this.parent.activeView.getNextPreviousDate('
|
|
597
|
+
this.parent.changeDate(this.parent.activeView.getNextPreviousDate('Previous'), args.originalEvent);
|
|
596
598
|
break;
|
|
597
599
|
case 'e-next':
|
|
598
|
-
this.parent.changeDate(this.parent.activeView.getNextPreviousDate('
|
|
600
|
+
this.parent.changeDate(this.parent.activeView.getNextPreviousDate('Next'), args.originalEvent);
|
|
599
601
|
break;
|
|
600
602
|
case 'e-add':
|
|
601
603
|
isSameTime = this.parent.activeCellsData.startTime.getTime() === this.parent.activeCellsData.endTime.getTime();
|
|
@@ -2,6 +2,7 @@ import { CellClickEventArgs, NotifyEventArgs, TdData } from '../base/interface';
|
|
|
2
2
|
import { AgendaBase } from '../event-renderer/agenda-base';
|
|
3
3
|
import { Schedule } from '../base/schedule';
|
|
4
4
|
import { Month } from './month';
|
|
5
|
+
import { NavigationDirection } from '../base/type';
|
|
5
6
|
/**
|
|
6
7
|
* month agenda view
|
|
7
8
|
*/
|
|
@@ -22,7 +23,7 @@ export declare class MonthAgenda extends Month {
|
|
|
22
23
|
private appointmentFiltering;
|
|
23
24
|
private clearElements;
|
|
24
25
|
private appendAppContainer;
|
|
25
|
-
getNextPreviousDate(type:
|
|
26
|
+
getNextPreviousDate(type: NavigationDirection): Date;
|
|
26
27
|
private getAgendaBase;
|
|
27
28
|
destroy(): void;
|
|
28
29
|
}
|
|
@@ -160,9 +160,9 @@ var MonthAgenda = /** @class */ (function (_super) {
|
|
|
160
160
|
};
|
|
161
161
|
MonthAgenda.prototype.getNextPreviousDate = function (type) {
|
|
162
162
|
var selectedDate = this.parent.selectedDate;
|
|
163
|
-
var interval = (type === '
|
|
163
|
+
var interval = (type === 'Next') ? this.parent.activeViewOptions.interval : -this.parent.activeViewOptions.interval;
|
|
164
164
|
var navigateDate = util.addMonths(this.parent.selectedDate, interval);
|
|
165
|
-
var month = (type === '
|
|
165
|
+
var month = (type === 'Next') ? 2 : 0;
|
|
166
166
|
var lastDate = new Date(selectedDate.getFullYear(), selectedDate.getMonth() + month, 0).getDate();
|
|
167
167
|
var date = (lastDate >= this.monthAgendaDate.getDate()) ? this.monthAgendaDate.getDate() : lastDate;
|
|
168
168
|
this.monthAgendaDate = new Date(navigateDate.getFullYear(), navigateDate.getMonth(), date);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IRenderer, TdData, NotifyEventArgs, CellClickEventArgs } from '../base/interface';
|
|
2
2
|
import { Schedule } from '../base/schedule';
|
|
3
3
|
import { ViewBase } from './view-base';
|
|
4
|
+
import { NavigationDirection } from '../base/type';
|
|
4
5
|
/**
|
|
5
6
|
* month view
|
|
6
7
|
*/
|
|
@@ -45,12 +46,12 @@ export declare class Month extends ViewBase implements IRenderer {
|
|
|
45
46
|
getMonthStart(currentDate: Date): Date;
|
|
46
47
|
getMonthEnd(currentDate: Date): Date;
|
|
47
48
|
private isCustomRange;
|
|
48
|
-
getRenderDates(workDays?: number[]): Date[];
|
|
49
|
-
getNextPreviousDate(type:
|
|
49
|
+
getRenderDates(workDays?: number[], selectedDate?: Date): Date[];
|
|
50
|
+
getNextPreviousDate(type: NavigationDirection): Date;
|
|
50
51
|
getStartDate(): Date;
|
|
51
52
|
getEndDate(): Date;
|
|
52
53
|
getEndDateFromStartDate(start: Date): Date;
|
|
53
|
-
getDateRangeText(): string;
|
|
54
|
+
getDateRangeText(startDate?: Date, dateCollection?: Date[]): string;
|
|
54
55
|
getLabelText(view: string): string;
|
|
55
56
|
private createWeekNumberElement;
|
|
56
57
|
unWireEvents(): void;
|
|
@@ -593,9 +593,10 @@ var Month = /** @class */ (function (_super) {
|
|
|
593
593
|
}
|
|
594
594
|
return false;
|
|
595
595
|
};
|
|
596
|
-
Month.prototype.getRenderDates = function (workDays) {
|
|
596
|
+
Month.prototype.getRenderDates = function (workDays, selectedDate) {
|
|
597
|
+
if (selectedDate === void 0) { selectedDate = this.parent.selectedDate; }
|
|
597
598
|
var renderDates = [];
|
|
598
|
-
var currentDate = util.resetTime(
|
|
599
|
+
var currentDate = util.resetTime(selectedDate);
|
|
599
600
|
var start = this.getMonthStart(currentDate);
|
|
600
601
|
var monthEnd = this.getMonthEnd(currentDate);
|
|
601
602
|
do {
|
|
@@ -623,13 +624,13 @@ var Month = /** @class */ (function (_super) {
|
|
|
623
624
|
Month.prototype.getNextPreviousDate = function (type) {
|
|
624
625
|
if (this.isCustomMonth()) {
|
|
625
626
|
var dates = this.parent.getCurrentViewDates();
|
|
626
|
-
var date = util.getWeekFirstDate(type === '
|
|
627
|
+
var date = util.getWeekFirstDate(type === 'Next' ? dates[dates.length - 1]
|
|
627
628
|
: dates[0], this.parent.activeViewOptions.firstDayOfWeek);
|
|
628
|
-
return util.addDays(date, type === '
|
|
629
|
+
return util.addDays(date, type === 'Next' ? util.WEEK_LENGTH : -(this.parent.activeViewOptions.numberOfWeeks > 0 ?
|
|
629
630
|
this.parent.activeViewOptions.numberOfWeeks : util.DEFAULT_WEEKS) * util.WEEK_LENGTH);
|
|
630
631
|
}
|
|
631
632
|
else {
|
|
632
|
-
return util.addMonths(this.parent.selectedDate, ((type === '
|
|
633
|
+
return util.addMonths(this.parent.selectedDate, ((type === 'Next' ? 1 : -1) * this.parent.activeViewOptions.interval));
|
|
633
634
|
}
|
|
634
635
|
};
|
|
635
636
|
Month.prototype.getStartDate = function () {
|
|
@@ -641,13 +642,18 @@ var Month = /** @class */ (function (_super) {
|
|
|
641
642
|
Month.prototype.getEndDateFromStartDate = function (start) {
|
|
642
643
|
return util.addDays(new Date(start.getTime()), 1);
|
|
643
644
|
};
|
|
644
|
-
Month.prototype.getDateRangeText = function () {
|
|
645
|
+
Month.prototype.getDateRangeText = function (startDate, dateCollection) {
|
|
646
|
+
if (startDate === void 0) { startDate = this.parent.selectedDate; }
|
|
647
|
+
if (dateCollection === void 0) { dateCollection = null; }
|
|
645
648
|
if (this.parent.isAdaptive || isNullOrUndefined(this.parent.activeViewOptions.dateFormat)) {
|
|
646
|
-
var
|
|
649
|
+
var maxNumberOfDaysPerWeek = 7;
|
|
650
|
+
startDate = !isNullOrUndefined(dateCollection) && dateCollection.length > maxNumberOfDaysPerWeek - 1
|
|
651
|
+
? dateCollection[maxNumberOfDaysPerWeek - 1] : startDate;
|
|
647
652
|
var endDate = void 0;
|
|
648
653
|
var updateCustomRange = false;
|
|
649
654
|
if (this.isCustomMonth()) {
|
|
650
|
-
var dates =
|
|
655
|
+
var dates = !isNullOrUndefined(dateCollection) && dateCollection.length > 0 ? dateCollection :
|
|
656
|
+
this.parent.getCurrentViewDates();
|
|
651
657
|
updateCustomRange = dates[0].getMonth() !== dates[dates.length - 1].getMonth() ||
|
|
652
658
|
dates[0].getFullYear() !== dates[dates.length - 1].getFullYear();
|
|
653
659
|
if (updateCustomRange) {
|
|
@@ -673,7 +679,8 @@ var Month = /** @class */ (function (_super) {
|
|
|
673
679
|
var format = (this.parent.activeViewOptions.dateFormat) ? this.parent.activeViewOptions.dateFormat : 'MMMM y';
|
|
674
680
|
return util.capitalizeFirstWord(this.parent.globalize.formatDate(startDate, { format: format, calendar: this.parent.getCalendarMode() }), 'single');
|
|
675
681
|
}
|
|
676
|
-
return this.formatDateRange(
|
|
682
|
+
return this.formatDateRange(!isNullOrUndefined(dateCollection) && dateCollection.length > 0 ? dateCollection[0] :
|
|
683
|
+
this.parent.selectedDate);
|
|
677
684
|
};
|
|
678
685
|
Month.prototype.getLabelText = function (view) {
|
|
679
686
|
var viewStr = view.charAt(0).toLowerCase() + view.substring(1);
|
|
@@ -151,8 +151,13 @@ var TimelineViews = /** @class */ (function (_super) {
|
|
|
151
151
|
};
|
|
152
152
|
TimelineViews.prototype.getLeftFromDateTime = function (currentDateIndex, date) {
|
|
153
153
|
var startHour = this.getStartHour();
|
|
154
|
+
var endHour = this.getEndHour();
|
|
154
155
|
var diffInDates = 0;
|
|
155
156
|
var diffInMinutes = ((date.getHours() - startHour.getHours()) * 60) + (date.getMinutes() - startHour.getMinutes());
|
|
157
|
+
var hoursRange = util.getStartEndHours(util.resetTime(new Date(date.getTime())), startHour, endHour);
|
|
158
|
+
var interval = this.parent.activeViewOptions.timeScale.slotCount !== 1 ?
|
|
159
|
+
this.parent.activeViewOptions.timeScale.interval :
|
|
160
|
+
(hoursRange.endHour.getTime() - hoursRange.startHour.getTime()) / util.MS_PER_MINUTE;
|
|
156
161
|
if (!isNullOrUndefined(currentDateIndex)) {
|
|
157
162
|
if (currentDateIndex[0] !== 0) {
|
|
158
163
|
var index = this.parent.activeView.colLevels.findIndex(function (level) { return level[0].type === 'dateHeader'; });
|
|
@@ -162,15 +167,15 @@ var TimelineViews = /** @class */ (function (_super) {
|
|
|
162
167
|
this.parent.getElementWidth(this.element.querySelector('.e-work-cells'));
|
|
163
168
|
}
|
|
164
169
|
else {
|
|
165
|
-
var
|
|
166
|
-
var end = (
|
|
170
|
+
var endHour_1 = this.getEndHour();
|
|
171
|
+
var end = (endHour_1.getHours() === 0) ? 24 : endHour_1.getHours();
|
|
167
172
|
diffInMinutes = diffInMinutes + ((currentDateIndex[0]) * (((end - startHour.getHours()) * 60) +
|
|
168
|
-
(
|
|
173
|
+
(endHour_1.getMinutes() - startHour.getMinutes())));
|
|
169
174
|
}
|
|
170
175
|
}
|
|
171
176
|
}
|
|
172
177
|
return diffInDates + ((diffInMinutes * this.parent.getElementWidth(this.element.querySelector('.e-work-cells'))
|
|
173
|
-
* this.parent.activeViewOptions.timeScale.slotCount) /
|
|
178
|
+
* this.parent.activeViewOptions.timeScale.slotCount) / interval);
|
|
174
179
|
};
|
|
175
180
|
TimelineViews.prototype.renderHeader = function () {
|
|
176
181
|
var tr = createElement('tr');
|
|
@@ -370,9 +370,13 @@ var VerticalView = /** @class */ (function (_super) {
|
|
|
370
370
|
};
|
|
371
371
|
VerticalView.prototype.getTopFromDateTime = function (date) {
|
|
372
372
|
var startHour = this.getStartEndHours(this.parent.activeViewOptions.startHour);
|
|
373
|
+
var endHour = this.getStartEndHours(this.parent.activeViewOptions.endHour);
|
|
373
374
|
var diffInMinutes = ((date.getHours() - startHour.getHours()) * 60) + (date.getMinutes() - startHour.getMinutes());
|
|
374
|
-
|
|
375
|
-
|
|
375
|
+
var hoursRange = util.getStartEndHours(util.resetTime(new Date(date.getTime())), startHour, endHour);
|
|
376
|
+
var interval = this.parent.activeViewOptions.timeScale.slotCount !== 1 ?
|
|
377
|
+
this.parent.activeViewOptions.timeScale.interval :
|
|
378
|
+
(hoursRange.endHour.getTime() - hoursRange.startHour.getTime()) / util.MS_PER_MINUTE;
|
|
379
|
+
return (diffInMinutes * this.getWorkCellHeight() * this.parent.activeViewOptions.timeScale.slotCount) / interval;
|
|
376
380
|
};
|
|
377
381
|
VerticalView.prototype.getWorkCellHeight = function () {
|
|
378
382
|
return parseFloat(this.parent.getElementHeight(this.element.querySelector('.' + cls.WORK_CELLS_CLASS)).toFixed(2));
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Schedule } from '../base/schedule';
|
|
2
2
|
import { TdData } from '../base/interface';
|
|
3
|
+
import { NavigationDirection } from '../base/type';
|
|
3
4
|
/**
|
|
4
5
|
* view base
|
|
5
6
|
*/
|
|
6
7
|
export declare class ViewBase {
|
|
7
|
-
previousNextAction:
|
|
8
|
+
previousNextAction: NavigationDirection;
|
|
8
9
|
element: HTMLElement;
|
|
9
10
|
parent: Schedule;
|
|
10
11
|
renderDates: Date[];
|
|
@@ -53,11 +54,11 @@ export declare class ViewBase {
|
|
|
53
54
|
isCurrentMonth(date: Date): boolean;
|
|
54
55
|
isWorkDay(date: Date, workDays?: number[]): boolean;
|
|
55
56
|
isWorkHour(date: Date, startHour: Date, endHour: Date, workDays: number[]): boolean;
|
|
56
|
-
getRenderDates(workDays?: number[]): Date[];
|
|
57
|
-
getNextPreviousDate(type:
|
|
57
|
+
getRenderDates(workDays?: number[], date?: Date): Date[];
|
|
58
|
+
getNextPreviousDate(type: NavigationDirection): Date;
|
|
58
59
|
formatViewLabel(view: string, startDate: Date, endDate: Date): string;
|
|
59
60
|
getLabelText(view: string): string;
|
|
60
|
-
getDateRangeText(): string;
|
|
61
|
+
getDateRangeText(date?: Date, dateCollection?: Date[]): string;
|
|
61
62
|
formatDateRange(startDate: Date, endDate?: Date): string;
|
|
62
63
|
getMobileDateElement(date: Date, className?: string): Element;
|
|
63
64
|
setResourceHeaderContent(tdElement: Element, tdData: TdData, className?: string): void;
|