1 line
45 KiB
Plaintext
1 line
45 KiB
Plaintext
|
{"version":3,"file":"primeng-slider.mjs","sources":["../../src/app/components/slider/slider.ts","../../src/app/components/slider/primeng-slider.ts"],"sourcesContent":["import { CommonModule, DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n Inject,\n Input,\n NgModule,\n NgZone,\n OnDestroy,\n Output,\n PLATFORM_ID,\n Renderer2,\n ViewChild,\n ViewEncapsulation,\n booleanAttribute,\n forwardRef,\n numberAttribute\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { DomHandler } from 'primeng/dom';\nimport { Nullable, VoidListener } from 'primeng/ts-helpers';\nimport { AutoFocusModule } from 'primeng/autofocus';\nimport { SliderChangeEvent, SliderSlideEndEvent } from './slider.interface';\n\nexport const SLIDER_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => Slider),\n multi: true\n};\n/**\n * Slider is a component to provide input with a drag handle.\n * @group Components\n */\n@Component({\n selector: 'p-slider',\n template: `\n <div\n [ngStyle]=\"style\"\n [class]=\"styleClass\"\n [ngClass]=\"{ 'p-slider p-component': true, 'p-disabled': disabled, 'p-slider-horizontal': orientation == 'horizontal', 'p-slider-vertical': orientation == 'vertical', 'p-slider-animate': animate }\"\n (click)=\"onBarClick($event)\"\n [attr.data-pc-name]=\"'slider'\"\n [attr.data-pc-section]=\"'root'\"\n >\n <span\n *ngIf=\"range && orientation == 'horizontal'\"\n class=\"p-slider-range\"\n [ngStyle]=\"{ left: offset !== null && offset !== undefined ? offset + '%' : handleValues[0] + '%', width: diff ? diff + '%' : handleValues[1] - handleValues[0] + '%' }\"\n [attr.data-pc-section]=\"'range'\"\n ></span>\n <span\n *ngIf=\"range && orientation == 'vertical'\"\n class=\"p-slider-range\"\n [ngStyle]=\"{ bottom: offset !== null && offset !== undefined ? offset + '%' : handleValues[0] + '%', height: diff ? diff + '%' : handleValues[1] - handleValues[0] + '%' }\"\n [attr.data-pc-section]=\"'range'\"\n ></span>\n <span *ngIf=\"!range && orientation == 'vertical'\" class=\"p-slider-range\" [attr.data-pc-section]=\"'range'\" [ngStyle]=\"{ height: handleValue + '%' }\"></span>\n <span *ngIf=\"!range && orientation == 'horizontal'\" class=\"p-slider-range\" [attr.data-pc-section]=\"'range'\" [ngStyle]=\"{ width: handleValue + '%' }\"></span>\n <span\n *ngIf=\"!range\"\n #sliderHandle\n class=\"p-slider-handle\"\n [style.transition]=\"dragging ? 'none' : null\"\n [ngStyle]=\"{ left: orientation == 'horizontal' ? handleValue + '%' : null, bottom: orientation == 'vertical' ? handleValue + '%' : null }\"\n (touchstart)=\"onDragStart($event)\"\n (touchmove)=\"onDrag($event)\"\n (touchend)=\"onDragEnd($event)\"\n (mousedown)=\"onMouseDown($event)\"\n (keydown)=\"onKeyDown($event)\"\n [attr.tabindex]=\"disabled ? null : tabindex\"\n role=\"slider\"\n [attr.aria-valuemin]=\"min\"\n [attr.aria-valuenow]=\"value\"\n [attr.aria-valuemax]=\"max\"\n [attr.aria-labelledby]=\"ariaLabelledBy\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-orientation]=\"orientation\"\n [attr.data-pc-section]=\"'handle'\"\n pAutoFocus\n [autofocus]=\"autofocus\"\n ></span>\n <span\n *ngIf=\"range\"\n #sliderHandleStart\n [style.transition]=\"dragging ? 'none' : null\"\n
|