@overlastic/vue 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.
@@ -922,8 +922,7 @@ var OverlaysVue = (() => {
922
922
  case 3:
923
923
  return false;
924
924
  default:
925
- if (process.env.NODE_ENV !== "production")
926
- ;
925
+ if (process.env.NODE_ENV !== "production") ;
927
926
  return false;
928
927
  }
929
928
  }
@@ -1894,8 +1893,7 @@ var OverlaysVue = (() => {
1894
1893
  }
1895
1894
  return returnType;
1896
1895
  default:
1897
- if (process.env.NODE_ENV !== "production")
1898
- ;
1896
+ if (process.env.NODE_ENV !== "production") ;
1899
1897
  return 0;
1900
1898
  }
1901
1899
  }
@@ -2153,8 +2151,7 @@ var OverlaysVue = (() => {
2153
2151
  false
2154
2152
  /* isComponent */
2155
2153
  );
2156
- } else
2157
- ;
2154
+ } else ;
2158
2155
  }
2159
2156
  function traverseChildren(parent, context3) {
2160
2157
  let i = 0;
@@ -7659,7 +7656,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
7659
7656
  }
7660
7657
  function renderComponentRoot(instance) {
7661
7658
  const {
7662
- type: Component2,
7659
+ type: Component,
7663
7660
  vnode,
7664
7661
  proxy,
7665
7662
  withProxy,
@@ -7697,7 +7694,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
7697
7694
  );
7698
7695
  fallthroughAttrs = attrs;
7699
7696
  } else {
7700
- const render22 = Component2;
7697
+ const render22 = Component;
7701
7698
  if (process.env.NODE_ENV !== "production" && attrs === props) {
7702
7699
  markAttrsAccessed();
7703
7700
  }
@@ -7718,7 +7715,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
7718
7715
  /* we know it doesn't need it */
7719
7716
  )
7720
7717
  );
7721
- fallthroughAttrs = Component2.props ? attrs : getFunctionalFallthrough(attrs);
7718
+ fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
7722
7719
  }
