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.
Files changed (106) hide show
  1. package/attributes.json +1 -1
  2. package/components/hy-avatar/hy-avatar.vue +12 -5
  3. package/components/hy-avatar/props.ts +4 -2
  4. package/components/hy-avatar/typing.d.ts +8 -1
  5. package/components/hy-calendar/hy-calendar.vue +3 -2
  6. package/components/hy-calendar/month.vue +25 -5
  7. package/components/hy-calendar/props.ts +1 -1
  8. package/components/hy-calendar/typing.d.ts +9 -0
  9. package/components/hy-cascader/hy-cascader.vue +503 -0
  10. package/components/hy-cascader/index.scss +84 -0
  11. package/components/hy-cascader/props.ts +88 -0
  12. package/components/hy-cascader/typing.d.ts +34 -0
  13. package/components/hy-check-button/typing.d.ts +12 -7
  14. package/components/hy-code-input/hy-code-input.vue +33 -11
  15. package/components/hy-code-input/typing.d.ts +4 -0
  16. package/components/hy-config-provider/hy-config-provider.vue +58 -53
  17. package/components/hy-count-down/hy-count-down.vue +8 -8
  18. package/components/hy-count-down/typing.d.ts +16 -0
  19. package/components/hy-count-to/hy-count-to.vue +7 -7
  20. package/components/hy-count-to/typing.d.ts +24 -0
  21. package/components/hy-datetime-picker/props.ts +1 -1
  22. package/components/hy-datetime-picker/typing.d.ts +1 -1
  23. package/components/hy-dropdown/typing.d.ts +5 -0
  24. package/components/hy-dropdown-item/hy-dropdown-item.vue +1 -1
  25. package/components/hy-folding-panel/hy-folding-panel.vue +3 -3
  26. package/components/hy-folding-panel/typing.d.ts +23 -0
  27. package/components/hy-folding-panel-item/hy-folding-panel-item.vue +2 -2
  28. package/components/hy-folding-panel-item/typing.d.ts +21 -0
  29. package/components/hy-form/hy-form.vue +2 -2
  30. package/components/hy-form/typing.d.ts +37 -0
  31. package/components/hy-form-item/typing.d.ts +1 -1
  32. package/components/hy-grid/hy-grid.vue +12 -12
  33. package/components/hy-grid/index.scss +1 -2
  34. package/components/hy-grid/props.ts +7 -2
  35. package/components/hy-grid/typing.d.ts +1 -1
  36. package/components/hy-icon/typing.d.ts +52 -9
  37. package/components/hy-keyboard/constants.ts +83 -0
  38. package/components/hy-keyboard/hy-keyboard.vue +375 -0
  39. package/components/hy-keyboard/index.scss +73 -0
  40. package/components/hy-keyboard/key/index.scss +79 -0
  41. package/components/hy-keyboard/key/index.vue +91 -0
  42. package/components/hy-keyboard/key/types.ts +1 -0
  43. package/components/hy-keyboard/props.ts +108 -0
  44. package/components/hy-keyboard/typing.d.ts +18 -0
  45. package/components/hy-list/hy-list.vue +15 -13
  46. package/components/hy-list/props.ts +1 -1
  47. package/components/hy-modal/typing.d.ts +2 -2
  48. package/components/hy-notice-bar/hy-column-notice.vue +54 -94
  49. package/components/hy-notice-bar/hy-notice-bar.vue +128 -96
  50. package/components/hy-notice-bar/hy-row-notice.vue +89 -121
  51. package/components/hy-notice-bar/props.ts +86 -85
  52. package/components/hy-notify/hy-notify.vue +10 -10
  53. package/components/hy-notify/typing.d.ts +35 -0
  54. package/components/hy-number-step/hy-number-step.vue +370 -367
  55. package/components/hy-number-step/index.scss +1 -0
  56. package/components/hy-number-step/props.ts +1 -1
  57. package/components/hy-picker/hy-picker.vue +126 -149
  58. package/components/hy-picker/props.ts +4 -1
  59. package/components/hy-picker/typing.d.ts +22 -0
  60. package/components/hy-popover/hy-popover.vue +2 -2
  61. package/components/hy-popover/typing.d.ts +1 -1
  62. package/components/hy-popup/hy-popup.vue +1 -1
  63. package/components/hy-popup/index.scss +1 -0
  64. package/components/hy-price/hy-price.vue +52 -23
  65. package/components/hy-price/props.ts +54 -54
  66. package/components/hy-radio/props.ts +1 -1
  67. package/components/hy-radio/typing.d.ts +5 -1
  68. package/components/hy-rolling-num/typing.d.ts +1 -0
  69. package/components/hy-signature/hy-signature.vue +17 -17
  70. package/components/hy-signature/typing.d.ts +1 -1
  71. package/components/hy-skeleton/index.scss +17 -0
  72. package/components/hy-steps/hy-steps.vue +1 -1
  73. package/components/hy-submit-bar/typing.d.ts +3 -3
  74. package/components/hy-swipe-action/hy-swipe-action.vue +34 -15
  75. package/components/hy-swipe-action/index.scss +0 -1
  76. package/components/hy-switch/typing.d.ts +4 -0
  77. package/components/hy-tabbar/props.ts +2 -1
  78. package/components/hy-tabbar/typing.d.ts +5 -4
  79. package/components/hy-tabs/hy-tabs.vue +338 -336
  80. package/components/hy-tabs/index.scss +6 -6
  81. package/components/hy-tabs/typing.d.ts +41 -33
  82. package/components/hy-textarea/hy-textarea.vue +2 -2
  83. package/components/hy-textarea/typing.d.ts +4 -0
  84. package/components/hy-toast/hy-toast.vue +17 -9
  85. package/components/hy-toast/index.scss +1 -1
  86. package/components/hy-toast/typing.d.ts +56 -37
  87. package/components/hy-tooltip/hy-tooltip.vue +1 -1
  88. package/components/hy-tooltip/index.scss +1 -0
  89. package/components/hy-tooltip/props.ts +1 -1
  90. package/components/hy-upload/hy-upload.vue +16 -1
  91. package/components/hy-upload/index.scss +149 -144
  92. package/components/index.ts +6 -0
  93. package/global.d.ts +2 -0
  94. package/libs/api/http.ts +122 -119
  95. package/libs/config/icon.ts +442 -430
  96. package/libs/css/_function.scss +7 -13
  97. package/libs/css/iconfont.css +445 -441
  98. package/libs/css/theme.scss +3 -1
  99. package/libs/locale/lang/en-US.ts +4 -0
  100. package/libs/locale/lang/zh-CN.ts +4 -0
  101. package/libs/typing/index.ts +80 -0
  102. package/package.json +5 -2
  103. package/tags.json +1 -1
  104. package/web-types.json +1 -1
  105. package/components/hy-folding-panel/hy-folding-panel-group.vue +0 -163
  106. 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>