@tplc/wot 1.0.15 → 1.0.16

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
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.0.16](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.7.22...v1.0.16) (2025-12-17)
6
+
7
+
8
+ ### ✨ Features | 新功能
9
+
10
+ * 优化pay ([fdead3a](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/fdead3a80ca5d7de1de0eff9745e35e2c4fca6db))
11
+
5
12
  ### [1.0.15](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.7.18...v1.0.15) (2025-12-16)
6
13
 
7
14
 
@@ -8,7 +8,15 @@
8
8
  * 记得注释
9
9
  */
10
10
  import type { ExtractPropTypes, PropType } from 'vue'
11
- import { baseProps, makeBooleanProp, makeNumberProp, makeNumericProp, makeRequiredProp, makeStringProp, numericProp } from '../common/props'
11
+ import {
12
+ baseProps,
13
+ makeBooleanProp,
14
+ makeNumberProp,
15
+ makeNumericProp,
16
+ makeRequiredProp,
17
+ makeStringProp,
18
+ numericProp,
19
+ } from '../common/props'
12
20
 
13
21
  /**
14
22
  * 输入框值变化前的回调函数类型定义
@@ -104,7 +112,7 @@ export const inputNumberProps = {
104
112
  * number: 数字输入
105
113
  * digit: 整数输入
106
114
  */
107
- inputType: makeStringProp<'number' | 'digit'>('digit')
115
+ inputType: makeStringProp<'number' | 'digit'>('digit'),
108
116
  }
109
117
 
110
118
  export type InputNumberProps = ExtractPropTypes<typeof inputNumberProps>
@@ -1,5 +1,8 @@
1
1
  <template>
2
- <view :class="`wd-input-number ${customClass} ${disabled ? 'is-disabled' : ''} ${withoutInput ? 'is-without-input' : ''}`" :style="customStyle">
2
+ <view
3
+ :class="`wd-input-number ${customClass} ${disabled ? 'is-disabled' : ''} ${withoutInput ? 'is-without-input' : ''}`"
4
+ :style="customStyle"
5
+ >
3
6
  <!-- 减号按钮 -->
4
7
  <view
5
8
  :class="`wd-input-number__action ${minDisabled || disableMinus ? 'is-disabled' : ''}`"
@@ -44,8 +47,8 @@ export default {
44
47
  options: {
45
48
  virtualHost: true,
46
49
  addGlobalClass: true,
47
- styleIsolation: 'shared'
48
- }
50
+ styleIsolation: 'shared',
51
+ },
49
52
  }
50
53
  </script>
51
54
 
@@ -61,7 +64,7 @@ const emit = defineEmits<{
61
64
  /**
62
65
  * 数值变化事件
63
66
  */
64
- (e: 'change', value: { value: number | string }): void
67
+ (e: 'change', value: { value: number | string; mode?: 'add' | 'sub' }): void
65
68
  /**
66
69
  * 输入框聚焦事件
67
70
  */
@@ -99,7 +102,7 @@ watch(
99
102
  () => props.modelValue,
100
103
  (val) => {
101
104
  inputValue.value = formatValue(val)
102
- }
105
+ },
103
106
  )
104
107
 
105
108
  // 监听 max, min, precision 变化时重新格式化当前值
@@ -259,7 +262,7 @@ function formatDisplay(val: string | number): string | number {
259
262
  return props.min
260
263
  }
261
264
 
262
- let num = Number(val)
265
+ const num = Number(val)
263
266
  if (isNaN(num)) {
264
267
  return props.min
265
268
  }
