@koobiq/angular-luxon-adapter 19.8.3 → 20.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.
@@ -1,14 +1,40 @@
1
- import * as i0 from "@angular/core";
2
- import * as i1 from "@koobiq/components/core";
3
- export * from './date-adapter';
4
- export * from './date-formats';
5
- export declare class LuxonDateModule {
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken } from '@angular/core';
3
+ import * as i1 from '@koobiq/components/core';
4
+ import { LuxonDateAdapterOptions, LuxonDateAdapter as LuxonDateAdapter$1 } from '@koobiq/luxon-date-adapter';
5
+ import { Observable } from 'rxjs';
6
+ import * as _koobiq_date_adapter from '@koobiq/date-adapter';
7
+
8
+ /** Configurable options for {@see LuxonDateAdapter}. */
9
+ type KbqLuxonDateAdapterOptions = LuxonDateAdapterOptions;
10
+ /** InjectionToken for moment date adapter to configure options. */
11
+ declare const KBQ_LUXON_DATE_ADAPTER_OPTIONS: InjectionToken<LuxonDateAdapterOptions>;
12
+ /** @docs-private */
13
+ declare function KBQ_LUXON_DATE_ADAPTER_OPTIONS_FACTORY(): KbqLuxonDateAdapterOptions;
14
+ declare class LuxonDateAdapter extends LuxonDateAdapter$1 {
15
+ protected readonly options?: LuxonDateAdapterOptions;
16
+ private localeService;
17
+ /** A stream that emits when the locale changes. */
18
+ get localeChanges(): Observable<any>;
19
+ private _localeChanges;
20
+ constructor();
21
+ setLocale: (locale: string) => void;
22
+ static ɵfac: i0.ɵɵFactoryDeclaration<LuxonDateAdapter, never>;
23
+ static ɵprov: i0.ɵɵInjectableDeclaration<LuxonDateAdapter>;
24
+ }
25
+
26
+ declare const KBQ_LUXON_DATE_FORMATS: _koobiq_date_adapter.DateFormats;
27
+
28
+ declare class LuxonDateModule {
6
29
  static ɵfac: i0.ɵɵFactoryDeclaration<LuxonDateModule, never>;
7
30
  static ɵmod: i0.ɵɵNgModuleDeclaration<LuxonDateModule, never, never, never>;
8
31
  static ɵinj: i0.ɵɵInjectorDeclaration<LuxonDateModule>;
9
32
  }
10
- export declare class KbqLuxonDateModule {
33
+ declare class KbqLuxonDateModule {
11
34
  static ɵfac: i0.ɵɵFactoryDeclaration<KbqLuxonDateModule, never>;
12
35
  static ɵmod: i0.ɵɵNgModuleDeclaration<KbqLuxonDateModule, never, [typeof LuxonDateModule, typeof i1.KbqLocaleServiceModule], never>;
13
36
  static ɵinj: i0.ɵɵInjectorDeclaration<KbqLuxonDateModule>;
14
37
  }
38
+
39
+ export { KBQ_LUXON_DATE_ADAPTER_OPTIONS, KBQ_LUXON_DATE_ADAPTER_OPTIONS_FACTORY, KBQ_LUXON_DATE_FORMATS, KbqLuxonDateModule, LuxonDateAdapter, LuxonDateModule };
40
+ export type { KbqLuxonDateAdapterOptions };
@@ -1,7 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, Inject, Optional, Injectable, NgModule } from '@angular/core';
3
- import * as i1 from '@koobiq/components/core';
4
- import { KBQ_DEFAULT_LOCALE_ID, KBQ_DATE_LOCALE, KBQ_LOCALE_SERVICE, DateAdapter, KbqLocaleServiceModule, KBQ_DATE_FORMATS } from '@koobiq/components/core';
2
+ import { InjectionToken, inject, Injectable, NgModule } from '@angular/core';
3
+ import { KBQ_DATE_LOCALE, KBQ_LOCALE_SERVICE, KBQ_DEFAULT_LOCALE_ID, DateAdapter, KbqLocaleServiceModule, KBQ_DATE_FORMATS } from '@koobiq/components/core';
5
4
  import { getLocaleFirstDayOfWeek } from '@angular/common';
