From 917b09a67bf43c1586ed4c7d3d78834cbd2ccee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bahad=C4=B1r=20Sofuo=C4=9Flu?= Date: Tue, 28 Mar 2023 15:20:20 +0300 Subject: [PATCH] Toolbar pt updates --- api-generator/components/toolbar.js | 6 ++++ components/lib/toolbar/Toolbar.d.ts | 45 +++++++++++++++++++++++++++++ components/lib/toolbar/Toolbar.vue | 10 ++++--- 3 files changed, 57 insertions(+), 4 deletions(-) diff --git a/api-generator/components/toolbar.js b/api-generator/components/toolbar.js index b90edb988..40b5f6506 100644 --- a/api-generator/components/toolbar.js +++ b/api-generator/components/toolbar.js @@ -4,6 +4,12 @@ const ToolbarProps = [ type: 'string', default: 'null', description: 'Defines a string value that labels an interactive element.' + }, + { + name: 'pt', + type: 'any', + default: 'null', + description: 'Uses to pass attributes to DOM elements inside the component.' } ]; diff --git a/components/lib/toolbar/Toolbar.d.ts b/components/lib/toolbar/Toolbar.d.ts index b3e1c3657..9e307f965 100755 --- a/components/lib/toolbar/Toolbar.d.ts +++ b/components/lib/toolbar/Toolbar.d.ts @@ -10,6 +10,46 @@ import { VNode } from 'vue'; import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers'; +export declare type ToolbarPassThroughOptionType = ToolbarPassThroughAttributes | ((options: ToolbarPassThroughMethodOptions) => ToolbarPassThroughAttributes) | null | undefined; + +/** + * Custom passthrough(pt) option method. + */ +export interface ToolbarPassThroughMethodOptions { + props: ToolbarProps; +} + +/** + * Custom passthrough(pt) options. + * @see {@link ToolbarProps.pt} + */ +export interface ToolbarPassThroughOptions { + /** + * Uses to pass attributes to the root's DOM element. + */ + root?: ToolbarPassThroughOptionType; + /** + * Uses to pass attributes to the groupleft's DOM element. + */ + groupleft?: ToolbarPassThroughOptionType; + /** + * Uses to pass attributes to the groupcenter's DOM element. + */ + groupcenter?: ToolbarPassThroughOptionType; + /** + * Uses to pass attributes to the groupright's DOM element. + */ + groupright?: ToolbarPassThroughOptionType; +} + +/** + * Custom passthrough attributes for each DOM elements + */ +export interface ToolbarPassThroughAttributes { + [key: string]: any; +} + + /** * Defines valid properties in Toolbar component. */ @@ -18,6 +58,11 @@ export interface ToolbarProps { * Defines a string value that labels an interactive element. */ 'aria-labelledby'?: string | undefined; + /** + * Uses to pass attributes to DOM elements inside the component. + * @type {ToolbarPassThroughOptions} + */ + pt?: ToolbarPassThroughOptions; } /** diff --git a/components/lib/toolbar/Toolbar.vue b/components/lib/toolbar/Toolbar.vue index 057ae599c..d646cbabc 100755 --- a/components/lib/toolbar/Toolbar.vue +++ b/components/lib/toolbar/Toolbar.vue @@ -1,20 +1,22 @@