wevu 6.16.31 → 6.16.32
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/base-D-o2Hv6z.mjs +1 -0
- package/dist/computed-DdPJb4_M.mjs +1 -0
- package/dist/dev/base-CoF39as1.mjs +302 -0
- package/dist/dev/base-CoF39as1.mjs.map +1 -0
- package/dist/dev/computed-DBCuiNOA.mjs +48 -0
- package/dist/dev/computed-DBCuiNOA.mjs.map +1 -0
- package/dist/dev/index.mjs +9 -3
- package/dist/dev/internal-reactivity.mjs +7 -0
- package/dist/dev/internal-runtime.mjs +5 -0
- package/dist/dev/internal-template.mjs +3 -0
- package/dist/dev/{router-ByTtgUmi.mjs → router-C_io1Bpp.mjs} +4 -301
- package/dist/dev/router-C_io1Bpp.mjs.map +1 -0
- package/dist/dev/router.mjs +2 -1
- package/dist/dev/router.mjs.map +1 -1
- package/dist/dev/src-DAWKf0w2.mjs +46 -0
- package/dist/dev/{store-eNxaNZbj.mjs → store-BWZEkK8F.mjs} +4 -47
- package/dist/dev/store-BWZEkK8F.mjs.map +1 -0
- package/dist/dev/store.mjs +1 -1
- package/dist/dev/template-BeuoC58i.mjs +91 -0
- package/dist/dev/template-BeuoC58i.mjs.map +1 -0
- package/dist/dev/{src-QNC0LVvV.mjs → templateRef-Cl4FZO1Q.mjs} +70 -516
- package/dist/dev/templateRef-Cl4FZO1Q.mjs.map +1 -0
- package/dist/dev/toRefs-DrE7KHlW.mjs +42 -0
- package/dist/dev/toRefs-DrE7KHlW.mjs.map +1 -0
- package/dist/dev/vue-demi.mjs +9 -3
- package/dist/dev/vue-demi.mjs.map +1 -1
- package/dist/dev/watch-CqXsBjp3.mjs +328 -0
- package/dist/dev/watch-CqXsBjp3.mjs.map +1 -0
- package/dist/{index-DuNbWb3x.d.mts → index-CgXlVT9g.d.mts} +2 -6
- package/dist/index.d.mts +2 -1
- package/dist/index.mjs +1 -1
- package/dist/internal-reactivity.d.mts +2 -0
- package/dist/internal-reactivity.mjs +1 -0
- package/dist/internal-runtime.d.mts +2 -0
- package/dist/internal-runtime.mjs +1 -0
- package/dist/internal-template.d.mts +2 -0
- package/dist/internal-template.mjs +1 -0
- package/dist/router-BiJKkvy7.mjs +1 -0
- package/dist/router.mjs +1 -1
- package/dist/store-B9C0AuaO.mjs +1 -0
- package/dist/store.mjs +1 -1
- package/dist/template-CFhlojaH.mjs +1 -0
- package/dist/template-DE8e5dj_.d.mts +6 -0
- package/dist/templateRef-QWFf20h8.mjs +1 -0
- package/dist/toRefs-COgMIEoC.mjs +1 -0
- package/dist/vue-demi.d.mts +2 -1
- package/dist/vue-demi.mjs +1 -1
- package/dist/watch-6_s3_f8q.mjs +1 -0
- package/package.json +47 -2
- package/dist/dev/router-ByTtgUmi.mjs.map +0 -1
- package/dist/dev/src-QNC0LVvV.mjs.map +0 -1
- package/dist/dev/store-eNxaNZbj.mjs.map +0 -1
- package/dist/router-C1IObdgc.mjs +0 -1
- package/dist/src-BtONVPDv.mjs +0 -1
- package/dist/store-CNXa5BsN.mjs +0 -1
|
@@ -1,171 +1,12 @@
|
|
|
1
|
-
import { A as track, C as effect,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { A as track, C as effect, N as nextTick, P as queueJob, a as toValue, b as addMutationRecorder, d as reactive, g as touchReactive, h as prelinkReactiveTree, i as ref, j as trigger, k as stop, l as isReactive, m as clearPatchIndices, n as isRef, o as unref, p as shallowReactive, r as markAsRef, s as getReactiveVersion, t as customRef, w as effectScope, x as removeMutationRecorder, y as toRaw } from "./ref-BoBfMdVt.mjs";
|
|
2
|
+
import { t as computed } from "./computed-DBCuiNOA.mjs";
|
|
3
|
+
import { _ as getScopedSlotHostGlobalObject, c as getCurrentSetupContext, d as setCurrentSetupContext, g as getMiniProgramGlobalObject, h as getCurrentMiniProgramRuntimeCapabilities, l as pushHook, m as getCurrentMiniProgramPages, n as callHookList, p as getCurrentMiniProgramHostConfig, r as callHookReturn, s as getCurrentInstance, t as assertInSetup, u as setCurrentInstance, v as supportsCurrentMiniProgramRuntimeCapability, x as readonly } from "./base-CoF39as1.mjs";
|
|
4
|
+
import { l as shallowRef, t as watch } from "./watch-CqXsBjp3.mjs";
|
|
5
|
+
import { C as releaseCurrentPageInstance, D as attachRuntimeProvideContext, E as attachRuntimeLayoutProvideContext, H as onPullDownRefresh, M as onAttached, N as onDetached, O as ensureRuntimeAppProvides, S as getCurrentPageInstance, T as runInPageScrollHook, V as onPageScroll, X as onShow, b as ensureMiniProgramGlobalPatched, et as onUnload, k as setRuntimeAppProvidedValue, w as resolvePageOptions, x as ensurePageShareMenus, y as bindCurrentPageInstance } from "./router-C_io1Bpp.mjs";
|
|
4
6
|
import { WEVU_ATTRS_KEY, WEVU_EFFECT_SCOPE_KEY, WEVU_EXPOSED_KEY, WEVU_FUNCTION_PROP_PATHS_KEY, WEVU_HOOKS_KEY, WEVU_INLINE_HANDLER, WEVU_INLINE_MAP_KEY, WEVU_IS_APP_INSTANCE_KEY, WEVU_LAYOUT_BRIDGE_PAGE_KEYS, WEVU_LAYOUT_HOST_BRIDGE_KEY, WEVU_MODEL_HANDLER, WEVU_NATIVE_INSTANCE_KEY, WEVU_ON_BEFORE_UPDATE_HOOK, WEVU_ON_LOAD_CALLED_KEY, WEVU_ON_UPDATED_HOOK, WEVU_OWNER_HANDLER, WEVU_PAGE_LAYOUT_NAME_KEY, WEVU_PAGE_LAYOUT_NONE, WEVU_PAGE_LAYOUT_PROPS_KEY, WEVU_PAGE_LAYOUT_SETTER_KEY, WEVU_PAGE_SCROLL_HOOK_DEPTH_KEY, WEVU_PARENT_INSTANCE_KEY, WEVU_PENDING_PROP_VALUES_KEY, WEVU_PROPS_ALIASES_KEY, WEVU_PROPS_DERIVED_KEYS_KEY, WEVU_PROPS_KEY, WEVU_PROP_KEYS_KEY, WEVU_PUBLIC_RUNTIME_KEY, WEVU_READY_CALLED_KEY, WEVU_RESERVED_METHOD_PREFIX, WEVU_ROUTE_DONE_CALLED_KEY, WEVU_ROUTE_DONE_IN_TICK_KEY, WEVU_RUNTIME_APP_KEY, WEVU_RUNTIME_KEY, WEVU_SCOPED_SLOT_CREATOR_KEY, WEVU_SCOPED_SLOT_OWNER_SEED_KEY, WEVU_SCOPED_SLOT_OWNER_STORE_KEY, WEVU_SETUP_CONTEXT_INSTANCE_KEY, WEVU_SETUP_STATE_KEY, WEVU_SLOT_NAMES_PROP, WEVU_SLOT_OWNER_ID_KEY, WEVU_SLOT_OWNER_ID_PROP, WEVU_SLOT_OWNER_KEY, WEVU_SLOT_OWNER_PROXY_KEY, WEVU_SLOT_PROPS_DATA_KEY, WEVU_SLOT_PROPS_KEY, WEVU_SLOT_SCOPE_KEY, WEVU_TEMPLATE_REFS_CALLBACKS_KEY, WEVU_TEMPLATE_REFS_KEY, WEVU_TEMPLATE_REFS_PENDING_KEY, WEVU_TEMPLATE_REF_MAP_KEY, WEVU_WATCH_STOPS_KEY } from "@weapp-core/constants";
|
|
5
7
|
import { resolveMiniProgramPageKeys } from "@weapp-core/shared";
|
|
6
8
|
import { wpi } from "@wevu/api";
|
|
7
9
|
|
|
8
|
-
//#region \0rolldown/runtime.js
|
|
9
|
-
var __defProp = Object.defineProperty;
|
|
10
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
11
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
12
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
13
|
-
var __exportAll = (all, no_symbols) => {
|
|
14
|
-
let target = {};
|
|
15
|
-
for (var name in all) {
|
|
16
|
-
__defProp(target, name, {
|
|
17
|
-
get: all[name],
|
|
18
|
-
enumerable: true
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
if (!no_symbols) {
|
|
22
|
-
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
23
|
-
}
|
|
24
|
-
return target;
|
|
25
|
-
};
|
|
26
|
-
var __copyProps = (to, from, except, desc) => {
|
|
27
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
28
|
-
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
29
|
-
key = keys[i];
|
|
30
|
-
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
31
|
-
__defProp(to, key, {
|
|
32
|
-
get: ((k) => from[k]).bind(null, key),
|
|
33
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return to;
|
|
39
|
-
};
|
|
40
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
41
|
-
|
|
42
|
-
//#endregion
|
|
43
|
-
//#region src/reactivity/shallowRef.ts
|
|
44
|
-
/**
|
|
45
|
-
* 创建一个“浅层” ref:它只在 .value 被整体替换时触发依赖,不会对内部对象做深层响应式处理。
|
|
46
|
-
*
|
|
47
|
-
* @param value 初始值
|
|
48
|
-
* @param defaultValue 传递给 customRef 的默认值,可用于兜底
|
|
49
|
-
* @returns 仅跟踪自身 .value 变更的浅层 ref
|
|
50
|
-
*
|
|
51
|
-
* @example
|
|
52
|
-
* ```ts
|
|
53
|
-
* const state = shallowRef({ count: 0 })
|
|
54
|
-
* state.value = { count: 1 } // 会触发依赖
|
|
55
|
-
* state.value.count++ // 不会触发依赖(内部属性未被深度代理)
|
|
56
|
-
* ```
|
|
57
|
-
*/
|
|
58
|
-
function shallowRef(value, defaultValue) {
|
|
59
|
-
return customRef((track, trigger) => ({
|
|
60
|
-
get() {
|
|
61
|
-
track();
|
|
62
|
-
return value;
|
|
63
|
-
},
|
|
64
|
-
set(newValue) {
|
|
65
|
-
if (Object.is(value, newValue)) return;
|
|
66
|
-
value = newValue;
|
|
67
|
-
trigger();
|
|
68
|
-
}
|
|
69
|
-
}), defaultValue);
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* 判断传入值是否为浅层 ref。
|
|
73
|
-
*
|
|
74
|
-
* @param r 待判断的值
|
|
75
|
-
* @returns 若为浅层 ref 则返回 true
|
|
76
|
-
*/
|
|
77
|
-
function isShallowRef(r) {
|
|
78
|
-
return isRef(r) && typeof r.value !== "function";
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* 主动触发一次浅层 ref 的更新(无需深度比较)。
|
|
82
|
-
*
|
|
83
|
-
* @param ref 需要触发的 ref
|
|
84
|
-
*/
|
|
85
|
-
function triggerRef(ref) {
|
|
86
|
-
if (isRef(ref)) {
|
|
87
|
-
const dep = ref.dep;
|
|
88
|
-
if (dep) {
|
|
89
|
-
triggerEffects(dep);
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
ref.value = ref.value;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
//#endregion
|
|
97
|
-
//#region src/reactivity/toRefs.ts
|
|
98
|
-
function toRef(object, key, defaultValue) {
|
|
99
|
-
const value = object[key];
|
|
100
|
-
if (isRef(value)) return value;
|
|
101
|
-
return customRef((track, trigger) => ({
|
|
102
|
-
get() {
|
|
103
|
-
track();
|
|
104
|
-
return object[key];
|
|
105
|
-
},
|
|
106
|
-
set(newValue) {
|
|
107
|
-
object[key] = newValue;
|
|
108
|
-
trigger();
|
|
109
|
-
}
|
|
110
|
-
}), defaultValue);
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* 将一个响应式对象转换成“同结构的普通对象”,其中每个字段都是指向原对象对应属性的 ref。
|
|
114
|
-
*
|
|
115
|
-
* @param object 待转换的响应式对象
|
|
116
|
-
* @returns 包含若干 ref 的普通对象
|
|
117
|
-
*
|
|
118
|
-
* @example
|
|
119
|
-
* ```ts
|
|
120
|
-
* const state = reactive({ foo: 1, bar: 2 })
|
|
121
|
-
* const stateAsRefs = toRefs(state)
|
|
122
|
-
*
|
|
123
|
-
* stateAsRefs.foo.value++ // 2
|
|
124
|
-
* state.foo // 2
|
|
125
|
-
* ```
|
|
126
|
-
*/
|
|
127
|
-
function toRefs(object) {
|
|
128
|
-
if (!isReactive(object)) console.warn("toRefs() 需要响应式对象,但收到的是普通对象。");
|
|
129
|
-
const result = Array.isArray(object) ? Array.from({ length: object.length }) : {};
|
|
130
|
-
for (const key in object) result[key] = toRef(object, key);
|
|
131
|
-
return result;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
//#endregion
|
|
135
|
-
//#region src/reactivity/traverse.ts
|
|
136
|
-
/**
|
|
137
|
-
* 深度遍历工具(框架内部依赖收集使用)。
|
|
138
|
-
* @internal
|
|
139
|
-
*/
|
|
140
|
-
function traverse(value, depth = Infinity, seen = /* @__PURE__ */ new Map()) {
|
|
141
|
-
if (depth <= 0 || !isObject$1(value)) return value;
|
|
142
|
-
if (isRef(value)) {
|
|
143
|
-
traverse(value.value, depth - 1, seen);
|
|
144
|
-
return value;
|
|
145
|
-
}
|
|
146
|
-
if (value["__r_skip"]) return value;
|
|
147
|
-
const existingDepth = seen.get(value);
|
|
148
|
-
if (existingDepth !== void 0 && existingDepth >= depth) return value;
|
|
149
|
-
seen.set(value, depth);
|
|
150
|
-
const nextDepth = depth - 1;
|
|
151
|
-
if (Array.isArray(value)) {
|
|
152
|
-
value.forEach((item) => traverse(item, nextDepth, seen));
|
|
153
|
-
return value;
|
|
154
|
-
}
|
|
155
|
-
if (value instanceof Map) {
|
|
156
|
-
value.forEach((item) => traverse(item, nextDepth, seen));
|
|
157
|
-
return value;
|
|
158
|
-
}
|
|
159
|
-
if (value instanceof Set) {
|
|
160
|
-
value.forEach((item) => traverse(item, nextDepth, seen));
|
|
161
|
-
return value;
|
|
162
|
-
}
|
|
163
|
-
const target = isReactive(value) && depth !== Infinity ? toRaw(value) : value;
|
|
164
|
-
for (const key in target) traverse(value[key], nextDepth, seen);
|
|
165
|
-
return value;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
//#endregion
|
|
169
10
|
//#region src/runtime/hooks/vue.ts
|
|
170
11
|
/**
|
|
171
12
|
* Vue 3 对齐:组件/页面已挂载,映射小程序 onReady
|
|
@@ -241,244 +82,9 @@ function callUpdateHooks(target, phase) {
|
|
|
241
82
|
callHookList(target, phase === "before" ? WEVU_ON_BEFORE_UPDATE_HOOK : WEVU_ON_UPDATED_HOOK);
|
|
242
83
|
}
|
|
243
84
|
|
|
244
|
-
//#endregion
|
|
245
|
-
//#region src/reactivity/watch/types.ts
|
|
246
|
-
let __deepWatchStrategy = "version";
|
|
247
|
-
/**
|
|
248
|
-
* 设置深度 watch 内部策略(测试/框架内部使用)。
|
|
249
|
-
* @internal
|
|
250
|
-
*/
|
|
251
|
-
function setDeepWatchStrategy(strategy) {
|
|
252
|
-
__deepWatchStrategy = strategy;
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* 获取深度 watch 内部策略(测试/框架内部使用)。
|
|
256
|
-
* @internal
|
|
257
|
-
*/
|
|
258
|
-
function getDeepWatchStrategy() {
|
|
259
|
-
return __deepWatchStrategy;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
//#endregion
|
|
263
|
-
//#region src/reactivity/watch/helpers.ts
|
|
264
|
-
function resolveWatchSource(item) {
|
|
265
|
-
if (typeof item === "function") return item();
|
|
266
|
-
if (isRef(item)) return item.value;
|
|
267
|
-
if (isReactive(item)) return item;
|
|
268
|
-
throw new Error("无效的 watch 源");
|
|
269
|
-
}
|
|
270
|
-
function createWatchGetter(source) {
|
|
271
|
-
const isReactiveSource = isReactive(source);
|
|
272
|
-
const isMultiSource = Array.isArray(source) && !isReactiveSource;
|
|
273
|
-
let getter;
|
|
274
|
-
if (isMultiSource) {
|
|
275
|
-
const sources = source;
|
|
276
|
-
getter = () => sources.map((item) => resolveWatchSource(item));
|
|
277
|
-
} else if (typeof source === "function") getter = source;
|
|
278
|
-
else if (isRef(source)) getter = () => source.value;
|
|
279
|
-
else if (isReactiveSource) getter = () => source;
|
|
280
|
-
else throw new Error("无效的 watch 源");
|
|
281
|
-
return {
|
|
282
|
-
getter,
|
|
283
|
-
isMultiSource,
|
|
284
|
-
isReactiveSource
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
function applyDeepWatchGetter(getter, source, isMultiSource, isReactiveSource, deepOption) {
|
|
288
|
-
const deepDefault = isMultiSource ? source.some((item) => isReactive(item)) : isReactiveSource;
|
|
289
|
-
const deep = deepOption !== null && deepOption !== void 0 ? deepOption : deepDefault;
|
|
290
|
-
if (!(deep === true || typeof deep === "number")) return getter;
|
|
291
|
-
const depth = typeof deep === "number" ? deep : deep ? Infinity : 0;
|
|
292
|
-
return () => {
|
|
293
|
-
const value = getter();
|
|
294
|
-
const strategy = getDeepWatchStrategy();
|
|
295
|
-
if (isMultiSource && Array.isArray(value)) return value.map((item) => {
|
|
296
|
-
if (strategy === "version" && isReactive(item)) {
|
|
297
|
-
touchReactive(item);
|
|
298
|
-
return item;
|
|
299
|
-
}
|
|
300
|
-
return traverse(item, depth);
|
|
301
|
-
});
|
|
302
|
-
if (strategy === "version" && isReactive(value)) {
|
|
303
|
-
touchReactive(value);
|
|
304
|
-
return value;
|
|
305
|
-
}
|
|
306
|
-
return traverse(value, depth);
|
|
307
|
-
};
|
|
308
|
-
}
|
|
309
|
-
function dispatchScheduledJob(job, flush, isFirstRun, scheduler) {
|
|
310
|
-
if (scheduler) {
|
|
311
|
-
scheduler(job, isFirstRun);
|
|
312
|
-
return;
|
|
313
|
-
}
|
|
314
|
-
if (flush === "sync") {
|
|
315
|
-
job();
|
|
316
|
-
return;
|
|
317
|
-
}
|
|
318
|
-
if (flush === "post") {
|
|
319
|
-
nextTick(() => queueJob(job));
|
|
320
|
-
return;
|
|
321
|
-
}
|
|
322
|
-
if (isFirstRun) job();
|
|
323
|
-
else queueJob(job);
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
//#endregion
|
|
327
|
-
//#region src/reactivity/watch.ts
|
|
328
|
-
function watch(source, cb, options = {}) {
|
|
329
|
-
var _options$flush;
|
|
330
|
-
const ownerInstance = getCurrentInstance();
|
|
331
|
-
const watchGetterContext = createWatchGetter(source);
|
|
332
|
-
const getter = applyDeepWatchGetter(watchGetterContext.getter, source, watchGetterContext.isMultiSource, watchGetterContext.isReactiveSource, options.deep);
|
|
333
|
-
let cleanup;
|
|
334
|
-
const onCleanup = (fn) => {
|
|
335
|
-
cleanup = fn;
|
|
336
|
-
};
|
|
337
|
-
let oldValue;
|
|
338
|
-
let runner;
|
|
339
|
-
let paused = false;
|
|
340
|
-
let pauseToken = 0;
|
|
341
|
-
let scheduledToken = pauseToken;
|
|
342
|
-
let stopHandle;
|
|
343
|
-
const cbWithOnce = options.once ? (value, oldVal, cleanupRegister) => {
|
|
344
|
-
cb(value, oldVal, cleanupRegister);
|
|
345
|
-
stopHandle();
|
|
346
|
-
} : cb;
|
|
347
|
-
const flush = (_options$flush = options.flush) !== null && _options$flush !== void 0 ? _options$flush : "pre";
|
|
348
|
-
const runJob = (token) => {
|
|
349
|
-
if (!runner.active || paused || token !== pauseToken) return;
|
|
350
|
-
const newValue = runner();
|
|
351
|
-
cleanup === null || cleanup === void 0 || cleanup();
|
|
352
|
-
const previousInstance = getCurrentInstance();
|
|
353
|
-
setCurrentInstance(ownerInstance);
|
|
354
|
-
try {
|
|
355
|
-
cbWithOnce(newValue, oldValue, onCleanup);
|
|
356
|
-
} finally {
|
|
357
|
-
setCurrentInstance(previousInstance);
|
|
358
|
-
}
|
|
359
|
-
oldValue = newValue;
|
|
360
|
-
};
|
|
361
|
-
const scheduledJob = () => runJob(scheduledToken);
|
|
362
|
-
const scheduleJob = (isFirstRun) => {
|
|
363
|
-
scheduledToken = pauseToken;
|
|
364
|
-
dispatchScheduledJob(scheduledJob, flush, isFirstRun, options.scheduler);
|
|
365
|
-
};
|
|
366
|
-
runner = effect(() => getter(), {
|
|
367
|
-
scheduler: () => {
|
|
368
|
-
if (paused) return;
|
|
369
|
-
scheduleJob(false);
|
|
370
|
-
},
|
|
371
|
-
lazy: true
|
|
372
|
-
});
|
|
373
|
-
const doStop = () => {
|
|
374
|
-
cleanup === null || cleanup === void 0 || cleanup();
|
|
375
|
-
cleanup = void 0;
|
|
376
|
-
stop(runner);
|
|
377
|
-
};
|
|
378
|
-
stopHandle = doStop;
|
|
379
|
-
stopHandle.stop = doStop;
|
|
380
|
-
stopHandle.pause = () => {
|
|
381
|
-
if (!paused) {
|
|
382
|
-
paused = true;
|
|
383
|
-
pauseToken += 1;
|
|
384
|
-
}
|
|
385
|
-
};
|
|
386
|
-
stopHandle.resume = () => {
|
|
387
|
-
if (!paused || !runner.active) return;
|
|
388
|
-
paused = false;
|
|
389
|
-
oldValue = runner();
|
|
390
|
-
};
|
|
391
|
-
if (options.immediate) runJob(pauseToken);
|
|
392
|
-
else oldValue = runner();
|
|
393
|
-
onScopeDispose(stopHandle);
|
|
394
|
-
return stopHandle;
|
|
395
|
-
}
|
|
396
|
-
/**
|
|
397
|
-
* watchEffect 注册一个响应式副作用,可选清理函数。
|
|
398
|
-
* 副作用会立即执行,并在依赖变化时重新运行。
|
|
399
|
-
*/
|
|
400
|
-
function watchEffect(effectFn, options = {}) {
|
|
401
|
-
var _options$flush2;
|
|
402
|
-
const ownerInstance = getCurrentInstance();
|
|
403
|
-
let cleanup;
|
|
404
|
-
const onCleanup = (fn) => {
|
|
405
|
-
cleanup = fn;
|
|
406
|
-
};
|
|
407
|
-
let runner;
|
|
408
|
-
let paused = false;
|
|
409
|
-
let pauseToken = 0;
|
|
410
|
-
let scheduledToken = pauseToken;
|
|
411
|
-
const flush = (_options$flush2 = options.flush) !== null && _options$flush2 !== void 0 ? _options$flush2 : "pre";
|
|
412
|
-
const runJob = (token) => {
|
|
413
|
-
if (!runner.active || paused || token !== pauseToken) return;
|
|
414
|
-
runner();
|
|
415
|
-
};
|
|
416
|
-
const scheduledJob = () => runJob(scheduledToken);
|
|
417
|
-
const scheduleJob = (isFirstRun) => {
|
|
418
|
-
scheduledToken = pauseToken;
|
|
419
|
-
dispatchScheduledJob(scheduledJob, flush, isFirstRun);
|
|
420
|
-
};
|
|
421
|
-
runner = effect(() => {
|
|
422
|
-
cleanup === null || cleanup === void 0 || cleanup();
|
|
423
|
-
cleanup = void 0;
|
|
424
|
-
const previousInstance = getCurrentInstance();
|
|
425
|
-
setCurrentInstance(ownerInstance);
|
|
426
|
-
try {
|
|
427
|
-
effectFn(onCleanup);
|
|
428
|
-
} finally {
|
|
429
|
-
setCurrentInstance(previousInstance);
|
|
430
|
-
}
|
|
431
|
-
}, {
|
|
432
|
-
lazy: true,
|
|
433
|
-
scheduler: () => {
|
|
434
|
-
if (paused) return;
|
|
435
|
-
scheduleJob(false);
|
|
436
|
-
}
|
|
437
|
-
});
|
|
438
|
-
scheduleJob(true);
|
|
439
|
-
const doStop = () => {
|
|
440
|
-
cleanup === null || cleanup === void 0 || cleanup();
|
|
441
|
-
cleanup = void 0;
|
|
442
|
-
stop(runner);
|
|
443
|
-
};
|
|
444
|
-
const stopHandle = doStop;
|
|
445
|
-
stopHandle.stop = doStop;
|
|
446
|
-
stopHandle.pause = () => {
|
|
447
|
-
if (!paused) {
|
|
448
|
-
paused = true;
|
|
449
|
-
pauseToken += 1;
|
|
450
|
-
}
|
|
451
|
-
};
|
|
452
|
-
stopHandle.resume = () => {
|
|
453
|
-
if (!paused || !runner.active) return;
|
|
454
|
-
paused = false;
|
|
455
|
-
scheduleJob(true);
|
|
456
|
-
};
|
|
457
|
-
onScopeDispose(stopHandle);
|
|
458
|
-
return stopHandle;
|
|
459
|
-
}
|
|
460
|
-
/**
|
|
461
|
-
* 以后置刷新的方式运行副作用,与 Vue 的 `watchPostEffect()` 兼容。
|
|
462
|
-
*/
|
|
463
|
-
function watchPostEffect(effectFn, options = {}) {
|
|
464
|
-
return watchEffect(effectFn, {
|
|
465
|
-
...options,
|
|
466
|
-
flush: "post"
|
|
467
|
-
});
|
|
468
|
-
}
|
|
469
|
-
/**
|
|
470
|
-
* 以同步刷新的方式运行副作用,与 Vue 的 `watchSyncEffect()` 兼容。
|
|
471
|
-
*/
|
|
472
|
-
function watchSyncEffect(effectFn, options = {}) {
|
|
473
|
-
return watchEffect(effectFn, {
|
|
474
|
-
...options,
|
|
475
|
-
flush: "sync"
|
|
476
|
-
});
|
|
477
|
-
}
|
|
478
|
-
|
|
479
85
|
//#endregion
|
|
480
86
|
//#region package.json
|
|
481
|
-
var version$1 = "6.16.
|
|
87
|
+
var version$1 = "6.16.32";
|
|
482
88
|
|
|
483
89
|
//#endregion
|
|
484
90
|
//#region src/version.ts
|
|
@@ -2472,6 +2078,17 @@ function resolveOwnerSnapshot(runtime) {
|
|
|
2472
2078
|
if (typeof fastSnapshot === "function") return fastSnapshot();
|
|
2473
2079
|
return typeof runtime.snapshot === "function" ? runtime.snapshot() : {};
|
|
2474
2080
|
}
|
|
2081
|
+
function shouldIncludeOwnerSnapshotProp(runtime, key) {
|
|
2082
|
+
const snapshotOmitKeys = runtime[WEVU_PROPS_DERIVED_KEYS_KEY];
|
|
2083
|
+
return !(snapshotOmitKeys instanceof Set && snapshotOmitKeys.has(key));
|
|
2084
|
+
}
|
|
2085
|
+
function mergeOwnerSnapshotProps(snapshot, propsSource, runtime) {
|
|
2086
|
+
if (!propsSource || typeof propsSource !== "object") return;
|
|
2087
|
+
for (const [key, value] of Object.entries(propsSource)) {
|
|
2088
|
+
if (!shouldIncludeOwnerSnapshotProp(runtime, key)) continue;
|
|
2089
|
+
snapshot[key] = value;
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
2475
2092
|
function attachOwnerSnapshot(target, runtime, ownerId) {
|
|
2476
2093
|
var _WEVU_PROPS_KEY;
|
|
2477
2094
|
try {
|
|
@@ -2485,8 +2102,7 @@ function attachOwnerSnapshot(target, runtime, ownerId) {
|
|
|
2485
2102
|
if (data && typeof data === "object") data[WEVU_SLOT_OWNER_ID_KEY] = ownerId;
|
|
2486
2103
|
} catch (_unused4) {}
|
|
2487
2104
|
const snapshot = resolveOwnerSnapshot(runtime);
|
|
2488
|
-
|
|
2489
|
-
if (propsSource && typeof propsSource === "object") for (const [key, value] of Object.entries(propsSource)) snapshot[key] = value;
|
|
2105
|
+
mergeOwnerSnapshotProps(snapshot, (_WEVU_PROPS_KEY = target[WEVU_PROPS_KEY]) !== null && _WEVU_PROPS_KEY !== void 0 ? _WEVU_PROPS_KEY : target.properties, runtime);
|
|
2490
2106
|
updateOwnerSnapshot(ownerId, snapshot, runtime.proxy);
|
|
2491
2107
|
}
|
|
2492
2108
|
|
|
@@ -3645,8 +3261,7 @@ function mountRuntimeInstance(target, runtimeApp, watchMap, setup, options) {
|
|
|
3645
3261
|
var _WEVU_PROPS_KEY;
|
|
3646
3262
|
if (!runtimeRef) return;
|
|
3647
3263
|
const snapshot = resolveOwnerSnapshot(runtimeRef);
|
|
3648
|
-
|
|
3649
|
-
if (propsSource && typeof propsSource === "object") for (const [key, value] of Object.entries(propsSource)) snapshot[key] = value;
|
|
3264
|
+
mergeOwnerSnapshotProps(snapshot, (_WEVU_PROPS_KEY = target[WEVU_PROPS_KEY]) !== null && _WEVU_PROPS_KEY !== void 0 ? _WEVU_PROPS_KEY : target.properties, runtimeRef);
|
|
3650
3265
|
updateOwnerSnapshot(ownerId, snapshot, runtimeRef.proxy);
|
|
3651
3266
|
};
|
|
3652
3267
|
const baseMountAdapter = {
|
|
@@ -3728,7 +3343,8 @@ function mountRuntimeInstance(target, runtimeApp, watchMap, setup, options) {
|
|
|
3728
3343
|
const internalRuntimeFields = {
|
|
3729
3344
|
__wevu_flushSetupSnapshotSync: runtime.__wevu_flushSetupSnapshotSync,
|
|
3730
3345
|
__wevu_touchSetupMethodsVersion: runtime.__wevu_touchSetupMethodsVersion,
|
|
3731
|
-
__wevu_trackSetupReactiveKey: runtime.__wevu_trackSetupReactiveKey
|
|
3346
|
+
__wevu_trackSetupReactiveKey: runtime.__wevu_trackSetupReactiveKey,
|
|
3347
|
+
[WEVU_PROPS_DERIVED_KEYS_KEY]: runtime[WEVU_PROPS_DERIVED_KEYS_KEY]
|
|
3732
3348
|
};
|
|
3733
3349
|
for (const [key, value] of Object.entries(internalRuntimeFields)) {
|
|
3734
3350
|
if (!value) continue;
|
|
@@ -4435,8 +4051,7 @@ function refreshOwnerSnapshotFromInstance(instance) {
|
|
|
4435
4051
|
const ownerId = instance[WEVU_SLOT_OWNER_ID_KEY];
|
|
4436
4052
|
if (!runtime || !ownerId || typeof runtime.snapshot !== "function") return;
|
|
4437
4053
|
const snapshot = runtime.snapshot();
|
|
4438
|
-
|
|
4439
|
-
if (propsSource && typeof propsSource === "object") for (const [key, value] of Object.entries(propsSource)) snapshot[key] = value;
|
|
4054
|
+
mergeOwnerSnapshotProps(snapshot, (_WEVU_PROPS_KEY = instance[WEVU_PROPS_KEY]) !== null && _WEVU_PROPS_KEY !== void 0 ? _WEVU_PROPS_KEY : instance.properties, runtime);
|
|
4440
4055
|
updateOwnerSnapshot(ownerId, snapshot, runtime.proxy);
|
|
4441
4056
|
}
|
|
4442
4057
|
|
|
@@ -4450,6 +4065,11 @@ function createPropsSync(options) {
|
|
|
4450
4065
|
const aliasEntries = Object.entries(propsAliases !== null && propsAliases !== void 0 ? propsAliases : {}).filter(([alias, propName]) => alias && propName);
|
|
4451
4066
|
const aliasKeySet = new Set(aliasEntries.map(([alias]) => alias));
|
|
4452
4067
|
const directPropsDerivedKeys = [...propsDerivedKeySet].filter((key) => propKeySet.has(key) && !aliasKeySet.has(key));
|
|
4068
|
+
const templateRuntimePropKeys = new Set([
|
|
4069
|
+
WEVU_SLOT_NAMES_PROP,
|
|
4070
|
+
WEVU_SLOT_OWNER_ID_PROP,
|
|
4071
|
+
WEVU_SLOT_SCOPE_KEY
|
|
4072
|
+
]);
|
|
4453
4073
|
const syncedAliases = /* @__PURE__ */ new WeakMap();
|
|
4454
4074
|
const isInternalAttrKey = (key) => key.startsWith("__wv_");
|
|
4455
4075
|
const updateSnapshotOmitKeys = (instance) => {
|
|
@@ -4463,6 +4083,15 @@ function createPropsSync(options) {
|
|
|
4463
4083
|
target[key] = value;
|
|
4464
4084
|
return true;
|
|
4465
4085
|
};
|
|
4086
|
+
const syncTemplateRuntimeProp = (instance, key, value) => {
|
|
4087
|
+
var _wevu;
|
|
4088
|
+
if (!templateRuntimePropKeys.has(key)) return;
|
|
4089
|
+
const runtimeState = (_wevu = instance.__wevu) === null || _wevu === void 0 ? void 0 : _wevu.state;
|
|
4090
|
+
if (!runtimeState || typeof runtimeState !== "object") return;
|
|
4091
|
+
try {
|
|
4092
|
+
setIfChanged(runtimeState, key, value);
|
|
4093
|
+
} catch (_unused) {}
|
|
4094
|
+
};
|
|
4466
4095
|
const syncSetupStatePropsAliases = (instance, propsProxy) => {
|
|
4467
4096
|
var _syncedAliases$get;
|
|
4468
4097
|
if (!aliasEntries.length) return;
|
|
@@ -4479,10 +4108,10 @@ function createPropsSync(options) {
|
|
|
4479
4108
|
try {
|
|
4480
4109
|
setIfChanged(setupState, alias, value);
|
|
4481
4110
|
aliases.add(alias);
|
|
4482
|
-
} catch (
|
|
4111
|
+
} catch (_unused2) {}
|
|
4483
4112
|
if (state && typeof state === "object" && (!hasOwn(state, alias) || aliases.has(alias))) try {
|
|
4484
4113
|
setIfChanged(state, alias, value);
|
|
4485
|
-
} catch (
|
|
4114
|
+
} catch (_unused3) {}
|
|
4486
4115
|
}
|
|
4487
4116
|
};
|
|
4488
4117
|
const syncPropsDerivedKeys = (instance, propsProxy) => {
|
|
@@ -4498,7 +4127,7 @@ function createPropsSync(options) {
|
|
|
4498
4127
|
if (!hasOwn(propsProxy, propName)) continue;
|
|
4499
4128
|
try {
|
|
4500
4129
|
setIfChanged(setupState, key, propsProxy[propName]);
|
|
4501
|
-
} catch (
|
|
4130
|
+
} catch (_unused4) {}
|
|
4502
4131
|
}
|
|
4503
4132
|
};
|
|
4504
4133
|
const attachWevuPropKeys = (instance) => {
|
|
@@ -4509,7 +4138,7 @@ function createPropsSync(options) {
|
|
|
4509
4138
|
enumerable: false,
|
|
4510
4139
|
writable: false
|
|
4511
4140
|
});
|
|
4512
|
-
} catch (
|
|
4141
|
+
} catch (_unused5) {
|
|
4513
4142
|
instance[WEVU_PROP_KEYS_KEY] = propKeys;
|
|
4514
4143
|
}
|
|
4515
4144
|
};
|
|
@@ -4517,8 +4146,8 @@ function createPropsSync(options) {
|
|
|
4517
4146
|
const attrsProxy = instance[WEVU_ATTRS_KEY];
|
|
4518
4147
|
if (!attrsProxy || typeof attrsProxy !== "object") return;
|
|
4519
4148
|
const hasRuntimeStateKey = (key) => {
|
|
4520
|
-
var
|
|
4521
|
-
const runtimeState = (
|
|
4149
|
+
var _wevu2;
|
|
4150
|
+
const runtimeState = (_wevu2 = instance.__wevu) === null || _wevu2 === void 0 ? void 0 : _wevu2.state;
|
|
4522
4151
|
return runtimeState != null && typeof runtimeState === "object" && hasOwn(runtimeState, key);
|
|
4523
4152
|
};
|
|
4524
4153
|
const properties = instance.properties;
|
|
@@ -4526,7 +4155,7 @@ function createPropsSync(options) {
|
|
|
4526
4155
|
const currentKeys = Object.keys(attrsProxy);
|
|
4527
4156
|
for (const existingKey of currentKeys) if (!next || !hasOwn(next, existingKey) || isInternalAttrKey(existingKey) || propKeySet.has(existingKey) || hasRuntimeStateKey(existingKey)) try {
|
|
4528
4157
|
delete attrsProxy[existingKey];
|
|
4529
|
-
} catch (
|
|
4158
|
+
} catch (_unused6) {}
|
|
4530
4159
|
if (!next) {
|
|
4531
4160
|
refreshOwnerSnapshotFromInstance(instance);
|
|
4532
4161
|
return;
|
|
@@ -4535,7 +4164,7 @@ function createPropsSync(options) {
|
|
|
4535
4164
|
if (isInternalAttrKey(key) || propKeySet.has(key) || hasRuntimeStateKey(key)) continue;
|
|
4536
4165
|
try {
|
|
4537
4166
|
attrsProxy[key] = value;
|
|
4538
|
-
} catch (
|
|
4167
|
+
} catch (_unused7) {}
|
|
4539
4168
|
}
|
|
4540
4169
|
refreshOwnerSnapshotFromInstance(instance);
|
|
4541
4170
|
};
|
|
@@ -4548,17 +4177,21 @@ function createPropsSync(options) {
|
|
|
4548
4177
|
const currentKeys = Object.keys(propsProxy);
|
|
4549
4178
|
for (const existingKey of currentKeys) if (!hasOwn(next, existingKey)) try {
|
|
4550
4179
|
delete propsProxy[existingKey];
|
|
4551
|
-
} catch (
|
|
4180
|
+
} catch (_unused8) {}
|
|
4552
4181
|
for (const [k, v] of Object.entries(next)) {
|
|
4553
4182
|
const nextValue = pendingPropValues && hasOwn(pendingPropValues, k) ? pendingPropValues[k] : v;
|
|
4554
4183
|
try {
|
|
4555
4184
|
propsProxy[k] = nextValue;
|
|
4556
|
-
} catch (
|
|
4185
|
+
} catch (_unused9) {}
|
|
4186
|
+
syncTemplateRuntimeProp(instance, k, nextValue);
|
|
4557
4187
|
}
|
|
4558
4188
|
if (pendingPropValues) {
|
|
4559
|
-
for (const [k, v] of Object.entries(pendingPropValues)) if (!hasOwn(next, k))
|
|
4560
|
-
|
|
4561
|
-
|
|
4189
|
+
for (const [k, v] of Object.entries(pendingPropValues)) if (!hasOwn(next, k)) {
|
|
4190
|
+
try {
|
|
4191
|
+
propsProxy[k] = v;
|
|
4192
|
+
} catch (_unused10) {}
|
|
4193
|
+
syncTemplateRuntimeProp(instance, k, v);
|
|
4194
|
+
}
|
|
4562
4195
|
}
|
|
4563
4196
|
syncPropsDerivedKeys(instance, propsProxy);
|
|
4564
4197
|
syncSetupStatePropsAliases(instance, propsProxy);
|
|
@@ -4577,7 +4210,8 @@ function createPropsSync(options) {
|
|
|
4577
4210
|
try {
|
|
4578
4211
|
propsProxy[key] = values[key];
|
|
4579
4212
|
changed = true;
|
|
4580
|
-
} catch (
|
|
4213
|
+
} catch (_unused11) {}
|
|
4214
|
+
syncTemplateRuntimeProp(instance, key, values[key]);
|
|
4581
4215
|
}
|
|
4582
4216
|
if (!changed) return;
|
|
4583
4217
|
syncPropsDerivedKeys(instance, propsProxy);
|
|
@@ -4591,7 +4225,8 @@ function createPropsSync(options) {
|
|
|
4591
4225
|
if (!propsProxy || typeof propsProxy !== "object") return;
|
|
4592
4226
|
try {
|
|
4593
4227
|
propsProxy[key] = value;
|
|
4594
|
-
} catch (
|
|
4228
|
+
} catch (_unused12) {}
|
|
4229
|
+
syncTemplateRuntimeProp(instance, key, value);
|
|
4595
4230
|
const pendingPropValues = (_ref$WEVU_PENDING_PRO = (_ref = instance)[WEVU_PENDING_PROP_VALUES_KEY]) !== null && _ref$WEVU_PENDING_PRO !== void 0 ? _ref$WEVU_PENDING_PRO : _ref[WEVU_PENDING_PROP_VALUES_KEY] = Object.create(null);
|
|
4596
4231
|
pendingPropValues[key] = value;
|
|
4597
4232
|
syncPropsDerivedKeys(instance, propsProxy);
|
|
@@ -5486,6 +5121,15 @@ function normalizeProps(baseOptions, props, explicitProperties) {
|
|
|
5486
5121
|
|
|
5487
5122
|
//#endregion
|
|
5488
5123
|
//#region src/runtime/define/scopedSlotOptions.ts
|
|
5124
|
+
const SCOPED_SLOT_SNAPSHOT_OMIT_KEYS = [
|
|
5125
|
+
WEVU_SLOT_OWNER_ID_KEY,
|
|
5126
|
+
WEVU_SLOT_OWNER_ID_PROP,
|
|
5127
|
+
WEVU_SLOT_OWNER_PROXY_KEY,
|
|
5128
|
+
WEVU_SLOT_OWNER_KEY,
|
|
5129
|
+
WEVU_SLOT_PROPS_DATA_KEY,
|
|
5130
|
+
WEVU_SLOT_PROPS_KEY,
|
|
5131
|
+
WEVU_SLOT_SCOPE_KEY
|
|
5132
|
+
];
|
|
5489
5133
|
const AMP_RE = /&/g;
|
|
5490
5134
|
const QUOT_RE = /"/g;
|
|
5491
5135
|
const NUM_QUOT_RE = /"/g;
|
|
@@ -5643,11 +5287,8 @@ function createScopedSlotOptions(overrides) {
|
|
|
5643
5287
|
const scopedSlotComputed = overrides === null || overrides === void 0 ? void 0 : overrides.computed;
|
|
5644
5288
|
const baseOptions = {
|
|
5645
5289
|
options: { virtualHost: true },
|
|
5646
|
-
setData: { omit:
|
|
5647
|
-
|
|
5648
|
-
WEVU_SLOT_OWNER_ID_PROP,
|
|
5649
|
-
WEVU_SLOT_OWNER_PROXY_KEY
|
|
5650
|
-
] },
|
|
5290
|
+
setData: { omit: SCOPED_SLOT_SNAPSHOT_OMIT_KEYS },
|
|
5291
|
+
[WEVU_PROPS_DERIVED_KEYS_KEY]: SCOPED_SLOT_SNAPSHOT_OMIT_KEYS,
|
|
5651
5292
|
properties: {
|
|
5652
5293
|
[WEVU_SLOT_OWNER_ID_PROP]: {
|
|
5653
5294
|
type: String,
|
|
@@ -6318,93 +5959,6 @@ function useScrollOffset(options = {}) {
|
|
|
6318
5959
|
return (selector) => runSelectorQuery(context, selector, all, (nodesRef) => nodesRef.scrollOffset());
|
|
6319
5960
|
}
|
|
6320
5961
|
|
|
6321
|
-
//#endregion
|
|
6322
|
-
//#region src/runtime/template.ts
|
|
6323
|
-
const hyphenateRE = /\B([A-Z])/g;
|
|
6324
|
-
function hasOwnProperty(target, key) {
|
|
6325
|
-
return Object.prototype.hasOwnProperty.call(target, key);
|
|
6326
|
-
}
|
|
6327
|
-
function hyphenate(value) {
|
|
6328
|
-
if (!value) return "";
|
|
6329
|
-
if (value.startsWith("--")) return value;
|
|
6330
|
-
return value.replace(hyphenateRE, "-$1").toLowerCase();
|
|
6331
|
-
}
|
|
6332
|
-
function appendStyle(base, part) {
|
|
6333
|
-
if (!part) return base;
|
|
6334
|
-
if (!base) return part;
|
|
6335
|
-
let next = base;
|
|
6336
|
-
if (!next.endsWith(";")) next += ";";
|
|
6337
|
-
const normalized = part.startsWith(";") ? part.slice(1) : part;
|
|
6338
|
-
return next + normalized;
|
|
6339
|
-
}
|
|
6340
|
-
function stringifyStyle(value) {
|
|
6341
|
-
let res = "";
|
|
6342
|
-
for (const key of Object.keys(value)) {
|
|
6343
|
-
const raw = unref(value[key]);
|
|
6344
|
-
if (raw == null) continue;
|
|
6345
|
-
const name = hyphenate(key);
|
|
6346
|
-
if (Array.isArray(raw)) for (const itemValue of raw) {
|
|
6347
|
-
const item = unref(itemValue);
|
|
6348
|
-
if (item == null) continue;
|
|
6349
|
-
res = appendStyle(res, `${name}:${item}`);
|
|
6350
|
-
}
|
|
6351
|
-
else res = appendStyle(res, `${name}:${raw}`);
|
|
6352
|
-
}
|
|
6353
|
-
return res;
|
|
6354
|
-
}
|
|
6355
|
-
function normalizeStyle(value) {
|
|
6356
|
-
const unwrapped = unref(value);
|
|
6357
|
-
if (unwrapped == null) return "";
|
|
6358
|
-
if (typeof unwrapped === "string") return unwrapped;
|
|
6359
|
-
if (Array.isArray(unwrapped)) {
|
|
6360
|
-
let res = "";
|
|
6361
|
-
for (const item of unwrapped) {
|
|
6362
|
-
const normalized = normalizeStyle(item);
|
|
6363
|
-
if (normalized) res = appendStyle(res, normalized);
|
|
6364
|
-
}
|
|
6365
|
-
return res;
|
|
6366
|
-
}
|
|
6367
|
-
if (typeof unwrapped === "object") return stringifyStyle(unwrapped);
|
|
6368
|
-
return "";
|
|
6369
|
-
}
|
|
6370
|
-
function normalizeClass(value) {
|
|
6371
|
-
const unwrapped = unref(value);
|
|
6372
|
-
let res = "";
|
|
6373
|
-
if (!unwrapped) return res;
|
|
6374
|
-
if (typeof unwrapped === "string") return unwrapped;
|
|
6375
|
-
if (Array.isArray(unwrapped)) {
|
|
6376
|
-
for (const item of unwrapped) {
|
|
6377
|
-
const normalized = normalizeClass(item);
|
|
6378
|
-
if (normalized) res += `${normalized} `;
|
|
6379
|
-
}
|
|
6380
|
-
return res.trim();
|
|
6381
|
-
}
|
|
6382
|
-
if (typeof unwrapped === "object") {
|
|
6383
|
-
for (const key of Object.keys(unwrapped)) if (unref(unwrapped[key])) res += `${key} `;
|
|
6384
|
-
return res.trim();
|
|
6385
|
-
}
|
|
6386
|
-
return res;
|
|
6387
|
-
}
|
|
6388
|
-
function resolvePropValue(target, key, fallback, preferProps = false) {
|
|
6389
|
-
if (target == null) return fallback;
|
|
6390
|
-
const propsObject = unref(target.__wevuProps);
|
|
6391
|
-
if (key === "data") {
|
|
6392
|
-
if (propsObject != null && (propsObject[key] !== void 0 || hasOwnProperty(propsObject, key))) return propsObject[key];
|
|
6393
|
-
return key in target ? target[key] : fallback;
|
|
6394
|
-
}
|
|
6395
|
-
const hasPropsValue = propsObject != null && (propsObject[key] !== void 0 || hasOwnProperty(propsObject, key));
|
|
6396
|
-
if (preferProps) {
|
|
6397
|
-
if (hasPropsValue) return propsObject[key];
|
|
6398
|
-
if (key in target) return target[key];
|
|
6399
|
-
return fallback;
|
|
6400
|
-
}
|
|
6401
|
-
const stateObject = unref(target.$state);
|
|
6402
|
-
if (stateObject != null && hasOwnProperty(stateObject, key)) return target[key];
|
|
6403
|
-
if (hasPropsValue) return propsObject[key];
|
|
6404
|
-
if (!(key in target)) return fallback;
|
|
6405
|
-
return target[key];
|
|
6406
|
-
}
|
|
6407
|
-
|
|
6408
5962
|
//#endregion
|
|
6409
5963
|
//#region src/runtime/updatePerformance.ts
|
|
6410
5964
|
function resolveUpdatePerformanceSetter(instance) {
|
|
@@ -6625,5 +6179,5 @@ function useTemplateRef(name) {
|
|
|
6625
6179
|
}
|
|
6626
6180
|
|
|
6627
6181
|
//#endregion
|
|
6628
|
-
export {
|
|
6629
|
-
//# sourceMappingURL=
|
|
6182
|
+
export { version as $, registerPageLayoutBridge as A, mountRuntimeInstance as B, useElementIntersectionObserver as C, defineComponent as D, createWevuScopedSlotComponent as E, unregisterRuntimeLayoutHosts as F, setPageLayout as G, teardownRuntimeInstance as H, useLayoutBridge as I, usePageLayout as J, syncRuntimePageLayoutState as K, useLayoutHosts as L, resolveLayoutBridge as M, resolveLayoutHost as N, createApp as O, unregisterPageLayoutBridge as P, markNoSetData as Q, waitForLayoutHost as R, useIntersectionObserver as S, createWevuComponent as T, runSetupFunction as U, setRuntimeSetDataVisibility as V, resolveRuntimePageLayoutName as W, setWevuDefaults as X, resetWevuDefaults as Y, isNoSetData as Z, usePageScrollThrottle as _, useModel as a, onDeactivated as at, useNavigationBarMetrics as b, useSlots as c, onServerPrefetch as ct, useUpdatePerformanceListener as d, callUpdateHooks as et, useBoundingClientRect as f, useAsyncPullDownRefresh as g, useSelectorQuery as h, useChangeModel as i, onBeforeUpdate as it, registerRuntimeLayoutHosts as j, registerComponent as k, defineAppSetup as l, onUnmounted as lt, useSelectorFields as m, mergeModels as n, onBeforeMount as nt, useAttrs as o, onErrorCaptured as ot, useScrollOffset as p, syncRuntimePageLayoutStateFromRuntime as q, useBindModel as r, onBeforeUnmount as rt, useNativeInstance as s, onMounted as st, useTemplateRef as t, onActivated as tt, use as u, onUpdated as ut, getCurrentPageStackSnapshot as v, useDisposables as w, usePageStack as x, getNavigationBarMetrics as y, registerApp as z };
|
|
6183
|
+
//# sourceMappingURL=templateRef-Cl4FZO1Q.mjs.map
|