@overlastic/vue2 0.8.1 → 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 +38 -38
- package/dist/index.d.cts +15 -15
- package/dist/index.d.ts +15 -15
- package/dist/index.global.js +62 -66
- package/dist/index.js +34 -34
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -28,16 +28,16 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
|
|
30
30
|
// src/index.ts
|
|
31
|
-
var
|
|
32
|
-
__export(
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
33
|
Field: () => Field,
|
|
34
|
-
default: () =>
|
|
34
|
+
default: () => index_default,
|
|
35
35
|
defineOverlay: () => defineOverlay,
|
|
36
36
|
install: () => install,
|
|
37
37
|
renderOverlay: () => renderOverlay,
|
|
38
|
-
|
|
38
|
+
useDisclosure: () => useDisclosure
|
|
39
39
|
});
|
|
40
|
-
module.exports = __toCommonJS(
|
|
40
|
+
module.exports = __toCommonJS(index_exports);
|
|
41
41
|
|
|
42
42
|
// src/internal/index.ts
|
|
43
43
|
var import_vue = __toESM(require("vue"), 1);
|
|
@@ -46,34 +46,45 @@ var context = {
|
|
|
46
46
|
};
|
|
47
47
|
var ScriptsInjectionKey = "$overlay";
|
|
48
48
|
|
|
49
|
+
// src/components/index.ts
|
|
50
|
+
var Field = {
|
|
51
|
+
name: "Field",
|
|
52
|
+
props: {
|
|
53
|
+
value: [String, Object]
|
|
54
|
+
},
|
|
55
|
+
render(h) {
|
|
56
|
+
return h(this.value);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
49
60
|
// src/composable/create.ts
|
|
50
61
|
var import_mitt = __toESM(require("mitt"), 1);
|
|
51
62
|
function createVisibleScripts(options) {
|
|
52
|
-
const {
|
|
63
|
+
const { cancel: _cancel, confirm: _confirm } = options.deferred || {};
|
|
53
64
|
const { vanish: _vanish } = options;
|
|
54
65
|
const { on, off, emit } = (0, import_mitt.default)();
|
|
55
|
-
function
|
|
56
|
-
emit("
|
|
57
|
-
|
|
66
|
+
function cancel(value) {
|
|
67
|
+
emit("cancel", value);
|
|
68
|
+
_cancel == null ? void 0 : _cancel(value);
|
|
58
69
|
}
|
|
59
|
-
function
|
|
70
|
+
function confirm(value) {
|
|
60
71
|
var _a;
|
|
61
|
-
(_a = options.deferred) == null ? void 0 : _a.
|
|
62
|
-
emit("
|
|
63
|
-
return
|
|
72
|
+
(_a = options.deferred) == null ? void 0 : _a.confirm(value);
|
|
73
|
+
emit("confirm", value);
|
|
74
|
+
return _confirm == null ? void 0 : _confirm(value);
|
|
64
75
|
}
|
|
65
76
|
function vanish() {
|
|
66
77
|
_vanish == null ? void 0 : _vanish();
|
|
67
|
-
|
|
78
|
+
cancel();
|
|
68
79
|
off("*");
|
|
69
80
|
}
|
|
70
81
|
if (options.deferred) {
|
|
71
|
-
options.deferred.
|
|
72
|
-
options.deferred.
|
|
82
|
+
options.deferred.confirm = confirm;
|
|
83
|
+
options.deferred.cancel = cancel;
|
|
73
84
|
}
|
|
74
85
|
return {
|
|
75
|
-
|
|
76
|
-
|
|
86
|
+
confirm,
|
|
87
|
+
cancel,
|
|
77
88
|
vanish,
|
|
78
89
|
on
|
|
79
90
|
};
|
|
@@ -82,10 +93,10 @@ function createVisibleScripts(options) {
|
|
|
82
93
|
// src/composable/define.ts
|
|
83
94
|
var import_core = require("@overlastic/core");
|
|
84
95
|
var import_vue2 = __toESM(require("vue"), 1);
|
|
85
|
-
function
|
|
96
|
+
function useDisclosure(options = {}) {
|
|
86
97
|
const { duration = 0, immediate = true, model = "visible", automatic = true, events = {} } = options;
|
|
87
|
-
events.
|
|
88
|
-
events.
|
|
98
|
+
events.confirm = events.confirm || "confirm";
|
|
99
|
+
events.cancel = events.cancel || "cancel";
|
|
89
100
|
const mixinOptions = import_vue2.default.extend({
|
|
90
101
|
inject: [ScriptsInjectionKey],
|
|
91
102
|
model: {
|
|
@@ -121,13 +132,13 @@ function useExtendOverlay(options = {}) {
|
|
|
121
132
|
this.$emit(events[type], value);
|
|
122
133
|
this.$visible = false;
|
|
123
134
|
},
|
|
124
|
-
async $
|
|
135
|
+
async $cancel(value) {
|
|
125
136
|
var _a;
|
|
126
|
-
(_a = this.$overlay) == null ? void 0 : _a.
|
|
137
|
+
(_a = this.$overlay) == null ? void 0 : _a.cancel(value);
|
|
127
138
|
},
|
|
128
|
-
async $
|
|
139
|
+
async $confirm(value) {
|
|
129
140
|
var _a;
|
|
130
|
-
(_a = this.$overlay) == null ? void 0 : _a.
|
|
141
|
+
(_a = this.$overlay) == null ? void 0 : _a.confirm(value);
|
|
131
142
|
}
|
|
132
143
|
}
|
|
133
144
|
});
|
|
@@ -163,29 +174,18 @@ var constructor = (0, import_core2.createConstructor)((Inst, props, options) =>
|
|
|
163
174
|
var defineOverlay = constructor.define;
|
|
164
175
|
var renderOverlay = constructor.render;
|
|
165
176
|
|
|
166
|
-
// src/components/index.ts
|
|
167
|
-
var Field = {
|
|
168
|
-
name: "Field",
|
|
169
|
-
props: {
|
|
170
|
-
value: [String, Object]
|
|
171
|
-
},
|
|
172
|
-
render(h) {
|
|
173
|
-
return h(this.value);
|
|
174
|
-
}
|
|
175
|
-
};
|
|
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
|
-
var
|
|
183
|
+
var index_default = unoverlay;
|
|
184
184
|
// Annotate the CommonJS export names for ESM import in node:
|
|
185
185
|
0 && (module.exports = {
|
|
186
186
|
Field,
|
|
187
187
|
defineOverlay,
|
|
188
188
|
install,
|
|
189
189
|
renderOverlay,
|
|
190
|
-
|
|
190
|
+
useDisclosure
|
|
191
191
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -3,21 +3,23 @@ import Vue__default, { Component, PluginObject } from 'vue';
|
|
|
3
3
|
import * as vue_types_vue from 'vue/types/vue';
|
|
4
4
|
import * as _overlastic_core from '@overlastic/core';
|
|
5
5
|
|
|
6
|
+
declare const Field: Component;
|
|
7
|
+
|
|
6
8
|
interface PromptifyEvents {
|
|
7
9
|
/**
|
|
8
|
-
*
|
|
10
|
+
* confirm event name used by the template
|
|
9
11
|
*
|
|
10
|
-
* @default '
|
|
12
|
+
* @default 'confirm'
|
|
11
13
|
*/
|
|
12
|
-
|
|
14
|
+
cancel?: string;
|
|
13
15
|
/**
|
|
14
|
-
*
|
|
16
|
+
* cancel event name used by the template
|
|
15
17
|
*
|
|
16
|
-
* @default '
|
|
18
|
+
* @default 'cancel'
|
|
17
19
|
*/
|
|
18
|
-
|
|
20
|
+
confirm?: string;
|
|
19
21
|
}
|
|
20
|
-
interface
|
|
22
|
+
interface UseDisclosureOptions {
|
|
21
23
|
/** duration duration to avoid premature destruction of components */
|
|
22
24
|
duration?: number;
|
|
23
25
|
/** whether to set visible to true immediately */
|
|
@@ -39,18 +41,18 @@ interface ExtendOverlayOptions {
|
|
|
39
41
|
*/
|
|
40
42
|
automatic?: boolean;
|
|
41
43
|
}
|
|
42
|
-
declare function
|
|
44
|
+
declare function useDisclosure(options?: UseDisclosureOptions): vue_types_vue.ExtendedVue<Vue__default, {
|
|
43
45
|
runtime_visible: boolean;
|
|
44
46
|
} | {
|
|
45
47
|
runtime_visible?: undefined;
|
|
46
48
|
}, {
|
|
47
|
-
$runtime_effect(type:
|
|
48
|
-
$
|
|
49
|
-
$
|
|
49
|
+
$runtime_effect(type: "confirm" | "cancel", value: any): Promise<void>;
|
|
50
|
+
$cancel(value: any): Promise<void>;
|
|
51
|
+
$confirm(value: any): Promise<void>;
|
|
50
52
|
}, {
|
|
51
53
|
$visible: any;
|
|
52
54
|
}, {
|
|
53
|
-
[x: string]: any;
|
|
55
|
+
[x: string]: /*elided*/ any;
|
|
54
56
|
}>;
|
|
55
57
|
|
|
56
58
|
interface VMountOptions {
|
|
@@ -61,9 +63,7 @@ interface VMountOptions {
|
|
|
61
63
|
declare const defineOverlay: <Props, Resolved = void>(instance: Vue.Component, options?: _overlastic_core.MountOptions<VMountOptions> | undefined) => _overlastic_core.ImperativeOverlay<Props, Resolved, VMountOptions>;
|
|
62
64
|
declare const renderOverlay: <Props, Resolved = void>(instance: Vue.Component, props?: Props | undefined, options?: _overlastic_core.MountOptions<VMountOptions> | undefined) => Promise<Resolved>;
|
|
63
65
|
|
|
64
|
-
declare const Field: Component;
|
|
65
|
-
|
|
66
66
|
declare function install(_ins: any, parent: any): void;
|
|
67
67
|
declare const unoverlay: PluginObject<Vue__default>;
|
|
68
68
|
|
|
69
|
-
export { type
|
|
69
|
+
export { Field, type UseDisclosureOptions, unoverlay as default, defineOverlay, install, renderOverlay, useDisclosure };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,21 +3,23 @@ import Vue__default, { Component, PluginObject } from 'vue';
|
|
|
3
3
|
import * as vue_types_vue from 'vue/types/vue';
|
|
4
4
|
import * as _overlastic_core from '@overlastic/core';
|
|
5
5
|
|
|
6
|
+
declare const Field: Component;
|
|
7
|
+
|
|
6
8
|
interface PromptifyEvents {
|
|
7
9
|
/**
|
|
8
|
-
*
|
|
10
|
+
* confirm event name used by the template
|
|
9
11
|
*
|
|
10
|
-
* @default '
|
|
12
|
+
* @default 'confirm'
|
|
11
13
|
*/
|
|
12
|
-
|
|
14
|
+
cancel?: string;
|
|
13
15
|
/**
|
|
14
|
-
*
|
|
16
|
+
* cancel event name used by the template
|
|
15
17
|
*
|
|
16
|
-
* @default '
|
|
18
|
+
* @default 'cancel'
|
|
17
19
|
*/
|
|
18
|
-
|
|
20
|
+
confirm?: string;
|
|
19
21
|
}
|
|
20
|
-
interface
|
|
22
|
+
interface UseDisclosureOptions {
|
|
21
23
|
/** duration duration to avoid premature destruction of components */
|
|
22
24
|
duration?: number;
|
|
23
25
|
/** whether to set visible to true immediately */
|
|
@@ -39,18 +41,18 @@ interface ExtendOverlayOptions {
|
|
|
39
41
|
*/
|
|
40
42
|
automatic?: boolean;
|
|
41
43
|
}
|
|
42
|
-
declare function
|
|
44
|
+
declare function useDisclosure(options?: UseDisclosureOptions): vue_types_vue.ExtendedVue<Vue__default, {
|
|
43
45
|
runtime_visible: boolean;
|
|
44
46
|
} | {
|
|
45
47
|
runtime_visible?: undefined;
|
|
46
48
|
}, {
|
|
47
|
-
$runtime_effect(type:
|
|
48
|
-
$
|
|
49
|
-
$
|
|
49
|
+
$runtime_effect(type: "confirm" | "cancel", value: any): Promise<void>;
|
|
50
|
+
$cancel(value: any): Promise<void>;
|
|
51
|
+
$confirm(value: any): Promise<void>;
|
|
50
52
|
}, {
|
|
51
53
|
$visible: any;
|
|
52
54
|
}, {
|
|
53
|
-
[x: string]: any;
|
|
55
|
+
[x: string]: /*elided*/ any;
|
|
54
56
|
}>;
|
|
55
57
|
|
|
56
58
|
interface VMountOptions {
|
|
@@ -61,9 +63,7 @@ interface VMountOptions {
|
|
|
61
63
|
declare const defineOverlay: <Props, Resolved = void>(instance: Vue.Component, options?: _overlastic_core.MountOptions<VMountOptions> | undefined) => _overlastic_core.ImperativeOverlay<Props, Resolved, VMountOptions>;
|
|
62
64
|
declare const renderOverlay: <Props, Resolved = void>(instance: Vue.Component, props?: Props | undefined, options?: _overlastic_core.MountOptions<VMountOptions> | undefined) => Promise<Resolved>;
|
|
63
65
|
|
|
64
|
-
declare const Field: Component;
|
|
65
|
-
|
|
66
66
|
declare function install(_ins: any, parent: any): void;
|
|
67
67
|
declare const unoverlay: PluginObject<Vue__default>;
|
|
68
68
|
|
|
69
|
-
export { type
|
|
69
|
+
export { Field, type UseDisclosureOptions, unoverlay as default, defineOverlay, install, renderOverlay, useDisclosure };
|
package/dist/index.global.js
CHANGED
|
@@ -19,14 +19,14 @@ var OverlaysVue = (() => {
|
|
|
19
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
20
|
|
|
21
21
|
// src/index.ts
|
|
22
|
-
var
|
|
23
|
-
__export(
|
|
22
|
+
var index_exports = {};
|
|
23
|
+
__export(index_exports, {
|
|
24
24
|
Field: () => Field,
|
|
25
|
-
default: () =>
|
|
25
|
+
default: () => index_default,
|
|
26
26
|
defineOverlay: () => defineOverlay,
|
|
27
27
|
install: () => install,
|
|
28
28
|
renderOverlay: () => renderOverlay,
|
|
29
|
-
|
|
29
|
+
useDisclosure: () => useDisclosure
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
// ../../node_modules/.pnpm/vue@2.6.0/node_modules/vue/dist/vue.runtime.esm.js
|
|
@@ -554,8 +554,7 @@ var OverlaysVue = (() => {
|
|
|
554
554
|
};
|
|
555
555
|
Object.defineProperties(VNode.prototype, prototypeAccessors);
|
|
556
556
|
var createEmptyVNode = function(text) {
|
|
557
|
-
if (text === void 0)
|
|
558
|
-
text = "";
|
|
557
|
+
if (text === void 0) text = "";
|
|
559
558
|
var node = new VNode();
|
|
560
559
|
node.text = text;
|
|
561
560
|
node.isComment = true;
|
|
@@ -604,8 +603,7 @@ var OverlaysVue = (() => {
|
|
|
604
603
|
var original = arrayProto[method];
|
|
605
604
|
def(arrayMethods, method, function mutator() {
|
|
606
605
|
var args = [], len = arguments.length;
|
|
607
|
-
while (len--)
|
|
608
|
-
args[len] = arguments[len];
|
|
606
|
+
while (len--) args[len] = arguments[len];
|
|
609
607
|
var result = original.apply(this, args);
|
|
610
608
|
var ob = this.__ob__;
|
|
611
609
|
var inserted2;
|
|
@@ -1244,8 +1242,7 @@ var OverlaysVue = (() => {
|
|
|
1244
1242
|
}
|
|
1245
1243
|
function isBoolean() {
|
|
1246
1244
|
var args = [], len = arguments.length;
|
|
1247
|
-
while (len--)
|
|
1248
|
-
args[len] = arguments[len];
|
|
1245
|
+
while (len--) args[len] = arguments[len];
|
|
1249
1246
|
return args.some(function(elem) {
|
|
1250
1247
|
return elem.toLowerCase() === "boolean";
|
|
1251
1248
|
});
|
|
@@ -2503,8 +2500,7 @@ var OverlaysVue = (() => {
|
|
|
2503
2500
|
proxy(vm, "_props", key2);
|
|
2504
2501
|
}
|
|
2505
2502
|
};
|
|
2506
|
-
for (var key in propsOptions)
|
|
2507
|
-
loop(key);
|
|
2503
|
+
for (var key in propsOptions) loop(key);
|
|
2508
2504
|
toggleObserving(true);
|
|
2509
2505
|
}
|
|
2510
2506
|
function initData(vm) {
|
|
@@ -2918,8 +2914,7 @@ var OverlaysVue = (() => {
|
|
|
2918
2914
|
}
|
|
2919
2915
|
}
|
|
2920
2916
|
};
|
|
2921
|
-
for (var key in value)
|
|
2922
|
-
loop(key);
|
|
2917
|
+
for (var key in value) loop(key);
|
|
2923
2918
|
}
|
|
2924
2919
|
}
|
|
2925
2920
|
return data;
|
|
@@ -6050,6 +6045,17 @@ var OverlaysVue = (() => {
|
|
|
6050
6045
|
};
|
|
6051
6046
|
var ScriptsInjectionKey = "$overlay";
|
|
6052
6047
|
|
|
6048
|
+
// src/components/index.ts
|
|
6049
|
+
var Field = {
|
|
6050
|
+
name: "Field",
|
|
6051
|
+
props: {
|
|
6052
|
+
value: [String, Object]
|
|
6053
|
+
},
|
|
6054
|
+
render(h) {
|
|
6055
|
+
return h(this.value);
|
|
6056
|
+
}
|
|
6057
|
+
};
|
|
6058
|
+
|
|
6053
6059
|
// ../../node_modules/.pnpm/mitt@3.0.1/node_modules/mitt/dist/mitt.mjs
|
|
6054
6060
|
function mitt_default(n) {
|
|
6055
6061
|
return { all: n = n || /* @__PURE__ */ new Map(), on: function(t, e) {
|
|
@@ -6070,36 +6076,54 @@ var OverlaysVue = (() => {
|
|
|
6070
6076
|
|
|
6071
6077
|
// src/composable/create.ts
|
|
6072
6078
|
function createVisibleScripts(options) {
|
|
6073
|
-
const {
|
|
6079
|
+
const { cancel: _cancel, confirm: _confirm } = options.deferred || {};
|
|
6074
6080
|
const { vanish: _vanish } = options;
|
|
6075
6081
|
const { on, off, emit } = mitt_default();
|
|
6076
|
-
function
|
|
6077
|
-
emit("
|
|
6078
|
-
|
|
6082
|
+
function cancel(value) {
|
|
6083
|
+
emit("cancel", value);
|
|
6084
|
+
_cancel == null ? void 0 : _cancel(value);
|
|
6079
6085
|
}
|
|
6080
|
-
function
|
|
6086
|
+
function confirm(value) {
|
|
6081
6087
|
var _a;
|
|
6082
|
-
(_a = options.deferred) == null ? void 0 : _a.
|
|
6083
|
-
emit("
|
|
6084
|
-
return
|
|
6088
|
+
(_a = options.deferred) == null ? void 0 : _a.confirm(value);
|
|
6089
|
+
emit("confirm", value);
|
|
6090
|
+
return _confirm == null ? void 0 : _confirm(value);
|
|
6085
6091
|
}
|
|
6086
6092
|
function vanish() {
|
|
6087
6093
|
_vanish == null ? void 0 : _vanish();
|
|
6088
|
-
|
|
6094
|
+
cancel();
|
|
6089
6095
|
off("*");
|
|
6090
6096
|
}
|
|
6091
6097
|
if (options.deferred) {
|
|
6092
|
-
options.deferred.
|
|
6093
|
-
options.deferred.
|
|
6098
|
+
options.deferred.confirm = confirm;
|
|
6099
|
+
options.deferred.cancel = cancel;
|
|
6094
6100
|
}
|
|
6095
6101
|
return {
|
|
6096
|
-
|
|
6097
|
-
|
|
6102
|
+
confirm,
|
|
6103
|
+
cancel,
|
|
6098
6104
|
vanish,
|
|
6099
6105
|
on
|
|
6100
6106
|
};
|
|
6101
6107
|
}
|
|
6102
6108
|
|
|
6109
|
+
// ../@core/src/deferred.ts
|
|
6110
|
+
function createDeferred() {
|
|
6111
|
+
let confirm, cancel;
|
|
6112
|
+
const promise = new Promise((_confirm, _cancel) => {
|
|
6113
|
+
confirm = _confirm;
|
|
6114
|
+
cancel = _cancel;
|
|
6115
|
+
});
|
|
6116
|
+
promise.confirm = (v) => {
|
|
6117
|
+
confirm(v);
|
|
6118
|
+
return promise;
|
|
6119
|
+
};
|
|
6120
|
+
promise.close = () => {
|
|
6121
|
+
confirm();
|
|
6122
|
+
};
|
|
6123
|
+
promise.cancel = cancel;
|
|
6124
|
+
return promise;
|
|
6125
|
+
}
|
|
6126
|
+
|
|
6103
6127
|
// ../@core/src/define/global.ts
|
|
6104
6128
|
var UnifiedOverlayProviderID = "unified-overlay";
|
|
6105
6129
|
function defineGlobalElement(id = "", root = document.body) {
|
|
@@ -6129,21 +6153,6 @@ var OverlaysVue = (() => {
|
|
|
6129
6153
|
return context2.spaces[id] || 0;
|
|
6130
6154
|
}
|
|
6131
6155
|
|
|
6132
|
-
// ../@core/src/deferred.ts
|
|
6133
|
-
function createDeferred() {
|
|
6134
|
-
let resolve, reject;
|
|
6135
|
-
const promise = new Promise((_resolve, _reject) => {
|
|
6136
|
-
resolve = _resolve;
|
|
6137
|
-
reject = _reject;
|
|
6138
|
-
});
|
|
6139
|
-
promise.resolve = (v) => {
|
|
6140
|
-
resolve(v);
|
|
6141
|
-
return promise;
|
|
6142
|
-
};
|
|
6143
|
-
promise.reject = reject;
|
|
6144
|
-
return promise;
|
|
6145
|
-
}
|
|
6146
|
-
|
|
6147
6156
|
// ../@core/src/events/index.ts
|
|
6148
6157
|
function watchClickPosition() {
|
|
6149
6158
|
if (typeof window === "undefined" && typeof document === "undefined")
|
|
@@ -6205,14 +6214,14 @@ var OverlaysVue = (() => {
|
|
|
6205
6214
|
|
|
6206
6215
|
// ../@core/src/utils/util.ts
|
|
6207
6216
|
function delay(milliseconds) {
|
|
6208
|
-
return new Promise((
|
|
6217
|
+
return new Promise((confirm) => setTimeout(confirm, milliseconds));
|
|
6209
6218
|
}
|
|
6210
6219
|
|
|
6211
6220
|
// src/composable/define.ts
|
|
6212
|
-
function
|
|
6221
|
+
function useDisclosure(options = {}) {
|
|
6213
6222
|
const { duration = 0, immediate = true, model = "visible", automatic = true, events: events2 = {} } = options;
|
|
6214
|
-
events2.
|
|
6215
|
-
events2.
|
|
6223
|
+
events2.confirm = events2.confirm || "confirm";
|
|
6224
|
+
events2.cancel = events2.cancel || "cancel";
|
|
6216
6225
|
const mixinOptions = vue_runtime_esm_default.extend({
|
|
6217
6226
|
inject: [ScriptsInjectionKey],
|
|
6218
6227
|
model: {
|
|
@@ -6248,13 +6257,13 @@ var OverlaysVue = (() => {
|
|
|
6248
6257
|
this.$emit(events2[type], value);
|
|
6249
6258
|
this.$visible = false;
|
|
6250
6259
|
},
|
|
6251
|
-
async $
|
|
6260
|
+
async $cancel(value) {
|
|
6252
6261
|
var _a;
|
|
6253
|
-
(_a = this.$overlay) == null ? void 0 : _a.
|
|
6262
|
+
(_a = this.$overlay) == null ? void 0 : _a.cancel(value);
|
|
6254
6263
|
},
|
|
6255
|
-
async $
|
|
6264
|
+
async $confirm(value) {
|
|
6256
6265
|
var _a;
|
|
6257
|
-
(_a = this.$overlay) == null ? void 0 : _a.
|
|
6266
|
+
(_a = this.$overlay) == null ? void 0 : _a.confirm(value);
|
|
6258
6267
|
}
|
|
6259
6268
|
}
|
|
6260
6269
|
});
|
|
@@ -6266,9 +6275,7 @@ var OverlaysVue = (() => {
|
|
|
6266
6275
|
__assign = Object.assign || function __assign2(t) {
|
|
6267
6276
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6268
6277
|
s = arguments[i];
|
|
6269
|
-
for (var p in s)
|
|
6270
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6271
|
-
t[p] = s[p];
|
|
6278
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
6272
6279
|
}
|
|
6273
6280
|
return t;
|
|
6274
6281
|
};
|
|
@@ -6347,25 +6354,14 @@ var OverlaysVue = (() => {
|
|
|
6347
6354
|
var defineOverlay = constructor.define;
|
|
6348
6355
|
var renderOverlay = constructor.render;
|
|
6349
6356
|
|
|
6350
|
-
// src/components/index.ts
|
|
6351
|
-
var Field = {
|
|
6352
|
-
name: "Field",
|
|
6353
|
-
props: {
|
|
6354
|
-
value: [String, Object]
|
|
6355
|
-
},
|
|
6356
|
-
render(h) {
|
|
6357
|
-
return h(this.value);
|
|
6358
|
-
}
|
|
6359
|
-
};
|
|
6360
|
-
|
|
6361
6357
|
// src/index.ts
|
|
6362
6358
|
function install(_ins, parent) {
|
|
6363
6359
|
if (parent)
|
|
6364
6360
|
context.parent = parent;
|
|
6365
6361
|
}
|
|
6366
6362
|
var unoverlay = { install };
|
|
6367
|
-
var
|
|
6368
|
-
return __toCommonJS(
|
|
6363
|
+
var index_default = unoverlay;
|
|
6364
|
+
return __toCommonJS(index_exports);
|
|
6369
6365
|
})();
|
|
6370
6366
|
/*! Bundled license information:
|
|
6371
6367
|
|
package/dist/index.js
CHANGED
|
@@ -5,34 +5,45 @@ var context = {
|
|
|
5
5
|
};
|
|
6
6
|
var ScriptsInjectionKey = "$overlay";
|
|
7
7
|
|
|
8
|
+
// src/components/index.ts
|
|
9
|
+
var Field = {
|
|
10
|
+
name: "Field",
|
|
11
|
+
props: {
|
|
12
|
+
value: [String, Object]
|
|
13
|
+
},
|
|
14
|
+
render(h) {
|
|
15
|
+
return h(this.value);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
8
19
|
// src/composable/create.ts
|
|
9
20
|
import mitt from "mitt";
|
|
10
21
|
function createVisibleScripts(options) {
|
|
11
|
-
const {
|
|
22
|
+
const { cancel: _cancel, confirm: _confirm } = options.deferred || {};
|
|
12
23
|
const { vanish: _vanish } = options;
|
|
13
24
|
const { on, off, emit } = mitt();
|
|
14
|
-
function
|
|
15
|
-
emit("
|
|
16
|
-
|
|
25
|
+
function cancel(value) {
|
|
26
|
+
emit("cancel", value);
|
|
27
|
+
_cancel == null ? void 0 : _cancel(value);
|
|
17
28
|
}
|
|
18
|
-
function
|
|
29
|
+
function confirm(value) {
|
|
19
30
|
var _a;
|
|
20
|
-
(_a = options.deferred) == null ? void 0 : _a.
|
|
21
|
-
emit("
|
|
22
|
-
return
|
|
31
|
+
(_a = options.deferred) == null ? void 0 : _a.confirm(value);
|
|
32
|
+
emit("confirm", value);
|
|
33
|
+
return _confirm == null ? void 0 : _confirm(value);
|
|
23
34
|
}
|
|
24
35
|
function vanish() {
|
|
25
36
|
_vanish == null ? void 0 : _vanish();
|
|
26
|
-
|
|
37
|
+
cancel();
|
|
27
38
|
off("*");
|
|
28
39
|
}
|
|
29
40
|
if (options.deferred) {
|
|
30
|
-
options.deferred.
|
|
31
|
-
options.deferred.
|
|
41
|
+
options.deferred.confirm = confirm;
|
|
42
|
+
options.deferred.cancel = cancel;
|
|
32
43
|
}
|
|
33
44
|
return {
|
|
34
|
-
|
|
35
|
-
|
|
45
|
+
confirm,
|
|
46
|
+
cancel,
|
|
36
47
|
vanish,
|
|
37
48
|
on
|
|
38
49
|
};
|
|
@@ -41,10 +52,10 @@ function createVisibleScripts(options) {
|
|
|
41
52
|
// src/composable/define.ts
|
|
42
53
|
import { delay } from "@overlastic/core";
|
|
43
54
|
import Vue2 from "vue";
|
|
44
|
-
function
|
|
55
|
+
function useDisclosure(options = {}) {
|
|
45
56
|
const { duration = 0, immediate = true, model = "visible", automatic = true, events = {} } = options;
|
|
46
|
-
events.
|
|
47
|
-
events.
|
|
57
|
+
events.confirm = events.confirm || "confirm";
|
|
58
|
+
events.cancel = events.cancel || "cancel";
|
|
48
59
|
const mixinOptions = Vue2.extend({
|
|
49
60
|
inject: [ScriptsInjectionKey],
|
|
50
61
|
model: {
|
|
@@ -80,13 +91,13 @@ function useExtendOverlay(options = {}) {
|
|
|
80
91
|
this.$emit(events[type], value);
|
|
81
92
|
this.$visible = false;
|
|
82
93
|
},
|
|
83
|
-
async $
|
|
94
|
+
async $cancel(value) {
|
|
84
95
|
var _a;
|
|
85
|
-
(_a = this.$overlay) == null ? void 0 : _a.
|
|
96
|
+
(_a = this.$overlay) == null ? void 0 : _a.cancel(value);
|
|
86
97
|
},
|
|
87
|
-
async $
|
|
98
|
+
async $confirm(value) {
|
|
88
99
|
var _a;
|
|
89
|
-
(_a = this.$overlay) == null ? void 0 : _a.
|
|
100
|
+
(_a = this.$overlay) == null ? void 0 : _a.confirm(value);
|
|
90
101
|
}
|
|
91
102
|
}
|
|
92
103
|
});
|
|
@@ -122,29 +133,18 @@ var constructor = createConstructor((Inst, props, options) => {
|
|
|
122
133
|
var defineOverlay = constructor.define;
|
|
123
134
|
var renderOverlay = constructor.render;
|
|
124
135
|
|
|
125
|
-
// src/components/index.ts
|
|
126
|
-
var Field = {
|
|
127
|
-
name: "Field",
|
|
128
|
-
props: {
|
|
129
|
-
value: [String, Object]
|
|
130
|
-
},
|
|
131
|
-
render(h) {
|
|
132
|
-
return h(this.value);
|
|
133
|
-
}
|
|
134
|
-
};
|
|
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
|
-
var
|
|
142
|
+
var index_default = unoverlay;
|
|
143
143
|
export {
|
|
144
144
|
Field,
|
|
145
|
-
|
|
145
|
+
index_default as default,
|
|
146
146
|
defineOverlay,
|
|
147
147
|
install,
|
|
148
148
|
renderOverlay,
|
|
149
|
-
|
|
149
|
+
useDisclosure
|
|
150
150
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@overlastic/vue2",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.3",
|
|
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.8.
|
|
33
|
+
"@overlastic/core": "^0.8.3"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"vue": "^2.6"
|