Začetni commit projekta rezervacije

This commit is contained in:
Mark Poljanšek committed 2025-04-23 20:19:33 +02:00
commit 328731b32f
56062 files changed
+2485242

No files matched your search

+7
View File
@@ -0,0 +1,7 @@
import { PolymorphicComponent } from "../utils/PolymorphicComponent.js";
import { PopperTypeMap } from "./BasePopper.types.js";
/**
* @ignore - internal component.
*/
declare const Popper: PolymorphicComponent<PopperTypeMap>;
export default Popper;
+129
View File
@@ -0,0 +1,129 @@
import * as React from 'react';
import { Instance, Options, OptionsGeneric, VirtualElement } from '@popperjs/core';
import { PortalProps } from "../Portal/index.js";
import { SlotComponentProps } from "../utils/types.js";
import { PolymorphicProps } from "../utils/PolymorphicComponent.js";
export type PopperPlacementType = Options['placement'];
export interface PopperRootSlotPropsOverrides {}
export interface PopperTransitionProps {
in: boolean;
onEnter: () => void;
onExited: () => void;
}
export interface PopperChildrenProps {
placement: PopperPlacementType;
TransitionProps?: PopperTransitionProps;
}
export interface PopperOwnProps {
/**
* An HTML element, [virtualElement](https://popper.js.org/docs/v2/virtual-elements/),
* or a function that returns either.
* It's used to set the position of the popper.
* The return value will passed as the reference object of the Popper instance.
*/
anchorEl?: null | VirtualElement | HTMLElement | (() => HTMLElement) | (() => VirtualElement);
/**
* Popper render function or node.
*/
children?: React.ReactNode | ((props: PopperChildrenProps) => React.ReactNode);
/**
* An HTML element or function that returns one.
* The `container` will have the portal children appended to it.
*
* You can also provide a callback, which is called in a React layout effect.
* This lets you set the container from a ref, and also makes server-side rendering possible.
*
* By default, it uses the body of the top-level document object,
* so it's simply `document.body` most of the time.
*/
container?: PortalProps['container'];
/**
* Direction of the text.
* @default 'ltr'
*/
direction?: 'ltr' | 'rtl';
/**
* The `children` will be under the DOM hierarchy of the parent component.
* @default false
*/
disablePortal?: PortalProps['disablePortal'];
/**
* Always keep the children in the DOM.
* This prop can be useful in SEO situation or
* when you want to maximize the responsiveness of the Popper.
* @default false
*/
keepMounted?: boolean;
/**
* Popper.js is based on a "plugin-like" architecture,
* most of its features are fully encapsulated "modifiers".
*
* A modifier is a function that is called each time Popper.js needs to
* compute the position of the popper.
* For this reason, modifiers should be very performant to avoid bottlenecks.
* To learn how to create a modifier, [read the modifiers documentation](https://popper.js.org/docs/v2/modifiers/).
*/
modifiers?: Options['modifiers'];
/**
* If `true`, the component is shown.
*/
open: boolean;
/**
* Popper placement.
* @default 'bottom'
*/
placement?: PopperPlacementType;
/**
* Options provided to the [`Popper.js`](https://popper.js.org/docs/v2/constructors/#options) instance.
* @default {}
*/
popperOptions?: Partial<OptionsGeneric<any>>;
/**
* A ref that points to the used popper instance.
*/
popperRef?: React.Ref<Instance>;
/**
* The props used for each slot inside the Popper.
* @default {}
*/
slotProps?: {
root?: SlotComponentProps<'div', PopperRootSlotPropsOverrides, PopperOwnerState>;
};
/**
* The components used for each slot inside the Popper.
* Either a string to use a HTML element or a component.
* @default {}
*/
slots?: PopperSlots;
/**
* Help supporting a react-transition-group/Transition component.
* @default false
*/
transition?: boolean;
}
export interface PopperSlots {
/**
* The component that renders the root.
* @default 'div'
*/
root?: React.ElementType;
}
export type PopperOwnerState = PopperOwnProps;
export interface PopperTypeMap<AdditionalProps = {}, RootComponentType extends React.ElementType = 'div'> {
props: PopperOwnProps & AdditionalProps;
defaultComponent: RootComponentType;
}
export type PopperProps<RootComponentType extends React.ElementType = PopperTypeMap['defaultComponent']> = PolymorphicProps<PopperTypeMap<{}, RootComponentType>, RootComponentType>;
export type PopperTooltipOwnProps = Omit<PopperOwnProps, 'container' | 'keepMounted' | 'transition'> & {
TransitionProps?: PopperTransitionProps;
};
export interface PopperTooltipTypeMap<AdditionalProps = {}, RootComponentType extends React.ElementType = 'div'> {
props: PopperTooltipOwnProps & AdditionalProps;
defaultComponent: RootComponentType;
}
export type PopperTooltipProps<RootComponentType extends React.ElementType = PopperTooltipTypeMap['defaultComponent']> = PolymorphicProps<PopperTooltipTypeMap<{}, RootComponentType>, RootComponentType>;
export interface PopperRootSlotProps {
className?: string;
ref: React.Ref<any>;
ownerState: PopperOwnerState;
}
+46
View File
@@ -0,0 +1,46 @@
import { SxProps } from '@mui/system';
import * as React from 'react';
import { PopperProps as BasePopperProps } from "./BasePopper.types.js";
import { Theme } from "../styles/index.js";
export interface PopperProps extends Omit<BasePopperProps, 'direction'> {
/**
* The component used for the root node.
* Either a string to use a HTML element or a component.
*/
component?: React.ElementType;
/**
* The components used for each slot inside the Popper.
* Either a string to use a HTML element or a component.
*
* @deprecated use the `slots` prop instead. This prop will be removed in a future major release. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
* @default {}
*/
components?: {
Root?: React.ElementType;
};
/**
* The props used for each slot inside the Popper.
*
* @deprecated use the `slotProps` prop instead. This prop will be removed in a future major release. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
* @default {}
*/
componentsProps?: BasePopperProps['slotProps'];
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx?: SxProps<Theme>;
}
/**
*
* Demos:
*
* - [Autocomplete](https://mui.com/material-ui/react-autocomplete/)
* - [Menu](https://mui.com/material-ui/react-menu/)
* - [Popper](https://mui.com/material-ui/react-popper/)
*
* API:
*
* - [Popper API](https://mui.com/material-ui/api/popper/)
*/
declare const Popper: React.ForwardRefExoticComponent<PopperProps & React.RefAttributes<HTMLDivElement>>;
export default Popper;
+4
View File
@@ -0,0 +1,4 @@
export { default } from "./Popper.js";
export * from "./Popper.js";
export * from "./popperClasses.js";
export { PopperPlacementType } from "./BasePopper.types.js";
+8
View File
@@ -0,0 +1,8 @@
export interface PopperClasses {
/** Class name applied to the root element. */
root: string;
}
export type PopperClassKey = keyof PopperClasses;
export declare function getPopperUtilityClass(slot: string): string;
declare const popperClasses: PopperClasses;
export default popperClasses;