hy-app 0.6.9 → 0.7.1
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-avatar/hy-avatar.vue +12 -5
- package/components/hy-avatar/props.ts +4 -2
- package/components/hy-avatar/typing.d.ts +8 -1
- package/components/hy-calendar/hy-calendar.vue +3 -2
- package/components/hy-calendar/month.vue +25 -5
- package/components/hy-calendar/props.ts +1 -1
- package/components/hy-calendar/typing.d.ts +9 -0
- package/components/hy-cascader/hy-cascader.vue +503 -0
- package/components/hy-cascader/index.scss +84 -0
- package/components/hy-cascader/props.ts +88 -0
- package/components/hy-cascader/typing.d.ts +34 -0
- package/components/hy-check-button/typing.d.ts +12 -7
- package/components/hy-code-input/hy-code-input.vue +33 -11
- package/components/hy-code-input/typing.d.ts +4 -0
- package/components/hy-config-provider/hy-config-provider.vue +58 -53
- package/components/hy-count-down/hy-count-down.vue +8 -8
- package/components/hy-count-down/typing.d.ts +16 -0
- package/components/hy-count-to/hy-count-to.vue +7 -7
- package/components/hy-count-to/typing.d.ts +24 -0
- package/components/hy-datetime-picker/props.ts +1 -1
- package/components/hy-datetime-picker/typing.d.ts +1 -1
- package/components/hy-dropdown/typing.d.ts +5 -0
- package/components/hy-dropdown-item/hy-dropdown-item.vue +1 -1
- package/components/hy-folding-panel/hy-folding-panel.vue +3 -3
- package/components/hy-folding-panel/typing.d.ts +23 -0
- package/components/hy-folding-panel-item/hy-folding-panel-item.vue +2 -2
- package/components/hy-folding-panel-item/typing.d.ts +21 -0
- package/components/hy-form/hy-form.vue +2 -2
- package/components/hy-form/typing.d.ts +37 -0
- package/components/hy-form-item/typing.d.ts +1 -1
- package/components/hy-grid/hy-grid.vue +12 -12
- package/components/hy-grid/index.scss +1 -2
- package/components/hy-grid/props.ts +7 -2
- package/components/hy-grid/typing.d.ts +1 -1
- package/components/hy-icon/typing.d.ts +52 -9
- package/components/hy-keyboard/constants.ts +83 -0
- package/components/hy-keyboard/hy-keyboard.vue +375 -0
- package/components/hy-keyboard/index.scss +73 -0
- package/components/hy-keyboard/key/index.scss +79 -0
- package/components/hy-keyboard/key/index.vue +91 -0
- package/components/hy-keyboard/key/types.ts +1 -0
- package/components/hy-keyboard/props.ts +108 -0
- package/components/hy-keyboard/typing.d.ts +18 -0
- package/components/hy-list/hy-list.vue +15 -13
- package/components/hy-list/props.ts +1 -1
- package/components/hy-modal/typing.d.ts +2 -2
- package/components/hy-notice-bar/hy-column-notice.vue +54 -94
- package/components/hy-notice-bar/hy-notice-bar.vue +128 -96
- package/components/hy-notice-bar/hy-row-notice.vue +89 -121
- package/components/hy-notice-bar/props.ts +86 -85
- package/components/hy-notify/hy-notify.vue +10 -10
- package/components/hy-notify/typing.d.ts +35 -0
- package/components/hy-number-step/hy-number-step.vue +370 -367
- package/components/hy-number-step/index.scss +1 -0
- package/components/hy-number-step/props.ts +1 -1
- package/components/hy-picker/hy-picker.vue +126 -149
- package/components/hy-picker/props.ts +4 -1
- package/components/hy-picker/typing.d.ts +22 -0
- package/components/hy-popover/hy-popover.vue +2 -2
- package/components/hy-popover/typing.d.ts +1 -1
- package/components/hy-popup/hy-popup.vue +1 -1
- package/components/hy-popup/index.scss +1 -0
- package/components/hy-price/hy-price.vue +52 -23
- package/components/hy-price/props.ts +54 -54
- package/components/hy-radio/props.ts +1 -1
- package/components/hy-radio/typing.d.ts +5 -1
- package/components/hy-rolling-num/typing.d.ts +1 -0
- package/components/hy-signature/hy-signature.vue +17 -17
- package/components/hy-signature/typing.d.ts +1 -1
- package/components/hy-skeleton/index.scss +17 -0
- package/components/hy-steps/hy-steps.vue +1 -1
- package/components/hy-submit-bar/typing.d.ts +3 -3
- package/components/hy-swipe-action/hy-swipe-action.vue +34 -15
- package/components/hy-swipe-action/index.scss +0 -1
- package/components/hy-switch/typing.d.ts +4 -0
- package/components/hy-tabbar/props.ts +2 -1
- package/components/hy-tabbar/typing.d.ts +5 -4
- package/components/hy-tabs/hy-tabs.vue +338 -336
- package/components/hy-tabs/index.scss +6 -6
- package/components/hy-tabs/typing.d.ts +41 -33
- package/components/hy-textarea/hy-textarea.vue +2 -2
- package/components/hy-textarea/typing.d.ts +4 -0
- package/components/hy-toast/hy-toast.vue +17 -9
- package/components/hy-toast/index.scss +1 -1
- package/components/hy-toast/typing.d.ts +56 -37
- package/components/hy-tooltip/hy-tooltip.vue +1 -1
- package/components/hy-tooltip/index.scss +1 -0
- package/components/hy-tooltip/props.ts +1 -1
- package/components/hy-upload/hy-upload.vue +16 -1
- package/components/hy-upload/index.scss +149 -144
- package/components/index.ts +6 -0
- package/global.d.ts +2 -0
- package/libs/api/http.ts +122 -119
- package/libs/config/icon.ts +442 -430
- package/libs/css/_function.scss +7 -13
- package/libs/css/iconfont.css +445 -441
- package/libs/css/theme.scss +3 -1
- package/libs/locale/lang/en-US.ts +4 -0
- package/libs/locale/lang/zh-CN.ts +4 -0
- package/libs/typing/index.ts +80 -0
- package/package.json +5 -2
- package/tags.json +1 -1
- package/web-types.json +1 -1
- package/components/hy-folding-panel/hy-folding-panel-group.vue +0 -163
- package/components/hy-qrcode/qrcode.js.bak +0 -1434
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="hy-folding-panel-group">
|
|
3
|
-
<slot></slot>
|
|
4
|
-
</view>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script lang="ts">
|
|
8
|
-
export default {
|
|
9
|
-
name: "hy-folding-panel-group"
|
|
10
|
-
};
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<script setup lang="ts">
|
|
14
|
-
import { provide, ref, watch, onMounted, nextTick, getCurrentInstance } from 'vue';
|
|
15
|
-
import type { Ref } from 'vue';
|
|
16
|
-
|
|
17
|
-
// Props定义
|
|
18
|
-
const props = defineProps({
|
|
19
|
-
/**
|
|
20
|
-
* 当前激活的面板索引,支持v-model
|
|
21
|
-
*/
|
|
22
|
-
modelValue: {
|
|
23
|
-
type: Number,
|
|
24
|
-
default: -1
|
|
25
|
-
},
|
|
26
|
-
/**
|
|
27
|
-
* 是否手风琴模式,默认true
|
|
28
|
-
*/
|
|
29
|
-
accordion: {
|
|
30
|
-
type: Boolean,
|
|
31
|
-
default: true
|
|
32
|
-
},
|
|
33
|
-
/**
|
|
34
|
-
* 是否禁用整个折叠面板组
|
|
35
|
-
*/
|
|
36
|
-
disabled: {
|
|
37
|
-
type: Boolean,
|
|
38
|
-
default: false
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
// 事件定义
|
|
43
|
-
const emit = defineEmits<{
|
|
44
|
-
(e: 'update:modelValue', value: number): void;
|
|
45
|
-
(e: 'change', index: number): void;
|
|
46
|
-
(e: 'open', index: number): void;
|
|
47
|
-
(e: 'close', index: number): void;
|
|
48
|
-
}>();
|
|
49
|
-
|
|
50
|
-
// 内部激活索引
|
|
51
|
-
const activeIndex = ref(props.modelValue);
|
|
52
|
-
|
|
53
|
-
// 监听v-model变化
|
|
54
|
-
watch(() => props.modelValue, (newVal) => {
|
|
55
|
-
activeIndex.value = newVal;
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
// 监听内部激活索引变化
|
|
59
|
-
watch(activeIndex, (newVal) => {
|
|
60
|
-
emit('update:modelValue', newVal);
|
|
61
|
-
emit('change', newVal);
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
// 提供给子组件的方法
|
|
65
|
-
const updateActiveIndex = (index: number) => {
|
|
66
|
-
if (props.disabled) return;
|
|
67
|
-
|
|
68
|
-
if (props.accordion) {
|
|
69
|
-
// 手风琴模式下,如果点击的是当前激活的索引,则关闭(设为-1)
|
|
70
|
-
const wasActive = activeIndex.value === index;
|
|
71
|
-
activeIndex.value = wasActive ? -1 : index;
|
|
72
|
-
|
|
73
|
-
// 触发相应的事件
|
|
74
|
-
if (!wasActive) {
|
|
75
|
-
emit('open', index);
|
|
76
|
-
} else {
|
|
77
|
-
emit('close', index);
|
|
78
|
-
}
|
|
79
|
-
} else {
|
|
80
|
-
// 非手风琴模式下,这里不做特殊处理,由子组件自己控制
|
|
81
|
-
activeIndex.value = index;
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
// 提供给子组件的配置
|
|
86
|
-
provide('hy-folding-panel-group', {
|
|
87
|
-
accordion: props.accordion,
|
|
88
|
-
disabled: props.disabled,
|
|
89
|
-
activeIndex,
|
|
90
|
-
updateActiveIndex
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
// 自动为子组件设置索引
|
|
94
|
-
onMounted(() => {
|
|
95
|
-
nextTick(() => {
|
|
96
|
-
const children = getCurrentInstance()?.proxy?.$el?.querySelectorAll('.hy-folding-panel-item');
|
|
97
|
-
children?.forEach((child, index) => {
|
|
98
|
-
const vueComponent = (child as any).__vueParentComponent?.proxy;
|
|
99
|
-
if (vueComponent && vueComponent.$options.name === 'hy-folding-panel-item') {
|
|
100
|
-
vueComponent.index = index;
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
// 对外暴露的方法
|
|
107
|
-
defineExpose({
|
|
108
|
-
/**
|
|
109
|
-
* 打开指定索引的面板
|
|
110
|
-
*/
|
|
111
|
-
open: (index: number) => {
|
|
112
|
-
if (props.disabled) return;
|
|
113
|
-
activeIndex.value = index;
|
|
114
|
-
emit('open', index);
|
|
115
|
-
},
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* 关闭所有面板
|
|
119
|
-
*/
|
|
120
|
-
closeAll: () => {
|
|
121
|
-
if (props.disabled) return;
|
|
122
|
-
const prevIndex = activeIndex.value;
|
|
123
|
-
activeIndex.value = -1;
|
|
124
|
-
if (prevIndex !== -1) {
|
|
125
|
-
emit('close', prevIndex);
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* 切换指定索引面板的状态
|
|
131
|
-
*/
|
|
132
|
-
toggle: (index: number) => {
|
|
133
|
-
if (props.disabled) return;
|
|
134
|
-
updateActiveIndex(index);
|
|
135
|
-
},
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* 关闭指定索引的面板
|
|
139
|
-
*/
|
|
140
|
-
close: (index: number) => {
|
|
141
|
-
if (props.disabled) return;
|
|
142
|
-
if (activeIndex.value === index) {
|
|
143
|
-
activeIndex.value = -1;
|
|
144
|
-
emit('close', index);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
</script>
|
|
149
|
-
|
|
150
|
-
<style lang="scss" scoped>
|
|
151
|
-
.hy-folding-panel-group {
|
|
152
|
-
width: 100%;
|
|
153
|
-
background-color: #ffffff;
|
|
154
|
-
border-radius: 8px;
|
|
155
|
-
overflow: hidden;
|
|
156
|
-
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.hy-folding-panel-group--disabled {
|
|
160
|
-
opacity: 0.6;
|
|
161
|
-
pointer-events: none;
|
|
162
|
-
}
|
|
163
|
-
</style>
|