6
5
  import { LuxonDateAdapter as LuxonDateAdapter$1, LUXON_DATE_FORMATS } from '@koobiq/luxon-date-adapter';
7
6
  import { Info } from 'luxon';
@@ -21,10 +20,11 @@ class LuxonDateAdapter extends LuxonDateAdapter$1 {
21
20
  get localeChanges() {
22
21
  return this._localeChanges;
23
22
  }
24
- constructor(dateLocale, options, localeService) {
23
+ constructor() {
24
+ const dateLocale = inject(KBQ_DATE_LOCALE);
25
+ const options = inject(KBQ_LUXON_DATE_ADAPTER_OPTIONS, { optional: true }) ?? undefined;
25
26
  super(dateLocale, options);
26
- this.options = options;
27
- this.localeService = localeService;
27
+ this.localeService = inject(KBQ_LOCALE_SERVICE, { optional: true });
28
28
  this._localeChanges = new BehaviorSubject(KBQ_DEFAULT_LOCALE_ID);
29
29
  this.setLocale = (locale) => {
30
30
  super.setLocale(locale);
@@ -44,58 +44,44 @@ class LuxonDateAdapter extends LuxonDateAdapter$1 {
44
44
  }
45
45
  this._localeChanges.next(locale);
46
46
  };
47
+ this.options = options;
47
48
  this.setLocale(this.localeService?.id || dateLocale);
48
49
  this.localeService?.changes.subscribe(this.setLocale);
49
50
  }
50
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: LuxonDateAdapter, deps: [{ token: KBQ_DATE_LOCALE }, { token: KBQ_LUXON_DATE_ADAPTER_OPTIONS, optional: true }, { token: KBQ_LOCALE_SERVICE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
51
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: LuxonDateAdapter }); }
51
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: LuxonDateAdapter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
52
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: LuxonDateAdapter }); }
52
53
  }
53
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: LuxonDateAdapter, decorators: [{
54
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: LuxonDateAdapter, decorators: [{
54
55
  type: Injectable
55
- }], ctorParameters: () => [{ type: undefined, decorators: [{
56
- type: Inject,
57
- args: [KBQ_DATE_LOCALE]
58
- }] }, { type: undefined, decorators: [{
59
- type: Optional
60
- }, {
61
- type: Inject,
62
- args: [KBQ_LUXON_DATE_ADAPTER_OPTIONS]
63
- }] }, { type: i1.KbqLocaleService, decorators: [{
64
- type: Optional
65
- }, {
66
- type: Inject,
67
- args: [KBQ_LOCALE_SERVICE]
68
- }] }] });
56
+ }], ctorParameters: () => [] });
69
57
 
70
58
  const KBQ_LUXON_DATE_FORMATS = LUXON_DATE_FORMATS;
71
59
 
72
60
  class LuxonDateModule {
73
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: LuxonDateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
74
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.21", ngImport: i0, type: LuxonDateModule }); }
75
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: LuxonDateModule, providers: [
61
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: LuxonDateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
62
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.25", ngImport: i0, type: LuxonDateModule }); }
63
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: LuxonDateModule, providers: [
76
64
  {
77
65
  provide: DateAdapter,
78
- useClass: LuxonDateAdapter,
79
- deps: [KBQ_DATE_LOCALE, KBQ_LUXON_DATE_ADAPTER_OPTIONS, KBQ_LOCALE_SERVICE]
66
+ useClass: LuxonDateAdapter
80
67
  }
81
68
  ] }); }
82
69
  }
83
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: LuxonDateModule, decorators: [{
70
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: LuxonDateModule, decorators: [{
84
71
  type: NgModule,
85
72
  args: [{
86
73
  providers: [
87
74
  {
88
75
  provide: DateAdapter,
89
- useClass: LuxonDateAdapter,
90
- deps: [KBQ_DATE_LOCALE, KBQ_LUXON_DATE_ADAPTER_OPTIONS, KBQ_LOCALE_SERVICE]
76
+ useClass: LuxonDateAdapter
91
77
  }
92
78
  ]
93
79
  }]
94
80
  }] });
