@zfqh/uview-x 0.0.7 → 0.0.8

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
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.0.8](http://10.10.10.16/caoben/front-end-tools/compare/@zfqh/uview-x@0.0.7...@zfqh/uview-x@0.0.8) (2026-11-11)
7
+
8
+ **Note:** Version bump only for package @zfqh/uview-x
9
+
10
+
11
+
12
+
13
+
6
14
  ## [0.0.7](http://10.10.10.16/caoben/front-end-tools/compare/@zfqh/uview-x@0.0.6...@zfqh/uview-x@0.0.7) (2026-11-11)
7
15
 
8
16
  **Note:** Version bump only for package @zfqh/uview-x
@@ -71,8 +71,8 @@
71
71
  // top和right分为为offset的第一个和第二个值,如果没有第二个值,则right等于top
72
72
  const top = p.offset[0]
73
73
  const right = p.offset[1] || top
74
- style.top = addUnit(top)
75
- style.right = addUnit(right)
74
+ style.top = addUnit(top as number)
75
+ style.right = addUnit(right as number)
76
76
  }
77
77
  }
78
78
  return style
@@ -333,7 +333,7 @@
333
333
  }
334
334
  }
335
335
 
336
- const emitDetail = (name: string, event: any) => {
336
+ const emitDetail = (name: any, event: any) => {
337
337
  emit(name, event?.detail)
338
338
  }
339
339
 
@@ -94,8 +94,8 @@
94
94
 
95
95
  <script setup lang="ts">
96
96
  import { computed, nextTick, onMounted, ref, watch } from 'vue'
97
- import { addStyle, addUnit, sys } from '../../utils/function'
98
- import { deepMerge } from '../../utils/merge'
97
+ import { addStyle, addUnit, sys } from '../../utils/function'
98
+ import { deepMerge } from '../../utils/merge'
99
99
  import props from './props'
100
100
  import UvPopup from '../uv-popup/uv-popup.vue'
101
101
  import UvButton from '../uv-button/uv-button.vue'
@@ -187,8 +187,6 @@
187
187
  const showCancelBtn = computed(() => Boolean(cfg.value.showCancelButton))
188
188
  const showConfirmBtn = computed(() => Boolean(cfg.value.showConfirmButton))
189
189
 
190
- const addUnit = (value: string | number) => addUnit(value)
191
-
192
190
  const titleAlignValue = computed(() => {
193
191
  const map: Record<string, string> = {
194
192
  left: 'flex-start',
@@ -13,7 +13,7 @@ import props from './props';
13
13
  import { useI18n } from '../../hooks';
14
14
  import { buildFormValidationMessages } from '../../utils/locale';
15
15
 
16
- import Schema from './valid.ts';
16
+ import Schema from './validator';
17
17
 
18
18
  // 去除警告信息
19
19
  Schema.warning = function () {};
@@ -54,7 +54,7 @@
54
54
 
55
55
  // 控制范围在0-100之间
56
56
  const innserPercentage = computed(() => {
57
- return range(0, 100, p.percentage)
57
+ return range(0, 100, p.percentage as number)
58
58
  })
59
59
 
60
60
  const percentageText = computed(() => `${innserPercentage.value}%`)
@@ -59,7 +59,6 @@
59
59
  import { computed, onMounted, onUnmounted, ref } from 'vue'
60
60
  import { addStyle, addUnit, error, getPx } from '../../utils/function'
61
61
  import { deepMerge } from '../../utils/merge'
62
- import { platform } from '../../utils/platform'
63
62
  import props from './props'
64
63
  import UvIcon from '../uv-icon/uv-icon.vue'
65
64
  import UvOverlay from '../uv-overlay/uv-overlay.vue'
@@ -123,7 +122,7 @@
123
122
  let closeTimer: any = null
124
123
 
125
124
  const bg = computed(() => {
126
- if (p.bgColor === '' || p.bgColor === 'none' || getPx(p.round) > 0) {
125
+ if (p.bgColor === '' || p.bgColor === 'none' || Number.parseFloat(String(p.round)) > 0) {
127
126
  return 'transparent'
128
127
  }
129
128
  return p.bgColor
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zfqh/uview-x",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "uview-x:面向 uni-app x 蒸汽模式(Vapor)、经典 uni-app Vue3 与 nvue 的 UV UI 组件库,组件保持 uv-ui API。",
5
5
  "main": "index.ts",
6
6
  "types": "types/index.d.ts",
@@ -39,5 +39,5 @@
39
39
  "README.md",
40
40
  "CHANGELOG.md"
41
41
  ],
42
- "gitHead": "59595760375b8c8c71d6abe4e860d4ba8ca915a1"
42
+ "gitHead": "509c3ca2fb6892340866e50b172a1ea918c86319"
43
43
  }
package/utils/config.ts CHANGED
@@ -106,7 +106,7 @@ const color: UViewColor = {
106
106
  // #ifndef APP-NVUE
107
107
  Object.assign(color, vars);
108
108
  // #endif
109
-
109
+ console.log(vars)
110
110
  const config: UViewConfig = {
111
111
  type: ['primary', 'success', 'info', 'error', 'warning'],
112
112
  color,
package/utils/function.ts CHANGED
@@ -190,15 +190,22 @@ export function $parent(this: any, name?: string): any | false {
190
190
  * 对象转字符串,或者字符串转对象
191
191
  * @param {object | string} customStyle 需要转换的目标
192
192
  * @param {String} target 转换的目的,object-转为对象,string-转为字符串
193
- * @returns {object|string}
193
+ * @returns {object|string} target 为 object 时返回对象,为 string 时返回字符串
194
194
  */
195
+ export function addStyle(customStyle: string | Record<string, any>, target: 'string'): string;
196
+ export function addStyle(customStyle: string | Record<string, any>, target?: 'object'): Record<string, any>;
197
+ export function addStyle(
198
+ customStyle: string | Record<string, any>,
199
+ target: 'object' | 'string',
200
+ ): Record<string, any> | string;
195
201
  export function addStyle(
196
202
  customStyle: string | Record<string, any>,
197
203
  target: 'object' | 'string' = 'object',
198
204
  ): Record<string, any> | string {
205
+ // 空值按目标类型归一,保证 target=object 时始终返回对象、target=string 时始终返回字符串
206
+ if (empty(customStyle)) return target === 'string' ? '' : {};
199
207
  // 字符串转字符串,对象转对象情形,直接返回
200
208
  if (
201
- empty(customStyle) ||
202
209
  (typeof customStyle === 'object' && target === 'object') ||
203
210
  (target === 'string' && typeof customStyle === 'string')
204
211
  ) {
File without changes