@hug/ngx-search-container 1.1.2 → 1.1.3
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 +21 -8
- package/README.md +1 -2
- package/_search-container-theme.scss +5 -5
- package/esm2020/search-container.component.mjs +24 -28
- package/esm2020/search-container.module.mjs +10 -10
- package/fesm2015/hug-ngx-search-container.mjs +32 -39
- package/fesm2015/hug-ngx-search-container.mjs.map +1 -1
- package/fesm2020/hug-ngx-search-container.mjs +32 -37
- package/fesm2020/hug-ngx-search-container.mjs.map +1 -1
- package/package.json +47 -53
- package/search-container.component.d.ts +12 -12
- package/search-container.module.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
## 1.1.
|
|
1
|
+
## 1.1.3 (2024-07-23)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### 🐛 Fixes
|
|
5
5
|
|
|
6
|
-
-
|
|
6
|
+
- **ngx-search-container:** ngx prefix ([064666d](https://github.com/DSI-HUG/ngx-components/commit/064666d))
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
### 🌱 Dependencies
|
|
10
10
|
|
|
11
|
-
- **@hug/ngx-core:** upgrade to v1.1.
|
|
11
|
+
- **@hug/ngx-core:** upgrade to v1.1.8 ([26f0d10](https://github.com/DSI-HUG/ngx-components/commit/26f0d10))
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
### ❤️ Thank You
|
|
@@ -16,14 +16,27 @@
|
|
|
16
16
|
- dsi-hug-bot @dsi-hug-bot
|
|
17
17
|
- Serge
|
|
18
18
|
|
|
19
|
-
## 1.1.
|
|
19
|
+
## 1.1.2 (2024-07-05)
|
|
20
20
|
|
|
21
|
+
### 🐛 Fixes
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
- theming ([79feb6e](https://github.com/DSI-HUG/ngx-components/commit/79feb6e))
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
### 🌱 Dependencies
|
|
25
26
|
|
|
27
|
+
- **@hug/ngx-core:** upgrade to v1.1.7 ([b0f15b9](https://github.com/DSI-HUG/ngx-components/commit/b0f15b9))
|
|
26
28
|
|
|
27
|
-
### ❤️
|
|
29
|
+
### ❤️ Thank You
|
|
30
|
+
|
|
31
|
+
- dsi-hug-bot @dsi-hug-bot
|
|
32
|
+
- Serge
|
|
33
|
+
|
|
34
|
+
## 1.1.0 (2024-06-26)
|
|
35
|
+
|
|
36
|
+
### 🚀 Features
|
|
37
|
+
|
|
38
|
+
- **search-container:** first commit ([f140942](https://github.com/DSI-HUG/ngx-components/commit/f140942))
|
|
39
|
+
|
|
40
|
+
### ❤️ Thank You
|
|
28
41
|
|
|
29
|
-
-
|
|
42
|
+
- Badisi
|
package/README.md
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
$background: map-get($theme, background);
|
|
7
7
|
$foreground: map-get($theme, foreground);
|
|
8
8
|
|
|
9
|
-
search-container {
|
|
10
|
-
.search-container {
|
|
9
|
+
ngx-search-container {
|
|
10
|
+
.ngx-search-container {
|
|
11
11
|
background-color: mat.get-color-from-palette($background, background, 0.2);
|
|
12
12
|
|
|
13
13
|
&:hover {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
|
|
40
40
|
.icon-clear {
|
|
41
41
|
:hover {
|
|
42
|
-
color: mat.get-color-from-palette($background, background)
|
|
42
|
+
color: mat.get-color-from-palette($background, background);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
|
|
@@ -52,13 +52,13 @@
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
.search-container-mobile {
|
|
55
|
+
.ngx-search-container-mobile {
|
|
56
56
|
&.active {
|
|
57
57
|
background-color: mat.get-color-from-palette($background, background);
|
|
58
58
|
color: mat.get-color-from-palette($foreground, text);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
.search-container {
|
|
61
|
+
.ngx-search-container {
|
|
62
62
|
&::placeholder {
|
|
63
63
|
color: mat.get-color-from-palette($foreground, secondary-text);
|
|
64
64
|
}
|
|
@@ -1,35 +1,31 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, ContentChild, Directive, EventEmitter,
|
|
2
|
-
import {
|
|
1
|
+
import { ChangeDetectionStrategy, Component, ContentChild, Directive, ElementRef, EventEmitter, inject, Input, Output, ViewEncapsulation } from '@angular/core';
|
|
2
|
+
import { NgControl } from '@angular/forms';
|
|
3
|
+
import { NgxDestroy } from '@hug/ngx-core';
|
|
3
4
|
import { BehaviorSubject, distinctUntilChanged, first, shareReplay, switchMap, takeUntil, tap } from 'rxjs';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
5
|
-
import * as i1 from "@
|
|
6
|
-
import * as i2 from "@
|
|
7
|
-
import * as i3 from "@angular/
|
|
8
|
-
import * as i4 from "@angular/material/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
this.
|
|
13
|
-
this.elementRef = elementRef;
|
|
6
|
+
import * as i1 from "@hug/ngx-core";
|
|
7
|
+
import * as i2 from "@angular/common";
|
|
8
|
+
import * as i3 from "@angular/material/icon";
|
|
9
|
+
import * as i4 from "@angular/material/tooltip";
|
|
10
|
+
export class NgxSearchInputDirective {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.ngControl = inject(NgControl);
|
|
13
|
+
this.elementRef = inject(ElementRef);
|
|
14
14
|
this.focus();
|
|
15
15
|
}
|
|
16
16
|
focus() {
|
|
17
17
|
this.elementRef.nativeElement.focus();
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type:
|
|
20
|
+
NgxSearchInputDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgxSearchInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
21
|
+
NgxSearchInputDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: NgxSearchInputDirective, selector: "[ngx-search-input]", ngImport: i0 });
|
|
22
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgxSearchInputDirective, decorators: [{
|
|
23
23
|
type: Directive,
|
|
24
24
|
args: [{
|
|
25
|
-
selector: '[
|
|
25
|
+
selector: '[ngx-search-input]'
|
|
26
26
|
}]
|
|
27
|
-
}], ctorParameters: function () { return [
|
|
28
|
-
|
|
29
|
-
}, {
|
|
30
|
-
type: Self
|
|
31
|
-
}] }, { type: i0.ElementRef }]; } });
|
|
32
|
-
export class SearchContainerComponent extends Destroy {
|
|
27
|
+
}], ctorParameters: function () { return []; } });
|
|
28
|
+
export class NgxSearchContainerComponent extends NgxDestroy {
|
|
33
29
|
constructor(mediaService, zone) {
|
|
34
30
|
super();
|
|
35
31
|
this.mediaService = mediaService;
|
|
@@ -68,12 +64,12 @@ export class SearchContainerComponent extends Destroy {
|
|
|
68
64
|
this.cleared.emit();
|
|
69
65
|
}
|
|
70
66
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type:
|
|
67
|
+
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 });
|
|
68
|
+
NgxSearchContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: NgxSearchContainerComponent, 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{display:flex;flex:1 1 auto;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: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
69
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgxSearchContainerComponent, decorators: [{
|
|
74
70
|
type: Component,
|
|
75
|
-
args: [{ selector: 'search-container', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *ngIf=\"mediaService.isHandset$ | async; else noHandsetTpl\" class=\"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=\"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: ["search-container{display:flex;flex:1 1 auto;padding-left:.5rem}search-container .search-container{width:100%;transition:.3s ease-in-out;border-radius:4px;height:40px;display:flex}search-container .search-container.mobile{justify-self:flex-end}search-container .search-container:not(.mobile){min-width:35vw;max-width:800px}search-container .search-container .mat-icon{padding:.5rem}search-container .search-container .icon-clear{cursor:pointer}search-container .search-container input{width:100%;background:none;border:none;outline:none;font-size:1.2rem}search-container .search-container input:focus{outline:none}search-container .search-container-mobile{width:100%;display:flex;justify-content:flex-end;height:40px}search-container .search-container-mobile.active{display:flex;align-items:center;position:fixed;top:0;left:0;width:100vw;height:56px;z-index:10}search-container .search-container-mobile .mat-icon{padding:.5rem}\n"] }]
|
|
76
|
-
}], ctorParameters: function () { return [{ type:
|
|
71
|
+
args: [{ selector: 'ngx-search-container', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, 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{display:flex;flex:1 1 auto;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"] }]
|
|
72
|
+
}], ctorParameters: function () { return [{ type: i1.NgxMediaService }, { type: i0.NgZone }]; }, propDecorators: { cleared: [{
|
|
77
73
|
type: Output
|
|
78
74
|
}], clearTooltip: [{
|
|
79
75
|
type: Input
|
|
@@ -82,8 +78,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
82
78
|
args: ['mobileSearch']
|
|
83
79
|
}], searchInput: [{
|
|
84
80
|
type: ContentChild,
|
|
85
|
-
args: [
|
|
81
|
+
args: [NgxSearchInputDirective]
|
|
86
82
|
}], right: [{
|
|
87
83
|
type: Input
|
|
88
84
|
}] } });
|
|
89
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
85
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VhcmNoLWNvbnRhaW5lci5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9wcm9qZWN0cy9zZWFyY2gtY29udGFpbmVyL3NyYy9zZWFyY2gtY29udGFpbmVyLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uL3Byb2plY3RzL3NlYXJjaC1jb250YWluZXIvc3JjL3NlYXJja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ljayk9XCJyZXNldCgpXCI+Y2xvc2U8L21hdC1pY29uPlxuICAgICAgICA8bmctY29udGFpbmVyICpuZ1RlbXBsYXRlT3V0bGV0PVwicmlnaHRcIj48L25nLWNvbnRhaW5lcj5cbiAgICA8L2Rpdj5cbjwvbmctdGVtcGxhdGU+XG4iXX0=
|
|
@@ -4,18 +4,18 @@ import { FormsModule } from '@angular/forms';
|
|
|
4
4
|
import { MatButtonModule } from '@angular/material/button';
|
|
5
5
|
import { MatIconModule } from '@angular/material/icon';
|
|
6
6
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
7
|
-
import {
|
|
7
|
+
import { NgxSearchContainerComponent, NgxSearchInputDirective } from './search-container.component';
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
9
|
export class SearchContainerModule {
|
|
10
10
|
}
|
|
11
11
|
SearchContainerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SearchContainerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
12
|
-
SearchContainerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: SearchContainerModule, declarations: [
|
|
13
|
-
|
|
12
|
+
SearchContainerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: SearchContainerModule, declarations: [NgxSearchContainerComponent,
|
|
13
|
+
NgxSearchInputDirective], imports: [CommonModule,
|
|
14
14
|
FormsModule,
|
|
15
15
|
MatButtonModule,
|
|
16
16
|
MatIconModule,
|
|
17
|
-
MatTooltipModule], exports: [
|
|
18
|
-
|
|
17
|
+
MatTooltipModule], exports: [NgxSearchContainerComponent,
|
|
18
|
+
NgxSearchInputDirective] });
|
|
19
19
|
SearchContainerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SearchContainerModule, imports: [CommonModule,
|
|
20
20
|
FormsModule,
|
|
21
21
|
MatButtonModule,
|
|
@@ -32,13 +32,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
32
32
|
MatTooltipModule
|
|
33
33
|
],
|
|
34
34
|
declarations: [
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
NgxSearchContainerComponent,
|
|
36
|
+
NgxSearchInputDirective
|
|
37
37
|
],
|
|
38
38
|
exports: [
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
NgxSearchContainerComponent,
|
|
40
|
+
NgxSearchInputDirective
|
|
41
41
|
]
|
|
42
42
|
}]
|
|
43
43
|
}] });
|
|
44
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
44
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VhcmNoLWNvbnRhaW5lci5tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9wcm9qZWN0cy9zZWFyY2gtY29udGFpbmVyL3NyYy9zZWFyY2gtY29udGFpbmVyLm1vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDL0MsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUN6QyxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0sZ0JBQWdCLENBQUM7QUFDN0MsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBQzNELE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUN2RCxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUU3RCxPQUFPLEVBQUUsMkJBQTJCLEVBQUUsdUJBQXVCLEVBQUUsTUFBTSw4QkFBOEIsQ0FB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uaW1wb3J0IHsgTmd4U2VhcmNoQ29udGFpbmVyQ29tcG9uZW50LCBOZ3hTZWFyY2hJbnB1dERpcmVjdGl2ZSB9IGZyb20gJy4vc2VhcmNoLWNvbnRhaW5lci5jb21wb25lbnQnO1xuXG5ATmdNb2R1bGUoe1xuICAgIGltcG9ydHM6IFtcbiAgICAgICAgQ29tbW9uTW9kdWxlLFxuICAgICAgICBGb3Jtc01vZHVsZSxcbiAgICAgICAgTWF0QnV0dG9uTW9kdWxlLFxuICAgICAgICBNYXRJY29uTW9kdWxlLFxuICAgICAgICBNYXRUb29sdGlwTW9kdWxlXG4gICAgXSxcbiAgICBkZWNsYXJhdGlvbnM6IFtcbiAgICAgICAgTmd4U2VhcmNoQ29udGFpbmVyQ29tcG9uZW50LFxuICAgICAgICBOZ3hTZWFyY2hJbnB1dERpcmVjdGl2ZVxuICAgIF0sXG4gICAgZXhwb3J0czogW1xuICAgICAgICBOZ3hTZWFyY2hDb250YWluZXJDb21wb25lbnQsXG4gICAgICAgIE5neFNlYXJjaElucHV0RGlyZWN0aXZlXG4gICAgXVxufSlcbmV4cG9ydCBjbGFzcyBTZWFyY2hDb250YWluZXJNb2R1bGUgeyB9XG4iXX0=
|
|
@@ -1,43 +1,36 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import { inject, ElementRef, Directive, EventEmitter, Component, ViewEncapsulation, ChangeDetectionStrategy, Output, Input, ContentChild, NgModule } from '@angular/core';
|
|
3
|
+
import { NgControl, FormsModule } from '@angular/forms';
|
|
4
|
+
import * as i1 from '@hug/ngx-core';
|
|
5
|
+
import { NgxDestroy } from '@hug/ngx-core';
|
|
5
6
|
import { BehaviorSubject, switchMap, first, tap, takeUntil, distinctUntilChanged, shareReplay } from 'rxjs';
|
|
6
|
-
import * as
|
|
7
|
-
import { FormsModule } from '@angular/forms';
|
|
8
|
-
import * as i3 from '@angular/common';
|
|
7
|
+
import * as i2 from '@angular/common';
|
|
9
8
|
import { CommonModule } from '@angular/common';
|
|
10
|
-
import * as
|
|
9
|
+
import * as i3 from '@angular/material/icon';
|
|
11
10
|
import { MatIconModule } from '@angular/material/icon';
|
|
12
|
-
import * as
|
|
11
|
+
import * as i4 from '@angular/material/tooltip';
|
|
13
12
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
14
13
|
import { MatButtonModule } from '@angular/material/button';
|
|
15
14
|
|
|
16
|
-
class
|
|
17
|
-
constructor(
|
|
18
|
-
this.ngControl =
|
|
19
|
-
this.elementRef =
|
|
15
|
+
class NgxSearchInputDirective {
|
|
16
|
+
constructor() {
|
|
17
|
+
this.ngControl = inject(NgControl);
|
|
18
|
+
this.elementRef = inject(ElementRef);
|
|
20
19
|
this.focus();
|
|
21
20
|
}
|
|
22
21
|
focus() {
|
|
23
22
|
this.elementRef.nativeElement.focus();
|
|
24
23
|
}
|
|
25
24
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type:
|
|
25
|
+
NgxSearchInputDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgxSearchInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
26
|
+
NgxSearchInputDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: NgxSearchInputDirective, selector: "[ngx-search-input]", ngImport: i0 });
|
|
27
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgxSearchInputDirective, decorators: [{
|
|
29
28
|
type: Directive,
|
|
30
29
|
args: [{
|
|
31
|
-
selector: '[
|
|
30
|
+
selector: '[ngx-search-input]'
|
|
32
31
|
}]
|
|
33
|
-
}], ctorParameters: function () {
|
|
34
|
-
|
|
35
|
-
type: Optional
|
|
36
|
-
}, {
|
|
37
|
-
type: Self
|
|
38
|
-
}] }, { type: i0.ElementRef }];
|
|
39
|
-
} });
|
|
40
|
-
class SearchContainerComponent extends Destroy {
|
|
32
|
+
}], ctorParameters: function () { return []; } });
|
|
33
|
+
class NgxSearchContainerComponent extends NgxDestroy {
|
|
41
34
|
constructor(mediaService, zone) {
|
|
42
35
|
super();
|
|
43
36
|
this.mediaService = mediaService;
|
|
@@ -79,12 +72,12 @@ class SearchContainerComponent extends Destroy {
|
|
|
79
72
|
this.cleared.emit();
|
|
80
73
|
}
|
|
81
74
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type:
|
|
75
|
+
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 });
|
|
76
|
+
NgxSearchContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: NgxSearchContainerComponent, 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{display:flex;flex:1 1 auto;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: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
77
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgxSearchContainerComponent, decorators: [{
|
|
85
78
|
type: Component,
|
|
86
|
-
args: [{ selector: 'search-container', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *ngIf=\"mediaService.isHandset$ | async; else noHandsetTpl\" class=\"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=\"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: ["search-container{display:flex;flex:1 1 auto;padding-left:.5rem}search-container .search-container{width:100%;transition:.3s ease-in-out;border-radius:4px;height:40px;display:flex}search-container .search-container.mobile{justify-self:flex-end}search-container .search-container:not(.mobile){min-width:35vw;max-width:800px}search-container .search-container .mat-icon{padding:.5rem}search-container .search-container .icon-clear{cursor:pointer}search-container .search-container input{width:100%;background:none;border:none;outline:none;font-size:1.2rem}search-container .search-container input:focus{outline:none}search-container .search-container-mobile{width:100%;display:flex;justify-content:flex-end;height:40px}search-container .search-container-mobile.active{display:flex;align-items:center;position:fixed;top:0;left:0;width:100vw;height:56px;z-index:10}search-container .search-container-mobile .mat-icon{padding:.5rem}\n"] }]
|
|
87
|
-
}], ctorParameters: function () { return [{ type:
|
|
79
|
+
args: [{ selector: 'ngx-search-container', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, 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{display:flex;flex:1 1 auto;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: [{
|
|
88
81
|
type: Output
|
|
89
82
|
}], clearTooltip: [{
|
|
90
83
|
type: Input
|
|
@@ -93,7 +86,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
93
86
|
args: ['mobileSearch']
|
|
94
87
|
}], searchInput: [{
|
|
95
88
|
type: ContentChild,
|
|
96
|
-
args: [
|
|
89
|
+
args: [NgxSearchInputDirective]
|
|
97
90
|
}], right: [{
|
|
98
91
|
type: Input
|
|
99
92
|
}] } });
|
|
@@ -101,13 +94,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
101
94
|
class SearchContainerModule {
|
|
102
95
|
}
|
|
103
96
|
SearchContainerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SearchContainerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
104
|
-
SearchContainerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: SearchContainerModule, declarations: [
|
|
105
|
-
|
|
97
|
+
SearchContainerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: SearchContainerModule, declarations: [NgxSearchContainerComponent,
|
|
98
|
+
NgxSearchInputDirective], imports: [CommonModule,
|
|
106
99
|
FormsModule,
|
|
107
100
|
MatButtonModule,
|
|
108
101
|
MatIconModule,
|
|
109
|
-
MatTooltipModule], exports: [
|
|
110
|
-
|
|
102
|
+
MatTooltipModule], exports: [NgxSearchContainerComponent,
|
|
103
|
+
NgxSearchInputDirective] });
|
|
111
104
|
SearchContainerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SearchContainerModule, imports: [CommonModule,
|
|
112
105
|
FormsModule,
|
|
113
106
|
MatButtonModule,
|
|
@@ -124,12 +117,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
124
117
|
MatTooltipModule
|
|
125
118
|
],
|
|
126
119
|
declarations: [
|
|
127
|
-
|
|
128
|
-
|
|
120
|
+
NgxSearchContainerComponent,
|
|
121
|
+
NgxSearchInputDirective
|
|
129
122
|
],
|
|
130
123
|
exports: [
|
|
131
|
-
|
|
132
|
-
|
|
124
|
+
NgxSearchContainerComponent,
|
|
125
|
+
NgxSearchInputDirective
|
|
133
126
|
]
|
|
134
127
|
}]
|
|
135
128
|
}] });
|
|
@@ -138,5 +131,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
138
131
|
* Generated bundle index. Do not edit.
|
|
139
132
|
*/
|
|
140
133
|
|
|
141
|
-
export {
|
|
134
|
+
export { NgxSearchContainerComponent, NgxSearchInputDirective, SearchContainerModule };
|
|
142
135
|
//# sourceMappingURL=hug-ngx-search-container.mjs.map
|
|
@@ -1 +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/search-container.module.ts","../../../projects/search-container/src/hug-ngx-search-container.ts"],"sourcesContent":["import { AfterContentInit, ChangeDetectionStrategy, Component, ContentChild, Directive, ElementRef, EventEmitter, Input, NgZone, Optional, Output, Self, TemplateRef, ViewEncapsulation } from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { Destroy, MediaService } from '@hug/ngx-core';\nimport { BehaviorSubject, distinctUntilChanged, first, Observable, shareReplay, switchMap, takeUntil, tap } from 'rxjs';\n\n@Directive({\n selector: '[searchInput]'\n})\nexport class SearchInputDirective {\n public constructor(\n @Optional() @Self() public ngControl: NgControl,\n private elementRef: ElementRef<HTMLElement>\n ) {\n this.focus();\n }\n\n public focus(): void {\n this.elementRef.nativeElement.focus();\n }\n}\n\n@Component({\n selector: 'search-container',\n templateUrl: './search-container.component.html',\n styleUrls: ['./search-container.component.scss'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SearchContainerComponent extends Destroy 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> | null | undefined;\n\n private _searchInput: SearchInputDirective | undefined;\n\n @ContentChild(SearchInputDirective)\n public set searchInput(searchInput: SearchInputDirective) {\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: MediaService,\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 );\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=\"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=\"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","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatTooltipModule } from '@angular/material/tooltip';\n\nimport { SearchContainerComponent, SearchInputDirective } from './search-container.component';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n MatButtonModule,\n MatIconModule,\n MatTooltipModule\n ],\n declarations: [\n SearchContainerComponent,\n SearchInputDirective\n ],\n exports: [\n SearchContainerComponent,\n SearchInputDirective\n ]\n})\nexport class SearchContainerModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;MAQa,oBAAoB,CAAA;IAC7B,WAC+B,CAAA,SAAoB,EACvC,UAAmC,EAAA;AADhB,QAAA,IAAS,CAAA,SAAA,GAAT,SAAS,CAAW;AACvC,QAAA,IAAU,CAAA,UAAA,GAAV,UAAU,CAAyB;QAE3C,IAAI,CAA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AAA,EAAA,CAAA,CAAA;AAArB,qBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,iBAR1B,wBAAwB;AACxB,QAAA,oBAAoB,aARpB,YAAY;QACZ,WAAW;QACX,eAAe;QACf,aAAa;AACb,QAAA,gBAAgB,aAOhB,wBAAwB;QACxB,oBAAoB,CAAA,EAAA,CAAA,CAAA;AAGf,qBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,YAf1B,YAAY;QACZ,WAAW;QACX,eAAe;QACf,aAAa;QACb,gBAAgB,CAAA,EAAA,CAAA,CAAA;2FAWX,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAjBjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE;wBACL,YAAY;wBACZ,WAAW;wBACX,eAAe;wBACf,aAAa;wBACb,gBAAgB;AACnB,qBAAA;AACD,oBAAA,YAAY,EAAE;wBACV,wBAAwB;wBACxB,oBAAoB;AACvB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACL,wBAAwB;wBACxB,oBAAoB;AACvB,qBAAA;iBACJ,CAAA;;;ACzBD;;AAEG;;;;"}
|
|
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/search-container.module.ts","../../../projects/search-container/src/hug-ngx-search-container.ts"],"sourcesContent":["import { AfterContentInit, ChangeDetectionStrategy, Component, ContentChild, Directive, ElementRef, EventEmitter, inject, Input, NgZone, Output, TemplateRef, ViewEncapsulation } from '@angular/core';\nimport { NgControl } from '@angular/forms';\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})\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})\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> | null | 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 );\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","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatTooltipModule } from '@angular/material/tooltip';\n\nimport { NgxSearchContainerComponent, NgxSearchInputDirective } from './search-container.component';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n MatButtonModule,\n MatIconModule,\n MatTooltipModule\n ],\n declarations: [\n NgxSearchContainerComponent,\n NgxSearchInputDirective\n ],\n exports: [\n NgxSearchContainerComponent,\n NgxSearchInputDirective\n ]\n})\nexport class SearchContainerModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"m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A,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAArB,qBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,iBAR1B,2BAA2B;AAC3B,QAAA,uBAAuB,aARvB,YAAY;QACZ,WAAW;QACX,eAAe;QACf,aAAa;AACb,QAAA,gBAAgB,aAOhB,2BAA2B;QAC3B,uBAAuB,CAAA,EAAA,CAAA,CAAA;AAGlB,qBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,YAf1B,YAAY;QACZ,WAAW;QACX,eAAe;QACf,aAAa;QACb,gBAAgB,CAAA,EAAA,CAAA,CAAA;2FAWX,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAjBjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE;wBACL,YAAY;wBACZ,WAAW;wBACX,eAAe;wBACf,aAAa;wBACb,gBAAgB;AACnB,qBAAA;AACD,oBAAA,YAAY,EAAE;wBACV,2BAA2B;wBAC3B,uBAAuB;AAC1B,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACL,2BAA2B;wBAC3B,uBAAuB;AAC1B,qBAAA;iBACJ,CAAA;;;ACzBD;;AAEG;;;;"}
|
|
@@ -1,41 +1,36 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import { inject, ElementRef, Directive, EventEmitter, Component, ViewEncapsulation, ChangeDetectionStrategy, Output, Input, ContentChild, NgModule } from '@angular/core';
|
|
3
|
+
import { NgControl, FormsModule } from '@angular/forms';
|
|
4
|
+
import * as i1 from '@hug/ngx-core';
|
|
5
|
+
import { NgxDestroy } from '@hug/ngx-core';
|
|
5
6
|
import { BehaviorSubject, switchMap, first, tap, takeUntil, distinctUntilChanged, shareReplay } from 'rxjs';
|
|
6
|
-
import * as
|
|
7
|
-
import { FormsModule } from '@angular/forms';
|
|
8
|
-
import * as i3 from '@angular/common';
|
|
7
|
+
import * as i2 from '@angular/common';
|
|
9
8
|
import { CommonModule } from '@angular/common';
|
|
10
|
-
import * as
|
|
9
|
+
import * as i3 from '@angular/material/icon';
|
|
11
10
|
import { MatIconModule } from '@angular/material/icon';
|
|
12
|
-
import * as
|
|
11
|
+
import * as i4 from '@angular/material/tooltip';
|
|
13
12
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
14
13
|
import { MatButtonModule } from '@angular/material/button';
|
|
15
14
|
|
|
16
|
-
class
|
|
17
|
-
constructor(
|
|
18
|
-
this.ngControl =
|
|
19
|
-
this.elementRef =
|
|
15
|
+
class NgxSearchInputDirective {
|
|
16
|
+
constructor() {
|
|
17
|
+
this.ngControl = inject(NgControl);
|
|
18
|
+
this.elementRef = inject(ElementRef);
|
|
20
19
|
this.focus();
|
|
21
20
|
}
|
|
22
21
|
focus() {
|
|
23
22
|
this.elementRef.nativeElement.focus();
|
|
24
23
|
}
|
|
25
24
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type:
|
|
25
|
+
NgxSearchInputDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgxSearchInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
26
|
+
NgxSearchInputDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: NgxSearchInputDirective, selector: "[ngx-search-input]", ngImport: i0 });
|
|
27
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgxSearchInputDirective, decorators: [{
|
|
29
28
|
type: Directive,
|
|
30
29
|
args: [{
|
|
31
|
-
selector: '[
|
|
30
|
+
selector: '[ngx-search-input]'
|
|
32
31
|
}]
|
|
33
|
-
}], ctorParameters: function () { return [
|
|
34
|
-
|
|
35
|
-
}, {
|
|
36
|
-
type: Self
|
|
37
|
-
}] }, { type: i0.ElementRef }]; } });
|
|
38
|
-
class SearchContainerComponent extends Destroy {
|
|
32
|
+
}], ctorParameters: function () { return []; } });
|
|
33
|
+
class NgxSearchContainerComponent extends NgxDestroy {
|
|
39
34
|
constructor(mediaService, zone) {
|
|
40
35
|
super();
|
|
41
36
|
this.mediaService = mediaService;
|
|
@@ -74,12 +69,12 @@ class SearchContainerComponent extends Destroy {
|
|
|
74
69
|
this.cleared.emit();
|
|
75
70
|
}
|
|
76
71
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type:
|
|
72
|
+
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 });
|
|
73
|
+
NgxSearchContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: NgxSearchContainerComponent, 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{display:flex;flex:1 1 auto;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: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
74
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgxSearchContainerComponent, decorators: [{
|
|
80
75
|
type: Component,
|
|
81
|
-
args: [{ selector: 'search-container', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *ngIf=\"mediaService.isHandset$ | async; else noHandsetTpl\" class=\"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=\"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: ["search-container{display:flex;flex:1 1 auto;padding-left:.5rem}search-container .search-container{width:100%;transition:.3s ease-in-out;border-radius:4px;height:40px;display:flex}search-container .search-container.mobile{justify-self:flex-end}search-container .search-container:not(.mobile){min-width:35vw;max-width:800px}search-container .search-container .mat-icon{padding:.5rem}search-container .search-container .icon-clear{cursor:pointer}search-container .search-container input{width:100%;background:none;border:none;outline:none;font-size:1.2rem}search-container .search-container input:focus{outline:none}search-container .search-container-mobile{width:100%;display:flex;justify-content:flex-end;height:40px}search-container .search-container-mobile.active{display:flex;align-items:center;position:fixed;top:0;left:0;width:100vw;height:56px;z-index:10}search-container .search-container-mobile .mat-icon{padding:.5rem}\n"] }]
|
|
82
|
-
}], ctorParameters: function () { return [{ type:
|
|
76
|
+
args: [{ selector: 'ngx-search-container', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, 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{display:flex;flex:1 1 auto;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"] }]
|
|
77
|
+
}], ctorParameters: function () { return [{ type: i1.NgxMediaService }, { type: i0.NgZone }]; }, propDecorators: { cleared: [{
|
|
83
78
|
type: Output
|
|
84
79
|
}], clearTooltip: [{
|
|
85
80
|
type: Input
|
|
@@ -88,7 +83,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
88
83
|
args: ['mobileSearch']
|
|
89
84
|
}], searchInput: [{
|
|
90
85
|
type: ContentChild,
|
|
91
|
-
args: [
|
|
86
|
+
args: [NgxSearchInputDirective]
|
|
92
87
|
}], right: [{
|
|
93
88
|
type: Input
|
|
94
89
|
}] } });
|
|
@@ -96,13 +91,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
96
91
|
class SearchContainerModule {
|
|
97
92
|
}
|
|
98
93
|
SearchContainerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SearchContainerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
99
|
-
SearchContainerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: SearchContainerModule, declarations: [
|
|
100
|
-
|
|
94
|
+
SearchContainerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: SearchContainerModule, declarations: [NgxSearchContainerComponent,
|
|
95
|
+
NgxSearchInputDirective], imports: [CommonModule,
|
|
101
96
|
FormsModule,
|
|
102
97
|
MatButtonModule,
|
|
103
98
|
MatIconModule,
|
|
104
|
-
MatTooltipModule], exports: [
|
|
105
|
-
|
|
99
|
+
MatTooltipModule], exports: [NgxSearchContainerComponent,
|
|
100
|
+
NgxSearchInputDirective] });
|
|
106
101
|
SearchContainerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SearchContainerModule, imports: [CommonModule,
|
|
107
102
|
FormsModule,
|
|
108
103
|
MatButtonModule,
|
|
@@ -119,12 +114,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
119
114
|
MatTooltipModule
|
|
120
115
|
],
|
|
121
116
|
declarations: [
|
|
122
|
-
|
|
123
|
-
|
|
117
|
+
NgxSearchContainerComponent,
|
|
118
|
+
NgxSearchInputDirective
|
|
124
119
|
],
|
|
125
120
|
exports: [
|
|
126
|
-
|
|
127
|
-
|
|
121
|
+
NgxSearchContainerComponent,
|
|
122
|
+
NgxSearchInputDirective
|
|
128
123
|
]
|
|
129
124
|
}]
|
|
130
125
|
}] });
|
|
@@ -133,5 +128,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
133
128
|
* Generated bundle index. Do not edit.
|
|
134
129
|
*/
|
|
135
130
|
|
|
136
|
-
export {
|
|
131
|
+
export { NgxSearchContainerComponent, NgxSearchInputDirective, SearchContainerModule };
|
|
137
132
|
//# sourceMappingURL=hug-ngx-search-container.mjs.map
|
|
@@ -1 +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/search-container.module.ts","../../../projects/search-container/src/hug-ngx-search-container.ts"],"sourcesContent":["import { AfterContentInit, ChangeDetectionStrategy, Component, ContentChild, Directive, ElementRef, EventEmitter, Input, NgZone, Optional, Output, Self, TemplateRef, ViewEncapsulation } from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { Destroy, MediaService } from '@hug/ngx-core';\nimport { BehaviorSubject, distinctUntilChanged, first, Observable, shareReplay, switchMap, takeUntil, tap } from 'rxjs';\n\n@Directive({\n selector: '[searchInput]'\n})\nexport class SearchInputDirective {\n public constructor(\n @Optional() @Self() public ngControl: NgControl,\n private elementRef: ElementRef<HTMLElement>\n ) {\n this.focus();\n }\n\n public focus(): void {\n this.elementRef.nativeElement.focus();\n }\n}\n\n@Component({\n selector: 'search-container',\n templateUrl: './search-container.component.html',\n styleUrls: ['./search-container.component.scss'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SearchContainerComponent extends Destroy 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> | null | undefined;\n\n private _searchInput: SearchInputDirective | undefined;\n\n @ContentChild(SearchInputDirective)\n public set searchInput(searchInput: SearchInputDirective) {\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: MediaService,\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 );\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=\"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=\"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","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatTooltipModule } from '@angular/material/tooltip';\n\nimport { SearchContainerComponent, SearchInputDirective } from './search-container.component';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n MatButtonModule,\n MatIconModule,\n MatTooltipModule\n ],\n declarations: [\n SearchContainerComponent,\n SearchInputDirective\n ],\n exports: [\n SearchContainerComponent,\n SearchInputDirective\n ]\n})\nexport class SearchContainerModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names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AAA,oBAAoB,aARpB,YAAY;QACZ,WAAW;QACX,eAAe;QACf,aAAa;AACb,QAAA,gBAAgB,aAOhB,wBAAwB;QACxB,oBAAoB,CAAA,EAAA,CAAA,CAAA;AAGf,qBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,YAf1B,YAAY;QACZ,WAAW;QACX,eAAe;QACf,aAAa;QACb,gBAAgB,CAAA,EAAA,CAAA,CAAA;2FAWX,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAjBjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE;wBACL,YAAY;wBACZ,WAAW;wBACX,eAAe;wBACf,aAAa;wBACb,gBAAgB;AACnB,qBAAA;AACD,oBAAA,YAAY,EAAE;wBACV,wBAAwB;wBACxB,oBAAoB;AACvB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACL,wBAAwB;wBACxB,oBAAoB;AACvB,qBAAA;AACJ,iBAAA,CAAA;;;ACzBD;;AAEG;;;;"}
|
|
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/search-container.module.ts","../../../projects/search-container/src/hug-ngx-search-container.ts"],"sourcesContent":["import { AfterContentInit, ChangeDetectionStrategy, Component, ContentChild, Directive, ElementRef, EventEmitter, inject, Input, NgZone, Output, TemplateRef, ViewEncapsulation } from '@angular/core';\nimport { NgControl } from '@angular/forms';\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})\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})\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> | null | 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 );\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","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatTooltipModule } from '@angular/material/tooltip';\n\nimport { NgxSearchContainerComponent, NgxSearchInputDirective } from './search-container.component';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n MatButtonModule,\n MatIconModule,\n MatTooltipModule\n ],\n declarations: [\n NgxSearchContainerComponent,\n NgxSearchInputDirective\n ],\n exports: [\n NgxSearchContainerComponent,\n NgxSearchInputDirective\n ]\n})\nexport class SearchContainerModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;MAQa,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,C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AAgB,CAAA,EAAA,CAAA,CAAA;2FAWX,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAjBjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE;wBACL,YAAY;wBACZ,WAAW;wBACX,eAAe;wBACf,aAAa;wBACb,gBAAgB;AACnB,qBAAA;AACD,oBAAA,YAAY,EAAE;wBACV,2BAA2B;wBAC3B,uBAAuB;AAC1B,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACL,2BAA2B;wBAC3B,uBAAuB;AAC1B,qBAAA;AACJ,iBAAA,CAAA;;;ACzBD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,57 +1,51 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
"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"
|
|
2
|
+
"name": "@hug/ngx-search-container",
|
|
3
|
+
"version": "1.1.3",
|
|
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"
|
|
32
15
|
},
|
|
33
|
-
"
|
|
34
|
-
|
|
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
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"lint": "eslint . --fix",
|
|
30
|
+
"test": "ng test search-container",
|
|
31
|
+
"test:ci": "ng test search-container --watch=false --browsers=ChromeHeadless",
|
|
32
|
+
"build:ng": "ng build search-container -c=production",
|
|
33
|
+
"build": "nx build:ng @hug/ngx-search-container --verbose",
|
|
34
|
+
"release": "node -r @swc-node/register ../../scripts/release.ts --projects=@hug/ngx-search-container --verbose",
|
|
35
|
+
"release:dry-run": "npm run release -- --dry-run"
|
|
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.8"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"tslib": "^2.6.3"
|
|
47
|
+
},
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"access": "public"
|
|
35
50
|
}
|
|
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.7"
|
|
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"
|
|
57
51
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { AfterContentInit, ElementRef, EventEmitter, NgZone, TemplateRef } from '@angular/core';
|
|
2
2
|
import { NgControl } from '@angular/forms';
|
|
3
|
-
import {
|
|
3
|
+
import { NgxDestroy, NgxMediaService } from '@hug/ngx-core';
|
|
4
4
|
import { BehaviorSubject, Observable } from 'rxjs';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
|
-
export declare class
|
|
6
|
+
export declare class NgxSearchInputDirective {
|
|
7
7
|
ngControl: NgControl;
|
|
8
|
-
|
|
9
|
-
constructor(
|
|
8
|
+
protected elementRef: ElementRef<HTMLElement>;
|
|
9
|
+
constructor();
|
|
10
10
|
focus(): void;
|
|
11
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
12
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxSearchInputDirective, never>;
|
|
12
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgxSearchInputDirective, "[ngx-search-input]", never, {}, {}, never, never, false>;
|
|
13
13
|
}
|
|
14
|
-
export declare class
|
|
15
|
-
protected mediaService:
|
|
14
|
+
export declare class NgxSearchContainerComponent extends NgxDestroy implements AfterContentInit {
|
|
15
|
+
protected mediaService: NgxMediaService;
|
|
16
16
|
private zone;
|
|
17
17
|
readonly cleared: EventEmitter<void>;
|
|
18
18
|
clearTooltip: string;
|
|
@@ -20,13 +20,13 @@ export declare class SearchContainerComponent extends Destroy implements AfterCo
|
|
|
20
20
|
protected readonly activeSearch$: BehaviorSubject<boolean>;
|
|
21
21
|
protected searchInputValue$: Observable<string> | null | undefined;
|
|
22
22
|
private _searchInput;
|
|
23
|
-
set searchInput(searchInput:
|
|
23
|
+
set searchInput(searchInput: NgxSearchInputDirective);
|
|
24
24
|
private _right;
|
|
25
25
|
set right(value: TemplateRef<unknown> | null);
|
|
26
26
|
get right(): TemplateRef<unknown> | null;
|
|
27
|
-
constructor(mediaService:
|
|
27
|
+
constructor(mediaService: NgxMediaService, zone: NgZone);
|
|
28
28
|
ngAfterContentInit(): void;
|
|
29
29
|
reset(): void;
|
|
30
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
31
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<
|
|
30
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxSearchContainerComponent, never>;
|
|
31
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgxSearchContainerComponent, "ngx-search-container", never, { "clearTooltip": "clearTooltip"; "right": "right"; }, { "cleared": "cleared"; }, ["mobileSearch", "searchInput"], ["*"], false>;
|
|
32
32
|
}
|
|
@@ -7,6 +7,6 @@ import * as i5 from "@angular/material/icon";
|
|
|
7
7
|
import * as i6 from "@angular/material/tooltip";
|
|
8
8
|
export declare class SearchContainerModule {
|
|
9
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<SearchContainerModule, never>;
|
|
10
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<SearchContainerModule, [typeof i1.
|
|
10
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<SearchContainerModule, [typeof i1.NgxSearchContainerComponent, typeof i1.NgxSearchInputDirective], [typeof i2.CommonModule, typeof i3.FormsModule, typeof i4.MatButtonModule, typeof i5.MatIconModule, typeof i6.MatTooltipModule], [typeof i1.NgxSearchContainerComponent, typeof i1.NgxSearchInputDirective]>;
|
|
11
11
|
static ɵinj: i0.ɵɵInjectorDeclaration<SearchContainerModule>;
|
|
12
12
|
}
|