From 9395ed14f79cc099b80419bc45d6fe2016ef0c32 Mon Sep 17 00:00:00 2001 From: Tim Lancina Date: Tue, 22 Dec 2015 14:23:24 -0600 Subject: [PATCH 1/3] chore(gulp-publish): convert spawn stream to string if it's not --- gulpfile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index fc7af3bc96..ef5dbe06a4 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -429,11 +429,11 @@ gulp.task('publish', ['src'], function(done){ var npmCmd = spawn('npm', ['publish', './' + distDir]); npmCmd.stdout.on('data', function (data) { - console.log(data); + console.log(data.toString()); }); npmCmd.stderr.on('data', function (data) { - console.log('npm err: ' + data); + console.log('npm err: ' + data.toString()); }); npmCmd.on('close', function() { From f30b9889dfdf548854919d1d230193576b2205ce Mon Sep 17 00:00:00 2001 From: Brandy Carney Date: Tue, 22 Dec 2015 15:57:53 -0500 Subject: [PATCH 2/3] feat(searchbar): emit blur and focus events closes #795 --- ionic/components/searchbar/searchbar.ts | 8 ++++++++ ionic/components/searchbar/test/floating/index.ts | 8 ++++++++ ionic/components/searchbar/test/floating/main.html | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ionic/components/searchbar/searchbar.ts b/ionic/components/searchbar/searchbar.ts index 33a5f101b9..47bf07d433 100644 --- a/ionic/components/searchbar/searchbar.ts +++ b/ionic/components/searchbar/searchbar.ts @@ -47,6 +47,8 @@ export class SearchbarInput { * @property {string} [placeholder=Search] - Sets input placeholder to the value passed in * * @property {Any} [input] - Expression to evaluate when the Searchbar input has changed + * @property {Any} [blur] - Expression to evaluate when the Searchbar input has blurred + * @property {Any} [focus] - Expression to evaluate when the Searchbar input has focused * @property {Any} [cancel] - Expression to evaluate when the cancel button is clicked. * @property {Any} [clear] - Expression to evaluate when the clear input button is clicked. * @@ -75,6 +77,8 @@ export class Searchbar extends Ion { @Input() ngModel: any; @Output() input: EventEmitter = new EventEmitter(); + @Output() blur: EventEmitter = new EventEmitter(); + @Output() focus: EventEmitter = new EventEmitter(); @Output() cancel: EventEmitter = new EventEmitter(); @Output() clear: EventEmitter = new EventEmitter(); @@ -147,6 +151,8 @@ export class Searchbar extends Ion { * Sets the Searchbar to focused and aligned left on input focus. */ inputFocused() { + this.focus.emit(this); + this.isFocused = true; this.shouldLeftAlign = true; } @@ -164,6 +170,8 @@ export class Searchbar extends Ion { this.blurInput = true; return; } + this.blur.emit(this); + this.isFocused = false; this.shouldLeftAlign = this.value && this.value.trim() != ''; } diff --git a/ionic/components/searchbar/test/floating/index.ts b/ionic/components/searchbar/test/floating/index.ts index d13a79cb3d..c2b119d666 100644 --- a/ionic/components/searchbar/test/floating/index.ts +++ b/ionic/components/searchbar/test/floating/index.ts @@ -27,4 +27,12 @@ class E2EApp { triggerInput(searchbar) { console.log("Triggered input", searchbar); } + + inputBlurred(searchbar) { + console.log("Blurred input", searchbar); + } + + inputFocused(searchbar) { + console.log("Focused input", searchbar); + } } diff --git a/ionic/components/searchbar/test/floating/main.html b/ionic/components/searchbar/test/floating/main.html index 49fde59f8c..cc832ce813 100644 --- a/ionic/components/searchbar/test/floating/main.html +++ b/ionic/components/searchbar/test/floating/main.html @@ -1,6 +1,6 @@
Search - Default
- +

defaultSearch: {{ defaultSearch }} From b4c89a98e0ef33771b09e100b0ab55e494850b7d Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Tue, 22 Dec 2015 21:53:12 -0600 Subject: [PATCH 3/3] chore(package): gulp package/publish Closes #799 --- gulpfile.js | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index ef5dbe06a4..5c57e2689b 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -397,7 +397,7 @@ gulp.task('src', function(done){ ); }) -gulp.task('publish', ['src'], function(done){ +gulp.task('package', ['src'], function(done){ var _ = require('lodash'); var fs = require('fs'); var distDir = 'dist'; @@ -414,7 +414,7 @@ gulp.task('publish', ['src'], function(done){ { type: 'input', name: 'ionicVersion', - message: '\n\n\nWhat ionic-framework alpha version number will this be?' + message: '\n\nWhat ionic-framework alpha version number will this be?' }, { type: 'input', @@ -425,23 +425,29 @@ gulp.task('publish', ['src'], function(done){ var packageTemplate = _.template(fs.readFileSync('scripts/npm/package.json')); fs.writeFileSync(distDir + '/package.json', packageTemplate(answers)); - var spawn = require('child_process').spawn; - var npmCmd = spawn('npm', ['publish', './' + distDir]); - - npmCmd.stdout.on('data', function (data) { - console.log(data.toString()); - }); - - npmCmd.stderr.on('data', function (data) { - console.log('npm err: ' + data.toString()); - }); - - npmCmd.on('close', function() { - done(); - }); + done(); }); }); +gulp.task('publish', ['package'], function(done){ + + var spawn = require('child_process').spawn; + var npmCmd = spawn('npm', ['publish', './dist']); + + npmCmd.stdout.on('data', function (data) { + console.log(data.toString()); + }); + + npmCmd.stderr.on('data', function (data) { + console.log('npm err: ' + data.toString()); + }); + + npmCmd.on('close', function() { + done(); + }); + +}); + require('./scripts/docs/gulp-tasks')(gulp, flags) ////////////////////////////////////////////////////