@hug/ngx-search-container 1.1.10 → 2.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.
package/CHANGELOG.md CHANGED
@@ -1,132 +1,162 @@
1
- ## 1.1.10 (2024-07-25)
1
+ # 2.0.0 (2024-09-11)
2
2
 
3
3
 
4
- ### 🐛 Fixes
4
+ ### 🚀 Features
5
5
 
6
- - **ngx-search-container:** update patch version ([43b005b](https://github.com/DSI-HUG/ngx-components/commit/43b005b))
6
+ - update to angular 15 - FC-67 ([6bad712](https://github.com/DSI-HUG/ngx-components/commit/6bad712))
7
7
 
8
+ - update material to angular 15 - FC-67 ([44406c1](https://github.com/DSI-HUG/ngx-components/commit/44406c1))
8
9
 
9
- ### 🌱 Dependencies
10
+ - datepicker angular15 ([fc101f9](https://github.com/DSI-HUG/ngx-components/commit/fc101f9))
10
11
 
11
- - **@hug/ngx-core:** upgrade to v1.1.14 ([12ee5d4](https://github.com/DSI-HUG/ngx-components/commit/12ee5d4))
12
+ - apply angular material 18 ([f65d64c](https://github.com/DSI-HUG/ngx-components/commit/f65d64c))
12
13
 
14
+ - remove NgxDetroy ([c64d8bb](https://github.com/DSI-HUG/ngx-components/commit/c64d8bb))
13
15
 
14
- ### ❤️ Thank You
16
+ - prettier ([2aa36f0](https://github.com/DSI-HUG/ngx-components/commit/2aa36f0))
15
17
 
16
- - dsi-hug-bot @dsi-hug-bot
17
- - Serge
18
+ - **ng18:** remove no more necessary files ([54c46a1](https://github.com/DSI-HUG/ngx-components/commit/54c46a1))
18
19
 
19
- ## 1.1.9 (2024-07-25)
20
+
21
+ ### 🐛 Fixes
22
+
23
+ - correctif passage compelt ng18 ([3fe864e](https://github.com/DSI-HUG/ngx-components/commit/3fe864e))
24
+
25
+ - **ci:** tests ([9387ba8](https://github.com/DSI-HUG/ngx-components/commit/9387ba8))
20
26
 
21
27
 
22
28
  ### 🌱 Dependencies
23
29
 
24
- - **@hug/ngx-core:** upgrade to v1.1.13 ([15e11d7](https://github.com/DSI-HUG/ngx-components/commit/15e11d7))
30
+ - **@hug/ngx-core:** upgrade to v2.0.0 ([ce6226c](https://github.com/DSI-HUG/ngx-components/commit/ce6226c))
25
31
 
26
32
 
27
33
  ### ❤️ Thank You
28
34
 
35
+ - Badisi
29
36
  - dsi-hug-bot @dsi-hug-bot
37
+ - rfrt
30
38
 
31
- ## 1.1.8 (2024-07-24)
32
-
39
+ ## 1.1.11 (2024-07-26)
33
40
 
34
41
  ### 🐛 Fixes
35
42
 
36
- - **ngx-search-container:** update patch version ([fe4999d](https://github.com/DSI-HUG/ngx-components/commit/fe4999d))
43
+ - error message ([e174fe9](https://github.com/DSI-HUG/ngx-components/commit/e174fe9))
44
+
45
+ - **ngx-search-container:** add NgTemplateOutlet import + add tooltip and style to icons ([46ae279](https://github.com/DSI-HUG/ngx-components/commit/46ae279))
46
+
47
+ ### ❤️ Thank You
37
48
 
49
+ - damien-guillermet
50
+ - Serge
51
+
52
+ ## 1.1.10 (2024-07-25)
53
+
54
+ ### 🐛 Fixes
55
+
56
+ - **ngx-search-container:** update patch version ([43b005b](https://github.com/DSI-HUG/ngx-components/commit/43b005b))
38
57
 
39
58
  ### 🌱 Dependencies
40
59
 
41
- - **@hug/ngx-core:** upgrade to v1.1.12 ([78a2936](https://github.com/DSI-HUG/ngx-components/commit/78a2936))
60
+ - **@hug/ngx-core:** upgrade to v1.1.14 ([12ee5d4](https://github.com/DSI-HUG/ngx-components/commit/12ee5d4))
42
61
 
62
+ ### ❤️ Thank You
43
63
 
44
- ### ❤️ Thank You
64
+ - dsi-hug-bot @dsi-hug-bot
65
+ - Serge
45
66
 
46
- - dsi-hug-bot @dsi-hug-bot
47
- - Serge
67
+ ## 1.1.9 (2024-07-25)
48
68
 
49
- ## 1.1.7 (2024-07-24)
69
+ ### 🌱 Dependencies
50
70
 
71
+ - **@hug/ngx-core:** upgrade to v1.1.13 ([15e11d7](https://github.com/DSI-HUG/ngx-components/commit/15e11d7))
72
+
73
+ ### ❤️ Thank You
74
+
75
+ - dsi-hug-bot @dsi-hug-bot
76
+
77
+ ## 1.1.8 (2024-07-24)
51
78
 
52
79
  ### 🐛 Fixes
53
80
 
54
- - **ngx-search-container:** remove module ([938de48](https://github.com/DSI-HUG/ngx-components/commit/938de48))
81
+ - **ngx-search-container:** update patch version ([fe4999d](https://github.com/DSI-HUG/ngx-components/commit/fe4999d))
55
82
 
83
+ ### 🌱 Dependencies
56
84
 
57
- ### ❤️ Thank You
85
+ - **@hug/ngx-core:** upgrade to v1.1.12 ([78a2936](https://github.com/DSI-HUG/ngx-components/commit/78a2936))
58
86
 
59
- - Serge
87
+ ### ❤️ Thank You
60
88
 
61
- ## 1.1.6 (2024-07-24)
89
+ - dsi-hug-bot @dsi-hug-bot
90
+ - Serge
62
91
 
92
+ ## 1.1.7 (2024-07-24)
63
93
 
64
94
  ### 🐛 Fixes
65
95
 
66
- - **ngx-search-container:** update patch version ([bfacbcb](https://github.com/DSI-HUG/ngx-components/commit/bfacbcb))
96
+ - **ngx-search-container:** remove module ([938de48](https://github.com/DSI-HUG/ngx-components/commit/938de48))
67
97
 
98
+ ### ❤️ Thank You
68
99
 
69
- ### 🌱 Dependencies
100
+ - Serge
70
101
 
71
- - **@hug/ngx-core:** upgrade to v1.1.11 ([bda1d8c](https://github.com/DSI-HUG/ngx-components/commit/bda1d8c))
102
+ ## 1.1.6 (2024-07-24)
72
103
 
104
+ ### 🐛 Fixes
73
105
 
74
- ### ❤️ Thank You
106
+ - **ngx-search-container:** update patch version ([bfacbcb](https://github.com/DSI-HUG/ngx-components/commit/bfacbcb))
75
107
 
76
- - dsi-hug-bot @dsi-hug-bot
77
- - Serge
108
+ ### 🌱 Dependencies
78
109
 
79
- ## 1.1.5 (2024-07-23)
110
+ - **@hug/ngx-core:** upgrade to v1.1.11 ([bda1d8c](https://github.com/DSI-HUG/ngx-components/commit/bda1d8c))
80
111
 
112
+ ### ❤️ Thank You
81
113
 
82
- ### 🐛 Fixes
114
+ - dsi-hug-bot @dsi-hug-bot
115
+ - Serge
83
116
 
84
- - **ngx-search-container:** compile path ([22cc8b6](https://github.com/DSI-HUG/ngx-components/commit/22cc8b6))
117
+ ## 1.1.5 (2024-07-23)
85
118
 
119
+ ### 🐛 Fixes
86
120
 
87
- ### 🌱 Dependencies
121
+ - **ngx-search-container:** compile path ([22cc8b6](https://github.com/DSI-HUG/ngx-components/commit/22cc8b6))
88
122
 
89
- - **@hug/ngx-core:** upgrade to v1.1.9 ([3692c68](https://github.com/DSI-HUG/ngx-components/commit/3692c68))
123
+ ### 🌱 Dependencies
90
124
 
91
- - **@hug/ngx-core:** upgrade to v1.1.10 ([78dbe21](https://github.com/DSI-HUG/ngx-components/commit/78dbe21))
125
+ - **@hug/ngx-core:** upgrade to v1.1.9 ([3692c68](https://github.com/DSI-HUG/ngx-components/commit/3692c68))
92
126
 
127
+ - **@hug/ngx-core:** upgrade to v1.1.10 ([78dbe21](https://github.com/DSI-HUG/ngx-components/commit/78dbe21))
93
128
 
94
- ### ❤️ Thank You
129
+ ### ❤️ Thank You
95
130
 
96
- - dsi-hug-bot @dsi-hug-bot
97
- - Serge
131
+ - dsi-hug-bot @dsi-hug-bot
132
+ - Serge
98
133
 
99
134
  ## 1.1.4 (2024-07-23)
100
135
 
101
-
102
136
  ### 🐛 Fixes
103
137
 
104
- - **ngx-snackbar:** use inject ([042cf24](https://github.com/DSI-HUG/ngx-components/commit/042cf24))
105
-
106
- - **ngx-search-container:** ngx prefix ([2ed4360](https://github.com/DSI-HUG/ngx-components/commit/2ed4360))
138
+ - **ngx-snackbar:** use inject ([042cf24](https://github.com/DSI-HUG/ngx-components/commit/042cf24))
107
139
 
140
+ - **ngx-search-container:** ngx prefix ([2ed4360](https://github.com/DSI-HUG/ngx-components/commit/2ed4360))
108
141
 
109
- ### ❤️ Thank You
142
+ ### ❤️ Thank You
110
143
 
111
- - Serge
144
+ - Serge
112
145
 
113
146
  ## 1.1.3 (2024-07-23)
114
147
 
115
-
116
148
  ### 🐛 Fixes
117
149
 
118
- - **ngx-search-container:** ngx prefix ([064666d](https://github.com/DSI-HUG/ngx-components/commit/064666d))
119
-
150
+ - **ngx-search-container:** ngx prefix ([064666d](https://github.com/DSI-HUG/ngx-components/commit/064666d))
120
151
 
121
152
  ### 🌱 Dependencies
122
153
 
123
- - **@hug/ngx-core:** upgrade to v1.1.8 ([26f0d10](https://github.com/DSI-HUG/ngx-components/commit/26f0d10))
154
+ - **@hug/ngx-core:** upgrade to v1.1.8 ([26f0d10](https://github.com/DSI-HUG/ngx-components/commit/26f0d10))
124
155
 
156
+ ### ❤️ Thank You
125
157
 
126
- ### ❤️ Thank You
127
-
128
- - dsi-hug-bot @dsi-hug-bot
129
- - Serge
158
+ - dsi-hug-bot @dsi-hug-bot
159
+ - Serge
130
160
 
131
161
  ## 1.1.2 (2024-07-05)
132
162
 
package/README.md CHANGED
@@ -1,4 +1,5 @@
1
- # @hug/search-container
1
+ @hug/search-container
2
+ =======
2
3
 
3
4
  The sources for this package are in the main [DSI-HUG/ngx-components](https://github.com/dsi-hug/ngx-components) repo. Please file issues and pull requests against that repo.
4
5
 
@@ -8,66 +8,66 @@
8
8
 
9
9
  ngx-search-container {
10
10
  .ngx-search-container {
11
- background-color: mat.get-color-from-palette($background, background, 0.2);
11
+ background-color: mat.m2-get-color-from-palette($background, background, 0.2);
12
12
 
13
13
  &:hover {
14
- background-color: mat.get-color-from-palette($background, background, 0.3);
14
+ background-color: mat.m2-get-color-from-palette($background, background, 0.3);
15
15
  }
16
16
 
17
17
  &:focus,
18
18
  &:focus-within {
19
- color: mat.get-color-from-palette($foreground, text, 0.8);
20
- background-color: mat.get-color-from-palette($background, background, 0.8);
19
+ color: mat.m2-get-color-from-palette($foreground, text, 0.8);
20
+ background-color: mat.m2-get-color-from-palette($background, background, 0.8);
21
21
 
22
22
  input {
23
- color: mat.get-color-from-palette($foreground, text, 0.6);
23
+ color: mat.m2-get-color-from-palette($foreground, text, 0.6);
24
24
 
25
25
  &::placeholder {
26
- color: mat.get-color-from-palette($foreground, text, 0.6);
26
+ color: mat.m2-get-color-from-palette($foreground, text, 0.6);
27
27
  }
28
28
  }
29
29
 
30
30
  .icon-clear {
31
31
  transition: 0.3s ease-in-out;
32
- color: mat.get-color-from-palette($foreground, disabled);
32
+ color: mat.m2-get-color-from-palette($foreground, disabled);
33
33
 
34
34
  &:hover {
35
- color: mat.get-color-from-palette($foreground, text);
35
+ color: mat.m2-get-color-from-palette($foreground, text);
36
36
  }
37
37
  }
38
38
  }
39
39
 
40
40
  .icon-clear {
41
41
  :hover {
42
- color: mat.get-color-from-palette($background, background);
42
+ color: mat.m2-get-color-from-palette($background, background);
43
43
  }
44
44
  }
45
45
 
46
46
  input {
47
- color: mat.get-color-from-palette($background, background, 0.8);
47
+ color: mat.m2-get-color-from-palette($background, background, 0.8);
48
48
 
49
49
  &::placeholder {
50
- color: mat.get-color-from-palette($background, background, 0.8);
50
+ color: mat.m2-get-color-from-palette($background, background, 0.8);
51
51
  }
52
52
  }
53
53
  }
54
54
 
55
55
  .ngx-search-container-mobile {
56
56
  &.active {
57
- background-color: mat.get-color-from-palette($background, background);
58
- color: mat.get-color-from-palette($foreground, text);
57
+ background-color: mat.m2-get-color-from-palette($background, background);
58
+ color: mat.m2-get-color-from-palette($foreground, text);
59
59
  }
60
60
 
61
61
  .ngx-search-container {
62
62
  &::placeholder {
63
- color: mat.get-color-from-palette($foreground, secondary-text);
63
+ color: mat.m2-get-color-from-palette($foreground, secondary-text);
64
64
  }
65
65
 
66
66
  input {
67
- color: mat.get-color-from-palette($foreground, text, 0.6);
67
+ color: mat.m2-get-color-from-palette($foreground, text, 0.6);
68
68
 
69
69
  &::placeholder {
70
- color: mat.get-color-from-palette($foreground, text, 0.6);
70
+ color: mat.m2-get-color-from-palette($foreground, text, 0.6);
71
71
  }
72
72
  }
73
73
  }
@@ -0,0 +1,100 @@
1
+ import { AsyncPipe, NgTemplateOutlet } from '@angular/common';
2
+ import { ChangeDetectionStrategy, Component, ContentChild, DestroyRef, Directive, ElementRef, EventEmitter, inject, Input, NgZone, Output, ViewEncapsulation } from '@angular/core';
3
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
4
+ import { NgControl } from '@angular/forms';
5
+ import { MatIcon } from '@angular/material/icon';
6
+ import { MatTooltip } from '@angular/material/tooltip';
7
+ import { NgxMediaService } from '@hug/ngx-core';
8
+ import { BehaviorSubject, distinctUntilChanged, first, shareReplay, switchMap, tap } from 'rxjs';
9
+ import * as i0 from "@angular/core";
10
+ export class NgxSearchInputDirective {
11
+ ngControl = inject(NgControl);
12
+ elementRef = inject(ElementRef);
13
+ constructor() {
14
+ this.focus();
15
+ }
16
+ focus() {
17
+ this.elementRef.nativeElement.focus();
18
+ }
19
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: NgxSearchInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
20
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.3", type: NgxSearchInputDirective, isStandalone: true, selector: "[ngx-search-input]", ngImport: i0 });
21
+ }
22
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: NgxSearchInputDirective, decorators: [{
23
+ type: Directive,
24
+ args: [{
25
+ selector: '[ngx-search-input]',
26
+ standalone: true
27
+ }]
28
+ }], ctorParameters: () => [] });
29
+ export class NgxSearchContainerComponent {
30
+ cleared = new EventEmitter();
31
+ clearTooltip = 'Effacer la recherche';
32
+ openSearchTooltip = 'Ouvrir la recherche';
33
+ closeSearchTooltip = 'Quitter la recherche';
34
+ mobileSearch;
35
+ activeSearch$ = new BehaviorSubject(false);
36
+ searchInputValue$;
37
+ set searchInput(searchInput) {
38
+ if (!searchInput) {
39
+ throw new Error('You need to add the attribute ngx-search-input to the NgxSearchContainerComponent');
40
+ }
41
+ if (!searchInput.ngControl) {
42
+ throw new Error('You need to add the attribute ngModel to the NgxSearchContainerComponent');
43
+ }
44
+ this._searchInput = searchInput;
45
+ }
46
+ set right(value) {
47
+ this._right = value;
48
+ }
49
+ get right() {
50
+ return this._right;
51
+ }
52
+ mediaService = inject(NgxMediaService);
53
+ zone = inject(NgZone);
54
+ destroyRef = inject(DestroyRef);
55
+ _searchInput;
56
+ _right = null;
57
+ constructor() {
58
+ this.activeSearch$.pipe(switchMap(activeSearch => this.zone.onStable.pipe(first(), tap(() => {
59
+ if (!activeSearch) {
60
+ this.reset();
61
+ }
62
+ this._searchInput?.focus();
63
+ }))), takeUntilDestroyed(this.destroyRef)).subscribe();
64
+ }
65
+ ngAfterContentInit() {
66
+ this.searchInputValue$ = this._searchInput?.ngControl?.valueChanges?.pipe(distinctUntilChanged(), shareReplay({ bufferSize: 1, refCount: false })) ?? undefined;
67
+ }
68
+ reset() {
69
+ this._searchInput?.ngControl?.reset();
70
+ this.cleared.emit();
71
+ }
72
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: NgxSearchContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
73
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.3", type: NgxSearchContainerComponent, isStandalone: true, selector: "ngx-search-container", inputs: { clearTooltip: "clearTooltip", openSearchTooltip: "openSearchTooltip", closeSearchTooltip: "closeSearchTooltip", right: "right" }, outputs: { cleared: "cleared" }, queries: [{ propertyName: "mobileSearch", first: true, predicate: ["mobileSearch"], descendants: true }, { propertyName: "searchInput", first: true, predicate: NgxSearchInputDirective, descendants: true }], ngImport: i0, template: "@if (mediaService.isHandset$ | async) {\n <div class=\"ngx-search-container-mobile mobile\" [class.active]=\"activeSearch$ | async\" #mobileSearch>\n @if (activeSearch$ | async) {\n <mat-icon class=\"icon-close-search\" [matTooltip]=\"closeSearchTooltip\" (click)=\"activeSearch$.next(false)\">\n arrow_back\n </mat-icon>\n <ng-container *ngTemplateOutlet=\"searchContainerTpl\"></ng-container>\n } @else {\n <mat-icon class=\"icon-open-search\" [matTooltip]=\"openSearchTooltip\" (click)=\"activeSearch$.next(true)\">\n search\n </mat-icon>\n }\n </div>\n} @else {\n <ng-container *ngTemplateOutlet=\"searchContainerTpl\"></ng-container>\n}\n\n<ng-template #searchContainerTpl>\n <div class=\"ngx-search-container\">\n <mat-icon>search</mat-icon>\n <ng-content></ng-content>\n @if (searchInputValue$ | async) {\n <mat-icon class=\"icon-clear\" [matTooltip]=\"clearTooltip\" (click)=\"reset()\">close</mat-icon>\n }\n <ng-container *ngTemplateOutlet=\"right\"></ng-container>\n </div>\n</ng-template>\n", styles: ["ngx-search-container{flex:1 1 auto;display:flex;padding-left:.5rem}ngx-search-container .ngx-search-container{width:100%;transition:.3s ease-in-out;border-radius:4px;height:40px;display:flex}ngx-search-container .ngx-search-container.mobile{justify-self:flex-end}ngx-search-container .ngx-search-container:not(.mobile){min-width:35vw;max-width:800px}ngx-search-container .ngx-search-container .mat-icon{padding:.5rem}ngx-search-container .ngx-search-container .icon-clear{cursor:pointer}ngx-search-container .ngx-search-container input{width:100%;background:none;border:none;outline:none;font-size:1.2rem}ngx-search-container .ngx-search-container input:focus{outline:none}ngx-search-container .ngx-search-container-mobile{width:100%;display:flex;justify-content:flex-end;height:40px}ngx-search-container .ngx-search-container-mobile.active{display:flex;align-items:center;position:absolute;top:0;left:0;width:100vw;height:56px;z-index:10}ngx-search-container .ngx-search-container-mobile .mat-icon{padding:.5rem}ngx-search-container .ngx-search-container-mobile .icon-close-search,ngx-search-container .ngx-search-container-mobile .icon-open-search{cursor:pointer}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
74
+ }
75
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: NgxSearchContainerComponent, decorators: [{
76
+ type: Component,
77
+ args: [{ selector: 'ngx-search-container', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
78
+ AsyncPipe,
79
+ NgTemplateOutlet,
80
+ MatIcon,
81
+ MatTooltip
82
+ ], template: "@if (mediaService.isHandset$ | async) {\n <div class=\"ngx-search-container-mobile mobile\" [class.active]=\"activeSearch$ | async\" #mobileSearch>\n @if (activeSearch$ | async) {\n <mat-icon class=\"icon-close-search\" [matTooltip]=\"closeSearchTooltip\" (click)=\"activeSearch$.next(false)\">\n arrow_back\n </mat-icon>\n <ng-container *ngTemplateOutlet=\"searchContainerTpl\"></ng-container>\n } @else {\n <mat-icon class=\"icon-open-search\" [matTooltip]=\"openSearchTooltip\" (click)=\"activeSearch$.next(true)\">\n search\n </mat-icon>\n }\n </div>\n} @else {\n <ng-container *ngTemplateOutlet=\"searchContainerTpl\"></ng-container>\n}\n\n<ng-template #searchContainerTpl>\n <div class=\"ngx-search-container\">\n <mat-icon>search</mat-icon>\n <ng-content></ng-content>\n @if (searchInputValue$ | async) {\n <mat-icon class=\"icon-clear\" [matTooltip]=\"clearTooltip\" (click)=\"reset()\">close</mat-icon>\n }\n <ng-container *ngTemplateOutlet=\"right\"></ng-container>\n </div>\n</ng-template>\n", styles: ["ngx-search-container{flex:1 1 auto;display:flex;padding-left:.5rem}ngx-search-container .ngx-search-container{width:100%;transition:.3s ease-in-out;border-radius:4px;height:40px;display:flex}ngx-search-container .ngx-search-container.mobile{justify-self:flex-end}ngx-search-container .ngx-search-container:not(.mobile){min-width:35vw;max-width:800px}ngx-search-container .ngx-search-container .mat-icon{padding:.5rem}ngx-search-container .ngx-search-container .icon-clear{cursor:pointer}ngx-search-container .ngx-search-container input{width:100%;background:none;border:none;outline:none;font-size:1.2rem}ngx-search-container .ngx-search-container input:focus{outline:none}ngx-search-container .ngx-search-container-mobile{width:100%;display:flex;justify-content:flex-end;height:40px}ngx-search-container .ngx-search-container-mobile.active{display:flex;align-items:center;position:absolute;top:0;left:0;width:100vw;height:56px;z-index:10}ngx-search-container .ngx-search-container-mobile .mat-icon{padding:.5rem}ngx-search-container .ngx-search-container-mobile .icon-close-search,ngx-search-container .ngx-search-container-mobile .icon-open-search{cursor:pointer}\n"] }]
83
+ }], ctorParameters: () => [], propDecorators: { cleared: [{
84
+ type: Output
85
+ }], clearTooltip: [{
86
+ type: Input
87
+ }], openSearchTooltip: [{
88
+ type: Input
89
+ }], closeSearchTooltip: [{
90
+ type: Input
91
+ }], mobileSearch: [{
92
+ type: ContentChild,
93
+ args: ['mobileSearch']
94
+ }], searchInput: [{
95
+ type: ContentChild,
96
+ args: [NgxSearchInputDirective]
97
+ }], right: [{
98
+ type: Input
99
+ }] } });
100
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VhcmNoLWNvbnRhaW5lci5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9wcm9qZWN0cy9zZWFyY2gtY29udGFpbmVyL3NyYy9zZWFyY2gtY29udGFpbmVyLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uL3Byb2plY3RzL3NlYXJjaC1jb250YWluZXIvc3JjL3NlYXJjaC1jb250YWluZXIuY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxnQkFBZ0IsRUF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lT3V0bGV0PVwic2VhcmNoQ29udGFpbmVyVHBsXCI+PC9uZy1jb250YWluZXI+XG59XG5cbjxuZy10ZW1wbGF0ZSAjc2VhcmNoQ29udGFpbmVyVHBsPlxuICAgIDxkaXYgY2xhc3M9XCJuZ3gtc2VhcmNoLWNvbnRhaW5lclwiPlxuICAgICAgICA8bWF0LWljb24+c2VhcmNoPC9tYXQtaWNvbj5cbiAgICAgICAgPG5nLWNvbnRlbnQ+PC9uZy1jb250ZW50PlxuICAgICAgICBAaWYgKHNlYXJjaElucHV0VmFsdWUkIHwgYXN5bmMpIHtcbiAgICAgICAgICAgIDxtYXQtaWNvbiBjbGFzcz1cImljb24tY2xlYXJcIiBbbWF0VG9vbHRpcF09XCJjbGVhclRvb2x0aXBcIiAoY2xpY2spPVwicmVzZXQoKVwiPmNsb3NlPC9tYXQtaWNvbj5cbiAgICAgICAgfVxuICAgICAgICA8bmctY29udGFpbmVyICpuZ1RlbXBsYXRlT3V0bGV0PVwicmlnaHRcIj48L25nLWNvbnRhaW5lcj5cbiAgICA8L2Rpdj5cbjwvbmctdGVtcGxhdGU+XG4iXX0=
@@ -0,0 +1,107 @@
1
+ import { AsyncPipe, NgTemplateOutlet } from '@angular/common';
2
+ import * as i0 from '@angular/core';
3
+ import { inject, ElementRef, Directive, EventEmitter, NgZone, DestroyRef, Component, ViewEncapsulation, ChangeDetectionStrategy, Output, Input, ContentChild } from '@angular/core';
4
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
+ import { NgControl } from '@angular/forms';
6
+ import { MatIcon } from '@angular/material/icon';
7
+ import { MatTooltip } from '@angular/material/tooltip';
8
+ import { NgxMediaService } from '@hug/ngx-core';
9
+ import { BehaviorSubject, switchMap, first, tap, distinctUntilChanged, shareReplay } from 'rxjs';
10
+
11
+ class NgxSearchInputDirective {
12
+ ngControl = inject(NgControl);
13
+ elementRef = inject(ElementRef);
14
+ constructor() {
15
+ this.focus();
16
+ }
17
+ focus() {
18
+ this.elementRef.nativeElement.focus();
19
+ }
20
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: NgxSearchInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
21
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.3", type: NgxSearchInputDirective, isStandalone: true, selector: "[ngx-search-input]", ngImport: i0 });
22
+ }
23
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: NgxSearchInputDirective, decorators: [{
24
+ type: Directive,
25
+ args: [{
26
+ selector: '[ngx-search-input]',
27
+ standalone: true
28
+ }]
29
+ }], ctorParameters: () => [] });
30
+ class NgxSearchContainerComponent {
31
+ cleared = new EventEmitter();
32
+ clearTooltip = 'Effacer la recherche';
33
+ openSearchTooltip = 'Ouvrir la recherche';
34
+ closeSearchTooltip = 'Quitter la recherche';
35
+ mobileSearch;
36
+ activeSearch$ = new BehaviorSubject(false);
37
+ searchInputValue$;
38
+ set searchInput(searchInput) {
39
+ if (!searchInput) {
40
+ throw new Error('You need to add the attribute ngx-search-input to the NgxSearchContainerComponent');
41
+ }
42
+ if (!searchInput.ngControl) {
43
+ throw new Error('You need to add the attribute ngModel to the NgxSearchContainerComponent');
44
+ }
45
+ this._searchInput = searchInput;
46
+ }
47
+ set right(value) {
48
+ this._right = value;
49
+ }
50
+ get right() {
51
+ return this._right;
52
+ }
53
+ mediaService = inject(NgxMediaService);
54
+ zone = inject(NgZone);
55
+ destroyRef = inject(DestroyRef);
56
+ _searchInput;
57
+ _right = null;
58
+ constructor() {
59
+ this.activeSearch$.pipe(switchMap(activeSearch => this.zone.onStable.pipe(first(), tap(() => {
60
+ if (!activeSearch) {
61
+ this.reset();
62
+ }
63
+ this._searchInput?.focus();
64
+ }))), takeUntilDestroyed(this.destroyRef)).subscribe();
65
+ }
66
+ ngAfterContentInit() {
67
+ this.searchInputValue$ = this._searchInput?.ngControl?.valueChanges?.pipe(distinctUntilChanged(), shareReplay({ bufferSize: 1, refCount: false })) ?? undefined;
68
+ }
69
+ reset() {
70
+ this._searchInput?.ngControl?.reset();
71
+ this.cleared.emit();
72
+ }
73
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: NgxSearchContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
74
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.3", type: NgxSearchContainerComponent, isStandalone: true, selector: "ngx-search-container", inputs: { clearTooltip: "clearTooltip", openSearchTooltip: "openSearchTooltip", closeSearchTooltip: "closeSearchTooltip", right: "right" }, outputs: { cleared: "cleared" }, queries: [{ propertyName: "mobileSearch", first: true, predicate: ["mobileSearch"], descendants: true }, { propertyName: "searchInput", first: true, predicate: NgxSearchInputDirective, descendants: true }], ngImport: i0, template: "@if (mediaService.isHandset$ | async) {\n <div class=\"ngx-search-container-mobile mobile\" [class.active]=\"activeSearch$ | async\" #mobileSearch>\n @if (activeSearch$ | async) {\n <mat-icon class=\"icon-close-search\" [matTooltip]=\"closeSearchTooltip\" (click)=\"activeSearch$.next(false)\">\n arrow_back\n </mat-icon>\n <ng-container *ngTemplateOutlet=\"searchContainerTpl\"></ng-container>\n } @else {\n <mat-icon class=\"icon-open-search\" [matTooltip]=\"openSearchTooltip\" (click)=\"activeSearch$.next(true)\">\n search\n </mat-icon>\n }\n </div>\n} @else {\n <ng-container *ngTemplateOutlet=\"searchContainerTpl\"></ng-container>\n}\n\n<ng-template #searchContainerTpl>\n <div class=\"ngx-search-container\">\n <mat-icon>search</mat-icon>\n <ng-content></ng-content>\n @if (searchInputValue$ | async) {\n <mat-icon class=\"icon-clear\" [matTooltip]=\"clearTooltip\" (click)=\"reset()\">close</mat-icon>\n }\n <ng-container *ngTemplateOutlet=\"right\"></ng-container>\n </div>\n</ng-template>\n", styles: ["ngx-search-container{flex:1 1 auto;display:flex;padding-left:.5rem}ngx-search-container .ngx-search-container{width:100%;transition:.3s ease-in-out;border-radius:4px;height:40px;display:flex}ngx-search-container .ngx-search-container.mobile{justify-self:flex-end}ngx-search-container .ngx-search-container:not(.mobile){min-width:35vw;max-width:800px}ngx-search-container .ngx-search-container .mat-icon{padding:.5rem}ngx-search-container .ngx-search-container .icon-clear{cursor:pointer}ngx-search-container .ngx-search-container input{width:100%;background:none;border:none;outline:none;font-size:1.2rem}ngx-search-container .ngx-search-container input:focus{outline:none}ngx-search-container .ngx-search-container-mobile{width:100%;display:flex;justify-content:flex-end;height:40px}ngx-search-container .ngx-search-container-mobile.active{display:flex;align-items:center;position:absolute;top:0;left:0;width:100vw;height:56px;z-index:10}ngx-search-container .ngx-search-container-mobile .mat-icon{padding:.5rem}ngx-search-container .ngx-search-container-mobile .icon-close-search,ngx-search-container .ngx-search-container-mobile .icon-open-search{cursor:pointer}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
75
+ }
76
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: NgxSearchContainerComponent, decorators: [{
77
+ type: Component,
78
+ args: [{ selector: 'ngx-search-container', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
79
+ AsyncPipe,
80
+ NgTemplateOutlet,
81
+ MatIcon,
82
+ MatTooltip
83
+ ], template: "@if (mediaService.isHandset$ | async) {\n <div class=\"ngx-search-container-mobile mobile\" [class.active]=\"activeSearch$ | async\" #mobileSearch>\n @if (activeSearch$ | async) {\n <mat-icon class=\"icon-close-search\" [matTooltip]=\"closeSearchTooltip\" (click)=\"activeSearch$.next(false)\">\n arrow_back\n </mat-icon>\n <ng-container *ngTemplateOutlet=\"searchContainerTpl\"></ng-container>\n } @else {\n <mat-icon class=\"icon-open-search\" [matTooltip]=\"openSearchTooltip\" (click)=\"activeSearch$.next(true)\">\n search\n </mat-icon>\n }\n </div>\n} @else {\n <ng-container *ngTemplateOutlet=\"searchContainerTpl\"></ng-container>\n}\n\n<ng-template #searchContainerTpl>\n <div class=\"ngx-search-container\">\n <mat-icon>search</mat-icon>\n <ng-content></ng-content>\n @if (searchInputValue$ | async) {\n <mat-icon class=\"icon-clear\" [matTooltip]=\"clearTooltip\" (click)=\"reset()\">close</mat-icon>\n }\n <ng-container *ngTemplateOutlet=\"right\"></ng-container>\n </div>\n</ng-template>\n", styles: ["ngx-search-container{flex:1 1 auto;display:flex;padding-left:.5rem}ngx-search-container .ngx-search-container{width:100%;transition:.3s ease-in-out;border-radius:4px;height:40px;display:flex}ngx-search-container .ngx-search-container.mobile{justify-self:flex-end}ngx-search-container .ngx-search-container:not(.mobile){min-width:35vw;max-width:800px}ngx-search-container .ngx-search-container .mat-icon{padding:.5rem}ngx-search-container .ngx-search-container .icon-clear{cursor:pointer}ngx-search-container .ngx-search-container input{width:100%;background:none;border:none;outline:none;font-size:1.2rem}ngx-search-container .ngx-search-container input:focus{outline:none}ngx-search-container .ngx-search-container-mobile{width:100%;display:flex;justify-content:flex-end;height:40px}ngx-search-container .ngx-search-container-mobile.active{display:flex;align-items:center;position:absolute;top:0;left:0;width:100vw;height:56px;z-index:10}ngx-search-container .ngx-search-container-mobile .mat-icon{padding:.5rem}ngx-search-container .ngx-search-container-mobile .icon-close-search,ngx-search-container .ngx-search-container-mobile .icon-open-search{cursor:pointer}\n"] }]
84
+ }], ctorParameters: () => [], propDecorators: { cleared: [{
85
+ type: Output
86
+ }], clearTooltip: [{
87
+ type: Input
88
+ }], openSearchTooltip: [{
89
+ type: Input
90
+ }], closeSearchTooltip: [{
91
+ type: Input
92
+ }], mobileSearch: [{
93
+ type: ContentChild,
94
+ args: ['mobileSearch']
95
+ }], searchInput: [{
96
+ type: ContentChild,
97
+ args: [NgxSearchInputDirective]
98
+ }], right: [{
99
+ type: Input
100
+ }] } });
101
+
102
+ /**
103
+ * Generated bundle index. Do not edit.
104
+ */
105
+
106
+ export { NgxSearchContainerComponent, NgxSearchInputDirective };
107
+ //# sourceMappingURL=hug-ngx-search-container.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hug-ngx-search-container.mjs","sources":["../../../projects/search-container/src/search-container.component.ts","../../../projects/search-container/src/search-container.component.html","../../../projects/search-container/src/hug-ngx-search-container.ts"],"sourcesContent":["import { AsyncPipe, NgTemplateOutlet } from '@angular/common';\nimport { AfterContentInit, ChangeDetectionStrategy, Component, ContentChild, DestroyRef, Directive, ElementRef, EventEmitter, inject, Input, NgZone, Output, TemplateRef, ViewEncapsulation } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { NgControl } from '@angular/forms';\nimport { MatIcon } from '@angular/material/icon';\nimport { MatTooltip } from '@angular/material/tooltip';\nimport { NgxMediaService } from '@hug/ngx-core';\nimport { BehaviorSubject, distinctUntilChanged, first, Observable, shareReplay, switchMap, tap } from 'rxjs';\n\n@Directive({\n selector: '[ngx-search-input]',\n standalone: true\n})\nexport class NgxSearchInputDirective {\n public ngControl = inject(NgControl);\n\n protected elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n public constructor() {\n this.focus();\n }\n\n public focus(): void {\n this.elementRef.nativeElement.focus();\n }\n}\n\n@Component({\n selector: 'ngx-search-container',\n templateUrl: './search-container.component.html',\n styleUrls: ['./search-container.component.scss'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [\n AsyncPipe,\n NgTemplateOutlet,\n MatIcon,\n MatTooltip\n ]\n})\nexport class NgxSearchContainerComponent implements AfterContentInit {\n\n @Output()\n public readonly cleared = new EventEmitter<void>();\n\n @Input()\n public clearTooltip = 'Effacer la recherche';\n\n @Input()\n public openSearchTooltip = 'Ouvrir la recherche';\n\n @Input()\n public closeSearchTooltip = 'Quitter la recherche';\n\n @ContentChild('mobileSearch')\n public mobileSearch: TemplateRef<unknown> | undefined;\n\n protected readonly activeSearch$ = new BehaviorSubject(false);\n\n protected searchInputValue$: Observable<string> | undefined;\n\n\n @ContentChild(NgxSearchInputDirective)\n public set searchInput(searchInput: NgxSearchInputDirective) {\n if (!searchInput) {\n throw new Error('You need to add the attribute ngx-search-input to the NgxSearchContainerComponent');\n }\n if (!searchInput.ngControl) {\n throw new Error('You need to add the attribute ngModel to the NgxSearchContainerComponent');\n }\n this._searchInput = searchInput;\n }\n\n\n @Input()\n public set right(value: TemplateRef<unknown> | null) {\n this._right = value;\n }\n\n public get right(): TemplateRef<unknown> | null {\n return this._right;\n }\n\n protected mediaService = inject(NgxMediaService);\n private zone = inject(NgZone);\n private destroyRef = inject(DestroyRef);\n\n private _searchInput: NgxSearchInputDirective | undefined;\n\n private _right: TemplateRef<unknown> | null = null;\n\n\n public constructor() {\n\n this.activeSearch$.pipe(\n switchMap(activeSearch => this.zone.onStable.pipe(\n first(),\n tap(() => {\n if (!activeSearch) {\n this.reset();\n }\n this._searchInput?.focus();\n })\n )),\n takeUntilDestroyed(this.destroyRef)\n ).subscribe();\n }\n\n public ngAfterContentInit(): void {\n this.searchInputValue$ = this._searchInput?.ngControl?.valueChanges?.pipe(\n distinctUntilChanged(),\n shareReplay({ bufferSize: 1, refCount: false })\n ) ?? undefined;\n }\n\n public reset(): void {\n this._searchInput?.ngControl?.reset();\n this.cleared.emit();\n }\n}\n","@if (mediaService.isHandset$ | async) {\n <div class=\"ngx-search-container-mobile mobile\" [class.active]=\"activeSearch$ | async\" #mobileSearch>\n @if (activeSearch$ | async) {\n <mat-icon class=\"icon-close-search\" [matTooltip]=\"closeSearchTooltip\" (click)=\"activeSearch$.next(false)\">\n arrow_back\n </mat-icon>\n <ng-container *ngTemplateOutlet=\"searchContainerTpl\"></ng-container>\n } @else {\n <mat-icon class=\"icon-open-search\" [matTooltip]=\"openSearchTooltip\" (click)=\"activeSearch$.next(true)\">\n search\n </mat-icon>\n }\n </div>\n} @else {\n <ng-container *ngTemplateOutlet=\"searchContainerTpl\"></ng-container>\n}\n\n<ng-template #searchContainerTpl>\n <div class=\"ngx-search-container\">\n <mat-icon>search</mat-icon>\n <ng-content></ng-content>\n @if (searchInputValue$ | async) {\n <mat-icon class=\"icon-clear\" [matTooltip]=\"clearTooltip\" (click)=\"reset()\">close</mat-icon>\n }\n <ng-container *ngTemplateOutlet=\"right\"></ng-container>\n </div>\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;MAaa,uBAAuB,CAAA;AACzB,IAAA,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AAE3B,IAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC,CAAC;AAEnE,IAAA,WAAA,GAAA;QACI,IAAI,CAAC,KAAK,EAAE,CAAC;KAChB;IAEM,KAAK,GAAA;AACR,QAAA,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;KACzC;uGAXQ,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;2FAAvB,uBAAuB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAvB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAJnC,SAAS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AAA,EAAA,CAAA,ipCAAA,CAAA,EAAA,CAAA;wDAKe,OAAO,EAAA,CAAA;sBADtB,MAAM;gBAIA,YAAY,EAAA,CAAA;sBADlB,KAAK;gBAIC,iBAAiB,EAAA,CAAA;sBADvB,KAAK;gBAIC,kBAAkB,EAAA,CAAA;sBADxB,KAAK;gBAIC,YAAY,EAAA,CAAA;sBADlB,YAAY;uBAAC,cAAc,CAAA;gBASjB,WAAW,EAAA,CAAA;sBADrB,YAAY;uBAAC,uBAAuB,CAAA;gBAa1B,KAAK,EAAA,CAAA;sBADf,KAAK;;;AE3EV;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,57 +1,51 @@
1
1
  {
2
- "name": "@hug/ngx-search-container",
3
- "version": "1.1.10",
4
- "description": "HUG Angular - search-container component",
5
- "homepage": "https://github.com/dsi-hug/ngx-components",
6
- "license": "GPL-3.0-only",
7
- "author": "HUG - Hôpitaux Universitaires Genève",
8
- "contributors": [
9
- "badisi (https://github.com/badisi)",
10
- "vapkse (https://github.com/vapkse)"
11
- ],
12
- "repository": {
13
- "type": "git",
14
- "url": "git+https://github.com/dsi-hug/ngx-components.git"
2
+ "name": "@hug/ngx-search-container",
3
+ "version": "2.0.0",
4
+ "description": "HUG Angular - search-container component",
5
+ "homepage": "https://github.com/dsi-hug/ngx-components",
6
+ "license": "GPL-3.0-only",
7
+ "author": "HUG - Hôpitaux Universitaires Genève",
8
+ "contributors": [
9
+ "badisi (https://github.com/badisi)",
10
+ "vapkse (https://github.com/vapkse)"
11
+ ],
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/dsi-hug/ngx-components.git"
15
+ },
16
+ "keywords": [
17
+ "angular",
18
+ "material",
19
+ "material design",
20
+ "components"
21
+ ],
22
+ "sideEffects": false,
23
+ "exports": {
24
+ ".": {
25
+ "sass": "./_search-container-theme.scss",
26
+ "types": "./index.d.ts",
27
+ "esm2022": "./esm2022/hug-ngx-search-container.mjs",
28
+ "esm": "./esm2022/hug-ngx-search-container.mjs",
29
+ "default": "./fesm2022/hug-ngx-search-container.mjs"
15
30
  },
16
- "keywords": [
17
- "angular",
18
- "material",
19
- "material design",
20
- "components"
21
- ],
22
- "sideEffects": false,
23
- "exports": {
24
- ".": {
25
- "sass": "./_search-container-theme.scss",
26
- "types": "./index.d.ts",
27
- "esm2020": "./esm2020/hug-ngx-search-container.mjs",
28
- "es2020": "./fesm2020/hug-ngx-search-container.mjs",
29
- "es2015": "./fesm2015/hug-ngx-search-container.mjs",
30
- "node": "./fesm2015/hug-ngx-search-container.mjs",
31
- "default": "./fesm2020/hug-ngx-search-container.mjs"
32
- },
33
- "./package.json": {
34
- "default": "./package.json"
35
- }
36
- },
37
- "peerDependencies": {
38
- "@angular/common": ">= 14",
39
- "@angular/core": ">= 14",
40
- "@angular/forms": ">= 14",
41
- "@angular/material": ">= 14",
42
- "rxjs": ">= 7.0.0",
43
- "@hug/ngx-core": "^1.1.14"
44
- },
45
- "dependencies": {
46
- "tslib": "^2.6.3"
47
- },
48
- "publishConfig": {
49
- "access": "public"
50
- },
51
- "module": "fesm2015/hug-ngx-search-container.mjs",
52
- "es2020": "fesm2020/hug-ngx-search-container.mjs",
53
- "esm2020": "esm2020/hug-ngx-search-container.mjs",
54
- "fesm2020": "fesm2020/hug-ngx-search-container.mjs",
55
- "fesm2015": "fesm2015/hug-ngx-search-container.mjs",
56
- "typings": "index.d.ts"
31
+ "./package.json": {
32
+ "default": "./package.json"
33
+ }
34
+ },
35
+ "peerDependencies": {
36
+ "@angular/common": ">=18 <19",
37
+ "@angular/core": ">=18 <19",
38
+ "@angular/forms": ">=18 <19",
39
+ "@angular/material": ">=18 <19",
40
+ "rxjs": ">= 7.4.0",
41
+ "@hug/ngx-core": "^2.0.0"
42
+ },
43
+ "dependencies": {
44
+ "tslib": "^2.7.0"
45
+ },
46
+ "publishConfig": {
47
+ "access": "public"
48
+ },
49
+ "module": "fesm2022/hug-ngx-search-container.mjs",
50
+ "typings": "index.d.ts"
57
51
  }
@@ -1,6 +1,6 @@
1
- import { AfterContentInit, ElementRef, EventEmitter, NgZone, TemplateRef } from '@angular/core';
1
+ import { AfterContentInit, ElementRef, EventEmitter, TemplateRef } from '@angular/core';
2
2
  import { NgControl } from '@angular/forms';
3
- import { NgxDestroy, NgxMediaService } from '@hug/ngx-core';
3
+ import { NgxMediaService } from '@hug/ngx-core';
4
4
  import { BehaviorSubject, Observable } from 'rxjs';
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class NgxSearchInputDirective {
@@ -9,24 +9,27 @@ export declare class NgxSearchInputDirective {
9
9
  constructor();
10
10
  focus(): void;
11
11
  static ɵfac: i0.ɵɵFactoryDeclaration<NgxSearchInputDirective, never>;
12
- static ɵdir: i0.ɵɵDirectiveDeclaration<NgxSearchInputDirective, "[ngx-search-input]", never, {}, {}, never, never, true>;
12
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NgxSearchInputDirective, "[ngx-search-input]", never, {}, {}, never, never, true, never>;
13
13
  }
14
- export declare class NgxSearchContainerComponent extends NgxDestroy implements AfterContentInit {
15
- protected mediaService: NgxMediaService;
16
- private zone;
14
+ export declare class NgxSearchContainerComponent implements AfterContentInit {
17
15
  readonly cleared: EventEmitter<void>;
18
16
  clearTooltip: string;
17
+ openSearchTooltip: string;
18
+ closeSearchTooltip: string;
19
19
  mobileSearch: TemplateRef<unknown> | undefined;
20
20
  protected readonly activeSearch$: BehaviorSubject<boolean>;
21
21
  protected searchInputValue$: Observable<string> | undefined;
22
- private _searchInput;
23
22
  set searchInput(searchInput: NgxSearchInputDirective);
24
- private _right;
25
23
  set right(value: TemplateRef<unknown> | null);
26
24
  get right(): TemplateRef<unknown> | null;
27
- constructor(mediaService: NgxMediaService, zone: NgZone);
25
+ protected mediaService: NgxMediaService;
26
+ private zone;
27
+ private destroyRef;
28
+ private _searchInput;
29
+ private _right;
30
+ constructor();
28
31
  ngAfterContentInit(): void;
29
32
  reset(): void;
30
33
  static ɵfac: i0.ɵɵFactoryDeclaration<NgxSearchContainerComponent, never>;
31
- static ɵcmp: i0.ɵɵComponentDeclaration<NgxSearchContainerComponent, "ngx-search-container", never, { "clearTooltip": "clearTooltip"; "right": "right"; }, { "cleared": "cleared"; }, ["mobileSearch", "searchInput"], ["*"], true>;
34
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgxSearchContainerComponent, "ngx-search-container", never, { "clearTooltip": { "alias": "clearTooltip"; "required": false; }; "openSearchTooltip": { "alias": "openSearchTooltip"; "required": false; }; "closeSearchTooltip": { "alias": "closeSearchTooltip"; "required": false; }; "right": { "alias": "right"; "required": false; }; }, { "cleared": "cleared"; }, ["mobileSearch", "searchInput"], ["*"], true, never>;
32
35
  }
@@ -1,93 +0,0 @@
1
- import { AsyncPipe, NgIf } from '@angular/common';
2
- import { ChangeDetectionStrategy, Component, ContentChild, Directive, ElementRef, EventEmitter, inject, Input, Output, ViewEncapsulation } from '@angular/core';
3
- import { NgControl } from '@angular/forms';
4
- import { MatIconModule } from '@angular/material/icon';
5
- import { MatTooltipModule } from '@angular/material/tooltip';
6
- import { NgxDestroy } from '@hug/ngx-core';
7
- import { BehaviorSubject, distinctUntilChanged, first, shareReplay, switchMap, takeUntil, tap } from 'rxjs';
8
- import * as i0 from "@angular/core";
9
- import * as i1 from "@hug/ngx-core";
10
- import * as i2 from "@angular/material/icon";
11
- import * as i3 from "@angular/material/tooltip";
12
- export class NgxSearchInputDirective {
13
- constructor() {
14
- this.ngControl = inject(NgControl);
15
- this.elementRef = inject(ElementRef);
16
- this.focus();
17
- }
18
- focus() {
19
- this.elementRef.nativeElement.focus();
20
- }
21
- }
22
- NgxSearchInputDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgxSearchInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
23
- NgxSearchInputDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: NgxSearchInputDirective, isStandalone: true, selector: "[ngx-search-input]", ngImport: i0 });
24
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgxSearchInputDirective, decorators: [{
25
- type: Directive,
26
- args: [{
27
- selector: '[ngx-search-input]',
28
- standalone: true
29
- }]
30
- }], ctorParameters: function () { return []; } });
31
- export class NgxSearchContainerComponent extends NgxDestroy {
32
- constructor(mediaService, zone) {
33
- super();
34
- this.mediaService = mediaService;
35
- this.zone = zone;
36
- this.cleared = new EventEmitter();
37
- this.clearTooltip = 'Effacer la recherche';
38
- this.activeSearch$ = new BehaviorSubject(false);
39
- this._right = null;
40
- this.activeSearch$.pipe(switchMap(activeSearch => this.zone.onStable.pipe(first(), tap(() => {
41
- if (!activeSearch) {
42
- this.reset();
43
- }
44
- this._searchInput?.focus();
45
- }))), takeUntil(this.destroyed$)).subscribe();
46
- }
47
- set searchInput(searchInput) {
48
- if (!searchInput) {
49
- throw new Error('You need to add the attribute searchInput to the SearchContainerComponent');
50
- }
51
- if (!searchInput.ngControl) {
52
- throw new Error('You need to add the attribute ngModel to the SearchContainerComponent');
53
- }
54
- this._searchInput = searchInput;
55
- }
56
- set right(value) {
57
- this._right = value;
58
- }
59
- get right() {
60
- return this._right;
61
- }
62
- ngAfterContentInit() {
63
- this.searchInputValue$ = this._searchInput?.ngControl?.valueChanges?.pipe(distinctUntilChanged(), shareReplay({ bufferSize: 1, refCount: false })) ?? undefined;
64
- }
65
- reset() {
66
- this._searchInput?.ngControl?.reset();
67
- this.cleared.emit();
68
- }
69
- }
70
- NgxSearchContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgxSearchContainerComponent, deps: [{ token: i1.NgxMediaService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
71
- NgxSearchContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: NgxSearchContainerComponent, isStandalone: true, selector: "ngx-search-container", inputs: { clearTooltip: "clearTooltip", right: "right" }, outputs: { cleared: "cleared" }, queries: [{ propertyName: "mobileSearch", first: true, predicate: ["mobileSearch"], descendants: true }, { propertyName: "searchInput", first: true, predicate: NgxSearchInputDirective, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div *ngIf=\"mediaService.isHandset$ | async; else noHandsetTpl\" class=\"ngx-search-container-mobile mobile\" [class.active]=\"activeSearch$ | async\" #mobileSearch>\n <ng-container *ngIf=\"activeSearch$ | async; else noActiveSearchTpl\">\n <mat-icon (click)=\"activeSearch$.next(false)\">arrow_back</mat-icon>\n <ng-container *ngTemplateOutlet=\"searchContainerTpl\"></ng-container>\n </ng-container>\n <ng-template #noActiveSearchTpl>\n <mat-icon (click)=\"activeSearch$.next(true)\">search</mat-icon>\n </ng-template>\n</div>\n\n<ng-template #noHandsetTpl>\n <ng-container *ngTemplateOutlet=\"searchContainerTpl\"></ng-container>\n</ng-template>\n\n<ng-template #searchContainerTpl>\n <div class=\"ngx-search-container\">\n <mat-icon>search</mat-icon>\n <ng-content></ng-content>\n <mat-icon *ngIf=\"searchInputValue$ | async\" class=\"icon-clear\" [matTooltip]=\"clearTooltip\" (click)=\"reset()\">close</mat-icon>\n <ng-container *ngTemplateOutlet=\"right\"></ng-container>\n </div>\n</ng-template>\n", styles: ["ngx-search-container{flex:1 1 auto;display:flex;padding-left:.5rem}ngx-search-container .ngx-search-container{width:100%;transition:.3s ease-in-out;border-radius:4px;height:40px;display:flex}ngx-search-container .ngx-search-container.mobile{justify-self:flex-end}ngx-search-container .ngx-search-container:not(.mobile){min-width:35vw;max-width:800px}ngx-search-container .ngx-search-container .mat-icon{padding:.5rem}ngx-search-container .ngx-search-container .icon-clear{cursor:pointer}ngx-search-container .ngx-search-container input{width:100%;background:none;border:none;outline:none;font-size:1.2rem}ngx-search-container .ngx-search-container input:focus{outline:none}ngx-search-container .ngx-search-container-mobile{width:100%;display:flex;justify-content:flex-end;height:40px}ngx-search-container .ngx-search-container-mobile.active{display:flex;align-items:center;position:fixed;top:0;left:0;width:100vw;height:56px;z-index:10}ngx-search-container .ngx-search-container-mobile .mat-icon{padding:.5rem}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
72
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgxSearchContainerComponent, decorators: [{
73
- type: Component,
74
- args: [{ selector: 'ngx-search-container', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
75
- AsyncPipe,
76
- NgIf,
77
- MatIconModule,
78
- MatTooltipModule
79
- ], template: "<div *ngIf=\"mediaService.isHandset$ | async; else noHandsetTpl\" class=\"ngx-search-container-mobile mobile\" [class.active]=\"activeSearch$ | async\" #mobileSearch>\n <ng-container *ngIf=\"activeSearch$ | async; else noActiveSearchTpl\">\n <mat-icon (click)=\"activeSearch$.next(false)\">arrow_back</mat-icon>\n <ng-container *ngTemplateOutlet=\"searchContainerTpl\"></ng-container>\n </ng-container>\n <ng-template #noActiveSearchTpl>\n <mat-icon (click)=\"activeSearch$.next(true)\">search</mat-icon>\n </ng-template>\n</div>\n\n<ng-template #noHandsetTpl>\n <ng-container *ngTemplateOutlet=\"searchContainerTpl\"></ng-container>\n</ng-template>\n\n<ng-template #searchContainerTpl>\n <div class=\"ngx-search-container\">\n <mat-icon>search</mat-icon>\n <ng-content></ng-content>\n <mat-icon *ngIf=\"searchInputValue$ | async\" class=\"icon-clear\" [matTooltip]=\"clearTooltip\" (click)=\"reset()\">close</mat-icon>\n <ng-container *ngTemplateOutlet=\"right\"></ng-container>\n </div>\n</ng-template>\n", styles: ["ngx-search-container{flex:1 1 auto;display:flex;padding-left:.5rem}ngx-search-container .ngx-search-container{width:100%;transition:.3s ease-in-out;border-radius:4px;height:40px;display:flex}ngx-search-container .ngx-search-container.mobile{justify-self:flex-end}ngx-search-container .ngx-search-container:not(.mobile){min-width:35vw;max-width:800px}ngx-search-container .ngx-search-container .mat-icon{padding:.5rem}ngx-search-container .ngx-search-container .icon-clear{cursor:pointer}ngx-search-container .ngx-search-container input{width:100%;background:none;border:none;outline:none;font-size:1.2rem}ngx-search-container .ngx-search-container input:focus{outline:none}ngx-search-container .ngx-search-container-mobile{width:100%;display:flex;justify-content:flex-end;height:40px}ngx-search-container .ngx-search-container-mobile.active{display:flex;align-items:center;position:fixed;top:0;left:0;width:100vw;height:56px;z-index:10}ngx-search-container .ngx-search-container-mobile .mat-icon{padding:.5rem}\n"] }]
80
- }], ctorParameters: function () { return [{ type: i1.NgxMediaService }, { type: i0.NgZone }]; }, propDecorators: { cleared: [{
81
- type: Output
82
- }], clearTooltip: [{
83
- type: Input
84
- }], mobileSearch: [{
85
- type: ContentChild,
86
- args: ['mobileSearch']
87
- }], searchInput: [{
88
- type: ContentChild,
89
- args: [NgxSearchInputDirective]
90
- }], right: [{
91
- type: Input
92
- }] } });
93
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VhcmNoLWNvbnRhaW5lci5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9wcm9qZWN0cy9zZWFyY2gtY29udGFpbmVyL3NyYy9zZWFyY2gtY29udGFpbmVyLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uL3Byb2plY3RzL3NlYXJjaC1jb250YWluZXIvc3JjL3NlYXJjaC1jb250YWluZXIuY29tcG9uZW50L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FjazwvbWF0LWljb24+XG4gICAgICAgIDxuZy1jb250YWluZXIgKm5nVGVtcGxhdGVPdXRsZXQ9XCJzZWFyY2hDb250YWluZXJUcGxcIj48L25nLWNvbnRhaW5lcj5cbiAgICA8L25nLWNvbnRhaW5lcj5cbiAgICA8bmctdGVtcGxhdGUgI25vQWN0aXZlU2VhcmNoVHBsPlxuICAgICAgICA8bWF0LWljb24gKGNsaWNrKT1cImFjdGl2ZVNlYXJjaCQubmV4dCh0cnVlKVwiPnNlYXJjaDwvbWF0LWljb24+XG4gICAgPC9uZy10ZW1wbGF0ZT5cbjwvZGl2PlxuXG48bmctdGVtcGxhdGUgI25vSGFuZHNldFRwbD5cbiAgICA8bmctY29udGFpbmVyICpuZ1RlbXBsYXRlT3V0bGV0PVwic2VhcmNoQ29udGFpbmVyVHBsXCI+PC9uZy1jb250YWluZXI+XG48L25nLXRlbXBsYXRlPlxuXG48bmctdGVtcGxhdGUgI3NlYXJjaENvbnRhaW5lclRwbD5cbiAgICA8ZGl2IGNsYXNzPVwibmd4LXNlYXJjaC1jb250YWluZXJcIj5cbiAgICAgICAgPG1hdC1pY29uPnNlYXJjaDwvbWF0LWljb24+XG4gICAgICAgIDxuZy1jb250ZW50PjwvbmctY29udGVudD5cbiAgICAgICAgPG1hdC1pY29uICpuZ0lmPVwic2VhcmNoSW5wdXRWYWx1ZSQgfCBhc3luY1wiIGNsYXNzPVwiaWNvbi1jbGVhclwiIFttYXRUb29sdGlwXT1cImNsZWFyVG9vbHRpcFwiIChjbGljayk9XCJyZXNldCgpXCI+Y2xvc2U8L21hdC1pY29uPlxuICAgICAgICA8bmctY29udGFpbmVyICpuZ1RlbXBsYXRlT3V0bGV0PVwicmlnaHRcIj48L25nLWNvbnRhaW5lcj5cbiAgICA8L2Rpdj5cbjwvbmctdGVtcGxhdGU+XG4iXX0=
@@ -1,103 +0,0 @@
1
- import { AsyncPipe, NgIf } from '@angular/common';
2
- import * as i0 from '@angular/core';
3
- import { inject, ElementRef, Directive, EventEmitter, Component, ViewEncapsulation, ChangeDetectionStrategy, Output, Input, ContentChild } from '@angular/core';
4
- import { NgControl } from '@angular/forms';
5
- import * as i2 from '@angular/material/icon';
6
- import { MatIconModule } from '@angular/material/icon';
7
- import * as i3 from '@angular/material/tooltip';
8
- import { MatTooltipModule } from '@angular/material/tooltip';
9
- import * as i1 from '@hug/ngx-core';
10
- import { NgxDestroy } from '@hug/ngx-core';
11
- import { BehaviorSubject, switchMap, first, tap, takeUntil, distinctUntilChanged, shareReplay } from 'rxjs';
12
-
13
- class NgxSearchInputDirective {
14
- constructor() {
15
- this.ngControl = inject(NgControl);
16
- this.elementRef = inject(ElementRef);
17
- this.focus();
18
- }
19
- focus() {
20
- this.elementRef.nativeElement.focus();
21
- }
22
- }
23
- NgxSearchInputDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgxSearchInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
24
- NgxSearchInputDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: NgxSearchInputDirective, isStandalone: true, selector: "[ngx-search-input]", ngImport: i0 });
25
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgxSearchInputDirective, decorators: [{
26
- type: Directive,
27
- args: [{
28
- selector: '[ngx-search-input]',
29
- standalone: true
30
- }]
31
- }], ctorParameters: function () { return []; } });
32
- class NgxSearchContainerComponent extends NgxDestroy {
33
- constructor(mediaService, zone) {
34
- super();
35
- this.mediaService = mediaService;
36
- this.zone = zone;
37
- this.cleared = new EventEmitter();
38
- this.clearTooltip = 'Effacer la recherche';
39
- this.activeSearch$ = new BehaviorSubject(false);
40
- this._right = null;
41
- this.activeSearch$.pipe(switchMap(activeSearch => this.zone.onStable.pipe(first(), tap(() => {
42
- var _a;
43
- if (!activeSearch) {
44
- this.reset();
45
- }
46
- (_a = this._searchInput) === null || _a === void 0 ? void 0 : _a.focus();
47
- }))), takeUntil(this.destroyed$)).subscribe();
48
- }
49
- set searchInput(searchInput) {
50
- if (!searchInput) {
51
- throw new Error('You need to add the attribute searchInput to the SearchContainerComponent');
52
- }
53
- if (!searchInput.ngControl) {
54
- throw new Error('You need to add the attribute ngModel to the SearchContainerComponent');
55
- }
56
- this._searchInput = searchInput;
57
- }
58
- set right(value) {
59
- this._right = value;
60
- }
61
- get right() {
62
- return this._right;
63
- }
64
- ngAfterContentInit() {
65
- var _a, _b, _c, _d;
66
- this.searchInputValue$ = (_d = (_c = (_b = (_a = this._searchInput) === null || _a === void 0 ? void 0 : _a.ngControl) === null || _b === void 0 ? void 0 : _b.valueChanges) === null || _c === void 0 ? void 0 : _c.pipe(distinctUntilChanged(), shareReplay({ bufferSize: 1, refCount: false }))) !== null && _d !== void 0 ? _d : undefined;
67
- }
68
- reset() {
69
- var _a, _b;
70
- (_b = (_a = this._searchInput) === null || _a === void 0 ? void 0 : _a.ngControl) === null || _b === void 0 ? void 0 : _b.reset();
71
- this.cleared.emit();
72
- }
73
- }
74
- NgxSearchContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgxSearchContainerComponent, deps: [{ token: i1.NgxMediaService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
75
- NgxSearchContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: NgxSearchContainerComponent, isStandalone: true, selector: "ngx-search-container", inputs: { clearTooltip: "clearTooltip", right: "right" }, outputs: { cleared: "cleared" }, queries: [{ propertyName: "mobileSearch", first: true, predicate: ["mobileSearch"], descendants: true }, { propertyName: "searchInput", first: true, predicate: NgxSearchInputDirective, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div *ngIf=\"mediaService.isHandset$ | async; else noHandsetTpl\" class=\"ngx-search-container-mobile mobile\" [class.active]=\"activeSearch$ | async\" #mobileSearch>\n <ng-container *ngIf=\"activeSearch$ | async; else noActiveSearchTpl\">\n <mat-icon (click)=\"activeSearch$.next(false)\">arrow_back</mat-icon>\n <ng-container *ngTemplateOutlet=\"searchContainerTpl\"></ng-container>\n </ng-container>\n <ng-template #noActiveSearchTpl>\n <mat-icon (click)=\"activeSearch$.next(true)\">search</mat-icon>\n </ng-template>\n</div>\n\n<ng-template #noHandsetTpl>\n <ng-container *ngTemplateOutlet=\"searchContainerTpl\"></ng-container>\n</ng-template>\n\n<ng-template #searchContainerTpl>\n <div class=\"ngx-search-container\">\n <mat-icon>search</mat-icon>\n <ng-content></ng-content>\n <mat-icon *ngIf=\"searchInputValue$ | async\" class=\"icon-clear\" [matTooltip]=\"clearTooltip\" (click)=\"reset()\">close</mat-icon>\n <ng-container *ngTemplateOutlet=\"right\"></ng-container>\n </div>\n</ng-template>\n", styles: ["ngx-search-container{flex:1 1 auto;display:flex;padding-left:.5rem}ngx-search-container .ngx-search-container{width:100%;transition:.3s ease-in-out;border-radius:4px;height:40px;display:flex}ngx-search-container .ngx-search-container.mobile{justify-self:flex-end}ngx-search-container .ngx-search-container:not(.mobile){min-width:35vw;max-width:800px}ngx-search-container .ngx-search-container .mat-icon{padding:.5rem}ngx-search-container .ngx-search-container .icon-clear{cursor:pointer}ngx-search-container .ngx-search-container input{width:100%;background:none;border:none;outline:none;font-size:1.2rem}ngx-search-container .ngx-search-container input:focus{outline:none}ngx-search-container .ngx-search-container-mobile{width:100%;display:flex;justify-content:flex-end;height:40px}ngx-search-container .ngx-search-container-mobile.active{display:flex;align-items:center;position:fixed;top:0;left:0;width:100vw;height:56px;z-index:10}ngx-search-container .ngx-search-container-mobile .mat-icon{padding:.5rem}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
76
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgxSearchContainerComponent, decorators: [{
77
- type: Component,
78
- args: [{ selector: 'ngx-search-container', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
79
- AsyncPipe,
80
- NgIf,
81
- MatIconModule,
82
- MatTooltipModule
83
- ], template: "<div *ngIf=\"mediaService.isHandset$ | async; else noHandsetTpl\" class=\"ngx-search-container-mobile mobile\" [class.active]=\"activeSearch$ | async\" #mobileSearch>\n <ng-container *ngIf=\"activeSearch$ | async; else noActiveSearchTpl\">\n <mat-icon (click)=\"activeSearch$.next(false)\">arrow_back</mat-icon>\n <ng-container *ngTemplateOutlet=\"searchContainerTpl\"></ng-container>\n </ng-container>\n <ng-template #noActiveSearchTpl>\n <mat-icon (click)=\"activeSearch$.next(true)\">search</mat-icon>\n </ng-template>\n</div>\n\n<ng-template #noHandsetTpl>\n <ng-container *ngTemplateOutlet=\"searchContainerTpl\"></ng-container>\n</ng-template>\n\n<ng-template #searchContainerTpl>\n <div class=\"ngx-search-container\">\n <mat-icon>search</mat-icon>\n <ng-content></ng-content>\n <mat-icon *ngIf=\"searchInputValue$ | async\" class=\"icon-clear\" [matTooltip]=\"clearTooltip\" (click)=\"reset()\">close</mat-icon>\n <ng-container *ngTemplateOutlet=\"right\"></ng-container>\n </div>\n</ng-template>\n", styles: ["ngx-search-container{flex:1 1 auto;display:flex;padding-left:.5rem}ngx-search-container .ngx-search-container{width:100%;transition:.3s ease-in-out;border-radius:4px;height:40px;display:flex}ngx-search-container .ngx-search-container.mobile{justify-self:flex-end}ngx-search-container .ngx-search-container:not(.mobile){min-width:35vw;max-width:800px}ngx-search-container .ngx-search-container .mat-icon{padding:.5rem}ngx-search-container .ngx-search-container .icon-clear{cursor:pointer}ngx-search-container .ngx-search-container input{width:100%;background:none;border:none;outline:none;font-size:1.2rem}ngx-search-container .ngx-search-container input:focus{outline:none}ngx-search-container .ngx-search-container-mobile{width:100%;display:flex;justify-content:flex-end;height:40px}ngx-search-container .ngx-search-container-mobile.active{display:flex;align-items:center;position:fixed;top:0;left:0;width:100vw;height:56px;z-index:10}ngx-search-container .ngx-search-container-mobile .mat-icon{padding:.5rem}\n"] }]
84
- }], ctorParameters: function () { return [{ type: i1.NgxMediaService }, { type: i0.NgZone }]; }, propDecorators: { cleared: [{
85
- type: Output
86
- }], clearTooltip: [{
87
- type: Input
88
- }], mobileSearch: [{
89
- type: ContentChild,
90
- args: ['mobileSearch']
91
- }], searchInput: [{
92
- type: ContentChild,
93
- args: [NgxSearchInputDirective]
94
- }], right: [{
95
- type: Input
96
- }] } });
97
-
98
- /**
99
- * Generated bundle index. Do not edit.
100
- */
101
-
102
- export { NgxSearchContainerComponent, NgxSearchInputDirective };
103
- //# sourceMappingURL=hug-ngx-search-container.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hug-ngx-search-container.mjs","sources":["../../../projects/search-container/src/search-container.component.ts","../../../projects/search-container/src/search-container.component.html","../../../projects/search-container/src/hug-ngx-search-container.ts"],"sourcesContent":["import { AsyncPipe, NgIf } from '@angular/common';\nimport { AfterContentInit, ChangeDetectionStrategy, Component, ContentChild, Directive, ElementRef, EventEmitter, inject, Input, NgZone, Output, TemplateRef, ViewEncapsulation } from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { NgxDestroy, NgxMediaService } from '@hug/ngx-core';\nimport { BehaviorSubject, distinctUntilChanged, first, Observable, shareReplay, switchMap, takeUntil, tap } from 'rxjs';\n\n@Directive({\n selector: '[ngx-search-input]',\n standalone: true\n})\nexport class NgxSearchInputDirective {\n public ngControl = inject(NgControl);\n\n protected elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n public constructor() {\n this.focus();\n }\n\n public focus(): void {\n this.elementRef.nativeElement.focus();\n }\n}\n\n@Component({\n selector: 'ngx-search-container',\n templateUrl: './search-container.component.html',\n styleUrls: ['./search-container.component.scss'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [\n AsyncPipe,\n NgIf,\n MatIconModule,\n MatTooltipModule\n ]\n})\nexport class NgxSearchContainerComponent extends NgxDestroy implements AfterContentInit {\n\n @Output()\n public readonly cleared = new EventEmitter<void>();\n\n @Input()\n public clearTooltip = 'Effacer la recherche';\n\n @ContentChild('mobileSearch')\n public mobileSearch: TemplateRef<unknown> | undefined;\n\n protected readonly activeSearch$ = new BehaviorSubject(false);\n\n protected searchInputValue$: Observable<string> | undefined;\n\n private _searchInput: NgxSearchInputDirective | undefined;\n\n @ContentChild(NgxSearchInputDirective)\n public set searchInput(searchInput: NgxSearchInputDirective) {\n if (!searchInput) {\n throw new Error('You need to add the attribute searchInput to the SearchContainerComponent');\n }\n if (!searchInput.ngControl) {\n throw new Error('You need to add the attribute ngModel to the SearchContainerComponent');\n }\n this._searchInput = searchInput;\n }\n\n private _right: TemplateRef<unknown> | null = null;\n\n @Input()\n public set right(value: TemplateRef<unknown> | null) {\n this._right = value;\n }\n\n public get right(): TemplateRef<unknown> | null {\n return this._right;\n }\n\n public constructor(\n protected mediaService: NgxMediaService,\n private zone: NgZone\n ) {\n super();\n\n this.activeSearch$.pipe(\n switchMap(activeSearch => this.zone.onStable.pipe(\n first(),\n tap(() => {\n if (!activeSearch) {\n this.reset();\n }\n this._searchInput?.focus();\n })\n )),\n takeUntil(this.destroyed$)\n ).subscribe();\n }\n\n public ngAfterContentInit(): void {\n this.searchInputValue$ = this._searchInput?.ngControl?.valueChanges?.pipe(\n distinctUntilChanged(),\n shareReplay({ bufferSize: 1, refCount: false })\n ) ?? undefined;\n }\n\n public reset(): void {\n this._searchInput?.ngControl?.reset();\n this.cleared.emit();\n }\n}\n","<div *ngIf=\"mediaService.isHandset$ | async; else noHandsetTpl\" class=\"ngx-search-container-mobile mobile\" [class.active]=\"activeSearch$ | async\" #mobileSearch>\n <ng-container *ngIf=\"activeSearch$ | async; else noActiveSearchTpl\">\n <mat-icon (click)=\"activeSearch$.next(false)\">arrow_back</mat-icon>\n <ng-container *ngTemplateOutlet=\"searchContainerTpl\"></ng-container>\n </ng-container>\n <ng-template #noActiveSearchTpl>\n <mat-icon (click)=\"activeSearch$.next(true)\">search</mat-icon>\n </ng-template>\n</div>\n\n<ng-template #noHandsetTpl>\n <ng-container *ngTemplateOutlet=\"searchContainerTpl\"></ng-container>\n</ng-template>\n\n<ng-template #searchContainerTpl>\n <div class=\"ngx-search-container\">\n <mat-icon>search</mat-icon>\n <ng-content></ng-content>\n <mat-icon *ngIf=\"searchInputValue$ | async\" class=\"icon-clear\" [matTooltip]=\"clearTooltip\" (click)=\"reset()\">close</mat-icon>\n <ng-container *ngTemplateOutlet=\"right\"></ng-container>\n </div>\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;MAYa,uBAAuB,CAAA;AAKhC,IAAA,WAAA,GAAA;AAJO,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AAE3B,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC,CAAC;QAG/D,IAAI,CAAC,KAAK,EAAE,CAAC;KAChB;IAEM,KAAK,GAAA;AACR,QAAA,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;KACzC;;oHAXQ,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;wGAAvB,u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,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACb,gBAAgB,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,UAAA,EAAA,QAAA,EAAA,cAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA;2FAGX,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAdvC,SAAS;+BACI,sBAAsB,EAAA,aAAA,EAGjB,iBAAiB,CAAC,IAAI,EAAA,eAAA,EACpB,uBAAuB,CAAC,MAAM,EACnC,UAAA,EAAA,IAAI,EACP,OAAA,EAAA;wBACL,SAAS;wBACT,IAAI;wBACJ,aAAa;wBACb,gBAAgB;qBACnB,EAAA,QAAA,EAAA,sjCAAA,EAAA,MAAA,EAAA,CAAA,s/BAAA,CAAA,EAAA,CAAA;2HAKe,OAAO,EAAA,CAAA;sBADtB,MAAM;gBAIA,YAAY,EAAA,CAAA;sBADlB,KAAK;gBAIC,YAAY,EAAA,CAAA;sBADlB,YAAY;uBAAC,cAAc,CAAA;gBAUjB,WAAW,EAAA,CAAA;sBADrB,YAAY;uBAAC,uBAAuB,CAAA;gBAc1B,KAAK,EAAA,CAAA;sBADf,KAAK;;;AEtEV;;AAEG;;;;"}
@@ -1,100 +0,0 @@
1
- import { AsyncPipe, NgIf } from '@angular/common';
2
- import * as i0 from '@angular/core';
3
- import { inject, ElementRef, Directive, EventEmitter, Component, ViewEncapsulation, ChangeDetectionStrategy, Output, Input, ContentChild } from '@angular/core';
4
- import { NgControl } from '@angular/forms';
5
- import * as i2 from '@angular/material/icon';
6
- import { MatIconModule } from '@angular/material/icon';
7
- import * as i3 from '@angular/material/tooltip';
8
- import { MatTooltipModule } from '@angular/material/tooltip';
9
- import * as i1 from '@hug/ngx-core';
10
- import { NgxDestroy } from '@hug/ngx-core';
11
- import { BehaviorSubject, switchMap, first, tap, takeUntil, distinctUntilChanged, shareReplay } from 'rxjs';
12
-
13
- class NgxSearchInputDirective {
14
- constructor() {
15
- this.ngControl = inject(NgControl);
16
- this.elementRef = inject(ElementRef);
17
- this.focus();
18
- }
19
- focus() {
20
- this.elementRef.nativeElement.focus();
21
- }
22
- }
23
- NgxSearchInputDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgxSearchInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
24
- NgxSearchInputDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: NgxSearchInputDirective, isStandalone: true, selector: "[ngx-search-input]", ngImport: i0 });
25
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgxSearchInputDirective, decorators: [{
26
- type: Directive,
27
- args: [{
28
- selector: '[ngx-search-input]',
29
- standalone: true
30
- }]
31
- }], ctorParameters: function () { return []; } });
32
- class NgxSearchContainerComponent extends NgxDestroy {
33
- constructor(mediaService, zone) {
34
- super();
35
- this.mediaService = mediaService;
36
- this.zone = zone;
37
- this.cleared = new EventEmitter();
38
- this.clearTooltip = 'Effacer la recherche';
39
- this.activeSearch$ = new BehaviorSubject(false);
40
- this._right = null;
41
- this.activeSearch$.pipe(switchMap(activeSearch => this.zone.onStable.pipe(first(), tap(() => {
42
- if (!activeSearch) {
43
- this.reset();
44
- }
45
- this._searchInput?.focus();
46
- }))), takeUntil(this.destroyed$)).subscribe();
47
- }
48
- set searchInput(searchInput) {
49
- if (!searchInput) {
50
- throw new Error('You need to add the attribute searchInput to the SearchContainerComponent');
51
- }
52
- if (!searchInput.ngControl) {
53
- throw new Error('You need to add the attribute ngModel to the SearchContainerComponent');
54
- }
55
- this._searchInput = searchInput;
56
- }
57
- set right(value) {
58
- this._right = value;
59
- }
60
- get right() {
61
- return this._right;
62
- }
63
- ngAfterContentInit() {
64
- this.searchInputValue$ = this._searchInput?.ngControl?.valueChanges?.pipe(distinctUntilChanged(), shareReplay({ bufferSize: 1, refCount: false })) ?? undefined;
65
- }
66
- reset() {
67
- this._searchInput?.ngControl?.reset();
68
- this.cleared.emit();
69
- }
70
- }
71
- NgxSearchContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgxSearchContainerComponent, deps: [{ token: i1.NgxMediaService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
72
- NgxSearchContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: NgxSearchContainerComponent, isStandalone: true, selector: "ngx-search-container", inputs: { clearTooltip: "clearTooltip", right: "right" }, outputs: { cleared: "cleared" }, queries: [{ propertyName: "mobileSearch", first: true, predicate: ["mobileSearch"], descendants: true }, { propertyName: "searchInput", first: true, predicate: NgxSearchInputDirective, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div *ngIf=\"mediaService.isHandset$ | async; else noHandsetTpl\" class=\"ngx-search-container-mobile mobile\" [class.active]=\"activeSearch$ | async\" #mobileSearch>\n <ng-container *ngIf=\"activeSearch$ | async; else noActiveSearchTpl\">\n <mat-icon (click)=\"activeSearch$.next(false)\">arrow_back</mat-icon>\n <ng-container *ngTemplateOutlet=\"searchContainerTpl\"></ng-container>\n </ng-container>\n <ng-template #noActiveSearchTpl>\n <mat-icon (click)=\"activeSearch$.next(true)\">search</mat-icon>\n </ng-template>\n</div>\n\n<ng-template #noHandsetTpl>\n <ng-container *ngTemplateOutlet=\"searchContainerTpl\"></ng-container>\n</ng-template>\n\n<ng-template #searchContainerTpl>\n <div class=\"ngx-search-container\">\n <mat-icon>search</mat-icon>\n <ng-content></ng-content>\n <mat-icon *ngIf=\"searchInputValue$ | async\" class=\"icon-clear\" [matTooltip]=\"clearTooltip\" (click)=\"reset()\">close</mat-icon>\n <ng-container *ngTemplateOutlet=\"right\"></ng-container>\n </div>\n</ng-template>\n", styles: ["ngx-search-container{flex:1 1 auto;display:flex;padding-left:.5rem}ngx-search-container .ngx-search-container{width:100%;transition:.3s ease-in-out;border-radius:4px;height:40px;display:flex}ngx-search-container .ngx-search-container.mobile{justify-self:flex-end}ngx-search-container .ngx-search-container:not(.mobile){min-width:35vw;max-width:800px}ngx-search-container .ngx-search-container .mat-icon{padding:.5rem}ngx-search-container .ngx-search-container .icon-clear{cursor:pointer}ngx-search-container .ngx-search-container input{width:100%;background:none;border:none;outline:none;font-size:1.2rem}ngx-search-container .ngx-search-container input:focus{outline:none}ngx-search-container .ngx-search-container-mobile{width:100%;display:flex;justify-content:flex-end;height:40px}ngx-search-container .ngx-search-container-mobile.active{display:flex;align-items:center;position:fixed;top:0;left:0;width:100vw;height:56px;z-index:10}ngx-search-container .ngx-search-container-mobile .mat-icon{padding:.5rem}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
73
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgxSearchContainerComponent, decorators: [{
74
- type: Component,
75
- args: [{ selector: 'ngx-search-container', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
76
- AsyncPipe,
77
- NgIf,
78
- MatIconModule,
79
- MatTooltipModule
80
- ], template: "<div *ngIf=\"mediaService.isHandset$ | async; else noHandsetTpl\" class=\"ngx-search-container-mobile mobile\" [class.active]=\"activeSearch$ | async\" #mobileSearch>\n <ng-container *ngIf=\"activeSearch$ | async; else noActiveSearchTpl\">\n <mat-icon (click)=\"activeSearch$.next(false)\">arrow_back</mat-icon>\n <ng-container *ngTemplateOutlet=\"searchContainerTpl\"></ng-container>\n </ng-container>\n <ng-template #noActiveSearchTpl>\n <mat-icon (click)=\"activeSearch$.next(true)\">search</mat-icon>\n </ng-template>\n</div>\n\n<ng-template #noHandsetTpl>\n <ng-container *ngTemplateOutlet=\"searchContainerTpl\"></ng-container>\n</ng-template>\n\n<ng-template #searchContainerTpl>\n <div class=\"ngx-search-container\">\n <mat-icon>search</mat-icon>\n <ng-content></ng-content>\n <mat-icon *ngIf=\"searchInputValue$ | async\" class=\"icon-clear\" [matTooltip]=\"clearTooltip\" (click)=\"reset()\">close</mat-icon>\n <ng-container *ngTemplateOutlet=\"right\"></ng-container>\n </div>\n</ng-template>\n", styles: ["ngx-search-container{flex:1 1 auto;display:flex;padding-left:.5rem}ngx-search-container .ngx-search-container{width:100%;transition:.3s ease-in-out;border-radius:4px;height:40px;display:flex}ngx-search-container .ngx-search-container.mobile{justify-self:flex-end}ngx-search-container .ngx-search-container:not(.mobile){min-width:35vw;max-width:800px}ngx-search-container .ngx-search-container .mat-icon{padding:.5rem}ngx-search-container .ngx-search-container .icon-clear{cursor:pointer}ngx-search-container .ngx-search-container input{width:100%;background:none;border:none;outline:none;font-size:1.2rem}ngx-search-container .ngx-search-container input:focus{outline:none}ngx-search-container .ngx-search-container-mobile{width:100%;display:flex;justify-content:flex-end;height:40px}ngx-search-container .ngx-search-container-mobile.active{display:flex;align-items:center;position:fixed;top:0;left:0;width:100vw;height:56px;z-index:10}ngx-search-container .ngx-search-container-mobile .mat-icon{padding:.5rem}\n"] }]
81
- }], ctorParameters: function () { return [{ type: i1.NgxMediaService }, { type: i0.NgZone }]; }, propDecorators: { cleared: [{
82
- type: Output
83
- }], clearTooltip: [{
84
- type: Input
85
- }], mobileSearch: [{
86
- type: ContentChild,
87
- args: ['mobileSearch']
88
- }], searchInput: [{
89
- type: ContentChild,
90
- args: [NgxSearchInputDirective]
91
- }], right: [{
92
- type: Input
93
- }] } });
94
-
95
- /**
96
- * Generated bundle index. Do not edit.
97
- */
98
-
99
- export { NgxSearchContainerComponent, NgxSearchInputDirective };
100
- //# sourceMappingURL=hug-ngx-search-container.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hug-ngx-search-container.mjs","sources":["../../../projects/search-container/src/search-container.component.ts","../../../projects/search-container/src/search-container.component.html","../../../projects/search-container/src/hug-ngx-search-container.ts"],"sourcesContent":["import { AsyncPipe, NgIf } from '@angular/common';\nimport { AfterContentInit, ChangeDetectionStrategy, Component, ContentChild, Directive, ElementRef, EventEmitter, inject, Input, NgZone, Output, TemplateRef, ViewEncapsulation } from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { NgxDestroy, NgxMediaService } from '@hug/ngx-core';\nimport { BehaviorSubject, distinctUntilChanged, first, Observable, shareReplay, switchMap, takeUntil, tap } from 'rxjs';\n\n@Directive({\n selector: '[ngx-search-input]',\n standalone: true\n})\nexport class NgxSearchInputDirective {\n public ngControl = inject(NgControl);\n\n protected elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n public constructor() {\n this.focus();\n }\n\n public focus(): void {\n this.elementRef.nativeElement.focus();\n }\n}\n\n@Component({\n selector: 'ngx-search-container',\n templateUrl: './search-container.component.html',\n styleUrls: ['./search-container.component.scss'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [\n AsyncPipe,\n NgIf,\n MatIconModule,\n MatTooltipModule\n ]\n})\nexport class NgxSearchContainerComponent extends NgxDestroy implements AfterContentInit {\n\n @Output()\n public readonly cleared = new EventEmitter<void>();\n\n @Input()\n public clearTooltip = 'Effacer la recherche';\n\n @ContentChild('mobileSearch')\n public mobileSearch: TemplateRef<unknown> | undefined;\n\n protected readonly activeSearch$ = new BehaviorSubject(false);\n\n protected searchInputValue$: Observable<string> | undefined;\n\n private _searchInput: NgxSearchInputDirective | undefined;\n\n @ContentChild(NgxSearchInputDirective)\n public set searchInput(searchInput: NgxSearchInputDirective) {\n if (!searchInput) {\n throw new Error('You need to add the attribute searchInput to the SearchContainerComponent');\n }\n if (!searchInput.ngControl) {\n throw new Error('You need to add the attribute ngModel to the SearchContainerComponent');\n }\n this._searchInput = searchInput;\n }\n\n private _right: TemplateRef<unknown> | null = null;\n\n @Input()\n public set right(value: TemplateRef<unknown> | null) {\n this._right = value;\n }\n\n public get right(): TemplateRef<unknown> | null {\n return this._right;\n }\n\n public constructor(\n protected mediaService: NgxMediaService,\n private zone: NgZone\n ) {\n super();\n\n this.activeSearch$.pipe(\n switchMap(activeSearch => this.zone.onStable.pipe(\n first(),\n tap(() => {\n if (!activeSearch) {\n this.reset();\n }\n this._searchInput?.focus();\n })\n )),\n takeUntil(this.destroyed$)\n ).subscribe();\n }\n\n public ngAfterContentInit(): void {\n this.searchInputValue$ = this._searchInput?.ngControl?.valueChanges?.pipe(\n distinctUntilChanged(),\n shareReplay({ bufferSize: 1, refCount: false })\n ) ?? undefined;\n }\n\n public reset(): void {\n this._searchInput?.ngControl?.reset();\n this.cleared.emit();\n }\n}\n","<div *ngIf=\"mediaService.isHandset$ | async; else noHandsetTpl\" class=\"ngx-search-container-mobile mobile\" [class.active]=\"activeSearch$ | async\" #mobileSearch>\n <ng-container *ngIf=\"activeSearch$ | async; else noActiveSearchTpl\">\n <mat-icon (click)=\"activeSearch$.next(false)\">arrow_back</mat-icon>\n <ng-container *ngTemplateOutlet=\"searchContainerTpl\"></ng-container>\n </ng-container>\n <ng-template #noActiveSearchTpl>\n <mat-icon (click)=\"activeSearch$.next(true)\">search</mat-icon>\n </ng-template>\n</div>\n\n<ng-template #noHandsetTpl>\n <ng-container *ngTemplateOutlet=\"searchContainerTpl\"></ng-container>\n</ng-template>\n\n<ng-template #searchContainerTpl>\n <div class=\"ngx-search-container\">\n <mat-icon>search</mat-icon>\n <ng-content></ng-content>\n <mat-icon *ngIf=\"searchInputValue$ | async\" class=\"icon-clear\" [matTooltip]=\"clearTooltip\" (click)=\"reset()\">close</mat-icon>\n <ng-container *ngTemplateOutlet=\"right\"></ng-container>\n </div>\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;MAYa,uBAAuB,CAAA;AAKhC,IAAA,WAAA,GAAA;AAJO,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AAE3B,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC,CAAC;QAG/D,IAAI,CAAC,KAAK,EAAE,CAAC;KAChB;IAEM,KAAK,GAAA;AACR,QAAA,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;KACzC;;oHAXQ,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;wGAAvB,uBAAuB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;2FAAvB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAJnC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,oBAAoB;AAC9B,oBAAA,UAAU,EAAE,IAAI;AACnB,iBAAA,CAAA;;AA6BK,MAAO,2BAA4B,SAAQ,UAAU,CAAA;IAuCvD,WACc,CAAA,YAA6B,EAC/B,IAAY,EAAA;AAEpB,QAAA,KAAK,EAAE,CAAC;QAHE,IAAY,CAAA,YAAA,GAAZ,YAAY,CAAiB;QAC/B,IAAI,CAAA,IAAA,G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