inquirer-datepicker
Advanced tools
Comparing version 2.0.0 to 2.0.1
19
index.js
@@ -55,2 +55,3 @@ /** | ||
let count = 0; | ||
const meta = {}; | ||
@@ -112,3 +113,2 @@ | ||
const options = this.opt; | ||
let format = options.format; | ||
const min = options.min || null; | ||
@@ -118,2 +118,4 @@ const max = options.max || null; | ||
let format = options.format; | ||
PROPS.forEach(key => { | ||
@@ -279,2 +281,3 @@ normalizeRange(min, key); | ||
elements.push(null); | ||
break; | ||
} | ||
@@ -313,2 +316,3 @@ }); | ||
keypress.pipe(takeUntil(line)).forEach(onKeypress); | ||
this.render(); | ||
@@ -327,2 +331,3 @@ | ||
let message = this.getQuestion(); | ||
const format = this.opt.format; | ||
@@ -349,2 +354,3 @@ const selection = this.selection; | ||
outputUnselected(); | ||
this.screen.render(message); | ||
@@ -361,3 +367,2 @@ | ||
onKeypress(e) { | ||
let index; | ||
const options = this.opt; | ||
@@ -370,6 +375,8 @@ const selection = this.selection; | ||
if (e.key.name === 'right') { | ||
index = findIndex(elements, isSelectable, cursor + 1); | ||
const index = findIndex(elements, isSelectable, cursor + 1); | ||
selection.cursor = index >= 0 ? index : cursor; | ||
} else if (e.key.name === 'left') { | ||
index = findLastIndex(elements, isSelectable, cursor > 0 ? cursor - 1 : cursor); | ||
const index = findLastIndex(elements, isSelectable, cursor > 0 ? cursor - 1 : cursor); | ||
selection.cursor = index >= 0 ? index : cursor; | ||
@@ -405,4 +412,5 @@ } else if (e.key.name === 'up') { | ||
const screen = this.screen; | ||
const format = this.opt.format; | ||
const selection = this.selection; | ||
const format = this.opt.format; | ||
let message = this.getQuestion(); | ||
@@ -416,2 +424,3 @@ | ||
screen.done(); | ||
this.done(selection.date.toDate()); | ||
@@ -418,0 +427,0 @@ |
{ | ||
"name": "inquirer-datepicker", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Datepicker prompt for inquirer.js", | ||
@@ -28,10 +28,10 @@ "main": "index.js", | ||
"dependencies": { | ||
"rxjs": "^6.6.0", | ||
"chalk": "^4.1.0", | ||
"moment": "^2.27.0", | ||
"lodash": "^4.17.19", | ||
"rxjs": "^7.4.0", | ||
"chalk": "^4.1.2", | ||
"moment": "^2.29.1", | ||
"lodash": "^4.17.21", | ||
"cli-cursor": "^3.1.0" | ||
}, | ||
"devDependencies": { | ||
"inquirer": "^7.3.0" | ||
"inquirer": "^8.2.0" | ||
}, | ||
@@ -38,0 +38,0 @@ "peerDependencies": { |
20933
- Removedrxjs@6.6.7(transitive)
- Removedtslib@1.14.1(transitive)
Updatedchalk@^4.1.2
Updatedlodash@^4.17.21
Updatedmoment@^2.29.1
Updatedrxjs@^7.4.0