@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;
@@ -1032,6 +1093,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
1032
1093
 
1033
1094
  class ButtonComponent {
1034
1095
  constructor() {
1096
+ // todo add button type (ex: for submit and check if it works with template driven forms)
1035
1097
  this.extraClasses = 'is-info'; // todo make a list of existing class
1036
1098
  this.label = '';
1037
1099
  this.icon = '';
@@ -1364,7 +1426,7 @@ const inOutX = trigger('inOutXAnimation', [
1364
1426
  ])
1365
1427
  ]);
1366
1428
 
1367
- class LabelComponent {
1429
+ class TagLabelComponent {
1368
1430
  constructor() {
1369
1431
  this.index = 0;
1370
1432
  this.label = '';
@@ -1379,11 +1441,11 @@ class LabelComponent {
1379
1441
  });
1380
1442
  }
1381
1443
  }
1382
- LabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: LabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1383
- 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 });
1384
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: LabelComponent, decorators: [{
1444
+ TagLabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: TagLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1445
+ 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 });
1446
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: TagLabelComponent, decorators: [{
1385
1447
  type: Component,
1386
- 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" }]
1448
+ 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" }]
1387
1449
  }], ctorParameters: function () { return []; }, propDecorators: { index: [{
1388
1450
  type: Input
1389
1451
  }], label: [{
@@ -2899,8 +2961,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
2899
2961
  }] });
2900
2962
 
2901
2963
  class SelectComponent {
2902
- constructor(translateService) {
2903
- this.translateService = translateService;
2964
+ constructor() {
2904
2965
  this.search = false;
2905
2966
  this.searchValue = '';
2906
2967
  this.searchValueChange = new EventEmitter();
@@ -2928,8 +2989,6 @@ class SelectComponent {
2928
2989
  get callToAction() {
2929
2990
  return this._calllToAction;
2930
2991
  }
2931
- ngOnInit() {
2932
- }
2933
2992
  onClose() {
2934
2993
  this.openCategories = false;
2935
2994
  }
@@ -2984,12 +3043,12 @@ class SelectComponent {
2984
3043
  this.onTouch = fn;
2985
3044
  }
2986
3045
  }
2987
- 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 });
3046
+ SelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2988
3047
  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" }] });
2989
3048
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SelectComponent, decorators: [{
2990
3049
  type: Component,
2991
3050
  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>" }]
2992
- }], ctorParameters: function () { return [{ type: i1$3.TranslateService }]; }, propDecorators: { items: [{
3051
+ }], ctorParameters: function () { return []; }, propDecorators: { items: [{
2993
3052
  type: Input
2994
3053
  }], placeholder: [{
2995
3054
  type: Input
@@ -3910,7 +3969,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
3910
3969
  }]
3911
3970
  }] });
3912
3971
 
