@ecodev/natural 36.1.5 → 38.0.1

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 (47) hide show
  1. package/bundles/ecodev-natural.umd.js +126 -103
  2. package/bundles/ecodev-natural.umd.js.map +1 -1
  3. package/ecodev-natural.metadata.json +1 -1
  4. package/esm2015/lib/classes/abstract-list.js +7 -5
  5. package/esm2015/lib/classes/abstract-navigable-list.js +32 -23
  6. package/esm2015/lib/classes/apollo-utils.js +4 -31
  7. package/esm2015/lib/classes/utility.js +32 -1
  8. package/esm2015/lib/classes/validators.js +2 -2
  9. package/esm2015/lib/modules/alert/confirm.component.js +1 -1
  10. package/esm2015/lib/modules/avatar/sources/gravatar.js +2 -2
  11. package/esm2015/lib/modules/detail-header/detail-header.component.js +1 -1
  12. package/esm2015/lib/modules/dialog-trigger/dialog-trigger.component.js +8 -4
  13. package/esm2015/lib/modules/dropdown-components/type-number/type-number.component.js +1 -1
  14. package/esm2015/lib/modules/dropdown-components/type-text/type-text.component.js +1 -1
  15. package/esm2015/lib/modules/file/component/file.component.js +1 -1
  16. package/esm2015/lib/modules/file/file-drop.directive.js +2 -4
  17. package/esm2015/lib/modules/fixed-button/fixed-button.component.js +1 -1
  18. package/esm2015/lib/modules/hierarchic-selector/hierarchic-selector/hierarchic-selector.component.js +1 -1
  19. package/esm2015/lib/modules/hierarchic-selector/hierarchic-selector-dialog/hierarchic-selector-dialog.component.js +1 -1
  20. package/esm2015/lib/modules/icon/icon.component.js +1 -1
  21. package/esm2015/lib/modules/relations/relations.component.js +1 -1
  22. package/esm2015/lib/modules/search/dropdown-container/dropdown-container.component.js +2 -2
  23. package/esm2015/lib/modules/search/dropdown-container/dropdown-ref.js +1 -1
  24. package/esm2015/lib/modules/search/facet-selector/facet-selector.component.js +1 -1
  25. package/esm2015/lib/modules/search/group/group.component.js +1 -1
  26. package/esm2015/lib/modules/search/input/input.component.js +4 -4
  27. package/esm2015/lib/modules/search/search/search.component.js +1 -1
  28. package/esm2015/lib/modules/select/select/select.component.js +1 -1
  29. package/esm2015/lib/modules/select/select-hierarchic/select-hierarchic.component.js +1 -1
  30. package/esm2015/lib/modules/sidenav/sidenav-container/sidenav-container.component.js +8 -3
  31. package/esm2015/lib/modules/sidenav/sidenav-content/sidenav-content.component.js +1 -1
  32. package/esm2015/lib/modules/table-button/table-button.component.js +1 -1
  33. package/fesm2015/ecodev-natural.js +109 -88
  34. package/fesm2015/ecodev-natural.js.map +1 -1
  35. package/lib/classes/abstract-list.d.ts +1 -1
  36. package/lib/classes/abstract-navigable-list.d.ts +4 -2
  37. package/lib/classes/utility.d.ts +9 -0
  38. package/lib/modules/dialog-trigger/dialog-trigger.component.d.ts +6 -6
  39. package/lib/modules/search/dropdown-container/dropdown-container.component.d.ts +1 -2
  40. package/lib/modules/sidenav/sidenav-container/sidenav-container.component.d.ts +5 -0
  41. package/package.json +5 -5
  42. package/src/lib/modules/alert/_alert.theme.scss +1 -1
  43. package/src/lib/modules/file/component/_file.theme.scss +1 -1
  44. package/src/lib/modules/icon/_icon.theme.scss +1 -1
  45. package/src/lib/modules/search/dropdown-container/_dropdown-container.theme.scss +1 -1
  46. package/src/lib/modules/sidenav/_sidenav.theme.scss +1 -1
  47. package/src/lib/styles/_table.scss +1 -1
@@ -101,7 +101,7 @@ export declare class NaturalAbstractList<TService extends NaturalAbstractModelSe
101
101
  /**
102
102
  * Persist search and then launch whatever is required to refresh the list
103
103
  */
