UNPKG

@oruga-ui/oruga-next

Version:

UI components for Vue.js and CSS framework agnostic

99 lines (96 loc) 3.76 kB
import type { Component } from "vue"; import type { ComponentClass, ComponentEmits } from "@/types"; import type { ComponentProps } from "vue-component-type-helpers"; export type SidebarProps<C extends Component = Component> = { /** Override existing theme classes completely */ override?: boolean; /** Whether siedbar is active or not, use v-model:active to make it two-way binding */ active?: boolean; /** Show an overlay background */ overlay?: boolean; /** Display the Sidebear inline */ inline?: boolean; /** * Sidebar position * @values top, right, bottom, left */ position?: "top" | "right" | "bottom" | "left"; /** Show sidebar in fullheight */ fullheight?: boolean; /** Show sidebar in fullwidth */ fullwidth?: boolean; /** * Override layout for small screens * @values expanded, reduced, fullwidth, fullheight, hidden */ mobile?: "expanded" | "reduced" | "fullwidth" | "fullheight" | "hidden"; /** Custom animation (transition name) */ animation?: string; /** Close when clicked outside of the panel */ closeOnOutside?: boolean; /** Close when pressing escape key */ closeOnEscape?: boolean; /** * Set `true` to remove the body scrollbar. * When `false`, a non-scrollable scrollbar will be kept to avoid moving the background, * but will set the body to a fixed position, which may break some layouts. */ clipScroll?: boolean; /** Trap focus inside the sidebar */ trapFocus?: boolean; /** Mobile breakpoint as `max-width` value */ mobileBreakpoint?: string; /** * Append the component to another part of the DOM. * Set `true` to append the component to the body. * In addition, any CSS selector string or an actual DOM node can be used. */ teleport?: boolean | string | object; /** * DOM container element for programmatic usage. * @ignore internal property */ container?: HTMLElement; /** * Component to be injected. * Close the component by emitting a 'close' event — `$emit('close')` */ component?: C; /** Props to be binded to the injected component */ props?: ComponentProps<C>; /** Events to be binded to the injected component */ events?: ComponentEmits<C>; } & SidebarClasses; // class props (will not be displayed in the docs) export type SidebarClasses = Partial<{ /** Class of the root element */ rootClass: ComponentClass; /** Class of the root element when on mobile */ mobileClass: ComponentClass; /** Class of the root element when active */ activeClass: ComponentClass; /** Class of the root element when teleported */ teleportClass: ComponentClass; /** Class of the root element when inlined */ inlineClass: ComponentClass; /** Class of the overlay element */ overlayClass: ComponentClass; /** Class of the content element */ contentClass: ComponentClass; /** Class of the content element with small screen modifier */ contentMobileClass: ComponentClass; /** Class of the content element when hidden */ hiddenClass: ComponentClass; /** Class of the content element when visible */ visibleClass: ComponentClass; /** Class of the content element with position */ positionClass: ComponentClass; /** Class of the content element when is fullheight */ fullheightClass: ComponentClass; /** Class of the content element when is fullwidth */ fullwidthClass: ComponentClass; /** Class of the body when is visible and scroll is clipped */ scrollClipClass: ComponentClass; /** Class of the body when is visible and scroll is keeped */ scrollKeepClass: ComponentClass; }>;