stellar-ui-plus 1.22.201 → 1.23.0

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.
Files changed (77) hide show
  1. package/common/auto-debug/setupGlobalDebug.ts +18 -5
  2. package/common/auto-debug/useStellarDebug.ts +26 -32
  3. package/common/auto-debug/vite-plugin-auto-debug.js +66 -68
  4. package/components/ste-app-update/ATTRIBUTES.md +8 -0
  5. package/components/ste-app-update/README.md +2 -0
  6. package/components/ste-app-update/method.ts +10 -9
  7. package/components/ste-app-update/props.ts +10 -0
  8. package/components/ste-app-update/ste-app-update.easycom.json +27 -0
  9. package/components/ste-app-update/ste-app-update.vue +168 -160
  10. package/components/ste-barcode/encode.ts +16 -16
  11. package/components/ste-button/ste-button.vue +2 -3
  12. package/components/ste-calendar/ATTRIBUTES.md +1 -0
  13. package/components/ste-calendar/props.ts +28 -27
  14. package/components/ste-calendar/ste-calendar.easycom.json +8 -1
  15. package/components/ste-calendar/ste-calendar.vue +9 -2
  16. package/components/ste-checkbox/README.md +2 -0
  17. package/components/ste-checkbox/ste-checkbox.vue +128 -122
  18. package/components/ste-checkbox-group/ste-checkbox-group.vue +18 -5
  19. package/components/ste-comment/ATTRIBUTES.md +8 -0
  20. package/components/ste-comment/README.md +61 -0
  21. package/components/ste-comment/config.json +5 -0
  22. package/components/ste-comment/props.ts +28 -0
  23. package/components/ste-comment/ste-comment.easycom.json +26 -0
  24. package/components/ste-comment/ste-comment.vue +168 -0
  25. package/components/ste-filter-tool/ATTRIBUTES.md +7 -5
  26. package/components/ste-filter-tool/README.md +25 -0
  27. package/components/ste-filter-tool/scrollUtil.ts +4 -4
  28. package/components/ste-filter-tool/ste-filter-tool.easycom.json +29 -12
  29. package/components/ste-filter-tool/ste-filter-tool.scss +8 -6
  30. package/components/ste-filter-tool/ste-filter-tool.vue +27 -2
  31. package/components/ste-filter-tool/type.d.ts +17 -3
  32. package/components/ste-filter-tool/useData.ts +9 -4
  33. package/components/ste-guide-qa/ATTRIBUTES.md +15 -0
  34. package/components/ste-guide-qa/README.md +123 -0
  35. package/components/ste-guide-qa/config.json +5 -0
  36. package/components/ste-guide-qa/props.ts +22 -0
  37. package/components/ste-guide-qa/ste-guide-qa.easycom.json +58 -0
  38. package/components/ste-guide-qa/ste-guide-qa.vue +170 -0
  39. package/components/ste-input/README.md +40 -7
  40. package/components/ste-input/ste-input.scss +2 -1
  41. package/components/ste-input/ste-input.vue +2 -0
  42. package/components/ste-login/components/loginFormItem.vue +9 -2
  43. package/components/ste-login/ste-login.vue +12 -4
  44. package/components/ste-login-info/props.ts +4 -0
  45. package/components/ste-login-info/ste-login-info.vue +3 -5
  46. package/components/ste-notice-bar/ste-notice-bar.vue +1 -0
  47. package/components/ste-qrcode/uqrcode.js +33 -33
  48. package/components/ste-radio/README.md +2 -56
  49. package/components/ste-radio/ste-radio.vue +66 -60
  50. package/components/ste-step/ste-step.scss +18 -1
  51. package/components/ste-step/ste-step.vue +14 -14
  52. package/components/ste-stepper/ATTRIBUTES.md +1 -1
  53. package/components/ste-stepper/props.ts +2 -2
  54. package/components/ste-stepper/ste-stepper.easycom.json +8 -0
  55. package/components/ste-stepper/ste-stepper.vue +40 -4
  56. package/components/ste-steps/ATTRIBUTES.md +2 -0
  57. package/components/ste-steps/props.ts +13 -11
  58. package/components/ste-steps/ste-steps.easycom.json +14 -0
  59. package/components/ste-steps/ste-steps.vue +7 -1
  60. package/components/ste-swiper/ATTRIBUTES.md +1 -0
  61. package/components/ste-swiper/README.md +73 -6
  62. package/components/ste-swiper/props.ts +2 -0
  63. package/components/ste-swiper/ste-swiper.easycom.json +7 -0
  64. package/components/ste-swiper/ste-swiper.vue +3 -3
  65. package/components/ste-swiper/useData.ts +458 -360
  66. package/components/ste-swiper-item/ste-swiper-item.vue +20 -2
  67. package/components/ste-tabs/README.md +4 -3
  68. package/components/ste-tabs/ste-tabs.vue +20 -5
  69. package/index.ts +4 -2
  70. package/package.json +1 -1
  71. package/static/app_update_img.png +0 -0
  72. package/types/components.d.ts +4 -2
  73. package/types/refComponents.d.ts +4 -2
  74. package/utils/utils.ts +19 -11
  75. package/components/ste-donut-chart/ATTRIBUTES.md +0 -33
  76. package/static/app_update_close.png +0 -0
  77. package/static/bg_top.png +0 -0
