@wizishop/angular-components 14.0.9 → 14.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/angular-components.scss +357 -33
  2. package/esm2020/lib/components/button/button.component.mjs +2 -1
  3. package/esm2020/lib/components/checkbox/checkbox.component.mjs +3 -3
  4. package/esm2020/lib/components/common/label/label.component.mjs +16 -0
  5. package/esm2020/lib/components/common/placeholder/placeholder.component.mjs +16 -0
  6. package/esm2020/lib/components/edit-in-place/edit-in-place.component.mjs +1 -1
  7. package/esm2020/lib/components/optional-disable-container/optional-disable-container.component.mjs +17 -0
  8. package/esm2020/lib/components/selects/option/option-selection-handler.interface.mjs +2 -0
  9. package/esm2020/lib/components/selects/option/option-selection-handler.token.mjs +3 -0
  10. package/esm2020/lib/components/selects/option/option.component.mjs +62 -0
  11. package/esm2020/lib/components/selects/option/select-option.directive.mjs +61 -0
  12. package/esm2020/lib/components/selects/option-call-to-action/option-call-to-action.component.mjs +12 -0
  13. package/esm2020/lib/components/selects/select/select.component.mjs +12 -15
  14. package/esm2020/lib/components/selects/select-in-text/select-in-text.component.mjs +1 -1
  15. package/esm2020/lib/components/selects/select-search-trigger/select-search-trigger.component.mjs +38 -0
  16. package/esm2020/lib/components/selects/select-test/select.component.mjs +216 -0
  17. package/esm2020/lib/components/selects/select-test/value-change.service.mjs +116 -0
  18. package/esm2020/lib/components/shared-components.module.mjs +36 -8
  19. package/esm2020/lib/components/tag-label/tag-label.component.mjs +34 -0
  20. package/esm2020/lib/directives/shared-directives.module.mjs +4 -3
  21. package/esm2020/lib/pipes/select/filter-options.pipe.mjs +19 -0
  22. package/esm2020/lib/pipes/shared-pipes.module.mjs +5 -4
  23. package/esm2020/public-api.mjs +11 -2
  24. package/fesm2015/wizishop-angular-components.mjs +582 -27
  25. package/fesm2015/wizishop-angular-components.mjs.map +1 -1
  26. package/fesm2020/wizishop-angular-components.mjs +580 -27
  27. package/fesm2020/wizishop-angular-components.mjs.map +1 -1
  28. package/lib/components/common/label/label.component.d.ts +8 -0
  29. package/lib/components/common/placeholder/placeholder.component.d.ts +8 -0
  30. package/lib/components/optional-disable-container/optional-disable-container.component.d.ts +7 -0
  31. package/lib/components/selects/option/option-selection-handler.interface.d.ts +7 -0
  32. package/lib/components/selects/option/option-selection-handler.token.d.ts +3 -0
  33. package/lib/components/selects/option/option.component.d.ts +24 -0
  34. package/lib/components/selects/option/select-option.directive.d.ts +21 -0
  35. package/lib/components/selects/option-call-to-action/option-call-to-action.component.d.ts +6 -0
  36. package/lib/components/selects/select/select.component.d.ts +3 -6
  37. package/lib/components/selects/select-search-trigger/select-search-trigger.component.d.ts +14 -0
  38. package/lib/components/selects/select-test/select.component.d.ts +55 -0
  39. package/lib/components/selects/select-test/value-change.service.d.ts +30 -0
  40. package/lib/components/shared-components.module.d.ts +42 -35
  41. package/lib/components/tag-label/tag-label.component.d.ts +12 -0
  42. package/lib/directives/shared-directives.module.d.ts +4 -3
  43. package/lib/pipes/select/filter-options.pipe.d.ts +7 -0
  44. package/lib/pipes/shared-pipes.module.d.ts +6 -5
  45. package/package.json +1 -1
  46. package/public-api.d.ts +10 -1
  47. package/wizishop-angular-components-14.1.2.tgz +0 -0
  48. package/esm2020/lib/components/label/label.component.mjs +0 -34
  49. package/lib/components/label/label.component.d.ts +0 -12
  50. package/wizishop-angular-components-14.0.9.tgz +0 -0
@@ -1,7 +1,7 @@
1
1
  import * as i1$2 from '@wizishop/ng-wizi-bulma';
2
2
  import { NwbAllModule, NwbFilterGroup } from '@wizishop/ng-wizi-bulma';
3
3
  import * as i0 from '@angular/core';
4
- import { Component, ViewEncapsulation, Input, EventEmitter, Directive, Output, HostListener, Injectable, NgModule, Inject, Pipe, ContentChildren, ViewChild } from '@angular/core';
4
+ import { Component, ViewEncapsulation, Input, EventEmitter, Directive, Output, HostListener, Injectable, InjectionToken, NgModule, Inject, Pipe, ContentChildren, ViewChild, ChangeDetectionStrategy, HostBinding, ContentChild } from '@angular/core';
5
5
  import * as i1 from '@angular/common';
6
6
  import { CommonModule, DOCUMENT } from '@angular/common';
7
7
  import * as i2 from '@angular/forms';
@@ -9,7 +9,7 @@ import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/fo
9
9
  import * as i4 from 'ngx-perfect-scrollbar';
10
10
  import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
11
11
  import { Subject, merge, fromEvent, ReplaySubject, interval } from 'rxjs';
12
- import { takeUntil, debounceTime, distinctUntilChanged, tap, map, takeWhile } from 'rxjs/operators';
12
+ import { takeUntil, debounceTime, distinctUntilChanged, tap, map, takeWhile, startWith } from 'rxjs/operators';
13
13
  import * as i1$1 from '@angular/cdk/overlay';
14
14
  import { CdkTableModule } from '@angular/cdk/table';
15
15
  import { trigger, transition, style, animate, state } from '@angular/animations';
@@ -18,6 +18,7 @@ import * as i1$3 from '@ngx-translate/core';
18
18
  import { TranslateModule } from '@ngx-translate/core';
19
19
  import * as i2$1 from '@angular/router';
20
20
  import { RouterModule } from '@angular/router';
21
+ import { DOWN_ARROW, UP_ARROW, LEFT_ARROW, RIGHT_ARROW, ENTER, SPACE, hasModifierKey, ESCAPE } from '@angular/cdk/keycodes';
21
22
 
22
23
  class LoaderComponent {
23
24
  constructor() {
@@ -335,11 +336,71 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
335
336
  type: Output
336
337
  }] } });
337
338
 