7723
7720
  } catch (err) {
7724
7721
  blockStack.length = 0;
@@ -9155,25 +9152,25 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
9155
9152
  function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
9156
9153
  const instance = currentRenderingInstance || currentInstance;
9157
9154
  if (instance) {
9158
- const Component2 = instance.type;
9155
+ const Component = instance.type;
9159
9156
  if (type === COMPONENTS) {
9160
9157
  const selfName = getComponentName(
9161
- Component2,
9158
+ Component,
9162
9159
  false
9163
9160
  /* do not include inferred name to avoid breaking existing code */
9164
9161
  );
9165
9162
  if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
9166
- return Component2;
9163
+ return Component;
9167
9164
  }
9168
9165
  }
9169
9166
  const res = (
9170
9167
  // local registration
9171
9168
  // check instance[type] first which is resolved for options API
9172
- resolve(instance[type] || Component2[type], name) || // global registration
9169
+ resolve(instance[type] || Component[type], name) || // global registration
9173
9170
  resolve(instance.appContext[type], name)
9174
9171
  );
9175
9172
  if (!res && maybeSelfReference) {
9176
- return Component2;
9173
+ return Component;
9177
9174
  }
9178
9175
  if (process.env.NODE_ENV !== "production" && warnMissing && !res) {
9179
9176
  const extra = type === COMPONENTS ? `
@@ -9752,7 +9749,7 @@ If this is a native custom element, make sure to exclude it from component resol
9752
9749
  }
9753
9750
  function callHook(hook, instance, type) {
9754
9751
  callWithAsyncErrorHandling(
9755
- isArray(hook) ? hook.map((h8) => h8.bind(instance.proxy)) : hook.bind(instance.proxy),
9752
+ isArray(hook) ? hook.map((h7) => h7.bind(instance.proxy)) : hook.bind(instance.proxy),
9756
9753
  instance,
9757
9754
  type
9758
9755
  );
@@ -10535,7 +10532,7 @@ If you want to remount the same app, move your app creation logic into a factory
10535
10532
  }
10536
10533
  const refValue = vnode.shapeFlag & 4 ? getExposeProxy(vnode.component) || vnode.component.proxy : vnode.el;
10537
10534
  const value = isUnmount ? null : refValue;
10538
- const { i: owner, r: ref7 } = rawRef;
10535
+ const { i: owner, r: ref6 } = rawRef;
10539
10536
  if (process.env.NODE_ENV !== "production" && !owner) {
10540
10537
  warn2(
10541
10538
  `Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.`
@@ -10545,7 +10542,7 @@ If you want to remount the same app, move your app creation logic into a factory
10545
10542
  const oldRef = oldRawRef && oldRawRef.r;
10546
10543
  const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
10547
10544
  const setupState = owner.setupState;
10548
- if (oldRef != null && oldRef !== ref7) {
10545
+ if (oldRef != null && oldRef !== ref6) {
10549
10546
  if (isString(oldRef)) {
10550
10547
  refs[oldRef] = null;
10551
10548
  if (hasOwn(setupState, oldRef)) {
@@ -10555,44 +10552,44 @@ If you want to remount the same app, move your app creation logic into a factory
10555
10552
  oldRef.value = null;
10556
10553
  }
10557
10554
  }
10558
- if (isFunction(ref7)) {
10559
- callWithErrorHandling(ref7, owner, 12, [value, refs]);
10555
+ if (isFunction(ref6)) {
10556
+ callWithErrorHandling(ref6, owner, 12, [value, refs]);
10560
10557
  } else {
10561
- const _isString = isString(ref7);
10562
- const _isRef = isRef(ref7);
10558
+ const _isString = isString(ref6);
10559
+ const _isRef = isRef(ref6);
10563
10560
  if (_isString || _isRef) {
10564
10561
  const doSet = () => {
10565
10562
  if (rawRef.f) {
10566
- const existing = _isString ? hasOwn(setupState, ref7) ? setupState[ref7] : refs[ref7] : ref7.value;
10563
+ const existing = _isString ? hasOwn(setupState, ref6) ? setupState[ref6] : refs[ref6] : ref6.value;
10567
10564
  if (isUnmount) {
10568
10565
  isArray(existing) && remove(existing, refValue);
10569
10566
  } else {
10570
10567
  if (!isArray(existing)) {
10571
10568
  if (_isString) {
10572
- refs[ref7] = [refValue];
10573
- if (hasOwn(setupState, ref7)) {
10574
- setupState[ref7] = refs[ref7];
10569
+ refs[ref6] = [refValue];
10570
+ if (hasOwn(setupState, ref6)) {
10571
+ setupState[ref6] = refs[ref6];
10575
10572
  }
10576
10573
  } else {
10577
- ref7.value = [refValue];
10574
+ ref6.value = [refValue];
10578
10575
  if (rawRef.k)
10579
- refs[rawRef.k] = ref7.value;
10576
+ refs[rawRef.k] = ref6.value;
10580
10577
  }
10581
10578
  } else if (!existing.includes(refValue)) {
10582
10579
  existing.push(refValue);
10583
10580
  }
10584
10581
  }
10585
10582
  } else if (_isString) {
10586
- refs[ref7] = value;
10587
- if (hasOwn(setupState, ref7)) {
10588
- setupState[ref7] = value;
10583
+ refs[ref6] = value;
10584
+ if (hasOwn(setupState, ref6)) {
10585
+ setupState[ref6] = value;
10589
10586
  }
10590
10587
  } else if (_isRef) {
10591
- ref7.value = value;
10588
+ ref6.value = value;
10592
10589
  if (rawRef.k)
10593
10590
  refs[rawRef.k] = value;
10594
10591
  } else if (process.env.NODE_ENV !== "production") {
10595
- warn2("Invalid template ref type:", ref7, `(${typeof ref7})`);
10592
+ warn2("Invalid template ref type:", ref6, `(${typeof ref6})`);
10596
10593
  }
10597
10594
  };
10598
10595
  if (value) {
@@ -10602,7 +10599,7 @@ If you want to remount the same app, move your app creation logic into a factory
10602
10599
  doSet();
10603
10600
  }
10604
10601
  } else if (process.env.NODE_ENV !== "production") {
10605
- warn2("Invalid template ref type:", ref7, `(${typeof ref7})`);
10602
+ warn2("Invalid template ref type:", ref6, `(${typeof ref6})`);
10606
10603
  }
10607
10604
  }
10608
10605
  }
@@ -10648,7 +10645,7 @@ If you want to remount the same app, move your app creation logic into a factory
10648
10645
  slotScopeIds,
10649
10646
  isFragmentStart
10650
10647
  );
10651
- const { type, ref: ref7, shapeFlag, patchFlag } = vnode;
10648
+ const { type, ref: ref6, shapeFlag, patchFlag } = vnode;
10652
10649
  let domType = node.nodeType;
10653
10650
  vnode.el = node;
10654
10651
  if (patchFlag === -2) {
@@ -10792,8 +10789,8 @@ If you want to remount the same app, move your app creation logic into a factory
10792
10789
  warn2("Invalid HostVNode type:", type, `(${typeof type})`);
10793
10790
  }
10794
10791
  }
10795
- if (ref7 != null) {
10796
- setRef(ref7, null, parentSuspense, vnode);
10792
+ if (ref6 != null) {
10793
+ setRef(ref6, null, parentSuspense, vnode);
10797
10794
  }
10798
10795
  return nextNode;
10799
10796
  };
@@ -11102,7 +11099,7 @@ For more details, see https://link.vuejs.org/feature-flags.`
11102
11099
  optimized = false;
11103
11100
  n2.dynamicChildren = null;
11104
11101
  }
11105
- const { type, ref: ref7, shapeFlag } = n2;
11102
+ const { type, ref: ref6, shapeFlag } = n2;
11106
11103
  switch (type) {
11107
11104
  case Text:
11108
11105
  processText(n1, n2, container, anchor);
@@ -11185,8 +11182,8 @@ For more details, see https://link.vuejs.org/feature-flags.`
11185
11182
  warn2("Invalid VNode type:", type, `(${typeof type})`);
11186
11183
  }
11187
11184
  }
