@netwin/angular-datetime-picker 18.2.0 → 19.0.0-rc.2

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.
Files changed (77) hide show
  1. package/README.md +1 -27
  2. package/assets/style/picker.min.css +1 -1
  3. package/esm2022/lib/date-time/adapter/date-time-adapter.class.mjs +7 -13
  4. package/esm2022/lib/date-time/adapter/date-time-format.class.mjs +1 -4
  5. package/esm2022/lib/date-time/adapter/native-date-time-adapter.class.mjs +21 -36
  6. package/esm2022/lib/date-time/adapter/native-date-time-format.class.mjs +1 -2
  7. package/esm2022/lib/date-time/adapter/native-date-time.module.mjs +9 -12
  8. package/esm2022/lib/date-time/adapter/unix-timestamp-adapter/unix-timestamp-date-time-adapter.class.mjs +12 -25
  9. package/esm2022/lib/date-time/adapter/unix-timestamp-adapter/unix-timestamp-date-time-format.class.mjs +1 -2
  10. package/esm2022/lib/date-time/calendar-body.component.mjs +22 -31
  11. package/esm2022/lib/date-time/calendar-month-view.component.mjs +13 -29
  12. package/esm2022/lib/date-time/calendar-multi-year-view.component.mjs +11 -17
  13. package/esm2022/lib/date-time/calendar-year-view.component.mjs +11 -19
  14. package/esm2022/lib/date-time/calendar.component.mjs +16 -27
  15. package/esm2022/lib/date-time/date-time-inline.component.mjs +280 -110
  16. package/esm2022/lib/date-time/date-time-picker-intl.service.mjs +4 -11
  17. package/esm2022/lib/date-time/date-time.module.mjs +12 -36
  18. package/esm2022/lib/date-time/options-provider.mjs +1 -1
  19. package/esm2022/lib/date-time/timer-box.component.mjs +6 -16
  20. package/esm2022/lib/date-time/timer.component.mjs +18 -17
  21. package/esm2022/lib/types/date-view.mjs +19 -0
  22. package/esm2022/lib/types/index.mjs +4 -0
  23. package/esm2022/lib/types/picker-type.mjs +2 -0
  24. package/esm2022/lib/types/select-mode.mjs +2 -0
  25. package/esm2022/public_api.mjs +18 -20
  26. package/fesm2022/netwin-angular-datetime-picker.mjs +1843 -4264
  27. package/fesm2022/netwin-angular-datetime-picker.mjs.map +1 -1
  28. package/lib/date-time/adapter/date-time-adapter.class.d.ts +16 -26
  29. package/lib/date-time/adapter/date-time-format.class.d.ts +8 -12
  30. package/lib/date-time/adapter/native-date-time-adapter.class.d.ts +7 -18
  31. package/lib/date-time/adapter/native-date-time-format.class.d.ts +0 -3
  32. package/lib/date-time/adapter/unix-timestamp-adapter/unix-timestamp-date-time-adapter.class.d.ts +6 -17
  33. package/lib/date-time/adapter/unix-timestamp-adapter/unix-timestamp-date-time-format.class.d.ts +0 -3
  34. package/lib/date-time/calendar-body.component.d.ts +21 -26
  35. package/lib/date-time/calendar-month-view.component.d.ts +19 -24
  36. package/lib/date-time/calendar-multi-year-view.component.d.ts +14 -14
  37. package/lib/date-time/calendar-year-view.component.d.ts +8 -9
  38. package/lib/date-time/calendar.component.d.ts +15 -21
  39. package/lib/date-time/date-time-inline.component.d.ts +164 -74
  40. package/lib/date-time/date-time-picker-intl.service.d.ts +0 -4
  41. package/lib/date-time/date-time.module.d.ts +11 -18
  42. package/lib/date-time/timer-box.component.d.ts +4 -5
  43. package/lib/date-time/timer.component.d.ts +6 -9
  44. package/lib/types/date-view.d.ts +17 -0
  45. package/lib/types/index.d.ts +3 -0
  46. package/lib/types/picker-type.d.ts +7 -0
  47. package/lib/types/select-mode.d.ts +8 -0
  48. package/package.json +1 -1
  49. package/public_api.d.ts +12 -19
  50. package/esm2022/lib/date-time/date-time-picker-container.component.mjs +0 -405
  51. package/esm2022/lib/date-time/date-time-picker-input.directive.mjs +0 -598
  52. package/esm2022/lib/date-time/date-time-picker-trigger.directive.mjs +0 -64
  53. package/esm2022/lib/date-time/date-time-picker.animations.mjs +0 -21
  54. package/esm2022/lib/date-time/date-time-picker.component.mjs +0 -564
  55. package/esm2022/lib/date-time/date-time.class.mjs +0 -176
  56. package/esm2022/lib/date-time/numberedFixLen.pipe.mjs +0 -28
  57. package/esm2022/lib/dialog/dialog-config.class.mjs +0 -59
  58. package/esm2022/lib/dialog/dialog-container.component.mjs +0 -232
  59. package/esm2022/lib/dialog/dialog-ref.class.mjs +0 -134
  60. package/esm2022/lib/dialog/dialog.module.mjs +0 -26
  61. package/esm2022/lib/dialog/dialog.service.mjs +0 -228
  62. package/esm2022/lib/utils/index.mjs +0 -5
  63. package/esm2022/lib/utils/object.utils.mjs +0 -23
  64. package/lib/date-time/date-time-picker-container.component.d.ts +0 -130
  65. package/lib/date-time/date-time-picker-input.directive.d.ts +0 -164
  66. package/lib/date-time/date-time-picker-trigger.directive.d.ts +0 -23
  67. package/lib/date-time/date-time-picker.animations.d.ts +0 -8
  68. package/lib/date-time/date-time-picker.component.d.ts +0 -173
  69. package/lib/date-time/date-time.class.d.ts +0 -103
  70. package/lib/date-time/numberedFixLen.pipe.d.ts +0 -10
  71. package/lib/dialog/dialog-config.class.d.ts +0 -169
  72. package/lib/dialog/dialog-container.component.d.ts +0 -58
  73. package/lib/dialog/dialog-ref.class.d.ts +0 -51
  74. package/lib/dialog/dialog.module.d.ts +0 -11
  75. package/lib/dialog/dialog.service.d.ts +0 -76
  76. package/lib/utils/index.d.ts +0 -4
  77. package/lib/utils/object.utils.d.ts +0 -8