@@ -277,7 +280,13 @@ function formatDisplay(val: string | number): string | number {
277
280
  function isIntermediate(val: string): boolean {
278
281
  if (!val) return false
279
282
  const str = String(val)
280
- return str.endsWith('.') || str.startsWith('.') || str.startsWith('-.') || str === '-' || (Number(props.precision) > 0 && str.indexOf('.') === -1)
283
+ return (
284
+ str.endsWith('.') ||
285
+ str.startsWith('.') ||
286
+ str.startsWith('-.') ||
287
+ str === '-' ||
288
+ (Number(props.precision) > 0 && str.indexOf('.') === -1)
289
+ )
281
290
  }
282
291
 
283
292
  /**
@@ -315,7 +324,7 @@ function cleanInput(val: string): string {
315
324
  /**
316
325
  * 更新值并触发事件
317
326
  */
318
- function updateValue(val: string | number) {
327
+ function updateValue(val: string | number, mode: 'add' | 'sub' = 'add') {
319
328
  // 空值处理
320
329
  if (props.allowNull && (!isDef(val) || val === '')) {
321
330
  if (isEqual('', String(props.modelValue))) {
@@ -326,7 +335,7 @@ function updateValue(val: string | number) {
326
335
  const doUpdate = () => {
327
336
  inputValue.value = ''
328
337
  emit('update:modelValue', '')
329
- emit('change', { value: '' })
338
+ emit('change', { value: '', mode })
330
339
  }
331
340
 
332
341
  callInterceptor(props.beforeChange, { args: [''], done: doUpdate })
@@ -344,7 +353,7 @@ function updateValue(val: string | number) {
344
353
  const doUpdate = () => {
345
354
  inputValue.value = display
346
355
  emit('update:modelValue', num)
347
- emit('change', { value: num })
356
+ emit('change', { value: num, mode })
348
357
  }
349
358
 
350
359
  callInterceptor(props.beforeChange, { args: [num], done: doUpdate })
@@ -368,10 +377,14 @@ function addStep(val: string | number, step: number) {
368
377
  */
369
378
  function handleClick(type: OperationType) {
370
379
  const step = type === 'add' ? props.step : -props.step
371
- if ((step < 0 && (minDisabled.value || props.disableMinus)) || (step > 0 && (maxDisabled.value || props.disablePlus))) return
380
+ if (
381
+ (step < 0 && (minDisabled.value || props.disableMinus)) ||
382
+ (step > 0 && (maxDisabled.value || props.disablePlus))
383
+ )
384
+ return
372
385
 
373
386
  const newVal = addStep(inputValue.value, step)
374
- updateValue(newVal)
387
+ updateValue(newVal, type)
375
388
  }
376
389
 
377
390
  /**
@@ -401,11 +414,12 @@ function handleInput(event: any) {
401
414
  inputValue.value = cleaned
402
415
  return
403
416
  }
404
-
417
+ const mode = cleaned > inputValue.value ? 'add' : 'sub'
405
418
  // 正常输入处理
406
419
  inputValue.value = cleaned
407
420
  if (props.immediateChange) {
408
- updateValue(cleaned)
421
+ // 判断这次修改是增加还是减少
422
+ updateValue(cleaned, mode)
409
423
  }
410
424
  })
411
425
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "@tplc/wot",
3
3
  "name": "@tplc/wot",
4
- "version": "1.0.15",
4
+ "version": "1.0.16",
5
5
  "keywords": [
6
6
  "wot-design-uni",
7
7
  "国际化",
@@ -93,7 +93,7 @@ declare const _default: import('vue').DefineComponent<
93
93
  import('vue').ComponentOptionsMixin,
94
94
  import('vue').ComponentOptionsMixin,
95
95
  {
96
- change: (value: { value: number | string }) => void
96
+ change: (value: { value: number | string; mode?: 'add' | 'sub' }) => void
97
97
  focus: (detail: any) => void
98
98
  blur: (value: { value: string | number }) => void
99
99
  'update:modelValue': (value: string | number) => void
@@ -191,7 +191,7 @@ declare const _default: import('vue').DefineComponent<
191
191
  > & {
192
192
  onFocus?: ((detail: any) => any) | undefined
193
193
  onBlur?: ((value: { value: string | number }) => any) | undefined
194
- onChange?: ((value: { value: number | string }) => any) | undefined
194
+ onChange?: ((value: { value: number | string; mode?: 'add' | 'sub' }) => any) | undefined
195
195
  'onUpdate:modelValue'?: ((value: string | number) => any) | undefined
196
196
  },
197
197
  {