@inquirer/select 1.3.1 → 1.3.3
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/cjs/index.js +6 -5
- package/dist/esm/index.mjs +6 -5
- package/package.json +5 -5
package/dist/cjs/index.js
CHANGED
|
@@ -26,7 +26,7 @@ function renderItem({ item, isActive }) {
|
|
|
26
26
|
return color(`${prefix} ${line}`);
|
|
27
27
|
}
|
|
28
28
|
exports.default = (0, core_1.createPrompt)((config, done) => {
|
|
29
|
-
const { choices: items, loop = true, pageSize } = config;
|
|
29
|
+
const { choices: items, loop = true, pageSize = 7 } = config;
|
|
30
30
|
const firstRender = (0, core_1.useRef)(true);
|
|
31
31
|
const prefix = (0, core_1.usePrefix)();
|
|
32
32
|
const [status, setStatus] = (0, core_1.useState)('pending');
|
|
@@ -71,10 +71,11 @@ exports.default = (0, core_1.createPrompt)((config, done) => {
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
});
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
const message = chalk_1.default.bold(config.message);
|
|
75
|
+
let helpTip;
|
|
76
|
+
if (firstRender.current && items.length <= pageSize) {
|
|
76
77
|
firstRender.current = false;
|
|
77
|
-
|
|
78
|
+
helpTip = chalk_1.default.dim('(Use arrow keys)');
|
|
78
79
|
}
|
|
79
80
|
const page = (0, core_1.usePagination)({
|
|
80
81
|
items,
|
|
@@ -89,5 +90,5 @@ exports.default = (0, core_1.createPrompt)((config, done) => {
|
|
|
89
90
|
const choiceDescription = selectedChoice.description
|
|
90
91
|
? `\n${selectedChoice.description}`
|
|
91
92
|
: ``;
|
|
92
|
-
return `${prefix
|
|
93
|
+
return `${[prefix, message, helpTip].filter(Boolean).join(' ')}\n${page}${choiceDescription}${ansi_escapes_1.default.cursorHide}`;
|
|
93
94
|
});
|
package/dist/esm/index.mjs
CHANGED
|
@@ -19,7 +19,7 @@ function renderItem({ item, isActive }) {
|
|
|
19
19
|
return color(`${prefix} ${line}`);
|
|
20
20
|
}
|
|
21
21
|
export default createPrompt((config, done) => {
|
|
22
|
-
const { choices: items, loop = true, pageSize } = config;
|
|
22
|
+
const { choices: items, loop = true, pageSize = 7 } = config;
|
|
23
23
|
const firstRender = useRef(true);
|
|
24
24
|
const prefix = usePrefix();
|
|
25
25
|
const [status, setStatus] = useState('pending');
|
|
@@ -64,10 +64,11 @@ export default createPrompt((config, done) => {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
const message = chalk.bold(config.message);
|
|
68
|
+
let helpTip;
|
|
69
|
+
if (firstRender.current && items.length <= pageSize) {
|
|
69
70
|
firstRender.current = false;
|
|
70
|
-
|
|
71
|
+
helpTip = chalk.dim('(Use arrow keys)');
|
|
71
72
|
}
|
|
72
73
|
const page = usePagination({
|
|
73
74
|
items,
|
|
@@ -82,6 +83,6 @@ export default createPrompt((config, done) => {
|
|
|
82
83
|
const choiceDescription = selectedChoice.description
|
|
83
84
|
? `\n${selectedChoice.description}`
|
|
84
85
|
: ``;
|
|
85
|
-
return `${prefix
|
|
86
|
+
return `${[prefix, message, helpTip].filter(Boolean).join(' ')}\n${page}${choiceDescription}${ansiEscapes.cursorHide}`;
|
|
86
87
|
});
|
|
87
88
|
export { Separator };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inquirer/select",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"description": "Inquirer select/list prompt",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"typings": "./dist/cjs/types/index.d.ts",
|
|
@@ -54,14 +54,14 @@
|
|
|
54
54
|
"license": "MIT",
|
|
55
55
|
"homepage": "https://github.com/SBoudrias/Inquirer.js/blob/master/packages/select/README.md",
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@inquirer/core": "^
|
|
58
|
-
"@inquirer/type": "^1.1.
|
|
57
|
+
"@inquirer/core": "^6.0.0",
|
|
58
|
+
"@inquirer/type": "^1.1.6",
|
|
59
59
|
"ansi-escapes": "^4.3.2",
|
|
60
60
|
"chalk": "^4.1.2",
|
|
61
61
|
"figures": "^3.2.0"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@inquirer/testing": "^2.1.
|
|
64
|
+
"@inquirer/testing": "^2.1.10"
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
67
|
"tsc": "yarn run tsc:esm && yarn run tsc:cjs",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "4dee2b11d89a7c8a698c9eeda546ba8092b84f64"
|
|
90
90
|
}
|