@tplc/wot 1.0.14 → 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 +14 -0
- package/components/wd-backtop/types.ts +9 -3
- package/components/wd-backtop/wd-backtop.vue +20 -12
- package/components/wd-input-number/types.ts +10 -2
- package/components/wd-input-number/wd-input-number.vue +28 -14
- package/package.json +1 -1
- package/types/components/wd-backtop/types.d.ts +9 -1
- package/types/components/wd-backtop/wd-backtop.vue.d.ts +21 -2
- package/types/components/wd-input-number/wd-input-number.vue.d.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
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
|
+
|
|
12
|
+
### [1.0.15](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.7.18...v1.0.15) (2025-12-16)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### ✨ Features | 新功能
|
|
16
|
+
|
|
17
|
+
* area 支持接受list数据 ([5abec9c](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/5abec9c777a1bc503f1206378ec60bddf9090c52))
|
|
18
|
+
|
|
5
19
|
### [1.0.14](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.5.83...v1.0.14) (2025-12-06)
|
|
6
20
|
|
|
7
21
|
### [1.0.13](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.5.82...v1.0.13) (2025-12-06)
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { baseProps,
|
|
1
|
+
import { baseProps, makeBooleanProp, makeNumberProp, makeStringProp } from '../common/props'
|
|
2
2
|
|
|
3
3
|
export const backtopProps = {
|
|
4
4
|
...baseProps,
|
|
5
5
|
/**
|
|
6
6
|
* 页面滚动距离
|
|
7
7
|
*/
|
|
8
|
-
scrollTop:
|
|
8
|
+
scrollTop: makeNumberProp(Number),
|
|
9
9
|
/**
|
|
10
10
|
* 距离顶部多少距离时显示
|
|
11
11
|
*/
|
|
@@ -33,5 +33,11 @@ export const backtopProps = {
|
|
|
33
33
|
/**
|
|
34
34
|
* 距离屏幕右边距离
|
|
35
35
|
*/
|
|
36
|
-
right: makeNumberProp(20)
|
|
36
|
+
right: makeNumberProp(20),
|
|
37
|
+
|
|
38
|
+
// 一直显示
|
|
39
|
+
alwaysShow: makeBooleanProp(false),
|
|
40
|
+
|
|
41
|
+
// 距离屏幕左边距离 优先级更高
|
|
42
|
+
left: makeNumberProp(0),
|
|
37
43
|
}
|
|
@@ -2,11 +2,16 @@
|
|
|
2
2
|
<wd-transition :show="show" name="fade">
|
|
3
3
|
<view
|
|
4
4
|
:class="`wd-backtop ${customClass} is-${shape}`"
|
|
5
|
-
:style="`z-index: ${zIndex}; bottom: ${bottom}px; right: ${right}px
|
|
5
|
+
:style="`z-index: ${zIndex}; bottom: ${bottom}px; ${left ? `left: ${left}px;` : `right: ${right}px;`} ${customStyle}`"
|
|
6
6
|
@click="handleBacktop"
|
|
7
7
|
>
|
|
8
8
|
<slot v-if="$slots.default"></slot>
|
|
9
|
-
<wd-icon
|
|
9
|
+
<wd-icon
|
|
10
|
+
v-else
|
|
11
|
+
custom-class="wd-backtop__backicon"
|
|
12
|
+
name="backtop"
|
|
13
|
+
:custom-style="iconStyle"
|
|
14
|
+
/>
|
|
10
15
|
</view>
|
|
11
16
|
</wd-transition>
|
|
12
17
|
</template>
|
|
@@ -17,29 +22,32 @@ export default {
|
|
|
17
22
|
options: {
|
|
18
23
|
addGlobalClass: true,
|
|
19
24
|
virtualHost: true,
|
|
20
|
-
styleIsolation: 'shared'
|
|
21
|
-
}
|
|
25
|
+
styleIsolation: 'shared',
|
|
26
|
+
},
|
|
22
27
|
}
|
|
23
28
|
</script>
|
|
24
29
|
|
|
25
30
|
<script lang="ts" setup>
|
|
26
|
-
import
|
|
27
|
-
import wdIcon from '../wd-icon/wd-icon.vue'
|
|
28
|
-
import { computed } from 'vue'
|
|
31
|
+
import { computed, ref } from 'vue'
|
|
29
32
|
import { backtopProps } from './types'
|
|
30
|
-
|
|
33
|
+
import { onPageScroll } from '@dcloudio/uni-app'
|
|
34
|
+
const scrollTop = ref(0)
|
|
31
35
|
const props = defineProps(backtopProps)
|
|
32
36
|
|
|
33
|
-
const show = computed(() =>
|
|
34
|
-
|
|
37
|
+
const show = computed(() => scrollTop.value > props.top || props.alwaysShow)
|
|
38
|
+
onPageScroll((e) => {
|
|
39
|
+
scrollTop.value = e.scrollTop
|
|
40
|
+
})
|
|
35
41
|
function handleBacktop() {
|
|
42
|
+
if (props.alwaysShow) return
|
|
43
|
+
scrollTop.value = 0
|
|
36
44
|
uni.pageScrollTo({
|
|
37
45
|
scrollTop: 0,
|
|
38
|
-
duration: props.duration
|
|
46
|
+
duration: props.duration,
|
|
39
47
|
})
|
|
40
48
|
}
|
|
41
49
|
</script>
|
|
42
50
|
|
|
43
51
|
<style lang="scss" scoped>
|
|
44
|
-
@import './index
|
|
52
|
+
@import './index';
|
|
45
53
|
</style>
|
|
@@ -8,7 +8,15 @@
|
|
|
8
8
|
* 记得注释
|
|
9
9
|
*/
|
|
10
10
|
import type { ExtractPropTypes, PropType } from 'vue'
|
|
11
|
-
import {
|
|
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
|
|
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
|
-
|
|
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
|
|
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 (
|
|
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
|
-
|
|
421
|
+
// 判断这次修改是增加还是减少
|
|
422
|
+
updateValue(cleaned, mode)
|
|
409
423
|
}
|
|
410
424
|
})
|
|
411
425
|
}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@ export declare const backtopProps: {
|
|
|
4
4
|
*/
|
|
5
5
|
scrollTop: {
|
|
6
6
|
type: NumberConstructor
|
|
7
|
-
|
|
7
|
+
default: NumberConstructor
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
10
|
* 距离顶部多少距离时显示
|
|
@@ -55,6 +55,14 @@ export declare const backtopProps: {
|
|
|
55
55
|
type: NumberConstructor
|
|
56
56
|
default: number
|
|
57
57
|
}
|
|
58
|
+
alwaysShow: {
|
|
59
|
+
type: BooleanConstructor
|
|
60
|
+
default: boolean
|
|
61
|
+
}
|
|
62
|
+
left: {
|
|
63
|
+
type: NumberConstructor
|
|
64
|
+
default: number
|
|
65
|
+
}
|
|
58
66
|
customStyle: {
|
|
59
67
|
type: import('vue').PropType<string>
|
|
60
68
|
default: string
|
|
@@ -3,7 +3,7 @@ declare const _default: __VLS_WithTemplateSlots<
|
|
|
3
3
|
{
|
|
4
4
|
scrollTop: {
|
|
5
5
|
type: NumberConstructor
|
|
6
|
-
|
|
6
|
+
default: NumberConstructor
|
|
7
7
|
}
|
|
8
8
|
top: {
|
|
9
9
|
type: NumberConstructor
|
|
@@ -33,6 +33,14 @@ declare const _default: __VLS_WithTemplateSlots<
|
|
|
33
33
|
type: NumberConstructor
|
|
34
34
|
default: number
|
|
35
35
|
}
|
|
36
|
+
alwaysShow: {
|
|
37
|
+
type: BooleanConstructor
|
|
38
|
+
default: boolean
|
|
39
|
+
}
|
|
40
|
+
left: {
|
|
41
|
+
type: NumberConstructor
|
|
42
|
+
default: number
|
|
43
|
+
}
|
|
36
44
|
customStyle: {
|
|
37
45
|
type: import('vue').PropType<string>
|
|
38
46
|
default: string
|
|
@@ -55,7 +63,7 @@ declare const _default: __VLS_WithTemplateSlots<
|
|
|
55
63
|
import('vue').ExtractPropTypes<{
|
|
56
64
|
scrollTop: {
|
|
57
65
|
type: NumberConstructor
|
|
58
|
-
|
|
66
|
+
default: NumberConstructor
|
|
59
67
|
}
|
|
60
68
|
top: {
|
|
61
69
|
type: NumberConstructor
|
|
@@ -85,6 +93,14 @@ declare const _default: __VLS_WithTemplateSlots<
|
|
|
85
93
|
type: NumberConstructor
|
|
86
94
|
default: number
|
|
87
95
|
}
|
|
96
|
+
alwaysShow: {
|
|
97
|
+
type: BooleanConstructor
|
|
98
|
+
default: boolean
|
|
99
|
+
}
|
|
100
|
+
left: {
|
|
101
|
+
type: NumberConstructor
|
|
102
|
+
default: number
|
|
103
|
+
}
|
|
88
104
|
customStyle: {
|
|
89
105
|
type: import('vue').PropType<string>
|
|
90
106
|
default: string
|
|
@@ -103,8 +119,11 @@ declare const _default: __VLS_WithTemplateSlots<
|
|
|
103
119
|
top: number
|
|
104
120
|
right: number
|
|
105
121
|
bottom: number
|
|
122
|
+
left: number
|
|
123
|
+
scrollTop: number
|
|
106
124
|
iconStyle: string
|
|
107
125
|
shape: string
|
|
126
|
+
alwaysShow: boolean
|
|
108
127
|
},
|
|
109
128
|
{}
|
|
110
129
|
>,
|
|
@@ -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
|
{
|