mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-18 13:51:27 +08:00

# Conflicts: # apps/automated/src/test-runner.ts # apps/automated/src/ui/bottom-navigation/bottom-navigation-navigation-tests.ts # apps/ui/src/bottom-navigation/events-page.ts # apps/ui/src/main-page.ts # apps/ui/src/test-page-main-view-model.ts # package.json # packages/core/color/color-common.ts # packages/core/color/index.d.ts # packages/core/ui/action-bar/index.android.ts # packages/core/ui/bottom-navigation/index.android.ts # packages/core/ui/core/view/index.ios.ts # packages/core/ui/core/view/view-helper/view-helper-common.ts # packages/core/ui/index.ts # packages/core/ui/styling/background.android.ts # packages/core/ui/tab-navigation-base/tab-strip-item/index.ts # packages/webpack/jasmine-config/reporter.ts
29 lines
735 B
TypeScript
29 lines
735 B
TypeScript
import { Button as ButtonDefinition } from '.';
|
|
import { TextBase } from '../text-base';
|
|
import { CSSType } from '../core/view';
|
|
import { booleanConverter } from '../core/view-base';
|
|
import { AccessibilityRole } from '../../accessibility';
|
|
|
|
|
|
export const tapEvent = 'tap';
|
|
|
|
@CSSType('Button')
|
|
export abstract class ButtonBase extends TextBase implements ButtonDefinition {
|
|
|
|
accessible = true;
|
|
accessibilityRole = AccessibilityRole.Button;
|
|
|
|
get textWrap(): boolean {
|
|
return this.style.whiteSpace === 'normal';
|
|
}
|
|
set textWrap(value: boolean) {
|
|
if (typeof value === 'string') {
|
|
value = booleanConverter(value);
|
|
}
|
|
|
|
this.style.whiteSpace = value ? 'normal' : 'nowrap';
|
|
}
|
|
}
|
|
|
|
ButtonBase.prototype.recycleNativeView = 'auto';
|