@ecodev/natural 45.1.0 → 45.2.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.
@@ -5,6 +5,8 @@ import type { ReadonlyDeep } from 'type-fest';
5
5
  *
6
6
  * So something like: "2021-09-23"
7
7
  */
8
+ export declare function formatIsoDate(date: null): null;
9
+ export declare function formatIsoDate(date: Date): string;
8
10
  export declare function formatIsoDate(date: Date | null): string | null;
9
11
  /**
10
12
  * Format a date and time in a way that will preserve the local time zone.
@@ -2,16 +2,17 @@ import * as i0 from "@angular/core";
2
2
  import * as i1 from "./pipes/capitalize.pipe";
3
3
  import * as i2 from "./pipes/ellipsis.pipe";
4
4
  import * as i3 from "./pipes/enum.pipe";
5
- import * as i4 from "./pipes/swiss-date.pipe";
6
- import * as i5 from "../../directives/http-prefix.directive";
5
+ import * as i4 from "../../directives/http-prefix.directive";
6
+ import * as i5 from "./directives/linkable-tab.directive";
7
7
  import * as i6 from "./directives/src-density.directive";
8
- import * as i7 from "./directives/linkable-tab.directive";
9
- import * as i8 from "@angular/common";
10
- import * as i9 from "@angular/material/form-field";
11
- import * as i10 from "@angular/material/input";
12
- import * as i11 from "@angular/material/select";
8
+ import * as i7 from "./pipes/swiss-date.pipe";
9
+ import * as i8 from "./pipes/time-ago.pipe";
10
+ import * as i9 from "@angular/common";
11
+ import * as i10 from "@angular/material/form-field";
12
+ import * as i11 from "@angular/material/input";
13
+ import * as i12 from "@angular/material/select";
13
14
  export declare class NaturalCommonModule {
14
15
  static ɵfac: i0.ɵɵFactoryDeclaration<NaturalCommonModule, never>;
15
- static ɵmod: i0.ɵɵNgModuleDeclaration<NaturalCommonModule, [typeof i1.NaturalCapitalizePipe, typeof i2.NaturalEllipsisPipe, typeof i3.NaturalEnumPipe, typeof i4.NaturalSwissDatePipe, typeof i5.NaturalHttpPrefixDirective, typeof i6.NaturalSrcDensityDirective, typeof i7.NaturalLinkableTabDirective], [typeof i8.CommonModule, typeof i9.MatFormFieldModule, typeof i10.MatInputModule, typeof i11.MatSelectModule], [typeof i1.NaturalCapitalizePipe, typeof i2.NaturalEllipsisPipe, typeof i3.NaturalEnumPipe, typeof i4.NaturalSwissDatePipe, typeof i5.NaturalHttpPrefixDirective, typeof i6.NaturalSrcDensityDirective, typeof i7.NaturalLinkableTabDirective]>;
16
+ static ɵmod: i0.ɵɵNgModuleDeclaration<NaturalCommonModule, [typeof i1.NaturalCapitalizePipe, typeof i2.NaturalEllipsisPipe, typeof i3.NaturalEnumPipe, typeof i4.NaturalHttpPrefixDirective, typeof i5.NaturalLinkableTabDirective, typeof i6.NaturalSrcDensityDirective, typeof i7.NaturalSwissDatePipe, typeof i8.NaturalTimeAgoPipe], [typeof i9.CommonModule, typeof i10.MatFormFieldModule, typeof i11.MatInputModule, typeof i12.MatSelectModule], [typeof i1.NaturalCapitalizePipe, typeof i2.NaturalEllipsisPipe, typeof i3.NaturalEnumPipe, typeof i4.NaturalHttpPrefixDirective, typeof i5.NaturalLinkableTabDirective, typeof i6.NaturalSrcDensityDirective, typeof i7.NaturalSwissDatePipe, typeof i8.NaturalTimeAgoPipe]>;
16
17
  static ɵinj: i0.ɵɵInjectorDeclaration<NaturalCommonModule>;
17
18
  }
@@ -0,0 +1,19 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Returns a string to approximately describe the date.
5
+ *
6
+ * Eg:
7
+ *
8
+ * - "il y a quelques minutes"
9
+ * - "dans 3 jours"
10
+ * - "dans 3 ans"
11
+ */
12
+ export declare class NaturalTimeAgoPipe implements PipeTransform {
13
+ private readonly fakedNow;
14
+ constructor(fakedNow?: number | null);
15
+ private getNow;
16
+ transform(date: Date | string | null | undefined): string;
17
+ static ɵfac: i0.ɵɵFactoryDeclaration<NaturalTimeAgoPipe, [{ optional: true; }]>;
18
+ static ɵpipe: i0.ɵɵPipeDeclaration<NaturalTimeAgoPipe, "timeAgo", false>;
19
+ }
@@ -4,6 +4,7 @@ export * from './pipes/capitalize.pipe';
4
4
  export * from './pipes/ellipsis.pipe';
