@wizishop/angular-components 14.3.14 → 14.3.15

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 (25) hide show
  1. package/esm2020/lib/components/selects/option/option-selection-handler.interface.mjs +1 -1
  2. package/esm2020/lib/components/selects/option/option-selection-handler.token.mjs +1 -1
  3. package/esm2020/lib/components/selects/option/option.component.mjs +3 -3
  4. package/esm2020/lib/components/selects/option/select-option.directive.mjs +3 -3
  5. package/esm2020/lib/components/selects/select-test/select.component.mjs +36 -92
  6. package/esm2020/lib/components/selects/select-test/select.directive.mjs +122 -0
  7. package/esm2020/lib/components/selects/select-test/value-change.service.mjs +5 -5
  8. package/esm2020/lib/directives/shared-directives.module.mjs +4 -3
  9. package/esm2020/public-api.mjs +3 -1
  10. package/fesm2015/wizishop-angular-components.mjs +301 -243
  11. package/fesm2015/wizishop-angular-components.mjs.map +1 -1
  12. package/fesm2020/wizishop-angular-components.mjs +301 -243
  13. package/fesm2020/wizishop-angular-components.mjs.map +1 -1
  14. package/lib/components/selects/option/option-selection-handler.interface.d.ts +3 -3
  15. package/lib/components/selects/option/option-selection-handler.token.d.ts +1 -1
  16. package/lib/components/selects/option/option.component.d.ts +7 -7
  17. package/lib/components/selects/option/select-option.directive.d.ts +7 -7
  18. package/lib/components/selects/select-test/select.component.d.ts +12 -23
  19. package/lib/components/selects/select-test/select.directive.d.ts +33 -0
  20. package/lib/components/selects/select-test/value-change.service.d.ts +8 -8
  21. package/lib/directives/shared-directives.module.d.ts +4 -3
  22. package/package.json +1 -1
  23. package/public-api.d.ts +2 -0
  24. package/wizishop-angular-components-14.3.15.tgz +0 -0
  25. package/wizishop-angular-components-14.3.14.tgz +0 -0
@@ -1,7 +1,7 @@
1
1
  import { ElementRef, EventEmitter } from "@angular/core";
