mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-19 23:13:04 +08:00
Merge branch 'master' of github.com:NativeScript/NativeScript
# Conflicts: # CHANGELOG.md # package.json # packages/core/data/observable/index.ts # packages/core/globals/index.ts # packages/core/package.json
This commit is contained in:
25
CHANGELOG.md
25
CHANGELOG.md
@ -1,3 +1,28 @@
|
|||||||
|
## [7.0.4](https://github.com/NativeScript/NativeScript/compare/7.0.3-types-ios...7.0.4) (2020-09-23)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **android-transitions:** remove hard-coded flip transition duration/curve ([#8851](https://github.com/NativeScript/NativeScript/issues/8851)) ([5f8d3d0](https://github.com/NativeScript/NativeScript/commit/5f8d3d03f7eac1bdcb1cf4c338734298d2ba86ab))
|
||||||
|
* **ios:** text-view color refreshes properly after setting the text to keep the styles ([#8863](https://github.com/NativeScript/NativeScript/issues/8863)) ([313f476](https://github.com/NativeScript/NativeScript/commit/313f47637e2fd3d95acb56499cf72e8d6cde7aec))
|
||||||
|
* **ios:** time-picker and date-picker for iOS 14 ([#8877](https://github.com/NativeScript/NativeScript/issues/8877)) ([45fb6c4](https://github.com/NativeScript/NativeScript/commit/45fb6c481b3ae7b3df2cd9f666e1813bdbaff0c7))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **core:** global event handling ([#8830](https://github.com/NativeScript/NativeScript/issues/8830)) ([eb676fd](https://github.com/NativeScript/NativeScript/commit/eb676fdedf9e3db750bb1c0e7b48194faed2c772))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [7.0.3](https://github.com/NativeScript/NativeScript/compare/7.0.0...7.0.3) (2020-09-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* add missing configuration keys and move profiling out of android key ([#8847](https://github.com/NativeScript/NativeScript/issues/8847)) ([d69e568](https://github.com/NativeScript/NativeScript/commit/d69e568a4b6505e1ceef33a56100996199bf2d4b))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [7.0.2](https://github.com/NativeScript/NativeScript/compare/7.0.0...7.0.2) (2020-09-10)
|
## [7.0.2](https://github.com/NativeScript/NativeScript/compare/7.0.0...7.0.2) (2020-09-10)
|
||||||
|
|
||||||
|
|
||||||
|
12
package.json
12
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "nativescript",
|
"name": "nativescript",
|
||||||
"version": "7.0.2",
|
"version": "7.0.4",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"config": {
|
"config": {
|
||||||
"npm_alias": "npm"
|
"npm_alias": "npm"
|
||||||
@ -36,11 +36,11 @@
|
|||||||
"webpack:test": "cd packages/webpack && npm run tsc && npm run jasmine",
|
"webpack:test": "cd packages/webpack && npm run tsc && npm run jasmine",
|
||||||
"webpack:build": "cd packages/webpack npm run setup && mkdir -p ../../dist/packages && mv \"$(npm pack | tail -n 1)\" ../../dist/packages/nativescript-webpack.tgz"
|
"webpack:build": "cd packages/webpack npm run setup && mkdir -p ../../dist/packages && mv \"$(npm pack | tail -n 1)\" ../../dist/packages/nativescript-webpack.tgz"
|
||||||
},
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/NativeScript/NativeScript.git"
|
"url": "https://github.com/NativeScript/NativeScript.git"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"nativescript-theme-core": "^1.0.4"
|
"nativescript-theme-core": "^1.0.4"
|
||||||
},
|
},
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
interface IConfigPlaform {
|
import type {InstrumentationMode} from '../profiling'
|
||||||
|
|
||||||
|
interface IConfigPlatform {
|
||||||
/**
|
/**
|
||||||
* App's bundle id
|
* App's bundle id
|
||||||
*/
|
*/
|
||||||
@ -10,9 +12,10 @@ interface IConfigPlaform {
|
|||||||
discardUncaughtJsExceptions?: boolean;
|
discardUncaughtJsExceptions?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IConfigIOS extends IConfigPlaform {}
|
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
||||||
|
interface IConfigIOS extends IConfigPlatform {}
|
||||||
|
|
||||||
interface IConfigAndroid extends IConfigPlaform {
|
interface IConfigAndroid extends IConfigPlatform {
|
||||||
/**
|
/**
|
||||||
* These are the v8 runtime flags you can pass in, you must have "--expose_gc" as this is used in the runtime
|
* These are the v8 runtime flags you can pass in, you must have "--expose_gc" as this is used in the runtime
|
||||||
*/
|
*/
|
||||||
@ -46,11 +49,6 @@ interface IConfigAndroid extends IConfigPlaform {
|
|||||||
*/
|
*/
|
||||||
gcThrottleTime?: number;
|
gcThrottleTime?: number;
|
||||||
|
|
||||||
/**
|
|
||||||
* Enabled "timeline" profiling by setting this key to "timeline", default: ""
|
|
||||||
*/
|
|
||||||
profiling?: string;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* "none" & "full" is supported, "full" is depreciated
|
* "none" & "full" is supported, "full" is depreciated
|
||||||
* Default: none
|
* Default: none
|
||||||
@ -91,8 +89,8 @@ interface IConfigAndroid extends IConfigPlaform {
|
|||||||
enableLineBreakpoints?: boolean;
|
enableLineBreakpoints?: boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enabled the multithreaded JavaScript engine, this will probably break plugins...
|
* Enable the multithreaded JavaScript engine, this will probably break plugins...
|
||||||
* Disabled/Default: false
|
* Default: false - disabled.
|
||||||
*/
|
*/
|
||||||
enableMultithreadedJavascript?: boolean;
|
enableMultithreadedJavascript?: boolean;
|
||||||
}
|
}
|
||||||
@ -104,9 +102,13 @@ export interface NativeScriptConfig {
|
|||||||
*/
|
*/
|
||||||
id?: string;
|
id?: string;
|
||||||
/**
|
/**
|
||||||
* App's main entry file
|
* App's main entry file (currently ignored - set it in package.json main field)
|
||||||
*/
|
*/
|
||||||
main?: string;
|
main?: string;
|
||||||
|
/**
|
||||||
|
* Path to the app source directory
|
||||||
|
* This is often the `src` or `app` directory however can be changed.
|
||||||
|
*/
|
||||||
appPath?: string;
|
appPath?: string;
|
||||||
/**
|
/**
|
||||||
* App_Resources path
|
* App_Resources path
|
||||||
@ -131,4 +133,15 @@ export interface NativeScriptConfig {
|
|||||||
* Various Android specific configurations including Android runtime flags.
|
* Various Android specific configurations including Android runtime flags.
|
||||||
*/
|
*/
|
||||||
android?: IConfigAndroid;
|
android?: IConfigAndroid;
|
||||||
|
/**
|
||||||
|
* Enable profiling for the application. Default: no profiling
|
||||||
|
* In most cases when profiling, you will want to use "timeline"
|
||||||
|
*/
|
||||||
|
profiling?: InstrumentationMode;
|
||||||
|
/**
|
||||||
|
* Set the default CSS parser that NativeScript will use.
|
||||||
|
* Default: css-tree
|
||||||
|
*/
|
||||||
|
cssParser?: 'rework' | 'nativescript' | 'css-tree';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ export class Observable implements ObservableDefinition {
|
|||||||
}
|
}
|
||||||
onListenerAdded(eventName: string, count: number) {}
|
onListenerAdded(eventName: string, count: number) {}
|
||||||
onListenerRemoved(eventName: string, count: number) {}
|
onListenerRemoved(eventName: string, count: number) {}
|
||||||
|
|
||||||
public addEventListener(eventNames: string, callback: (data: EventData) => void, thisArg?: any): void {
|
public addEventListener(eventNames: string, callback: (data: EventData) => void, thisArg?: any): void {
|
||||||
if (typeof eventNames !== 'string') {
|
if (typeof eventNames !== 'string') {
|
||||||
throw new TypeError('Events name(s) must be string.');
|
throw new TypeError('Events name(s) must be string.');
|
||||||
@ -164,7 +164,9 @@ export class Observable implements ObservableDefinition {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static _handleEvent<T extends EventData>(observers: Array<ListenerEntry>, data: T): void {
|
private static _handleEvent<T extends EventData>(observers: Array<ListenerEntry>, data: T): void {
|
||||||
if (!observers) { return; }
|
if (!observers) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
for (let i = observers.length - 1; i >= 0; i--) {
|
for (let i = observers.length - 1; i >= 0; i--) {
|
||||||
const entry = observers[i];
|
const entry = observers[i];
|
||||||
if (entry.once) {
|
if (entry.once) {
|
||||||
|
@ -360,4 +360,4 @@ export function initGlobal() {
|
|||||||
}
|
}
|
||||||
if (!global.NativeScriptHasInitGlobal) {
|
if (!global.NativeScriptHasInitGlobal) {
|
||||||
initGlobal();
|
initGlobal();
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"main": "index",
|
"main": "index",
|
||||||
"types": "index.d.ts",
|
"types": "index.d.ts",
|
||||||
"description": "NativeScript Core Modules",
|
"description": "NativeScript Core Modules",
|
||||||
"version": "7.0.3-alpha.1",
|
"version": "7.0.4",
|
||||||
"homepage": "https://nativescript.org",
|
"homepage": "https://nativescript.org",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -1,9 +1,14 @@
|
|||||||
import { DatePickerBase, yearProperty, monthProperty, dayProperty, dateProperty, maxDateProperty, minDateProperty } from './date-picker-common';
|
import { DatePickerBase, yearProperty, monthProperty, dayProperty, dateProperty, maxDateProperty, minDateProperty } from './date-picker-common';
|
||||||
import { colorProperty } from '../styling/style-properties';
|
import { colorProperty } from '../styling/style-properties';
|
||||||
import { Color } from '../../color';
|
import { Color } from '../../color';
|
||||||
|
import { Device } from '../../platform';
|
||||||
|
|
||||||
export * from './date-picker-common';
|
export * from './date-picker-common';
|
||||||
|
|
||||||
|
const SUPPORT_DATE_PICKER_STYLE = parseFloat(Device.os) >= 14.0;
|
||||||
|
const SUPPORT_TEXT_COLOR = parseFloat(Device.os) < 14.0;
|
||||||
|
const DEFAULT_DATE_PICKER_STYLE = 1;
|
||||||
|
|
||||||
export class DatePicker extends DatePickerBase {
|
export class DatePicker extends DatePickerBase {
|
||||||
private _changeHandler: NSObject;
|
private _changeHandler: NSObject;
|
||||||
public nativeViewProtected: UIDatePicker;
|
public nativeViewProtected: UIDatePicker;
|
||||||
@ -11,7 +16,9 @@ export class DatePicker extends DatePickerBase {
|
|||||||
public createNativeView() {
|
public createNativeView() {
|
||||||
const picker = UIDatePicker.new();
|
const picker = UIDatePicker.new();
|
||||||
picker.datePickerMode = UIDatePickerMode.Date;
|
picker.datePickerMode = UIDatePickerMode.Date;
|
||||||
|
if (SUPPORT_DATE_PICKER_STYLE) {
|
||||||
|
picker.preferredDatePickerStyle = DEFAULT_DATE_PICKER_STYLE;
|
||||||
|
}
|
||||||
return picker;
|
return picker;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,11 +81,13 @@ export class DatePicker extends DatePickerBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[colorProperty.getDefault](): UIColor {
|
[colorProperty.getDefault](): UIColor {
|
||||||
return this.nativeViewProtected.valueForKey('textColor');
|
return SUPPORT_TEXT_COLOR ? this.nativeViewProtected.valueForKey('textColor') : UIColor.new();
|
||||||
}
|
}
|
||||||
[colorProperty.setNative](value: Color | UIColor) {
|
[colorProperty.setNative](value: Color | UIColor) {
|
||||||
const picker = this.nativeViewProtected;
|
if (SUPPORT_TEXT_COLOR) {
|
||||||
picker.setValueForKey(value instanceof Color ? value.ios : value, 'textColor');
|
const picker = this.nativeViewProtected;
|
||||||
|
picker.setValueForKey(value instanceof Color ? value.ios : value, 'textColor');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -235,8 +235,8 @@ export class TextView extends TextViewBaseCommon {
|
|||||||
|
|
||||||
public showText() {
|
public showText() {
|
||||||
this._isShowingHint = false;
|
this._isShowingHint = false;
|
||||||
this._refreshColor();
|
|
||||||
this._setNativeText();
|
this._setNativeText();
|
||||||
|
this._refreshColor();
|
||||||
this.requestLayout();
|
this.requestLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,9 +1,14 @@
|
|||||||
import { TimePickerBase, timeProperty, minuteIntervalProperty, minuteProperty, minMinuteProperty, maxMinuteProperty, hourProperty, minHourProperty, maxHourProperty } from './time-picker-common';
|
import { TimePickerBase, timeProperty, minuteIntervalProperty, minuteProperty, minMinuteProperty, maxMinuteProperty, hourProperty, minHourProperty, maxHourProperty } from './time-picker-common';
|
||||||
import { Color } from '../../color';
|
import { Color } from '../../color';
|
||||||
import { colorProperty } from '../styling/style-properties';
|
import { colorProperty } from '../styling/style-properties';
|
||||||
|
import { Device } from '../../platform';
|
||||||
|
|
||||||
export * from './time-picker-common';
|
export * from './time-picker-common';
|
||||||
|
|
||||||
|
const SUPPORT_DATE_PICKER_STYLE = parseFloat(Device.os) >= 14.0;
|
||||||
|
const SUPPORT_TEXT_COLOR = parseFloat(Device.os) < 14.0;
|
||||||
|
const DEFAULT_DATE_PICKER_STYLE = 1;
|
||||||
|
|
||||||
function getDate(hour: number, minute: number): Date {
|
function getDate(hour: number, minute: number): Date {
|
||||||
let components = NSDateComponents.alloc().init();
|
let components = NSDateComponents.alloc().init();
|
||||||
components.hour = hour;
|
components.hour = hour;
|
||||||
@ -30,7 +35,9 @@ export class TimePicker extends TimePickerBase {
|
|||||||
createNativeView() {
|
createNativeView() {
|
||||||
const picker = UIDatePicker.new();
|
const picker = UIDatePicker.new();
|
||||||
picker.datePickerMode = UIDatePickerMode.Time;
|
picker.datePickerMode = UIDatePickerMode.Time;
|
||||||
|
if (SUPPORT_DATE_PICKER_STYLE) {
|
||||||
|
picker.preferredDatePickerStyle = DEFAULT_DATE_PICKER_STYLE;
|
||||||
|
}
|
||||||
return picker;
|
return picker;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -106,11 +113,13 @@ export class TimePicker extends TimePickerBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[colorProperty.getDefault](): UIColor {
|
[colorProperty.getDefault](): UIColor {
|
||||||
return this.nativeViewProtected.valueForKey('textColor');
|
return SUPPORT_TEXT_COLOR ? this.nativeViewProtected.valueForKey('textColor') : UIColor.new();
|
||||||
}
|
}
|
||||||
[colorProperty.setNative](value: Color | UIColor) {
|
[colorProperty.setNative](value: Color | UIColor) {
|
||||||
const color = value instanceof Color ? value.ios : value;
|
if (SUPPORT_TEXT_COLOR) {
|
||||||
this.nativeViewProtected.setValueForKey(color, 'textColor');
|
const color = value instanceof Color ? value.ios : value;
|
||||||
|
this.nativeViewProtected.setValueForKey(color, 'textColor');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nativescript/types-android",
|
"name": "@nativescript/types-android",
|
||||||
"version": "7.0.2",
|
"version": "7.0.4",
|
||||||
"description": "NativeScript Types for Android.",
|
"description": "NativeScript Types for Android.",
|
||||||
"homepage": "https://nativescript.org",
|
"homepage": "https://nativescript.org",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -460,6 +460,7 @@
|
|||||||
constructor(context: android.content.Context, attrs: android.util.AttributeSet);
|
constructor(context: android.content.Context, attrs: android.util.AttributeSet);
|
||||||
|
|
||||||
setSwipePageEnabled(enabled: boolean): void;
|
setSwipePageEnabled(enabled: boolean): void;
|
||||||
|
setAnimationEnabled(enabled: boolean): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class TabItemSpec {
|
export class TabItemSpec {
|
||||||
@ -619,4 +620,4 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nativescript/types-ios",
|
"name": "@nativescript/types-ios",
|
||||||
"version": "7.0.1",
|
"version": "7.0.4",
|
||||||
"description": "NativeScript Types for iOS.",
|
"description": "NativeScript Types for iOS.",
|
||||||
"homepage": "https://nativescript.org",
|
"homepage": "https://nativescript.org",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -6101,6 +6101,8 @@ declare class UIDatePicker extends UIControl implements NSCoding {
|
|||||||
|
|
||||||
minuteInterval: number;
|
minuteInterval: number;
|
||||||
|
|
||||||
|
preferredDatePickerStyle: number;
|
||||||
|
|
||||||
timeZone: NSTimeZone;
|
timeZone: NSTimeZone;
|
||||||
|
|
||||||
constructor(o: { coder: NSCoder; }); // inherited from NSCoding
|
constructor(o: { coder: NSCoder; }); // inherited from NSCoding
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nativescript/types",
|
"name": "@nativescript/types",
|
||||||
"version": "7.0.1",
|
"version": "7.0.4",
|
||||||
"description": "NativeScript Types for all supported platforms.",
|
"description": "NativeScript Types for all supported platforms.",
|
||||||
"homepage": "https://nativescript.org",
|
"homepage": "https://nativescript.org",
|
||||||
"repository": {
|
"repository": {
|
||||||
@ -12,7 +12,7 @@
|
|||||||
],
|
],
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nativescript/types-ios": "~7.0.0",
|
"@nativescript/types-ios": "7.0.4",
|
||||||
"@nativescript/types-android": "~7.0.0"
|
"@nativescript/types-android": "7.0.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user