@vtj/uni 0.10.7 → 0.10.9
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.mjs +176 -167
- package/dist/index.umd.js +3 -3
- package/package.json +5 -5
- package/types/setup/app.d.ts +1 -0
- package/types/types.d.ts +2 -1
- package/types/version.d.ts +2 -2
package/dist/index.mjs
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
import { adoptedStyleSheets as
|
1
|
+
import { adoptedStyleSheets as S } from "@vtj/renderer";
|
2
2
|
/**!
|
3
3
|
* Copyright (c) 2025, VTJ.PRO All rights reserved.
|
4
4
|
* @name @vtj/uni
|
5
5
|
* @author CHC chenhuachun1549@dingtalk.com
|
6
|
-
* @version 0.10.
|
6
|
+
* @version 0.10.9
|
7
7
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
8
8
|
*/
|
9
|
-
const
|
9
|
+
const Q = "0.10.9", h = [
|
10
10
|
"onLaunch",
|
11
11
|
"onShow",
|
12
12
|
"onHide",
|
@@ -17,7 +17,7 @@ const X = "0.10.7", T = [
|
|
17
17
|
"onPageNotFound",
|
18
18
|
"onUniNViewMessage",
|
19
19
|
"onExit"
|
20
|
-
],
|
20
|
+
], ee = [
|
21
21
|
"onLoad",
|
22
22
|
"onShow",
|
23
23
|
"onReady",
|
@@ -44,44 +44,44 @@ const X = "0.10.7", T = [
|
|
44
44
|
"updated",
|
45
45
|
"beforeUnmount",
|
46
46
|
"unmounted"
|
47
|
-
], f = "/pages",
|
48
|
-
name:
|
49
|
-
appid:
|
50
|
-
description:
|
51
|
-
versionName:
|
52
|
-
versionCode:
|
53
|
-
transformPx:
|
47
|
+
], f = "/pages", N = "VTJ", A = "__UNI__1FC118B", I = "VTJ移动跨端项目", w = "1.0.0", U = "100", R = !1, B = {}, C = { enable: !1 }, y = "3", b = {
|
48
|
+
name: N,
|
49
|
+
appid: A,
|
50
|
+
description: I,
|
51
|
+
versionName: w,
|
52
|
+
versionCode: U,
|
53
|
+
transformPx: R,
|
54
54
|
"app-plus": { usingComponents: !0, nvueStyleCompiler: "uni-app", compilerVersion: 3, splashscreen: { alwaysShowBeforeRender: !0, waiting: !0, autoclose: !0, delay: 0 }, modules: {}, distribute: { android: { permissions: ['<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>', '<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>', '<uses-permission android:name="android.permission.VIBRATE"/>', '<uses-permission android:name="android.permission.READ_LOGS"/>', '<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>', '<uses-feature android:name="android.hardware.camera.autofocus"/>', '<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>', '<uses-permission android:name="android.permission.CAMERA"/>', '<uses-permission android:name="android.permission.GET_ACCOUNTS"/>', '<uses-permission android:name="android.permission.READ_PHONE_STATE"/>', '<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>', '<uses-permission android:name="android.permission.WAKE_LOCK"/>', '<uses-permission android:name="android.permission.FLASHLIGHT"/>', '<uses-feature android:name="android.hardware.camera"/>', '<uses-permission android:name="android.permission.WRITE_SETTINGS"/>'] }, ios: {}, sdkConfigs: {}, icons: { android: { hdpi: "src/static/logo.png", xhdpi: "src/static/logo.png", xxhdpi: "src/static/logo.png", xxxhdpi: "src/static/logo.png" } } } },
|
55
|
-
quickapp:
|
55
|
+
quickapp: B,
|
56
56
|
"mp-weixin": { appid: "", setting: { urlCheck: !1 }, usingComponents: !0 },
|
57
57
|
"mp-alipay": { usingComponents: !0 },
|
58
58
|
"mp-baidu": { usingComponents: !0 },
|
59
59
|
"mp-toutiao": { usingComponents: !0 },
|
60
|
-
uniStatistics:
|
61
|
-
vueVersion:
|
62
|
-
},
|
63
|
-
pages:
|
64
|
-
globalStyle:
|
65
|
-
easycom:
|
60
|
+
uniStatistics: C,
|
61
|
+
vueVersion: y
|
62
|
+
}, v = [], F = { navigationBarTextStyle: "black", navigationBarTitleText: "uni-app", navigationBarBackgroundColor: "#F8F8F8", backgroundColor: "#F8F8F8" }, P = { autoscan: !0, custom: { "^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue" } }, O = {
|
63
|
+
pages: v,
|
64
|
+
globalStyle: F,
|
65
|
+
easycom: P
|
66
66
|
};
|
67
|
-
function
|
67
|
+
function ne(e) {
|
68
68
|
const [t, ...n] = e;
|
69
|
-
return [t.toLowerCase(), ...n].join("").replace(/[A-Z]/g, (
|
69
|
+
return [t.toLowerCase(), ...n].join("").replace(/[A-Z]/g, (i) => `-${i.toLowerCase()}`);
|
70
70
|
}
|
71
|
-
function
|
72
|
-
let { manifestJson: t = {}, pagesJson: n = {}, routes:
|
73
|
-
const
|
74
|
-
const { path: a, style:
|
71
|
+
function x(e) {
|
72
|
+
let { manifestJson: t = {}, pagesJson: n = {}, routes: o = [] } = e;
|
73
|
+
const i = o.map((s) => {
|
74
|
+
const { path: a, style: r, needLogin: c } = s;
|
75
75
|
return {
|
76
76
|
path: a,
|
77
|
-
style:
|
77
|
+
style: r,
|
78
78
|
needLogin: c
|
79
79
|
};
|
80
80
|
});
|
81
81
|
return {
|
82
82
|
...e,
|
83
|
-
manifestJson: Object.assign({},
|
84
|
-
pagesJson: Object.assign({},
|
83
|
+
manifestJson: Object.assign({}, b, t),
|
84
|
+
pagesJson: Object.assign({}, O, n, { pages: i })
|
85
85
|
};
|
86
86
|
}
|
87
87
|
const g = {
|
@@ -93,63 +93,63 @@ const g = {
|
|
93
93
|
titlePenetrate: "titlePenetrate",
|
94
94
|
transparentTitle: "transparentTitle"
|
95
95
|
};
|
96
|
-
function
|
96
|
+
function E(e) {
|
97
97
|
const t = {}, n = {
|
98
98
|
black: "#000000",
|
99
99
|
white: "#ffffff"
|
100
100
|
};
|
101
|
-
for (const
|
102
|
-
g[
|
101
|
+
for (const o in e)
|
102
|
+
g[o] && (t[g[o]] = o === "navigationBarTextStyle" ? n[e[o]] || n.black : e[o]);
|
103
103
|
return t;
|
104
104
|
}
|
105
|
-
function
|
105
|
+
function L(e) {
|
106
106
|
const t = {};
|
107
107
|
for (const n in e)
|
108
108
|
g[n] || (t[n] = e[n]);
|
109
109
|
return t;
|
110
110
|
}
|
111
|
-
function
|
111
|
+
function te(e) {
|
112
112
|
return e.split("?")[0].match(/\#\/pages\/([\w\W]*)/i)?.[1] ?? "";
|
113
113
|
}
|
114
114
|
function V(e) {
|
115
115
|
return e.h5?.router?.mode || "hash";
|
116
116
|
}
|
117
|
-
function
|
117
|
+
function k(e) {
|
118
118
|
return {
|
119
119
|
topWindow: !!e.topWindow?.path,
|
120
120
|
leftWindow: !!e.leftWindow?.path,
|
121
121
|
rightWindow: !!e.rightWindow?.path
|
122
122
|
};
|
123
123
|
}
|
124
|
-
function
|
125
|
-
const { pagesJson: t = {} } = e, { globalStyle: n, pages:
|
126
|
-
return !!(n?.enablePullDownRefresh ||
|
124
|
+
function W(e) {
|
125
|
+
const { pagesJson: t = {} } = e, { globalStyle: n, pages: o = [] } = t;
|
126
|
+
return !!(n?.enablePullDownRefresh || o.find((i) => !!i.style?.enablePullDownRefresh));
|
127
127
|
}
|
128
|
-
function
|
129
|
-
const { pagesJson: t = {} } = e, { globalStyle: n, pages:
|
130
|
-
let
|
131
|
-
return n?.navigationStyle === "custom" ? (
|
128
|
+
function M(e) {
|
129
|
+
const { pagesJson: t = {} } = e, { globalStyle: n, pages: o = [] } = t;
|
130
|
+
let i = !1;
|
131
|
+
return n?.navigationStyle === "custom" ? (i = !0, o.find((s) => s.style?.navigationStyle === "default") && (i = !1)) : o.every((s) => s.style?.navigationStyle === "custom") && (i = !0), i;
|
132
132
|
}
|
133
|
-
function
|
134
|
-
const t =
|
133
|
+
function D(e) {
|
134
|
+
const t = M(e), n = {
|
135
135
|
navigationBar: !1,
|
136
136
|
navigationBarButtons: !1,
|
137
137
|
navigationBarSearchInput: !1,
|
138
138
|
navigationBarTransparent: !1
|
139
|
-
}, { pagesJson:
|
139
|
+
}, { pagesJson: o = {} } = e, { globalStyle: i, pages: s = [] } = o;
|
140
140
|
if (t)
|
141
141
|
return n;
|
142
142
|
n.navigationBar = !0;
|
143
|
-
const a =
|
144
|
-
return
|
143
|
+
const a = i?.h5?.titleNView;
|
144
|
+
return s.find((r) => !!r.style?.h5?.titleNView?.buttons.length) && (n.navigationBarButtons = !0), (a?.searchInput || s.find((r) => !!r.style?.h5?.titleNView?.searchInput)) && (n.navigationBarSearchInput = !0), (a?.type === "transparent" || s.find((r) => r.style?.h5?.titleNView?.type === "transparent")) && (n.navigationBarTransparent = !0), n;
|
145
145
|
}
|
146
|
-
function
|
147
|
-
const { pagesJson: n = {}, manifestJson:
|
148
|
-
navigationBar:
|
146
|
+
function G(e, t = window) {
|
147
|
+
const { pagesJson: n = {}, manifestJson: o = {} } = e, { topWindow: i, leftWindow: s, rightWindow: a } = k(n), {
|
148
|
+
navigationBar: r,
|
149
149
|
navigationBarButtons: c,
|
150
150
|
navigationBarSearchInput: u,
|
151
151
|
navigationBarTransparent: _
|
152
|
-
} =
|
152
|
+
} = D(e), p = {
|
153
153
|
// vue
|
154
154
|
__VUE_OPTIONS_API__: !0,
|
155
155
|
// enable/disable Options API support, default: true
|
@@ -184,7 +184,7 @@ function D(e, t = window) {
|
|
184
184
|
// 是否启用i18n
|
185
185
|
__UNI_FEATURE_NVUE__: !1,
|
186
186
|
// 是否启用nvue
|
187
|
-
__UNI_FEATURE_ROUTER_MODE__: V(
|
187
|
+
__UNI_FEATURE_ROUTER_MODE__: V(o),
|
188
188
|
// 路由模式
|
189
189
|
__UNI_FEATURE_PAGES__: !!n.pages?.length,
|
190
190
|
// 是否多页面
|
@@ -192,17 +192,17 @@ function D(e, t = window) {
|
|
192
192
|
// 是否包含tabBar
|
193
193
|
__UNI_FEATURE_TABBAR_MIDBUTTON__: !!n.tabBar?.midButton,
|
194
194
|
// 是否包含midButton
|
195
|
-
__UNI_FEATURE_TOPWINDOW__:
|
195
|
+
__UNI_FEATURE_TOPWINDOW__: i,
|
196
196
|
// 是否包含topWindow
|
197
|
-
__UNI_FEATURE_LEFTWINDOW__:
|
197
|
+
__UNI_FEATURE_LEFTWINDOW__: s,
|
198
198
|
// 是否包含leftWindow
|
199
199
|
__UNI_FEATURE_RIGHTWINDOW__: a,
|
200
200
|
// 是否包含rightWindow
|
201
201
|
__UNI_FEATURE_RESPONSIVE__: !1,
|
202
202
|
// 是否启用响应式
|
203
|
-
__UNI_FEATURE_NAVIGATIONBAR__:
|
203
|
+
__UNI_FEATURE_NAVIGATIONBAR__: r,
|
204
204
|
// 是否启用标题栏
|
205
|
-
__UNI_FEATURE_PULL_DOWN_REFRESH__:
|
205
|
+
__UNI_FEATURE_PULL_DOWN_REFRESH__: W(e),
|
206
206
|
// 是否启用下拉刷新
|
207
207
|
__UNI_FEATURE_NAVIGATIONBAR_BUTTONS__: c,
|
208
208
|
// 是否启用标题栏按钮
|
@@ -211,37 +211,37 @@ function D(e, t = window) {
|
|
211
211
|
__UNI_FEATURE_NAVIGATIONBAR_TRANSPARENT__: _
|
212
212
|
// 是否启用透明标题栏
|
213
213
|
};
|
214
|
-
Object.entries(
|
215
|
-
t[
|
214
|
+
Object.entries(p).forEach(([d, l]) => {
|
215
|
+
t[d] = l;
|
216
216
|
});
|
217
217
|
}
|
218
|
-
const
|
219
|
-
function
|
220
|
-
const { pagesJson: n = {}, manifestJson:
|
221
|
-
appid:
|
218
|
+
const J = "4.45";
|
219
|
+
function H(e, t = window) {
|
220
|
+
const { pagesJson: n = {}, manifestJson: o = {} } = e, { easycom: i = {} } = n, {
|
221
|
+
appid: s = "",
|
222
222
|
name: a = "",
|
223
|
-
versionCode:
|
223
|
+
versionCode: r = "",
|
224
224
|
versionName: c = ""
|
225
|
-
} =
|
225
|
+
} = o, u = n.globalStyle, _ = o.h5?.router || {};
|
226
226
|
t.__uniConfig = {
|
227
|
-
easycom:
|
227
|
+
easycom: i,
|
228
228
|
globalStyle: {
|
229
|
-
...
|
230
|
-
navigationBar:
|
229
|
+
...L(u),
|
230
|
+
navigationBar: E(u),
|
231
231
|
isNVue: !1
|
232
232
|
},
|
233
|
-
compilerVersion:
|
234
|
-
appId:
|
233
|
+
compilerVersion: J,
|
234
|
+
appId: s,
|
235
235
|
appName: a,
|
236
236
|
appVersion: c,
|
237
|
-
appVersionCode: String(
|
237
|
+
appVersionCode: String(r),
|
238
238
|
async: {
|
239
239
|
loading: "AsyncLoading",
|
240
240
|
error: "AsyncError",
|
241
241
|
delay: 200,
|
242
242
|
timeout: 6e4,
|
243
243
|
suspensible: !0,
|
244
|
-
...
|
244
|
+
...o.h5?.async || {}
|
245
245
|
},
|
246
246
|
debug: !1,
|
247
247
|
networkTimeout: {
|
@@ -249,7 +249,7 @@ function G(e, t = window) {
|
|
249
249
|
connectSocket: 6e4,
|
250
250
|
uploadFile: 6e4,
|
251
251
|
downloadFile: 6e4,
|
252
|
-
...
|
252
|
+
...o.networkTimeout || {}
|
253
253
|
},
|
254
254
|
sdkConfigs: {},
|
255
255
|
nvue: {
|
@@ -285,28 +285,28 @@ function G(e, t = window) {
|
|
285
285
|
// tabBar: pagesJson.tabBar
|
286
286
|
};
|
287
287
|
}
|
288
|
-
function
|
288
|
+
function j(e, t = window) {
|
289
289
|
const {
|
290
290
|
UniServiceJSBridge: n,
|
291
|
-
UniViewJSBridge:
|
292
|
-
getApp:
|
293
|
-
uni:
|
291
|
+
UniViewJSBridge: o,
|
292
|
+
getApp: i,
|
293
|
+
uni: s,
|
294
294
|
getCurrentPages: a,
|
295
|
-
upx2px:
|
295
|
+
upx2px: r,
|
296
296
|
setupPage: c
|
297
297
|
} = e;
|
298
|
-
t.UniServiceJSBridge = n, t.UniViewJSBridge =
|
298
|
+
t.UniServiceJSBridge = n, t.UniViewJSBridge = o, t.getApp = i, t.uni = s, t.wx = s, t.getCurrentPages = a, t.upx2px = r, t.__setupPage = (u) => c(u);
|
299
299
|
}
|
300
|
-
function
|
301
|
-
const {
|
300
|
+
function $(e, t, n) {
|
301
|
+
const { openBlock: o, createBlock: i, withCtx: s, createVNode: a } = e, { PageComponent: r, setupPage: c, getApp: u } = t;
|
302
302
|
return {
|
303
303
|
mpType: "page",
|
304
|
-
setup() {
|
305
|
-
const p =
|
306
|
-
return () => (o(), r
|
307
|
-
page:
|
308
|
-
|
309
|
-
|
304
|
+
async setup() {
|
305
|
+
const p = u()?.$route?.query || {}, { loader: d, component: l } = n, T = d ? await d(n) : l || {};
|
306
|
+
return () => (o(), i(r, null, {
|
307
|
+
page: s(() => [
|
308
|
+
a(
|
309
|
+
c(T),
|
310
310
|
Object.assign({}, p, { ref: "page" }),
|
311
311
|
null,
|
312
312
|
512
|
@@ -317,38 +317,42 @@ function H(e, t, n) {
|
|
317
317
|
}
|
318
318
|
};
|
319
319
|
}
|
320
|
-
function
|
321
|
-
const { path:
|
320
|
+
function K(e, t, n) {
|
321
|
+
const { path: o, style: i = {}, meta: s = {}, home: a, id: r } = t, c = e.tabBar?.list || [], u = c.findIndex((l) => l.pagePath === o || l.pagePath?.endsWith(r)), _ = c[u], p = !!_, d = n === 0;
|
322
322
|
return {
|
323
|
-
isTabBar:
|
323
|
+
isTabBar: p,
|
324
324
|
tabBarIndex: u,
|
325
|
-
isQuit: a ??
|
326
|
-
isEntry: a ??
|
325
|
+
isQuit: a ?? d,
|
326
|
+
isEntry: a ?? d,
|
327
327
|
navigationBar: {
|
328
328
|
type: "default",
|
329
|
-
...
|
329
|
+
...E(i)
|
330
330
|
},
|
331
331
|
isNVue: !1,
|
332
|
-
route: _ ? _.pagePath :
|
333
|
-
...
|
332
|
+
route: _ ? _.pagePath : o,
|
333
|
+
...s
|
334
334
|
};
|
335
335
|
}
|
336
|
-
function
|
337
|
-
const
|
338
|
-
const c =
|
336
|
+
function q(e, t, n, o, i = window) {
|
337
|
+
const s = n.map((a, r) => {
|
338
|
+
const c = K(o, a, r), u = $(e, t, a), { path: _ } = a;
|
339
339
|
return {
|
340
340
|
path: _,
|
341
341
|
alias: _,
|
342
342
|
meta: c,
|
343
|
-
component:
|
343
|
+
component: {
|
344
|
+
render() {
|
345
|
+
return e.h(e.Suspense, [e.h(u)]);
|
346
|
+
}
|
347
|
+
}
|
344
348
|
};
|
345
349
|
});
|
346
|
-
|
350
|
+
i.__uniRoutes = s, i.__uniLayout = {};
|
347
351
|
}
|
348
|
-
function
|
349
|
-
|
352
|
+
function Y(e, t, n = window) {
|
353
|
+
S(n, String(e), t);
|
350
354
|
}
|
351
|
-
function
|
355
|
+
function z(e, t) {
|
352
356
|
if (!t) return;
|
353
357
|
[
|
354
358
|
"View",
|
@@ -385,80 +389,84 @@ function q(e, t) {
|
|
385
389
|
"PickerViewColumn",
|
386
390
|
"ResizeSensor",
|
387
391
|
"SwiperItem"
|
388
|
-
].forEach((
|
389
|
-
const
|
390
|
-
e.component(
|
392
|
+
].forEach((o) => {
|
393
|
+
const i = t[o];
|
394
|
+
e.component(o, i);
|
391
395
|
});
|
392
396
|
}
|
393
|
-
function
|
394
|
-
const t =
|
397
|
+
function oe(e) {
|
398
|
+
const t = x(e), {
|
395
399
|
Vue: n,
|
396
|
-
App:
|
397
|
-
UniH5:
|
398
|
-
routes:
|
400
|
+
App: o,
|
401
|
+
UniH5: i,
|
402
|
+
routes: s = [],
|
399
403
|
pagesJson: a = {},
|
400
|
-
manifestJson:
|
404
|
+
manifestJson: r = {},
|
401
405
|
window: c,
|
402
406
|
css: u = ""
|
403
407
|
} = t;
|
404
|
-
if (!
|
405
|
-
return n.createApp(
|
406
|
-
const { plugin: _, setupApp:
|
407
|
-
|
408
|
-
const
|
409
|
-
return
|
408
|
+
if (!i)
|
409
|
+
return n.createApp(o);
|
410
|
+
const { plugin: _, setupApp: p } = i;
|
411
|
+
G(t, c), H(t, c), j(i, c), q(n, i, s, a, c), Y(r.appid || Date.now(), u, c);
|
412
|
+
const d = n.createApp(p(o));
|
413
|
+
return d.use(z, i), d.use(_), d;
|
410
414
|
}
|
411
|
-
function
|
415
|
+
function ie(e, t) {
|
412
416
|
const n = {};
|
413
|
-
return Object.entries(e).forEach(([
|
414
|
-
|
417
|
+
return Object.entries(e).forEach(([o, i]) => {
|
418
|
+
h.includes(o) && i && (n[o] = t(i));
|
415
419
|
}), n;
|
416
420
|
}
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
421
|
+
function m(e, t) {
|
422
|
+
return async () => {
|
423
|
+
const n = await e.getDsl(t);
|
424
|
+
if (n) {
|
425
|
+
const { renderer: o } = e.createDslRenderer(n);
|
426
|
+
return o;
|
427
|
+
}
|
428
|
+
return null;
|
429
|
+
};
|
430
|
+
}
|
431
|
+
async function ae(e, t = !1, n = f) {
|
432
|
+
const o = e.project?.pages || [], i = [];
|
433
|
+
for (const a of o) {
|
434
|
+
const r = e.project?.homepage === a.id;
|
435
|
+
i.push({
|
424
436
|
id: a.id,
|
425
437
|
path: `${n}/${a.id}`,
|
426
|
-
|
438
|
+
loader: m(e, a.id),
|
427
439
|
style: {
|
428
440
|
navigationBarTitleText: a.title,
|
429
441
|
...a.style
|
430
442
|
},
|
431
443
|
needLogin: a.needLogin,
|
432
|
-
home:
|
444
|
+
home: r
|
433
445
|
});
|
434
446
|
}
|
435
|
-
const
|
436
|
-
if (
|
447
|
+
const s = i.find((a) => !!a.home) || i[0];
|
448
|
+
if (s) {
|
437
449
|
const a = n === f ? "/" : n;
|
438
|
-
|
439
|
-
...
|
450
|
+
i.unshift({
|
451
|
+
...s,
|
440
452
|
path: a
|
441
453
|
});
|
442
454
|
}
|
443
455
|
if (t) {
|
444
456
|
const a = e.project?.blocks || [];
|
445
|
-
for (const
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
id: s.id,
|
451
|
-
path: `${n}/${s.id}`,
|
452
|
-
component: u,
|
457
|
+
for (const r of a)
|
458
|
+
i.push({
|
459
|
+
id: r.id,
|
460
|
+
path: `${n}/${r.id}`,
|
461
|
+
loader: m(e, r.id),
|
453
462
|
style: {
|
454
463
|
navigationStyle: "custom"
|
455
464
|
}
|
456
465
|
});
|
457
|
-
}
|
458
466
|
}
|
459
|
-
return
|
467
|
+
return i;
|
460
468
|
}
|
461
|
-
function
|
469
|
+
function se() {
|
462
470
|
if (window.uni?.showLoading)
|
463
471
|
return window.uni.showLoading({
|
464
472
|
title: "加载中...",
|
@@ -469,39 +477,40 @@ function ie() {
|
|
469
477
|
}
|
470
478
|
};
|
471
479
|
}
|
472
|
-
function
|
480
|
+
function X(e, t = "", n = "warning") {
|
473
481
|
window.uni?.showModal && window.uni.showModal({
|
474
482
|
title: t,
|
475
483
|
content: e,
|
476
484
|
showCancel: !1
|
477
485
|
});
|
478
486
|
}
|
479
|
-
function
|
480
|
-
|
487
|
+
function re(e) {
|
488
|
+
X(e);
|
481
489
|
}
|
482
490
|
export {
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
491
|
+
h as APP_LIFE_CYCLE,
|
492
|
+
b as MANIFEST_JSON,
|
493
|
+
O as PAGES_JSON,
|
494
|
+
ee as PAGE_LIFE_CYCLES_LIST,
|
487
495
|
f as ROUTE_PAGE_BASE_PATH,
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
q as
|
500
|
-
|
501
|
-
|
496
|
+
re as alert,
|
497
|
+
ie as createUniAppComponent,
|
498
|
+
m as createUniLoader,
|
499
|
+
ae as createUniRoutes,
|
500
|
+
te as getFileId,
|
501
|
+
L as getGobalStyle,
|
502
|
+
E as getNavigationBar,
|
503
|
+
Y as injectUniCSS,
|
504
|
+
H as injectUniConfig,
|
505
|
+
G as injectUniFeatures,
|
506
|
+
j as injectUniGlobal,
|
507
|
+
q as injectUniRoutes,
|
508
|
+
z as install,
|
509
|
+
se as loading,
|
510
|
+
x as mergeOptions,
|
502
511
|
g as navigationBarMaps,
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
512
|
+
X as notify,
|
513
|
+
oe as setupUniApp,
|
514
|
+
ne as toKebabCase,
|
515
|
+
Q as version
|
507
516
|
};
|
package/dist/index.umd.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
(function(c,
|
1
|
+
(function(c,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("@vtj/renderer")):typeof define=="function"&&define.amd?define(["exports","@vtj/renderer"],E):(c=typeof globalThis<"u"?globalThis:c||self,E(c.VtjUni={},c.renderer))})(this,function(c,E){"use strict";/**!
|
2
2
|
* Copyright (c) 2025, VTJ.PRO All rights reserved.
|
3
3
|
* @name @vtj/uni
|
4
4
|
* @author CHC chenhuachun1549@dingtalk.com
|
5
|
-
* @version 0.10.
|
5
|
+
* @version 0.10.9
|
6
6
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
7
|
-
*/const b="0.10.7",U=["onLaunch","onShow","onHide","onError","onPageNotFound","onUnhandledRejection","onThemeChange","onPageNotFound","onUniNViewMessage","onExit"],O=["onLoad","onShow","onReady","onHide","onUnload","onResize","onPullDownRefresh","onReachBottom","onTabItemTap","onShareAppMessage","onPageScroll","onNavigationBarButtonTap","onBackPress","onNavigationBarSearchInputChanged","onNavigationBarSearchInputConfirmed","onNavigationBarSearchInputClicked","onShareTimeline","onAddToFavorites","beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeUnmount","unmounted"],S="/pages",N={name:"VTJ",appid:"__UNI__1FC118B",description:"VTJ移动跨端项目",versionName:"1.0.0",versionCode:"100",transformPx:!1,"app-plus":{usingComponents:!0,nvueStyleCompiler:"uni-app",compilerVersion:3,splashscreen:{alwaysShowBeforeRender:!0,waiting:!0,autoclose:!0,delay:0},modules:{},distribute:{android:{permissions:['<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>','<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>','<uses-permission android:name="android.permission.VIBRATE"/>','<uses-permission android:name="android.permission.READ_LOGS"/>','<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>','<uses-feature android:name="android.hardware.camera.autofocus"/>','<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>','<uses-permission android:name="android.permission.CAMERA"/>','<uses-permission android:name="android.permission.GET_ACCOUNTS"/>','<uses-permission android:name="android.permission.READ_PHONE_STATE"/>','<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>','<uses-permission android:name="android.permission.WAKE_LOCK"/>','<uses-permission android:name="android.permission.FLASHLIGHT"/>','<uses-feature android:name="android.hardware.camera"/>','<uses-permission android:name="android.permission.WRITE_SETTINGS"/>']},ios:{},sdkConfigs:{},icons:{android:{hdpi:"src/static/logo.png",xhdpi:"src/static/logo.png",xxhdpi:"src/static/logo.png",xxxhdpi:"src/static/logo.png"}}}},quickapp:{},"mp-weixin":{appid:"",setting:{urlCheck:!1},usingComponents:!0},"mp-alipay":{usingComponents:!0},"mp-baidu":{usingComponents:!0},"mp-toutiao":{usingComponents:!0},uniStatistics:{enable:!1},vueVersion:"3"},I={pages:[],globalStyle:{navigationBarTextStyle:"black",navigationBarTitleText:"uni-app",navigationBarBackgroundColor:"#F8F8F8",backgroundColor:"#F8F8F8"},easycom:{autoscan:!0,custom:{"^uni-(.*)":"@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue"}}};function L(e){const[t,...n]=e;return[t.toLowerCase(),...n].join("").replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`)}function h(e){let{manifestJson:t={},pagesJson:n={},routes:o=[]}=e;const i=o.map(u=>{const{path:a,style:p,needLogin:_}=u;return{path:a,style:p,needLogin:_}});return{...e,manifestJson:Object.assign({},N,t),pagesJson:Object.assign({},I,n,{pages:i})}}const T={navigationBarBackgroundColor:"backgroundColor",navigationBarTextStyle:"titleColor",navigationBarTitleText:"titleText",navigationStyle:"style",titleImage:"titleImage",titlePenetrate:"titlePenetrate",transparentTitle:"transparentTitle"};function A(e){const t={},n={black:"#000000",white:"#ffffff"};for(const o in e)T[o]&&(t[T[o]]=o==="navigationBarTextStyle"?n[e[o]]||n.black:e[o]);return t}function w(e){const t={};for(const n in e)T[n]||(t[n]=e[n]);return t}function V(e){var o;const n=e.split("?")[0].match(/\#\/pages\/([\w\W]*)/i);return(o=n==null?void 0:n[1])!=null?o:""}function k(e){var n;const t=e.h5;return((n=t==null?void 0:t.router)==null?void 0:n.mode)||"hash"}function W(e){var t,n,o;return{topWindow:!!((t=e.topWindow)!=null&&t.path),leftWindow:!!((n=e.leftWindow)!=null&&n.path),rightWindow:!!((o=e.rightWindow)!=null&&o.path)}}function j(e){const{pagesJson:t={}}=e,{globalStyle:n,pages:o=[]}=t;return!!(n!=null&&n.enablePullDownRefresh||o.find(i=>{var u;return!!((u=i.style)!=null&&u.enablePullDownRefresh)}))}function G(e){const{pagesJson:t={}}=e,{globalStyle:n,pages:o=[]}=t;let i=!1;return(n==null?void 0:n.navigationStyle)==="custom"?(i=!0,o.find(u=>{var a;return((a=u.style)==null?void 0:a.navigationStyle)==="default"})&&(i=!1)):o.every(u=>{var a;return((a=u.style)==null?void 0:a.navigationStyle)==="custom"})&&(i=!0),i}function D(e){var p;const t=G(e),n={navigationBar:!1,navigationBarButtons:!1,navigationBarSearchInput:!1,navigationBarTransparent:!1},{pagesJson:o={}}=e,{globalStyle:i,pages:u=[]}=o;if(t)return n;n.navigationBar=!0;const a=(p=i==null?void 0:i.h5)==null?void 0:p.titleNView;return u.find(_=>{var s,r,d;return!!((d=(r=(s=_.style)==null?void 0:s.h5)==null?void 0:r.titleNView)!=null&&d.buttons.length)})&&(n.navigationBarButtons=!0),(a!=null&&a.searchInput||u.find(_=>{var s,r,d;return!!((d=(r=(s=_.style)==null?void 0:s.h5)==null?void 0:r.titleNView)!=null&&d.searchInput)}))&&(n.navigationBarSearchInput=!0),((a==null?void 0:a.type)==="transparent"||u.find(_=>{var s,r,d;return((d=(r=(s=_.style)==null?void 0:s.h5)==null?void 0:r.titleNView)==null?void 0:d.type)==="transparent"}))&&(n.navigationBarTransparent=!0),n}function R(e,t=window){var l,g,f,E;const{pagesJson:n={},manifestJson:o={}}=e,{topWindow:i,leftWindow:u,rightWindow:a}=W(n),{navigationBar:p,navigationBarButtons:_,navigationBarSearchInput:s,navigationBarTransparent:r}=D(e),d={__VUE_OPTIONS_API__:!0,__VUE_PROD_DEVTOOLS__:!1,__VUE_PROD_HYDRATION_MISMATCH_DETAILS__:!1,__UNI_FEATURE_WX__:!1,__UNI_FEATURE_WXS__:!1,__UNI_FEATURE_RPX__:!1,__UNI_FEATURE_PROMISE__:!1,__UNI_FEATURE_LONGPRESS__:!1,__UNI_FEATURE_I18N_EN__:!1,__UNI_FEATURE_I18N_ES__:!1,__UNI_FEATURE_I18N_FR__:!1,__UNI_FEATURE_I18N_ZH_HANS__:!0,__UNI_FEATURE_I18N_ZH_HANT__:!1,__UNI_FEATURE_UNI_CLOUD__:!1,__UNI_FEATURE_I18N_LOCALE__:!1,__UNI_FEATURE_NVUE__:!1,__UNI_FEATURE_ROUTER_MODE__:k(o),__UNI_FEATURE_PAGES__:!!((l=n.pages)!=null&&l.length),__UNI_FEATURE_TABBAR__:!!((f=(g=n.tabBar)==null?void 0:g.list)!=null&&f.length),__UNI_FEATURE_TABBAR_MIDBUTTON__:!!((E=n.tabBar)!=null&&E.midButton),__UNI_FEATURE_TOPWINDOW__:i,__UNI_FEATURE_LEFTWINDOW__:u,__UNI_FEATURE_RIGHTWINDOW__:a,__UNI_FEATURE_RESPONSIVE__:!1,__UNI_FEATURE_NAVIGATIONBAR__:p,__UNI_FEATURE_PULL_DOWN_REFRESH__:j(e),__UNI_FEATURE_NAVIGATIONBAR_BUTTONS__:_,__UNI_FEATURE_NAVIGATIONBAR_SEARCHINPUT__:s,__UNI_FEATURE_NAVIGATIONBAR_TRANSPARENT__:r};Object.entries(d).forEach(([z,X])=>{t[z]=X})}const M="4.45";function C(e,t=window){var d,l;const{pagesJson:n={},manifestJson:o={}}=e,{easycom:i={}}=n,{appid:u="",name:a="",versionCode:p="",versionName:_=""}=o,s=n.globalStyle,r=((d=o.h5)==null?void 0:d.router)||{};t.__uniConfig={easycom:i,globalStyle:{...w(s),navigationBar:A(s),isNVue:!1},compilerVersion:M,appId:u,appName:a,appVersion:_,appVersionCode:String(p),async:{loading:"AsyncLoading",error:"AsyncError",delay:200,timeout:6e4,suspensible:!0,...((l=o.h5)==null?void 0:l.async)||{}},debug:!1,networkTimeout:{request:6e4,connectSocket:6e4,uploadFile:6e4,downloadFile:6e4,...o.networkTimeout||{}},sdkConfigs:{},nvue:{"flex-direction":"column"},locale:"",fallbackLocale:"",locales:{},router:{mode:"hash",base:"/",assets:"assets",routerBase:r.base||"/",...r},darkmode:!1,themeConfig:{},tabBar:n.tabBar?{position:"bottom",color:"#7A7E83",selectedColor:"#3cc51f",borderStyle:"black",blurEffect:"none",fontSize:"10px",iconWidth:"24px",spacing:"3px",height:"50px",backgroundColor:"#ffffff",selectedIndex:0,shown:!0,...n.tabBar}:void 0}}function B(e,t=window){const{UniServiceJSBridge:n,UniViewJSBridge:o,getApp:i,uni:u,getCurrentPages:a,upx2px:p,setupPage:_}=e;t.UniServiceJSBridge=n,t.UniViewJSBridge=o,t.getApp=i,t.uni=u,t.wx=u,t.getCurrentPages=a,t.upx2px=p,t.__setupPage=s=>_(s)}function J(e,t,n){const{defineAsyncComponent:o,openBlock:i,createBlock:u,withCtx:a,createVNode:p}=e,{PageComponent:_,setupPage:s,getApp:r}=t;return{mpType:"page",setup(){var f;const d=r(),l=((f=d==null?void 0:d.$route)==null?void 0:f.query)||{},g=typeof n=="function"?o(n):n;return()=>(i(),u(_,null,{page:a(()=>[p(s(g),Object.assign({},l,{ref:"page"}),null,512)]),_:1}))}}}function H(e,t,n){var g;const{path:o,style:i={},meta:u={},home:a,id:p}=t,_=((g=e.tabBar)==null?void 0:g.list)||[],s=_.findIndex(f=>{var E;return f.pagePath===o||((E=f.pagePath)==null?void 0:E.endsWith(p))}),r=_[s],d=!!r,l=n===0;return{isTabBar:d,tabBarIndex:s,isQuit:a!=null?a:l,isEntry:a!=null?a:l,navigationBar:{type:"default",...A(i)},isNVue:!1,route:r?r.pagePath:o,...u}}function y(e,t,n,o,i=window){const u=n.map((a,p)=>{const _=H(o,a,p),s=J(e,t,a.component),{path:r}=a;return{path:r,alias:r,meta:_,component:s}});i.__uniRoutes=u,i.__uniLayout={}}function v(e,t,n=window){m.adoptedStyleSheets(n,String(e),t)}function F(e,t){if(!t)return;["View","ScrollView","Swiper","MovableArea","MovableView","CoverView","CoverImage","Icon","Text","RichText","Progress","Button","CheckboxGroup","Checkbox","Editor","Form","Input","Label","Picker","PickerView","RadioGroup","Radio","Slider","Switch","Textarea","Navigator","Image","Video","Map","Canvas","WebView","PickerViewColumn","ResizeSensor","SwiperItem"].forEach(o=>{const i=t[o];e.component(o,i)})}function x(e){const t=h(e),{Vue:n,App:o,UniH5:i,routes:u=[],pagesJson:a={},manifestJson:p={},window:_,css:s=""}=t;if(!i)return n.createApp(o);const{plugin:r,setupApp:d}=i;R(t,_),C(t,_),B(i,_),y(n,i,u,a,_),v(p.appid||Date.now(),s,_);const l=n.createApp(d(o));return l.use(F,i),l.use(r),l}function $(e,t){const n={};return Object.entries(e).forEach(([o,i])=>{U.includes(o)&&i&&(n[o]=t(i))}),n}async function q(e,t=!1,n=S){var a,p,_;const o=((a=e.project)==null?void 0:a.pages)||[],i=[];for(const s of o){const r=await e.getDsl(s.id);if(!r)continue;const{renderer:d}=e.createDslRenderer(r),l=((p=e.project)==null?void 0:p.homepage)===s.id;i.push({id:s.id,path:`${n}/${s.id}`,component:d,style:{navigationBarTitleText:s.title,...s.style},needLogin:s.needLogin,home:l})}const u=i.find(s=>!!s.home)||i[0];if(u){const s=n===S?"/":n;i.unshift({...u,path:s})}if(t){const s=((_=e.project)==null?void 0:_.blocks)||[];for(const r of s){const d=await e.getDsl(r.id);if(!d)continue;const{renderer:l}=e.createDslRenderer(d);i.push({id:r.id,path:`${n}/${r.id}`,component:l,style:{navigationStyle:"custom"}})}}return i}function K(){var e;if((e=window.uni)!=null&&e.showLoading)return window.uni.showLoading({title:"加载中...",mask:!0}),{close:()=>{var t;(t=window.uni)!=null&&t.hideLoading&&window.uni.hideLoading()}}}function P(e,t="",n="warning"){var o;(o=window.uni)!=null&&o.showModal&&window.uni.showModal({title:t,content:e,showCancel:!1})}function Y(e){P(e)}c.APP_LIFE_CYCLE=U,c.MANIFEST_JSON=N,c.PAGES_JSON=I,c.PAGE_LIFE_CYCLES_LIST=O,c.ROUTE_PAGE_BASE_PATH=S,c.alert=Y,c.createUniAppComponent=$,c.createUniRoutes=q,c.getFileId=V,c.getGobalStyle=w,c.getNavigationBar=A,c.injectUniCSS=v,c.injectUniConfig=C,c.injectUniFeatures=R,c.injectUniGlobal=B,c.injectUniRoutes=y,c.install=F,c.loading=K,c.mergeOptions=h,c.navigationBarMaps=T,c.notify=P,c.setupUniApp=x,c.toKebabCase=L,c.version=b,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
7
|
+
*/const O="0.10.9",N=["onLaunch","onShow","onHide","onError","onPageNotFound","onUnhandledRejection","onThemeChange","onPageNotFound","onUniNViewMessage","onExit"],L=["onLoad","onShow","onReady","onHide","onUnload","onResize","onPullDownRefresh","onReachBottom","onTabItemTap","onShareAppMessage","onPageScroll","onNavigationBarButtonTap","onBackPress","onNavigationBarSearchInputChanged","onNavigationBarSearchInputConfirmed","onNavigationBarSearchInputClicked","onShareTimeline","onAddToFavorites","beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeUnmount","unmounted"],S="/pages",I={name:"VTJ",appid:"__UNI__1FC118B",description:"VTJ移动跨端项目",versionName:"1.0.0",versionCode:"100",transformPx:!1,"app-plus":{usingComponents:!0,nvueStyleCompiler:"uni-app",compilerVersion:3,splashscreen:{alwaysShowBeforeRender:!0,waiting:!0,autoclose:!0,delay:0},modules:{},distribute:{android:{permissions:['<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>','<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>','<uses-permission android:name="android.permission.VIBRATE"/>','<uses-permission android:name="android.permission.READ_LOGS"/>','<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>','<uses-feature android:name="android.hardware.camera.autofocus"/>','<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>','<uses-permission android:name="android.permission.CAMERA"/>','<uses-permission android:name="android.permission.GET_ACCOUNTS"/>','<uses-permission android:name="android.permission.READ_PHONE_STATE"/>','<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>','<uses-permission android:name="android.permission.WAKE_LOCK"/>','<uses-permission android:name="android.permission.FLASHLIGHT"/>','<uses-feature android:name="android.hardware.camera"/>','<uses-permission android:name="android.permission.WRITE_SETTINGS"/>']},ios:{},sdkConfigs:{},icons:{android:{hdpi:"src/static/logo.png",xhdpi:"src/static/logo.png",xxhdpi:"src/static/logo.png",xxxhdpi:"src/static/logo.png"}}}},quickapp:{},"mp-weixin":{appid:"",setting:{urlCheck:!1},usingComponents:!0},"mp-alipay":{usingComponents:!0},"mp-baidu":{usingComponents:!0},"mp-toutiao":{usingComponents:!0},uniStatistics:{enable:!1},vueVersion:"3"},h={pages:[],globalStyle:{navigationBarTextStyle:"black",navigationBarTitleText:"uni-app",navigationBarBackgroundColor:"#F8F8F8",backgroundColor:"#F8F8F8"},easycom:{autoscan:!0,custom:{"^uni-(.*)":"@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue"}}};function k(n){const[t,...e]=n;return[t.toLowerCase(),...e].join("").replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`)}function w(n){let{manifestJson:t={},pagesJson:e={},routes:o=[]}=n;const i=o.map(u=>{const{path:a,style:d,needLogin:_}=u;return{path:a,style:d,needLogin:_}});return{...n,manifestJson:Object.assign({},I,t),pagesJson:Object.assign({},h,e,{pages:i})}}const T={navigationBarBackgroundColor:"backgroundColor",navigationBarTextStyle:"titleColor",navigationBarTitleText:"titleText",navigationStyle:"style",titleImage:"titleImage",titlePenetrate:"titlePenetrate",transparentTitle:"transparentTitle"};function A(n){const t={},e={black:"#000000",white:"#ffffff"};for(const o in n)T[o]&&(t[T[o]]=o==="navigationBarTextStyle"?e[n[o]]||e.black:n[o]);return t}function R(n){const t={};for(const e in n)T[e]||(t[e]=n[e]);return t}function V(n){var o;const e=n.split("?")[0].match(/\#\/pages\/([\w\W]*)/i);return(o=e==null?void 0:e[1])!=null?o:""}function W(n){var e;const t=n.h5;return((e=t==null?void 0:t.router)==null?void 0:e.mode)||"hash"}function j(n){var t,e,o;return{topWindow:!!((t=n.topWindow)!=null&&t.path),leftWindow:!!((e=n.leftWindow)!=null&&e.path),rightWindow:!!((o=n.rightWindow)!=null&&o.path)}}function G(n){const{pagesJson:t={}}=n,{globalStyle:e,pages:o=[]}=t;return!!(e!=null&&e.enablePullDownRefresh||o.find(i=>{var u;return!!((u=i.style)!=null&&u.enablePullDownRefresh)}))}function M(n){const{pagesJson:t={}}=n,{globalStyle:e,pages:o=[]}=t;let i=!1;return(e==null?void 0:e.navigationStyle)==="custom"?(i=!0,o.find(u=>{var a;return((a=u.style)==null?void 0:a.navigationStyle)==="default"})&&(i=!1)):o.every(u=>{var a;return((a=u.style)==null?void 0:a.navigationStyle)==="custom"})&&(i=!0),i}function D(n){var d;const t=M(n),e={navigationBar:!1,navigationBarButtons:!1,navigationBarSearchInput:!1,navigationBarTransparent:!1},{pagesJson:o={}}=n,{globalStyle:i,pages:u=[]}=o;if(t)return e;e.navigationBar=!0;const a=(d=i==null?void 0:i.h5)==null?void 0:d.titleNView;return u.find(_=>{var s,r,p;return!!((p=(r=(s=_.style)==null?void 0:s.h5)==null?void 0:r.titleNView)!=null&&p.buttons.length)})&&(e.navigationBarButtons=!0),(a!=null&&a.searchInput||u.find(_=>{var s,r,p;return!!((p=(r=(s=_.style)==null?void 0:s.h5)==null?void 0:r.titleNView)!=null&&p.searchInput)}))&&(e.navigationBarSearchInput=!0),((a==null?void 0:a.type)==="transparent"||u.find(_=>{var s,r,p;return((p=(r=(s=_.style)==null?void 0:s.h5)==null?void 0:r.titleNView)==null?void 0:p.type)==="transparent"}))&&(e.navigationBarTransparent=!0),e}function C(n,t=window){var l,g,m,f;const{pagesJson:e={},manifestJson:o={}}=n,{topWindow:i,leftWindow:u,rightWindow:a}=j(e),{navigationBar:d,navigationBarButtons:_,navigationBarSearchInput:s,navigationBarTransparent:r}=D(n),p={__VUE_OPTIONS_API__:!0,__VUE_PROD_DEVTOOLS__:!1,__VUE_PROD_HYDRATION_MISMATCH_DETAILS__:!1,__UNI_FEATURE_WX__:!1,__UNI_FEATURE_WXS__:!1,__UNI_FEATURE_RPX__:!1,__UNI_FEATURE_PROMISE__:!1,__UNI_FEATURE_LONGPRESS__:!1,__UNI_FEATURE_I18N_EN__:!1,__UNI_FEATURE_I18N_ES__:!1,__UNI_FEATURE_I18N_FR__:!1,__UNI_FEATURE_I18N_ZH_HANS__:!0,__UNI_FEATURE_I18N_ZH_HANT__:!1,__UNI_FEATURE_UNI_CLOUD__:!1,__UNI_FEATURE_I18N_LOCALE__:!1,__UNI_FEATURE_NVUE__:!1,__UNI_FEATURE_ROUTER_MODE__:W(o),__UNI_FEATURE_PAGES__:!!((l=e.pages)!=null&&l.length),__UNI_FEATURE_TABBAR__:!!((m=(g=e.tabBar)==null?void 0:g.list)!=null&&m.length),__UNI_FEATURE_TABBAR_MIDBUTTON__:!!((f=e.tabBar)!=null&&f.midButton),__UNI_FEATURE_TOPWINDOW__:i,__UNI_FEATURE_LEFTWINDOW__:u,__UNI_FEATURE_RIGHTWINDOW__:a,__UNI_FEATURE_RESPONSIVE__:!1,__UNI_FEATURE_NAVIGATIONBAR__:d,__UNI_FEATURE_PULL_DOWN_REFRESH__:G(n),__UNI_FEATURE_NAVIGATIONBAR_BUTTONS__:_,__UNI_FEATURE_NAVIGATIONBAR_SEARCHINPUT__:s,__UNI_FEATURE_NAVIGATIONBAR_TRANSPARENT__:r};Object.entries(p).forEach(([X,Z])=>{t[X]=Z})}const J="4.45";function B(n,t=window){var p,l;const{pagesJson:e={},manifestJson:o={}}=n,{easycom:i={}}=e,{appid:u="",name:a="",versionCode:d="",versionName:_=""}=o,s=e.globalStyle,r=((p=o.h5)==null?void 0:p.router)||{};t.__uniConfig={easycom:i,globalStyle:{...R(s),navigationBar:A(s),isNVue:!1},compilerVersion:J,appId:u,appName:a,appVersion:_,appVersionCode:String(d),async:{loading:"AsyncLoading",error:"AsyncError",delay:200,timeout:6e4,suspensible:!0,...((l=o.h5)==null?void 0:l.async)||{}},debug:!1,networkTimeout:{request:6e4,connectSocket:6e4,uploadFile:6e4,downloadFile:6e4,...o.networkTimeout||{}},sdkConfigs:{},nvue:{"flex-direction":"column"},locale:"",fallbackLocale:"",locales:{},router:{mode:"hash",base:"/",assets:"assets",routerBase:r.base||"/",...r},darkmode:!1,themeConfig:{},tabBar:e.tabBar?{position:"bottom",color:"#7A7E83",selectedColor:"#3cc51f",borderStyle:"black",blurEffect:"none",fontSize:"10px",iconWidth:"24px",spacing:"3px",height:"50px",backgroundColor:"#ffffff",selectedIndex:0,shown:!0,...e.tabBar}:void 0}}function v(n,t=window){const{UniServiceJSBridge:e,UniViewJSBridge:o,getApp:i,uni:u,getCurrentPages:a,upx2px:d,setupPage:_}=n;t.UniServiceJSBridge=e,t.UniViewJSBridge=o,t.getApp=i,t.uni=u,t.wx=u,t.getCurrentPages=a,t.upx2px=d,t.__setupPage=s=>_(s)}function H(n,t,e){const{openBlock:o,createBlock:i,withCtx:u,createVNode:a}=n,{PageComponent:d,setupPage:_,getApp:s}=t;return{mpType:"page",async setup(){var f;const r=s(),p=((f=r==null?void 0:r.$route)==null?void 0:f.query)||{},{loader:l,component:g}=e,m=l?await l(e):g||{};return()=>(o(),i(d,null,{page:u(()=>[a(_(m),Object.assign({},p,{ref:"page"}),null,512)]),_:1}))}}}function x(n,t,e){var g;const{path:o,style:i={},meta:u={},home:a,id:d}=t,_=((g=n.tabBar)==null?void 0:g.list)||[],s=_.findIndex(m=>{var f;return m.pagePath===o||((f=m.pagePath)==null?void 0:f.endsWith(d))}),r=_[s],p=!!r,l=e===0;return{isTabBar:p,tabBarIndex:s,isQuit:a!=null?a:l,isEntry:a!=null?a:l,navigationBar:{type:"default",...A(i)},isNVue:!1,route:r?r.pagePath:o,...u}}function y(n,t,e,o,i=window){const u=e.map((a,d)=>{const _=x(o,a,d),s=H(n,t,a),{path:r}=a;return{path:r,alias:r,meta:_,component:{render(){return n.h(n.Suspense,[n.h(s)])}}}});i.__uniRoutes=u,i.__uniLayout={}}function F(n,t,e=window){E.adoptedStyleSheets(e,String(n),t)}function P(n,t){if(!t)return;["View","ScrollView","Swiper","MovableArea","MovableView","CoverView","CoverImage","Icon","Text","RichText","Progress","Button","CheckboxGroup","Checkbox","Editor","Form","Input","Label","Picker","PickerView","RadioGroup","Radio","Slider","Switch","Textarea","Navigator","Image","Video","Map","Canvas","WebView","PickerViewColumn","ResizeSensor","SwiperItem"].forEach(o=>{const i=t[o];n.component(o,i)})}function $(n){const t=w(n),{Vue:e,App:o,UniH5:i,routes:u=[],pagesJson:a={},manifestJson:d={},window:_,css:s=""}=t;if(!i)return e.createApp(o);const{plugin:r,setupApp:p}=i;C(t,_),B(t,_),v(i,_),y(e,i,u,a,_),F(d.appid||Date.now(),s,_);const l=e.createApp(p(o));return l.use(P,i),l.use(r),l}function q(n,t){const e={};return Object.entries(n).forEach(([o,i])=>{N.includes(o)&&i&&(e[o]=t(i))}),e}function U(n,t){return async()=>{const e=await n.getDsl(t);if(e){const{renderer:o}=n.createDslRenderer(e);return o}return null}}async function K(n,t=!1,e=S){var a,d,_;const o=((a=n.project)==null?void 0:a.pages)||[],i=[];for(const s of o){const r=((d=n.project)==null?void 0:d.homepage)===s.id;i.push({id:s.id,path:`${e}/${s.id}`,loader:U(n,s.id),style:{navigationBarTitleText:s.title,...s.style},needLogin:s.needLogin,home:r})}const u=i.find(s=>!!s.home)||i[0];if(u){const s=e===S?"/":e;i.unshift({...u,path:s})}if(t){const s=((_=n.project)==null?void 0:_.blocks)||[];for(const r of s)i.push({id:r.id,path:`${e}/${r.id}`,loader:U(n,r.id),style:{navigationStyle:"custom"}})}return i}function Y(){var n;if((n=window.uni)!=null&&n.showLoading)return window.uni.showLoading({title:"加载中...",mask:!0}),{close:()=>{var t;(t=window.uni)!=null&&t.hideLoading&&window.uni.hideLoading()}}}function b(n,t="",e="warning"){var o;(o=window.uni)!=null&&o.showModal&&window.uni.showModal({title:t,content:n,showCancel:!1})}function z(n){b(n)}c.APP_LIFE_CYCLE=N,c.MANIFEST_JSON=I,c.PAGES_JSON=h,c.PAGE_LIFE_CYCLES_LIST=L,c.ROUTE_PAGE_BASE_PATH=S,c.alert=z,c.createUniAppComponent=q,c.createUniLoader=U,c.createUniRoutes=K,c.getFileId=V,c.getGobalStyle=R,c.getNavigationBar=A,c.injectUniCSS=F,c.injectUniConfig=B,c.injectUniFeatures=C,c.injectUniGlobal=v,c.injectUniRoutes=y,c.install=P,c.loading=Y,c.mergeOptions=w,c.navigationBarMaps=T,c.notify=b,c.setupUniApp=$,c.toKebabCase=k,c.version=O,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vtj/uni",
|
3
3
|
"private": false,
|
4
|
-
"version": "0.10.
|
4
|
+
"version": "0.10.9",
|
5
5
|
"type": "module",
|
6
6
|
"sideEffects": false,
|
7
7
|
"dependencies": {
|
8
|
-
"@vtj/core": "~0.10.
|
9
|
-
"@vtj/icons": "~0.10.
|
10
|
-
"@vtj/renderer": "~0.10.
|
11
|
-
"@vtj/utils": "~0.10.
|
8
|
+
"@vtj/core": "~0.10.9",
|
9
|
+
"@vtj/icons": "~0.10.9",
|
10
|
+
"@vtj/renderer": "~0.10.9",
|
11
|
+
"@vtj/utils": "~0.10.9"
|
12
12
|
},
|
13
13
|
"devDependencies": {
|
14
14
|
"@dcloudio/uni-app": "3.0.0-4040520250104002",
|
package/types/setup/app.d.ts
CHANGED
@@ -3,4 +3,5 @@ import { Provider } from '@vtj/renderer';
|
|
3
3
|
import { SetupUniAppOptions, UniRoute } from '../types';
|
4
4
|
export declare function setupUniApp(options: SetupUniAppOptions): any;
|
5
5
|
export declare function createUniAppComponent(uniConfig: UniConfig, parser: (script: JSFunction) => Function): Record<string, Function>;
|
6
|
+
export declare function createUniLoader(provider: Provider, id: string): () => Promise<any>;
|
6
7
|
export declare function createUniRoutes(provider: Provider, includeBlock?: boolean, basePath?: string): Promise<UniRoute[]>;
|
package/types/types.d.ts
CHANGED
@@ -2,7 +2,8 @@ import { DefineComponent } from 'vue';
|
|
2
2
|
export interface UniRoute {
|
3
3
|
id: string;
|
4
4
|
path: string;
|
5
|
-
|
5
|
+
loader?: (route?: Partial<UniRoute>) => Promise<DefineComponent>;
|
6
|
+
component?: DefineComponent;
|
6
7
|
style?: PageStyle;
|
7
8
|
needLogin?: boolean;
|
8
9
|
meta?: Record<string, any>;
|
package/types/version.d.ts
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
* Copyright (c) 2025, VTJ.PRO All rights reserved.
|
3
3
|
* @name @vtj/uni
|
4
4
|
* @author CHC chenhuachun1549@dingtalk.com
|
5
|
-
* @version 0.10.
|
5
|
+
* @version 0.10.8
|
6
6
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
7
7
|
*/
|
8
|
-
export declare const version = "0.10.
|
8
|
+
export declare const version = "0.10.8";
|