@progress/kendo-angular-dateinputs 21.4.1 → 22.0.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/localization/calendar-messages.d.ts +1 -1
- package/calendar/localization/multiview-calendar-messages.d.ts +1 -1
- package/dateinput/localization/messages.d.ts +1 -1
- package/datepicker/localization/messages.d.ts +1 -1
- package/daterange/date-range-input.d.ts +1 -1
- package/daterange/localization/messages.d.ts +1 -1
- package/datetimepicker/localization/messages.d.ts +1 -1
- package/fesm2022/progress-kendo-angular-dateinputs.mjs +262 -262
- package/package.json +15 -23
- package/timepicker/localization/messages.d.ts +1 -1
- package/esm2022/calendar/calendar.component.mjs +0 -1711
- package/esm2022/calendar/calendar.module.mjs +0 -91
- package/esm2022/calendar/calendars.module.mjs +0 -87
- package/esm2022/calendar/footer.component.mjs +0 -77
- package/esm2022/calendar/for.directive.mjs +0 -116
- package/esm2022/calendar/header.component.mjs +0 -367
- package/esm2022/calendar/horizontal-view-list.component.mjs +0 -580
- package/esm2022/calendar/localization/calendar-custom-messages.component.mjs +0 -51
- package/esm2022/calendar/localization/calendar-localized-messages.directive.mjs +0 -39
- package/esm2022/calendar/localization/calendar-messages.mjs +0 -45
- package/esm2022/calendar/localization/multiview-calendar-custom-messages.component.mjs +0 -51
- package/esm2022/calendar/localization/multiview-calendar-localized-messages.directive.mjs +0 -39
- package/esm2022/calendar/localization/multiview-calendar-messages.mjs +0 -45
- package/esm2022/calendar/models/cell-context.interface.mjs +0 -5
- package/esm2022/calendar/models/navigation-action.enum.mjs +0 -20
- package/esm2022/calendar/models/orientation.mjs +0 -5
- package/esm2022/calendar/models/row-length-options.interface.mjs +0 -5
- package/esm2022/calendar/models/scrollable.interface.mjs +0 -5
- package/esm2022/calendar/models/selection-range-end.type.mjs +0 -5
- package/esm2022/calendar/models/selection-range.interface.mjs +0 -10
- package/esm2022/calendar/models/selection.mjs +0 -50
- package/esm2022/calendar/models/type.mjs +0 -5
- package/esm2022/calendar/models/view-service.interface.mjs +0 -5
- package/esm2022/calendar/models/view.enum.mjs +0 -16
- package/esm2022/calendar/models/view.type.mjs +0 -5
- package/esm2022/calendar/multiview-calendar.component.mjs +0 -1564
- package/esm2022/calendar/multiview-calendar.module.mjs +0 -89
- package/esm2022/calendar/navigation.component.mjs +0 -230
- package/esm2022/calendar/services/bus-view.service.mjs +0 -83
- package/esm2022/calendar/services/century-view.service.mjs +0 -219
- package/esm2022/calendar/services/decade-view.service.mjs +0 -217
- package/esm2022/calendar/services/disabled-dates.service.mjs +0 -66
- package/esm2022/calendar/services/dom.service.mjs +0 -203
- package/esm2022/calendar/services/month-view.service.mjs +0 -223
- package/esm2022/calendar/services/navigation.service.mjs +0 -60
- package/esm2022/calendar/services/scroll-sync.service.mjs +0 -89
- package/esm2022/calendar/services/selection.service.mjs +0 -62
- package/esm2022/calendar/services/weeknames.service.mjs +0 -33
- package/esm2022/calendar/services/year-view.service.mjs +0 -204
- package/esm2022/calendar/templates/cell-template.directive.mjs +0 -45
- package/esm2022/calendar/templates/century-cell-template.directive.mjs +0 -43
- package/esm2022/calendar/templates/decade-cell-template.directive.mjs +0 -43
- package/esm2022/calendar/templates/footer-template.directive.mjs +0 -44
- package/esm2022/calendar/templates/header-template.directive.mjs +0 -47
- package/esm2022/calendar/templates/header-title-template.directive.mjs +0 -43
- package/esm2022/calendar/templates/month-cell-template.directive.mjs +0 -43
- package/esm2022/calendar/templates/navigation-item-template.directive.mjs +0 -43
- package/esm2022/calendar/templates/weeknumber-cell-template.directive.mjs +0 -43
- package/esm2022/calendar/templates/year-cell-template.directive.mjs +0 -43
- package/esm2022/calendar/view-list.component.mjs +0 -497
- package/esm2022/calendar/view.component.mjs +0 -432
- package/esm2022/common/dom-queries.mjs +0 -24
- package/esm2022/common/models/fillmode.mjs +0 -5
- package/esm2022/common/models/rounded.mjs +0 -5
- package/esm2022/common/models/size.mjs +0 -5
- package/esm2022/common/models/week-days-format.mjs +0 -5
- package/esm2022/common/picker.service.mjs +0 -17
- package/esm2022/common/utils.mjs +0 -70
- package/esm2022/dateinput/arrow.enum.mjs +0 -13
- package/esm2022/dateinput/dateinput.component.mjs +0 -1196
- package/esm2022/dateinput/dateinput.module.mjs +0 -45
- package/esm2022/dateinput/localization/dateinput-custom-messages.component.mjs +0 -60
- package/esm2022/dateinput/localization/dateinput-localized-messages.directive.mjs +0 -39
- package/esm2022/dateinput/localization/messages.mjs +0 -39
- package/esm2022/dateinput/models/format-placeholder.model.mjs +0 -5
- package/esm2022/dateinput/models/format-settings.model.mjs +0 -5
- package/esm2022/dateinput/models/incremental-steps.model.mjs +0 -5
- package/esm2022/dateinputs.module.mjs +0 -136
- package/esm2022/datepicker/datepicker.component.mjs +0 -1758
- package/esm2022/datepicker/datepicker.module.mjs +0 -83
- package/esm2022/datepicker/localization/datepicker-custom-messages.component.mjs +0 -53
- package/esm2022/datepicker/localization/datepicker-localized-messages.directive.mjs +0 -39
- package/esm2022/datepicker/localization/messages.mjs +0 -63
- package/esm2022/daterange/auto-correct-on.type.mjs +0 -5
- package/esm2022/daterange/date-range-end-input.directive.mjs +0 -105
- package/esm2022/daterange/date-range-input.mjs +0 -138
- package/esm2022/daterange/date-range-popup-template.directive.mjs +0 -36
- package/esm2022/daterange/date-range-popup.component.mjs +0 -1051
- package/esm2022/daterange/date-range-selection.directive.mjs +0 -223
- package/esm2022/daterange/date-range-start-input.directive.mjs +0 -109
- package/esm2022/daterange/date-range.component.mjs +0 -116
- package/esm2022/daterange/date-range.module.mjs +0 -103
- package/esm2022/daterange/date-range.service.mjs +0 -225
- package/esm2022/daterange/localization/daterange-popup-custom-messages.component.mjs +0 -43
- package/esm2022/daterange/localization/daterange-popup-localized-messages.directive.mjs +0 -39
- package/esm2022/daterange/localization/messages.mjs +0 -51
- package/esm2022/datetimepicker/datetimepicker.component.mjs +0 -2505
- package/esm2022/datetimepicker/datetimepicker.module.mjs +0 -106
- package/esm2022/datetimepicker/localization/datetimepicker-custom-messages.component.mjs +0 -52
- package/esm2022/datetimepicker/localization/localized-messages.directive.mjs +0 -39
- package/esm2022/datetimepicker/localization/messages.mjs +0 -153
- package/esm2022/datetimepicker/models/active-tab.type.mjs +0 -5
- package/esm2022/defaults.mjs +0 -24
- package/esm2022/directives.mjs +0 -146
- package/esm2022/index.mjs +0 -78
- package/esm2022/package-metadata.mjs +0 -16
- package/esm2022/popup-settings.model.mjs +0 -5
- package/esm2022/preventable-event.mjs +0 -27
- package/esm2022/progress-kendo-angular-dateinputs.mjs +0 -8
- package/esm2022/timepicker/localization/messages.mjs +0 -105
- package/esm2022/timepicker/localization/timepicker-custom-messages.component.mjs +0 -54
- package/esm2022/timepicker/localization/timepicker-localized-messages.directive.mjs +0 -39
- package/esm2022/timepicker/localization/timeselector-custom-messages.component.mjs +0 -45
- package/esm2022/timepicker/localization/timeselector-localized-messages.directive.mjs +0 -39
- package/esm2022/timepicker/models/incremental-steps.model.mjs +0 -5
- package/esm2022/timepicker/models/list-item.interface.mjs +0 -5
- package/esm2022/timepicker/models/list-service-settings.mjs +0 -5
- package/esm2022/timepicker/models/list-service.interface.mjs +0 -5
- package/esm2022/timepicker/models/time-part.default.mjs +0 -14
- package/esm2022/timepicker/services/dayperiod.service.mjs +0 -131
- package/esm2022/timepicker/services/dom.service.mjs +0 -126
- package/esm2022/timepicker/services/hours.service.mjs +0 -130
- package/esm2022/timepicker/services/milliseconds.service.mjs +0 -131
- package/esm2022/timepicker/services/minutes.service.mjs +0 -128
- package/esm2022/timepicker/services/seconds.service.mjs +0 -128
- package/esm2022/timepicker/timelist.component.mjs +0 -388
- package/esm2022/timepicker/timepicker.component.mjs +0 -1598
- package/esm2022/timepicker/timepicker.module.mjs +0 -71
- package/esm2022/timepicker/timeselector.component.mjs +0 -728
- package/esm2022/timepicker/util.mjs +0 -70
- package/esm2022/util.mjs +0 -406
- package/esm2022/validators/disabled-date.validator.mjs +0 -18
- package/esm2022/validators/disabled-dates-range.validator.mjs +0 -26
- package/esm2022/validators/incomplete-date.validator.mjs +0 -18
- package/esm2022/validators/max.validator.mjs +0 -21
- package/esm2022/validators/min.validator.mjs +0 -21
- package/esm2022/validators/time-range.validator.mjs +0 -23
- package/esm2022/virtualization/models/scrollable.interface.mjs +0 -5
- package/esm2022/virtualization/services/row-height.service.mjs +0 -73
- package/esm2022/virtualization/services/scroller.service.mjs +0 -109
- package/esm2022/virtualization/virtualization.component.mjs +0 -324
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Injectable } from '@angular/core';
|
|
6
|
-
import { getDate, isEqual } from '@progress/kendo-date-math';
|
|
7
|
-
import { IntlService } from '@progress/kendo-angular-intl';
|
|
8
|
-
import { MIDNIGHT_DATE } from '../../defaults';
|
|
9
|
-
import { range, setHours } from '../../util';
|
|
10
|
-
import * as i0 from "@angular/core";
|
|
11
|
-
import * as i1 from "@progress/kendo-angular-intl";
|
|
12
|
-
const HOURS_IN_DAY = 24;
|
|
13
|
-
const clampToRange = (rangeValue) => (value) => value % rangeValue;
|
|
14
|
-
const clamp = clampToRange(HOURS_IN_DAY);
|
|
15
|
-
const stepper = (start, step) => (idx) => clamp(start + (idx * step));
|
|
16
|
-
const distanceFromMin = (value, min) => clamp(HOURS_IN_DAY + value - min);
|
|
17
|
-
const limit = (borderValue) => (barrier, value) => {
|
|
18
|
-
const useBarrier = !value || getDate(barrier).getTime() === getDate(value).getTime();
|
|
19
|
-
return useBarrier ? barrier : setHours(barrier, borderValue);
|
|
20
|
-
};
|
|
21
|
-
const limitDown = limit(0);
|
|
22
|
-
const limitUp = limit(HOURS_IN_DAY - 1);
|
|
23
|
-
/**
|
|
24
|
-
* @hidden
|
|
25
|
-
*/
|
|
26
|
-
export class HoursService {
|
|
27
|
-
intl;
|
|
28
|
-
boundRange = false;
|
|
29
|
-
insertUndividedMax = false;
|
|
30
|
-
min;
|
|
31
|
-
max;
|
|
32
|
-
step;
|
|
33
|
-
toListItem;
|
|
34
|
-
constructor(intl) {
|
|
35
|
-
this.intl = intl;
|
|
36
|
-
}
|
|
37
|
-
apply(value, candidate) {
|
|
38
|
-
return setHours(value, candidate.getHours());
|
|
39
|
-
}
|
|
40
|
-
configure(settings) {
|
|
41
|
-
const { boundRange = this.boundRange, insertUndividedMax = this.insertUndividedMax, min = this.min, max = this.max, part, step = this.step } = settings;
|
|
42
|
-
this.boundRange = boundRange;
|
|
43
|
-
this.insertUndividedMax = insertUndividedMax;
|
|
44
|
-
this.toListItem = (hour) => {
|
|
45
|
-
const date = setHours(MIDNIGHT_DATE, hour);
|
|
46
|
-
return {
|
|
47
|
-
text: this.intl.formatDate(date, part.pattern),
|
|
48
|
-
value: date
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
this.min = min;
|
|
52
|
-
this.max = max;
|
|
53
|
-
this.step = step;
|
|
54
|
-
}
|
|
55
|
-
data(selectedValue) {
|
|
56
|
-
const [min] = this.range(selectedValue);
|
|
57
|
-
const getHour = stepper(min, this.step);
|
|
58
|
-
const convertToItem = (idx) => (this.toListItem(getHour(idx)));
|
|
59
|
-
const data = range(0, this.countFromMin(selectedValue)).map(convertToItem);
|
|
60
|
-
this.addLast(data);
|
|
61
|
-
this.addMissing(data, selectedValue);
|
|
62
|
-
return data;
|
|
63
|
-
}
|
|
64
|
-
isRangeChanged(min, max) {
|
|
65
|
-
return !isEqual(this.min, min) || !isEqual(this.max, max);
|
|
66
|
-
}
|
|
67
|
-
limitRange(min, max, value) {
|
|
68
|
-
return this.boundRange ? [limitDown(min, value), limitUp(max, value)] : [min, max];
|
|
69
|
-
}
|
|
70
|
-
total(value) {
|
|
71
|
-
const last = this.insertUndividedMax && this.isLastMissing(value) ? 1 : 0;
|
|
72
|
-
const missing = this.isMissing(value) ? 1 : 0;
|
|
73
|
-
return this.countFromMin(value) + missing + last;
|
|
74
|
-
}
|
|
75
|
-
selectedIndex(value) {
|
|
76
|
-
return Math.ceil(this.divideByStep(value));
|
|
77
|
-
}
|
|
78
|
-
valueInList(value) {
|
|
79
|
-
if (!value) {
|
|
80
|
-
return true;
|
|
81
|
-
}
|
|
82
|
-
const matchMax = this.insertUndividedMax && this.lastHour(value) === value.getHours();
|
|
83
|
-
return matchMax || !this.isMissing(value);
|
|
84
|
-
}
|
|
85
|
-
addLast(data, value) {
|
|
86
|
-
if (this.insertUndividedMax && this.isLastMissing(value)) {
|
|
87
|
-
data.push(this.toListItem(this.lastHour(value)));
|
|
88
|
-
}
|
|
89
|
-
return data;
|
|
90
|
-
}
|
|
91
|
-
addMissing(data, value) {
|
|
92
|
-
if (this.valueInList(value)) {
|
|
93
|
-
return data;
|
|
94
|
-
}
|
|
95
|
-
const missingItem = this.toListItem(value.getHours());
|
|
96
|
-
data.splice(this.selectedIndex(value), 0, missingItem);
|
|
97
|
-
return data;
|
|
98
|
-
}
|
|
99
|
-
countFromMin(value) {
|
|
100
|
-
const [min, max] = this.range(value);
|
|
101
|
-
return Math.floor(distanceFromMin(max, min) / this.step) + 1; /* include min */
|
|
102
|
-
}
|
|
103
|
-
isMissing(value) {
|
|
104
|
-
if (!value) {
|
|
105
|
-
return false;
|
|
106
|
-
}
|
|
107
|
-
return this.selectedIndex(value) !== this.divideByStep(value);
|
|
108
|
-
}
|
|
109
|
-
isLastMissing(value) {
|
|
110
|
-
return this.isMissing(setHours(this.max, this.lastHour(value)));
|
|
111
|
-
}
|
|
112
|
-
divideByStep(value) {
|
|
113
|
-
return distanceFromMin(value.getHours(), this.min.getHours()) / this.step;
|
|
114
|
-
}
|
|
115
|
-
lastHour(value) {
|
|
116
|
-
return this.range(value)[1];
|
|
117
|
-
}
|
|
118
|
-
range(value) {
|
|
119
|
-
const [min, max] = this.limitRange(this.min, this.max, value);
|
|
120
|
-
return [min.getHours(), max.getHours()];
|
|
121
|
-
}
|
|
122
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: HoursService, deps: [{ token: i1.IntlService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
123
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: HoursService, providedIn: 'root' });
|
|
124
|
-
}
|
|
125
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: HoursService, decorators: [{
|
|
126
|
-
type: Injectable,
|
|
127
|
-
args: [{
|
|
128
|
-
providedIn: 'root'
|
|
129
|
-
}]
|
|
130
|
-
}], ctorParameters: () => [{ type: i1.IntlService }] });
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Injectable } from '@angular/core';
|
|
6
|
-
import { isEqual } from '@progress/kendo-date-math';
|
|
7
|
-
import { IntlService } from '@progress/kendo-angular-intl';
|
|
8
|
-
import { MIDNIGHT_DATE } from '../../defaults';
|
|
9
|
-
import { range, setMilliseconds } from '../../util';
|
|
10
|
-
import * as i0 from "@angular/core";
|
|
11
|
-
import * as i1 from "@progress/kendo-angular-intl";
|
|
12
|
-
const MILLISECONDS_IN_SECOND = 1000;
|
|
13
|
-
const clampToRange = (rangeValue) => (value) => value % rangeValue;
|
|
14
|
-
const clamp = clampToRange(MILLISECONDS_IN_SECOND);
|
|
15
|
-
const stepper = (start, step) => (idx) => clamp(start + (idx * step));
|
|
16
|
-
const distanceFromMin = (value, min) => clamp(MILLISECONDS_IN_SECOND + value - min);
|
|
17
|
-
const limit = (borderValue) => (barrier, value) => {
|
|
18
|
-
const useBarrier = !value ||
|
|
19
|
-
(barrier.getHours() === value.getHours() &&
|
|
20
|
-
barrier.getMinutes() === value.getMinutes() &&
|
|
21
|
-
barrier.getSeconds() === value.getSeconds());
|
|
22
|
-
return useBarrier ? barrier : setMilliseconds(barrier, borderValue);
|
|
23
|
-
};
|
|
24
|
-
const limitDown = limit(0);
|
|
25
|
-
const limitUp = limit(MILLISECONDS_IN_SECOND - 1);
|
|
26
|
-
/**
|
|
27
|
-
* @hidden
|
|
28
|
-
*/
|
|
29
|
-
export class MillisecondsService {
|
|
30
|
-
intl;
|
|
31
|
-
toListItem;
|
|
32
|
-
min;
|
|
33
|
-
max;
|
|
34
|
-
step;
|
|
35
|
-
insertUndividedMax = false;
|
|
36
|
-
constructor(intl) {
|
|
37
|
-
this.intl = intl;
|
|
38
|
-
}
|
|
39
|
-
apply(value, candidate) {
|
|
40
|
-
return setMilliseconds(value, candidate.getMilliseconds());
|
|
41
|
-
}
|
|
42
|
-
configure(settings) {
|
|
43
|
-
const { insertUndividedMax = this.insertUndividedMax, min = this.min, max = this.max, step = this.step } = settings;
|
|
44
|
-
this.insertUndividedMax = insertUndividedMax;
|
|
45
|
-
this.toListItem = (millisecond) => {
|
|
46
|
-
const date = setMilliseconds(MIDNIGHT_DATE, millisecond);
|
|
47
|
-
return {
|
|
48
|
-
text: this.intl.formatDate(date, "SSS"), // Always "SSS" for the popup UI
|
|
49
|
-
value: date
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
this.min = min;
|
|
53
|
-
this.max = max;
|
|
54
|
-
this.step = step;
|
|
55
|
-
}
|
|
56
|
-
data(selectedValue) {
|
|
57
|
-
const [min] = this.range(selectedValue);
|
|
58
|
-
const getMillisecond = stepper(min, this.step);
|
|
59
|
-
const convertToItem = (idx) => (this.toListItem(getMillisecond(idx)));
|
|
60
|
-
const data = range(0, this.countFromMin(selectedValue)).map(convertToItem);
|
|
61
|
-
this.addLast(data);
|
|
62
|
-
this.addMissing(data, selectedValue);
|
|
63
|
-
return data;
|
|
64
|
-
}
|
|
65
|
-
isRangeChanged(min, max) {
|
|
66
|
-
return !isEqual(this.min, min) || !isEqual(this.max, max);
|
|
67
|
-
}
|
|
68
|
-
limitRange(min, max, value) {
|
|
69
|
-
return [limitDown(min, value), limitUp(max, value)];
|
|
70
|
-
}
|
|
71
|
-
total(value) {
|
|
72
|
-
const last = this.insertUndividedMax && this.isLastMissing(value) ? 1 : 0;
|
|
73
|
-
const missing = this.isMissing(value) ? 1 : 0;
|
|
74
|
-
return this.countFromMin(value) + missing + last;
|
|
75
|
-
}
|
|
76
|
-
selectedIndex(value) {
|
|
77
|
-
return Math.ceil(this.divideByStep(value));
|
|
78
|
-
}
|
|
79
|
-
valueInList(value) {
|
|
80
|
-
if (!value) {
|
|
81
|
-
return true;
|
|
82
|
-
}
|
|
83
|
-
const matchMax = this.insertUndividedMax && this.lastMillisecond(value) === value.getMilliseconds();
|
|
84
|
-
return matchMax || !this.isMissing(value);
|
|
85
|
-
}
|
|
86
|
-
divideByStep(value) {
|
|
87
|
-
return distanceFromMin(value.getMilliseconds(), this.min.getMilliseconds()) / this.step;
|
|
88
|
-
}
|
|
89
|
-
addLast(data, value) {
|
|
90
|
-
if (this.insertUndividedMax && this.isLastMissing(value)) {
|
|
91
|
-
data.push(this.toListItem(this.lastMillisecond(value)));
|
|
92
|
-
}
|
|
93
|
-
return data;
|
|
94
|
-
}
|
|
95
|
-
addMissing(data, value) {
|
|
96
|
-
if (this.valueInList(value)) {
|
|
97
|
-
return data;
|
|
98
|
-
}
|
|
99
|
-
const missingItem = this.toListItem(value.getMilliseconds());
|
|
100
|
-
data.splice(this.selectedIndex(value), 0, missingItem);
|
|
101
|
-
return data;
|
|
102
|
-
}
|
|
103
|
-
countFromMin(value) {
|
|
104
|
-
const [min, max] = this.range(value);
|
|
105
|
-
return Math.floor(distanceFromMin(max, min) / this.step) + 1; /* include min */
|
|
106
|
-
}
|
|
107
|
-
isMissing(value) {
|
|
108
|
-
if (!value) {
|
|
109
|
-
return false;
|
|
110
|
-
}
|
|
111
|
-
return this.selectedIndex(value) !== this.divideByStep(value);
|
|
112
|
-
}
|
|
113
|
-
isLastMissing(value) {
|
|
114
|
-
return this.isMissing(setMilliseconds(this.max, this.lastMillisecond(value)));
|
|
115
|
-
}
|
|
116
|
-
lastMillisecond(value) {
|
|
117
|
-
return this.range(value)[1];
|
|
118
|
-
}
|
|
119
|
-
range(value) {
|
|
120
|
-
const [min, max] = this.limitRange(this.min, this.max, value);
|
|
121
|
-
return [min.getMilliseconds(), max.getMilliseconds()];
|
|
122
|
-
}
|
|
123
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: MillisecondsService, deps: [{ token: i1.IntlService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
124
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: MillisecondsService, providedIn: 'root' });
|
|
125
|
-
}
|
|
126
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: MillisecondsService, decorators: [{
|
|
127
|
-
type: Injectable,
|
|
128
|
-
args: [{
|
|
129
|
-
providedIn: 'root'
|
|
130
|
-
}]
|
|
131
|
-
}], ctorParameters: () => [{ type: i1.IntlService }] });
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Injectable } from '@angular/core';
|
|
6
|
-
import { isEqual } from '@progress/kendo-date-math';
|
|
7
|
-
import { IntlService } from '@progress/kendo-angular-intl';
|
|
8
|
-
import { MIDNIGHT_DATE } from '../../defaults';
|
|
9
|
-
import { range, setMinutes } from '../../util';
|
|
10
|
-
import * as i0 from "@angular/core";
|
|
11
|
-
import * as i1 from "@progress/kendo-angular-intl";
|
|
12
|
-
const MINUTES_IN_HOUR = 60;
|
|
13
|
-
const clampToRange = (rangeValue) => (value) => value % rangeValue;
|
|
14
|
-
const clamp = clampToRange(MINUTES_IN_HOUR);
|
|
15
|
-
const stepper = (start, step) => (idx) => clamp(start + (idx * step));
|
|
16
|
-
const distanceFromMin = (value, min) => clamp(MINUTES_IN_HOUR + value - min);
|
|
17
|
-
const limit = (borderValue) => (barrier, value) => {
|
|
18
|
-
const useBarrier = !value || barrier.getHours() === value.getHours();
|
|
19
|
-
return useBarrier ? barrier : setMinutes(barrier, borderValue);
|
|
20
|
-
};
|
|
21
|
-
const limitDown = limit(0);
|
|
22
|
-
const limitUp = limit(MINUTES_IN_HOUR - 1);
|
|
23
|
-
/**
|
|
24
|
-
* @hidden
|
|
25
|
-
*/
|
|
26
|
-
export class MinutesService {
|
|
27
|
-
intl;
|
|
28
|
-
toListItem;
|
|
29
|
-
min;
|
|
30
|
-
max;
|
|
31
|
-
step;
|
|
32
|
-
insertUndividedMax = false;
|
|
33
|
-
constructor(intl) {
|
|
34
|
-
this.intl = intl;
|
|
35
|
-
}
|
|
36
|
-
apply(value, candidate) {
|
|
37
|
-
return setMinutes(value, candidate.getMinutes());
|
|
38
|
-
}
|
|
39
|
-
configure(settings) {
|
|
40
|
-
const { insertUndividedMax = this.insertUndividedMax, min = this.min, max = this.max, part, step = this.step } = settings;
|
|
41
|
-
this.insertUndividedMax = insertUndividedMax;
|
|
42
|
-
this.toListItem = (minute) => {
|
|
43
|
-
const date = setMinutes(MIDNIGHT_DATE, minute);
|
|
44
|
-
return {
|
|
45
|
-
text: this.intl.formatDate(date, part.pattern),
|
|
46
|
-
value: date
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
this.min = min;
|
|
50
|
-
this.max = max;
|
|
51
|
-
this.step = step;
|
|
52
|
-
}
|
|
53
|
-
data(selectedValue) {
|
|
54
|
-
const [min] = this.range(selectedValue);
|
|
55
|
-
const getMinute = stepper(min, this.step);
|
|
56
|
-
const convertToItem = (idx) => (this.toListItem(getMinute(idx)));
|
|
57
|
-
const data = range(0, this.countFromMin(selectedValue)).map(convertToItem);
|
|
58
|
-
this.addLast(data);
|
|
59
|
-
this.addMissing(data, selectedValue);
|
|
60
|
-
return data;
|
|
61
|
-
}
|
|
62
|
-
isRangeChanged(min, max) {
|
|
63
|
-
return !isEqual(this.min, min) || !isEqual(this.max, max);
|
|
64
|
-
}
|
|
65
|
-
limitRange(min, max, value) {
|
|
66
|
-
return [limitDown(min, value), limitUp(max, value)];
|
|
67
|
-
}
|
|
68
|
-
total(value) {
|
|
69
|
-
const last = this.insertUndividedMax && this.isLastMissing(value) ? 1 : 0;
|
|
70
|
-
const missing = this.isMissing(value) ? 1 : 0;
|
|
71
|
-
return this.countFromMin(value) + missing + last;
|
|
72
|
-
}
|
|
73
|
-
selectedIndex(value) {
|
|
74
|
-
return Math.ceil(this.divideByStep(value));
|
|
75
|
-
}
|
|
76
|
-
valueInList(value) {
|
|
77
|
-
if (!value) {
|
|
78
|
-
return true;
|
|
79
|
-
}
|
|
80
|
-
const matchMax = this.insertUndividedMax && this.lastMinute(value) === value.getMinutes();
|
|
81
|
-
return matchMax || !this.isMissing(value);
|
|
82
|
-
}
|
|
83
|
-
addLast(data, value) {
|
|
84
|
-
if (this.insertUndividedMax && this.isLastMissing(value)) {
|
|
85
|
-
data.push(this.toListItem(this.lastMinute(value)));
|
|
86
|
-
}
|
|
87
|
-
return data;
|
|
88
|
-
}
|
|
89
|
-
addMissing(data, value) {
|
|
90
|
-
if (this.valueInList(value)) {
|
|
91
|
-
return data;
|
|
92
|
-
}
|
|
93
|
-
const missingItem = this.toListItem(value.getMinutes());
|
|
94
|
-
data.splice(this.selectedIndex(value), 0, missingItem);
|
|
95
|
-
return data;
|
|
96
|
-
}
|
|
97
|
-
countFromMin(value) {
|
|
98
|
-
const [min, max] = this.range(value);
|
|
99
|
-
return Math.floor(distanceFromMin(max, min) / this.step) + 1; /* include min */
|
|
100
|
-
}
|
|
101
|
-
isMissing(value) {
|
|
102
|
-
if (!value) {
|
|
103
|
-
return false;
|
|
104
|
-
}
|
|
105
|
-
return this.selectedIndex(value) !== this.divideByStep(value);
|
|
106
|
-
}
|
|
107
|
-
isLastMissing(value) {
|
|
108
|
-
return this.isMissing(setMinutes(this.max, this.lastMinute(value)));
|
|
109
|
-
}
|
|
110
|
-
divideByStep(value) {
|
|
111
|
-
return distanceFromMin(value.getMinutes(), this.min.getMinutes()) / this.step;
|
|
112
|
-
}
|
|
113
|
-
lastMinute(value) {
|
|
114
|
-
return this.range(value)[1];
|
|
115
|
-
}
|
|
116
|
-
range(value) {
|
|
117
|
-
const [min, max] = this.limitRange(this.min, this.max, value);
|
|
118
|
-
return [min.getMinutes(), max.getMinutes()];
|
|
119
|
-
}
|
|
120
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: MinutesService, deps: [{ token: i1.IntlService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
121
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: MinutesService, providedIn: 'root' });
|
|
122
|
-
}
|
|
123
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: MinutesService, decorators: [{
|
|
124
|
-
type: Injectable,
|
|
125
|
-
args: [{
|
|
126
|
-
providedIn: 'root'
|
|
127
|
-
}]
|
|
128
|
-
}], ctorParameters: () => [{ type: i1.IntlService }] });
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Injectable } from '@angular/core';
|
|
6
|
-
import { isEqual } from '@progress/kendo-date-math';
|
|
7
|
-
import { IntlService } from '@progress/kendo-angular-intl';
|
|
8
|
-
import { MIDNIGHT_DATE } from '../../defaults';
|
|
9
|
-
import { range, setSeconds } from '../../util';
|
|
10
|
-
import * as i0 from "@angular/core";
|
|
11
|
-
import * as i1 from "@progress/kendo-angular-intl";
|
|
12
|
-
const SECONDS_IN_HOUR = 60;
|
|
13
|
-
const clampToRange = (rangeValue) => (value) => value % rangeValue;
|
|
14
|
-
const clamp = clampToRange(SECONDS_IN_HOUR);
|
|
15
|
-
const stepper = (start, step) => (idx) => clamp(start + (idx * step));
|
|
16
|
-
const distanceFromMin = (value, min) => clamp(SECONDS_IN_HOUR + value - min);
|
|
17
|
-
const limit = (borderValue) => (barrier, value) => {
|
|
18
|
-
const useBarrier = !value || barrier.getHours() === value.getHours() && barrier.getMinutes() === value.getMinutes();
|
|
19
|
-
return useBarrier ? barrier : setSeconds(barrier, borderValue);
|
|
20
|
-
};
|
|
21
|
-
const limitDown = limit(0);
|
|
22
|
-
const limitUp = limit(SECONDS_IN_HOUR - 1);
|
|
23
|
-
/**
|
|
24
|
-
* @hidden
|
|
25
|
-
*/
|
|
26
|
-
export class SecondsService {
|
|
27
|
-
intl;
|
|
28
|
-
toListItem;
|
|
29
|
-
min;
|
|
30
|
-
max;
|
|
31
|
-
step;
|
|
32
|
-
insertUndividedMax = false;
|
|
33
|
-
constructor(intl) {
|
|
34
|
-
this.intl = intl;
|
|
35
|
-
}
|
|
36
|
-
apply(value, candidate) {
|
|
37
|
-
return setSeconds(value, candidate.getSeconds());
|
|
38
|
-
}
|
|
39
|
-
configure(settings) {
|
|
40
|
-
const { insertUndividedMax = this.insertUndividedMax, min = this.min, max = this.max, part, step = this.step } = settings;
|
|
41
|
-
this.insertUndividedMax = insertUndividedMax;
|
|
42
|
-
this.toListItem = (second) => {
|
|
43
|
-
const date = setSeconds(MIDNIGHT_DATE, second);
|
|
44
|
-
return {
|
|
45
|
-
text: this.intl.formatDate(date, part.pattern),
|
|
46
|
-
value: date
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
this.min = min;
|
|
50
|
-
this.max = max;
|
|
51
|
-
this.step = step;
|
|
52
|
-
}
|
|
53
|
-
data(selectedValue) {
|
|
54
|
-
const [min] = this.range(selectedValue);
|
|
55
|
-
const getSecond = stepper(min, this.step);
|
|
56
|
-
const convertToItem = (idx) => (this.toListItem(getSecond(idx)));
|
|
57
|
-
const data = range(0, this.countFromMin(selectedValue)).map(convertToItem);
|
|
58
|
-
this.addLast(data);
|
|
59
|
-
this.addMissing(data, selectedValue);
|
|
60
|
-
return data;
|
|
61
|
-
}
|
|
62
|
-
isRangeChanged(min, max) {
|
|
63
|
-
return !isEqual(this.min, min) || !isEqual(this.max, max);
|
|
64
|
-
}
|
|
65
|
-
limitRange(min, max, value) {
|
|
66
|
-
return [limitDown(min, value), limitUp(max, value)];
|
|
67
|
-
}
|
|
68
|
-
total(value) {
|
|
69
|
-
const last = this.insertUndividedMax && this.isLastMissing(value) ? 1 : 0;
|
|
70
|
-
const missing = this.isMissing(value) ? 1 : 0;
|
|
71
|
-
return this.countFromMin(value) + missing + last;
|
|
72
|
-
}
|
|
73
|
-
selectedIndex(value) {
|
|
74
|
-
return Math.ceil(this.divideByStep(value));
|
|
75
|
-
}
|
|
76
|
-
valueInList(value) {
|
|
77
|
-
if (!value) {
|
|
78
|
-
return true;
|
|
79
|
-
}
|
|
80
|
-
const matchMax = this.insertUndividedMax && this.lastSecond(value) === value.getSeconds();
|
|
81
|
-
return matchMax || !this.isMissing(value);
|
|
82
|
-
}
|
|
83
|
-
divideByStep(value) {
|
|
84
|
-
return distanceFromMin(value.getSeconds(), this.min.getSeconds()) / this.step;
|
|
85
|
-
}
|
|
86
|
-
addLast(data, value) {
|
|
87
|
-
if (this.insertUndividedMax && this.isLastMissing(value)) {
|
|
88
|
-
data.push(this.toListItem(this.lastSecond(value)));
|
|
89
|
-
}
|
|
90
|
-
return data;
|
|
91
|
-
}
|
|
92
|
-
addMissing(data, value) {
|
|
93
|
-
if (this.valueInList(value)) {
|
|
94
|
-
return data;
|
|
95
|
-
}
|
|
96
|
-
const missingItem = this.toListItem(value.getSeconds());
|
|
97
|
-
data.splice(this.selectedIndex(value), 0, missingItem);
|
|
98
|
-
return data;
|
|
99
|
-
}
|
|
100
|
-
countFromMin(value) {
|
|
101
|
-
const [min, max] = this.range(value);
|
|
102
|
-
return Math.floor(distanceFromMin(max, min) / this.step) + 1; /* include min */
|
|
103
|
-
}
|
|
104
|
-
isMissing(value) {
|
|
105
|
-
if (!value) {
|
|
106
|
-
return false;
|
|
107
|
-
}
|
|
108
|
-
return this.selectedIndex(value) !== this.divideByStep(value);
|
|
109
|
-
}
|
|
110
|
-
isLastMissing(value) {
|
|
111
|
-
return this.isMissing(setSeconds(this.max, this.lastSecond(value)));
|
|
112
|
-
}
|
|
113
|
-
lastSecond(value) {
|
|
114
|
-
return this.range(value)[1];
|
|
115
|
-
}
|
|
116
|
-
range(value) {
|
|
117
|
-
const [min, max] = this.limitRange(this.min, this.max, value);
|
|
118
|
-
return [min.getSeconds(), max.getSeconds()];
|
|
119
|
-
}
|
|
120
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SecondsService, deps: [{ token: i1.IntlService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
121
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SecondsService, providedIn: 'root' });
|
|
122
|
-
}
|
|
123
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SecondsService, decorators: [{
|
|
124
|
-
type: Injectable,
|
|
125
|
-
args: [{
|
|
126
|
-
providedIn: 'root'
|
|
127
|
-
}]
|
|
128
|
-
}], ctorParameters: () => [{ type: i1.IntlService }] });
|