@angular/material-luxon-adapter 17.1.0-next.3 → 17.1.0

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2023 Google LLC.
3
+ Copyright (c) 2024 Google LLC.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -6,16 +6,16 @@
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
8
  import { NgModule } from '@angular/core';
9
- import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core';
9
+ import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE, } from '@angular/material/core';
10
10
  import { MAT_LUXON_DATE_ADAPTER_OPTIONS, LuxonDateAdapter } from './luxon-date-adapter';
11
11
  import { MAT_LUXON_DATE_FORMATS } from './luxon-date-formats';
12
12
  import * as i0 from "@angular/core";
13
13
  export * from './luxon-date-adapter';
14
14
  export * from './luxon-date-formats';
15
15
  export class LuxonDateModule {
16
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.2", ngImport: i0, type: LuxonDateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
17
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.0-next.2", ngImport: i0, type: LuxonDateModule }); }
18
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.0-next.2", ngImport: i0, type: LuxonDateModule, providers: [
16
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: LuxonDateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
17
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.0-next.5", ngImport: i0, type: LuxonDateModule }); }
18
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: LuxonDateModule, providers: [
19
19
  {
20
20
  provide: DateAdapter,
21
21
  useClass: LuxonDateAdapter,
@@ -23,7 +23,7 @@ export class LuxonDateModule {
23
23
  },
24
24
  ] }); }
25
25
  }
26
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.2", ngImport: i0, type: LuxonDateModule, decorators: [{
26
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: LuxonDateModule, decorators: [{
27
27
  type: NgModule,
28
28
  args: [{
29
29
  providers: [
@@ -36,15 +36,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.2",
36
36
  }]
37
37
  }] });
38
38
  export class MatLuxonDateModule {
39
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.2", ngImport: i0, type: MatLuxonDateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
40
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.0-next.2", ngImport: i0, type: MatLuxonDateModule, imports: [LuxonDateModule] }); }
41
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.0-next.2", ngImport: i0, type: MatLuxonDateModule, providers: [{ provide: MAT_DATE_FORMATS, useValue: MAT_LUXON_DATE_FORMATS }], imports: [LuxonDateModule] }); }
39
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: MatLuxonDateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
40
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.0-next.5", ngImport: i0, type: MatLuxonDateModule }); }
41
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: MatLuxonDateModule, providers: [provideLuxonDateAdapter()] }); }
42
42
  }
43
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.2", ngImport: i0, type: MatLuxonDateModule, decorators: [{
43
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: MatLuxonDateModule, decorators: [{
44
44
  type: NgModule,
45
45
  args: [{
46
- imports: [LuxonDateModule],
47
- providers: [{ provide: MAT_DATE_FORMATS, useValue: MAT_LUXON_DATE_FORMATS }],
46
+ providers: [provideLuxonDateAdapter()],
48
47
  }]
49
48
  }] });
50
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbWF0ZXJpYWwtbHV4b24tYWRhcHRlci9hZGFwdGVyL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRztBQUVILE9BQU8sRUFBQyxRQUFRLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFDdkMsT0FBTyxFQUFDLFdBQVcsRUFBRSxnQkFBZ0IsRUFBRSxlQUFlLEVBQUMsTUFBTSx3QkFBd0IsQ0FBQztBQUN0RixPQUFPLEVBQUMsOEJBQThCLEVBQUUsZ0JBQWdCLEVBQUMsTUFBTSxzQkFBc0IsQ0FBQztBQUN0RixPQUFPLEVBQUMsc0JBQXNCLEVBQUMsTUFBTSxzQkFBc0IsQ0FBQzs7QUFFNUQsY0FBYyxzQkFBc0IsQ0FBQztBQUNyQyxjQUFjLHNCQUFzQixDQUFDO0FBV3JDLE1BQU0sT0FBTyxlQUFlO3FIQUFmLGVBQWU7c0hBQWYsZUFBZTtzSEFBZixlQUF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52
+ provide: DateAdapter,
53
+ useClass: LuxonDateAdapter,
54
+ deps: [MAT_DATE_LOCALE, MAT_LUXON_DATE_ADAPTER_OPTIONS],
55
+ },
56
+ { provide: MAT_DATE_FORMATS, useValue: formats },
57
+ ];
58
+ }
59
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbWF0ZXJpYWwtbHV4b24tYWRhcHRlci9hZGFwdGVyL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRztBQUVILE9BQU8sRUFBQyxRQUFRLEVBQVcsTUFBTSxlQUFlLENBQUM7QUFDakQsT0FBTyxFQUNMLFdBQVcsRUFDWCxnQkFBZ0IsRUFDaEIsZUFBZSxHQUVoQixNQUFNLHdCQUF3QixDQUFDO0FBQ2hDLE9BQU8sRUFBQyw4QkFBOEIsRUFBRSxnQkFBZ0IsRUFBQyxNQUFNLHNCQUFzQixDQUFDO0FBQ3RGLE9BQU8sRUFBQyxzQkFBc0IsRUFBQyxNQUFNLHNCQUFzQixDQUFDOztBQUU1RCxjQUFjLHNCQUFzQixDQUFDO0FBQ3JDLGNBQWMsc0JBQXNCLENBQUM7QUFXckMsTUFBTSxPQUFPLGVBQWU7cUhBQWYsZUFBZTtzSEFBZixlQUFlO3NIQUFmLGVBQWUsYUFSZjtZQUNUO2dCQUNFLE9BQU8sRUFBRSxXQUFXO2dCQUNwQixRQUFRLEVBQUUsZ0JBQWdCO2dCQUMxQixJQUFJLEVBQUUsQ0FBQyxlQUFlLEVBQUUsOEJBQThCLENBQUM7YUFDeEQ7U0FDRjs7a0dBRVUsZUFBZTtrQkFUM0IsUUFBUTttQkFBQztvQkFDUixTQUFTLEVBQUU7d0JBQ1Q7NEJBQ0UsT0FBTyxFQUFFLFdBQVc7NEJBQ3BCLF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2xhc3M6IEx1eG9uRGF0ZUFkYXB0ZXIsXG4gICAgICBkZXBzOiBbTUFUX0RBVEVfTE9DQUxFLCBNQVRfTFVYT05fREFURV9BREFQVEVSX09QVElPTlNdLFxuICAgIH0sXG4gICAge3Byb3ZpZGU6IE1BVF9EQVRFX0ZPUk1BVFMsIHVzZVZhbHVlOiBmb3JtYXRzfSxcbiAgXTtcbn1cbiJdfQ==
@@ -199,10 +199,10 @@ export class LuxonDateAdapter extends DateAdapter {
199
199
  outputCalendar: this._defaultOutputCalendar,
200
200
  };
