From b0d9acf05ffcd10e5581dc8c7e5f02c61d7b8f8b Mon Sep 17 00:00:00 2001 From: tgpetrov Date: Fri, 17 May 2019 18:32:32 +0300 Subject: [PATCH 01/32] fix: issue with ng-validation --- .../nativescript-datetimepicker.accessors.ts | 59 ++++++++++++++++++- src/datetimepicker.android.ts | 56 ++++++------------ src/ui/date-picker-field.common.ts | 20 +++++-- src/ui/date-time-picker-fields.ts | 19 ++++-- src/ui/time-picker-field.common.ts | 24 +++++--- src/utils/date-utils.ts | 10 ++++ 6 files changed, 127 insertions(+), 61 deletions(-) diff --git a/src/angular/nativescript-datetimepicker.accessors.ts b/src/angular/nativescript-datetimepicker.accessors.ts index 66566c2..ae23f41 100644 --- a/src/angular/nativescript-datetimepicker.accessors.ts +++ b/src/angular/nativescript-datetimepicker.accessors.ts @@ -39,10 +39,13 @@ const DATE_TIME_PICKERS_VALUE_ACCESSOR = { "date-picker-field[ngModel],date-picker-field[formControlName],date-picker-field[formControl]", providers: [DATE_PICKER_VALUE_ACCESSOR], host: { - "(dateChange)": "onChange($event.value)", + "(dateChange)": "handleDateChange($event)", + "(datePickerOpened)": "handleDatePickerOpened($event)", + "(datePickerClosed)": "handleDatePickerClosed($event)" }, }) export class DatePickerValueAccessor extends BaseValueAccessor { + private _hasBeenOpened = false; constructor(elementRef: ElementRef) { super(elementRef.nativeElement); } @@ -51,6 +54,20 @@ export class DatePickerValueAccessor extends BaseValueAccessor const normalized = super.normalizeValue(value); this.view.date = normalized; } + + handleDateChange(args: any) { + if (this._hasBeenOpened) { + this.onChange(args.value); + } + } + + handleDatePickerOpened(args: any) { + this._hasBeenOpened = true; + } + + handleDatePickerClosed(args: any) { + this.onTouched(); + } } /** @@ -69,10 +86,13 @@ export class DatePickerValueAccessor extends BaseValueAccessor "time-picker-field[ngModel],time-picker-field[formControlName],time-picker-field[formControl]", providers: [TIME_PICKER_VALUE_ACCESSOR], host: { - "(timeChange)": "onChange($event.value)", + "(timeChange)": "handleTimeChange($event)", + "(timePickerOpened)": "handleTimePickerOpened($event)", + "(timePickerClosed)": "handleTimePickerClosed($event)" }, }) export class TimePickerValueAccessor extends BaseValueAccessor { + private _hasBeenOpened = false; constructor(elementRef: ElementRef) { super(elementRef.nativeElement); } @@ -81,6 +101,20 @@ export class TimePickerValueAccessor extends BaseValueAccessor const normalized = super.normalizeValue(value); this.view.time = normalized; } + + handleTimeChange(args: any) { + if (this._hasBeenOpened) { + this.onChange(args.value); + } + } + + handleTimePickerOpened(args: any) { + this._hasBeenOpened = true; + } + + handleTimePickerClosed(args: any) { + this.onTouched(); + } } /** @@ -99,10 +133,15 @@ export class TimePickerValueAccessor extends BaseValueAccessor "date-time-picker-fields[ngModel],date-time-picker-fields[formControlName],date-time-picker-fields[formControl]", providers: [DATE_TIME_PICKERS_VALUE_ACCESSOR], host: { - "(dateChange)": "onChange($event.value)", + "(dateChange)": "handleDateChange($event)", + "(datePickerOpened)": "handlePickerOpened($event)", + "(datePickerClosed)": "handlePickerClosed($event)", + "(timePickerOpened)": "handlePickerOpened($event)", + "(timePickerClosed)": "handlePickerClosed($event)" }, }) export class DateTimePickersValueAccessor extends BaseValueAccessor { + private _hasBeenOpened = false; constructor(elementRef: ElementRef) { super(elementRef.nativeElement); } @@ -111,4 +150,18 @@ export class DateTimePickersValueAccessor extends BaseValueAccessor{ + eventName: DatePickerFieldBase.datePickerClosedEvent, + object: this + }; + this.notify(args); }) .catch((err) => { console.log('DatePickerField Error: ' + err); }); + let args = { + eventName: DatePickerFieldBase.datePickerOpenedEvent, + object: this + }; + this.notify(args); } public updateText() { @@ -112,10 +124,6 @@ export class DatePickerFieldBase extends PickerFieldBase implements DatePickerFi } } -export function dateComparer(x: Date, y: Date): boolean { - return x <= y && x >= y; -} - export function dateValueConverter(v: any): Date { return new Date(v); } diff --git a/src/ui/date-time-picker-fields.ts b/src/ui/date-time-picker-fields.ts index 99f232b..555d502 100644 --- a/src/ui/date-time-picker-fields.ts +++ b/src/ui/date-time-picker-fields.ts @@ -1,11 +1,11 @@ -import { Property, CSSType } from "tns-core-modules/ui/core/view"; +import { Property, CSSType, EventData } from "tns-core-modules/ui/core/view"; import { PropertyChangeData } from "tns-core-modules/data/observable"; import { DateTimePickerFields as DateTimePickerFieldsDefinition } from "./date-time-picker-fields"; import { GridLayout, ItemSpec } from "tns-core-modules/ui/layouts/grid-layout"; import { Orientation } from "tns-core-modules/ui/layouts/stack-layout"; import { DatePickerField } from "./date-picker-field"; import { TimePickerField } from "./time-picker-field"; -import { getDateNow, clearTime } from "../utils/date-utils"; +import { getDateNow, clearTime, dateComparer } from "../utils/date-utils"; @CSSType("DateTimePickerFields") export class DateTimePickerFields extends GridLayout implements DateTimePickerFieldsDefinition { @@ -241,6 +241,17 @@ export class DateTimePickerFields extends GridLayout implements DateTimePickerFi super.disposeNativeView(); } + public addEventListener(eventNames: string, callback: (data: EventData) => void, thisArg?: Object) { + super.addEventListener(eventNames, callback, thisArg); + this.dateField.addEventListener(eventNames, callback, thisArg); + this.timeField.addEventListener(eventNames, callback, thisArg); + } + public removeEventListener(eventNames: string, callback?: any, thisArg?: Object) { + super.removeEventListener(eventNames, callback, thisArg); + this.dateField.removeEventListener(eventNames, callback, thisArg); + this.timeField.removeEventListener(eventNames, callback, thisArg); + } + private _updateHandlers(subscribe: boolean) { if (subscribe) { this._dateChangeHandler = this._dateChangeHandler || ((args: PropertyChangeData) => { @@ -299,10 +310,6 @@ export class DateTimePickerFields extends GridLayout implements DateTimePickerFi } } -export function dateComparer(x: Date, y: Date): boolean { - return x <= y && x >= y; -} - export function dateValueConverter(v: any): Date { return new Date(v); } diff --git a/src/ui/time-picker-field.common.ts b/src/ui/time-picker-field.common.ts index b7a5806..838e592 100644 --- a/src/ui/time-picker-field.common.ts +++ b/src/ui/time-picker-field.common.ts @@ -1,8 +1,8 @@ -import { Property, CSSType } from "tns-core-modules/ui/core/view"; +import { Property, CSSType, EventData } from "tns-core-modules/ui/core/view"; import { DateTimePicker, DateTimePickerStyle } from "../datetimepicker"; import { TimePickerField as TimePickerFieldDefinition } from "./time-picker-field"; import { LocalizationUtils } from "../utils/localization-utils"; -import { getDateNow } from "../utils/date-utils"; +import { getDateNow, dateComparer } from "../utils/date-utils"; import { PickerFieldBase } from "./picker-field-base"; @CSSType("TimePickerField") @@ -10,13 +10,15 @@ export class TimePickerFieldBase extends PickerFieldBase implements TimePickerFi public time: Date; public timeFormat: string; public pickerDefaultTime: Date; + public static timePickerOpenedEvent = "timePickerOpened"; + public static timePickerClosedEvent = "timePickerClosed"; private _nativeLocale: any; private _nativeTimeFormatter: any; public static timeProperty = new Property({ name: "time", - equalityComparer: timeComparer, + equalityComparer: dateComparer, valueConverter: timeValueConverter, valueChanged: TimePickerFieldBase.timePropertyChanged }); @@ -29,7 +31,7 @@ export class TimePickerFieldBase extends PickerFieldBase implements TimePickerFi public static pickerDefaultTimeProperty = new Property({ name: "pickerDefaultTime", defaultValue: getDateNow(), - equalityComparer: timeComparer, + equalityComparer: dateComparer, valueConverter: timeValueConverter }); @@ -48,10 +50,20 @@ export class TimePickerFieldBase extends PickerFieldBase implements TimePickerFi if (result) { this.time = result; } + let args = { + eventName: TimePickerFieldBase.timePickerClosedEvent, + object: this + }; + this.notify(args); }) .catch((err) => { console.log('TimePickerField Error: ' + err); }); + let args = { + eventName: TimePickerFieldBase.timePickerOpenedEvent, + object: this + }; + this.notify(args); } public updateText() { @@ -101,10 +113,6 @@ export class TimePickerFieldBase extends PickerFieldBase implements TimePickerFi } } -export function timeComparer(x: Date, y: Date): boolean { - return x <= y && x >= y; -} - // Creates a date for today with the time represented in the timeString in ISO 8601 formats // as specified here: https://en.wikipedia.org/wiki/ISO_8601#Times: // 1)hh:mm:ss.sss --- 2)hhmmss.sss --- 3)hh:mm:ss --- 4)hhmmss --- 5)hh:mm --- 6)hhmm --- 7)hh diff --git a/src/utils/date-utils.ts b/src/utils/date-utils.ts index 0bdbc4f..7f29bd6 100644 --- a/src/utils/date-utils.ts +++ b/src/utils/date-utils.ts @@ -21,4 +21,14 @@ export function clearTime(date: Date): Date { date.setSeconds(0); date.setMilliseconds(0); return date; +} + +export function dateComparer(x: Date, y: Date): boolean { + if (x === undefined && y === undefined) { + return true; + } + if (x === null && y === null) { + return true; + } + return x <= y && x >= y; } \ No newline at end of file From a505e2ef0572d2479ec66251ac4d87332e6029d4 Mon Sep 17 00:00:00 2001 From: tgpetrov Date: Thu, 23 May 2019 11:35:44 +0300 Subject: [PATCH 02/32] fix: ipad issue --- src/datetimepicker.ios.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/datetimepicker.ios.ts b/src/datetimepicker.ios.ts index c1ef977..89dc264 100644 --- a/src/datetimepicker.ios.ts +++ b/src/datetimepicker.ios.ts @@ -13,6 +13,7 @@ export class DateTimePickerStyle extends DateTimePickerStyleBase { export class DateTimePicker extends DateTimePickerBase { public static PICKER_DEFAULT_MESSAGE_HEIGHT = 192; public static PICKER_WIDTH_INSETS = 16; + public static PICKER_WIDTH_PAD = 304; public static PICKER_DEFAULT_TITLE_OFFSET = 26.5; public static PICKER_DEFAULT_TITLE_HEIGHT = 16; public static PICKER_DEFAULT_MESSAGE = "\n\n\n\n\n\n\n\n\n"; @@ -72,7 +73,8 @@ export class DateTimePicker extends DateTimePickerBase { const alertController = UIAlertController.alertControllerWithTitleMessagePreferredStyle( alertTitle, DateTimePicker.PICKER_DEFAULT_MESSAGE, UIAlertControllerStyle.ActionSheet); const alertSize = Math.min(alertController.view.frame.size.width, alertController.view.frame.size.height); - const pickerViewWidth = alertSize - DateTimePicker.PICKER_WIDTH_INSETS; + const pickerViewWidth = UIDevice.currentDevice.userInterfaceIdiom === UIUserInterfaceIdiom.Pad ? + DateTimePicker.PICKER_WIDTH_PAD : alertSize - DateTimePicker.PICKER_WIDTH_INSETS; let pickerContainerFrameTop = DateTimePicker.PICKER_DEFAULT_TITLE_OFFSET; if (options.title) { From 9aefec534d9a31975d99cb1b4f79d79d8039fa97 Mon Sep 17 00:00:00 2001 From: Elena Hristova Date: Fri, 31 May 2019 17:59:23 +0300 Subject: [PATCH 03/32] chore: update to node 10, set trusty distribution --- .travis.yml | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 65363f1..aff794e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,7 @@ matrix: - stage: "lint" language: node_js os: linux - node_js: "8" + node_js: "10" script: - cd src && npm run ci.tslint - cd ../demo && npm run ci.tslint @@ -39,7 +39,7 @@ matrix: - Type="VanillaJS" osx_image: xcode10.0 language: node_js - node_js: "8" + node_js: "10" jdk: oraclejdk8 before_script: pod repo update script: @@ -53,7 +53,7 @@ matrix: - Type="VueJS" osx_image: xcode10.0 language: node_js - node_js: "8" + node_js: "10" jdk: oraclejdk8 before_script: pod repo update script: @@ -67,7 +67,7 @@ matrix: - Type="Angular" osx_image: xcode10.0 language: node_js - node_js: "8" + node_js: "10" jdk: oraclejdk8 before_script: pod repo update script: @@ -78,33 +78,36 @@ matrix: - "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $IOS_SAUCE_STORAGE/$IOS_PACKAGE_NG?overwrite=true --data-binary @$IOS_PACKAGE_FOLDER_NG/$IOS_PACKAGE_NG" - language: android os: linux + dist: trusty env: - WebpackAndroid="28" - Type="VanillaJS" jdk: oraclejdk8 - before_install: nvm install 8 + before_install: nvm install 10 script: - cd src && npm run build - cd ../demo && npm i && tns build android --bundle --env.uglify --env.snapshot --copy-to "./outputs/app-debug.apk" - "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $ANDROID_SAUCE_STORAGE/$ANDROID_PACKAGE_JS?overwrite=true --data-binary @$ANDROID_PACKAGE_FOLDER_JS/app-debug.apk" - language: android os: linux + dist: trusty env: - WebpackAndroid="28" - Type="VueJS" jdk: oraclejdk8 - before_install: nvm install 8 + before_install: nvm install 10 script: - cd src && npm run build - cd ../demo-vue && npm i && tns build android --bundle --env.uglify --copy-to "./outputs/app-debug.apk" - "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $ANDROID_SAUCE_STORAGE/$ANDROID_PACKAGE_VUE?overwrite=true --data-binary @$ANDROID_PACKAGE_FOLDER_VUE/app-debug.apk" - language: android os: linux + dist: trusty env: - WebpackAndroid="28" - Type="Angular" jdk: oraclejdk8 - before_install: nvm install 8 + before_install: nvm install 10 script: - cd src && npm run build - cd ../publish && sh pack.sh @@ -112,22 +115,26 @@ matrix: - npm i && tns build android --bundle --env.uglify --env.snapshot --env.aot --copy-to "./outputs/app-debug.apk" - "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $ANDROID_SAUCE_STORAGE/$ANDROID_PACKAGE_NG?overwrite=true --data-binary @$ANDROID_PACKAGE_FOLDER_NG/app-debug.apk" - language: android + os: linux + dist: trusty env: - BuildAndroid="28" - Type="VanillaJS" - os: linux + jdk: oraclejdk8 - before_install: nvm install 8.11.4 + before_install: nvm install 10 script: - cd src && npm run build - cd ../demo && tns build android - language: android + os: linux + dist: trusty env: - BuildAndroid="28" - Type="Angular" - os: linux + jdk: oraclejdk8 - before_install: nvm install 8.11.4 + before_install: nvm install 10 script: - cd src && npm run build - cd ../demo-angular && tns build android @@ -138,7 +145,7 @@ matrix: - Type="VanillaJS" osx_image: xcode10.0 language: node_js - node_js: "8" + node_js: "10" jdk: oraclejdk8 before_script: pod repo update script: @@ -151,7 +158,7 @@ matrix: - Type="Angular" osx_image: xcode10.0 language: node_js - node_js: "8" + node_js: "10" jdk: oraclejdk8 before_script: pod repo update script: @@ -163,7 +170,7 @@ matrix: - Type="Angular" language: node_js os: linux - node_js: "8" + node_js: "10" script: - npm i -g appium - cd demo-angular && npm i @@ -173,7 +180,7 @@ matrix: - iOS="12.0" - Type="Angular" language: node_js - node_js: "8" + node_js: "10" script: - npm i -g appium - cd demo-angular && npm i From 41ac4b3dd77f04e89d918520237b7bb9cab7e877 Mon Sep 17 00:00:00 2001 From: Elena Hristova Date: Fri, 31 May 2019 22:56:57 +0300 Subject: [PATCH 04/32] chore: update to latest dependencies --- demo-angular/package.json | 106 ++++++------- demo-angular/src/app/home/home.component.ts | 2 +- demo-vue/package.json | 12 +- demo/package.json | 8 +- src/package.json | 158 ++++++++++---------- 5 files changed, 143 insertions(+), 143 deletions(-) diff --git a/demo-angular/package.json b/demo-angular/package.json index fa43c29..79858f2 100644 --- a/demo-angular/package.json +++ b/demo-angular/package.json @@ -1,55 +1,55 @@ { - "nativescript": { - "id": "org.nativescript.datetimepicker.demong", - "tns-android": { - "version": "5.3.0" - }, - "tns-ios": { - "version": "5.3.0" - } + "nativescript": { + "id": "org.nativescript.datetimepicker.demong", + "tns-android": { + "version": "5.4.0" }, - "description": "NativeScript DateTimePicker Demo NG", - "license": "SEE LICENSE IN LICENSE FILE", - "repository": "https://github.com/NativeScript/nativescript-datetimepicker", - "scripts": { - "ci.tslint": "npm i && tslint --config '../tslint.json' 'src/**/*.ts'", - "build.plugin": "cd ../src && npm run build", - "e2e": "node ./node_modules/nativescript-dev-appium/check-dev-deps.js && tsc -p e2e && mocha --opts ./e2e/config/mocha.opts ", - "e2e-watch": "tsc -p e2e --watch" - }, - "dependencies": { - "@angular/animations": "~7.2.0", - "@angular/common": "~7.2.0", - "@angular/compiler": "~7.2.0", - "@angular/core": "~7.2.0", - "@angular/forms": "~7.2.0", - "@angular/http": "~7.2.0", - "@angular/platform-browser": "~7.2.0", - "@angular/platform-browser-dynamic": "~7.2.0", - "@angular/router": "~7.2.0", - "nativescript-angular": "~7.2.0", - "nativescript-datetimepicker": "file:../src", - "nativescript-theme-core": "~1.0.4", - "reflect-metadata": "~0.1.10", - "rxjs": "~6.4.0", - "tns-core-modules": "^5.0.0", - "zone.js": "~0.8.18" - }, - "devDependencies": { - "@nativescript/schematics": "~0.5.0", - "nativescript-dev-typescript": "~0.9.0", - "nativescript-dev-webpack": "~0.21.0", - "@angular/compiler-cli": "~7.2.0", - "@ngtools/webpack": "~7.2.0", - "@types/chai": "~4.1.7", - "@types/mocha": "~5.2.5", - "@types/node": "~10.12.18", - "mocha": "~5.2.0", - "mocha-junit-reporter": "~1.18.0", - "mocha-multi": "~1.0.1", - "mochawesome": "~3.1.1", - "nativescript-dev-appium": "~5.0.0", - "tslint": "~5.11.0" - }, - "readme": "NativeScript DateTimePicker Demo NG" -} + "tns-ios": { + "version": "5.4.0" + } + }, + "description": "NativeScript DateTimePicker Demo NG", + "license": "SEE LICENSE IN LICENSE FILE", + "repository": "https://github.com/NativeScript/nativescript-datetimepicker", + "scripts": { + "ci.tslint": "npm i && tslint --config '../tslint.json' 'src/**/*.ts'", + "build.plugin": "cd ../src && npm run build", + "e2e": "node ./node_modules/nativescript-dev-appium/check-dev-deps.js && tsc -p e2e && mocha --opts ./e2e/config/mocha.opts ", + "e2e-watch": "tsc -p e2e --watch" + }, + "dependencies": { + "@angular/animations": "~8.0.0", + "@angular/common": "~8.0.0", + "@angular/compiler": "~8.0.0", + "@angular/core": "~8.0.0", + "@angular/forms": "~8.0.0", + "@angular/http": "8.0.0-beta.10", + "@angular/platform-browser": "~8.0.0", + "@angular/platform-browser-dynamic": "~8.0.0", + "@angular/router": "~8.0.0", + "nativescript-angular": "~8.0.0", + "nativescript-datetimepicker": "file:../src", + "nativescript-theme-core": "~1.0.4", + "reflect-metadata": "~0.1.10", + "rxjs": "^6.3.3", + "tns-core-modules": "^5.0.0", + "typescript": "~3.4.5", + "zone.js": "^0.8.4" + }, + "devDependencies": { + "@angular/compiler-cli": "~8.0.0", + "@ngtools/webpack": "~8.0.0", + "@types/chai": "~4.1.7", + "@types/mocha": "~5.2.5", + "@types/node": "~10.12.18", + "mocha": "~5.2.0", + "mocha-junit-reporter": "~1.18.0", + "mocha-multi": "~1.0.1", + "mochawesome": "~3.1.1", + "nativescript-dev-appium": "~5.2.0", + "nativescript-dev-typescript": "~0.10.0", + "nativescript-dev-webpack": "~0.24.0", + "tslint": "~5.11.0" + }, + "readme": "NativeScript DateTimePicker Demo NG" +} \ No newline at end of file diff --git a/demo-angular/src/app/home/home.component.ts b/demo-angular/src/app/home/home.component.ts index 55f8206..8f4e9e2 100644 --- a/demo-angular/src/app/home/home.component.ts +++ b/demo-angular/src/app/home/home.component.ts @@ -26,7 +26,7 @@ export class HomeComponent implements OnInit { public customVisibility: string; private _expandedId: string; - @ViewChild("scrollView") scrollView: ElementRef; + @ViewChild("scrollView", { static: false }) scrollView: ElementRef; constructor() { // Use the component constructor to inject providers. diff --git a/demo-vue/package.json b/demo-vue/package.json index d5c2468..588de42 100644 --- a/demo-vue/package.json +++ b/demo-vue/package.json @@ -2,10 +2,10 @@ "nativescript": { "id": "org.nativescript.datetimepicker.demovue", "tns-android": { - "version": "5.3.0" + "version": "5.4.0" }, "tns-ios": { - "version": "5.3.0" + "version": "5.4.0" } }, "description": "NativeScript DateTimePicker Demo Vue", @@ -14,16 +14,16 @@ "dependencies": { "nativescript-datetimepicker": "file:../src", "nativescript-theme-core": "~1.0.4", - "nativescript-vue": "~2.0.0", + "nativescript-vue": "~2.2.0", "tns-core-modules": "^5.0.0" }, "devDependencies": { "@babel/core": "~7.2.0", "@babel/preset-env": "~7.2.0", "babel-loader": "~8.0.0", - "nativescript-dev-typescript": "~0.9.0", - "nativescript-dev-webpack": "~0.21.0", - "nativescript-vue-template-compiler": "~2.0.2", + "nativescript-dev-typescript": "~0.10.0", + "nativescript-dev-webpack": "~0.24.0", + "nativescript-vue-template-compiler": "~2.2.0", "node-sass": "~4.9.0", "vue-loader": "~15.4.0" }, diff --git a/demo/package.json b/demo/package.json index 57a03a8..7c26a9c 100644 --- a/demo/package.json +++ b/demo/package.json @@ -2,10 +2,10 @@ "nativescript": { "id": "org.nativescript.datetimepicker.demo", "tns-android": { - "version": "5.3.0" + "version": "5.4.0" }, "tns-ios": { - "version": "5.3.0" + "version": "5.4.0" } }, "description": "NativeScript DateTimePicker Demo Core", @@ -21,8 +21,8 @@ "tns-core-modules": "^5.0.0" }, "devDependencies": { - "nativescript-dev-typescript": "~0.9.0", - "nativescript-dev-webpack": "~0.21.0", + "nativescript-dev-typescript": "~0.10.0", + "nativescript-dev-webpack": "~0.24.0", "tslint": "~5.11.0" }, "readme": "NativeScript DateTimePicker Demo Core" diff --git a/src/package.json b/src/package.json index 5ed340a..0e35e24 100644 --- a/src/package.json +++ b/src/package.json @@ -1,81 +1,81 @@ { - "name": "nativescript-datetimepicker", - "version": "1.2.0", - "description": "A NativeScript plugin for picking date and time.", - "typings": "index.d.ts", - "nativescript": { - "platforms": { - "android": "5.0.0", - "ios": "5.0.0" - } - }, - "scripts": { - "tsc": "npm i && tsc", - "build": "npm run tsc", - "tslint": "cd .. && tslint \"**/*.ts\" --config tslint.json --exclude \"**/node_modules/**\" --exclude \"**/platforms/**\"", - "plugin.tscwatch": "npm run tsc -- -w", - "demo.ios": "npm run build && cd ../demo && tns run ios --syncAllFiles --emulator", - "demo.android": "npm run build && cd ../demo && tns run android --syncAllFiles --emulator", - "demo.reset": "cd ../demo && npx rimraf -- hooks node_modules platforms package-lock.json", - "demo.ng.ios": "npm run build && cd ../demo-angular && tns run ios --syncAllFiles --emulator", - "demo.ng.android": "npm run build && cd ../demo-angular && tns run android --syncAllFiles --emulator", - "demo.ng.reset": "cd ../demo-angular && npx rimraf -- hooks node_modules platforms package-lock.json", - "demo.vue.ios": "npm run build && cd ../demo-vue && tns run ios --bundle --syncAllFiles --emulator", - "demo.vue.android": "npm run build && cd ../demo-vue && tns run android --bundle --syncAllFiles --emulator", - "demo.vue.reset": "cd ../demo-vue && npx rimraf -- hooks node_modules platforms package-lock.json", - "plugin.prepare": "npm run build && cd ../demo && tns plugin remove nativescript-datetimepicker && tns plugin add ../src", - "clean": "npm run demo.reset && npx rimraf -- node_modules package-lock.json && npm i", - "ci.tslint": "npm i && tslint '**/*.ts' --config '../tslint.json' --exclude '**/node_modules/**' --exclude '**/platforms/**'", - "ngc": "ngc -p tsconfig.json", - "prepack": "npm i && npm run ngc", - "pack": "bash ../publish/pack.sh" - }, - "keywords": [ - "NativeScript", - "JavaScript", - "Android", - "iOS", - "DatePicker", - "TimePicker", - "Date", - "Time" - ], - "author": { - "name": "NativeScript Team", - "email": "nativescriptplugins@progress.com" - }, - "bugs": { - "url": "https://github.com/NativeScript/nativescript-datetimepicker/issues" - }, - "repository": { - "type": "git", - "url": "git://github.com/NativeScript/nativescript-datetimepicker.git" - }, - "license": "Apache-2.0", - "homepage": "https://github.com/NativeScript/nativescript-datetimepicker", - "readmeFilename": "README.md", - "devDependencies": { - "tns-core-modules": "^5.0.0", - "tns-platform-declarations": "^5.0.0", - "typescript": "~3.1.6", - "prompt": "^1.0.0", - "rimraf": "^2.6.2", - "tslint": "^5.11.0", - "semver": "^5.6.0", - "nativescript-angular": "~7.2.0", - "@angular/core": "~7.2.0", - "@angular/common": "~7.2.0", - "@angular/compiler": "~7.2.0", - "@angular/compiler-cli": "~7.2.0", - "@angular/forms": "~7.2.0", - "@angular/http": "~7.2.0", - "@angular/platform-browser": "~7.2.0", - "@angular/platform-browser-dynamic": "~7.2.0", - "@angular/router": "~7.2.0", - "rxjs": "~6.4.0", - "zone.js": "~0.8.26", - "nativescript-vue": "~2.0.0" - }, - "dependencies": {}, - "bootstrapper": "nativescript-plugin-seed" + "name": "nativescript-datetimepicker", + "version": "1.2.0", + "description": "A NativeScript plugin for picking date and time.", + "typings": "index.d.ts", + "nativescript": { + "platforms": { + "android": "5.0.0", + "ios": "5.0.0" + } + }, + "scripts": { + "tsc": "npm i && tsc", + "build": "npm run tsc", + "tslint": "cd .. && tslint \"**/*.ts\" --config tslint.json --exclude \"**/node_modules/**\" --exclude \"**/platforms/**\"", + "plugin.tscwatch": "npm run tsc -- -w", + "demo.ios": "npm run build && cd ../demo && tns run ios --syncAllFiles --emulator", + "demo.android": "npm run build && cd ../demo && tns run android --syncAllFiles --emulator", + "demo.reset": "cd ../demo && npx rimraf -- hooks node_modules platforms package-lock.json", + "demo.ng.ios": "npm run build && cd ../demo-angular && tns run ios --syncAllFiles --emulator", + "demo.ng.android": "npm run build && cd ../demo-angular && tns run android --syncAllFiles --emulator", + "demo.ng.reset": "cd ../demo-angular && npx rimraf -- hooks node_modules platforms package-lock.json", + "demo.vue.ios": "npm run build && cd ../demo-vue && tns run ios --bundle --syncAllFiles --emulator", + "demo.vue.android": "npm run build && cd ../demo-vue && tns run android --bundle --syncAllFiles --emulator", + "demo.vue.reset": "cd ../demo-vue && npx rimraf -- hooks node_modules platforms package-lock.json", + "plugin.prepare": "npm run build && cd ../demo && tns plugin remove nativescript-datetimepicker && tns plugin add ../src", + "clean": "npm run demo.reset && npx rimraf -- node_modules package-lock.json && npm i", + "ci.tslint": "npm i && tslint '**/*.ts' --config '../tslint.json' --exclude '**/node_modules/**' --exclude '**/platforms/**'", + "ngc": "ngc -p tsconfig.json", + "prepack": "npm i && npm run ngc", + "pack": "bash ../publish/pack.sh" + }, + "keywords": [ + "NativeScript", + "JavaScript", + "Android", + "iOS", + "DatePicker", + "TimePicker", + "Date", + "Time" + ], + "author": { + "name": "NativeScript Team", + "email": "nativescriptplugins@progress.com" + }, + "bugs": { + "url": "https://github.com/NativeScript/nativescript-datetimepicker/issues" + }, + "repository": { + "type": "git", + "url": "git://github.com/NativeScript/nativescript-datetimepicker.git" + }, + "license": "Apache-2.0", + "homepage": "https://github.com/NativeScript/nativescript-datetimepicker", + "readmeFilename": "README.md", + "devDependencies": { + "@angular/common": "~8.0.0", + "@angular/compiler": "~8.0.0", + "@angular/compiler-cli": "~8.0.0", + "@angular/core": "~8.0.0", + "@angular/forms": "~8.0.0", + "@angular/http": "8.0.0-beta.10", + "@angular/platform-browser": "~8.0.0", + "@angular/platform-browser-dynamic": "~8.0.0", + "@angular/router": "~8.0.0", + "nativescript-angular": "~8.0.0", + "nativescript-vue": "~2.2.0", + "prompt": "^1.0.0", + "rimraf": "^2.6.2", + "rxjs": "^6.3.3", + "semver": "^5.6.0", + "tns-core-modules": "^5.0.0", + "tns-platform-declarations": "^5.0.0", + "tslint": "^5.11.0", + "typescript": "~3.4.5", + "zone.js": "^0.8.4" + }, + "dependencies": {}, + "bootstrapper": "nativescript-plugin-seed" } From 5c57145359c62979384a48b621ce9e355bda1115 Mon Sep 17 00:00:00 2001 From: Elena Hristova Date: Mon, 3 Jun 2019 10:20:04 +0300 Subject: [PATCH 05/32] fix: e2e tests --- demo-angular/e2e/tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/demo-angular/e2e/tsconfig.json b/demo-angular/e2e/tsconfig.json index 4aa39f6..2b7aa4b 100644 --- a/demo-angular/e2e/tsconfig.json +++ b/demo-angular/e2e/tsconfig.json @@ -8,7 +8,8 @@ "sourceMap": true, "types": [ "mocha", - "chai" + "chai", + "node" ], "lib": [ "es2015", From 0e9898ba40956f7ab77661a852d24709bb4c1831 Mon Sep 17 00:00:00 2001 From: Zdravko Branzov Date: Mon, 3 Jun 2019 17:18:20 +0300 Subject: [PATCH 06/32] chore: bump version to 1.2.1 --- src/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/package.json b/src/package.json index 0e35e24..576b880 100644 --- a/src/package.json +++ b/src/package.json @@ -1,6 +1,6 @@ { "name": "nativescript-datetimepicker", - "version": "1.2.0", + "version": "1.2.1", "description": "A NativeScript plugin for picking date and time.", "typings": "index.d.ts", "nativescript": { From 5ac5413b115f044880785d57a89687cdf7d08fda Mon Sep 17 00:00:00 2001 From: Elena Hristova Date: Tue, 18 Jun 2019 20:19:20 +0300 Subject: [PATCH 07/32] chore: update to xcode 10.2 (#34) --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index aff794e..4e82455 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,7 +37,7 @@ matrix: env: - WebpackiOS="12.0" - Type="VanillaJS" - osx_image: xcode10.0 + osx_image: xcode10.2 language: node_js node_js: "10" jdk: oraclejdk8 @@ -51,7 +51,7 @@ matrix: env: - WebpackiOS="12.0" - Type="VueJS" - osx_image: xcode10.0 + osx_image: xcode10.2 language: node_js node_js: "10" jdk: oraclejdk8 @@ -65,7 +65,7 @@ matrix: env: - WebpackiOS="12.0" - Type="Angular" - osx_image: xcode10.0 + osx_image: xcode10.2 language: node_js node_js: "10" jdk: oraclejdk8 @@ -143,7 +143,7 @@ matrix: - BuildiOS="12.0" - Xcode="10.0" - Type="VanillaJS" - osx_image: xcode10.0 + osx_image: xcode10.2 language: node_js node_js: "10" jdk: oraclejdk8 @@ -156,7 +156,7 @@ matrix: - BuildiOS="12.0" - Xcode="10.0" - Type="Angular" - osx_image: xcode10.0 + osx_image: xcode10.2 language: node_js node_js: "10" jdk: oraclejdk8 From c242538613187afb1f061e00359d6c005d4da6e5 Mon Sep 17 00:00:00 2001 From: Dimitar Todorov Date: Tue, 25 Jun 2019 16:24:09 +0300 Subject: [PATCH 08/32] add .npmrc package-lock false --- demo-angular/.npmrc | 1 + demo-vue/.npmrc | 1 + demo/.npmrc | 1 + 3 files changed, 3 insertions(+) create mode 100644 demo-angular/.npmrc create mode 100644 demo-vue/.npmrc create mode 100644 demo/.npmrc diff --git a/demo-angular/.npmrc b/demo-angular/.npmrc new file mode 100644 index 0000000..9cf9495 --- /dev/null +++ b/demo-angular/.npmrc @@ -0,0 +1 @@ +package-lock=false \ No newline at end of file diff --git a/demo-vue/.npmrc b/demo-vue/.npmrc new file mode 100644 index 0000000..9cf9495 --- /dev/null +++ b/demo-vue/.npmrc @@ -0,0 +1 @@ +package-lock=false \ No newline at end of file diff --git a/demo/.npmrc b/demo/.npmrc new file mode 100644 index 0000000..9cf9495 --- /dev/null +++ b/demo/.npmrc @@ -0,0 +1 @@ +package-lock=false \ No newline at end of file From e24d98f90f111a488afb6533165349ade6cdccef Mon Sep 17 00:00:00 2001 From: tgpetrov Date: Thu, 27 Jun 2019 09:47:25 +0300 Subject: [PATCH 09/32] refactor: use not so generic names --- src/ui/picker-field-base.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/ui/picker-field-base.ts b/src/ui/picker-field-base.ts index 231cc46..8071c70 100644 --- a/src/ui/picker-field-base.ts +++ b/src/ui/picker-field-base.ts @@ -8,7 +8,7 @@ export abstract class PickerFieldBase extends TextField { public pickerOkText: string; public pickerCancelText: string; - private _tapHandler: (args: TouchGestureEventData) => void; + private _pickerFieldBaseTapHandler: (args: TouchGestureEventData) => void; constructor() { super(); @@ -36,11 +36,11 @@ export abstract class PickerFieldBase extends TextField { initNativeView() { super.initNativeView(); - this._updateHandler(true); + this._updatePickerFieldBaseTapHandler(true); } disposeNativeView() { - this._updateHandler(false); + this._updatePickerFieldBaseTapHandler(false); super.disposeNativeView(); } @@ -51,18 +51,18 @@ export abstract class PickerFieldBase extends TextField { protected onLocaleChanged(oldValue: string, newValue: string) { } - private _updateHandler(subscribe: boolean) { + private _updatePickerFieldBaseTapHandler(subscribe: boolean) { if (subscribe) { - this._tapHandler = this._tapHandler || ((args: TouchGestureEventData) => { - this._onTap(args); + this._pickerFieldBaseTapHandler = this._pickerFieldBaseTapHandler || ((args: TouchGestureEventData) => { + this._onPickerFieldBaseTap(args); }); - this.on(GestureTypes.tap, this._tapHandler); + this.on(GestureTypes.tap, this._pickerFieldBaseTapHandler); } else { - this.off(GestureTypes.tap, this._tapHandler); + this.off(GestureTypes.tap, this._pickerFieldBaseTapHandler); } } - private _onTap(args: TouchGestureEventData) { + private _onPickerFieldBaseTap(args: TouchGestureEventData) { this.open(); } } From 87ff1ffd9434fa662fe84b8e33c66f4b77d0d6e7 Mon Sep 17 00:00:00 2001 From: tgpetrov Date: Thu, 27 Jun 2019 09:48:13 +0300 Subject: [PATCH 10/32] docs: more details about formats --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 15a2699..956fe3b 100644 --- a/README.md +++ b/README.md @@ -165,12 +165,12 @@ Internally `DatePickerField` and `TimePickerField` call `DateTimePicker`'s `pick | Property | Description | | --- | --- | -| `date` | The date the picker field is currently displaying. | -| `minDate` | The minimum date the picker field can select. | -| `maxDate` | The maximum date the picker field can select. | +| `date` | The date the picker field is currently displaying. Property is of type `Date`. When used in markup, the provided string will be passed to the [Date constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) to create a new `Date` object. | +| `minDate` | The minimum date the picker field can select. Parsing of dates is handled similarly as with `date` property. | +| `maxDate` | The maximum date the picker field can select. Parsing of dates is handled similarly as with `date` property. | | `locale` | Identifier of a locale that will be used to localize the names of the month names and also the order of the spinners (with `en_GB` first spinner is day, with `en_US` first spinner is month) (default is based on the device’s locale settings). | | `dateFormat` | Format used for the text in the picker field (on android used as a pattern for a [SimpleDateFormat](https://developer.android.com/reference/java/text/SimpleDateFormat), on iOS used as a dateFormat for [NSDateFormatter](https://developer.apple.com/documentation/foundation/nsdateformatter), default is generated by the current value of the `locale` property). | -| `pickerDefaultDate` | The date that will be displayed in the picker, if it is opened while date is undefined (if `pickerDefaultDate` is undefined, the picker will display today) | +| `pickerDefaultDate` | The date that will be displayed in the picker, if it is opened while date is undefined (if `pickerDefaultDate` is undefined, the picker will display today). Parsing of dates is handled similarly as with `date` property. | | `pickerTitle` | Text that will be displayed as title of the picker, default is undefined. | | `pickerOkText` | Text for the confirmation button of the picker (default is OK on iOS, localized version of OK on android (based on the devices locale settings)). | | `pickerCancelText` | Text for the cancel button of the picker (default is Cancel on iOS, localized version of Cancel on android (based on the devices locale settings)). | @@ -179,10 +179,10 @@ Internally `DatePickerField` and `TimePickerField` call `DateTimePicker`'s `pick | Property | Description | | --- | --- | -| `time` | The time the picker field is currently displaying. | +| `time` | The time the picker field is currently displaying. Property is of type `Date`. When used in markup, the provided string will be parsed to a new `Date` object if it is in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Times) format. | | `locale` | Identifier of a locale that will be used to create locale-specific time formatter of the time (if the format is 12-Hour, with de_DE locale “vorm.”/”nachm.” will be used to show whether time is before/after noon, with en_US locale “am”/”pm” will be used) (default is based on the device’s locale settings). The locale will also be used on iOS to determine whether the picker will be in 12 or 24 hour format. | | `timeFormat` | Format used for the text in the picker field (on android used as a pattern for a [SimpleDateFormat](https://developer.android.com/reference/java/text/SimpleDateFormat), on iOS used as a dateFormat for [NSDateFormatter](https://developer.apple.com/documentation/foundation/nsdateformatter), default is generated by the current value of the locale property), the format will also be used on Android to determine whether the picker will be in 12 or 24 hour format. | -| `pickerDefaultTime` | The time that will be displayed in the picker, if it is opened while time is undefined (if defaultTime is undefined, the picker will display now). | +| `pickerDefaultTime` | The time that will be displayed in the picker, if it is opened while time is undefined (if defaultTime is undefined, the picker will display now). Parsing is handled similarly as with `time` property. | | `pickerTitle` | Text that will be displayed as title of the picker, default is undefined. | | `pickerOkText` | Text for the confirmation button of the picker (default is OK on iOS, localized version of OK on android (based on the devices locale settings)). | | `pickerCancelText` | Text for the cancel button of the picker (default is Cancel on iOS, localized version of Cancel on android (based on the devices locale settings)). | @@ -191,13 +191,13 @@ Internally `DatePickerField` and `TimePickerField` call `DateTimePicker`'s `pick | Property | Description | | --- | --- | -| `date` | The date the picker fields are currently displaying. | -| `minDate` | The minimum date the date component can select. | -| `maxDate` | The maximum date the time component can select. | +| `date` | The date the picker fields are currently displaying. Property is of type `Date`. When used in markup, the provided string will be passed to the [Date constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) to create a new `Date` object. | +| `minDate` | The minimum date the date component can select. Parsing of dates is handled similarly as with `date` property. | +| `maxDate` | The maximum date the time component can select. Parsing of dates is handled similarly as with `date` property. | | `locale` | Identifier of a locale that will be used to localize the names of the month names, the order of the date spinners (with `en_GB` first spinner is day, with `en_US` first spinner is month), and to create locale-specific time formatter of the time (if the format is 12-Hour, with de_DE locale “vorm.”/”nachm.” will be used to show whether time is before/after noon, with en_US locale “am”/”pm” will be used) (default is based on the device’s locale settings). The locale will also be used on iOS to determine whether the picker will be in 12 or 24 hour format. | | `dateFormat` | Format used for the text in the picker field (on android used as a pattern for a [SimpleDateFormat](https://developer.android.com/reference/java/text/SimpleDateFormat), on iOS used as a dateFormat for [NSDateFormatter](https://developer.apple.com/documentation/foundation/nsdateformatter), default is generated by the current value of the `locale` property). | | `timeFormat` | Format used for the text in the picker field (on android used as a pattern for a [SimpleDateFormat](https://developer.android.com/reference/java/text/SimpleDateFormat), on iOS used as a dateFormat for [NSDateFormatter](https://developer.apple.com/documentation/foundation/nsdateformatter), default is generated by the current value of the locale property), the format will also be used on Android to determine whether the picker will be in 12 or 24 hour format. | -| `pickerDefaultTime` | The time that will be displayed in the picker, if it is opened while time is undefined (if defaultTime is undefined, the picker will display now). | +| `pickerDefaultDate` | The date and time that will be displayed in the pickers, if opened while `date` is `undefined` (if `pickerDefaultDate` is undefined, the picker will display now). Parsing of dates is handled similarly as with `date` property. | | `pickerTitleDate` | Text that will be displayed as title of the picker, when the date component is tapped, default is undefined. | | `pickerTitleTime` | Text that will be displayed as title of the picker, when the time component is tapped, default is undefined. | | `pickerOkText` | Text for the confirmation button of the picker (default is OK on iOS, localized version of OK on android (based on the devices locale settings)). | From d4b094ce6c55265802bf12c34f3c49ff12f62e07 Mon Sep 17 00:00:00 2001 From: Elena Hristova Date: Wed, 17 Jul 2019 11:11:32 +0300 Subject: [PATCH 11/32] chore: update demos to 6.0 --- demo-angular/nsconfig.json | 2 +- demo-angular/package.json | 15 +++++++-------- demo-vue/package.json | 20 ++++++++++---------- demo/package.json | 12 ++++++------ 4 files changed, 24 insertions(+), 25 deletions(-) diff --git a/demo-angular/nsconfig.json b/demo-angular/nsconfig.json index a64c9fa..b38346b 100644 --- a/demo-angular/nsconfig.json +++ b/demo-angular/nsconfig.json @@ -1,4 +1,4 @@ { "appResourcesPath": "App_Resources", "appPath": "src" -} +} \ No newline at end of file diff --git a/demo-angular/package.json b/demo-angular/package.json index 79858f2..af13542 100644 --- a/demo-angular/package.json +++ b/demo-angular/package.json @@ -2,10 +2,10 @@ "nativescript": { "id": "org.nativescript.datetimepicker.demong", "tns-android": { - "version": "5.4.0" + "version": "6.0.0" }, "tns-ios": { - "version": "5.4.0" + "version": "6.0.1" } }, "description": "NativeScript DateTimePicker Demo NG", @@ -32,8 +32,7 @@ "nativescript-theme-core": "~1.0.4", "reflect-metadata": "~0.1.10", "rxjs": "^6.3.3", - "tns-core-modules": "^5.0.0", - "typescript": "~3.4.5", + "tns-core-modules": "^6.0.0", "zone.js": "^0.8.4" }, "devDependencies": { @@ -47,9 +46,9 @@ "mocha-multi": "~1.0.1", "mochawesome": "~3.1.1", "nativescript-dev-appium": "~5.2.0", - "nativescript-dev-typescript": "~0.10.0", - "nativescript-dev-webpack": "~0.24.0", - "tslint": "~5.11.0" + "nativescript-dev-webpack": "~1.0.1", + "tslint": "~5.11.0", + "typescript": "~3.4.5" }, "readme": "NativeScript DateTimePicker Demo NG" -} \ No newline at end of file +} diff --git a/demo-vue/package.json b/demo-vue/package.json index 588de42..0c59c60 100644 --- a/demo-vue/package.json +++ b/demo-vue/package.json @@ -2,30 +2,30 @@ "nativescript": { "id": "org.nativescript.datetimepicker.demovue", "tns-android": { - "version": "5.4.0" + "version": "6.0.0" }, "tns-ios": { - "version": "5.4.0" + "version": "6.0.1" } }, "description": "NativeScript DateTimePicker Demo Vue", "license": "SEE LICENSE IN LICENSE FILE", "repository": "https://github.com/NativeScript/nativescript-datetimepicker", "dependencies": { - "nativescript-datetimepicker": "file:../src", + "nativescript-datetimepicker": "1.1.0", "nativescript-theme-core": "~1.0.4", - "nativescript-vue": "~2.2.0", - "tns-core-modules": "^5.0.0" + "nativescript-vue": "~2.3.0", + "tns-core-modules": "^6.0.0" }, "devDependencies": { "@babel/core": "~7.2.0", "@babel/preset-env": "~7.2.0", "babel-loader": "~8.0.0", - "nativescript-dev-typescript": "~0.10.0", - "nativescript-dev-webpack": "~0.24.0", - "nativescript-vue-template-compiler": "~2.2.0", - "node-sass": "~4.9.0", - "vue-loader": "~15.4.0" + "nativescript-dev-webpack": "~1.0.1", + "nativescript-vue-template-compiler": "~2.3.0", + "node-sass": "~4.12.0", + "vue-loader": "~15.4.0", + "typescript": "~3.4.5" }, "readme": "NativeScript DateTimePicker Demo Vue" } diff --git a/demo/package.json b/demo/package.json index 7c26a9c..f093619 100644 --- a/demo/package.json +++ b/demo/package.json @@ -2,10 +2,10 @@ "nativescript": { "id": "org.nativescript.datetimepicker.demo", "tns-android": { - "version": "5.4.0" + "version": "6.0.0" }, "tns-ios": { - "version": "5.4.0" + "version": "6.0.1" } }, "description": "NativeScript DateTimePicker Demo Core", @@ -18,12 +18,12 @@ "dependencies": { "nativescript-datetimepicker": "file:../src", "nativescript-theme-core": "~1.0.4", - "tns-core-modules": "^5.0.0" + "tns-core-modules": "^6.0.0" }, "devDependencies": { - "nativescript-dev-typescript": "~0.10.0", - "nativescript-dev-webpack": "~0.24.0", - "tslint": "~5.11.0" + "nativescript-dev-webpack": "~1.0.1", + "tslint": "~5.11.0", + "typescript": "~3.4.5" }, "readme": "NativeScript DateTimePicker Demo Core" } From 7d6cb56b5117953f95aefae65a7b2a69a561f043 Mon Sep 17 00:00:00 2001 From: Elena Hristova Date: Wed, 17 Jul 2019 11:12:56 +0300 Subject: [PATCH 12/32] chore: use linked plugin --- demo-vue/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo-vue/package.json b/demo-vue/package.json index 0c59c60..6b005d5 100644 --- a/demo-vue/package.json +++ b/demo-vue/package.json @@ -12,7 +12,7 @@ "license": "SEE LICENSE IN LICENSE FILE", "repository": "https://github.com/NativeScript/nativescript-datetimepicker", "dependencies": { - "nativescript-datetimepicker": "1.1.0", + "nativescript-datetimepicker": "file:../src", "nativescript-theme-core": "~1.0.4", "nativescript-vue": "~2.3.0", "tns-core-modules": "^6.0.0" From 625cb0dee9a6255c9a349412e5b3a974f5fb9df0 Mon Sep 17 00:00:00 2001 From: Todor Petrov Date: Wed, 17 Jul 2019 23:03:17 +0300 Subject: [PATCH 13/32] chore: more updates to demos for 6.0 (#38) * chore: update apps for 6.0 * chore: remove syncAllFiles & bundle --- .../Android/{ => src/main}/AndroidManifest.xml | 0 .../{ => src/main/res}/drawable-hdpi/background.png | Bin .../{ => src/main/res}/drawable-hdpi/icon.png | Bin .../{ => src/main/res}/drawable-hdpi/logo.png | Bin .../{ => src/main/res}/drawable-ldpi/background.png | Bin .../{ => src/main/res}/drawable-ldpi/icon.png | Bin .../{ => src/main/res}/drawable-ldpi/logo.png | Bin .../{ => src/main/res}/drawable-mdpi/background.png | Bin .../{ => src/main/res}/drawable-mdpi/icon.png | Bin .../{ => src/main/res}/drawable-mdpi/logo.png | Bin .../main/res}/drawable-nodpi/splash_screen.xml | 0 .../main/res}/drawable-xhdpi/background.png | Bin .../{ => src/main/res}/drawable-xhdpi/icon.png | Bin .../{ => src/main/res}/drawable-xhdpi/logo.png | Bin .../main/res}/drawable-xxhdpi/background.png | Bin .../{ => src/main/res}/drawable-xxhdpi/icon.png | Bin .../{ => src/main/res}/drawable-xxhdpi/logo.png | Bin .../main/res}/drawable-xxxhdpi/background.png | Bin .../{ => src/main/res}/drawable-xxxhdpi/icon.png | Bin .../{ => src/main/res}/drawable-xxxhdpi/logo.png | Bin .../{ => src/main/res}/values-v21/colors.xml | 0 .../{ => src/main/res}/values-v21/styles.xml | 0 .../Android/{ => src/main/res}/values/colors.xml | 0 .../Android/{ => src/main/res}/values/strings.xml | 0 .../Android/{ => src/main/res}/values/styles.xml | 0 src/package.json | 12 ++++++------ 26 files changed, 6 insertions(+), 6 deletions(-) rename demo-vue/app/App_Resources/Android/{ => src/main}/AndroidManifest.xml (100%) rename demo-vue/app/App_Resources/Android/{ => src/main/res}/drawable-hdpi/background.png (100%) rename demo-vue/app/App_Resources/Android/{ => src/main/res}/drawable-hdpi/icon.png (100%) rename demo-vue/app/App_Resources/Android/{ => src/main/res}/drawable-hdpi/logo.png (100%) rename demo-vue/app/App_Resources/Android/{ => src/main/res}/drawable-ldpi/background.png (100%) rename demo-vue/app/App_Resources/Android/{ => src/main/res}/drawable-ldpi/icon.png (100%) rename demo-vue/app/App_Resources/Android/{ => src/main/res}/drawable-ldpi/logo.png (100%) rename demo-vue/app/App_Resources/Android/{ => src/main/res}/drawable-mdpi/background.png (100%) rename demo-vue/app/App_Resources/Android/{ => src/main/res}/drawable-mdpi/icon.png (100%) rename demo-vue/app/App_Resources/Android/{ => src/main/res}/drawable-mdpi/logo.png (100%) rename demo-vue/app/App_Resources/Android/{ => src/main/res}/drawable-nodpi/splash_screen.xml (100%) rename demo-vue/app/App_Resources/Android/{ => src/main/res}/drawable-xhdpi/background.png (100%) rename demo-vue/app/App_Resources/Android/{ => src/main/res}/drawable-xhdpi/icon.png (100%) rename demo-vue/app/App_Resources/Android/{ => src/main/res}/drawable-xhdpi/logo.png (100%) rename demo-vue/app/App_Resources/Android/{ => src/main/res}/drawable-xxhdpi/background.png (100%) rename demo-vue/app/App_Resources/Android/{ => src/main/res}/drawable-xxhdpi/icon.png (100%) rename demo-vue/app/App_Resources/Android/{ => src/main/res}/drawable-xxhdpi/logo.png (100%) rename demo-vue/app/App_Resources/Android/{ => src/main/res}/drawable-xxxhdpi/background.png (100%) rename demo-vue/app/App_Resources/Android/{ => src/main/res}/drawable-xxxhdpi/icon.png (100%) rename demo-vue/app/App_Resources/Android/{ => src/main/res}/drawable-xxxhdpi/logo.png (100%) rename demo-vue/app/App_Resources/Android/{ => src/main/res}/values-v21/colors.xml (100%) rename demo-vue/app/App_Resources/Android/{ => src/main/res}/values-v21/styles.xml (100%) rename demo-vue/app/App_Resources/Android/{ => src/main/res}/values/colors.xml (100%) rename demo-vue/app/App_Resources/Android/{ => src/main/res}/values/strings.xml (100%) rename demo-vue/app/App_Resources/Android/{ => src/main/res}/values/styles.xml (100%) diff --git a/demo-vue/app/App_Resources/Android/AndroidManifest.xml b/demo-vue/app/App_Resources/Android/src/main/AndroidManifest.xml similarity index 100% rename from demo-vue/app/App_Resources/Android/AndroidManifest.xml rename to demo-vue/app/App_Resources/Android/src/main/AndroidManifest.xml diff --git a/demo-vue/app/App_Resources/Android/drawable-hdpi/background.png b/demo-vue/app/App_Resources/Android/src/main/res/drawable-hdpi/background.png similarity index 100% rename from demo-vue/app/App_Resources/Android/drawable-hdpi/background.png rename to demo-vue/app/App_Resources/Android/src/main/res/drawable-hdpi/background.png diff --git a/demo-vue/app/App_Resources/Android/drawable-hdpi/icon.png b/demo-vue/app/App_Resources/Android/src/main/res/drawable-hdpi/icon.png similarity index 100% rename from demo-vue/app/App_Resources/Android/drawable-hdpi/icon.png rename to demo-vue/app/App_Resources/Android/src/main/res/drawable-hdpi/icon.png diff --git a/demo-vue/app/App_Resources/Android/drawable-hdpi/logo.png b/demo-vue/app/App_Resources/Android/src/main/res/drawable-hdpi/logo.png similarity index 100% rename from demo-vue/app/App_Resources/Android/drawable-hdpi/logo.png rename to demo-vue/app/App_Resources/Android/src/main/res/drawable-hdpi/logo.png diff --git a/demo-vue/app/App_Resources/Android/drawable-ldpi/background.png b/demo-vue/app/App_Resources/Android/src/main/res/drawable-ldpi/background.png similarity index 100% rename from demo-vue/app/App_Resources/Android/drawable-ldpi/background.png rename to demo-vue/app/App_Resources/Android/src/main/res/drawable-ldpi/background.png diff --git a/demo-vue/app/App_Resources/Android/drawable-ldpi/icon.png b/demo-vue/app/App_Resources/Android/src/main/res/drawable-ldpi/icon.png similarity index 100% rename from demo-vue/app/App_Resources/Android/drawable-ldpi/icon.png rename to demo-vue/app/App_Resources/Android/src/main/res/drawable-ldpi/icon.png diff --git a/demo-vue/app/App_Resources/Android/drawable-ldpi/logo.png b/demo-vue/app/App_Resources/Android/src/main/res/drawable-ldpi/logo.png similarity index 100% rename from demo-vue/app/App_Resources/Android/drawable-ldpi/logo.png rename to demo-vue/app/App_Resources/Android/src/main/res/drawable-ldpi/logo.png diff --git a/demo-vue/app/App_Resources/Android/drawable-mdpi/background.png b/demo-vue/app/App_Resources/Android/src/main/res/drawable-mdpi/background.png similarity index 100% rename from demo-vue/app/App_Resources/Android/drawable-mdpi/background.png rename to demo-vue/app/App_Resources/Android/src/main/res/drawable-mdpi/background.png diff --git a/demo-vue/app/App_Resources/Android/drawable-mdpi/icon.png b/demo-vue/app/App_Resources/Android/src/main/res/drawable-mdpi/icon.png similarity index 100% rename from demo-vue/app/App_Resources/Android/drawable-mdpi/icon.png rename to demo-vue/app/App_Resources/Android/src/main/res/drawable-mdpi/icon.png diff --git a/demo-vue/app/App_Resources/Android/drawable-mdpi/logo.png b/demo-vue/app/App_Resources/Android/src/main/res/drawable-mdpi/logo.png similarity index 100% rename from demo-vue/app/App_Resources/Android/drawable-mdpi/logo.png rename to demo-vue/app/App_Resources/Android/src/main/res/drawable-mdpi/logo.png diff --git a/demo-vue/app/App_Resources/Android/drawable-nodpi/splash_screen.xml b/demo-vue/app/App_Resources/Android/src/main/res/drawable-nodpi/splash_screen.xml similarity index 100% rename from demo-vue/app/App_Resources/Android/drawable-nodpi/splash_screen.xml rename to demo-vue/app/App_Resources/Android/src/main/res/drawable-nodpi/splash_screen.xml diff --git a/demo-vue/app/App_Resources/Android/drawable-xhdpi/background.png b/demo-vue/app/App_Resources/Android/src/main/res/drawable-xhdpi/background.png similarity index 100% rename from demo-vue/app/App_Resources/Android/drawable-xhdpi/background.png rename to demo-vue/app/App_Resources/Android/src/main/res/drawable-xhdpi/background.png diff --git a/demo-vue/app/App_Resources/Android/drawable-xhdpi/icon.png b/demo-vue/app/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png similarity index 100% rename from demo-vue/app/App_Resources/Android/drawable-xhdpi/icon.png rename to demo-vue/app/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png diff --git a/demo-vue/app/App_Resources/Android/drawable-xhdpi/logo.png b/demo-vue/app/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png similarity index 100% rename from demo-vue/app/App_Resources/Android/drawable-xhdpi/logo.png rename to demo-vue/app/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png diff --git a/demo-vue/app/App_Resources/Android/drawable-xxhdpi/background.png b/demo-vue/app/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png similarity index 100% rename from demo-vue/app/App_Resources/Android/drawable-xxhdpi/background.png rename to demo-vue/app/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png diff --git a/demo-vue/app/App_Resources/Android/drawable-xxhdpi/icon.png b/demo-vue/app/App_Resources/Android/src/main/res/drawable-xxhdpi/icon.png similarity index 100% rename from demo-vue/app/App_Resources/Android/drawable-xxhdpi/icon.png rename to demo-vue/app/App_Resources/Android/src/main/res/drawable-xxhdpi/icon.png diff --git a/demo-vue/app/App_Resources/Android/drawable-xxhdpi/logo.png b/demo-vue/app/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png similarity index 100% rename from demo-vue/app/App_Resources/Android/drawable-xxhdpi/logo.png rename to demo-vue/app/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png diff --git a/demo-vue/app/App_Resources/Android/drawable-xxxhdpi/background.png b/demo-vue/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png similarity index 100% rename from demo-vue/app/App_Resources/Android/drawable-xxxhdpi/background.png rename to demo-vue/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png diff --git a/demo-vue/app/App_Resources/Android/drawable-xxxhdpi/icon.png b/demo-vue/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png similarity index 100% rename from demo-vue/app/App_Resources/Android/drawable-xxxhdpi/icon.png rename to demo-vue/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png diff --git a/demo-vue/app/App_Resources/Android/drawable-xxxhdpi/logo.png b/demo-vue/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png similarity index 100% rename from demo-vue/app/App_Resources/Android/drawable-xxxhdpi/logo.png rename to demo-vue/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png diff --git a/demo-vue/app/App_Resources/Android/values-v21/colors.xml b/demo-vue/app/App_Resources/Android/src/main/res/values-v21/colors.xml similarity index 100% rename from demo-vue/app/App_Resources/Android/values-v21/colors.xml rename to demo-vue/app/App_Resources/Android/src/main/res/values-v21/colors.xml diff --git a/demo-vue/app/App_Resources/Android/values-v21/styles.xml b/demo-vue/app/App_Resources/Android/src/main/res/values-v21/styles.xml similarity index 100% rename from demo-vue/app/App_Resources/Android/values-v21/styles.xml rename to demo-vue/app/App_Resources/Android/src/main/res/values-v21/styles.xml diff --git a/demo-vue/app/App_Resources/Android/values/colors.xml b/demo-vue/app/App_Resources/Android/src/main/res/values/colors.xml similarity index 100% rename from demo-vue/app/App_Resources/Android/values/colors.xml rename to demo-vue/app/App_Resources/Android/src/main/res/values/colors.xml diff --git a/demo-vue/app/App_Resources/Android/values/strings.xml b/demo-vue/app/App_Resources/Android/src/main/res/values/strings.xml similarity index 100% rename from demo-vue/app/App_Resources/Android/values/strings.xml rename to demo-vue/app/App_Resources/Android/src/main/res/values/strings.xml diff --git a/demo-vue/app/App_Resources/Android/values/styles.xml b/demo-vue/app/App_Resources/Android/src/main/res/values/styles.xml similarity index 100% rename from demo-vue/app/App_Resources/Android/values/styles.xml rename to demo-vue/app/App_Resources/Android/src/main/res/values/styles.xml diff --git a/src/package.json b/src/package.json index 576b880..462947a 100644 --- a/src/package.json +++ b/src/package.json @@ -14,14 +14,14 @@ "build": "npm run tsc", "tslint": "cd .. && tslint \"**/*.ts\" --config tslint.json --exclude \"**/node_modules/**\" --exclude \"**/platforms/**\"", "plugin.tscwatch": "npm run tsc -- -w", - "demo.ios": "npm run build && cd ../demo && tns run ios --syncAllFiles --emulator", - "demo.android": "npm run build && cd ../demo && tns run android --syncAllFiles --emulator", + "demo.ios": "npm run build && cd ../demo && tns run ios --emulator", + "demo.android": "npm run build && cd ../demo && tns run android --emulator", "demo.reset": "cd ../demo && npx rimraf -- hooks node_modules platforms package-lock.json", - "demo.ng.ios": "npm run build && cd ../demo-angular && tns run ios --syncAllFiles --emulator", - "demo.ng.android": "npm run build && cd ../demo-angular && tns run android --syncAllFiles --emulator", + "demo.ng.ios": "npm run build && cd ../demo-angular && tns run ios --emulator", + "demo.ng.android": "npm run build && cd ../demo-angular && tns run android --emulator", "demo.ng.reset": "cd ../demo-angular && npx rimraf -- hooks node_modules platforms package-lock.json", - "demo.vue.ios": "npm run build && cd ../demo-vue && tns run ios --bundle --syncAllFiles --emulator", - "demo.vue.android": "npm run build && cd ../demo-vue && tns run android --bundle --syncAllFiles --emulator", + "demo.vue.ios": "npm run build && cd ../demo-vue && tns run ios --emulator", + "demo.vue.android": "npm run build && cd ../demo-vue && tns run android --emulator", "demo.vue.reset": "cd ../demo-vue && npx rimraf -- hooks node_modules platforms package-lock.json", "plugin.prepare": "npm run build && cd ../demo && tns plugin remove nativescript-datetimepicker && tns plugin add ../src", "clean": "npm run demo.reset && npx rimraf -- node_modules package-lock.json && npm i", From 381bdb05ad3892b29a815e1fafc0cc3a5e13be17 Mon Sep 17 00:00:00 2001 From: Dimitar Todorov Date: Thu, 18 Jul 2019 11:56:50 +0300 Subject: [PATCH 14/32] Move e2e tests on root --- .travis.yml | 46 +++++++++++++++++- demo-angular/package.json | 7 --- .../e2e/config/appium.capabilities.json | 0 {demo-angular => tests}/e2e/config/mocha.opts | 0 {demo-angular => tests}/e2e/helper.ts | 0 .../cssDatePicker.png | Bin .../cssTimePicker.png | Bin .../iPhone X/cssDatePicker.png | Bin .../iPhone X/cssTimePicker.png | Bin {demo-angular => tests}/e2e/setup.ts | 0 {demo-angular => tests}/e2e/tests.e2e.ts | 0 {demo-angular => tests}/e2e/tsconfig.json | 0 tests/package.json | 21 ++++++++ 13 files changed, 65 insertions(+), 9 deletions(-) rename {demo-angular => tests}/e2e/config/appium.capabilities.json (100%) rename {demo-angular => tests}/e2e/config/mocha.opts (100%) rename {demo-angular => tests}/e2e/helper.ts (100%) rename {demo-angular => tests}/e2e/resources/images/datetimepicker-ng-android/Android GoogleAPI Emulator/cssDatePicker.png (100%) rename {demo-angular => tests}/e2e/resources/images/datetimepicker-ng-android/Android GoogleAPI Emulator/cssTimePicker.png (100%) rename {demo-angular => tests}/e2e/resources/images/datetimepicker-ng-ios/iPhone X/cssDatePicker.png (100%) rename {demo-angular => tests}/e2e/resources/images/datetimepicker-ng-ios/iPhone X/cssTimePicker.png (100%) rename {demo-angular => tests}/e2e/setup.ts (100%) rename {demo-angular => tests}/e2e/tests.e2e.ts (100%) rename {demo-angular => tests}/e2e/tsconfig.json (100%) create mode 100644 tests/package.json diff --git a/.travis.yml b/.travis.yml index 4e82455..0bc5cb2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -173,8 +173,30 @@ matrix: node_js: "10" script: - npm i -g appium - - cd demo-angular && npm i + - cd tests && npm i - travis_wait travis_retry npm run e2e -- --runType android24 --sauceLab --appPath $ANDROID_PACKAGE_NG + - os: linux + env: + - Android="24" + - Type="VanillaJS" + language: node_js + os: linux + node_js: "10" + script: + - npm i -g appium + - cd tests && npm i + - travis_wait travis_retry npm run e2e -- --runType android24 --sauceLab --appPath $ANDROID_PACKAGE_JS + - os: linux + env: + - Android="24" + - Type="VueJS" + language: node_js + os: linux + node_js: "10" + script: + - npm i -g appium + - cd tests && npm i + - travis_wait travis_retry npm run e2e -- --runType android24 --sauceLab --appPath $ANDROID_PACKAGE_VUE - os: linux env: - iOS="12.0" @@ -183,8 +205,28 @@ matrix: node_js: "10" script: - npm i -g appium - - cd demo-angular && npm i + - cd tests && npm i - travis_wait travis_retry npm run e2e -- --runType sim.iPhoneX --sauceLab --appPath $IOS_PACKAGE_NG + - os: linux + env: + - iOS="12.0" + - Type="VueJS" + language: node_js + node_js: "10" + script: + - npm i -g appium + - cd tests && npm i + - travis_wait travis_retry npm run e2e -- --runType sim.iPhoneX --sauceLab --appPath $IOS_PACKAGE_VUE + - os: linux + env: + - iOS="12.0" + - Type="VanillaJS" + language: node_js + node_js: "10" + script: + - npm i -g appium + - cd tests && npm i + - travis_wait travis_retry npm run e2e -- --runType sim.iPhoneX --sauceLab --appPath $IOS_PACKAGE_JS android: components: diff --git a/demo-angular/package.json b/demo-angular/package.json index af13542..f755a79 100644 --- a/demo-angular/package.json +++ b/demo-angular/package.json @@ -38,14 +38,7 @@ "devDependencies": { "@angular/compiler-cli": "~8.0.0", "@ngtools/webpack": "~8.0.0", - "@types/chai": "~4.1.7", - "@types/mocha": "~5.2.5", "@types/node": "~10.12.18", - "mocha": "~5.2.0", - "mocha-junit-reporter": "~1.18.0", - "mocha-multi": "~1.0.1", - "mochawesome": "~3.1.1", - "nativescript-dev-appium": "~5.2.0", "nativescript-dev-webpack": "~1.0.1", "tslint": "~5.11.0", "typescript": "~3.4.5" diff --git a/demo-angular/e2e/config/appium.capabilities.json b/tests/e2e/config/appium.capabilities.json similarity index 100% rename from demo-angular/e2e/config/appium.capabilities.json rename to tests/e2e/config/appium.capabilities.json diff --git a/demo-angular/e2e/config/mocha.opts b/tests/e2e/config/mocha.opts similarity index 100% rename from demo-angular/e2e/config/mocha.opts rename to tests/e2e/config/mocha.opts diff --git a/demo-angular/e2e/helper.ts b/tests/e2e/helper.ts similarity index 100% rename from demo-angular/e2e/helper.ts rename to tests/e2e/helper.ts diff --git a/demo-angular/e2e/resources/images/datetimepicker-ng-android/Android GoogleAPI Emulator/cssDatePicker.png b/tests/e2e/resources/images/datetimepicker-ng-android/Android GoogleAPI Emulator/cssDatePicker.png similarity index 100% rename from demo-angular/e2e/resources/images/datetimepicker-ng-android/Android GoogleAPI Emulator/cssDatePicker.png rename to tests/e2e/resources/images/datetimepicker-ng-android/Android GoogleAPI Emulator/cssDatePicker.png diff --git a/demo-angular/e2e/resources/images/datetimepicker-ng-android/Android GoogleAPI Emulator/cssTimePicker.png b/tests/e2e/resources/images/datetimepicker-ng-android/Android GoogleAPI Emulator/cssTimePicker.png similarity index 100% rename from demo-angular/e2e/resources/images/datetimepicker-ng-android/Android GoogleAPI Emulator/cssTimePicker.png rename to tests/e2e/resources/images/datetimepicker-ng-android/Android GoogleAPI Emulator/cssTimePicker.png diff --git a/demo-angular/e2e/resources/images/datetimepicker-ng-ios/iPhone X/cssDatePicker.png b/tests/e2e/resources/images/datetimepicker-ng-ios/iPhone X/cssDatePicker.png similarity index 100% rename from demo-angular/e2e/resources/images/datetimepicker-ng-ios/iPhone X/cssDatePicker.png rename to tests/e2e/resources/images/datetimepicker-ng-ios/iPhone X/cssDatePicker.png diff --git a/demo-angular/e2e/resources/images/datetimepicker-ng-ios/iPhone X/cssTimePicker.png b/tests/e2e/resources/images/datetimepicker-ng-ios/iPhone X/cssTimePicker.png similarity index 100% rename from demo-angular/e2e/resources/images/datetimepicker-ng-ios/iPhone X/cssTimePicker.png rename to tests/e2e/resources/images/datetimepicker-ng-ios/iPhone X/cssTimePicker.png diff --git a/demo-angular/e2e/setup.ts b/tests/e2e/setup.ts similarity index 100% rename from demo-angular/e2e/setup.ts rename to tests/e2e/setup.ts diff --git a/demo-angular/e2e/tests.e2e.ts b/tests/e2e/tests.e2e.ts similarity index 100% rename from demo-angular/e2e/tests.e2e.ts rename to tests/e2e/tests.e2e.ts diff --git a/demo-angular/e2e/tsconfig.json b/tests/e2e/tsconfig.json similarity index 100% rename from demo-angular/e2e/tsconfig.json rename to tests/e2e/tsconfig.json diff --git a/tests/package.json b/tests/package.json new file mode 100644 index 0000000..152ef39 --- /dev/null +++ b/tests/package.json @@ -0,0 +1,21 @@ +{ + "devDependencies": { + "@types/chai": "^4.1.3", + "@types/mocha": "^5.2.0", + "@types/node": "^10.1.2", + "babel-loader": "~8.0.0", + "chai": "~4.1.2", + "chai-as-promised": "~7.1.1", + "karma": "^2.0.2", + "karma-nativescript-launcher": "^0.4.0", + "mocha": "^3.3.0", + "mocha-junit-reporter": "^1.18.0", + "mocha-multi": "^1.0.1", + "mochawesome": "^3.1.1", + "nativescript-dev-appium": "~5.2.0", + "typescript": "~3.5.3" + }, + "scripts": { + "e2e": "tsc -p e2e && mocha --opts ./e2e/config/mocha.opts" + } + } \ No newline at end of file From 79c9ab55fab92f8e916fd04c588b92630370152c Mon Sep 17 00:00:00 2001 From: Dimitar Todorov Date: Thu, 18 Jul 2019 12:25:24 +0300 Subject: [PATCH 15/32] Fix: remove build-only stages. Remove --bundle flag. --- .travis.yml | 62 ++++++----------------------------------------------- 1 file changed, 6 insertions(+), 56 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0bc5cb2..c857638 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,7 +44,7 @@ matrix: before_script: pod repo update script: - cd src && npm run build - - cd ../demo && npm i && tns build ios --bundle --env.uglify --copy-to "./outputs/demo.app" + - cd ../demo && npm i && tns build ios --env.uglify --copy-to "./outputs/demo.app" - cd $IOS_PACKAGE_FOLDER_JS && zip -r $IOS_PACKAGE_JS demo.app - "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $IOS_SAUCE_STORAGE/$IOS_PACKAGE_JS?overwrite=true --data-binary @$IOS_PACKAGE_FOLDER_JS/$IOS_PACKAGE_JS" - os: osx @@ -58,7 +58,7 @@ matrix: before_script: pod repo update script: - cd src && npm run build - - cd ../demo-vue && npm i && tns build ios --bundle --env.uglify --copy-to "./outputs/demovue.app" + - cd ../demo-vue && npm i && tns build ios --env.uglify --copy-to "./outputs/demovue.app" - cd $IOS_PACKAGE_FOLDER_VUE && zip -r $IOS_PACKAGE_VUE demovue.app - "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $IOS_SAUCE_STORAGE/$IOS_PACKAGE_VUE?overwrite=true --data-binary @$IOS_PACKAGE_FOLDER_VUE/$IOS_PACKAGE_VUE" - os: osx @@ -73,7 +73,7 @@ matrix: script: - cd src && npm run build && npm pack - cd ../demo-angular && tns plugin add ../src/*.tgz - - npm i && tns build ios --bundle --env.uglify --env.aot --copy-to "./outputs/demoangular.app" + - npm i && tns build ios --env.uglify --env.aot --copy-to "./outputs/demoangular.app" - cd $IOS_PACKAGE_FOLDER_NG && zip -r $IOS_PACKAGE_NG demoangular.app - "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $IOS_SAUCE_STORAGE/$IOS_PACKAGE_NG?overwrite=true --data-binary @$IOS_PACKAGE_FOLDER_NG/$IOS_PACKAGE_NG" - language: android @@ -86,7 +86,7 @@ matrix: before_install: nvm install 10 script: - cd src && npm run build - - cd ../demo && npm i && tns build android --bundle --env.uglify --env.snapshot --copy-to "./outputs/app-debug.apk" + - cd ../demo && npm i && tns build android --env.uglify --env.snapshot --copy-to "./outputs/app-debug.apk" - "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $ANDROID_SAUCE_STORAGE/$ANDROID_PACKAGE_JS?overwrite=true --data-binary @$ANDROID_PACKAGE_FOLDER_JS/app-debug.apk" - language: android os: linux @@ -98,7 +98,7 @@ matrix: before_install: nvm install 10 script: - cd src && npm run build - - cd ../demo-vue && npm i && tns build android --bundle --env.uglify --copy-to "./outputs/app-debug.apk" + - cd ../demo-vue && npm i && tns build android --env.uglify --copy-to "./outputs/app-debug.apk" - "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $ANDROID_SAUCE_STORAGE/$ANDROID_PACKAGE_VUE?overwrite=true --data-binary @$ANDROID_PACKAGE_FOLDER_VUE/app-debug.apk" - language: android os: linux @@ -112,58 +112,8 @@ matrix: - cd src && npm run build - cd ../publish && sh pack.sh - cd ../demo-angular && tns plugin add ../publish/package/*.tgz - - npm i && tns build android --bundle --env.uglify --env.snapshot --env.aot --copy-to "./outputs/app-debug.apk" + - npm i && tns build android --env.uglify --env.snapshot --env.aot --copy-to "./outputs/app-debug.apk" - "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $ANDROID_SAUCE_STORAGE/$ANDROID_PACKAGE_NG?overwrite=true --data-binary @$ANDROID_PACKAGE_FOLDER_NG/app-debug.apk" - - language: android - os: linux - dist: trusty - env: - - BuildAndroid="28" - - Type="VanillaJS" - - jdk: oraclejdk8 - before_install: nvm install 10 - script: - - cd src && npm run build - - cd ../demo && tns build android - - language: android - os: linux - dist: trusty - env: - - BuildAndroid="28" - - Type="Angular" - - jdk: oraclejdk8 - before_install: nvm install 10 - script: - - cd src && npm run build - - cd ../demo-angular && tns build android - - os: osx - env: - - BuildiOS="12.0" - - Xcode="10.0" - - Type="VanillaJS" - osx_image: xcode10.2 - language: node_js - node_js: "10" - jdk: oraclejdk8 - before_script: pod repo update - script: - - cd src && npm run build - - cd ../demo && tns build ios --bundle --env.uglify - - os: osx - env: - - BuildiOS="12.0" - - Xcode="10.0" - - Type="Angular" - osx_image: xcode10.2 - language: node_js - node_js: "10" - jdk: oraclejdk8 - before_script: pod repo update - script: - - cd src && npm run build - - cd ../demo-angular && tns build ios - stage: "UI Tests" env: - Android="24" From 5eb9cd5e9c220f5e22c217d2fdd0e9f893e0c4c4 Mon Sep 17 00:00:00 2001 From: Dimitar Todorov Date: Fri, 19 Jul 2019 09:38:26 +0300 Subject: [PATCH 16/32] Fix: verify title tests --- tests/e2e/tests.e2e.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/tests.e2e.ts b/tests/e2e/tests.e2e.ts index 8bd225e..a469bed 100644 --- a/tests/e2e/tests.e2e.ts +++ b/tests/e2e/tests.e2e.ts @@ -61,7 +61,7 @@ describe("DateTimePicker", () => { }); it("Should verify demo title", async () => { - const title = await driver.findElementByText("DateTimePicker Demo NG", SearchOptions.exact); + const title = await driver.findElementByText("DateTimePicker Demo", SearchOptions.contains); expect(title).to.exist; }); From a4a502df95b4ce09de1ca88dc499c2ccaa3f5b45 Mon Sep 17 00:00:00 2001 From: Dimitar Todorov Date: Fri, 19 Jul 2019 16:32:01 +0300 Subject: [PATCH 17/32] Fix: skip last 2 tests for non angular projecs - issue in appium and android. --- tests/e2e/tests.e2e.ts | 66 ++++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/tests/e2e/tests.e2e.ts b/tests/e2e/tests.e2e.ts index a469bed..caf73cb 100644 --- a/tests/e2e/tests.e2e.ts +++ b/tests/e2e/tests.e2e.ts @@ -144,7 +144,7 @@ describe("DateTimePicker", () => { const dateString = day + "." + monthString + "." + year; console.log(dateString); const dateField = await driver.findElementByText(dateString); - expect(dateString).to.exist; + expect(dateField).to.exist; }); it("Should scroll to custom format and verify values", async () => { @@ -283,36 +283,38 @@ describe("DateTimePicker", () => { await customButtonsTitle.click(); }); - it("Should tap button to select date and verify button text", async () => { - await scrollToElement(driver, "tap to select date and time", Direction.down); - let dateButton = await driver.findElementByText("tap to select date", SearchOptions.contains); - await dateButton.click(); - const date = await getPickerDate(driver); - await clickOkBtn(driver); - const pickerDate = new Date(date); - let day = pickerDate.getDate(); - let dayString = day.toString(); - if(day < 10){ - dayString = "0" + day.toString(); - } - let month = pickerDate.getMonth() + 1; - let monthString = month.toString(); - if(month < 10){ - monthString = "0" + month.toString(); - } - let year = pickerDate.getFullYear(); - const dateString = dayString + "." + monthString+ "." + year; - console.log(dateString); - const dateField = await driver.findElementByText(dateString); - expect(dateString).to.exist; - }) + if (process.env["Type"] === 'Angular'){ + it("Should tap button to select date and verify button text", async () => { + await scrollToElement(driver, "tap to select date and time", Direction.down); + let dateButton = await driver.findElementByText("tap to select date", SearchOptions.contains); + await dateButton.click(); + const date = await getPickerDate(driver); + await clickOkBtn(driver); + const pickerDate = new Date(date); + let day = pickerDate.getDate(); + let dayString = day.toString(); + if(day < 10){ + dayString = "0" + day.toString(); + } + let month = pickerDate.getMonth() + 1; + let monthString = month.toString(); + if(month < 10){ + monthString = "0" + month.toString(); + } + let year = pickerDate.getFullYear(); + const dateString = dayString + "." + monthString+ "." + year; + console.log(dateString); + const dateField = await driver.findElementByText(dateString); + expect(dateField).to.exist; + }) - it("Should tap button to select time and verify button text", async () => { - let timeButton = await driver.findElementByText("tap to select time", SearchOptions.contains); - await timeButton.click(); - const time = await getPickerTime(driver, 24); - await clickOkBtn(driver); - timeButton = await driver.findElementByText(time); - expect(timeButton).to.exist; - }); + it("Should tap button to select time and verify button text", async () => { + let timeButton = await driver.findElementByText("tap to select time", SearchOptions.contains); + await timeButton.click(); + const time = await getPickerTime(driver, 24); + await clickOkBtn(driver); + timeButton = await driver.findElementByText(time); + expect(timeButton).to.exist; + }); + } }); \ No newline at end of file From 79d511abc14d1b238d61aee30d5e205b3e99e2a2 Mon Sep 17 00:00:00 2001 From: Dimitar Todorov Date: Wed, 31 Jul 2019 10:18:22 +0300 Subject: [PATCH 18/32] Update test for de_DE locale. Accept button selector. --- tests/e2e/tests.e2e.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/e2e/tests.e2e.ts b/tests/e2e/tests.e2e.ts index caf73cb..21fefb4 100644 --- a/tests/e2e/tests.e2e.ts +++ b/tests/e2e/tests.e2e.ts @@ -244,8 +244,8 @@ describe("DateTimePicker", () => { let rejectBtn; if(driver.isAndroid){ let buttons = await driver.findElementsByClassName("android.widget.Button"); - acceptBtn = buttons[5]; - rejectBtn = buttons[4]; + acceptBtn = buttons[buttons.length - 1]; + rejectBtn = buttons[buttons.length - 2]; } else{ acceptBtn = await driver.findElementByText("Bestätigen", SearchOptions.exact); @@ -256,7 +256,7 @@ describe("DateTimePicker", () => { expect(rejectBtn).to.exist; expect(title).to.exist; await acceptBtn.click(); - const dateField = await driver.findElementByText(time); + const dateField = await driver.findElementByText(time, SearchOptions.contains); expect(time).to.exist; }); From ed5113300022650e66461c8dbf1ded6e71805db6 Mon Sep 17 00:00:00 2001 From: dtodorov Date: Mon, 19 Aug 2019 11:35:15 +0300 Subject: [PATCH 19/32] Fix: mocha-multi to 1.0.1 --- tests/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/package.json b/tests/package.json index 152ef39..31af65d 100644 --- a/tests/package.json +++ b/tests/package.json @@ -10,7 +10,7 @@ "karma-nativescript-launcher": "^0.4.0", "mocha": "^3.3.0", "mocha-junit-reporter": "^1.18.0", - "mocha-multi": "^1.0.1", + "mocha-multi": "1.0.1", "mochawesome": "^3.1.1", "nativescript-dev-appium": "~5.2.0", "typescript": "~3.5.3" @@ -18,4 +18,4 @@ "scripts": { "e2e": "tsc -p e2e && mocha --opts ./e2e/config/mocha.opts" } - } \ No newline at end of file + } From e43dc42db44eabcbbd6d619569628e5291a910a4 Mon Sep 17 00:00:00 2001 From: dtodorov Date: Mon, 19 Aug 2019 14:14:46 +0300 Subject: [PATCH 20/32] Update package.json --- tests/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/package.json b/tests/package.json index 31af65d..a8dfbcc 100644 --- a/tests/package.json +++ b/tests/package.json @@ -10,7 +10,7 @@ "karma-nativescript-launcher": "^0.4.0", "mocha": "^3.3.0", "mocha-junit-reporter": "^1.18.0", - "mocha-multi": "1.0.1", + "mocha-multi": "1.1.0", "mochawesome": "^3.1.1", "nativescript-dev-appium": "~5.2.0", "typescript": "~3.5.3" From 4b6b0386fb05a208ba9dd37d0cd93aaa3b4ed498 Mon Sep 17 00:00:00 2001 From: dtodorov Date: Tue, 20 Aug 2019 10:33:19 +0300 Subject: [PATCH 21/32] Add android28 to capabilities. Update test run. (#43) --- .travis.yml | 6 +++--- tests/e2e/config/appium.capabilities.json | 12 ++++-------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index c857638..888046f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -124,7 +124,7 @@ matrix: script: - npm i -g appium - cd tests && npm i - - travis_wait travis_retry npm run e2e -- --runType android24 --sauceLab --appPath $ANDROID_PACKAGE_NG + - travis_wait travis_retry npm run e2e -- --runType android28 --sauceLab --appPath $ANDROID_PACKAGE_NG - os: linux env: - Android="24" @@ -135,7 +135,7 @@ matrix: script: - npm i -g appium - cd tests && npm i - - travis_wait travis_retry npm run e2e -- --runType android24 --sauceLab --appPath $ANDROID_PACKAGE_JS + - travis_wait travis_retry npm run e2e -- --runType android28 --sauceLab --appPath $ANDROID_PACKAGE_JS - os: linux env: - Android="24" @@ -146,7 +146,7 @@ matrix: script: - npm i -g appium - cd tests && npm i - - travis_wait travis_retry npm run e2e -- --runType android24 --sauceLab --appPath $ANDROID_PACKAGE_VUE + - travis_wait travis_retry npm run e2e -- --runType android28 --sauceLab --appPath $ANDROID_PACKAGE_VUE - os: linux env: - iOS="12.0" diff --git a/tests/e2e/config/appium.capabilities.json b/tests/e2e/config/appium.capabilities.json index b8c1f53..3e19c7f 100644 --- a/tests/e2e/config/appium.capabilities.json +++ b/tests/e2e/config/appium.capabilities.json @@ -80,14 +80,10 @@ }, "android28": { "platformName": "Android", - "platformVersion": "28", - "deviceName": "Emulator-Api28-Google", - "avd": "Emulator-Api28-Google", - "lt": 60000, - "newCommandTimeout": 720, - "noReset": false, - "fullReset": false, - "app": "" + "platformVersion": "9.0", + "deviceName": "Android GoogleAPI Emulator", + "appiumVersion": "1.9.1", + "noReset": true }, "sim.iPhone7": { "platformName": "iOS", From cd1e070c42fe4cbf50286d4856587b12cb2fbe68 Mon Sep 17 00:00:00 2001 From: dtodorov Date: Wed, 21 Aug 2019 14:14:26 +0300 Subject: [PATCH 22/32] Chore: update labels of travis builds --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 888046f..457934e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -116,7 +116,7 @@ matrix: - "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $ANDROID_SAUCE_STORAGE/$ANDROID_PACKAGE_NG?overwrite=true --data-binary @$ANDROID_PACKAGE_FOLDER_NG/app-debug.apk" - stage: "UI Tests" env: - - Android="24" + - Android="28" - Type="Angular" language: node_js os: linux @@ -127,7 +127,7 @@ matrix: - travis_wait travis_retry npm run e2e -- --runType android28 --sauceLab --appPath $ANDROID_PACKAGE_NG - os: linux env: - - Android="24" + - Android="28" - Type="VanillaJS" language: node_js os: linux @@ -138,7 +138,7 @@ matrix: - travis_wait travis_retry npm run e2e -- --runType android28 --sauceLab --appPath $ANDROID_PACKAGE_JS - os: linux env: - - Android="24" + - Android="28" - Type="VueJS" language: node_js os: linux From ffdacff60e6b3c39a1e47bb0a077b32cc6c6db72 Mon Sep 17 00:00:00 2001 From: Elena Hristova Date: Thu, 5 Sep 2019 01:07:13 +0300 Subject: [PATCH 23/32] chore: update dependencies for 6.1 --- demo-angular/package.json | 37 ++++++++++++++++++------------------- demo-vue/package.json | 10 +++++----- demo/package.json | 6 +++--- src/package.json | 1 - 4 files changed, 26 insertions(+), 28 deletions(-) diff --git a/demo-angular/package.json b/demo-angular/package.json index f755a79..767d1ed 100644 --- a/demo-angular/package.json +++ b/demo-angular/package.json @@ -2,10 +2,10 @@ "nativescript": { "id": "org.nativescript.datetimepicker.demong", "tns-android": { - "version": "6.0.0" + "version": "6.1.0" }, "tns-ios": { - "version": "6.0.1" + "version": "6.1.0" } }, "description": "NativeScript DateTimePicker Demo NG", @@ -18,30 +18,29 @@ "e2e-watch": "tsc -p e2e --watch" }, "dependencies": { - "@angular/animations": "~8.0.0", - "@angular/common": "~8.0.0", - "@angular/compiler": "~8.0.0", - "@angular/core": "~8.0.0", - "@angular/forms": "~8.0.0", - "@angular/http": "8.0.0-beta.10", - "@angular/platform-browser": "~8.0.0", - "@angular/platform-browser-dynamic": "~8.0.0", - "@angular/router": "~8.0.0", - "nativescript-angular": "~8.0.0", + "@angular/animations": "~8.2.0", + "@angular/common": "~8.2.0", + "@angular/compiler": "~8.2.0", + "@angular/core": "~8.2.0", + "@angular/forms": "~8.2.0", + "@angular/platform-browser": "~8.2.0", + "@angular/platform-browser-dynamic": "~8.2.0", + "@angular/router": "~8.2.0", + "nativescript-angular": "~8.2.0", "nativescript-datetimepicker": "file:../src", "nativescript-theme-core": "~1.0.4", "reflect-metadata": "~0.1.10", - "rxjs": "^6.3.3", + "rxjs": "^6.4.0", "tns-core-modules": "^6.0.0", - "zone.js": "^0.8.4" + "zone.js": "^0.9.1" }, "devDependencies": { - "@angular/compiler-cli": "~8.0.0", - "@ngtools/webpack": "~8.0.0", + "@angular/compiler-cli": "~8.2.0", + "@ngtools/webpack": "~8.2.0", "@types/node": "~10.12.18", - "nativescript-dev-webpack": "~1.0.1", + "nativescript-dev-webpack": "^1.0.0", "tslint": "~5.11.0", - "typescript": "~3.4.5" + "typescript": "~3.5.3" }, "readme": "NativeScript DateTimePicker Demo NG" -} +} \ No newline at end of file diff --git a/demo-vue/package.json b/demo-vue/package.json index 6b005d5..f954c43 100644 --- a/demo-vue/package.json +++ b/demo-vue/package.json @@ -2,10 +2,10 @@ "nativescript": { "id": "org.nativescript.datetimepicker.demovue", "tns-android": { - "version": "6.0.0" + "version": "6.1.0" }, "tns-ios": { - "version": "6.0.1" + "version": "6.1.0" } }, "description": "NativeScript DateTimePicker Demo Vue", @@ -14,15 +14,15 @@ "dependencies": { "nativescript-datetimepicker": "file:../src", "nativescript-theme-core": "~1.0.4", - "nativescript-vue": "~2.3.0", + "nativescript-vue": "~2.4.0", "tns-core-modules": "^6.0.0" }, "devDependencies": { "@babel/core": "~7.2.0", "@babel/preset-env": "~7.2.0", "babel-loader": "~8.0.0", - "nativescript-dev-webpack": "~1.0.1", - "nativescript-vue-template-compiler": "~2.3.0", + "nativescript-dev-webpack": "^1.0.0", + "nativescript-vue-template-compiler": "~2.4.0", "node-sass": "~4.12.0", "vue-loader": "~15.4.0", "typescript": "~3.4.5" diff --git a/demo/package.json b/demo/package.json index f093619..78148dc 100644 --- a/demo/package.json +++ b/demo/package.json @@ -2,10 +2,10 @@ "nativescript": { "id": "org.nativescript.datetimepicker.demo", "tns-android": { - "version": "6.0.0" + "version": "6.1.0" }, "tns-ios": { - "version": "6.0.1" + "version": "6.1.0" } }, "description": "NativeScript DateTimePicker Demo Core", @@ -21,7 +21,7 @@ "tns-core-modules": "^6.0.0" }, "devDependencies": { - "nativescript-dev-webpack": "~1.0.1", + "nativescript-dev-webpack": "^1.0.0", "tslint": "~5.11.0", "typescript": "~3.4.5" }, diff --git a/src/package.json b/src/package.json index 462947a..102cad1 100644 --- a/src/package.json +++ b/src/package.json @@ -60,7 +60,6 @@ "@angular/compiler-cli": "~8.0.0", "@angular/core": "~8.0.0", "@angular/forms": "~8.0.0", - "@angular/http": "8.0.0-beta.10", "@angular/platform-browser": "~8.0.0", "@angular/platform-browser-dynamic": "~8.0.0", "@angular/router": "~8.0.0", From 4f4df05e8be8789938fb715bf94fc57e3fb55026 Mon Sep 17 00:00:00 2001 From: tgpetrov Date: Tue, 29 Oct 2019 19:09:34 +0200 Subject: [PATCH 24/32] fix: styles don't work with ios13 --- src/datetimepicker.ios.ts | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/src/datetimepicker.ios.ts b/src/datetimepicker.ios.ts index 89dc264..bceac1f 100644 --- a/src/datetimepicker.ios.ts +++ b/src/datetimepicker.ios.ts @@ -81,8 +81,7 @@ export class DateTimePicker extends DateTimePickerBase { pickerContainerFrameTop += DateTimePicker.PICKER_DEFAULT_TITLE_HEIGHT; } const pickerViewHeight = DateTimePicker.PICKER_DEFAULT_MESSAGE_HEIGHT; - const pickerContainerFrame = CGRectMake(0, pickerContainerFrameTop, pickerViewWidth, pickerViewHeight); - const pickerContainer = UIView.alloc().initWithFrame(pickerContainerFrame); + const pickerContainer = UIView.alloc().init(); let spinnersBackgroundColor = new Color("transparent"); let spinnersTextColor = null; if (style) { @@ -94,12 +93,22 @@ export class DateTimePicker extends DateTimePickerBase { const pickerView = nativePicker; pickerView.frame = CGRectMake(0, 0, pickerViewWidth, pickerViewHeight); pickerContainer.addSubview(pickerView); + DateTimePicker._clearVibrancyEffects(alertController.view); const messageLabel = DateTimePicker._findLabelWithText(alertController.view, DateTimePicker.PICKER_DEFAULT_MESSAGE); - const messageLabelContainer = messageLabel.superview; + const messageLabelContainer = DateTimePicker._getLabelContainer(messageLabel); messageLabelContainer.clipsToBounds = true; messageLabelContainer.addSubview(pickerContainer); + pickerContainer.translatesAutoresizingMaskIntoConstraints = false; + pickerContainer.topAnchor.constraintEqualToAnchorConstant(alertController.view.topAnchor, pickerContainerFrameTop).active = true; + pickerContainer.leftAnchor.constraintEqualToAnchor(alertController.view.leftAnchor).active = true; + pickerContainer.rightAnchor.constraintEqualToAnchor(alertController.view.rightAnchor).active = true; + pickerContainer.bottomAnchor.constraintEqualToAnchor(alertController.view.bottomAnchor).active = true; + + pickerView.leftAnchor.constraintLessThanOrEqualToAnchorConstant(pickerContainer.leftAnchor, DateTimePicker.PICKER_WIDTH_INSETS).active = true; + pickerView.rightAnchor.constraintLessThanOrEqualToAnchorConstant(pickerContainer.rightAnchor, DateTimePicker.PICKER_WIDTH_INSETS).active = true; + const cancelButtonText = options.cancelButtonText ? options.cancelButtonText : "Cancel"; const okButtonText = options.okButtonText ? options.okButtonText : "OK"; const cancelActionStyle = (style && style.buttonCancelBackgroundColor) ? UIAlertActionStyle.Default : UIAlertActionStyle.Cancel; @@ -169,6 +178,7 @@ export class DateTimePicker extends DateTimePickerBase { } if (color) { nativePicker.setValueForKey(color.ios, "textColor"); + nativePicker.setValueForKey(false, "highlightsToday"); } } @@ -201,6 +211,25 @@ export class DateTimePicker extends DateTimePickerBase { } } + private static _clearVibrancyEffects(uiView: UIView) { + if (uiView instanceof UIVisualEffectView && uiView.effect instanceof UIVibrancyEffect) { + // Since ios13 UIAlertController has some effects which cause + // semi-transparency and interfere with color customizations: + uiView.effect = null; + } + const subViewsCount = uiView.subviews.count; + for (let i = 0; i < subViewsCount; i++) { + DateTimePicker._clearVibrancyEffects(uiView.subviews[i]); + } + } + + private static _getLabelContainer(uiView: UIView) { + if (uiView.superview.class() === (UIView.class())) { + return uiView.superview; + } + return DateTimePicker._getLabelContainer(uiView.superview); + } + private static _findLabelWithText(uiView: UIView, text: string) { if ((uiView instanceof UILabel) && uiView.text === text) { return uiView; From b037671cac7a26b17f45a804062ebdf45318e009 Mon Sep 17 00:00:00 2001 From: Zdravko Branzov Date: Thu, 31 Oct 2019 17:37:14 +0200 Subject: [PATCH 25/32] chore: bump the version to 1.2.2 --- src/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/package.json b/src/package.json index 102cad1..7e56f93 100644 --- a/src/package.json +++ b/src/package.json @@ -1,6 +1,6 @@ { "name": "nativescript-datetimepicker", - "version": "1.2.1", + "version": "1.2.2", "description": "A NativeScript plugin for picking date and time.", "typings": "index.d.ts", "nativescript": { From 65efef29a61039f65c0bdbf607c1cd771646dacc Mon Sep 17 00:00:00 2001 From: tgpetrov Date: Fri, 1 Nov 2019 10:10:23 +0200 Subject: [PATCH 26/32] fix: issue happening on 31st --- src/datetimepicker.android.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/datetimepicker.android.ts b/src/datetimepicker.android.ts index 3f88c1b..7163c31 100644 --- a/src/datetimepicker.android.ts +++ b/src/datetimepicker.android.ts @@ -155,6 +155,11 @@ export class DateTimePicker extends DateTimePickerBase { const context = options.context; let dateTime: Date; if (value) { + if (nativePicker instanceof android.widget.DatePicker) { + const minDate = (options).minDate; + const maxDate = (options).maxDate; + value = DateTimePicker._trimDate(value, minDate, maxDate); + } dateTime = new Date(value.getTime()); } else { dateTime = (nativePicker instanceof android.widget.DatePicker) ? getDateToday() : getDateNow(); @@ -188,6 +193,17 @@ export class DateTimePicker extends DateTimePickerBase { } } + private static _trimDate(originalDate: Date, minDate: Date, maxDate: Date) { + let finalDate = originalDate; + if (minDate !== undefined && minDate > finalDate) { + finalDate = minDate; + } + if (maxDate !== undefined && maxDate < finalDate) { + finalDate = maxDate; + } + return finalDate; + } + private static _applyDialogColors(nativeDialog: android.app.AlertDialog, color: Color, backgroundColor: Color) { if (backgroundColor) { nativeDialog.getWindow().setBackgroundDrawable(new android.graphics.drawable.ColorDrawable(backgroundColor.android)); From 58c76b8508c336b614fe630eafdb43fda286b683 Mon Sep 17 00:00:00 2001 From: Elena Hristova Date: Wed, 6 Nov 2019 15:57:51 +0200 Subject: [PATCH 27/32] chore: update to 6.2 --- demo-angular/package.json | 10 +++++----- demo-vue/package.json | 8 ++++---- demo/package.json | 8 ++++---- src/package.json | 6 +++--- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/demo-angular/package.json b/demo-angular/package.json index 767d1ed..821ee23 100644 --- a/demo-angular/package.json +++ b/demo-angular/package.json @@ -2,10 +2,10 @@ "nativescript": { "id": "org.nativescript.datetimepicker.demong", "tns-android": { - "version": "6.1.0" + "version": "6.2.0" }, "tns-ios": { - "version": "6.1.0" + "version": "6.2.0" } }, "description": "NativeScript DateTimePicker Demo NG", @@ -26,7 +26,7 @@ "@angular/platform-browser": "~8.2.0", "@angular/platform-browser-dynamic": "~8.2.0", "@angular/router": "~8.2.0", - "nativescript-angular": "~8.2.0", + "nativescript-angular": "~8.20.0", "nativescript-datetimepicker": "file:../src", "nativescript-theme-core": "~1.0.4", "reflect-metadata": "~0.1.10", @@ -38,9 +38,9 @@ "@angular/compiler-cli": "~8.2.0", "@ngtools/webpack": "~8.2.0", "@types/node": "~10.12.18", - "nativescript-dev-webpack": "^1.0.0", + "nativescript-dev-webpack": "^1.3.0", "tslint": "~5.11.0", "typescript": "~3.5.3" }, "readme": "NativeScript DateTimePicker Demo NG" -} \ No newline at end of file +} diff --git a/demo-vue/package.json b/demo-vue/package.json index f954c43..3a0fe44 100644 --- a/demo-vue/package.json +++ b/demo-vue/package.json @@ -2,10 +2,10 @@ "nativescript": { "id": "org.nativescript.datetimepicker.demovue", "tns-android": { - "version": "6.1.0" + "version": "6.2.0" }, "tns-ios": { - "version": "6.1.0" + "version": "6.2.0" } }, "description": "NativeScript DateTimePicker Demo Vue", @@ -21,11 +21,11 @@ "@babel/core": "~7.2.0", "@babel/preset-env": "~7.2.0", "babel-loader": "~8.0.0", - "nativescript-dev-webpack": "^1.0.0", + "nativescript-dev-webpack": "^1.3.0", "nativescript-vue-template-compiler": "~2.4.0", "node-sass": "~4.12.0", "vue-loader": "~15.4.0", - "typescript": "~3.4.5" + "typescript": "~3.5.3" }, "readme": "NativeScript DateTimePicker Demo Vue" } diff --git a/demo/package.json b/demo/package.json index 78148dc..f5800a7 100644 --- a/demo/package.json +++ b/demo/package.json @@ -2,10 +2,10 @@ "nativescript": { "id": "org.nativescript.datetimepicker.demo", "tns-android": { - "version": "6.1.0" + "version": "6.2.0" }, "tns-ios": { - "version": "6.1.0" + "version": "6.2.0" } }, "description": "NativeScript DateTimePicker Demo Core", @@ -21,9 +21,9 @@ "tns-core-modules": "^6.0.0" }, "devDependencies": { - "nativescript-dev-webpack": "^1.0.0", + "nativescript-dev-webpack": "^1.3.0", "tslint": "~5.11.0", - "typescript": "~3.4.5" + "typescript": "~3.5.3" }, "readme": "NativeScript DateTimePicker Demo Core" } diff --git a/src/package.json b/src/package.json index 7e56f93..8dffccd 100644 --- a/src/package.json +++ b/src/package.json @@ -69,10 +69,10 @@ "rimraf": "^2.6.2", "rxjs": "^6.3.3", "semver": "^5.6.0", - "tns-core-modules": "^5.0.0", - "tns-platform-declarations": "^5.0.0", + "tns-core-modules": "^6.0.0", + "tns-platform-declarations": "^6.0.0", "tslint": "^5.11.0", - "typescript": "~3.4.5", + "typescript": "~3.5.3", "zone.js": "^0.8.4" }, "dependencies": {}, From 79cca18293dab4052190905bfbe8d4255fe96367 Mon Sep 17 00:00:00 2001 From: Elena Hristova Date: Thu, 7 Nov 2019 11:04:49 +0200 Subject: [PATCH 28/32] chore: update angular references in plugin --- src/package.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/package.json b/src/package.json index 8dffccd..bf6e983 100644 --- a/src/package.json +++ b/src/package.json @@ -55,16 +55,16 @@ "homepage": "https://github.com/NativeScript/nativescript-datetimepicker", "readmeFilename": "README.md", "devDependencies": { - "@angular/common": "~8.0.0", - "@angular/compiler": "~8.0.0", - "@angular/compiler-cli": "~8.0.0", - "@angular/core": "~8.0.0", - "@angular/forms": "~8.0.0", - "@angular/platform-browser": "~8.0.0", - "@angular/platform-browser-dynamic": "~8.0.0", - "@angular/router": "~8.0.0", - "nativescript-angular": "~8.0.0", - "nativescript-vue": "~2.2.0", + "@angular/common": "~8.2.0", + "@angular/compiler": "~8.2.0", + "@angular/compiler-cli": "~8.2.0", + "@angular/core": "~8.2.0", + "@angular/forms": "~8.2.0", + "@angular/platform-browser": "~8.2.0", + "@angular/platform-browser-dynamic": "~8.2.0", + "@angular/router": "~8.2.0", + "nativescript-angular": "~8.20.0", + "nativescript-vue": "~2.4.0", "prompt": "^1.0.0", "rimraf": "^2.6.2", "rxjs": "^6.3.3", From f5aabf55709e99d9c2d66260fb0ed9ee47c6a710 Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Mon, 7 Sep 2020 11:32:34 -0700 Subject: [PATCH 29/32] chore: readme --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 956fe3b..ccf1ecc 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,10 @@ +## NativeScript 7 + +* Use `@nativescript/datetimepicker`: `~2.0.0` +* [Source managed here](https://github.com/NativeScript/plugins) + +## If using 6 and below, see the following: + # NativeScript DateTimePicker [![npm](https://img.shields.io/npm/v/nativescript-datetimepicker.svg)](https://www.npmjs.com/package/nativescript-datetimepicker) From 1edd8f0b3858f8a75b4000e2b6551e5c56efb3d2 Mon Sep 17 00:00:00 2001 From: Alexander Mai <50353733+alexander-mai@users.noreply.github.com> Date: Fri, 2 Oct 2020 05:17:35 +0200 Subject: [PATCH 30/32] fix(ios) Fixed iOS 14 display error (#76) --- src/datetimepicker.ios.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/datetimepicker.ios.ts b/src/datetimepicker.ios.ts index bceac1f..f56b1ec 100644 --- a/src/datetimepicker.ios.ts +++ b/src/datetimepicker.ios.ts @@ -1,5 +1,6 @@ import { Color } from "tns-core-modules/color"; import { View, ios as iosView } from "tns-core-modules/ui/core/view"; +import { device } from "tns-core-modules/platform"; import { DateTimePickerBase, DateTimePickerStyleBase, getCurrentPage, DatePickerOptions, TimePickerOptions, PickerOptions @@ -11,6 +12,10 @@ export class DateTimePickerStyle extends DateTimePickerStyleBase { } export class DateTimePicker extends DateTimePickerBase { + private static readonly SUPPORT_DATE_PICKER_STYLE = parseFloat(device.osVersion) >= 14.0; + private static readonly SUPPORT_TEXT_COLOR = parseFloat(device.osVersion) < 14.0; + private static readonly DEFAULT_DATE_PICKER_STYLE = 1; + public static PICKER_DEFAULT_MESSAGE_HEIGHT = 192; public static PICKER_WIDTH_INSETS = 16; public static PICKER_WIDTH_PAD = 304; @@ -43,6 +48,9 @@ export class DateTimePicker extends DateTimePickerBase { static _createNativeDatePicker(options: DatePickerOptions): UIDatePicker { const pickerView = UIDatePicker.alloc().initWithFrame(CGRectZero); pickerView.datePickerMode = UIDatePickerMode.Date; + if (this.SUPPORT_DATE_PICKER_STYLE) { + (pickerView as any).preferredDatePickerStyle = this.DEFAULT_DATE_PICKER_STYLE; + } const date = options.date ? options.date : getDateToday(); pickerView.date = date; if (options.maxDate) { @@ -60,6 +68,9 @@ export class DateTimePicker extends DateTimePickerBase { static _createNativeTimePicker(options: TimePickerOptions): UIDatePicker { const pickerView = UIDatePicker.alloc().initWithFrame(CGRectZero); pickerView.datePickerMode = UIDatePickerMode.Time; + if (this.SUPPORT_DATE_PICKER_STYLE) { + (pickerView as any).preferredDatePickerStyle = this.DEFAULT_DATE_PICKER_STYLE; + } const time = options.time ? options.time : getDateNow(); pickerView.date = time; if (options.locale) { @@ -177,7 +188,9 @@ export class DateTimePicker extends DateTimePickerBase { nativeContainer.backgroundColor = backgroundColor.ios; } if (color) { - nativePicker.setValueForKey(color.ios, "textColor"); + if (this.SUPPORT_TEXT_COLOR) { + nativePicker.setValueForKey(color, 'textColor'); + } nativePicker.setValueForKey(false, "highlightsToday"); } } @@ -243,4 +256,4 @@ export class DateTimePicker extends DateTimePickerBase { } return null; } -} \ No newline at end of file +} From e35391ee31b1907bd6fd595c9e45cd48d80f3965 Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Thu, 1 Oct 2020 20:26:32 -0700 Subject: [PATCH 31/32] chore: bump 1.2.3 --- src/package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/package.json b/src/package.json index bf6e983..287eca0 100644 --- a/src/package.json +++ b/src/package.json @@ -1,6 +1,6 @@ { "name": "nativescript-datetimepicker", - "version": "1.2.2", + "version": "1.2.3", "description": "A NativeScript plugin for picking date and time.", "typings": "index.d.ts", "nativescript": { @@ -11,7 +11,7 @@ }, "scripts": { "tsc": "npm i && tsc", - "build": "npm run tsc", + "build": "npm run tsc && npm run ngc", "tslint": "cd .. && tslint \"**/*.ts\" --config tslint.json --exclude \"**/node_modules/**\" --exclude \"**/platforms/**\"", "plugin.tscwatch": "npm run tsc -- -w", "demo.ios": "npm run build && cd ../demo && tns run ios --emulator", @@ -69,8 +69,8 @@ "rimraf": "^2.6.2", "rxjs": "^6.3.3", "semver": "^5.6.0", - "tns-core-modules": "^6.0.0", - "tns-platform-declarations": "^6.0.0", + "tns-core-modules": "~6.5.0", + "tns-platform-declarations": "~6.0.0", "tslint": "^5.11.0", "typescript": "~3.5.3", "zone.js": "^0.8.4" From a9604fad6dec5dc25ed1a7165c1c86bfffe9985b Mon Sep 17 00:00:00 2001 From: Nathanael Anderson Date: Tue, 8 Dec 2020 10:38:02 -0600 Subject: [PATCH 32/32] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index ccf1ecc..b88d36a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +# ALL NativeScript 7 Issues should be posted here: https://github.com/NativeScript/plugins/ + ## NativeScript 7 * Use `@nativescript/datetimepicker`: `~2.0.0`