@wizishop/angular-components 14.3.33 → 14.4.1

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.
@@ -547,7 +547,7 @@ class ValueChangeService {
547
547
  });
548
548
  }
549
549
  updateSelectPlaceholder() {
550
- if (!this.value) {
550
+ if (!this.value && typeof this.value !== 'number') {
551
551
  this.selectedOptionContent = null;
552
552
  return;
553
553
  }
@@ -3809,82 +3809,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
3809
3809
  type: Output
3810
3810
  }] } });
3811
3811
 
3812
- class FindOptionSelectedPipe {
3813
- transform(options, field) {
3814
- const isFieldArray = Array.isArray(field);
3815
- if (!options) {
3816
- return isFieldArray ? [] : '';
3817
- }
3818
- const optionSelected = options.find((item) => item.active);
3819
- if (!optionSelected) {
3820
- return isFieldArray ? [] : '';
3821
- }
3822
- if (isFieldArray) {
3823
- return field.reduce((acc, curr) => {
3824
- return acc[curr];
3825
- }, optionSelected);
3826
- }
3827
- return optionSelected[field];
3812
+ class LabelComponent {
3813
+ constructor() { }
3814
+ ngOnInit() {
3828
3815
  }
3829
3816
  }
3830
- FindOptionSelectedPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: FindOptionSelectedPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3831
- FindOptionSelectedPipepipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.0.7", ngImport: i0, type: FindOptionSelectedPipe, name: "wacFindOptionSelectedField" });
3832
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: FindOptionSelectedPipe, decorators: [{
3833
- type: Pipe,
3834
- args: [{
3835
- name: 'wacFindOptionSelectedField'
3836
- }]
3837
- }] });
3817
+ LabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: LabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3818
+ LabelComponentcmp = 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>" });
3819
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: LabelComponent, decorators: [{
3820
+ type: Component,
3821
+ args: [{ selector: 'wac-label', host: {
3822
+ 'class': 'wac-label'
3823
+ }, template: "<ng-content></ng-content>" }]
3824
+ }], ctorParameters: function () { return []; } });
3838
3825
 
3839
3826
  class InputWithSelectComponent {
3840
- constructor() {
3841
- this.showSelect = false;
3842
- this.inputValueChange = new EventEmitter();
3843
- this.selectValueChange = new EventEmitter();
3844
- }
3845
- onClickItem(index) {
3846
- this.unActiveAll();
3847
- const optionSelected = this.options[index];
3848
- optionSelected.active = true;
3849
- this.showSelect = false;
3850
- this.selectValueChange.emit(index);
3851
- }
3852
- onToggleSelect() {
3853
- this.showSelect = !this.showSelect;
3854
- }
3855
- onCloseSelect() {
3856
- this.showSelect = false;
3857
- }
3858
- onChangeInputValue(e) {
3859
- this.inputValueChange.emit(e.target.value);
3860
- }
3861
- unActiveAll() {
3862
- this.options.forEach((item) => {
3863
- item.active = false;
3864
- });
3865
- }
3866
3827
  }
3867
3828
  InputWithSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: InputWithSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3868
- InputWithSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.7", type: InputWithSelectComponent, selector: "wac-input-with-select", inputs: { label: "label", text: "text", options: "options", placeholder: "placeholder", id: "id", value: "value" }, outputs: { inputValueChange: "inputValueChange", selectValueChange: "selectValueChange" }, ngImport: i0, template: "<div class=\"wac-input-with-select\" [zIndexToggle]=\"showSelect\">\n <label class=\"wac-input-with-select__label\" [for]=\"id\" [innerHTML]=\"label\"></label>\n <div class=\"wac-input-with-select__wrapper\">\n <div class=\"wac-input-with-select__wrapper__left\" wzAutoHide (clickOutside)=\"onCloseSelect()\">\n <input [id]=\"id\" type=\"text\" [placeholder]=\"placeholder\" [(ngModel)]=\"value\" (ngModelChange)=\"onChangeInputValue($event)\"/>\n <div class=\"wac-input-with-select__wrapper__left__current\">\n <span (click)=\"onToggleSelect()\">{{ options | wacFindOptionSelectedField: 'label' }}</span>\n </div>\n <div class=\"wac-input-with-select__wrapper__left__select\" *ngIf=\"showSelect\">\n <div class=\"wac-input-with-select__wrapper__left__select__item\" *ngFor=\"let option of options; let index = index\">\n <div (click)=\"onClickItem(index)\">{{ option.label }}</div>\n </div>\n </div>\n </div>\n <div class=\"wac-input-with-select__wrapper__right\">\n <p [innerHTML]=\"text\"></p>\n </div>\n </div>\n</div>\n", dependencies: [{ 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: 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: "pipe", type: FindOptionSelectedPipe, name: "wacFindOptionSelectedField" }] });
3829
+ InputWithSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.7", type: InputWithSelectComponent, selector: "wac-input-with-select", queries: [{ propertyName: "label", first: true, predicate: LabelComponent, 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<div class=\"wac-input-with-select\">\n <div class=\"wac-input-with-select__wrapper\">\n <div class=\"wac-input-with-select__wrapper__left\">\n <ng-content select=\"input\"></ng-content>\n <ng-content select=\"wac-select-test\"></ng-content>\n </div>\n <div class=\"wac-input-with-select__wrapper__right\">\n <ng-content select=\"[text]\"></ng-content>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], encapsulation: i0.ViewEncapsulation.None });
3869
3830
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: InputWithSelectComponent, decorators: [{
3870
3831
  type: Component,
3871
- args: [{ selector: 'wac-input-with-select', template: "<div class=\"wac-input-with-select\" [zIndexToggle]=\"showSelect\">\n <label class=\"wac-input-with-select__label\" [for]=\"id\" [innerHTML]=\"label\"></label>\n <div class=\"wac-input-with-select__wrapper\">\n <div class=\"wac-input-with-select__wrapper__left\" wzAutoHide (clickOutside)=\"onCloseSelect()\">\n <input [id]=\"id\" type=\"text\" [placeholder]=\"placeholder\" [(ngModel)]=\"value\" (ngModelChange)=\"onChangeInputValue($event)\"/>\n <div class=\"wac-input-with-select__wrapper__left__current\">\n <span (click)=\"onToggleSelect()\">{{ options | wacFindOptionSelectedField: 'label' }}</span>\n </div>\n <div class=\"wac-input-with-select__wrapper__left__select\" *ngIf=\"showSelect\">\n <div class=\"wac-input-with-select__wrapper__left__select__item\" *ngFor=\"let option of options; let index = index\">\n <div (click)=\"onClickItem(index)\">{{ option.label }}</div>\n </div>\n </div>\n </div>\n <div class=\"wac-input-with-select__wrapper__right\">\n <p [innerHTML]=\"text\"></p>\n </div>\n </div>\n</div>\n" }]
3872
- }], ctorParameters: function () { return []; }, propDecorators: { label: [{
3873
- type: Input
3874
- }], text: [{
3875
- type: Input
3876
- }], options: [{
3877
- type: Input
3878
- }], placeholder: [{
3879
- type: Input
3880
- }], id: [{
3881
- type: Input
3882
- }], value: [{
3883
- type: Input
3884
- }], inputValueChange: [{
3885
- type: Output
3886
- }], selectValueChange: [{
3887
- type: Output
3832
+ args: [{ selector: 'wac-input-with-select', 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<div class=\"wac-input-with-select\">\n <div class=\"wac-input-with-select__wrapper\">\n <div class=\"wac-input-with-select__wrapper__left\">\n <ng-content select=\"input\"></ng-content>\n <ng-content select=\"wac-select-test\"></ng-content>\n </div>\n <div class=\"wac-input-with-select__wrapper__right\">\n <ng-content select=\"[text]\"></ng-content>\n </div>\n </div>\n</div>\n" }]
3833
+ }], propDecorators: { label: [{
3834
+ type: ContentChild,
3835
+ args: [LabelComponent]
3888
3836
  }] } });
3889
3837
 
3890
3838
  class PopinComponent {
@@ -4644,6 +4592,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
4644
4592
  }]
4645
4593
  }] });
4646
4594
 
4595
+ class FindOptionSelectedPipe {
4596
+ transform(options, field) {
4597
+ const isFieldArray = Array.isArray(field);
4598
+ if (!options) {
4599
+ return isFieldArray ? [] : '';
4600
+ }
4601
+ const optionSelected = options.find((item) => item.active);
4602
+ if (!optionSelected) {
4603
+ return isFieldArray ? [] : '';
4604
+ }
4605
+ if (isFieldArray) {
4606
+ return field.reduce((acc, curr) => {
4607
+ return acc[curr];
4608
+ }, optionSelected);
4609
+ }
4610
+ return optionSelected[field];
4611
+ }
4612
+ }
4613
+ FindOptionSelectedPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: FindOptionSelectedPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
4614
+ FindOptionSelectedPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.0.7", ngImport: i0, type: FindOptionSelectedPipe, name: "wacFindOptionSelectedField" });
4615
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: FindOptionSelectedPipe, decorators: [{
4616
+ type: Pipe,
4617
+ args: [{
4618
+ name: 'wacFindOptionSelectedField'
4619
+ }]
4620
+ }] });
4621
+
4647
4622
  const exportedPipes = [
4648
4623
  FormatObjectToRecursifTreePipe,
4649
4624
  FormatObjectToSimpleTreePipe,
@@ -4733,20 +4708,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
4733
4708
  args: ['searchInput']
4734
4709
  }] } });
4735
4710
 
4736
- class LabelComponent {
4737
- constructor() { }
4738
- ngOnInit() {
4739
- }
4740
- }
4741
- LabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: LabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4742
- 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>" });
4743
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: LabelComponent, decorators: [{
4744
- type: Component,
4745
- args: [{ selector: 'wac-label', host: {
4746
- 'class': 'wac-label'
4747
- }, template: "<ng-content></ng-content>" }]
4748
- }], ctorParameters: function () { return []; } });
4749
-
4750
4711
  class SelectTestComponent extends SelectDirective {
4751
4712
  constructor(valueChangeService) {
4752
4713
  super(valueChangeService);