From 77888cca6f353d5fbff1127d989d5f0fbadde716 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: Tue, 9 May 2023 12:17:12 +0300 Subject: [PATCH] Refactor #3922 - For TriStateCheckbox --- .../tristatecheckbox/TriStateCheckbox.d.ts | 48 ++++++++++++++----- .../lib/tristatecheckbox/TriStateCheckbox.vue | 15 ++++-- 2 files changed, 47 insertions(+), 16 deletions(-) diff --git a/components/lib/tristatecheckbox/TriStateCheckbox.d.ts b/components/lib/tristatecheckbox/TriStateCheckbox.d.ts index 788a2679a..04ba9e695 100755 --- a/components/lib/tristatecheckbox/TriStateCheckbox.d.ts +++ b/components/lib/tristatecheckbox/TriStateCheckbox.d.ts @@ -18,6 +18,7 @@ export declare type TriStateCheckboxPassThroughOptionType = TriStateCheckboxPass export interface TriStateCheckboxPassThroughMethodOptions { props: TriStateCheckboxProps; state: TriStateCheckboxState; + context: TriStateCheckboxContext; } /** @@ -29,22 +30,10 @@ export interface TriStateCheckboxPassThroughOptions { * Uses to pass attributes to the root's DOM element. */ root?: TriStateCheckboxPassThroughOptionType; - /** - * Uses to pass attributes to the input aria's DOM element. - */ - inputAria?: TriStateCheckboxPassThroughOptionType; - /** - * Uses to pass attributes to the input's DOM element. - */ - input?: TriStateCheckboxPassThroughOptionType; - /** - * Uses to pass attributes to the sr only aria's DOM element. - */ - srOnlyAria?: TriStateCheckboxPassThroughOptionType; /** * Uses to pass attributes to the checkbox box's DOM element. */ - checboxBox?: TriStateCheckboxPassThroughOptionType; + checbox?: TriStateCheckboxPassThroughOptionType; /** * Uses to pass attributes to the check icon's DOM element. */ @@ -57,6 +46,18 @@ export interface TriStateCheckboxPassThroughOptions { * Uses to pass attributes to the nullable icon's DOM element. */ nullableIcon?: TriStateCheckboxPassThroughOptionType; + /** + * Uses to pass attributes to the hidden input wrapper's DOM element. + */ + hiddenInputWrapper?: TriStateCheckboxPassThroughOptionType; + /** + * Uses to pass attributes to the hidden input's DOM element. + */ + hiddenInput?: TriStateCheckboxPassThroughOptionType; + /** + * Uses to pass attributes to the sr only aria's DOM element. + */ + srOnlyAria?: TriStateCheckboxPassThroughOptionType; } /** @@ -76,6 +77,27 @@ export interface TriStateCheckboxState { focused: boolean; } +/** + * Defines current options in TriStateCheckbox component. + */ +export interface TriStateCheckboxContext { + /** + * Current active state as a boolean. + * @defaultValue false + */ + active: boolean; + /** + * Current focused state as a boolean. + * @defaultValue false + */ + focused: boolean; + /** + * Current disabled state as a boolean. + * @defaultValue false + */ + disabled: boolean; +} + /** * Defines valid properties in TriStateCheckbox component. */ diff --git a/components/lib/tristatecheckbox/TriStateCheckbox.vue b/components/lib/tristatecheckbox/TriStateCheckbox.vue index 1a2c3a0cb..067fa80fe 100755 --- a/components/lib/tristatecheckbox/TriStateCheckbox.vue +++ b/components/lib/tristatecheckbox/TriStateCheckbox.vue @@ -1,6 +1,6 @@