201
201
  }
202
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.2", ngImport: i0, type: LuxonDateAdapter, deps: [{ token: MAT_DATE_LOCALE, optional: true }, { token: MAT_LUXON_DATE_ADAPTER_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
203
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.0-next.2", ngImport: i0, type: LuxonDateAdapter }); }
202
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: LuxonDateAdapter, deps: [{ token: MAT_DATE_LOCALE, optional: true }, { token: MAT_LUXON_DATE_ADAPTER_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
203
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: LuxonDateAdapter }); }
204
204
  }
205
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.2", ngImport: i0, type: LuxonDateAdapter, decorators: [{
205
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: LuxonDateAdapter, decorators: [{
206
206
  type: Injectable
207
207
  }], ctorParameters: () => [{ type: undefined, decorators: [{
208
208
  type: Optional
@@ -193,10 +193,10 @@ class LuxonDateAdapter extends DateAdapter {
193
193
  outputCalendar: this._defaultOutputCalendar,
194
194
  };
195
195
  }
196
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.2", ngImport: i0, type: LuxonDateAdapter, deps: [{ token: MAT_DATE_LOCALE, optional: true }, { token: MAT_LUXON_DATE_ADAPTER_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
197
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.0-next.2", ngImport: i0, type: LuxonDateAdapter }); }
196
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: LuxonDateAdapter, deps: [{ token: MAT_DATE_LOCALE, optional: true }, { token: MAT_LUXON_DATE_ADAPTER_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
197
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: LuxonDateAdapter }); }
198
198
  }
199
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.2", ngImport: i0, type: LuxonDateAdapter, decorators: [{
199
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: LuxonDateAdapter, decorators: [{
200
200
  type: Injectable
201
201
  }], ctorParameters: () => [{ type: undefined, decorators: [{
202
202
  type: Optional
@@ -223,9 +223,9 @@ const MAT_LUXON_DATE_FORMATS = {
223
223
  };
224
224
 
225
225
  class LuxonDateModule {
226
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.2", ngImport: i0, type: LuxonDateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
227
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.0-next.2", ngImport: i0, type: LuxonDateModule }); }
228
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.0-next.2", ngImport: i0, type: LuxonDateModule, providers: [
226
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: LuxonDateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
227
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.0-next.5", ngImport: i0, type: LuxonDateModule }); }
228
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: LuxonDateModule, providers: [
229
229
  {
230
230
  provide: DateAdapter,
231
231
  useClass: LuxonDateAdapter,
@@ -233,7 +233,7 @@ class LuxonDateModule {
233
233
  },
234
234
  ] }); }
235
235
  }
236
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.2", ngImport: i0, type: LuxonDateModule, decorators: [{
236
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: LuxonDateModule, decorators: [{
237
237
  type: NgModule,
238
238
  args: [{
239
239
  providers: [
@@ -246,21 +246,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.2",
246
246
  }]
247
247
  }] });
248
248
  class MatLuxonDateModule {
249
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.2", ngImport: i0, type: MatLuxonDateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
250
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.0-next.2", ngImport: i0, type: MatLuxonDateModule, imports: [LuxonDateModule] }); }
251
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.0-next.2", ngImport: i0, type: MatLuxonDateModule, providers: [{ provide: MAT_DATE_FORMATS, useValue: MAT_LUXON_DATE_FORMATS }], imports: [LuxonDateModule] }); }
249
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: MatLuxonDateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
250
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.0-next.5", ngImport: i0, type: MatLuxonDateModule }); }
251
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: MatLuxonDateModule, providers: [provideLuxonDateAdapter()] }); }
252
252
  }