@@ -1,12 +1,7 @@
1
- /**
2
- * date-time-adapter.class
3
- */
4
1
  import { InjectionToken } from '@angular/core';
5
- import { Observable, Subject } from 'rxjs';
2
+ import { Subject } from 'rxjs';
6
3
  /** InjectionToken for date time picker that can be used to override default locale code. */
7
4
  export declare const OWL_DATE_TIME_LOCALE: InjectionToken<string>;
8
- /** @docs-private */
9
- export declare function OWL_DATE_TIME_LOCALE_FACTORY(): string;
10
5
  /** Provider for OWL_DATE_TIME_LOCALE injection token. */
11
6
  export declare const OWL_DATE_TIME_LOCALE_PROVIDER: {
12
7
  provide: InjectionToken<string>;
@@ -14,10 +9,10 @@ export declare const OWL_DATE_TIME_LOCALE_PROVIDER: {
14
9
  };
15
10
  export declare abstract class DateTimeAdapter<T> {
16
11
  /** The locale to use for all dates. */
17
- protected locale: any;
12
+ protected locale: string;
18
13
  /** A stream that emits when the locale changes. */
19
14
  protected _localeChanges: Subject<string>;
20
- get localeChanges(): Observable<string>;
15
+ localeChanges: import("rxjs").Observable<string>;
21
16
  /** total milliseconds in a day. */
22
17
  protected readonly millisecondsInDay = 86400000;
23
18
  /** total milliseconds in a minute. */
@@ -30,13 +25,13 @@ export declare abstract class DateTimeAdapter<T> {
30
25
  * Get the month of the given date
31
26
  * 0 -- January
32
27
  * 11 -- December
33
- * */
28
+ */
34
29
  abstract getMonth(date: T): number;
35
30
  /**
36
31
  * Get the day of the week of the given date
37
32
  * 0 -- Sunday
38
33
  * 6 -- Saturday
39
- * */
34
+ */
40
35
  abstract getDay(date: T): number;
41
36
  /**
42
37
  * Get the day num of the given date
@@ -107,7 +102,7 @@ export declare abstract class DateTimeAdapter<T> {
107
102
  /**
108
103
  * Checks whether the given object is considered a date instance by this DateTimeAdapter.
109
104
  */
110
- abstract isDateInstance(obj: any): boolean;
105
+ abstract isDateInstance(obj: unknown): obj is T;
111
106
  /**
112
107
  * Add the specified number of years to the given date
113
108
  */
@@ -133,40 +128,35 @@ export declare abstract class DateTimeAdapter<T> {
133
128
  */
134
129
  abstract setSeconds(date: T, amount: number): T;
135
130
  /**
136
- * Creates a date with the given year, month, date, hour, minute and second. Does not allow over/under-flow of the
137
- * month and date.
131
+ * Creates a date with the given year, month, day, hour, minute and second.
132
+ * Does not allow over/under-flow of the month and date.
138
133
  */
139
- abstract createDate(year: number, month: number, date: number): T;
140
- abstract createDate(year: number, month: number, date: number, hours: number, minutes: number, seconds: number): T;
134
+ abstract createDate(year: number, month: number, day: number, hours?: number, minutes?: number, seconds?: number): T;
141
135
  /**
142
136
  * Clone the given date
143
137
  */
144
138
  abstract clone(date: T): T;
145
139
  /**
146
140
  * Get a new moment
147
- * */
141
+ */
148
142
  abstract now(): T;
149
143
  /**
150
144
  * Formats a date as a string according to the given format.
151
145
  */
152
- abstract format(date: T, displayFormat: any): string;
153
- /**
154
- * Parse a user-provided value to a Date Object
155
- */
156
- abstract parse(value: any, parseFormat: any): T | null;
146
+ abstract format(date: T, displayFormat: Intl.DateTimeFormatOptions): string;
157
147
  /**
158
148
  * Compare two given dates
159
149
  * 1 if the first date is after the second,
160
150
  * -1 if the first date is before the second
161
151
  * 0 if dates are equal.
162
- * */
152
+ */
163
153
  compare(first: T, second: T): number;
164
154
  /**
165
155
  * Check if two given dates are in the same year
166
156
  * 1 if the first date's year is after the second,
167
157
  * -1 if the first date's year is before the second
168
158
  * 0 if two given dates are in the same year
169
- * */
159
+ */
170
160
  compareYear(first: T, second: T): number;
171
161
  /**
172
162
  * Attempts to deserialize a value to a valid date object. This is different from parsing in that
@@ -177,15 +167,15 @@ export declare abstract class DateTimeAdapter<T> {
177
167
  * support passing values from your backend directly to these properties by overriding this method
178
168
  * to also deserialize the format used by your backend.
179
169
  */
180
- deserialize(value: any): T | null;
170
+ deserialize(value: unknown | null): T | null;
181
171
  /**
182
172
  * Sets the locale used for all dates.
183
173
  */
184
174
  setLocale(locale: string): void;
185
175
  /**
186
176
  * Get the locale used for all dates.
187
- * */
188
- getLocale(): any;
177
+ */
178
+ getLocale(): string;
189
179
  /**
190
180
  * Clamp the given date between min and max dates.
191
181
  */
@@ -1,15 +1,11 @@
1
- /**
2
- * date-time-format.class
3
- */
4
1
  import { InjectionToken } from '@angular/core';
5
- export interface OwlDateTimeFormats {
6
- parseInput: any;
7
- fullPickerInput: any;
8
- datePickerInput: any;
9
- timePickerInput: any;
10
- monthYearLabel: any;
11
- dateA11yLabel: any;
12
- monthYearA11yLabel: any;
13
- }
2
+ export type OwlDateTimeFormats = {
3
+ fullPickerInput: Pick<Intl.DateTimeFormatOptions, 'year' | 'month' | 'day' | 'hour' | 'minute'>;
4
+ datePickerInput: Pick<Intl.DateTimeFormatOptions, 'year' | 'month' | 'day'>;
5
+ timePickerInput: Pick<Intl.DateTimeFormatOptions, 'hour' | 'minute'>;
6
+ monthYearLabel: Pick<Intl.DateTimeFormatOptions, 'year' | 'month'>;
7
+ dateA11yLabel: Pick<Intl.DateTimeFormatOptions, 'year' | 'month' | 'day'>;
8
+ monthYearA11yLabel: Pick<Intl.DateTimeFormatOptions, 'year' | 'month'>;
9
+ };
14
10
  /** InjectionToken for date time picker that can be used to override default format. */
15
11
  export declare const OWL_DATE_TIME_FORMATS: InjectionToken<OwlDateTimeFormats>;
@@ -1,21 +1,11 @@
1
- /**
2
- * native-date-time-adapter.class
3
- */
4
- import { Platform } from '@angular/cdk/platform';
5
1
  import { DateTimeAdapter } from './date-time-adapter.class';
6
2
  import * as i0 from "@angular/core";
7
3
  export declare class NativeDateTimeAdapter extends DateTimeAdapter<Date> {
8
- private owlDateTimeLocale;
4
+ private readonly platform;
5
+ private readonly owlDateTimeLocale;
9
6
  /** Whether to clamp the date between 1 and 9999 to avoid IE and Edge errors. */
10
7
  private readonly _clampDate;
11
- /**
12
- * Whether to use `timeZone: 'utc'` with `Intl.DateTimeFormat` when formatting dates.
13
- * Without this `Intl.DateTimeFormat` sometimes chooses the wrong timeZone, which can throw off
14
- * the result. (e.g. in the en-US locale `new Date(1800, 7, 14).toLocaleDateString()`
15
- * will produce `'8/13/1800'`.
16
- */
17
- useUtcForDisplay: boolean;
18
- constructor(owlDateTimeLocale: string, platform: Platform);
8
+ constructor();
19
9
  getYear(date: Date): number;
20
10
  getMonth(date: Date): number;
21
11
  getDay(date: Date): number;
@@ -35,7 +25,7 @@ export declare class NativeDateTimeAdapter extends DateTimeAdapter<Date> {
35
25
  isSameDay(dateLeft: Date, dateRight: Date): boolean;
36
26
  isValid(date: Date): boolean;
37
27
  invalid(): Date;
38
- isDateInstance(obj: any): boolean;
28
+ isDateInstance(obj: unknown): obj is Date;
39
29
  addCalendarYears(date: Date, amount: number): Date;
40
30
  addCalendarMonths(date: Date, amount: number): Date;
41
31
  addCalendarDays(date: Date, amount: number): Date;
@@ -45,14 +35,13 @@ export declare class NativeDateTimeAdapter extends DateTimeAdapter<Date> {
45
35
  createDate(year: number, month: number, date: number, hours?: number, minutes?: number, seconds?: number): Date;
46
36
  clone(date: Date): Date;
47
37
  now(): Date;
48
- format(date: Date, displayFormat: any): string;
49
- parse(value: any, parseFormat: any): Date | null;
38
+ format(date: Date, displayFormat: Intl.DateTimeFormatOptions): string;
50
39
  /**
51
40
  * Returns the given value if given a valid Date or null. Deserializes valid ISO 8601 strings
52
41
  * (https://www.ietf.org/rfc/rfc3339.txt) into valid Dates and empty string into null. Returns an
53
42
  * invalid date for all other values.
54
43
  */
55
- deserialize(value: any): Date | null;
44
+ deserialize(value: unknown): Date | null;
56
45
  /**
57
46
  * Strip out unicode LTR and RTL characters. Edge and IE insert these into formatted dates while
58
47
  * other browsers do not. We remove them to make output consistent and because they interfere with
@@ -67,6 +56,6 @@ export declare class NativeDateTimeAdapter extends DateTimeAdapter<Date> {
67
56
  * representation with the local date and time.
68
57
  */
69
58
  private _format;
70
- static ɵfac: i0.ɵɵFactoryDeclaration<NativeDateTimeAdapter, [{ optional: true; }, null]>;
59
+ static ɵfac: i0.ɵɵFactoryDeclaration<NativeDateTimeAdapter, never>;
71
60
  static ɵprov: i0.ɵɵInjectableDeclaration<NativeDateTimeAdapter>;
72
61
  }
@@ -1,5 +1,2 @@
1
- /**
2
- * native-date-time-format.class
3
- */
4
1
  import { OwlDateTimeFormats } from './date-time-format.class';
5
2
  export declare const OWL_NATIVE_DATE_TIME_FORMATS: OwlDateTimeFormats;
@@ -1,21 +1,11 @@
1
- /**
2
- * unix-timestamp-date-time-adapter.class
3
- */
4
- import { Platform } from '@angular/cdk/platform';
5
1
  import { DateTimeAdapter } from '../date-time-adapter.class';
6
2
  import * as i0 from "@angular/core";
7
3
  export declare class UnixTimestampDateTimeAdapter extends DateTimeAdapter<number> {
8
- private owlDateTimeLocale;
9
- constructor(owlDateTimeLocale: string, platform: Platform);
4
+ private readonly platform;
5
+ private readonly owlDateTimeLocale;
10
6
  /** Whether to clamp the date between 1 and 9999 to avoid IE and Edge errors. */
11
7
  private readonly _clampDate;
12
- /**
13
- * Whether to use `timeZone: 'utc'` with `Intl.DateTimeFormat` when formatting dates.
14
- * Without this `Intl.DateTimeFormat` sometimes chooses the wrong timeZone, which can throw off
15
- * the result. (e.g. in the en-US locale `new Date(1800, 7, 14).toLocaleDateString()`
16
- * will produce `'8/13/1800'`.
17
- */
18
- useUtcForDisplay: boolean;
8
+ constructor();
19
9
  /**
20
10
  * Strip out unicode LTR and RTL characters. Edge and IE insert these into formatted dates while
21
11
  * other browsers do not. We remove them to make output consistent and because they interfere with
@@ -37,7 +27,7 @@ export declare class UnixTimestampDateTimeAdapter extends DateTimeAdapter<number
37
27
  clone(date: number): number;
38
28
  createDate(year: number, month: number, date: number, hours?: number, minutes?: number, seconds?: number): number;
39
29
  differenceInCalendarDays(dateLeft: number, dateRight: number): number;
40
- format(date: number, displayFormat: any): string;
30
+ format(date: number, displayFormat: Intl.DateTimeFormatOptions): string;
41
31
  getDate(date: number): number;
42
32
  getDateNames(): Array<string>;
43
33
  getDay(date: number): number;
@@ -52,16 +42,15 @@ export declare class UnixTimestampDateTimeAdapter extends DateTimeAdapter<number
52
42
  getYear(date: number): number;
53
43
  getYearName(date: number): string;
54
44
  invalid(): number;
55
- isDateInstance(obj: any): boolean;
45
+ isDateInstance(obj: unknown): obj is number;
56
46
  isEqual(dateLeft: number, dateRight: number): boolean;
57
47
  isSameDay(dateLeft: number, dateRight: number): boolean;
58
48
  isValid(date: number): boolean;
59
49
  now(): number;
60
- parse(value: any, parseFormat: any): number | null;
61
50
  setHours(date: number, amount: number): number;
62
51
  setMinutes(date: number, amount: number): number;
63
52
  setSeconds(date: number, amount: number): number;
64
53
  toIso8601(date: number): string;
65
- static ɵfac: i0.ɵɵFactoryDeclaration<UnixTimestampDateTimeAdapter, [{ optional: true; }, null]>;
54
+ static ɵfac: i0.ɵɵFactoryDeclaration<UnixTimestampDateTimeAdapter, never>;
66
55
  static ɵprov: i0.ɵɵInjectableDeclaration<UnixTimestampDateTimeAdapter>;
67
56
  }
@@ -1,5 +1,2 @@
1
- /**
2
- * unix-timestamp-date-time-format.class
3
- */
4
1
  import { OwlDateTimeFormats } from '../date-time-format.class';
5
2
  export declare const OWL_UNIX_TIMESTAMP_DATE_TIME_FORMATS: OwlDateTimeFormats;
@@ -1,8 +1,5 @@
1
- /**
2
- * calendar-body.component
3
- */
4
- import { ElementRef, EventEmitter, NgZone } from '@angular/core';
5
- import { SelectMode } from './date-time.class';
1
+ import { EventEmitter } from '@angular/core';
2
+ import { SelectMode } from '../types';
6
3
  import * as i0 from "@angular/core";
7
4
  export declare class CalendarCell {
8
5
  value: number;
@@ -14,19 +11,19 @@ export declare class CalendarCell {
14
11
  constructor(value: number, displayValue: string, ariaLabel: string, enabled: boolean, out?: boolean, cellClass?: string);
15
12
  }
16
13
  export declare class OwlCalendarBodyComponent {
17
- private elmRef;
18
- private ngZone;
14
+ private readonly elmRef;
15
+ private readonly ngZone;
19
16
  /**
20
17
  * The cell number of the active cell in the table.
21
18
  */
22
19
  activeCell: number;
23
20
  /**
24
21
  * The cells to display in the table.
25
- * */
22
+ */
26
23
  rows: Array<Array<CalendarCell>>;
27
24
  /**
28
25
  * The number of columns in the table.
29
- * */
26
+ */
30
27
  numCols: number;
31
28
  /**
32
29
  * The ratio (width / height) to use for the cells in the table.
@@ -34,11 +31,11 @@ export declare class OwlCalendarBodyComponent {
34
31
  cellRatio: number;
35
32
  /**
36
33
  * The value in the table that corresponds to today.
37
- * */
34
+ */
38
35
  todayValue: number;
39
36
  /**
40
37
  * The value in the table that is currently selected.
41
- * */
38
+ */
42
39
  selectedValues: Array<number>;
43
40
  /**
44
41
  * Current picker select mode
@@ -46,33 +43,31 @@ export declare class OwlCalendarBodyComponent {
46
43
  selectMode: SelectMode;
47
44
  /**
48
45
  * Emit when a calendar cell is selected
49
- * */
46
+ */
50
47
  readonly select: EventEmitter<CalendarCell>;
51
- get owlDTCalendarBodyClass(): boolean;
52
- get isInSingleMode(): boolean;
53
- get isInRangeMode(): boolean;
54
- constructor(elmRef: ElementRef, ngZone: NgZone);
55
- selectCell(cell: CalendarCell): void;
56
- isActiveCell(rowIndex: number, colIndex: number): boolean;
48
+ protected get isInSingleMode(): boolean;
49
+ protected get isInRangeMode(): boolean;
50
+ protected selectCell(cell: CalendarCell): void;
51
+ protected isActiveCell(rowIndex: number, colIndex: number): boolean;
57
52
  /**
58
53
  * Check if the cell is selected
59
54
  */
60
- isSelected(value: number): boolean;
55
+ protected isSelected(value: number): boolean;
61
56
  /**
62
57
  * Check if the cell in the range
63
- * */
64
- isInRange(value: number): boolean;
58
+ */
59
+ protected isInRange(value: number): boolean;
65
60
  /**
66
61
  * Check if the cell is the range from
67
- * */
68
- isRangeFrom(value: number): boolean;
62
+ */
63
+ protected isRangeFrom(value: number): boolean;
69
64
  /**
70
65
  * Check if the cell is the range to
71
- * */
72
- isRangeTo(value: number): boolean;
66
+ */
67
+ protected isRangeTo(value: number): boolean;
73
68
  /**
74
69
  * Focus to a active cell
75
- * */
70
+ */
76
71
  focusActiveCell(): void;
77
72
  static ɵfac: i0.ɵɵFactoryDeclaration<OwlCalendarBodyComponent, never>;
78
73
  static ɵcmp: i0.ɵɵComponentDeclaration<OwlCalendarBodyComponent, "[owl-date-time-calendar-body]", ["owlDateTimeCalendarBody"], { "activeCell": { "alias": "activeCell"; "required": false; }; "rows": { "alias": "rows"; "required": false; }; "numCols": { "alias": "numCols"; "required": false; }; "cellRatio": { "alias": "cellRatio"; "required": false; }; "todayValue": { "alias": "todayValue"; "required": false; }; "selectedValues": { "alias": "selectedValues"; "required": false; }; "selectMode": { "alias": "selectMode"; "required": false; }; }, { "select": "select"; }, never, never, false, never>;
@@ -1,8 +1,8 @@
1
1
  import { AfterContentInit, ChangeDetectorRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
2
+ import { SelectMode } from '../types';
2
3
  import { DateTimeAdapter } from './adapter/date-time-adapter.class';
3
4
  import { OwlDateTimeFormats } from './adapter/date-time-format.class';
4
5
  import { CalendarCell, OwlCalendarBodyComponent } from './calendar-body.component';
5
- import { SelectMode } from './date-time.class';
6
6
  import * as i0 from "@angular/core";
7
7
  export declare class OwlMonthViewComponent<T> implements OnInit, AfterContentInit, OnDestroy {
8
8
  private cdRef;
@@ -10,19 +10,19 @@ export declare class OwlMonthViewComponent<T> implements OnInit, AfterContentIni
10
10
  private dateTimeFormats;
11
11
  /**
12
12
  * Whether to hide dates in other months at the start or end of the current month.
13
- * */
13
+ */
14
14
  hideOtherMonths: boolean;
15
15
  private isDefaultFirstDayOfWeek;
16
16
  /**
17
17
  * Define the first day of a week
18
18
  * Sunday: 0 - Saturday: 6
19
- * */
19
+ */
20
20
  private _firstDayOfWeek;
21
21
  get firstDayOfWeek(): number;
22
22
  set firstDayOfWeek(val: number);
23
23
  /**
24
24
  * The select mode of the picker;
25
- * */
25
+ */
26
26
  private _selectMode;
27
27
  get selectMode(): SelectMode;
28
28
  set selectMode(val: SelectMode);
@@ -38,7 +38,7 @@ export declare class OwlMonthViewComponent<T> implements OnInit, AfterContentIni
38
38
  set pickerMoment(value: T);
39
39
  /**
40
40
  * A function used to filter which dates are selectable
41
- * */
41
+ */
42
42
  private _dateFilter;
43
43
  get dateFilter(): (date: T) => boolean;
44
44
  set dateFilter(filter: (date: T) => boolean);
@@ -51,43 +51,38 @@ export declare class OwlMonthViewComponent<T> implements OnInit, AfterContentIni
51
51
  get maxDate(): T | null;
52
52
  set maxDate(value: T | null);
53
53
  private _weekdays;
54
- get weekdays(): {
54
+ protected get weekdays(): Array<{
55
55
  long: string;
56
56
  short: string;
57
57
  narrow: string;
58
- }[];
58
+ }>;
59
59
  private _days;
60
- get days(): CalendarCell[][];
61
- get activeCell(): number;
62
- get isInSingleMode(): boolean;
63
- get isInRangeMode(): boolean;
60
+ protected get days(): Array<Array<CalendarCell>>;
61
+ protected get activeCell(): number;
62
+ protected get isInSingleMode(): boolean;
63
+ protected get isInRangeMode(): boolean;
64
64
  private firstDateOfMonth;
65
65
  private localeSub;
66
66
  private initiated;
67
67
  private dateNames;
68
68
  /**
69
69
  * The date of the month that today falls on.
70
- * */
70
+ */
71
71
  todayDate: number | null;
72
72
  /**
73
73
  * An array to hold all selectedDates' value
74
74
  * the value is the day number in current month
75
- * */
75
+ */
76
76
  selectedDates: Array<number>;
77
77
  firstRowOffset: number;
78
78
  /**
79
79
  * Callback to invoke when a new date is selected
80
- * */
80
+ */
81
81
  readonly selectedChange: EventEmitter<T>;
82
- /**
83
- * Callback to invoke when any date is selected.
84
- * */
85
- readonly userSelection: EventEmitter<void>;
86
82
  /** Emits when any date is activated. */
87
83
  readonly pickerMomentChange: EventEmitter<T>;
88
84
  /** The body of calendar table */
89
- calendarBodyElm: OwlCalendarBodyComponent;
90
- get owlDTCalendarView(): boolean;
85
+ protected calendarBodyElm: OwlCalendarBodyComponent;
91
86
  constructor(cdRef: ChangeDetectorRef, dateTimeAdapter: DateTimeAdapter<T>, dateTimeFormats: OwlDateTimeFormats);
92
87
  ngOnInit(): void;
93
88
  ngAfterContentInit(): void;
@@ -106,11 +101,11 @@ export declare class OwlMonthViewComponent<T> implements OnInit, AfterContentIni
106
101
  handleCalendarKeydown(event: KeyboardEvent): void;
107
102
  /**
108
103
  * Generate the calendar weekdays array
109
- * */
104
+ */
110
105
  private generateWeekDays;
111
106
  /**
112
107
  * Generate the calendar days array
113
- * */
108
+ */
114
109
  private generateCalendar;
115
110
  private updateFirstDayOfWeek;
116
111
  /**
@@ -133,9 +128,9 @@ export declare class OwlMonthViewComponent<T> implements OnInit, AfterContentIni
133
128
  * Set the selectedDates value.
134
129
  * In single mode, it has only one value which represent the selected date
135
130
  * In range mode, it would has two values, one for the fromValue and the other for the toValue
136
- * */
131
+ */
137
132
  private setSelectedDates;
138
133
  private focusActiveCell;
139
134
  static ɵfac: i0.ɵɵFactoryDeclaration<OwlMonthViewComponent<any>, [null, { optional: true; }, { optional: true; }]>;
140
- static ɵcmp: i0.ɵɵComponentDeclaration<OwlMonthViewComponent<any>, "owl-date-time-month-view", ["owlYearView"], { "hideOtherMonths": { "alias": "hideOtherMonths"; "required": false; }; "firstDayOfWeek": { "alias": "firstDayOfWeek"; "required": false; }; "selectMode": { "alias": "selectMode"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "selecteds": { "alias": "selecteds"; "required": false; }; "pickerMoment": { "alias": "pickerMoment"; "required": false; }; "dateFilter": { "alias": "dateFilter"; "required": false; }; "minDate": { "alias": "minDate"; "required": false; }; "maxDate": { "alias": "maxDate"; "required": false; }; }, { "selectedChange": "selectedChange"; "userSelection": "userSelection"; "pickerMomentChange": "pickerMomentChange"; }, never, never, false, never>;
135
+ static ɵcmp: i0.ɵɵComponentDeclaration<OwlMonthViewComponent<any>, "owl-date-time-month-view", ["owlYearView"], { "hideOtherMonths": { "alias": "hideOtherMonths"; "required": false; }; "firstDayOfWeek": { "alias": "firstDayOfWeek"; "required": false; }; "selectMode": { "alias": "selectMode"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "selecteds": { "alias": "selecteds"; "required": false; }; "pickerMoment": { "alias": "pickerMoment"; "required": false; }; "dateFilter": { "alias": "dateFilter"; "required": false; }; "minDate": { "alias": "minDate"; "required": false; }; "maxDate": { "alias": "maxDate"; "required": false; }; }, { "selectedChange": "selectedChange"; "pickerMomentChange": "pickerMomentChange"; }, never, never, false, never>;
141
136
  }
@@ -1,8 +1,9 @@
1
1
  import { AfterContentInit, ChangeDetectorRef, EventEmitter } from '@angular/core';
2
+ import { SelectMode } from '../types';
2
3
  import { DateTimeAdapter } from './adapter/date-time-adapter.class';
3
4
  import { CalendarCell, OwlCalendarBodyComponent } from './calendar-body.component';
4
5
  import { OwlDateTimeIntl } from './date-time-picker-intl.service';
5
- import { SelectMode } from './date-time.class';
6
+ import { Options } from './options-provider';
6
7
  import * as i0 from "@angular/core";
7
8
  export declare class OwlMultiYearViewComponent<T> implements AfterContentInit {
8
9
  private cdRef;
@@ -11,7 +12,7 @@ export declare class OwlMultiYearViewComponent<T> implements AfterContentInit {
11
12
  private options;
12
13
  /**
13
14
  * The select mode of the picker;
14
- * */
15
+ */
15
16
  private _selectMode;
16
17
  get selectMode(): SelectMode;
17
18
  set selectMode(val: SelectMode);
@@ -23,11 +24,11 @@ export declare class OwlMultiYearViewComponent<T> implements AfterContentInit {
23
24
  get selecteds(): Array<T>;
24
25
  set selecteds(values: Array<T>);
25
26
  private _pickerMoment;
26
- get pickerMoment(): T;
27
+ get pickerMoment(): T | null;
27
28
  set pickerMoment(value: T);
28
29
  /**
29
30
  * A function used to filter which dates are selectable
30
- * */
31
+ */
31
32
  private _dateFilter;
32
33
  get dateFilter(): (date: T) => boolean;
33
34
  set dateFilter(filter: (date: T) => boolean);
@@ -42,7 +43,7 @@ export declare class OwlMultiYearViewComponent<T> implements AfterContentInit {
42
43
  private _todayYear;
43
44
  get todayYear(): number;
44
45
  private _years;
45
- get years(): CalendarCell[][];
46
+ get years(): Array<Array<CalendarCell>>;
46
47
  private _selectedYears;
47
48
  get selectedYears(): Array<number>;
48
49
  private initiated;
@@ -54,21 +55,20 @@ export declare class OwlMultiYearViewComponent<T> implements AfterContentInit {
54
55
  get nextButtonLabel(): string;
55
56
  /**
56
57
  * Callback to invoke when a new month is selected
57
- * */
58
+ */
58
59
  readonly change: EventEmitter<T>;
59
60
  /**
60
61
  * Emits the selected year. This doesn't imply a change on the selected date
61
- * */
62
+ */
62
63
  readonly yearSelected: EventEmitter<T>;
63
64
  /** Emits when any date is activated. */
64
65
  readonly pickerMomentChange: EventEmitter<T>;
65
66
  /** Emits when use keyboard enter to select a calendar cell */
66
- readonly keyboardEnter: EventEmitter<any>;
67
+ readonly keyboardEnter: EventEmitter<KeyboardEvent>;
67
68
  /** The body of calendar table */
68
69
  calendarBodyElm: OwlCalendarBodyComponent;
69
- get owlDTCalendarView(): boolean;
70
70
  get owlDTCalendarMultiYearView(): boolean;
71
- constructor(cdRef: ChangeDetectorRef, pickerIntl: OwlDateTimeIntl, dateTimeAdapter: DateTimeAdapter<T>, options: any);
71
+ constructor(cdRef: ChangeDetectorRef, pickerIntl: OwlDateTimeIntl, dateTimeAdapter: DateTimeAdapter<T>, options: Options['multiYear']);
72
72
  ngAfterContentInit(): void;
73
73
  /**
74
74
  * Handle a calendarCell selected
@@ -77,12 +77,12 @@ export declare class OwlMultiYearViewComponent<T> implements AfterContentInit {
77
77
  private selectYear;
78
78
  /**
79
79
  * Generate the previous year list
80
- * */
81
- prevYearList(event: any): void;
80
+ */
81
+ prevYearList(event: MouseEvent): void;
82
82
  /**
83
83
  * Generate the next year list
84
- * */
85
- nextYearList(event: any): void;
84
+ */
85
+ nextYearList(event: MouseEvent): void;
86
86
  generateYearList(): void;
87
87
  /** Whether the previous period button is enabled. */
88
88
  previousEnabled(): boolean;
@@ -1,8 +1,8 @@
1
1
  import { AfterContentInit, ChangeDetectorRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
2
+ import { SelectMode } from '../types';
2
3
  import { DateTimeAdapter } from './adapter/date-time-adapter.class';
3
4
  import { OwlDateTimeFormats } from './adapter/date-time-format.class';
4
5
  import { CalendarCell, OwlCalendarBodyComponent } from './calendar-body.component';
5
- import { SelectMode } from './date-time.class';
6
6
  import * as i0 from "@angular/core";
7
7
  export declare class OwlYearViewComponent<T> implements OnInit, AfterContentInit, OnDestroy {
8
8
  private cdRef;
@@ -10,7 +10,7 @@ export declare class OwlYearViewComponent<T> implements OnInit, AfterContentInit
10
10
  private dateTimeFormats;
11
11
  /**
12
12
  * The select mode of the picker;
13
- * */
13
+ */
14
14
  private _selectMode;
15
15
  get selectMode(): SelectMode;
16
16
  set selectMode(val: SelectMode);
@@ -26,7 +26,7 @@ export declare class OwlYearViewComponent<T> implements OnInit, AfterContentInit
26
26
  set pickerMoment(value: T);
27
27
  /**
28
28
  * A function used to filter which dates are selectable
29
- * */
29
+ */
30
30
  private _dateFilter;
31
31
  get dateFilter(): (date: T) => boolean;
32
32
  set dateFilter(filter: (date: T) => boolean);
@@ -50,15 +50,15 @@ export declare class OwlYearViewComponent<T> implements OnInit, AfterContentInit
50
50
  /**
51
51
  * An array to hold all selectedDates' month value
52
52
  * the value is the month number in current year
53
- * */
53
+ */
54
54
  selectedMonths: Array<number>;
55
55
  /**
56
56
  * Callback to invoke when a new month is selected
57
- * */
57
+ */
58
58
  readonly change: EventEmitter<T>;
59
59
  /**
60
60
  * Emits the selected year. This doesn't imply a change on the selected date
61
- * */
61
+ */
62
62
  readonly monthSelected: EventEmitter<T>;
63
63
  /** Emits when any date is activated. */
64
64
  readonly pickerMomentChange: EventEmitter<T>;
@@ -66,7 +66,6 @@ export declare class OwlYearViewComponent<T> implements OnInit, AfterContentInit
66
66
  readonly keyboardEnter: EventEmitter<any>;
67
67
  /** The body of calendar table */
68
68
  calendarBodyElm: OwlCalendarBodyComponent;
69
- get owlDTCalendarView(): boolean;
70
69
  constructor(cdRef: ChangeDetectorRef, dateTimeAdapter: DateTimeAdapter<T>, dateTimeFormats: OwlDateTimeFormats);
71
70
  ngOnInit(): void;
72
71
  ngAfterContentInit(): void;
@@ -85,7 +84,7 @@ export declare class OwlYearViewComponent<T> implements OnInit, AfterContentInit
85
84
  handleCalendarKeydown(event: KeyboardEvent): void;
86
85
  /**
87
86
  * Generate the calendar month list
88
- * */
87
+ */
89
88
  private generateMonthList;
90
89
  /**
91
90
  * Creates an CalendarCell for the given month.
@@ -104,7 +103,7 @@ export declare class OwlYearViewComponent<T> implements OnInit, AfterContentInit
104
103
  * Set the selectedMonths value
105
104
  * In single mode, it has only one value which represent the month the selected date in
106
105
  * In range mode, it would has two values, one for the month the fromValue in and the other for the month the toValue in
107
- * */
106
+ */
108
107
  private setSelectedMonths;
109
108
  /**
110
109
  * Check the given dates are in the same year