3913
- const exportedPipes = [FormatObjectToRecursifTreePipe, FormatObjectToSimpleTreePipe];
3972
+ class FilterOptionsPipe {
3973
+ transform(options, searchValue, ...args) {
3974
+ const regexp = new RegExp(searchValue, 'i');
3975
+ return options.filter(option => {
3976
+ return args.some(arg => regexp.test(option[arg]));
3977
+ });
3978
+ }
3979
+ }
3980
+ FilterOptionsPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: FilterOptionsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3981
+ FilterOptionsPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.0.7", ngImport: i0, type: FilterOptionsPipe, name: "filterOptions" });
3982
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: FilterOptionsPipe, decorators: [{
3983
+ type: Pipe,
3984
+ args: [{
3985
+ name: 'filterOptions'
3986
+ }]
3987
+ }] });
3988
+
3989
+ const exportedPipes = [FormatObjectToRecursifTreePipe, FormatObjectToSimpleTreePipe, FilterOptionsPipe];
3914
3990
  const pipes = [
3915
3991
  SelectFiltersPipe,
3916
3992
  AreAllOptionsSelectedPipe
@@ -3918,8 +3994,8 @@ const pipes = [
3918
3994
  class SharedPipes {
3919
3995
  }
3920
3996
  SharedPipes.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SharedPipes, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3921
- SharedPipes.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.7", ngImport: i0, type: SharedPipes, declarations: [FormatObjectToRecursifTreePipe, FormatObjectToSimpleTreePipe, SelectFiltersPipe,
3922
- AreAllOptionsSelectedPipe], imports: [CommonModule, FormsModule], exports: [FormatObjectToRecursifTreePipe, FormatObjectToSimpleTreePipe, SelectFiltersPipe,
3997
+ SharedPipes.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.7", ngImport: i0, type: SharedPipes, declarations: [FormatObjectToRecursifTreePipe, FormatObjectToSimpleTreePipe, FilterOptionsPipe, SelectFiltersPipe,
3998
+ AreAllOptionsSelectedPipe], imports: [CommonModule, FormsModule], exports: [FormatObjectToRecursifTreePipe, FormatObjectToSimpleTreePipe, FilterOptionsPipe, SelectFiltersPipe,
3923
3999
  AreAllOptionsSelectedPipe] });
3924
4000
  SharedPipes.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SharedPipes, imports: [CommonModule, FormsModule] });
3925
4001
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SharedPipes, decorators: [{
@@ -3954,6 +4030,462 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
3954
4030
  }]
3955
4031
  }] });
3956
4032
 