104
- search(naturalSearchSelections: NaturalSearchSelections, navigationExtras?: NavigationExtras): void;
104
+ search(naturalSearchSelections: NaturalSearchSelections, navigationExtras?: NavigationExtras, resetPagination?: boolean): void;
105
105
  /**
106
106
  * Change sorting variables for query and persist the new value in url and local storage
107
107
  * The default value is not persisted
@@ -1,5 +1,5 @@
1
1
  import { Injector, OnDestroy, OnInit } from '@angular/core';
2
- import { RouterLink } from '@angular/router';
2
+ import { NavigationExtras, RouterLink } from '@angular/router';
3
3
  import { NaturalSearchSelections } from '../modules/search/types/values';
4
4
  import { NaturalAbstractModelService } from '../services/abstract-model.service';
5
5
  import { NaturalAbstractList } from './abstract-list';
@@ -28,12 +28,14 @@ export declare class NaturalAbstractNavigableList<TService extends NaturalAbstra
28
28
  * Name of filter for child items to access ancestor item
29
29
  */
30
30
  ancestorRelationName: string;
31
+ private oldAncertorId;
31
32
  breadcrumbs: BreadcrumbItem[];
32
33
  constructor(service: TService, injector: Injector);
33
34
  ngOnInit(): void;
34
35
  protected getDataObservable(): Observable<PaginatedData<NavigableItem<ExtractTallOne<TService>>>>;
35
36
  protected translateSearchAndRefreshList(naturalSearchSelections: NaturalSearchSelections): void;
36
- clearSearch(): void;
37
+ clearSearch(resetPagination?: boolean): void;
38
+ search(naturalSearchSelections: NaturalSearchSelections, navigationExtras?: NavigationExtras, resetPagination?: boolean): void;
37
39
  /**
38
40
  * Return an array for router link usage
39
41
  */
@@ -1,8 +1,17 @@
1
1
  import { Literal } from '../types/types';
2
2
  /**
3
3
  * Very basic formatting to get only date, without time and ignoring entirely the timezone
4
+ *
5
+ * So something like: "2021-09-23"
4
6
  */
5
7
  export declare function formatIsoDate(date: Date | null): string | null;
8
+ /**
9
+ * Format a date and time in a way that will preserve the local time zone.
10
+ * This allow the server side to know the day (without time) that was selected on client side.
11
+ *
12
+ * So something like: "2021-09-23T17:57:16+09:00"
13
+ */
14
+ export declare function formatIsoDateTime(date: Date): string;
6
15
  /**
7
16
  * Relations to full objects are converted to their IDs only.
8
17
  *
@@ -2,17 +2,17 @@ import { ComponentType } from '@angular/cdk/portal';
2
2
  import { OnDestroy } from '@angular/core';
3
3
  import { MatDialog, MatDialogConfig } from '@angular/material/dialog';
4
4
  import { ActivatedRoute, Router, RouterLink } from '@angular/router';
5
- import { Literal } from '../../types/types';
6
- export interface NaturalDialogTriggerRoutingData {
7
- component: ComponentType<any>;
5
+ export interface NaturalDialogTriggerRoutingData<T, D> {
6
+ component: ComponentType<T>;
8
7
  afterClosedRoute?: RouterLink['routerLink'];
9
- dialogConfig: MatDialogConfig<Literal>;
8
+ dialogConfig: MatDialogConfig<D>;
10
9
  }
11
- export declare type NaturalDialogTriggerProvidedData = Literal & {
10
+ export declare type NaturalDialogTriggerProvidedData<D> = {
11
+ data?: Readonly<D> | null;
12
12
  activatedRoute: ActivatedRoute;
13
13
  };
14
14
  export declare type NaturalDialogTriggerRedirectionValues = RouterLink['routerLink'] | null | undefined | '' | -1;
15
- export declare class NaturalDialogTriggerComponent implements OnDestroy {
15
+ export declare class NaturalDialogTriggerComponent<T, D> implements OnDestroy {
16
16
  private readonly dialog;
17
17
  private readonly route;
18
18
  private readonly router;
@@ -3,7 +3,6 @@ import { ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';
3
3
  import { BasePortalOutlet, CdkPortalOutlet, ComponentPortal, TemplatePortal } from '@angular/cdk/portal';
4
4
  import { ComponentRef, ElementRef, EmbeddedViewRef, InjectionToken, OnDestroy, TemplateRef } from '@angular/core';
5
5
  import { Subject } from 'rxjs';
6
- import { DropdownResult } from '../types/values';
7
6
  export declare function throwMatDialogContentAlreadyAttachedError(): void;
8
7
  export interface NaturalDropdownContainerData {
9
8
  showValidateButton: boolean;
@@ -15,7 +14,7 @@ export declare class NaturalDropdownContainerComponent extends BasePortalOutlet
15
14
  data: NaturalDropdownContainerData;
16
15
  portalOutlet: CdkPortalOutlet;
17
16
  templateRef: TemplateRef<any>;
18
- readonly closed: Subject<DropdownResult>;
17
+ readonly closed: Subject<void>;
19
18
  /** Current state of the panel animation. */
