From f46d5e315422af20a1db23c207585e41c95842cd 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: Wed, 24 May 2023 17:39:47 +0300 Subject: [PATCH] Refactor #3965 - For TriStateCheckbox --- .../tristatecheckbox/BaseTriStateCheckbox.vue | 75 +++++++++++++++++++ .../tristatecheckbox/TriStateCheckbox.d.ts | 26 ++++++- .../lib/tristatecheckbox/TriStateCheckbox.vue | 61 +++------------ 3 files changed, 110 insertions(+), 52 deletions(-) create mode 100644 components/lib/tristatecheckbox/BaseTriStateCheckbox.vue diff --git a/components/lib/tristatecheckbox/BaseTriStateCheckbox.vue b/components/lib/tristatecheckbox/BaseTriStateCheckbox.vue new file mode 100644 index 000000000..92478ea89 --- /dev/null +++ b/components/lib/tristatecheckbox/BaseTriStateCheckbox.vue @@ -0,0 +1,75 @@ + diff --git a/components/lib/tristatecheckbox/TriStateCheckbox.d.ts b/components/lib/tristatecheckbox/TriStateCheckbox.d.ts index 5dde0de83..5cc2104c0 100755 --- a/components/lib/tristatecheckbox/TriStateCheckbox.d.ts +++ b/components/lib/tristatecheckbox/TriStateCheckbox.d.ts @@ -138,6 +138,11 @@ export interface TriStateCheckboxProps { * @type {TriStateCheckboxPassThroughOptions} */ pt?: TriStateCheckboxPassThroughOptions; + /** + * When enabled, it removes component related styles in the core. + * @defaultValue false + */ + unstyled?: boolean; } /** @@ -147,15 +152,30 @@ export interface TriStateCheckboxSlots { /** * Custom check icon template. */ - checkicon(): VNode[]; + checkicon(scope: { + /** + * Style class of the icon. + */ + class: string; + }): VNode[]; /** * Custom uncheck icon template. */ - uncheckicon(): VNode[]; + uncheckicon(scope: { + /** + * Style class of the icon. + */ + class: string; + }): VNode[]; /** * Custom nullable icon template. */ - nullableicon(): VNode[]; + nullableicon(scope: { + /** + * Style class of the icon. + */ + class: string; + }): VNode[]; } /** diff --git a/components/lib/tristatecheckbox/TriStateCheckbox.vue b/components/lib/tristatecheckbox/TriStateCheckbox.vue index d22027461..45e77e857 100755 --- a/components/lib/tristatecheckbox/TriStateCheckbox.vue +++ b/components/lib/tristatecheckbox/TriStateCheckbox.vue @@ -1,6 +1,6 @@