mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: default tabs
This commit is contained in:
@@ -4,27 +4,27 @@ import { Property, CoercibleProperty } from '../core/properties';
|
||||
|
||||
@CSSType('Progress')
|
||||
export class ProgressBase extends View implements ProgressDefinition {
|
||||
public value: number;
|
||||
public maxValue: number;
|
||||
// get maxValue(): number {
|
||||
// return this._getValue(Progress.maxValueProperty);
|
||||
// }
|
||||
// set maxValue(newMaxValue: number) {
|
||||
// this._setValue(Progress.maxValueProperty, newMaxValue);
|
||||
public value: number;
|
||||
public maxValue: number;
|
||||
// get maxValue(): number {
|
||||
// return this._getValue(Progress.maxValueProperty);
|
||||
// }
|
||||
// set maxValue(newMaxValue: number) {
|
||||
// this._setValue(Progress.maxValueProperty, newMaxValue);
|
||||
|
||||
// // Adjust value if needed.
|
||||
// if (this.value > newMaxValue) {
|
||||
// this.value = newMaxValue;
|
||||
// }
|
||||
// }
|
||||
// // Adjust value if needed.
|
||||
// if (this.value > newMaxValue) {
|
||||
// this.value = newMaxValue;
|
||||
// }
|
||||
// }
|
||||
|
||||
// get value(): number {
|
||||
// return this._getValue(Progress.valueProperty);
|
||||
// }
|
||||
// set value(value: number) {
|
||||
// value = Math.min(value, this.maxValue);
|
||||
// this._setValue(Progress.valueProperty, value);
|
||||
// }
|
||||
// get value(): number {
|
||||
// return this._getValue(Progress.valueProperty);
|
||||
// }
|
||||
// set value(value: number) {
|
||||
// value = Math.min(value, this.maxValue);
|
||||
// this._setValue(Progress.valueProperty, value);
|
||||
// }
|
||||
}
|
||||
|
||||
ProgressBase.prototype.recycleNativeView = 'auto';
|
||||
@@ -33,12 +33,12 @@ ProgressBase.prototype.recycleNativeView = 'auto';
|
||||
* Represents the observable property backing the value property of each Progress instance.
|
||||
*/
|
||||
export const valueProperty = new CoercibleProperty<ProgressBase, number>({
|
||||
name: 'value',
|
||||
defaultValue: 0,
|
||||
coerceValue: (t, v) => {
|
||||
return v < 0 ? 0 : Math.min(v, t.maxValue);
|
||||
},
|
||||
valueConverter: (v) => parseInt(v),
|
||||
name: 'value',
|
||||
defaultValue: 0,
|
||||
coerceValue: (t, v) => {
|
||||
return v < 0 ? 0 : Math.min(v, t.maxValue);
|
||||
},
|
||||
valueConverter: (v) => parseInt(v),
|
||||
});
|
||||
valueProperty.register(ProgressBase);
|
||||
|
||||
@@ -46,11 +46,11 @@ valueProperty.register(ProgressBase);
|
||||
* Represents the observable property backing the maxValue property of each Progress instance.
|
||||
*/
|
||||
export const maxValueProperty = new Property<ProgressBase, number>({
|
||||
name: 'maxValue',
|
||||
defaultValue: 100,
|
||||
valueChanged: (target, oldValue, newValue) => {
|
||||
valueProperty.coerce(target);
|
||||
},
|
||||
valueConverter: (v) => parseInt(v),
|
||||
name: 'maxValue',
|
||||
defaultValue: 100,
|
||||
valueChanged: (target, oldValue, newValue) => {
|
||||
valueProperty.coerce(target);
|
||||
},
|
||||
valueConverter: (v) => parseInt(v),
|
||||
});
|
||||
maxValueProperty.register(ProgressBase);
|
||||
|
||||
Reference in New Issue
Block a user