* Toggles the select-all state. * @param event The click event if the toggle is triggered by a (mouse or keyboard) click. If * using with a native ` `, the parameter is required for the * indeterminate state to work properly.
(event?: MouseEvent)
| 51 | * indeterminate state to work properly. |
| 52 | */ |
| 53 | toggle(event?: MouseEvent) { |
| 54 | // This is needed when applying the directive on a native <input type="checkbox"> |
| 55 | // checkbox. The default behavior needs to be prevented in order to support the indeterminate |
| 56 | // state. The timeout is also needed so the checkbox can show the latest state. |
| 57 | if (event) { |
| 58 | event.preventDefault(); |
| 59 | } |
| 60 | |
| 61 | setTimeout(() => { |
| 62 | this._selection.toggleSelectAll(); |
| 63 | }); |
| 64 | } |
| 65 | |
| 66 | private readonly _destroyed = new Subject<void>(); |
| 67 |
no test coverage detected