20
19
  panelAnimationState: 'void' | 'enter';
21
20
  /** Emits whenever an animation on the menu completes. */
@@ -1,4 +1,5 @@
1
1
  import { ElementRef, OnDestroy, OnInit } from '@angular/core';
2
+ import { MatDrawer } from '@angular/material/sidenav';
2
3
  import { NaturalSidenavService } from '../sidenav.service';
3
4
  export declare class NaturalSidenavContainerComponent implements OnInit, OnDestroy {
4
5
  readonly sidenavService: NaturalSidenavService;
@@ -7,6 +8,10 @@ export declare class NaturalSidenavContainerComponent implements OnInit, OnDestr
7
8
  * Unique identifier used for the local storage
8
9
  */
9
10
  name: string;
11
+ /**
12
+ * The side that the drawer is attached to
13
+ */
14
+ position: MatDrawer['position'];
10
15
  /**
11
16
  * If true listens to route changes to close side nav after a route change if mobile view is active
12
17
  * Actually a navigation to current route does not emit a route change, and the sidenav don't close.
package/package.json CHANGED
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "@ecodev/natural",
3
- "version": "36.1.5",
3
+ "version": "38.0.1",
4
4
  "license": "MIT",
5
5
  "repository": "github:Ecodev/natural",
6
6
  "sideEffects": false,
7
7
  "dependencies": {
8
- "ts-md5": "^1.2.8",
9
- "tslib": "^2.2.0"
8
+ "ts-md5": "^1.2.9",
9
+ "tslib": "^2.3.1"
10
10
  },
11
11
  "peerDependencies": {
12
12
  "@angular/common": "^12.0.1",
13
13
  "@angular/core": "^12.0.1",
14
14
  "@angular/localize": "^12.0.1",
15
15
  "@angular/material": "^12.0.1",
16
- "apollo-angular": "^2.5.0",
16
+ "apollo-angular": "^2.6.0",
17
17
  "lodash-es": "^4.17.21",
18
- "rxjs": "^6.5.4"
18
+ "rxjs": "^7.4.0"
19
19
  },
20
20
  "main": "bundles/ecodev-natural.umd.js",
21
21
  "module": "fesm2015/ecodev-natural.js",
@@ -1,4 +1,4 @@
1
- @use "sass:map";
1
+ @use 'sass:map';
2
2
  @use '~@angular/material' as mat;
3
3
  @mixin natural-alert($theme) {
4
4
  $primary: map.get($theme, primary);
@@ -1,4 +1,4 @@
1
- @use "sass:map";
1
+ @use 'sass:map';
2
2
  @use '~@angular/material' as mat;
3
3
  @mixin natural-file($theme) {
4
4
  $primary: map.get($theme, primary);
@@ -1,4 +1,4 @@
1
- @use "sass:map";
1
+ @use 'sass:map';
2
2
  @use '~@angular/material' as mat;
3
3
  @mixin natural-icon($theme) {
4
4
  $primary: map.get($theme, primary);
@@ -1,4 +1,4 @@
1
- @use "sass:map";
1
+ @use 'sass:map';
2
2
  @use '~@angular/material' as mat;
3
3
  @mixin natural-dropdown-container($theme) {
4
4
  $background: map.get($theme, background);
@@ -1,4 +1,4 @@
1
- @use "sass:map";
1
+ @use 'sass:map';
2
2
  @mixin natural-sidenav($theme) {
3
3
  $primary: map.get($theme, primary);
4
4
  $accent: map.get($theme, accent);
@@ -1,4 +1,4 @@
1
- @use "sass:map";
1
+ @use 'sass:map';
2
2
  @use '~@angular/material' as mat;
3
3
  @mixin natural-table($theme) {
4
4
  $primary: map.get($theme, primary);