@inquirer/select 4.3.0 → 4.3.1
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 +3 -1
- package/dist/esm/index.js +3 -1
- package/package.json +2 -2
package/dist/commonjs/index.js
CHANGED
|
@@ -141,14 +141,16 @@ exports.default = (0, core_1.createPrompt)((config, done) => {
|
|
|
141
141
|
helpTipTop = theme.style.help(`(${config.instructions?.navigation ?? 'Use arrow keys'})`);
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
+
let separatorCount = 0;
|
|
144
145
|
const page = (0, core_1.usePagination)({
|
|
145
146
|
items,
|
|
146
147
|
active,
|
|
147
148
|
renderItem({ item, isActive, index }) {
|
|
148
149
|
if (core_1.Separator.isSeparator(item)) {
|
|
150
|
+
separatorCount++;
|
|
149
151
|
return ` ${item.separator}`;
|
|
150
152
|
}
|
|
151
|
-
const indexLabel = theme.indexMode === 'number' ? `${index + 1}. ` : '';
|
|
153
|
+
const indexLabel = theme.indexMode === 'number' ? `${index + 1 - separatorCount}. ` : '';
|
|
152
154
|
if (item.disabled) {
|
|
153
155
|
const disabledLabel = typeof item.disabled === 'string' ? item.disabled : '(disabled)';
|
|
154
156
|
return theme.style.disabled(`${indexLabel}${item.name} ${disabledLabel}`);
|
package/dist/esm/index.js
CHANGED
|
@@ -135,14 +135,16 @@ export default createPrompt((config, done) => {
|
|
|
135
135
|
helpTipTop = theme.style.help(`(${config.instructions?.navigation ?? 'Use arrow keys'})`);
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
|
+
let separatorCount = 0;
|
|
138
139
|
const page = usePagination({
|
|
139
140
|
items,
|
|
140
141
|
active,
|
|
141
142
|
renderItem({ item, isActive, index }) {
|
|
142
143
|
if (Separator.isSeparator(item)) {
|
|
144
|
+
separatorCount++;
|
|
143
145
|
return ` ${item.separator}`;
|
|
144
146
|
}
|
|
145
|
-
const indexLabel = theme.indexMode === 'number' ? `${index + 1}. ` : '';
|
|
147
|
+
const indexLabel = theme.indexMode === 'number' ? `${index + 1 - separatorCount}. ` : '';
|
|
146
148
|
if (item.disabled) {
|
|
147
149
|
const disabledLabel = typeof item.disabled === 'string' ? item.disabled : '(disabled)';
|
|
148
150
|
return theme.style.disabled(`${indexLabel}${item.name} ${disabledLabel}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inquirer/select",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.1",
|
|
4
4
|
"description": "Inquirer select/list prompt",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"answer",
|
|
@@ -108,5 +108,5 @@
|
|
|
108
108
|
"optional": true
|
|
109
109
|
}
|
|
110
110
|
},
|
|
111
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "5fbae895f0da93446b99ed0b03ccaa6dfb12cf00"
|
|
112
112
|
}
|