uview-plus 3.8.119 → 3.8.125

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.
@@ -1,21 +1,17 @@
1
1
  import { dirname, relative, resolve } from 'node:path'
2
2
  import { fileURLToPath } from 'node:url'
3
3
  import process from 'node:process'
4
- import { copyFileSync, existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from 'node:fs'
4
+ import { existsSync, mkdirSync, statSync, writeFileSync } from 'node:fs'
5
5
 
6
6
  import { createFilter, normalizePath } from 'vite'
7
7
 
8
8
  import { transformNvuePage, transformPage } from './page.js'
9
9
  import { rebuildUpApp, registerUpApp } from './root.js'
10
10
  import { loadPagesJson, normalizePlatformPath, toArray } from './utils.js'
11
+ import { createAppIconFontFeature } from '../vite/app-icon-font.js'
12
+ import { detectProjectRoot } from '../vite/utils.js'
11
13
 
12
14
  const rootLibPath = normalizePath(dirname(fileURLToPath(import.meta.url)))
13
- const appStaticIconFontRelativePath = 'static/app-plus/uview-plus/upicon.ttf'
14
- const appStaticIconFontFlag = 'const useAppStaticIconFont = false;'
15
- const appStaticIconFontEnabledFlag = 'const useAppStaticIconFont = true;'
16
- const appRemoteIconFontCondition = /\/\*\s*#ifdef\s+APP\s+\|\|\s+(MP-QQ\s+\|\|\s+MP-TOUTIAO\s+\|\|\s+MP-BAIDU\s+\|\|\s+MP-KUAISHOU\s+\|\|\s+MP-XHS)\s*\*\//
17
- const appCompiledRemoteIconFontFace = /[ \t]*(?:\/\/[^\n]*\n[ \t]*)?@font-face\s*\{[^{}]*font-family:\s*['"]?uicon-iconfont['"]?;?[^{}]*at\.alicdn\.com\/t\/font_2225171[^{}]*\}\s*/
18
- const appCompiledRemoteIconFontFaceGlobal = /[ \t]*(?:\/\/[^\n]*\n[ \t]*)?@font-face\s*\{[^{}]*font-family:\s*['"]?uicon-iconfont['"]?;?[^{}]*at\.alicdn\.com\/t\/font_2225171[^{}]*\}\s*/g
19
15
 
20
16
  export default function UniUpRoot(options = {}) {
21
17
  const rootOptions = {
@@ -28,41 +24,12 @@ export default function UniUpRoot(options = {}) {
28
24
  }
29
25
  const rootFileName = String(rootOptions.rootFileName || 'App.up').replace(/\.vue$/i, '')
30
26
 
31
- const detectProjectRoot = () => {
32
- const cwd = normalizePath(process.env.INIT_CWD || process.cwd())
33
- const envInputDir = process.env.UNI_INPUT_DIR ? normalizePath(process.env.UNI_INPUT_DIR) : ''
34
- const cliRootPath = normalizePath(resolve(cwd, 'src'))
35
- const hbuilderRootPath = cwd
36
-
37
- const isPageRoot = (path) => existsSync(resolve(path, 'pages.json'))
38
-
39
- if (envInputDir && isPageRoot(envInputDir)) {
40
- const projectType = envInputDir.endsWith('/src') ? 'cli' : 'hbuilder'
41
- return { rootPath: envInputDir, projectType }
42
- }
43
-
44
- if (isPageRoot(cliRootPath)) {
45
- return { rootPath: cliRootPath, projectType: 'cli' }
46
- }
47
-
48
- if (isPageRoot(hbuilderRootPath)) {
49
- return { rootPath: hbuilderRootPath, projectType: 'hbuilder' }
50
- }
51
-
52
- return {
53
- rootPath: envInputDir || cliRootPath,
54
- projectType: envInputDir && !envInputDir.endsWith('/src') ? 'hbuilder' : 'cli',
55
- }
56
- }
57
-
58
27
  const projectInfo = detectProjectRoot()
59
28
  const rootPath = normalizePath(projectInfo.rootPath)
29
+ // App 本地图标字体与 Root 组件无关,这里复用 UniUp 的同一个 feature,保持老项目行为不变
30
+ const appIconFont = createAppIconFontFeature({ enabled: rootOptions.appStaticIconFont !== false })
60
31
  const appUpPath = normalizePath(resolve(rootPath, `${rootFileName}.vue`))
61
32
  const rootToastHostPath = normalizePath(resolve(rootLibPath, 'root-toast-host.vue'))
62
- const iconFontSourcePath = normalizePath(resolve(rootLibPath, '../../components/u-icon/upicon.ttf'))
63
- const appStaticIconFontPath = normalizePath(resolve(rootPath, appStaticIconFontRelativePath))
64
- const uIconUtilPath = normalizePath(resolve(rootPath, 'uni_modules/uview-plus/components/u-icon/util.js'))
65
- const uIconVuePath = normalizePath(resolve(rootPath, 'uni_modules/uview-plus/components/u-icon/u-icon.vue'))
66
33
  const themeRuntimePath = normalizePath(resolve(rootPath, 'uni_modules/uview-plus/libs/theme/runtime.js'))
67
34
  const pagesPath = normalizePath(resolve(rootPath, 'pages.json'))
68
35
  const excludedPaths = toArray(rootOptions.excludePages)
@@ -99,51 +66,6 @@ export default function UniUpRoot(options = {}) {
99
66
  writeFileSync(appUpPath, defaultRootSfc, 'utf-8')
100
67
  }
101
68
 
102
- const shouldCopyFile = (sourcePath, targetPath) => {
103
- if (!existsSync(targetPath)) return true
104
- if (statSync(sourcePath).size !== statSync(targetPath).size) return true
105
- return !readFileSync(sourcePath).equals(readFileSync(targetPath))
106
- }
107
-
108
- const ensureAppStaticIconFont = () => {
109
- if (process.env.UNI_PLATFORM !== 'app') return
110
- if (!existsSync(iconFontSourcePath)) {
111
- throw new Error(`uview-plus built-in icon font is missing: ${iconFontSourcePath}`)
112
- }
113
-
114
- mkdirSync(dirname(appStaticIconFontPath), { recursive: true })
115
- if (shouldCopyFile(iconFontSourcePath, appStaticIconFontPath)) {
116
- copyFileSync(iconFontSourcePath, appStaticIconFontPath)
117
- }
118
- }
119
-
120
- const removeAppCompiledRemoteIconFontFace = (code) => code.replace(appCompiledRemoteIconFontFaceGlobal, '')
121
-
122
- const transformAppStaticIconFont = (code, cleanId) => {
123
- if (process.env.UNI_PLATFORM !== 'app') return null
124
- if (cleanId === uIconUtilPath && code.includes(appStaticIconFontFlag)) {
125
- return code.replace(appStaticIconFontFlag, appStaticIconFontEnabledFlag)
126
- }
127
- if (cleanId === uIconVuePath && appRemoteIconFontCondition.test(code)) {
128
- return code.replace(appRemoteIconFontCondition, '/* #ifdef $1 */')
129
- }
130
- if (cleanId === uIconVuePath && appCompiledRemoteIconFontFace.test(code)) {
131
- return removeAppCompiledRemoteIconFontFace(code)
132
- }
133
- return null
134
- }
135
-
136
- const removeAppRemoteIconFontFaceFromCssAssets = (bundle) => {
137
- if (process.env.UNI_PLATFORM !== 'app') return
138
- Object.values(bundle).forEach((asset) => {
139
- if (asset.type !== 'asset') return
140
- if (!asset.fileName.endsWith('.css')) return
141
- if (typeof asset.source !== 'string') return
142
- if (!appCompiledRemoteIconFontFace.test(asset.source)) return
143
- asset.source = removeAppCompiledRemoteIconFontFace(asset.source)
144
- })
145
- }
146
-
147
69
  const refreshPagesJson = () => {
148
70
  if (!existsSync(pagesPath)) return
149
71
  const mtimeMs = statSync(pagesPath).mtimeMs
@@ -164,7 +86,7 @@ export default function UniUpRoot(options = {}) {
164
86
  }
165
87
  },
166
88
  buildStart() {
167
- ensureAppStaticIconFont()
89
+ appIconFont.ensure()
168
90
  ensureRootFile()
169
91
  refreshPagesJson()
170
92
  },
@@ -173,7 +95,7 @@ export default function UniUpRoot(options = {}) {
173
95
  const isSfcBlock = id.includes('?')
174
96
  const cleanId = normalizePath(id.split('?')[0])
175
97
 
176
- const iconFontCode = transformAppStaticIconFont(code, cleanId)
98
+ const iconFontCode = appIconFont.transform(code, cleanId)
177
99
  if (iconFontCode) {
178
100
  return {
179
101
  code: iconFontCode,
@@ -218,7 +140,7 @@ export default function UniUpRoot(options = {}) {
218
140
  return null
219
141
  },
220
142
  generateBundle(_, bundle) {
221
- removeAppRemoteIconFontFaceFromCssAssets(bundle)
143
+ appIconFont.generateBundle(bundle)
222
144
  },
223
145
  }
224
146
  }
@@ -0,0 +1,93 @@
1
+ import { dirname, resolve } from 'node:path'
2
+ import { fileURLToPath } from 'node:url'
3
+ import { copyFileSync, existsSync, mkdirSync, readFileSync, statSync } from 'node:fs'
4
+
5
+ import { detectProjectRoot, isAppPlatform, normalizePath, toCleanId } from './utils.js'
6
+
7
+ const featurePath = normalizePath(dirname(fileURLToPath(import.meta.url)))
8
+ export const appStaticIconFontRelativePath = 'static/app-plus/uview-plus/upicon.ttf'
9
+ // 源码默认 App 端优先本地字体,只有在显式关闭本地字体时才切回 config.iconUrl
10
+ // 不带分号,兼容有/无分号两种代码风格
11
+ const appStaticIconFontFlag = 'const useAppStaticIconFont = true'
12
+ const appStaticIconFontDisabledFlag = 'const useAppStaticIconFont = false'
13
+ const appRemoteIconFontCondition = /\/\*\s*#ifdef\s+APP\s+\|\|\s+(MP-QQ\s+\|\|\s+MP-TOUTIAO\s+\|\|\s+MP-BAIDU\s+\|\|\s+MP-KUAISHOU\s+\|\|\s+MP-XHS)\s*\*\//
14
+ const appCompiledRemoteIconFontFace = /[ \t]*(?:\/\/[^\n]*\n[ \t]*)?@font-face\s*\{[^{}]*font-family:\s*['"]?uicon-iconfont['"]?;?[^{}]*at\.alicdn\.com\/t\/font_2225171[^{}]*\}\s*/
15
+ const appCompiledRemoteIconFontFaceGlobal = /[ \t]*(?:\/\/[^\n]*\n[ \t]*)?@font-face\s*\{[^{}]*font-family:\s*['"]?uicon-iconfont['"]?;?[^{}]*at\.alicdn\.com\/t\/font_2225171[^{}]*\}\s*/g
16
+
17
+ /**
18
+ * App 本地图标字体能力(UniUp 的一个 feature)。
19
+ *
20
+ * 与 Root 组件无关:App / App-nvue 默认优先加载随包分发的 static 字体,
21
+ * 但字体文件必须由构建插件复制到应用 static 目录,本 feature 负责这件事,
22
+ * 并在 App 构建时移除远程 CSS 字体,避免本地字体与远程字体同时加载。
23
+ */
24
+ export function createAppIconFontFeature(options = {}) {
25
+ const enabled = options.enabled !== false
26
+ const projectInfo = detectProjectRoot()
27
+ const rootPath = normalizePath(projectInfo.rootPath)
28
+ const iconFontSourcePath = normalizePath(resolve(featurePath, '../../components/u-icon/upicon.ttf'))
29
+ const appStaticIconFontPath = normalizePath(resolve(rootPath, appStaticIconFontRelativePath))
30
+ const uIconUtilPath = normalizePath(resolve(rootPath, 'uni_modules/uview-plus/components/u-icon/util.js'))
31
+ const uIconVuePath = normalizePath(resolve(rootPath, 'uni_modules/uview-plus/components/u-icon/u-icon.vue'))
32
+
33
+ const shouldCopyFile = (sourcePath, targetPath) => {
34
+ if (!existsSync(targetPath)) return true
35
+ if (statSync(sourcePath).size !== statSync(targetPath).size) return true
36
+ return !readFileSync(sourcePath).equals(readFileSync(targetPath))
37
+ }
38
+
39
+ const removeAppCompiledRemoteIconFontFace = (code) => code.replace(appCompiledRemoteIconFontFaceGlobal, '')
40
+
41
+ const ensure = () => {
42
+ if (!enabled) return
43
+ if (!isAppPlatform()) return
44
+ if (!existsSync(iconFontSourcePath)) {
45
+ throw new Error(`uview-plus built-in icon font is missing: ${iconFontSourcePath}`)
46
+ }
47
+
48
+ mkdirSync(dirname(appStaticIconFontPath), { recursive: true })
49
+ if (shouldCopyFile(iconFontSourcePath, appStaticIconFontPath)) {
50
+ copyFileSync(iconFontSourcePath, appStaticIconFontPath)
51
+ }
52
+ }
53
+
54
+ const transform = (code, id) => {
55
+ if (!isAppPlatform()) return null
56
+ const cleanId = toCleanId(id)
57
+ if (!enabled) {
58
+ if (cleanId === uIconUtilPath && code.includes(appStaticIconFontFlag)) {
59
+ return code.replace(appStaticIconFontFlag, appStaticIconFontDisabledFlag)
60
+ }
61
+ return null
62
+ }
63
+ if (cleanId === uIconVuePath && appRemoteIconFontCondition.test(code)) {
64
+ return code.replace(appRemoteIconFontCondition, '/* #ifdef $1 */')
65
+ }
66
+ if (cleanId === uIconVuePath && appCompiledRemoteIconFontFace.test(code)) {
67
+ return removeAppCompiledRemoteIconFontFace(code)
68
+ }
69
+ return null
70
+ }
71
+
72
+ const generateBundle = (bundle) => {
73
+ if (!enabled) return
74
+ if (!isAppPlatform()) return
75
+ Object.values(bundle).forEach((asset) => {
76
+ if (asset.type !== 'asset') return
77
+ if (!asset.fileName.endsWith('.css')) return
78
+ if (typeof asset.source !== 'string') return
79
+ if (!appCompiledRemoteIconFontFace.test(asset.source)) return
80
+ asset.source = removeAppCompiledRemoteIconFontFace(asset.source)
81
+ })
82
+ }
83
+
84
+ return {
85
+ name: 'app-icon-font',
86
+ enabled,
87
+ rootPath,
88
+ appStaticIconFontPath,
89
+ ensure,
90
+ transform,
91
+ generateBundle,
92
+ }
93
+ }
@@ -0,0 +1,50 @@
1
+ import { createAppIconFontFeature } from './app-icon-font.js'
2
+
3
+ /**
4
+ * uview-plus 通用 Vite 插件(统一入口)。
5
+ *
6
+ * 设计约定:
7
+ * - 用户只需要在 vite.config 里注册一次 `UpVite()`,之后组件库新增任何构建期能力
8
+ * 都在这里追加 feature,用户不需要改自己的配置。
9
+ * - 每个 feature 是一个对象,按需实现以下钩子(都可选):
10
+ * { name, ensure(), transform(code, id), generateBundle(bundle) }
11
+ * `ensure()` 对应 buildStart,`transform` 返回改写后的源码字符串或 null。
12
+ *
13
+ * 用法:
14
+ * import UpVite from 'uview-plus/libs/vite/index.js'
15
+ * export default defineConfig({ plugins: [UpVite(), uni()] })
16
+ */
17
+ export function createUpViteFeatures(options = {}) {
18
+ return [
19
+ // App 端本地图标字体:把内置 upicon.ttf 复制到 static 并移除 App 远程 @font-face
20
+ createAppIconFontFeature({ enabled: options.appStaticIconFont !== false }),
21
+ // 后续新增构建期能力在此追加,保持对用户的配置零改动
22
+ ]
23
+ }
24
+
25
+ export default function UpVite(options = {}) {
26
+ const features = createUpViteFeatures(options)
27
+
28
+ return {
29
+ name: 'vite-plugin-up-vite',
30
+ enforce: 'pre',
31
+ buildStart() {
32
+ features.forEach(feature => feature.ensure?.())
33
+ },
34
+ transform(code, id) {
35
+ for (const feature of features) {
36
+ const transformed = feature.transform?.(code, id)
37
+ if (transformed) {
38
+ return {
39
+ code: transformed,
40
+ map: null,
41
+ }
42
+ }
43
+ }
44
+ return null
45
+ },
46
+ generateBundle(_, bundle) {
47
+ features.forEach(feature => feature.generateBundle?.(bundle))
48
+ },
49
+ }
50
+ }
@@ -0,0 +1,48 @@
1
+ import { existsSync } from 'node:fs'
2
+ import { resolve } from 'node:path'
3
+ import process from 'node:process'
4
+
5
+ /**
6
+ * 统一为正斜杠路径。
7
+ *
8
+ * 这里刻意不 import vite 的 normalizePath —— 让 libs/vite 目录保持自包含,
9
+ * 宿主项目不一定装了 vite 包(HBuilderX 项目走 HBuilderX 内置构建)。
10
+ */
11
+ export const normalizePath = (path) => {
12
+ if (!path) return ''
13
+ return String(path).replace(/\\/g, '/')
14
+ }
15
+
16
+ /**
17
+ * 识别宿主项目根目录,同时兼容 CLI 项目与 HBuilderX 项目。
18
+ */
19
+ export function detectProjectRoot() {
20
+ const cwd = normalizePath(process.env.INIT_CWD || process.cwd())
21
+ const envInputDir = process.env.UNI_INPUT_DIR ? normalizePath(process.env.UNI_INPUT_DIR) : ''
22
+ const cliRootPath = normalizePath(resolve(cwd, 'src'))
23
+ const hbuilderRootPath = cwd
24
+
25
+ const isPageRoot = (path) => existsSync(resolve(path, 'pages.json'))
26
+
27
+ if (envInputDir && isPageRoot(envInputDir)) {
28
+ const projectType = envInputDir.endsWith('/src') ? 'cli' : 'hbuilder'
29
+ return { rootPath: envInputDir, projectType }
30
+ }
31
+
32
+ if (isPageRoot(cliRootPath)) {
33
+ return { rootPath: cliRootPath, projectType: 'cli' }
34
+ }
35
+
36
+ if (isPageRoot(hbuilderRootPath)) {
37
+ return { rootPath: hbuilderRootPath, projectType: 'hbuilder' }
38
+ }
39
+
40
+ return {
41
+ rootPath: envInputDir || cliRootPath,
42
+ projectType: envInputDir && !envInputDir.endsWith('/src') ? 'hbuilder' : 'cli',
43
+ }
44
+ }
45
+
46
+ export const isAppPlatform = () => process.env.UNI_PLATFORM === 'app'
47
+
48
+ export const toCleanId = (id) => normalizePath(String(id).split('?')[0])
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "id": "uview-plus",
3
3
  "name": "uview-plus",
4
4
  "displayName": "零云®uview-plus3.0重磅发布,全面的Vue3鸿蒙跨端移动组件库,组件丰富维护更新稳定。",
5
- "version": "3.8.119",
5
+ "version": "3.8.125",
6
6
  "description": "零云®uview-plus已兼容vue3支持多语言,120+全面的组件和便捷的工具会让您信手拈来。近期新增拖动排序、条码、图片裁剪、下拉刷新、虚拟列表、签名、Markdown等。",
7
7
  "keywords": [
8
8
  "uview",
@@ -51,6 +51,21 @@ declare interface SliderProps {
51
51
  * 滑块按钮自定义样式
52
52
  */
53
53
  blockStyle?: unknown
54
+ /**
55
+ * 是否区间模式(双滑块)
56
+ * @default false
57
+ */
58
+ isRange?: boolean
59
+ /**
60
+ * 区间模式下的取值,支持 v-model:rangeValue 双向绑定
61
+ * @default [0, 0]
62
+ */
63
+ rangeValue?: (string | number)[]
64
+ /**
65
+ * 区间模式下更新 v-model:rangeValue
66
+ * @param value 当前区间值
67
+ */
68
+ "onUpdate:rangeValue"?: (value: (string | number)[]) => any
54
69
  /**
55
70
  * 更新v-model的
56
71
  * @param value 当前值
package/types/comps.d.ts CHANGED
@@ -1,104 +1,121 @@
1
- declare module 'vue' {
2
- export interface GlobalComponents {
3
- // 基础组件
4
- ['up-icon']: typeof import('./comps/icon')['Icon']
5
- ['up-image']: typeof import('./comps/image')['Image']
6
- ['up-button']: typeof import('./comps/button')['Button']
7
- ['up-text']: typeof import('./comps/text')['Text']
8
- ['up-row']: typeof import('./comps/row')['Row']
9
- ['up-col']: typeof import('./comps/col')['Col']
10
- ['up-cell']: typeof import('./comps/cell')['Cell']
11
- ['up-cell-group']: typeof import('./comps/cellGroup')['CellGroup']
12
- ['up-badge']: typeof import('./comps/badge')['Badge']
13
- ['up-tag']: typeof import('./comps/tag')['Tag']
14
- ['up-loading-icon']: typeof import('./comps/loadingIcon')['LoadingIcon']
15
- ['up-loading-page']: typeof import('./comps/loadingPage')['LoadingPage']
1
+ /**
2
+ * uview-plus 组件登记表,键统一写 `up-` 前缀。
3
+ * easycom 同时支持 `up-` / `u-` / `u--` 三种前缀(见 pages.json 的 easycom.custom),
4
+ * 另两种前缀由下面的 UviewPlusAliasComponents 从这一份改写而来,无需手工维护三份清单。
5
+ */
6
+ interface UviewPlusComponents {
7
+ // 基础组件
8
+ ['up-icon']: typeof import('./comps/icon')['Icon']
9
+ ['up-image']: typeof import('./comps/image')['Image']
10
+ ['up-button']: typeof import('./comps/button')['Button']
11
+ ['up-text']: typeof import('./comps/text')['Text']
12
+ ['up-row']: typeof import('./comps/row')['Row']
13
+ ['up-col']: typeof import('./comps/col')['Col']
14
+ ['up-cell']: typeof import('./comps/cell')['Cell']
15
+ ['up-cell-group']: typeof import('./comps/cellGroup')['CellGroup']
16
+ ['up-badge']: typeof import('./comps/badge')['Badge']
17
+ ['up-tag']: typeof import('./comps/tag')['Tag']
18
+ ['up-loading-icon']: typeof import('./comps/loadingIcon')['LoadingIcon']
19
+ ['up-loading-page']: typeof import('./comps/loadingPage')['LoadingPage']
20
+
21
+ // 表单组件
22
+ ['up-form']: typeof import('./comps/form')['Form']
23
+ ['up-form-item']: typeof import('./comps/formItem')['FormItem']
24
+ ['up-calendar']: typeof import('./comps/calendar')['Calendar']
25
+ ['up-calendar-strip']: typeof import('./comps/calendarStrip')['CalendarStrip']
26
+ ['up-keyboard']: typeof import('./comps/keyboard')['Keyboard']
27
+ ['up-picker']: typeof import('./comps/picker')['Picker']
28
+ ['up-datetime-picker']: typeof import('./comps/datetimePicker')['DatetimePicker']
29
+ ['up-rate']: typeof import('./comps/rate')['Rate']
30
+ ['up-search']: typeof import('./comps/search')['Search']
31
+ ['up-number-box']: typeof import('./comps/numberBox')['NumberBox']
32
+ ['up-upload']: typeof import('./comps/upload')['Upload']
33
+ ['up-code']: typeof import('./comps/code')['Code']
34
+ ['up-input']: typeof import('./comps/input')['Input']
35
+ ['up-textarea']: typeof import('./comps/textarea')['Textarea']
36
+ ['up-checkbox']: typeof import('./comps/checkbox')['Checkbox']
37
+ ['up-checkbox-group']: typeof import('./comps/checkboxGroup')['CheckboxGroup']
38
+ ['up-radio']: typeof import('./comps/radio')['Radio']
39
+ ['up-radio-group']: typeof import('./comps/radioGroup')['RadioGroup']
40
+ ['up-switch']: typeof import('./comps/switch')['Switch']
41
+ ['up-slider']: typeof import('./comps/slider')['Slider']
42
+ ['up-album']: typeof import('./comps/album')['Album']
43
+
44
+ // 数据组件
45
+ ['up-list']: typeof import('./comps/list')['List']
46
+ ['up-list-item']: typeof import('./comps/listItem')['ListItem']
47
+ ['up-line-progress']: typeof import('./comps/lineProgress')['LineProgress']
48
+ ['up-count-down']: typeof import('./comps/countDown')['CountDown']
49
+ ['up-count-to']: typeof import('./comps/countTo')['CountTo']
16
50
 
17
- // 表单组件
18
- ['up-form']: typeof import('./comps/form')['Form']
19
- ['up-form-item']: typeof import('./comps/formItem')['FormItem']
20
- ['up-calendar']: typeof import('./comps/calendar')['Calendar']
21
- ['up-calendar-strip']: typeof import('./comps/calendarStrip')['CalendarStrip']
22
- ['up-keyboard']: typeof import('./comps/keyboard')['Keyboard']
23
- ['up-picker']: typeof import('./comps/picker')['Picker']
24
- ['up-datetime-picker']: typeof import('./comps/datetimePicker')['DatetimePicker']
25
- ['up-rate']: typeof import('./comps/rate')['Rate']
26
- ['up-search']: typeof import('./comps/search')['Search']
27
- ['up-number-box']: typeof import('./comps/numberBox')['NumberBox']
28
- ['up-upload']: typeof import('./comps/upload')['Upload']
29
- ['up-code']: typeof import('./comps/code')['Code']
30
- ['up-input']: typeof import('./comps/input')['Input']
31
- ['up-textarea']: typeof import('./comps/textarea')['Textarea']
32
- ['up-checkbox']: typeof import('./comps/checkbox')['Checkbox']
33
- ['up-checkbox-group']: typeof import('./comps/checkboxGroup')['CheckboxGroup']
34
- ['up-radio']: typeof import('./comps/radio')['Radio']
35
- ['up-radio-group']: typeof import('./comps/radioGroup')['RadioGroup']
36
- ['up-switch']: typeof import('./comps/switch')['Switch']
37
- ['up-slider']: typeof import('./comps/slider')['Slider']
38
- ['up-album']: typeof import('./comps/album')['Album']
51
+ // 反馈组件
52
+ ['up-tooltip']: typeof import('./comps/tooltip')['Tooltip']
53
+ ['up-guide']: typeof import('./comps/guide')['Guide']
54
+ ['up-action-sheet']: typeof import('./comps/actionSheet')['ActionSheet']
55
+ ['up-alert']: typeof import('./comps/alert')['Alert']
56
+ ['up-toast']: typeof import('./comps/toast')['Toast']
57
+ ['up-notice-bar']: typeof import('./comps/noticeBar')['NoticeBar']
58
+ ['up-notify']: typeof import('./comps/notify')['Notify']
59
+ ['up-swipe-action']: typeof import('./comps/swipeAction')['SwipeAction']
60
+ ['up-swipe-action-item']: typeof import('./comps/swipeActionItem')['SwipeActionItem']
61
+ ['up-collapse']: typeof import('./comps/collapse')['Collapse']
62
+ ['up-collapse-item']: typeof import('./comps/collapseItem')['CollapseItem']
63
+ ['up-popup']: typeof import('./comps/popup')['Popup']
64
+ ['up-modal']: typeof import('./comps/modal')['Modal']
39
65
 
40
- // 数据组件
41
- ['up-list']: typeof import('./comps/list')['List']
42
- ['up-list-item']: typeof import('./comps/listItem')['ListItem']
43
- ['up-line-progress']: typeof import('./comps/lineProgress')['LineProgress']
44
- ['up-count-down']: typeof import('./comps/countDown')['CountDown']
45
- ['up-count-to']: typeof import('./comps/countTo')['CountTo']
66
+ // 布局组件
67
+ ['up-scroll-list']: typeof import('./comps/scrollList')['ScrollList']
68
+ ['up-line']: typeof import('./comps/line')['Line']
69
+ ['up-overlay']: typeof import('./comps/overlay')['Overlay']
70
+ ['up-no-network']: typeof import('./comps/noNetwork')['NoNetwork']
71
+ ['up-grid']: typeof import('./comps/grid')['Grid']
72
+ ['up-grid-item']: typeof import('./comps/gridItem')['GridItem']
73
+ ['up-swiper']: typeof import('./comps/swiper')['Swiper']
74
+ ['up-skeleton']: typeof import('./comps/skeleton')['Skeleton']
75
+ ['up-sticky']: typeof import('./comps/sticky')['Sticky']
76
+ ['up-divider']: typeof import('./comps/divider')['Divider']
46
77
 
47
- // 反馈组件
48
- ['up-tooltip']: typeof import('./comps/tooltip')['Tooltip']
49
- ['up-guide']: typeof import('./comps/guide')['Guide']
50
- ['up-action-sheet']: typeof import('./comps/actionSheet')['ActionSheet']
51
- ['up-alert']: typeof import('./comps/alert')['Alert']
52
- ['up-toast']: typeof import('./comps/toast')['Toast']
53
- ['up-notice-bar']: typeof import('./comps/noticeBar')['NoticeBar']
54
- ['up-notify']: typeof import('./comps/notify')['Notify']
55
- ['up-swipe-action']: typeof import('./comps/swipeAction')['SwipeAction']
56
- ['up-swipe-action-item']: typeof import('./comps/swipeActionItem')['SwipeActionItem']
57
- ['up-collapse']: typeof import('./comps/collapse')['Collapse']
58
- ['up-collapse-item']: typeof import('./comps/collapseItem')['CollapseItem']
59
- ['up-popup']: typeof import('./comps/popup')['Popup']
60
- ['up-modal']: typeof import('./comps/modal')['Modal']
78
+ // 导航组件
79
+ ['up-tabbar']: typeof import('./comps/tabbar')['Tabbar']
80
+ ['up-tabbar-item']: typeof import('./comps/tabbarItem')['TabbarItem']
81
+ ['up-back-top']: typeof import('./comps/backTop')['BackTop']
82
+ ['up-navbar']: typeof import('./comps/navbar')['Navbar']
83
+ ['up-tabs']: typeof import('./comps/tabs')['Tabs']
84
+ ['up-subsection']: typeof import('./comps/subsection')['Subsection']
85
+ ['up-index-list']: typeof import('./comps/indexList')['IndexList']
86
+ ['up-index-item']: typeof import('./comps/indexItem')['IndexItem']
87
+ ['up-index-anchor']: typeof import('./comps/indexAnchor')['IndexAnchor']
88
+ ['up-steps']: typeof import('./comps/steps')['Steps']
89
+ ['up-steps-item']: typeof import('./comps/stepsItem')['StepsItem']
90
+ ['up-empty']: typeof import('./comps/empty')['Empty']
61
91
 
62
- // 布局组件
63
- ['up-scroll-list']: typeof import('./comps/scrollList')['ScrollList']
64
- ['up-line']: typeof import('./comps/line')['Line']
65
- ['up-overlay']: typeof import('./comps/overlay')['Overlay']
66
- ['up-no-network']: typeof import('./comps/noNetwork')['NoNetwork']
67
- ['up-grid']: typeof import('./comps/grid')['Grid']
68
- ['up-grid-item']: typeof import('./comps/gridItem')['GridItem']
69
- ['up-swiper']: typeof import('./comps/swiper')['Swiper']
70
- ['up-skeleton']: typeof import('./comps/skeleton')['Skeleton']
71
- ['up-sticky']: typeof import('./comps/sticky')['Sticky']
72
- ['up-divider']: typeof import('./comps/divider')['Divider']
92
+ // 其他组件
93
+ ['up-parse']: typeof import('./comps/parse')['Parse']
94
+ ['up-code-input']: typeof import('./comps/codeInput')['CodeInput']
95
+ ['up-loadmore']: typeof import('./comps/loadMore')['LoadMore']
96
+ ['up-read-more']: typeof import('./comps/readMore')['ReadMore']
97
+ ['up-gap']: typeof import('./comps/gap')['Gap']
98
+ ['up-avatar']: typeof import('./comps/avatar')['Avatar']
99
+ ['up-avatar-group']: typeof import('./comps/avatarGroup')['AvatarGroup']
100
+ ['up-link']: typeof import('./comps/link')['Link']
101
+ ['up-transition']: typeof import('./comps/transition')['Transition']
102
+ ['up-status-bar']: typeof import('./comps/statusBar')['StatusBar']
103
+ ['up-safe-bottom']: typeof import('./comps/safeBottom')['SafeBottom']
104
+ ['up-qrcode']: typeof import('./comps/qrcode')['Qrcode']
105
+ }
73
106
 
74
- // 导航组件
75
- ['up-tabbar']: typeof import('./comps/tabbar')['Tabbar']
76
- ['up-tabbar-item']: typeof import('./comps/tabbarItem')['TabbarItem']
77
- ['up-back-top']: typeof import('./comps/backTop')['BackTop']
78
- ['up-navbar']: typeof import('./comps/navbar')['Navbar']
79
- ['up-tabs']: typeof import('./comps/tabs')['Tabs']
80
- ['up-subsection']: typeof import('./comps/subsection')['Subsection']
81
- ['up-index-list']: typeof import('./comps/indexList')['IndexList']
82
- ['up-index-item']: typeof import('./comps/indexItem')['IndexItem']
83
- ['up-index-anchor']: typeof import('./comps/indexAnchor')['IndexAnchor']
84
- ['up-steps']: typeof import('./comps/steps')['Steps']
85
- ['up-steps-item']: typeof import('./comps/stepsItem')['StepsItem']
86
- ['up-empty']: typeof import('./comps/empty')['Empty']
107
+ /** 把 `up-xxx` 键改写成 `${P}xxx` 键 */
108
+ type UviewPlusAliasComponents<P extends string> = {
109
+ [K in keyof UviewPlusComponents & string as K extends `up-${infer Name}`
110
+ ? `${P}${Name}`
111
+ : never]: UviewPlusComponents[K]
112
+ }
87
113
 
88
- // 其他组件
89
- ['up-parse']: typeof import('./comps/parse')['Parse']
90
- ['up-code-input']: typeof import('./comps/codeInput')['CodeInput']
91
- ['up-loadmore']: typeof import('./comps/loadMore')['LoadMore']
92
- ['up-read-more']: typeof import('./comps/readMore')['ReadMore']
93
- ['up-gap']: typeof import('./comps/gap')['Gap']
94
- ['up-avatar']: typeof import('./comps/avatar')['Avatar']
95
- ['up-avatar-group']: typeof import('./comps/avatarGroup')['AvatarGroup']
96
- ['up-link']: typeof import('./comps/link')['Link']
97
- ['up-transition']: typeof import('./comps/transition')['Transition']
98
- ['up-status-bar']: typeof import('./comps/statusBar')['StatusBar']
99
- ['up-safe-bottom']: typeof import('./comps/safeBottom')['SafeBottom']
100
- ['up-qrcode']: typeof import('./comps/qrcode')['Qrcode']
101
- }
114
+ declare module 'vue' {
115
+ export interface GlobalComponents
116
+ extends UviewPlusComponents,
117
+ UviewPlusAliasComponents<'u-'>,
118
+ UviewPlusAliasComponents<'u--'> {}
102
119
  }
103
120
 
104
121
  export {}