11188
- if (ref7 != null && parentComponent) {
11189
- setRef(ref7, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
11185
+ if (ref6 != null && parentComponent) {
11186
+ setRef(ref6, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
11190
11187
  }
11191
11188
  };
11192
11189
  const processText = (n1, n2, container, anchor) => {
@@ -12278,15 +12275,15 @@ For more details, see https://link.vuejs.org/feature-flags.`
12278
12275
  const {
12279
12276
  type,
12280
12277
  props,
12281
- ref: ref7,
12278
+ ref: ref6,
12282
12279
  children,
12283
12280
  dynamicChildren,
12284
12281
  shapeFlag,
12285
12282
  patchFlag,
12286
12283
  dirs
12287
12284
  } = vnode;
12288
- if (ref7 != null) {
12289
- setRef(ref7, null, parentSuspense, vnode, true);
12285
+ if (ref6 != null) {
12286
+ setRef(ref6, null, parentSuspense, vnode, true);
12290
12287
  }
12291
12288
  if (shapeFlag & 256) {
12292
12289
  parentComponent.ctx.deactivate(vnode);
@@ -12800,7 +12797,7 @@ Component that was made reactive: `,
12800
12797
  return isProxy(props) || InternalObjectKey in props ? extend({}, props) : props;
12801
12798
  }
12802
12799
  function cloneVNode(vnode, extraProps, mergeRef = false) {
12803
- const { props, ref: ref7, patchFlag, children } = vnode;
12800
+ const { props, ref: ref6, patchFlag, children } = vnode;
12804
12801
  const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
12805
12802
  const cloned = {
12806
12803
  __v_isVNode: true,
@@ -12812,8 +12809,8 @@ Component that was made reactive: `,
12812
12809
  // #2078 in the case of <component :is="vnode" ref="extra"/>
12813
12810
  // if the vnode itself already has a ref, cloneVNode will need to merge
12814
12811
  // the refs so the single vnode can be set on multiple refs
12815
- mergeRef && ref7 ? isArray(ref7) ? ref7.concat(normalizeRef(extraProps)) : [ref7, normalizeRef(extraProps)] : normalizeRef(extraProps)
12816
- ) : ref7,
12812
+ mergeRef && ref6 ? isArray(ref6) ? ref6.concat(normalizeRef(extraProps)) : [ref6, normalizeRef(extraProps)] : normalizeRef(extraProps)
12813
+ ) : ref6,
12817
12814
  scopeId: vnode.scopeId,
12818
12815
  slotScopeIds: vnode.slotScopeIds,
12819
12816
  children: process.env.NODE_ENV !== "production" && patchFlag === -1 && isArray(children) ? children.map(deepCloneVNode) : children,
@@ -13072,24 +13069,24 @@ Component that was made reactive: `,
13072
13069
  }
13073
13070
  function setupStatefulComponent(instance, isSSR) {
13074
13071
  var _a;
13075
- const Component2 = instance.type;
13072
+ const Component = instance.type;
13076
13073
  if (process.env.NODE_ENV !== "production") {
13077
- if (Component2.name) {
13078
- validateComponentName(Component2.name, instance.appContext.config);
13074
+ if (Component.name) {
13075
+ validateComponentName(Component.name, instance.appContext.config);
13079
13076
  }
13080
- if (Component2.components) {
13081
- const names = Object.keys(Component2.components);
13077
+ if (Component.components) {
13078
+ const names = Object.keys(Component.components);
13082
13079
  for (let i = 0; i < names.length; i++) {
13083
13080
  validateComponentName(names[i], instance.appContext.config);
13084
13081
  }
13085
13082
  }
13086
- if (Component2.directives) {
13087
- const names = Object.keys(Component2.directives);
13083
+ if (Component.directives) {
13084
+ const names = Object.keys(Component.directives);
13088
13085
  for (let i = 0; i < names.length; i++) {
13089
13086
  validateDirectiveName(names[i]);
13090
13087
  }
13091
13088
  }
13092
- if (Component2.compilerOptions && isRuntimeOnly()) {
13089
+ if (Component.compilerOptions && isRuntimeOnly()) {
13093
13090
  warn2(
13094
13091
  `"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.`
13095
13092
  );
@@ -13100,7 +13097,7 @@ Component that was made reactive: `,
13100
13097
  if (process.env.NODE_ENV !== "production") {
13101
13098
  exposePropsOnRenderContext(instance);
13102
13099
  }
13103
- const { setup } = Component2;
13100
+ const { setup } = Component;
13104
13101
  if (setup) {
13105
13102
  const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
13106
13103
  setCurrentInstance(instance);
@@ -13124,7 +13121,7 @@ Component that was made reactive: `,
13124
13121
  } else {
13125
13122
  instance.asyncDep = setupResult;
13126
13123
  if (process.env.NODE_ENV !== "production" && !instance.suspense) {
13127
- const name = (_a = Component2.name) != null ? _a : "Anonymous";
13124
+ const name = (_a = Component.name) != null ? _a : "Anonymous";
13128
13125
  warn2(
13129
13126
  `Component <${name}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`
13130
13127
  );
@@ -13173,16 +13170,16 @@ Component that was made reactive: `,
13173
13170
  };
13174
13171
  }
13175
13172
  function finishComponentSetup(instance, isSSR, skipOptions) {
13176
- const Component2 = instance.type;
13173
+ const Component = instance.type;
13177
13174
  if (!instance.render) {
13178
- if (!isSSR && compile2 && !Component2.render) {
13179
- const template = Component2.template || resolveMergedOptions(instance).template;
13175
+ if (!isSSR && compile2 && !Component.render) {
13176
+ const template = Component.template || resolveMergedOptions(instance).template;
13180
13177
  if (template) {
13181
13178
  if (process.env.NODE_ENV !== "production") {
13182
13179
  startMeasure(instance, `compile`);
13183
13180
  }
13184
13181
  const { isCustomElement, compilerOptions } = instance.appContext.config;
13185
- const { delimiters, compilerOptions: componentCompilerOptions } = Component2;
13182
+ const { delimiters, compilerOptions: componentCompilerOptions } = Component;
13186
13183
  const finalCompilerOptions = extend(
13187
13184
  extend(
13188
13185
  {
@@ -13193,13 +13190,13 @@ Component that was made reactive: `,
13193
13190
  ),
13194
13191
  componentCompilerOptions
13195
13192
  );
13196
- Component2.render = compile2(template, finalCompilerOptions);
13193
+ Component.render = compile2(template, finalCompilerOptions);
13197
13194
  if (process.env.NODE_ENV !== "production") {
13198
13195
  endMeasure(instance, `compile`);
13199
13196
  }
13200
13197
  }
13201
13198
  }
13202
- instance.render = Component2.render || NOOP;
13199
+ instance.render = Component.render || NOOP;
13203
13200
  if (installWithProxy) {
13204
13201
  installWithProxy(instance);
13205
13202
  }
@@ -13211,8 +13208,8 @@ Component that was made reactive: `,
13211
13208
  resetTracking();
13212
13209
  unsetCurrentInstance();
13213
13210
  }
13214
- if (process.env.NODE_ENV !== "production" && !Component2.render && instance.render === NOOP && !isSSR) {
13215
- if (!compile2 && Component2.template) {
13211
+ if (process.env.NODE_ENV !== "production" && !Component.render && instance.render === NOOP && !isSSR) {
13212
+ if (!compile2 && Component.template) {
13216
13213
  warn2(
13217
13214
  `Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".`
13218
13215
  /* should not happen */
