@keenmate/web-multiselect 2.0.0-rc10 → 2.0.0-rc12

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/index.d.ts CHANGED
@@ -336,6 +336,20 @@ declare interface MultiSelectConfig<T = any> {
336
336
  isAddNewAllowed?: boolean;
337
337
  /** Show count badge next to toggle icon (internal: isCounterShown) */
338
338
  isCounterShown?: boolean;
339
+ /**
340
+ * Show an inline clear (✕) button inside the input that wipes the whole selection.
341
+ * Appears only while something is selected (and the control is enabled). Clicking it
342
+ * clears the selection and any search text, fires `change`, and refocuses the input.
343
+ * Default `false`. (internal: isClearShown)
344
+ */
345
+ isClearShown?: boolean;
346
+ /**
347
+ * Scope the "one overlay open at a time" coordination to a named group. Overlays
348
+ * (multiselects, datepickers, external popovers) sharing a group dismiss each other
349
+ * when one opens; different groups are independent. Unset = the default (ungrouped)
350
+ * group, in which every ungrouped overlay coordinates. (internal: overlayGroup)
351
+ */
352
+ overlayGroup?: string;
339
353
  /**
340
354
  * Allow the selected-items popover to open. Defaults to `true`. The popover is triggered by
341
355
  * the count / compact / "+X more" badge and by the in-input counter (`isCounterShown`). Set
@@ -653,6 +667,15 @@ export declare class MultiSelectElement<T = any> extends BlissElement<MultiSelec
653
667
  showMessage(content: string | HTMLElement, opts?: MessageOptions): void;
654
668
  /** Dismiss the transient message shown by {@link showMessage}, if any. */
655
669
  hideMessage(): void;
670
+ /** Open the dropdown. */
671
+ open(): void;
672
+ /** Close the dropdown. */
673
+ close(): void;
674
+ /** Toggle the dropdown open/closed. */
675
+ toggle(): void;
676
+ /** Whether the dropdown is currently open. Assigning opens/closes it. */
677
+ get isOpen(): boolean;
678
+ set isOpen(value: boolean);
656
679
  destroy(): void;
657
680
  }
658
681
 
@@ -903,10 +926,10 @@ export declare const uiLogger: Logger;
903
926
  export declare type ValueFormat = 'json' | 'csv' | 'array';
904
927
 
905
928
  export declare class WebMultiSelect<T = any> {
929
+ #private;
906
930
  private element;
907
931
  private instanceId;
908
932
  private options;
909
- private isOpen;
910
933
  private selectedValues;
911
934
  private selectedOptions;
912
935
  private allOptions;
@@ -962,14 +985,17 @@ export declare class WebMultiSelect<T = any> {
962
985
  private selectedPopoverVirtualScroll;
963
986
  private selectedPopoverContainer;
964
987
  private input;
988
+ private inputWrapper;
965
989
  private dropdown;
966
990
  private dropdownInner;
967
991
  private badgesContainer;
968
992
  private counter;
993
+ private clearButton;
969
994
  private hint?;
970
995
  private selectedPopover;
971
996
  private documentKeydownHandler;
972
997
  private documentClickHandler;
998
+ private overlayCoord;
973
999
  /**
974
1000
  * Generic field extractor with the precedence:
975
1001
  * tuple short-circuit -> member property -> callback -> fallback
@@ -1257,14 +1283,33 @@ export declare class WebMultiSelect<T = any> {
1257
1283
  private deselectOption;
1258
1284
  private selectAll;
1259
1285
  clearAll(): void;
1286
+ /**
1287
+ * Inline clear (✕) handler: wipe the whole selection and any search text, then
1288
+ * restore focus to the input. clearAll() → commit() → renderBadges() already
1289
+ * refreshes this button's visibility (it hides once nothing is selected).
1290
+ */
1291
+ private clearClick;
1292
+ /**
1293
+ * Show the inline clear (✕) only when it is opted in (isClearShown), something is
1294
+ * selected, and the control is enabled. Called from renderBadges() so it tracks
1295
+ * every selection change. Uses inline display like the counter / fullscreen clear.
1296
+ */
1297
+ private updateClearButton;
1260
1298
  /**
1261
1299
  * Re-render and fire callbacks after a selection state change.
1262
1300
  * `added` / `removed` drive per-item select/deselect callbacks.
1263
1301
  * `onChange` fires once if anything actually changed.
1264
1302
  */
1265
1303
  private commit;
1266
- private open;
1267
- private close;
1304
+ /** Open the dropdown (no-op if already open, or if there is nothing to show). */
1305
+ open(): void;
1306
+ /** Close the dropdown (no-op if already closed). */
1307
+ close(): void;
1308
+ /** Toggle the dropdown open/closed. */
1309
+ toggle(): void;
1310
+ /** Whether the dropdown is currently open. Assigning opens/closes it. */
1311
+ get isOpen(): boolean;
1312
+ set isOpen(value: boolean);
1268
1313
  /**
1269
1314
  * Anchor a floating panel (dropdown or selected-items popover) below/above the input with
1270
1315
  * placement-locking and width-syncing. Returns the `autoUpdate` cleanup.