UNPKG

@workday/canvas-kit-react

Version:

The parent module that contains all Workday Canvas Kit React components

128 lines 5.84 kB
import React from 'react'; export type Visibility = 'hidden' | 'visible'; export declare const useDisclosureModel: (<TT_Special_Generic>(config?: (Partial<{ /** ID reference of the list. Children ids can be derived from this id */ id: string; /** * The initial visibility of the disclosed content * @default 'hidden' */ initialVisibility: Visibility; }> & { onShow?: ((data: Event | React.SyntheticEvent<Element, Event> | undefined, prevState: { /** ID reference of the list. Children ids can be derived from this id */ id: string; /** * Visibility state of the disclosed content. Models are allowed to extend the states to fit * their needs, so if you need to consistently determine "not hidden", use * `visibility !== 'hidden'` rather than `visibility === 'visible'` */ visibility: "hidden" | "visible"; }) => void) | undefined; onHide?: ((data: Event | React.SyntheticEvent<Element, Event> | undefined, prevState: { /** ID reference of the list. Children ids can be derived from this id */ id: string; /** * Visibility state of the disclosed content. Models are allowed to extend the states to fit * their needs, so if you need to consistently determine "not hidden", use * `visibility !== 'hidden'` rather than `visibility === 'visible'` */ visibility: "hidden" | "visible"; }) => void) | undefined; } & { shouldShow?: ((data: Event | React.SyntheticEvent<Element, Event> | undefined, state: { /** ID reference of the list. Children ids can be derived from this id */ id: string; /** * Visibility state of the disclosed content. Models are allowed to extend the states to fit * their needs, so if you need to consistently determine "not hidden", use * `visibility !== 'hidden'` rather than `visibility === 'visible'` */ visibility: "hidden" | "visible"; }) => boolean) | undefined; shouldHide?: ((data: Event | React.SyntheticEvent<Element, Event> | undefined, state: { /** ID reference of the list. Children ids can be derived from this id */ id: string; /** * Visibility state of the disclosed content. Models are allowed to extend the states to fit * their needs, so if you need to consistently determine "not hidden", use * `visibility !== 'hidden'` rather than `visibility === 'visible'` */ visibility: "hidden" | "visible"; }) => boolean) | undefined; }) | undefined) => { state: { /** ID reference of the list. Children ids can be derived from this id */ id: string; /** * Visibility state of the disclosed content. Models are allowed to extend the states to fit * their needs, so if you need to consistently determine "not hidden", use * `visibility !== 'hidden'` rather than `visibility === 'visible'` */ visibility: "hidden" | "visible"; }; events: { /** * Start showing the disclosed content. If a DOM event triggered this event, the event data will * be passed along. This data can be used by guards and callbacks. */ show(event?: Event | React.SyntheticEvent): void; /** * Start hiding this disclosed content. If a DOM event triggered this event, the event data will * be passed along. This data can be used by guards and callbacks. */ hide(event?: Event | React.SyntheticEvent): void; }; }) & import("@workday/canvas-kit-react/common").ModelExtras<{ /** ID reference of the list. Children ids can be derived from this id */ id: string; /** * The initial visibility of the disclosed content * @default 'hidden' */ initialVisibility: Visibility; }, {}, { /** ID reference of the list. Children ids can be derived from this id */ id: string; /** * Visibility state of the disclosed content. Models are allowed to extend the states to fit * their needs, so if you need to consistently determine "not hidden", use * `visibility !== 'hidden'` rather than `visibility === 'visible'` */ visibility: "hidden" | "visible"; }, { /** * Start showing the disclosed content. If a DOM event triggered this event, the event data will * be passed along. This data can be used by guards and callbacks. */ show(event?: Event | React.SyntheticEvent): void; /** * Start hiding this disclosed content. If a DOM event triggered this event, the event data will * be passed along. This data can be used by guards and callbacks. */ hide(event?: Event | React.SyntheticEvent): void; }, { state: { /** ID reference of the list. Children ids can be derived from this id */ id: string; /** * Visibility state of the disclosed content. Models are allowed to extend the states to fit * their needs, so if you need to consistently determine "not hidden", use * `visibility !== 'hidden'` rather than `visibility === 'visible'` */ visibility: "hidden" | "visible"; }; events: { /** * Start showing the disclosed content. If a DOM event triggered this event, the event data will * be passed along. This data can be used by guards and callbacks. */ show(event?: Event | React.SyntheticEvent): void; /** * Start hiding this disclosed content. If a DOM event triggered this event, the event data will * be passed along. This data can be used by guards and callbacks. */ hide(event?: Event | React.SyntheticEvent): void; }; }>; //# sourceMappingURL=useDisclosureModel.d.ts.map