338
- const directives$1 = [DebounceKeyupDirective, AbstractDebounceDirective, AutoHideDirective, ZindexToggleDirective, VarDirective, KeypressEnterDirective];
339
+ const OPTION_SELECTION_HANDLER = new InjectionToken('OPTION_SELECTION_HANDLER');
340
+
341
+ // todo create a select module and in the select-option.directive.ts
342
+ class SelectOptionDirective {
343
+ constructor(contentRef) {
344
+ this.contentRef = contentRef;
345
+ this.disabled = false;
346
+ this.selected = false;
347
+ this.selectedChange = new EventEmitter();
348
+ }
349
+ onClick() {
350
+ this.onSelectOption();
351
+ }
352
+ ngOnInit() {
353
+ }
354
+ onSelectOption() {
355
+ if (this.disabled) {
356
+ return;
357
+ }
358
+ this.selected = !this.selected;
359
+ this.selectedChange.emit(this.value);
360
+ }
361
+ getValue() {
362
+ return this.value;
363
+ }
364
+ setValue(value) {
365
+ this.value = value;
366
+ }
367
+ isSelected() {
368
+ return this.selected;
369
+ }
370
+ setSelected(selected) {
371
+ this.selected = selected;
372
+ this.selectedChange.emit(this.value);
373
+ }
374
+ getContentRef() {
375
+ return this.contentRef;
376
+ }
377
+ }
378
+ SelectOptionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SelectOptionDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
379
+ SelectOptionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.7", type: SelectOptionDirective, selector: "[selectOption]", inputs: { disabled: "disabled", value: "value", selected: "selected" }, outputs: { selectedChange: "selectedChange" }, host: { listeners: { "click": "onClick()" } }, providers: [{ provide: OPTION_SELECTION_HANDLER, useExisting: SelectOptionDirective }], ngImport: i0 });
380
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SelectOptionDirective, decorators: [{
381
+ type: Directive,
382
+ args: [{
383
+ selector: '[selectOption]',
384
+ providers: [{ provide: OPTION_SELECTION_HANDLER, useExisting: SelectOptionDirective }]
385
+ }]
386
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { onClick: [{
387
+ type: HostListener,
388
+ args: ['click']
389
+ }], disabled: [{
390
+ type: Input
391
+ }], value: [{
392
+ type: Input
393
+ }], selected: [{
394
+ type: Input
395
+ }], selectedChange: [{
396
+ type: Output
397
+ }] } });
398
+
399
+ const directives$1 = [DebounceKeyupDirective, AbstractDebounceDirective, AutoHideDirective, ZindexToggleDirective, VarDirective, KeypressEnterDirective, SelectOptionDirective];
339
400
  class SharedDirectives {
340
401
  }
341
402
  SharedDirectives.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SharedDirectives, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
342
- SharedDirectives.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.7", ngImport: i0, type: SharedDirectives, declarations: [DebounceKeyupDirective, AbstractDebounceDirective, AutoHideDirective, ZindexToggleDirective, VarDirective, KeypressEnterDirective], imports: [CommonModule, FormsModule], exports: [DebounceKeyupDirective, AbstractDebounceDirective, AutoHideDirective, ZindexToggleDirective, VarDirective, KeypressEnterDirective] });
403
+ SharedDirectives.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.7", ngImport: i0, type: SharedDirectives, declarations: [DebounceKeyupDirective, AbstractDebounceDirective, AutoHideDirective, ZindexToggleDirective, VarDirective, KeypressEnterDirective, SelectOptionDirective], imports: [CommonModule, FormsModule], exports: [DebounceKeyupDirective, AbstractDebounceDirective, AutoHideDirective, ZindexToggleDirective, VarDirective, KeypressEnterDirective, SelectOptionDirective] });
343
404
  SharedDirectives.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SharedDirectives, imports: [CommonModule, FormsModule] });
