diff --git a/api-generator/components/galleria.js b/api-generator/components/galleria.js index 7848d81a4..953956ff3 100644 --- a/api-generator/components/galleria.js +++ b/api-generator/components/galleria.js @@ -142,6 +142,12 @@ const GalleriaProps = [ type: 'any', default: 'null', description: "Style class of the component on fullscreen mode. Otherwise, the 'class' property can be used." + }, + { + name: 'pt', + type: 'any', + default: 'null', + description: 'Uses to pass attributes to DOM elements inside the component.' } ]; diff --git a/components/lib/config/PrimeVue.d.ts b/components/lib/config/PrimeVue.d.ts index e4abb1c9a..65005a99c 100644 --- a/components/lib/config/PrimeVue.d.ts +++ b/components/lib/config/PrimeVue.d.ts @@ -19,6 +19,7 @@ import { DividerPassThroughOptions } from '../divider'; import { DockPassThroughOptions } from '../dock'; import { FieldsetPassThroughOptions } from '../fieldset'; import { FileUploadPassThroughOptions } from '../fileupload'; +import { GalleriaPassThroughOptions } from '../galleria'; import { ImagePassThroughOptions } from '../image'; import { InlineMessagePassThroughOptions } from '../inlinemessage'; import { InplacePassThroughOptions } from '../inplace'; @@ -85,6 +86,7 @@ interface PrimeVuePTOptions { dynamicdialog?: DialogPassThroughOptions; fieldset?: FieldsetPassThroughOptions; fileupload?: FileUploadPassThroughOptions; + galleria?: GalleriaPassThroughOptions; image?: ImagePassThroughOptions; inlinemessage?: InlineMessagePassThroughOptions; inplace?: InplacePassThroughOptions; diff --git a/components/lib/galleria/Galleria.d.ts b/components/lib/galleria/Galleria.d.ts index ee93fdaf5..35b3e636d 100755 --- a/components/lib/galleria/Galleria.d.ts +++ b/components/lib/galleria/Galleria.d.ts @@ -9,6 +9,15 @@ */ import { ButtonHTMLAttributes, HTMLAttributes, VNode } from 'vue'; import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers'; +export declare type GalleriaPassThroughOptionType = GalleriaPassThroughAttributes | ((options: GalleriaPassThroughMethodOptions) => GalleriaPassThroughAttributes) | null | undefined; + +/** + * Custom passthrough(pt) option method. + */ +export interface GalleriaPassThroughMethodOptions { + props: GalleriaProps; + state: GalleriaState; +} export interface GalleriaResponsiveOptions { /** @@ -21,6 +30,139 @@ export interface GalleriaResponsiveOptions { numVisible: number; } +/** + * Custom passthrough(pt) options. + * @see {@link GalleriaProps.pt} + */ +export interface GalleriaPassThroughOptions { + /** + * Uses to pass attributes to the root's DOM element. + */ + root?: GalleriaPassThroughOptionType; + /** + * Uses to pass attributes to the close button's DOM element. + */ + closeButton?: GalleriaPassThroughOptionType; + /** + * Uses to pass attributes to the close icon's DOM element. + */ + closeIcon?: GalleriaPassThroughOptionType; + /** + * Uses to pass attributes to the header's DOM element. + */ + header?: GalleriaPassThroughOptionType; + /** + * Uses to pass attributes to the content's DOM element. + */ + content?: GalleriaPassThroughOptionType; + /** + * Uses to pass attributes to the footer's DOM element. + */ + footer?: GalleriaPassThroughOptionType; + /** + * Uses to pass attributes to the item wrapper's DOM element. + */ + itemWrapper?: GalleriaPassThroughOptionType; + /** + * Uses to pass attributes to the item container's DOM element. + */ + itemContainer?: GalleriaPassThroughOptionType; + /** + * Uses to pass attributes to the previous item button's DOM element. + */ + previousItemButton?: GalleriaPassThroughOptionType; + /** + * Uses to pass attributes to the previous item icon's DOM element. + */ + previousItemIcon?: GalleriaPassThroughOptionType; + /** + * Uses to pass attributes to the item's DOM element. + */ + item?: GalleriaPassThroughOptionType; + /** + * Uses to pass attributes to the next item button's DOM element. + */ + nextItemButton?: GalleriaPassThroughOptionType; + /** + * Uses to pass attributes to the next item icon's DOM element. + */ + nextItemIcon?: GalleriaPassThroughOptionType; + /** + * Uses to pass attributes to the caption's DOM element. + */ + caption?: GalleriaPassThroughOptionType; + /** + * Uses to pass attributes to the indicators's DOM element. + */ + indicators?: GalleriaPassThroughOptionType; + /** + * Uses to pass attributes to the indicator's DOM element. + */ + indicator?: GalleriaPassThroughOptionType; + /** + * Uses to pass attributes to the thumbnail wrapper's DOM element. + */ + thumbnailWrapper?: GalleriaPassThroughOptionType; + /** + * Uses to pass attributes to the thumbnail container's DOM element. + */ + thumbnailContainer?: GalleriaPassThroughOptionType; + /** + * Uses to pass attributes to the previous thumbnail button's DOM element. + */ + previousThumbnailButton?: GalleriaPassThroughOptionType; + /** + * Uses to pass attributes to the previous thumbnail icon's DOM element. + */ + previousThumbnailIcon?: GalleriaPassThroughOptionType; + /** + * Uses to pass attributes to the thumbnail items container's DOM element. + */ + thumbnailItemsContainer?: GalleriaPassThroughOptionType; + /** + * Uses to pass attributes to the thumbnail items' DOM element. + */ + thumbnailItems?: GalleriaPassThroughOptionType; + /** + * Uses to pass attributes to the thumbnail item's DOM element. + */ + thumbnailItem?: GalleriaPassThroughOptionType; + /** + * Uses to pass attributes to the thumbnail item content's DOM element. + */ + thumbnailItemContent?: GalleriaPassThroughOptionType; + /** + * Uses to pass attributes to the next thumbnail button's DOM element. + */ + nextThumbnailButton?: GalleriaPassThroughOptionType; + /** + * Uses to pass attributes to the next thumbnail icon's DOM element. + */ + nextThumbnailIcon?: GalleriaPassThroughOptionType; + /** + * Uses to pass attributes to the mask's DOM element. + */ + mask?: GalleriaPassThroughOptionType; +} + +/** + * Custom passthrough attributes for each DOM elements + */ +export interface GalleriaPassThroughAttributes { + [key: string]: any; +} + +/** + * Defines current inline state in Galleria component. + */ +export interface GalleriaState { + /** + * Current collapsed state as a boolean. + * @defaultValue false + */ + d_collapsed: boolean; +} + /** * Defines valid properties in Galleria component. */ @@ -152,6 +294,11 @@ export interface GalleriaProps { * Uses to pass all properties of the HTMLButtonElement to the next navigation button. */ nextButtonProps?: ButtonHTMLAttributes | undefined; + /** + * Uses to pass attributes to DOM elements inside the component. + * @type {GalleriaPassThroughOptions} + */ + pt?: GalleriaPassThroughOptions; } /** * Defines valid slots in Galleria slots. diff --git a/components/lib/galleria/Galleria.vue b/components/lib/galleria/Galleria.vue index c4fcf35de..766fbbfee 100755 --- a/components/lib/galleria/Galleria.vue +++ b/components/lib/galleria/Galleria.vue @@ -1,15 +1,16 @@