2
- export interface OptionSelectionHandler {
3
- value: any;
2
+ export interface OptionSelectionHandler<TOptionValue> {
3
+ value: TOptionValue;
4
4
  selected: boolean;
5
- selectedChange: EventEmitter<any>;
5
+ selectedChange: EventEmitter<boolean>;
6
6
  getContentRef(): ElementRef<any>;
7
7
  }
@@ -1,3 +1,3 @@
1
1
  import { InjectionToken } from "@angular/core";
2
2
  import { OptionSelectionHandler } from "./option-selection-handler.interface";
3
- export declare const OPTION_SELECTION_HANDLER: InjectionToken<OptionSelectionHandler>;
3
+ export declare const OPTION_SELECTION_HANDLER: InjectionToken<OptionSelectionHandler<any>>;
@@ -1,24 +1,24 @@
1
1
  import { ChangeDetectorRef, ElementRef, EventEmitter, Renderer2 } from '@angular/core';
2
2
  import { OptionSelectionHandler } from './option-selection-handler.interface';
3
3
  import * as i0 from "@angular/core";
4
- export declare class OptionComponent implements OptionSelectionHandler {
4
+ export declare class OptionComponent<TOptionValue> implements OptionSelectionHandler<TOptionValue> {
5
5
  private renderer;
6
6
  private elementRef;
7
7
  private changeDetectorRef;
8
8
  contentRef: ElementRef;
9
9
  disabled: boolean;
10
- value: any;
10
+ value: TOptionValue;
11
11
  set selected(selected: boolean);
12
12
  get selected(): boolean;
13
13
  _selected: boolean;
14
- selectedChange: EventEmitter<any>;
14
+ selectedChange: EventEmitter<boolean>;
15
15
  constructor(renderer: Renderer2, elementRef: ElementRef, changeDetectorRef: ChangeDetectorRef);
16
16
  onSelectOption(): void;
17
- getValue(): any;
18
- setValue(value: any): void;
17
+ getValue(): TOptionValue;
18
+ setValue(value: TOptionValue): void;
19
19
  isSelected(): boolean;
20
20
  setSelected(selected: boolean): void;
21
21
  getContentRef(): ElementRef<any>;
22
- static ɵfac: i0.ɵɵFactoryDeclaration<OptionComponent, never>;
23
- static ɵcmp: i0.ɵɵComponentDeclaration<OptionComponent, "wac-option", never, { "disabled": "disabled"; "value": "value"; "selected": "selected"; }, { "selectedChange": "selectedChange"; }, never, ["*"], false>;
22
+ static ɵfac: i0.ɵɵFactoryDeclaration<OptionComponent<any>, never>;
23
+ static ɵcmp: i0.ɵɵComponentDeclaration<OptionComponent<any>, "wac-option", never, { "disabled": "disabled"; "value": "value"; "selected": "selected"; }, { "selectedChange": "selectedChange"; }, never, ["*"], false>;
24
24
  }
@@ -1,20 +1,20 @@
1
1
  import { ElementRef, EventEmitter } from '@angular/core';
2
2
  import { OptionSelectionHandler } from './option-selection-handler.interface';
3
3
  import * as i0 from "@angular/core";
4
- export declare class SelectOptionDirective implements OptionSelectionHandler {
4
+ export declare class SelectOptionDirective<TOptionValue> implements OptionSelectionHandler<TOptionValue> {
5
5
  private contentRef;
6
6
  onClick(): void;
7
7
  disabled: boolean;
8
- value: any;
8
+ value: TOptionValue;
9
9
  selected: boolean;
10
- selectedChange: EventEmitter<any>;
10
+ selectedChange: EventEmitter<boolean>;
11
11
  constructor(contentRef: ElementRef);
12
12
  onSelectOption(): void;
13
- getValue(): any;
14
- setValue(value: any): void;
13
+ getValue(): TOptionValue;
14
+ setValue(value: TOptionValue): void;
15
15
  isSelected(): boolean;
16
16
  setSelected(selected: boolean): void;
17
17
  getContentRef(): ElementRef<any>;
18
- static ɵfac: i0.ɵɵFactoryDeclaration<SelectOptionDirective, never>;
19
- static ɵdir: i0.ɵɵDirectiveDeclaration<SelectOptionDirective, "[wacSelectOption]", never, { "disabled": "disabled"; "value": "value"; "selected": "selected"; }, { "selectedChange": "selectedChange"; }, never, never, false>;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<SelectOptionDirective<any>, never>;
19
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SelectOptionDirective<any>, "[wacSelectOption]", never, { "disabled": "disabled"; "value": "value"; "selected": "selected"; }, { "selectedChange": "selectedChange"; }, never, never, false>;
20
20
  }
@@ -1,26 +1,19 @@
1
- import { AfterViewInit, EventEmitter, OnDestroy, OnInit, QueryList } from '@angular/core';
2
- import { ControlValueAccessor } from '@angular/forms';
1
+ import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
3
2
  import { ValueChangeService } from './value-change.service';
4
3
  import { Subject } from 'rxjs';
5
- import { OptionSelectionHandler } from '../option/option-selection-handler.interface';
6
4
  import { SelectSearchTriggerComponent } from '../select-search-trigger/select-search-trigger.component';
7
5
  import { LabelComponent } from '../../common/label/label.component';
6
+ import { SelectDirective } from './select.directive';
8
7
  import * as i0 from "@angular/core";
9
- export declare class SelectTestComponent implements OnInit, ControlValueAccessor, AfterViewInit, OnDestroy {
10
- private valueChangeService;
8
+ export declare class SelectTestComponent<TOptionValue> extends SelectDirective<TOptionValue> implements OnInit, OnDestroy {
9
+ protected valueChangeService: ValueChangeService<TOptionValue>;
11
10
  role: string;
12
- optionChildren: QueryList<OptionSelectionHandler>;
13
11
  customSearchTrigger: SelectSearchTriggerComponent;
14
12
  label: LabelComponent;
15
- set value(value: any);
16
- get value(): any;
17
- _value: any;
18
- valueChange: EventEmitter<any>;
19
13
  /** Whether the component is required. */
20
14
  get required(): boolean;
21
15
  set required(value: boolean);
22
16
  private _required;
23
- disabled: boolean;
24
17
  get selectedOptionContent(): any;
25
18
  set keepPanelOpen(keepPanelOpen: boolean);
26
19
  get keepPanelOpen(): boolean;
@@ -31,25 +24,21 @@ export declare class SelectTestComponent implements OnInit, ControlValueAccessor
31
24
  openPanelChange: EventEmitter<boolean>;
32
25
  enableSearch: boolean;
33
26
  isDestroyed$: Subject<void>;
34
- constructor(valueChangeService: ValueChangeService);
27
+ private isKeyBoardAction;
28
+ constructor(valueChangeService: ValueChangeService<TOptionValue>);
35
29
  ngOnInit(): void;
36
- ngAfterViewInit(): void;
37
- private handleValueChange;
38
- private handleOptionChildren;
30
+ private closeTabOnValueChange;
31
+ private skipIfTriggeredByKeyboardAction;
39
32
  onTogglePanel(): void;
40
33
  onClosePanel(): void;
41
- /** Handles all keydown events on the select. */
42
- _handleKeydown(event: KeyboardEvent): void;
34
+ onKeydown(event: KeyboardEvent): void;
43
35
  /** Handles keyboard events while the select is closed. */
44
36
  private _handleClosedKeydown;
45
37
  /** Handles keyboard events when the selected is open. */
46
38
  private _handleOpenKeydown;
47
- onChange: (value: any) => void;
48
- onTouch: (value: any) => void;
49
- writeValue(value: any): void;
50
- registerOnChange(fn: any): void;
39
+ onSelectTouch: (value: any) => void;
51
40
  registerOnTouched(fn: any): void;
52
41
  ngOnDestroy(): void;
53
- static ɵfac: i0.ɵɵFactoryDeclaration<SelectTestComponent, never>;
54
- static ɵcmp: i0.ɵɵComponentDeclaration<SelectTestComponent, "wac-select-test", never, { "value": "value"; "required": "required"; "disabled": "disabled"; "keepPanelOpen": "keepPanelOpen"; "openPanel": "openPanel"; "enableSearch": "enableSearch"; }, { "valueChange": "valueChange"; "openPanelChange": "openPanelChange"; }, ["customSearchTrigger", "label", "optionChildren"], ["wac-label, .wac-label", "wac-select-search-trigger", "wac-placeholder,[role=placeholder]", "wac-option-call-to-action, wac-option, option, .option, [selectOption]"], false>;
42
+ static ɵfac: i0.ɵɵFactoryDeclaration<SelectTestComponent<any>, never>;
43
+ static ɵcmp: i0.ɵɵComponentDeclaration<SelectTestComponent<any>, "wac-select-test", never, { "required": "required"; "keepPanelOpen": "keepPanelOpen"; "openPanel": "openPanel"; "enableSearch": "enableSearch"; }, { "openPanelChange": "openPanelChange"; }, ["customSearchTrigger", "label"], ["wac-label, .wac-label", "wac-select-search-trigger", "wac-placeholder,[role=placeholder]", "wac-option-call-to-action, wac-option, option, .option, [selectOption]"], false>;
55
44
  }
@@ -0,0 +1,33 @@
1
+ import { AfterViewInit, EventEmitter, OnDestroy, OnInit, QueryList } from '@angular/core';
2
+ import { ControlValueAccessor } from '@angular/forms';
3
+ import { Subject } from 'rxjs';
4
+ import { OptionSelectionHandler } from '../option/option-selection-handler.interface';
5
+ import { ValueChangeService } from './value-change.service';
6
+ import * as i0 from "@angular/core";
7
+ export declare class SelectDirective<TOptionValue> implements OnInit, ControlValueAccessor, AfterViewInit, OnDestroy {
8
+ protected valueChangeService: ValueChangeService<TOptionValue>;
9
+ /** Handles all keydown events on the select. */
10
+ onKeydown(event: KeyboardEvent): void;
11
+ optionChildren: QueryList<OptionSelectionHandler<TOptionValue>>;
12
+ set value(value: TOptionValue);
13
+ get value(): TOptionValue;
14
+ _value: TOptionValue;
15
+ valueChange: EventEmitter<TOptionValue>;
16
+ disabled: boolean;
17
+ isDestroyed$: Subject<void>;
18
+ constructor(valueChangeService: ValueChangeService<TOptionValue>);
19
+ ngOnInit(): void;
20
+ ngAfterViewInit(): void;
21
+ private handleValueChange;
22
+ private handleOptionChildren;
23
+ /** Handles keyboard events when the selected is open. */
24
+ protected handleKeyboardAction(event: KeyboardEvent): void;
25
+ onChange: (value: any) => void;
26
+ onTouch: (value: any) => void;
27
+ writeValue(value: any): void;
28
+ registerOnChange(fn: any): void;
29
+ registerOnTouched(fn: any): void;
30
+ ngOnDestroy(): void;
31
+ static ɵfac: i0.ɵɵFactoryDeclaration<SelectDirective<any>, never>;
32
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SelectDirective<any>, "[wacSelect]", never, { "value": "value"; "disabled": "disabled"; }, { "valueChange": "valueChange"; }, ["optionChildren"], never, false>;
33
+ }
@@ -2,18 +2,18 @@ import { ChangeDetectorRef, OnDestroy, QueryList } from '@angular/core';
2
2
  import { Subject } from 'rxjs';
3
3
  import { OptionComponent } from '../option/option.component';
4
4
  import * as i0 from "@angular/core";
5
- export declare class ValueChangeService implements OnDestroy {
5
+ export declare class ValueChangeService<TOptionValue> implements OnDestroy {
6
6
  private changeDetectorRef;
7
- valueChange$: Subject<any>;
8
- set value(value: any);
9
- get value(): any;
7
+ valueChange$: Subject<TOptionValue>;
8
+ set value(value: TOptionValue);
9
+ get value(): TOptionValue;
10
10
  private _value;
11
- optionChildren: QueryList<OptionComponent>;
11
+ optionChildren: QueryList<OptionComponent<TOptionValue>>;
12
12
  selectedOptionContent: any;
13
13
  indexSelectedOption: number;
14
14
  resetListeners$: Subject<void>;
15
15
  constructor(changeDetectorRef: ChangeDetectorRef);
16
- handleSelectOptionsChange(optionChildren: QueryList<OptionComponent>, value: any): void;
16
+ handleSelectOptionsChange(optionChildren: QueryList<OptionComponent<TOptionValue>>, value: any): void;
17
17
  assignValue(value: any): void;
18
18
  handleValueChange(): void;
19
19
  selectNextOption(): void;
@@ -30,6 +30,6 @@ export declare class ValueChangeService implements OnDestroy {
30
30
  private optionSelectedChangeListeners;
31
31
  private changeSelectedOption;
32
32
  ngOnDestroy(): void;
33
- static ɵfac: i0.ɵɵFactoryDeclaration<ValueChangeService, never>;
34
- static ɵprov: i0.ɵɵInjectableDeclaration<ValueChangeService>;
33
+ static ɵfac: i0.ɵɵFactoryDeclaration<ValueChangeService<any>, never>;
34
+ static ɵprov: i0.ɵɵInjectableDeclaration<ValueChangeService<any>>;
35
35
  }
@@ -6,10 +6,11 @@ import * as i4 from "./zindex-toggle/zindex-toggle.directive";
6
6
  import * as i5 from "./ng-var.directive";
7
7
  import * as i6 from "./keyboard-events/keypress-enter.directive";
8
8
  import * as i7 from "../components/selects/option/select-option.directive";
9
- import * as i8 from "@angular/common";
10
- import * as i9 from "@angular/forms";
9
+ import * as i8 from "../components/selects/select-test/select.directive";
10
+ import * as i9 from "@angular/common";
11
+ import * as i10 from "@angular/forms";
11
12
  export declare class SharedDirectives {
12
13
  static ɵfac: i0.ɵɵFactoryDeclaration<SharedDirectives, never>;
13
- static ɵmod: i0.ɵɵNgModuleDeclaration<SharedDirectives, [typeof i1.DebounceKeyupDirective, typeof i2.AbstractDebounceDirective, typeof i3.AutoHideDirective, typeof i4.ZindexToggleDirective, typeof i5.VarDirective, typeof i6.KeypressEnterDirective, typeof i7.SelectOptionDirective], [typeof i8.CommonModule, typeof i9.FormsModule], [typeof i1.DebounceKeyupDirective, typeof i2.AbstractDebounceDirective, typeof i3.AutoHideDirective, typeof i4.ZindexToggleDirective, typeof i5.VarDirective, typeof i6.KeypressEnterDirective, typeof i7.SelectOptionDirective]>;
14
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SharedDirectives, [typeof i1.DebounceKeyupDirective, typeof i2.AbstractDebounceDirective, typeof i3.AutoHideDirective, typeof i4.ZindexToggleDirective, typeof i5.VarDirective, typeof i6.KeypressEnterDirective, typeof i7.SelectOptionDirective, typeof i8.SelectDirective], [typeof i9.CommonModule, typeof i10.FormsModule], [typeof i1.DebounceKeyupDirective, typeof i2.AbstractDebounceDirective, typeof i3.AutoHideDirective, typeof i4.ZindexToggleDirective, typeof i5.VarDirective, typeof i6.KeypressEnterDirective, typeof i7.SelectOptionDirective, typeof i8.SelectDirective]>;
14
15
  static ɵinj: i0.ɵɵInjectorDeclaration<SharedDirectives>;
15
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wizishop/angular-components",
3
- "version": "14.3.14",
3
+ "version": "14.3.15",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "~14.0.6",
6
6
  "@angular/cdk": "^14.0.5",
package/public-api.d.ts CHANGED
@@ -100,6 +100,8 @@ export * from './lib/directives/keyboard-events/keypress-enter.directive';
100
100
  export * from './lib/components/optional-disable-container/optional-disable-container.component';
101
101
  export * from './lib/components/summary/summary.component';
102
102
  export * from './lib/components/selects/select-test/select.component';
103
+ export * from './lib/components/selects/select-test/value-change.service';
104
+ export * from './lib/components/selects/select-test/select.directive';
103
105
  export * from './lib/components/selects/option/option.component';
104
106
  export * from './lib/components/selects/option-call-to-action/option-call-to-action.component';
105
107
  export * from './lib/components/common/placeholder/placeholder.component';