@@ -1,11 +1,12 @@
1
1
  import { unref } from 'vue';
2
2
  export function initDebugTool() {
3
- // #ifdef MP-WEIXIN
4
3
  if (process.env.NODE_ENV === 'development') {
5
4
  const stellarDebugRegistry = new Map<string, Record<string, any>>();
6
5
  (globalThis as any).stellarDebugRegistry = stellarDebugRegistry;
7
6
 
8
- const showDebugInfo = () => {
7
+ const execFunName = '$vs';
8
+
9
+ const printInfo = () => {
9
10
  const pages = getCurrentPages();
10
11
  if (!pages.length) {
11
12
  console.warn('[StellarUI Debug] 未找到当前页面。');
@@ -29,10 +30,22 @@ export function initDebugTool() {
29
30
 
30
31
  console.log(`%c[StellarUI Debug] 当前页面: ${route}`, 'color: #409EFF; font-weight: bold;');
31
32
  console.table(output);
33
+ return '';
32
34
  };
33
35
 
34
- (wx as any).showDebugInfo = showDebugInfo;
35
- console.log('%c[StellarUI Debug] 调试工具已挂载。在控制台输入 `wx.showDebugInfo()` 查看当前页面变量。', 'color: #409EFF; font-weight: bold;');
36
+ // #ifdef MP-WEIXIN
37
+ (wx as any)[execFunName] = printInfo;
38
+ console.log(`%c[StellarUI Debug] 调试工具已挂载。在控制台输入 ${`wx.${execFunName}()`} 查看当前页面变量。`, 'color: #409EFF; font-weight: bold;');
39
+ // #endif
40
+
41
+ // #ifdef MP-ALIPAY
42
+ (my as any)[execFunName] = printInfo;
43
+ console.log(`%c[StellarUI Debug] 调试工具已挂载。在控制台输入 ${`my.${execFunName}()`} 查看当前页面变量。`, 'color: #409EFF; font-weight: bold;');
44
+ // #endif
45
+
46
+ // #ifdef WEB || H5
47
+ (window as any)[execFunName] = printInfo;
48
+ console.log(`%c[StellarUI Debug] 调试工具已挂载。在控制台输入 ${`${execFunName}()`} 查看当前页面变量。`, 'color: #409EFF; font-weight: bold;');
49
+ // #endif
36
50
  }
37
- // #endif
38
51
  }
@@ -1,32 +1,26 @@
1
- import { onShow } from '@dcloudio/uni-app'
2
-
3
- /**
4
- * 手动注册需要调试的变量。
5
- * 在需要调试的页面的 <script setup> 中调用此函数。
6
- *
7
- * @example
8
- * import { useStellarDebug } from '@/composables/useStellarDebug';
9
- * const myVar = ref(0);
10
- * const myReactive = reactive({ a: 1 });
11
- * useStellarDebug({ myVar, myReactive });
12
- *
13
- * @param data 包含需要调试的变量的对象。
14
- */
15
- export function useStellarDebug(data: Record<string, any>) {
16
- if (process.env.NODE_ENV !== 'development') {
17
- return
18
- }
19
-
20
- onShow(() => {
21
- const pages = getCurrentPages()
22
- if (!pages.length) return
23
-
24
- const currentPage = pages[pages.length - 1]
25
- const route = currentPage.route
26
-
27
- if (route && (globalThis as any).stellarDebugRegistry) {
28
- (globalThis as any).stellarDebugRegistry.set(route, data)
29
- console.log(`%c[StellarUI Debug] 成功为页面 ${route} 手动注册调试变量。`, 'color: #67C23A;')
30
- }
31
- })
32
- }
1
+ import { onLoad } from '@dcloudio/uni-app';
2
+
3
+ /**
4
+ * 手动注册需要调试的变量。
5
+ * 在需要调试的页面的 <script setup> 中调用此函数。
6
+ *
7
+ * @param data 包含需要调试的变量的对象。
8
+ */
9
+ export function useStellarDebug(data: Record<string, any>) {
10
+ onLoad(() => {
11
+ if (process.env.NODE_ENV !== 'development') {
12
+ return;
13
+ }
14
+
15
+ const pages = getCurrentPages();
16
+ if (!pages.length) return;
17
+
18
+ const currentPage = pages[pages.length - 1];
19
+ const route = currentPage.route;
20
+
21
+ if (route && (globalThis as any).stellarDebugRegistry) {
22
+ (globalThis as any).stellarDebugRegistry.set(route, data);
23
+ console.log(`%c[StellarUI Debug] 成功为页面 ${route} 手动注册调试变量。`, 'color: #67C23A;');
24
+ }
25
+ });
26
+ }
@@ -1,68 +1,66 @@
1
- import { parse, compileScript } from '@vue/compiler-sfc';
2
-
3
- export default function autoDebugPlugin() {
4
- return {
5
- name: 'vite-plugin-auto-debug',
6
- enforce: 'pre', // <-- 移除 'as const'
7
- transform(code, id) {
8
- const isPage = id.endsWith('.vue') && (id.includes('/src/pages/') || id.includes('/src/subPackages'));
9
- if (!isPage) return null;
10
-
11
- const { descriptor } = parse(code);
12
-
13
- if (!descriptor.scriptSetup) {
14
- return null;
15
- }
16
-
17
- let scriptContent = descriptor.scriptSetup.content;
18
- let scriptLang = descriptor.scriptSetup.lang || 'js';
19
-
20
- const { bindings } = compileScript(descriptor, { id });
21
-
22
- if (!bindings) {
23
- return null;
24
- }
25
-
26
- const debugVars = Object.keys(bindings).filter(key => ['setup-ref', 'setup-reactive-const', 'setup-computed', 'setup-shallow-ref'].includes(bindings[key]));
27
-
28
- if (debugVars.length === 0) {
29
- return null;
30
- }
31
-
32
- const injectionCall = `
33
- import { useStellarDebug } from 'stellar-ui-plus/common/auto-debug/useStellarDebug';
34
- import { onShow } from '@dcloudio/uni-app';
35
- onShow(() => {
36
- useStellarDebug({ ${debugVars.join(', ')} });
37
- });
38
- `;
39
-
40
- let newScriptContent = scriptContent + injectionCall;
41
-
42
- let newCode = '';
43
-
44
- if (descriptor.template) {
45
- const attrs = Object.keys(descriptor.template.attrs)
46
- .map(key => `${key}="${key === 'lang' ? descriptor.template.attrs[key] : descriptor.template.attrs[key]}"`)
47
- .join(' ');
48
- newCode += `<template ${attrs ? ` ${attrs}` : ''}>\n${descriptor.template.content}\n</template>\n`;
49
- }
50
-
51
- newCode += `<script setup${scriptLang ? ` lang="${scriptLang}"` : ''}>\n${newScriptContent}\n</script>\n`;
52
-
53
- if (descriptor.styles) {
54
- descriptor.styles.forEach(style => {
55
- const attrs = Object.keys(style.attrs)
56
- .map(key => `${key}="${key === 'lang' ? style.attrs[key] : style.attrs[key]}"`)
57
- .join(' ');
58
- newCode += `<style${attrs ? ` ${attrs}` : ''}>\n${style.content}\n</style>\n`;
59
- });
60
- }
61
-
62
- return {
63
- code: newCode,
64
- map: null,
65
- };
66
- },
67
- };
68
- }
1
+ import { parse, compileScript } from '@vue/compiler-sfc';
2
+
3
+ export default function autoDebugPlugin(dirName) {
4
+ return {
5
+ name: 'vite-plugin-auto-debug',
6
+ enforce: 'pre',
7
+ transform(code, id) {
8
+ const isPage = id.endsWith('.vue') && (id.includes('/src/pages/') || id.includes('/src/subPackages') || (dirName && id.includes(dirName)));
9
+
10
+ if (!isPage) return null;
11
+
12
+ const { descriptor } = parse(code);
13
+
14
+ if (!descriptor.scriptSetup) {
15
+ return null;
16
+ }
17
+
18
+ let scriptContent = descriptor.scriptSetup.content;
19
+ let scriptLang = descriptor.scriptSetup.lang || 'js';
20
+
21
+ const { bindings } = compileScript(descriptor, { id });
22
+
23
+ if (!bindings) {
24
+ return null;
25
+ }
26
+
27
+ const debugVars = Object.keys(bindings).filter(key => ['setup-ref', 'setup-reactive-const', 'setup-computed', 'setup-shallow-ref'].includes(bindings[key]));
28
+
29
+ if (debugVars.length === 0) {
30
+ return null;
31
+ }
32
+
33
+ const injectionCall = `
34
+ import { useStellarDebug } from 'stellar-ui-plus/common/auto-debug/useStellarDebug';
35
+ useStellarDebug({ ${debugVars.join(', ')} });
36
+ `;
37
+
38
+ let newScriptContent = scriptContent + injectionCall;
39
+
40
+ let newCode = '';
41
+
42
+ if (descriptor.template) {
43
+ const attrs = Object.keys(descriptor.template.attrs)
44
+ .map(key => `${key}="${key === 'lang' ? descriptor.template.attrs[key] : descriptor.template.attrs[key]}"`)
45
+ .join(' ');
46
+ newCode += `<template ${attrs ? ` ${attrs}` : ''}>\n${descriptor.template.content}\n</template>\n`;
47
+ }
48
+
49
+ newCode += `<script setup${scriptLang ? ` lang="${scriptLang}"` : ''}>\n${newScriptContent}\n</script>\n`;
50
+
51
+ if (descriptor.styles) {
52
+ descriptor.styles.forEach(style => {
53
+ const attrs = Object.keys(style.attrs)
54
+ .map(key => `${key}="${key === 'lang' ? style.attrs[key] : style.attrs[key]}"`)
55
+ .join(' ');
56
+ newCode += `<style${attrs ? ` ${attrs}` : ''}>\n${style.content}\n</style>\n`;
57
+ });
58
+ }
59
+
60
+ return {
61
+ code: newCode,
62
+ map: null,
63
+ };
64
+ },
65
+ };
66
+ }
@@ -4,5 +4,13 @@
4
4
  | `clientId` | 应用编码 | `string` | `` | - | - |
5
5
  | `clientSecret` | 应用密钥 | `string` | `` | - | - |
6
6
  | `apiUrl` | 更新API地址 | `string` | `https://zboa.whzb.com/inte-cloud-dev/blade-system/api/inte/client/ver/currentDetail` | - | - |
7
+ | `appType` | APP环境,版本号的最后一位为环境标识 | `string` | `` | - | - |
8
+ | `btnText` | 立即体验按钮文本 | `string` | `立即体验` | - | - |
7
9
 
8
10
 
11
+ #### Events
12
+ | 事件名 | 说明 | 事件参数 | 支持版本 |
13
+ | ----- | ----- | ------- | -------- |
14
+ | `cancel` | 取消更新 | - | - |
15
+ | `update` | 发现新版时本触发 | - | - |
16
+ | `no-update` | 没有新版时本触发 | - | - |
@@ -9,6 +9,8 @@
9
9
  - 属性`clientId`用于设置APP的应用编码
10
10
  - 属性`clientSecret`用于设置APP的应用密钥
11
11
  - 函数`start`用于开始检查更新
12
+ - 回调事`cancel`取消更新
13
+ - 回调事`complete`取消,成功更新都会执行
12
14
 
13
15
  ```html
14
16
  <script setup lang="ts">
@@ -50,16 +50,21 @@ export interface ClientData {
50
50
 
51
51
  export function download(
52
52
  data: ClientData,
53
- { success, error, onProgressUpdate }: { success?: () => void; error?: (e: any) => void; onProgressUpdate?: (res: UniApp.OnProgressDownloadResult) => void }
53
+ {
54
+ success,
55
+ error,
56
+ onProgressUpdate,
57
+ downloadSuccess,
58
+ }: { success?: () => void; error?: (e: any) => void; downloadSuccess?: (tempFilePath: string) => void; onProgressUpdate?: (res: UniApp.OnProgressDownloadResult) => void }
54
59
  ) {
55
60
  const package_type = data.package_type;
56
61
  const downloadTask = uni.downloadFile({
57
62
  url: data.updateFile,
58
63
  success: res => {
59
64
  if (res.statusCode === 200) {
65
+ downloadSuccess && downloadSuccess(res.tempFilePath);
60
66
  plus.runtime.install(
61
67
  res.tempFilePath,
62
- //true表示强制安装,不进行版本号的校验;false则需要版本号校验,
63
68
  { force: true },
64
69
  () => {
65
70
  // wgt升级
@@ -74,11 +79,13 @@ export function download(
74
79
  plus.runtime.restart();
75
80
  },
76
81
  });
82
+ } else {
83
+ // 整包升级
84
+ success && success();
77
85
  }
78
86
  },
79
87
  e => {
80
88
  //提示部分wgt包无法安装的问题
81
- data.isForce = false;
82
89
  uni.showModal({
83
90
  title: '提示',
84
91
  content: e.message,
@@ -89,12 +96,6 @@ export function download(
89
96
  });
90
97
  }
91
98
  );
92
- // 整包升级
93
- if (package_type == 0) {
94
- // 解决安装app点击取消,更新还在的问题
95
- data.isForce = false;
96
- success && success();
97
- }
98
99
  }
99
100
  },
100
101
  });
@@ -14,4 +14,14 @@ export default {
14
14
  type: String,
15
15
  default: () => 'https://zboa.whzb.com/inte-cloud-dev/blade-system/api/inte/client/ver/currentDetail',
16
16
  },
17
+ /** APP环境,版本号的最后一位为环境标识 */
18
+ appType: {
19
+ type: String,
20
+ default: () => '',
21
+ },
22
+ /** 立即体验按钮文本 */
23
+ btnText: {
24
+ type: String,
25
+ default: () => '立即体验',
26
+ },
17
27
  };
@@ -21,6 +21,33 @@
21
21
  "description": "更新API地址",
22
22
  "type": "string",
23
23
  "default": "https://zboa.whzb.com/inte-cloud-dev/blade-system/api/inte/client/ver/currentDetail"
24
+ },
25
+ {
26
+ "name": "appType",
27
+ "description": "APP环境,版本号的最后一位为环境标识",
28
+ "type": "string",
29
+ "default": ""
30
+ },
31
+ {
32
+ "name": "btnText",
33
+ "description": "立即体验按钮文本",
34
+ "type": "string",
35
+ "default": "立即体验"
36
+ },
37
+ {
38
+ "name": "[event]cancel",
39
+ "description": "取消更新",
40
+ "type": "() => void"
41
+ },
42
+ {
43
+ "name": "[event]update",
44
+ "description": "发现新版时本触发",
45
+ "type": "() => void"
46
+ },
47
+ {
48
+ "name": "[event]no-update",
49
+ "description": "没有新版时本触发",
50
+ "type": "() => void"
24
51
  }
25
52
  ]
26
53
  }