Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
property-value-slider
Advanced tools
HTML custom element. Insert a Slider to manipulate an object property value
Creates a HTML custom element. In the Element is a slider. With this slider you can change a propery value of an HTMLElement. I use it to explore some aspects of CSS.
Id of the HTMLElement with the property to be changed. Element has to be in normal DOM not shadow
Name of the property to be changed.
The unit of the property value. It is added to the destPropName. If the unit is 'contentLength', the slider adds random word. In this case the slider value is the count of chars.
If the custom element is bound (s. destId), then a property (or sub-property) of that element is usually set. But if you also pass "destPropChildSelector" then you can set properties of elements which are children (need not be direct children) of this element. The selector for the "querySelectorAll" method is expected as the value. For example, if you want to customize all children that have the CSS class "flex-item" then you have to use ".flex-item" as the value.
Without this Parameter two numbers are insert right to the slider. The first shows the current value. The second the max value. A click on this numbers open an Dialog zu change the value. If "hideNr" is set, then the numbers are not apear and you can't change the min/max values on the fly. This parameter is new in 1.0.5. Before the parameter "showNr" exists.
The min value the slider returns Standard: 1
The max value the slider returns Standard: 100
The start value for the property. This value is set once at the beginning.
Is only relevant, if the parameter destPropUnit === "contentLength". There are three valid values:
Without this parameter a fix LOREM text ist created at startup. If the parameter "newContent" is set, every time you change the size of the content a new random LOREM is created to fill the content. So every time you change the lenght you get a new Text.
Without this Parameter a label is draw on the left side of the slider. It will show the "destId"."destPropName" ("destPropUnit").
Normally, the identifier, which is to the left of the slider, is made up of: '"destPropName" and "destPropUnit". If the "caption" attribute is passed, then this is used instead. The attribute should be passed even if the slider is not directly bound to an object.
If one of the two is passed, then a checkbox is set at the beginning of the slider. The values of the bound element (s. destId) are then only changed if the checkbox is set. If the checkbox is cleared, then the value of the bound attribute will default to ''. This resets all style attributes. However, if the slider controls a non-style attribute, you can use the "resetTo" attribute to transfer the value to which it is reset. The event changeVal is sent regardless of the status of the checkbox. However, the "checked" property is still returned in event.detail. This is true if either no checkbox is displayed at all and if it is checked.
This attribute is only relevant if the attribute "checked" or "unchecked" is also passed. It determines what value the bound attribute (s. destId, destPropertyName) will be reset to when the checkbox is reset. The default is a empty string '', that is fine for style properties.
<prop-val-slider>
id="range-div-test"
destId="div-test"
destPropName="style.fontSize"
destPropUnit="px"
min="1"
max="40"
startValue="14">
</prop-val-slider>
<div id="div-test">The font size of this div is controled by the slider</div>
FAQs
HTML custom element. Insert a Slider to manipulate an object property value
The npm package property-value-slider receives a total of 11 weekly downloads. As such, property-value-slider popularity was classified as not popular.
We found that property-value-slider demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.