@overlastic/vue 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 +142 -132
- package/dist/index.d.cts +62 -55
- package/dist/index.d.ts +62 -55
- package/dist/index.global.js +318 -312
- package/dist/index.js +133 -122
- package/package.json +4 -4
package/dist/index.global.js
CHANGED
|
@@ -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:
|
|
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 =
|
|
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 =
|
|
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
|
|
9155
|
+
const Component = instance.type;
|
|
9159
9156
|
if (type === COMPONENTS) {
|
|
9160
9157
|
const selfName = getComponentName(
|
|
9161
|
-
|
|
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
|
|
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] ||
|
|
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
|
|
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((
|
|
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:
|
|
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 !==
|
|
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(
|
|
10559
|
-
callWithErrorHandling(
|
|
10555
|
+
if (isFunction(ref6)) {
|
|
10556
|
+
callWithErrorHandling(ref6, owner, 12, [value, refs]);
|
|
10560
10557
|
} else {
|
|
10561
|
-
const _isString = isString(
|
|
10562
|
-
const _isRef = isRef(
|
|
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,
|
|
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[
|
|
10573
|
-
if (hasOwn(setupState,
|
|
10574
|
-
setupState[
|
|
10569
|
+
refs[ref6] = [refValue];
|
|
10570
|
+
if (hasOwn(setupState, ref6)) {
|
|
10571
|
+
setupState[ref6] = refs[ref6];
|
|
10575
10572
|
}
|
|
10576
10573
|
} else {
|
|
10577
|
-
|
|
10574
|
+
ref6.value = [refValue];
|
|
10578
10575
|
if (rawRef.k)
|
|
10579
|
-
refs[rawRef.k] =
|
|
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[
|
|
10587
|
-
if (hasOwn(setupState,
|
|
10588
|
-
setupState[
|
|
10583
|
+
refs[ref6] = value;
|
|
10584
|
+
if (hasOwn(setupState, ref6)) {
|
|
10585
|
+
setupState[ref6] = value;
|
|
10589
10586
|
}
|
|
10590
10587
|
} else if (_isRef) {
|
|
10591
|
-
|
|
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:",
|
|
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:",
|
|
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:
|
|
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 (
|
|
10796
|
-
setRef(
|
|
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:
|
|
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 (
|
|
11189
|
-
setRef(
|
|
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:
|
|
12278
|
+
ref: ref6,
|
|
12282
12279
|
children,
|
|
12283
12280
|
dynamicChildren,
|
|
12284
12281
|
shapeFlag,
|
|
12285
12282
|
patchFlag,
|
|
12286
12283
|
dirs
|
|
12287
12284
|
} = vnode;
|
|
12288
|
-
if (
|
|
12289
|
-
setRef(
|
|
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:
|
|
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 &&
|
|
12816
|
-
) :
|
|
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
|
|
13072
|
+
const Component = instance.type;
|
|
13076
13073
|
if (process.env.NODE_ENV !== "production") {
|
|
13077
|
-
if (
|
|
13078
|
-
validateComponentName(
|
|
13074
|
+
if (Component.name) {
|
|
13075
|
+
validateComponentName(Component.name, instance.appContext.config);
|
|
13079
13076
|
}
|
|
13080
|
-
if (
|
|
13081
|
-
const names = Object.keys(
|
|
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 (
|
|
13087
|
-
const names = Object.keys(
|
|
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 (
|
|
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 } =
|
|
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 =
|
|
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
|
|
13173
|
+
const Component = instance.type;
|
|
13177
13174
|
if (!instance.render) {
|
|
13178
|
-
if (!isSSR && compile2 && !
|
|
13179
|
-
const 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 } =
|
|
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
|
-
|
|
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 =
|
|
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" && !
|
|
13215
|
-
if (!compile2 &&
|
|
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(
|
|
13323
|
-
return isFunction(
|
|
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,
|
|
13326
|
-
let name = getComponentName(
|
|
13327
|
-
if (!name &&
|
|
13328
|
-
const match =
|
|
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] ===
|
|
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:
|
|
14612
|
+
ref: ref6,
|
|
14616
14613
|
ref_key,
|
|
14617
14614
|
ref_for
|
|
14618
14615
|
}) => {
|
|
14619
|
-
if (typeof
|
|
14620
|
-
|
|
14616
|
+
if (typeof ref6 === "number") {
|
|
14617
|
+
ref6 = "" + ref6;
|
|
14621
14618
|
}
|
|
14622
|
-
return
|
|
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
|
|
16496
|
-
__export(
|
|
16490
|
+
var index_exports = {};
|
|
16491
|
+
__export(index_exports, {
|
|
16497
16492
|
Field: () => Field,
|
|
16498
16493
|
OverlaysProvider: () => OverlaysProvider,
|
|
16499
|
-
default: () =>
|
|
16494
|
+
default: () => index_default,
|
|
16500
16495
|
defineOverlay: () => defineOverlay,
|
|
16501
16496
|
install: () => install2,
|
|
16502
16497
|
renderOverlay: () => renderOverlay,
|
|
16503
|
-
|
|
16504
|
-
|
|
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
|
|
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
|
-
//
|
|
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.
|
|
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,117 +16801,8 @@ ${codeFrame}` : message);
|
|
|
16655
16801
|
}
|
|
16656
16802
|
}
|
|
16657
16803
|
|
|
16658
|
-
//
|
|
16659
|
-
|
|
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 container = globalContainer ? defineGlobalElement(name, options3.root) : document.body;
|
|
16730
|
-
mount(instance, props, Object.assign(options3, {
|
|
16731
|
-
position: context2.position,
|
|
16732
|
-
id: name,
|
|
16733
|
-
deferred,
|
|
16734
|
-
index,
|
|
16735
|
-
container
|
|
16736
|
-
}));
|
|
16737
|
-
return deferred;
|
|
16738
|
-
}
|
|
16739
|
-
let inst;
|
|
16740
|
-
function only(props, options3) {
|
|
16741
|
-
if (!inst) {
|
|
16742
|
-
inst = executor(props, options3);
|
|
16743
|
-
inst.finally(() => inst = void 0);
|
|
16744
|
-
}
|
|
16745
|
-
return inst;
|
|
16746
|
-
}
|
|
16747
|
-
function caller(props, overrides) {
|
|
16748
|
-
const opts = { ...options2, ...overrides };
|
|
16749
|
-
return opts.only ? only(props, opts) : executor(props, opts);
|
|
16750
|
-
}
|
|
16751
|
-
return caller;
|
|
16752
|
-
}
|
|
16753
|
-
function render2(instance, props, options2) {
|
|
16754
|
-
return define2(instance, options2)(props);
|
|
16755
|
-
}
|
|
16756
|
-
return { define: define2, render: render2 };
|
|
16757
|
-
}
|
|
16758
|
-
watchClickPosition();
|
|
16759
|
-
|
|
16760
|
-
// ../@core/src/utils/util.ts
|
|
16761
|
-
function noop2() {
|
|
16762
|
-
}
|
|
16763
|
-
function delay(milliseconds) {
|
|
16764
|
-
return new Promise((resolve2) => setTimeout(resolve2, milliseconds));
|
|
16765
|
-
}
|
|
16766
|
-
|
|
16767
|
-
// src/composable/define.ts
|
|
16768
|
-
function useExtendOverlay(options = {}) {
|
|
16804
|
+
// src/composable/disclosure.ts
|
|
16805
|
+
function useDisclosure(options = {}) {
|
|
16769
16806
|
const { duration = 0, immediate = true, model = "visible", automatic = true } = options;
|
|
16770
16807
|
const overlay = (0, lib_exports.inject)(ScriptsInjectionKey, useDeclarative(model, options));
|
|
16771
16808
|
const dec = Reflect.get(overlay, "in_dec");
|
|
@@ -16784,43 +16821,30 @@ ${codeFrame}` : message);
|
|
|
16784
16821
|
return overlay;
|
|
16785
16822
|
}
|
|
16786
16823
|
function useDeclarative(model, options = {}) {
|
|
16787
|
-
const {
|
|
16824
|
+
const { cancel = "cancel", confirm = "confirm", close = "close" } = options.events || {};
|
|
16788
16825
|
const instance = (0, lib_exports.getCurrentInstance)();
|
|
16789
16826
|
if (!instance)
|
|
16790
|
-
throw new Error("Please use
|
|
16827
|
+
throw new Error("Please use useDisclosure in component setup");
|
|
16791
16828
|
const visible = useVModel(instance.props, model, instance.emit, { passive: true });
|
|
16792
|
-
const
|
|
16793
|
-
instance == null ? void 0 : instance.emit(
|
|
16829
|
+
const _cancel = (value) => {
|
|
16830
|
+
instance == null ? void 0 : instance.emit(cancel, value);
|
|
16794
16831
|
visible.value = false;
|
|
16795
16832
|
};
|
|
16796
|
-
const
|
|
16797
|
-
instance == null ? void 0 : instance.emit(
|
|
16833
|
+
const _confirm = (value) => {
|
|
16834
|
+
instance == null ? void 0 : instance.emit(confirm, value);
|
|
16798
16835
|
visible.value = false;
|
|
16799
16836
|
};
|
|
16800
|
-
|
|
16801
|
-
|
|
16802
|
-
|
|
16803
|
-
vanish: noop2,
|
|
16804
|
-
visible,
|
|
16805
|
-
in_dec: true
|
|
16837
|
+
const _close = (value) => {
|
|
16838
|
+
instance == null ? void 0 : instance.emit(close, value);
|
|
16839
|
+
visible.value = false;
|
|
16806
16840
|
};
|
|
16807
|
-
}
|
|
16808
|
-
|
|
16809
|
-
// src/composable/scripts.ts
|
|
16810
|
-
function useScripts(options) {
|
|
16811
|
-
const { reject: _reject } = options.deferred || {};
|
|
16812
|
-
const { vanish: _vanish } = options;
|
|
16813
|
-
const visible = (0, lib_exports.ref)(false);
|
|
16814
|
-
function vanish() {
|
|
16815
|
-
_vanish == null ? void 0 : _vanish();
|
|
16816
|
-
_reject == null ? void 0 : _reject();
|
|
16817
|
-
}
|
|
16818
16841
|
return {
|
|
16819
|
-
|
|
16820
|
-
|
|
16821
|
-
|
|
16842
|
+
cancel: _cancel,
|
|
16843
|
+
confirm: _confirm,
|
|
16844
|
+
close: _close,
|
|
16845
|
+
vanish: noop,
|
|
16822
16846
|
visible,
|
|
16823
|
-
|
|
16847
|
+
in_dec: true
|
|
16824
16848
|
};
|
|
16825
16849
|
}
|
|
16826
16850
|
|
|
@@ -16829,9 +16853,7 @@ ${codeFrame}` : message);
|
|
|
16829
16853
|
__assign = Object.assign || function __assign2(t) {
|
|
16830
16854
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
16831
16855
|
s = arguments[i];
|
|
16832
|
-
for (var p2 in s)
|
|
16833
|
-
if (Object.prototype.hasOwnProperty.call(s, p2))
|
|
16834
|
-
t[p2] = s[p2];
|
|
16856
|
+
for (var p2 in s) if (Object.prototype.hasOwnProperty.call(s, p2)) t[p2] = s[p2];
|
|
16835
16857
|
}
|
|
16836
16858
|
return t;
|
|
16837
16859
|
};
|
|
@@ -16884,32 +16906,25 @@ ${codeFrame}` : message);
|
|
|
16884
16906
|
return noCase(input, __assign({ delimiter: "", transform: pascalCaseTransform }, options));
|
|
16885
16907
|
}
|
|
16886
16908
|
|
|
16887
|
-
// src/composable/
|
|
16888
|
-
function
|
|
16889
|
-
const {
|
|
16890
|
-
const
|
|
16891
|
-
|
|
16892
|
-
|
|
16893
|
-
|
|
16894
|
-
|
|
16895
|
-
to: options.root || document.body,
|
|
16896
|
-
disabled: options.root === false
|
|
16897
|
-
},
|
|
16898
|
-
(0, lib_exports.h)("div", { id: name }, [
|
|
16899
|
-
(0, lib_exports.h)(component, props.value)
|
|
16900
|
-
])
|
|
16901
|
-
);
|
|
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();
|
|
16902
16917
|
}
|
|
16903
|
-
|
|
16904
|
-
|
|
16905
|
-
|
|
16906
|
-
|
|
16907
|
-
|
|
16908
|
-
|
|
16909
|
-
|
|
16910
|
-
|
|
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
|
+
};
|
|
16911
16926
|
}
|
|
16912
|
-
function
|
|
16927
|
+
function createRefreshMetadata() {
|
|
16913
16928
|
const visible = (0, lib_exports.ref)(false);
|
|
16914
16929
|
const refresh = (0, lib_exports.ref)(false);
|
|
16915
16930
|
const props = (0, lib_exports.ref)();
|
|
@@ -16917,12 +16932,12 @@ ${codeFrame}` : message);
|
|
|
16917
16932
|
function vanish() {
|
|
16918
16933
|
refresh.value = false;
|
|
16919
16934
|
props.value = {};
|
|
16920
|
-
scripts.
|
|
16935
|
+
scripts.cancel();
|
|
16921
16936
|
}
|
|
16922
16937
|
function callback(_props) {
|
|
16923
16938
|
scripts.deferred = createDeferred();
|
|
16924
|
-
scripts.
|
|
16925
|
-
scripts.
|
|
16939
|
+
scripts.confirm = scripts.deferred.confirm;
|
|
16940
|
+
scripts.cancel = scripts.deferred.cancel;
|
|
16926
16941
|
props.value = _props;
|
|
16927
16942
|
refresh.value = true;
|
|
16928
16943
|
return scripts.deferred;
|
|
@@ -16930,13 +16945,13 @@ ${codeFrame}` : message);
|
|
|
16930
16945
|
return { callback, scripts, props, refresh };
|
|
16931
16946
|
}
|
|
16932
16947
|
|
|
16933
|
-
// src/composable/
|
|
16934
|
-
var { define } = createConstructor((Instance, props, options) => {
|
|
16948
|
+
// src/composable/overlay.ts
|
|
16949
|
+
var { define: defineInject } = createConstructor((Instance, props, options) => {
|
|
16935
16950
|
const { id, deferred, render: render2, vanish: _vanish } = options;
|
|
16936
16951
|
const InstanceWithProvider = (0, vue_exports.defineComponent)({
|
|
16937
16952
|
name: pascalCase(id),
|
|
16938
16953
|
setup: () => {
|
|
16939
|
-
const scripts =
|
|
16954
|
+
const scripts = createScripts({ vanish, deferred });
|
|
16940
16955
|
(0, vue_exports.provide)(ScriptsInjectionKey, scripts);
|
|
16941
16956
|
},
|
|
16942
16957
|
render: () => (0, vue_exports.h)(Instance, props)
|
|
@@ -16946,9 +16961,42 @@ ${codeFrame}` : message);
|
|
|
16946
16961
|
}
|
|
16947
16962
|
render2(InstanceWithProvider, props);
|
|
16948
16963
|
}, { container: false });
|
|
16949
|
-
function
|
|
16950
|
-
const {
|
|
16951
|
-
|
|
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
|
+
}
|
|
16952
17000
|
}
|
|
16953
17001
|
|
|
16954
17002
|
// src/utils/index.ts
|
|
@@ -16971,7 +17019,7 @@ ${codeFrame}` : message);
|
|
|
16971
17019
|
const InstanceWithProvider = (0, lib_exports.defineComponent)({
|
|
16972
17020
|
name: pascalCase(id),
|
|
16973
17021
|
setup: () => {
|
|
16974
|
-
const scripts =
|
|
17022
|
+
const scripts = createScripts({
|
|
16975
17023
|
vanish,
|
|
16976
17024
|
deferred
|
|
16977
17025
|
});
|
|
@@ -16989,53 +17037,11 @@ ${codeFrame}` : message);
|
|
|
16989
17037
|
var defineOverlay = constructor.define;
|
|
16990
17038
|
var renderOverlay = constructor.render;
|
|
16991
17039
|
|
|
16992
|
-
// src/components/Field.ts
|
|
16993
|
-
var Field = (0, vue_exports.defineComponent)({
|
|
16994
|
-
name: "Field",
|
|
16995
|
-
props: {
|
|
16996
|
-
is: {
|
|
16997
|
-
type: [String, Number, Object],
|
|
16998
|
-
default: ""
|
|
16999
|
-
}
|
|
17000
|
-
},
|
|
17001
|
-
setup(props) {
|
|
17002
|
-
return () => {
|
|
17003
|
-
if (typeof props.is === "string" || typeof props.is === "number")
|
|
17004
|
-
return props.is;
|
|
17005
|
-
return props.is ? (0, vue_exports.h)(props.is) : null;
|
|
17006
|
-
};
|
|
17007
|
-
}
|
|
17008
|
-
});
|
|
17009
|
-
|
|
17010
|
-
// src/components/Provider.ts
|
|
17011
|
-
var OverlaysProvider = (0, lib_exports.defineComponent)({
|
|
17012
|
-
setup(_, { slots }) {
|
|
17013
|
-
const instances = (0, lib_exports.ref)([]);
|
|
17014
|
-
function render2(Instance, props) {
|
|
17015
|
-
console.log({ Instance, props });
|
|
17016
|
-
instances.value.push({ Instance: (0, vue_exports.markRaw)(Instance), props });
|
|
17017
|
-
}
|
|
17018
|
-
function vanish(instance) {
|
|
17019
|
-
instances.value = instances.value.filter(({ Instance }) => Instance !== instance);
|
|
17020
|
-
}
|
|
17021
|
-
(0, lib_exports.provide)(InstancesInjectionKey, { render: render2, vanish });
|
|
17022
|
-
return () => {
|
|
17023
|
-
var _a;
|
|
17024
|
-
return (0, lib_exports.h)(lib_exports.Fragment, [
|
|
17025
|
-
...instances.value.map(
|
|
17026
|
-
({ Instance, props }, index) => (0, lib_exports.h)(Instance, { ...props, key: index })
|
|
17027
|
-
),
|
|
17028
|
-
(_a = slots.default) == null ? void 0 : _a.call(slots)
|
|
17029
|
-
]);
|
|
17030
|
-
};
|
|
17031
|
-
}
|
|
17032
|
-
});
|
|
17033
|
-
|
|
17034
17040
|
// src/index.ts
|
|
17035
17041
|
function install2(app) {
|
|
17036
17042
|
context.appContext = app._context;
|
|
17037
17043
|
}
|
|
17038
17044
|
var unoverlay = { install: install2 };
|
|
17039
|
-
var
|
|
17040
|
-
return __toCommonJS(
|
|
17045
|
+
var index_default = unoverlay;
|
|
17046
|
+
return __toCommonJS(index_exports);
|
|
17041
17047
|
})();
|