@inquirer/select
Advanced tools
Comparing version 1.2.4 to 1.2.5
@@ -17,3 +17,2 @@ "use strict"; | ||
const { choices } = config; | ||
const paginator = (0, core_1.useRef)(new core_1.Paginator()).current; | ||
const firstRender = (0, core_1.useRef)(true); | ||
@@ -62,5 +61,2 @@ const prefix = (0, core_1.usePrefix)(); | ||
} | ||
if (status === 'done') { | ||
return `${prefix} ${message} ${chalk_1.default.cyan(choice.name || choice.value)}`; | ||
} | ||
const allChoices = choices | ||
@@ -82,5 +78,11 @@ .map((choice, index) => { | ||
.join('\n'); | ||
const windowedChoices = paginator.paginate(allChoices, cursorPosition, config.pageSize); | ||
const windowedChoices = (0, core_1.usePagination)(allChoices, { | ||
active: cursorPosition, | ||
pageSize: config.pageSize, | ||
}); | ||
if (status === 'done') { | ||
return `${prefix} ${message} ${chalk_1.default.cyan(choice.name || choice.value)}`; | ||
} | ||
const choiceDescription = choice.description ? `\n${choice.description}` : ``; | ||
return `${prefix} ${message}\n${windowedChoices}${choiceDescription}${ansi_escapes_1.default.cursorHide}`; | ||
}); |
@@ -17,3 +17,2 @@ "use strict"; | ||
const { choices } = config; | ||
const paginator = (0, core_1.useRef)(new core_1.Paginator()).current; | ||
const firstRender = (0, core_1.useRef)(true); | ||
@@ -62,5 +61,2 @@ const prefix = (0, core_1.usePrefix)(); | ||
} | ||
if (status === 'done') { | ||
return `${prefix} ${message} ${chalk_1.default.cyan(choice.name || choice.value)}`; | ||
} | ||
const allChoices = choices | ||
@@ -82,5 +78,11 @@ .map((choice, index) => { | ||
.join('\n'); | ||
const windowedChoices = paginator.paginate(allChoices, cursorPosition, config.pageSize); | ||
const windowedChoices = (0, core_1.usePagination)(allChoices, { | ||
active: cursorPosition, | ||
pageSize: config.pageSize, | ||
}); | ||
if (status === 'done') { | ||
return `${prefix} ${message} ${chalk_1.default.cyan(choice.name || choice.value)}`; | ||
} | ||
const choiceDescription = choice.description ? `\n${choice.description}` : ``; | ||
return `${prefix} ${message}\n${windowedChoices}${choiceDescription}${ansi_escapes_1.default.cursorHide}`; | ||
}); |
{ | ||
"name": "@inquirer/select", | ||
"version": "1.2.4", | ||
"version": "1.2.5", | ||
"description": "Inquirer select/list prompt", | ||
@@ -57,3 +57,3 @@ "main": "./dist/cjs/index.js", | ||
"dependencies": { | ||
"@inquirer/core": "^2.3.1", | ||
"@inquirer/core": "^3.0.0", | ||
"@inquirer/type": "^1.1.1", | ||
@@ -92,3 +92,3 @@ "ansi-escapes": "^4.3.2", | ||
}, | ||
"gitHead": "b1b29c0b6da9420d739cd46704c205515de2db04" | ||
"gitHead": "18144628b03b62c346cb7d9d55a2c526b1ed5d8a" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
263
18171
+ Added@inquirer/core@3.1.2(transitive)
- Removed@inquirer/core@2.3.1(transitive)
Updated@inquirer/core@^3.0.0