95
81
  class KbqLuxonDateModule {
96
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: KbqLuxonDateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
97
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.21", ngImport: i0, type: KbqLuxonDateModule, imports: [LuxonDateModule, KbqLocaleServiceModule] }); }
98
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: KbqLuxonDateModule, providers: [
82
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqLuxonDateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
83
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.25", ngImport: i0, type: KbqLuxonDateModule, imports: [LuxonDateModule, KbqLocaleServiceModule] }); }
84
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqLuxonDateModule, providers: [
99
85
  {
100
86
  // todo после добавления KbqLocaleServiceModule возможно уже неактуально
101
87
  provide: KBQ_DATE_FORMATS,
@@ -103,7 +89,7 @@ class KbqLuxonDateModule {
103
89
  }
104
90
  ], imports: [LuxonDateModule, KbqLocaleServiceModule] }); }
105
91
  }
106
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: KbqLuxonDateModule, decorators: [{
92
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqLuxonDateModule, decorators: [{
107
93
  type: NgModule,
108
94
  args: [{
109
95
  imports: [LuxonDateModule, KbqLocaleServiceModule],
@@ -1 +1 @@
1
- {"version":3,"file":"koobiq-angular-luxon-adapter-adapter.mjs","sources":["../../../packages/angular-luxon-adapter/adapter/date-adapter.ts","../../../packages/angular-luxon-adapter/adapter/date-formats.ts","../../../packages/angular-luxon-adapter/adapter/index.ts","../../../packages/angular-luxon-adapter/adapter/koobiq-angular-luxon-adapter-adapter.ts"],"sourcesContent":["import { getLocaleFirstDayOfWeek } from '@angular/common';\nimport { Inject, Injectable, InjectionToken, Optional } from '@angular/core';\nimport { KBQ_DATE_LOCALE, KBQ_DEFAULT_LOCALE_ID, KBQ_LOCALE_SERVICE, KbqLocaleService } from '@koobiq/components/core';\nimport { LuxonDateAdapter as BaseLuxonDateAdapter, LuxonDateAdapterOptions } from '@koobiq/luxon-date-adapter';\nimport { Info } from 'luxon';\nimport { BehaviorSubject, Observable } from 'rxjs';\n\n/** Configurable options for {@see LuxonDateAdapter}. */\nexport type KbqLuxonDateAdapterOptions = LuxonDateAdapterOptions;\n\n/** InjectionToken for moment date adapter to configure options. */\nexport const KBQ_LUXON_DATE_ADAPTER_OPTIONS = new InjectionToken<KbqLuxonDateAdapterOptions>(\n 'KBQ_MOMENT_DATE_ADAPTER_OPTIONS',\n {\n providedIn: 'root',\n factory: KBQ_LUXON_DATE_ADAPTER_OPTIONS_FACTORY\n }\n);\n\n/** @docs-private */\nexport function KBQ_LUXON_DATE_ADAPTER_OPTIONS_FACTORY(): KbqLuxonDateAdapterOptions {\n return { useUtc: false };\n}\n\n@Injectable()\nexport class LuxonDateAdapter extends BaseLuxonDateAdapter {\n /** A stream that emits when the locale changes. */\n get localeChanges(): Observable<any> {\n return this._localeChanges;\n }\n\n private _localeChanges = new BehaviorSubject<string>(KBQ_DEFAULT_LOCALE_ID);\n\n constructor(\n @Inject(KBQ_DATE_LOCALE) dateLocale: string,\n @Optional() @Inject(KBQ_LUXON_DATE_ADAPTER_OPTIONS) protected readonly options?: LuxonDateAdapterOptions,\n @Optional() @Inject(KBQ_LOCALE_SERVICE) private localeService?: KbqLocaleService\n ) {\n super(dateLocale, options);\n\n this.setLocale(this.localeService?.id || dateLocale);\n\n this.localeService?.changes.subscribe(this.setLocale);\n }\n\n setLocale = (locale: string): void => {\n super.setLocale(locale);\n\n // try to find locale using angular core utilities\n if (Object.keys(this.localeData).length <= 1) {\n const options = { locale };\n const localeData = {\n ...this.localeData,\n firstDayOfWeek: getLocaleFirstDayOfWeek(locale),\n longMonths: Info.monthsFormat('long', options),\n shortMonths: Info.monthsFormat('short', options),\n narrowDaysOfWeek: Info.weekdaysFormat('narrow', options),\n shortDaysOfWeek: Info.weekdaysFormat('short', options),\n longDaysOfWeek: Info.weekdaysFormat('long', options)\n };\n\n this.updateLocaleData(localeData);\n }\n\n this._localeChanges.next(locale);\n };\n}\n","import { LUXON_DATE_FORMATS } from '@koobiq/luxon-date-adapter';\n\nexport const KBQ_LUXON_DATE_FORMATS = LUXON_DATE_FORMATS;\n","import { NgModule } from '@angular/core';\nimport {\n DateAdapter,\n KBQ_DATE_FORMATS,\n KBQ_DATE_LOCALE,\n KBQ_LOCALE_SERVICE,\n KbqLocaleServiceModule\n} from '@koobiq/components/core';\nimport { KBQ_LUXON_DATE_ADAPTER_OPTIONS, LuxonDateAdapter } from './date-adapter';\n\nexport * from './date-adapter';\nexport * from './date-formats';\n\n@NgModule({\n providers: [\n {\n provide: DateAdapter,\n useClass: LuxonDateAdapter,\n deps: [KBQ_DATE_LOCALE, KBQ_LUXON_DATE_ADAPTER_OPTIONS, KBQ_LOCALE_SERVICE]\n }\n ]\n})\nexport class LuxonDateModule {}\n\n@NgModule({\n imports: [LuxonDateModule, KbqLocaleServiceModule],\n providers: [\n {\n // todo после добавления KbqLocaleServiceModule возможно уже неактуально\n provide: KBQ_DATE_FORMATS,\n useValue: null\n }\n ]\n})\nexport class KbqLuxonDateModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["BaseLuxonDateAdapter"],"mappings":";;;;;;;;;AAUA;MACa,8BAA8B,GAAG,IAAI,cAAc,CAC5D,iCAAiC,EACjC;AACI,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE;AACZ,CAAA;AAGL;SACgB,sCAAsC,GAAA;AAClD,IAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE;AAC5B;AAGM,MAAO,gBAAiB,SAAQA,kBAAoB,CAAA;;AAEtD,IAAA,IAAI,aAAa,GAAA;QACb,OAAO,IAAI,CAAC,cAAc;IAC9B;AAIA,IAAA,WAAA,CAC6B,UAAkB,EAC4B,OAAiC,EACxD,aAAgC,EAAA;AAEhF,QAAA,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC;QAH6C,IAAA,CAAA,OAAO,GAAP,OAAO;QAC9B,IAAA,CAAA,aAAa,GAAb,aAAa;AALzD,QAAA,IAAA,CAAA,cAAc,GAAG,IAAI,eAAe,CAAS,qBAAqB,CAAC;AAc3E,QAAA,IAAA,CAAA,SAAS,GAAG,CAAC,MAAc,KAAU;AACjC,YAAA,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC;;AAGvB,YAAA,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,IAAI,CAAC,EAAE;AAC1C,gBAAA,MAAM,OAAO,GAAG,EAAE,MAAM,EAAE;AAC1B,gBAAA,MAAM,UAAU,GAAG;oBACf,GAAG,IA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,IAAA,EAAA,kBAAkB,EAAA,SAAA,EARhB;AACP,YAAA;;AAEI,gBAAA,OAAO,EAAE,gBAAgB;AACzB,gBAAA,QAAQ,EAAE;AACb;SACJ,EAAA,OAAA,EAAA,CAPS,eAAe,EAAE,sBAAsB,CAAA,EAAA,CAAA,CAAA;;4FASxC,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAV9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,eAAe,EAAE,sBAAsB,CAAC;AAClD,oBAAA,SAAS,EAAE;AACP,wBAAA;;AAEI,4BAAA,OAAO,EAAE,gBAAgB;AACzB,4BAAA,QAAQ,EAAE;AACb;AACJ;AACJ,iBAAA;;;ACjCD;;AAEG;;;;"}
1
+ {"version":3,"file":"koobiq-angular-luxon-adapter-adapter.mjs","sources":["../../../packages/angular-luxon-adapter/adapter/date-adapter.ts","../../../packages/angular-luxon-adapter/adapter/date-formats.ts","../../../packages/angular-luxon-adapter/adapter/index.ts","../../../packages/angular-luxon-adapter/adapter/koobiq-angular-luxon-adapter-adapter.ts"],"sourcesContent":["import { getLocaleFirstDayOfWeek } from '@angular/common';\nimport { Injectable, InjectionToken, inject } from '@angular/core';\nimport { KBQ_DATE_LOCALE, KBQ_DEFAULT_LOCALE_ID, KBQ_LOCALE_SERVICE, KbqLocaleService } from '@koobiq/components/core';\nimport { LuxonDateAdapter as BaseLuxonDateAdapter, LuxonDateAdapterOptions } from '@koobiq/luxon-date-adapter';\nimport { Info } from 'luxon';\nimport { BehaviorSubject, Observable } from 'rxjs';\n\n/** Configurable options for {@see LuxonDateAdapter}. */\nexport type KbqLuxonDateAdapterOptions = LuxonDateAdapterOptions;\n\n/** InjectionToken for moment date adapter to configure options. */\nexport const KBQ_LUXON_DATE_ADAPTER_OPTIONS = new InjectionToken<KbqLuxonDateAdapterOptions>(\n 'KBQ_MOMENT_DATE_ADAPTER_OPTIONS',\n {\n providedIn: 'root',\n factory: KBQ_LUXON_DATE_ADAPTER_OPTIONS_FACTORY\n }\n);\n\n/** @docs-private */\nexport function KBQ_LUXON_DATE_ADAPTER_OPTIONS_FACTORY(): KbqLuxonDateAdapterOptions {\n return { useUtc: false };\n}\n\n@Injectable()\nexport class LuxonDateAdapter extends BaseLuxonDateAdapter {\n protected readonly options?: LuxonDateAdapterOptions;\n private localeService = inject<KbqLocaleService>(KBQ_LOCALE_SERVICE, { optional: true });\n /** A stream that emits when the locale changes. */\n get localeChanges(): Observable<any> {\n return this._localeChanges;\n }\n\n private _localeChanges = new BehaviorSubject<string>(KBQ_DEFAULT_LOCALE_ID);\n\n constructor() {\n const dateLocale = inject(KBQ_DATE_LOCALE);\n const options =\n inject<LuxonDateAdapterOptions>(KBQ_LUXON_DATE_ADAPTER_OPTIONS, { optional: true }) ?? undefined;\n\n super(dateLocale, options);\n this.options = options;\n\n this.setLocale(this.localeService?.id || dateLocale);\n\n this.localeService?.changes.subscribe(this.setLocale);\n }\n\n setLocale = (locale: string): void => {\n super.setLocale(locale);\n\n // try to find locale using angular core utilities\n if (Object.keys(this.localeData).length <= 1) {\n const options = { locale };\n const localeData = {\n ...this.localeData,\n firstDayOfWeek: getLocaleFirstDayOfWeek(locale),\n longMonths: Info.monthsFormat('long', options),\n shortMonths: Info.monthsFormat('short', options),\n narrowDaysOfWeek: Info.weekdaysFormat('narrow', options),\n shortDaysOfWeek: Info.weekdaysFormat('short', options),\n longDaysOfWeek: Info.weekdaysFormat('long', options)\n };\n\n this.updateLocaleData(localeData);\n }\n\n this._localeChanges.next(locale);\n };\n}\n","import { LUXON_DATE_FORMATS } from '@koobiq/luxon-date-adapter';\n\nexport const KBQ_LUXON_DATE_FORMATS = LUXON_DATE_FORMATS;\n","import { NgModule } from '@angular/core';\nimport { DateAdapter, KBQ_DATE_FORMATS, KbqLocaleServiceModule } from '@koobiq/components/core';\nimport { LuxonDateAdapter } from './date-adapter';\n\nexport * from './date-adapter';\nexport * from './date-formats';\n\n@NgModule({\n providers: [\n {\n provide: DateAdapter,\n useClass: LuxonDateAdapter\n }\n ]\n})\nexport class LuxonDateModule {}\n\n@NgModule({\n imports: [LuxonDateModule, KbqLocaleServiceModule],\n providers: [\n {\n // todo после добавления KbqLocaleServiceModule возможно уже неактуально\n provide: KBQ_DATE_FORMATS,\n useValue: null\n }\n ]\n})\nexport class KbqLuxonDateModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["BaseLuxonDateAdapter"],"mappings":";;;;;;;;AAUA;MACa,8BAA8B,GAAG,IAAI,cAAc,CAC5D,iCAAiC,EACjC;AACI,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE;AACZ,CAAA;AAGL;SACgB,sCAAsC,GAAA;AAClD,IAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE;AAC5B;AAGM,MAAO,gBAAiB,SAAQA,kBAAoB,CAAA;;AAItD,IAAA,IAAI,aAAa,GAAA;QACb,OAAO,IAAI,CAAC,cAAc;IAC9B;AAIA,IAAA,WAAA,GAAA;AACI,QAAA,MAAM,UAAU,GAAG,MAAM,CAAC,eAAe,CAAC;AAC1C,QAAA,MAAM,OAAO,GACT,MAAM,CAA0B,8BAA8B,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,SAAS;AAEpG,QAAA,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC;QAbtB,IAAA,CAAA,aAAa,GAAG,MAAM,CAAmB,kBAAkB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAMhF,QAAA,IAAA,CAAA,cAAc,GAAG,IAAI,eAAe,CAAS,qBAAqB,CAAC;AAe3E,QAAA,IAAA,CAAA,SAAS,GAAG,CAAC,MAAc,KAAU;AACjC,YAAA,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC;;AAGvB,YAAA,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,IAAI,CAAC,EAAE;AAC1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AAE,gBAAgB;AACzB,4BAAA,QAAQ,EAAE;AACb;AACJ;AACJ,iBAAA;;;AC1BD;;AAEG;;;;"}
package/index.d.ts CHANGED
@@ -1 +1,2 @@
1
- export * from './public-api';
1
+
2
+ export { };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koobiq/angular-luxon-adapter",
3
- "version": "19.8.3",
3
+ "version": "20.1.0",
4
4
  "description": "Koobiq Luxon Adapter",
5
5
  "keywords": [
6
6
  "angular",
@@ -14,7 +14,7 @@
14
14
  "license": "MIT",
15
15
  "peerDependencies": {
16
16
  "@koobiq/luxon-date-adapter": "^3.1.4",
17
- "@koobiq/components": "19.8.3"
17
+ "@koobiq/components": "20.1.0"
18
18
  },
19
19
  "dependencies": {
20
20
  "tslib": "^2.6.2"
@@ -1,22 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- import { KbqLocaleService } from '@koobiq/components/core';
3
- import { LuxonDateAdapter as BaseLuxonDateAdapter, LuxonDateAdapterOptions } from '@koobiq/luxon-date-adapter';
4
- import { Observable } from 'rxjs';
5
- import * as i0 from "@angular/core";
6
- /** Configurable options for {@see LuxonDateAdapter}. */
7
- export type KbqLuxonDateAdapterOptions = LuxonDateAdapterOptions;
8
- /** InjectionToken for moment date adapter to configure options. */
9
- export declare const KBQ_LUXON_DATE_ADAPTER_OPTIONS: InjectionToken<LuxonDateAdapterOptions>;
10
- /** @docs-private */
11
- export declare function KBQ_LUXON_DATE_ADAPTER_OPTIONS_FACTORY(): KbqLuxonDateAdapterOptions;
12
- export declare class LuxonDateAdapter extends BaseLuxonDateAdapter {
13
- protected readonly options?: LuxonDateAdapterOptions | undefined;
14
- private localeService?;
15
- /** A stream that emits when the locale changes. */
16
- get localeChanges(): Observable<any>;
17
- private _localeChanges;
18
- constructor(dateLocale: string, options?: LuxonDateAdapterOptions | undefined, localeService?: KbqLocaleService | undefined);
19
- setLocale: (locale: string) => void;
20
- static ɵfac: i0.ɵɵFactoryDeclaration<LuxonDateAdapter, [null, { optional: true; }, { optional: true; }]>;
21
- static ɵprov: i0.ɵɵInjectableDeclaration<LuxonDateAdapter>;
22
- }
@@ -1 +0,0 @@
1
- export declare const KBQ_LUXON_DATE_FORMATS: import("@koobiq/date-adapter").DateFormats;
package/public-api.d.ts DELETED
@@ -1 +0,0 @@
1
- export {};