253
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.2", ngImport: i0, type: MatLuxonDateModule, decorators: [{
253
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: MatLuxonDateModule, decorators: [{
254
254
  type: NgModule,
255
255
  args: [{
256
- imports: [LuxonDateModule],
257
- providers: [{ provide: MAT_DATE_FORMATS, useValue: MAT_LUXON_DATE_FORMATS }],
256
+ providers: [provideLuxonDateAdapter()],
258
257
  }]
259
258
  }] });
259
+ function provideLuxonDateAdapter(formats = MAT_LUXON_DATE_FORMATS) {
260
+ return [
261
+ {
262
+ provide: DateAdapter,
263
+ useClass: LuxonDateAdapter,
264
+ deps: [MAT_DATE_LOCALE, MAT_LUXON_DATE_ADAPTER_OPTIONS],
265
+ },
266
+ { provide: MAT_DATE_FORMATS, useValue: formats },
267
+ ];
268
+ }
260
269
 
261
270
  /**
262
271
  * Generated bundle index. Do not edit.
263
272
  */
264
273
 
265
- export { LuxonDateAdapter, LuxonDateModule, MAT_LUXON_DATE_ADAPTER_OPTIONS, MAT_LUXON_DATE_ADAPTER_OPTIONS_FACTORY, MAT_LUXON_DATE_FORMATS, MatLuxonDateModule };
274
+ export { LuxonDateAdapter, LuxonDateModule, MAT_LUXON_DATE_ADAPTER_OPTIONS, MAT_LUXON_DATE_ADAPTER_OPTIONS_FACTORY, MAT_LUXON_DATE_FORMATS, MatLuxonDateModule, provideLuxonDateAdapter };
266
275
  //# sourceMappingURL=material-luxon-adapter.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"material-luxon-adapter.mjs","sources":["../../../../../../src/material-luxon-adapter/adapter/luxon-date-adapter.ts","../../../../../../src/material-luxon-adapter/adapter/luxon-date-formats.ts","../../../../../../src/material-luxon-adapter/adapter/index.ts","../../../../../../src/material-luxon-adapter/material-luxon-adapter_public_index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Inject, Injectable, Optional, InjectionToken} from '@angular/core';\nimport {DateAdapter, MAT_DATE_LOCALE} from '@angular/material/core';\nimport {\n DateTime as LuxonDateTime,\n Info as LuxonInfo,\n DateTimeOptions as LuxonDateTimeOptions,\n CalendarSystem as LuxonCalendarSystem,\n} from 'luxon';\n\n/** Configurable options for the `LuxonDateAdapter`. */\nexport interface MatLuxonDateAdapterOptions {\n /**\n * Turns the use of utc dates on or off.\n * Changing this will change how Angular Material components like DatePicker output dates.\n */\n useUtc: boolean;\n\n /**\n * Sets the first day of week.\n * Changing this will change how Angular Material components like DatePicker shows start of week.\n */\n firstDayOfWeek: number;\n\n /**\n * Sets the output Calendar.\n * Changing this will change how Angular Material components like DatePicker output dates.\n */\n defaultOutputCalendar: LuxonCalendarSystem;\n}\n\n/** InjectionToken for LuxonDateAdapter to configure options. */\nexport const MAT_LUXON_DATE_ADAPTER_OPTIONS = new InjectionToken<MatLuxonDateAdapterOptions>(\n 'MAT_LUXON_DATE_ADAPTER_OPTIONS',\n {\n providedIn: 'root',\n factory: MAT_LUXON_DATE_ADAPTER_OPTIONS_FACTORY,\n },\n);\n\n/** @docs-private */\nexport function MAT_LUXON_DATE_ADAPTER_OPTIONS_FACTORY(): MatLuxonDateAdapterOptions {\n return {\n useUtc: false,\n firstDayOfWeek: 0,\n defaultOutputCalendar: 'gregory',\n };\n}\n\n/** Creates an array and fills it with values. */\nfunction range<T>(length: number, valueFunction: (index: number) => T): T[] {\n const valuesArray = Array(length);\n for (let i = 0; i < length; i++) {\n valuesArray[i] = valueFunction(i);\n }\n return valuesArray;\n}\n\n/** Adapts Luxon Dates for use with Angular Material. */\n@Injectable()\nexport class LuxonDateAdapter extends DateAdapter<LuxonDateTime> {\n private _useUTC: boolean;\n private _firstDayOfWeek: number;\n private _defaultOutputCalendar: LuxonCalendarSystem;\n\n constructor(\n @Optional() @Inject(MAT_DATE_LOCALE) dateLocale: string,\n @Optional()\n @Inject(MAT_LUXON_DATE_ADAPTER_OPTIONS)\n options?: MatLuxonDateAdapterOptions,\n ) {\n super();\n this._useUTC = !!options?.useUtc;\n this._firstDayOfWeek = options?.firstDayOfWeek || 0;\n this._defaultOutputCalendar = options?.defaultOutputCalendar || 'gregory';\n this.setLocale(dateLocale || LuxonDateTime.local().locale);\n }\n\n getYear(date: LuxonDateTime): number {\n return date.year;\n }\n\n getMonth(date: LuxonDateTime): number {\n // Luxon works with 1-indexed months whereas our code expects 0-indexed.\n return date.month - 1;\n }\n\n getDate(date: LuxonDateTime): number {\n return date.day;\n }\n\n getDayOfWeek(date: LuxonDateTime): number {\n return date.weekday;\n }\n\n getMonthNames(style: 'long' | 'short' | 'narrow'): string[] {\n // Adding outputCalendar option, because LuxonInfo doesn't get effected by LuxonSettings\n return LuxonInfo.months(style, {\n locale: this.locale,\n outputCalendar: this._defaultOutputCalendar,\n });\n }\n\n getDateNames(): string[] {\n // At the time of writing, Luxon doesn't offer similar\n // functionality so we have to fall back to the Intl API.\n const dtf = new Intl.DateTimeFormat(this.locale, {day: 'numeric', timeZone: 'utc'});\n\n // Format a UTC date in order to avoid DST issues.\n return range(31, i => dtf.format(LuxonDateTime.utc(2017, 1, i + 1).toJSDate()));\n }\n\n getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[] {\n // Note that we shift the array once, because Luxon returns Monday as the\n // first day of the week, whereas our logic assumes that it's Sunday. See:\n // https://moment.github.io/luxon/api-docs/index.html#infoweekdays\n const days = LuxonInfo.weekdays(style, {locale: this.locale});\n days.unshift(days.pop()!);\n return days;\n }\n\n getYearName(date: LuxonDateTime): string {\n return date.toFormat('yyyy', this._getOptions());\n }\n\n getFirstDayOfWeek(): number {\n return this._firstDayOfWeek;\n }\n\n getNumDaysInMonth(date: LuxonDateTime): number {\n return date.daysInMonth;\n }\n\n clone(date: LuxonDateTime): LuxonDateTime {\n return LuxonDateTime.fromObject(date.toObject(), this._getOptions());\n }\n\n createDate(year: number, month: number, date: number): LuxonDateTime {\n const options = this._getOptions();\n\n if (month < 0 || month > 11) {\n throw Error(`Invalid month index \"${month}\". Month index has to be between 0 and 11.`);\n }\n\n if (date < 1) {\n throw Error(`Invalid date \"${date}\". Date has to be greater than 0.`);\n }\n\n // Luxon uses 1-indexed months so we need to add one to the month.\n const result = this._useUTC\n ? LuxonDateTime.utc(year, month + 1, date, options)\n : LuxonDateTime.local(year, month + 1, date, options);\n\n if (!this.isValid(result)) {\n throw Error(`Invalid date \"${date}\". Reason: \"${result.invalidReason}\".`);\n }\n\n return result;\n }\n\n today(): LuxonDateTime {\n const options = this._getOptions();\n\n return this._useUTC ? LuxonDateTime.utc(options) : LuxonDateTime.local(options);\n }\n\n parse(value: any, parseFormat: string | string[]): LuxonDateTime | null {\n const options: LuxonDateTimeOptions = this._getOptions();\n\n if (typeof value == 'string' && value.length > 0) {\n const iso8601Date = LuxonDateTime.fromISO(value, options);\n\n if (this.isValid(iso8601Date)) {\n return iso8601Date;\n }\n\n const formats = Array.isArray(parseFormat) ? parseFormat : [parseFormat];\n\n if (!parseFormat.length) {\n throw Error('Formats array must not be empty.');\n }\n\n for (const format of formats) {\n const fromFormat = LuxonDateTime.fromFormat(value, format, options);\n\n if (this.isValid(fromFormat)) {\n return fromFormat;\n }\n }\n\n return this.invalid();\n } else if (typeof value === 'number') {\n return LuxonDateTime.fromMillis(value, options);\n } else if (value instanceof Date) {\n return LuxonDateTime.fromJSDate(value, options);\n } else if (value instanceof LuxonDateTime) {\n return LuxonDateTime.fromMillis(value.toMillis(), options);\n }\n\n return null;\n }\n\n format(date: LuxonDateTime, displayFormat: string): string {\n if (!this.isValid(date)) {\n throw Error('LuxonDateAdapter: Cannot format invalid date.');\n }\n if (this._useUTC) {\n return date.setLocale(this.locale).setZone('utc').toFormat(displayFormat);\n } else {\n return date.setLocale(this.locale).toFormat(displayFormat);\n }\n }\n\n addCalendarYears(date: LuxonDateTime, years: number): LuxonDateTime {\n return date.reconfigure(this._getOptions()).plus({years});\n }\n\n addCalendarMonths(date: LuxonDateTime, months: number): LuxonDateTime {\n return date.reconfigure(this._getOptions()).plus({months});\n }\n\n addCalendarDays(date: LuxonDateTime, days: number): LuxonDateTime {\n return date.reconfigure(this._getOptions()).plus({days});\n }\n\n toIso8601(date: LuxonDateTime): string {\n return date.toISO();\n }\n\n /**\n * Returns the given value if given a valid Luxon or null. Deserializes valid ISO 8601 strings\n * (https://www.ietf.org/rfc/rfc3339.txt) and valid Date objects into valid DateTime and empty\n * string into null. Returns an invalid date for all other values.\n */\n override deserialize(value: any): LuxonDateTime | null {\n const options = this._getOptions();\n let date: LuxonDateTime | undefined;\n if (value instanceof Date) {\n date = LuxonDateTime.fromJSDate(value, options);\n }\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n date = LuxonDateTime.fromISO(value, options);\n }\n if (date && this.isValid(date)) {\n return date;\n }\n return super.deserialize(value);\n }\n\n isDateInstance(obj: any): boolean {\n return obj instanceof LuxonDateTime;\n }\n\n isValid(date: LuxonDateTime): boolean {\n return date.isValid;\n }\n\n invalid(): LuxonDateTime {\n return LuxonDateTime.invalid('Invalid Luxon DateTime object.');\n }\n\n /** Gets the options that should be used when constructing a new `DateTime` object. */\n private _getOptions(): LuxonDateTimeOptions {\n return {\n zone: this._useUTC ? 'utc' : undefined,\n locale: this.locale,\n outputCalendar: this._defaultOutputCalendar,\n };\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {MatDateFormats} from '@angular/material/core';\n\nexport const MAT_LUXON_DATE_FORMATS: MatDateFormats = {\n parse: {\n dateInput: 'D',\n },\n display: {\n dateInput: 'D',\n monthYearLabel: 'LLL yyyy',\n dateA11yLabel: 'DD',\n monthYearA11yLabel: 'LLLL yyyy',\n },\n};\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/core';\nimport {MAT_LUXON_DATE_ADAPTER_OPTIONS, LuxonDateAdapter} from './luxon-date-adapter';\nimport {MAT_LUXON_DATE_FORMATS} from './luxon-date-formats';\n\nexport * from './luxon-date-adapter';\nexport * from './luxon-date-formats';\n\n@NgModule({\n providers: [\n {\n provide: DateAdapter,\n useClass: LuxonDateAdapter,\n deps: [MAT_DATE_LOCALE, MAT_LUXON_DATE_ADAPTER_OPTIONS],\n },\n ],\n})\nexport class LuxonDateModule {}\n\n@NgModule({\n imports: [LuxonDateModule],\n providers: [{provide: MAT_DATE_FORMATS, useValue: MAT_LUXON_DATE_FORMATS}],\n})\nexport class MatLuxonDateModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["LuxonDateTime","LuxonInfo"],"mappings":";;;;;AAsCA;MACa,8BAA8B,GAAG,IAAI,cAAc,CAC9D,gCAAgC,EAChC;AACE,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE,sCAAsC;AAChD,CAAA,EACD;AAEF;SACgB,sCAAsC,GAAA;IACpD,OAAO;AACL,QAAA,MAAM,EAAE,KAAK;AACb,QAA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A,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,eAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,YANlB,eAAe,CAAA,EAAA,CAAA,CAAA,EAAA;AAMf,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,eAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,EAFlB,SAAA,EAAA,CAAC,EAAC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,sBAAsB,EAAC,CAAC,YADhE,eAAe,CAAA,EAAA,CAAA,CAAA,EAAA;;kGAGd,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,eAAe,CAAC;oBAC1B,SAAS,EAAE,CAAC,EAAC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,sBAAsB,EAAC,CAAC;AAC3E,iBAAA,CAAA;;;AC9BD;;AAEG;;;;"}
