matcha-components 20.35.0 → 20.36.0
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.
|
@@ -5868,8 +5868,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.2", ngImpor
|
|
|
5868
5868
|
}] } });
|
|
5869
5869
|
|
|
5870
5870
|
class MatchaSliderComponent {
|
|
5871
|
-
constructor(cdr) {
|
|
5871
|
+
constructor(cdr, elementRef) {
|
|
5872
5872
|
this.cdr = cdr;
|
|
5873
|
+
this.elementRef = elementRef;
|
|
5873
5874
|
this.value = 0;
|
|
5874
5875
|
this.highValue = 0;
|
|
5875
5876
|
this.options = {};
|
|
@@ -5973,6 +5974,12 @@ class MatchaSliderComponent {
|
|
|
5973
5974
|
ngOnInit() {
|
|
5974
5975
|
this.initializeValues();
|
|
5975
5976
|
}
|
|
5977
|
+
ngAfterViewInit() {
|
|
5978
|
+
// Garantir que o sliderElement está disponível
|
|
5979
|
+
if (this.sliderElement) {
|
|
5980
|
+
console.log('Slider element ready:', this.sliderElement.nativeElement);
|
|
5981
|
+
}
|
|
5982
|
+
}
|
|
5976
5983
|
ngOnDestroy() {
|
|
5977
5984
|
this.destroy$.next();
|
|
5978
5985
|
this.destroy$.complete();
|
|
@@ -6012,7 +6019,13 @@ class MatchaSliderComponent {
|
|
|
6012
6019
|
onTrackMouseDown(event) {
|
|
6013
6020
|
if (this.isDisabled)
|
|
6014
6021
|
return;
|
|
6015
|
-
|
|
6022
|
+
// Usar elementRef em vez de ViewChild
|
|
6023
|
+
const sliderElement = this.elementRef.nativeElement.querySelector('.matcha-slider');
|
|
6024
|
+
if (!sliderElement) {
|
|
6025
|
+
console.error('Slider element not found');
|
|
6026
|
+
return;
|
|
6027
|
+
}
|
|
6028
|
+
const rect = sliderElement.getBoundingClientRect();
|
|
6016
6029
|
if (!rect)
|
|
6017
6030
|
return;
|
|
6018
6031
|
const newValue = this.calculateValueFromPosition(event.clientX, rect);
|
|
@@ -6296,7 +6309,7 @@ class MatchaSliderComponent {
|
|
|
6296
6309
|
formatValue(value) {
|
|
6297
6310
|
return this.mergedOptions.format ? this.mergedOptions.format(value) : value.toString();
|
|
6298
6311
|
}
|
|
6299
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.2", ngImport: i0, type: MatchaSliderComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
6312
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.2", ngImport: i0, type: MatchaSliderComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
6300
6313
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.2", type: MatchaSliderComponent, isStandalone: false, selector: "matcha-slider", inputs: { value: "value", highValue: "highValue", options: "options", color: "color", disabled: "disabled" }, outputs: { valueChange: "valueChange", highValueChange: "highValueChange", userChange: "userChange", userChangeEnd: "userChangeEnd" }, providers: [
|
|
6301
6314
|
{
|
|
6302
6315
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -6314,7 +6327,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.2", ngImpor
|
|
|
6314
6327
|
multi: true
|
|
6315
6328
|
}
|
|
6316
6329
|
], template: "<div class=\"matcha-slider\" [class.disabled]=\"isDisabled\" [class.range]=\"isRange\"\n [attr.data-color]=\"color\" #sliderElement>\n\n\n <div class=\"limit-labels\" *ngIf=\"!mergedOptions.hideLimitLabels\">\n <span class=\"floor-label\">{{ formatValue(mergedOptions.floor || 0) }}</span>\n <span class=\"ceil-label\" [class.color-placeholder]=\"!isAtMaxValue\" *ngIf=\"!isAtMaxValue\">{{ formatValue(mergedOptions.ceil || 100) }}</span>\n </div>\n <div class=\"slider-track\" (mousedown)=\"onTrackMouseDown($event)\" (click)=\"onTrackClick($event)\">\n\n <div class=\"selection-bar\" [style]=\"selectionBarStyle\" *ngIf=\"mergedOptions.showSelectionBar\">\n </div>\n\n <div class=\"pointer low-pointer\" [style]=\"getPointerStyle(false)\"\n [attr.tabindex]=\"isDisabled ? -1 : 0\"\n (mousedown)=\"onPointerMouseDown($event, false)\" (click)=\"onPointerClick($event, false)\"\n (keydown)=\"onKeyDown($event)\" role=\"slider\" [attr.aria-valuemin]=\"mergedOptions.floor\"\n [attr.aria-valuemax]=\"mergedOptions.ceil\" [attr.aria-valuenow]=\"value\"\n [attr.aria-disabled]=\"isDisabled\">\n\n <div class=\"pointer-label\" *ngIf=\"!mergedOptions.hidePointerLabels\">\n {{ formatValue(value) }}\n </div>\n </div>\n\n <div class=\"pointer high-pointer\" [style]=\"getPointerStyle(true)\"\n [attr.tabindex]=\"isDisabled ? -1 : 0\" (mousedown)=\"onPointerMouseDown($event, true)\"\n (click)=\"onPointerClick($event, true)\" (keydown)=\"onKeyDown($event)\" role=\"slider\"\n [attr.aria-valuemin]=\"mergedOptions.floor\" [attr.aria-valuemax]=\"mergedOptions.ceil\"\n [attr.aria-valuenow]=\"highValue\" [attr.aria-disabled]=\"isDisabled\" *ngIf=\"isRange\">\n\n <div class=\"pointer-label\" *ngIf=\"!mergedOptions.hidePointerLabels\">\n {{ formatValue(highValue) }}\n </div>\n </div>\n </div>\n\n\n</div>" }]
|
|
6317
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { value: [{
|
|
6330
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }], propDecorators: { value: [{
|
|
6318
6331
|
type: Input
|
|
6319
6332
|
}], highValue: [{
|
|
6320
6333
|
type: Input
|