uview-pro 0.5.8 → 0.5.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/changelog.md CHANGED
@@ -1,31 +1,45 @@
1
- ## 0.5.8(2026-02-10
2
-
3
- ### 🚀 Chore | 构建/工程依赖/工具
4
-
5
- - **deps:** 更新 uni-app 相关依赖包版本到 4.87,修复更新包后运行到 h5 报错问题 ([b00751b](https://github.com/anyup/uView-Pro/commit/b00751b2643bd582f2d1b9472e245d856352d4ed))
6
-
7
- ### 📝 Documentation | 文档
8
-
9
- - 添加npm下载量统计徽章 ([63971ee](https://github.com/anyup/uView-Pro/commit/63971eead3365d5efe29166b2252e58904c0306c))
1
+ ## 0.5.9(2026-02-26
10
2
 
11
3
  ### 🐛 Bug Fixes | Bug 修复
12
4
 
13
- - **useToast:** 修复使用useToast全局提示会触发多次监听的问题(#130) ([ae56413](https://github.com/anyup/uView-Pro/commit/ae564132604d27c3d92de2f6ece5eaae75980aaa))
14
- - **useModal:** 修复使用useModal全局弹窗会触发多次监听的问题(#130) ([50da10c](https://github.com/anyup/uView-Pro/commit/50da10c7c19d65885244df5c99634775be088824))
15
- - **u-upload:** 修复u-upload组件中删除确认弹窗的“取消”和“确认”按钮国际化问题(#128) ([e48ab1d](https://github.com/anyup/uView-Pro/commit/e48ab1d23f50c850b1fd85c9b48860bd1d5105b0))
5
+ - **calendar:** minDate / maxDate 纳入校验年月范围 ([249c04f](https://github.com/anyup/uView-Pro/commit/249c04f11e8610df4964f2d24d5fbe580e9236f8))
16
6
 
17
7
  ### ✨ Features | 新功能
18
8
 
19
- - **useToast:** 支持使用useToast页面级弹出时,toast可指定页面ID(#130) ([7d09ffe](https://github.com/anyup/uView-Pro/commit/7d09ffe5f8bbee5a3872dfc716dc7ba013f7e1bc))
20
- - **useModal:** 支持使用useModal页面级弹出时,modal可指定页面ID(#130) ([63af409](https://github.com/anyup/uView-Pro/commit/63af409370f775bac7ceabe98db8b5225491baa8))
21
- - **u-button:** 添加按钮文本属性支持 ([72fda47](https://github.com/anyup/uView-Pro/commit/72fda47673f1b099f12dcd88ca20570d20d3d5bc))
22
- - **router:** 添加路由跳转hooks功能 ([cb5a687](https://github.com/anyup/uView-Pro/commit/cb5a687bd7ec8c863d237f69b5cb486e86016398))
23
- - **demo:** 添加useModal和useToast示例页面 ([f42ca51](https://github.com/anyup/uView-Pro/commit/f42ca51839b1ebd3f02106da0310f4bbbfbb96cf))
9
+ - **calendar:** 日历选择演示页面新增最小/最大日期切换功能 ([dc8aeae](https://github.com/anyup/uView-Pro/commit/dc8aeae5072774d3d1be1318e4f7b4567c9b0385))
24
10
 
25
11
  ### 👥 Contributors
26
12
 
27
- <a href="https://github.com/anyup"><img src="https://github.com/anyup.png?size=40" width="40" height="40" alt="anyup" title="anyup"/></a>
13
+ <a href="https://github.com/zakicheung"><img src="https://github.com/zakicheung.png?size=40" width="40" height="40" alt="张淇" title="张淇"/></a> <a href="https://github.com/anyup"><img src="https://github.com/anyup.png?size=40" width="40" height="40" alt="anyup" title="anyup"/></a>
28
14
 
15
+ ## 0.5.8(2026-02-10)
16
+
17
+ ### 🚀 Chore | 构建/工程依赖/工具
18
+
19
+ - **deps:** 更新 uni-app 相关依赖包版本到 4.87,修复更新包后运行到 h5 报错问题 ([b00751b](https://github.com/anyup/uView-Pro/commit/b00751b2643bd582f2d1b9472e245d856352d4ed))
20
+
21
+ ### 📝 Documentation | 文档
22
+
23
+ - 添加npm下载量统计徽章 ([63971ee](https://github.com/anyup/uView-Pro/commit/63971eead3365d5efe29166b2252e58904c0306c))
24
+
25
+ ### 🐛 Bug Fixes | Bug 修复
26
+
27
+ - **useToast:** 修复使用useToast全局提示会触发多次监听的问题(#130) ([ae56413](https://github.com/anyup/uView-Pro/commit/ae564132604d27c3d92de2f6ece5eaae75980aaa))
28
+ - **useModal:** 修复使用useModal全局弹窗会触发多次监听的问题(#130) ([50da10c](https://github.com/anyup/uView-Pro/commit/50da10c7c19d65885244df5c99634775be088824))
29
+ - **u-upload:** 修复u-upload组件中删除确认弹窗的“取消”和“确认”按钮国际化问题(#128) ([e48ab1d](https://github.com/anyup/uView-Pro/commit/e48ab1d23f50c850b1fd85c9b48860bd1d5105b0))
30
+
31
+ ### ✨ Features | 新功能
32
+
33
+ - **useToast:** 支持使用useToast页面级弹出时,toast可指定页面ID(#130) ([7d09ffe](https://github.com/anyup/uView-Pro/commit/7d09ffe5f8bbee5a3872dfc716dc7ba013f7e1bc))
34
+ - **useModal:** 支持使用useModal页面级弹出时,modal可指定页面ID(#130) ([63af409](https://github.com/anyup/uView-Pro/commit/63af409370f775bac7ceabe98db8b5225491baa8))
35
+ - **u-button:** 添加按钮文本属性支持 ([72fda47](https://github.com/anyup/uView-Pro/commit/72fda47673f1b099f12dcd88ca20570d20d3d5bc))
36
+ - **router:** 添加路由跳转hooks功能 ([cb5a687](https://github.com/anyup/uView-Pro/commit/cb5a687bd7ec8c863d237f69b5cb486e86016398))
37
+ - **demo:** 添加useModal和useToast示例页面 ([f42ca51](https://github.com/anyup/uView-Pro/commit/f42ca51839b1ebd3f02106da0310f4bbbfbb96cf))
38
+
39
+ ### 👥 Contributors
40
+
41
+ <a href="https://github.com/anyup"><img src="https://github.com/anyup.png?size=40" width="40" height="40" alt="anyup" title="anyup"/></a>
42
+
29
43
  ## 0.5.7(2026-02-06)
30
44
 
31
45
  ### 🐛 Bug Fixes | Bug 修复
@@ -450,15 +450,25 @@ function getWeekday(yearNum: number, monthNum: number) {
450
450
  }
451
451
 
452
452
  /**
453
- * 检查年份是否超出范围
453
+ * 检查年月是否超出范围
454
454
  */
455
- function checkRange(yearNum: number) {
456
- let overstep = false;
455
+ function checkRange(yearNum: number, monthNum: number) {
457
456
  if (yearNum < Number(props.minYear) || yearNum > Number(props.maxYear)) {
458
457
  uni.showToast({ title: t('uCalendar.outOfRange'), icon: 'none' });
459
- overstep = true;
458
+ return true;
460
459
  }
461
- return overstep;
460
+
461
+ const beforeMin =
462
+ min.value && (yearNum < min.value.year || (yearNum === min.value.year && monthNum < min.value.month));
463
+ const afterMax =
464
+ max.value && (yearNum > max.value.year || (yearNum === max.value.year && monthNum > max.value.month));
465
+
466
+ if (beforeMin || afterMax) {
467
+ uni.showToast({ title: t('uCalendar.outOfRange'), icon: 'none' });
468
+ return true;
469
+ }
470
+
471
+ return false;
462
472
  }
463
473
 
464
474
  /**
@@ -468,16 +478,18 @@ function changeMonthHandler(isAdd: number) {
468
478
  if (isAdd) {
469
479
  let m = month.value + 1;
470
480
  let y = m > 12 ? year.value + 1 : year.value;
471
- if (!checkRange(y)) {
472
- month.value = m > 12 ? 1 : m;
481
+ m = m > 12 ? 1 : m;
482
+ if (!checkRange(y, m)) {
483
+ month.value = m;
473
484
  year.value = y;
474
485
  changeData();
475
486
  }
476
487
  } else {
477
488
  let m = month.value - 1;
478
489
  let y = m < 1 ? year.value - 1 : year.value;
479
- if (!checkRange(y)) {
480
- month.value = m < 1 ? 12 : m;
490
+ m = m < 1 ? 12 : m;
491
+ if (!checkRange(y, m)) {
492
+ month.value = m;
481
493
  year.value = y;
482
494
  changeData();
483
495
  }
@@ -485,12 +497,20 @@ function changeMonthHandler(isAdd: number) {
485
497
  }
486
498
 
487
499
  /**
488
- * 切换年份
500
+ * 切换年份:若 minDate/maxDate 的月份在当前年超出,则切换到该年的最小/最大有效月
489
501
  */
490
502
  function changeYearHandler(isAdd: number) {
491
503
  let y = isAdd ? year.value + 1 : year.value - 1;
492
- if (!checkRange(y)) {
504
+ let m = month.value;
505
+ if (min.value && y === min.value.year && m < min.value.month) {
506
+ m = min.value.month;
507
+ }
508
+ if (max.value && y === max.value.year && m > max.value.month) {
509
+ m = max.value.month;
510
+ }
511
+ if (!checkRange(y, m)) {
493
512
  year.value = y;
513
+ month.value = m;
494
514
  changeData();
495
515
  }
496
516
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "id": "uview-pro",
3
3
  "name": "uview-pro",
4
4
  "displayName": "【支持鸿蒙】uView Pro|基于Vue3+TS的高质量UI组件库,支持多主题、暗黑模式、多语言",
5
- "version": "0.5.8",
5
+ "version": "0.5.9",
6
6
  "description": "uView Pro是基于Vue3+TS的多平台UI框架,提供80+高质量组件、便捷工具和常用模板,支持多主题、暗黑模式、多语言,支持H5/APP/鸿蒙/小程序多端开发。已在鸿蒙应用商店上架,欢迎体验!",
7
7
  "main": "index.ts",
8
8
  "module": "index.ts",