@koobiq/angular-moment-adapter 19.8.1 → 20.0.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,44 @@
1
- import * as i0 from "@angular/core";
2
- import * as i1 from "@koobiq/components/core";
3
- export * from './moment-date-adapter';
4
- export * from './moment-date-formats';
5
- export declare class MomentDateModule {
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken } from '@angular/core';
3
+ import * as i1 from '@koobiq/components/core';
4
+ import { MomentDateAdapterOptions, MomentDateAdapter as MomentDateAdapter$1 } from '@koobiq/moment-date-adapter';
5
+ import { Observable } from 'rxjs';
6
+ import * as _koobiq_date_adapter from '@koobiq/date-adapter';
7
+
8
+ /** Configurable options for {@see MomentDateAdapter}. */
9
+ type IKbqMomentDateAdapterOptions = MomentDateAdapterOptions;
10
+ /** InjectionToken for moment date adapter to configure options. */
11
+ declare const KBQ_MOMENT_DATE_ADAPTER_OPTIONS: InjectionToken<MomentDateAdapterOptions>;
12
+ /** @docs-private */
13
+ declare function KBQ_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY(): IKbqMomentDateAdapterOptions;
14
+ declare class MomentDateAdapter extends MomentDateAdapter$1 {
15
+ protected readonly options?: IKbqMomentDateAdapterOptions;
16
+ private localeService;
17
+ constructor();
18
+ /** A stream that emits when the locale changes. */
19
+ get localeChanges(): Observable<any>;
20
+ private _localeChanges;
21
+ /**
22
+ * Sets the locale used for all dates.
23
+ * @param locale The new locale.
24
+ */
25
+ setLocale: (locale: any) => void;
26
+ static ɵfac: i0.ɵɵFactoryDeclaration<MomentDateAdapter, never>;
27
+ static ɵprov: i0.ɵɵInjectableDeclaration<MomentDateAdapter>;
28
+ }
29
+
30
+ declare const KBQ_MOMENT_DATE_FORMATS: _koobiq_date_adapter.DateFormats;
31
+
32
+ declare class MomentDateModule {
6
33
  static ɵfac: i0.ɵɵFactoryDeclaration<MomentDateModule, never>;
7
34
  static ɵmod: i0.ɵɵNgModuleDeclaration<MomentDateModule, never, never, never>;
8
35
  static ɵinj: i0.ɵɵInjectorDeclaration<MomentDateModule>;
9
36
  }
10
- export declare class KbqMomentDateModule {
37
+ declare class KbqMomentDateModule {
11
38
  static ɵfac: i0.ɵɵFactoryDeclaration<KbqMomentDateModule, never>;
12
39
  static ɵmod: i0.ɵɵNgModuleDeclaration<KbqMomentDateModule, never, [typeof MomentDateModule, typeof i1.KbqLocaleServiceModule], never>;
13
40
  static ɵinj: i0.ɵɵInjectorDeclaration<KbqMomentDateModule>;
14
41
  }
42
+
43
+ export { KBQ_MOMENT_DATE_ADAPTER_OPTIONS, KBQ_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY, KBQ_MOMENT_DATE_FORMATS, KbqMomentDateModule, MomentDateAdapter, MomentDateModule };
44
+ export type { IKbqMomentDateAdapterOptions };
@@ -1,6 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, Optional, Inject, Injectable, NgModule } from '@angular/core';
3
- import * as i1 from '@koobiq/components/core';
2
+ import { InjectionToken, inject, Injectable, NgModule } from '@angular/core';
4
3
  import { KBQ_DATE_LOCALE, KBQ_LOCALE_SERVICE, DateAdapter, KbqLocaleServiceModule, KBQ_DATE_FORMATS } from '@koobiq/components/core';
5
4
  import { MomentDateAdapter as MomentDateAdapter$1, MOMENT_DATE_FORMATS } from '@koobiq/moment-date-adapter';
6
5
  import { Subject } from 'rxjs';
@@ -18,10 +17,11 @@ function KBQ_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY() {
18
17
  };
19
18
  }
