@progress/kendo-react-dateinputs 7.2.4-develop.3 → 7.3.0-develop.1
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/calendar/components/Calendar.js +12 -0
- package/calendar/components/Calendar.mjs +328 -0
- package/calendar/components/CalendarCell.js +8 -0
- package/calendar/components/CalendarCell.mjs +101 -0
- package/calendar/components/CalendarHeaderTitle.js +8 -0
- package/calendar/components/CalendarHeaderTitle.mjs +23 -0
- package/calendar/components/CalendarNavigationItem.js +8 -0
- package/calendar/components/CalendarNavigationItem.mjs +29 -0
- package/calendar/components/CalendarWeekCell.js +8 -0
- package/calendar/components/CalendarWeekCell.mjs +23 -0
- package/calendar/components/Header.js +8 -0
- package/calendar/components/Header.mjs +78 -0
- package/calendar/components/HorizontalViewList.js +8 -0
- package/calendar/components/HorizontalViewList.mjs +120 -0
- package/calendar/components/MultiViewCalendar.js +8 -0
- package/calendar/components/MultiViewCalendar.mjs +428 -0
- package/calendar/components/Navigation.js +8 -0
- package/calendar/components/Navigation.mjs +117 -0
- package/calendar/components/TodayCommand.js +8 -0
- package/calendar/components/TodayCommand.mjs +74 -0
- package/calendar/components/View.js +8 -0
- package/calendar/components/View.mjs +153 -0
- package/calendar/components/ViewList.js +8 -0
- package/calendar/components/ViewList.mjs +228 -0
- package/calendar/models/CalendarViewEnum.js +8 -0
- package/calendar/models/CalendarViewEnum.mjs +12 -0
- package/calendar/models/NavigationAction.js +8 -0
- package/calendar/models/NavigationAction.mjs +12 -0
- package/calendar/models/SelectionRange.js +8 -0
- package/calendar/models/SelectionRange.mjs +12 -0
- package/calendar/services/BusViewService.js +8 -0
- package/calendar/services/BusViewService.mjs +58 -0
- package/calendar/services/CenturyViewService.js +8 -0
- package/calendar/services/CenturyViewService.mjs +126 -0
- package/calendar/services/DOMService.js +14 -0
- package/calendar/services/DOMService.mjs +124 -0
- package/calendar/services/DecadeViewService.js +8 -0
- package/calendar/services/DecadeViewService.mjs +126 -0
- package/calendar/services/MonthViewService.js +8 -0
- package/calendar/services/MonthViewService.mjs +139 -0
- package/calendar/services/NavigationService.js +8 -0
- package/calendar/services/NavigationService.mjs +36 -0
- package/calendar/services/ScrollSyncService.js +8 -0
- package/calendar/services/ScrollSyncService.mjs +50 -0
- package/calendar/services/WeekNamesService.js +8 -0
- package/calendar/services/WeekNamesService.mjs +24 -0
- package/calendar/services/YearViewService.js +8 -0
- package/calendar/services/YearViewService.mjs +135 -0
- package/common/AdaptiveMode.js +8 -0
- package/common/AdaptiveMode.mjs +73 -0
- package/common/PickerWrap.js +8 -0
- package/common/PickerWrap.mjs +32 -0
- package/common/constants.js +8 -0
- package/common/constants.mjs +12 -0
- package/dateinput/DateInput.js +8 -0
- package/dateinput/DateInput.mjs +503 -0
- package/dateinput/models/kendo-date.js +8 -0
- package/dateinput/models/kendo-date.mjs +233 -0
- package/dateinput/models/mask.js +8 -0
- package/dateinput/models/mask.mjs +16 -0
- package/dateinput/utils.js +8 -0
- package/dateinput/utils.mjs +38 -0
- package/datepicker/DatePicker.js +8 -0
- package/datepicker/DatePicker.mjs +462 -0
- package/datepicker/ToggleButton.js +8 -0
- package/datepicker/ToggleButton.mjs +13 -0
- package/daterangepicker/DateRangePicker.js +8 -0
- package/daterangepicker/DateRangePicker.mjs +426 -0
- package/datetimepicker/DateTimePicker.js +8 -0
- package/datetimepicker/DateTimePicker.mjs +475 -0
- package/datetimepicker/DateTimeSelector.js +8 -0
- package/datetimepicker/DateTimeSelector.mjs +275 -0
- package/dist/cdn/js/kendo-react-dateinputs.js +8 -21
- package/hooks/usePickerFloatingLabel.js +8 -0
- package/hooks/usePickerFloatingLabel.mjs +31 -0
- package/index.d.mts +4528 -5
- package/index.d.ts +4528 -39
- package/index.js +8 -21
- package/index.mjs +114 -6540
- package/messages/index.js +8 -0
- package/messages/index.mjs +59 -0
- package/package-metadata.js +8 -0
- package/package-metadata.mjs +19 -0
- package/package.json +7 -7
- package/timepicker/TimeList.js +14 -0
- package/timepicker/TimeList.mjs +230 -0
- package/timepicker/TimePart.js +8 -0
- package/timepicker/TimePart.mjs +267 -0
- package/timepicker/TimePicker.js +8 -0
- package/timepicker/TimePicker.mjs +479 -0
- package/timepicker/TimeSelector.js +8 -0
- package/timepicker/TimeSelector.mjs +250 -0
- package/timepicker/models/TimePart.js +8 -0
- package/timepicker/models/TimePart.mjs +18 -0
- package/timepicker/services/DOMService.js +8 -0
- package/timepicker/services/DOMService.mjs +34 -0
- package/timepicker/services/DayPeriodService.js +8 -0
- package/timepicker/services/DayPeriodService.mjs +89 -0
- package/timepicker/services/HoursService.js +8 -0
- package/timepicker/services/HoursService.mjs +92 -0
- package/timepicker/services/MinutesService.js +8 -0
- package/timepicker/services/MinutesService.mjs +91 -0
- package/timepicker/services/SecondsService.js +8 -0
- package/timepicker/services/SecondsService.mjs +91 -0
- package/timepicker/utils.js +8 -0
- package/timepicker/utils.mjs +91 -0
- package/utils.js +8 -0
- package/utils.mjs +111 -0
- package/virtualization/Virtualization.js +8 -0
- package/virtualization/Virtualization.mjs +204 -0
- package/virtualization/services/RowHeightService.js +8 -0
- package/virtualization/services/RowHeightService.mjs +50 -0
- package/virtualization/services/ScrollerService.js +8 -0
- package/virtualization/services/ScrollerService.mjs +52 -0
- package/PopupSettings.d.ts +0 -18
- package/calendar/components/Calendar.d.ts +0 -191
- package/calendar/components/CalendarCell.d.ts +0 -39
- package/calendar/components/CalendarHeaderTitle.d.ts +0 -32
- package/calendar/components/CalendarNavigationItem.d.ts +0 -31
- package/calendar/components/CalendarWeekCell.d.ts +0 -29
- package/calendar/components/Header.d.ts +0 -58
- package/calendar/components/HorizontalViewList.d.ts +0 -71
- package/calendar/components/MultiViewCalendar.d.ts +0 -212
- package/calendar/components/Navigation.d.ts +0 -80
- package/calendar/components/TodayCommand.d.ts +0 -35
- package/calendar/components/View.d.ts +0 -89
- package/calendar/components/ViewList.d.ts +0 -115
- package/calendar/models/ActiveView.d.ts +0 -8
- package/calendar/models/CalendarSettings.d.ts +0 -106
- package/calendar/models/CalendarViewEnum.d.ts +0 -13
- package/calendar/models/CellContext.d.ts +0 -23
- package/calendar/models/MultiViewCalendarMode.d.ts +0 -13
- package/calendar/models/MultiViewCalendarSettings.d.ts +0 -115
- package/calendar/models/NavigationAction.d.ts +0 -19
- package/calendar/models/SelectionRange.d.ts +0 -21
- package/calendar/models/SelectionRangeEnd.d.ts +0 -8
- package/calendar/models/ViewService.d.ts +0 -29
- package/calendar/models/index.d.ts +0 -15
- package/calendar/services/BusViewService.d.ts +0 -25
- package/calendar/services/CenturyViewService.d.ts +0 -29
- package/calendar/services/DOMService.d.ts +0 -33
- package/calendar/services/DecadeViewService.d.ts +0 -31
- package/calendar/services/MonthViewService.d.ts +0 -37
- package/calendar/services/NavigationService.d.ts +0 -18
- package/calendar/services/ScrollSyncService.d.ts +0 -25
- package/calendar/services/WeekNamesService.d.ts +0 -13
- package/calendar/services/YearViewService.d.ts +0 -35
- package/calendar/services/index.d.ts +0 -14
- package/common/AdaptiveMode.d.ts +0 -25
- package/common/PickerWrap.d.ts +0 -22
- package/common/constants.d.ts +0 -8
- package/dateinput/DateInput.d.ts +0 -355
- package/dateinput/models/DateInputSettings.d.ts +0 -103
- package/dateinput/models/format-placeholder.d.ts +0 -43
- package/dateinput/models/incremental-steps.d.ts +0 -15
- package/dateinput/models/index.d.ts +0 -11
- package/dateinput/models/kendo-date.d.ts +0 -57
- package/dateinput/models/mask.d.ts +0 -11
- package/dateinput/models/selection.d.ts +0 -11
- package/dateinput/utils.d.ts +0 -34
- package/datepicker/DatePicker.d.ts +0 -358
- package/datepicker/ToggleButton.d.ts +0 -14
- package/datepicker/models/DatePickerSettings.d.ts +0 -141
- package/datepicker/models/index.d.ts +0 -6
- package/daterangepicker/DateRangePicker.d.ts +0 -354
- package/daterangepicker/models/DateRangePickerCalendarSettings.d.ts +0 -10
- package/daterangepicker/models/DateRangePickerDateInputSettings.d.ts +0 -10
- package/daterangepicker/models/DateRangePickerPopupSettings.d.ts +0 -10
- package/daterangepicker/models/DateRangePickerSettings.d.ts +0 -126
- package/daterangepicker/models/index.d.ts +0 -9
- package/datetimepicker/DateTimePicker.d.ts +0 -342
- package/datetimepicker/DateTimeSelector.d.ts +0 -106
- package/datetimepicker/models/DateTimePickerSettings.d.ts +0 -144
- package/datetimepicker/models/index.d.ts +0 -6
- package/hooks/usePickerFloatingLabel.d.ts +0 -24
- package/messages/index.d.ts +0 -124
- package/package-metadata.d.ts +0 -9
- package/timepicker/TimeList.d.ts +0 -91
- package/timepicker/TimePart.d.ts +0 -141
- package/timepicker/TimePicker.d.ts +0 -355
- package/timepicker/TimeSelector.d.ts +0 -144
- package/timepicker/models/IncrementalSteps.d.ts +0 -12
- package/timepicker/models/ListItem.d.ts +0 -11
- package/timepicker/models/ListService.d.ts +0 -19
- package/timepicker/models/ListServiceSettings.d.ts +0 -16
- package/timepicker/models/TimePart.d.ts +0 -14
- package/timepicker/models/TimePickerSettings.d.ts +0 -133
- package/timepicker/models/index.d.ts +0 -11
- package/timepicker/services/DOMService.d.ts +0 -14
- package/timepicker/services/DayPeriodService.d.ts +0 -51
- package/timepicker/services/HoursService.d.ts +0 -37
- package/timepicker/services/MinutesService.d.ts +0 -36
- package/timepicker/services/SecondsService.d.ts +0 -36
- package/timepicker/services/index.d.ts +0 -10
- package/timepicker/utils.d.ts +0 -60
- package/utils.d.ts +0 -100
- package/virtualization/Virtualization.d.ts +0 -120
- package/virtualization/services/RowHeightService.d.ts +0 -22
- package/virtualization/services/ScrollerService.d.ts +0 -53
- package/virtualization/services/index.d.ts +0 -7
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
var c = /* @__PURE__ */ ((t) => (t[t.month = 0] = "month", t[t.year = 1] = "year", t[t.decade = 2] = "decade", t[t.century = 3] = "century", t))(c || {});
|
|
10
|
+
export {
|
|
11
|
+
c as CalendarViewEnum
|
|
12
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var w=(e=>(e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.Up=2]="Up",e[e.Down=3]="Down",e[e.PrevView=4]="PrevView",e[e.NextView=5]="NextView",e[e.FirstInView=6]="FirstInView",e[e.LastInView=7]="LastInView",e[e.LowerView=8]="LowerView",e[e.UpperView=9]="UpperView",e))(w||{});exports.Action=w;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
var w = /* @__PURE__ */ ((e) => (e[e.Left = 0] = "Left", e[e.Right = 1] = "Right", e[e.Up = 2] = "Up", e[e.Down = 3] = "Down", e[e.PrevView = 4] = "PrevView", e[e.NextView = 5] = "NextView", e[e.FirstInView = 6] = "FirstInView", e[e.LastInView = 7] = "LastInView", e[e.LowerView = 8] = "LowerView", e[e.UpperView = 9] = "UpperView", e))(w || {});
|
|
10
|
+
export {
|
|
11
|
+
w as Action
|
|
12
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={start:null,end:null};exports.EMPTY_SELECTIONRANGE=e;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
const l = { start: null, end: null };
|
|
10
|
+
export {
|
|
11
|
+
l as EMPTY_SELECTIONRANGE
|
|
12
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./CenturyViewService.js"),s=require("./DecadeViewService.js"),a=require("./MonthViewService.js"),u=require("./YearViewService.js"),i=require("../models/CalendarViewEnum.js"),m={[i.CalendarViewEnum.month]:a.MonthViewService,[i.CalendarViewEnum.year]:u.YearViewService,[i.CalendarViewEnum.decade]:s.DecadeViewService,[i.CalendarViewEnum.century]:c.CenturyViewService},h=(r,e)=>{const t=i.CalendarViewEnum[i.CalendarViewEnum[r+e]];return t!==void 0?t:r};class w{constructor(e){this.bottom=i.CalendarViewEnum.month,this.top=i.CalendarViewEnum.century,this.onViewChanged=e}configure(e,t){this.bottom=e,this.top=t}service(e,t){return new m[`${e}`](t)}moveDown(e,t){this.move(e,-1,t)}moveUp(e,t){this.move(e,1,t)}moveToBottom(e){e!==this.bottom&&this.onViewChanged({view:this.bottom})}canMoveDown(e){return this.bottom<e}canMoveUp(e){return e<this.top}clamp(e){return e<this.bottom?this.bottom:e>this.top?this.top:e}move(e,t,o){const n=this.clamp(h(e,t));n!==e&&this.onViewChanged({view:n},o)}}exports.BusViewService=w;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import { CenturyViewService as s } from "./CenturyViewService.mjs";
|
|
10
|
+
import { DecadeViewService as m } from "./DecadeViewService.mjs";
|
|
11
|
+
import { MonthViewService as c } from "./MonthViewService.mjs";
|
|
12
|
+
import { YearViewService as h } from "./YearViewService.mjs";
|
|
13
|
+
import { CalendarViewEnum as o } from "../models/CalendarViewEnum.mjs";
|
|
14
|
+
const a = {
|
|
15
|
+
[o.month]: c,
|
|
16
|
+
[o.year]: h,
|
|
17
|
+
[o.decade]: m,
|
|
18
|
+
[o.century]: s
|
|
19
|
+
}, u = (i, t) => {
|
|
20
|
+
const e = o[o[i + t]];
|
|
21
|
+
return e !== void 0 ? e : i;
|
|
22
|
+
};
|
|
23
|
+
class V {
|
|
24
|
+
constructor(t) {
|
|
25
|
+
this.bottom = o.month, this.top = o.century, this.onViewChanged = t;
|
|
26
|
+
}
|
|
27
|
+
configure(t, e) {
|
|
28
|
+
this.bottom = t, this.top = e;
|
|
29
|
+
}
|
|
30
|
+
service(t, e) {
|
|
31
|
+
return new a[`${t}`](e);
|
|
32
|
+
}
|
|
33
|
+
moveDown(t, e) {
|
|
34
|
+
this.move(t, -1, e);
|
|
35
|
+
}
|
|
36
|
+
moveUp(t, e) {
|
|
37
|
+
this.move(t, 1, e);
|
|
38
|
+
}
|
|
39
|
+
moveToBottom(t) {
|
|
40
|
+
t !== this.bottom && this.onViewChanged({ view: this.bottom });
|
|
41
|
+
}
|
|
42
|
+
canMoveDown(t) {
|
|
43
|
+
return this.bottom < t;
|
|
44
|
+
}
|
|
45
|
+
canMoveUp(t) {
|
|
46
|
+
return t < this.top;
|
|
47
|
+
}
|
|
48
|
+
clamp(t) {
|
|
49
|
+
return t < this.bottom ? this.bottom : t > this.top ? this.top : t;
|
|
50
|
+
}
|
|
51
|
+
move(t, e, n) {
|
|
52
|
+
const r = this.clamp(u(t, e));
|
|
53
|
+
r !== t && this.onViewChanged({ view: r }, n);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
export {
|
|
57
|
+
V as BusViewService
|
|
58
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@progress/kendo-date-math"),o=require("../models/NavigationAction.js"),R=require("../models/SelectionRange.js"),u=require("../../utils.js"),T=[[]],E=4,q=3,V={[o.Action.Left]:n=>r.addDecades(n,-1),[o.Action.Up]:n=>r.addDecades(n,-5),[o.Action.Right]:n=>r.addDecades(n,1),[o.Action.Down]:n=>r.addDecades(n,5),[o.Action.PrevView]:n=>r.addCenturies(n,-1),[o.Action.NextView]:n=>r.addCenturies(n,1),[o.Action.FirstInView]:n=>r.firstDecadeOfCentury(n),[o.Action.LastInView]:n=>r.lastDecadeOfCentury(n)};class v{addToDate(e,t){return r.addCenturies(e,t)}datesList(e,t){return u.range(0,t).map(i=>r.addCenturies(e,i))}data(e){const{cellUID:t,focusedDate:i,isActiveView:c,max:a,min:l,selectedDate:d,selectionRange:f=R.EMPTY_SELECTIONRANGE,viewDate:g}=e;if(!g)return T;const h=u.range(0,E),D=r.firstDecadeOfCentury(g),S=r.lastDecadeOfCentury(g),A=u.getToday();return u.range(0,q).map(I=>{const F=r.addDecades(D,I*E);return h.map(O=>{const s=this.normalize(r.addDecades(F,O),l,a),y=this.isEqual(s,f.start),C=this.isEqual(s,f.end),Y=!y&&!C&&u.isInSelectionRange(s,f),w=c&&(Array.isArray(d)?this.isSelectedFromArray(s,d,l,a):u.isInRange(d,l,a)&&this.isEqual(s,d));return u.intersects(s,D,S)?{formattedValue:this.value(s),id:`${t}${s.getTime()}`,isFocused:this.isEqual(s,i),isSelected:w,isWeekend:!1,isInRange:u.isInRange(s,l,a),isRangeStart:y,isRangeMid:Y,isRangeEnd:C,isRangeSplitEnd:Y&&this.isEqual(s,S),isRangeSplitStart:Y&&this.isEqual(s,D),isToday:this.isEqual(s,A),title:this.cellTitle(s),value:s}:null})})}isSelectedFromArray(e,t,i,c){let a=!1;return t.forEach(l=>{u.isInRange(e,i,c)&&this.isEqual(e,l)&&(a=!0)}),a}isEqual(e,t){return!e||!t?!1:r.firstYearOfDecade(e).getFullYear()===r.firstYearOfDecade(t).getFullYear()}isInArray(e,t){if(!t.length)return!1;const i=e.getFullYear();return t[0].getFullYear()<=i&&i<=t[t.length-1].getFullYear()+99}isInRange(e,t,i){const c=r.firstYearOfDecade(e).getFullYear(),a=!t||r.firstYearOfDecade(t).getFullYear()<=c,l=!i||c<=r.firstYearOfDecade(i).getFullYear();return a&&l}isInSameView(e,t){return r.durationInCenturies(e,t)===0}isRangeStart(e){return e.getFullYear()%1e3===0}move(e,t){const i=V[t];return i?i(e):e}cellTitle(e){return r.firstYearOfDecade(e).getFullYear().toString()}navigationTitle(e){return e?r.firstDecadeOfCentury(e).getFullYear().toString():""}title(e){return e?`${r.firstDecadeOfCentury(e).getFullYear()} - ${r.lastDecadeOfCentury(e).getFullYear()}`:""}rowLength(e){return E}skip(e,t){return r.durationInCenturies(t,e)}total(e,t){return r.durationInCenturies(e,t)+1}value(e){return e?r.firstYearOfDecade(e).getFullYear().toString():""}viewDate(e,t,i=1){return r.durationInCenturies(e,t)<i?r.addCenturies(e,-1):e}normalize(e,t,i){return e<t&&this.isEqual(e,t)?r.cloneDate(t):e>i&&this.isEqual(e,i)?r.cloneDate(i):e}}exports.CenturyViewService=v;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import { addDecades as c, addCenturies as g, firstDecadeOfCentury as E, lastDecadeOfCentury as I, firstYearOfDecade as o, durationInCenturies as d, cloneDate as p } from "@progress/kendo-date-math";
|
|
10
|
+
import { Action as l } from "../models/NavigationAction.mjs";
|
|
11
|
+
import { EMPTY_SELECTIONRANGE as M } from "../models/SelectionRange.mjs";
|
|
12
|
+
import { range as m, getToday as N, isInRange as w, intersects as O, isInSelectionRange as _ } from "../../utils.mjs";
|
|
13
|
+
const $ = [[]], T = 4, b = 3, G = {
|
|
14
|
+
[l.Left]: (i) => c(i, -1),
|
|
15
|
+
[l.Up]: (i) => c(i, -5),
|
|
16
|
+
[l.Right]: (i) => c(i, 1),
|
|
17
|
+
[l.Down]: (i) => c(i, 5),
|
|
18
|
+
[l.PrevView]: (i) => g(i, -1),
|
|
19
|
+
[l.NextView]: (i) => g(i, 1),
|
|
20
|
+
[l.FirstInView]: (i) => E(i),
|
|
21
|
+
[l.LastInView]: (i) => I(i)
|
|
22
|
+
};
|
|
23
|
+
class W {
|
|
24
|
+
addToDate(e, t) {
|
|
25
|
+
return g(e, t);
|
|
26
|
+
}
|
|
27
|
+
datesList(e, t) {
|
|
28
|
+
return m(0, t).map((r) => g(e, r));
|
|
29
|
+
}
|
|
30
|
+
data(e) {
|
|
31
|
+
const {
|
|
32
|
+
cellUID: t,
|
|
33
|
+
focusedDate: r,
|
|
34
|
+
isActiveView: u,
|
|
35
|
+
max: s,
|
|
36
|
+
min: a,
|
|
37
|
+
selectedDate: f,
|
|
38
|
+
selectionRange: h = M,
|
|
39
|
+
viewDate: F
|
|
40
|
+
} = e;
|
|
41
|
+
if (!F)
|
|
42
|
+
return $;
|
|
43
|
+
const q = m(0, T), S = E(F), R = I(F), A = N();
|
|
44
|
+
return m(0, b).map((V) => {
|
|
45
|
+
const L = c(S, V * T);
|
|
46
|
+
return q.map((C) => {
|
|
47
|
+
const n = this.normalize(c(L, C), a, s), y = this.isEqual(n, h.start), D = this.isEqual(n, h.end), Y = !y && !D && _(n, h), v = u && (Array.isArray(f) ? this.isSelectedFromArray(n, f, a, s) : w(f, a, s) && this.isEqual(n, f));
|
|
48
|
+
return O(n, S, R) ? {
|
|
49
|
+
formattedValue: this.value(n),
|
|
50
|
+
id: `${t}${n.getTime()}`,
|
|
51
|
+
isFocused: this.isEqual(n, r),
|
|
52
|
+
isSelected: v,
|
|
53
|
+
isWeekend: !1,
|
|
54
|
+
isInRange: w(n, a, s),
|
|
55
|
+
isRangeStart: y,
|
|
56
|
+
isRangeMid: Y,
|
|
57
|
+
isRangeEnd: D,
|
|
58
|
+
isRangeSplitEnd: Y && this.isEqual(n, R),
|
|
59
|
+
isRangeSplitStart: Y && this.isEqual(n, S),
|
|
60
|
+
isToday: this.isEqual(n, A),
|
|
61
|
+
title: this.cellTitle(n),
|
|
62
|
+
value: n
|
|
63
|
+
} : null;
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
isSelectedFromArray(e, t, r, u) {
|
|
68
|
+
let s = !1;
|
|
69
|
+
return t.forEach((a) => {
|
|
70
|
+
w(e, r, u) && this.isEqual(e, a) && (s = !0);
|
|
71
|
+
}), s;
|
|
72
|
+
}
|
|
73
|
+
isEqual(e, t) {
|
|
74
|
+
return !e || !t ? !1 : o(e).getFullYear() === o(t).getFullYear();
|
|
75
|
+
}
|
|
76
|
+
isInArray(e, t) {
|
|
77
|
+
if (!t.length)
|
|
78
|
+
return !1;
|
|
79
|
+
const r = e.getFullYear();
|
|
80
|
+
return t[0].getFullYear() <= r && r <= t[t.length - 1].getFullYear() + 99;
|
|
81
|
+
}
|
|
82
|
+
isInRange(e, t, r) {
|
|
83
|
+
const u = o(e).getFullYear(), s = !t || o(t).getFullYear() <= u, a = !r || u <= o(r).getFullYear();
|
|
84
|
+
return s && a;
|
|
85
|
+
}
|
|
86
|
+
isInSameView(e, t) {
|
|
87
|
+
return d(e, t) === 0;
|
|
88
|
+
}
|
|
89
|
+
isRangeStart(e) {
|
|
90
|
+
return e.getFullYear() % 1e3 === 0;
|
|
91
|
+
}
|
|
92
|
+
move(e, t) {
|
|
93
|
+
const r = G[t];
|
|
94
|
+
return r ? r(e) : e;
|
|
95
|
+
}
|
|
96
|
+
cellTitle(e) {
|
|
97
|
+
return o(e).getFullYear().toString();
|
|
98
|
+
}
|
|
99
|
+
navigationTitle(e) {
|
|
100
|
+
return e ? E(e).getFullYear().toString() : "";
|
|
101
|
+
}
|
|
102
|
+
title(e) {
|
|
103
|
+
return e ? `${E(e).getFullYear()} - ${I(e).getFullYear()}` : "";
|
|
104
|
+
}
|
|
105
|
+
rowLength(e) {
|
|
106
|
+
return T;
|
|
107
|
+
}
|
|
108
|
+
skip(e, t) {
|
|
109
|
+
return d(t, e);
|
|
110
|
+
}
|
|
111
|
+
total(e, t) {
|
|
112
|
+
return d(e, t) + 1;
|
|
113
|
+
}
|
|
114
|
+
value(e) {
|
|
115
|
+
return e ? o(e).getFullYear().toString() : "";
|
|
116
|
+
}
|
|
117
|
+
viewDate(e, t, r = 1) {
|
|
118
|
+
return d(e, t) < r ? g(e, -1) : e;
|
|
119
|
+
}
|
|
120
|
+
normalize(e, t, r) {
|
|
121
|
+
return e < t && this.isEqual(e, t) ? p(t) : e > r && this.isEqual(e, r) ? p(r) : e;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
export {
|
|
125
|
+
W as CenturyViewService
|
|
126
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../models/CalendarViewEnum.js"),n=require("../../utils.js"),m=require("@progress/kendo-react-common");class N{constructor(){this.calendarHeight=0,this.headerHeight=0,this.monthViewHeight=0,this.yearViewHeight=0,this.decadeViewHeight=0,this.centuryViewHeight=0,this.navigationItemHeight=0,this.scrollableContentHeight=0,this.scrollableYearContentHeight=0,this.calendarWidth=0,this.monthViewWidth=0,this.yearViewWidth=0,this.decadeViewWidth=0,this.centuryViewWidth=0,this.scrollableContentWidth=0,this.didCalculate=!1,this.hostContainer=null}ensureHeights(){this.calendarHeight===void 0&&this.calculateHeights()}calculateHeights(a){if(!m.canUseDOM)return;const s=n.domContainerFactory("div"),i=n.domContainerFactory("ul"),l=n.domContainerFactory("li"),p=n.domContainerFactory("td"),F=n.domContainerFactory("th"),w=n.domContainerFactory("tr"),D=n.domContainerFactory("tbody"),S=n.domContainerFactory("thead"),v=n.domContainerFactory("table"),C=()=>s(`
|
|
9
|
+
<span class="k-button k-button-md k-button-rectangle k-button-solid k-button-solid-base k-button-flat k-calendar-title">
|
|
10
|
+
<span className="k-button-text">March 2017</span>
|
|
11
|
+
</span>
|
|
12
|
+
<span class="k-spacer"></span>
|
|
13
|
+
<span class="k-calendar-nav k-hstack"><button class="k-calendar-nav-today">TODAY</button></span>
|
|
14
|
+
`,"k-calendar-header k-hstack"),M=()=>v([S([w([F("MO","k-calendar-th")],"k-calendar-tr")],"k-calendar-thead")],"k-calendar-table k-calendar-weekdays"),V=(t,e)=>new Array(t).fill("1").map(e),O=(t,e=1)=>v([D([w([p("1","k-calendar-td k-alt")])].concat(V(t,()=>w(V(e,c=>p(`<span class="k-link">${c}</span>`,"k-calendar-td")),"k-calendar-tr"))),"k-calendar-tbody")],"k-calendar-table"),k=t=>s(t,"k-content k-scrollable"),q=(t,e,c)=>s(c?[C(),M(),k([t,t])]:[C(),k([t,t])],e,{left:"-10000px",position:"absolute"}),$=(()=>{let t;return()=>m.canUseDOM?(t||(t=s([k([i([l("<span>FEB</span>")])])],"k-calendar-navigation",{left:"0px",position:"absolute"})),t):null})(),g=({cells:t,rows:e},c,E)=>{let y;return()=>m.canUseDOM?(y||(y=q(O(e,t),c,E)),y):null},d=t=>t.querySelector(".k-scrollable"),b=t=>{const e=d(t);return e.className=`${e.className} k-scrollable-horizontal`,t},H=g({cells:7,rows:6},"k-calendar-view k-calendar-monthview k-vstack",!0),f=g({cells:5,rows:3},"k-calendar-view k-calendar-yearview",!1),W=g({cells:5,rows:2},"k-calendar-view k-calendar-decadeview",!1),z=()=>b(H()),Y=()=>b(f()),x=()=>b(W()),r=t=>parseFloat(window.getComputedStyle(t).height)||t.offsetHeight,h=t=>{const e=window.getComputedStyle(t);return parseFloat(e.width)+parseFloat(e.paddingLeft)+parseFloat(e.paddingRight)||t.offsetWidth},o=t=>t.querySelector("tbody");this.didCalculate=!0,a&&(this.hostContainer=a),this.batch(H(),t=>{const e=o(t);this.calendarHeight=r(t),this.monthViewHeight=r(e),this.headerHeight=r(e.children[0]),this.scrollableContentHeight=r(d(t))}),this.batch(z(),t=>{const e=o(t);this.calendarWidth=h(t),this.monthViewWidth=h(e),this.scrollableContentWidth=h(d(t))}),this.batch(f(),t=>{this.yearViewHeight=r(o(t)),this.scrollableYearContentHeight=r(d(t))}),this.batch(Y(),t=>{this.yearViewWidth=h(o(t))}),this.batch(W(),t=>{this.decadeViewHeight=r(o(t)),this.centuryViewHeight=this.decadeViewHeight}),this.batch(x(),t=>{this.decadeViewWidth=h(o(t)),this.centuryViewWidth=this.decadeViewWidth}),this.batch($(),t=>{this.navigationItemHeight=r(t.querySelector("li"))})}viewHeight(a){return this.viewDimension(a,"height")}viewWidth(a){return this.viewDimension(a,"width")}viewDimension(a,s){const i=s==="height"?"ViewHeight":"ViewWidth";switch(a){case u.CalendarViewEnum.month:return this[`month${i}`];case u.CalendarViewEnum.year:return this[`year${i}`];case u.CalendarViewEnum.decade:return this[`decade${i}`];case u.CalendarViewEnum.century:return this[`century${i}`];default:return 1}}batch(a,s){const i=this.hostContainer||document.body,l=i.appendChild(a);s(l),i.removeChild(l)}}exports.DOMService=N;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import { CalendarViewEnum as u } from "../models/CalendarViewEnum.mjs";
|
|
10
|
+
import { domContainerFactory as s } from "../../utils.mjs";
|
|
11
|
+
import { canUseDOM as y } from "@progress/kendo-react-common";
|
|
12
|
+
class P {
|
|
13
|
+
constructor() {
|
|
14
|
+
this.calendarHeight = 0, this.headerHeight = 0, this.monthViewHeight = 0, this.yearViewHeight = 0, this.decadeViewHeight = 0, this.centuryViewHeight = 0, this.navigationItemHeight = 0, this.scrollableContentHeight = 0, this.scrollableYearContentHeight = 0, this.calendarWidth = 0, this.monthViewWidth = 0, this.yearViewWidth = 0, this.decadeViewWidth = 0, this.centuryViewWidth = 0, this.scrollableContentWidth = 0, this.didCalculate = !1, this.hostContainer = null;
|
|
15
|
+
}
|
|
16
|
+
ensureHeights() {
|
|
17
|
+
this.calendarHeight === void 0 && this.calculateHeights();
|
|
18
|
+
}
|
|
19
|
+
calculateHeights(i) {
|
|
20
|
+
if (!y)
|
|
21
|
+
return;
|
|
22
|
+
const n = s("div"), a = s("ul"), l = s("li"), v = s("td"), D = s("th"), w = s("tr"), F = s("tbody"), S = s("thead"), m = s("table"), H = () => n(
|
|
23
|
+
`
|
|
24
|
+
<span class="k-button k-button-md k-button-rectangle k-button-solid k-button-solid-base k-button-flat k-calendar-title">
|
|
25
|
+
<span className="k-button-text">March 2017</span>
|
|
26
|
+
</span>
|
|
27
|
+
<span class="k-spacer"></span>
|
|
28
|
+
<span class="k-calendar-nav k-hstack"><button class="k-calendar-nav-today">TODAY</button></span>
|
|
29
|
+
`,
|
|
30
|
+
"k-calendar-header k-hstack"
|
|
31
|
+
), $ = () => m(
|
|
32
|
+
[
|
|
33
|
+
S([
|
|
34
|
+
w([D("MO", "k-calendar-th")], "k-calendar-tr")
|
|
35
|
+
], "k-calendar-thead")
|
|
36
|
+
],
|
|
37
|
+
"k-calendar-table k-calendar-weekdays"
|
|
38
|
+
), V = (t, e) => new Array(t).fill("1").map(e), z = (t, e = 1) => m([
|
|
39
|
+
F(
|
|
40
|
+
[w(
|
|
41
|
+
[v("1", "k-calendar-td k-alt")]
|
|
42
|
+
)].concat(
|
|
43
|
+
V(
|
|
44
|
+
t,
|
|
45
|
+
() => w(V(e, (o) => v(`<span class="k-link">${o}</span>`, "k-calendar-td")), "k-calendar-tr")
|
|
46
|
+
)
|
|
47
|
+
),
|
|
48
|
+
"k-calendar-tbody"
|
|
49
|
+
)
|
|
50
|
+
], "k-calendar-table"), k = (t) => n(t, "k-content k-scrollable"), M = (t, e, o) => n(
|
|
51
|
+
o ? [
|
|
52
|
+
H(),
|
|
53
|
+
$(),
|
|
54
|
+
k([t, t])
|
|
55
|
+
] : [
|
|
56
|
+
H(),
|
|
57
|
+
k([t, t])
|
|
58
|
+
],
|
|
59
|
+
e,
|
|
60
|
+
{ left: "-10000px", position: "absolute" }
|
|
61
|
+
), x = /* @__PURE__ */ (() => {
|
|
62
|
+
let t;
|
|
63
|
+
return () => y ? (t || (t = n(
|
|
64
|
+
[k([a([l("<span>FEB</span>")])])],
|
|
65
|
+
"k-calendar-navigation",
|
|
66
|
+
{ left: "0px", position: "absolute" }
|
|
67
|
+
)), t) : null;
|
|
68
|
+
})(), g = ({ cells: t, rows: e }, o, N) => {
|
|
69
|
+
let p;
|
|
70
|
+
return () => y ? (p || (p = M(z(e, t), o, N)), p) : null;
|
|
71
|
+
}, d = (t) => t.querySelector(".k-scrollable"), b = (t) => {
|
|
72
|
+
const e = d(t);
|
|
73
|
+
return e.className = `${e.className} k-scrollable-horizontal`, t;
|
|
74
|
+
}, f = g({ cells: 7, rows: 6 }, "k-calendar-view k-calendar-monthview k-vstack", !0), C = g({ cells: 5, rows: 3 }, "k-calendar-view k-calendar-yearview", !1), W = g({ cells: 5, rows: 2 }, "k-calendar-view k-calendar-decadeview", !1), O = () => b(f()), Y = () => b(C()), q = () => b(W()), h = (t) => parseFloat(window.getComputedStyle(t).height) || t.offsetHeight, c = (t) => {
|
|
75
|
+
const e = window.getComputedStyle(t);
|
|
76
|
+
return parseFloat(e.width) + parseFloat(e.paddingLeft) + parseFloat(e.paddingRight) || t.offsetWidth;
|
|
77
|
+
}, r = (t) => t.querySelector("tbody");
|
|
78
|
+
this.didCalculate = !0, i && (this.hostContainer = i), this.batch(f(), (t) => {
|
|
79
|
+
const e = r(t);
|
|
80
|
+
this.calendarHeight = h(t), this.monthViewHeight = h(e), this.headerHeight = h(e.children[0]), this.scrollableContentHeight = h(d(t));
|
|
81
|
+
}), this.batch(O(), (t) => {
|
|
82
|
+
const e = r(t);
|
|
83
|
+
this.calendarWidth = c(t), this.monthViewWidth = c(e), this.scrollableContentWidth = c(d(t));
|
|
84
|
+
}), this.batch(C(), (t) => {
|
|
85
|
+
this.yearViewHeight = h(r(t)), this.scrollableYearContentHeight = h(d(t));
|
|
86
|
+
}), this.batch(Y(), (t) => {
|
|
87
|
+
this.yearViewWidth = c(r(t));
|
|
88
|
+
}), this.batch(W(), (t) => {
|
|
89
|
+
this.decadeViewHeight = h(r(t)), this.centuryViewHeight = this.decadeViewHeight;
|
|
90
|
+
}), this.batch(q(), (t) => {
|
|
91
|
+
this.decadeViewWidth = c(r(t)), this.centuryViewWidth = this.decadeViewWidth;
|
|
92
|
+
}), this.batch(x(), (t) => {
|
|
93
|
+
this.navigationItemHeight = h(t.querySelector("li"));
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
viewHeight(i) {
|
|
97
|
+
return this.viewDimension(i, "height");
|
|
98
|
+
}
|
|
99
|
+
viewWidth(i) {
|
|
100
|
+
return this.viewDimension(i, "width");
|
|
101
|
+
}
|
|
102
|
+
viewDimension(i, n) {
|
|
103
|
+
const a = n === "height" ? "ViewHeight" : "ViewWidth";
|
|
104
|
+
switch (i) {
|
|
105
|
+
case u.month:
|
|
106
|
+
return this[`month${a}`];
|
|
107
|
+
case u.year:
|
|
108
|
+
return this[`year${a}`];
|
|
109
|
+
case u.decade:
|
|
110
|
+
return this[`decade${a}`];
|
|
111
|
+
case u.century:
|
|
112
|
+
return this[`century${a}`];
|
|
113
|
+
default:
|
|
114
|
+
return 1;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
batch(i, n) {
|
|
118
|
+
const a = this.hostContainer || document.body, l = a.appendChild(i);
|
|
119
|
+
n(l), a.removeChild(l);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
export {
|
|
123
|
+
P as DOMService
|
|
124
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@progress/kendo-date-math"),c=require("../models/NavigationAction.js"),y=require("../models/SelectionRange.js"),l=require("../../utils.js"),O=[[]],E=4,V=3,v={[c.Action.Left]:i=>r.addYears(i,-1),[c.Action.Up]:i=>r.addYears(i,-5),[c.Action.Right]:i=>r.addYears(i,1),[c.Action.Down]:i=>r.addYears(i,5),[c.Action.PrevView]:i=>r.addDecades(i,-1),[c.Action.NextView]:i=>r.addDecades(i,1),[c.Action.FirstInView]:i=>r.firstYearOfDecade(i),[c.Action.LastInView]:i=>r.lastYearOfDecade(i)};class m{addToDate(e,t){return r.addDecades(e,t)}datesList(e,t){return l.range(0,t).map(a=>r.addDecades(e,a))}data(e){const{cellUID:t,focusedDate:a,isActiveView:u,max:s,min:o,selectedDate:d,selectionRange:g=y.EMPTY_SELECTIONRANGE,viewDate:f}=e;if(!f)return O;const I=l.range(0,E),D=r.firstYearOfDecade(f),S=r.lastYearOfDecade(f),F=l.getToday();return l.range(0,V).map(w=>{const R=r.addYears(D,w*E);return I.map(T=>{const n=this.normalize(r.addYears(R,T),o,s),h=this.isEqual(n,g.start),A=this.isEqual(n,g.end),Y=!h&&!A&&l.isInSelectionRange(n,g),q=u&&(Array.isArray(d)?this.isSelectedFromArray(n,d,o,s):l.isInRange(d,o,s)&&this.isEqual(n,d));return l.intersects(n,D,S)?{formattedValue:this.value(n),id:`${t}${n.getTime()}`,isFocused:this.isEqual(n,a),isSelected:q,isWeekend:!1,isInRange:l.isInRange(n,o,s),isRangeStart:h,isRangeMid:Y,isRangeEnd:A,isRangeSplitEnd:Y&&this.isEqual(n,S),isRangeSplitStart:Y&&this.isEqual(n,D),isToday:this.isEqual(n,F),title:this.cellTitle(n),value:n}:null})})}isSelectedFromArray(e,t,a,u){let s=!1;return t.forEach(o=>{l.isInRange(e,a,u)&&this.isEqual(e,o)&&(s=!0)}),s}isEqual(e,t){return!e||!t?!1:e.getFullYear()===t.getFullYear()}isInArray(e,t){if(!t.length)return!1;const a=e.getFullYear();return t[0].getFullYear()<=a&&a<=t[t.length-1].getFullYear()+9}isInRange(e,t,a){const u=e.getFullYear(),s=!t||t.getFullYear()<=u,o=!a||u<=a.getFullYear();return s&&o}isRangeStart(e){return e.getFullYear()%100===0}isInSameView(e,t){return r.durationInDecades(e,t)===0}move(e,t){const a=v[t];return a?a(e):e}cellTitle(e){return e.getFullYear().toString()}navigationTitle(e){return e?r.firstYearOfDecade(e).getFullYear().toString():""}title(e){return e?`${r.firstYearOfDecade(e).getFullYear()} - ${r.lastYearOfDecade(e).getFullYear()}`:""}rowLength(e){return E}skip(e,t){return r.durationInDecades(t,e)}total(e,t){return r.durationInDecades(e,t)+1}value(e){return e?e.getFullYear().toString():""}viewDate(e,t,a=1){return r.durationInDecades(e,t)<a?r.addDecades(e,-1):e}normalize(e,t,a){return e<t&&this.isEqual(e,t)?r.cloneDate(t):e>a&&this.isEqual(e,a)?r.cloneDate(a):e}}exports.DecadeViewService=m;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import { addYears as u, addDecades as c, firstYearOfDecade as f, lastYearOfDecade as T, durationInDecades as d, cloneDate as p } from "@progress/kendo-date-math";
|
|
10
|
+
import { Action as l } from "../models/NavigationAction.mjs";
|
|
11
|
+
import { EMPTY_SELECTIONRANGE as M } from "../models/SelectionRange.mjs";
|
|
12
|
+
import { range as S, getToday as N, isInRange as m, intersects as O, isInSelectionRange as _ } from "../../utils.mjs";
|
|
13
|
+
const $ = [[]], w = 4, b = 3, C = {
|
|
14
|
+
[l.Left]: (i) => u(i, -1),
|
|
15
|
+
[l.Up]: (i) => u(i, -5),
|
|
16
|
+
[l.Right]: (i) => u(i, 1),
|
|
17
|
+
[l.Down]: (i) => u(i, 5),
|
|
18
|
+
[l.PrevView]: (i) => c(i, -1),
|
|
19
|
+
[l.NextView]: (i) => c(i, 1),
|
|
20
|
+
[l.FirstInView]: (i) => f(i),
|
|
21
|
+
[l.LastInView]: (i) => T(i)
|
|
22
|
+
};
|
|
23
|
+
class U {
|
|
24
|
+
addToDate(e, t) {
|
|
25
|
+
return c(e, t);
|
|
26
|
+
}
|
|
27
|
+
datesList(e, t) {
|
|
28
|
+
return S(0, t).map((r) => c(e, r));
|
|
29
|
+
}
|
|
30
|
+
data(e) {
|
|
31
|
+
const {
|
|
32
|
+
cellUID: t,
|
|
33
|
+
focusedDate: r,
|
|
34
|
+
isActiveView: o,
|
|
35
|
+
max: n,
|
|
36
|
+
min: a,
|
|
37
|
+
selectedDate: g,
|
|
38
|
+
selectionRange: E = M,
|
|
39
|
+
viewDate: h
|
|
40
|
+
} = e;
|
|
41
|
+
if (!h)
|
|
42
|
+
return $;
|
|
43
|
+
const q = S(0, w), Y = f(h), D = T(h), A = N();
|
|
44
|
+
return S(0, b).map((y) => {
|
|
45
|
+
const V = u(Y, y * w);
|
|
46
|
+
return q.map((L) => {
|
|
47
|
+
const s = this.normalize(u(V, L), a, n), I = this.isEqual(s, E.start), R = this.isEqual(s, E.end), F = !I && !R && _(s, E), v = o && (Array.isArray(g) ? this.isSelectedFromArray(s, g, a, n) : m(g, a, n) && this.isEqual(s, g));
|
|
48
|
+
return O(s, Y, D) ? {
|
|
49
|
+
formattedValue: this.value(s),
|
|
50
|
+
id: `${t}${s.getTime()}`,
|
|
51
|
+
isFocused: this.isEqual(s, r),
|
|
52
|
+
isSelected: v,
|
|
53
|
+
isWeekend: !1,
|
|
54
|
+
isInRange: m(s, a, n),
|
|
55
|
+
isRangeStart: I,
|
|
56
|
+
isRangeMid: F,
|
|
57
|
+
isRangeEnd: R,
|
|
58
|
+
isRangeSplitEnd: F && this.isEqual(s, D),
|
|
59
|
+
isRangeSplitStart: F && this.isEqual(s, Y),
|
|
60
|
+
isToday: this.isEqual(s, A),
|
|
61
|
+
title: this.cellTitle(s),
|
|
62
|
+
value: s
|
|
63
|
+
} : null;
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
isSelectedFromArray(e, t, r, o) {
|
|
68
|
+
let n = !1;
|
|
69
|
+
return t.forEach((a) => {
|
|
70
|
+
m(e, r, o) && this.isEqual(e, a) && (n = !0);
|
|
71
|
+
}), n;
|
|
72
|
+
}
|
|
73
|
+
isEqual(e, t) {
|
|
74
|
+
return !e || !t ? !1 : e.getFullYear() === t.getFullYear();
|
|
75
|
+
}
|
|
76
|
+
isInArray(e, t) {
|
|
77
|
+
if (!t.length)
|
|
78
|
+
return !1;
|
|
79
|
+
const r = e.getFullYear();
|
|
80
|
+
return t[0].getFullYear() <= r && r <= t[t.length - 1].getFullYear() + 9;
|
|
81
|
+
}
|
|
82
|
+
isInRange(e, t, r) {
|
|
83
|
+
const o = e.getFullYear(), n = !t || t.getFullYear() <= o, a = !r || o <= r.getFullYear();
|
|
84
|
+
return n && a;
|
|
85
|
+
}
|
|
86
|
+
isRangeStart(e) {
|
|
87
|
+
return e.getFullYear() % 100 === 0;
|
|
88
|
+
}
|
|
89
|
+
isInSameView(e, t) {
|
|
90
|
+
return d(e, t) === 0;
|
|
91
|
+
}
|
|
92
|
+
move(e, t) {
|
|
93
|
+
const r = C[t];
|
|
94
|
+
return r ? r(e) : e;
|
|
95
|
+
}
|
|
96
|
+
cellTitle(e) {
|
|
97
|
+
return e.getFullYear().toString();
|
|
98
|
+
}
|
|
99
|
+
navigationTitle(e) {
|
|
100
|
+
return e ? f(e).getFullYear().toString() : "";
|
|
101
|
+
}
|
|
102
|
+
title(e) {
|
|
103
|
+
return e ? `${f(e).getFullYear()} - ${T(e).getFullYear()}` : "";
|
|
104
|
+
}
|
|
105
|
+
rowLength(e) {
|
|
106
|
+
return w;
|
|
107
|
+
}
|
|
108
|
+
skip(e, t) {
|
|
109
|
+
return d(t, e);
|
|
110
|
+
}
|
|
111
|
+
total(e, t) {
|
|
112
|
+
return d(e, t) + 1;
|
|
113
|
+
}
|
|
114
|
+
value(e) {
|
|
115
|
+
return e ? e.getFullYear().toString() : "";
|
|
116
|
+
}
|
|
117
|
+
viewDate(e, t, r = 1) {
|
|
118
|
+
return d(e, t) < r ? c(e, -1) : e;
|
|
119
|
+
}
|
|
120
|
+
normalize(e, t, r) {
|
|
121
|
+
return e < t && this.isEqual(e, t) ? p(t) : e > r && this.isEqual(e, r) ? p(r) : e;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
export {
|
|
125
|
+
U as DecadeViewService
|
|
126
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@progress/kendo-date-math"),l=require("../models/NavigationAction.js"),N=require("../models/SelectionRange.js"),u=require("../../utils.js"),b=[[]],f=7,v=6,p=6,O=0,V={[l.Action.Left]:r=>n.addDays(r,-1),[l.Action.Up]:r=>n.addWeeks(r,-1),[l.Action.Right]:r=>n.addDays(r,1),[l.Action.Down]:r=>n.addWeeks(r,1),[l.Action.PrevView]:r=>n.addMonths(r,-1),[l.Action.NextView]:r=>n.addMonths(r,1),[l.Action.FirstInView]:r=>n.firstDayOfMonth(r),[l.Action.LastInView]:r=>n.lastDayOfMonth(r)};class k{constructor(t){this.intl=t}addToDate(t,e){return n.addMonths(t,e)}datesList(t,e){return u.range(0,e).map(i=>n.addMonths(t,i))}data(t){const{cellUID:e,focusedDate:i,isActiveView:h,max:a,min:o,selectedDate:c,selectionRange:d=N.EMPTY_SELECTIONRANGE,viewDate:g}=t;if(!g)return b;const M=n.firstDayOfMonth(g),y=n.lastDayOfMonth(g),A=n.dayOfWeek(M,this.intl.firstDay(),-1),w=u.range(0,f),E=u.getToday();return u.range(0,v).map(T=>{const I=n.addDays(A,T*f);return w.map(R=>{const s=this.normalize(n.addDays(I,R),o,a);if(s<M||s>y)return null;const m=this.isEqual(s,d.start),S=this.isEqual(s,d.end),D=!m&&!S&&u.isInSelectionRange(s,d),q=h&&(Array.isArray(c)?this.isSelectedFromArray(s,c,o,a):u.isInRange(c,o,a)&&this.isEqual(s,c));return{formattedValue:this.value(s),id:`${e}${s.getTime()}`,isFocused:this.isEqual(s,i),isSelected:q,isInRange:u.isInRange(s,o,a),isWeekend:this.isWeekend(s),isRangeStart:m,isRangeMid:D,isRangeEnd:S,isRangeSplitStart:D&&this.isEqual(s,M),isRangeSplitEnd:D&&this.isEqual(s,y),isToday:this.isEqual(s,E),title:this.cellTitle(s),value:s}})})}isEqual(t,e){return!t||!e?!1:n.getDate(t).getTime()===n.getDate(e).getTime()}isSelectedFromArray(t,e,i,h){let a=!1;return e.forEach(o=>{u.isInRange(t,i,h)&&this.isEqual(t,o)&&(a=!0)}),a}isInArray(t,e){return!!e.length&&n.firstDayOfMonth(e[0])<=t&&t<=n.lastDayOfMonth(e[e.length-1])}isInRange(t,e,i){const h=n.getDate(t),a=!e||n.getDate(e)<=h,o=!i||h<=n.getDate(i);return a&&o}isInSameView(t,e){return n.durationInMonths(t,e)===0}isRangeStart(t){return!t.getMonth()}move(t,e){const i=V[e];return i?i(t):t}cellTitle(t){return this.intl.formatDate(t,"D")}navigationTitle(t){return t?this.isRangeStart(t)?t.getFullYear().toString():this.abbrMonthNames()[t.getMonth()]:""}title(t){return`${this.wideMonthNames()[t.getMonth()]} ${t.getFullYear()}`}rowLength(t){return f+(t?1:0)}skip(t,e){return n.durationInMonths(e,t)}total(t,e){return n.durationInMonths(t,e)+1}value(t){return t?t.getDate().toString():""}viewDate(t,e,i=1){return n.durationInMonths(t,e)<i?n.addMonths(t,-1):t}isWeekend(t){const e=t.getDay();return e===p||e===O}abbrMonthNames(){return this.intl.dateFormatNames({nameType:"abbreviated",type:"months"})}normalize(t,e,i){return t<e&&this.isEqual(t,e)?n.getDate(e):t>i&&this.isEqual(t,i)?n.getDate(i):t}wideMonthNames(){return this.intl.dateFormatNames({nameType:"wide",type:"months",standAlone:!0})}}exports.MonthViewService=k;
|