hy-app 0.2.16 → 0.2.18

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 (82) hide show
  1. package/components/hy-action-sheet/hy-action-sheet.vue +5 -5
  2. package/components/hy-action-sheet/index.scss +6 -1
  3. package/components/hy-address-picker/hy-address-picker.vue +5 -5
  4. package/components/hy-avatar/hy-avatar.vue +5 -5
  5. package/components/hy-back-top/hy-back-top.vue +5 -5
  6. package/components/hy-badge/hy-badge.vue +5 -5
  7. package/components/hy-button/hy-button.vue +5 -5
  8. package/components/hy-calendar/hy-calendar.vue +22 -18
  9. package/components/hy-calendar/typing.d.ts +1 -1
  10. package/components/hy-card/hy-card.vue +5 -5
  11. package/components/hy-cell/hy-cell.vue +10 -11
  12. package/components/hy-check-button/hy-check-button.vue +7 -6
  13. package/components/hy-checkbox/hy-checkbox.vue +14 -14
  14. package/components/hy-code-input/hy-code-input.vue +8 -15
  15. package/components/hy-code-input/index.scss +1 -1
  16. package/components/hy-config-provider/hy-config-provider.vue +8 -6
  17. package/components/hy-count-down/hy-count-down.vue +7 -6
  18. package/components/hy-count-to/hy-count-to.vue +6 -5
  19. package/components/hy-datetime-picker/hy-datetime-picker.vue +7 -7
  20. package/components/hy-divider/hy-divider.vue +10 -7
  21. package/components/hy-dropdown/hy-dropdown.vue +6 -5
  22. package/components/hy-dropdown-item/hy-dropdown-item.vue +7 -5
  23. package/components/hy-empty/hy-empty.vue +6 -5
  24. package/components/hy-float-button/hy-float-button.vue +6 -6
  25. package/components/hy-folding-panel/hy-folding-panel.vue +6 -5
  26. package/components/hy-grid/hy-grid.vue +11 -13
  27. package/components/hy-grid/typing.d.ts +1 -1
  28. package/components/hy-icon/hy-icon.vue +15 -15
  29. package/components/hy-image/hy-image.vue +15 -9
  30. package/components/hy-input/hy-input.vue +7 -6
  31. package/components/hy-line/hy-line.vue +8 -6
  32. package/components/hy-line-progress/hy-line-progress.vue +9 -16
  33. package/components/hy-list/hy-list.vue +6 -5
  34. package/components/hy-loading/hy-loading.vue +9 -10
  35. package/components/hy-menu/hy-menu.vue +11 -8
  36. package/components/hy-modal/hy-modal.vue +6 -6
  37. package/components/hy-modal/index.scss +1 -1
  38. package/components/hy-navbar/hy-navbar.vue +6 -6
  39. package/components/hy-notice-bar/hy-notice-bar.vue +14 -9
  40. package/components/hy-notify/hy-notify.vue +6 -6
  41. package/components/hy-number-step/hy-number-step.vue +8 -6
  42. package/components/hy-overlay/hy-overlay.vue +8 -9
  43. package/components/hy-pagination/hy-pagination.vue +11 -8
  44. package/components/hy-picker/hy-picker.vue +9 -9
  45. package/components/hy-popover/hy-popover.vue +11 -7
  46. package/components/hy-popup/hy-popup.vue +9 -7
  47. package/components/hy-price/hy-price.vue +6 -5
  48. package/components/hy-qrcode/hy-qrcode.vue +6 -8
  49. package/components/hy-radio/hy-radio.vue +10 -12
  50. package/components/hy-rate/hy-rate.vue +7 -7
  51. package/components/hy-read-more/hy-read-more.vue +6 -5
  52. package/components/hy-scroll-list/hy-scroll-list.vue +6 -5
  53. package/components/hy-search/hy-search.vue +8 -6
  54. package/components/hy-signature/hy-signature.vue +6 -5
  55. package/components/hy-slider/hy-slider.vue +8 -7
  56. package/components/hy-steps/hy-steps.vue +10 -17
  57. package/components/hy-submit-bar/hy-submit-bar.vue +6 -6
  58. package/components/hy-subsection/hy-subsection.vue +16 -19
  59. package/components/hy-swipe-action/hy-swipe-action.vue +18 -19
  60. package/components/hy-swiper/hy-swiper.vue +15 -15
  61. package/components/hy-swiper/typing.d.ts +13 -1
  62. package/components/hy-switch/hy-switch.vue +17 -10
  63. package/components/hy-tabBar/hy-tabBar.vue +35 -26
  64. package/components/hy-tabs/hy-tabs.vue +28 -21
  65. package/components/hy-tag/hy-tag.vue +13 -17
  66. package/components/hy-tag/typing.d.ts +1 -1
  67. package/components/hy-text/hy-text.vue +12 -14
  68. package/components/hy-textarea/hy-textarea.vue +7 -6
  69. package/components/hy-textarea/index.scss +7 -2
  70. package/components/hy-toast/hy-toast.vue +72 -75
  71. package/components/hy-tooltip/hy-tooltip.vue +8 -14
  72. package/components/hy-transition/hy-transition.vue +8 -6
  73. package/components/hy-upload/hy-upload.vue +6 -5
  74. package/components/hy-warn/hy-warn.vue +6 -6
  75. package/components/hy-waterfall/hy-waterfall.vue +8 -7
  76. package/components/hy-watermark/hy-watermark.vue +20 -10
  77. package/libs/css/common.scss +5 -0
  78. package/libs/css/vars.css +1 -1
  79. package/package.json +2 -2
  80. package/theme.scss +1 -1
  81. package/utils/inspect.ts +1 -1
  82. package/web-types.json +1 -1