@@ -13319,13 +13316,13 @@ Component that was made reactive: `,
13319
13316
  }));
13320
13317
  }
13321
13318
  }
13322
- function getComponentName(Component2, includeInferred = true) {
13323
- return isFunction(Component2) ? Component2.displayName || Component2.name : Component2.name || includeInferred && Component2.__name;
13319
+ function getComponentName(Component, includeInferred = true) {
13320
+ return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
13324
13321
  }
13325
- function formatComponentName(instance, Component2, isRoot = false) {
13326
- let name = getComponentName(Component2);
13327
- if (!name && Component2.__file) {
13328
- const match = Component2.__file.match(/([^/\\]+)\.\w+$/);
13322
+ function formatComponentName(instance, Component, isRoot = false) {
13323
+ let name = getComponentName(Component);
13324
+ if (!name && Component.__file) {
13325
+ const match = Component.__file.match(/([^/\\]+)\.\w+$/);
13329
13326
  if (match) {
13330
13327
  name = match[1];
13331
13328
  }
@@ -13333,7 +13330,7 @@ Component that was made reactive: `,
13333
13330
  if (!name && instance && instance.parent) {
13334
13331
  const inferFromRegistry = (registry) => {
13335
13332
  for (const key in registry) {
13336
- if (registry[key] === Component2) {
13333
+ if (registry[key] === Component) {
13337
13334
  return key;
13338
13335
  }
13339
13336
  }
@@ -14612,14 +14609,14 @@ Component that was made reactive: `,
14612
14609
  InternalObjectKey = `__vInternal`;
14613
14610
  normalizeKey = ({ key }) => key != null ? key : null;
14614
14611
  normalizeRef = ({
14615
- ref: ref7,
14612
+ ref: ref6,
14616
14613
  ref_key,
14617
14614
  ref_for
14618
14615
  }) => {
14619
- if (typeof ref7 === "number") {
14620
- ref7 = "" + ref7;
14616
+ if (typeof ref6 === "number") {
14617
+ ref6 = "" + ref6;
14621
14618
  }
14622
- return ref7 != null ? isString(ref7) || isRef(ref7) || isFunction(ref7) ? { i: currentRenderingInstance, r: ref7, k: ref_key, f: !!ref_for } : ref7 : null;
14619
+ return ref6 != null ? isString(ref6) || isRef(ref6) || isFunction(ref6) ? { i: currentRenderingInstance, r: ref6, k: ref_key, f: !!ref_for } : ref6 : null;
14623
14620
  };
14624
14621
  createVNode = process.env.NODE_ENV !== "production" ? createVNodeWithArgsTransform : _createVNode;
14625
14622
  emptyAppContext = createAppContext();
@@ -16397,8 +16394,7 @@ Component that was made reactive: `,
16397
16394
  runtimeDom.registerRuntimeCompiler(compileToFunction);
16398
16395
  exports.compile = compileToFunction;
16399
16396
  Object.keys(runtimeDom).forEach(function(k) {
16400
- if (k !== "default" && !exports.hasOwnProperty(k))
16401
- exports[k] = runtimeDom[k];
16397
+ if (k !== "default" && !exports.hasOwnProperty(k)) exports[k] = runtimeDom[k];
16402
16398
  });
16403
16399
  }
16404
16400
  });
@@ -16473,8 +16469,7 @@ ${codeFrame}` : message);
16473
16469
  runtimeDom.registerRuntimeCompiler(compileToFunction);
16474
16470
  exports.compile = compileToFunction;
16475
16471
  Object.keys(runtimeDom).forEach(function(k) {
16476
- if (k !== "default" && !exports.hasOwnProperty(k))
16477
- exports[k] = runtimeDom[k];
16472
+ if (k !== "default" && !exports.hasOwnProperty(k)) exports[k] = runtimeDom[k];
16478
16473
  });
16479
16474
  }
16480
16475
  });
@@ -16492,17 +16487,16 @@ ${codeFrame}` : message);
16492
16487
  });
16493
16488
 
16494
16489
  // src/index.ts
16495
- var src_exports = {};
16496
- __export(src_exports, {
16490
+ var index_exports = {};
16491
+ __export(index_exports, {
16497
16492
  Field: () => Field,
16498
16493
  OverlaysProvider: () => OverlaysProvider,
16499
- default: () => src_default,
16494
+ default: () => index_default,
16500
16495
  defineOverlay: () => defineOverlay,
16501
16496
  install: () => install2,
16502
16497
  renderOverlay: () => renderOverlay,
16503
- useExtendOverlay: () => useExtendOverlay,
16504
- useOverlayHolder: () => useOverlayHolder,
16505
- useOverlayInject: () => useOverlayInject
16498
+ useDisclosure: () => useDisclosure,
16499
+ useOverlay: () => useOverlay
16506
16500
  });
16507
16501
 
16508
16502
  // src/internal/index.ts
@@ -16512,7 +16506,29 @@ ${codeFrame}` : message);
16512
16506
  var ScriptsInjectionKey = Symbol("OverlayScripts");
16513
16507
  var InstancesInjectionKey = Symbol("OverlayInstances");
16514
16508
 
16515
- // ../../node_modules/.pnpm/vue-demi@0.14.7_vue@3.3.2/node_modules/vue-demi/lib/index.mjs
16509
+ // ../../node_modules/.pnpm/vue@3.3.2/node_modules/vue/index.mjs
16510
+ var vue_exports = {};
16511
+ __reExport(vue_exports, __toESM(require_vue(), 1));
16512
+
16513
+ // src/components/Field.ts
16514
+ var Field = (0, vue_exports.defineComponent)({
16515
+ name: "Field",
16516
+ props: {
16517
+ is: {
16518
+ type: [String, Number, Object],
16519
+ default: ""
16520
+ }
16521
+ },
16522
+ setup(props) {
16523
+ return () => {
16524
+ if (typeof props.is === "string" || typeof props.is === "number")
16525
+ return props.is;
16526
+ return props.is ? (0, vue_exports.h)(props.is) : null;
16527
+ };
16528
+ }
16529
+ });
16530
+
16531
+ // ../../node_modules/.pnpm/vue-demi@0.14.10_vue@3.3.2/node_modules/vue-demi/lib/index.mjs
16516
16532
  var lib_exports = {};
16517
16533
  __export(lib_exports, {
16518
16534
  Vue: () => vue_exports,
@@ -16523,12 +16539,6 @@ ${codeFrame}` : message);
16523
16539
  isVue3: () => isVue3,
16524
16540
  set: () => set2
16525
16541
  });
