Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@wisefoxme/unit-converter-lwc) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Unit Converter LWC
A Lightning Web Component (LWC) for converting units of measurement. This component allows users to convert values between different units such as length, weight, and temperature.
API
@api fromUnit
: The unit to convert from (e.g., "m" for meters).@api toUnit
: The unit to convert to (e.g., "km" for kilometers).@api conversionType
: The type of conversion (e.g., "length", "weight", "temperature").@api value
: An object containing thefrom
andto
values along with their respective units.@api precision
: The number of decimal places to round the converted value to (default is 2).@api hideLabels
: A boolean to hide or show the unit labels (default is false).@api fromLabel
: Custom label for the "from" input field.@api toLabel
: Custom label for the "to" input field.@api disableFrom
: A boolean to disable or enable the "from" input field (default is false).@api disableTo
: A boolean to disable or enable the "to" input field (default is false).@api disabled
: A boolean to disable or enable the input fields (default is false).
Events
conversion
: Fired when a conversion is performed. The event detail contains the from
and to
values along with their respective units:
{
"from": { "unit": "m", "value": 1500 },
"to": { "unit": "km", "value": 1.5 }
}