@nativescript-community/ui-material-slider
Advanced tools
Comparing version 5.3.3 to 5.4.0-alpha.4
@@ -6,1 +6,2 @@ import { Color, CssProperty, Style } from '@nativescript/core'; | ||
export declare const thumbHollowAtStartProperty: CssProperty<Style, boolean>; | ||
export declare const stepSizeProperty: CssProperty<Style, number>; |
@@ -6,3 +6,3 @@ import { Color, CssProperty, Style, booleanConverter } from '@nativescript/core'; | ||
equalityComparer: Color.equals, | ||
valueConverter: v => new Color(v) | ||
valueConverter: (v) => new Color(v) | ||
}); | ||
@@ -14,3 +14,3 @@ trackBackgroundColorProperty.register(Style); | ||
equalityComparer: Color.equals, | ||
valueConverter: v => new Color(v) | ||
valueConverter: (v) => new Color(v) | ||
}); | ||
@@ -22,3 +22,3 @@ thumbColorProperty.register(Style); | ||
equalityComparer: Color.equals, | ||
valueConverter: v => new Color(v) | ||
valueConverter: (v) => new Color(v) | ||
}); | ||
@@ -32,2 +32,9 @@ trackFillColorProperty.register(Style); | ||
thumbHollowAtStartProperty.register(Style); | ||
export const stepSizeProperty = new CssProperty({ | ||
name: 'stepSize', | ||
cssName: 'step-size', | ||
defaultValue: 0, | ||
valueConverter: (v) => parseFloat(v) | ||
}); | ||
stepSizeProperty.register(Style); | ||
//# sourceMappingURL=cssproperties.js.map |
{ | ||
"name": "@nativescript-community/ui-material-slider", | ||
"version": "5.3.3", | ||
"version": "5.4.0-alpha.4+ef2a4482", | ||
"description": "Material Design Sliders allow users to make selections from a range of values.", | ||
@@ -46,5 +46,5 @@ "main": "./slider", | ||
"dependencies": { | ||
"@nativescript-community/ui-material-core": "^5.3.3" | ||
"@nativescript-community/ui-material-core": "^5.4.0-alpha.4+ef2a4482" | ||
}, | ||
"gitHead": "bbf6747f2fdbdb732bbef1e3b6075cc342198600" | ||
"gitHead": "ef2a4482fd8fca3288e16a0973c103ef61b9e184" | ||
} |
@@ -8,2 +8,3 @@ import { Color, Slider as NSSlider } from '@nativescript/core'; | ||
elevation: number; | ||
stepSize: number; | ||
} |
@@ -25,2 +25,6 @@ import { CSSType, Color, Slider as NSSlider } from '@nativescript/core'; | ||
], SliderBase.prototype, "elevation", void 0); | ||
__decorate([ | ||
cssProperty, | ||
__metadata("design:type", Number) | ||
], SliderBase.prototype, "stepSize", void 0); | ||
SliderBase = __decorate([ | ||
@@ -27,0 +31,0 @@ CSSType('MDSlider') |
@@ -12,2 +12,3 @@ import { CoercibleProperty, Color, Property, View } from '@nativescript/core'; | ||
thumbColor: Color; | ||
stepSize: number; | ||
elevation: number; | ||
@@ -14,0 +15,0 @@ _supressNativeValue: boolean; |
import { cssProperty, rippleColorProperty, themer } from '@nativescript-community/ui-material-core'; | ||
import { getEnabledColorStateList } from '@nativescript-community/ui-material-core/android/utils'; | ||
import { CoercibleProperty, Color, Property, View, backgroundColorProperty, backgroundInternalProperty, colorProperty } from '@nativescript/core'; | ||
import { thumbColorProperty, trackBackgroundColorProperty, trackFillColorProperty } from './cssproperties'; | ||
import { stepSizeProperty, thumbColorProperty, trackBackgroundColorProperty, trackFillColorProperty } from './cssproperties'; | ||
let ASlider; | ||
@@ -98,3 +98,11 @@ export function sliderGetEnabledColorStateList(color, alpha = 255) { | ||
} | ||
[stepSizeProperty.getDefault]() { | ||
return 0; | ||
} | ||
[stepSizeProperty.setNative](value) { | ||
this.nativeViewProtected.setStepSize(value); | ||
} | ||
[valueProperty.setNative](value) { | ||
this.nativeViewProtected.setValueFrom(this.minValue); | ||
this.nativeViewProtected.setValueTo(this.maxValue); | ||
this.nativeViewProtected.setValue(value); | ||
@@ -154,2 +162,6 @@ } | ||
__metadata("design:type", Number) | ||
], Slider.prototype, "stepSize", void 0); | ||
__decorate([ | ||
cssProperty, | ||
__metadata("design:type", Number) | ||
], Slider.prototype, "elevation", void 0); | ||
@@ -156,0 +168,0 @@ valueProperty.register(Slider); |
import { elevationProperty, rippleColorProperty, themer } from '@nativescript-community/ui-material-core'; | ||
import { Color, backgroundColorProperty, colorProperty } from '@nativescript/core'; | ||
import { thumbColorProperty, thumbHollowAtStartProperty, trackBackgroundColorProperty, trackFillColorProperty } from './cssproperties'; | ||
import { maxValueProperty } from '@nativescript/core/ui/progress'; | ||
import { minValueProperty } from '@nativescript/core/ui/slider/slider-common'; | ||
import { stepSizeProperty, thumbColorProperty, thumbHollowAtStartProperty, trackBackgroundColorProperty, trackFillColorProperty } from './cssproperties'; | ||
import { SliderBase } from './slider-common'; | ||
@@ -54,3 +56,28 @@ export class Slider extends SliderBase { | ||
} | ||
[minValueProperty.setNative](value) { | ||
this.nativeViewProtected.minimumValue = value; | ||
if (this.stepSize !== 0) { | ||
this.nativeViewProtected.numberOfDiscreteValues = (this.maxValue - this.minValue) / value; | ||
} | ||
} | ||
[maxValueProperty.setNative](value) { | ||
this.nativeViewProtected.maximumValue = value; | ||
if (this.stepSize !== 0) { | ||
this.nativeViewProtected.numberOfDiscreteValues = (this.maxValue - this.minValue) / value; | ||
} | ||
} | ||
[stepSizeProperty.getDefault]() { | ||
return 0; | ||
} | ||
[stepSizeProperty.setNative](value) { | ||
if (value === 0) { | ||
this.nativeViewProtected.discrete = false; | ||
} | ||
else { | ||
this.nativeViewProtected.discrete = true; | ||
this.nativeViewProtected.numberOfDiscreteValues = (this.maxValue - this.minValue) / value; | ||
this.nativeViewProtected.shouldDisplayDiscreteValueLabel = false; | ||
} | ||
} | ||
} | ||
//# sourceMappingURL=slider.ios.js.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
93327
522
3
1
+ Added@nativescript-community/ui-material-core@5.4.0-alpha.4(transitive)
- Removed@nativescript-community/ui-material-core@5.3.21(transitive)
Updated@nativescript-community/ui-material-core@^5.4.0-alpha.4+ef2a4482