@overlastic/vue2 0.4.4 → 0.5.1
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 +23 -23
- package/README.md +29 -85
- package/dist/index.cjs +10 -10
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.global.js +22 -21
- package/dist/index.js +9 -9
- package/package.json +2 -2
package/LICENSE
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2022-PRESENT Hairyf<https://github.com/hairyf>
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022-PRESENT Hairyf<https://github.com/hairyf>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
|
package/README.md
CHANGED
|
@@ -1,85 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
##
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
## Usage
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
### Step 1: Define Component
|
|
35
|
-
|
|
36
|
-
overlays is suitable for most components. Using usePrograms can provide finer control over the component process.
|
|
37
|
-
|
|
38
|
-
```vue
|
|
39
|
-
<!-- overlay.vue -->
|
|
40
|
-
<script>
|
|
41
|
-
import { usePrograms } from '@overlastic/vue2'
|
|
42
|
-
export default {
|
|
43
|
-
mixins: [usePrograms({ duration: 1000 })],
|
|
44
|
-
methods: {
|
|
45
|
-
onClick() {
|
|
46
|
-
// use this.$visible
|
|
47
|
-
// use this.$resolve or this.$reject
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
</script>
|
|
52
|
-
|
|
53
|
-
<template>
|
|
54
|
-
<div v-if="visible" @click="resolve(`${title}:confirmed`)">
|
|
55
|
-
{{ title }}
|
|
56
|
-
</div>
|
|
57
|
-
</template>
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
### Step 2: Create Overlay
|
|
61
|
-
|
|
62
|
-
You can use the `defineOverlay` method to convert the component into a modal dialog in Javascript / Typescript, which allows you to call it.
|
|
63
|
-
|
|
64
|
-
```ts
|
|
65
|
-
import { defineOverlay } from '@overlastic/vue'
|
|
66
|
-
import OverlayComponent from './overlay.vue'
|
|
67
|
-
|
|
68
|
-
// Convert to imperative callback
|
|
69
|
-
const callback = defineOverlay(OverlayComponent)
|
|
70
|
-
// Call the component and get the value of the resolve callback
|
|
71
|
-
const value = await callback({ title: 'callbackOverlay' })
|
|
72
|
-
// value === "callbackOverlay:confirmed"
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
You can also use `renderOverlay` to directly call the component and skip the `defineOverlay` method.
|
|
76
|
-
|
|
77
|
-
```ts
|
|
78
|
-
import { renderOverlay } from '@overlastic/vue'
|
|
79
|
-
import OverlayComponent from './overlay.vue'
|
|
80
|
-
|
|
81
|
-
const value = await renderOverlay(OverlayComponent, {
|
|
82
|
-
title: 'usePrograms'
|
|
83
|
-
})
|
|
84
|
-
// value === "usePrograms:confirmed"
|
|
85
|
-
```
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://overlastic.vercel.app/" target="blank">
|
|
3
|
+
<img src="https://github.com/hairyf/overlastic/raw/master/docs/public/circle.svg" width="120" alt="Nest Logo" />
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
A create modal | dialog | popup promise deferred library
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="https://www.npmjs.com/@overlastic/vue2"><img src="https://img.shields.io/npm/v/@overlastic/vue2.svg" alt="NPM Version" /></a>
|
|
13
|
+
<a href="https://www.npmjs.com/@overlastic/vue2"><img src="https://img.shields.io/npm/l/@overlastic/vue2.svg" alt="Package License" /></a>
|
|
14
|
+
<a href="https://www.npmjs.com/@overlastic/vue2"><img src="https://img.shields.io/npm/dm/@overlastic/vue2.svg" alt="NPM Downloads" /></a>
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
## Description
|
|
18
|
+
|
|
19
|
+
Create messages or dialog overlays using Overlastic in Vue2 APP.
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
$ npm install --save @overlastic/vue2
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Quick Start
|
|
28
|
+
|
|
29
|
+
[Overview & Tutorial](https://overlastic.vercel.app/en/vue/vue2)
|
package/dist/index.cjs
CHANGED
|
@@ -35,7 +35,7 @@ __export(src_exports, {
|
|
|
35
35
|
defineOverlay: () => defineOverlay,
|
|
36
36
|
install: () => install,
|
|
37
37
|
renderOverlay: () => renderOverlay,
|
|
38
|
-
|
|
38
|
+
useOverlayDefine: () => useOverlayDefine
|
|
39
39
|
});
|
|
40
40
|
module.exports = __toCommonJS(src_exports);
|
|
41
41
|
|
|
@@ -46,7 +46,7 @@ var context = {
|
|
|
46
46
|
};
|
|
47
47
|
var ScriptsInjectionKey = "$overlay";
|
|
48
48
|
|
|
49
|
-
// src/composable/
|
|
49
|
+
// src/composable/create.ts
|
|
50
50
|
var import_mitt = __toESM(require("mitt"), 1);
|
|
51
51
|
function createVisibleScripts(options) {
|
|
52
52
|
const { reject: _reject, resolve: _resolve } = options.deferred || {};
|
|
@@ -79,10 +79,10 @@ function createVisibleScripts(options) {
|
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
// src/composable/
|
|
82
|
+
// src/composable/define.ts
|
|
83
83
|
var import_core = require("@overlastic/core");
|
|
84
84
|
var import_vue2 = __toESM(require("vue"), 1);
|
|
85
|
-
function
|
|
85
|
+
function useOverlayDefine(options = {}) {
|
|
86
86
|
const { duration = 0, immediate = true, model = "visible", automatic = true, events = {} } = options;
|
|
87
87
|
events.reject = events.reject || "reject";
|
|
88
88
|
events.resolve = events.resolve || "resolve";
|
|
@@ -141,14 +141,14 @@ var import_vue3 = __toESM(require("vue"), 1);
|
|
|
141
141
|
var constructor = (0, import_core2.createConstructor)((Inst, props, options) => {
|
|
142
142
|
const { container, id, deferred } = options;
|
|
143
143
|
function vanish() {
|
|
144
|
-
|
|
144
|
+
app.$destroy();
|
|
145
145
|
container.remove();
|
|
146
146
|
}
|
|
147
147
|
const $overlay = createVisibleScripts({
|
|
148
148
|
deferred,
|
|
149
149
|
vanish
|
|
150
150
|
});
|
|
151
|
-
const
|
|
151
|
+
const app = new import_vue3.default({
|
|
152
152
|
name: (0, import_pascal_case.pascalCase)(id),
|
|
153
153
|
parent: options.parent,
|
|
154
154
|
provide: () => ({ $overlay }),
|
|
@@ -156,7 +156,7 @@ var constructor = (0, import_core2.createConstructor)((Inst, props, options) =>
|
|
|
156
156
|
});
|
|
157
157
|
const child = document.createElement("div");
|
|
158
158
|
container.appendChild(child);
|
|
159
|
-
|
|
159
|
+
app.$mount(child);
|
|
160
160
|
});
|
|
161
161
|
|
|
162
162
|
// src/define/index.ts
|
|
@@ -175,10 +175,10 @@ var Field = {
|
|
|
175
175
|
};
|
|
176
176
|
|
|
177
177
|
// src/index.ts
|
|
178
|
-
|
|
178
|
+
function install(_ins, parent) {
|
|
179
179
|
if (parent)
|
|
180
180
|
context.parent = parent;
|
|
181
|
-
}
|
|
181
|
+
}
|
|
182
182
|
var unoverlay = { install };
|
|
183
183
|
var src_default = unoverlay;
|
|
184
184
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -187,5 +187,5 @@ var src_default = unoverlay;
|
|
|
187
187
|
defineOverlay,
|
|
188
188
|
install,
|
|
189
189
|
renderOverlay,
|
|
190
|
-
|
|
190
|
+
useOverlayDefine
|
|
191
191
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -17,7 +17,7 @@ interface PromptifyEvents {
|
|
|
17
17
|
*/
|
|
18
18
|
resolve?: string;
|
|
19
19
|
}
|
|
20
|
-
interface
|
|
20
|
+
interface OverlayDefineOptions {
|
|
21
21
|
/** duration duration to avoid premature destruction of components */
|
|
22
22
|
duration?: number;
|
|
23
23
|
/** whether to set visible to true immediately */
|
|
@@ -39,7 +39,7 @@ interface ProgramsOptions {
|
|
|
39
39
|
*/
|
|
40
40
|
automatic?: boolean;
|
|
41
41
|
}
|
|
42
|
-
declare function
|
|
42
|
+
declare function useOverlayDefine(options?: OverlayDefineOptions): vue_types_vue.ExtendedVue<Vue__default, {
|
|
43
43
|
runtime_visible: boolean;
|
|
44
44
|
} | {
|
|
45
45
|
runtime_visible?: undefined;
|
|
@@ -63,7 +63,7 @@ declare const renderOverlay: <Props, Resolved = void>(instance: Vue.Component, p
|
|
|
63
63
|
|
|
64
64
|
declare const Field: Component;
|
|
65
65
|
|
|
66
|
-
declare
|
|
66
|
+
declare function install(_ins: any, parent: any): void;
|
|
67
67
|
declare const unoverlay: PluginObject<Vue__default>;
|
|
68
68
|
|
|
69
|
-
export { Field, type
|
|
69
|
+
export { Field, type OverlayDefineOptions, unoverlay as default, defineOverlay, install, renderOverlay, useOverlayDefine };
|
package/dist/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ interface PromptifyEvents {
|
|
|
17
17
|
*/
|
|
18
18
|
resolve?: string;
|
|
19
19
|
}
|
|
20
|
-
interface
|
|
20
|
+
interface OverlayDefineOptions {
|
|
21
21
|
/** duration duration to avoid premature destruction of components */
|
|
22
22
|
duration?: number;
|
|
23
23
|
/** whether to set visible to true immediately */
|
|
@@ -39,7 +39,7 @@ interface ProgramsOptions {
|
|
|
39
39
|
*/
|
|
40
40
|
automatic?: boolean;
|
|
41
41
|
}
|
|
42
|
-
declare function
|
|
42
|
+
declare function useOverlayDefine(options?: OverlayDefineOptions): vue_types_vue.ExtendedVue<Vue__default, {
|
|
43
43
|
runtime_visible: boolean;
|
|
44
44
|
} | {
|
|
45
45
|
runtime_visible?: undefined;
|
|
@@ -63,7 +63,7 @@ declare const renderOverlay: <Props, Resolved = void>(instance: Vue.Component, p
|
|
|
63
63
|
|
|
64
64
|
declare const Field: Component;
|
|
65
65
|
|
|
66
|
-
declare
|
|
66
|
+
declare function install(_ins: any, parent: any): void;
|
|
67
67
|
declare const unoverlay: PluginObject<Vue__default>;
|
|
68
68
|
|
|
69
|
-
export { Field, type
|
|
69
|
+
export { Field, type OverlayDefineOptions, unoverlay as default, defineOverlay, install, renderOverlay, useOverlayDefine };
|
package/dist/index.global.js
CHANGED
|
@@ -26,7 +26,7 @@ var OverlaysVue = (() => {
|
|
|
26
26
|
defineOverlay: () => defineOverlay,
|
|
27
27
|
install: () => install,
|
|
28
28
|
renderOverlay: () => renderOverlay,
|
|
29
|
-
|
|
29
|
+
useOverlayDefine: () => useOverlayDefine
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
// ../../node_modules/.pnpm/vue@2.6.0/node_modules/vue/dist/vue.runtime.esm.js
|
|
@@ -6068,7 +6068,7 @@ var OverlaysVue = (() => {
|
|
|
6068
6068
|
} };
|
|
6069
6069
|
}
|
|
6070
6070
|
|
|
6071
|
-
// src/composable/
|
|
6071
|
+
// src/composable/create.ts
|
|
6072
6072
|
function createVisibleScripts(options) {
|
|
6073
6073
|
const { reject: _reject, resolve: _resolve } = options.deferred || {};
|
|
6074
6074
|
const { vanish: _vanish } = options;
|
|
@@ -6164,14 +6164,15 @@ var OverlaysVue = (() => {
|
|
|
6164
6164
|
}
|
|
6165
6165
|
|
|
6166
6166
|
// ../@core/src/constructor.ts
|
|
6167
|
-
function createConstructor(mount) {
|
|
6168
|
-
|
|
6169
|
-
|
|
6167
|
+
function createConstructor(mount, options = {}) {
|
|
6168
|
+
const { container: globalContainer } = options;
|
|
6169
|
+
function define(instance, options2) {
|
|
6170
|
+
function executor(props2, options3) {
|
|
6170
6171
|
const deferred = createDeferred();
|
|
6171
|
-
const name = defineName(
|
|
6172
|
-
const index2 = getIndex(
|
|
6173
|
-
const container = defineGlobalElement(name,
|
|
6174
|
-
mount(instance, props2, Object.assign(
|
|
6172
|
+
const name = defineName(options3.id, options3.autoIncrement);
|
|
6173
|
+
const index2 = getIndex(options3.id);
|
|
6174
|
+
const container = globalContainer ? defineGlobalElement(name, options3.root) : document.body;
|
|
6175
|
+
mount(instance, props2, Object.assign(options3, {
|
|
6175
6176
|
position: context2.position,
|
|
6176
6177
|
id: name,
|
|
6177
6178
|
deferred,
|
|
@@ -6181,21 +6182,21 @@ var OverlaysVue = (() => {
|
|
|
6181
6182
|
return deferred;
|
|
6182
6183
|
}
|
|
6183
6184
|
let inst;
|
|
6184
|
-
function only(props2,
|
|
6185
|
+
function only(props2, options3) {
|
|
6185
6186
|
if (!inst) {
|
|
6186
|
-
inst = executor(props2,
|
|
6187
|
+
inst = executor(props2, options3);
|
|
6187
6188
|
inst.finally(() => inst = void 0);
|
|
6188
6189
|
}
|
|
6189
6190
|
return inst;
|
|
6190
6191
|
}
|
|
6191
6192
|
function caller(props2, overrides) {
|
|
6192
|
-
const opts = { ...
|
|
6193
|
+
const opts = { ...options2, ...overrides };
|
|
6193
6194
|
return opts.only ? only(props2, opts) : executor(props2, opts);
|
|
6194
6195
|
}
|
|
6195
6196
|
return caller;
|
|
6196
6197
|
}
|
|
6197
|
-
function render4(instance, props2,
|
|
6198
|
-
return define(instance,
|
|
6198
|
+
function render4(instance, props2, options2) {
|
|
6199
|
+
return define(instance, options2)(props2);
|
|
6199
6200
|
}
|
|
6200
6201
|
return { define, render: render4 };
|
|
6201
6202
|
}
|
|
@@ -6206,8 +6207,8 @@ var OverlaysVue = (() => {
|
|
|
6206
6207
|
return new Promise((resolve) => setTimeout(resolve, milliseconds));
|
|
6207
6208
|
}
|
|
6208
6209
|
|
|
6209
|
-
// src/composable/
|
|
6210
|
-
function
|
|
6210
|
+
// src/composable/define.ts
|
|
6211
|
+
function useOverlayDefine(options = {}) {
|
|
6211
6212
|
const { duration = 0, immediate = true, model = "visible", automatic = true, events: events2 = {} } = options;
|
|
6212
6213
|
events2.reject = events2.reject || "reject";
|
|
6213
6214
|
events2.resolve = events2.resolve || "resolve";
|
|
@@ -6323,14 +6324,14 @@ var OverlaysVue = (() => {
|
|
|
6323
6324
|
var constructor = createConstructor((Inst, props2, options) => {
|
|
6324
6325
|
const { container, id, deferred } = options;
|
|
6325
6326
|
function vanish() {
|
|
6326
|
-
|
|
6327
|
+
app.$destroy();
|
|
6327
6328
|
container.remove();
|
|
6328
6329
|
}
|
|
6329
6330
|
const $overlay = createVisibleScripts({
|
|
6330
6331
|
deferred,
|
|
6331
6332
|
vanish
|
|
6332
6333
|
});
|
|
6333
|
-
const
|
|
6334
|
+
const app = new vue_runtime_esm_default({
|
|
6334
6335
|
name: pascalCase(id),
|
|
6335
6336
|
parent: options.parent,
|
|
6336
6337
|
provide: () => ({ $overlay }),
|
|
@@ -6338,7 +6339,7 @@ var OverlaysVue = (() => {
|
|
|
6338
6339
|
});
|
|
6339
6340
|
const child = document.createElement("div");
|
|
6340
6341
|
container.appendChild(child);
|
|
6341
|
-
|
|
6342
|
+
app.$mount(child);
|
|
6342
6343
|
});
|
|
6343
6344
|
|
|
6344
6345
|
// src/define/index.ts
|
|
@@ -6357,10 +6358,10 @@ var OverlaysVue = (() => {
|
|
|
6357
6358
|
};
|
|
6358
6359
|
|
|
6359
6360
|
// src/index.ts
|
|
6360
|
-
|
|
6361
|
+
function install(_ins, parent) {
|
|
6361
6362
|
if (parent)
|
|
6362
6363
|
context.parent = parent;
|
|
6363
|
-
}
|
|
6364
|
+
}
|
|
6364
6365
|
var unoverlay = { install };
|
|
6365
6366
|
var src_default = unoverlay;
|
|
6366
6367
|
return __toCommonJS(src_exports);
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ var context = {
|
|
|
5
5
|
};
|
|
6
6
|
var ScriptsInjectionKey = "$overlay";
|
|
7
7
|
|
|
8
|
-
// src/composable/
|
|
8
|
+
// src/composable/create.ts
|
|
9
9
|
import mitt from "mitt";
|
|
10
10
|
function createVisibleScripts(options) {
|
|
11
11
|
const { reject: _reject, resolve: _resolve } = options.deferred || {};
|
|
@@ -38,10 +38,10 @@ function createVisibleScripts(options) {
|
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
// src/composable/
|
|
41
|
+
// src/composable/define.ts
|
|
42
42
|
import { delay } from "@overlastic/core";
|
|
43
43
|
import Vue2 from "vue";
|
|
44
|
-
function
|
|
44
|
+
function useOverlayDefine(options = {}) {
|
|
45
45
|
const { duration = 0, immediate = true, model = "visible", automatic = true, events = {} } = options;
|
|
46
46
|
events.reject = events.reject || "reject";
|
|
47
47
|
events.resolve = events.resolve || "resolve";
|
|
@@ -100,14 +100,14 @@ import Vue3 from "vue";
|
|
|
100
100
|
var constructor = createConstructor((Inst, props, options) => {
|
|
101
101
|
const { container, id, deferred } = options;
|
|
102
102
|
function vanish() {
|
|
103
|
-
|
|
103
|
+
app.$destroy();
|
|
104
104
|
container.remove();
|
|
105
105
|
}
|
|
106
106
|
const $overlay = createVisibleScripts({
|
|
107
107
|
deferred,
|
|
108
108
|
vanish
|
|
109
109
|
});
|
|
110
|
-
const
|
|
110
|
+
const app = new Vue3({
|
|
111
111
|
name: pascalCase(id),
|
|
112
112
|
parent: options.parent,
|
|
113
113
|
provide: () => ({ $overlay }),
|
|
@@ -115,7 +115,7 @@ var constructor = createConstructor((Inst, props, options) => {
|
|
|
115
115
|
});
|
|
116
116
|
const child = document.createElement("div");
|
|
117
117
|
container.appendChild(child);
|
|
118
|
-
|
|
118
|
+
app.$mount(child);
|
|
119
119
|
});
|
|
120
120
|
|
|
121
121
|
// src/define/index.ts
|
|
@@ -134,10 +134,10 @@ var Field = {
|
|
|
134
134
|
};
|
|
135
135
|
|
|
136
136
|
// src/index.ts
|
|
137
|
-
|
|
137
|
+
function install(_ins, parent) {
|
|
138
138
|
if (parent)
|
|
139
139
|
context.parent = parent;
|
|
140
|
-
}
|
|
140
|
+
}
|
|
141
141
|
var unoverlay = { install };
|
|
142
142
|
var src_default = unoverlay;
|
|
143
143
|
export {
|
|
@@ -146,5 +146,5 @@ export {
|
|
|
146
146
|
defineOverlay,
|
|
147
147
|
install,
|
|
148
148
|
renderOverlay,
|
|
149
|
-
|
|
149
|
+
useOverlayDefine
|
|
150
150
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@overlastic/vue2",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.5.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/hairyf/overlastic#readme",
|
|
7
7
|
"repository": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"mitt": "^3.0.1",
|
|
32
32
|
"pascal-case": "3.1.2",
|
|
33
|
-
"@overlastic/core": "^0.
|
|
33
|
+
"@overlastic/core": "^0.5.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"vue": "^2.6"
|