@wizishop/angular-components 0.0.71 → 0.0.74

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 (31) hide show
  1. package/angular-components.scss +4681 -4670
  2. package/bundles/wizishop-angular-components.umd.js +170 -8
  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/shared-components.module.js +7 -3
  8. package/esm2015/lib/components/tag/tag.component.js +11 -6
  9. package/esm2015/lib/components/tree/tree.component.js +20 -0
  10. package/esm2015/lib/components/tree/tree.dto.js +2 -0
  11. package/esm2015/lib/components/tree/tree.module.js +20 -0
  12. package/esm2015/lib/pipes/shared-pipes.module.js +16 -0
  13. package/esm2015/lib/pipes/tree/format-object-to-recursif-tree.pipe.js +37 -0
  14. package/esm2015/lib/pipes/tree/format-object-to-simple-tree.pipe.js +45 -0
  15. package/esm2015/lib/wizi-components.module.js +4 -2
  16. package/esm2015/public-api.js +6 -1
  17. package/fesm2015/wizishop-angular-components.js +145 -10
  18. package/fesm2015/wizishop-angular-components.js.map +1 -1
  19. package/lib/components/button/button.component.d.ts +1 -0
  20. package/lib/components/tag/tag.component.d.ts +3 -1
  21. package/lib/components/tree/tree.component.d.ts +9 -0
  22. package/lib/components/tree/tree.dto.d.ts +8 -0
  23. package/lib/components/tree/tree.module.d.ts +2 -0
  24. package/lib/pipes/shared-pipes.module.d.ts +2 -0
  25. package/lib/pipes/tree/format-object-to-recursif-tree.pipe.d.ts +6 -0
  26. package/lib/pipes/tree/format-object-to-simple-tree.pipe.d.ts +7 -0
  27. package/package.json +1 -1
  28. package/public-api.d.ts +5 -0
  29. package/wizishop-angular-components-0.0.74.tgz +0 -0
  30. package/wizishop-angular-components.metadata.json +1 -1
  31. package/wizishop-angular-components-0.0.71.tgz +0 -0
@@ -847,13 +847,16 @@
847
847
  function TagComponent() {
848
848
  this.label = '';
849
849
  this.hasClose = false;
850
- this.isOpen = true;
851
850
  this.big = false;
851
+ this.isOpen = true;
852
+ this.isOpenChange = new i0.EventEmitter();
852
853
  }
853
854
  TagComponent.prototype.closeTag = function () {
854
- if (this.hasClose) {
855
- this.isOpen = false;
855
+ if (!this.hasClose) {
856
+ return;
856
857
  }
858
+ this.isOpen = false;
859
+ this.isOpenChange.next(this.isOpen);
857
860
  };
858
861
  return TagComponent;
859
862
  }());
@@ -868,7 +871,9 @@
868
871
  label: [{ type: i0.Input }],
869
872
  class: [{ type: i0.Input }],
870
873
  hasClose: [{ type: i0.Input }],
871
- big: [{ type: i0.Input }]
874
+ big: [{ type: i0.Input }],
875
+ isOpen: [{ type: i0.Input }],
876
+ isOpenChange: [{ type: i0.Output }]
872
877
  };
873
878
 
