@inquirer/select 4.2.4 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/index.js +9 -1
- package/dist/esm/index.js +9 -1
- package/package.json +7 -7
package/dist/commonjs/index.js
CHANGED
|
@@ -89,7 +89,15 @@ exports.default = (0, core_1.createPrompt)((config, done) => {
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
else if ((0, core_1.isNumberKey)(key) && !Number.isNaN(Number(rl.line))) {
|
|
92
|
-
const
|
|
92
|
+
const selectedIndex = Number(rl.line) - 1;
|
|
93
|
+
// Find the nth item (ignoring separators)
|
|
94
|
+
let selectableIndex = -1;
|
|
95
|
+
const position = items.findIndex((item) => {
|
|
96
|
+
if (core_1.Separator.isSeparator(item))
|
|
97
|
+
return false;
|
|
98
|
+
selectableIndex++;
|
|
99
|
+
return selectableIndex === selectedIndex;
|
|
100
|
+
});
|
|
93
101
|
const item = items[position];
|
|
94
102
|
if (item != null && isSelectable(item)) {
|
|
95
103
|
setActive(position);
|
package/dist/esm/index.js
CHANGED
|
@@ -83,7 +83,15 @@ export default createPrompt((config, done) => {
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
else if (isNumberKey(key) && !Number.isNaN(Number(rl.line))) {
|
|
86
|
-
const
|
|
86
|
+
const selectedIndex = Number(rl.line) - 1;
|
|
87
|
+
// Find the nth item (ignoring separators)
|
|
88
|
+
let selectableIndex = -1;
|
|
89
|
+
const position = items.findIndex((item) => {
|
|
90
|
+
if (Separator.isSeparator(item))
|
|
91
|
+
return false;
|
|
92
|
+
selectableIndex++;
|
|
93
|
+
return selectableIndex === selectedIndex;
|
|
94
|
+
});
|
|
87
95
|
const item = items[position];
|
|
88
96
|
if (item != null && isSelectable(item)) {
|
|
89
97
|
setActive(position);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inquirer/select",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"description": "Inquirer select/list prompt",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"answer",
|
|
@@ -74,15 +74,15 @@
|
|
|
74
74
|
"tsc": "tshy"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@inquirer/core": "^10.1.
|
|
78
|
-
"@inquirer/figures": "^1.0.
|
|
79
|
-
"@inquirer/type": "^3.0.
|
|
77
|
+
"@inquirer/core": "^10.1.15",
|
|
78
|
+
"@inquirer/figures": "^1.0.13",
|
|
79
|
+
"@inquirer/type": "^3.0.8",
|
|
80
80
|
"ansi-escapes": "^4.3.2",
|
|
81
81
|
"yoctocolors-cjs": "^2.1.2"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
|
-
"@arethetypeswrong/cli": "^0.18.
|
|
85
|
-
"@inquirer/testing": "^2.1.
|
|
84
|
+
"@arethetypeswrong/cli": "^0.18.2",
|
|
85
|
+
"@inquirer/testing": "^2.1.49",
|
|
86
86
|
"tshy": "^3.0.2"
|
|
87
87
|
},
|
|
88
88
|
"engines": {
|
|
@@ -108,5 +108,5 @@
|
|
|
108
108
|
"optional": true
|
|
109
109
|
}
|
|
110
110
|
},
|
|
111
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "c1a755fe8b50377b685ea5951e0794985ce8d356"
|
|
112
112
|
}
|