@lumx/vue 4.11.0-next.2 → 4.11.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/dialog/Dialog.d.ts +66 -0
- package/components/dialog/Dialog.stories.d.ts +106 -0
- package/components/dialog/index.d.ts +2 -0
- package/components/expansion-panel/ExpansionPanel.d.ts +1 -1
- package/composables/useDisableBodyScroll.d.ts +8 -0
- package/composables/useTransitionVisibility.d.ts +11 -0
- package/index.d.ts +1 -0
- package/index.js +3800 -3523
- package/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { BaseDialogProps, DialogSizes } from '@lumx/core/js/components/Dialog';
|
|
3
|
+
import { GenericProps, HasCloseMode } from '@lumx/core/js/types';
|
|
4
|
+
export type DialogProps = Pick<BaseDialogProps, 'forceFooterDivider' | 'forceHeaderDivider' | 'isLoading'> & HasCloseMode & {
|
|
5
|
+
/** Additional class name. */
|
|
6
|
+
class?: string;
|
|
7
|
+
/** Whether the dialog is open. */
|
|
8
|
+
isOpen?: boolean;
|
|
9
|
+
/** Size variant. */
|
|
10
|
+
size?: DialogSizes;
|
|
11
|
+
/** Z-axis position. */
|
|
12
|
+
zIndex?: number;
|
|
13
|
+
/** Additional props for the dialog container element. */
|
|
14
|
+
dialogProps?: GenericProps;
|
|
15
|
+
/** Reference to the parent element that triggered modal opening (gets focus back on close). */
|
|
16
|
+
parentElement?: HTMLElement;
|
|
17
|
+
/** Element that should receive focus when the dialog opens. By default the first focusable child. */
|
|
18
|
+
focusElement?: HTMLElement;
|
|
19
|
+
/** Reference to the dialog content element. */
|
|
20
|
+
contentRef?: Ref<HTMLDivElement>;
|
|
21
|
+
/** Whether to keep the dialog open on clickaway or escape press. */
|
|
22
|
+
preventAutoClose?: boolean;
|
|
23
|
+
/** Whether to keep the dialog open on escape press. */
|
|
24
|
+
preventCloseOnEscape?: boolean;
|
|
25
|
+
/** Whether to keep the dialog open on clickaway. */
|
|
26
|
+
preventCloseOnClick?: boolean;
|
|
27
|
+
/** Whether to disable body scroll when the dialog is open. */
|
|
28
|
+
disableBodyScroll?: boolean;
|
|
29
|
+
};
|
|
30
|
+
export declare const emitSchema: {
|
|
31
|
+
close: () => boolean;
|
|
32
|
+
visibilityChange: (isVisible: boolean) => boolean;
|
|
33
|
+
};
|
|
34
|
+
declare const Dialog: import('vue').DefineSetupFnComponent<DialogProps, {
|
|
35
|
+
close: () => boolean;
|
|
36
|
+
visibilityChange: (isVisible: boolean) => boolean;
|
|
37
|
+
}, {}, Pick<BaseDialogProps, "isLoading" | "forceFooterDivider" | "forceHeaderDivider"> & HasCloseMode & {
|
|
38
|
+
/** Additional class name. */
|
|
39
|
+
class?: string;
|
|
40
|
+
/** Whether the dialog is open. */
|
|
41
|
+
isOpen?: boolean;
|
|
42
|
+
/** Size variant. */
|
|
43
|
+
size?: DialogSizes;
|
|
44
|
+
/** Z-axis position. */
|
|
45
|
+
zIndex?: number;
|
|
46
|
+
/** Additional props for the dialog container element. */
|
|
47
|
+
dialogProps?: GenericProps;
|
|
48
|
+
/** Reference to the parent element that triggered modal opening (gets focus back on close). */
|
|
49
|
+
parentElement?: HTMLElement;
|
|
50
|
+
/** Element that should receive focus when the dialog opens. By default the first focusable child. */
|
|
51
|
+
focusElement?: HTMLElement;
|
|
52
|
+
/** Reference to the dialog content element. */
|
|
53
|
+
contentRef?: Ref<HTMLDivElement>;
|
|
54
|
+
/** Whether to keep the dialog open on clickaway or escape press. */
|
|
55
|
+
preventAutoClose?: boolean;
|
|
56
|
+
/** Whether to keep the dialog open on escape press. */
|
|
57
|
+
preventCloseOnEscape?: boolean;
|
|
58
|
+
/** Whether to keep the dialog open on clickaway. */
|
|
59
|
+
preventCloseOnClick?: boolean;
|
|
60
|
+
/** Whether to disable body scroll when the dialog is open. */
|
|
61
|
+
disableBodyScroll?: boolean;
|
|
62
|
+
} & {
|
|
63
|
+
onClose?: (() => any) | undefined;
|
|
64
|
+
onVisibilityChange?: ((isVisible: boolean) => any) | undefined;
|
|
65
|
+
}, import('vue').PublicProps>;
|
|
66
|
+
export default Dialog;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
component: any;
|
|
3
|
+
render: any;
|
|
4
|
+
parameters: {
|
|
5
|
+
chromatic: {
|
|
6
|
+
pauseAnimationAtEnd: boolean;
|
|
7
|
+
delay: number;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
decorators: ((story: any, context: any) => any)[];
|
|
11
|
+
args: Partial<import('@lumx/core/js/components/Dialog').DialogProps>;
|
|
12
|
+
argTypes: {
|
|
13
|
+
size: {
|
|
14
|
+
control: {
|
|
15
|
+
type: "select" | "inline-radio";
|
|
16
|
+
};
|
|
17
|
+
options: ("big" | "tiny" | "regular" | "huge")[];
|
|
18
|
+
mapping: Record<string, "big" | "tiny" | "regular" | "huge"> | undefined;
|
|
19
|
+
};
|
|
20
|
+
onVisibilityChange: {
|
|
21
|
+
action: boolean;
|
|
22
|
+
};
|
|
23
|
+
children: {
|
|
24
|
+
control: boolean;
|
|
25
|
+
};
|
|
26
|
+
closeMode: {
|
|
27
|
+
control: {
|
|
28
|
+
type: "inline-radio";
|
|
29
|
+
};
|
|
30
|
+
options: string[];
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
title: string;
|
|
34
|
+
};
|
|
35
|
+
export default _default;
|
|
36
|
+
export declare const Default: {
|
|
37
|
+
args: {
|
|
38
|
+
children: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export declare const Loading: {
|
|
42
|
+
args: {
|
|
43
|
+
isLoading: boolean;
|
|
44
|
+
children: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export declare const WithHeaderFooter: {
|
|
48
|
+
args: {
|
|
49
|
+
header: string;
|
|
50
|
+
footer: string;
|
|
51
|
+
children: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
export declare const ForceDivider: {
|
|
55
|
+
args: {
|
|
56
|
+
forceFooterDivider: boolean;
|
|
57
|
+
forceHeaderDivider: boolean;
|
|
58
|
+
header: string;
|
|
59
|
+
footer: string;
|
|
60
|
+
children: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
export declare const LongContent: {
|
|
64
|
+
args: {
|
|
65
|
+
children: string;
|
|
66
|
+
header: string;
|
|
67
|
+
footer: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
export declare const PreventAutoClose: {
|
|
71
|
+
args: {
|
|
72
|
+
preventAutoClose: boolean;
|
|
73
|
+
children: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
export declare const PreventCloseOnEscape: {
|
|
77
|
+
args: {
|
|
78
|
+
preventCloseOnEscape: boolean;
|
|
79
|
+
children: string;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
export declare const PreventCloseOnClick: {
|
|
83
|
+
args: {
|
|
84
|
+
preventCloseOnClick: boolean;
|
|
85
|
+
children: string;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* More complex header/footer using Vue named slots
|
|
90
|
+
*/
|
|
91
|
+
export declare const WithHeaderFooterChildren: {
|
|
92
|
+
render: () => import("vue/jsx-runtime").JSX.Element;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Dialog needing a confirmation before close using a nested Dialog
|
|
96
|
+
*/
|
|
97
|
+
export declare const WithConfirmClose: {
|
|
98
|
+
render: () => import("vue/jsx-runtime").JSX.Element;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Test dialog focus trap (focus is contained inside the dialog) with all kinds of focusable and non-focusable items
|
|
102
|
+
*/
|
|
103
|
+
export declare const FocusTrap: {
|
|
104
|
+
tags: string[];
|
|
105
|
+
render: () => import("vue/jsx-runtime").JSX.Element;
|
|
106
|
+
};
|
|
@@ -23,7 +23,7 @@ declare const ExpansionPanel: import('vue').DefineSetupFnComponent<ExpansionPane
|
|
|
23
23
|
open: (event: MouseEvent) => boolean;
|
|
24
24
|
close: (event: MouseEvent) => boolean;
|
|
25
25
|
toggleOpen: (shouldOpen: boolean, event: MouseEvent) => boolean;
|
|
26
|
-
}, {}, Omit<UIProps, "className" | "footer" | "ref" | "handleClick" | "handleChange" | "handleInput" | "handleKeyPress" | "handleClose" | "handleFocus" | "handleBeforeClick" | "handleAfterClick" | "handleMouseEnter" | "handleMouseLeave" | "handleKeyDown" | "children" | "content" | "IconButton" | "toggleButtonProps" | "
|
|
26
|
+
}, {}, Omit<UIProps, "className" | "footer" | "ref" | "handleClick" | "handleChange" | "handleInput" | "handleKeyPress" | "handleClose" | "handleFocus" | "handleBeforeClick" | "handleAfterClick" | "handleMouseEnter" | "handleMouseLeave" | "handleKeyDown" | "children" | "content" | "IconButton" | "toggleButtonProps" | "wrapperRef" | "handleOpen" | "handleToggleOpen" | "headerProps" | "headerContent" | "dragHandle" | "isChildrenVisible"> & {
|
|
27
27
|
class?: string;
|
|
28
28
|
} & {
|
|
29
29
|
/** Props to pass to the toggle button (minus those already set by the ExpansionPanel). */
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Disables body scroll when the dialog is open.
|
|
4
|
+
* Uses @vueuse/core's useScrollLock which sets overflow:hidden on document.body.
|
|
5
|
+
*
|
|
6
|
+
* @param isActive Whether body scroll should be disabled.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useDisableBodyScroll(isActive: Ref<boolean>): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ComputedRef, Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Returns true if the component is visible, tracking the opacity transition.
|
|
4
|
+
* Keeps the component mounted during the close animation, then unmounts after the timeout.
|
|
5
|
+
*
|
|
6
|
+
* @param isOpen Whether the component intends to be visible or not.
|
|
7
|
+
* @param timeout Duration of the close animation in ms.
|
|
8
|
+
* @param onVisibilityChange Callback called when the visibility changes.
|
|
9
|
+
* @return ComputedRef<boolean> true if the component should be rendered (open or animating closed)
|
|
10
|
+
*/
|
|
11
|
+
export declare function useTransitionVisibility(isOpen: Ref<boolean>, timeout: number, onVisibilityChange?: Ref<((isVisible: boolean) => void) | undefined>): ComputedRef<boolean>;
|
package/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from './components/badge';
|
|
|
6
6
|
export * from './components/button';
|
|
7
7
|
export * from './components/checkbox';
|
|
8
8
|
export * from './components/chip';
|
|
9
|
+
export * from './components/dialog';
|
|
9
10
|
export * from './components/divider';
|
|
10
11
|
export * from './components/drag-handle';
|
|
11
12
|
export * from './components/expansion-panel';
|