@opencloud-eu/design-system
Version:
OpenCloud Design System is used to design OpenCloud UI components
309 lines (308 loc) • 13.5 kB
TypeScript
import { FocusTargetOrFalse, FocusTrapTabbableOptions } from 'focus-trap';
import { ContextualHelperData } from '../../helpers';
export interface Props {
/**
* @docs Title of the modal.
*/
title: string;
/**
* @docs Text for the cancel button.
* @default Cancel
*/
buttonCancelText?: string;
/**
* @docs Disables the confirm button.
* @default false
*/
buttonConfirmDisabled?: boolean;
/**
* @docs Text for the confirm button.
* @default Confirm
*/
buttonConfirmText?: string;
/**
* @docs Contextual helper data. Please refer to the component source for the `ContextualHelperData` type definition.
*/
contextualHelperData?: ContextualHelperData;
/**
* @docs Label of the contextual helper.
*/
contextualHelperLabel?: string;
/**
* @docs Additional class(es) to be added to the modal.
*/
elementClass?: string;
/**
* @docs Element ID of the modal.
*/
elementId?: string;
/**
* @docs Selector of the element that is supposed to receive the initial focus inside the modal.
*/
focusTrapInitial?: string | boolean;
/**
* @docs Determines if the modal has an input field.
* @default false
*/
hasInput?: boolean;
/**
* @docs Hide the action buttons.
* @default false
*/
hideActions?: boolean;
/**
* @docs Hide the confirm button.
* @default false
*/
hideConfirmButton?: boolean;
/**
* @docs Description to be displayed below the input field.
*/
inputDescription?: string;
/**
* @docs Determines if a required mark should be displayed next to the input label.
*/
inputRequiredMark?: boolean;
/**
* @docs Error message to be displayed below the input field.
*/
inputError?: string;
/**
* @docs Label of the input field.
*/
inputLabel?: string;
/**
* @docs Selection range of the input field in case parts of the input content should be selected on first render.
*/
inputSelectionRange?: [number, number];
/**
* @docs Type of the input field.
* @default text
*/
inputType?: 'text' | 'number' | 'email' | 'password' | 'date';
/**
* @docs Value of the input field.
*/
inputValue?: string;
/**
* @docs Determines if the modal is in a loading state.
* @default false
*/
isLoading?: boolean;
/**
* @docs Message of the modal.
*/
message?: string;
}
export interface Emits {
/**
* @docs Emitted when the cancel button has been clicked.
*/
(e: 'cancel'): void;
/**
* @docs Emitted when the confirm button has been clicked.
*/
(e: 'confirm', value: string): void;
/**
* @docs Emitted when the user has typed something in the input field.
*/
(e: 'input', value: string): void;
}
export interface Slots {
/**
* @docs Custom content of the modal.
*/
content?: () => unknown;
}
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
input: (value: string) => any;
cancel: () => any;
confirm: (value: string) => any;
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
onInput?: (value: string) => any;
onCancel?: () => any;
onConfirm?: (value: string) => any;
}>, {}, {}, {
FocusTrap: import('vue').DefineComponent<{
active: {
type: BooleanConstructor;
default: boolean;
};
} & {
escapeDeactivates: {
type: BooleanConstructor;
default: true;
};
returnFocusOnDeactivate: {
type: BooleanConstructor;
default: true;
};
allowOutsideClick: {
type: import('vue').PropType<boolean | import('focus-trap').MouseEventToBoolean | undefined>;
default: true;
};
clickOutsideDeactivates: import('vue').PropType<boolean | import('focus-trap').MouseEventToBoolean | undefined>;
initialFocus: import('vue').PropType<FocusTargetOrFalse | (() => void) | undefined>;
fallbackFocus: import('vue').PropType<import('focus-trap').FocusTarget | undefined>;
checkCanFocusTrap: import('vue').PropType<((containers: (HTMLElement | SVGElement)[]) => Promise<void>) | undefined>;
checkCanReturnFocus: import('vue').PropType<((trigger: HTMLElement | SVGElement) => Promise<void>) | undefined>;
delayInitialFocus: {
type: BooleanConstructor;
default: true;
};
document: import('vue').PropType<Document | undefined>;
preventScroll: BooleanConstructor;
setReturnFocus: import('vue').PropType<import('focus-trap').FocusTargetValueOrFalse | ((nodeFocusedBeforeActivation: HTMLElement | SVGElement) => import('focus-trap').FocusTargetValueOrFalse) | undefined>;
tabbableOptions: import('vue').PropType<FocusTrapTabbableOptions | undefined>;
}, {
activate(): void;
deactivate(): void;
renderImpl(): import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
[key: string]: any;
}> | import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
[key: string]: any;
}>[] | null;
}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("update:active" | "activate" | "postActivate" | "deactivate" | "postDeactivate")[], "update:active" | "activate" | "postActivate" | "deactivate" | "postDeactivate", import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, Readonly<import('vue').ExtractPropTypes<{
active: {
type: BooleanConstructor;
default: boolean;
};
} & {
escapeDeactivates: {
type: BooleanConstructor;
default: true;
};
returnFocusOnDeactivate: {
type: BooleanConstructor;
default: true;
};
allowOutsideClick: {
type: import('vue').PropType<boolean | import('focus-trap').MouseEventToBoolean | undefined>;
default: true;
};
clickOutsideDeactivates: import('vue').PropType<boolean | import('focus-trap').MouseEventToBoolean | undefined>;
initialFocus: import('vue').PropType<FocusTargetOrFalse | (() => void) | undefined>;
fallbackFocus: import('vue').PropType<import('focus-trap').FocusTarget | undefined>;
checkCanFocusTrap: import('vue').PropType<((containers: (HTMLElement | SVGElement)[]) => Promise<void>) | undefined>;
checkCanReturnFocus: import('vue').PropType<((trigger: HTMLElement | SVGElement) => Promise<void>) | undefined>;
delayInitialFocus: {
type: BooleanConstructor;
default: true;
};
document: import('vue').PropType<Document | undefined>;
preventScroll: BooleanConstructor;
setReturnFocus: import('vue').PropType<import('focus-trap').FocusTargetValueOrFalse | ((nodeFocusedBeforeActivation: HTMLElement | SVGElement) => import('focus-trap').FocusTargetValueOrFalse) | undefined>;
tabbableOptions: import('vue').PropType<FocusTrapTabbableOptions | undefined>;
}>> & {
onActivate?: ((...args: any[]) => any) | undefined;
onPostActivate?: ((...args: any[]) => any) | undefined;
onDeactivate?: ((...args: any[]) => any) | undefined;
onPostDeactivate?: ((...args: any[]) => any) | undefined;
"onUpdate:active"?: ((...args: any[]) => any) | undefined;
}, {
returnFocusOnDeactivate: boolean;
escapeDeactivates: boolean;
allowOutsideClick: boolean | import('focus-trap').MouseEventToBoolean | undefined;
preventScroll: boolean;
delayInitialFocus: boolean;
active: boolean;
}, {}>;
}, {}, string, import('vue').ComponentProvideOptions, false, {
ocModal: HTMLDivElement;
ocModalInput: {
$: import('vue').ComponentInternalInstance;
$data: {};
$props: {
readonly id?: string;
readonly type?: "text" | "number" | "email" | "password" | "date";
readonly modelValue?: string;
readonly selectionRange?: [number, number];
readonly clearButtonEnabled?: boolean;
readonly clearButtonAccessibleLabel?: string;
readonly defaultValue?: string;
readonly disabled?: boolean;
readonly label: string;
readonly errorMessage?: string;
readonly errorMessageDebouncedTime?: number;
readonly fixMessageLine?: boolean;
readonly descriptionMessage?: string;
readonly readOnly?: boolean;
readonly requiredMark?: boolean;
readonly passwordPolicy?: import('../../helpers').PasswordPolicy;
readonly generatePasswordMethod?: (...args: unknown[]) => string;
readonly onFocus?: (value: string) => any;
readonly onChange?: (value: string) => any;
readonly "onUpdate:modelValue"?: (value: string) => any;
readonly onPasswordChallengeCompleted?: () => any;
readonly onPasswordChallengeFailed?: () => any;
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
$attrs: {
[x: string]: unknown;
};
$refs: {
[x: string]: unknown;
} & {
inputRef: unknown;
};
$slots: Readonly<{
[name: string]: import('vue').Slot<any>;
}>;
$root: import('vue').ComponentPublicInstance | null;
$parent: import('vue').ComponentPublicInstance | null;
$host: Element | null;
$emit: ((event: "focus", value: string) => void) & ((event: "change", value: string) => void) & ((event: "update:modelValue", value: string) => void) & ((event: "passwordChallengeCompleted") => void) & ((event: "passwordChallengeFailed") => void);
$el: any;
$options: import('vue').ComponentOptionsBase<Readonly<import('../OcTextInput/OcTextInput.vue').Props> & Readonly<{
onFocus?: (value: string) => any;
onChange?: (value: string) => any;
"onUpdate:modelValue"?: (value: string) => any;
onPasswordChallengeCompleted?: () => any;
onPasswordChallengeFailed?: () => any;
}>, {
focus: () => void;
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
focus: (value: string) => any;
change: (value: string) => any;
"update:modelValue": (value: string) => any;
passwordChallengeCompleted: () => any;
passwordChallengeFailed: () => any;
}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
beforeCreate?: (() => void) | (() => void)[];
created?: (() => void) | (() => void)[];
beforeMount?: (() => void) | (() => void)[];
mounted?: (() => void) | (() => void)[];
beforeUpdate?: (() => void) | (() => void)[];
updated?: (() => void) | (() => void)[];
activated?: (() => void) | (() => void)[];
deactivated?: (() => void) | (() => void)[];
beforeDestroy?: (() => void) | (() => void)[];
beforeUnmount?: (() => void) | (() => void)[];
destroyed?: (() => void) | (() => void)[];
unmounted?: (() => void) | (() => void)[];
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
};
$forceUpdate: () => void;
$nextTick: typeof import('vue').nextTick;
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
} & Readonly<{}> & Omit<Readonly<import('../OcTextInput/OcTextInput.vue').Props> & Readonly<{
onFocus?: (value: string) => any;
onChange?: (value: string) => any;
"onUpdate:modelValue"?: (value: string) => any;
onPasswordChallengeCompleted?: () => any;
onPasswordChallengeFailed?: () => any;
}>, "focus"> & import('vue').ShallowUnwrapRef<{
focus: () => void;
}> & {} & import('vue').ComponentCustomProperties & {} & {
$slots: Readonly<import('../OcTextInput/OcTextInput.vue').Slots> & import('../OcTextInput/OcTextInput.vue').Slots;
};
}, HTMLDivElement>, {
content?(_: {}): any;
}>;
export default _default;
type __VLS_WithTemplateSlots<T, S> = T & {
new (): {
$slots: S;
};
};