16526
-
16527
- // ../../node_modules/.pnpm/vue@3.3.2/node_modules/vue/index.mjs
16528
- var vue_exports = {};
16529
- __reExport(vue_exports, __toESM(require_vue(), 1));
16530
-
16531
- // ../../node_modules/.pnpm/vue-demi@0.14.7_vue@3.3.2/node_modules/vue-demi/lib/index.mjs
16532
16542
  __reExport(lib_exports, vue_exports);
16533
16543
  var isVue2 = false;
16534
16544
  var isVue3 = true;
@@ -16552,7 +16562,143 @@ ${codeFrame}` : message);
16552
16562
  delete target[key];
16553
16563
  }
16554
16564
 
16555
- // ../../node_modules/.pnpm/@vueuse+shared@10.9.0_vue@3.3.2/node_modules/@vueuse/shared/index.mjs
16565
+ // src/components/Provider.ts
16566
+ var OverlaysProvider = (0, lib_exports.defineComponent)({
16567
+ setup(_, { slots }) {
16568
+ const instances = (0, lib_exports.ref)([]);
16569
+ function render2(Instance, props) {
16570
+ instances.value.push({ Instance: (0, vue_exports.markRaw)(Instance), props });
16571
+ }
16572
+ function vanish(instance) {
16573
+ instances.value = instances.value.filter(({ Instance }) => Instance !== instance);
16574
+ }
16575
+ (0, lib_exports.provide)(InstancesInjectionKey, { render: render2, vanish });
16576
+ return () => {
16577
+ var _a;
16578
+ return (0, lib_exports.h)(lib_exports.Fragment, [
16579
+ ...instances.value.map(
16580
+ ({ Instance, props }, index) => (0, lib_exports.h)(Instance, { ...props, key: index })
16581
+ ),
16582
+ (_a = slots.default) == null ? void 0 : _a.call(slots)
16583
+ ]);
16584
+ };
16585
+ }
16586
+ });
16587
+
16588
+ // ../@core/src/deferred.ts
16589
+ function createDeferred() {
16590
+ let confirm, cancel;
16591
+ const promise = new Promise((_confirm, _cancel) => {
16592
+ confirm = _confirm;
16593
+ cancel = _cancel;
16594
+ });
16595
+ promise.confirm = (v) => {
16596
+ confirm(v);
16597
+ return promise;
16598
+ };
16599
+ promise.close = () => {
16600
+ confirm();
16601
+ };
16602
+ promise.cancel = cancel;
16603
+ return promise;
16604
+ }
16605
+
16606
+ // ../@core/src/define/global.ts
16607
+ var UnifiedOverlayProviderID = "unified-overlay";
16608
+ function defineGlobalElement(id = "", root = document.body) {
16609
+ const el = document.createElement("div");
16610
+ if (id)
16611
+ el.id = id;
16612
+ if (root !== false)
16613
+ root.appendChild(el);
16614
+ return el;
16615
+ }
16616
+
16617
+ // ../@core/src/internal/index.ts
16618
+ var context2 = {
16619
+ position: null,
16620
+ spaces: {}
16621
+ };
16622
+
16623
+ // ../@core/src/define/name-index.ts
16624
+ function defineName(id = UnifiedOverlayProviderID, auto = true) {
16625
+ if (!context2.spaces[id])
16626
+ context2.spaces[id] = 0;
16627
+ if (auto)
16628
+ return `${id}--${++context2.spaces[id]}`;
16629
+ return id;
16630
+ }
16631
+ function getIndex(id = UnifiedOverlayProviderID) {
16632
+ return context2.spaces[id] || 0;
16633
+ }
16634
+
16635
+ // ../@core/src/events/index.ts
16636
+ function watchClickPosition() {
16637
+ if (typeof window === "undefined" && typeof document === "undefined")
16638
+ return;
16639
+ document.addEventListener("click", (event) => {
16640
+ if (event.target instanceof Element) {
16641
+ const { left, top, width, height } = event.target.getBoundingClientRect();
16642
+ if (left > 0 || top > 0) {
16643
+ context2.position = { x: left + width / 2, y: top + height / 2 };
16644
+ } else {
16645
+ context2.position = null;
16646
+ }
16647
+ } else {
16648
+ context2.position = null;
16649
+ }
16650
+ setTimeout(() => context2.position = null, 64);
16651
+ });
16652
+ }
16653
+
16654
+ // ../@core/src/constructor.ts
16655
+ function createConstructor(mount, options = {}) {
16656
+ const { container: globalContainer } = options;
16657
+ function define(instance, options2) {
16658
+ function executor(props, options3) {
16659
+ const deferred = createDeferred();
16660
+ const name = defineName(options3.id, options3.autoIncrement);
16661
+ const index = getIndex(options3.id);
16662
+ const root = globalContainer ? options3.root : document.body;
16663
+ const container = defineGlobalElement(name, root);
16664
+ mount(instance, props, Object.assign(options3, {
16665
+ position: context2.position,
16666
+ id: name,
16667
+ deferred,
16668
+ index,
16669
+ container
16670
+ }));
16671
+ return deferred;
16672
+ }
16673
+ let inst;
16674
+ function only(props, options3) {
16675
+ if (!inst) {
16676
+ inst = executor(props, options3);
16677
+ inst.finally(() => inst = void 0);
16678
+ }
16679
+ return inst;
16680
+ }
16681
+ function caller(props, overrides) {
16682
+ const opts = { ...options2, ...overrides };
16683
+ return opts.only ? only(props, opts) : executor(props, opts);
16684
+ }
16685
+ return caller;
16686
+ }
16687
+ function render2(instance, props, options2) {
16688
+ return define(instance, options2)(props);
16689
+ }
16690
+ return { define, render: render2 };
16691
+ }
16692
+ watchClickPosition();
16693
+
16694
+ // ../@core/src/utils/util.ts
16695
+ function noop() {
16696
+ }
16697
+ function delay(milliseconds) {
16698
+ return new Promise((confirm) => setTimeout(confirm, milliseconds));
16699
+ }
16700
+
16701
+ // ../../node_modules/.pnpm/@vueuse+shared@10.11.1_vue@3.3.2/node_modules/@vueuse/shared/index.mjs
16556
16702
  var isClient = typeof window !== "undefined" && typeof document !== "undefined";
16557
16703
  var isWorker = typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
16558
16704
  var isDef = (val) => typeof val !== "undefined";
@@ -16570,7 +16716,7 @@ ${codeFrame}` : message);
16570
16716
  return str.replace(camelizeRE2, (_, c) => c ? c.toUpperCase() : "");