5
5
  export * from './pipes/enum.pipe';
6
6
  export * from './pipes/swiss-date.pipe';
7
+ export { NaturalTimeAgoPipe } from './pipes/time-ago.pipe';
7
8
  export * from './services/memory-storage';
8
9
  export { NaturalSrcDensityDirective } from './directives/src-density.directive';
9
10
  export { NATURAL_SEO_CONFIG, NaturalSeoConfig, NaturalSeoService, NaturalSeo, NaturalSeoBasic, NaturalSeoResolve, NaturalSeoCallback, } from './services/seo.service';
@@ -1,6 +1,7 @@
1
1
  import { EventEmitter } from '@angular/core';
2
2
  import { FormGroup } from '@angular/forms';
3
3
  import { ActivatedRoute } from '@angular/router';
4
+ import { NaturalAbstractController } from '../../classes/abstract-controller';
4
5
  import * as i0 from "@angular/core";
5
6
  declare type Model = {
6
7
  id?: string;
@@ -8,7 +9,7 @@ declare type Model = {
8
9
  delete: boolean;
9
10
  };
10
11
  };
11
- export declare class NaturalFixedButtonDetailComponent {
12
+ export declare class NaturalFixedButtonDetailComponent extends NaturalAbstractController {
12
13
  private canChange;
13
14
  isCreation: boolean;
14
15
  get model(): Model;
@@ -2,7 +2,6 @@ import { BehaviorSubject } from 'rxjs';
2
2
  import { NaturalHierarchicConfiguration } from './hierarchic-configuration';
3
3
  import { NameOrFullName } from '../../../types/types';
4
4
  export declare type HierarchicModel = {
5
- id: string;
6
5
  __typename: string;
7
6
  } & NameOrFullName;
8
7
  export declare class HierarchicModelNode {
@@ -1,8 +1,9 @@
1
1
  import * as i0 from "@angular/core";
2
2
  import * as i1 from "./stamp.component";
3
3
  import * as i2 from "@angular/common";
4
+ import * as i3 from "../common/common-module";
4
5
  export declare class NaturalStampModule {
5
6
  static ɵfac: i0.ɵɵFactoryDeclaration<NaturalStampModule, never>;
6
- static ɵmod: i0.ɵɵNgModuleDeclaration<NaturalStampModule, [typeof i1.NaturalStampComponent], [typeof i2.CommonModule], [typeof i1.NaturalStampComponent]>;
7
+ static ɵmod: i0.ɵɵNgModuleDeclaration<NaturalStampModule, [typeof i1.NaturalStampComponent], [typeof i2.CommonModule, typeof i3.NaturalCommonModule], [typeof i1.NaturalStampComponent]>;
7
8
  static ɵinj: i0.ɵɵInjectorDeclaration<NaturalStampModule>;
8
9
  }
@@ -8,6 +8,7 @@ declare type Stamped = {
8
8
  };
9
9
  export declare class NaturalStampComponent {
10
10
  item: Stamped;
11
+ showUpdate(): boolean;
11
12
  static ɵfac: i0.ɵɵFactoryDeclaration<NaturalStampComponent, never>;
12
13
  static ɵcmp: i0.ɵɵComponentDeclaration<NaturalStampComponent, "natural-stamp", never, { "item": "item"; }, {}, never, never, false>;
13
14
  }
@@ -11,9 +11,11 @@ export interface Literal {
11
11
  * An object with either a name or a fullName (or maybe both)
12
12
  */
13
13
  export declare type NameOrFullName = {
14
+ id: string;
14
15
  name: string;
15
16
  fullName?: string;
16
17
  } | {
18
+ id: string;
17
19
  name?: string;
18
20
  fullName: string;
19
21
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecodev/natural",
3
- "version": "45.1.0",
3
+ "version": "45.2.0",
4
4
  "license": "MIT",
5
5
  "repository": "github:Ecodev/natural",
6
6
  "sideEffects": false,