Merge pull request #5943 from m-meier/patch-8

feat(Checkbox): add indeterminate state to icon slot, fixes #5942
active-menu
Tuğçe Küçükoğlu 2024-06-24 10:59:40 +03:00 committed by GitHub
commit 337485de90
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -225,6 +225,10 @@ export interface CheckboxSlots {
* State of the checkbox.
*/
checked: boolean;
/**
* Indeterminate state of the checkbox.
*/
indeterminate?: boolean | undefined;
/**
* Style class of the icon.
*/

View File

@ -22,7 +22,7 @@
v-bind="getPTOptions('input')"
/>
<div :class="cx('box')" v-bind="getPTOptions('box')">
<slot name="icon" :checked="checked" :class="cx('icon')">
<slot name="icon" :checked="checked" :indeterminate="d_indeterminate" :class="cx('icon')">
<CheckIcon v-if="checked" :class="cx('icon')" v-bind="getPTOptions('icon')" />
<MinusIcon v-else-if="d_indeterminate" :class="cx('icon')" v-bind="getPTOptions('icon')" />
</slot>