20
19
  class MomentDateAdapter extends MomentDateAdapter$1 {
21
- constructor(dateLocale, options, localeService) {
20
+ constructor() {
21
+ const dateLocale = inject(KBQ_DATE_LOCALE, { optional: true });
22
+ const options = inject(KBQ_MOMENT_DATE_ADAPTER_OPTIONS, { optional: true }) ?? undefined;
22
23
  super(dateLocale, options);
23
- this.options = options;
24
- this.localeService = localeService;
24
+ this.localeService = inject(KBQ_LOCALE_SERVICE, { optional: true });
25
25
  this._localeChanges = new Subject();
26
26
  /**
27
27
  * Sets the locale used for all dates.
@@ -31,6 +31,7 @@ class MomentDateAdapter extends MomentDateAdapter$1 {
31
31
  super.setLocale(locale);
32
32
  this._localeChanges.next();
33
33
  };
34
+ this.options = options;
34
35
  this.setLocale(this.localeService?.id || dateLocale);
35
36
  this.localeService?.changes.subscribe(this.setLocale);
36
37
  }
@@ -38,57 +39,40 @@ class MomentDateAdapter extends MomentDateAdapter$1 {
38
39
  get localeChanges() {
39
40
  return this._localeChanges;
40
41
  }
41
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: MomentDateAdapter, deps: [{ token: KBQ_DATE_LOCALE, optional: true }, { token: KBQ_MOMENT_DATE_ADAPTER_OPTIONS, optional: true }, { token: KBQ_LOCALE_SERVICE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
42
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: MomentDateAdapter }); }
42
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: MomentDateAdapter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
43
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: MomentDateAdapter }); }
43
44
  }
44
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: MomentDateAdapter, decorators: [{
45
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: MomentDateAdapter, decorators: [{
45
46
  type: Injectable
46
- }], ctorParameters: () => [{ type: undefined, decorators: [{
47
- type: Optional
48
- }, {
49
- type: Inject,
50
- args: [KBQ_DATE_LOCALE]
51
- }] }, { type: undefined, decorators: [{
52
- type: Optional
53
- }, {
54
- type: Inject,
55
- args: [KBQ_MOMENT_DATE_ADAPTER_OPTIONS]
56
- }] }, { type: i1.KbqLocaleService, decorators: [{
57
- type: Optional
58
- }, {
59
- type: Inject,
60
- args: [KBQ_LOCALE_SERVICE]
61
- }] }] });
47
+ }], ctorParameters: () => [] });
62
48
 
63
49
  const KBQ_MOMENT_DATE_FORMATS = MOMENT_DATE_FORMATS;
64
50
 
65
51
  class MomentDateModule {
66
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: MomentDateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
67
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.21", ngImport: i0, type: MomentDateModule }); }
68
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: MomentDateModule, providers: [
52
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: MomentDateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
53
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.25", ngImport: i0, type: MomentDateModule }); }
54
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: MomentDateModule, providers: [
69
55
  {
70
56
  provide: DateAdapter,
71
- useClass: MomentDateAdapter,
72
- deps: [KBQ_DATE_LOCALE, KBQ_MOMENT_DATE_ADAPTER_OPTIONS, KBQ_LOCALE_SERVICE]
57
+ useClass: MomentDateAdapter
73
58
  }
74
59
  ] }); }
75
60
  }
76
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: MomentDateModule, decorators: [{
61
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: MomentDateModule, decorators: [{
77
62
  type: NgModule,
78
63
  args: [{
79
64
  providers: [
80
65
  {
81
66
  provide: DateAdapter,
82
- useClass: MomentDateAdapter,
83
- deps: [KBQ_DATE_LOCALE, KBQ_MOMENT_DATE_ADAPTER_OPTIONS, KBQ_LOCALE_SERVICE]
67
+ useClass: MomentDateAdapter
84
68
  }
85
69
  ]
86
70
  }]
87
71
  }] });
88
72
  class KbqMomentDateModule {
89
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: KbqMomentDateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
90
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.21", ngImport: i0, type: KbqMomentDateModule, imports: [MomentDateModule, KbqLocaleServiceModule] }); }
91
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: KbqMomentDateModule, providers: [
73
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqMomentDateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
74
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.25", ngImport: i0, type: KbqMomentDateModule, imports: [MomentDateModule, KbqLocaleServiceModule] }); }
75
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqMomentDateModule, providers: [
92
76
  {
93
77
  // todo после добавления McLocaleServiceModule возможно уже неактуально
94
78
  provide: KBQ_DATE_FORMATS,
@@ -96,7 +80,7 @@ class KbqMomentDateModule {
96
80
  }
97
81
  ], imports: [MomentDateModule, KbqLocaleServiceModule] }); }
98
82
  }
99
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: KbqMomentDateModule, decorators: [{
83
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqMomentDateModule, decorators: [{
100
84
  type: NgModule,
101
85
  args: [{
102
86
  imports: [MomentDateModule, KbqLocaleServiceModule],
@@ -1 +1 @@
1
- {"version":3,"file":"koobiq-angular-moment-adapter-adapter.mjs","sources":["../../../packages/angular-moment-adapter/adapter/moment-date-adapter.ts","../../../packages/angular-moment-adapter/adapter/moment-date-formats.ts","../../../packages/angular-moment-adapter/adapter/index.ts","../../../packages/angular-moment-adapter/adapter/koobiq-angular-moment-adapter-adapter.ts"],"sourcesContent":["import { Inject, Injectable, InjectionToken, Optional } from '@angular/core';\nimport { KBQ_DATE_LOCALE, KBQ_LOCALE_SERVICE, KbqLocaleService } from '@koobiq/components/core';\nimport { MomentDateAdapter as BaseMomentDateAdapter, MomentDateAdapterOptions } from '@koobiq/moment-date-adapter';\nimport { Observable, Subject } from 'rxjs';\n\n/** Configurable options for {@see MomentDateAdapter}. */\nexport type IKbqMomentDateAdapterOptions = MomentDateAdapterOptions;\n\n/** InjectionToken for moment date adapter to configure options. */\nexport const KBQ_MOMENT_DATE_ADAPTER_OPTIONS = new InjectionToken<IKbqMomentDateAdapterOptions>(\n 'KBQ_MOMENT_DATE_ADAPTER_OPTIONS',\n {\n providedIn: 'root',\n factory: KBQ_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY\n }\n);\n\n/** @docs-private */\nexport function KBQ_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY(): IKbqMomentDateAdapterOptions {\n return {\n useUtc: false,\n findDateFormat: false\n };\n}\n\n@Injectable()\nexport class MomentDateAdapter extends BaseMomentDateAdapter {\n constructor(\n @Optional() @Inject(KBQ_DATE_LOCALE) dateLocale: string,\n @Optional() @Inject(KBQ_MOMENT_DATE_ADAPTER_OPTIONS) protected readonly options?: IKbqMomentDateAdapterOptions,\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 /** A stream that emits when the locale changes. */\n get localeChanges(): Observable<any> {\n return this._localeChanges;\n }\n\n private _localeChanges = new Subject<void>();\n\n /**\n * Sets the locale used for all dates.\n * @param locale The new locale.\n */\n setLocale = (locale: any) => {\n super.setLocale(locale);\n this._localeChanges.next();\n };\n}\n","import { MOMENT_DATE_FORMATS } from '@koobiq/moment-date-adapter';\n\nexport const KBQ_MOMENT_DATE_FORMATS = MOMENT_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_MOMENT_DATE_ADAPTER_OPTIONS, MomentDateAdapter } from './moment-date-adapter';\n\nexport * from './moment-date-adapter';\nexport * from './moment-date-formats';\n\n@NgModule({\n providers: [\n {\n provide: DateAdapter,\n useClass: MomentDateAdapter,\n deps: [KBQ_DATE_LOCALE, KBQ_MOMENT_DATE_ADAPTER_OPTIONS, KBQ_LOCALE_SERVICE]\n }\n ]\n})\nexport class MomentDateModule {}\n\n@NgModule({\n imports: [MomentDateModule, KbqLocaleServiceModule],\n providers: [\n {\n // todo после добавления McLocaleServiceModule возможно уже неактуально\n provide: KBQ_DATE_FORMATS,\n useValue: null\n }\n ]\n})\nexport class KbqMomentDateModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["BaseMomentDateAdapter"],"mappings":";;;;;;;AAQA;MACa,+BAA+B,GAAG,IAAI,cAAc,CAC7D,iCAAiC,EACjC;AACI,IAAA,UA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ZnB,gBAAgB,EAGG,sBAAsB,CAAA,EAAA,CAAA,CAAA;AASzC,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,EAAA,SAAA,EARjB;AACP,YAAA;;AAEI,gBAAA,OAAO,EAAE,gBAAgB;AACzB,gBAAA,QAAQ,EAAE;AACb;SACJ,EAAA,OAAA,EAAA,CAPS,gBAAgB,EAAE,sBAAsB,CAAA,EAAA,CAAA,CAAA;;4FASzC,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAV/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,gBAAgB,EAAE,sBAAsB,CAAC;AACnD,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-moment-adapter-adapter.mjs","sources":["../../../packages/angular-moment-adapter/adapter/moment-date-adapter.ts","../../../packages/angular-moment-adapter/adapter/moment-date-formats.ts","../../../packages/angular-moment-adapter/adapter/index.ts","../../../packages/angular-moment-adapter/adapter/koobiq-angular-moment-adapter-adapter.ts"],"sourcesContent":["import { Injectable, InjectionToken, inject } from '@angular/core';\nimport { KBQ_DATE_LOCALE, KBQ_LOCALE_SERVICE, KbqLocaleService } from '@koobiq/components/core';\nimport { MomentDateAdapter as BaseMomentDateAdapter, MomentDateAdapterOptions } from '@koobiq/moment-date-adapter';\nimport { Observable, Subject } from 'rxjs';\n\n/** Configurable options for {@see MomentDateAdapter}. */\nexport type IKbqMomentDateAdapterOptions = MomentDateAdapterOptions;\n\n/** InjectionToken for moment date adapter to configure options. */\nexport const KBQ_MOMENT_DATE_ADAPTER_OPTIONS = new InjectionToken<IKbqMomentDateAdapterOptions>(\n 'KBQ_MOMENT_DATE_ADAPTER_OPTIONS',\n {\n providedIn: 'root',\n factory: KBQ_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY\n }\n);\n\n/** @docs-private */\nexport function KBQ_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY(): IKbqMomentDateAdapterOptions {\n return {\n useUtc: false,\n findDateFormat: false\n };\n}\n\n@Injectable()\nexport class MomentDateAdapter extends BaseMomentDateAdapter {\n protected readonly options?: IKbqMomentDateAdapterOptions;\n private localeService = inject<KbqLocaleService>(KBQ_LOCALE_SERVICE, { optional: true });\n constructor() {\n const dateLocale = inject(KBQ_DATE_LOCALE, { optional: true })!;\n const options =\n inject<IKbqMomentDateAdapterOptions>(KBQ_MOMENT_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 /** A stream that emits when the locale changes. */\n get localeChanges(): Observable<any> {\n return this._localeChanges;\n }\n\n private _localeChanges = new Subject<void>();\n\n /**\n * Sets the locale used for all dates.\n * @param locale The new locale.\n */\n setLocale = (locale: any) => {\n super.setLocale(locale);\n this._localeChanges.next();\n };\n}\n","import { MOMENT_DATE_FORMATS } from '@koobiq/moment-date-adapter';\n\nexport const KBQ_MOMENT_DATE_FORMATS = MOMENT_DATE_FORMATS;\n","import { NgModule } from '@angular/core';\nimport { DateAdapter, KBQ_DATE_FORMATS, KbqLocaleServiceModule } from '@koobiq/components/core';\nimport { MomentDateAdapter } from './moment-date-adapter';\n\nexport * from './moment-date-adapter';\nexport * from './moment-date-formats';\n\n@NgModule({\n providers: [\n {\n provide: DateAdapter,\n useClass: MomentDateAdapter\n }\n ]\n})\nexport class MomentDateModule {}\n\n@NgModule({\n imports: [MomentDateModule, KbqLocaleServiceModule],\n providers: [\n {\n // todo после добавления McLocaleServiceModule возможно уже неактуально\n provide: KBQ_DATE_FORMATS,\n useValue: null\n }\n ]\n})\nexport class KbqMomentDateModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["BaseMomentDateAdapter"],"mappings":";;;;;;AAQA;MACa,+BAA+B,GAAG,IAAI,cAAc,CAC7D,iCAAiC,EACjC;AACI,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE;AACZ,CAAA;AAGL;SACgB,uCAAuC,GAAA;IACnD,OAAO;AACH,QAAA,MAAM,EAAE,KAAK;AACb,QAAA,cAAc,EAAE;KACnB;AACL;AAGM,MAAO,iBAAkB,SAAQA,mBAAqB,CAAA;AAGxD,IAAA,WAAA,GAAA;AACI,QAAA,MAAM,UAAU,GAAG,MAAM,CAAC,eAAe,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAE;AAC/D,QAAA,MAAM,OAAO,GACT,MAAM,CAA+B,+BAA+B,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,SAAS;AAE1G,QAAA,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC;QANtB,IAAA,CAAA,aAAa,GAAG,MAAM,CAAmB,kBAAkB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAmBhF,QAAA,IAAA,CAAA,cAAc,GAAG,IAAI,OAAO,EAAQ;AAE5C;;;AAGG;AACH,QAAA,IAAA,CAAA,SAAS,GAAG,CAAC,MAAW,KAAI;AACxB,YAAA,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC;AACvB,YAAA,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE;AAC9B,QAAA,CAAC;AArBG,QAAA,IAAI,CAAC,OAAO,GAAG,OAAO;QAEtB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,UAAU,CAAC;QAEpD,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC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AA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,EAAA,SAAA,EARjB;AACP,YAAA;;AAEI,gBAAA,OAAO,EAAE,gBAAgB;AACzB,gBAAA,QAAQ,EAAE;AACb;SACJ,EAAA,OAAA,EAAA,CAPS,gBAAgB,EAAE,sBAAsB,CAAA,EAAA,CAAA,CAAA;;4FASzC,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAV/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,gBAAgB,EAAE,sBAAsB,CAAC;AACnD,oBAAA,SAAS,EAAE;AACP,wBAAA;;AAEI,4BAAA,OAAO,EAAE,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-moment-adapter",
3
- "version": "19.8.1",
3
+ "version": "20.0.0",
4
4
  "description": "Koobiq Moment Adapter",
5
5
  "keywords": [
6
6
  "angular",
@@ -14,7 +14,7 @@
14
14
  "license": "MIT",
15
15
  "peerDependencies": {
16
16
  "@koobiq/moment-date-adapter": "^3.1.4",
17
- "@koobiq/components": "19.8.1"
17
+ "@koobiq/components": "20.0.0"
18
18
  },
19
19
  "dependencies": {
20
20
  "tslib": "^2.6.2"
@@ -1,26 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- import { KbqLocaleService } from '@koobiq/components/core';
3
- import { MomentDateAdapter as BaseMomentDateAdapter, MomentDateAdapterOptions } from '@koobiq/moment-date-adapter';
4
- import { Observable } from 'rxjs';
5
- import * as i0 from "@angular/core";
6
- /** Configurable options for {@see MomentDateAdapter}. */
7
- export type IKbqMomentDateAdapterOptions = MomentDateAdapterOptions;
8
- /** InjectionToken for moment date adapter to configure options. */
9
- export declare const KBQ_MOMENT_DATE_ADAPTER_OPTIONS: InjectionToken<MomentDateAdapterOptions>;
10
- /** @docs-private */
11
- export declare function KBQ_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY(): IKbqMomentDateAdapterOptions;
12
- export declare class MomentDateAdapter extends BaseMomentDateAdapter {
13
- protected readonly options?: IKbqMomentDateAdapterOptions | undefined;
14
- private localeService?;
15
- constructor(dateLocale: string, options?: IKbqMomentDateAdapterOptions | undefined, localeService?: KbqLocaleService | undefined);
16
- /** A stream that emits when the locale changes. */
17
- get localeChanges(): Observable<any>;
18
- private _localeChanges;
19
- /**
20
- * Sets the locale used for all dates.
21
- * @param locale The new locale.
22
- */
23
- setLocale: (locale: any) => void;
24
- static ɵfac: i0.ɵɵFactoryDeclaration<MomentDateAdapter, [{ optional: true; }, { optional: true; }, { optional: true; }]>;
25
- static ɵprov: i0.ɵɵInjectableDeclaration<MomentDateAdapter>;
26
- }
@@ -1 +0,0 @@
1
- export declare const KBQ_MOMENT_DATE_FORMATS: import("@koobiq/date-adapter").DateFormats;
package/public-api.d.ts DELETED
@@ -1 +0,0 @@
1
- export {};