16571
16717
  });
16572
16718
 
16573
- // ../../node_modules/.pnpm/@vueuse+core@10.9.0_vue@3.3.2/node_modules/@vueuse/core/index.mjs
16719
+ // ../../node_modules/.pnpm/@vueuse+core@10.11.1_vue@3.3.2/node_modules/@vueuse/core/index.mjs
16574
16720
  var defaultDocument = isClient ? window.document : void 0;
16575
16721
  var defaultNavigator = isClient ? window.navigator : void 0;
16576
16722
  var defaultLocation = isClient ? window.location : void 0;
@@ -16655,118 +16801,8 @@ ${codeFrame}` : message);
16655
16801
  }
16656
16802
  }
16657
16803
 
16658
- // ../@core/src/define/global.ts
16659
- var UnifiedOverlayProviderID = "unified-overlay";
16660
- function defineGlobalElement(id = "", root = document.body) {
16661
- const el = document.createElement("div");
16662
- if (id)
16663
- el.id = id;
16664
- if (root !== false)
16665
- root.appendChild(el);
16666
- return el;
16667
- }
16668
-
16669
- // ../@core/src/internal/index.ts
16670
- var context2 = {
16671
- position: null,
16672
- spaces: {}
16673
- };
16674
-
16675
- // ../@core/src/define/name-index.ts
16676
- function defineName(id = UnifiedOverlayProviderID, auto = true) {
16677
- if (!context2.spaces[id])
16678
- context2.spaces[id] = 0;
16679
- if (auto)
16680
- return `${id}--${++context2.spaces[id]}`;
16681
- return id;
16682
- }
16683
- function getIndex(id = UnifiedOverlayProviderID) {
16684
- return context2.spaces[id] || 0;
16685
- }
16686
-
16687
- // ../@core/src/deferred.ts
16688
- function createDeferred() {
16689
- let resolve2, reject;
16690
- const promise = new Promise((_resolve, _reject) => {
16691
- resolve2 = _resolve;
16692
- reject = _reject;
16693
- });
16694
- promise.resolve = (v) => {
16695
- resolve2(v);
16696
- return promise;
16697
- };
16698
- promise.reject = reject;
16699
- return promise;
16700
- }
16701
-
16702
- // ../@core/src/events/index.ts
16703
- function watchClickPosition() {
16704
- if (typeof window === "undefined" && typeof document === "undefined")
16705
- return;
16706
- document.addEventListener("click", (event) => {
16707
- if (event.target instanceof Element) {
16708
- const { left, top, width, height } = event.target.getBoundingClientRect();
16709
- if (left > 0 || top > 0) {
16710
- context2.position = { x: left + width / 2, y: top + height / 2 };
16711
- } else {
16712
- context2.position = null;
16713
- }
16714
- } else {
16715
- context2.position = null;
16716
- }
16717
- setTimeout(() => context2.position = null, 64);
16718
- });
16719
- }
16720
-
16721
- // ../@core/src/constructor.ts
16722
- function createConstructor(mount, options = {}) {
16723
- const { container: globalContainer } = options;
16724
- function define2(instance, options2) {
16725
- function executor(props, options3) {
16726
- const deferred = createDeferred();
16727
- const name = defineName(options3.id, options3.autoIncrement);
16728
- const index = getIndex(options3.id);
16729
- const root = globalContainer ? options3.root : document.body;
16730
- const container = defineGlobalElement(name, root);
16731
- mount(instance, props, Object.assign(options3, {
16732
- position: context2.position,
16733
- id: name,
16734
- deferred,
16735
- index,
16736
- container
16737
- }));
16738
- return deferred;
16739
- }
16740
- let inst;
16741
- function only(props, options3) {
16742
- if (!inst) {
16743
- inst = executor(props, options3);
16744
- inst.finally(() => inst = void 0);
16745
- }
16746
- return inst;
16747
- }
16748
- function caller(props, overrides) {
16749
- const opts = { ...options2, ...overrides };
16750
- return opts.only ? only(props, opts) : executor(props, opts);
16751
- }
16752
- return caller;
16753
- }
16754
- function render2(instance, props, options2) {
16755
- return define2(instance, options2)(props);
16756
- }
16757
- return { define: define2, render: render2 };
16758
- }
16759
- watchClickPosition();
16760
-
16761
- // ../@core/src/utils/util.ts
16762
- function noop2() {
16763
- }
16764
- function delay(milliseconds) {
16765
- return new Promise((resolve2) => setTimeout(resolve2, milliseconds));
16766
- }
16767
-
16768
- // src/composable/define.ts
16769
- function useExtendOverlay(options = {}) {
16804
+ // src/composable/disclosure.ts
16805
+ function useDisclosure(options = {}) {
16770
16806
  const { duration = 0, immediate = true, model = "visible", automatic = true } = options;
16771
16807
  const overlay = (0, lib_exports.inject)(ScriptsInjectionKey, useDeclarative(model, options));
16772
16808
  const dec = Reflect.get(overlay, "in_dec");
@@ -16785,43 +16821,30 @@ ${codeFrame}` : message);
16785
16821
  return overlay;