874
879
  var TabComponent = /** @class */ (function () {
@@ -906,6 +911,7 @@
906
911
  this.label = '';
907
912
  this.icon = '';
908
913
  this.widthAuto = false;
914
+ this.contentHorizontalPosition = 'center';
909
915
  this.iconFontSize = 12;
910
916
  this.hasLoader = false;
911
917
  this.disabled = false;
@@ -1000,7 +1006,7 @@
1000
1006
  ButtonComponent.decorators = [
1001
1007
  { type: i0.Component, args: [{
1002
1008
  selector: 'wac-button',
1003
- 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"
1009
+ 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"
1004
1010
  },] }
1005
1011
  ];
1006
1012
  ButtonComponent.ctorParameters = function () { return []; };
@@ -1010,6 +1016,7 @@
1010
1016
  icon: [{ type: i0.Input }],
1011
1017
  iconNext: [{ type: i0.Input }],
1012
1018
  widthAuto: [{ type: i0.Input }],
1019
+ contentHorizontalPosition: [{ type: i0.Input }],
1013
1020
  iconFontSize: [{ type: i0.Input }],
1014
1021
  hasLoader: [{ type: i0.Input }],
1015
1022
  disabled: [{ type: i0.Input }],
@@ -3760,6 +3767,153 @@
3760
3767
  unSelectedItemsAll: [{ type: i0.Output }]
3761
3768
  };
3762
3769
 
3770
+ var TreeComponent = /** @class */ (function () {
3771
+ function TreeComponent() {
3772
+ this.treeDepth = 0;
3773
+ }
3774
+ TreeComponent.prototype.ngOnInit = function () { };
3775
+ return TreeComponent;
3776
+ }());
3777
+ TreeComponent.decorators = [
3778
+ { type: i0.Component, args: [{
3779
+ selector: 'wac-tree',
3780
+ template: "<div *ngFor=\"let item of items; index as i\" [ngClass]=\"['treeDepth-' + treeDepth]\">\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\">\n <!-- Todo maybe pass child template -->\n </wac-tree>\n </li>\n </ul>\n</div>"
3781
+ },] }
3782
+ ];
3783
+ TreeComponent.ctorParameters = function () { return []; };
3784
+ TreeComponent.propDecorators = {
3785
+ items: [{ type: i0.Input }],
3786
+ treeDepth: [{ type: i0.Input }],
3787
+ optionTemplateRef: [{ type: i0.ContentChild, args: ["optionTemplate", { static: false },] }]
3788
+ };
3789
+
3790
+ var FormatObjectToRecursifTreePipe = /** @class */ (function () {
3791
+ function FormatObjectToRecursifTreePipe() {
3792
+ this.childrenProperties = [];
3793
+ }
3794
+ FormatObjectToRecursifTreePipe.prototype.transform = function (objectList, childrenProperties) {
3795
+ var _this = this;
3796
+ this.childrenProperties = childrenProperties;
3797
+ var treeDepth = 0;
3798
+ objectList.forEach(function (object) { return _this.recursiveFormatObjectToRecursifTree(object, treeDepth); });
3799
+ return objectList;
3800
+ };
3801
+ FormatObjectToRecursifTreePipe.prototype.recursiveFormatObjectToRecursifTree = function (object, treeDepth) {
3802
+ var e_1, _a;
3803
+ try {
3804
+ for (var _b = __values(this.childrenProperties), _c = _b.next(); !_c.done; _c = _b.next()) {
3805
+ var childrenProperty = _c.value;
3806
+ object.hasTreeChrildren = true;
3807
+ if (!object.hasOwnProperty(childrenProperty)) {
3808
+ // No more chrildren
3809
+ object.hasTreeChrildren = false;
3810
+ continue;
3811
+ }
3812
+ if (Array.isArray(object[childrenProperty])) {
3813
+ throw "Property : \"" + childrenProperty + "\", is not an array. it could not be transform to a recursive list.";
3814
+ }
3815
+ // Add treeChildren property filled with name children property
3816
+ object.treeChildren = object[childrenProperty];
3817
+ // call this function recursively until no children can be generated
3818
+ this.recursiveFormatObjectToRecursifTree(object.treeChildren, treeDepth++);
3819
+ break;
3820
+ }
3821
+ }
3822
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
3823
+ finally {
3824
+ try {
3825
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
3826
+ }
3827
+ finally { if (e_1) throw e_1.error; }
3828
+ }
3829
+ object.treeDepth = treeDepth;
3830
+ };
3831
+ return FormatObjectToRecursifTreePipe;
3832
+ }());
3833
+ FormatObjectToRecursifTreePipe.decorators = [
3834
+ { type: i0.Pipe, args: [{
3835
+ name: 'formatObjectToRecursifTree'
3836
+ },] }
3837
+ ];
3838
+
3839
+ var FormatObjectToSimpleTreePipe = /** @class */ (function () {
3840
+ function FormatObjectToSimpleTreePipe() {
3841
+ this.childrenProperties = [];
3842
+ this.labelProperties = [];
3843
+ }
3844
+ FormatObjectToSimpleTreePipe.prototype.transform = function (objectList, childrenProperties, labelProperties) {
3845
+ var _this = this;
3846
+ this.childrenProperties = childrenProperties;
3847
+ this.labelProperties = labelProperties;
3848
+ var treeDepth = 0;
3849
+ objectList.forEach(function (object) { return _this.recursiveFormatObjectToSimpleTree(object, treeDepth); });
3850
+ return objectList;
3851
+ };
3852
+ FormatObjectToSimpleTreePipe.prototype.recursiveFormatObjectToSimpleTree = function (object, treeDepth) {
3853
+ for (var property in object) {
3854
+ if (!Object.prototype.hasOwnProperty.call(object, property)) {
3855
+ continue;
3856
+ }
3857
+ if (this.labelProperties.includes(property)) {
3858
+ object.treeLabel = object[property];
3859
+ continue;
3860
+ }
3861
+ object.hasTreeChrildren = true;
3862
+ if (!this.childrenProperties.includes(property)) {
3863
+ // No more chrildren
3864
+ object.hasTreeChrildren = false;
3865
+ continue;
3866
+ }
3867
+ if (Array.isArray(object[property])) {
3868
+ throw "Property : \"" + property + "\", is not an array. it could not be transform to a recursive list.";
3869
+ }
3870
+ // Add treeChildren property filled with name children property
3871
+ object.treeChildren = object[property];
3872
+ // call this function recursively until no children can be generated
3873
+ this.recursiveFormatObjectToSimpleTree(object.treeChildren, treeDepth++);
3874
+ break;
3875
+ }
3876
+ };
3877
+ return FormatObjectToSimpleTreePipe;
3878
+ }());
3879
+ FormatObjectToSimpleTreePipe.decorators = [
3880
+ { type: i0.Pipe, args: [{
3881
+ name: 'formatObjectToSimpleTree'
3882
+ },] }
3883
+ ];
3884
+
3885
+ var exportedPipes = [FormatObjectToRecursifTreePipe, FormatObjectToSimpleTreePipe];
3886
+ var SharedPipes = /** @class */ (function () {
3887
+ function SharedPipes() {
3888
+ }
3889
+ return SharedPipes;
3890
+ }());
3891
+ SharedPipes.decorators = [
3892
+ { type: i0.NgModule, args: [{
3893
+ imports: [common.CommonModule, forms.FormsModule],
3894
+ declarations: exportedPipes,
3895
+ exports: exportedPipes
3896
+ },] }
3897
+ ];
3898
+
3899
+ var TreeModule = /** @class */ (function () {
3900
+ function TreeModule() {
3901
+ }
3902
+ return TreeModule;
3903
+ }());
3904
+ TreeModule.decorators = [
3905
+ { type: i0.NgModule, args: [{
3906
+ imports: [
3907
+ common.CommonModule,
3908
+ forms.FormsModule,
3909
+ SharedPipes
3910
+ ],
3911
+ exports: [TreeComponent],
3912
+ declarations: [TreeComponent],
3913
+ providers: [],
3914
+ },] }
3915
+ ];
3916
+
3763
3917
  var components = [
3764
3918
  TagComponent,
3765
3919
  TabComponent,
@@ -3815,7 +3969,8 @@
3815
3969
  TooltipComponent,
3816
3970
  CheckboxComponent,
3817
3971
  LoaderComponent,
3818
- ProgressBarComponent
3972
+ ProgressBarComponent,
3973
+ TreeComponent
3819
3974
  ];
3820
3975
  var SharedComponentsModule = /** @class */ (function () {
3821
3976
  function SharedComponentsModule() {
@@ -3843,7 +3998,8 @@
3843
3998
  ProgressBarModule,
3844
3999
  ngxPerfectScrollbar.PerfectScrollbarModule,
3845
4000
  AlertPopupModule,
3846
- router.RouterModule
4001
+ router.RouterModule,
4002
+ TreeModule
3847
4003
  ],
3848
4004
  declarations: components,
3849
4005
  exports: __spread(components, exportsFromModule)
@@ -3861,9 +4017,10 @@
3861
4017
  common.CommonModule,
3862
4018
  SharedComponentsModule,
3863
4019
  SharedDirectives,
4020
+ SharedPipes,
3864
4021
  i1$1.NwbAllModule
3865
4022
  ],
3866
- exports: [SharedComponentsModule, SharedDirectives]
4023
+ exports: [SharedComponentsModule, SharedDirectives, SharedPipes]
3867
4024
  },] }
