hy-app 0.2.13 → 0.2.15

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 (223) hide show
  1. package/components/hy-action-sheet/hy-action-sheet.vue +81 -13
  2. package/components/hy-action-sheet/typing.d.ts +1 -3
  3. package/components/hy-address-picker/hy-address-picker.vue +109 -8
  4. package/components/hy-address-picker/index.scss +2 -2
  5. package/components/hy-address-picker/typing.d.ts +39 -30
  6. package/components/hy-avatar/hy-avatar.vue +78 -4
  7. package/components/hy-avatar/typing.d.ts +21 -16
  8. package/components/hy-back-top/hy-back-top.vue +86 -28
  9. package/components/hy-back-top/typing.d.ts +17 -12
  10. package/components/hy-badge/hy-badge.vue +114 -43
  11. package/components/hy-badge/typing.d.ts +20 -15
  12. package/components/hy-button/HyButton.docgen.js +6 -0
  13. package/components/hy-button/hy-button.vue +70 -77
  14. package/components/hy-button/props.ts +40 -41
  15. package/components/hy-calendar/hy-calendar.vue +290 -143
  16. package/components/hy-calendar/typing.d.ts +38 -31
  17. package/components/hy-card/hy-card.vue +139 -36
  18. package/components/hy-card/typing.d.ts +39 -28
  19. package/components/hy-cell/hy-cell.vue +131 -67
  20. package/components/hy-cell/typing.d.ts +6 -1
  21. package/components/hy-check-button/hy-check-button.vue +101 -32
  22. package/components/hy-check-button/typing.d.ts +26 -19
  23. package/components/hy-checkbox/hy-checkbox.vue +167 -78
  24. package/components/hy-checkbox/typing.d.ts +26 -19
  25. package/components/hy-code-input/hy-code-input.vue +101 -5
  26. package/components/hy-code-input/typing.d.ts +9 -0
  27. package/components/hy-config-provider/hy-config-provider.vue +44 -24
  28. package/components/hy-config-provider/typing.d.ts +0 -4
  29. package/components/hy-count-down/hy-count-down.vue +99 -62
  30. package/components/hy-count-down/typing.d.ts +18 -5
  31. package/components/hy-count-to/hy-count-to.vue +165 -113
  32. package/components/hy-count-to/typing.d.ts +15 -11
  33. package/components/hy-datetime-picker/hy-datetime-picker.vue +338 -232
  34. package/components/hy-datetime-picker/typing.d.ts +49 -39
  35. package/components/hy-divider/hy-divider.vue +128 -64
  36. package/components/hy-divider/typing.d.ts +16 -16
  37. package/components/hy-dropdown/hy-dropdown.vue +57 -19
  38. package/components/hy-dropdown/typing.d.ts +14 -14
  39. package/components/hy-dropdown-item/hy-dropdown-item.vue +34 -5
  40. package/components/hy-dropdown-item/typing.d.ts +13 -6
  41. package/components/hy-empty/hy-empty.vue +64 -6
  42. package/components/hy-empty/typing.d.ts +5 -0
  43. package/components/hy-float-button/hy-float-button.vue +117 -5
  44. package/components/hy-float-button/typing.d.ts +7 -0
  45. package/components/hy-folding-panel/hy-folding-panel.vue +87 -25
  46. package/components/hy-folding-panel/typing.d.ts +24 -15
  47. package/components/hy-grid/hy-grid.vue +95 -35
  48. package/components/hy-grid/typing.d.ts +24 -19
  49. package/components/hy-icon/hy-icon.vue +84 -6
  50. package/components/hy-icon/typing.d.ts +5 -0
  51. package/components/hy-image/hy-image.vue +105 -6
  52. package/components/hy-image/typing.d.ts +9 -0
  53. package/components/hy-input/hy-input.vue +277 -130
  54. package/components/hy-input/props.ts +13 -14
  55. package/components/hy-input/typing.d.ts +59 -38
  56. package/components/hy-line/hy-line.vue +65 -25
  57. package/components/hy-line-progress/hy-line-progress.vue +68 -35
  58. package/components/hy-list/hy-list.vue +127 -61
  59. package/components/hy-list/typing.d.ts +19 -12
  60. package/components/hy-loading/hy-loading.vue +79 -25
  61. package/components/hy-menu/hy-menu.vue +69 -45
  62. package/components/hy-menu/typing.d.ts +22 -15
  63. package/components/hy-modal/hy-modal.vue +91 -4
  64. package/components/hy-modal/typing.d.ts +11 -0
  65. package/components/hy-navbar/hy-navbar.vue +105 -25
  66. package/components/hy-navbar/typing.d.ts +25 -20
  67. package/components/hy-notice-bar/hy-notice-bar.vue +97 -19
  68. package/components/hy-notice-bar/typing.d.ts +22 -17
  69. package/components/hy-notify/hy-notify.vue +106 -54
  70. package/components/hy-number-step/hy-number-step.vue +211 -120
  71. package/components/hy-number-step/typing.d.ts +45 -28
  72. package/components/hy-overlay/hy-overlay.vue +60 -16
  73. package/components/hy-overlay/typing.d.ts +11 -6
  74. package/components/hy-pagination/hy-pagination.vue +94 -37
  75. package/components/hy-pagination/typing.d.ts +20 -11
  76. package/components/hy-picker/hy-picker.vue +225 -160
  77. package/components/hy-picker/typing.d.ts +51 -28
  78. package/components/hy-popover/hy-popover.vue +55 -7
  79. package/components/hy-popover/typing.d.ts +21 -1
  80. package/components/hy-popup/hy-popup.vue +164 -99
  81. package/components/hy-popup/typing.d.ts +11 -0
  82. package/components/hy-price/hy-price.vue +77 -30
  83. package/components/hy-price/typing.d.ts +10 -10
  84. package/components/hy-qrcode/hy-qrcode.vue +75 -5
  85. package/components/hy-qrcode/typing.d.ts +25 -16
  86. package/components/hy-radio/hy-radio.vue +169 -88
  87. package/components/hy-radio/typing.d.ts +29 -22
  88. package/components/hy-rate/hy-rate.vue +155 -104
  89. package/components/hy-rate/typing.d.ts +23 -16
  90. package/components/hy-read-more/hy-read-more.vue +83 -56
  91. package/components/hy-read-more/typing.d.ts +18 -11
  92. package/components/hy-scroll-list/hy-scroll-list.vue +69 -58
  93. package/components/hy-scroll-list/typing.d.ts +14 -7
  94. package/components/hy-search/hy-search.vue +168 -62
  95. package/components/hy-search/typing.d.ts +47 -26
  96. package/components/hy-signature/hy-signature.vue +354 -272
  97. package/components/hy-signature/typing.d.ts +65 -52
  98. package/components/hy-slider/hy-slider.vue +208 -160
  99. package/components/hy-slider/typing.d.ts +28 -17
  100. package/components/hy-steps/hy-steps.vue +125 -99
  101. package/components/hy-steps/typing.d.ts +21 -14
  102. package/components/hy-submit-bar/hy-submit-bar.vue +129 -48
  103. package/components/hy-submit-bar/typing.d.ts +30 -23
  104. package/components/hy-subsection/hy-subsection.vue +139 -96
  105. package/components/hy-subsection/typing.d.ts +23 -16
  106. package/components/hy-swipe-action/hy-swipe-action.vue +161 -135
  107. package/components/hy-swipe-action/typing.d.ts +26 -17
  108. package/components/hy-swiper/hy-swiper.vue +178 -73
  109. package/components/hy-swiper/typing.d.ts +37 -28
  110. package/components/hy-switch/hy-switch.vue +107 -60
  111. package/components/hy-switch/typing.d.ts +25 -18
  112. package/components/hy-tabs/hy-tabs.vue +170 -160
  113. package/components/hy-tabs/typing.d.ts +36 -22
  114. package/components/hy-tag/hy-tag.vue +133 -58
  115. package/components/hy-tag/typing.d.ts +26 -18
  116. package/components/hy-text/hy-text.vue +106 -6
  117. package/components/hy-text/typing.d.ts +31 -26
  118. package/components/hy-textarea/hy-textarea.vue +183 -89
  119. package/components/hy-textarea/typing.d.ts +41 -24
  120. package/components/hy-tooltip/hy-tooltip.vue +145 -101
  121. package/components/hy-tooltip/typing.d.ts +18 -13
  122. package/components/hy-transition/hy-transition.vue +48 -13
  123. package/components/hy-transition/typing.d.ts +17 -0
  124. package/components/hy-upload/hy-upload.vue +113 -148
  125. package/components/hy-upload/typing.d.ts +71 -71
  126. package/components/hy-warn/hy-warn.vue +79 -36
  127. package/components/hy-warn/typing.d.ts +18 -11
  128. package/components/hy-waterfall/hy-waterfall.vue +90 -77
  129. package/components/hy-watermark/hy-watermark.vue +82 -5
  130. package/components/hy-watermark/typing.d.ts +20 -20
  131. package/global.d.ts +39 -59
  132. package/package.json +5 -13
  133. package/utils/inspect.ts +3 -1
  134. package/web-types.json +1 -1
  135. package/component-helper.ts +0 -177
  136. package/components.json +0 -3287
  137. package/dist/attributes.json +0 -1
  138. package/dist/docs/components/hy-action-sheet/hy-action-sheet.md +0 -41
  139. package/dist/docs/components/hy-address-picker/hy-address-picker.md +0 -25
  140. package/dist/docs/components/hy-avatar/hy-avatar.md +0 -19
  141. package/dist/docs/components/hy-back-top/hy-back-top.md +0 -19
  142. package/dist/docs/components/hy-badge/hy-badge.md +0 -13
  143. package/dist/docs/components/hy-button/hy-button.md +0 -61
  144. package/dist/docs/components/hy-calendar/header.md +0 -17
  145. package/dist/docs/components/hy-calendar/hy-calendar.md +0 -27
  146. package/dist/docs/components/hy-calendar/month.md +0 -38
  147. package/dist/docs/components/hy-card/hy-card.md +0 -24
  148. package/dist/docs/components/hy-cell/hy-cell.md +0 -26
  149. package/dist/docs/components/hy-check-button/hy-check-button.md +0 -14
  150. package/dist/docs/components/hy-checkbox/hy-checkbox.md +0 -21
  151. package/dist/docs/components/hy-code-input/hy-code-input.md +0 -15
  152. package/dist/docs/components/hy-config-provider/hy-config-provider.md +0 -13
  153. package/dist/docs/components/hy-count-down/hy-count-down.md +0 -34
  154. package/dist/docs/components/hy-count-to/hy-count-to.md +0 -31
  155. package/dist/docs/components/hy-datetime-picker/hy-datetime-picker.md +0 -25
  156. package/dist/docs/components/hy-divider/hy-divider.md +0 -13
  157. package/dist/docs/components/hy-dropdown/hy-dropdown.md +0 -13
  158. package/dist/docs/components/hy-dropdown-item/hy-dropdown-item.md +0 -20
  159. package/dist/docs/components/hy-empty/hy-empty.md +0 -20
  160. package/dist/docs/components/hy-float-button/hy-float-button.md +0 -20
  161. package/dist/docs/components/hy-folding-panel/hy-folding-panel.md +0 -24
  162. package/dist/docs/components/hy-form/hy-form.md +0 -29
  163. package/dist/docs/components/hy-grid/hy-grid.md +0 -19
  164. package/dist/docs/components/hy-icon/hy-icon.md +0 -13
  165. package/dist/docs/components/hy-image/hy-image.md +0 -22
  166. package/dist/docs/components/hy-input/hy-input.md +0 -29
  167. package/dist/docs/components/hy-line/hy-line.md +0 -7
  168. package/dist/docs/components/hy-line-progress/hy-line-progress.md +0 -13
  169. package/dist/docs/components/hy-list/hy-list.md +0 -25
  170. package/dist/docs/components/hy-loading/hy-loading.md +0 -14
  171. package/dist/docs/components/hy-login/ThePhoneLogin.md +0 -20
  172. package/dist/docs/components/hy-login/TheUserLogin.md +0 -44
  173. package/dist/docs/components/hy-login/hy-login.md +0 -14
  174. package/dist/docs/components/hy-menu/hy-menu.md +0 -21
  175. package/dist/docs/components/hy-modal/hy-modal.md +0 -23
  176. package/dist/docs/components/hy-navbar/hy-navbar.md +0 -22
  177. package/dist/docs/components/hy-notice-bar/hy-column-notice.md +0 -20
  178. package/dist/docs/components/hy-notice-bar/hy-notice-bar.md +0 -14
  179. package/dist/docs/components/hy-notice-bar/hy-row-notice.md +0 -20
  180. package/dist/docs/components/hy-notify/hy-notify.md +0 -23
  181. package/dist/docs/components/hy-number-step/hy-number-step.md +0 -27
  182. package/dist/docs/components/hy-overlay/hy-overlay.md +0 -19
  183. package/dist/docs/components/hy-pagination/hy-pagination.md +0 -14
  184. package/dist/docs/components/hy-parse/hy-parse.md +0 -46
  185. package/dist/docs/components/hy-parse/node/node.md +0 -7
  186. package/dist/docs/components/hy-picker/hy-picker.md +0 -32
  187. package/dist/docs/components/hy-popover/hy-popover.md +0 -34
  188. package/dist/docs/components/hy-popup/hy-popup.md +0 -22
  189. package/dist/docs/components/hy-price/hy-price.md +0 -13
  190. package/dist/docs/components/hy-qrcode/hy-qrcode.md +0 -15
  191. package/dist/docs/components/hy-radio/hy-radio.md +0 -21
  192. package/dist/docs/components/hy-rate/hy-rate.md +0 -14
  193. package/dist/docs/components/hy-read-more/hy-read-more.md +0 -21
  194. package/dist/docs/components/hy-scroll-list/hy-scroll-list.md +0 -21
  195. package/dist/docs/components/hy-search/hy-search.md +0 -27
  196. package/dist/docs/components/hy-signature/hy-signature.md +0 -45
  197. package/dist/docs/components/hy-slider/hy-slider.md +0 -24
  198. package/dist/docs/components/hy-status-bar/hy-status-bar.md +0 -13
  199. package/dist/docs/components/hy-steps/hy-steps.md +0 -23
  200. package/dist/docs/components/hy-submit-bar/hy-submit-bar.md +0 -21
  201. package/dist/docs/components/hy-subsection/hy-subsection.md +0 -14
  202. package/dist/docs/components/hy-swipe-action/hy-swipe-action.md +0 -29
  203. package/dist/docs/components/hy-swiper/hy-swiper-indicator.md +0 -23
  204. package/dist/docs/components/hy-swiper/hy-swiper.md +0 -22
  205. package/dist/docs/components/hy-switch/hy-switch.md +0 -20
  206. package/dist/docs/components/hy-tabBar/hy-tabBar.md +0 -13
  207. package/dist/docs/components/hy-tabs/hy-tabs.md +0 -27
  208. package/dist/docs/components/hy-tag/hy-tag.md +0 -21
  209. package/dist/docs/components/hy-text/hy-text.md +0 -13
  210. package/dist/docs/components/hy-textarea/hy-textarea.md +0 -19
  211. package/dist/docs/components/hy-toast/hy-toast.md +0 -17
  212. package/dist/docs/components/hy-tooltip/hy-tooltip.md +0 -13
  213. package/dist/docs/components/hy-transition/hy-transition.md +0 -25
  214. package/dist/docs/components/hy-upload/hy-upload.md +0 -25
  215. package/dist/docs/components/hy-warn/hy-warn.md +0 -14
  216. package/dist/docs/components/hy-waterfall/hy-waterfall.md +0 -30
  217. package/dist/docs/components/hy-watermark/hy-watermark.md +0 -7
  218. package/dist/docs/components/message/TheMessage.md +0 -17
  219. package/dist/docs/components/yk-dialog/yk-dialog.md +0 -7
  220. package/dist/tags.json +0 -1
  221. package/dist/web-types.json +0 -1
  222. package/docgen.config.js +0 -14
  223. package/web-types.config.js +0 -7
