4 lines
14 KiB
JavaScript
4 lines
14 KiB
JavaScript
|
/*! DSFR v1.11.2 | SPDX-License-Identifier: MIT | License-Filename: LICENSE.md | restricted use (see terms and conditions) */
|
||
|
!function(){"use strict";var t=window.dsfr,e={RANGE:t.internals.ns.selector("range"),RANGE_SM:t.internals.ns.selector("range--sm"),RANGE_STEP:t.internals.ns.selector("range--step"),RANGE_DOUBLE:t.internals.ns.selector("range--double"),RANGE_DOUBLE_STEP:t.internals.ns.selector("range--double")+t.internals.ns.selector("range--step"),RANGE_INPUT:t.internals.ns.selector("range input[type=range]:nth-of-type(1)"),RANGE_INPUT2:t.internals.ns.selector("range--double")+" input[type=range]:nth-of-type(2)",RANGE_OUTPUT:t.internals.ns.selector("range__output"),RANGE_MIN:t.internals.ns.selector("range__min"),RANGE_MAX:t.internals.ns.selector("range__max"),RANGE_PREFIX:t.internals.ns.attr("prefix"),RANGE_SUFFIX:t.internals.ns.attr("suffix")},i={VALUE:t.internals.ns.emission("range","value"),VALUE2:t.internals.ns.emission("range","value2"),OUTPUT:t.internals.ns.emission("range","output"),CONSTRAINTS:t.internals.ns.emission("range","constraints"),MIN:t.internals.ns.emission("range","min"),MAX:t.internals.ns.emission("range","max"),STEP:t.internals.ns.emission("range","step"),PREFIX:t.internals.ns.emission("range","prefix"),SUFFIX:t.internals.ns.emission("range","suffix"),DISABLED:t.internals.ns.emission("range","disabled"),ENABLE_POINTER:t.internals.ns.emission("range","enable_pointer")},s=function(){this._width=0,this._min=0,this._max=0,this._value=0,this._thumbSize=24,this._innerWidth=0,this._prefix="",this._suffix="",this._background={}},n={width:{configurable:!0},isSm:{configurable:!0},textValue:{configurable:!0},value:{configurable:!0},outputX:{configurable:!0},min:{configurable:!0},textMin:{configurable:!0},max:{configurable:!0},textMax:{configurable:!0},step:{configurable:!0},output:{configurable:!0},progress:{configurable:!0}};s.prototype.configure=function(t){t&&(this._prefix=t._prefix,this._suffix=t._suffix,this._width=t.width,this.setConstraints(t._constraints),this.value=t.value,this.update())},s.prototype.setPrefix=function(t){this._prefix=null!==t?t:""},s.prototype.setSuffix=function(t){this._suffix=null!==t?t:""},s.prototype._decorate=function(t){return""+this._prefix+t+this._suffix},n.width.get=function(){return this._width},n.width.set=function(t){this._width=t},n.isSm.get=function(){return this._isSm},n.isSm.set=function(t){this._isSm!==t&&(this._isSm=t,this.setThumbSize(t?16:24),this.update())},s.prototype.setThumbSize=function(t,e){void 0===e&&(e=1),this._thumbSize=t,this._innerPadding=t*e},n.textValue.get=function(){return this._decorate(this._value)},n.value.get=function(){return this._value},n.value.set=function(t){this._value=t},n.outputX.get=function(){return this._outputX},s.prototype.setConstraints=function(t){this._constraints=t,this._min=t.min,this._max=t.max,this._step=t.step,this._rangeWidth=t.rangeWidth},n.min.get=function(){return this._min},n.textMin.get=function(){return this._decorate(this._min)},n.max.get=function(){return this._max},n.textMax.get=function(){return this._decorate(this._max)},n.step.get=function(){return this._step},n.output.get=function(){return{text:this.textValue,transform:"translateX("+this._translateX+"px) translateX(-"+this._centerPercent+"%)"}},s.prototype._getRatio=function(t){return(t-this._min)/this._rangeWidth},n.progress.get=function(){return this._progress},s.prototype.update=function(){this._update()},s.prototype._update=function(){this._innerWidth=this._width-this._innerPadding;var t=this._getRatio(this._value);this._translateX=t*this._width,this._centerPercent=100*t,this._progress={right:(this._innerWidth*t+.5*this._innerPadding).toFixed(2)+"px"}},Object.defineProperties(s.prototype,n);var r=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={stepWidth:{configurable:!0}};return i.stepWidth.get=function(){return this._stepWidth.toFixed(3)+"px"},e.prototype._update=function(){t.prototype._update.call(this);var e=this._rangeWidth/this._step;for(this._stepWidth=this._innerWidth/e;this._stepWidth<4;)this._stepWidth*=2},Object.defineProperties(e.prototype,i),e}(s),o=function(t){functi
|
||
|
//# sourceMappingURL=range.nomodule.min.js.map
|