@overlastic/vue2 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 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 src_exports = {};
32
- __export(src_exports, {
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
33
  Field: () => Field,
34
- default: () => src_default,
34
+ default: () => index_default,
35
35
  defineOverlay: () => defineOverlay,
36
36
  install: () => install,
37
37
  renderOverlay: () => renderOverlay,
38
- useExtendOverlay: () => useExtendOverlay
38
+ useDisclosure: () => useDisclosure
39
39
  });
40
- module.exports = __toCommonJS(src_exports);
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 { reject: _reject, resolve: _resolve } = options.deferred || {};
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 reject(value) {
56
- emit("reject", value);
57
- _reject == null ? void 0 : _reject(value);
66
+ function cancel(value) {
67
+ emit("cancel", value);
68
+ _cancel == null ? void 0 : _cancel(value);
58
69
  }
59
- function resolve(value) {
70
+ function confirm(value) {
60
71
  var _a;
61
- (_a = options.deferred) == null ? void 0 : _a.resolve(value);
62
- emit("resolve", value);
63
- return _resolve == null ? void 0 : _resolve(value);
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
- reject();
78
+ cancel();
68
79
  off("*");
69
80
  }
70
81
  if (options.deferred) {
71
- options.deferred.resolve = resolve;
72
- options.deferred.reject = reject;
82
+ options.deferred.confirm = confirm;
83
+ options.deferred.cancel = cancel;
73
84
  }
74
85
  return {
75
- resolve,
76
- reject,
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 useExtendOverlay(options = {}) {
96
+ function useDisclosure(options = {}) {
86
97
  const { duration = 0, immediate = true, model = "visible", automatic = true, events = {} } = options;
87
- events.reject = events.reject || "reject";
88
- events.resolve = events.resolve || "resolve";
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 $resolve(value) {
135
+ async $cancel(value) {
125
136
  var _a;
126
- (_a = this.$overlay) == null ? void 0 : _a.resolve(value);
137
+ (_a = this.$overlay) == null ? void 0 : _a.cancel(value);
127
138
  },
128
- async $reject(value) {
139
+ async $confirm(value) {
129
140
  var _a;
130
- (_a = this.$overlay) == null ? void 0 : _a.reject(value);
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 src_default = unoverlay;
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
- useExtendOverlay
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
- * reject event name used by the template
10
+ * confirm event name used by the template
9
11
  *
10
- * @default 'reject'
12
+ * @default 'confirm'
11
13
  */
12
- reject?: string;
14
+ cancel?: string;
13
15
  /**
14
- * resolve event name used by the template
16
+ * cancel event name used by the template
15
17
  *
16
- * @default 'resolve'
18
+ * @default 'cancel'
17
19
  */
18
- resolve?: string;
20
+ confirm?: string;
19
21
  }
20
- interface ExtendOverlayOptions {
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 useExtendOverlay(options?: ExtendOverlayOptions): vue_types_vue.ExtendedVue<Vue__default, {
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: 'reject' | 'resolve', value: any): Promise<void>;
48
- $resolve(value: any): Promise<void>;
49
- $reject(value: any): Promise<void>;
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 ExtendOverlayOptions, Field, unoverlay as default, defineOverlay, install, renderOverlay, useExtendOverlay };
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
- * reject event name used by the template
10
+ * confirm event name used by the template
9
11
  *
10
- * @default 'reject'
12
+ * @default 'confirm'
11
13
  */
12
- reject?: string;
14
+ cancel?: string;
13
15
  /**
14
- * resolve event name used by the template
16
+ * cancel event name used by the template
15
17
  *
16
- * @default 'resolve'
18
+ * @default 'cancel'
17
19
  */
18
- resolve?: string;
20
+ confirm?: string;
19
21
  }
20
- interface ExtendOverlayOptions {
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 useExtendOverlay(options?: ExtendOverlayOptions): vue_types_vue.ExtendedVue<Vue__default, {
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: 'reject' | 'resolve', value: any): Promise<void>;
48
- $resolve(value: any): Promise<void>;
49
- $reject(value: any): Promise<void>;
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 ExtendOverlayOptions, Field, unoverlay as default, defineOverlay, install, renderOverlay, useExtendOverlay };
69
+ export { Field, type UseDisclosureOptions, unoverlay as default, defineOverlay, install, renderOverlay, useDisclosure };
@@ -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 src_exports = {};
23
- __export(src_exports, {
22
+ var index_exports = {};
23
+ __export(index_exports, {
24
24
  Field: () => Field,
25
- default: () => src_default,
25
+ default: () => index_default,
26
26
  defineOverlay: () => defineOverlay,
27
27
  install: () => install,
28
28
  renderOverlay: () => renderOverlay,
29
- useExtendOverlay: () => useExtendOverlay
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 { reject: _reject, resolve: _resolve } = options.deferred || {};
6079
+ const { cancel: _cancel, confirm: _confirm } = options.deferred || {};
6074
6080
  const { vanish: _vanish } = options;
6075
6081
  const { on, off, emit } = mitt_default();
6076
- function reject(value) {
6077
- emit("reject", value);
6078
- _reject == null ? void 0 : _reject(value);
6082
+ function cancel(value) {
6083
+ emit("cancel", value);
6084
+ _cancel == null ? void 0 : _cancel(value);
6079
6085
  }
6080
- function resolve(value) {
6086
+ function confirm(value) {
6081
6087
  var _a;
6082
- (_a = options.deferred) == null ? void 0 : _a.resolve(value);
6083
- emit("resolve", value);
6084
- return _resolve == null ? void 0 : _resolve(value);
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
- reject();
6094
+ cancel();
6089
6095
  off("*");
6090
6096
  }
6091
6097
  if (options.deferred) {
6092
- options.deferred.resolve = resolve;
6093
- options.deferred.reject = reject;
6098
+ options.deferred.confirm = confirm;
6099
+ options.deferred.cancel = cancel;
6094
6100
  }
6095
6101
  return {
6096
- resolve,
6097
- reject,
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")
@@ -6171,7 +6180,8 @@ var OverlaysVue = (() => {
6171
6180
  const deferred = createDeferred();
6172
6181
  const name = defineName(options3.id, options3.autoIncrement);
6173
6182
  const index2 = getIndex(options3.id);
6174
- const container = globalContainer ? defineGlobalElement(name, options3.root) : document.body;
6183
+ const root = globalContainer ? options3.root : document.body;
6184
+ const container = defineGlobalElement(name, root);
6175
6185
  mount(instance, props2, Object.assign(options3, {
6176
6186
  position: context2.position,
6177
6187
  id: name,
@@ -6204,14 +6214,14 @@ var OverlaysVue = (() => {
6204
6214
 
6205
6215
  // ../@core/src/utils/util.ts
6206
6216
  function delay(milliseconds) {
6207
- return new Promise((resolve) => setTimeout(resolve, milliseconds));
6217
+ return new Promise((confirm) => setTimeout(confirm, milliseconds));
6208
6218
  }
6209
6219
 
6210
6220
  // src/composable/define.ts
6211
- function useExtendOverlay(options = {}) {
6221
+ function useDisclosure(options = {}) {
6212
6222
  const { duration = 0, immediate = true, model = "visible", automatic = true, events: events2 = {} } = options;
6213
- events2.reject = events2.reject || "reject";
6214
- events2.resolve = events2.resolve || "resolve";
6223
+ events2.confirm = events2.confirm || "confirm";
6224
+ events2.cancel = events2.cancel || "cancel";
6215
6225
  const mixinOptions = vue_runtime_esm_default.extend({
6216
6226
  inject: [ScriptsInjectionKey],
6217
6227
  model: {
@@ -6247,13 +6257,13 @@ var OverlaysVue = (() => {
6247
6257
  this.$emit(events2[type], value);
6248
6258
  this.$visible = false;
6249
6259
  },
6250
- async $resolve(value) {
6260
+ async $cancel(value) {
6251
6261
  var _a;
6252
- (_a = this.$overlay) == null ? void 0 : _a.resolve(value);
6262
+ (_a = this.$overlay) == null ? void 0 : _a.cancel(value);
6253
6263
  },
6254
- async $reject(value) {
6264
+ async $confirm(value) {
6255
6265
  var _a;
6256
- (_a = this.$overlay) == null ? void 0 : _a.reject(value);
6266
+ (_a = this.$overlay) == null ? void 0 : _a.confirm(value);
6257
6267
  }
6258
6268
  }
6259
6269
  });
@@ -6265,9 +6275,7 @@ var OverlaysVue = (() => {
6265
6275
  __assign = Object.assign || function __assign2(t) {
6266
6276
  for (var s, i = 1, n = arguments.length; i < n; i++) {
6267
6277
  s = arguments[i];
6268
- for (var p in s)
6269
- if (Object.prototype.hasOwnProperty.call(s, p))
6270
- t[p] = s[p];
6278
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
6271
6279
  }
6272
6280
  return t;
6273
6281
  };
@@ -6346,25 +6354,14 @@ var OverlaysVue = (() => {
6346
6354
  var defineOverlay = constructor.define;
6347
6355
  var renderOverlay = constructor.render;
6348
6356
 
6349
- // src/components/index.ts
6350
- var Field = {
6351
- name: "Field",
6352
- props: {
6353
- value: [String, Object]
6354
- },
6355
- render(h) {
6356
- return h(this.value);
6357
- }
6358
- };
6359
-
6360
6357
  // src/index.ts
6361
6358
  function install(_ins, parent) {
6362
6359
  if (parent)
6363
6360
  context.parent = parent;
6364
6361
  }
6365
6362
  var unoverlay = { install };
6366
- var src_default = unoverlay;
6367
- return __toCommonJS(src_exports);
6363
+ var index_default = unoverlay;
6364
+ return __toCommonJS(index_exports);
6368
6365
  })();
6369
6366
  /*! Bundled license information:
6370
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 { reject: _reject, resolve: _resolve } = options.deferred || {};
22
+ const { cancel: _cancel, confirm: _confirm } = options.deferred || {};
12
23
  const { vanish: _vanish } = options;
13
24
  const { on, off, emit } = mitt();
14
- function reject(value) {
15
- emit("reject", value);
16
- _reject == null ? void 0 : _reject(value);
25
+ function cancel(value) {
26
+ emit("cancel", value);
27
+ _cancel == null ? void 0 : _cancel(value);
17
28
  }
18
- function resolve(value) {
29
+ function confirm(value) {
19
30
  var _a;
20
- (_a = options.deferred) == null ? void 0 : _a.resolve(value);
21
- emit("resolve", value);
22
- return _resolve == null ? void 0 : _resolve(value);
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
- reject();
37
+ cancel();
27
38
  off("*");
28
39
  }
29
40
  if (options.deferred) {
30
- options.deferred.resolve = resolve;
31
- options.deferred.reject = reject;
41
+ options.deferred.confirm = confirm;
42
+ options.deferred.cancel = cancel;
32
43
  }
33
44
  return {
34
- resolve,
35
- reject,
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 useExtendOverlay(options = {}) {
55
+ function useDisclosure(options = {}) {
45
56
  const { duration = 0, immediate = true, model = "visible", automatic = true, events = {} } = options;
46
- events.reject = events.reject || "reject";
47
- events.resolve = events.resolve || "resolve";
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 $resolve(value) {
94
+ async $cancel(value) {
84
95
  var _a;
85
- (_a = this.$overlay) == null ? void 0 : _a.resolve(value);
96
+ (_a = this.$overlay) == null ? void 0 : _a.cancel(value);
86
97
  },
87
- async $reject(value) {
98
+ async $confirm(value) {
88
99
  var _a;
89
- (_a = this.$overlay) == null ? void 0 : _a.reject(value);
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 src_default = unoverlay;
142
+ var index_default = unoverlay;
143
143
  export {
144
144
  Field,
145
- src_default as default,
145
+ index_default as default,
146
146
  defineOverlay,
147
147
  install,
148
148
  renderOverlay,
149
- useExtendOverlay
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.0",
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.0"
33
+ "@overlastic/core": "^0.8.3"
34
34
  },
35
35
  "devDependencies": {
36
36
  "vue": "^2.6"