@kahitsan/ksui 0.10.0 → 0.10.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kahitsan/ksui",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "ksui is a set of shared SolidJS UI components plus the @kserp/host-ui type contract for KahitSan/Hilinga plugins. Published to the public npm registry and consumed as a normal dependency. Ships source under a `solid` export condition so the consumer's vite-plugin-solid compiles it with solid-js + @kserp/host-ui externalized to the host runtime.",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -87,6 +87,11 @@ export interface ComboBoxMultiProps<T> extends ComboBoxCommonProps<T> {
87
87
  /** Focus the inline input on mount (marks the wrapper with `data-autofocus`
88
88
  * for a host modal's focus helper). */
89
89
  autoFocusOnMount?: boolean;
90
+ /** Close the results popup after each add/create instead of keeping it open
91
+ * for rapid multi-add. The input keeps focus and the popup reopens on the
92
+ * next keystroke. Use when the popup overlays a click target below it (e.g.
93
+ * the POS package grid) so a lingering popup would eat the next click. */
94
+ closeOnSelect?: boolean;
90
95
  }
91
96
 
92
97
  export type ComboBoxProps<T> = ComboBoxSingleProps<T> | ComboBoxMultiProps<T>;
@@ -357,6 +362,9 @@ function MultiComboBox<T>(props: ComboBoxMultiProps<T>): JSX.Element {
357
362
  if (props.value.some((x) => idOf(x) === idOf(item))) return;
358
363
  props.onChange([...props.value, item]);
359
364
  resetInput();
365
+ // resetInput re-focuses the input; closing after that keeps focus so the
366
+ // next keystroke reopens the popup (the input's onInput re-opens it).
367
+ if (props.closeOnSelect) eng.setOpen(false);
360
368
  };
361
369
 
362
370
  const removeFromPool = (item: T) => {