UNPKG

1.1 kBJavaScriptView Raw
1import { View, CSSType } from '../core/view';
2import { Property, CoercibleProperty } from '../core/properties';
3let ProgressBase = class ProgressBase extends View {
4};
5ProgressBase = __decorate([
6 CSSType('Progress')
7], ProgressBase);
8export { ProgressBase };
9ProgressBase.prototype.recycleNativeView = 'auto';
10/**
11 * Represents the observable property backing the value property of each Progress instance.
12 */
13export const valueProperty = new CoercibleProperty({
14 name: 'value',
15 defaultValue: 0,
16 coerceValue: (t, v) => {
17 return v < 0 ? 0 : Math.min(v, t.maxValue);
18 },
19 valueConverter: (v) => parseInt(v),
20});
21valueProperty.register(ProgressBase);
22/**
23 * Represents the observable property backing the maxValue property of each Progress instance.
24 */
25export const maxValueProperty = new Property({
26 name: 'maxValue',
27 defaultValue: 100,
28 valueChanged: (target, oldValue, newValue) => {
29 valueProperty.coerce(target);
30 },
31 valueConverter: (v) => parseInt(v),
32});
33maxValueProperty.register(ProgressBase);
34//# sourceMappingURL=progress-common.js.map
\No newline at end of file