0.3.8 • Published 3 years ago

mindlife-custom-battery-rangeslider v0.3.8

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

Built With Stencil

MINDLIFE BATTERY

This is a custom element that lets users slide up and down a battery level with options such as animated hint at startup or read-only (disabled) mode to just display a value.

The following link demonstrate how to use the project in Angular

demo

private demo repo for authorised people

Installation

npm install mindlife-custom-battery-rangeslider

Angular

Using a Stencil built web component collection within an Angular CLI project is a two-step process. We need to:

Include the CUSTOM_ELEMENTS_SCHEMA in the modules that use the components. Call defineCustomElements() from main.ts (or some other appropriate place).

Please read: https://stenciljs.com/docs/angular

Usage

import 'mindlife-custom-battery-rangeslider';
<mindlife-battery></mindlife-battery>

Events

The only emitted event is the value of the slider when it moves mindlife-battery-value it will be between 0 and 100.

  document.addEventListener("mindlife-battery-value",(e)=>{console.log(e)})

Properties

Example

      <mindlife-battery value="40" reversed="false" animated-hint="false" disabled="false" single-color="true" color-steps="2" container="battery"></mindlife-battery>

value is the value set by the component at initialisation, it's watched at all time so the slider updates itself upon change.

animated-hint is a boolean value to enable the UX hint that will shake the handle of the slider to hint user that it can be moved.

disabled is a boolean value to make the slider read only through the value property defined above.

single-color is a boolean value to make the slider show only one color at a time, when true all segments will be the color of the highest value, if false, each segment color will be its own color level.

reversed boolean, if true, green is the color at the bottom and goes to red at the top.

color-steps 1 or 2, this is the number of steps where a segment color changes to another shade

container 'battery' or 'container' a battery or a simple container is used

container-opacity number from 0 to 1, 0 being fully transparent and 1 being fully opaque

hue-rotation number from 0 to 360 following HSL convention like this:

HSL Color wheel

0.3.8

3 years ago

0.3.6

3 years ago

0.3.5

3 years ago

0.3.4

3 years ago

0.3.3

3 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.9

3 years ago

0.2.8

3 years ago

0.2.7

3 years ago

0.2.6

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.2.3

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.2.2

3 years ago

0.1.9

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.0

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.0.98

4 years ago

0.0.99

4 years ago

0.0.97

4 years ago

0.0.95

4 years ago

0.0.96

4 years ago

0.0.93

4 years ago

0.0.94

4 years ago

0.0.92

4 years ago

0.0.91

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago