matcha-components 20.32.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);
|
|
@@ -6158,6 +6171,7 @@ class MatchaSliderComponent {
|
|
|
6158
6171
|
this.valueChange.emit(this.value);
|
|
6159
6172
|
this.userChange.emit(this.value);
|
|
6160
6173
|
this.onChange(this.value);
|
|
6174
|
+
this.cdr.markForCheck();
|
|
6161
6175
|
}
|
|
6162
6176
|
}
|
|
6163
6177
|
updateRangeValues(newValue) {
|
|
@@ -6195,6 +6209,7 @@ class MatchaSliderComponent {
|
|
|
6195
6209
|
this.valueChange.emit(this.value);
|
|
6196
6210
|
this.userChange.emit(this.value);
|
|
6197
6211
|
this.onChange([this.value, this.highValue]);
|
|
6212
|
+
this.cdr.markForCheck();
|
|
6198
6213
|
}
|
|
6199
6214
|
}
|
|
6200
6215
|
updateHighValue(newValue) {
|
|
@@ -6219,6 +6234,7 @@ class MatchaSliderComponent {
|
|
|
6219
6234
|
this.highValueChange.emit(this.highValue);
|
|
6220
6235
|
this.userChange.emit(this.highValue);
|
|
6221
6236
|
this.onChange([this.value, this.highValue]);
|
|
6237
|
+
this.cdr.markForCheck();
|
|
6222
6238
|
}
|
|
6223
6239
|
}
|
|
6224
6240
|
onKeyDown(event) {
|
|
@@ -6293,25 +6309,25 @@ class MatchaSliderComponent {
|
|
|
6293
6309
|
formatValue(value) {
|
|
6294
6310
|
return this.mergedOptions.format ? this.mergedOptions.format(value) : value.toString();
|
|
6295
6311
|
}
|
|
6296
|
-
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 }); }
|
|
6297
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: [
|
|
6298
6314
|
{
|
|
6299
6315
|
provide: NG_VALUE_ACCESSOR,
|
|
6300
6316
|
useExisting: forwardRef(() => MatchaSliderComponent),
|
|
6301
6317
|
multi: true
|
|
6302
6318
|
}
|
|
6303
|
-
], viewQueries: [{ propertyName: "sliderElement", first: true, predicate: ["sliderElement"], descendants: true }], ngImport: i0, 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>", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.
|
|
6319
|
+
], viewQueries: [{ propertyName: "sliderElement", first: true, predicate: ["sliderElement"], descendants: true }], ngImport: i0, 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>", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.Default }); }
|
|
6304
6320
|
}
|
|
6305
6321
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.2", ngImport: i0, type: MatchaSliderComponent, decorators: [{
|
|
6306
6322
|
type: Component,
|
|
6307
|
-
args: [{ selector: 'matcha-slider', standalone: false, changeDetection: ChangeDetectionStrategy.
|
|
6323
|
+
args: [{ selector: 'matcha-slider', standalone: false, changeDetection: ChangeDetectionStrategy.Default, providers: [
|
|
6308
6324
|
{
|
|
6309
6325
|
provide: NG_VALUE_ACCESSOR,
|
|
6310
6326
|
useExisting: forwardRef(() => MatchaSliderComponent),
|
|
6311
6327
|
multi: true
|
|
6312
6328
|
}
|
|
6313
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>" }]
|
|
6314
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { value: [{
|
|
6330
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }], propDecorators: { value: [{
|
|
6315
6331
|
type: Input
|
|
6316
6332
|
}], highValue: [{
|
|
6317
6333
|
type: Input
|