3868
4025
  ];
3869
4026
 
@@ -3892,6 +4049,8 @@
3892
4049
  exports.DropdownComponent = DropdownComponent;
3893
4050
  exports.FiltersComponent = FiltersComponent;
3894
4051
  exports.FiltersTableService = FiltersTableService;
4052
+ exports.FormatObjectToRecursifTreePipe = FormatObjectToRecursifTreePipe;
4053
+ exports.FormatObjectToSimpleTreePipe = FormatObjectToSimpleTreePipe;
3895
4054
  exports.FreePopinComponent = FreePopinComponent;
3896
4055
  exports.H1Component = H1Component;
3897
4056
  exports.H2Component = H2Component;
@@ -3922,6 +4081,7 @@
3922
4081
  exports.SettingsComponent = SettingsComponent;
3923
4082
  exports.SharedComponentsModule = SharedComponentsModule;
3924
4083
  exports.SharedDirectives = SharedDirectives;
4084
+ exports.SharedPipes = SharedPipes;
3925
4085
  exports.SnackbarComponent = SnackbarComponent;
3926
4086
  exports.StateComponent = StateComponent;
3927
4087
  exports.SwitchComponent = SwitchComponent;
@@ -3934,6 +4094,8 @@
3934
4094
  exports.TextAreaComponent = TextAreaComponent;
3935
4095
  exports.TextComponent = TextComponent;
3936
4096
  exports.TooltipComponent = TooltipComponent;
4097
+ exports.TreeComponent = TreeComponent;
4098
+ exports.TreeModule = TreeModule;
3937
4099
  exports.UploadComponent = UploadComponent;
3938
4100
  exports.WiziComponentsModule = WiziComponentsModule;
3939
4101
  exports.WrapperBlocsComponent = WrapperBlocsComponent;