@inquirer/select 4.3.0 → 4.3.2

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.
@@ -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.0",
3
+ "version": "4.3.2",
4
4
  "description": "Inquirer select/list prompt",
5
5
  "keywords": [
6
6
  "answer",
@@ -74,7 +74,7 @@
74
74
  "tsc": "tshy"
75
75
  },
76
76
  "dependencies": {
77
- "@inquirer/core": "^10.1.15",
77
+ "@inquirer/core": "^10.2.0",
78
78
  "@inquirer/figures": "^1.0.13",
79
79
  "@inquirer/type": "^3.0.8",
80
80
  "ansi-escapes": "^4.3.2",
@@ -108,5 +108,5 @@
108
108
  "optional": true
109
109
  }
110
110
  },
111
- "gitHead": "c1a755fe8b50377b685ea5951e0794985ce8d356"
111
+ "gitHead": "fdc92010930a3a40da5ed4f14ba608d5333e3d55"
112
112
  }