1
+ {"version":3,"file":"material-luxon-adapter.mjs","sources":["../../../../../../src/material-luxon-adapter/adapter/luxon-date-adapter.ts","../../../../../../src/material-luxon-adapter/adapter/luxon-date-formats.ts","../../../../../../src/material-luxon-adapter/adapter/index.ts","../../../../../../src/material-luxon-adapter/material-luxon-adapter_public_index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Inject, Injectable, Optional, InjectionToken} from '@angular/core';\nimport {DateAdapter, MAT_DATE_LOCALE} from '@angular/material/core';\nimport {\n DateTime as LuxonDateTime,\n Info as LuxonInfo,\n DateTimeOptions as LuxonDateTimeOptions,\n CalendarSystem as LuxonCalendarSystem,\n} from 'luxon';\n\n/** Configurable options for the `LuxonDateAdapter`. */\nexport interface MatLuxonDateAdapterOptions {\n /**\n * Turns the use of utc dates on or off.\n * Changing this will change how Angular Material components like DatePicker output dates.\n */\n useUtc: boolean;\n\n /**\n * Sets the first day of week.\n * Changing this will change how Angular Material components like DatePicker shows start of week.\n */\n firstDayOfWeek: number;\n\n /**\n * Sets the output Calendar.\n * Changing this will change how Angular Material components like DatePicker output dates.\n */\n defaultOutputCalendar: LuxonCalendarSystem;\n}\n\n/** InjectionToken for LuxonDateAdapter to configure options. */\nexport const MAT_LUXON_DATE_ADAPTER_OPTIONS = new InjectionToken<MatLuxonDateAdapterOptions>(\n 'MAT_LUXON_DATE_ADAPTER_OPTIONS',\n {\n providedIn: 'root',\n factory: MAT_LUXON_DATE_ADAPTER_OPTIONS_FACTORY,\n },\n);\n\n/** @docs-private */\nexport function MAT_LUXON_DATE_ADAPTER_OPTIONS_FACTORY(): MatLuxonDateAdapterOptions {\n return {\n useUtc: false,\n firstDayOfWeek: 0,\n defaultOutputCalendar: 'gregory',\n };\n}\n\n/** Creates an array and fills it with values. */\nfunction range<T>(length: number, valueFunction: (index: number) => T): T[] {\n const valuesArray = Array(length);\n for (let i = 0; i < length; i++) {\n valuesArray[i] = valueFunction(i);\n }\n return valuesArray;\n}\n\n/** Adapts Luxon Dates for use with Angular Material. */\n@Injectable()\nexport class LuxonDateAdapter extends DateAdapter<LuxonDateTime> {\n private _useUTC: boolean;\n private _firstDayOfWeek: number;\n private _defaultOutputCalendar: LuxonCalendarSystem;\n\n constructor(\n @Optional() @Inject(MAT_DATE_LOCALE) dateLocale: string,\n @Optional()\n @Inject(MAT_LUXON_DATE_ADAPTER_OPTIONS)\n options?: MatLuxonDateAdapterOptions,\n ) {\n super();\n this._useUTC = !!options?.useUtc;\n this._firstDayOfWeek = options?.firstDayOfWeek || 0;\n this._defaultOutputCalendar = options?.defaultOutputCalendar || 'gregory';\n this.setLocale(dateLocale || LuxonDateTime.local().locale);\n }\n\n getYear(date: LuxonDateTime): number {\n return date.year;\n }\n\n getMonth(date: LuxonDateTime): number {\n // Luxon works with 1-indexed months whereas our code expects 0-indexed.\n return date.month - 1;\n }\n\n getDate(date: LuxonDateTime): number {\n return date.day;\n }\n\n getDayOfWeek(date: LuxonDateTime): number {\n return date.weekday;\n }\n\n getMonthNames(style: 'long' | 'short' | 'narrow'): string[] {\n // Adding outputCalendar option, because LuxonInfo doesn't get effected by LuxonSettings\n return LuxonInfo.months(style, {\n locale: this.locale,\n outputCalendar: this._defaultOutputCalendar,\n });\n }\n\n getDateNames(): string[] {\n // At the time of writing, Luxon doesn't offer similar\n // functionality so we have to fall back to the Intl API.\n const dtf = new Intl.DateTimeFormat(this.locale, {day: 'numeric', timeZone: 'utc'});\n\n // Format a UTC date in order to avoid DST issues.\n return range(31, i => dtf.format(LuxonDateTime.utc(2017, 1, i + 1).toJSDate()));\n }\n\n getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[] {\n // Note that we shift the array once, because Luxon returns Monday as the\n // first day of the week, whereas our logic assumes that it's Sunday. See:\n // https://moment.github.io/luxon/api-docs/index.html#infoweekdays\n const days = LuxonInfo.weekdays(style, {locale: this.locale});\n days.unshift(days.pop()!);\n return days;\n }\n\n getYearName(date: LuxonDateTime): string {\n return date.toFormat('yyyy', this._getOptions());\n }\n\n getFirstDayOfWeek(): number {\n return this._firstDayOfWeek;\n }\n\n getNumDaysInMonth(date: LuxonDateTime): number {\n return date.daysInMonth;\n }\n\n clone(date: LuxonDateTime): LuxonDateTime {\n return LuxonDateTime.fromObject(date.toObject(), this._getOptions());\n }\n\n createDate(year: number, month: number, date: number): LuxonDateTime {\n const options = this._getOptions();\n\n if (month < 0 || month > 11) {\n throw Error(`Invalid month index \"${month}\". Month index has to be between 0 and 11.`);\n }\n\n if (date < 1) {\n throw Error(`Invalid date \"${date}\". Date has to be greater than 0.`);\n }\n\n // Luxon uses 1-indexed months so we need to add one to the month.\n const result = this._useUTC\n ? LuxonDateTime.utc(year, month + 1, date, options)\n : LuxonDateTime.local(year, month + 1, date, options);\n\n if (!this.isValid(result)) {\n throw Error(`Invalid date \"${date}\". Reason: \"${result.invalidReason}\".`);\n }\n\n return result;\n }\n\n today(): LuxonDateTime {\n const options = this._getOptions();\n\n return this._useUTC ? LuxonDateTime.utc(options) : LuxonDateTime.local(options);\n }\n\n parse(value: any, parseFormat: string | string[]): LuxonDateTime | null {\n const options: LuxonDateTimeOptions = this._getOptions();\n\n if (typeof value == 'string' && value.length > 0) {\n const iso8601Date = LuxonDateTime.fromISO(value, options);\n\n if (this.isValid(iso8601Date)) {\n return iso8601Date;\n }\n\n const formats = Array.isArray(parseFormat) ? parseFormat : [parseFormat];\n\n if (!parseFormat.length) {\n throw Error('Formats array must not be empty.');\n }\n\n for (const format of formats) {\n const fromFormat = LuxonDateTime.fromFormat(value, format, options);\n\n if (this.isValid(fromFormat)) {\n return fromFormat;\n }\n }\n\n return this.invalid();\n } else if (typeof value === 'number') {\n return LuxonDateTime.fromMillis(value, options);\n } else if (value instanceof Date) {\n return LuxonDateTime.fromJSDate(value, options);\n } else if (value instanceof LuxonDateTime) {\n return LuxonDateTime.fromMillis(value.toMillis(), options);\n }\n\n return null;\n }\n\n format(date: LuxonDateTime, displayFormat: string): string {\n if (!this.isValid(date)) {\n throw Error('LuxonDateAdapter: Cannot format invalid date.');\n }\n if (this._useUTC) {\n return date.setLocale(this.locale).setZone('utc').toFormat(displayFormat);\n } else {\n return date.setLocale(this.locale).toFormat(displayFormat);\n }\n }\n\n addCalendarYears(date: LuxonDateTime, years: number): LuxonDateTime {\n return date.reconfigure(this._getOptions()).plus({years});\n }\n\n addCalendarMonths(date: LuxonDateTime, months: number): LuxonDateTime {\n return date.reconfigure(this._getOptions()).plus({months});\n }\n\n addCalendarDays(date: LuxonDateTime, days: number): LuxonDateTime {\n return date.reconfigure(this._getOptions()).plus({days});\n }\n\n toIso8601(date: LuxonDateTime): string {\n return date.toISO();\n }\n\n /**\n * Returns the given value if given a valid Luxon or null. Deserializes valid ISO 8601 strings\n * (https://www.ietf.org/rfc/rfc3339.txt) and valid Date objects into valid DateTime and empty\n * string into null. Returns an invalid date for all other values.\n */\n override deserialize(value: any): LuxonDateTime | null {\n const options = this._getOptions();\n let date: LuxonDateTime | undefined;\n if (value instanceof Date) {\n date = LuxonDateTime.fromJSDate(value, options);\n }\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n date = LuxonDateTime.fromISO(value, options);\n }\n if (date && this.isValid(date)) {\n return date;\n }\n return super.deserialize(value);\n }\n\n isDateInstance(obj: any): boolean {\n return obj instanceof LuxonDateTime;\n }\n\n isValid(date: LuxonDateTime): boolean {\n return date.isValid;\n }\n\n invalid(): LuxonDateTime {\n return LuxonDateTime.invalid('Invalid Luxon DateTime object.');\n }\n\n /** Gets the options that should be used when constructing a new `DateTime` object. */\n private _getOptions(): LuxonDateTimeOptions {\n return {\n zone: this._useUTC ? 'utc' : undefined,\n locale: this.locale,\n outputCalendar: this._defaultOutputCalendar,\n };\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {MatDateFormats} from '@angular/material/core';\n\nexport const MAT_LUXON_DATE_FORMATS: MatDateFormats = {\n parse: {\n dateInput: 'D',\n },\n display: {\n dateInput: 'D',\n monthYearLabel: 'LLL yyyy',\n dateA11yLabel: 'DD',\n monthYearA11yLabel: 'LLLL yyyy',\n },\n};\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule, Provider} from '@angular/core';\nimport {\n DateAdapter,\n MAT_DATE_FORMATS,\n MAT_DATE_LOCALE,\n MatDateFormats,\n} from '@angular/material/core';\nimport {MAT_LUXON_DATE_ADAPTER_OPTIONS, LuxonDateAdapter} from './luxon-date-adapter';\nimport {MAT_LUXON_DATE_FORMATS} from './luxon-date-formats';\n\nexport * from './luxon-date-adapter';\nexport * from './luxon-date-formats';\n\n@NgModule({\n providers: [\n {\n provide: DateAdapter,\n useClass: LuxonDateAdapter,\n deps: [MAT_DATE_LOCALE, MAT_LUXON_DATE_ADAPTER_OPTIONS],\n },\n ],\n})\nexport class LuxonDateModule {}\n\n@NgModule({\n providers: [provideLuxonDateAdapter()],\n})\nexport class MatLuxonDateModule {}\n\nexport function provideLuxonDateAdapter(\n formats: MatDateFormats = MAT_LUXON_DATE_FORMATS,\n): Provider[] {\n return [\n {\n provide: DateAdapter,\n useClass: LuxonDateAdapter,\n deps: [MAT_DATE_LOCALE, MAT_LUXON_DATE_ADAPTER_OPTIONS],\n },\n {provide: MAT_DATE_FORMATS, useValue: formats},\n ];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["LuxonDateTime","LuxonInfo"],"mappings":";;;;;AAsCA;MACa,8BAA8B,GAAG,IAAI,cAAc,CAC9D,gCAAgC,EAChC;AACE,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE,sCAAsC;AAChD,CAAA,EACD;AAEF;SACgB,sCAAsC,GAAA;IACpD,OAAO;AACL,QAAA,MAAM,EAAE,KAAK;AACb,QAAA,cAAc,EAAE,CAAC;AACjB,QAAA,qBAAqB,EAAE,SAAS;KACjC,CAAC;AACJ,CAAC;AAED;AACA,SAAS,KAAK,CAAI,MAAc,EAAE,aAAmC,EAAA;AACnE,IAAA,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;AAClC,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QAC/B,WAAW,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;KACnC;AACD,IAAA,OAAO,WAAW,CAAC;AACrB,CAAC;AAED;AAEM,MAAO,gBAAiB,SAAQ,WAA0B,CAAA;IAK9D,WACuC,CAAA,UAAkB,EAGvD,OAAoC,EAAA;AAEpC,QAAA,K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gB;AAC1B,YAAA,IAAI,EAAE,CAAC,eAAe,EAAE,8BAA8B,CAAC;AACxD,SAAA;AACD,QAAA,EAAC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,OAAO,EAAC;KAC/C,CAAC;AACJ;;AChDA;;AAEG;;;;"}
package/index.d.ts CHANGED
@@ -4,6 +4,7 @@ import { DateTime } from 'luxon';
4
4
  import * as i0 from '@angular/core';
5
5
  import { InjectionToken } from '@angular/core';
6
6
  import { MatDateFormats } from '@angular/material/core';
7
+ import { Provider } from '@angular/core';
7
8
 
8
9
  /** Adapts Luxon Dates for use with Angular Material. */
9
10
  export declare class LuxonDateAdapter extends DateAdapter<DateTime> {
@@ -80,8 +81,10 @@ export declare interface MatLuxonDateAdapterOptions {
80
81
 
81
82
  export declare class MatLuxonDateModule {
82
83
  static ɵfac: i0.ɵɵFactoryDeclaration<MatLuxonDateModule, never>;
83
- static ɵmod: i0.ɵɵNgModuleDeclaration<MatLuxonDateModule, never, [typeof LuxonDateModule], never>;
84
+ static ɵmod: i0.ɵɵNgModuleDeclaration<MatLuxonDateModule, never, never, never>;
84
85
  static ɵinj: i0.ɵɵInjectorDeclaration<MatLuxonDateModule>;
85
86
  }
86
87
 
88
+ export declare function provideLuxonDateAdapter(formats?: MatDateFormats): Provider[];
89
+
87
90
  export { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/material-luxon-adapter",
3
- "version": "17.1.0-next.3",
3
+ "version": "17.1.0",
4
4
  "description": "Angular Material Luxon Adapter",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,8 +12,8 @@
12
12
  },
13
13
  "homepage": "https://github.com/angular/components#readme",
14
14
  "peerDependencies": {
15
- "@angular/material": "17.1.0-next.3",
16
- "@angular/core": "^17.0.0-0 || ^17.1.0-0 || ^17.2.0-0 || ^17.3.0-0 || ^18.0.0-0",
15
+ "@angular/material": "17.1.0",
16
+ "@angular/core": "^17.0.0 || ^18.0.0",
17
17
  "luxon": "^3.0.0"
18
18
  },
19
19
  "dependencies": {