@vtj/uni 0.10.1-alpha.0 → 0.10.1-alpha.2
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 +169 -163
- package/dist/index.umd.js +3 -3
- package/package.json +5 -5
- package/types/constants.d.ts +1 -0
- package/types/defaults/pages.json.d.ts +6 -0
- package/types/setup/app.d.ts +1 -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 E } 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.1-alpha.
|
6
|
+
* @version 0.10.1-alpha.2
|
7
7
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
8
8
|
*/
|
9
|
-
const
|
9
|
+
const X = "0.10.1-alpha.2", T = [
|
10
10
|
"onLaunch",
|
11
11
|
"onShow",
|
12
12
|
"onHide",
|
@@ -17,7 +17,7 @@ const Y = "0.10.1-alpha.0", E = [
|
|
17
17
|
"onPageNotFound",
|
18
18
|
"onUniNViewMessage",
|
19
19
|
"onExit"
|
20
|
-
],
|
20
|
+
], Z = [
|
21
21
|
"onLoad",
|
22
22
|
"onShow",
|
23
23
|
"onReady",
|
@@ -44,43 +44,44 @@ const Y = "0.10.1-alpha.0", E = [
|
|
44
44
|
"updated",
|
45
45
|
"beforeUnmount",
|
46
46
|
"unmounted"
|
47
|
-
],
|
48
|
-
name:
|
47
|
+
], f = "/pages", S = "VTJ", N = "__UNI__1FC118B", A = "VTJ移动跨端项目", I = "1.0.0", h = "100", U = !1, w = {}, R = { enable: !1 }, B = "3", C = {
|
48
|
+
name: S,
|
49
49
|
appid: N,
|
50
|
-
description:
|
51
|
-
versionName:
|
50
|
+
description: A,
|
51
|
+
versionName: I,
|
52
52
|
versionCode: h,
|
53
|
-
transformPx:
|
53
|
+
transformPx: U,
|
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: w,
|
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:
|
60
|
+
uniStatistics: R,
|
61
|
+
vueVersion: B
|
62
|
+
}, y = [], b = { navigationBarTextStyle: "black", navigationBarTitleText: "uni-app", navigationBarBackgroundColor: "#F8F8F8", backgroundColor: "#F8F8F8" }, v = { autoscan: !0, custom: { "^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue" } }, F = {
|
63
|
+
pages: y,
|
64
|
+
globalStyle: b,
|
65
|
+
easycom: v
|
65
66
|
};
|
66
|
-
function
|
67
|
+
function Q(e) {
|
67
68
|
const [t, ...n] = e;
|
68
|
-
return [t.toLowerCase(), ...n].join("").replace(/[A-Z]/g, (
|
69
|
+
return [t.toLowerCase(), ...n].join("").replace(/[A-Z]/g, (i) => `-${i.toLowerCase()}`);
|
69
70
|
}
|
70
|
-
function
|
71
|
-
let { manifestJson: t = {}, pagesJson: n = {}, routes:
|
72
|
-
const
|
73
|
-
const { path:
|
71
|
+
function O(e) {
|
72
|
+
let { manifestJson: t = {}, pagesJson: n = {}, routes: o = [] } = e;
|
73
|
+
const i = o.map((s) => {
|
74
|
+
const { path: c, style: a, needLogin: r } = s;
|
74
75
|
return {
|
75
|
-
path:
|
76
|
-
style:
|
77
|
-
needLogin:
|
76
|
+
path: c,
|
77
|
+
style: a,
|
78
|
+
needLogin: r
|
78
79
|
};
|
79
80
|
});
|
80
81
|
return {
|
81
82
|
...e,
|
82
|
-
manifestJson: Object.assign({},
|
83
|
-
pagesJson: Object.assign({},
|
83
|
+
manifestJson: Object.assign({}, C, t),
|
84
|
+
pagesJson: Object.assign({}, F, n, { pages: i })
|
84
85
|
};
|
85
86
|
}
|
86
87
|
const g = {
|
@@ -92,63 +93,63 @@ const g = {
|
|
92
93
|
titlePenetrate: "titlePenetrate",
|
93
94
|
transparentTitle: "transparentTitle"
|
94
95
|
};
|
95
|
-
function
|
96
|
+
function m(e) {
|
96
97
|
const t = {}, n = {
|
97
98
|
black: "#000000",
|
98
99
|
white: "#ffffff"
|
99
100
|
};
|
100
|
-
for (const
|
101
|
-
g[
|
101
|
+
for (const o in e)
|
102
|
+
g[o] && (t[g[o]] = o === "navigationBarTextStyle" ? n[e[o]] || n.black : e[o]);
|
102
103
|
return t;
|
103
104
|
}
|
104
|
-
function
|
105
|
+
function P(e) {
|
105
106
|
const t = {};
|
106
107
|
for (const n in e)
|
107
108
|
g[n] || (t[n] = e[n]);
|
108
109
|
return t;
|
109
110
|
}
|
110
|
-
function
|
111
|
+
function ee(e) {
|
111
112
|
return e.split("?")[0].match(/\#\/pages\/([\w\W]*)/i)?.[1] ?? "";
|
112
113
|
}
|
113
|
-
function
|
114
|
+
function V(e) {
|
114
115
|
return e.h5?.router?.mode || "hash";
|
115
116
|
}
|
116
|
-
function
|
117
|
+
function x(e) {
|
117
118
|
return {
|
118
119
|
topWindow: !!e.topWindow?.path,
|
119
120
|
leftWindow: !!e.leftWindow?.path,
|
120
121
|
rightWindow: !!e.rightWindow?.path
|
121
122
|
};
|
122
123
|
}
|
123
|
-
function
|
124
|
-
const { pagesJson: t = {} } = e, { globalStyle: n, pages:
|
125
|
-
return !!(n?.enablePullDownRefresh ||
|
124
|
+
function L(e) {
|
125
|
+
const { pagesJson: t = {} } = e, { globalStyle: n, pages: o = [] } = t;
|
126
|
+
return !!(n?.enablePullDownRefresh || o.find((i) => !!i.style?.enablePullDownRefresh));
|
126
127
|
}
|
127
|
-
function
|
128
|
-
const { pagesJson: t = {} } = e, { globalStyle: n, pages:
|
129
|
-
let
|
130
|
-
return n?.navigationStyle === "custom" ? (
|
128
|
+
function k(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;
|
131
132
|
}
|
132
|
-
function
|
133
|
-
const t =
|
133
|
+
function W(e) {
|
134
|
+
const t = k(e), n = {
|
134
135
|
navigationBar: !1,
|
135
136
|
navigationBarButtons: !1,
|
136
137
|
navigationBarSearchInput: !1,
|
137
138
|
navigationBarTransparent: !1
|
138
|
-
}, { pagesJson:
|
139
|
+
}, { pagesJson: o = {} } = e, { globalStyle: i, pages: s = [] } = o;
|
139
140
|
if (t)
|
140
141
|
return n;
|
141
142
|
n.navigationBar = !0;
|
142
|
-
const
|
143
|
-
return s.find((
|
143
|
+
const c = i?.h5?.titleNView;
|
144
|
+
return s.find((a) => !!a.style?.h5?.titleNView?.buttons.length) && (n.navigationBarButtons = !0), (c?.searchInput || s.find((a) => !!a.style?.h5?.titleNView?.searchInput)) && (n.navigationBarSearchInput = !0), (c?.type === "transparent" || s.find((a) => a.style?.h5?.titleNView?.type === "transparent")) && (n.navigationBarTransparent = !0), n;
|
144
145
|
}
|
145
|
-
function
|
146
|
-
const { pagesJson: n = {}, manifestJson:
|
147
|
-
navigationBar:
|
148
|
-
navigationBarButtons:
|
146
|
+
function M(e, t = window) {
|
147
|
+
const { pagesJson: n = {}, manifestJson: o = {} } = e, { topWindow: i, leftWindow: s, rightWindow: c } = x(n), {
|
148
|
+
navigationBar: a,
|
149
|
+
navigationBarButtons: r,
|
149
150
|
navigationBarSearchInput: _,
|
150
151
|
navigationBarTransparent: u
|
151
|
-
} =
|
152
|
+
} = W(e), d = {
|
152
153
|
// vue
|
153
154
|
__VUE_OPTIONS_API__: !0,
|
154
155
|
// enable/disable Options API support, default: true
|
@@ -183,7 +184,7 @@ function k(e, t = window) {
|
|
183
184
|
// 是否启用i18n
|
184
185
|
__UNI_FEATURE_NVUE__: !1,
|
185
186
|
// 是否启用nvue
|
186
|
-
__UNI_FEATURE_ROUTER_MODE__:
|
187
|
+
__UNI_FEATURE_ROUTER_MODE__: V(o),
|
187
188
|
// 路由模式
|
188
189
|
__UNI_FEATURE_PAGES__: !!n.pages?.length,
|
189
190
|
// 是否多页面
|
@@ -191,19 +192,19 @@ function k(e, t = window) {
|
|
191
192
|
// 是否包含tabBar
|
192
193
|
__UNI_FEATURE_TABBAR_MIDBUTTON__: !!n.tabBar?.midButton,
|
193
194
|
// 是否包含midButton
|
194
|
-
__UNI_FEATURE_TOPWINDOW__:
|
195
|
+
__UNI_FEATURE_TOPWINDOW__: i,
|
195
196
|
// 是否包含topWindow
|
196
197
|
__UNI_FEATURE_LEFTWINDOW__: s,
|
197
198
|
// 是否包含leftWindow
|
198
|
-
__UNI_FEATURE_RIGHTWINDOW__:
|
199
|
+
__UNI_FEATURE_RIGHTWINDOW__: c,
|
199
200
|
// 是否包含rightWindow
|
200
201
|
__UNI_FEATURE_RESPONSIVE__: !1,
|
201
202
|
// 是否启用响应式
|
202
|
-
__UNI_FEATURE_NAVIGATIONBAR__:
|
203
|
+
__UNI_FEATURE_NAVIGATIONBAR__: a,
|
203
204
|
// 是否启用标题栏
|
204
|
-
__UNI_FEATURE_PULL_DOWN_REFRESH__:
|
205
|
+
__UNI_FEATURE_PULL_DOWN_REFRESH__: L(e),
|
205
206
|
// 是否启用下拉刷新
|
206
|
-
__UNI_FEATURE_NAVIGATIONBAR_BUTTONS__:
|
207
|
+
__UNI_FEATURE_NAVIGATIONBAR_BUTTONS__: r,
|
207
208
|
// 是否启用标题栏按钮
|
208
209
|
__UNI_FEATURE_NAVIGATIONBAR_SEARCHINPUT__: _,
|
209
210
|
// 是否启用标题栏搜索框
|
@@ -214,33 +215,33 @@ function k(e, t = window) {
|
|
214
215
|
t[p] = l;
|
215
216
|
});
|
216
217
|
}
|
217
|
-
const
|
218
|
-
function
|
219
|
-
const { pagesJson: n = {}, manifestJson:
|
218
|
+
const D = "4.45";
|
219
|
+
function G(e, t = window) {
|
220
|
+
const { pagesJson: n = {}, manifestJson: o = {} } = e, { easycom: i = {} } = n, {
|
220
221
|
appid: s = "",
|
221
|
-
name:
|
222
|
-
versionCode:
|
223
|
-
versionName:
|
224
|
-
} =
|
222
|
+
name: c = "",
|
223
|
+
versionCode: a = "",
|
224
|
+
versionName: r = ""
|
225
|
+
} = o, _ = n.globalStyle, u = o.h5?.router || {};
|
225
226
|
t.__uniConfig = {
|
226
|
-
easycom:
|
227
|
+
easycom: i,
|
227
228
|
globalStyle: {
|
228
|
-
...
|
229
|
-
navigationBar:
|
229
|
+
...P(_),
|
230
|
+
navigationBar: m(_),
|
230
231
|
isNVue: !1
|
231
232
|
},
|
232
|
-
compilerVersion:
|
233
|
+
compilerVersion: D,
|
233
234
|
appId: s,
|
234
|
-
appName:
|
235
|
-
appVersion:
|
236
|
-
appVersionCode: String(
|
235
|
+
appName: c,
|
236
|
+
appVersion: r,
|
237
|
+
appVersionCode: String(a),
|
237
238
|
async: {
|
238
239
|
loading: "AsyncLoading",
|
239
240
|
error: "AsyncError",
|
240
241
|
delay: 200,
|
241
242
|
timeout: 6e4,
|
242
243
|
suspensible: !0,
|
243
|
-
...
|
244
|
+
...o.h5?.async || {}
|
244
245
|
},
|
245
246
|
debug: !1,
|
246
247
|
networkTimeout: {
|
@@ -248,7 +249,7 @@ function M(e, t = window) {
|
|
248
249
|
connectSocket: 6e4,
|
249
250
|
uploadFile: 6e4,
|
250
251
|
downloadFile: 6e4,
|
251
|
-
...
|
252
|
+
...o.networkTimeout || {}
|
252
253
|
},
|
253
254
|
sdkConfigs: {},
|
254
255
|
nvue: {
|
@@ -284,27 +285,27 @@ function M(e, t = window) {
|
|
284
285
|
// tabBar: pagesJson.tabBar
|
285
286
|
};
|
286
287
|
}
|
287
|
-
function
|
288
|
+
function J(e, t = window) {
|
288
289
|
const {
|
289
290
|
UniServiceJSBridge: n,
|
290
|
-
UniViewJSBridge:
|
291
|
-
getApp:
|
291
|
+
UniViewJSBridge: o,
|
292
|
+
getApp: i,
|
292
293
|
uni: s,
|
293
|
-
getCurrentPages:
|
294
|
-
upx2px:
|
295
|
-
setupPage:
|
294
|
+
getCurrentPages: c,
|
295
|
+
upx2px: a,
|
296
|
+
setupPage: r
|
296
297
|
} = e;
|
297
|
-
t.UniServiceJSBridge = n, t.UniViewJSBridge =
|
298
|
+
t.UniServiceJSBridge = n, t.UniViewJSBridge = o, t.getApp = i, t.uni = s, t.wx = s, t.getCurrentPages = c, t.upx2px = a, t.__setupPage = (_) => r(_);
|
298
299
|
}
|
299
|
-
function
|
300
|
-
const { defineAsyncComponent:
|
300
|
+
function H(e, t, n) {
|
301
|
+
const { defineAsyncComponent: o, openBlock: i, createBlock: s, withCtx: c, createVNode: a } = e, { PageComponent: r, setupPage: _, getApp: u } = t;
|
301
302
|
return {
|
302
303
|
mpType: "page",
|
303
304
|
setup() {
|
304
|
-
const p = u()?.$route?.query || {}, l = typeof n == "function" ?
|
305
|
-
return () => (
|
306
|
-
page:
|
307
|
-
|
305
|
+
const p = u()?.$route?.query || {}, l = typeof n == "function" ? o(n) : n;
|
306
|
+
return () => (i(), s(r, null, {
|
307
|
+
page: c(() => [
|
308
|
+
a(
|
308
309
|
_(l),
|
309
310
|
Object.assign({}, p, { ref: "page" }),
|
310
311
|
null,
|
@@ -316,38 +317,38 @@ function G(e, t, n) {
|
|
316
317
|
}
|
317
318
|
};
|
318
319
|
}
|
319
|
-
function
|
320
|
-
const { path:
|
320
|
+
function j(e, t, n) {
|
321
|
+
const { path: o, style: i = {}, meta: s = {}, home: c } = t, r = (e.tabBar?.list || []).findIndex((d) => d.pagePath === o), _ = r > -1, u = n === 0;
|
321
322
|
return {
|
322
323
|
isTabBar: _,
|
323
|
-
tabBarIndex:
|
324
|
-
isQuit:
|
325
|
-
isEntry:
|
324
|
+
tabBarIndex: r,
|
325
|
+
isQuit: c ?? u,
|
326
|
+
isEntry: c ?? u,
|
326
327
|
navigationBar: {
|
327
328
|
type: "default",
|
328
|
-
...
|
329
|
+
...m(i)
|
329
330
|
},
|
330
331
|
isNVue: !1,
|
331
|
-
route:
|
332
|
+
route: o,
|
332
333
|
...s
|
333
334
|
};
|
334
335
|
}
|
335
|
-
function
|
336
|
-
const s = n.map((
|
337
|
-
const
|
336
|
+
function $(e, t, n, o, i = window) {
|
337
|
+
const s = n.map((c, a) => {
|
338
|
+
const r = j(o, c, a), _ = H(e, t, c.component), { path: u } = c;
|
338
339
|
return {
|
339
340
|
path: u,
|
340
341
|
alias: u,
|
341
|
-
meta:
|
342
|
+
meta: r,
|
342
343
|
component: _
|
343
344
|
};
|
344
345
|
});
|
345
|
-
|
346
|
+
i.__uniRoutes = s, i.__uniLayout = {};
|
346
347
|
}
|
347
|
-
function
|
348
|
-
|
348
|
+
function K(e, t, n = window) {
|
349
|
+
E(n, String(e), t);
|
349
350
|
}
|
350
|
-
function
|
351
|
+
function q(e, t) {
|
351
352
|
if (!t) return;
|
352
353
|
[
|
353
354
|
"View",
|
@@ -384,73 +385,77 @@ function K(e, t) {
|
|
384
385
|
"PickerViewColumn",
|
385
386
|
"ResizeSensor",
|
386
387
|
"SwiperItem"
|
387
|
-
].forEach((
|
388
|
-
const
|
389
|
-
e.component(
|
388
|
+
].forEach((o) => {
|
389
|
+
const i = t[o];
|
390
|
+
e.component(o, i);
|
390
391
|
});
|
391
392
|
}
|
392
|
-
function
|
393
|
-
const t =
|
393
|
+
function ne(e) {
|
394
|
+
const t = O(e), {
|
394
395
|
Vue: n,
|
395
|
-
App:
|
396
|
-
UniH5:
|
396
|
+
App: o,
|
397
|
+
UniH5: i,
|
397
398
|
routes: s = [],
|
398
|
-
pagesJson:
|
399
|
-
manifestJson:
|
400
|
-
window:
|
401
|
-
css: _
|
402
|
-
} = t, { plugin: u, setupApp: d } =
|
403
|
-
|
404
|
-
const p = n.createApp(d(
|
405
|
-
return p.use(
|
399
|
+
pagesJson: c = {},
|
400
|
+
manifestJson: a = {},
|
401
|
+
window: r,
|
402
|
+
css: _ = ""
|
403
|
+
} = t, { plugin: u, setupApp: d } = i;
|
404
|
+
M(t, r), G(t, r), J(i, r), $(n, i, s, c, r), K(a.appid || Date.now(), _, r);
|
405
|
+
const p = n.createApp(d(o));
|
406
|
+
return p.use(q, i), p.use(u), p;
|
406
407
|
}
|
407
|
-
function
|
408
|
+
function te(e, t) {
|
408
409
|
const n = {};
|
409
|
-
return Object.entries(e).forEach(([
|
410
|
-
|
410
|
+
return Object.entries(e).forEach(([o, i]) => {
|
411
|
+
T.includes(o) && i && (n[o] = t(i));
|
411
412
|
}), n;
|
412
413
|
}
|
413
|
-
async function
|
414
|
-
const i = e.project?.pages || [],
|
414
|
+
async function oe(e, t, n = !1, o = f) {
|
415
|
+
const i = e.project?.pages || [], s = [];
|
415
416
|
for (const a of i) {
|
416
417
|
const r = await e.getDsl(a.id);
|
417
418
|
if (!r) continue;
|
418
|
-
const { renderer:
|
419
|
-
|
419
|
+
const { renderer: _ } = t({ dsl: r, components: {} }), u = e.project?.homepage === a.id;
|
420
|
+
s.push({
|
420
421
|
id: a.id,
|
421
|
-
path:
|
422
|
-
component:
|
422
|
+
path: `${o}/${a.id}`,
|
423
|
+
component: _,
|
423
424
|
style: {
|
424
425
|
navigationBarTitleText: a.title,
|
425
426
|
...a.style
|
426
427
|
},
|
427
428
|
needLogin: a.needLogin,
|
428
|
-
home:
|
429
|
+
home: u
|
430
|
+
});
|
431
|
+
}
|
432
|
+
const c = s.find((a) => !!a.home) || s[0];
|
433
|
+
if (c) {
|
434
|
+
const a = o === f ? "/" : o;
|
435
|
+
s.unshift({
|
436
|
+
...c,
|
437
|
+
path: a
|
429
438
|
});
|
430
439
|
}
|
431
|
-
|
432
|
-
if (s && o.unshift({
|
433
|
-
...s,
|
434
|
-
path: "/"
|
435
|
-
}), n) {
|
440
|
+
if (n) {
|
436
441
|
const a = e.project?.blocks || [];
|
437
442
|
for (const r of a) {
|
438
|
-
const
|
439
|
-
if (!
|
440
|
-
const { renderer:
|
441
|
-
|
443
|
+
const _ = await e.getDsl(r.id);
|
444
|
+
if (!_) continue;
|
445
|
+
const { renderer: u } = t({ dsl: _, components: {} });
|
446
|
+
s.push({
|
442
447
|
id: r.id,
|
443
|
-
path:
|
444
|
-
component:
|
448
|
+
path: `${o}/${r.id}`,
|
449
|
+
component: u,
|
445
450
|
style: {
|
446
451
|
navigationStyle: "custom"
|
447
452
|
}
|
448
453
|
});
|
449
454
|
}
|
450
455
|
}
|
451
|
-
return
|
456
|
+
return s;
|
452
457
|
}
|
453
|
-
function
|
458
|
+
function ie() {
|
454
459
|
if (window.uni)
|
455
460
|
return window.uni.showLoading({
|
456
461
|
title: "加载中...",
|
@@ -459,38 +464,39 @@ function te() {
|
|
459
464
|
window.uni.hideLoading();
|
460
465
|
};
|
461
466
|
}
|
462
|
-
function
|
467
|
+
function Y(e, t = "", n = "warning") {
|
463
468
|
window.uni && window.uni.showModal({
|
464
469
|
title: t,
|
465
470
|
content: e,
|
466
471
|
showCancel: !1
|
467
472
|
});
|
468
473
|
}
|
469
|
-
function
|
470
|
-
|
474
|
+
function ae(e) {
|
475
|
+
Y(e);
|
471
476
|
}
|
472
477
|
export {
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
478
|
+
T as APP_LIFE_CYCLE,
|
479
|
+
C as MANIFEST_JSON,
|
480
|
+
F as PAGES_JSON,
|
481
|
+
Z as PAGE_LIFE_CYCLES_LIST,
|
482
|
+
f as ROUTE_PAGE_BASE_PATH,
|
483
|
+
ae as alert,
|
484
|
+
te as createUniAppComponent,
|
485
|
+
oe as createUniRoutes,
|
486
|
+
ee as getFileId,
|
487
|
+
P as getGobalStyle,
|
488
|
+
m as getNavigationBar,
|
489
|
+
K as injectUniCSS,
|
490
|
+
G as injectUniConfig,
|
491
|
+
M as injectUniFeatures,
|
492
|
+
J as injectUniGlobal,
|
493
|
+
$ as injectUniRoutes,
|
494
|
+
q as install,
|
495
|
+
ie as loading,
|
496
|
+
O as mergeOptions,
|
491
497
|
g as navigationBarMaps,
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
498
|
+
Y as notify,
|
499
|
+
ne as setupUniApp,
|
500
|
+
Q as toKebabCase,
|
501
|
+
X as version
|
496
502
|
};
|
package/dist/index.umd.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
(function(
|
1
|
+
(function(c,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("@vtj/renderer")):typeof define=="function"&&define.amd?define(["exports","@vtj/renderer"],g):(c=typeof globalThis<"u"?globalThis:c||self,g(c.VtjUni={},c.renderer))})(this,function(c,g){"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.1-alpha.
|
5
|
+
* @version 0.10.1-alpha.2
|
6
6
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
7
|
-
*/const b="0.10.1-alpha.0",S=["onLaunch","onShow","onHide","onError","onPageNotFound","onUnhandledRejection","onThemeChange","onPageNotFound","onUniNViewMessage","onExit"],P=["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"],A={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"},N={pages:[],globalStyle:{navigationBarTextStyle:"black",navigationBarTitleText:"uni-app",navigationBarBackgroundColor:"#F8F8F8",backgroundColor:"#F8F8F8"}};function O(e){const[t,...n]=e;return[t.toLowerCase(),...n].join("").replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`)}function I(e){let{manifestJson:t={},pagesJson:n={},routes:o=[]}=e;const i=o.map(r=>{const{path:a,style:p,needLogin:_}=r;return{path:a,style:p,needLogin:_}});return{...e,manifestJson:Object.assign({},A,t),pagesJson:Object.assign({},N,n,{pages:i})}}const m={navigationBarBackgroundColor:"backgroundColor",navigationBarTextStyle:"titleColor",navigationBarTitleText:"titleText",navigationStyle:"style",titleImage:"titleImage",titlePenetrate:"titlePenetrate",transparentTitle:"transparentTitle"};function T(e){const t={},n={black:"#000000",white:"#ffffff"};for(const o in e)m[o]&&(t[m[o]]=o==="navigationBarTextStyle"?n[e[o]]||n.black:e[o]);return t}function U(e){const t={};for(const n in e)m[n]||(t[n]=e[n]);return t}function L(e){var o;const n=e.split("?")[0].match(/\#\/pages\/([\w\W]*)/i);return(o=n==null?void 0:n[1])!=null?o:""}function V(e){var n;const t=e.h5;return((n=t==null?void 0:t.router)==null?void 0:n.mode)||"hash"}function k(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 W(e){const{pagesJson:t={}}=e,{globalStyle:n,pages:o=[]}=t;return!!(n!=null&&n.enablePullDownRefresh||o.find(i=>{var r;return!!((r=i.style)!=null&&r.enablePullDownRefresh)}))}function j(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(r=>{var a;return((a=r.style)==null?void 0:a.navigationStyle)==="default"})&&(i=!1)):o.every(r=>{var a;return((a=r.style)==null?void 0:a.navigationStyle)==="custom"})&&(i=!0),i}function G(e){var p;const t=j(e),n={navigationBar:!1,navigationBarButtons:!1,navigationBarSearchInput:!1,navigationBarTransparent:!1},{pagesJson:o={}}=e,{globalStyle:i,pages:r=[]}=o;if(t)return n;n.navigationBar=!0;const a=(p=i==null?void 0:i.h5)==null?void 0:p.titleNView;return r.find(_=>{var s,c,d;return!!((d=(c=(s=_.style)==null?void 0:s.h5)==null?void 0:c.titleNView)!=null&&d.buttons.length)})&&(n.navigationBarButtons=!0),(a!=null&&a.searchInput||r.find(_=>{var s,c,d;return!!((d=(c=(s=_.style)==null?void 0:s.h5)==null?void 0:c.titleNView)!=null&&d.searchInput)}))&&(n.navigationBarSearchInput=!0),((a==null?void 0:a.type)==="transparent"||r.find(_=>{var s,c,d;return((d=(c=(s=_.style)==null?void 0:s.h5)==null?void 0:c.titleNView)==null?void 0:d.type)==="transparent"}))&&(n.navigationBarTransparent=!0),n}function h(e,t=window){var l,E,g,F;const{pagesJson:n={},manifestJson:o={}}=e,{topWindow:i,leftWindow:r,rightWindow:a}=k(n),{navigationBar:p,navigationBarButtons:_,navigationBarSearchInput:s,navigationBarTransparent:c}=G(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__:V(o),__UNI_FEATURE_PAGES__:!!((l=n.pages)!=null&&l.length),__UNI_FEATURE_TABBAR__:!!((g=(E=n.tabBar)==null?void 0:E.list)!=null&&g.length),__UNI_FEATURE_TABBAR_MIDBUTTON__:!!((F=n.tabBar)!=null&&F.midButton),__UNI_FEATURE_TOPWINDOW__:i,__UNI_FEATURE_LEFTWINDOW__:r,__UNI_FEATURE_RIGHTWINDOW__:a,__UNI_FEATURE_RESPONSIVE__:!1,__UNI_FEATURE_NAVIGATIONBAR__:p,__UNI_FEATURE_PULL_DOWN_REFRESH__:W(e),__UNI_FEATURE_NAVIGATIONBAR_BUTTONS__:_,__UNI_FEATURE_NAVIGATIONBAR_SEARCHINPUT__:s,__UNI_FEATURE_NAVIGATIONBAR_TRANSPARENT__:c};Object.entries(d).forEach(([$,z])=>{t[$]=z})}const M="4.45";function C(e,t=window){var d,l;const{pagesJson:n={},manifestJson:o={}}=e,{easycom:i={}}=n,{appid:r="",name:a="",versionCode:p="",versionName:_=""}=o,s=n.globalStyle,c=((d=o.h5)==null?void 0:d.router)||{};t.__uniConfig={easycom:i,globalStyle:{...U(s),navigationBar:T(s),isNVue:!1},compilerVersion:M,appId:r,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:c.base||"/",...c},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 w(e,t=window){const{UniServiceJSBridge:n,UniViewJSBridge:o,getApp:i,uni:r,getCurrentPages:a,upx2px:p,setupPage:_}=e;t.UniServiceJSBridge=n,t.UniViewJSBridge=o,t.getApp=i,t.uni=r,t.wx=r,t.getCurrentPages=a,t.upx2px=p,t.__setupPage=s=>_(s)}function D(e,t,n){const{defineAsyncComponent:o,openBlock:i,createBlock:r,withCtx:a,createVNode:p}=e,{PageComponent:_,setupPage:s,getApp:c}=t;return{mpType:"page",setup(){var g;const d=c(),l=((g=d==null?void 0:d.$route)==null?void 0:g.query)||{},E=typeof n=="function"?o(n):n;return()=>(i(),r(_,null,{page:a(()=>[p(s(E),Object.assign({},l,{ref:"page"}),null,512)]),_:1}))}}}function J(e,t,n){var d;const{path:o,style:i={},meta:r={},home:a}=t,_=(((d=e.tabBar)==null?void 0:d.list)||[]).findIndex(l=>l.pagePath===o),s=_>-1,c=n===0;return{isTabBar:s,tabBarIndex:_,isQuit:a!=null?a:c,isEntry:a!=null?a:c,navigationBar:{type:"default",...T(i)},isNVue:!1,route:o,...r}}function R(e,t,n,o,i=window){const r=n.map((a,p)=>{const _=J(o,a,p),s=D(e,t,a.component),{path:c}=a;return{path:c,alias:c,meta:_,component:s}});i.__uniRoutes=r,i.__uniLayout={}}function B(e,t,n=window){f.adoptedStyleSheets(n,String(e),t)}function v(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=I(e),{Vue:n,App:o,UniH5:i,routes:r=[],pagesJson:a={},manifestJson:p={},window:_,css:s}=t,{plugin:c,setupApp:d}=i;h(t,_),C(t,_),w(i,_),R(n,i,r,a,_),s&&B(p.appid||Date.now(),s,_);const l=n.createApp(d(o));return l.use(v,i),l.use(c),l}function H(e,t){const n={};return Object.entries(e).forEach(([o,i])=>{S.includes(o)&&i&&(n[o]=t(i))}),n}async function q(e,t,n=!1){var a,p,_;const o=((a=e.project)==null?void 0:a.pages)||[],i=[];for(const s of o){const c=await e.getDsl(s.id);if(!c)continue;const{renderer:d}=t({dsl:c,components:{}}),l=((p=e.project)==null?void 0:p.homepage)===s.id;i.push({id:s.id,path:`/pages/${s.id}`,component:d,style:{navigationBarTitleText:s.title,...s.style},needLogin:s.needLogin,home:l})}const r=i.find(s=>!!s.home)||i[0];if(r&&i.unshift({...r,path:"/"}),n){const s=((_=e.project)==null?void 0:_.blocks)||[];for(const c of s){const d=await e.getDsl(c.id);if(!d)continue;const{renderer:l}=t({dsl:d,components:{}});i.push({id:c.id,path:`/pages/${c.id}`,component:l,style:{navigationStyle:"custom"}})}}return i}function K(){if(window.uni)return window.uni.showLoading({title:"加载中...",mask:!0}),()=>{window.uni.hideLoading()}}function y(e,t="",n="warning"){window.uni&&window.uni.showModal({title:t,content:e,showCancel:!1})}function Y(e){y(e)}u.APP_LIFE_CYCLE=S,u.MANIFEST_JSON=A,u.PAGES_JSON=N,u.PAGE_LIFE_CYCLES_LIST=P,u.alert=Y,u.createUniAppComponent=H,u.createUniRoutes=q,u.getFileId=L,u.getGobalStyle=U,u.getNavigationBar=T,u.injectUniCSS=B,u.injectUniConfig=C,u.injectUniFeatures=h,u.injectUniGlobal=w,u.injectUniRoutes=R,u.install=v,u.loading=K,u.mergeOptions=I,u.navigationBarMaps=m,u.notify=y,u.setupUniApp=x,u.toKebabCase=O,u.version=b,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
|
7
|
+
*/const P="0.10.1-alpha.2",A=["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"],T="/pages",U={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"},N={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 I(e){let{manifestJson:t={},pagesJson:n={},routes:o=[]}=e;const i=o.map(r=>{const{path:a,style:p,needLogin:u}=r;return{path:a,style:p,needLogin:u}});return{...e,manifestJson:Object.assign({},U,t),pagesJson:Object.assign({},N,n,{pages:i})}}const E={navigationBarBackgroundColor:"backgroundColor",navigationBarTextStyle:"titleColor",navigationBarTitleText:"titleText",navigationStyle:"style",titleImage:"titleImage",titlePenetrate:"titlePenetrate",transparentTitle:"transparentTitle"};function S(e){const t={},n={black:"#000000",white:"#ffffff"};for(const o in e)E[o]&&(t[E[o]]=o==="navigationBarTextStyle"?n[e[o]]||n.black:e[o]);return t}function h(e){const t={};for(const n in e)E[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 r;return!!((r=i.style)!=null&&r.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(r=>{var a;return((a=r.style)==null?void 0:a.navigationStyle)==="default"})&&(i=!1)):o.every(r=>{var a;return((a=r.style)==null?void 0:a.navigationStyle)==="custom"})&&(i=!0),i}function M(e){var p;const t=G(e),n={navigationBar:!1,navigationBarButtons:!1,navigationBarSearchInput:!1,navigationBarTransparent:!1},{pagesJson:o={}}=e,{globalStyle:i,pages:r=[]}=o;if(t)return n;n.navigationBar=!0;const a=(p=i==null?void 0:i.h5)==null?void 0:p.titleNView;return r.find(u=>{var d,s,_;return!!((_=(s=(d=u.style)==null?void 0:d.h5)==null?void 0:s.titleNView)!=null&&_.buttons.length)})&&(n.navigationBarButtons=!0),(a!=null&&a.searchInput||r.find(u=>{var d,s,_;return!!((_=(s=(d=u.style)==null?void 0:d.h5)==null?void 0:s.titleNView)!=null&&_.searchInput)}))&&(n.navigationBarSearchInput=!0),((a==null?void 0:a.type)==="transparent"||r.find(u=>{var d,s,_;return((_=(s=(d=u.style)==null?void 0:d.h5)==null?void 0:s.titleNView)==null?void 0:_.type)==="transparent"}))&&(n.navigationBarTransparent=!0),n}function C(e,t=window){var l,f,m,b;const{pagesJson:n={},manifestJson:o={}}=e,{topWindow:i,leftWindow:r,rightWindow:a}=W(n),{navigationBar:p,navigationBarButtons:u,navigationBarSearchInput:d,navigationBarTransparent:s}=M(e),_={__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__:!!((m=(f=n.tabBar)==null?void 0:f.list)!=null&&m.length),__UNI_FEATURE_TABBAR_MIDBUTTON__:!!((b=n.tabBar)!=null&&b.midButton),__UNI_FEATURE_TOPWINDOW__:i,__UNI_FEATURE_LEFTWINDOW__:r,__UNI_FEATURE_RIGHTWINDOW__:a,__UNI_FEATURE_RESPONSIVE__:!1,__UNI_FEATURE_NAVIGATIONBAR__:p,__UNI_FEATURE_PULL_DOWN_REFRESH__:j(e),__UNI_FEATURE_NAVIGATIONBAR_BUTTONS__:u,__UNI_FEATURE_NAVIGATIONBAR_SEARCHINPUT__:d,__UNI_FEATURE_NAVIGATIONBAR_TRANSPARENT__:s};Object.entries(_).forEach(([z,X])=>{t[z]=X})}const D="4.45";function R(e,t=window){var _,l;const{pagesJson:n={},manifestJson:o={}}=e,{easycom:i={}}=n,{appid:r="",name:a="",versionCode:p="",versionName:u=""}=o,d=n.globalStyle,s=((_=o.h5)==null?void 0:_.router)||{};t.__uniConfig={easycom:i,globalStyle:{...h(d),navigationBar:S(d),isNVue:!1},compilerVersion:D,appId:r,appName:a,appVersion:u,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:s.base||"/",...s},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 w(e,t=window){const{UniServiceJSBridge:n,UniViewJSBridge:o,getApp:i,uni:r,getCurrentPages:a,upx2px:p,setupPage:u}=e;t.UniServiceJSBridge=n,t.UniViewJSBridge=o,t.getApp=i,t.uni=r,t.wx=r,t.getCurrentPages=a,t.upx2px=p,t.__setupPage=d=>u(d)}function J(e,t,n){const{defineAsyncComponent:o,openBlock:i,createBlock:r,withCtx:a,createVNode:p}=e,{PageComponent:u,setupPage:d,getApp:s}=t;return{mpType:"page",setup(){var m;const _=s(),l=((m=_==null?void 0:_.$route)==null?void 0:m.query)||{},f=typeof n=="function"?o(n):n;return()=>(i(),r(u,null,{page:a(()=>[p(d(f),Object.assign({},l,{ref:"page"}),null,512)]),_:1}))}}}function H(e,t,n){var _;const{path:o,style:i={},meta:r={},home:a}=t,u=(((_=e.tabBar)==null?void 0:_.list)||[]).findIndex(l=>l.pagePath===o),d=u>-1,s=n===0;return{isTabBar:d,tabBarIndex:u,isQuit:a!=null?a:s,isEntry:a!=null?a:s,navigationBar:{type:"default",...S(i)},isNVue:!1,route:o,...r}}function B(e,t,n,o,i=window){const r=n.map((a,p)=>{const u=H(o,a,p),d=J(e,t,a.component),{path:s}=a;return{path:s,alias:s,meta:u,component:d}});i.__uniRoutes=r,i.__uniLayout={}}function v(e,t,n=window){g.adoptedStyleSheets(n,String(e),t)}function y(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=I(e),{Vue:n,App:o,UniH5:i,routes:r=[],pagesJson:a={},manifestJson:p={},window:u,css:d=""}=t,{plugin:s,setupApp:_}=i;C(t,u),R(t,u),w(i,u),B(n,i,r,a,u),v(p.appid||Date.now(),d,u);const l=n.createApp(_(o));return l.use(y,i),l.use(s),l}function $(e,t){const n={};return Object.entries(e).forEach(([o,i])=>{A.includes(o)&&i&&(n[o]=t(i))}),n}async function q(e,t,n=!1,o=T){var p,u,d;const i=((p=e.project)==null?void 0:p.pages)||[],r=[];for(const s of i){const _=await e.getDsl(s.id);if(!_)continue;const{renderer:l}=t({dsl:_,components:{}}),f=((u=e.project)==null?void 0:u.homepage)===s.id;r.push({id:s.id,path:`${o}/${s.id}`,component:l,style:{navigationBarTitleText:s.title,...s.style},needLogin:s.needLogin,home:f})}const a=r.find(s=>!!s.home)||r[0];if(a){const s=o===T?"/":o;r.unshift({...a,path:s})}if(n){const s=((d=e.project)==null?void 0:d.blocks)||[];for(const _ of s){const l=await e.getDsl(_.id);if(!l)continue;const{renderer:f}=t({dsl:l,components:{}});r.push({id:_.id,path:`${o}/${_.id}`,component:f,style:{navigationStyle:"custom"}})}}return r}function K(){if(window.uni)return window.uni.showLoading({title:"加载中...",mask:!0}),()=>{window.uni.hideLoading()}}function F(e,t="",n="warning"){window.uni&&window.uni.showModal({title:t,content:e,showCancel:!1})}function Y(e){F(e)}c.APP_LIFE_CYCLE=A,c.MANIFEST_JSON=U,c.PAGES_JSON=N,c.PAGE_LIFE_CYCLES_LIST=O,c.ROUTE_PAGE_BASE_PATH=T,c.alert=Y,c.createUniAppComponent=$,c.createUniRoutes=q,c.getFileId=V,c.getGobalStyle=h,c.getNavigationBar=S,c.injectUniCSS=v,c.injectUniConfig=R,c.injectUniFeatures=C,c.injectUniGlobal=w,c.injectUniRoutes=B,c.install=y,c.loading=K,c.mergeOptions=I,c.navigationBarMaps=E,c.notify=F,c.setupUniApp=x,c.toKebabCase=L,c.version=P,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.1-alpha.
|
4
|
+
"version": "0.10.1-alpha.2",
|
5
5
|
"type": "module",
|
6
6
|
"sideEffects": false,
|
7
7
|
"dependencies": {
|
8
|
-
"@vtj/core": "~0.10.1-alpha.
|
9
|
-
"@vtj/
|
10
|
-
"@vtj/
|
11
|
-
"@vtj/utils": "~0.10.1-alpha.
|
8
|
+
"@vtj/core": "~0.10.1-alpha.2",
|
9
|
+
"@vtj/icons": "~0.10.1-alpha.2",
|
10
|
+
"@vtj/renderer": "~0.10.1-alpha.2",
|
11
|
+
"@vtj/utils": "~0.10.1-alpha.2"
|
12
12
|
},
|
13
13
|
"devDependencies": {
|
14
14
|
"@dcloudio/uni-app": "3.0.0-4040520250104002",
|
package/types/constants.d.ts
CHANGED
@@ -5,6 +5,12 @@ declare const _default: {
|
|
5
5
|
"navigationBarTitleText": "uni-app",
|
6
6
|
"navigationBarBackgroundColor": "#F8F8F8",
|
7
7
|
"backgroundColor": "#F8F8F8"
|
8
|
+
},
|
9
|
+
"easycom": {
|
10
|
+
"autoscan": true,
|
11
|
+
"custom": {
|
12
|
+
"^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue"
|
13
|
+
}
|
8
14
|
}
|
9
15
|
}
|
10
16
|
;
|
package/types/setup/app.d.ts
CHANGED
@@ -3,4 +3,4 @@ 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 createUniRoutes(provider: Provider, createRenderer: any, includeBlock?: boolean): Promise<UniRoute[]>;
|
6
|
+
export declare function createUniRoutes(provider: Provider, createRenderer: any, includeBlock?: boolean, basePath?: string): Promise<UniRoute[]>;
|
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.1-alpha.1
|
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.1-alpha.1";
|