From 2d1a301c22eb076520ef2004afedec783cac3af4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Fri, 23 Jun 2023 16:08:09 +0300 Subject: [PATCH] Checkbox updates for pt --- components/lib/checkbox/Checkbox.d.ts | 25 +++++++++++++++++++++++++ components/lib/checkbox/Checkbox.vue | 15 ++++++++++++--- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/components/lib/checkbox/Checkbox.d.ts b/components/lib/checkbox/Checkbox.d.ts index e3cfad4f7..611fe7bd7 100755 --- a/components/lib/checkbox/Checkbox.d.ts +++ b/components/lib/checkbox/Checkbox.d.ts @@ -18,6 +18,7 @@ export declare type CheckboxPassThroughOptionType = CheckboxPassThroughAttribute export interface CheckboxPassThroughMethodOptions { props: CheckboxProps; state: CheckboxState; + context: CheckboxContext; } /** @@ -151,6 +152,30 @@ export interface CheckboxProps { unstyled?: boolean; } +/** + * Defines current options in Checkbox component. + */ +export interface CheckboxContext { + /** + * Current checked state of the item as a boolean. + * @defaultValue false + */ + checked: boolean; + /** + * Current focus state of the item as a boolean. + * @defaultValue false + */ + focused: boolean; + /** + * Current disabled state of the item as a boolean. + * @defaultValue false + */ + disabled: boolean; +} + +/** + * Defines valid slots in Checkbox component. + */ export interface CheckboxSlots { /** * Custom icon template. diff --git a/components/lib/checkbox/Checkbox.vue b/components/lib/checkbox/Checkbox.vue index c9964c3cf..c0f411180 100755 --- a/components/lib/checkbox/Checkbox.vue +++ b/components/lib/checkbox/Checkbox.vue @@ -1,5 +1,5 @@