344
405
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SharedDirectives, decorators: [{
345
406
  type: NgModule,
@@ -366,8 +427,8 @@ class CheckboxComponent {
366
427
  this.label = '';
367
428
  this.alone = false;
368
429
  this.checked = false;
369
- this.hasInput = false;
370
- this.inputPlaceholder = '';
430
+ this.hasInput = false; // todo remove from it ! That is not a part of a checkbox
431
+ this.inputPlaceholder = ''; // todo remove from it ! That is not a part of a checkbox
371
432
  this.id = '';
372
433
  this.whiteSpace = true;
373
434
  this.disabled = false;
@@ -1037,6 +1098,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
1037
1098
 
1038
1099
  class ButtonComponent {
1039
1100
  constructor() {
1101
+ // todo add button type (ex: for submit and check if it works with template driven forms)
1040
1102
  this.extraClasses = 'is-info'; // todo make a list of existing class
1041
1103
  this.label = '';
1042
1104
  this.icon = '';
@@ -1369,7 +1431,7 @@ const inOutX = trigger('inOutXAnimation', [
1369
1431
  ])
1370
1432
  ]);
1371
1433
 
1372
- class LabelComponent {
1434
+ class TagLabelComponent {
1373
1435
  constructor() {
1374
1436
  this.index = 0;
1375
1437
  this.label = '';
@@ -1384,11 +1446,11 @@ class LabelComponent {
1384
1446
  });
1385
1447
  }
1386
1448
  }
1387
- LabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: LabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1388
- LabelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.7", type: LabelComponent, selector: "wac-label", inputs: { index: "index", label: "label", deleted: "deleted" }, outputs: { onDeleteLabel: "onDeleteLabel" }, ngImport: i0, template: "<div *ngIf=\"!deleted\" [@inOutXAnimation] class=\"wac-label\">\n <div class=\"wac-label__wrapper\">\n {{ label }}\n <i class=\"far fa-times\" (click)=\"deleteLabel()\"></i>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], animations: [inOutX], encapsulation: i0.ViewEncapsulation.None });
1389
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: LabelComponent, decorators: [{
1449
+ TagLabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: TagLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1450
+ TagLabelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.7", type: TagLabelComponent, selector: "wac-tag-label", inputs: { index: "index", label: "label", deleted: "deleted" }, outputs: { onDeleteLabel: "onDeleteLabel" }, ngImport: i0, template: "<div *ngIf=\"!deleted\" [@inOutXAnimation] class=\"wac-tag-label\">\n <div class=\"wac-label__wrapper\">\n {{ label }}\n <i class=\"far fa-times\" (click)=\"deleteLabel()\"></i>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], animations: [inOutX], encapsulation: i0.ViewEncapsulation.None });
1451
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: TagLabelComponent, decorators: [{
1390
1452
  type: Component,
1391
- args: [{ selector: 'wac-label', encapsulation: ViewEncapsulation.None, animations: [inOutX], template: "<div *ngIf=\"!deleted\" [@inOutXAnimation] class=\"wac-label\">\n <div class=\"wac-label__wrapper\">\n {{ label }}\n <i class=\"far fa-times\" (click)=\"deleteLabel()\"></i>\n </div>\n</div>\n" }]
1453
+ args: [{ selector: 'wac-tag-label', encapsulation: ViewEncapsulation.None, animations: [inOutX], template: "<div *ngIf=\"!deleted\" [@inOutXAnimation] class=\"wac-tag-label\">\n <div class=\"wac-label__wrapper\">\n {{ label }}\n <i class=\"far fa-times\" (click)=\"deleteLabel()\"></i>\n </div>\n</div>\n" }]
1392
1454
  }], ctorParameters: function () { return []; }, propDecorators: { index: [{
1393
1455
  type: Input
1394
1456
  }], label: [{
@@ -2908,8 +2970,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
2908
2970
  }] });
2909
2971
 
2910
2972
  class SelectComponent {
2911
- constructor(translateService) {
2912
- this.translateService = translateService;
2973
+ constructor() {
2913
2974
  this.search = false;
2914
2975
  this.searchValue = '';
2915
2976
  this.searchValueChange = new EventEmitter();
@@ -2937,8 +2998,6 @@ class SelectComponent {
2937
2998
  get callToAction() {
2938
2999
  return this._calllToAction;
2939
3000
  }
2940
- ngOnInit() {
2941
- }
2942
3001
  onClose() {
2943
3002
  this.openCategories = false;
2944
3003
  }
@@ -2994,12 +3053,12 @@ class SelectComponent {
2994
3053
  this.onTouch = fn;
2995
3054
  }
2996
3055
  }
2997
- SelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SelectComponent, deps: [{ token: i1$3.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
3056
+ SelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2998
3057
  SelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.7", type: SelectComponent, selector: "wac-select", inputs: { items: "items", placeholder: "placeholder", label: "label", maxWidthItems: "maxWidthItems", search: "search", searchValue: "searchValue", type: "type", callToAction: "callToAction", maxWidth: "maxWidth", disabled: "disabled" }, outputs: { searchValueChange: "searchValueChange", selectValue: "selectValue", clickOnCallToAction: "clickOnCallToAction" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: SelectComponent, multi: true }], viewQueries: [{ propertyName: "searchElement", first: true, predicate: ["search"], descendants: true }], ngImport: i0, template: "<p *ngIf=\"label\" [innerHTML]=\"label\" class=\"wac-select__label\"></p>\n\n<div class=\"wac-select\" wzAutoHide (clickOutside)=\"onClose()\" [ngStyle]=\"{ 'max-width': maxWidth }\" [zIndexToggle]=\"openCategories\">\n\n <div class=\"wac-select__current\" [ngClass]=\"{ 'select-disabled' : disabled }\" (click)=\"!disabled && openCategories = !openCategories\" *ngIf=\"!search\">\n <span *ngIf=\"indexItemSelected !== -1\" class=\"icon\" [innerHTML]=\"items[indexItemSelected].icon\"></span>\n <span [innerHTML]=\"indexItemSelected !== -1 ? items[indexItemSelected].name : placeholder\"></span><span><i class=\"fas fa-chevron-down\"></i></span>\n </div>\n\n <div class=\"wac-select__current wac-select__current--withSearch\" [ngClass]=\"{ 'select-disabled' : disabled, 'open-search': openCategories }\" *ngIf=\"search\">\n <div class=\"wac-select__current__search\" *ngIf=\"openCategories && !disabled\">\n <i class=\"far fa-search\"></i>\n <input #search type=\"text\" [(ngModel)]=\"searchValue\" (ngModelChange)=\"onSearcheValueChange()\" (keypressEnter)=\"onClickCallToAction()\"/>\n </div>\n <span (click)=\"openCategories = !openCategories;\" *ngIf=\"items[indexItemSelected]?.icon && !openCategories\" class=\"icon\" [innerHTML]=\"items[indexItemSelected].icon\"></span>\n <span (click)=\"showCategories()\" [innerHTML]=\"items[indexItemSelected]?.name ? items[indexItemSelected].name : placeholder\"></span>\n <span (click)=\"openCategories = !openCategories;\"><i class=\"fas fa-chevron-down\"></i></span>\n </div>\n\n <div class=\"wac-select__content\" *ngIf=\"!disabled\" [ngClass]=\"{ hidden: !openCategories, open: type === 'open' }\" [ngStyle]=\"{ 'max-width': maxWidthItems }\">\n <perfect-scrollbar [config]=\"{ suppressScrollX: true }\" *ngIf=\"items.length\">\n\n <div *ngIf=\"callToAction\" class=\"wac-select__content__cta\">\n <div (click)=\"onClickCallToAction()\">\n <i *ngIf=\"callToAction.icon\" [classList]=\"callToAction.icon\"></i><strong *ngIf=\"callToAction.boldText\">{{ callToAction.boldText }}</strong\n ><span>{{ callToAction?.name }}</span>\n </div>\n </div>\n\n <div\n *ngFor=\"let item of items | selectFilters: searchValue; let index = index;\"\n (click)=\"onClose()\"\n class=\"wac-select__content__item\"\n >\n <div [ngClass]=\"{ selected: item.selected }\" (click)=\"onSelectItem(item.id)\">\n <span class=\"icon\" [innerHTML]=\"item.icon\" *ngIf=\"item.icon\"></span>{{ item.name }}\n </div>\n </div>\n\n </perfect-scrollbar>\n\n <div *ngIf=\"!(items | selectFilters: searchValue)?.length\" class=\"wac-select__content__empty\">\n <span>{{'wac.datatable.noresult' | translate}}</span>\n </div>\n\n </div>\n</div>", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: AutoHideDirective, selector: "[wzAutoHide]", inputs: ["triggerElement", "forceOn"], outputs: ["clickOutside"] }, { kind: "directive", type: ZindexToggleDirective, selector: "[zIndexToggle]", inputs: ["zIndexToggle"], outputs: ["onEventChange"] }, { kind: "directive", type: KeypressEnterDirective, selector: "[keypressEnter]", outputs: ["keypressEnter"] }, { kind: "component", type: i4.PerfectScrollbarComponent, selector: "perfect-scrollbar", inputs: ["disabled", "usePSClass", "autoPropagation", "scrollIndicators", "config"], outputs: ["psScrollY", "psScrollX", "psScrollUp", "psScrollDown", "psScrollLeft", "psScrollRight", "psYReachEnd", "psYReachStart", "psXReachEnd", "psXReachStart"], exportAs: ["ngxPerfectScrollbar"] }, { kind: "pipe", type: i1$3.TranslatePipe, name: "translate" }, { kind: "pipe", type: SelectFiltersPipe, name: "selectFilters" }] });
2999
3058
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SelectComponent, decorators: [{
3000
3059
  type: Component,
3001
3060
  args: [{ selector: 'wac-select', providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: SelectComponent, multi: true }], template: "<p *ngIf=\"label\" [innerHTML]=\"label\" class=\"wac-select__label\"></p>\n\n<div class=\"wac-select\" wzAutoHide (clickOutside)=\"onClose()\" [ngStyle]=\"{ 'max-width': maxWidth }\" [zIndexToggle]=\"openCategories\">\n\n <div class=\"wac-select__current\" [ngClass]=\"{ 'select-disabled' : disabled }\" (click)=\"!disabled && openCategories = !openCategories\" *ngIf=\"!search\">\n <span *ngIf=\"indexItemSelected !== -1\" class=\"icon\" [innerHTML]=\"items[indexItemSelected].icon\"></span>\n <span [innerHTML]=\"indexItemSelected !== -1 ? items[indexItemSelected].name : placeholder\"></span><span><i class=\"fas fa-chevron-down\"></i></span>\n </div>\n\n <div class=\"wac-select__current wac-select__current--withSearch\" [ngClass]=\"{ 'select-disabled' : disabled, 'open-search': openCategories }\" *ngIf=\"search\">\n <div class=\"wac-select__current__search\" *ngIf=\"openCategories && !disabled\">\n <i class=\"far fa-search\"></i>\n <input #search type=\"text\" [(ngModel)]=\"searchValue\" (ngModelChange)=\"onSearcheValueChange()\" (keypressEnter)=\"onClickCallToAction()\"/>\n </div>\n <span (click)=\"openCategories = !openCategories;\" *ngIf=\"items[indexItemSelected]?.icon && !openCategories\" class=\"icon\" [innerHTML]=\"items[indexItemSelected].icon\"></span>\n <span (click)=\"showCategories()\" [innerHTML]=\"items[indexItemSelected]?.name ? items[indexItemSelected].name : placeholder\"></span>\n <span (click)=\"openCategories = !openCategories;\"><i class=\"fas fa-chevron-down\"></i></span>\n </div>\n\n <div class=\"wac-select__content\" *ngIf=\"!disabled\" [ngClass]=\"{ hidden: !openCategories, open: type === 'open' }\" [ngStyle]=\"{ 'max-width': maxWidthItems }\">\n <perfect-scrollbar [config]=\"{ suppressScrollX: true }\" *ngIf=\"items.length\">\n\n <div *ngIf=\"callToAction\" class=\"wac-select__content__cta\">\n <div (click)=\"onClickCallToAction()\">\n <i *ngIf=\"callToAction.icon\" [classList]=\"callToAction.icon\"></i><strong *ngIf=\"callToAction.boldText\">{{ callToAction.boldText }}</strong\n ><span>{{ callToAction?.name }}</span>\n </div>\n </div>\n\n <div\n *ngFor=\"let item of items | selectFilters: searchValue; let index = index;\"\n (click)=\"onClose()\"\n class=\"wac-select__content__item\"\n >\n <div [ngClass]=\"{ selected: item.selected }\" (click)=\"onSelectItem(item.id)\">\n <span class=\"icon\" [innerHTML]=\"item.icon\" *ngIf=\"item.icon\"></span>{{ item.name }}\n </div>\n </div>\n\n </perfect-scrollbar>\n\n <div *ngIf=\"!(items | selectFilters: searchValue)?.length\" class=\"wac-select__content__empty\">\n <span>{{'wac.datatable.noresult' | translate}}</span>\n </div>\n\n </div>\n</div>" }]
3002
- }], ctorParameters: function () { return [{ type: i1$3.TranslateService }]; }, propDecorators: { items: [{
3061
+ }], ctorParameters: function () { return []; }, propDecorators: { items: [{
3003
3062
  type: Input
3004
3063
  }], placeholder: [{
3005
3064
  type: Input
@@ -3920,7 +3979,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
3920
3979
  }]
3921
3980
  }] });
3922
3981
 
3923
- const exportedPipes = [FormatObjectToRecursifTreePipe, FormatObjectToSimpleTreePipe];
3982
+ class FilterOptionsPipe {
3983
+ transform(options, searchValue, ...args) {
3984
+ const regexp = new RegExp(searchValue, 'i');
3985
+ return options.filter(option => {
3986
+ return args.some(arg => regexp.test(option[arg]));
3987
+ });
3988
+ }
3989
+ }
3990
+ FilterOptionsPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: FilterOptionsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3991
+ FilterOptionsPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.0.7", ngImport: i0, type: FilterOptionsPipe, name: "filterOptions" });
3992
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: FilterOptionsPipe, decorators: [{
3993
+ type: Pipe,
3994
+ args: [{
3995
+ name: 'filterOptions'
3996
+ }]
3997
+ }] });
3998
+
3999
+ const exportedPipes = [FormatObjectToRecursifTreePipe, FormatObjectToSimpleTreePipe, FilterOptionsPipe];
3924
4000
  const pipes = [
3925
4001
  SelectFiltersPipe,
3926
4002
  AreAllOptionsSelectedPipe
@@ -3928,8 +4004,8 @@ const pipes = [
3928
4004
  class SharedPipes {
3929
4005
  }
3930
4006
  SharedPipes.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SharedPipes, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3931
- SharedPipes.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.7", ngImport: i0, type: SharedPipes, declarations: [FormatObjectToRecursifTreePipe, FormatObjectToSimpleTreePipe, SelectFiltersPipe,
3932
- AreAllOptionsSelectedPipe], imports: [CommonModule, FormsModule], exports: [FormatObjectToRecursifTreePipe, FormatObjectToSimpleTreePipe, SelectFiltersPipe,
4007
+ SharedPipes.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.7", ngImport: i0, type: SharedPipes, declarations: [FormatObjectToRecursifTreePipe, FormatObjectToSimpleTreePipe, FilterOptionsPipe, SelectFiltersPipe,
4008
+ AreAllOptionsSelectedPipe], imports: [CommonModule, FormsModule], exports: [FormatObjectToRecursifTreePipe, FormatObjectToSimpleTreePipe, FilterOptionsPipe, SelectFiltersPipe,
3933
4009
  AreAllOptionsSelectedPipe] });
