diff --git a/components/lib/tristatecheckbox/TriStateCheckbox.d.ts b/components/lib/tristatecheckbox/TriStateCheckbox.d.ts index a6f23b0e6..788a2679a 100755 --- a/components/lib/tristatecheckbox/TriStateCheckbox.d.ts +++ b/components/lib/tristatecheckbox/TriStateCheckbox.d.ts @@ -10,6 +10,72 @@ import { InputHTMLAttributes, VNode } from 'vue'; import { ClassComponent, GlobalComponentConstructor, Nullable } from '../ts-helpers'; +export declare type TriStateCheckboxPassThroughOptionType = TriStateCheckboxPassThroughAttributes | ((options: TriStateCheckboxPassThroughMethodOptions) => TriStateCheckboxPassThroughAttributes) | null | undefined; + +/** + * Custom passthrough(pt) option method. + */ +export interface TriStateCheckboxPassThroughMethodOptions { + props: TriStateCheckboxProps; + state: TriStateCheckboxState; +} + +/** + * Custom passthrough(pt) options. + * @see {@link TriStateCheckboxProps.pt} + */ +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; + /** + * Uses to pass attributes to the check icon's DOM element. + */ + checkIcon?: TriStateCheckboxPassThroughOptionType; + /** + * Uses to pass attributes to the uncheck icon's DOM element. + */ + uncheckIcon?: TriStateCheckboxPassThroughOptionType; + /** + * Uses to pass attributes to the nullable icon's DOM element. + */ + nullableIcon?: TriStateCheckboxPassThroughOptionType; +} + +/** + * Custom passthrough attributes for each DOM elements + */ +export interface TriStateCheckboxPassThroughAttributes { + [key: string]: any; +} + +/** + * Defines current inline state in TriStateCheckbox component. + */ +export interface TriStateCheckboxState { + /** + * Focused state as a boolean. + */ + focused: boolean; +} + /** * Defines valid properties in TriStateCheckbox component. */ @@ -45,6 +111,11 @@ export interface TriStateCheckboxProps { * Establishes a string value that labels the component. */ 'aria-label'?: string | undefined; + /** + * Uses to pass attributes to DOM elements inside the component. + * @type {TriStateCheckboxPassThroughOptions} + */ + pt?: TriStateCheckboxPassThroughOptions; } /** diff --git a/components/lib/tristatecheckbox/TriStateCheckbox.vue b/components/lib/tristatecheckbox/TriStateCheckbox.vue index dbf49ee06..1a2c3a0cb 100755 --- a/components/lib/tristatecheckbox/TriStateCheckbox.vue +++ b/components/lib/tristatecheckbox/TriStateCheckbox.vue @@ -1,6 +1,6 @@ diff --git a/doc/tristatecheckbox/pt/PTImage.vue b/doc/tristatecheckbox/pt/PTImage.vue new file mode 100644 index 000000000..9ac50d6b4 --- /dev/null +++ b/doc/tristatecheckbox/pt/PTImage.vue @@ -0,0 +1,8 @@ + diff --git a/doc/tristatecheckbox/pt/index.vue b/doc/tristatecheckbox/pt/index.vue new file mode 100644 index 000000000..3272c69b2 --- /dev/null +++ b/doc/tristatecheckbox/pt/index.vue @@ -0,0 +1,41 @@ + + + diff --git a/pages/slider/index.vue b/pages/slider/index.vue index 803e0fa68..4ecf1f03b 100755 --- a/pages/slider/index.vue +++ b/pages/slider/index.vue @@ -12,6 +12,7 @@ import StepDoc from '@/doc/slider/StepDoc'; import StyleDoc from '@/doc/slider/StyleDoc'; import VerticalDoc from '@/doc/slider/VerticalDoc'; import PTComponent from '@/doc/slider/pt/index.vue'; + export default { data() { return { diff --git a/pages/tristatecheckbox/index.vue b/pages/tristatecheckbox/index.vue index 42c4fe566..970283d32 100755 --- a/pages/tristatecheckbox/index.vue +++ b/pages/tristatecheckbox/index.vue @@ -1,5 +1,12 @@