@wizishop/angular-components 0.0.72 → 0.0.73

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 (32) hide show
  1. package/angular-components.scss +2602 -2602
  2. package/bundles/wizishop-angular-components.umd.js +160 -10
  3. package/bundles/wizishop-angular-components.umd.js.map +1 -1
  4. package/bundles/wizishop-angular-components.umd.min.js +2 -2
  5. package/bundles/wizishop-angular-components.umd.min.js.map +1 -1
  6. package/esm2015/lib/components/button/button.component.js +4 -2
  7. package/esm2015/lib/components/inputs/input/input.component.js +2 -3
  8. package/esm2015/lib/components/shared-components.module.js +7 -3
  9. package/esm2015/lib/components/tag/tag.component.js +11 -6
  10. package/esm2015/lib/components/tree/tree.component.js +17 -0
  11. package/esm2015/lib/components/tree/tree.dto.js +2 -0
  12. package/esm2015/lib/components/tree/tree.module.js +20 -0
  13. package/esm2015/lib/pipes/shared-pipes.module.js +16 -0
  14. package/esm2015/lib/pipes/tree/format-object-to-recursif-tree.pipe.js +32 -0
  15. package/esm2015/lib/pipes/tree/format-object-to-simple-tree.pipe.js +41 -0
  16. package/esm2015/lib/wizi-components.module.js +4 -2
  17. package/esm2015/public-api.js +6 -1
  18. package/fesm2015/wizishop-angular-components.js +134 -12
  19. package/fesm2015/wizishop-angular-components.js.map +1 -1
  20. package/lib/components/button/button.component.d.ts +1 -0
  21. package/lib/components/tag/tag.component.d.ts +3 -1
  22. package/lib/components/tree/tree.component.d.ts +8 -0
  23. package/lib/components/tree/tree.dto.d.ts +6 -0
  24. package/lib/components/tree/tree.module.d.ts +2 -0
  25. package/lib/pipes/shared-pipes.module.d.ts +2 -0
  26. package/lib/pipes/tree/format-object-to-recursif-tree.pipe.d.ts +6 -0
  27. package/lib/pipes/tree/format-object-to-simple-tree.pipe.d.ts +7 -0
  28. package/package.json +1 -1
  29. package/public-api.d.ts +5 -0
  30. package/wizishop-angular-components-0.0.73.tgz +0 -0
  31. package/wizishop-angular-components.metadata.json +1 -1
  32. package/wizishop-angular-components-0.0.72.tgz +0 -0
@@ -1,5 +1,5 @@
1
1
  import { NwbFilterRoutingBuilder, NwbAllModule } from '@wizishop/ng-wizi-bulma';
2
- import { Component, ViewEncapsulation, Input, EventEmitter, Output, Directive, HostListener, ɵɵdefineInjectable, ɵɵinject, ComponentFactoryResolver, ApplicationRef, INJECTOR, Injectable, Injector, ElementRef, Renderer2, NgModule, ViewChild, Pipe, Inject } from '@angular/core';
2
+ import { Component, ViewEncapsulation, Input, EventEmitter, Output, Directive, HostListener, ɵɵdefineInjectable, ɵɵinject, ComponentFactoryResolver, ApplicationRef, INJECTOR, Injectable, Injector, ElementRef, Renderer2, NgModule, ViewChild, Pipe, Inject, ContentChild } from '@angular/core';
3
3
  import { CommonModule, DOCUMENT } from '@angular/common';
4
4
  import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms';
5
5
  import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