@@ -44,11 +44,6 @@
44
44
  </template>
45
45
 
46
46
  <script lang="ts">
47
- /**
48
- * 该组件用于滚动通告场景,有多种模式可供选择
49
- * @displayName hy-notice-bar
50
- */
51
- defineOptions({})
52
47
  export default {
53
48
  name: 'hy-notice-bar',
54
49
  options: {
@@ -61,20 +56,26 @@ export default {
61
56
 
62
57
  <script setup lang="ts">
63
58
  import { ref, toRefs } from 'vue'
64
- import type { INoticeBarEmits } from './typing'
59
+ import type { PropType, CSSProperties } from 'vue'
60
+ import { INoticeBarEmits, NoticeBarModeVo } from './typing'
65
61
  import { IconConfig } from '../../config'
66
-
67
62
  // 组件
68
63
  import HyRowNotice from './hy-row-notice.vue'
69
64
  import HyColumnNotice from './hy-column-notice.vue'
70
65
 
66
+ /**
67
+ * 该组件用于滚动通告场景,有多种模式可供选择
68
+ * @displayName hy-notice-bar
69
+ */
70
+ defineOptions({})
71
+
71
72
  const show = ref(true)
72
73
 
73
74
  // const props = withDefaults(defineProps<IProps>(), defaultProps);
74
75
  const props = defineProps({
75
76
  /** 显示的内容,数组 */
76
77
  text: {
77
- type: [String, Array],
78
+ type: [String, Array] as PropType<string | string[]>,
78
79
  default: [],
79
80
  },
80
81
  /**
@@ -99,7 +100,7 @@ const props = defineProps({
99
100
  * 通告模式,link-显示右箭头,closable-显示右侧关闭图标
100
101
  * @values link,closable
101
102
  * */
102
- mode: String,
103
+ mode: String as PropType<NoticeBarModeVo>,
103
104
  /** 文字颜色,各图标也会使用文字颜色 */
104
105
  color: String,
105
106
  /** 背景颜色 */
@@ -142,6 +143,10 @@ const props = defineProps({
142
143
  },
143
144
  /** 跳转地址 */
144
145
  url: String,
146
+ /** 定义需要用到的外部样式 */
147
+ customStyle: Object as PropType<CSSProperties>,
148
+ /** 自定义外部类名 */
149
+ customClass: String,
145
150
  })
146
151
  const { mode, linkType, url } = toRefs(props)
147
152
  const emit = defineEmits<INoticeBarEmits>()
@@ -30,11 +30,6 @@
30
30
  </template>
31
31
 
32
32
  <script lang="ts">
33
- /**
34
- * 一般用于页面顶部向下滑出一个提示,尔后自动收起的场景。
35
- * @displayName hy-notify
36
- */
37
- defineOptions({})
38
33
  export default {
39
34
  name: 'hy-notify',
40
35
  options: {
@@ -50,13 +45,18 @@ import type IProps from './typing'
50
45
  import { computed, ref } from 'vue'
51
46
  import type { CSSProperties, PropType } from 'vue'
52
47
  import { IconConfig } from '../../config'
53
-
54
48
  import { addUnit } from '../../utils'
55
49
  // 组件
56
50
  import HyTransition from '../hy-transition/hy-transition.vue'
57
51
  import HyStatusBar from '../hy-status-bar/hy-status-bar.vue'
58
52
  import HyIcon from '../hy-icon/hy-icon.vue'
59
53
 
54
+ /**
55
+ * 一般用于页面顶部向下滑出一个提示,尔后自动收起的场景。
56
+ * @displayName hy-notify
57
+ */
58
+ defineOptions({})
59
+
60
60
  // const props = withDefaults(defineProps<IProps>(), defaultProps)
61
61
  const props = defineProps({
62
62
  /** 到顶部的距离 */
@@ -126,11 +126,6 @@
126
126
  </template>
127
127
 
128
128
  <script lang="ts">
129
- /**
130
- * 一般用于商城购物选择物品数量的场景
131
- * @displayName hy-number-step
132
- */
133
- defineOptions({})
134
129
  export default {
135
130
  name: 'hy-number-step',
136
131
  options: {
@@ -146,9 +141,16 @@ import { computed, toRefs, ref, watch, onMounted, nextTick } from 'vue'
146
141
  import type { CSSProperties, PropType } from 'vue'
147
142
  import { addUnit } from '../../utils'
148
143
  import { IconConfig } from '../../config'
149
- import HyIcon from '../hy-icon/hy-icon.vue'
150
144
  import type HyIconProps from '../hy-icon/typing'
151
145
  import type { INumberStepEmits } from './typing'
146
+ // 组件
147
+ import HyIcon from '../hy-icon/hy-icon.vue'
148
+
149
+ /**
150
+ * 一般用于商城购物选择物品数量的场景
151
+ * @displayName hy-number-step
152
+ */
153
+ defineOptions({})
152
154
 
153
155
  // const props = withDefaults(defineProps<IProps>(), defaultProps)
154
156
  const props = defineProps({
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <HyTransition
3
3
  :show="show"
4
- :custom-class="['hy-overlay', customClass]"
4
+ :custom-class="`hy-overlay ${customClass}`"
5
5
  :duration="duration"
6
6
  :custom-style="overlayStyle"
7
7
  @click="clickHandler"
@@ -11,11 +11,6 @@
11
11
  </template>
12
12
 
13
13
  <script lang="ts">
14
- /**
15
- * 创建一个遮罩层,用于强调特定的页面元素,并阻止用户对遮罩下层的内容进行操作,一般用于弹窗场景
16
- * @displayName hy-overlay
17
- */
18
- defineOptions({})
19
14
  export default {
20
15
  name: 'hy-overlay',
21
16
  options: {
@@ -32,6 +27,12 @@ import type { CSSProperties, PropType } from 'vue'
32
27
  import type { IOverlayEmits } from './typing'
33
28
  import HyTransition from '../hy-transition/hy-transition.vue'
34
29
 
30
+ /**
31
+ * 创建一个遮罩层,用于强调特定的页面元素,并阻止用户对遮罩下层的内容进行操作,一般用于弹窗场景
32
+ * @displayName hy-overlay
33
+ */
34
+ defineOptions({})
35
+
35
36
  // const props = withDefaults(defineProps<IProps>(), defaultProps)
36
37
  const props = defineProps({
37
38
  /** 是否显示遮罩 */
@@ -55,9 +56,7 @@ const props = defineProps({
55
56
  default: 0.5,
56
57
  },
57
58
  /** 定义需要用到的外部样式 */
58
- customStyle: {
59
- type: Object as PropType<CSSProperties>,
60
- },
59
+ customStyle: Object as PropType<CSSProperties>,
61
60
  /** 自定义外部类名 */
62
61
  customClass: String,
63
62
  })
@@ -53,11 +53,6 @@
53
53
  </template>
54
54
 
55
55
  <script lang="ts">
56
- /**
57
- * 当数据量过多时,使用分页分解数据。
58
- * @displayName hy-pagination
59
- */
60
- defineOptions({})
61
56
  export default {
62
57
  name: 'hy-pagination',
63
58
  options: {
@@ -69,11 +64,19 @@ export default {
69
64
  </script>
70
65
 
71
66
  <script lang="ts" setup>
67
+ import { ref, toRefs, watch } from 'vue'
68
+ import type { CSSProperties, PropType } from 'vue'
69
+ import type { IPaginationEmits } from './typing'
70
+ import { IconConfig } from '../../config'
71
+ // 组件
72
72
  import HyIcon from '../hy-icon/hy-icon.vue'
73
73
  import HyButton from '../hy-button/hy-button.vue'
74
- import { CSSProperties, PropType, ref, toRefs, watch } from 'vue'
75
- import type { IPaginationEmits } from './typing'
76
- import { IconConfig } from 'hy-app'
74
+
75
+ /**
76
+ * 当数据量过多时,使用分页分解数据。
77
+ * @displayName hy-pagination
78
+ */
79
+ defineOptions({})
77
80
 
78
81
  // const props = withDefaults(defineProps<IProps>(), defaultProps);
79
82
  const props = defineProps({
@@ -95,11 +95,6 @@
95
95
  </template>
96
96
 
97
97
  <script lang="ts">
98
- /**
99
- * 此选择器用于单列,多列,多列联动的选择场景。
100
- * @displayName hy-picker
101
- */
102
- defineOptions({})
103
98
  export default {
104
99
  name: 'hy-picker',
105
100
  options: {
@@ -115,17 +110,22 @@ import { computed, PropType, ref, toRefs, watch } from 'vue'
115
110
  import { deepClone, sleep, addUnit } from '../../utils'
116
111
  import { IconConfig } from '../../config'
117
112
  import type { IPickerEmits, PickerColumnVo } from './typing'
118
-
113
+ import type HyInputProps from '../hy-input/typing'
119
114
  // 组件
120
115
  import HyInput from '../hy-input/hy-input.vue'
121
116
  import HyIcon from '../hy-icon/hy-icon.vue'
122
117
  import HyPopup from '../hy-popup/hy-popup.vue'
123
- import type HyInputProps from '@/package/components/hy-input/typing'
118
+
119
+ /**
120
+ * 此选择器用于单列,多列,多列联动的选择场景。
121
+ * @displayName hy-picker
122
+ */
123
+ defineOptions({})
124
124
 
125
125
  // const props = withDefaults(defineProps<IProps>(), defaultProps)
126
126
  const props = defineProps({
127
127
  /** 显示到输入框值 */
128
- modelValue: String,
128
+ modelValue: [String, Array],
129
129
  /** 是否显示弹窗 */
130
130
  show: {
131
131
  type: Boolean,
@@ -329,7 +329,7 @@ const inputValue = computed(() => {
329
329
  * @description 显示
330
330
  * */
331
331
  const onShowByClickInput = () => {
332
- if (!input.value.disabled) {
332
+ if (!input.value?.disabled) {
333
333
  showByClickInput.value = !showByClickInput.value
334
334
  }
335
335
  }
@@ -93,11 +93,6 @@
93
93
  </template>
94
94
 
95
95
  <script lang="ts">
96
- /**
97
- * 常用于展示提示信息。
98
- * @displayName hy-popover
99
- */
100
- defineOptions({})
101
96
  export default {
102
97
  name: 'hy-popover',
103
98
  options: {
@@ -119,17 +114,22 @@ import {
119
114
  useSlots,
120
115
  watch,
121
116
  inject,
122
- PropType,
123
117
  } from 'vue'
118
+ import type { PropType, CSSProperties } from 'vue'
124
119
  import type { IOffset, IPopoverEmits, PopoverContentVo, PopoverExpose } from './typing'
125
120
  import { isArray } from '../../utils'
126
121
  import { type Queue, queueKey, usePopover } from '../../composables'
127
122
  import { closeOther, pushToQueue, removeFromQueue } from '../../common'
128
-
129
123
  // 组件
130
124
  import HyIcon from '../hy-icon/hy-icon.vue'
131
125
  import HyTransition from '../hy-transition/hy-transition.vue'
132
126
 
127
+ /**
128
+ * 常用于展示提示信息。
129
+ * @displayName hy-popover
130
+ */
131
+ defineOptions({})
132
+
133
133
  // const props = withDefaults(defineProps<IProps>(), defaultProps)
134
134
  const props = defineProps({
135
135
  /** 控制 popover 的显示状态 */
@@ -170,6 +170,10 @@ const props = defineProps({
170
170
  type: String,
171
171
  default: 'normal',
172
172
  },
173
+ /** 定义需要用到的外部样式 */
174
+ customStyle: Object as PropType<CSSProperties>,
175
+ /** 自定义外部类名 */
176
+ customClass: String,
173
177
  })
174
178
  const { modelValue, content, mode, placement } = toRefs(props)
175
179
  const emit = defineEmits<IPopoverEmits>()
@@ -38,11 +38,6 @@
38
38
  </template>
39
39
 
40
40
  <script lang="ts">
41
- /**
42
- * 弹出层容器,用于展示弹窗、信息提示等内容,支持上、下、左、右和中部弹出。组件只提供容器,内部内容由用户自定义。
43
- * @displayName hy-popup
44
- */
45
- defineOptions({})
46
41
  export default {
47
42
  name: 'hy-popup',
48
43
  options: {
@@ -54,7 +49,8 @@ export default {
54
49
  </script>
55
50
 
56
51
  <script setup lang="ts">
57
- import { computed, type CSSProperties, PropType, ref, toRefs, watch } from 'vue'
52
+ import { computed, ref, toRefs, watch } from 'vue'
53
+ import type { CSSProperties, PropType } from 'vue'
58
54
  import type { IPopupEmits } from './typing'
59
55
  import { addUnit, getWindowInfo } from '../../utils'
60
56
  import { IconConfig } from '../../config'
@@ -64,6 +60,12 @@ import HyTransition from '../hy-transition/hy-transition.vue'
64
60
  import HyOverlay from '../hy-overlay/hy-overlay.vue'
65
61
  import HyIcon from '../hy-icon/hy-icon.vue'
66
62
 
63
+ /**
64
+ * 弹出层容器,用于展示弹窗、信息提示等内容,支持上、下、左、右和中部弹出。组件只提供容器,内部内容由用户自定义。
65
+ * @displayName hy-popup
66
+ */
67
+ defineOptions({})
68
+
67
69
  // const props = withDefaults(defineProps<IProps>(), defaultProps)
68
70
  const props = defineProps({
69
71
  /** 是否展示弹窗 */
@@ -127,7 +129,7 @@ const props = defineProps({
127
129
  default: 'top-right',
128
130
  },
129
131
  /** 圆角值 */
130
- round: String,
132
+ round: [String, Number],
131
133
  /** 当mode=center时 是否开启缩放 */
132
134
  zoom: {
133
135
  type: Boolean,
@@ -15,11 +15,6 @@
15
15
  </template>
16
16
 
17
17
  <script lang="ts">
18
- /**
19
- * 业务组件,突出金额小数点前大,小数点后小
20
- * @displayName hy-price
21
- */
22
- defineOptions({})
23
18
  export default {
24
19
  name: 'hy-price',
25
20
  options: {
@@ -35,6 +30,12 @@ import { computed, toRefs } from 'vue'
35
30
  import type { CSSProperties, PropType } from 'vue'
36
31
  import { addUnit, getPx } from '../../utils'
37
32
 
33
+ /**
34
+ * 业务组件,突出金额小数点前大,小数点后小
35
+ * @displayName hy-price
36
+ */
37
+ defineOptions({})
38
+
38
39
  // const props = withDefaults(defineProps<IProps>(), defaultProps)
39
40
  const props = defineProps({
40
41
  /** 传入金额值 */
@@ -21,11 +21,6 @@
21
21
  </template>
22
22
 
23
23
  <script lang="ts">
24
- /**
25
- * 根据提供的字符串前端JS生成二维码展示
26
- * @displayName hy-qrcode
27
- */
28
- defineOptions({})
29
24
  export default {
30
25
  name: 'hy-qrcode',
31
26
  options: {
@@ -41,12 +36,15 @@ import { getCurrentInstance, toRefs, ref, onMounted } from 'vue'
41
36
  import type { IQrcodeEmits } from './typing'
42
37
  import QRCode from './qrcode.js'
43
38
  import { addUnit, error } from '../../utils'
44
- import { IconConfig } from '../../config'
45
-
46
39
  // 组件
47
- import HyIcon from '../hy-icon/hy-icon.vue'
48
40
  import HyLoading from '../hy-loading/hy-loading.vue'
49
41
 
42
+ /**
43
+ * 根据提供的字符串前端JS生成二维码展示
44
+ * @displayName hy-qrcode
45
+ */
46
+ defineOptions({})
47
+
50
48
  // const props = withDefaults(defineProps<IProps>(), defaultProps)
51
49
  const props = defineProps({
52
50
  /** 实例ID字符串(如果有多个二维码组件必须设置不一样的cid) */
@@ -47,11 +47,6 @@
47
47
  </template>
48
48
 
49
49
  <script lang="ts">
50
- /**
51
- * 复选框组件一般用于需要多个选择的场景,该组件功能完整,使用方便
52
- * @displayName hy-radio
53
- */
54
- defineOptions({})
55
50
  export default {
56
51
  name: 'hy-radio',
57
52
  options: {
@@ -69,10 +64,15 @@ import type { IRadioEmits } from './typing'
69
64
  import type { CheckboxColumnsVo, IFieldNames } from '../hy-check-button/typing'
70
65
  import { addUnit, bem, error } from '../../utils'
71
66
  import { IconConfig } from '../../config'
72
-
73
67
  // 组件
74
68
  import HyIcon from '../hy-icon/hy-icon.vue'
75
69
 
70
+ /**
71
+ * 复选框组件一般用于需要多个选择的场景,该组件功能完整,使用方便
72
+ * @displayName hy-radio
73
+ */
74
+ defineOptions({})
75
+
76
76
  // const props = withDefaults(defineProps<IProps>(), defaultProps);
77
77
  const props = defineProps({
78
78
  /** 双向绑定值,数组类型 */
@@ -296,18 +296,16 @@ const iconClickHandler = (e: Event, temp: CheckboxColumnsVo) => {
296
296
  * */
297
297
  const wrapperClickHandler = (e: Event, temp: CheckboxColumnsVo) => {
298
298
  e.stopPropagation()
299
- if (!isDisabled(temp?.disabled) || !labelDisabled.value) {
300
- setRadioCheckedStatus(temp)
301
- }
299
+ if (labelDisabled.value || isDisabled(temp?.disabled)) return
300
+ setRadioCheckedStatus(temp)
302
301
  }
303
302
  /**
304
303
  * @description 点击label
305
304
  * */
306
305
  const labelClickHandler = (e: Event, temp: CheckboxColumnsVo) => {
307
306
  e.stopPropagation()
308
- if (!isDisabled(temp?.disabled) || !labelDisabled.value) {
309
- setRadioCheckedStatus(temp)
310
- }
307
+ if (labelDisabled.value || isDisabled(temp?.disabled)) return
308
+ setRadioCheckedStatus(temp)
311
309
  }
312
310
 
313
311
  /**
@@ -51,11 +51,6 @@
51
51
  </template>
52
52
 
53
53
  <script lang="ts">
54
- /**
55
- * 该组件一般用于满意度调查,星型评分的场景。
56
- * @displayName hy-rate
57
- */
58
- defineOptions({})
59
54
  export default {
60
55
  name: 'hy-rate',
61
56
  options: {
@@ -71,10 +66,15 @@ import { addUnit, getRect, guid, range, sleep } from '../../utils'
71
66
  import { ref, watch, toRefs, onMounted, getCurrentInstance } from 'vue'
72
67
  import type { CSSProperties, PropType } from 'vue'
73
68
  import type { IRateEmits } from './typing'
74
-
69
+ import { IconConfig } from '../../config'
75
70
  // 组件
76
71
  import HyIcon from '../hy-icon/hy-icon.vue'
77
- import { IconConfig } from '@/package'
72
+
73
+ /**
74
+ * 该组件一般用于满意度调查,星型评分的场景。
75
+ * @displayName hy-rate
76
+ */
77
+ defineOptions({})
78
78
 
79
79
  // const props = withDefaults(defineProps<IProps>(), defaultProps)
80
80
  const props = defineProps({
@@ -42,11 +42,6 @@
42
42
  </template>
43
43
 
44
44
  <script lang="ts">
45
- /**
46
- * 该组件一般用于内容较长,预先收起一部分,点击展开全部内容的场景。
47
- * @displayName hy-read-more
48
- */
49
- defineOptions({})
50
45
  export default {
51
46
  name: 'hy-read-more',
52
47
  options: {
@@ -67,6 +62,12 @@ import { IconConfig } from '../../config'
67
62
  // 组件
68
63
  import HyIcon from '../hy-icon/hy-icon.vue'
69
64
 
65
+ /**
66
+ * 该组件一般用于内容较长,预先收起一部分,点击展开全部内容的场景。
67
+ * @displayName hy-read-more
68
+ */
69
+ defineOptions({})
70
+
70
71
  // const props = withDefaults(defineProps<IProps>(), defaultProps)
71
72
  const props = defineProps({
72
73
  /** 内容超出此高度才会显示展开全文按钮,单位px */
@@ -32,11 +32,6 @@
32
32
  </template>
33
33
 
34
34
  <script lang="ts">
35
- /**
36
- * 该组件一般用于同时展示多个商品、分类的场景,也可以完成左右滑动的列表。
37
- * @displayName hy-scroll-list
38
- */
39
- defineOptions({})
40
35
  export default {
41
36
  name: 'hy-scroll-list',
42
37
  options: {
@@ -52,6 +47,12 @@ import { computed, type CSSProperties, toRefs, ref, onMounted, getCurrentInstanc
52
47
  import type { IScrollListEmits } from './typing'
53
48
  import { addUnit, colorGradient, getRect, sleep } from '../../utils'
54
49
 
50
+ /**
51
+ * 该组件一般用于同时展示多个商品、分类的场景,也可以完成左右滑动的列表。
52
+ * @displayName hy-scroll-list
53
+ */
54
+ defineOptions({})
55
+
55
56
  // const props = withDefaults(defineProps<IProps>(), defaultProps)
56
57
  const props = defineProps({
57
58
  /** 指示器的整体宽度 */
@@ -94,11 +94,6 @@
94
94
  </template>
95
95
 
96
96
  <script lang="ts">
97
- /**
98
- * 搜索组件,集成了常见搜索框所需功能,用户可以一键引入,开箱即用。
99
- * @displayName hy-search
100
- */
101
- defineOptions({})
102
97
  export default {
103
98
  name: 'hy-search',
104
99
  options: {
@@ -110,13 +105,20 @@ export default {
110
105
  </script>
111
106
 
112
107
  <script setup lang="ts">
113
- import { computed, nextTick, toRefs, ref, watch, PropType, type CSSProperties } from 'vue'
108
+ import { computed, nextTick, toRefs, ref, watch } from 'vue'
109
+ import type { PropType, CSSProperties } from 'vue'
114
110
  import type { ISearchEmits } from './typing'
115
111
  import { sleep, addUnit } from '../../utils'
116
112
  import { IconConfig } from '../../config'
117
113
  import HyIcon from '../hy-icon/hy-icon.vue'
118
114
  import type HyIconProps from '../hy-icon/typing'
119
115
 
116
+ /**
117
+ * 搜索组件,集成了常见搜索框所需功能,用户可以一键引入,开箱即用。
118
+ * @displayName hy-search
119
+ */
120
+ defineOptions({})
121
+
120
122
  // const props = withDefaults(defineProps<IProps>(), defaultProps)
121
123
  const props = defineProps({
122
124
  /** 输入框初始值 */
@@ -73,11 +73,6 @@
73
73
  </view>
74
74
  </template>
75
75
  <script lang="ts">
76
- /**
77
- * 用于签名场景,基于 Canvas 实现的签名组件。提供了基础签名、历史记录、笔锋效果等功能。
78
- * @displayName hy-signature
79
- */
80
- defineOptions({})
81
76
  export default {
82
77
  name: 'hy-signature',
83
78
  options: {
@@ -99,6 +94,12 @@ import { canvas2dAdapter } from './canvasHelper'
99
94
  // 组件
100
95
  import HyButton from '../hy-button/hy-button.vue'
101
96
 
97
+ /**
98
+ * 用于签名场景,基于 Canvas 实现的签名组件。提供了基础签名、历史记录、笔锋效果等功能。
99
+ * @displayName hy-signature
100
+ */
101
+ defineOptions({})
102
+
102
103
  // const props = withDefaults(defineProps<IProps>(), defaultProps);
103
104
  const props = defineProps({
104
105
  /** 签名笔颜色 */
@@ -140,11 +140,6 @@
140
140
  </template>
141
141
 
142
142
  <script lang="ts">
143
- /**
144
- * 一般用于表单中,手动选择一个区间范围的场景。
145
- * @displayName hy-slider
146
- */
147
- defineOptions({})
148
143
  export default {
149
144
  name: 'hy-slider',
150
145
  options: {
@@ -159,7 +154,13 @@ export default {
159
154
  import { computed, getCurrentInstance, onMounted, ref, toRefs, watch } from 'vue'
160
155
  import type { CSSProperties, PropType } from 'vue'
161
156
  import { addUnit, error, getRect, getPx } from '../../utils'
162
- import { ISliderEmits } from '@/package/components/hy-slider/typing'
157
+ import type { ISliderEmits } from './typing'
158
+
159
+ /**
160
+ * 一般用于表单中,手动选择一个区间范围的场景。
161
+ * @displayName hy-slider
162
+ */
163
+ defineOptions({})
163
164
 
164
165
  // const props = withDefaults(defineProps<IProps>(), defaultProps);
165
166
  const props = defineProps({
@@ -216,7 +217,7 @@ const props = defineProps({
216
217
  },
217
218
  /** 双滑块时值 */
218
219
  rangeValue: {
219
- type: Array as unknown as number[],
220
+ type: Array as unknown as PropType<number[]>,
220
221
  default: [0, 0],
221
222
  },
222
223
  /** 是否区间的模式 */
@@ -104,11 +104,6 @@
104
104
  </template>
105
105
 
106
106
  <script lang="ts">
107
- /**
108
- * 一般用于完成一个任务要分几个步骤,标识目前处于第几步的场景。
109
- * @displayName hy-steps
110
- */
111
- defineOptions({})
112
107
  export default {
113
108
  name: 'hy-steps',
114
109
  options: {
@@ -120,21 +115,19 @@ export default {
120
115
  </script>
121
116
 
122
117
  <script setup lang="ts">
123
- import {
124
- computed,
125
- type CSSProperties,
126
- toRefs,
127
- ref,
128
- onMounted,
129
- getCurrentInstance,
130
- watch,
131
- PropType,
132
- } from 'vue'
118
+ import { computed, toRefs, ref, onMounted, getCurrentInstance, watch } from 'vue'
119
+ import type { CSSProperties, PropType } from 'vue'
133
120
  import type { IStepsEmits } from './typing'
134
121
  import type { StepListVo } from './typing'
135
122
  import { addUnit, getRect } from '../../utils'
136
123
  import { ColorConfig, IconConfig } from '../../config'
137
124
 
125
+ /**
126
+ * 一般用于完成一个任务要分几个步骤,标识目前处于第几步的场景。
127
+ * @displayName hy-steps
128
+ */
129
+ defineOptions({})
130
+
138
131
  // 组件
139
132
  import HyIcon from '../hy-icon/hy-icon.vue'
140
133
 
@@ -213,8 +206,8 @@ const lineStyle = computed(() => {
213
206
  style.backgroundColor = temp.error
214
207
  ? ''
215
208
  : index < current.value
216
- ? activeColor.value
217
- : inactiveColor.value
209
+ ? activeColor.value
210
+ : inactiveColor.value
218
211
  return style
219
212
  }
220
213
  })