3934
4010
  SharedPipes.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SharedPipes, imports: [CommonModule, FormsModule] });
3935
4011
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SharedPipes, decorators: [{
@@ -3964,6 +4040,464 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
3964
4040
  }]
3965
4041
  }] });
3966
4042
 
4043
+ class OptionalDisableContainerComponent {
4044
+ constructor() {
4045
+ this.disabled = false;
4046
+ }
4047
+ }
4048
+ OptionalDisableContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: OptionalDisableContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4049
+ OptionalDisableContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.7", type: OptionalDisableContainerComponent, selector: "wac-optional-disable-container", inputs: { disabled: "disabled" }, ngImport: i0, template: "<ng-content></ng-content>\n<div class=\"wac-optional-disable-container__disabledSection\" *ngIf=\"disabled\"></div>", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
4050
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: OptionalDisableContainerComponent, decorators: [{
4051
+ type: Component,
4052
+ args: [{ selector: 'wac-optional-disable-container', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>\n<div class=\"wac-optional-disable-container__disabledSection\" *ngIf=\"disabled\"></div>" }]
4053
+ }], ctorParameters: function () { return []; }, propDecorators: { disabled: [{
4054
+ type: Input
4055
+ }] } });
4056
+
4057
+ class ValueChangeService {
4058
+ constructor() {
4059
+ this.valueChange$ = new Subject();
4060
+ this.indexSelectedOption = null;
4061
+ this.resetListeners$ = new Subject();
4062
+ }
4063
+ set value(value) {
4064
+ this._value = value;
4065
+ this.handleValueChange();
4066
+ this.valueChange$.next(value);
4067
+ }
4068
+ get value() {
4069
+ return this._value;
4070
+ }
4071
+ handleSelectOptionsChange(optionChildren, value) {
4072
+ this.resetListeners$.next();
4073
+ this.optionChildren = optionChildren;
4074
+ this._value = value;
4075
+ this.indexSelectedOption = null;
4076
+ this.handleInitialSelectedOption();
4077
+ this.handleSelectedOptionsEvent();
4078
+ }
4079
+ assignValue(value) {
4080
+ this._value = value;
4081
+ this.handleValueChange();
4082
+ }
4083
+ handleValueChange() {
4084
+ this.changeSelectedOption();
4085
+ this.updateSelectPlaceholder();
4086
+ }
4087
+ selectNextOption() {
4088
+ if (this.indexSelectedOption + 1 >= this.optionChildren.length) {
4089
+ return;
4090
+ }
4091
+ if (this.indexSelectedOption === null) {
4092
+ this.indexSelectedOption = 0;
4093
+ }
4094
+ else {
4095
+ this.indexSelectedOption = this.indexSelectedOption + 1;
4096
+ }
4097
+ this.assignValue(this.optionChildren.get(this.indexSelectedOption).value);
4098
+ }
4099
+ selectPreviousOption() {
4100
+ if (!this.indexSelectedOption) {
4101
+ this.indexSelectedOption = null;
4102
+ this.assignValue(null);
4103
+ return;
4104
+ }
4105
+ this.indexSelectedOption = this.indexSelectedOption - 1;
4106
+ this.assignValue(this.optionChildren.get(this.indexSelectedOption).value);
4107
+ }
4108
+ handleInitialSelectedOption() {
4109
+ setTimeout(() => {
4110
+ if (!this.value) {
4111
+ this.findInitialSelectedOption();
4112
+ return;
4113
+ }
4114
+ this.handleValueChange();
4115
+ }, 0);
4116
+ }
4117
+ findInitialSelectedOption() {
4118
+ const selectedOption = this.getSelectedOptionComponent();
4119
+ if (!selectedOption) {
4120
+ return;
4121
+ }
4122
+ this.value = selectedOption.value;
4123
+ }
4124
+ handleSelectedOptionsEvent() {
4125
+ this.optionSelectedChangeListeners().subscribe((selecteEvent) => {
4126
+ this.value = selecteEvent.value;
4127
+ });
4128
+ }
4129
+ updateSelectPlaceholder() {
4130
+ if (!this.value) {
4131
+ this.selectedOptionContent = null;
4132
+ return;
4133
+ }
4134
+ const selectedOption = this.getSelectedOptionComponent();
4135
+ this.selectedOptionContent = (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.getContentRef().nativeElement.innerHTML) || undefined;
4136
+ }
4137
+ getSelectedOptionComponent() {
4138
+ return this.optionChildren.find((option) => option.selected);
4139
+ }
4140
+ optionSelectedChangeListeners() {
4141
+ const selectedChange$ = this.optionChildren.map((option) => {
4142
+ return option.selectedChange.pipe(map((value) => {
4143
+ return {
4144
+ value
4145
+ };
4146
+ }));
4147
+ });
4148
+ return merge(...selectedChange$).pipe(takeUntil(this.resetListeners$));
4149
+ }
4150
+ changeSelectedOption() {
4151
+ this.optionChildren.forEach((optionComponent, index) => {
4152
+ optionComponent.selected = this.value == undefined ? false : optionComponent.value === this.value;
4153
+ if (optionComponent.selected) {
4154
+ this.indexSelectedOption = index;
4155
+ }
4156
+ });
4157
+ }
4158
+ ngOnDestroy() {
4159
+ this.resetListeners$.next();
4160
+ this.resetListeners$.complete();
4161
+ }
4162
+ }
4163
+ ValueChangeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: ValueChangeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4164
+ ValueChangeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: ValueChangeService });
4165
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: ValueChangeService, decorators: [{
4166
+ type: Injectable
4167
+ }], ctorParameters: function () { return []; } });
4168
+
4169
+ class SelectSearchTriggerComponent {
4170
+ constructor() {
4171
+ this.searchValue = '';
4172
+ this.searchValueChange = new EventEmitter();
4173
+ this.searchInputKeyEnterPressed = new EventEmitter();
4174
+ }
4175
+ onSearchValueChange() {
4176
+ this.searchValueChange.emit(this.searchValue);
4177
+ }
4178
+ onKeypressEnter() {
4179
+ this.searchInputKeyEnterPressed.emit();
4180
+ }
4181
+ setFocus() {
4182
+ setTimeout(() => {
4183
+ this.searchInput.nativeElement.focus();
4184
+ }, 0);
4185
+ }
4186
+ }
4187
+ SelectSearchTriggerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SelectSearchTriggerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4188
+ SelectSearchTriggerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.7", type: SelectSearchTriggerComponent, selector: "wac-select-search-trigger", inputs: { searchValue: "searchValue" }, outputs: { searchValueChange: "searchValueChange", searchInputKeyEnterPressed: "searchInputKeyEnterPressed" }, viewQueries: [{ propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true }], ngImport: i0, template: "<div class=\"wac-select-seacrh-trigger\">\n <i class=\"far fa-search\"></i>\n <input #searchInput type=\"text\" (click)=\"$event.stopPropagation()\" [(ngModel)]=\"searchValue\" (ngModelChange)=\"onSearchValueChange()\" (keypressEnter)=\"onKeypressEnter()\"/>\n</div>", dependencies: [{ kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: KeypressEnterDirective, selector: "[keypressEnter]", outputs: ["keypressEnter"] }], encapsulation: i0.ViewEncapsulation.None });
4189
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SelectSearchTriggerComponent, decorators: [{
4190
+ type: Component,
4191
+ args: [{ selector: 'wac-select-search-trigger', encapsulation: ViewEncapsulation.None, template: "<div class=\"wac-select-seacrh-trigger\">\n <i class=\"far fa-search\"></i>\n <input #searchInput type=\"text\" (click)=\"$event.stopPropagation()\" [(ngModel)]=\"searchValue\" (ngModelChange)=\"onSearchValueChange()\" (keypressEnter)=\"onKeypressEnter()\"/>\n</div>" }]
4192
+ }], ctorParameters: function () { return []; }, propDecorators: { searchValue: [{
4193
+ type: Input
4194
+ }], searchValueChange: [{
4195
+ type: Output
4196
+ }], searchInputKeyEnterPressed: [{
4197
+ type: Output
4198
+ }], searchInput: [{
4199
+ type: ViewChild,
4200
+ args: ['searchInput']
4201
+ }] } });
4202
+
4203
+ class LabelComponent {
4204
+ constructor() { }
4205
+ ngOnInit() {
4206
+ }
4207
+ }
4208
+ LabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: LabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4209
+ LabelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.7", type: LabelComponent, selector: "wac-label", host: { classAttribute: "wac-label" }, ngImport: i0, template: "<ng-content></ng-content>" });
4210
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: LabelComponent, decorators: [{
4211
+ type: Component,
4212
+ args: [{ selector: 'wac-label', host: {
4213
+ 'class': 'wac-label'
4214
+ }, template: "<ng-content></ng-content>" }]
4215
+ }], ctorParameters: function () { return []; } });
4216
+
4217
+ class SelectTestComponent {
4218
+ constructor(valueChangeService) {
4219
+ this.valueChangeService = valueChangeService;
4220
+ //! Refacto improve sroll on mobile, see with Pauline
4221
+ // todo handle multiple selection ?
4222
+ this.role = 'combobox';
4223
+ this.valueChange = new EventEmitter();
4224
+ this.disabled = false;
4225
+ this._openPanel = false;
4226
+ this.openPanelChange = new EventEmitter();
4227
+ this.enableSearch = false;
4228
+ this.isDestroyed$ = new Subject();
4229
+ // ControlValueAccessor methods
4230
+ this.onChange = () => { };
4231
+ this.onTouch = () => { }; // todo call it on blur and on close if not disable and opened
4232
+ }
4233
+ set value(value) {
4234
+ this._value = value;
4235
+ if (!this.optionChildren) {
4236
+ return;
4237
+ }
4238
+ this.valueChangeService.assignValue(value);
4239
+ }
4240
+ get value() {
4241
+ return this._value;
4242
+ }
4243
+ /** Whether the component is required. */
4244
+ get required() {
4245
+ var _a;
4246
+ return (_a = this._required) !== null && _a !== void 0 ? _a : false;
4247
+ }
4248
+ set required(value) {
4249
+ this._required = value;
4250
+ }
4251
+ get selectedOptionContent() {
4252
+ return this.valueChangeService.selectedOptionContent;
4253
+ }
4254
+ ;
4255
+ set keepPanelOpen(keepPanelOpen) {
4256
+ this.openPanel = keepPanelOpen;
4257
+ this._keepPanelOpen = keepPanelOpen;
4258
+ }
4259
+ get keepPanelOpen() {
4260
+ return this._keepPanelOpen;
4261
+ }
4262
+ set openPanel(openPanel) {
4263
+ var _a;
4264
+ const wasOpen = this._openPanel;
4265
+ this._openPanel = this.keepPanelOpen || openPanel;
4266
+ if (openPanel) {
4267
+ (_a = this.customSearchTrigger) === null || _a === void 0 ? void 0 : _a.setFocus();
4268
+ }
4269
+ if (wasOpen) {
4270
+ this.onTouch(this.value);
4271
+ }
4272
+ }
4273
+ get openPanel() {
4274
+ return this._openPanel;
4275
+ }
4276
+ ngOnInit() {
4277
+ this.handleValueChange();
4278
+ }
4279
+ ngAfterViewInit() {
4280
+ this.handleOptionChildren();
4281
+ }
4282
+ handleValueChange() {
4283
+ this.valueChangeService.valueChange$.pipe(takeUntil(this.isDestroyed$)).subscribe(value => {
4284
+ this._value = value;
4285
+ this.valueChange.emit(this.value);
4286
+ this.onChange(this.value);
4287
+ this.onClosePanel();
4288
+ });
4289
+ }
4290
+ handleOptionChildren() {
4291
+ this.optionChildren.changes.pipe(takeUntil(this.isDestroyed$), startWith(this.optionChildren)).subscribe(optionChildren => {
4292
+ this.valueChangeService.handleSelectOptionsChange(optionChildren, this.value);
4293
+ });
4294
+ }
4295
+ onTogglePanel() {
4296
+ this.openPanel = !this.openPanel;
4297
+ this.openPanelChange.emit(this.openPanel);
4298
+ }
4299
+ onClosePanel() {
4300
+ this.openPanel = false;
4301
+ this.openPanelChange.emit(this.openPanel);
4302
+ }
4303
+ /** Handles all keydown events on the select. */
4304
+ _handleKeydown(event) {
4305
+ if (this.disabled) {
4306
+ return;
4307
+ }
4308
+ this.openPanel ? this._handleOpenKeydown(event) : this._handleClosedKeydown(event);
4309
+ }
4310
+ /** Handles keyboard events while the select is closed. */
4311
+ _handleClosedKeydown(event) {
4312
+ const keyCode = event.keyCode;
4313
+ const isArrowKey = keyCode === DOWN_ARROW ||
4314
+ keyCode === UP_ARROW ||
4315
+ keyCode === LEFT_ARROW ||
4316
+ keyCode === RIGHT_ARROW;
4317
+ const isOpenKey = keyCode === ENTER || keyCode === SPACE;
4318
+ // Open the select on ALT + arrow key to match the native <select>
4319
+ if ((isOpenKey && !hasModifierKey(event)) ||
4320
+ (event.altKey && isArrowKey)) {
4321
+ event.preventDefault(); // prevents the page from scrolling down when pressing space
4322
+ this.openPanel = true;
4323
+ return;
4324
+ }
4325
+ if (!isArrowKey) {
4326
+ return;
4327
+ }
4328
+ event.preventDefault(); // prevents the page from scrolling
4329
+ // select the next option on arrow key down
4330
+ if (keyCode === DOWN_ARROW || keyCode === RIGHT_ARROW) {
4331
+ this.valueChangeService.selectNextOption();
4332
+ return;
4333
+ }
4334
+ this.valueChangeService.selectPreviousOption();
4335
+ }
4336
+ /** Handles keyboard events when the selected is open. */
4337
+ _handleOpenKeydown(event) {
4338
+ const keyCode = event.keyCode;
4339
+ const isArrowKey = keyCode === DOWN_ARROW ||
4340
+ keyCode === UP_ARROW ||
4341
+ keyCode === LEFT_ARROW ||
4342
+ keyCode === RIGHT_ARROW;
4343
+ const isEscapeKey = keyCode === ESCAPE || keyCode === ENTER || keyCode === SPACE;
4344
+ if ((isArrowKey && event.altKey) || isEscapeKey) {
4345
+ // Close the select on ALT + arrow key to match the native <select>
4346
+ event.preventDefault();
4347
+ this.openPanel = false;
4348
+ return;
4349
+ }
4350
+ if (!isArrowKey) {
4351
+ return;
4352
+ }
4353
+ event.preventDefault(); // prevents the page from scrolling
4354
+ // select the next option on arrow key down
4355
+ if (keyCode === DOWN_ARROW || keyCode === RIGHT_ARROW) {
4356
+ this.valueChangeService.selectNextOption();
4357
+ return;
4358
+ }
4359
+ this.valueChangeService.selectPreviousOption();
4360
+ }
4361
+ writeValue(value) {
4362
+ this.value = value;
4363
+ }
4364
+ registerOnChange(fn) {
4365
+ this.onChange = fn;
4366
+ }
4367
+ registerOnTouched(fn) {
4368
+ this.onTouch = fn;
4369
+ }
4370
+ ngOnDestroy() {
4371
+ this.isDestroyed$.next();
4372
+ this.isDestroyed$.complete();
4373
+ }
4374
+ }
4375
+ SelectTestComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SelectTestComponent, deps: [{ token: ValueChangeService }], target: i0.ɵɵFactoryTarget.Component });
4376
+ SelectTestComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.7", type: SelectTestComponent, selector: "wac-select-test", inputs: { value: "value", required: "required", disabled: "disabled", keepPanelOpen: "keepPanelOpen", openPanel: "openPanel", enableSearch: "enableSearch" }, outputs: { valueChange: "valueChange", openPanelChange: "openPanelChange" }, host: { listeners: { "document:keydown": "_handleKeydown($event)" }, properties: { "attr.role": "this.role" } }, providers: [
4377
+ { provide: NG_VALUE_ACCESSOR, useExisting: SelectTestComponent, multi: true },
4378
+ ValueChangeService
4379
+ ], queries: [{ propertyName: "customSearchTrigger", first: true, predicate: SelectSearchTriggerComponent, descendants: true }, { propertyName: "label", first: true, predicate: LabelComponent, descendants: true }, { propertyName: "optionChildren", predicate: OPTION_SELECTION_HANDLER, descendants: true }], ngImport: i0, template: "<p *ngIf=\"!!label\" class=\"wac-select-test__label\">\n <ng-content select=\"wac-label, .wac-label\" ></ng-content>\n</p>\n\n\n<div\n class=\"wac-select-test\"\n wzAutoHide\n (clickOutside)=\"onClosePanel()\"\n [triggerElement]=\"'wac-select-test__header__selection'\"\n [zIndexToggle]=\"openPanel\"\n >\n\n <div class=\"wac-select-test__header\" [ngClass]=\"{ 'select-disabled' : disabled }\" (click)=\"!disabled && onTogglePanel()\" tabindex=\"0\">\n\n <ng-container [ngTemplateOutlet]=\"openPanel ? openPanelTrigger : closePanelTrigger\" >\n\n <ng-template #closePanelTrigger>\n <ng-container [ngTemplateOutlet]=\"defaultTrigger\"></ng-container>\n </ng-template>\n\n <ng-template #openPanelTrigger>\n <ng-content *ngIf=\"!!customSearchTrigger; else defaultTrigger\" select=\"wac-select-search-trigger\" ></ng-content>\n </ng-template>\n\n <ng-template #defaultTrigger>\n <ng-content *ngIf=\"!selectedOptionContent\" select=\"wac-placeholder,[role=placeholder]\"></ng-content>\n <div\n class=\"wac-select-test__header__selection wac-option__placeholder\"\n *ngIf=\"!!selectedOptionContent\"\n [innerHtml]=\"selectedOptionContent\">\n </div>\n </ng-template>\n\n </ng-container>\n\n <span class=\"wac-select-test__header__chevron\"><i class=\"fas fa-chevron-down\"></i></span>\n\n </div>\n\n\n <div class=\"wac-select-test__content\" *ngIf=\"!disabled\" [ngClass]=\"{ hidden: !openPanel, open: openPanel }\">\n\n <perfect-scrollbar [config]=\"{ suppressScrollX: true }\">\n <ng-content\n select=\"wac-option-call-to-action, wac-option, option, .option, [selectOption]\">\n </ng-content>\n </perfect-scrollbar>\n\n <div *ngIf=\"!optionChildren?.length\" class=\"wac-select-test__content__empty\">\n <span>{{'wac.datatable.noresult' | translate}}</span>\n </div>\n\n </div>\n</div>", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: AutoHideDirective, selector: "[wzAutoHide]", inputs: ["triggerElement", "forceOn"], outputs: ["clickOutside"] }, { kind: "directive", type: ZindexToggleDirective, selector: "[zIndexToggle]", inputs: ["zIndexToggle"], outputs: ["onEventChange"] }, { kind: "component", type: i4.PerfectScrollbarComponent, selector: "perfect-scrollbar", inputs: ["disabled", "usePSClass", "autoPropagation", "scrollIndicators", "config"], outputs: ["psScrollY", "psScrollX", "psScrollUp", "psScrollDown", "psScrollLeft", "psScrollRight", "psYReachEnd", "psYReachStart", "psXReachEnd", "psXReachStart"], exportAs: ["ngxPerfectScrollbar"] }, { kind: "pipe", type: i1$3.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
4380
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SelectTestComponent, decorators: [{
4381
+ type: Component,
4382
+ args: [{ selector: 'wac-select-test', providers: [
4383
+ { provide: NG_VALUE_ACCESSOR, useExisting: SelectTestComponent, multi: true },
4384
+ ValueChangeService
4385
+ ], encapsulation: ViewEncapsulation.None, template: "<p *ngIf=\"!!label\" class=\"wac-select-test__label\">\n <ng-content select=\"wac-label, .wac-label\" ></ng-content>\n</p>\n\n\n<div\n class=\"wac-select-test\"\n wzAutoHide\n (clickOutside)=\"onClosePanel()\"\n [triggerElement]=\"'wac-select-test__header__selection'\"\n [zIndexToggle]=\"openPanel\"\n >\n\n <div class=\"wac-select-test__header\" [ngClass]=\"{ 'select-disabled' : disabled }\" (click)=\"!disabled && onTogglePanel()\" tabindex=\"0\">\n\n <ng-container [ngTemplateOutlet]=\"openPanel ? openPanelTrigger : closePanelTrigger\" >\n\n <ng-template #closePanelTrigger>\n <ng-container [ngTemplateOutlet]=\"defaultTrigger\"></ng-container>\n </ng-template>\n\n <ng-template #openPanelTrigger>\n <ng-content *ngIf=\"!!customSearchTrigger; else defaultTrigger\" select=\"wac-select-search-trigger\" ></ng-content>\n </ng-template>\n\n <ng-template #defaultTrigger>\n <ng-content *ngIf=\"!selectedOptionContent\" select=\"wac-placeholder,[role=placeholder]\"></ng-content>\n <div\n class=\"wac-select-test__header__selection wac-option__placeholder\"\n *ngIf=\"!!selectedOptionContent\"\n [innerHtml]=\"selectedOptionContent\">\n </div>\n </ng-template>\n\n </ng-container>\n\n <span class=\"wac-select-test__header__chevron\"><i class=\"fas fa-chevron-down\"></i></span>\n\n </div>\n\n\n <div class=\"wac-select-test__content\" *ngIf=\"!disabled\" [ngClass]=\"{ hidden: !openPanel, open: openPanel }\">\n\n <perfect-scrollbar [config]=\"{ suppressScrollX: true }\">\n <ng-content\n select=\"wac-option-call-to-action, wac-option, option, .option, [selectOption]\">\n </ng-content>\n </perfect-scrollbar>\n\n <div *ngIf=\"!optionChildren?.length\" class=\"wac-select-test__content__empty\">\n <span>{{'wac.datatable.noresult' | translate}}</span>\n </div>\n\n </div>\n</div>" }]
4386
+ }], ctorParameters: function () { return [{ type: ValueChangeService }]; }, propDecorators: { role: [{
4387
+ type: HostBinding,
4388
+ args: ['attr.role']
4389
+ }], optionChildren: [{
4390
+ type: ContentChildren,
4391
+ args: [OPTION_SELECTION_HANDLER, { descendants: true }]
4392
+ }], customSearchTrigger: [{
4393
+ type: ContentChild,
4394
+ args: [SelectSearchTriggerComponent]
4395
+ }], label: [{
4396
+ type: ContentChild,
4397
+ args: [LabelComponent]
4398
+ }], value: [{
4399
+ type: Input
4400
+ }], valueChange: [{
4401
+ type: Output
4402
+ }], required: [{
4403
+ type: Input
4404
+ }], disabled: [{
4405
+ type: Input
4406
+ }], keepPanelOpen: [{
4407
+ type: Input
4408
+ }], openPanel: [{
4409
+ type: Input
4410
+ }], openPanelChange: [{
4411
+ type: Output
4412
+ }], enableSearch: [{
4413
+ type: Input
4414
+ }], _handleKeydown: [{
4415
+ type: HostListener,
4416
+ args: ['document:keydown', ['$event']]
4417
+ }] } });
4418
+
4419
+ class OptionComponent {
4420
+ constructor(renderer, elementRef) {
4421
+ this.renderer = renderer;
4422
+ this.elementRef = elementRef;
4423
+ this.disabled = false;
4424
+ this.selectedChange = new EventEmitter();
4425
+ }
4426
+ set selected(selected) {
4427
+ this._selected = selected;
4428
+ selected ? this.renderer.addClass(this.elementRef.nativeElement, 'selected') : this.renderer.removeClass(this.elementRef.nativeElement, 'selected');
4429
+ }
4430
+ get selected() {
4431
+ return this._selected;
4432
+ }
4433
+ ngOnInit() {
4434
+ }
4435
+ onSelectOption() {
4436
+ if (this.disabled) {
4437
+ return;
4438
+ }
4439
+ this.selected = !this.selected;
4440
+ this.selectedChange.emit(this.value);
4441
+ }
4442
+ getValue() {
4443
+ return this.value;
4444
+ }
4445
+ setValue(value) {
4446
+ this.value = value;
4447
+ }
4448
+ isSelected() {
4449
+ return this.selected;
4450
+ }
4451
+ setSelected(selected) {
4452
+ this.selected = selected;
4453
+ this.selectedChange.emit(this.value);
4454
+ }
4455
+ getContentRef() {
4456
+ return this.contentRef;
4457
+ }
4458
+ }
4459
+ OptionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: OptionComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
4460
+ OptionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.7", type: OptionComponent, selector: "wac-option", inputs: { disabled: "disabled", value: "value", selected: "selected" }, outputs: { selectedChange: "selectedChange" }, providers: [{ provide: OPTION_SELECTION_HANDLER, useExisting: OptionComponent }], viewQueries: [{ propertyName: "contentRef", first: true, predicate: ["contentWrapper"], descendants: true }], ngImport: i0, template: "<div\n [ngClass]=\"{ 'disabled': disabled }\"\n class=\"wac-option\"\n (click)=\"onSelectOption()\"\n >\n <div [ngClass]=\"{ 'selected': !disabled && selected, 'disabled': disabled }\" #contentWrapper>\n <ng-content></ng-content>\n </div>\n</div>", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], encapsulation: i0.ViewEncapsulation.None });
4461
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: OptionComponent, decorators: [{
4462
+ type: Component,
4463
+ args: [{ selector: 'wac-option', encapsulation: ViewEncapsulation.None, providers: [{ provide: OPTION_SELECTION_HANDLER, useExisting: OptionComponent }], template: "<div\n [ngClass]=\"{ 'disabled': disabled }\"\n class=\"wac-option\"\n (click)=\"onSelectOption()\"\n >\n <div [ngClass]=\"{ 'selected': !disabled && selected, 'disabled': disabled }\" #contentWrapper>\n <ng-content></ng-content>\n </div>\n</div>" }]
4464
+ }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }]; }, propDecorators: { contentRef: [{
4465
+ type: ViewChild,
4466
+ args: ['contentWrapper']
4467
+ }], disabled: [{
4468
+ type: Input
4469
+ }], value: [{
4470
+ type: Input
4471
+ }], selected: [{
4472
+ type: Input
4473
+ }], selectedChange: [{
4474
+ type: Output
4475
+ }] } });
4476
+
4477
+ class OptionCallToActionComponent {
4478
+ constructor() { }
4479
+ }
4480
+ OptionCallToActionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: OptionCallToActionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4481
+ OptionCallToActionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.7", type: OptionCallToActionComponent, selector: "wac-option-call-to-action", ngImport: i0, template: "\n<div class=\"wac-option-call-to-action\">\n <div>\n <ng-content></ng-content>\n </div>\n</div>\n\n" });
4482
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: OptionCallToActionComponent, decorators: [{
4483
+ type: Component,
4484
+ args: [{ selector: 'wac-option-call-to-action', template: "\n<div class=\"wac-option-call-to-action\">\n <div>\n <ng-content></ng-content>\n </div>\n</div>\n\n" }]
4485
+ }], ctorParameters: function () { return []; } });
4486
+
4487
+ class PlaceholderComponent {
4488
+ constructor() { }
4489
+ ngOnInit() {
4490
+ }
4491
+ }
4492
+ PlaceholderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: PlaceholderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4493
+ PlaceholderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.7", type: PlaceholderComponent, selector: "wac-placeholder", host: { classAttribute: "wac-placeholder" }, ngImport: i0, template: "<ng-content></ng-content>" });
4494
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: PlaceholderComponent, decorators: [{
4495
+ type: Component,
4496
+ args: [{ selector: 'wac-placeholder', host: {
4497
+ 'class': 'wac-placeholder'
4498
+ }, template: "<ng-content></ng-content>" }]
4499
+ }], ctorParameters: function () { return []; } });
4500
+
3967
4501
  const components = [
3968
4502
  TagComponent,
3969
4503
  TabComponent,
@@ -3978,7 +4512,7 @@ const components = [
3978
4512
  LogoComponent,
3979
4513
  RadioComponent,
3980
4514
  StateComponent,
3981
- LabelComponent,
4515
+ TagLabelComponent,
3982
4516
  CalendarComponent,
3983
4517
  WzEditInPlaceComponent,
3984
4518
  AlertComponent,
@@ -4005,7 +4539,14 @@ const components = [
4005
4539
  WrapperBlocsComponent,
4006
4540
  SnackbarComponent,
4007
4541
  SearchComponent,
4008
- SelectedListComponent
4542
+ SelectedListComponent,
4543
+ OptionalDisableContainerComponent,
4544
+ SelectTestComponent,
4545
+ OptionComponent,
4546
+ OptionCallToActionComponent,
4547
+ PlaceholderComponent,
4548
+ LabelComponent,
4549
+ SelectSearchTriggerComponent,
4009
4550
  ];
4010
4551
  const exportsFromModule = [
4011
4552
  PaginationComponent,
@@ -4038,7 +4579,7 @@ SharedComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
4038
4579
  LogoComponent,
4039
4580
  RadioComponent,
4040
4581
  StateComponent,
4041
- LabelComponent,
4582
+ TagLabelComponent,
4042
4583
  CalendarComponent,
4043
4584
  WzEditInPlaceComponent,
4044
4585
  AlertComponent,
@@ -4065,7 +4606,14 @@ SharedComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
4065
4606
  WrapperBlocsComponent,
4066
4607
  SnackbarComponent,
4067
4608
  SearchComponent,
4068
- SelectedListComponent], imports: [CommonModule,
4609
+ SelectedListComponent,
4610
+ OptionalDisableContainerComponent,
4611
+ SelectTestComponent,
4612
+ OptionComponent,
4613
+ OptionCallToActionComponent,
4614
+ PlaceholderComponent,
4615
+ LabelComponent,
4616
+ SelectSearchTriggerComponent], imports: [CommonModule,
4069
4617
  FormsModule,
4070
4618
  NwbAllModule, i1$3.TranslateModule, ReactiveFormsModule,
4071
4619
  SharedDirectives,
@@ -4096,7 +4644,7 @@ SharedComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
4096
4644
  LogoComponent,
4097
4645
  RadioComponent,
4098
4646
  StateComponent,
4099
- LabelComponent,
4647
+ TagLabelComponent,
4100
4648
  CalendarComponent,
4101
4649
  WzEditInPlaceComponent,
4102
4650
  AlertComponent,
@@ -4123,7 +4671,14 @@ SharedComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
4123
4671
  WrapperBlocsComponent,
4124
4672
  SnackbarComponent,
4125
4673
  SearchComponent,
4126
- SelectedListComponent, PaginationComponent,
4674
+ SelectedListComponent,
4675
+ OptionalDisableContainerComponent,
4676
+ SelectTestComponent,
4677
+ OptionComponent,
4678
+ OptionCallToActionComponent,
4679
+ PlaceholderComponent,
4680
+ LabelComponent,
4681
+ SelectSearchTriggerComponent, PaginationComponent,
4127
4682
  TableComponent,
4128
4683
  TableColumn,
4129
4684
  CheckBoxRow,
@@ -4232,5 +4787,5 @@ class TableFiltersGroup extends NwbFilterGroup {
4232
4787
  * Generated bundle index. Do not edit.
4233
4788
  */
4234
4789
 
4235
- export { AbstractDebounceDirective, AlertComponent, AlertPopupComponent, AlertPopupModule, AlertPopupService, AreAllOptionsSelectedPipe, AutoHideDirective, BackComponent, BlockComponent, ButtonComponent, CalendarComponent, CheckBoxRow, CheckboxComponent, DebounceKeyupDirective, DeleteComponent, DropdownComponent, FiltersComponent, FiltersTableService, FormatObjectToRecursifTreePipe, FormatObjectToSimpleTreePipe, FreePopinComponent, H1Component, H2Component, H3Component, H4Component, HeaderPageComponent, HtmlContainer, ImageComponent, InfoComponent, InputComponent, InputSearchComponent, InputWithSelectComponent, KeypressEnterDirective, LabelComponent, LinkComponent, LoaderComponent, LogoComponent, MultipleSearchComponent, MultipleSearchPlusComponent, PaginationComponent, PopinComponent, ProgressBarComponent, RadioComponent, SearchComponent, SelectComponent, SelectFiltersPipe, SelectInTextComponent, SelectedListComponent, SeparatorComponent, SettingsComponent, SharedComponentsModule, SharedDirectives, SharedPipes, SnackbarComponent, StateComponent, SwitchComponent, TabComponent, TableColumn, TableColumnHeader, TableComponent, TableFiltersGroup, TableRow, TagComponent, TextAreaComponent, TextComponent, TooltipComponent, TreeComponent, TreeModule, UploadComponent, VarDirective, WiziComponentsModule, WrapperBlocsComponent, WrapperComponent, WzEditInPlaceComponent, ZindexToggleDirective };
4790
+ export { AbstractDebounceDirective, AlertComponent, AlertPopupComponent, AlertPopupModule, AlertPopupService, AreAllOptionsSelectedPipe, AutoHideDirective, BackComponent, BlockComponent, ButtonComponent, CalendarComponent, CheckBoxRow, CheckboxComponent, DebounceKeyupDirective, DeleteComponent, DropdownComponent, FilterOptionsPipe, FiltersComponent, FiltersTableService, FormatObjectToRecursifTreePipe, FormatObjectToSimpleTreePipe, FreePopinComponent, H1Component, H2Component, H3Component, H4Component, HeaderPageComponent, HtmlContainer, ImageComponent, InfoComponent, InputComponent, InputSearchComponent, InputWithSelectComponent, KeypressEnterDirective, LabelComponent, LinkComponent, LoaderComponent, LogoComponent, MultipleSearchComponent, MultipleSearchPlusComponent, OptionCallToActionComponent, OptionComponent, OptionalDisableContainerComponent, PaginationComponent, PlaceholderComponent, PopinComponent, ProgressBarComponent, RadioComponent, SearchComponent, SelectComponent, SelectFiltersPipe, SelectInTextComponent, SelectOptionDirective, SelectSearchTriggerComponent, SelectTestComponent, SelectedListComponent, SeparatorComponent, SettingsComponent, SharedComponentsModule, SharedDirectives, SharedPipes, SnackbarComponent, StateComponent, SwitchComponent, TabComponent, TableColumn, TableColumnHeader, TableComponent, TableFiltersGroup, TableRow, TagComponent, TagLabelComponent, TextAreaComponent, TextComponent, TooltipComponent, TreeComponent, TreeModule, UploadComponent, VarDirective, WiziComponentsModule, WrapperBlocsComponent, WrapperComponent, WzEditInPlaceComponent, ZindexToggleDirective };
4236
4791
  //# sourceMappingURL=wizishop-angular-components.mjs.map