@overlastic/vue 0.6.1 → 0.7.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/dist/index.cjs +4 -4
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.global.js +3 -3
- package/dist/index.js +3 -3
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -26,7 +26,7 @@ __export(src_exports, {
|
|
|
26
26
|
defineOverlay: () => defineOverlay,
|
|
27
27
|
install: () => install,
|
|
28
28
|
renderOverlay: () => renderOverlay,
|
|
29
|
-
|
|
29
|
+
useExtendOverlay: () => useExtendOverlay,
|
|
30
30
|
useOverlayHolder: () => useOverlayHolder,
|
|
31
31
|
useOverlayInject: () => useOverlayInject
|
|
32
32
|
});
|
|
@@ -43,7 +43,7 @@ var InstancesInjectionKey = Symbol("OverlayInstances");
|
|
|
43
43
|
var import_vue_demi = require("vue-demi");
|
|
44
44
|
var import_core = require("@vueuse/core");
|
|
45
45
|
var import_core2 = require("@overlastic/core");
|
|
46
|
-
function
|
|
46
|
+
function useExtendOverlay(options = {}) {
|
|
47
47
|
const { duration = 0, immediate = true, model = "visible", automatic = true } = options;
|
|
48
48
|
const overlay = (0, import_vue_demi.inject)(ScriptsInjectionKey, useDeclarative(model, options));
|
|
49
49
|
const dec = Reflect.get(overlay, "in_dec");
|
|
@@ -65,7 +65,7 @@ function useDeclarative(model, options = {}) {
|
|
|
65
65
|
const { reject = "reject", resolve = "resolve" } = options.events || {};
|
|
66
66
|
const instance = (0, import_vue_demi.getCurrentInstance)();
|
|
67
67
|
if (!instance)
|
|
68
|
-
throw new Error("Please use
|
|
68
|
+
throw new Error("Please use useExtendOverlay in component setup");
|
|
69
69
|
const visible = (0, import_core.useVModel)(instance.props, model, instance.emit, { passive: true });
|
|
70
70
|
const _reject = (value) => {
|
|
71
71
|
instance == null ? void 0 : instance.emit(reject, value);
|
|
@@ -277,7 +277,7 @@ var src_default = unoverlay;
|
|
|
277
277
|
defineOverlay,
|
|
278
278
|
install,
|
|
279
279
|
renderOverlay,
|
|
280
|
-
|
|
280
|
+
useExtendOverlay,
|
|
281
281
|
useOverlayHolder,
|
|
282
282
|
useOverlayInject
|
|
283
283
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -19,7 +19,7 @@ interface PromptifyEvents {
|
|
|
19
19
|
*/
|
|
20
20
|
resolve?: string;
|
|
21
21
|
}
|
|
22
|
-
interface
|
|
22
|
+
interface ExtendOverlayOptions {
|
|
23
23
|
/** animation duration to avoid premature destruction of components */
|
|
24
24
|
duration?: number;
|
|
25
25
|
/** whether to set visible to true immediately */
|
|
@@ -41,7 +41,7 @@ interface DefineOverlayOptions {
|
|
|
41
41
|
*/
|
|
42
42
|
automatic?: boolean;
|
|
43
43
|
}
|
|
44
|
-
interface
|
|
44
|
+
interface ExtendOverlayReturn {
|
|
45
45
|
/** the notification reject, modify visible, and destroy it after the duration ends */
|
|
46
46
|
reject: (reason?: any) => void;
|
|
47
47
|
/** the notification resolve, modify visible, and destroy it after the duration ends */
|
|
@@ -60,7 +60,7 @@ interface DefineOverlayReturn {
|
|
|
60
60
|
* @function vanish destroy the current instance (immediately)
|
|
61
61
|
* @field visible control overlay display and hide
|
|
62
62
|
*/
|
|
63
|
-
declare function
|
|
63
|
+
declare function useExtendOverlay(options?: ExtendOverlayOptions): ExtendOverlayReturn;
|
|
64
64
|
|
|
65
65
|
type AbstractFn = abstract new (...args: any) => any;
|
|
66
66
|
|
|
@@ -112,4 +112,4 @@ declare const unoverlay: {
|
|
|
112
112
|
install: typeof install;
|
|
113
113
|
};
|
|
114
114
|
|
|
115
|
-
export { type
|
|
115
|
+
export { type ExtendOverlayOptions, type ExtendOverlayReturn, Field, type InjectionHolder, OverlayProvider, unoverlay as default, defineOverlay, install, renderOverlay, useExtendOverlay, useOverlayHolder, useOverlayInject };
|
package/dist/index.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ interface PromptifyEvents {
|
|
|
19
19
|
*/
|
|
20
20
|
resolve?: string;
|
|
21
21
|
}
|
|
22
|
-
interface
|
|
22
|
+
interface ExtendOverlayOptions {
|
|
23
23
|
/** animation duration to avoid premature destruction of components */
|
|
24
24
|
duration?: number;
|
|
25
25
|
/** whether to set visible to true immediately */
|
|
@@ -41,7 +41,7 @@ interface DefineOverlayOptions {
|
|
|
41
41
|
*/
|
|
42
42
|
automatic?: boolean;
|
|
43
43
|
}
|
|
44
|
-
interface
|
|
44
|
+
interface ExtendOverlayReturn {
|
|
45
45
|
/** the notification reject, modify visible, and destroy it after the duration ends */
|
|
46
46
|
reject: (reason?: any) => void;
|
|
47
47
|
/** the notification resolve, modify visible, and destroy it after the duration ends */
|
|
@@ -60,7 +60,7 @@ interface DefineOverlayReturn {
|
|
|
60
60
|
* @function vanish destroy the current instance (immediately)
|
|
61
61
|
* @field visible control overlay display and hide
|
|
62
62
|
*/
|
|
63
|
-
declare function
|
|
63
|
+
declare function useExtendOverlay(options?: ExtendOverlayOptions): ExtendOverlayReturn;
|
|
64
64
|
|
|
65
65
|
type AbstractFn = abstract new (...args: any) => any;
|
|
66
66
|
|
|
@@ -112,4 +112,4 @@ declare const unoverlay: {
|
|
|
112
112
|
install: typeof install;
|
|
113
113
|
};
|
|
114
114
|
|
|
115
|
-
export { type
|
|
115
|
+
export { type ExtendOverlayOptions, type ExtendOverlayReturn, Field, type InjectionHolder, OverlayProvider, unoverlay as default, defineOverlay, install, renderOverlay, useExtendOverlay, useOverlayHolder, useOverlayInject };
|
package/dist/index.global.js
CHANGED
|
@@ -16500,7 +16500,7 @@ ${codeFrame}` : message);
|
|
|
16500
16500
|
defineOverlay: () => defineOverlay,
|
|
16501
16501
|
install: () => install2,
|
|
16502
16502
|
renderOverlay: () => renderOverlay,
|
|
16503
|
-
|
|
16503
|
+
useExtendOverlay: () => useExtendOverlay,
|
|
16504
16504
|
useOverlayHolder: () => useOverlayHolder,
|
|
16505
16505
|
useOverlayInject: () => useOverlayInject
|
|
16506
16506
|
});
|
|
@@ -16765,7 +16765,7 @@ ${codeFrame}` : message);
|
|
|
16765
16765
|
}
|
|
16766
16766
|
|
|
16767
16767
|
// src/composable/define.ts
|
|
16768
|
-
function
|
|
16768
|
+
function useExtendOverlay(options = {}) {
|
|
16769
16769
|
const { duration = 0, immediate = true, model = "visible", automatic = true } = options;
|
|
16770
16770
|
const overlay = (0, lib_exports.inject)(ScriptsInjectionKey, useDeclarative(model, options));
|
|
16771
16771
|
const dec = Reflect.get(overlay, "in_dec");
|
|
@@ -16787,7 +16787,7 @@ ${codeFrame}` : message);
|
|
|
16787
16787
|
const { reject = "reject", resolve: resolve2 = "resolve" } = options.events || {};
|
|
16788
16788
|
const instance = (0, lib_exports.getCurrentInstance)();
|
|
16789
16789
|
if (!instance)
|
|
16790
|
-
throw new Error("Please use
|
|
16790
|
+
throw new Error("Please use useExtendOverlay in component setup");
|
|
16791
16791
|
const visible = useVModel(instance.props, model, instance.emit, { passive: true });
|
|
16792
16792
|
const _reject = (value) => {
|
|
16793
16793
|
instance == null ? void 0 : instance.emit(reject, value);
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ var InstancesInjectionKey = Symbol("OverlayInstances");
|
|
|
9
9
|
import { getCurrentInstance, inject, onMounted, provide } from "vue-demi";
|
|
10
10
|
import { useVModel } from "@vueuse/core";
|
|
11
11
|
import { delay, noop } from "@overlastic/core";
|
|
12
|
-
function
|
|
12
|
+
function useExtendOverlay(options = {}) {
|
|
13
13
|
const { duration = 0, immediate = true, model = "visible", automatic = true } = options;
|
|
14
14
|
const overlay = inject(ScriptsInjectionKey, useDeclarative(model, options));
|
|
15
15
|
const dec = Reflect.get(overlay, "in_dec");
|
|
@@ -31,7 +31,7 @@ function useDeclarative(model, options = {}) {
|
|
|
31
31
|
const { reject = "reject", resolve = "resolve" } = options.events || {};
|
|
32
32
|
const instance = getCurrentInstance();
|
|
33
33
|
if (!instance)
|
|
34
|
-
throw new Error("Please use
|
|
34
|
+
throw new Error("Please use useExtendOverlay in component setup");
|
|
35
35
|
const visible = useVModel(instance.props, model, instance.emit, { passive: true });
|
|
36
36
|
const _reject = (value) => {
|
|
37
37
|
instance == null ? void 0 : instance.emit(reject, value);
|
|
@@ -243,7 +243,7 @@ export {
|
|
|
243
243
|
defineOverlay,
|
|
244
244
|
install,
|
|
245
245
|
renderOverlay,
|
|
246
|
-
|
|
246
|
+
useExtendOverlay,
|
|
247
247
|
useOverlayHolder,
|
|
248
248
|
useOverlayInject
|
|
249
249
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@overlastic/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.7.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/hairyf/overlastic#readme",
|
|
7
7
|
"repository": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"pascal-case": "3.1.2",
|
|
30
30
|
"vue": "^3.3.2",
|
|
31
31
|
"vue-demi": ">=0.14.7",
|
|
32
|
-
"@overlastic/core": "^0.
|
|
32
|
+
"@overlastic/core": "^0.7.0"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"build": "tsup src/index.ts",
|