@wizishop/angular-components 15.1.126 → 15.1.129

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.
@@ -6667,7 +6667,8 @@ class BorderPickerComponent {
6667
6667
  this.gap = '12px';
6668
6668
  this.fontSize = '14px';
6669
6669
  this.disabled = false;
6670
- this.value = '0%';
6670
+ this.value = '0px';
6671
+ this.maxPixels = 50; // Valeur maximale en pixels
6671
6672
  this.blurred = new EventEmitter();
6672
6673
  this.borderRadiusChange = new EventEmitter();
6673
6674
  this.sliderValue = 0;
@@ -6676,7 +6677,7 @@ class BorderPickerComponent {
6676
6677
  }
6677
6678
  ngOnInit() {
6678
6679
  if (this.value) {
6679
- const numericValue = parseInt(this.value.replace('%', ''), 10);
6680
+ const numericValue = parseInt(this.value.replace('px', ''), 10);
6680
6681
  if (!isNaN(numericValue)) {
6681
6682
  this.sliderValue = numericValue;
6682
6683
  }
@@ -6684,7 +6685,20 @@ class BorderPickerComponent {
6684
6685
  }
6685
6686
  writeValue(value) {
6686
6687
  if (value !== undefined) {
6687
- this.value = value;
6688
+ this.value = value || '0px'; // Default to '0px' if value is null
6689
+ if (this.value) {
6690
+ const numericValue = parseInt(this.value.replace('px', ''), 10);
6691
+ if (!isNaN(numericValue)) {
6692
+ this.sliderValue = numericValue;
6693
+ this.updateSliderPercentage();
6694
+ }
6695
+ }
6696
+ else {
6697
+ // Handle null value case
6698
+ this.sliderValue = 0;
6699
+ this.value = '0px';
6700
+ this.updateSliderPercentage();
6701
+ }
6688
6702
  }
6689
6703
  }
6690
6704
  registerOnChange(fn) {
@@ -6694,11 +6708,16 @@ class BorderPickerComponent {
6694
6708
  this.onTouched = fn;
6695
6709
  }
6696
6710
  setValue(event) {
6697
- this.value = event.target.value;
6698
- const numericValue = parseInt(this.value.replace('%', ''), 10);
6699
- if (!isNaN(numericValue)) {
6700
- this.sliderValue = numericValue;
6701
- this.updateSliderPercentage();
6711
+ this.value = event.target.value || '0px';
6712
+ if (this.value) {
6713
+ const numericValue = parseInt(this.value.replace('px', ''), 10);
6714
+ if (!isNaN(numericValue)) {
6715
+ this.sliderValue = numericValue;
6716
+ this.updateSliderPercentage();
6717
+ }
6718
+ }
6719
+ else {
6720
+ this.sliderValue = 0;
6702
6721
  }
6703
6722
  this.onChange(this.value);
6704
6723
  this.borderRadiusChange.emit(this.value);
@@ -6706,21 +6725,22 @@ class BorderPickerComponent {
6706
6725
  updateSliderPercentage() {
6707
6726
  const slider = document.querySelector('.bp-range');
6708
6727
  if (slider) {
6709
- slider.style.setProperty('--slider-percentage', `${this.sliderValue}%`);
6728
+ const percentage = (this.sliderValue / this.maxPixels) * 100;
6729
+ slider.style.setProperty('--slider-percentage', `${percentage}%`);
6710
6730
  }
6711
6731
  }
6712
6732
  ngAfterViewInit() {
6713
6733
  this.updateSliderPercentage();
6714
6734
  }
6715
6735
  onFocusOut() {
6716
- if (!this.value.endsWith('%') && this.value) {
6717
- this.value = this.value + '%';
6736
+ if (!this.value.endsWith('px') && this.value) {
6737
+ this.value = this.value + 'px';
6718
6738
  this.onChange(this.value);
6719
6739
  this.borderRadiusChange.emit(this.value);
6720
6740
  }
6721
6741
  }
6722
6742
  updateBorderRadius(value) {
6723
- this.value = value + '%';
6743
+ this.value = value + 'px';
6724
6744
  this.updateSliderPercentage();
6725
6745
  this.onChange(this.value);
6726
6746
  this.borderRadiusChange.emit(this.value);
@@ -6731,13 +6751,13 @@ class BorderPickerComponent {
6731
6751
  }
6732
6752
  }
6733
6753
  BorderPickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: BorderPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
6734
- BorderPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: BorderPickerComponent, isStandalone: true, selector: "wac-border-picker", inputs: { label: "label", gap: "gap", fontSize: "fontSize", disabled: "disabled", value: "value" }, outputs: { blurred: "blurred", borderRadiusChange: "borderRadiusChange" }, providers: [
6754
+ BorderPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: BorderPickerComponent, isStandalone: true, selector: "wac-border-picker", inputs: { label: "label", gap: "gap", fontSize: "fontSize", disabled: "disabled", value: "value", maxPixels: "maxPixels" }, outputs: { blurred: "blurred", borderRadiusChange: "borderRadiusChange" }, providers: [
6735
6755
  {
6736
6756
  provide: NG_VALUE_ACCESSOR,
6737
6757
  useExisting: forwardRef(() => BorderPickerComponent),
6738
6758
  multi: true
6739
6759
  }
6740
- ], ngImport: i0, template: "<div class=\"w-border-picker\" [ngStyle]=\"{'gap': gap}\">\r\n\r\n <label class=\"bp-label\" for=\"borderPicker\" [ngStyle]=\"{'font-size': fontSize}\">{{ label }}</label>\r\n\r\n <div class=\"w-input\">\r\n\r\n <div class=\"border-preview\" [ngStyle]=\"{'border-radius': value}\">\r\n <div class=\"mask1\"></div>\r\n <div class=\"mask2\"></div>\r\n </div>\r\n\r\n <input\r\n class=\"bp-range\"\r\n type=\"range\"\r\n min=\"0\"\r\n max=\"100\"\r\n [(ngModel)]=\"sliderValue\"\r\n (ngModelChange)=\"updateBorderRadius($event)\"\r\n />\r\n\r\n <input\r\n class=\"bp-input\"\r\n id=\"borderPicker\"\r\n [placeholder]=\"sliderValue\"\r\n maxlength=\"5\"\r\n [(ngModel)]=\"value\"\r\n (ngModelChange)=\"onChange($event)\"\r\n (focusout)=\"onFocusOut()\"\r\n (input)=\"setValue($event)\"\r\n />\r\n\r\n </div>\r\n\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { 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.RangeValueAccessor, selector: "input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
6760
+ ], ngImport: i0, template: "<div class=\"w-border-picker\" [ngStyle]=\"{'gap': gap}\">\r\n\r\n <label class=\"bp-label\" for=\"borderPicker\" [ngStyle]=\"{'font-size': fontSize}\">{{ label }}</label>\r\n\r\n <div class=\"w-input\">\r\n\r\n <div class=\"border-preview\" [ngStyle]=\"{'border-radius': value}\">\r\n <div class=\"mask1\"></div>\r\n <div class=\"mask2\"></div>\r\n </div>\r\n\r\n <input\r\n class=\"bp-range\"\r\n type=\"range\"\r\n min=\"0\"\r\n [max]=\"maxPixels\"\r\n [(ngModel)]=\"sliderValue\"\r\n (ngModelChange)=\"updateBorderRadius($event)\"\r\n />\r\n\r\n <input\r\n class=\"bp-input\"\r\n id=\"borderPicker\"\r\n [placeholder]=\"sliderValue\"\r\n maxlength=\"5\"\r\n [(ngModel)]=\"value\"\r\n (ngModelChange)=\"onChange($event)\"\r\n (focusout)=\"onFocusOut()\"\r\n (input)=\"setValue($event)\"\r\n />\r\n\r\n </div>\r\n\r\n</div>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { 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.RangeValueAccessor, selector: "input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
6741
6761
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: BorderPickerComponent, decorators: [{
6742
6762
  type: Component,
6743
6763
  args: [{ selector: "wac-border-picker", standalone: true, imports: [
@@ -6749,7 +6769,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImpor
6749
6769
  useExisting: forwardRef(() => BorderPickerComponent),
6750
6770
  multi: true
6751
6771
  }
6752
- ], template: "<div class=\"w-border-picker\" [ngStyle]=\"{'gap': gap}\">\r\n\r\n <label class=\"bp-label\" for=\"borderPicker\" [ngStyle]=\"{'font-size': fontSize}\">{{ label }}</label>\r\n\r\n <div class=\"w-input\">\r\n\r\n <div class=\"border-preview\" [ngStyle]=\"{'border-radius': value}\">\r\n <div class=\"mask1\"></div>\r\n <div class=\"mask2\"></div>\r\n </div>\r\n\r\n <input\r\n class=\"bp-range\"\r\n type=\"range\"\r\n min=\"0\"\r\n max=\"100\"\r\n [(ngModel)]=\"sliderValue\"\r\n (ngModelChange)=\"updateBorderRadius($event)\"\r\n />\r\n\r\n <input\r\n class=\"bp-input\"\r\n id=\"borderPicker\"\r\n [placeholder]=\"sliderValue\"\r\n maxlength=\"5\"\r\n [(ngModel)]=\"value\"\r\n (ngModelChange)=\"onChange($event)\"\r\n (focusout)=\"onFocusOut()\"\r\n (input)=\"setValue($event)\"\r\n />\r\n\r\n </div>\r\n\r\n</div>\r\n" }]
6772
+ ], template: "<div class=\"w-border-picker\" [ngStyle]=\"{'gap': gap}\">\r\n\r\n <label class=\"bp-label\" for=\"borderPicker\" [ngStyle]=\"{'font-size': fontSize}\">{{ label }}</label>\r\n\r\n <div class=\"w-input\">\r\n\r\n <div class=\"border-preview\" [ngStyle]=\"{'border-radius': value}\">\r\n <div class=\"mask1\"></div>\r\n <div class=\"mask2\"></div>\r\n </div>\r\n\r\n <input\r\n class=\"bp-range\"\r\n type=\"range\"\r\n min=\"0\"\r\n [max]=\"maxPixels\"\r\n [(ngModel)]=\"sliderValue\"\r\n (ngModelChange)=\"updateBorderRadius($event)\"\r\n />\r\n\r\n <input\r\n class=\"bp-input\"\r\n id=\"borderPicker\"\r\n [placeholder]=\"sliderValue\"\r\n maxlength=\"5\"\r\n [(ngModel)]=\"value\"\r\n (ngModelChange)=\"onChange($event)\"\r\n (focusout)=\"onFocusOut()\"\r\n (input)=\"setValue($event)\"\r\n />\r\n\r\n </div>\r\n\r\n</div>" }]
6753
6773
  }], ctorParameters: function () { return []; }, propDecorators: { label: [{
6754
6774
  type: Input
6755
6775
  }], gap: [{
@@ -6760,6 +6780,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImpor
6760
6780
  type: Input
6761
6781
  }], value: [{
6762
6782
  type: Input
6783
+ }], maxPixels: [{
6784
+ type: Input
6763
6785
  }], blurred: [{
6764
6786
  type: Output
6765
6787
  }], borderRadiusChange: [{