@overlastic/vue 0.8.0 → 0.8.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/dist/index.cjs +142 -132
- package/dist/index.d.cts +62 -55
- package/dist/index.d.ts +62 -55
- package/dist/index.global.js +318 -312
- package/dist/index.js +133 -122
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,25 +1,52 @@
|
|
|
1
1
|
import * as vue_demi from 'vue-demi';
|
|
2
2
|
import { Ref, AppContext, App } from 'vue-demi';
|
|
3
|
-
import * as _overlastic_core from '@overlastic/core';
|
|
4
|
-
import { Deferred, ImperativeOverlay, GlobalMountOptions, MountOptions } from '@overlastic/core';
|
|
5
3
|
import * as vue from 'vue';
|
|
6
|
-
import {
|
|
4
|
+
import { PropType, VNode, Component, VNodeProps } from 'vue';
|
|
5
|
+
import { Deferred, MountOptions, ImperativeOverlay } from '@overlastic/core';
|
|
6
|
+
|
|
7
|
+
declare const Field: vue.DefineComponent<{
|
|
8
|
+
is: {
|
|
9
|
+
type: PropType<string | number | VNode | Component>;
|
|
10
|
+
default: string;
|
|
11
|
+
};
|
|
12
|
+
}, () => string | number | VNode<vue.RendererNode, vue.RendererElement, {
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}> | null, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
|
|
15
|
+
is: {
|
|
16
|
+
type: PropType<string | number | VNode | Component>;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
}>>, {
|
|
20
|
+
is: string | number | VNode<vue.RendererNode, vue.RendererElement, {
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
}> | Component;
|
|
23
|
+
}, {}>;
|
|
24
|
+
|
|
25
|
+
declare const OverlaysProvider: vue_demi.DefineComponent<{}, () => vue_demi.VNode<vue_demi.RendererNode, vue_demi.RendererElement, {
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
}>, {}, {}, {}, vue_demi.ComponentOptionsMixin, vue_demi.ComponentOptionsMixin, {}, string, vue_demi.VNodeProps & vue_demi.AllowedComponentProps & vue_demi.ComponentCustomProps, Readonly<vue_demi.ExtractPropTypes<{}>>, {}, {}>;
|
|
7
28
|
|
|
8
29
|
interface PromptifyEvents {
|
|
9
30
|
/**
|
|
10
|
-
*
|
|
31
|
+
* cancel event name used by the template
|
|
32
|
+
*
|
|
33
|
+
* @default 'cancel'
|
|
34
|
+
*/
|
|
35
|
+
cancel?: string;
|
|
36
|
+
/**
|
|
37
|
+
* confirm event name used by the template
|
|
11
38
|
*
|
|
12
|
-
* @default '
|
|
39
|
+
* @default 'confirm'
|
|
13
40
|
*/
|
|
14
|
-
|
|
41
|
+
confirm?: string;
|
|
15
42
|
/**
|
|
16
|
-
*
|
|
43
|
+
* confirm event name used by the template
|
|
17
44
|
*
|
|
18
|
-
* @default '
|
|
45
|
+
* @default 'close'
|
|
19
46
|
*/
|
|
20
|
-
|
|
47
|
+
close?: string;
|
|
21
48
|
}
|
|
22
|
-
interface
|
|
49
|
+
interface UseDisclosureOptions {
|
|
23
50
|
/** animation duration to avoid premature destruction of components */
|
|
24
51
|
duration?: number;
|
|
25
52
|
/** whether to set visible to true immediately */
|
|
@@ -41,11 +68,13 @@ interface ExtendOverlayOptions {
|
|
|
41
68
|
*/
|
|
42
69
|
automatic?: boolean;
|
|
43
70
|
}
|
|
44
|
-
interface
|
|
45
|
-
/** the notification
|
|
46
|
-
|
|
47
|
-
/** the notification
|
|
48
|
-
|
|
71
|
+
interface UseDisclosureReturn {
|
|
72
|
+
/** the notification cancel, modify visible, and destroy it after the duration ends */
|
|
73
|
+
cancel: (reason?: any) => void;
|
|
74
|
+
/** the notification confirm, modify visible, and destroy it after the duration ends */
|
|
75
|
+
confirm: (value?: any) => void;
|
|
76
|
+
/** the notification confirm, modify visible, and destroy it after the duration ends */
|
|
77
|
+
close: () => void;
|
|
49
78
|
/** destroy the current instance (immediately) */
|
|
50
79
|
vanish: () => void;
|
|
51
80
|
/** visible control popup display and hide */
|
|
@@ -55,61 +84,39 @@ interface ExtendOverlayReturn {
|
|
|
55
84
|
}
|
|
56
85
|
/**
|
|
57
86
|
* get overlay layer meta information
|
|
58
|
-
* @function
|
|
59
|
-
* @function
|
|
87
|
+
* @function cancel the notification cancel, modify visible, and destroy it after the duration ends
|
|
88
|
+
* @function confirm the notification confirm, modify visible, and destroy it after the duration ends
|
|
60
89
|
* @function vanish destroy the current instance (immediately)
|
|
61
90
|
* @field visible control overlay display and hide
|
|
62
91
|
*/
|
|
63
|
-
declare function
|
|
92
|
+
declare function useDisclosure(options?: UseDisclosureOptions): UseDisclosureReturn;
|
|
64
93
|
|
|
65
94
|
type AbstractFn = abstract new (...args: any) => any;
|
|
66
95
|
|
|
67
|
-
type
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
96
|
+
type KnownKeys<T> = {
|
|
97
|
+
[K in keyof T]: T[K] extends unknown ? (unknown extends T[K] ? never : K) : never;
|
|
98
|
+
}[keyof T];
|
|
99
|
+
type PickKnown<T> = Pick<T, KnownKeys<T>>;
|
|
100
|
+
type ExtractEvent<T extends AbstractFn> = Parameters<Required<InstanceType<T>['$props']>['onConfirm']>[0];
|
|
101
|
+
type ExtractProps<T extends AbstractFn> = PickKnown<Omit<InstanceType<T>['$props'], keyof VNodeProps | `on${string}` | 'visible'>>;
|
|
102
|
+
declare function useOverlay<Comp extends AbstractFn, Resolved = ExtractEvent<Comp>>(Instance: Comp, options?: MountOptions<{
|
|
103
|
+
type?: 'inject';
|
|
104
|
+
}>): ImperativeOverlay<ExtractProps<Comp>, Resolved>;
|
|
105
|
+
declare function useOverlay<Comp extends AbstractFn, Resolved = ExtractEvent<Comp>>(Instance: Comp, options?: MountOptions<{
|
|
106
|
+
type?: 'holder';
|
|
107
|
+
}>): [Comp, ImperativeOverlay<ExtractProps<Comp>, Resolved>];
|
|
75
108
|
|
|
76
109
|
interface VMountOptions {
|
|
77
110
|
/** current app context */
|
|
78
111
|
appContext?: AppContext;
|
|
79
112
|
}
|
|
80
113
|
|
|
81
|
-
declare const defineOverlay: <Component extends AbstractFn, Resolved = any>(instance: Component, options?: MountOptions<VMountOptions> | undefined) => ImperativeOverlay<InstanceType<Component>[
|
|
82
|
-
declare const renderOverlay: <Component extends AbstractFn, Resolved = any>(instance: Component, props?: InstanceType<Component>[
|
|
83
|
-
|
|
84
|
-
declare const Field: vue.DefineComponent<{
|
|
85
|
-
is: {
|
|
86
|
-
type: PropType<string | number | VNode<vue.RendererNode, vue.RendererElement, {
|
|
87
|
-
[key: string]: any;
|
|
88
|
-
}> | Component>;
|
|
89
|
-
default: string;
|
|
90
|
-
};
|
|
91
|
-
}, () => string | number | VNode<vue.RendererNode, vue.RendererElement, {
|
|
92
|
-
[key: string]: any;
|
|
93
|
-
}> | null, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
|
|
94
|
-
is: {
|
|
95
|
-
type: PropType<string | number | VNode<vue.RendererNode, vue.RendererElement, {
|
|
96
|
-
[key: string]: any;
|
|
97
|
-
}> | Component>;
|
|
98
|
-
default: string;
|
|
99
|
-
};
|
|
100
|
-
}>>, {
|
|
101
|
-
is: string | number | VNode<vue.RendererNode, vue.RendererElement, {
|
|
102
|
-
[key: string]: any;
|
|
103
|
-
}> | Component;
|
|
104
|
-
}, {}>;
|
|
105
|
-
|
|
106
|
-
declare const OverlaysProvider: vue_demi.DefineComponent<{}, () => vue_demi.VNode<vue_demi.RendererNode, vue_demi.RendererElement, {
|
|
107
|
-
[key: string]: any;
|
|
108
|
-
}>, {}, {}, {}, vue_demi.ComponentOptionsMixin, vue_demi.ComponentOptionsMixin, {}, string, vue_demi.VNodeProps & vue_demi.AllowedComponentProps & vue_demi.ComponentCustomProps, Readonly<vue_demi.ExtractPropTypes<{}>>, {}, {}>;
|
|
114
|
+
declare const defineOverlay: <Component extends AbstractFn, Resolved = any>(instance: Component, options?: MountOptions<VMountOptions> | undefined) => ImperativeOverlay<InstanceType<Component>["$props"], Resolved, VMountOptions>;
|
|
115
|
+
declare const renderOverlay: <Component extends AbstractFn, Resolved = any>(instance: Component, props?: InstanceType<Component>["$props"] | undefined, options?: MountOptions<VMountOptions> | undefined) => Promise<Resolved>;
|
|
109
116
|
|
|
110
117
|
declare function install(app: App): void;
|
|
111
118
|
declare const unoverlay: {
|
|
112
119
|
install: typeof install;
|
|
113
120
|
};
|
|
114
121
|
|
|
115
|
-
export {
|
|
122
|
+
export { Field, OverlaysProvider, type UseDisclosureOptions, type UseDisclosureReturn, unoverlay as default, defineOverlay, install, renderOverlay, useDisclosure, useOverlay };
|