@inquirer/select
Advanced tools
Comparing version 1.2.9 to 1.2.10
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -9,5 +6,5 @@ exports.Separator = void 0; | ||
Object.defineProperty(exports, "Separator", { enumerable: true, get: function () { return core_1.Separator; } }); | ||
const chalk_1 = __importDefault(require("chalk")); | ||
const figures_1 = __importDefault(require("figures")); | ||
const ansi_escapes_1 = __importDefault(require("ansi-escapes")); | ||
const chalk_1 = require("chalk"); | ||
const figures_1 = require("figures"); | ||
const ansi_escapes_1 = require("ansi-escapes"); | ||
function isSelectableChoice(choice) { | ||
@@ -29,7 +26,7 @@ return choice != null && !core_1.Separator.isSeparator(choice) && !choice.disabled; | ||
// Safe to assume the cursor position always point to a Choice. | ||
const choice = choices[cursorPosition]; | ||
const selectedChoice = choices[cursorPosition]; | ||
(0, core_1.useKeypress)((key) => { | ||
if ((0, core_1.isEnterKey)(key)) { | ||
setStatus('done'); | ||
done(choice.value); | ||
done(selectedChoice.value); | ||
} | ||
@@ -83,6 +80,8 @@ else if ((0, core_1.isUpKey)(key) || (0, core_1.isDownKey)(key)) { | ||
if (status === 'done') { | ||
return `${prefix} ${message} ${chalk_1.default.cyan(choice.name || choice.value)}`; | ||
return `${prefix} ${message} ${chalk_1.default.cyan(selectedChoice.name || selectedChoice.value)}`; | ||
} | ||
const choiceDescription = choice.description ? `\n${choice.description}` : ``; | ||
const choiceDescription = selectedChoice.description | ||
? `\n${selectedChoice.description}` | ||
: ``; | ||
return `${prefix} ${message}\n${windowedChoices}${choiceDescription}${ansi_escapes_1.default.cursorHide}`; | ||
}); |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -9,5 +6,5 @@ exports.Separator = void 0; | ||
Object.defineProperty(exports, "Separator", { enumerable: true, get: function () { return core_1.Separator; } }); | ||
const chalk_1 = __importDefault(require("chalk")); | ||
const figures_1 = __importDefault(require("figures")); | ||
const ansi_escapes_1 = __importDefault(require("ansi-escapes")); | ||
const chalk_1 = require("chalk"); | ||
const figures_1 = require("figures"); | ||
const ansi_escapes_1 = require("ansi-escapes"); | ||
function isSelectableChoice(choice) { | ||
@@ -29,7 +26,7 @@ return choice != null && !core_1.Separator.isSeparator(choice) && !choice.disabled; | ||
// Safe to assume the cursor position always point to a Choice. | ||
const choice = choices[cursorPosition]; | ||
const selectedChoice = choices[cursorPosition]; | ||
(0, core_1.useKeypress)((key) => { | ||
if ((0, core_1.isEnterKey)(key)) { | ||
setStatus('done'); | ||
done(choice.value); | ||
done(selectedChoice.value); | ||
} | ||
@@ -83,6 +80,8 @@ else if ((0, core_1.isUpKey)(key) || (0, core_1.isDownKey)(key)) { | ||
if (status === 'done') { | ||
return `${prefix} ${message} ${chalk_1.default.cyan(choice.name || choice.value)}`; | ||
return `${prefix} ${message} ${chalk_1.default.cyan(selectedChoice.name || selectedChoice.value)}`; | ||
} | ||
const choiceDescription = choice.description ? `\n${choice.description}` : ``; | ||
const choiceDescription = selectedChoice.description | ||
? `\n${selectedChoice.description}` | ||
: ``; | ||
return `${prefix} ${message}\n${windowedChoices}${choiceDescription}${ansi_escapes_1.default.cursorHide}`; | ||
}); |
{ | ||
"name": "@inquirer/select", | ||
"version": "1.2.9", | ||
"version": "1.2.10", | ||
"description": "Inquirer select/list prompt", | ||
@@ -57,4 +57,4 @@ "main": "./dist/cjs/index.js", | ||
"dependencies": { | ||
"@inquirer/core": "^4.0.0", | ||
"@inquirer/type": "^1.1.2", | ||
"@inquirer/core": "^4.1.0", | ||
"@inquirer/type": "^1.1.3", | ||
"ansi-escapes": "^4.3.2", | ||
@@ -65,9 +65,8 @@ "chalk": "^4.1.2", | ||
"devDependencies": { | ||
"@inquirer/testing": "^2.1.4" | ||
"@inquirer/testing": "^2.1.5" | ||
}, | ||
"scripts": { | ||
"tsc": "yarn run clean && yarn run tsc:esm && yarn run tsc:cjs", | ||
"clean": "rm -rf dist", | ||
"tsc:esm": "tsc -p ./tsconfig.json", | ||
"tsc:cjs": "tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs" | ||
"tsc": "yarn run tsc:esm && yarn run tsc:cjs", | ||
"tsc:esm": "rm -rf dist/esm && tsc -p ./tsconfig.json", | ||
"tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs" | ||
}, | ||
@@ -92,3 +91,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "ea5baff21fb29ed3c0931ea4030cc1dd1e92fc8d" | ||
"gitHead": "f5c544a8ded1c7dfb6ac8364759955e8f2ecfb0c" | ||
} |
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
17886
Updated@inquirer/core@^4.1.0
Updated@inquirer/type@^1.1.3