@@ -1,48 +1,48 @@
1
- import type { CSSProperties } from "vue";
1
+ import type { CSSProperties } from 'vue'
2
2
 
3
3
  export default interface HyDropdownProps {
4
4
  /**
5
5
  * @description 标题和选项卡选中的颜色(默认#2979ff)
6
6
  * */
7
- activeColor?: string;
7
+ activeColor?: string
8
8
  /**
9
9
  * @description 标题和选项卡未选中的颜色(默认#606266)
10
10
  * */
11
- inactiveColor?: string;
11
+ inactiveColor?: string
12
12
  /**
13
13
  * @description 点击遮罩是否关闭菜单(默认true)
14
14
  * */
15
- closeOnClickMask?: boolean;
15
+ closeOnClickMask?: boolean
16
16
  /**
17
17
  * @description 是否粘性定位(默认true)
18
18
  * */
19
- sticky?: boolean;
19
+ sticky?: boolean
20
20
  /**
21
21
  * @description 标题菜单的高度,单位任意(默认80)
22
22
  * */
23
- height?: number | string;
23
+ height?: number | string
24
24
  /**
25
25
  * @description 标题菜单是否显示下边框(默认false)
26
26
  * */
27
- borderBottom?: boolean;
27
+ borderBottom?: boolean
28
28
  /**
29
29
  * @description 标题的字体大小,单位任意,数值默认为rpx单位(默认28)
30
30
  * */
31
- titleSize?: number;
31
+ titleSize?: number
32
32
  /**
33
33
  * @description 菜单展开内容下方的圆角值,单位任意(默认0)
34
34
  * */
35
- borderRadius?: number;
35
+ borderRadius?: number
36
36
  /**
37
- * @description 是否显示遮罩
37
+ * @description 图标名称
38
38
  * */
39
- menuIcon?: string;
39
+ menuIcon?: string
40
40
  /**
41
- * @description 是否显示遮罩
41
+ * @description 图标大小
42
42
  * */
43
- menuIconSize?: number;
43
+ menuIconSize?: number
44
44
  /**
45
45
  * @description 定义需要用到的外部样式
46
46
  * */
47
- customStyle?: CSSProperties;
47
+ customStyle?: CSSProperties
48
48
  }