4033
+ class OptionalDisableContainerComponent {
4034
+ constructor() {
4035
+ this.disabled = false;
4036
+ }
4037
+ }
4038
+ OptionalDisableContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: OptionalDisableContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4039
+ 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 });
4040
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: OptionalDisableContainerComponent, decorators: [{
4041
+ type: Component,
4042
+ 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>" }]
4043
+ }], ctorParameters: function () { return []; }, propDecorators: { disabled: [{
4044
+ type: Input
4045
+ }] } });
4046
+
4047
+ class ValueChangeService {
4048
+ constructor() {
4049
+ this.valueChange$ = new Subject();
4050
+ this.indexSelectedOption = null;
4051
+ this.resetListeners$ = new Subject();
4052
+ }
4053
+ set value(value) {
4054
+ this._value = value;
4055
+ this.handleValueChange();
4056
+ this.valueChange$.next(value);
4057
+ }
4058
+ get value() {
4059
+ return this._value;
4060
+ }
4061
+ handleSelectOptionsChange(optionChildren, value) {
4062
+ this.resetListeners$.next();
4063
+ this.optionChildren = optionChildren;
4064
+ this._value = value;
4065
+ this.indexSelectedOption = null;
4066
+ this.handleInitialSelectedOption();
4067
+ this.handleSelectedOptionsEvent();
4068
+ }
4069
+ assignValue(value) {
4070
+ this._value = value;
4071
+ this.handleValueChange();
4072
+ }
4073
+ handleValueChange() {
4074
+ this.changeSelectedOption();
4075
+ this.updateSelectPlaceholder();
4076
+ }
4077
+ selectNextOption() {
4078
+ if (this.indexSelectedOption + 1 >= this.optionChildren.length) {
4079
+ return;
4080
+ }
4081
+ if (this.indexSelectedOption === null) {
4082
+ this.indexSelectedOption = 0;
4083
+ }
4084
+ else {
4085
+ this.indexSelectedOption = this.indexSelectedOption + 1;
4086
+ }
4087
+ this.assignValue(this.optionChildren.get(this.indexSelectedOption).value);
4088
+ }
4089
+ selectPreviousOption() {
4090
+ if (!this.indexSelectedOption) {
4091
+ this.indexSelectedOption = null;
4092
+ this.assignValue(null);
4093
+ return;
4094
+ }
4095
+ this.indexSelectedOption = this.indexSelectedOption - 1;
4096
+ this.assignValue(this.optionChildren.get(this.indexSelectedOption).value);
4097
+ }
4098
+ handleInitialSelectedOption() {
4099
+ setTimeout(() => {
4100
+ if (!this.value) {
4101
+ this.findInitialSelectedOption();
4102
+ return;
4103
+ }
4104
+ this.handleValueChange();
4105
+ }, 0);
4106
+ }
4107
+ findInitialSelectedOption() {
4108
+ const selectedOption = this.getSelectedOptionComponent();
4109
+ if (!selectedOption) {
4110
+ return;
4111
+ }
4112
+ this.value = selectedOption.value;
4113
+ }
4114
+ handleSelectedOptionsEvent() {
4115
+ this.optionSelectedChangeListeners().subscribe((selecteEvent) => {
4116
+ this.value = selecteEvent.value;
4117
+ });
4118
+ }
4119
+ updateSelectPlaceholder() {
4120
+ if (!this.value) {
4121
+ this.selectedOptionContent = null;
4122
+ return;
4123
+ }
4124
+ const selectedOption = this.getSelectedOptionComponent();
4125
+ this.selectedOptionContent = selectedOption?.getContentRef().nativeElement.innerHTML || undefined;
4126
+ }
4127
+ getSelectedOptionComponent() {
4128
+ return this.optionChildren.find((option) => option.selected);
4129
+ }
4130
+ optionSelectedChangeListeners() {
4131
+ const selectedChange$ = this.optionChildren.map((option) => {
4132
+ return option.selectedChange.pipe(map((value) => {
4133
+ return {
4134
+ value
4135
+ };
4136
+ }));
4137
+ });
4138
+ return merge(...selectedChange$).pipe(takeUntil(this.resetListeners$));
4139
+ }
4140
+ changeSelectedOption() {
4141
+ this.optionChildren.forEach((optionComponent, index) => {
4142
+ optionComponent.selected = this.value == undefined ? false : optionComponent.value === this.value;
4143
+ if (optionComponent.selected) {
4144
+ this.indexSelectedOption = index;
4145
+ }
4146
+ });
4147
+ }
4148
+ ngOnDestroy() {
4149
+ this.resetListeners$.next();
4150
+ this.resetListeners$.complete();
4151
+ }
4152
+ }
4153
+ ValueChangeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: ValueChangeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4154
+ ValueChangeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: ValueChangeService });
4155
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: ValueChangeService, decorators: [{
4156
+ type: Injectable
4157
+ }], ctorParameters: function () { return []; } });
4158
+
4159
+ class SelectSearchTriggerComponent {
4160
+ constructor() {
4161
+ this.searchValue = '';
4162
+ this.searchValueChange = new EventEmitter();
4163
+ this.searchInputKeyEnterPressed = new EventEmitter();
4164
+ }
4165
+ onSearchValueChange() {
4166
+ this.searchValueChange.emit(this.searchValue);
4167
+ }
4168
+ onKeypressEnter() {
4169
+ this.searchInputKeyEnterPressed.emit();
4170
+ }
4171
+ setFocus() {
4172
+ setTimeout(() => {
4173
+ this.searchInput.nativeElement.focus();
4174
+ }, 0);
4175
+ }
4176
+ }
4177
+ SelectSearchTriggerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SelectSearchTriggerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4178
+ 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 });
4179
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SelectSearchTriggerComponent, decorators: [{
4180
+ type: Component,
4181
+ 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>" }]
4182
+ }], ctorParameters: function () { return []; }, propDecorators: { searchValue: [{
4183
+ type: Input
4184
+ }], searchValueChange: [{
4185
+ type: Output
4186
+ }], searchInputKeyEnterPressed: [{
4187
+ type: Output
4188
+ }], searchInput: [{
4189
+ type: ViewChild,
4190
+ args: ['searchInput']
4191
+ }] } });
4192
+
4193
+ class LabelComponent {
4194
+ constructor() { }
4195
+ ngOnInit() {
4196
+ }
4197
+ }
4198
+ LabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: LabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4199
+ 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>" });
4200
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: LabelComponent, decorators: [{
4201
+ type: Component,
4202
+ args: [{ selector: 'wac-label', host: {
4203
+ 'class': 'wac-label'
4204
+ }, template: "<ng-content></ng-content>" }]
4205
+ }], ctorParameters: function () { return []; } });
4206
+
4207
+ class SelectTestComponent {
4208
+ constructor(valueChangeService) {
4209
+ this.valueChangeService = valueChangeService;
4210
+ //! Refacto improve sroll on mobile, see with Pauline
4211
+ // todo handle multiple selection ?
4212
+ this.role = 'combobox';
4213
+ this.valueChange = new EventEmitter();
4214
+ this.disabled = false;
4215
+ this._openPanel = false;
4216
+ this.openPanelChange = new EventEmitter();
4217
+ this.enableSearch = false;
4218
+ this.isDestroyed$ = new Subject();
4219
+ // ControlValueAccessor methods
4220
+ this.onChange = () => { };
4221
+ this.onTouch = () => { }; // todo call it on blur and on close if not disable and opened
4222
+ }
4223
+ set value(value) {
4224
+ this._value = value;
4225
+ if (!this.optionChildren) {
4226
+ return;
4227
+ }
4228
+ this.valueChangeService.assignValue(value);
4229
+ }
4230
+ get value() {
4231
+ return this._value;
4232
+ }
4233
+ /** Whether the component is required. */
4234
+ get required() {
4235
+ return this._required ?? false;
4236
+ }
4237
+ set required(value) {
4238
+ this._required = value;
4239
+ }
4240
+ get selectedOptionContent() {
4241
+ return this.valueChangeService.selectedOptionContent;
4242
+ }
4243
+ ;
4244
+ set keepPanelOpen(keepPanelOpen) {
4245
+ this.openPanel = keepPanelOpen;
4246
+ this._keepPanelOpen = keepPanelOpen;
4247
+ }
4248
+ get keepPanelOpen() {
4249
+ return this._keepPanelOpen;
4250
+ }
4251
+ set openPanel(openPanel) {
4252
+ const wasOpen = this._openPanel;
4253
+ this._openPanel = this.keepPanelOpen || openPanel;
4254
+ if (openPanel) {
4255
+ this.customSearchTrigger?.setFocus();
4256
+ }
4257
+ if (wasOpen) {
4258
+ this.onTouch(this.value);
4259
+ }
4260
+ }
4261
+ get openPanel() {
4262
+ return this._openPanel;
4263
+ }
4264
+ ngOnInit() {
4265
+ this.handleValueChange();
4266
+ }
4267
+ ngAfterViewInit() {
4268
+ this.handleOptionChildren();
4269
+ }
4270
+ handleValueChange() {
4271
+ this.valueChangeService.valueChange$.pipe(takeUntil(this.isDestroyed$)).subscribe(value => {
4272
+ this._value = value;
4273
+ this.valueChange.emit(this.value);
4274
+ this.onChange(this.value);
4275
+ this.onClosePanel();
4276
+ });
4277
+ }
4278
+ handleOptionChildren() {
4279
+ this.optionChildren.changes.pipe(takeUntil(this.isDestroyed$), startWith(this.optionChildren)).subscribe(optionChildren => {
4280
+ this.valueChangeService.handleSelectOptionsChange(optionChildren, this.value);
4281
+ });
4282
+ }
4283
+ onTogglePanel() {
4284
+ this.openPanel = !this.openPanel;
4285
+ this.openPanelChange.emit(this.openPanel);
4286
+ }
4287
+ onClosePanel() {
4288
+ this.openPanel = false;
4289
+ this.openPanelChange.emit(this.openPanel);
4290
+ }
4291
+ /** Handles all keydown events on the select. */
4292
+ _handleKeydown(event) {
4293
+ if (this.disabled) {
4294
+ return;
4295
+ }
4296
+ this.openPanel ? this._handleOpenKeydown(event) : this._handleClosedKeydown(event);
4297
+ }
4298
+ /** Handles keyboard events while the select is closed. */
4299
+ _handleClosedKeydown(event) {
4300
+ const keyCode = event.keyCode;
4301
+ const isArrowKey = keyCode === DOWN_ARROW ||
4302
+ keyCode === UP_ARROW ||
4303
+ keyCode === LEFT_ARROW ||
4304
+ keyCode === RIGHT_ARROW;
4305
+ const isOpenKey = keyCode === ENTER || keyCode === SPACE;
4306
+ // Open the select on ALT + arrow key to match the native <select>
4307
+ if ((isOpenKey && !hasModifierKey(event)) ||
4308
+ (event.altKey && isArrowKey)) {
4309
+ event.preventDefault(); // prevents the page from scrolling down when pressing space
4310
+ this.openPanel = true;
4311
+ return;
4312
+ }
4313
+ if (!isArrowKey) {
4314
+ return;
4315
+ }
4316
+ event.preventDefault(); // prevents the page from scrolling
4317
+ // select the next option on arrow key down
4318
+ if (keyCode === DOWN_ARROW || keyCode === RIGHT_ARROW) {
4319
+ this.valueChangeService.selectNextOption();
4320
+ return;
4321
+ }
4322
+ this.valueChangeService.selectPreviousOption();
4323
+ }
4324
+ /** Handles keyboard events when the selected is open. */
4325
+ _handleOpenKeydown(event) {
4326
+ const keyCode = event.keyCode;
4327
+ const isArrowKey = keyCode === DOWN_ARROW ||
4328
+ keyCode === UP_ARROW ||
4329
+ keyCode === LEFT_ARROW ||
4330
+ keyCode === RIGHT_ARROW;
4331
+ const isEscapeKey = keyCode === ESCAPE || keyCode === ENTER || keyCode === SPACE;
4332
+ if ((isArrowKey && event.altKey) || isEscapeKey) {
4333
+ // Close the select on ALT + arrow key to match the native <select>
4334
+ event.preventDefault();
4335
+ this.openPanel = false;
4336
+ return;
4337
+ }
4338
+ if (!isArrowKey) {
4339
+ return;
4340
+ }
4341
+ event.preventDefault(); // prevents the page from scrolling
4342
+ // select the next option on arrow key down
4343
+ if (keyCode === DOWN_ARROW || keyCode === RIGHT_ARROW) {
4344
+ this.valueChangeService.selectNextOption();
4345
+ return;
4346
+ }
4347
+ this.valueChangeService.selectPreviousOption();
4348
+ }
4349
+ writeValue(value) {
4350
+ this.value = value;
4351
+ }
4352
+ registerOnChange(fn) {
4353
+ this.onChange = fn;
4354
+ }
4355
+ registerOnTouched(fn) {
4356
+ this.onTouch = fn;
4357
+ }
4358
+ ngOnDestroy() {
4359
+ this.isDestroyed$.next();
4360
+ this.isDestroyed$.complete();
4361
+ }
4362
+ }
4363
+ SelectTestComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SelectTestComponent, deps: [{ token: ValueChangeService }], target: i0.ɵɵFactoryTarget.Component });
4364
+ 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: [
4365
+ { provide: NG_VALUE_ACCESSOR, useExisting: SelectTestComponent, multi: true },
4366
+ ValueChangeService
4367
+ ], 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 });
4368
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SelectTestComponent, decorators: [{
4369
+ type: Component,
4370
+ args: [{ selector: 'wac-select-test', providers: [
4371
+ { provide: NG_VALUE_ACCESSOR, useExisting: SelectTestComponent, multi: true },
4372
+ ValueChangeService
4373
+ ], 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>" }]
4374
+ }], ctorParameters: function () { return [{ type: ValueChangeService }]; }, propDecorators: { role: [{
4375
+ type: HostBinding,
4376
+ args: ['attr.role']
4377
+ }], optionChildren: [{
4378
+ type: ContentChildren,
4379
+ args: [OPTION_SELECTION_HANDLER, { descendants: true }]
4380
+ }], customSearchTrigger: [{
4381
+ type: ContentChild,
4382
+ args: [SelectSearchTriggerComponent]
4383
+ }], label: [{
4384
+ type: ContentChild,
4385
+ args: [LabelComponent]
4386
+ }], value: [{
4387
+ type: Input
4388
+ }], valueChange: [{
4389
+ type: Output
4390
+ }], required: [{
4391
+ type: Input
4392
+ }], disabled: [{
4393
+ type: Input
4394
+ }], keepPanelOpen: [{
4395
+ type: Input
4396
+ }], openPanel: [{
4397
+ type: Input
4398
+ }], openPanelChange: [{
4399
+ type: Output
4400
+ }], enableSearch: [{
4401
+ type: Input
4402
+ }], _handleKeydown: [{
4403
+ type: HostListener,
4404
+ args: ['document:keydown', ['$event']]
4405
+ }] } });
4406
+
4407
+ class OptionComponent {
4408
+ constructor(renderer, elementRef) {
4409
+ this.renderer = renderer;
4410
+ this.elementRef = elementRef;
4411
+ this.disabled = false;
4412
+ this.selectedChange = new EventEmitter();
4413
+ }
4414
+ set selected(selected) {
4415
+ this._selected = selected;
4416
+ selected ? this.renderer.addClass(this.elementRef.nativeElement, 'selected') : this.renderer.removeClass(this.elementRef.nativeElement, 'selected');
4417
+ }
4418
+ get selected() {
4419
+ return this._selected;
4420
+ }
4421
+ ngOnInit() {
4422
+ }
4423
+ onSelectOption() {
4424
+ if (this.disabled) {
4425
+ return;
4426
+ }
4427
+ this.selected = !this.selected;
4428
+ this.selectedChange.emit(this.value);
4429
+ }
4430
+ getValue() {
4431
+ return this.value;
4432
+ }
4433
+ setValue(value) {
4434
+ this.value = value;
4435
+ }
4436
+ isSelected() {
4437
+ return this.selected;
4438
+ }
4439
+ setSelected(selected) {
4440
+ this.selected = selected;
4441
+ this.selectedChange.emit(this.value);
4442
+ }
4443
+ getContentRef() {
4444
+ return this.contentRef;
4445
+ }
4446
+ }
4447
+ 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 });
4448
+ 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 });
4449
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: OptionComponent, decorators: [{
4450
+ type: Component,
4451
+ 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>" }]
4452
+ }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }]; }, propDecorators: { contentRef: [{
4453
+ type: ViewChild,
4454
+ args: ['contentWrapper']
4455
+ }], disabled: [{
4456
+ type: Input
4457
+ }], value: [{
4458
+ type: Input
4459
+ }], selected: [{
4460
+ type: Input
4461
+ }], selectedChange: [{
4462
+ type: Output
4463
+ }] } });
4464
+
4465
+ class OptionCallToActionComponent {
4466
+ constructor() { }
4467
+ }
4468
+ OptionCallToActionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: OptionCallToActionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4469
+ 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" });
4470
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: OptionCallToActionComponent, decorators: [{
4471
+ type: Component,
4472
+ 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" }]
4473
+ }], ctorParameters: function () { return []; } });
4474
+
4475
+ class PlaceholderComponent {
4476
+ constructor() { }
4477
+ ngOnInit() {
4478
+ }
4479
+ }
4480
+ PlaceholderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: PlaceholderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4481
+ 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>" });
4482
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: PlaceholderComponent, decorators: [{
4483
+ type: Component,
4484
+ args: [{ selector: 'wac-placeholder', host: {
4485
+ 'class': 'wac-placeholder'
4486
+ }, template: "<ng-content></ng-content>" }]
4487
+ }], ctorParameters: function () { return []; } });
4488
+
3957
4489
  const components = [
3958
4490
  TagComponent,
3959
4491
  TabComponent,
@@ -3968,7 +4500,7 @@ const components = [
3968
4500
  LogoComponent,
3969
4501
  RadioComponent,
3970
4502
  StateComponent,
3971
- LabelComponent,
4503
+ TagLabelComponent,
3972
4504
  CalendarComponent,
3973
4505
  WzEditInPlaceComponent,
3974
4506
  AlertComponent,
@@ -3995,7 +4527,14 @@ const components = [
3995
4527
  WrapperBlocsComponent,
3996
4528
  SnackbarComponent,
3997
4529
  SearchComponent,
3998
- SelectedListComponent
4530
+ SelectedListComponent,
4531
+ OptionalDisableContainerComponent,
4532
+ SelectTestComponent,
4533
+ OptionComponent,
4534
+ OptionCallToActionComponent,
4535
+ PlaceholderComponent,
4536
+ LabelComponent,
4537
+ SelectSearchTriggerComponent,
3999
4538
  ];
4000
4539
  const exportsFromModule = [
4001
4540
  PaginationComponent,
@@ -4028,7 +4567,7 @@ SharedComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
4028
4567
  LogoComponent,
4029
4568
  RadioComponent,
4030
4569
  StateComponent,
4031
- LabelComponent,
4570
+ TagLabelComponent,
4032
4571
  CalendarComponent,
4033
4572
  WzEditInPlaceComponent,
4034
4573
  AlertComponent,
@@ -4055,7 +4594,14 @@ SharedComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
4055
4594
  WrapperBlocsComponent,
4056
4595
  SnackbarComponent,
4057
4596
  SearchComponent,
4058
- SelectedListComponent], imports: [CommonModule,
4597
+ SelectedListComponent,
4598
+ OptionalDisableContainerComponent,
4599
+ SelectTestComponent,
4600
+ OptionComponent,
4601
+ OptionCallToActionComponent,
4602
+ PlaceholderComponent,
4603
+ LabelComponent,
4604
+ SelectSearchTriggerComponent], imports: [CommonModule,
4059
4605
  FormsModule,
4060
4606
  NwbAllModule, i1$3.TranslateModule, ReactiveFormsModule,
4061
4607
  SharedDirectives,
@@ -4086,7 +4632,7 @@ SharedComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
4086
4632
  LogoComponent,
4087
4633
  RadioComponent,
4088
4634
  StateComponent,
4089
- LabelComponent,
4635
+ TagLabelComponent,
4090
4636
  CalendarComponent,
4091
4637
  WzEditInPlaceComponent,
4092
4638
  AlertComponent,
@@ -4113,7 +4659,14 @@ SharedComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
4113
4659
  WrapperBlocsComponent,
4114
4660
  SnackbarComponent,
4115
4661
  SearchComponent,
4116
- SelectedListComponent, PaginationComponent,
4662
+ SelectedListComponent,
4663
+ OptionalDisableContainerComponent,
4664
+ SelectTestComponent,
4665
+ OptionComponent,
4666
+ OptionCallToActionComponent,
4667
+ PlaceholderComponent,
4668
+ LabelComponent,
4669
+ SelectSearchTriggerComponent, PaginationComponent,
4117
4670
  TableComponent,
4118
4671
  TableColumn,
4119
4672
  CheckBoxRow,
@@ -4222,5 +4775,5 @@ class TableFiltersGroup extends NwbFilterGroup {
4222
4775
  * Generated bundle index. Do not edit.
4223
4776
  */
4224
4777
 
4225
- 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 };
4778
+ 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 };
4226
4779
  //# sourceMappingURL=wizishop-angular-components.mjs.map