16786
16822
  }
16787
16823
  function useDeclarative(model, options = {}) {
16788
- const { reject = "reject", resolve: resolve2 = "resolve" } = options.events || {};
16824
+ const { cancel = "cancel", confirm = "confirm", close = "close" } = options.events || {};
16789
16825
  const instance = (0, lib_exports.getCurrentInstance)();
16790
16826
  if (!instance)
16791
- throw new Error("Please use useExtendOverlay in component setup");
16827
+ throw new Error("Please use useDisclosure in component setup");
16792
16828
  const visible = useVModel(instance.props, model, instance.emit, { passive: true });
16793
- const _reject = (value) => {
16794
- instance == null ? void 0 : instance.emit(reject, value);
16829
+ const _cancel = (value) => {
16830
+ instance == null ? void 0 : instance.emit(cancel, value);
16795
16831
  visible.value = false;
16796
16832
  };
16797
- const _resolve = (value) => {
16798
- instance == null ? void 0 : instance.emit(resolve2, value);
16833
+ const _confirm = (value) => {
16834
+ instance == null ? void 0 : instance.emit(confirm, value);
16799
16835
  visible.value = false;
16800
16836
  };
16801
- return {
16802
- reject: _reject,
16803
- resolve: _resolve,
16804
- vanish: noop2,
16805
- visible,
16806
- in_dec: true
16837
+ const _close = (value) => {
16838
+ instance == null ? void 0 : instance.emit(close, value);
16839
+ visible.value = false;
16807
16840
  };
16808
- }
16809
-
16810
- // src/composable/scripts.ts
16811
- function useScripts(options) {
16812
- const { reject: _reject } = options.deferred || {};
16813
- const { vanish: _vanish } = options;
16814
- const visible = (0, lib_exports.ref)(false);
16815
- function vanish() {
16816
- _vanish == null ? void 0 : _vanish();
16817
- _reject == null ? void 0 : _reject();
16818
- }
16819
16841
  return {
16820
- resolve: options.deferred.resolve,
16821
- reject: options.deferred.reject,
16822
- deferred: options.deferred,
16842
+ cancel: _cancel,
16843
+ confirm: _confirm,
16844
+ close: _close,
16845
+ vanish: noop,
16823
16846
  visible,
16824
- vanish
16847
+ in_dec: true
16825
16848
  };
16826
16849
  }
16827
16850
 
@@ -16830,9 +16853,7 @@ ${codeFrame}` : message);
16830
16853
  __assign = Object.assign || function __assign2(t) {
16831
16854
  for (var s, i = 1, n = arguments.length; i < n; i++) {
16832
16855
  s = arguments[i];
16833
- for (var p2 in s)
16834
- if (Object.prototype.hasOwnProperty.call(s, p2))
16835
- t[p2] = s[p2];
16856
+ for (var p2 in s) if (Object.prototype.hasOwnProperty.call(s, p2)) t[p2] = s[p2];
16836
16857
  }
16837
16858
  return t;
16838
16859
  };
@@ -16885,32 +16906,25 @@ ${codeFrame}` : message);
16885
16906
  return noCase(input, __assign({ delimiter: "", transform: pascalCaseTransform }, options));
16886
16907
  }
16887
16908
 
16888
- // src/composable/holder.ts
16889
- function useOverlayHolder(component, options = {}) {
16890
- const { callback, scripts, props, refresh } = useRefreshMetadata();
16891
- const name = defineName(options.id, options.autoIncrement);
16892
- function render2() {
16893
- return (0, lib_exports.h)(
16894
- lib_exports.Teleport,
16895
- {
16896
- to: options.root || document.body,
16897
- disabled: options.root === false
16898
- },
16899
- (0, lib_exports.h)("div", { id: name }, [
16900
- (0, lib_exports.h)(component, props.value)
16901
- ])
16902
- );
16909
+ // src/composable/utils/index.ts
16910
+ function createScripts(options) {
16911
+ const { cancel: _cancel } = options.deferred || {};
16912
+ const { vanish: _vanish } = options;
16913
+ const visible = (0, lib_exports.ref)(false);
16914
+ function vanish() {
16915
+ _vanish == null ? void 0 : _vanish();
16916
+ _cancel == null ? void 0 : _cancel();
16903
16917
  }
16904
- const Holder = (0, lib_exports.defineComponent)({
16905
- name: pascalCase(name),
16906
- setup() {
16907
- (0, lib_exports.provide)(ScriptsInjectionKey, scripts);
16908
- return () => refresh.value ? render2() : null;
16909
- }
16910
- });
16911
- return [Holder, callback];
16918
+ return {
16919
+ confirm: options.deferred.confirm,
16920
+ cancel: options.deferred.cancel,
16921
+ close: () => options.deferred.confirm(),
16922
+ deferred: options.deferred,
16923
+ visible,
16924
+ vanish
16925
+ };
16912
16926
  }
16913
- function useRefreshMetadata() {
16927
+ function createRefreshMetadata() {
16914
16928
  const visible = (0, lib_exports.ref)(false);
16915
16929
  const refresh = (0, lib_exports.ref)(false);
16916
16930
  const props = (0, lib_exports.ref)();
@@ -16918,12 +16932,12 @@ ${codeFrame}` : message);
16918
16932
  function vanish() {
16919
16933
  refresh.value = false;
16920
16934
  props.value = {};
16921
- scripts.reject();
16935
+ scripts.cancel();
16922
16936
  }
16923
16937
  function callback(_props) {
16924
16938
  scripts.deferred = createDeferred();
16925
- scripts.resolve = scripts.deferred.resolve;
16926
- scripts.reject = scripts.deferred.reject;
16939
+ scripts.confirm = scripts.deferred.confirm;
16940
+ scripts.cancel = scripts.deferred.cancel;
16927
16941
  props.value = _props;
16928
16942
  refresh.value = true;
16929
16943
  return scripts.deferred;
@@ -16931,13 +16945,13 @@ ${codeFrame}` : message);
16931
16945
  return { callback, scripts, props, refresh };
16932
16946
  }
16933
16947
 
16934
- // src/composable/inject.ts
16935
- var { define } = createConstructor((Instance, props, options) => {
16948
+ // src/composable/overlay.ts
16949
+ var { define: defineInject } = createConstructor((Instance, props, options) => {
16936
16950
  const { id, deferred, render: render2, vanish: _vanish } = options;
16937
16951
  const InstanceWithProvider = (0, vue_exports.defineComponent)({
16938
16952
  name: pascalCase(id),
16939
16953
  setup: () => {
16940
- const scripts = useScripts({ vanish, deferred });
16954
+ const scripts = createScripts({ vanish, deferred });
16941
16955
  (0, vue_exports.provide)(ScriptsInjectionKey, scripts);
16942
16956
  },
16943
16957
  render: () => (0, vue_exports.h)(Instance, props)
@@ -16947,9 +16961,42 @@ ${codeFrame}` : message);
16947
16961
  }
16948
16962
  render2(InstanceWithProvider, props);
16949
16963
  }, { container: false });
16950
- function useOverlayInject(Instance) {
16951
- const { render: render2, vanish } = (0, vue_exports.inject)(InstancesInjectionKey);
16952
- return define(Instance, { render: render2, vanish });
16964
+ function defineHolder(component, options = {}) {
16965
+ const { callback, scripts, props, refresh } = createRefreshMetadata();
16966
+ const name = defineName(options.id, options.autoIncrement);
16967
+ function render2() {
16968
+ return (0, vue_exports.h)(
16969
+ vue_exports.Teleport,
16970
+ {
16971
+ to: options.root || document.body,
16972
+ disabled: options.root === false
16973
+ },
16974
+ (0, vue_exports.h)("div", { id: name }, [
16975
+ (0, vue_exports.h)(component, props.value)
16976
+ ])
16977
+ );
16978
+ }
16979
+ const Holder = (0, vue_exports.defineComponent)({
16980
+ name: pascalCase(name),
16981
+ setup() {
16982
+ (0, vue_exports.provide)(ScriptsInjectionKey, scripts);
16983
+ return () => refresh.value ? render2() : null;
16984
+ }
16985
+ });
16986
+ return [
16987
+ Holder,
16988
+ callback
16989
+ ];
16990
+ }
16991
+ function useOverlay(Instance, options = {}) {
16992
+ const { type = "inject" } = options != null ? options : {};
16993
+ if (type === "inject") {
16994
+ const { render: render2, vanish } = (0, vue_exports.inject)(InstancesInjectionKey);
16995
+ return defineInject(Instance, { render: render2, vanish });
16996
+ }
16997
+ if (type === "holder") {
16998
+ return defineHolder(Instance, options);
16999
+ }
16953
17000
  }
16954
17001
 
16955
17002
  // src/utils/index.ts
@@ -16972,7 +17019,7 @@ ${codeFrame}` : message);
16972
17019
  const InstanceWithProvider = (0, lib_exports.defineComponent)({
16973
17020
  name: pascalCase(id),
16974
17021
  setup: () => {
16975
- const scripts = useScripts({
17022
+ const scripts = createScripts({
16976
17023
  vanish,
16977
17024
  deferred
16978
17025
  });
@@ -16990,53 +17037,11 @@ ${codeFrame}` : message);
16990
17037
  var defineOverlay = constructor.define;
16991
17038
  var renderOverlay = constructor.render;
16992
17039
 
16993
- // src/components/Field.ts
16994
- var Field = (0, vue_exports.defineComponent)({
16995
- name: "Field",
16996
- props: {
16997
- is: {
16998
- type: [String, Number, Object],
16999
- default: ""
17000
- }
17001
- },
17002
- setup(props) {
17003
- return () => {
17004
- if (typeof props.is === "string" || typeof props.is === "number")
17005
- return props.is;
17006
- return props.is ? (0, vue_exports.h)(props.is) : null;
17007
- };
17008
- }
17009
- });
17010
-
17011
- // src/components/Provider.ts
17012
- var OverlaysProvider = (0, lib_exports.defineComponent)({
17013
- setup(_, { slots }) {
17014
- const instances = (0, lib_exports.ref)([]);
17015
- function render2(Instance, props) {
17016
- console.log({ Instance, props });
17017
- instances.value.push({ Instance: (0, vue_exports.markRaw)(Instance), props });
17018
- }
17019
- function vanish(instance) {
17020
- instances.value = instances.value.filter(({ Instance }) => Instance !== instance);
17021
- }
17022
- (0, lib_exports.provide)(InstancesInjectionKey, { render: render2, vanish });
17023
- return () => {
17024
- var _a;
17025
- return (0, lib_exports.h)(lib_exports.Fragment, [
17026
- ...instances.value.map(
17027
- ({ Instance, props }, index) => (0, lib_exports.h)(Instance, { ...props, key: index })
17028
- ),
17029
- (_a = slots.default) == null ? void 0 : _a.call(slots)
17030
- ]);
17031
- };
17032
- }
17033
- });
17034
-
17035
17040
  // src/index.ts
17036
17041
  function install2(app) {
17037
17042
  context.appContext = app._context;
17038
17043
  }
17039
17044
  var unoverlay = { install: install2 };
17040
- var src_default = unoverlay;
17041
- return __toCommonJS(src_exports);
17045
+ var index_default = unoverlay;
17046
+ return __toCommonJS(index_exports);
17042
17047
  })();