@inertia-vuetify/modal 0.0.0-stage → 3.0.0-rc.0
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/LICENSE +50 -0
- package/README.md +371 -2
- package/dist/CloseButton.vue.d.ts +3 -0
- package/dist/Deferred.vue.d.ts +16 -0
- package/dist/ModalBtn.vue.d.ts +17 -0
- package/dist/ModalContent.vue.d.ts +33 -0
- package/dist/ModalLink.vue.d.ts +201 -0
- package/dist/ModalRenderer.vue.d.ts +6 -0
- package/dist/ModalRoot.vue.d.ts +13 -0
- package/dist/WhenVisible.vue.d.ts +24 -0
- package/dist/app.d.ts +5 -0
- package/dist/cache.d.ts +12 -0
- package/dist/config.d.ts +16 -0
- package/dist/helpers.d.ts +5 -0
- package/dist/index.d.ts +14 -0
- package/dist/inertia-modal-vuetify.js +1140 -0
- package/dist/keys.d.ts +2 -0
- package/dist/modalStack.d.ts +64 -0
- package/dist/transitions.d.ts +10 -0
- package/dist/types.d.ts +109 -0
- package/dist/useModal.d.ts +3 -0
- package/package.json +71 -4
- package/src/CloseButton.vue +13 -0
- package/src/Deferred.vue +21 -0
- package/src/HeadlessModal.vue +174 -0
- package/src/Modal.vue +120 -0
- package/src/ModalBtn.vue +28 -0
- package/src/ModalContent.vue +238 -0
- package/src/ModalLink.vue +189 -0
- package/src/ModalRenderer.vue +21 -0
- package/src/ModalRoot.vue +152 -0
- package/src/WhenVisible.vue +90 -0
- package/src/app.ts +17 -0
- package/src/cache.ts +67 -0
- package/src/config.ts +116 -0
- package/src/helpers.ts +18 -0
- package/src/index.ts +15 -0
- package/src/keys.ts +3 -0
- package/src/modalStack.ts +525 -0
- package/src/transitions.ts +30 -0
- package/src/types.ts +121 -0
- package/src/useModal.ts +7 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import type { RequestPayload } from '@inertiajs/core';
|
|
2
|
+
import { type Component, type PropType } from 'vue';
|
|
3
|
+
import type { Fullscreen, HttpMethod, MaxWidth, ModalPosition, PrefetchOption, SlideoverPosition } from './types';
|
|
4
|
+
type __VLS_Slots = {
|
|
5
|
+
default?(props: {
|
|
6
|
+
loading: boolean;
|
|
7
|
+
}): unknown;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
10
|
+
href: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
method: {
|
|
15
|
+
type: PropType<HttpMethod>;
|
|
16
|
+
default: string;
|
|
17
|
+
};
|
|
18
|
+
data: {
|
|
19
|
+
type: PropType<RequestPayload>;
|
|
20
|
+
default: () => {};
|
|
21
|
+
};
|
|
22
|
+
as: {
|
|
23
|
+
type: PropType<string | Component>;
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
26
|
+
headers: {
|
|
27
|
+
type: PropType<Record<string, string>>;
|
|
28
|
+
default: () => {};
|
|
29
|
+
};
|
|
30
|
+
queryStringArrayFormat: {
|
|
31
|
+
type: PropType<"brackets" | "indices">;
|
|
32
|
+
default: string;
|
|
33
|
+
};
|
|
34
|
+
navigate: {
|
|
35
|
+
type: BooleanConstructor;
|
|
36
|
+
default: null;
|
|
37
|
+
};
|
|
38
|
+
prefetch: {
|
|
39
|
+
type: PropType<PrefetchOption>;
|
|
40
|
+
default: boolean;
|
|
41
|
+
};
|
|
42
|
+
cacheFor: {
|
|
43
|
+
type: NumberConstructor;
|
|
44
|
+
default: number;
|
|
45
|
+
};
|
|
46
|
+
closeButton: {
|
|
47
|
+
type: BooleanConstructor;
|
|
48
|
+
default: null;
|
|
49
|
+
};
|
|
50
|
+
closeExplicitly: {
|
|
51
|
+
type: BooleanConstructor;
|
|
52
|
+
default: null;
|
|
53
|
+
};
|
|
54
|
+
closeOnClickOutside: {
|
|
55
|
+
type: BooleanConstructor;
|
|
56
|
+
default: null;
|
|
57
|
+
};
|
|
58
|
+
maxWidth: {
|
|
59
|
+
type: PropType<MaxWidth>;
|
|
60
|
+
default: null;
|
|
61
|
+
};
|
|
62
|
+
paddingClasses: {
|
|
63
|
+
type: PropType<string | false>;
|
|
64
|
+
default: null;
|
|
65
|
+
};
|
|
66
|
+
panelClasses: {
|
|
67
|
+
type: PropType<string | false>;
|
|
68
|
+
default: null;
|
|
69
|
+
};
|
|
70
|
+
position: {
|
|
71
|
+
type: PropType<ModalPosition | SlideoverPosition>;
|
|
72
|
+
default: null;
|
|
73
|
+
};
|
|
74
|
+
slideover: {
|
|
75
|
+
type: BooleanConstructor;
|
|
76
|
+
default: null;
|
|
77
|
+
};
|
|
78
|
+
fullscreen: {
|
|
79
|
+
type: PropType<Fullscreen>;
|
|
80
|
+
default: null;
|
|
81
|
+
};
|
|
82
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
83
|
+
start: () => any;
|
|
84
|
+
close: () => any;
|
|
85
|
+
focus: () => any;
|
|
86
|
+
blur: () => any;
|
|
87
|
+
success: () => any;
|
|
88
|
+
"after-leave": () => any;
|
|
89
|
+
error: (error: unknown) => any;
|
|
90
|
+
prefetching: () => any;
|
|
91
|
+
prefetched: () => any;
|
|
92
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
93
|
+
href: {
|
|
94
|
+
type: StringConstructor;
|
|
95
|
+
required: true;
|
|
96
|
+
};
|
|
97
|
+
method: {
|
|
98
|
+
type: PropType<HttpMethod>;
|
|
99
|
+
default: string;
|
|
100
|
+
};
|
|
101
|
+
data: {
|
|
102
|
+
type: PropType<RequestPayload>;
|
|
103
|
+
default: () => {};
|
|
104
|
+
};
|
|
105
|
+
as: {
|
|
106
|
+
type: PropType<string | Component>;
|
|
107
|
+
default: string;
|
|
108
|
+
};
|
|
109
|
+
headers: {
|
|
110
|
+
type: PropType<Record<string, string>>;
|
|
111
|
+
default: () => {};
|
|
112
|
+
};
|
|
113
|
+
queryStringArrayFormat: {
|
|
114
|
+
type: PropType<"brackets" | "indices">;
|
|
115
|
+
default: string;
|
|
116
|
+
};
|
|
117
|
+
navigate: {
|
|
118
|
+
type: BooleanConstructor;
|
|
119
|
+
default: null;
|
|
120
|
+
};
|
|
121
|
+
prefetch: {
|
|
122
|
+
type: PropType<PrefetchOption>;
|
|
123
|
+
default: boolean;
|
|
124
|
+
};
|
|
125
|
+
cacheFor: {
|
|
126
|
+
type: NumberConstructor;
|
|
127
|
+
default: number;
|
|
128
|
+
};
|
|
129
|
+
closeButton: {
|
|
130
|
+
type: BooleanConstructor;
|
|
131
|
+
default: null;
|
|
132
|
+
};
|
|
133
|
+
closeExplicitly: {
|
|
134
|
+
type: BooleanConstructor;
|
|
135
|
+
default: null;
|
|
136
|
+
};
|
|
137
|
+
closeOnClickOutside: {
|
|
138
|
+
type: BooleanConstructor;
|
|
139
|
+
default: null;
|
|
140
|
+
};
|
|
141
|
+
maxWidth: {
|
|
142
|
+
type: PropType<MaxWidth>;
|
|
143
|
+
default: null;
|
|
144
|
+
};
|
|
145
|
+
paddingClasses: {
|
|
146
|
+
type: PropType<string | false>;
|
|
147
|
+
default: null;
|
|
148
|
+
};
|
|
149
|
+
panelClasses: {
|
|
150
|
+
type: PropType<string | false>;
|
|
151
|
+
default: null;
|
|
152
|
+
};
|
|
153
|
+
position: {
|
|
154
|
+
type: PropType<ModalPosition | SlideoverPosition>;
|
|
155
|
+
default: null;
|
|
156
|
+
};
|
|
157
|
+
slideover: {
|
|
158
|
+
type: BooleanConstructor;
|
|
159
|
+
default: null;
|
|
160
|
+
};
|
|
161
|
+
fullscreen: {
|
|
162
|
+
type: PropType<Fullscreen>;
|
|
163
|
+
default: null;
|
|
164
|
+
};
|
|
165
|
+
}>> & Readonly<{
|
|
166
|
+
onStart?: (() => any) | undefined;
|
|
167
|
+
onClose?: (() => any) | undefined;
|
|
168
|
+
onFocus?: (() => any) | undefined;
|
|
169
|
+
onBlur?: (() => any) | undefined;
|
|
170
|
+
onSuccess?: (() => any) | undefined;
|
|
171
|
+
"onAfter-leave"?: (() => any) | undefined;
|
|
172
|
+
onError?: ((error: unknown) => any) | undefined;
|
|
173
|
+
onPrefetching?: (() => any) | undefined;
|
|
174
|
+
onPrefetched?: (() => any) | undefined;
|
|
175
|
+
}>, {
|
|
176
|
+
maxWidth: MaxWidth;
|
|
177
|
+
position: "top" | "bottom" | "left" | "right" | "center";
|
|
178
|
+
data: RequestPayload;
|
|
179
|
+
slideover: boolean;
|
|
180
|
+
navigate: boolean;
|
|
181
|
+
closeButton: boolean;
|
|
182
|
+
closeExplicitly: boolean;
|
|
183
|
+
closeOnClickOutside: boolean;
|
|
184
|
+
paddingClasses: string | false;
|
|
185
|
+
panelClasses: string | false;
|
|
186
|
+
fullscreen: Fullscreen;
|
|
187
|
+
method: import("@inertiajs/core").Method;
|
|
188
|
+
headers: Record<string, string>;
|
|
189
|
+
queryStringArrayFormat: "indices" | "brackets";
|
|
190
|
+
prefetch: PrefetchOption;
|
|
191
|
+
as: string | Component;
|
|
192
|
+
cacheFor: number;
|
|
193
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
194
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
195
|
+
declare const _default: typeof __VLS_export;
|
|
196
|
+
export default _default;
|
|
197
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
198
|
+
new (): {
|
|
199
|
+
$slots: S;
|
|
200
|
+
};
|
|
201
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
index: number;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare var __VLS_1: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_1) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ReloadOptions } from './types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
data?: string | string[];
|
|
4
|
+
params?: ReloadOptions;
|
|
5
|
+
buffer?: number;
|
|
6
|
+
as?: string;
|
|
7
|
+
always?: boolean;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_Slots = {
|
|
10
|
+
default?(): unknown;
|
|
11
|
+
fallback?(): unknown;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
14
|
+
as: string;
|
|
15
|
+
buffer: number;
|
|
16
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
18
|
+
declare const _default: typeof __VLS_export;
|
|
19
|
+
export default _default;
|
|
20
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
21
|
+
new (): {
|
|
22
|
+
$slots: S;
|
|
23
|
+
};
|
|
24
|
+
};
|
package/dist/app.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type App, type Component, type VNode } from 'vue';
|
|
2
|
+
/** Renders the Inertia app inside `ModalRoot`, which renders the modal stack. */
|
|
3
|
+
export declare function renderApp(App: Component, props: Record<string, any>): () => VNode;
|
|
4
|
+
/** Wraps an app's existing render function in `ModalRoot`. */
|
|
5
|
+
export declare function withInertiaModal(app: App): void;
|
package/dist/cache.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class ResponseCache<T> {
|
|
2
|
+
private cache;
|
|
3
|
+
private timers;
|
|
4
|
+
private inFlight;
|
|
5
|
+
static key(method: string, url: string, data: unknown): string;
|
|
6
|
+
get(key: string): T | null;
|
|
7
|
+
set(key: string, response: T, cacheFor: number): void;
|
|
8
|
+
delete(key: string): void;
|
|
9
|
+
getInFlight(key: string): Promise<T> | undefined;
|
|
10
|
+
setInFlight(key: string, promise: Promise<T>): void;
|
|
11
|
+
deleteInFlight(key: string): void;
|
|
12
|
+
}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { GlobalModalConfig, ModalPosition, ModalTypeConfig } from './types';
|
|
2
|
+
export declare function resetConfig(): void;
|
|
3
|
+
/** Replaces the configuration (omitted keys get their defaults) or sets one dot-notation key. */
|
|
4
|
+
export declare function putConfig(config: GlobalModalConfig): void;
|
|
5
|
+
export declare function putConfig(key: string, value: unknown): void;
|
|
6
|
+
/** Reads the whole configuration or one dot-notation key; missing keys return `null`. */
|
|
7
|
+
export declare function getConfig(key?: string): unknown;
|
|
8
|
+
export declare function getConfigByType<K extends keyof ModalTypeConfig>(slideover: boolean, key: K): ModalTypeConfig[K];
|
|
9
|
+
/**
|
|
10
|
+
* Maps a max-width token to a CSS width; unknown tokens fall back to `2xl`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getMaxWidth(maxWidth?: string | null): string;
|
|
13
|
+
/**
|
|
14
|
+
* Maps a modal position to a Vuetify dialog location.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getDialogLocation(position?: string | null): ModalPosition;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { except, kebabCase, only, rejectNullValues, sameUrlPath } from '@inertiaui/vanilla';
|
|
2
|
+
export declare function parseResponseData(data: unknown): unknown;
|
|
3
|
+
/** Overrides id generation, e.g. to make request headers predictable in tests. */
|
|
4
|
+
export declare function generateIdUsing(callback: (() => string) | null): void;
|
|
5
|
+
export declare function generateId(prefix?: string): string;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * as dialogUtils from '@inertiaui/vanilla';
|
|
2
|
+
export type { CleanupFunction, EscapeKeyOptions, FocusTrapOptions } from '@inertiaui/vanilla';
|
|
3
|
+
export { renderApp, withInertiaModal } from './app';
|
|
4
|
+
export { getConfig, getDialogLocation, getMaxWidth, putConfig, resetConfig } from './config';
|
|
5
|
+
export { default as Deferred } from './Deferred.vue';
|
|
6
|
+
export { default as HeadlessModal } from './HeadlessModal.vue';
|
|
7
|
+
export { default as Modal } from './Modal.vue';
|
|
8
|
+
export { default as ModalBtn } from './ModalBtn.vue';
|
|
9
|
+
export { default as ModalLink } from './ModalLink.vue';
|
|
10
|
+
export { default as ModalRoot } from './ModalRoot.vue';
|
|
11
|
+
export { initFromPageProps, ModalInstance, modalPropNames, prefetch, useModalStack, visitModal, type ModalStack } from './modalStack';
|
|
12
|
+
export type * from './types';
|
|
13
|
+
export { default as useModal } from './useModal';
|
|
14
|
+
export { default as WhenVisible } from './WhenVisible.vue';
|