@@ -58,6 +58,10 @@
58
58
  </template>
59
59
 
60
60
  <script lang="ts">
61
+ /**
62
+ * 主要提供筛选下拉筛选框,内置基础筛选功能,可以根据自己的需求自定义筛选项。和hy-dropdown组合用法
63
+ * @displayName hy-dropdown-item
64
+ */
61
65
  export default {
62
66
  name: 'hy-dropdown-item',
63
67
  options: {
@@ -67,9 +71,18 @@ export default {
67
71
  </script>
68
72
 
69
73
  <script setup lang="ts">
70
- import { computed, inject, ref, onMounted, watch, useSlots, toRefs, getCurrentInstance } from 'vue'
71
- import defaultProps from './props'
72
- import type IProps from './typing'
74
+ import {
75
+ computed,
76
+ inject,
77
+ ref,
78
+ onMounted,
79
+ watch,
80
+ useSlots,
81
+ toRefs,
82
+ getCurrentInstance,
83
+ type PropType,
84
+ } from 'vue'
85
+ import type { IDropdownItemEmits } from './typing'
73
86
  import type FatherIProps from '../hy-dropdown/typing'
74
87
  import type { DropdownMenuItem } from './typing'
75
88
  import { addUnit, getRect, throttle } from '../../utils'
@@ -78,9 +91,25 @@ import { IconConfig } from '../../config'
78
91
  import HyOverlay from '../hy-overlay/hy-overlay.vue'
79
92
  import HyIcon from '../hy-icon/hy-icon.vue'
80
93
 
81
- const props = withDefaults(defineProps<IProps>(), defaultProps)
94
+ // const props = withDefaults(defineProps<IProps>(), defaultProps)
95
+ const props = defineProps({
96
+ /** 获取值 */
97
+ modelValue: String,
98
+ /** 标题 */
99
+ title: String,
100
+ /** 下拉选择值 */
101
+ menus: {
102
+ type: Array as unknown as PropType<DropdownMenuItem[]>,
103
+ default: [],
104
+ },
105
+ /** 禁用组件点击 */
106
+ disabled: {
107
+ type: Boolean,
108
+ default: false,
109
+ },
110
+ })
82
111
  const { modelValue, menus } = toRefs(props)
83
- const emits = defineEmits(['update:modelValue', 'change'])
112
+ const emits = defineEmits<IDropdownItemEmits>()
84
113
 
85
114
  const slots = useSlots()
86
115
  //是否有插槽
@@ -2,28 +2,35 @@ export interface DropdownMenuItem {
2
2
  /**
3
3
  * @description 展示标题
4
4
  * */
5
- label: string;
5
+ label: string
6
6
  /**
7
7
  * @description 值
8
8
  * */
9
- value: string | number;
9
+ value: string | number
10
10
  }
11
11
 
12
12
  export default interface HyDropdownItemProps {
13
13
  /**
14
14
  * @description 获取值
15
15
  * */
16
- modelValue: string | number;
16
+ modelValue: string | number
17
17
  /**
18
18
  * @description 标题
19
19
  * */
20
- title: string;
20
+ title: string
21
21
  /**
22
22
  * @description 下拉选择值
23
23
  * */
24
- menus?: DropdownMenuItem[];
24
+ menus?: DropdownMenuItem[]
25
25
  /**
26
26
  * @description 禁用组件点击
27
27
  * */
28
- disabled?: boolean;
28
+ disabled?: boolean
29
+ }
30
+
31
+ export interface IDropdownItemEmits {
32
+ /** 选中值触发 */
33
+ (e: 'change', item: DropdownMenuItem): void
34
+ /** 选中值触发 */
35
+ (e: 'update:modelValue', item: DropdownMenuItem): void
29
36
  }
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <view class="hy-empty" v-if="show" :style="emptyStyle">
2
+ <view :class="['hy-empty', customClass]" v-if="show" :style="emptyStyle">
3
3
  <view class="hy-empty__img" :style="imgStyle">
4
4
  <HyIcon
5
5
  :name="imageUrl || emptyIcon[mode].icon"
@@ -30,6 +30,11 @@
30
30
  </template>
31
31
 
32
32
  <script lang="ts">
33
+ /**
34
+ * 加载的第一页数据就为空
35
+ * @displayName hy-empty
36
+ */
37
+ defineOptions({})
33
38
  export default {
34
39
  name: 'hy-empty',
35
40
  options: {
@@ -41,20 +46,73 @@ export default {
41
46
  </script>
42
47
 
43
48
  <script setup lang="ts">
44
- import { computed, type CSSProperties, toRefs } from 'vue'
45
- import defaultProps from './props'
46
- import type IProps from './typing'
49
+ import { computed, toRefs } from 'vue'
50
+ import type { CSSProperties, PropType } from 'vue'
47
51
  import { addUnit } from '../../utils'
48
52
  import emptyIcon from './icon'
53
+ import type { HyButtonProps } from '../hy-button/typing'
54
+ import type { IEmptyEmits } from './typing'
49
55
 
50
56
  // 组件
51
57
  import HyButton from '../hy-button/hy-button.vue'
52
58
  import HyIcon from '../hy-icon/hy-icon.vue'
53
59
 
54
- const props = withDefaults(defineProps<IProps>(), defaultProps)
60
+ // const props = withDefaults(defineProps<IProps>(), defaultProps)
61
+ const props = defineProps({
62
+ /** 是否显示空状态 */
63
+ show: {
64
+ type: Boolean,
65
+ default: true,
66
+ required: true,
67
+ },
68
+ /** 缺省页内容 */
69
+ mode: {
70
+ type: String,
71
+ default: 'car',
72
+ },
73
+ /** 空状态图片 */
74
+ imageUrl: String,
75
+ /** 组件层级 */
76
+ zIndex: {
77
+ type: Number,
78
+ default: 889,
79
+ },
80
+ /** 组件层级 */
81
+ width: {
82
+ type: Number,
83
+ default: 350,
84
+ },
85
+ /** icon高度 */
86
+ height: {
87
+ type: [String, Number],
88
+ default: 'auto',
89
+ },
90
+ /** 提示信息 */
91
+ description: String,
92
+ /** 提示信息大小 */
93
+ desSize: {
94
+ type: Number,
95
+ default: 15,
96
+ },
97
+ /** 提示信息颜色 */
98
+ desColor: String,
99
+ /** 图片margin */
100
+ imgMargin: String,
101
+ /** 按钮属性值 */
102
+ button: {
103
+ type: Object as unknown as PropType<HyButtonProps>,
104
+ },
105
+ navigateUrl: String,
106
+ /** 定义需要用到的外部样式 */
107
+ customStyle: {
108
+ type: Object as PropType<CSSProperties>,
109
+ },
110
+ /** 自定义外部类名 */
111
+ customClass: String,
112
+ })
55
113
  const { zIndex, width, height, imgMargin, navigateUrl, desSize, desColor, customStyle } =
56
114
  toRefs(props)
57
- const emit = defineEmits(['click'])
115
+ const emit = defineEmits<IEmptyEmits>()
58
116
 
59
117
  const emptyDescription = computed(() => {
60
118
  return props.description
@@ -76,3 +76,8 @@ export default interface HyEmptyProps {
76
76
  * */
77
77
  customStyle?: CSSProperties
78
78
  }
79
+
80
+ export interface IEmptyEmits {
81
+ /** 点击按钮触发 */
82
+ (e: 'click'): void
83
+ }
@@ -9,6 +9,7 @@
9
9
  'hy-float-button__shadow': shadow,
10
10
  },
11
11
  `hy-float-button__${shape}`,
12
+ customClass,
12
13
  ]"
13
14
  @touchmove.stop.prevent="handleTouchMove"
14
15
  @touchstart="handleTouchStart"
@@ -60,6 +61,11 @@
60
61
  </template>
61
62
 
62
63
  <script lang="ts">
64
+ /**
65
+ * 悬浮动作按钮组件,按下可显示一组动作按钮。
66
+ * @displayName hy-float-button
67
+ */
68
+ defineOptions({})
63
69
  export default {
64
70
  name: 'hy-float-button',
65
71
  options: {
@@ -71,18 +77,124 @@ export default {
71
77
  </script>
72
78
 
73
79
  <script lang="ts" setup>
74
- import { computed, type CSSProperties, getCurrentInstance, onMounted, ref, toRefs } from 'vue'
75
- import type IProps from './typing'
80
+ import { computed, getCurrentInstance, onMounted, ref, toRefs } from 'vue'
81
+ import type { CSSProperties, PropType } from 'vue'
82
+ import type { IFloatButtonEmits, IGap } from './typing'
76
83
  import type { MenusType } from './typing'
77
- import defaultProps from './props'
78
84
  import { addUnit, getPx, getRect, guid, isH5 } from '../../utils'
79
85
  import { HyApp } from '../../typing/modules/common'
86
+ import { IconConfig } from '../../config'
80
87
 
81
88
  // 组件
82
89
  import HyIcon from '../hy-icon/hy-icon.vue'
83
90
  import HyLine from '../hy-line/hy-line.vue'
84
91
 
85
- const props = withDefaults(defineProps<IProps>(), defaultProps)
92
+ // const props = withDefaults(defineProps<IProps>(), defaultProps)
93
+ const props = defineProps({
94
+ /** 菜单栏集合 */
95
+ menus: {
96
+ type: Array as unknown as PropType<MenusType[]>,
97
+ default: [],
98
+ },
99
+ /**
100
+ * 打开方向
101
+ * @values row,column
102
+ * */
103
+ direction: {
104
+ type: String,
105
+ default: 'column',
106
+ },
107
+ /** 按钮显示的图标 */
108
+ icon: {
109
+ type: String,
110
+ default: IconConfig.PLUS,
111
+ },
112
+ /** 按钮图标大小 */
113
+ iconSize: String,
114
+ /** 按钮图标颜色 */
115
+ iconColor: String,
116
+ /** 到边框最小距离 */
117
+ gap: {
118
+ type: Object as unknown as PropType<IGap>,
119
+ default: { left: 16, right: 16, top: 16, bottom: 40 },
120
+ },
121
+ /** 层级 */
122
+ zIndex: {
123
+ type: Number,
124
+ default: 10086,
125
+ },
126
+ /** 按钮背景颜色 */
127
+ bgColor: String,
128
+ /** 按钮文字 */
129
+ text: String,
130
+ /** 按钮文字大小 */
131
+ fontSize: {
132
+ type: [Number, String],
133
+ default: 12,
134
+ },
135
+ /** 按钮文字的颜色 */
136
+ textColor: String,
137
+ /**
138
+ * 按钮的尺寸
139
+ * @values small,medium,large
140
+ * */
141
+ size: {
142
+ type: String,
143
+ default: 'medium',
144
+ },
145
+ /**
146
+ * 按钮的形状
147
+ * @values circle,square
148
+ * */
149
+ shape: {
150
+ type: String,
151
+ default: 'circle',
152
+ },
153
+ /** 按钮的透明度 */
154
+ opacity: {
155
+ type: Number,
156
+ default: 1,
157
+ },
158
+ /** 是否显示阴影 */
159
+ shadow: {
160
+ type: Boolean,
161
+ default: true,
162
+ },
163
+ /** 是否显示漂浮的动画 */
164
+ float: {
165
+ type: Boolean,
166
+ default: true,
167
+ },
168
+ /** 是否固定位置 */
169
+ fixed: {
170
+ type: Boolean,
171
+ default: true,
172
+ },
173
+ /** 是否能拖动 */
174
+ draggable: {
175
+ type: Boolean,
176
+ default: true,
177
+ },
178
+ /**
179
+ * 悬浮按钮位置
180
+ * @values left-top,left-bottom,right-top,right-bottom,left-center,right-center,top-center,bottom-center
181
+ * */
182
+ position: {
183
+ type: String,
184
+ default: 'right-bottom',
185
+ },
186
+ /** 禁用点击打开菜单栏 */
187
+ expandable: {
188
+ type: Boolean,
189
+ default: true,
190
+ },
191
+ /** 定义需要用到的外部样式 */
192
+ customStyle: {
193
+ type: Object as PropType<CSSProperties>,
194
+ },
195
+ /** 自定义外部类名 */
196
+ customClass: String,
197
+ })
86
198
  const {
87
199
  menus,
88
200
  customStyle,
@@ -98,7 +210,7 @@ const {
98
210
  position,
99
211
  expandable,
100
212
  } = toRefs(props)
101
- const emit = defineEmits(['click', 'clickItem'])
213
+ const emit = defineEmits<IFloatButtonEmits>()
102
214
 
103
215
  const instance = getCurrentInstance()
104
216
  const btnSize: AnyObject = {
@@ -115,3 +115,10 @@ export default interface HyFloatButtonProps {
115
115
  * */
116
116
  customStyle?: CSSProperties
117
117
  }
118
+
119
+ export interface IFloatButtonEmits {
120
+ /** 点击悬浮按钮触发 */
121
+ (e: 'click'): void
122
+ /** 点击菜单按钮触发 */
123
+ (e: 'clickItem', item: MenusType, index: number): void
124
+ }
@@ -39,64 +39,126 @@
39
39
  </template>
40
40
 
41
41
  <script lang="ts">
42
+ /**
43
+ * 通过折叠面板收纳内容区域。
44
+ * @displayName hy-folding-panel
45
+ */
46
+ defineOptions({})
42
47
  export default {
43
48
  name: 'hy-folding-panel',
44
49
  options: {
45
50
  addGlobalClass: true,
46
51
  virtualHost: true,
47
- styleIsolation: 'shared'
48
- }
52
+ styleIsolation: 'shared',
53
+ },
49
54
  }
50
55
  </script>
51
56
 
52
57
  <script setup lang="ts">
53
- import { toRefs, ref, watch } from "vue";
54
- import defaultProps from "./props";
55
- import type IProps from "./typing";
56
- import type { PanelVo } from "./typing";
58
+ import { toRefs, ref, watch } from 'vue'
59
+ import type { CSSProperties, PropType } from 'vue'
60
+ import type { IFoldingPanel, PanelVo } from './typing'
61
+ import { addUnit } from '../../utils'
62
+ import { ColorConfig } from '../../config'
57
63
 
58
- import HyCell from "../hy-cell/hy-cell.vue";
59
- import HyLine from "../hy-line/hy-line.vue";
60
- import { addUnit } from "../../utils";
64
+ import HyCell from '../hy-cell/hy-cell.vue'
65
+ import HyLine from '../hy-line/hy-line.vue'
61
66
 
62
- const props = withDefaults(defineProps<IProps>(), defaultProps);
63
- const { list, contentHeight, accordion } = toRefs(props);
64
- const emit = defineEmits(["open", "close", "change"]);
67
+ // const props = withDefaults(defineProps<IProps>(), defaultProps);
68
+ const props = defineProps({
69
+ /** 数据集 */
70
+ list: {
71
+ type: Array as PropType<PanelVo[]>,
72
+ default: [],
73
+ },
74
+ /** 是否手风琴模式 */
75
+ accordion: {
76
+ type: Boolean,
77
+ default: false,
78
+ },
79
+ /** 头部标题 */
80
+ title: String,
81
+ /** 是否显示头部底部边框 */
82
+ titleBorder: {
83
+ type: Boolean,
84
+ default: false,
85
+ },
86
+ /** 是否显示cell下边框 */
87
+ border: {
88
+ type: Boolean,
89
+ default: true,
90
+ },
91
+ /** 标题前缀竖线颜色 */
92
+ verticalColor: {
93
+ type: String,
94
+ default: ColorConfig.primary,
95
+ },
96
+ /** 是否显示标题前缀竖线 */
97
+ showVertical: {
98
+ type: Boolean,
99
+ default: true,
100
+ },
101
+ /** 是否禁用 */
102
+ disabled: {
103
+ type: Boolean,
104
+ default: false,
105
+ },
106
+ /**
107
+ * 单元的大小
108
+ * @values large,medium,small
109
+ * */
110
+ size: {
111
+ type: String,
112
+ default: 'medium',
113
+ },
114
+ /** 内容面板高度 */
115
+ contentHeight: {
116
+ type: [Number, String],
117
+ default: 120,
118
+ },
119
+ /** 定义需要用到的外部样式 */
120
+ customStyle: {
121
+ type: Object as PropType<CSSProperties>,
122
+ },
123
+ })
124
+ const { list, contentHeight, accordion } = toRefs(props)
125
+ const emit = defineEmits<IFoldingPanel>()
65
126
 
66
- const lists = ref<PanelVo[]>([]);
127
+ const lists = ref<PanelVo[]>([])
67
128
 
68
129
  watch(
69
130
  () => list.value,
70
131
  (newValue: PanelVo[]) => {
71
132
  lists.value = newValue.map((item) => ({
72
133
  ...item,
73
- arrowDirection: "down",
134
+ arrowDirection: 'down',
74
135
  spread: false,
75
- }));
136
+ }))
76
137
  },
77
138
  { immediate: true },
78
- );
139
+ )
79
140
 
80
141
  const clickHandler = (temp: PanelVo, index: number) => {
81
142
  // if (temp?.disabled && temp?.animating) return;
82
143
  lists.value = list.value.map((item, i) => {
83
144
  if (accordion.value) {
84
145
  // 判断是否是收起来
85
- item.spread = i === index ? !item.spread : false;
146
+ item.spread = i === index ? !item.spread : false
86
147
  } else {
87
148
  if (i === index) {
88
- item.spread = !item.spread;
149
+ item.spread = !item.spread
89
150
  }
90
151
  }
91
152
 
92
- item.arrowDirection = item.spread ? "up" : "down";
93
- return item;
94
- });
95
- emit("change", temp, index);
96
- emit(temp.spread ? "open" : "close", temp, index);
97
- };
153
+ item.arrowDirection = item.spread ? 'up' : 'down'
154
+ return item
155
+ })
156
+ const event = temp.spread ? 'open' : 'close'
157
+ emit('change', temp, index)
158
+ emit(event, temp, index)
159
+ }
98
160
  </script>
99
161
 
100
162
  <style lang="scss" scoped>
101
- @import "./index.scss";
163
+ @import './index.scss';
102
164
  </style>
@@ -1,59 +1,68 @@
1
- import type { CSSProperties } from "vue";
2
- import type { CellContentVo } from "../hy-cell/typing";
1
+ import type { CSSProperties } from 'vue'
2
+ import type { CellContentVo } from '../hy-cell/typing'
3
3
 
4
4
  export interface PanelVo extends CellContentVo {
5
5
  /**
6
6
  * @description 是否展示
7
7
  * */
8
- spread?: boolean;
8
+ spread?: boolean
9
9
  /**
10
10
  * @description 展示面板里自定义值
11
11
  * */
12
- content?: string;
12
+ content?: string
13
13
  }
14
14
  export default interface HyFoldingPanelProps {
15
15
  /**
16
16
  * @description 数据集
17
17
  * */
18
- list: PanelVo[];
18
+ list: PanelVo[]
19
19
  /**
20
20
  * @description 是否手风琴模式( 默认 false )
21
21
  * */
22
- accordion?: boolean;
22
+ accordion?: boolean
23
23
  /**
24
24
  * @description 头部标题
25
25
  * */
26
- title?: string;
26
+ title?: string
27
27
  /**
28
28
  * @description 是否显示头部底部边框
29
29
  * */
30
- titleBorder?: boolean;
30
+ titleBorder?: boolean
31
31
  /**
32
32
  * @description 是否显示cell下边框 (默认 true )
33
33
  * */
34
- border?: boolean;
34
+ border?: boolean
35
35
  /**
36
36
  * @description 标题前缀竖线颜色
37
37
  * */
38
- verticalColor?: string;
38
+ verticalColor?: string
39
39
  /**
40
40
  * @description 是否显示标题前缀竖线
41
41
  * */
42
- showVertical?: boolean;
42
+ showVertical?: boolean
43
43
  /**
44
44
  * @description 是否禁用(默认false)
45
45
  * */
46
- disabled?: boolean;
46
+ disabled?: boolean
47
47
  /**
48
48
  * @description 单元的大小,可选值为 large,medium,small
49
49
  * */
50
- size?: HyApp.SizeType;
50
+ size?: HyApp.SizeType
51
51
  /**
52
52
  * @description 内容面板高度
53
53
  * */
54
- contentHeight?: string | number;
54
+ contentHeight?: string | number
55
55
  /**
56
56
  * @description 定义需要用到的外部样式
57
57
  * */
58
- customStyle?: CSSProperties;
58
+ customStyle?: CSSProperties
59
+ }
60
+
61
+ export interface IFoldingPanel {
62
+ /** 打开面板触发 */
63
+ (e: 'open', temp: PanelVo, index: number): void
64
+ /** 关闭面板触发 */
65
+ (e: 'close', temp: PanelVo, index: number): void
66
+ /** 改成面板开关状态触发 */
67
+ (e: 'change', temp: PanelVo, index: number): void
59
68
  }