hy-app 0.6.4 → 0.6.6
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/attributes.json +1 -1
- package/components/hy-address-picker/hy-address-picker.vue +249 -249
- package/components/hy-address-picker/props.ts +103 -103
- package/components/hy-button/hy-button.vue +320 -289
- package/components/hy-button/props.ts +143 -143
- package/components/hy-button/typing.d.ts +43 -35
- package/components/hy-calendar/header.vue +58 -58
- package/components/hy-calendar/hy-calendar.vue +8 -6
- package/components/hy-calendar/month.vue +402 -402
- package/components/hy-calendar/props.ts +169 -169
- package/components/hy-calendar/typing.d.ts +47 -45
- package/components/hy-cell-item/hy-cell-item.vue +161 -161
- package/components/hy-cell-item/props.ts +59 -59
- package/components/hy-check-button/hy-check-button.vue +135 -135
- package/components/hy-code-input/hy-code-input.vue +231 -231
- package/components/hy-code-input/props.ts +90 -90
- package/components/hy-config-provider/hy-config-provider.vue +53 -53
- package/components/hy-config-provider/props.ts +30 -30
- package/components/hy-coupon/hy-coupon.vue +183 -183
- package/components/hy-coupon/props.ts +108 -108
- package/components/hy-datetime-picker/hy-datetime-picker.vue +41 -55
- package/components/hy-datetime-picker/props.ts +144 -144
- package/components/hy-datetime-picker/typing.d.ts +2 -0
- package/components/hy-divider/props.ts +83 -83
- package/components/hy-empty/icon.ts +72 -72
- package/components/hy-folding-panel/hy-folding-panel-group.vue +162 -162
- package/components/hy-form/hy-form.vue +220 -220
- package/components/hy-icon/hy-icon.vue +112 -112
- package/components/hy-index-bar/hy-index-bar.vue +185 -185
- package/components/hy-index-bar/index.scss +64 -64
- package/components/hy-index-bar/props.ts +94 -94
- package/components/hy-index-bar/typing.d.ts +36 -36
- package/components/hy-input/hy-input.vue +333 -333
- package/components/hy-input/props.ts +186 -186
- package/components/hy-modal/hy-modal.vue +211 -211
- package/components/hy-modal/props.ts +94 -94
- package/components/hy-modal/typing.d.ts +16 -16
- package/components/hy-notice-bar/hy-row-notice.vue +121 -121
- package/components/hy-notify/hy-notify.vue +174 -174
- package/components/hy-number-step/hy-number-step.vue +367 -367
- package/components/hy-overlay/hy-overlay.vue +61 -61
- package/components/hy-overlay/props.ts +38 -38
- package/components/hy-pagination/hy-pagination.vue +136 -136
- package/components/hy-pagination/props.ts +58 -58
- package/components/hy-parse/hy-parse.vue +550 -550
- package/components/hy-parse/node/node.vue +781 -781
- package/components/hy-parse/parser.js +1455 -1455
- package/components/hy-parse/props.ts +19 -19
- package/components/hy-parse/typing.d.ts +68 -68
- package/components/hy-picker/hy-picker.vue +435 -435
- package/components/hy-picker/props.ts +122 -122
- package/components/hy-picker/typing.d.ts +38 -38
- package/components/hy-qrcode/props.ts +72 -72
- package/components/hy-qrcode/qrcode.js.bak +1433 -1433
- package/components/hy-radio/props.ts +97 -97
- package/components/hy-read-more/props.ts +48 -48
- package/components/hy-search/props.ts +133 -133
- package/components/hy-signature/canvasHelper.ts +51 -51
- package/components/hy-signature/props.ts +121 -121
- package/components/hy-skeleton/hy-skeleton.vue +142 -142
- package/components/hy-skeleton/props.ts +46 -46
- package/components/hy-skeleton/typing.d.ts +31 -31
- package/components/hy-steps/hy-steps.vue +275 -275
- package/components/hy-steps/typing.d.ts +25 -25
- package/components/hy-swiper/hy-swiper.vue +3 -3
- package/components/hy-swiper/index.scss +5 -5
- package/components/hy-swiper/props.ts +0 -1
- package/components/hy-table/hy-table.vue +630 -630
- package/components/hy-table/props.ts +62 -62
- package/components/hy-table/typing.d.ts +29 -29
- package/components/hy-tabs/hy-tabs.vue +336 -335
- package/components/hy-tabs/props.ts +84 -77
- package/components/hy-tag/hy-tag.vue +173 -173
- package/components/hy-tag/props.ts +89 -89
- package/components/hy-text/hy-text.vue +237 -237
- package/components/hy-text/props.ts +115 -115
- package/components/hy-textarea/hy-textarea.vue +198 -198
- package/components/hy-toast/hy-toast.vue +200 -200
- package/components/hy-toast/props.ts +3 -3
- package/components/hy-transition/hy-transition.vue +157 -157
- package/components/hy-transition/props.ts +32 -32
- package/components/hy-upload/hy-upload.vue +384 -384
- package/components/hy-watermark/hy-watermark.vue +1058 -1058
- package/components/hy-watermark/props.ts +109 -109
- package/global.d.ts +94 -94
- package/libs/api/http.ts +119 -119
- package/libs/composables/index.ts +8 -8
- package/libs/composables/useMessage.ts +149 -149
- package/libs/composables/useToast.ts +45 -45
- package/libs/composables/useTranslate.ts +10 -10
- package/libs/css/_config.scss +5 -5
- package/libs/index.ts +8 -8
- package/libs/locale/index.ts +32 -32
- package/libs/locale/lang/en-US.ts +84 -84
- package/libs/locale/lang/zh-CN.ts +87 -87
- package/libs/typing/index.ts +2 -2
- package/libs/typing/modules/common.d.ts +139 -139
- package/libs/typing/modules/form.ts +176 -176
- package/libs/typing/modules/http.d.ts +19 -19
- package/libs/typing/modules/index.d.ts +12 -12
- package/libs/utils/inside.ts +340 -340
- package/libs/utils/inspect.ts +140 -140
- package/libs/utils/utils.ts +525 -525
- package/package.json +81 -81
- package/tags.json +1 -1
- package/web-types.json +1 -1
|
@@ -1,157 +1,157 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view
|
|
3
|
-
v-if="hasInit"
|
|
4
|
-
class="hy-transition"
|
|
5
|
-
ref="hy-transition"
|
|
6
|
-
:class="[classes, customClass]"
|
|
7
|
-
:style="[mergeStyle]"
|
|
8
|
-
@tap.stop="clickHandler"
|
|
9
|
-
>
|
|
10
|
-
<slot />
|
|
11
|
-
</view>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script lang="ts">
|
|
15
|
-
export default {
|
|
16
|
-
name: 'hy-transition',
|
|
17
|
-
options: {
|
|
18
|
-
addGlobalClass: true,
|
|
19
|
-
virtualHost: true,
|
|
20
|
-
styleIsolation: 'shared'
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
<script setup lang="ts">
|
|
26
|
-
import { computed, ref, watch, nextTick } from 'vue'
|
|
27
|
-
import type { CSSProperties } from 'vue'
|
|
28
|
-
import { sleep } from '../../libs'
|
|
29
|
-
import type { ITransitionEmits } from './typing'
|
|
30
|
-
import transitionProps from './props'
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* 该组件用于组件的动画过渡效果。
|
|
34
|
-
* @displayName hy-transition
|
|
35
|
-
*/
|
|
36
|
-
defineOptions({})
|
|
37
|
-
|
|
38
|
-
const props = defineProps(transitionProps)
|
|
39
|
-
const emit = defineEmits<ITransitionEmits>()
|
|
40
|
-
|
|
41
|
-
const hasInit = ref<boolean>(false) // 是否显示/隐藏组件
|
|
42
|
-
const viewStyle = ref<CSSProperties>({}) // 组件内部的样式
|
|
43
|
-
const status = ref<string>('') // 记录组件动画的状态
|
|
44
|
-
const transitionEnded = ref<boolean>(false) // 组件是否结束的标记
|
|
45
|
-
const display = ref<boolean>(false) // 组件是否展示
|
|
46
|
-
const classes = ref<string>('') // 应用的类名
|
|
47
|
-
|
|
48
|
-
// #ifndef APP-NVUE
|
|
49
|
-
// 定义类名,通过给元素动态切换类名,赋予元素一定的css动画样式
|
|
50
|
-
const getClassNames = (name: string) => ({
|
|
51
|
-
enter: `u-${name}-enter u-${name}-enter-active`,
|
|
52
|
-
'enter-to': `u-${name}-enter-to u-${name}-enter-active`,
|
|
53
|
-
leave: `u-${name}-leave u-${name}-leave-active`,
|
|
54
|
-
'leave-to': `u-${name}-leave-to u-${name}-leave-active`
|
|
55
|
-
})
|
|
56
|
-
// #endif
|
|
57
|
-
|
|
58
|
-
// #ifndef APP-NVUE
|
|
59
|
-
// vue版本的组件进场处理
|
|
60
|
-
const vueEnter = async () => {
|
|
61
|
-
// 动画进入时的类名
|
|
62
|
-
const classNames = getClassNames(props.mode)
|
|
63
|
-
// 定义状态和发出动画进入前事件
|
|
64
|
-
status.value = 'enter'
|
|
65
|
-
emit('beforeEnter')
|
|
66
|
-
hasInit.value = true
|
|
67
|
-
display.value = true
|
|
68
|
-
classes.value = classNames.enter
|
|
69
|
-
await nextTick()
|
|
70
|
-
{
|
|
71
|
-
// https://github.com/umicro/uView2.0/issues/545
|
|
72
|
-
await sleep(20)
|
|
73
|
-
// 标识动画尚未结束
|
|
74
|
-
emit('enter')
|
|
75
|
-
transitionEnded.value = false
|
|
76
|
-
// 组件动画进入后触发的事件
|
|
77
|
-
emit('afterEnter')
|
|
78
|
-
// 赋予组件enter-to类名
|
|
79
|
-
classes.value = classNames['enter-to']
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
// 动画离场处理
|
|
83
|
-
const vueLeave = async () => {
|
|
84
|
-
// 如果不是展示状态,无需执行逻辑
|
|
85
|
-
if (!display.value) return
|
|
86
|
-
const classNames = getClassNames(props.mode)
|
|
87
|
-
// 标记离开状态和发出事件
|
|
88
|
-
status.value = 'leave'
|
|
89
|
-
emit('beforeLeave')
|
|
90
|
-
// 获得类名
|
|
91
|
-
classes.value = classNames.leave
|
|
92
|
-
|
|
93
|
-
await nextTick()
|
|
94
|
-
{
|
|
95
|
-
// 动画正在离场的状态
|
|
96
|
-
transitionEnded.value = false
|
|
97
|
-
emit('leave')
|
|
98
|
-
// 组件执行动画,到了执行的执行时间后,执行一些额外处理
|
|
99
|
-
setTimeout(() => onTransitionEnd(), props.duration)
|
|
100
|
-
classes.value = classNames['leave-to']
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
// #endif
|
|
104
|
-
|
|
105
|
-
watch(
|
|
106
|
-
() => props.show,
|
|
107
|
-
(newVal) => {
|
|
108
|
-
// vue和nvue分别执行不同的方法
|
|
109
|
-
// #ifdef APP-NVUE
|
|
110
|
-
// newVal ? nvueEnter() : nvueLeave()
|
|
111
|
-
// #endif
|
|
112
|
-
// #ifndef APP-NVUE
|
|
113
|
-
newVal ? vueEnter() : vueLeave()
|
|
114
|
-
// #endif
|
|
115
|
-
},
|
|
116
|
-
{ immediate: true }
|
|
117
|
-
)
|
|
118
|
-
|
|
119
|
-
const mergeStyle = computed(() => {
|
|
120
|
-
return {
|
|
121
|
-
// #ifndef APP-NVUE
|
|
122
|
-
transitionDuration: `${props.duration}ms`,
|
|
123
|
-
// display: `${this.display ? '' : 'none'}`,
|
|
124
|
-
transitionTimingFunction: props.timingFunction,
|
|
125
|
-
// #endif
|
|
126
|
-
// 避免自定义样式影响到动画属性,所以写在viewStyle前面
|
|
127
|
-
...props.customStyle,
|
|
128
|
-
...viewStyle
|
|
129
|
-
}
|
|
130
|
-
})
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* @description 组件被点击发出事件
|
|
134
|
-
* */
|
|
135
|
-
const clickHandler = () => {
|
|
136
|
-
emit('click')
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
const onTransitionEnd = () => {
|
|
140
|
-
// 如果已经是结束的状态,无需再处理
|
|
141
|
-
if (transitionEnded.value) return
|
|
142
|
-
transitionEnded.value = true
|
|
143
|
-
// 发出组件动画执行后的事件
|
|
144
|
-
status.value === 'leave' ? emit('afterLeave') : emit('afterEnter')
|
|
145
|
-
if (!props.show && display.value) {
|
|
146
|
-
display.value = false
|
|
147
|
-
hasInit.value = false
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
</script>
|
|
151
|
-
|
|
152
|
-
<style lang="scss" scoped>
|
|
153
|
-
/* #ifndef APP-NVUE */
|
|
154
|
-
// vue版本动画相关的样式抽离在外部文件
|
|
155
|
-
@import './index.scss';
|
|
156
|
-
/* #endif */
|
|
157
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<view
|
|
3
|
+
v-if="hasInit"
|
|
4
|
+
class="hy-transition"
|
|
5
|
+
ref="hy-transition"
|
|
6
|
+
:class="[classes, customClass]"
|
|
7
|
+
:style="[mergeStyle]"
|
|
8
|
+
@tap.stop="clickHandler"
|
|
9
|
+
>
|
|
10
|
+
<slot />
|
|
11
|
+
</view>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script lang="ts">
|
|
15
|
+
export default {
|
|
16
|
+
name: 'hy-transition',
|
|
17
|
+
options: {
|
|
18
|
+
addGlobalClass: true,
|
|
19
|
+
virtualHost: true,
|
|
20
|
+
styleIsolation: 'shared'
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<script setup lang="ts">
|
|
26
|
+
import { computed, ref, watch, nextTick } from 'vue'
|
|
27
|
+
import type { CSSProperties } from 'vue'
|
|
28
|
+
import { sleep } from '../../libs'
|
|
29
|
+
import type { ITransitionEmits } from './typing'
|
|
30
|
+
import transitionProps from './props'
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* 该组件用于组件的动画过渡效果。
|
|
34
|
+
* @displayName hy-transition
|
|
35
|
+
*/
|
|
36
|
+
defineOptions({})
|
|
37
|
+
|
|
38
|
+
const props = defineProps(transitionProps)
|
|
39
|
+
const emit = defineEmits<ITransitionEmits>()
|
|
40
|
+
|
|
41
|
+
const hasInit = ref<boolean>(false) // 是否显示/隐藏组件
|
|
42
|
+
const viewStyle = ref<CSSProperties>({}) // 组件内部的样式
|
|
43
|
+
const status = ref<string>('') // 记录组件动画的状态
|
|
44
|
+
const transitionEnded = ref<boolean>(false) // 组件是否结束的标记
|
|
45
|
+
const display = ref<boolean>(false) // 组件是否展示
|
|
46
|
+
const classes = ref<string>('') // 应用的类名
|
|
47
|
+
|
|
48
|
+
// #ifndef APP-NVUE
|
|
49
|
+
// 定义类名,通过给元素动态切换类名,赋予元素一定的css动画样式
|
|
50
|
+
const getClassNames = (name: string) => ({
|
|
51
|
+
enter: `u-${name}-enter u-${name}-enter-active`,
|
|
52
|
+
'enter-to': `u-${name}-enter-to u-${name}-enter-active`,
|
|
53
|
+
leave: `u-${name}-leave u-${name}-leave-active`,
|
|
54
|
+
'leave-to': `u-${name}-leave-to u-${name}-leave-active`
|
|
55
|
+
})
|
|
56
|
+
// #endif
|
|
57
|
+
|
|
58
|
+
// #ifndef APP-NVUE
|
|
59
|
+
// vue版本的组件进场处理
|
|
60
|
+
const vueEnter = async () => {
|
|
61
|
+
// 动画进入时的类名
|
|
62
|
+
const classNames = getClassNames(props.mode)
|
|
63
|
+
// 定义状态和发出动画进入前事件
|
|
64
|
+
status.value = 'enter'
|
|
65
|
+
emit('beforeEnter')
|
|
66
|
+
hasInit.value = true
|
|
67
|
+
display.value = true
|
|
68
|
+
classes.value = classNames.enter
|
|
69
|
+
await nextTick()
|
|
70
|
+
{
|
|
71
|
+
// https://github.com/umicro/uView2.0/issues/545
|
|
72
|
+
await sleep(20)
|
|
73
|
+
// 标识动画尚未结束
|
|
74
|
+
emit('enter')
|
|
75
|
+
transitionEnded.value = false
|
|
76
|
+
// 组件动画进入后触发的事件
|
|
77
|
+
emit('afterEnter')
|
|
78
|
+
// 赋予组件enter-to类名
|
|
79
|
+
classes.value = classNames['enter-to']
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
// 动画离场处理
|
|
83
|
+
const vueLeave = async () => {
|
|
84
|
+
// 如果不是展示状态,无需执行逻辑
|
|
85
|
+
if (!display.value) return
|
|
86
|
+
const classNames = getClassNames(props.mode)
|
|
87
|
+
// 标记离开状态和发出事件
|
|
88
|
+
status.value = 'leave'
|
|
89
|
+
emit('beforeLeave')
|
|
90
|
+
// 获得类名
|
|
91
|
+
classes.value = classNames.leave
|
|
92
|
+
|
|
93
|
+
await nextTick()
|
|
94
|
+
{
|
|
95
|
+
// 动画正在离场的状态
|
|
96
|
+
transitionEnded.value = false
|
|
97
|
+
emit('leave')
|
|
98
|
+
// 组件执行动画,到了执行的执行时间后,执行一些额外处理
|
|
99
|
+
setTimeout(() => onTransitionEnd(), props.duration)
|
|
100
|
+
classes.value = classNames['leave-to']
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
// #endif
|
|
104
|
+
|
|
105
|
+
watch(
|
|
106
|
+
() => props.show,
|
|
107
|
+
(newVal) => {
|
|
108
|
+
// vue和nvue分别执行不同的方法
|
|
109
|
+
// #ifdef APP-NVUE
|
|
110
|
+
// newVal ? nvueEnter() : nvueLeave()
|
|
111
|
+
// #endif
|
|
112
|
+
// #ifndef APP-NVUE
|
|
113
|
+
newVal ? vueEnter() : vueLeave()
|
|
114
|
+
// #endif
|
|
115
|
+
},
|
|
116
|
+
{ immediate: true }
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
const mergeStyle = computed(() => {
|
|
120
|
+
return {
|
|
121
|
+
// #ifndef APP-NVUE
|
|
122
|
+
transitionDuration: `${props.duration}ms`,
|
|
123
|
+
// display: `${this.display ? '' : 'none'}`,
|
|
124
|
+
transitionTimingFunction: props.timingFunction,
|
|
125
|
+
// #endif
|
|
126
|
+
// 避免自定义样式影响到动画属性,所以写在viewStyle前面
|
|
127
|
+
...props.customStyle,
|
|
128
|
+
...viewStyle
|
|
129
|
+
}
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* @description 组件被点击发出事件
|
|
134
|
+
* */
|
|
135
|
+
const clickHandler = () => {
|
|
136
|
+
emit('click')
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const onTransitionEnd = () => {
|
|
140
|
+
// 如果已经是结束的状态,无需再处理
|
|
141
|
+
if (transitionEnded.value) return
|
|
142
|
+
transitionEnded.value = true
|
|
143
|
+
// 发出组件动画执行后的事件
|
|
144
|
+
status.value === 'leave' ? emit('afterLeave') : emit('afterEnter')
|
|
145
|
+
if (!props.show && display.value) {
|
|
146
|
+
display.value = false
|
|
147
|
+
hasInit.value = false
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
</script>
|
|
151
|
+
|
|
152
|
+
<style lang="scss" scoped>
|
|
153
|
+
/* #ifndef APP-NVUE */
|
|
154
|
+
// vue版本动画相关的样式抽离在外部文件
|
|
155
|
+
@import './index.scss';
|
|
156
|
+
/* #endif */
|
|
157
|
+
</style>
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import type { CSSProperties, PropType } from 'vue'
|
|
2
|
-
|
|
3
|
-
const transitionProps = {
|
|
4
|
-
/** 是否展示组件 */
|
|
5
|
-
show: {
|
|
6
|
-
type: Boolean,
|
|
7
|
-
default: false
|
|
8
|
-
},
|
|
9
|
-
/** 使用的动画模式 */
|
|
10
|
-
mode: {
|
|
11
|
-
type: String,
|
|
12
|
-
default: 'fade'
|
|
13
|
-
},
|
|
14
|
-
/** 动画的执行时间,单位ms */
|
|
15
|
-
duration: {
|
|
16
|
-
type: Number,
|
|
17
|
-
default: 300
|
|
18
|
-
},
|
|
19
|
-
/** 使用的动画过渡函数 */
|
|
20
|
-
timingFunction: {
|
|
21
|
-
type: String,
|
|
22
|
-
default: 'ease-out'
|
|
23
|
-
},
|
|
24
|
-
/** 定义需要用到的外部样式 */
|
|
25
|
-
customStyle: {
|
|
26
|
-
type: Object as PropType<CSSProperties>
|
|
27
|
-
},
|
|
28
|
-
/** 自定义外部类名 */
|
|
29
|
-
customClass: String
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export default transitionProps
|
|
1
|
+
import type { CSSProperties, PropType } from 'vue'
|
|
2
|
+
|
|
3
|
+
const transitionProps = {
|
|
4
|
+
/** 是否展示组件 */
|
|
5
|
+
show: {
|
|
6
|
+
type: Boolean,
|
|
7
|
+
default: false
|
|
8
|
+
},
|
|
9
|
+
/** 使用的动画模式 */
|
|
10
|
+
mode: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: 'fade'
|
|
13
|
+
},
|
|
14
|
+
/** 动画的执行时间,单位ms */
|
|
15
|
+
duration: {
|
|
16
|
+
type: Number,
|
|
17
|
+
default: 300
|
|
18
|
+
},
|
|
19
|
+
/** 使用的动画过渡函数 */
|
|
20
|
+
timingFunction: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: 'ease-out'
|
|
23
|
+
},
|
|
24
|
+
/** 定义需要用到的外部样式 */
|
|
25
|
+
customStyle: {
|
|
26
|
+
type: Object as PropType<CSSProperties>
|
|
27
|
+
},
|
|
28
|
+
/** 自定义外部类名 */
|
|
29
|
+
customClass: String
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export default transitionProps
|