aeb-ui-kit 2.4.0-preview.548 → 2.4.0-preview.561
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.
- package/esm2020/lib/slider/slider.component.mjs +23 -5
- package/esm2020/lib/slider/slider.module.mjs +6 -4
- package/fesm2015/aeb-ui-kit.mjs +20 -6
- package/fesm2015/aeb-ui-kit.mjs.map +1 -1
- package/fesm2020/aeb-ui-kit.mjs +20 -6
- package/fesm2020/aeb-ui-kit.mjs.map +1 -1
- package/lib/slider/slider.component.d.ts +4 -1
- package/lib/slider/slider.module.d.ts +3 -1
- package/package.json +1 -1
package/fesm2020/aeb-ui-kit.mjs
CHANGED
|
@@ -4488,6 +4488,18 @@ class SliderComponent {
|
|
|
4488
4488
|
document.addEventListener('mouseup', this.handleEndDragging, false);
|
|
4489
4489
|
});
|
|
4490
4490
|
}
|
|
4491
|
+
inputHandler(e) {
|
|
4492
|
+
const value = Number(e.target.value);
|
|
4493
|
+
this.value = value;
|
|
4494
|
+
}
|
|
4495
|
+
onInputBlur() {
|
|
4496
|
+
if (this.value < this.min) {
|
|
4497
|
+
this.value = this.min;
|
|
4498
|
+
}
|
|
4499
|
+
else if (this.value > this.max) {
|
|
4500
|
+
this.value = this.max;
|
|
4501
|
+
}
|
|
4502
|
+
}
|
|
4491
4503
|
calculateAverage(values) {
|
|
4492
4504
|
return values.reduce((sum, value) => sum + value, 0) / values.length;
|
|
4493
4505
|
}
|
|
@@ -4510,13 +4522,13 @@ class SliderComponent {
|
|
|
4510
4522
|
}
|
|
4511
4523
|
}
|
|
4512
4524
|
SliderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SliderComponent, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
4513
|
-
SliderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: SliderComponent, selector: "aeb-slider", inputs: { label: "label", prefix: "prefix", intialValue: "intialValue", min: "min", max: "max", step: "step", value: "value", valueSeparator: "valueSeparator" }, providers: [
|
|
4525
|
+
SliderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: SliderComponent, selector: "aeb-slider", inputs: { label: "label", prefix: "prefix", intialValue: "intialValue", min: "min", max: "max", step: "step", value: "value", isEditable: "isEditable", valueSeparator: "valueSeparator" }, providers: [
|
|
4514
4526
|
{
|
|
4515
4527
|
provide: NG_VALUE_ACCESSOR,
|
|
4516
4528
|
useExisting: forwardRef(() => SliderComponent),
|
|
4517
4529
|
multi: true
|
|
4518
4530
|
}
|
|
4519
|
-
], viewQueries: [{ propertyName: "slider", first: true, predicate: ["slider"], descendants: true }], ngImport: i0, template: "<div class=\"slider\">\n <div class=\"label\">{{ label }}</div>\n
|
|
4531
|
+
], viewQueries: [{ propertyName: "slider", first: true, predicate: ["slider"], descendants: true }], ngImport: i0, template: "<div class=\"slider\" [ngStyle]=\"{ marginBottom: isEditable ? '0' : '20px' }\">\n <ng-container *ngIf=\"!isEditable\">\n <div class=\"label\">{{ label }}</div>\n <div class=\"value\">\n {{ value | number : \"1.0-0\" | replace : \",\" : valueSeparator }}\n {{ prefix }}\n </div>\n </ng-container>\n</div>\n\n<aeb-form-field *ngIf=\"isEditable\">\n <aeb-label>{{ label }}</aeb-label>\n <input\n type=\"number\"\n aebInput\n (input)=\"inputHandler($event)\"\n (blur)=\"onInputBlur()\"\n [(ngModel)]=\"value\"\n />\n</aeb-form-field>\n\n<div\n class=\"slider-line-wrapper\"\n [ngStyle]=\"{ height: isEditable ? '0' : '20px' }\"\n #slider\n>\n <div\n class=\"slider-line\"\n [ngStyle]=\"{\n width: isEditable ? '98%' : '100%',\n backgroundColor: isEditable ? 'transparent' : 'var(--lightgray)'\n }\"\n >\n <div\n class=\"slider-line-position\"\n [ngStyle]=\"{\n width: position + '%'\n }\"\n [ngClass]=\"{ pressed: isPressed }\"\n ></div>\n </div>\n</div>\n<div class=\"slider-limits\">\n <div>\n {{ min | number : \"1.0-0\" | replace : \",\" : valueSeparator }} {{ prefix }}\n </div>\n <div>\n {{ max | number : \"1.0-0\" | replace : \",\" : valueSeparator }} {{ prefix }}\n </div>\n</div>\n", styles: [".slider{display:flex;align-content:center;justify-content:space-between;color:var(--darkblue)}.label{font-size:16px;line-height:20px;color:var(--gray)}.value{font-size:20px;font-weight:700;color:var(--darkblue)}.slider-line-wrapper{display:flex;justify-content:center;align-items:center;width:100%}.slider-line{position:relative;width:100%;height:4px;border-radius:2px}.slider-line-position{position:absolute;top:0;left:0;width:100%;height:100%;background-color:var(--blue);border-radius:2px}.slider-line-position:hover{background-color:var(--blue-turquoise)}.slider-line-position:hover:after{background-color:var(--blue-turquoise)}.slider-line-position.pressed:after{top:-11px;right:-13px;width:26px;height:26px;background-color:var(--blue-turquoise);border-radius:15px}.slider-line-position.pressed{background-color:var(--blue-turquoise)}.slider-line-position:after{position:absolute;top:-8px;right:-10px;width:20px;height:20px;cursor:pointer;content:\"\";background-color:var(--blue);border-radius:10px}.slider-limits{display:flex;align-items:center;justify-content:space-between;margin-top:8px;font-size:12px;line-height:14px;color:var(--gray)}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: FormFieldComponent, selector: "aeb-form-field", inputs: ["center", "onError", "cssMod"] }, { kind: "directive", type: LabelDirective, selector: "aeb-label" }, { kind: "directive", type: InputDirective, selector: "input[aebInput]", inputs: ["value"] }, { kind: "directive", type: i1$1.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: i1$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: i1.DecimalPipe, name: "number" }, { kind: "pipe", type: ReplacePipe, name: "replace" }] });
|
|
4520
4532
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SliderComponent, decorators: [{
|
|
4521
4533
|
type: Component,
|
|
4522
4534
|
args: [{ selector: 'aeb-slider', providers: [
|
|
@@ -4525,7 +4537,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
4525
4537
|
useExisting: forwardRef(() => SliderComponent),
|
|
4526
4538
|
multi: true
|
|
4527
4539
|
}
|
|
4528
|
-
], template: "<div class=\"slider\">\n <div class=\"label\">{{ label }}</div>\n
|
|
4540
|
+
], template: "<div class=\"slider\" [ngStyle]=\"{ marginBottom: isEditable ? '0' : '20px' }\">\n <ng-container *ngIf=\"!isEditable\">\n <div class=\"label\">{{ label }}</div>\n <div class=\"value\">\n {{ value | number : \"1.0-0\" | replace : \",\" : valueSeparator }}\n {{ prefix }}\n </div>\n </ng-container>\n</div>\n\n<aeb-form-field *ngIf=\"isEditable\">\n <aeb-label>{{ label }}</aeb-label>\n <input\n type=\"number\"\n aebInput\n (input)=\"inputHandler($event)\"\n (blur)=\"onInputBlur()\"\n [(ngModel)]=\"value\"\n />\n</aeb-form-field>\n\n<div\n class=\"slider-line-wrapper\"\n [ngStyle]=\"{ height: isEditable ? '0' : '20px' }\"\n #slider\n>\n <div\n class=\"slider-line\"\n [ngStyle]=\"{\n width: isEditable ? '98%' : '100%',\n backgroundColor: isEditable ? 'transparent' : 'var(--lightgray)'\n }\"\n >\n <div\n class=\"slider-line-position\"\n [ngStyle]=\"{\n width: position + '%'\n }\"\n [ngClass]=\"{ pressed: isPressed }\"\n ></div>\n </div>\n</div>\n<div class=\"slider-limits\">\n <div>\n {{ min | number : \"1.0-0\" | replace : \",\" : valueSeparator }} {{ prefix }}\n </div>\n <div>\n {{ max | number : \"1.0-0\" | replace : \",\" : valueSeparator }} {{ prefix }}\n </div>\n</div>\n", styles: [".slider{display:flex;align-content:center;justify-content:space-between;color:var(--darkblue)}.label{font-size:16px;line-height:20px;color:var(--gray)}.value{font-size:20px;font-weight:700;color:var(--darkblue)}.slider-line-wrapper{display:flex;justify-content:center;align-items:center;width:100%}.slider-line{position:relative;width:100%;height:4px;border-radius:2px}.slider-line-position{position:absolute;top:0;left:0;width:100%;height:100%;background-color:var(--blue);border-radius:2px}.slider-line-position:hover{background-color:var(--blue-turquoise)}.slider-line-position:hover:after{background-color:var(--blue-turquoise)}.slider-line-position.pressed:after{top:-11px;right:-13px;width:26px;height:26px;background-color:var(--blue-turquoise);border-radius:15px}.slider-line-position.pressed{background-color:var(--blue-turquoise)}.slider-line-position:after{position:absolute;top:-8px;right:-10px;width:20px;height:20px;cursor:pointer;content:\"\";background-color:var(--blue);border-radius:10px}.slider-limits{display:flex;align-items:center;justify-content:space-between;margin-top:8px;font-size:12px;line-height:14px;color:var(--gray)}\n"] }]
|
|
4529
4541
|
}], ctorParameters: function () { return [{ type: i0.Renderer2 }]; }, propDecorators: { slider: [{
|
|
4530
4542
|
type: ViewChild,
|
|
4531
4543
|
args: ['slider']
|
|
@@ -4543,6 +4555,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
4543
4555
|
type: Input
|
|
4544
4556
|
}], value: [{
|
|
4545
4557
|
type: Input
|
|
4558
|
+
}], isEditable: [{
|
|
4559
|
+
type: Input
|
|
4546
4560
|
}], valueSeparator: [{
|
|
4547
4561
|
type: Input
|
|
4548
4562
|
}] } });
|
|
@@ -4550,13 +4564,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
4550
4564
|
class SliderModule {
|
|
4551
4565
|
}
|
|
4552
4566
|
SliderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SliderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4553
|
-
SliderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: SliderModule, declarations: [SliderComponent, ReplacePipe], imports: [CommonModule], exports: [SliderComponent] });
|
|
4554
|
-
SliderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SliderModule, imports: [CommonModule] });
|
|
4567
|
+
SliderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: SliderModule, declarations: [SliderComponent, ReplacePipe], imports: [CommonModule, FormFieldModule, FormsModule], exports: [SliderComponent] });
|
|
4568
|
+
SliderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SliderModule, imports: [CommonModule, FormFieldModule, FormsModule] });
|
|
4555
4569
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SliderModule, decorators: [{
|
|
4556
4570
|
type: NgModule,
|
|
4557
4571
|
args: [{
|
|
4558
4572
|
declarations: [SliderComponent, ReplacePipe],
|
|
4559
|
-
imports: [CommonModule],
|
|
4573
|
+
imports: [CommonModule, FormFieldModule, FormsModule],
|
|
4560
4574
|
exports: [SliderComponent]
|
|
4561
4575
|
}]
|
|
4562
4576
|
}] });
|