@vue/runtime-dom 3.5.0-alpha.5 → 3.5.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/runtime-dom.cjs.js +258 -48
- package/dist/runtime-dom.cjs.prod.js +215 -46
- package/dist/runtime-dom.d.ts +60 -40
- package/dist/runtime-dom.esm-browser.js +450 -158
- package/dist/runtime-dom.esm-browser.prod.js +2 -2
- package/dist/runtime-dom.esm-bundler.js +267 -53
- package/dist/runtime-dom.global.js +442 -154
- package/dist/runtime-dom.global.prod.js +2 -2
- package/package.json +7 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.5.0-
|
|
2
|
+
* @vue/runtime-dom v3.5.0-beta.1
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -64,9 +64,11 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
64
64
|
};
|
|
65
65
|
};
|
|
66
66
|
const camelizeRE = /-(\w)/g;
|
|
67
|
-
const camelize = cacheStringFunction(
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
const camelize = cacheStringFunction(
|
|
68
|
+
(str) => {
|
|
69
|
+
return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
|
|
70
|
+
}
|
|
71
|
+
);
|
|
70
72
|
const hyphenateRE = /\B([A-Z])/g;
|
|
71
73
|
const hyphenate = cacheStringFunction(
|
|
72
74
|
(str) => str.replace(hyphenateRE, "-$1").toLowerCase()
|
|
@@ -74,10 +76,12 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
74
76
|
const capitalize = cacheStringFunction((str) => {
|
|
75
77
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
76
78
|
});
|
|
77
|
-
const toHandlerKey = cacheStringFunction(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
const toHandlerKey = cacheStringFunction(
|
|
80
|
+
(str) => {
|
|
81
|
+
const s = str ? `on${capitalize(str)}` : ``;
|
|
82
|
+
return s;
|
|
83
|
+
}
|
|
84
|
+
);
|
|
81
85
|
const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
|
|
82
86
|
const invokeArrayFns = (fns, ...arg) => {
|
|
83
87
|
for (let i = 0; i < fns.length; i++) {
|
|
@@ -322,6 +326,7 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
322
326
|
* @internal
|
|
323
327
|
*/
|
|
324
328
|
this.cleanups = [];
|
|
329
|
+
this._isPaused = false;
|
|
325
330
|
this.parent = activeEffectScope;
|
|
326
331
|
if (!detached && activeEffectScope) {
|
|
327
332
|
this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
|
|
@@ -332,6 +337,37 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
332
337
|
get active() {
|
|
333
338
|
return this._active;
|
|
334
339
|
}
|
|
340
|
+
pause() {
|
|
341
|
+
if (this._active) {
|
|
342
|
+
this._isPaused = true;
|
|
343
|
+
if (this.scopes) {
|
|
344
|
+
for (let i = 0, l = this.scopes.length; i < l; i++) {
|
|
345
|
+
this.scopes[i].pause();
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
for (let i = 0, l = this.effects.length; i < l; i++) {
|
|
349
|
+
this.effects[i].pause();
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Resumes the effect scope, including all child scopes and effects.
|
|
355
|
+
*/
|
|
356
|
+
resume() {
|
|
357
|
+
if (this._active) {
|
|
358
|
+
if (this._isPaused) {
|
|
359
|
+
this._isPaused = false;
|
|
360
|
+
if (this.scopes) {
|
|
361
|
+
for (let i = 0, l = this.scopes.length; i < l; i++) {
|
|
362
|
+
this.scopes[i].resume();
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
for (let i = 0, l = this.effects.length; i < l; i++) {
|
|
366
|
+
this.effects[i].resume();
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
335
371
|
run(fn) {
|
|
336
372
|
if (this._active) {
|
|
337
373
|
const currentEffectScope = activeEffectScope;
|
|
@@ -402,6 +438,7 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
402
438
|
}
|
|
403
439
|
|
|
404
440
|
let activeSub;
|
|
441
|
+
const pausedQueueEffects = /* @__PURE__ */ new WeakSet();
|
|
405
442
|
class ReactiveEffect {
|
|
406
443
|
constructor(fn) {
|
|
407
444
|
this.fn = fn;
|
|
@@ -430,6 +467,18 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
430
467
|
activeEffectScope.effects.push(this);
|
|
431
468
|
}
|
|
432
469
|
}
|
|
470
|
+
pause() {
|
|
471
|
+
this.flags |= 128;
|
|
472
|
+
}
|
|
473
|
+
resume() {
|
|
474
|
+
if (this.flags & 128) {
|
|
475
|
+
this.flags &= ~128;
|
|
476
|
+
if (pausedQueueEffects.has(this)) {
|
|
477
|
+
pausedQueueEffects.delete(this);
|
|
478
|
+
this.trigger();
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
433
482
|
/**
|
|
434
483
|
* @internal
|
|
435
484
|
*/
|
|
@@ -483,7 +532,9 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
483
532
|
}
|
|
484
533
|
}
|
|
485
534
|
trigger() {
|
|
486
|
-
if (this.
|
|
535
|
+
if (this.flags & 128) {
|
|
536
|
+
pausedQueueEffects.add(this);
|
|
537
|
+
} else if (this.scheduler) {
|
|
487
538
|
this.scheduler();
|
|
488
539
|
} else {
|
|
489
540
|
this.runIfDirty();
|
|
@@ -803,9 +854,15 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
803
854
|
link.dep.subs = link;
|
|
804
855
|
}
|
|
805
856
|
const targetMap = /* @__PURE__ */ new WeakMap();
|
|
806
|
-
const ITERATE_KEY = Symbol(
|
|
807
|
-
|
|
808
|
-
|
|
857
|
+
const ITERATE_KEY = Symbol(
|
|
858
|
+
"Object iterate"
|
|
859
|
+
);
|
|
860
|
+
const MAP_KEY_ITERATE_KEY = Symbol(
|
|
861
|
+
"Map keys iterate"
|
|
862
|
+
);
|
|
863
|
+
const ARRAY_ITERATE_KEY = Symbol(
|
|
864
|
+
"Array iterate"
|
|
865
|
+
);
|
|
809
866
|
function track(target, type, key) {
|
|
810
867
|
if (shouldTrack && activeSub) {
|
|
811
868
|
let depsMap = targetMap.get(target);
|
|
@@ -1095,7 +1152,7 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
1095
1152
|
return isShallow2;
|
|
1096
1153
|
} else if (key === "__v_raw") {
|
|
1097
1154
|
if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
|
|
1098
|
-
// this means the
|
|
1155
|
+
// this means the receiver is a user proxy of the reactive proxy
|
|
1099
1156
|
Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
|
|
1100
1157
|
return target;
|
|
1101
1158
|
}
|
|
@@ -1219,9 +1276,7 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
1219
1276
|
}
|
|
1220
1277
|
const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
|
|
1221
1278
|
const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
|
|
1222
|
-
const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(
|
|
1223
|
-
true
|
|
1224
|
-
);
|
|
1279
|
+
const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true);
|
|
1225
1280
|
const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
|
|
1226
1281
|
|
|
1227
1282
|
const toShallow = (value) => value;
|
|
@@ -1716,13 +1771,14 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
1716
1771
|
class CustomRefImpl {
|
|
1717
1772
|
constructor(factory) {
|
|
1718
1773
|
this["__v_isRef"] = true;
|
|
1774
|
+
this._value = void 0;
|
|
1719
1775
|
const dep = this.dep = new Dep();
|
|
1720
1776
|
const { get, set } = factory(dep.track.bind(dep), dep.trigger.bind(dep));
|
|
1721
1777
|
this._get = get;
|
|
1722
1778
|
this._set = set;
|
|
1723
1779
|
}
|
|
1724
1780
|
get value() {
|
|
1725
|
-
return this._get();
|
|
1781
|
+
return this._value = this._get();
|
|
1726
1782
|
}
|
|
1727
1783
|
set value(newVal) {
|
|
1728
1784
|
this._set(newVal);
|
|
@@ -1747,10 +1803,11 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
1747
1803
|
this._key = _key;
|
|
1748
1804
|
this._defaultValue = _defaultValue;
|
|
1749
1805
|
this["__v_isRef"] = true;
|
|
1806
|
+
this._value = void 0;
|
|
1750
1807
|
}
|
|
1751
1808
|
get value() {
|
|
1752
1809
|
const val = this._object[this._key];
|
|
1753
|
-
return val === void 0 ? this._defaultValue : val;
|
|
1810
|
+
return this._value = val === void 0 ? this._defaultValue : val;
|
|
1754
1811
|
}
|
|
1755
1812
|
set value(newVal) {
|
|
1756
1813
|
this._object[this._key] = newVal;
|
|
@@ -1764,9 +1821,10 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
1764
1821
|
this._getter = _getter;
|
|
1765
1822
|
this["__v_isRef"] = true;
|
|
1766
1823
|
this["__v_isReadonly"] = true;
|
|
1824
|
+
this._value = void 0;
|
|
1767
1825
|
}
|
|
1768
1826
|
get value() {
|
|
1769
|
-
return this._getter();
|
|
1827
|
+
return this._value = this._getter();
|
|
1770
1828
|
}
|
|
1771
1829
|
}
|
|
1772
1830
|
function toRef(source, key, defaultValue) {
|
|
@@ -1800,7 +1858,8 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
1800
1858
|
/**
|
|
1801
1859
|
* @internal
|
|
1802
1860
|
*/
|
|
1803
|
-
this
|
|
1861
|
+
this.__v_isRef = true;
|
|
1862
|
+
// TODO isolatedDeclarations "__v_isReadonly"
|
|
1804
1863
|
// A computed is also a subscriber that tracks other deps
|
|
1805
1864
|
/**
|
|
1806
1865
|
* @internal
|
|
@@ -2425,6 +2484,9 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
2425
2484
|
"[HMR] Root or manually mounted instance modified. Full reload required."
|
|
2426
2485
|
);
|
|
2427
2486
|
}
|
|
2487
|
+
if (instance.root.ce && instance !== instance.root) {
|
|
2488
|
+
instance.root.ce._removeChildStyle(oldComp);
|
|
2489
|
+
}
|
|
2428
2490
|
}
|
|
2429
2491
|
queuePostFlushCb(() => {
|
|
2430
2492
|
hmrDirtyComponents.clear();
|
|
@@ -2504,9 +2566,7 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
2504
2566
|
function devtoolsUnmountApp(app) {
|
|
2505
2567
|
emit$1("app:unmount" /* APP_UNMOUNT */, app);
|
|
2506
2568
|
}
|
|
2507
|
-
const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook(
|
|
2508
|
-
"component:added" /* COMPONENT_ADDED */
|
|
2509
|
-
);
|
|
2569
|
+
const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook("component:added" /* COMPONENT_ADDED */);
|
|
2510
2570
|
const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook("component:updated" /* COMPONENT_UPDATED */);
|
|
2511
2571
|
const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook(
|
|
2512
2572
|
"component:removed" /* COMPONENT_REMOVED */
|
|
@@ -2530,12 +2590,8 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
2530
2590
|
);
|
|
2531
2591
|
};
|
|
2532
2592
|
}
|
|
2533
|
-
const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook(
|
|
2534
|
-
|
|
2535
|
-
);
|
|
2536
|
-
const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook(
|
|
2537
|
-
"perf:end" /* PERFORMANCE_END */
|
|
2538
|
-
);
|
|
2593
|
+
const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:start" /* PERFORMANCE_START */);
|
|
2594
|
+
const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:end" /* PERFORMANCE_END */);
|
|
2539
2595
|
function createDevtoolsPerformanceHook(hook) {
|
|
2540
2596
|
return (component, type, time) => {
|
|
2541
2597
|
emit$1(hook, component.appContext.app, component.uid, component, type, time);
|
|
@@ -3713,6 +3769,7 @@ Server rendered element contains more child nodes than client vdom.`
|
|
|
3713
3769
|
}
|
|
3714
3770
|
if (props) {
|
|
3715
3771
|
{
|
|
3772
|
+
const isCustomElement = el.tagName.includes("-");
|
|
3716
3773
|
for (const key in props) {
|
|
3717
3774
|
if (// #11189 skip if this node has directives that have created hooks
|
|
3718
3775
|
// as it could have mutated the DOM in any possible way
|
|
@@ -3720,7 +3777,7 @@ Server rendered element contains more child nodes than client vdom.`
|
|
|
3720
3777
|
logMismatchError();
|
|
3721
3778
|
}
|
|
3722
3779
|
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
|
|
3723
|
-
key[0] === ".") {
|
|
3780
|
+
key[0] === "." || isCustomElement) {
|
|
3724
3781
|
patchProp(el, key, null, props[key], void 0, parentComponent);
|
|
3725
3782
|
}
|
|
3726
3783
|
}
|
|
@@ -4045,24 +4102,19 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
4045
4102
|
}
|
|
4046
4103
|
}
|
|
4047
4104
|
|
|
4048
|
-
const hydrateOnIdle = () => (hydrate) => {
|
|
4049
|
-
const id = requestIdleCallback(hydrate);
|
|
4105
|
+
const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
|
|
4106
|
+
const id = requestIdleCallback(hydrate, { timeout });
|
|
4050
4107
|
return () => cancelIdleCallback(id);
|
|
4051
4108
|
};
|
|
4052
|
-
const hydrateOnVisible = (
|
|
4053
|
-
const ob = new IntersectionObserver(
|
|
4054
|
-
(entries)
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
break;
|
|
4060
|
-
}
|
|
4061
|
-
},
|
|
4062
|
-
{
|
|
4063
|
-
rootMargin: isString(margin) ? margin : margin + "px"
|
|
4109
|
+
const hydrateOnVisible = (opts) => (hydrate, forEach) => {
|
|
4110
|
+
const ob = new IntersectionObserver((entries) => {
|
|
4111
|
+
for (const e of entries) {
|
|
4112
|
+
if (!e.isIntersecting) continue;
|
|
4113
|
+
ob.disconnect();
|
|
4114
|
+
hydrate();
|
|
4115
|
+
break;
|
|
4064
4116
|
}
|
|
4065
|
-
);
|
|
4117
|
+
}, opts);
|
|
4066
4118
|
forEach((el) => ob.observe(el));
|
|
4067
4119
|
return () => ob.disconnect();
|
|
4068
4120
|
};
|
|
@@ -4371,7 +4423,7 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
4371
4423
|
}
|
|
4372
4424
|
function pruneCacheEntry(key) {
|
|
4373
4425
|
const cached = cache.get(key);
|
|
4374
|
-
if (!current || !isSameVNodeType(cached, current)) {
|
|
4426
|
+
if (cached && (!current || !isSameVNodeType(cached, current))) {
|
|
4375
4427
|
unmount(cached);
|
|
4376
4428
|
} else if (current) {
|
|
4377
4429
|
resetShapeFlag(current);
|
|
@@ -4433,6 +4485,10 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
4433
4485
|
return rawVNode;
|
|
4434
4486
|
}
|
|
4435
4487
|
let vnode = getInnerChild(rawVNode);
|
|
4488
|
+
if (vnode.type === Comment) {
|
|
4489
|
+
current = null;
|
|
4490
|
+
return vnode;
|
|
4491
|
+
}
|
|
4436
4492
|
const comp = vnode.type;
|
|
4437
4493
|
const name = getComponentName(
|
|
4438
4494
|
isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
|
|
@@ -4562,17 +4618,19 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
4562
4618
|
};
|
|
4563
4619
|
const onBeforeMount = createHook("bm");
|
|
4564
4620
|
const onMounted = createHook("m");
|
|
4565
|
-
const onBeforeUpdate = createHook(
|
|
4621
|
+
const onBeforeUpdate = createHook(
|
|
4622
|
+
"bu"
|
|
4623
|
+
);
|
|
4566
4624
|
const onUpdated = createHook("u");
|
|
4567
|
-
const onBeforeUnmount = createHook(
|
|
4568
|
-
|
|
4569
|
-
const onServerPrefetch = createHook("sp");
|
|
4570
|
-
const onRenderTriggered = createHook(
|
|
4571
|
-
"rtg"
|
|
4625
|
+
const onBeforeUnmount = createHook(
|
|
4626
|
+
"bum"
|
|
4572
4627
|
);
|
|
4573
|
-
const
|
|
4574
|
-
|
|
4628
|
+
const onUnmounted = createHook("um");
|
|
4629
|
+
const onServerPrefetch = createHook(
|
|
4630
|
+
"sp"
|
|
4575
4631
|
);
|
|
4632
|
+
const onRenderTriggered = createHook("rtg");
|
|
4633
|
+
const onRenderTracked = createHook("rtc");
|
|
4576
4634
|
function onErrorCaptured(hook, target = currentInstance) {
|
|
4577
4635
|
injectHook("ec", hook, target);
|
|
4578
4636
|
}
|
|
@@ -4699,9 +4757,14 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
4699
4757
|
}
|
|
4700
4758
|
|
|
4701
4759
|
function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
4702
|
-
if (currentRenderingInstance.
|
|
4760
|
+
if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
|
|
4703
4761
|
if (name !== "default") props.name = name;
|
|
4704
|
-
return
|
|
4762
|
+
return openBlock(), createBlock(
|
|
4763
|
+
Fragment,
|
|
4764
|
+
null,
|
|
4765
|
+
[createVNode("slot", props, fallback && fallback())],
|
|
4766
|
+
64
|
|
4767
|
+
);
|
|
4705
4768
|
}
|
|
4706
4769
|
let slot = slots[name];
|
|
4707
4770
|
if (slot && slot.length > 1) {
|
|
@@ -4774,6 +4837,7 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
4774
4837
|
$refs: (i) => shallowReadonly(i.refs) ,
|
|
4775
4838
|
$parent: (i) => getPublicInstance(i.parent),
|
|
4776
4839
|
$root: (i) => getPublicInstance(i.root),
|
|
4840
|
+
$host: (i) => i.ce,
|
|
4777
4841
|
$emit: (i) => i.emit,
|
|
4778
4842
|
$options: (i) => resolveMergedOptions(i) ,
|
|
4779
4843
|
$forceUpdate: (i) => i.f || (i.f = () => {
|
|
@@ -4925,29 +4989,25 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
4925
4989
|
return Reflect.ownKeys(target);
|
|
4926
4990
|
};
|
|
4927
4991
|
}
|
|
4928
|
-
const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend(
|
|
4929
|
-
{
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
key
|
|
4944
|
-
)} should not start with _ which is a reserved prefix for Vue internals.`
|
|
4945
|
-
);
|
|
4946
|
-
}
|
|
4947
|
-
return has;
|
|
4992
|
+
const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend({}, PublicInstanceProxyHandlers, {
|
|
4993
|
+
get(target, key) {
|
|
4994
|
+
if (key === Symbol.unscopables) {
|
|
4995
|
+
return;
|
|
4996
|
+
}
|
|
4997
|
+
return PublicInstanceProxyHandlers.get(target, key, target);
|
|
4998
|
+
},
|
|
4999
|
+
has(_, key) {
|
|
5000
|
+
const has = key[0] !== "_" && !isGloballyAllowed(key);
|
|
5001
|
+
if (!has && PublicInstanceProxyHandlers.has(_, key)) {
|
|
5002
|
+
warn$1(
|
|
5003
|
+
`Property ${JSON.stringify(
|
|
5004
|
+
key
|
|
5005
|
+
)} should not start with _ which is a reserved prefix for Vue internals.`
|
|
5006
|
+
);
|
|
4948
5007
|
}
|
|
5008
|
+
return has;
|
|
4949
5009
|
}
|
|
4950
|
-
);
|
|
5010
|
+
});
|
|
4951
5011
|
function createDevRenderContext(instance) {
|
|
4952
5012
|
const target = {};
|
|
4953
5013
|
Object.defineProperty(target, `_`, {
|
|
@@ -5646,7 +5706,7 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
5646
5706
|
If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
|
|
5647
5707
|
);
|
|
5648
5708
|
}
|
|
5649
|
-
const vnode = createVNode(rootComponent, rootProps);
|
|
5709
|
+
const vnode = app._ceVNode || createVNode(rootComponent, rootProps);
|
|
5650
5710
|
vnode.appContext = context;
|
|
5651
5711
|
if (namespace === true) {
|
|
5652
5712
|
namespace = "svg";
|
|
@@ -5748,7 +5808,7 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
5748
5808
|
function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
5749
5809
|
const instance = currentInstance || currentRenderingInstance;
|
|
5750
5810
|
if (instance || currentApp) {
|
|
5751
|
-
const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides :
|
|
5811
|
+
const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
|
|
5752
5812
|
if (provides && key in provides) {
|
|
5753
5813
|
return provides[key];
|
|
5754
5814
|
} else if (arguments.length > 1) {
|
|
@@ -5953,6 +6013,9 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
5953
6013
|
} else {
|
|
5954
6014
|
value = defaultValue;
|
|
5955
6015
|
}
|
|
6016
|
+
if (instance.ce) {
|
|
6017
|
+
instance.ce._setProp(key, value);
|
|
6018
|
+
}
|
|
5956
6019
|
}
|
|
5957
6020
|
if (opt[0 /* shouldCast */]) {
|
|
5958
6021
|
if (isAbsent && !hasDefault) {
|
|
@@ -6951,8 +7014,8 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
6951
7014
|
const componentUpdateFn = () => {
|
|
6952
7015
|
if (!instance.isMounted) {
|
|
6953
7016
|
let vnodeHook;
|
|
6954
|
-
const { el, props
|
|
6955
|
-
const { bm, m, parent } = instance;
|
|
7017
|
+
const { el, props } = initialVNode;
|
|
7018
|
+
const { bm, m, parent, root, type } = instance;
|
|
6956
7019
|
const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
|
|
6957
7020
|
toggleRecurse(instance, false);
|
|
6958
7021
|
if (bm) {
|
|
@@ -6995,6 +7058,9 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
6995
7058
|
hydrateSubTree();
|
|
6996
7059
|
}
|
|
6997
7060
|
} else {
|
|
7061
|
+
if (root.ce) {
|
|
7062
|
+
root.ce._injectChildStyle(type);
|
|
7063
|
+
}
|
|
6998
7064
|
{
|
|
6999
7065
|
startMeasure(instance, `render`);
|
|
7000
7066
|
}
|
|
@@ -7668,13 +7734,13 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
7668
7734
|
namespace
|
|
7669
7735
|
);
|
|
7670
7736
|
}
|
|
7737
|
+
container._vnode = vnode;
|
|
7671
7738
|
if (!isFlushing) {
|
|
7672
7739
|
isFlushing = true;
|
|
7673
7740
|
flushPreFlushCbs();
|
|
7674
7741
|
flushPostFlushCbs();
|
|
7675
7742
|
isFlushing = false;
|
|
7676
7743
|
}
|
|
7677
|
-
container._vnode = vnode;
|
|
7678
7744
|
};
|
|
7679
7745
|
const internals = {
|
|
7680
7746
|
p: patch,
|
|
@@ -7842,14 +7908,9 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
7842
7908
|
const _cb = cb;
|
|
7843
7909
|
cb = (...args) => {
|
|
7844
7910
|
_cb(...args);
|
|
7845
|
-
|
|
7911
|
+
watchHandle();
|
|
7846
7912
|
};
|
|
7847
7913
|
}
|
|
7848
|
-
if (deep !== void 0 && typeof deep === "number") {
|
|
7849
|
-
warn$1(
|
|
7850
|
-
`watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.`
|
|
7851
|
-
);
|
|
7852
|
-
}
|
|
7853
7914
|
if (!cb) {
|
|
7854
7915
|
if (immediate !== void 0) {
|
|
7855
7916
|
warn$1(
|
|
@@ -7875,10 +7936,12 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
7875
7936
|
);
|
|
7876
7937
|
};
|
|
7877
7938
|
const instance = currentInstance;
|
|
7878
|
-
const reactiveGetter = (source2) =>
|
|
7879
|
-
|
|
7880
|
-
|
|
7881
|
-
|
|
7939
|
+
const reactiveGetter = (source2) => {
|
|
7940
|
+
if (deep) return source2;
|
|
7941
|
+
if (isShallow(source2) || deep === false || deep === 0)
|
|
7942
|
+
return traverse(source2, 1);
|
|
7943
|
+
return traverse(source2);
|
|
7944
|
+
};
|
|
7882
7945
|
let getter;
|
|
7883
7946
|
let forceTrigger = false;
|
|
7884
7947
|
let isMultiSource = false;
|
|
@@ -7924,7 +7987,8 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
7924
7987
|
}
|
|
7925
7988
|
if (cb && deep) {
|
|
7926
7989
|
const baseGetter = getter;
|
|
7927
|
-
|
|
7990
|
+
const depth = deep === true ? Infinity : deep;
|
|
7991
|
+
getter = () => traverse(baseGetter(), depth);
|
|
7928
7992
|
}
|
|
7929
7993
|
let cleanup;
|
|
7930
7994
|
let onCleanup = (fn) => {
|
|
@@ -7971,12 +8035,15 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
7971
8035
|
}
|
|
7972
8036
|
effect.scheduler = scheduler;
|
|
7973
8037
|
const scope = getCurrentScope();
|
|
7974
|
-
const
|
|
8038
|
+
const watchHandle = () => {
|
|
7975
8039
|
effect.stop();
|
|
7976
8040
|
if (scope) {
|
|
7977
8041
|
remove(scope.effects, effect);
|
|
7978
8042
|
}
|
|
7979
8043
|
};
|
|
8044
|
+
watchHandle.pause = effect.pause.bind(effect);
|
|
8045
|
+
watchHandle.resume = effect.resume.bind(effect);
|
|
8046
|
+
watchHandle.stop = watchHandle;
|
|
7980
8047
|
{
|
|
7981
8048
|
effect.onTrack = onTrack;
|
|
7982
8049
|
effect.onTrigger = onTrigger;
|
|
@@ -7995,7 +8062,7 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
7995
8062
|
} else {
|
|
7996
8063
|
effect.run();
|
|
7997
8064
|
}
|
|
7998
|
-
return
|
|
8065
|
+
return watchHandle;
|
|
7999
8066
|
}
|
|
8000
8067
|
function instanceWatch(source, value, options) {
|
|
8001
8068
|
const publicThis = this.proxy;
|
|
@@ -8085,7 +8152,8 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
8085
8152
|
return options.get ? options.get(localValue) : localValue;
|
|
8086
8153
|
},
|
|
8087
8154
|
set(value) {
|
|
8088
|
-
|
|
8155
|
+
const emittedValue = options.set ? options.set(value) : value;
|
|
8156
|
+
if (!hasChanged(emittedValue, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
|
|
8089
8157
|
return;
|
|
8090
8158
|
}
|
|
8091
8159
|
const rawProps = i.vnode.props;
|
|
@@ -8094,7 +8162,6 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
8094
8162
|
localValue = value;
|
|
8095
8163
|
trigger();
|
|
8096
8164
|
}
|
|
8097
|
-
const emittedValue = options.set ? options.set(value) : value;
|
|
8098
8165
|
i.emit(`update:${name}`, emittedValue);
|
|
8099
8166
|
if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
|
|
8100
8167
|
trigger();
|
|
@@ -8132,9 +8199,9 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
8132
8199
|
} = instance;
|
|
8133
8200
|
if (emitsOptions) {
|
|
8134
8201
|
if (!(event in emitsOptions) && true) {
|
|
8135
|
-
if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {
|
|
8202
|
+
if (!propsOptions || !(toHandlerKey(camelize(event)) in propsOptions)) {
|
|
8136
8203
|
warn$1(
|
|
8137
|
-
`Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(event)}" prop.`
|
|
8204
|
+
`Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.`
|
|
8138
8205
|
);
|
|
8139
8206
|
}
|
|
8140
8207
|
} else {
|
|
@@ -9944,11 +10011,16 @@ Component that was made reactive: `,
|
|
|
9944
10011
|
const r = shallowRef(null);
|
|
9945
10012
|
if (i) {
|
|
9946
10013
|
const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs;
|
|
9947
|
-
|
|
9948
|
-
|
|
9949
|
-
|
|
9950
|
-
|
|
9951
|
-
|
|
10014
|
+
let desc;
|
|
10015
|
+
if ((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable) {
|
|
10016
|
+
warn$1(`useTemplateRef('${key}') already exists.`);
|
|
10017
|
+
} else {
|
|
10018
|
+
Object.defineProperty(refs, key, {
|
|
10019
|
+
enumerable: true,
|
|
10020
|
+
get: () => r.value,
|
|
10021
|
+
set: (val) => r.value = val
|
|
10022
|
+
});
|
|
10023
|
+
}
|
|
9952
10024
|
} else {
|
|
9953
10025
|
warn$1(
|
|
9954
10026
|
`useTemplateRef() is called when there is no active component instance to be associated with.`
|
|
@@ -10182,7 +10254,7 @@ Component that was made reactive: `,
|
|
|
10182
10254
|
return true;
|
|
10183
10255
|
}
|
|
10184
10256
|
|
|
10185
|
-
const version = "3.5.0-
|
|
10257
|
+
const version = "3.5.0-beta.1";
|
|
10186
10258
|
const warn = warn$1 ;
|
|
10187
10259
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
10188
10260
|
const devtools = devtools$1 ;
|
|
@@ -10192,6 +10264,18 @@ Component that was made reactive: `,
|
|
|
10192
10264
|
const compatUtils = null;
|
|
10193
10265
|
const DeprecationTypes = null;
|
|
10194
10266
|
|
|
10267
|
+
let policy = void 0;
|
|
10268
|
+
const tt = typeof window !== "undefined" && window.trustedTypes;
|
|
10269
|
+
if (tt) {
|
|
10270
|
+
try {
|
|
10271
|
+
policy = /* @__PURE__ */ tt.createPolicy("vue", {
|
|
10272
|
+
createHTML: (val) => val
|
|
10273
|
+
});
|
|
10274
|
+
} catch (e) {
|
|
10275
|
+
warn(`Error creating trusted types policy: ${e}`);
|
|
10276
|
+
}
|
|
10277
|
+
}
|
|
10278
|
+
const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) => val;
|
|
10195
10279
|
const svgNS = "http://www.w3.org/2000/svg";
|
|
10196
10280
|
const mathmlNS = "http://www.w3.org/1998/Math/MathML";
|
|
10197
10281
|
const doc = typeof document !== "undefined" ? document : null;
|
|
@@ -10239,7 +10323,9 @@ Component that was made reactive: `,
|
|
|
10239
10323
|
if (start === end || !(start = start.nextSibling)) break;
|
|
10240
10324
|
}
|
|
10241
10325
|
} else {
|
|
10242
|
-
templateContainer.innerHTML =
|
|
10326
|
+
templateContainer.innerHTML = unsafeToTrustedHTML(
|
|
10327
|
+
namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content
|
|
10328
|
+
);
|
|
10243
10329
|
const template = templateContainer.content;
|
|
10244
10330
|
if (namespace === "svg" || namespace === "mathml") {
|
|
10245
10331
|
const wrapper = template.firstChild;
|
|
@@ -10602,11 +10688,17 @@ Component that was made reactive: `,
|
|
|
10602
10688
|
}
|
|
10603
10689
|
const setVars = () => {
|
|
10604
10690
|
const vars = getter(instance.proxy);
|
|
10605
|
-
|
|
10691
|
+
if (instance.ce) {
|
|
10692
|
+
setVarsOnNode(instance.ce, vars);
|
|
10693
|
+
} else {
|
|
10694
|
+
setVarsOnVNode(instance.subTree, vars);
|
|
10695
|
+
}
|
|
10606
10696
|
updateTeleports(vars);
|
|
10607
10697
|
};
|
|
10608
|
-
|
|
10698
|
+
onBeforeMount(() => {
|
|
10609
10699
|
watchPostEffect(setVars);
|
|
10700
|
+
});
|
|
10701
|
+
onMounted(() => {
|
|
10610
10702
|
const ob = new MutationObserver(setVars);
|
|
10611
10703
|
ob.observe(instance.subTree.el.parentNode, { childList: true });
|
|
10612
10704
|
onUnmounted(() => ob.disconnect());
|
|
@@ -10959,16 +11051,24 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
10959
11051
|
if (isNativeOn(key) && isString(value)) {
|
|
10960
11052
|
return false;
|
|
10961
11053
|
}
|
|
10962
|
-
|
|
11054
|
+
if (key in el) {
|
|
11055
|
+
return true;
|
|
11056
|
+
}
|
|
11057
|
+
if (el._isVueCE && (/[A-Z]/.test(key) || !isString(value))) {
|
|
11058
|
+
return true;
|
|
11059
|
+
}
|
|
11060
|
+
return false;
|
|
10963
11061
|
}
|
|
10964
11062
|
|
|
11063
|
+
const REMOVAL = {};
|
|
10965
11064
|
/*! #__NO_SIDE_EFFECTS__ */
|
|
10966
11065
|
// @__NO_SIDE_EFFECTS__
|
|
10967
|
-
function defineCustomElement(options, extraOptions,
|
|
11066
|
+
function defineCustomElement(options, extraOptions, _createApp) {
|
|
10968
11067
|
const Comp = defineComponent(options, extraOptions);
|
|
11068
|
+
if (isPlainObject(Comp)) extend(Comp, extraOptions);
|
|
10969
11069
|
class VueCustomElement extends VueElement {
|
|
10970
11070
|
constructor(initialProps) {
|
|
10971
|
-
super(Comp, initialProps,
|
|
11071
|
+
super(Comp, initialProps, _createApp);
|
|
10972
11072
|
}
|
|
10973
11073
|
}
|
|
10974
11074
|
VueCustomElement.def = Comp;
|
|
@@ -10976,47 +11076,88 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
10976
11076
|
}
|
|
10977
11077
|
/*! #__NO_SIDE_EFFECTS__ */
|
|
10978
11078
|
const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
|
|
10979
|
-
return /* @__PURE__ */ defineCustomElement(options, extraOptions,
|
|
11079
|
+
return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
|
|
10980
11080
|
};
|
|
10981
11081
|
const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
|
|
10982
11082
|
};
|
|
10983
11083
|
class VueElement extends BaseClass {
|
|
10984
|
-
constructor(_def, _props = {},
|
|
11084
|
+
constructor(_def, _props = {}, _createApp = createApp) {
|
|
10985
11085
|
super();
|
|
10986
11086
|
this._def = _def;
|
|
10987
11087
|
this._props = _props;
|
|
11088
|
+
this._createApp = _createApp;
|
|
11089
|
+
this._isVueCE = true;
|
|
10988
11090
|
/**
|
|
10989
11091
|
* @internal
|
|
10990
11092
|
*/
|
|
10991
11093
|
this._instance = null;
|
|
11094
|
+
/**
|
|
11095
|
+
* @internal
|
|
11096
|
+
*/
|
|
11097
|
+
this._app = null;
|
|
11098
|
+
/**
|
|
11099
|
+
* @internal
|
|
11100
|
+
*/
|
|
11101
|
+
this._nonce = this._def.nonce;
|
|
10992
11102
|
this._connected = false;
|
|
10993
11103
|
this._resolved = false;
|
|
10994
11104
|
this._numberProps = null;
|
|
11105
|
+
this._styleChildren = /* @__PURE__ */ new WeakSet();
|
|
10995
11106
|
this._ob = null;
|
|
10996
|
-
if (this.shadowRoot &&
|
|
10997
|
-
|
|
11107
|
+
if (this.shadowRoot && _createApp !== createApp) {
|
|
11108
|
+
this._root = this.shadowRoot;
|
|
11109
|
+
this._mount(_def);
|
|
10998
11110
|
} else {
|
|
10999
11111
|
if (this.shadowRoot) {
|
|
11000
11112
|
warn(
|
|
11001
11113
|
`Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.`
|
|
11002
11114
|
);
|
|
11003
11115
|
}
|
|
11004
|
-
|
|
11116
|
+
if (_def.shadowRoot !== false) {
|
|
11117
|
+
this.attachShadow({ mode: "open" });
|
|
11118
|
+
this._root = this.shadowRoot;
|
|
11119
|
+
} else {
|
|
11120
|
+
this._root = this;
|
|
11121
|
+
}
|
|
11005
11122
|
if (!this._def.__asyncLoader) {
|
|
11006
11123
|
this._resolveProps(this._def);
|
|
11007
11124
|
}
|
|
11008
11125
|
}
|
|
11009
11126
|
}
|
|
11010
11127
|
connectedCallback() {
|
|
11128
|
+
if (!this.shadowRoot) {
|
|
11129
|
+
this._parseSlots();
|
|
11130
|
+
}
|
|
11011
11131
|
this._connected = true;
|
|
11132
|
+
let parent = this;
|
|
11133
|
+
while (parent = parent && (parent.parentNode || parent.host)) {
|
|
11134
|
+
if (parent instanceof VueElement) {
|
|
11135
|
+
this._parent = parent;
|
|
11136
|
+
break;
|
|
11137
|
+
}
|
|
11138
|
+
}
|
|
11012
11139
|
if (!this._instance) {
|
|
11013
11140
|
if (this._resolved) {
|
|
11141
|
+
this._setParent();
|
|
11014
11142
|
this._update();
|
|
11015
11143
|
} else {
|
|
11016
|
-
|
|
11144
|
+
if (parent && parent._pendingResolve) {
|
|
11145
|
+
this._pendingResolve = parent._pendingResolve.then(() => {
|
|
11146
|
+
this._pendingResolve = void 0;
|
|
11147
|
+
this._resolveDef();
|
|
11148
|
+
});
|
|
11149
|
+
} else {
|
|
11150
|
+
this._resolveDef();
|
|
11151
|
+
}
|
|
11017
11152
|
}
|
|
11018
11153
|
}
|
|
11019
11154
|
}
|
|
11155
|
+
_setParent(parent = this._parent) {
|
|
11156
|
+
if (parent) {
|
|
11157
|
+
this._instance.parent = parent._instance;
|
|
11158
|
+
this._instance.provides = parent._instance.provides;
|
|
11159
|
+
}
|
|
11160
|
+
}
|
|
11020
11161
|
disconnectedCallback() {
|
|
11021
11162
|
this._connected = false;
|
|
11022
11163
|
nextTick(() => {
|
|
@@ -11025,8 +11166,9 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
11025
11166
|
this._ob.disconnect();
|
|
11026
11167
|
this._ob = null;
|
|
11027
11168
|
}
|
|
11028
|
-
|
|
11029
|
-
this._instance =
|
|
11169
|
+
this._app && this._app.unmount();
|
|
11170
|
+
this._instance.ce = void 0;
|
|
11171
|
+
this._app = this._instance = null;
|
|
11030
11172
|
}
|
|
11031
11173
|
});
|
|
11032
11174
|
}
|
|
@@ -11034,7 +11176,9 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
11034
11176
|
* resolve inner component definition (handle possible async component)
|
|
11035
11177
|
*/
|
|
11036
11178
|
_resolveDef() {
|
|
11037
|
-
this.
|
|
11179
|
+
if (this._pendingResolve) {
|
|
11180
|
+
return;
|
|
11181
|
+
}
|
|
11038
11182
|
for (let i = 0; i < this.attributes.length; i++) {
|
|
11039
11183
|
this._setAttr(this.attributes[i].name);
|
|
11040
11184
|
}
|
|
@@ -11045,6 +11189,8 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
11045
11189
|
});
|
|
11046
11190
|
this._ob.observe(this, { attributes: true });
|
|
11047
11191
|
const resolve = (def, isAsync = false) => {
|
|
11192
|
+
this._resolved = true;
|
|
11193
|
+
this._pendingResolve = void 0;
|
|
11048
11194
|
const { props, styles } = def;
|
|
11049
11195
|
let numberProps;
|
|
11050
11196
|
if (props && !isArray(props)) {
|
|
@@ -11062,22 +11208,53 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
11062
11208
|
if (isAsync) {
|
|
11063
11209
|
this._resolveProps(def);
|
|
11064
11210
|
}
|
|
11065
|
-
this.
|
|
11066
|
-
|
|
11211
|
+
if (this.shadowRoot) {
|
|
11212
|
+
this._applyStyles(styles);
|
|
11213
|
+
} else if (styles) {
|
|
11214
|
+
warn(
|
|
11215
|
+
"Custom element style injection is not supported when using shadowRoot: false"
|
|
11216
|
+
);
|
|
11217
|
+
}
|
|
11218
|
+
this._mount(def);
|
|
11067
11219
|
};
|
|
11068
11220
|
const asyncDef = this._def.__asyncLoader;
|
|
11069
11221
|
if (asyncDef) {
|
|
11070
|
-
asyncDef().then(
|
|
11222
|
+
this._pendingResolve = asyncDef().then(
|
|
11223
|
+
(def) => resolve(this._def = def, true)
|
|
11224
|
+
);
|
|
11071
11225
|
} else {
|
|
11072
11226
|
resolve(this._def);
|
|
11073
11227
|
}
|
|
11074
11228
|
}
|
|
11229
|
+
_mount(def) {
|
|
11230
|
+
if (!def.name) {
|
|
11231
|
+
def.name = "VueElement";
|
|
11232
|
+
}
|
|
11233
|
+
this._app = this._createApp(def);
|
|
11234
|
+
if (def.configureApp) {
|
|
11235
|
+
def.configureApp(this._app);
|
|
11236
|
+
}
|
|
11237
|
+
this._app._ceVNode = this._createVNode();
|
|
11238
|
+
this._app.mount(this._root);
|
|
11239
|
+
const exposed = this._instance && this._instance.exposed;
|
|
11240
|
+
if (!exposed) return;
|
|
11241
|
+
for (const key in exposed) {
|
|
11242
|
+
if (!hasOwn(this, key)) {
|
|
11243
|
+
Object.defineProperty(this, key, {
|
|
11244
|
+
// unwrap ref to be consistent with public instance behavior
|
|
11245
|
+
get: () => unref(exposed[key])
|
|
11246
|
+
});
|
|
11247
|
+
} else {
|
|
11248
|
+
warn(`Exposed property "${key}" already exists on custom element.`);
|
|
11249
|
+
}
|
|
11250
|
+
}
|
|
11251
|
+
}
|
|
11075
11252
|
_resolveProps(def) {
|
|
11076
11253
|
const { props } = def;
|
|
11077
11254
|
const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
|
|
11078
11255
|
for (const key of Object.keys(this)) {
|
|
11079
11256
|
if (key[0] !== "_" && declaredPropKeys.includes(key)) {
|
|
11080
|
-
this._setProp(key, this[key]
|
|
11257
|
+
this._setProp(key, this[key]);
|
|
11081
11258
|
}
|
|
11082
11259
|
}
|
|
11083
11260
|
for (const key of declaredPropKeys.map(camelize)) {
|
|
@@ -11086,18 +11263,20 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
11086
11263
|
return this._getProp(key);
|
|
11087
11264
|
},
|
|
11088
11265
|
set(val) {
|
|
11089
|
-
this._setProp(key, val);
|
|
11266
|
+
this._setProp(key, val, true, true);
|
|
11090
11267
|
}
|
|
11091
11268
|
});
|
|
11092
11269
|
}
|
|
11093
11270
|
}
|
|
11094
11271
|
_setAttr(key) {
|
|
11095
|
-
|
|
11272
|
+
if (key.startsWith("data-v-")) return;
|
|
11273
|
+
const has = this.hasAttribute(key);
|
|
11274
|
+
let value = has ? this.getAttribute(key) : REMOVAL;
|
|
11096
11275
|
const camelKey = camelize(key);
|
|
11097
|
-
if (this._numberProps && this._numberProps[camelKey]) {
|
|
11276
|
+
if (has && this._numberProps && this._numberProps[camelKey]) {
|
|
11098
11277
|
value = toNumber(value);
|
|
11099
11278
|
}
|
|
11100
|
-
this._setProp(camelKey, value, false);
|
|
11279
|
+
this._setProp(camelKey, value, false, true);
|
|
11101
11280
|
}
|
|
11102
11281
|
/**
|
|
11103
11282
|
* @internal
|
|
@@ -11108,9 +11287,13 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
11108
11287
|
/**
|
|
11109
11288
|
* @internal
|
|
11110
11289
|
*/
|
|
11111
|
-
_setProp(key, val, shouldReflect = true, shouldUpdate =
|
|
11290
|
+
_setProp(key, val, shouldReflect = true, shouldUpdate = false) {
|
|
11112
11291
|
if (val !== this._props[key]) {
|
|
11113
|
-
|
|
11292
|
+
if (val === REMOVAL) {
|
|
11293
|
+
delete this._props[key];
|
|
11294
|
+
} else {
|
|
11295
|
+
this._props[key] = val;
|
|
11296
|
+
}
|
|
11114
11297
|
if (shouldUpdate && this._instance) {
|
|
11115
11298
|
this._update();
|
|
11116
11299
|
}
|
|
@@ -11126,18 +11309,22 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
11126
11309
|
}
|
|
11127
11310
|
}
|
|
11128
11311
|
_update() {
|
|
11129
|
-
render(this._createVNode(), this.
|
|
11312
|
+
render(this._createVNode(), this._root);
|
|
11130
11313
|
}
|
|
11131
11314
|
_createVNode() {
|
|
11132
|
-
const
|
|
11315
|
+
const baseProps = {};
|
|
11316
|
+
if (!this.shadowRoot) {
|
|
11317
|
+
baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this);
|
|
11318
|
+
}
|
|
11319
|
+
const vnode = createVNode(this._def, extend(baseProps, this._props));
|
|
11133
11320
|
if (!this._instance) {
|
|
11134
11321
|
vnode.ce = (instance) => {
|
|
11135
11322
|
this._instance = instance;
|
|
11136
|
-
instance.
|
|
11323
|
+
instance.ce = this;
|
|
11137
11324
|
{
|
|
11138
11325
|
instance.ceReload = (newStyles) => {
|
|
11139
11326
|
if (this._styles) {
|
|
11140
|
-
this._styles.forEach((s) => this.
|
|
11327
|
+
this._styles.forEach((s) => this._root.removeChild(s));
|
|
11141
11328
|
this._styles.length = 0;
|
|
11142
11329
|
}
|
|
11143
11330
|
this._applyStyles(newStyles);
|
|
@@ -11147,9 +11334,10 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
11147
11334
|
}
|
|
11148
11335
|
const dispatch = (event, args) => {
|
|
11149
11336
|
this.dispatchEvent(
|
|
11150
|
-
new CustomEvent(
|
|
11151
|
-
|
|
11152
|
-
|
|
11337
|
+
new CustomEvent(
|
|
11338
|
+
event,
|
|
11339
|
+
isPlainObject(args[0]) ? extend({ detail: args }, args[0]) : { detail: args }
|
|
11340
|
+
)
|
|
11153
11341
|
);
|
|
11154
11342
|
};
|
|
11155
11343
|
instance.emit = (event, ...args) => {
|
|
@@ -11158,30 +11346,126 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
11158
11346
|
dispatch(hyphenate(event), args);
|
|
11159
11347
|
}
|
|
11160
11348
|
};
|
|
11161
|
-
|
|
11162
|
-
while (parent = parent && (parent.parentNode || parent.host)) {
|
|
11163
|
-
if (parent instanceof VueElement) {
|
|
11164
|
-
instance.parent = parent._instance;
|
|
11165
|
-
instance.provides = parent._instance.provides;
|
|
11166
|
-
break;
|
|
11167
|
-
}
|
|
11168
|
-
}
|
|
11349
|
+
this._setParent();
|
|
11169
11350
|
};
|
|
11170
11351
|
}
|
|
11171
11352
|
return vnode;
|
|
11172
11353
|
}
|
|
11173
|
-
_applyStyles(styles) {
|
|
11174
|
-
if (styles)
|
|
11175
|
-
|
|
11176
|
-
|
|
11177
|
-
|
|
11178
|
-
|
|
11179
|
-
|
|
11354
|
+
_applyStyles(styles, owner) {
|
|
11355
|
+
if (!styles) return;
|
|
11356
|
+
if (owner) {
|
|
11357
|
+
if (owner === this._def || this._styleChildren.has(owner)) {
|
|
11358
|
+
return;
|
|
11359
|
+
}
|
|
11360
|
+
this._styleChildren.add(owner);
|
|
11361
|
+
}
|
|
11362
|
+
const nonce = this._nonce;
|
|
11363
|
+
for (let i = styles.length - 1; i >= 0; i--) {
|
|
11364
|
+
const s = document.createElement("style");
|
|
11365
|
+
if (nonce) s.setAttribute("nonce", nonce);
|
|
11366
|
+
s.textContent = styles[i];
|
|
11367
|
+
this.shadowRoot.prepend(s);
|
|
11368
|
+
{
|
|
11369
|
+
if (owner) {
|
|
11370
|
+
if (owner.__hmrId) {
|
|
11371
|
+
if (!this._childStyles) this._childStyles = /* @__PURE__ */ new Map();
|
|
11372
|
+
let entry = this._childStyles.get(owner.__hmrId);
|
|
11373
|
+
if (!entry) {
|
|
11374
|
+
this._childStyles.set(owner.__hmrId, entry = []);
|
|
11375
|
+
}
|
|
11376
|
+
entry.push(s);
|
|
11377
|
+
}
|
|
11378
|
+
} else {
|
|
11180
11379
|
(this._styles || (this._styles = [])).push(s);
|
|
11181
11380
|
}
|
|
11182
|
-
}
|
|
11381
|
+
}
|
|
11382
|
+
}
|
|
11383
|
+
}
|
|
11384
|
+
/**
|
|
11385
|
+
* Only called when shaddowRoot is false
|
|
11386
|
+
*/
|
|
11387
|
+
_parseSlots() {
|
|
11388
|
+
const slots = this._slots = {};
|
|
11389
|
+
let n;
|
|
11390
|
+
while (n = this.firstChild) {
|
|
11391
|
+
const slotName = n.nodeType === 1 && n.getAttribute("slot") || "default";
|
|
11392
|
+
(slots[slotName] || (slots[slotName] = [])).push(n);
|
|
11393
|
+
this.removeChild(n);
|
|
11394
|
+
}
|
|
11395
|
+
}
|
|
11396
|
+
/**
|
|
11397
|
+
* Only called when shaddowRoot is false
|
|
11398
|
+
*/
|
|
11399
|
+
_renderSlots() {
|
|
11400
|
+
const outlets = this.querySelectorAll("slot");
|
|
11401
|
+
const scopeId = this._instance.type.__scopeId;
|
|
11402
|
+
for (let i = 0; i < outlets.length; i++) {
|
|
11403
|
+
const o = outlets[i];
|
|
11404
|
+
const slotName = o.getAttribute("name") || "default";
|
|
11405
|
+
const content = this._slots[slotName];
|
|
11406
|
+
const parent = o.parentNode;
|
|
11407
|
+
if (content) {
|
|
11408
|
+
for (const n of content) {
|
|
11409
|
+
if (scopeId && n.nodeType === 1) {
|
|
11410
|
+
const id = scopeId + "-s";
|
|
11411
|
+
const walker = document.createTreeWalker(n, 1);
|
|
11412
|
+
n.setAttribute(id, "");
|
|
11413
|
+
let child;
|
|
11414
|
+
while (child = walker.nextNode()) {
|
|
11415
|
+
child.setAttribute(id, "");
|
|
11416
|
+
}
|
|
11417
|
+
}
|
|
11418
|
+
parent.insertBefore(n, o);
|
|
11419
|
+
}
|
|
11420
|
+
} else {
|
|
11421
|
+
while (o.firstChild) parent.insertBefore(o.firstChild, o);
|
|
11422
|
+
}
|
|
11423
|
+
parent.removeChild(o);
|
|
11424
|
+
}
|
|
11425
|
+
}
|
|
11426
|
+
/**
|
|
11427
|
+
* @internal
|
|
11428
|
+
*/
|
|
11429
|
+
_injectChildStyle(comp) {
|
|
11430
|
+
this._applyStyles(comp.styles, comp);
|
|
11431
|
+
}
|
|
11432
|
+
/**
|
|
11433
|
+
* @internal
|
|
11434
|
+
*/
|
|
11435
|
+
_removeChildStyle(comp) {
|
|
11436
|
+
{
|
|
11437
|
+
this._styleChildren.delete(comp);
|
|
11438
|
+
if (this._childStyles && comp.__hmrId) {
|
|
11439
|
+
const oldStyles = this._childStyles.get(comp.__hmrId);
|
|
11440
|
+
if (oldStyles) {
|
|
11441
|
+
oldStyles.forEach((s) => this._root.removeChild(s));
|
|
11442
|
+
oldStyles.length = 0;
|
|
11443
|
+
}
|
|
11444
|
+
}
|
|
11445
|
+
}
|
|
11446
|
+
}
|
|
11447
|
+
}
|
|
11448
|
+
function useHost(caller) {
|
|
11449
|
+
const instance = getCurrentInstance();
|
|
11450
|
+
const el = instance && instance.ce;
|
|
11451
|
+
if (el) {
|
|
11452
|
+
return el;
|
|
11453
|
+
} else {
|
|
11454
|
+
if (!instance) {
|
|
11455
|
+
warn(
|
|
11456
|
+
`${caller || "useHost"} called without an active component instance.`
|
|
11457
|
+
);
|
|
11458
|
+
} else {
|
|
11459
|
+
warn(
|
|
11460
|
+
`${caller || "useHost"} can only be used in components defined via defineCustomElement.`
|
|
11461
|
+
);
|
|
11183
11462
|
}
|
|
11184
11463
|
}
|
|
11464
|
+
return null;
|
|
11465
|
+
}
|
|
11466
|
+
function useShadowRoot() {
|
|
11467
|
+
const el = useHost("useShadowRoot") ;
|
|
11468
|
+
return el && el.shadowRoot;
|
|
11185
11469
|
}
|
|
11186
11470
|
|
|
11187
11471
|
function useCssModule(name = "$style") {
|
|
@@ -11650,7 +11934,9 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
11650
11934
|
if (!isFunction(component) && !component.render && !component.template) {
|
|
11651
11935
|
component.template = container.innerHTML;
|
|
11652
11936
|
}
|
|
11653
|
-
container.
|
|
11937
|
+
if (container.nodeType === 1) {
|
|
11938
|
+
container.textContent = "";
|
|
11939
|
+
}
|
|
11654
11940
|
const proxy = mount(container, false, resolveRootNamespace(container));
|
|
11655
11941
|
if (container instanceof Element) {
|
|
11656
11942
|
container.removeAttribute("v-cloak");
|
|
@@ -11875,9 +12161,11 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
11875
12161
|
exports.useAttrs = useAttrs;
|
|
11876
12162
|
exports.useCssModule = useCssModule;
|
|
11877
12163
|
exports.useCssVars = useCssVars;
|
|
12164
|
+
exports.useHost = useHost;
|
|
11878
12165
|
exports.useId = useId;
|
|
11879
12166
|
exports.useModel = useModel;
|
|
11880
12167
|
exports.useSSRContext = useSSRContext;
|
|
12168
|
+
exports.useShadowRoot = useShadowRoot;
|
|
11881
12169
|
exports.useSlots = useSlots;
|
|
11882
12170
|
exports.useTemplateRef = useTemplateRef;
|
|
11883
12171
|
exports.useTransitionState = useTransitionState;
|