@@ -517,13 +517,16 @@ class TagComponent {
517
517
  constructor() {
518
518
  this.label = '';
519
519
  this.hasClose = false;
520
- this.isOpen = true;
521
520
  this.big = false;
521
+ this.isOpen = true;
522
+ this.isOpenChange = new EventEmitter();
522
523
  }
523
524
  closeTag() {
524
- if (this.hasClose) {
525
- this.isOpen = false;
525
+ if (!this.hasClose) {
526
+ return;
526
527
  }
528
+ this.isOpen = false;
529
+ this.isOpenChange.next(this.isOpen);
527
530
  }
528
531
  }
529
532
  TagComponent.decorators = [
@@ -537,7 +540,9 @@ TagComponent.propDecorators = {
537
540
  label: [{ type: Input }],
538
541
  class: [{ type: Input }],
539
542
  hasClose: [{ type: Input }],
540
- big: [{ type: Input }]
543
+ big: [{ type: Input }],
544
+ isOpen: [{ type: Input }],
545
+ isOpenChange: [{ type: Output }]
541
546
  };
542
547
 
543
548
  class TabComponent {
@@ -574,6 +579,7 @@ class ButtonComponent {
574
579
  this.label = '';
575
580
  this.icon = '';
576
581
  this.widthAuto = false;
582
+ this.contentHorizontalPosition = 'left';
577
583
  this.iconFontSize = 12;
578
584
  this.hasLoader = false;
579
585
  this.disabled = false;
@@ -665,7 +671,7 @@ class ButtonComponent {
665
671
  ButtonComponent.decorators = [
666
672
  { type: Component, args: [{
667
673
  selector: 'wac-button',
668
- template: "<a\n [class]=\"'wac-button ' + extraClasses\"\n (click)=\"confirmDelete && waitForConfirmDelete ? addMaxWidthDelete() : '';onButtonClick($event);\"\n (mouseleave)=\"animation ? resetMaxWidth() : '';\"\n (mouseenter)=\"animation ? addMaxWidth() : '';\"\n wzAutoHide (clickOutside)=\"confirmDelete && !waitForConfirmDelete ? resetMaxWidthDelete() : ''\"\n [ngClass]=\"[label === '' ? 'alone' : '',animationRight ? 'animation-right' : '', animation ? 'animationText' : '', isLoading ? 'is-loading' : '', opacity ? 'opacity' : '', disabled ? 'disabled' : '', widthAuto ? 'width-auto' : '', whiteSpaceNowrap ? 'white-space-no-wrap' : '', !waitForConfirmDelete && confirmDelete ? 'step-delete' : '', confirmDelete ? 'deletePosition-' + confirmDeletePosition : '']\"\n>\n <span class=\"wac-button__wrapper\">\n <i *ngIf=\"icon !== ''\" [ngClass]=\"icon\" [style.font-size.px]=\"iconFontSize\"></i>\n {{ label }}\n <i *ngIf=\"iconNext !== ''\" [ngClass]=\"iconNext\" [style.font-size.px]=\"iconFontSize\"></i>\n </span>\n <span class=\"wac-button__animation\" [style.maxWidth]=\"buttonMaxWidth\" [style.width]=\"buttonWidth + 'px'\">\n <span #calculWidth class=\"wac-button__animation__text\" [innerHTML]=\"animationText\"></span>\n </span>\n <span class=\"wac-button__confirmDelete\" [style.maxWidth]=\"buttonMaxWidthDelete\" [style.width]=\"buttonWidthDelete + 'px'\">\n <span #calculWidthDelete class=\"wac-button__confirmDelete__text\" [innerHTML]=\"confirmDeleteText\"></span>\n </span>\n <span\n class=\"wac-button__loader\"\n [ngClass]=\"extraClasses.includes('is-outlined') ? 'outlined' : ''\"\n *ngIf=\"isLoading || interval !== null\"\n [style.width]=\"currentLoading + '%'\"\n >\n <span *ngIf=\"extraClasses.includes('is-outlined')\">\n <i *ngIf=\"icon !== ''\" [ngClass]=\"icon\" [style.font-size.px]=\"iconFontSize\"></i>\n {{ label }}\n <i *ngIf=\"iconNext !== ''\" [ngClass]=\"iconNext\" [style.font-size.px]=\"iconFontSize\"></i>\n </span>\n\n </span>\n</a>\n"
674
+ template: "<a\n [class]=\"'wac-button ' + extraClasses\"\n (click)=\"confirmDelete && waitForConfirmDelete ? addMaxWidthDelete() : '';onButtonClick($event);\"\n (mouseleave)=\"animation ? resetMaxWidth() : '';\"\n (mouseenter)=\"animation ? addMaxWidth() : '';\"\n wzAutoHide (clickOutside)=\"confirmDelete && !waitForConfirmDelete ? resetMaxWidthDelete() : ''\"\n [ngClass]=\"[\n label === '' ? 'alone' : '',\n animationRight ? 'animation-right' : '',\n animation ? 'animationText' : '',\n isLoading ? 'is-loading' : '',\n opacity ? 'opacity' : '',\n disabled ? 'disabled' : '',\n widthAuto ? 'width-auto' : '',\n whiteSpaceNowrap ? 'white-space-no-wrap' : '',\n !waitForConfirmDelete && confirmDelete ? 'step-delete' : '',\n confirmDelete ? 'deletePosition-' + confirmDeletePosition : ''\n ]\"\n [ngStyle]=\"{\n 'text-align': contentHorizontalPosition\n }\"\n>\n <span class=\"wac-button__wrapper\">\n <i *ngIf=\"icon !== ''\" [ngClass]=\"icon\" [style.font-size.px]=\"iconFontSize\"></i>\n {{ label }}\n <i *ngIf=\"iconNext !== ''\" [ngClass]=\"iconNext\" [style.font-size.px]=\"iconFontSize\"></i>\n </span>\n <span class=\"wac-button__animation\" [style.maxWidth]=\"buttonMaxWidth\" [style.width]=\"buttonWidth + 'px'\">\n <span #calculWidth class=\"wac-button__animation__text\" [innerHTML]=\"animationText\"></span>\n </span>\n <span class=\"wac-button__confirmDelete\" [style.maxWidth]=\"buttonMaxWidthDelete\" [style.width]=\"buttonWidthDelete + 'px'\">\n <span #calculWidthDelete class=\"wac-button__confirmDelete__text\" [innerHTML]=\"confirmDeleteText\"></span>\n </span>\n <span\n class=\"wac-button__loader\"\n [ngClass]=\"extraClasses.includes('is-outlined') ? 'outlined' : ''\"\n *ngIf=\"isLoading || interval !== null\"\n [style.width]=\"currentLoading + '%'\"\n >\n <span *ngIf=\"extraClasses.includes('is-outlined')\">\n <i *ngIf=\"icon !== ''\" [ngClass]=\"icon\" [style.font-size.px]=\"iconFontSize\"></i>\n {{ label }}\n <i *ngIf=\"iconNext !== ''\" [ngClass]=\"iconNext\" [style.font-size.px]=\"iconFontSize\"></i>\n </span>\n\n </span>\n</a>\n"
669
675
  },] }
670
676
  ];
671
677
  ButtonComponent.ctorParameters = () => [];
@@ -675,6 +681,7 @@ ButtonComponent.propDecorators = {
675
681
  icon: [{ type: Input }],
676
682
  iconNext: [{ type: Input }],
677
683
  widthAuto: [{ type: Input }],
684
+ contentHorizontalPosition: [{ type: Input }],
678
685
  iconFontSize: [{ type: Input }],
679
686
  hasLoader: [{ type: Input }],
680
687
  disabled: [{ type: Input }],
@@ -1436,7 +1443,7 @@ class InputComponent {
1436
1443
  this.indication = false;
1437
1444
  this.success = false;
1438
1445
  this.keypressEnter = new EventEmitter();
1439
- this.KEYPRESS_ENTER = "13";
1446
+ this.KEYPRESS_ENTER = "Enter";
1440
1447
  this.id = 'wz-input_' +
1441
1448
  Math.random()
1442
1449
  .toString(36)
@@ -1478,7 +1485,6 @@ class InputComponent {
1478
1485
  }
1479
1486
  }
1480
1487
  keyPress(event) {
1481
- console.log('event', event);
1482
1488
  if (this.keyPreventDefault.includes(event.key)) {
1483
1489
  event.preventDefault();
1484
1490
  }
@@ -3292,6 +3298,119 @@ SelectedListComponent.propDecorators = {
3292
3298
  unSelectedItemsAll: [{ type: Output }]
3293
3299
  };
3294
3300
 
3301
+ class TreeComponent {
3302
+ constructor() { }
3303
+ ngOnInit() { }
3304
+ }
3305
+ TreeComponent.decorators = [
3306
+ { type: Component, args: [{
3307
+ selector: 'wac-tree',
3308
+ template: "<div *ngFor=\"let item of items; index as i\">\n <ul>\n <li>\n\n <ng-template #defaultItem>\n {{ item?.treeLabel }}\n </ng-template>\n\n <ng-container\n [ngTemplateOutlet]=\"optionTemplateRef || defaultItem\"\n [ngTemplateOutletContext]=\"{ $implicit: item, index: i }\"\n >\n </ng-container>\n\n <wac-tree [items]=\"item.treeChildren\" *ngIf=\"item.treeChildren?.length\"></wac-tree>\n </li>\n </ul>\n</div>"
3309
+ },] }
3310
+ ];
3311
+ TreeComponent.ctorParameters = () => [];
3312
+ TreeComponent.propDecorators = {
3313
+ items: [{ type: Input }],
3314
+ optionTemplateRef: [{ type: ContentChild, args: ["optionTemplate", { static: false },] }]
3315
+ };
3316
+
3317
+ class FormatObjectToRecursifTreePipe {
3318
+ constructor() {
3319
+ this.childrenProperties = [];
3320
+ }
3321
+ transform(objectList, childrenProperties) {
3322
+ this.childrenProperties = childrenProperties;
3323
+ objectList.forEach(object => this.recursiveFormatObjectToRecursifTree(object));
3324
+ return objectList;
3325
+ }
3326
+ recursiveFormatObjectToRecursifTree(object) {
3327
+ for (const childrenProperty of this.childrenProperties) {
3328
+ if (!object.hasOwnProperty(childrenProperty)) {
3329
+ continue;
3330
+ }
3331
+ if (Array.isArray(object[childrenProperty])) {
3332
+ throw `Property : "${childrenProperty}", is not an array. it could not be transform to a recursive list.`;
3333
+ }
3334
+ // Add treeChildren property filled with name children property
3335
+ object.treeChildren = object[childrenProperty];
3336
+ // call this function recursively until no children can be generated
3337
+ this.recursiveFormatObjectToRecursifTree(object.treeChildren);
3338
+ break;
3339
+ }
3340
+ }
3341
+ }
3342
+ FormatObjectToRecursifTreePipe.decorators = [
3343
+ { type: Pipe, args: [{
3344
+ name: 'formatObjectToRecursifTree'
3345
+ },] }
3346
+ ];
3347
+
3348
+ class FormatObjectToSimpleTreePipe {
3349
+ constructor() {
3350
+ this.childrenProperties = [];
3351
+ this.labelProperties = [];
3352
+ }
3353
+ transform(objectList, childrenProperties, labelProperties) {
3354
+ this.childrenProperties = childrenProperties;
3355
+ this.labelProperties = labelProperties;
3356
+ objectList.forEach(object => this.recursiveFormatObjectToSimpleTree(object));
3357
+ return objectList;
3358
+ }
3359
+ recursiveFormatObjectToSimpleTree(object) {
3360
+ for (const property in object) {
3361
+ if (!Object.prototype.hasOwnProperty.call(object, property)) {
3362
+ continue;
3363
+ }
3364
+ if (this.labelProperties.includes(property)) {
3365
+ object.treeLabel = object[property];
3366
+ continue;
3367
+ }
3368
+ if (!this.childrenProperties.includes(property)) {
3369
+ continue;
3370
+ }
3371
+ if (Array.isArray(object[property])) {
3372
+ throw `Property : "${property}", is not an array. it could not be transform to a recursive list.`;
3373
+ }
3374
+ // Add treeChildren property filled with name children property
3375
+ object.treeChildren = object[property];
3376
+ // call this function recursively until no children can be generated
3377
+ this.recursiveFormatObjectToSimpleTree(object.treeChildren);
3378
+ break;
3379
+ }
3380
+ }
3381
+ }
3382
+ FormatObjectToSimpleTreePipe.decorators = [
3383
+ { type: Pipe, args: [{
3384
+ name: 'formatObjectToSimpleTree'
3385
+ },] }
3386
+ ];
3387
+
3388
+ const exportedPipes = [FormatObjectToRecursifTreePipe, FormatObjectToSimpleTreePipe];
3389
+ class SharedPipes {
3390
+ }
3391
+ SharedPipes.decorators = [
3392
+ { type: NgModule, args: [{
3393
+ imports: [CommonModule, FormsModule],
3394
+ declarations: exportedPipes,
3395
+ exports: exportedPipes
3396
+ },] }
3397
+ ];
3398
+
3399
+ class TreeModule {
3400
+ }
3401
+ TreeModule.decorators = [
3402
+ { type: NgModule, args: [{
3403
+ imports: [
3404
+ CommonModule,
3405
+ FormsModule,
3406
+ SharedPipes
3407
+ ],
3408
+ exports: [TreeComponent],
3409
+ declarations: [TreeComponent],
3410
+ providers: [],
3411
+ },] }
3412
+ ];
3413
+
3295
3414
  const components = [
3296
3415
  TagComponent,
3297
3416
  TabComponent,
@@ -3347,7 +3466,8 @@ const exportsFromModule = [
3347
3466
  TooltipComponent,
3348
3467
  CheckboxComponent,
3349
3468
  LoaderComponent,
3350
- ProgressBarComponent
3469
+ ProgressBarComponent,
3470
+ TreeComponent
3351
3471
  ];
3352
3472
  class SharedComponentsModule {
3353
3473
  }
@@ -3372,7 +3492,8 @@ SharedComponentsModule.decorators = [
3372
3492
  ProgressBarModule,
3373
3493
  PerfectScrollbarModule,
3374
3494
  AlertPopupModule,
3375
- RouterModule
3495
+ RouterModule,
3496
+ TreeModule
3376
3497
  ],
3377
3498
  declarations: components,
3378
3499
  exports: [...components, ...exportsFromModule]
@@ -3387,9 +3508,10 @@ WiziComponentsModule.decorators = [
3387
3508
  CommonModule,
3388
3509
  SharedComponentsModule,
3389
3510
  SharedDirectives,
3511
+ SharedPipes,
3390
3512
  NwbAllModule
3391
3513
  ],
3392
- exports: [SharedComponentsModule, SharedDirectives]
3514
+ exports: [SharedComponentsModule, SharedDirectives, SharedPipes]
3393
3515
  },] }
3394
3516
  ];
3395
3517
 
@@ -3401,5 +3523,5 @@ WiziComponentsModule.decorators = [
3401
3523
  * Generated bundle index. Do not edit.
3402
3524
  */
3403
3525
 
3404
- export { AbstractDebounceDirective, AlertComponent, AlertPopupComponent, AlertPopupModule, AlertPopupService, AutoHideDirective, BackComponent, BlockComponent, ButtonComponent, CalendarComponent, CheckBoxRow, CheckboxComponent, DebounceKeyupDirective, DeleteComponent, DropdownComponent, FiltersComponent, FiltersTableService, FreePopinComponent, H1Component, H2Component, H3Component, H4Component, HeaderPageComponent, HtmlContainer, ImageComponent, InfoComponent, InputComponent, InputSearchComponent, InputWithSelectComponent, LabelComponent, LinkComponent, LoaderComponent, LogoComponent, MultipleSearchComponent, MultipleSearchPlusComponent, PaginationComponent, PopinComponent, ProgressBarComponent, RadioComponent, SearchComponent, SelectComponent, SelectInTextComponent, SelectedListComponent, SeparatorComponent, SettingsComponent, SharedComponentsModule, SharedDirectives, SnackbarComponent, StateComponent, SwitchComponent, TabComponent, TableColumn, TableColumnHeader, TableComponent, TableRow, TagComponent, TextAreaComponent, TextComponent, TooltipComponent, UploadComponent, WiziComponentsModule, WrapperBlocsComponent, WrapperComponent, WzEditInPlaceComponent, ZindexToggleDirective, DomService as ɵa, PaginationModule as ɵb, PagniationArrayTotalPages as ɵc, PagniationIsLastPage as ɵd, PagniationText as ɵe, TableModule as ɵf, InputSearchModule as ɵg, InputModule as ɵh, TooltipModule as ɵi, ProgressBarModule as ɵj, LoaderModule as ɵk, CheckboxModule as ɵl, inOutY as ɵm, inOutX as ɵn };
3526
+ export { AbstractDebounceDirective, AlertComponent, AlertPopupComponent, AlertPopupModule, AlertPopupService, 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, LabelComponent, LinkComponent, LoaderComponent, LogoComponent, MultipleSearchComponent, MultipleSearchPlusComponent, PaginationComponent, PopinComponent, ProgressBarComponent, RadioComponent, SearchComponent, SelectComponent, SelectInTextComponent, SelectedListComponent, SeparatorComponent, SettingsComponent, SharedComponentsModule, SharedDirectives, SharedPipes, SnackbarComponent, StateComponent, SwitchComponent, TabComponent, TableColumn, TableColumnHeader, TableComponent, TableRow, TagComponent, TextAreaComponent, TextComponent, TooltipComponent, TreeComponent, TreeModule, UploadComponent, WiziComponentsModule, WrapperBlocsComponent, WrapperComponent, WzEditInPlaceComponent, ZindexToggleDirective, DomService as ɵa, PaginationModule as ɵb, PagniationArrayTotalPages as ɵc, PagniationIsLastPage as ɵd, PagniationText as ɵe, TableModule as ɵf, InputSearchModule as ɵg, InputModule as ɵh, TooltipModule as ɵi, ProgressBarModule as ɵj, LoaderModule as ɵk, CheckboxModule as ɵl, inOutY as ɵm, inOutX as ɵn };
3405
3527
  //# sourceMappingURL=wizishop-angular-components.js.map