@wizishop/angular-components 14.4.62 → 14.4.64

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.component.mjs +6 -3
  3. package/esm2020/lib/components/selects/option/select-option.directive.mjs +6 -1
  4. package/esm2020/lib/components/selects/option-call-to-action/option-call-to-action.component.mjs +1 -1
  5. package/esm2020/lib/components/selects/select/select.component.mjs +3 -3
  6. package/esm2020/lib/components/selects/select/select.directive.mjs +12 -2
  7. package/esm2020/lib/components/selects/select/value-change.service.mjs +52 -11
  8. package/esm2020/lib/utils/array.mjs +2 -0
  9. package/esm2020/lib/utils/uuid.mjs +8 -0
  10. package/esm2020/public-api.mjs +2 -1
  11. package/fesm2015/wizishop-angular-components.mjs +83 -16
  12. package/fesm2015/wizishop-angular-components.mjs.map +1 -1
  13. package/fesm2020/wizishop-angular-components.mjs +82 -16
  14. package/fesm2020/wizishop-angular-components.mjs.map +1 -1
  15. package/lib/components/selects/option/option-selection-handler.interface.d.ts +1 -0
  16. package/lib/components/selects/option/option.component.d.ts +1 -0
  17. package/lib/components/selects/option/select-option.directive.d.ts +2 -0
  18. package/lib/components/selects/select/select.directive.d.ts +8 -5
  19. package/lib/components/selects/select/value-change.service.d.ts +15 -5
  20. package/lib/utils/array.d.ts +1 -0
  21. package/lib/utils/uuid.d.ts +1 -0
  22. package/package.json +1 -1
  23. package/public-api.d.ts +1 -0
  24. package/wizishop-angular-components-14.4.64.tgz +0 -0
  25. package/wizishop-angular-components-14.4.62.tgz +0 -0
@@ -6,4 +6,5 @@ export interface OptionSelectionHandler<TOptionValue> {
6
6
  getContentRef(): ElementRef<any>;
7
7
  setDisabledState(isDisabled: boolean): void;
8
8
  setSelected(selected: boolean): void;
9
+ setMultiple(multiple: boolean): void;
9
10
  }
@@ -5,6 +5,7 @@ export declare class OptionComponent<TOptionValue> extends SelectOptionDirective
5
5
  protected contentRef: ElementRef;
6
6
  protected changeDetectorRef: ChangeDetectorRef;
7
7
  contentOption: ElementRef;
8
+ checkBoxId: string;
8
9
  constructor(contentRef: ElementRef, changeDetectorRef: ChangeDetectorRef);
9
10
  getContentRef(): ElementRef<any>;
10
11
  static ɵfac: i0.ɵɵFactoryDeclaration<OptionComponent<any>, never>;
@@ -14,6 +14,7 @@ export declare class SelectOptionDirective<TOptionValue> implements OptionSelect
14
14
  selected: boolean;
15
15
  onClickEventPreventDefault: boolean;
16
16
  selectedChange: EventEmitter<boolean>;
17
+ multiple: boolean;
17
18
  constructor(contentRef: ElementRef, changeDetectorRef: ChangeDetectorRef);
18
19
  setSelected(selected: boolean): void;
19
20
  onSelectOption(): void;
@@ -22,6 +23,7 @@ export declare class SelectOptionDirective<TOptionValue> implements OptionSelect
22
23
  isSelected(): boolean;
23
24
  getContentRef(): ElementRef<any>;
24
25
  setDisabledState(isDisabled: boolean): void;
26
+ setMultiple(multiple: boolean): void;
25
27
  static ɵfac: i0.ɵɵFactoryDeclaration<SelectOptionDirective<any>, never>;
26
28
  static ɵdir: i0.ɵɵDirectiveDeclaration<SelectOptionDirective<any>, "[wacOption]", ["wacOption"], { "disabled": "disabled"; "value": "value"; "selected": "selected"; "onClickEventPreventDefault": "onClickEventPreventDefault"; }, { "selectedChange": "selectedChange"; }, never, never, false>;
27
29
  }
@@ -11,10 +11,13 @@ export declare class SelectDirective<TOptionValue> implements OnInit, ControlVal
11
11
  /** Handles all keydown events on the select. */
12
12
  onKeydown(event: KeyboardEvent): void;
13
13
  optionChildren: QueryList<OptionSelectionHandler<TOptionValue>>;
14
- set value(value: TOptionValue);
15
- get value(): TOptionValue;
16
- _value: TOptionValue;
17
- valueChange: EventEmitter<TOptionValue>;
14
+ set value(value: TOptionValue | TOptionValue[]);
15
+ get value(): TOptionValue | TOptionValue[];
16
+ _value: TOptionValue | TOptionValue[];
17
+ valueChange: EventEmitter<any>;
18
+ get multiple(): boolean;
19
+ set multiple(value: boolean);
20
+ private _multiple;
18
21
  set disabled(disabled: boolean);
