uview-pro 0.4.4 → 0.4.5

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,20 +1,38 @@
1
- ## 0.4.4(2025-12-08
1
+ ## 0.4.5(2025-12-10
2
2
 
3
3
  ### ✨ Features | 新功能
4
4
 
5
- - **u-card:** u-card 组件的默认插槽同 body 插槽 ([ffa13ed](https://github.com/anyup/uView-Pro/commit/ffa13edcf17ff1559e8bdf2260f6b146680f9d07))
6
- - **u-tag:** 优化自定义样式 custom-style 应用,支持 text 插槽内容 ([5bdb733](https://github.com/anyup/uView-Pro/commit/5bdb73346252850d74165cda0bb00766e5f6f59f))
7
- - **u-line-progress:** 优化u-line-progress进度条百分比显示方式 ([1c1d979](https://github.com/anyup/uView-Pro/commit/1c1d97958f3c7e5a28943b46ea25d38b50449364))
8
- - **switch:** 增强开关组件支持自定义值类型 ([2bcb136](https://github.com/anyup/uView-Pro/commit/2bcb1368aa1f3c7fe83799e909b89fc4349b30c3))
5
+ - **u-input:** 为选择类型输入框添加覆盖层以增强交互 ([9b7bac2](https://github.com/anyup/uView-Pro/commit/9b7bac221195d010c31b15915d2927d095bd257f))
6
+ - **u-form:** 增强 u-form 深层校验、动态校验表单 ([97d0ccb](https://github.com/anyup/uView-Pro/commit/97d0ccbe03391f63bed81dcfd1af1432f4f7c77d))
9
7
 
10
- ### 📝 Documentation | 文档
8
+ ### 🐛 Bug Fixes | Bug 修复
11
9
 
12
- - 优化 Markdown 文档样式和格式 ([c80ff6d](https://github.com/anyup/uView-Pro/commit/c80ff6df269eb92a88001373aa96344ff4cafb79))
10
+ - **u-input:** 修复清空图标点击事件冒泡问题 ([8a214ff](https://github.com/anyup/uView-Pro/commit/8a214ffe8e5588395cdc456e600bc8dd0f03a603))
11
+ - **style:** 修复除H5环境外主题样式作用域问题 ([c02ba3c](https://github.com/anyup/uView-Pro/commit/c02ba3c1454e709b1fa9de817d77b0f2128b5fc0))
12
+ - **u-switch:** 修复开关组件激活颜色默认值的响应式问题 ([3d78647](https://github.com/anyup/uView-Pro/commit/3d78647d75c3201cced2643395ff5dd935d0e7ec))
13
+ - **form:** 修复 form 校验报错问题 ([8d6d60d](https://github.com/anyup/uView-Pro/commit/8d6d60d4af4e5653f7b87afc3f208d0e26809505))
13
14
 
14
15
  ### 👥 Contributors
15
16
 
16
- <a href="https://github.com/anyup"><img src="https://github.com/anyup.png?size=40" width="40" height="40" alt="anyup" title="anyup"/></a> <a href="https://github.com/liujiayii"><img src="https://github.com/liujiayii.png?size=40" width="40" height="40" alt="liujiayii" title="liujiayii"/></a>
17
+ <a href="https://github.com/anyup"><img src="https://github.com/anyup.png?size=40" width="40" height="40" alt="anyup" title="anyup"/></a> <a href="https://github.com/yoshinosk"><img src="https://github.com/yoshinosk.png?size=40" width="40" height="40" alt="yoshinosk" title="yoshinosk"/></a>
17
18
 
19
+ ## 0.4.4(2025-12-08)
20
+
21
+ ### ✨ Features | 新功能
22
+
23
+ - **u-card:** u-card 组件的默认插槽同 body 插槽 ([ffa13ed](https://github.com/anyup/uView-Pro/commit/ffa13edcf17ff1559e8bdf2260f6b146680f9d07))
24
+ - **u-tag:** 优化自定义样式 custom-style 应用,支持 text 插槽内容 ([5bdb733](https://github.com/anyup/uView-Pro/commit/5bdb73346252850d74165cda0bb00766e5f6f59f))
25
+ - **u-line-progress:** 优化u-line-progress进度条百分比显示方式 ([1c1d979](https://github.com/anyup/uView-Pro/commit/1c1d97958f3c7e5a28943b46ea25d38b50449364))
26
+ - **switch:** 增强开关组件支持自定义值类型 ([2bcb136](https://github.com/anyup/uView-Pro/commit/2bcb1368aa1f3c7fe83799e909b89fc4349b30c3))
27
+
28
+ ### 📝 Documentation | 文档
29
+
30
+ - 优化 Markdown 文档样式和格式 ([c80ff6d](https://github.com/anyup/uView-Pro/commit/c80ff6df269eb92a88001373aa96344ff4cafb79))
31
+
32
+ ### 👥 Contributors
33
+
34
+ <a href="https://github.com/anyup"><img src="https://github.com/anyup.png?size=40" width="40" height="40" alt="anyup" title="anyup"/></a> <a href="https://github.com/liujiayii"><img src="https://github.com/liujiayii.png?size=40" width="40" height="40" alt="liujiayii" title="liujiayii"/></a>
35
+
18
36
  ## 0.4.3(2025-12-03)
19
37
 
20
38
  ### 📝 Documentation | 文档
@@ -249,7 +249,7 @@ function getPropByPath(obj: any, path: string) {
249
249
  function getRules() {
250
250
  // 父组件的所有规则
251
251
  let rules = parentExposed?.value?.rules?.value || {};
252
- rules = rules ? rules[props.prop] : [];
252
+ rules = rules ? rules[props.prop] || getPropByPath(rules,props.prop.replace(/(\.|^)(\d+)\./,'.defaultField.fields.')).v : [];
253
253
  // 保证返回的是一个数组形式
254
254
  return [].concat(rules || []);
255
255
  }
@@ -60,12 +60,14 @@
60
60
  @input="handleInput"
61
61
  @confirm="onConfirm"
62
62
  />
63
+ <view class="u-input__select-overlay" v-if="type === 'select'" @tap.stop="inputClick"></view>
63
64
  <view class="u-input__right-icon u-flex">
64
65
  <view
65
66
  class="u-input__right-icon__clear u-input__right-icon__item"
66
67
  v-if="clearable && modelValue != '' && !disabled"
68
+ @click.stop="onClear"
67
69
  >
68
- <u-icon size="32" name="close-circle-fill" color="var(--u-light-color)" @click="onClear" />
70
+ <u-icon size="32" name="close-circle-fill" color="var(--u-light-color)" />
69
71
  </view>
70
72
  <view
71
73
  class="u-input__right-icon__clear u-input__right-icon__item"
@@ -255,6 +257,12 @@ defineExpose({
255
257
  flex: 1;
256
258
  @include vue-flex;
257
259
 
260
+ &__select-overlay {
261
+ position: absolute;
262
+ inset: 0;
263
+ z-index: 1;
264
+ }
265
+
258
266
  &__input {
259
267
  //height: 70rpx;
260
268
  font-size: 28rpx;
@@ -281,6 +289,7 @@ defineExpose({
281
289
  padding: 1px 4px;
282
290
  border-radius: 10px;
283
291
  line-height: 16px;
292
+ z-index: 2;
284
293
  }
285
294
 
286
295
  &--border {
@@ -293,6 +302,9 @@ defineExpose({
293
302
  }
294
303
 
295
304
  &__right-icon {
305
+ position: relative;
306
+ z-index: 2;
307
+
296
308
  &__item {
297
309
  margin-left: 10rpx;
298
310
  }
@@ -15,7 +15,7 @@ export const SwitchProps = {
15
15
  /** 开关尺寸,单位rpx */
16
16
  size: { type: [Number, String] as PropType<number | string>, default: 50 },
17
17
  /** 打开时的颜色 */
18
- activeColor: { type: String, default: () => getColor('primary') },
18
+ activeColor: { type: String, default: 'var(--u-type-primary)' },
19
19
  /** 关闭时的颜色 */
20
20
  inactiveColor: { type: String, default: 'var(--u-white-color)' },
21
21
  /** v-model 绑定值,开关状态值 */
@@ -1,3 +1,4 @@
1
+ /* #ifdef H5 */
1
2
  :root {
2
3
  color-scheme: light;
3
4
  }
@@ -6,6 +7,7 @@
6
7
  :root[data-u-theme-mode='dark'] {
7
8
  color-scheme: dark;
8
9
  }
10
+ /* #endif */
9
11
 
10
12
  page {
11
13
  color: $u-main-color;
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的80+精选UI组件库,支持多主题,暗黑模式",
5
- "version": "0.4.4",
5
+ "version": "0.4.5",
6
6
  "description": "uView Pro,是全面支持Vue3+TS的uni-app生态框架,80+精选组件,支持安卓,iOS,鸿蒙,各小程序平台,支持多主题,一键暗黑模式",
7
7
  "main": "index.ts",
8
8
  "module": "index.ts",
package/types/global.d.ts CHANGED
@@ -133,6 +133,8 @@ export type FormRuleItem = {
133
133
  type?: string;
134
134
  validator?: (rule: any, value: any, callback: any) => boolean;
135
135
  asyncValidator?: (rule: any, value: any, callback: any) => void;
136
+ fields?: FormRules;
137
+ defaultField?: FormRuleItem;
136
138
  };
137
139
  export type FormRules = Record<string, FormRuleItem | FormRuleItem[]>;
138
140