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:
Martin Guillon
2020-09-23 21:17:41 +02:00
14 changed files with 98 additions and 37 deletions

View File

@ -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)

View File

@ -1,6 +1,6 @@
{
"name": "nativescript",
"version": "7.0.2",
"version": "7.0.4",
"license": "MIT",
"config": {
"npm_alias": "npm"
@ -36,11 +36,11 @@
"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"
},
"private": true,
"repository": {
"type": "git",
"url": "https://github.com/NativeScript/NativeScript.git"
},
"private": true,
"repository": {
"type": "git",
"url": "https://github.com/NativeScript/NativeScript.git"
},
"dependencies": {
"nativescript-theme-core": "^1.0.4"
},

View File

@ -1,4 +1,6 @@
interface IConfigPlaform {
import type {InstrumentationMode} from '../profiling'
interface IConfigPlatform {
/**
* App's bundle id
*/
@ -10,9 +12,10 @@ interface IConfigPlaform {
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
*/
@ -46,11 +49,6 @@ interface IConfigAndroid extends IConfigPlaform {
*/
gcThrottleTime?: number;
/**
* Enabled "timeline" profiling by setting this key to "timeline", default: ""
*/
profiling?: string;
/**
* "none" & "full" is supported, "full" is depreciated
* Default: none
@ -91,8 +89,8 @@ interface IConfigAndroid extends IConfigPlaform {
enableLineBreakpoints?: boolean;
/**
* Enabled the multithreaded JavaScript engine, this will probably break plugins...
* Disabled/Default: false
* Enable the multithreaded JavaScript engine, this will probably break plugins...
* Default: false - disabled.
*/
enableMultithreadedJavascript?: boolean;
}
@ -104,9 +102,13 @@ export interface NativeScriptConfig {
*/
id?: string;
/**
* App's main entry file
* App's main entry file (currently ignored - set it in package.json main field)
*/
main?: string;
/**
* Path to the app source directory
* This is often the `src` or `app` directory however can be changed.
*/
appPath?: string;
/**
* App_Resources path
@ -131,4 +133,15 @@ export interface NativeScriptConfig {
* Various Android specific configurations including Android runtime flags.
*/
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';
}

View File

@ -164,7 +164,9 @@ export class Observable implements ObservableDefinition {
}
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--) {
const entry = observers[i];
if (entry.once) {

View File

@ -3,7 +3,7 @@
"main": "index",
"types": "index.d.ts",
"description": "NativeScript Core Modules",
"version": "7.0.3-alpha.1",
"version": "7.0.4",
"homepage": "https://nativescript.org",
"repository": {
"type": "git",

View File

@ -1,9 +1,14 @@
import { DatePickerBase, yearProperty, monthProperty, dayProperty, dateProperty, maxDateProperty, minDateProperty } from './date-picker-common';
import { colorProperty } from '../styling/style-properties';
import { Color } from '../../color';
import { Device } from '../../platform';
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 {
private _changeHandler: NSObject;
public nativeViewProtected: UIDatePicker;
@ -11,7 +16,9 @@ export class DatePicker extends DatePickerBase {
public createNativeView() {
const picker = UIDatePicker.new();
picker.datePickerMode = UIDatePickerMode.Date;
if (SUPPORT_DATE_PICKER_STYLE) {
picker.preferredDatePickerStyle = DEFAULT_DATE_PICKER_STYLE;
}
return picker;
}
@ -74,11 +81,13 @@ export class DatePicker extends DatePickerBase {
}
[colorProperty.getDefault](): UIColor {
return this.nativeViewProtected.valueForKey('textColor');
return SUPPORT_TEXT_COLOR ? this.nativeViewProtected.valueForKey('textColor') : UIColor.new();
}
[colorProperty.setNative](value: Color | UIColor) {
const picker = this.nativeViewProtected;
picker.setValueForKey(value instanceof Color ? value.ios : value, 'textColor');
if (SUPPORT_TEXT_COLOR) {
const picker = this.nativeViewProtected;
picker.setValueForKey(value instanceof Color ? value.ios : value, 'textColor');
}
}
}

View File

@ -235,8 +235,8 @@ export class TextView extends TextViewBaseCommon {
public showText() {
this._isShowingHint = false;
this._refreshColor();
this._setNativeText();
this._refreshColor();
this.requestLayout();
}

View File

@ -1,9 +1,14 @@
import { TimePickerBase, timeProperty, minuteIntervalProperty, minuteProperty, minMinuteProperty, maxMinuteProperty, hourProperty, minHourProperty, maxHourProperty } from './time-picker-common';
import { Color } from '../../color';
import { colorProperty } from '../styling/style-properties';
import { Device } from '../../platform';
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 {
let components = NSDateComponents.alloc().init();
components.hour = hour;
@ -30,7 +35,9 @@ export class TimePicker extends TimePickerBase {
createNativeView() {
const picker = UIDatePicker.new();
picker.datePickerMode = UIDatePickerMode.Time;
if (SUPPORT_DATE_PICKER_STYLE) {
picker.preferredDatePickerStyle = DEFAULT_DATE_PICKER_STYLE;
}
return picker;
}
@ -106,11 +113,13 @@ export class TimePicker extends TimePickerBase {
}
[colorProperty.getDefault](): UIColor {
return this.nativeViewProtected.valueForKey('textColor');
return SUPPORT_TEXT_COLOR ? this.nativeViewProtected.valueForKey('textColor') : UIColor.new();
}
[colorProperty.setNative](value: Color | UIColor) {
const color = value instanceof Color ? value.ios : value;
this.nativeViewProtected.setValueForKey(color, 'textColor');
if (SUPPORT_TEXT_COLOR) {
const color = value instanceof Color ? value.ios : value;
this.nativeViewProtected.setValueForKey(color, 'textColor');
}
}
}

View File

@ -1,6 +1,6 @@
{
"name": "@nativescript/types-android",
"version": "7.0.2",
"version": "7.0.4",
"description": "NativeScript Types for Android.",
"homepage": "https://nativescript.org",
"repository": {

View File

@ -460,6 +460,7 @@
constructor(context: android.content.Context, attrs: android.util.AttributeSet);
setSwipePageEnabled(enabled: boolean): void;
setAnimationEnabled(enabled: boolean): void;
}
export class TabItemSpec {

View File

@ -1,6 +1,6 @@
{
"name": "@nativescript/types-ios",
"version": "7.0.1",
"version": "7.0.4",
"description": "NativeScript Types for iOS.",
"homepage": "https://nativescript.org",
"repository": {

View File

@ -6101,6 +6101,8 @@ declare class UIDatePicker extends UIControl implements NSCoding {
minuteInterval: number;
preferredDatePickerStyle: number;
timeZone: NSTimeZone;
constructor(o: { coder: NSCoder; }); // inherited from NSCoding

View File

@ -1,6 +1,6 @@
{
"name": "@nativescript/types",
"version": "7.0.1",
"version": "7.0.4",
"description": "NativeScript Types for all supported platforms.",
"homepage": "https://nativescript.org",
"repository": {
@ -12,7 +12,7 @@
],
"license": "Apache-2.0",
"dependencies": {
"@nativescript/types-ios": "~7.0.0",
"@nativescript/types-android": "~7.0.0"
"@nativescript/types-ios": "7.0.4",
"@nativescript/types-android": "7.0.4"
}
}