19
22
  get disabled(): boolean;
20
23
  _disabled: boolean;
@@ -35,5 +38,5 @@ export declare class SelectDirective<TOptionValue> implements OnInit, ControlVal
35
38
  setDisabledState(isDisabled: boolean): void;
36
39
  ngOnDestroy(): void;
37
40
  static ɵfac: i0.ɵɵFactoryDeclaration<SelectDirective<any>, never>;
38
- static ɵdir: i0.ɵɵDirectiveDeclaration<SelectDirective<any>, "[wacSelect]", ["wacSelect"], { "value": "value"; "disabled": "disabled"; "tabIndex": "tabIndex"; }, { "valueChange": "valueChange"; }, ["optionChildren"], never, false>;
41
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SelectDirective<any>, "[wacSelect]", ["wacSelect"], { "value": "value"; "multiple": "multiple"; "disabled": "disabled"; "tabIndex": "tabIndex"; }, { "valueChange": "valueChange"; }, ["optionChildren"], never, false>;
39
42
  }
@@ -4,9 +4,10 @@ import { OptionComponent } from '../option/option.component';
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class ValueChangeService<TOptionValue> implements OnDestroy {
6
6
  private changeDetectorRef;
7
- valueChange$: Subject<TOptionValue>;
8
- set value(value: TOptionValue);
9
- get value(): TOptionValue;
7
+ valueChange$: Subject<TOptionValue | TOptionValue[]>;
8
+ set value(value: TOptionValue | TOptionValue[]);
9
+ get value(): TOptionValue | TOptionValue[];
10
+ multiple: boolean;
10
11
  private _value;
11
12
  disabled: boolean;
12
13
  optionChildren: QueryList<OptionComponent<TOptionValue>>;
@@ -15,21 +16,30 @@ export declare class ValueChangeService<TOptionValue> implements OnDestroy {
15
16
  resetListeners$: Subject<void>;
16
17
  constructor(changeDetectorRef: ChangeDetectorRef);
17
18
  handleSelectOptionsChange(optionChildren: QueryList<OptionComponent<TOptionValue>>, value: any): void;
18
- assignValue(value: any): void;
19
+ assignValue(value: TOptionValue | TOptionValue[]): void;
19
20
  handleValueChange(): void;
20
21
  setDisabledState(isDisabled: boolean): void;
21
22
  selectNextOption(): void;
22
23
  selectPreviousOption(): void;
23
24
  searchOptionByFirstLetter(letter: string): void;
25
+ setMultiple(value: boolean): void;
24
26
  private indexOfMatchedOption;
25
27
  private isNotNull;
26
28
  private highestAndClosestIndex;
29
+ private handleMultipleSelection;
27
30
  private handleInitialSelectedOption;
31
+ private mustUpdateValueWithInitialSelectedOptionValues;
28
32
  private handleSelectedOptionsEvent;
29
33
  private updateSelectPlaceholder;
30
- private getSelectedOptionComponent;
34
+ private getSelectedOptionsContent;
35
+ private getSelectedOptionComponents;
36
+ private getSelectedOptionsValues;
31
37
  private optionSelectedChangeListeners;
32
38
  private changeSelectedOption;
39
+ /**
40
+ * May not work with objects values
41
+ */
42
+ private isSelectedValue;
33
43
  ngOnDestroy(): void;
34
44
  static ɵfac: i0.ɵɵFactoryDeclaration<ValueChangeService<any>, never>;
35
45
  static ɵprov: i0.ɵɵInjectableDeclaration<ValueChangeService<any>>;
@@ -0,0 +1 @@
1
+ export declare const compareArrays: <TItem>(a: TItem[], b: TItem[]) => boolean;
@@ -0,0 +1 @@
1
+ export declare const uuid: () => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wizishop/angular-components",
3
- "version": "14.4.62",
3
+ "version": "14.4.64",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "~14.0.6",
6
6
  "@angular/cdk": "^14.0.5",
package/public-api.d.ts CHANGED
@@ -55,6 +55,7 @@ export * from './lib/directives/zindex-toggle/zindex-toggle.directive';
55
55
  export * from './lib/directives/keyboard-events/only-numbers.directive';
56
56
  export * from './lib/directives/ng-var.directive';
57
57
  export * from './lib/utils/html-container.class';
58
+ export * from './lib/utils/uuid';
58
59
  export * from './lib/components/selects/call-to-action.model';
59
60
  export * from './lib/components/table/shared/filters-table.service';
60
61
  export * from './lib/components/table/shared/table-filters.model';