@keenmate/web-multiselect 2.0.0-rc10 → 2.0.0-rc11
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/README.md +188 -186
- package/custom-elements.json +187 -75
- package/dist/index.d.ts +40 -3
- package/dist/multiselect.js +1276 -1200
- package/dist/multiselect.umd.js +13 -13
- package/dist/style.css +1 -1
- package/docs/usage.md +5 -0
- package/package.json +1 -1
- package/src/css/controls.css +89 -25
- package/src/css/states.css +6 -5
- package/src/css/variables.css +17 -10
- package/vscode.html-custom-data.json +6 -1
- package/web-types.json +17 -2
package/dist/index.d.ts
CHANGED
|
@@ -336,6 +336,13 @@ 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;
|
|
339
346
|
/**
|
|
340
347
|
* Allow the selected-items popover to open. Defaults to `true`. The popover is triggered by
|
|
341
348
|
* the count / compact / "+X more" badge and by the in-input counter (`isCounterShown`). Set
|
|
@@ -653,6 +660,15 @@ export declare class MultiSelectElement<T = any> extends BlissElement<MultiSelec
|
|
|
653
660
|
showMessage(content: string | HTMLElement, opts?: MessageOptions): void;
|
|
654
661
|
/** Dismiss the transient message shown by {@link showMessage}, if any. */
|
|
655
662
|
hideMessage(): void;
|
|
663
|
+
/** Open the dropdown. */
|
|
664
|
+
open(): void;
|
|
665
|
+
/** Close the dropdown. */
|
|
666
|
+
close(): void;
|
|
667
|
+
/** Toggle the dropdown open/closed. */
|
|
668
|
+
toggle(): void;
|
|
669
|
+
/** Whether the dropdown is currently open. Assigning opens/closes it. */
|
|
670
|
+
get isOpen(): boolean;
|
|
671
|
+
set isOpen(value: boolean);
|
|
656
672
|
destroy(): void;
|
|
657
673
|
}
|
|
658
674
|
|
|
@@ -903,10 +919,10 @@ export declare const uiLogger: Logger;
|
|
|
903
919
|
export declare type ValueFormat = 'json' | 'csv' | 'array';
|
|
904
920
|
|
|
905
921
|
export declare class WebMultiSelect<T = any> {
|
|
922
|
+
#private;
|
|
906
923
|
private element;
|
|
907
924
|
private instanceId;
|
|
908
925
|
private options;
|
|
909
|
-
private isOpen;
|
|
910
926
|
private selectedValues;
|
|
911
927
|
private selectedOptions;
|
|
912
928
|
private allOptions;
|
|
@@ -962,10 +978,12 @@ export declare class WebMultiSelect<T = any> {
|
|
|
962
978
|
private selectedPopoverVirtualScroll;
|
|
963
979
|
private selectedPopoverContainer;
|
|
964
980
|
private input;
|
|
981
|
+
private inputWrapper;
|
|
965
982
|
private dropdown;
|
|
966
983
|
private dropdownInner;
|
|
967
984
|
private badgesContainer;
|
|
968
985
|
private counter;
|
|
986
|
+
private clearButton;
|
|
969
987
|
private hint?;
|
|
970
988
|
private selectedPopover;
|
|
971
989
|
private documentKeydownHandler;
|
|
@@ -1257,14 +1275,33 @@ export declare class WebMultiSelect<T = any> {
|
|
|
1257
1275
|
private deselectOption;
|
|
1258
1276
|
private selectAll;
|
|
1259
1277
|
clearAll(): void;
|
|
1278
|
+
/**
|
|
1279
|
+
* Inline clear (✕) handler: wipe the whole selection and any search text, then
|
|
1280
|
+
* restore focus to the input. clearAll() → commit() → renderBadges() already
|
|
1281
|
+
* refreshes this button's visibility (it hides once nothing is selected).
|
|
1282
|
+
*/
|
|
1283
|
+
private clearClick;
|
|
1284
|
+
/**
|
|
1285
|
+
* Show the inline clear (✕) only when it is opted in (isClearShown), something is
|
|
1286
|
+
* selected, and the control is enabled. Called from renderBadges() so it tracks
|
|
1287
|
+
* every selection change. Uses inline display like the counter / fullscreen clear.
|
|
1288
|
+
*/
|
|
1289
|
+
private updateClearButton;
|
|
1260
1290
|
/**
|
|
1261
1291
|
* Re-render and fire callbacks after a selection state change.
|
|
1262
1292
|
* `added` / `removed` drive per-item select/deselect callbacks.
|
|
1263
1293
|
* `onChange` fires once if anything actually changed.
|
|
1264
1294
|
*/
|
|
1265
1295
|
private commit;
|
|
1266
|
-
|
|
1267
|
-
|
|
1296
|
+
/** Open the dropdown (no-op if already open, or if there is nothing to show). */
|
|
1297
|
+
open(): void;
|
|
1298
|
+
/** Close the dropdown (no-op if already closed). */
|
|
1299
|
+
close(): void;
|
|
1300
|
+
/** Toggle the dropdown open/closed. */
|
|
1301
|
+
toggle(): void;
|
|
1302
|
+
/** Whether the dropdown is currently open. Assigning opens/closes it. */
|
|
1303
|
+
get isOpen(): boolean;
|
|
1304
|
+
set isOpen(value: boolean);
|
|
1268
1305
|
/**
|
|
1269
1306
|
* Anchor a floating panel (dropdown or selected-items popover) below/above the input with
|
|
1270
1307
|
* placement-locking and width-syncing. Returns the `autoUpdate` cleanup.
|