hy-app 0.6.9 → 0.7.0

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/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 +1 -0
  6. package/components/hy-calendar/month.vue +25 -5
  7. package/components/hy-calendar/props.ts +1 -1
  8. package/components/hy-cascader/hy-cascader.vue +503 -0
  9. package/components/hy-cascader/index.scss +84 -0
  10. package/components/hy-cascader/props.ts +88 -0
  11. package/components/hy-cascader/typing.d.ts +34 -0
  12. package/components/hy-check-button/typing.d.ts +12 -7
  13. package/components/hy-code-input/hy-code-input.vue +33 -11
  14. package/components/hy-code-input/typing.d.ts +4 -0
  15. package/components/hy-config-provider/hy-config-provider.vue +58 -53
  16. package/components/hy-datetime-picker/props.ts +1 -1
  17. package/components/hy-datetime-picker/typing.d.ts +1 -1
  18. package/components/hy-dropdown/typing.d.ts +5 -0
  19. package/components/hy-form/typing.d.ts +6 -0
  20. package/components/hy-form-item/typing.d.ts +1 -1
  21. package/components/hy-grid/hy-grid.vue +12 -12
  22. package/components/hy-grid/index.scss +1 -2
  23. package/components/hy-grid/props.ts +7 -2
  24. package/components/hy-grid/typing.d.ts +1 -1
  25. package/components/hy-icon/typing.d.ts +52 -9
  26. package/components/hy-keyboard/constants.ts +83 -0
  27. package/components/hy-keyboard/hy-keyboard.vue +375 -0
  28. package/components/hy-keyboard/index.scss +73 -0
  29. package/components/hy-keyboard/key/index.scss +79 -0
  30. package/components/hy-keyboard/key/index.vue +91 -0
  31. package/components/hy-keyboard/key/types.ts +1 -0
  32. package/components/hy-keyboard/props.ts +108 -0
  33. package/components/hy-keyboard/typing.d.ts +18 -0
  34. package/components/hy-modal/typing.d.ts +2 -2
  35. package/components/hy-notice-bar/hy-column-notice.vue +54 -94
  36. package/components/hy-notice-bar/hy-notice-bar.vue +128 -96
  37. package/components/hy-notice-bar/hy-row-notice.vue +89 -121
  38. package/components/hy-notice-bar/props.ts +86 -85
  39. package/components/hy-notify/hy-notify.vue +9 -9
  40. package/components/hy-notify/typing.d.ts +22 -0
  41. package/components/hy-picker/hy-picker.vue +126 -149
  42. package/components/hy-picker/props.ts +4 -1
  43. package/components/hy-picker/typing.d.ts +22 -0
  44. package/components/hy-popup/index.scss +1 -0
  45. package/components/hy-price/hy-price.vue +52 -23
  46. package/components/hy-price/props.ts +54 -54
  47. package/components/hy-radio/props.ts +1 -1
  48. package/components/hy-radio/typing.d.ts +5 -1
  49. package/components/hy-rolling-num/typing.d.ts +1 -0
  50. package/components/hy-skeleton/index.scss +17 -0
  51. package/components/hy-steps/hy-steps.vue +1 -1
  52. package/components/hy-submit-bar/typing.d.ts +3 -3
  53. package/components/hy-swipe-action/hy-swipe-action.vue +34 -15
  54. package/components/hy-swipe-action/index.scss +0 -1
  55. package/components/hy-switch/typing.d.ts +4 -0
  56. package/components/hy-tabbar/props.ts +2 -1
  57. package/components/hy-tabbar/typing.d.ts +5 -4
  58. package/components/hy-tabs/hy-tabs.vue +338 -336
  59. package/components/hy-tabs/index.scss +6 -6
  60. package/components/hy-tabs/typing.d.ts +41 -33
  61. package/components/hy-textarea/hy-textarea.vue +2 -2
  62. package/components/hy-textarea/typing.d.ts +4 -0
  63. package/components/hy-toast/hy-toast.vue +14 -6
  64. package/components/hy-toast/typing.d.ts +42 -36
  65. package/components/hy-tooltip/hy-tooltip.vue +1 -1
  66. package/components/hy-tooltip/index.scss +1 -0
  67. package/components/hy-tooltip/props.ts +1 -1
  68. package/components/hy-upload/hy-upload.vue +16 -1
  69. package/components/hy-upload/index.scss +149 -144
  70. package/components/index.ts +6 -0
  71. package/global.d.ts +2 -0
  72. package/libs/config/icon.ts +442 -430
  73. package/libs/css/_function.scss +7 -13
  74. package/libs/css/iconfont.css +445 -441
  75. package/libs/css/theme.scss +1 -1
  76. package/libs/locale/lang/en-US.ts +4 -0
  77. package/libs/locale/lang/zh-CN.ts +4 -0
  78. package/libs/typing/index.ts +80 -0
  79. package/package.json +5 -2
  80. package/tags.json +1 -1
  81. package/web-types.json +1 -1
  82. package/components/hy-qrcode/qrcode.js.bak +0 -1434
@@ -0,0 +1,84 @@
1
+ @use "../../libs/css/theme" as *;
2
+ @use "../../libs/css/mixin" as *;
3
+
4
+ @include b(cascader) {
5
+ position: relative;
6
+ width: 100%;
7
+ height: 100%;
8
+
9
+ &-input {
10
+ position: relative;
11
+ .input-cover {
12
+ opacity: 0;
13
+ position: absolute;
14
+ top: 0;
15
+ bottom: 0;
16
+ left: 0;
17
+ right: 0;
18
+ z-index: 1;
19
+ }
20
+ }
21
+
22
+ @include e(header) {
23
+ display: flex;
24
+ justify-content: space-between;
25
+ align-items: center;
26
+ padding: $hy-border-margin-padding-base;
27
+ border-bottom: $hy-border-line;
28
+ }
29
+
30
+ @include e(header-title) {
31
+ font-size: $hy-font-size-base;
32
+ font-weight: $hy-font-weight-bold;
33
+ color: $hy-text-color;
34
+ }
35
+
36
+ @include e(header-close) {
37
+ width: 60rpx;
38
+ height: 60rpx;
39
+ display: flex;
40
+ align-items: center;
41
+ justify-content: center;
42
+ }
43
+
44
+ @include e(content) {
45
+ flex: 1;
46
+ overflow-y: auto;
47
+ padding: 0;
48
+ height: 100%;
49
+ }
50
+
51
+ @include e(item) {
52
+ display: flex;
53
+ align-items: center;
54
+ justify-content: space-between;
55
+ padding: $hy-border-margin-padding-lg $hy-border-margin-padding-base;
56
+ font-size: $hy-font-size-base;
57
+ color: $hy-text-color;
58
+ position: relative;
59
+
60
+ @include m(active) {
61
+ color: $hy-primary;
62
+ font-weight: $hy-font-weight-bold;
63
+ background: $hy-background--hover;
64
+ border-left: $hy-border-width-lg solid $hy-primary;
65
+ }
66
+ }
67
+
68
+ @include e(panel) {
69
+ width: 100%;
70
+ height: 100%;
71
+ }
72
+
73
+ @include edeep(loading) {
74
+ position: absolute;
75
+ top: 0;
76
+ right: 0;
77
+ left: 0;
78
+ bottom: 0;
79
+ display: flex;
80
+ align-items: center;
81
+ justify-content: center;
82
+ z-index: 10;
83
+ }
84
+ }
@@ -0,0 +1,88 @@
1
+ import type { CascaderOption, CascaderValue, CascaderLazyLoad } from './typing'
2
+ import type { PropType } from 'vue'
3
+ import type { HyInputProps } from '../hy-input/typing'
4
+ import { useTranslate } from '../../libs'
5
+
6
+ const { t } = useTranslate('cascader')
7
+
8
+ const cascaderProps = {
9
+ /** 当前选中的值 */
10
+ modelValue: {
11
+ type: Object as PropType<CascaderValue>,
12
+ default: () => ({ value: [], label: [] })
13
+ },
14
+ /** 是否显示级联选择器弹窗 */
15
+ show: {
16
+ type: Boolean,
17
+ default: false
18
+ },
19
+ /** 级联选择器数据源 */
20
+ options: {
21
+ type: Array as PropType<CascaderOption[]>,
22
+ default: () => []
23
+ },
24
+ /** 是否显示顶部工具栏 */
25
+ showToolbar: {
26
+ type: Boolean,
27
+ default: true
28
+ },
29
+ /** 顶部标题 */
30
+ title: String,
31
+ /** 输入框占位提示文字 */
32
+ placeholder: {
33
+ type: String,
34
+ default: () => t('placeholder')
35
+ },
36
+ /** 点击遮罩层是否关闭 */
37
+ closeOnClickOverlay: {
38
+ type: Boolean,
39
+ default: false
40
+ },
41
+ /** 弹出层的 z-index 值 */
42
+ zIndex: {
43
+ type: Number,
44
+ default: 10076
45
+ },
46
+ /** 是否显示输入框 */
47
+ hasInput: {
48
+ type: Boolean,
49
+ default: false
50
+ },
51
+ /** 输入框配置 */
52
+ input: {
53
+ type: Object as PropType<HyInputProps>,
54
+ default: () => {}
55
+ },
56
+ /** 多选时的分隔符 */
57
+ separator: {
58
+ type: String,
59
+ default: ' / '
60
+ },
61
+ /** 选项值对应的 key */
62
+ valueKey: {
63
+ type: String,
64
+ default: 'value'
65
+ },
66
+ /** 选项标签对应的 key */
67
+ labelKey: {
68
+ type: String,
69
+ default: 'label'
70
+ },
71
+ /** 选项子级对应的 key */
72
+ childrenKey: {
73
+ type: String,
74
+ default: 'children'
75
+ },
76
+ /** 异步加载子节点的回调函数,提供后将启用异步加载模式 */
77
+ lazyLoad: {
78
+ type: Function as PropType<CascaderLazyLoad>,
79
+ default: undefined
80
+ },
81
+ /** 选项对象中,标识叶子节点的 key */
82
+ isLeafKey: {
83
+ type: String,
84
+ default: 'isLeaf'
85
+ }
86
+ }
87
+
88
+ export default cascaderProps
@@ -0,0 +1,34 @@
1
+ export interface CascaderOption {
2
+ value: string | number
3
+ label: string
4
+ children?: CascaderOption[]
5
+ disabled?: boolean
6
+ isLeaf?: boolean
7
+ [key: string]: any
8
+ }
9
+
10
+ export interface CascaderValue {
11
+ value: (string | number)[]
12
+ label: string[]
13
+ }
14
+
15
+ export interface CascaderEmitValue {
16
+ value: (string | number)[]
17
+ label: string[]
18
+ selectedOptions: CascaderOption[]
19
+ }
20
+
21
+ export type CascaderLazyLoad = (
22
+ option: CascaderOption | null,
23
+ tabIndex: number,
24
+ resolve: (children: CascaderOption[]) => void
25
+ ) => void
26
+
27
+ export interface ICascaderEmits {
28
+ (e: 'close'): void
29
+ (e: 'cancel'): void
30
+ (e: 'confirm', params: CascaderEmitValue): void
31
+ (e: 'change', params: CascaderEmitValue): void
32
+ (e: 'update:show', show: boolean): void
33
+ (e: 'update:modelValue', value: CascaderValue): void
34
+ }
@@ -1,33 +1,38 @@
1
+ import type { ExtractPropTypes } from 'vue'
2
+ import type checkButtonProps from './props'
3
+
4
+ export interface HyCheckButtonProps extends ExtractPropTypes<typeof checkButtonProps> {}
5
+
1
6
  export interface CheckboxColumnsVo extends FieldNamesType {
2
7
  /**
3
- * @description 显示文本内容
8
+ * 显示文本内容
4
9
  * */
5
10
  label?: string
6
11
  /**
7
- * @description
12
+ * 值
8
13
  * */
9
14
  value?: string | number
10
15
  /**
11
- * @description 是否选中
16
+ * 是否选中
12
17
  * */
13
18
  checked?: boolean
14
19
 
15
20
  /**
16
- * @description 是否禁用
21
+ * 是否禁用
17
22
  * */
18
23
  disabled?: boolean
19
24
  }
20
25
  export interface IFieldNames {
21
26
  /**
22
- * @description 自定义columns的文本键
27
+ * 自定义columns的文本键
23
28
  * */
24
29
  label: string
25
30
  /**
26
- * @description 自定义columns的值键
31
+ * 自定义columns的值键
27
32
  * */
28
33
  value: string
29
34
  /**
30
- * @description 自定义columns的选中键
35
+ * 自定义columns的选中键
31
36
  * */
32
37
  checked: string
33
38
  }
@@ -35,8 +35,8 @@
35
35
  :style="{
36
36
  height: boxSize
37
37
  }"
38
- @focus="isFocus = true"
39
- @blur="isFocus = false"
38
+ @focus="handleFocus"
39
+ @blur="handleBlur"
40
40
  />
41
41
  </view>
42
42
  </template>
@@ -80,9 +80,19 @@ const boxSize = addUnit(props.size)
80
80
 
81
81
  watch(
82
82
  () => props.modelValue,
83
- (newValue: string | number) => {
84
- inputValue.value = String(newValue).substring(0, props.maxlength)
85
- current.value = newValue.toString().length
83
+ (newValue: string | number | undefined, oldValue: string | number | undefined) => {
84
+ const newValueStr = String(newValue).substring(0, props.maxlength)
85
+ inputValue.value = newValueStr
86
+ current.value = newValueStr.length
87
+
88
+ // 当值从外部更新时(如键盘组件),也触发change事件
89
+ if (newValue !== oldValue) {
90
+ emit('change', newValueStr)
91
+ }
92
+
93
+ if (String(inputValue.value).length >= Number(props.maxlength)) {
94
+ emit('finish', inputValue.value)
95
+ }
86
96
  },
87
97
 
88
98
  { immediate: true }
@@ -178,14 +188,30 @@ const itemClass = computed(() => {
178
188
  })
179
189
 
180
190
  /**
181
- * @description 将输入的值,转为数组,给item历遍时,根据当前的索引显示数组的元素
191
+ * 将输入的值,转为数组,给item历遍时,根据当前的索引显示数组的元素
182
192
  */
183
193
  const codeArray = computed(() => {
184
194
  return String(inputValue.value).split('')
185
195
  })
186
196
 
187
197
  /**
188
- * @description 监听输入框的值发生变化
198
+ * 输入框获取焦点时触发
199
+ * */
200
+ const handleFocus = () => {
201
+ isFocus.value = true
202
+ emit('focus')
203
+ }
204
+
205
+ /**
206
+ * 输入框失去焦点时触发
207
+ * */
208
+ const handleBlur = () => {
209
+ isFocus.value = false
210
+ emit('blur')
211
+ }
212
+
213
+ /**
214
+ * 监听输入框的值发生变化
189
215
  * */
190
216
  const inputHandler = (e: InputOnInputEvent) => {
191
217
  const value = e.detail.value
@@ -200,10 +226,6 @@ const inputHandler = (e: InputOnInputEvent) => {
200
226
  emit('change', value)
201
227
  // 修改通过v-model双向绑定的值
202
228
  emit('update:modelValue', value)
203
- // 达到用户指定输入长度时,发出完成事件
204
- if (String(value).length >= Number(props.maxlength)) {
205
- emit('finish', value)
206
- }
207
229
  }
208
230
  </script>
209
231
 
@@ -5,4 +5,8 @@ export interface ICodeInputEmits {
5
5
  (e: 'finish', value: string | number): void
6
6
  /** 更新值 */
7
7
  (e: 'update:modelValue', value: string | number): void
8
+ /** 输入框获取焦点时触发 */
9
+ (e: 'focus'): void
10
+ /** 输入框失去焦点时触发 */
11
+ (e: 'blur'): void
8
12
  }
@@ -1,53 +1,58 @@
1
- <template>
2
- <view :class="themeClass" :style="[themeStyle, { height: height ? addUnit(height) : '' }]">
3
- <!-- @slot 默认插槽 -->
4
- <slot />
5
- </view>
6
- </template>
7
-
8
- <script lang="ts">
9
- export default {
10
- name: 'hy-config-provider',
11
- options: {
12
- addGlobalClass: true,
13
- virtualHost: true,
14
- styleIsolation: 'shared'
15
- }
16
- }
17
- </script>
18
-
19
- <script setup lang="ts">
20
- import { computed } from 'vue'
21
- import { addUnit, colorGradient } from '../../libs'
22
- import configProviderProps from './props'
23
-
24
- /**
25
- * 将 ConfigProvider 组件的 theme 属性设置为 dark,可以开启深色模式。 深色模式会全局生效,使页面上的所有 Wot 组件变为深色风格。
26
- * @displayName hy-config-provider
27
- */
28
- defineOptions({})
29
-
30
- const props = defineProps(configProviderProps)
31
-
32
- const themeClass = computed(() => {
33
- return [props.customClass, 'hy-config-provider', `hy-theme--${props.theme}`]
34
- })
35
-
36
- const themeStyle = computed(() => {
37
- return [
38
- {
39
- '--hy-theme-color': props.themeColor,
40
- '--hy-theme--light':
41
- props.theme === 'dark'
42
- ? colorGradient(props.themeColor, '#000')[60]
43
- : colorGradient(props.themeColor)[80],
44
- padding: addUnit(props.padding)
45
- },
46
- props.customStyle
47
- ]
48
- })
49
- </script>
50
-
51
- <style scoped lang="scss">
52
- @import './index.scss';
53
- </style>
1
+ <template>
2
+ <view :class="themeClass" :style="[themeStyle, { height: height ? addUnit(height) : '' }]">
3
+ <!-- @slot 默认插槽 -->
4
+ <slot />
5
+ </view>
6
+ </template>
7
+
8
+ <script lang="ts">
9
+ export default {
10
+ name: 'hy-config-provider',
11
+ options: {
12
+ addGlobalClass: true,
13
+ virtualHost: true,
14
+ styleIsolation: 'shared'
15
+ }
16
+ }
17
+ </script>
18
+
19
+ <script setup lang="ts">
20
+ import { computed, provide, toRefs } from 'vue'
21
+ import { addUnit, colorGradient } from '../../libs'
22
+ import configProviderProps from './props'
23
+
24
+ /**
25
+ * 将 ConfigProvider 组件的 theme 属性设置为 dark,可以开启深色模式。 深色模式会全局生效,使页面上的所有 Wot 组件变为深色风格。
26
+ * @displayName hy-config-provider
27
+ */
28
+ defineOptions({})
29
+
30
+ const props = defineProps(configProviderProps)
31
+
32
+ const themeClass = computed(() => {
33
+ return [props.customClass, 'hy-config-provider', `hy-theme--${props.theme}`]
34
+ })
35
+
36
+ const themeStyle = computed(() => {
37
+ return [
38
+ {
39
+ '--hy-theme-color': props.themeColor,
40
+ '--hy-theme--light':
41
+ props.theme === 'dark'
42
+ ? colorGradient(props.themeColor, '#000')[60]
43
+ : colorGradient(props.themeColor)[80],
44
+ padding: addUnit(props.padding)
45
+ },
46
+ props.customStyle
47
+ ]
48
+ })
49
+
50
+ // 提供给所有后代组件
51
+ provide('hy-config-provider', {
52
+ ...toRefs(props)
53
+ })
54
+ </script>
55
+
56
+ <style scoped lang="scss">
57
+ @import './index.scss';
58
+ </style>
@@ -1,6 +1,6 @@
1
1
  import { DateModeEnum, useTranslate } from '../../libs'
2
2
  import type { CSSProperties, PropType } from 'vue'
3
- import type { HyInputProps } from '../hy-input/typing'
3
+ import type { HyInputProps } from '../../index'
4
4
 
5
5
  const { t } = useTranslate('datetimePicker')
6
6
 
@@ -1,4 +1,4 @@
1
- import { DateModeEnum } from '../../typing'
1
+ import type { DateModeEnum } from '../../index'
2
2
 
3
3
  type IParam = {
4
4
  /** 值 */
@@ -0,0 +1,5 @@
1
+ import type { ExtractPropTypes } from 'vue'
2
+ import type dropdownProps from './props'
3
+
4
+ export interface HyDropdownProps extends ExtractPropTypes<typeof dropdownProps> {}
5
+ export type FatherIProps = HyDropdownProps
@@ -1,3 +1,9 @@
1
+ import type { ExtractPropTypes } from 'vue'
2
+ import type formProps from './props'
3
+
4
+ export interface HyFormProps extends ExtractPropTypes<typeof formProps> {}
5
+ export type HyFormSimpleProps = HyFormProps
6
+
1
7
  export interface FormRule {
2
8
  /**
3
9
  * 是否必填
@@ -1,4 +1,4 @@
1
- import HyFormSimpleProps, { type FormRule } from '../hy-form/typing'
1
+ import type { HyFormSimpleProps, FormRule } from '../../index'
2
2
  import type { ToRefs } from 'vue'
3
3
 
4
4
  export interface IFormContext extends ToRefs<HyFormSimpleProps> {
@@ -14,18 +14,18 @@
14
14
  :name="item[customKeys?.icon]"
15
15
  label-pos="bottom"
16
16
  :label="item[customKeys?.name]"
17
- :space="item?.iconConfig?.space || iconConfig?.space || 8"
18
- :color="item?.iconConfig?.color || iconConfig?.color"
19
- :size="item?.iconConfig?.size || iconConfig?.size || 30"
20
- :bold="item?.iconConfig?.bold || iconConfig?.bold"
21
- :customPrefix="item?.iconConfig?.customPrefix"
22
- :imgMode="item?.iconConfig?.imgMode || iconConfig?.imgMode"
23
- :width="item?.iconConfig?.width || iconConfig?.width"
24
- :height="item?.iconConfig?.height || iconConfig?.height"
25
- :top="item?.iconConfig?.top || iconConfig?.top"
26
- :stop="item?.iconConfig?.stop || iconConfig?.stop"
27
- :round="item?.iconConfig?.round || iconConfig?.round || 6"
28
- :customStyle="item?.iconConfig?.customStyle || iconConfig?.customStyle"
17
+ :space="item?.iconProps?.space || iconProps?.space || 8"
18
+ :color="item?.iconProps?.color || iconProps?.color"
19
+ :size="item?.iconProps?.size || iconProps?.size || size"
20
+ :bold="item?.iconProps?.bold || iconProps?.bold"
21
+ :customPrefix="item?.iconProps?.customPrefix"
22
+ :imgMode="item?.iconProps?.imgMode || iconProps?.imgMode"
23
+ :width="item?.iconProps?.width || iconProps?.width"
24
+ :height="item?.iconProps?.height || iconProps?.height"
25
+ :top="item?.iconProps?.top || iconProps?.top"
26
+ :stop="item?.iconProps?.stop || iconProps?.stop"
27
+ :round="item?.iconProps?.round || iconProps?.round || 6"
28
+ :customStyle="item?.iconProps?.customStyle || iconProps?.customStyle"
29
29
  ></hy-icon>
30
30
  </view>
31
31
  </template>
@@ -13,7 +13,6 @@
13
13
  /* #endif */
14
14
 
15
15
  @include e(item) {
16
- align-items: center;
17
16
  justify-content: center;
18
17
  position: relative;
19
18
  flex-direction: column;
@@ -24,9 +23,9 @@
24
23
  /* #endif */
25
24
 
26
25
  /* #ifdef MP */
27
- position: relative;
28
26
  float: left;
29
27
  /* #endif */
28
+ padding: $hy-border-margin-padding-base 0;
30
29
 
31
30
  // 只有当有 border 类时才显示边框
32
31
  @include m(border) {
@@ -21,6 +21,11 @@ const gridProps = {
21
21
  type: Number,
22
22
  default: 5
23
23
  },
24
+ /** 图标大小 */
25
+ size: {
26
+ type: [Number, String],
27
+ default: 44
28
+ },
24
29
  /** 是否显示宫格的边框 */
25
30
  border: {
26
31
  type: Boolean,
@@ -29,7 +34,7 @@ const gridProps = {
29
34
  /** 单个宫格高度 */
30
35
  itemHeight: {
31
36
  type: [Number, String],
32
- default: '80px'
37
+ default: '100%'
33
38
  },
34
39
  /**
35
40
  * 宫格对齐方式,表现为数量少的时候,靠左,居中,还是靠右
@@ -50,7 +55,7 @@ const gridProps = {
50
55
  default: 'transparent'
51
56
  },
52
57
  /** 图标属性api配置集合 */
53
- iconConfig: Object as PropType<HyIconProps>,
58
+ iconProps: Object as PropType<HyIconProps>,
54
59
  /** 定义需要用到的外部样式 */
55
60
  customStyle: Object as PropType<CSSProperties>,
56
61
  /** 自定义外部类名 */
@@ -12,7 +12,7 @@ export interface GridItemVo {
12
12
  /**
13
13
  * 图标属性api配置
14
14
  * */
15
- iconConfig?: Partial<HyIconProps>
15
+ iconProps?: Partial<HyIconProps>
16
16
  /**
17
17
  * 自定义内容键值对
18
18
  * */
@@ -1,9 +1,52 @@
1
- import type { ExtractPropTypes } from 'vue'
2
- import iconProps from './props'
3
-
4
- export interface HyIconProps extends ExtractPropTypes<typeof iconProps> {}
5
-
6
- export interface IIconEmits {
7
- /** 点击图标触发 */
8
- (e: 'click', index: string, e: Event): void
9
- }
1
+ import type { CSSProperties } from 'vue'
2
+
3
+ export interface HyIconProps {
4
+ /** 图标名称 */
5
+ name?: string
6
+ /** 图标颜色 */
7
+ color?: string
8
+ /** 图标字体大小,单位px */
9
+ size?: number | string
10
+ /** 是否显示粗体 */
11
+ bold?: boolean
12
+ /** 点击图标的时候传递事件出去的index(用于区分点击了哪一个) */
13
+ index?: string
14
+ /** 自定义扩展前缀,方便用户扩展自己的图标库 */
15
+ customPrefix?: string
16
+ /** 图标右侧的label文字 */
17
+ label?: string
18
+ /**
19
+ * label相对于图标的位置,只能right或bottom
20
+ * @values right,bottom
21
+ * */
22
+ labelPos?: string
23
+ /** label字体大小,单位px */
24
+ labelSize?: string
25
+ /** 图标右侧的label文字颜色 */
26
+ labelColor?: string
27
+ /** label与图标的距离,单位px */
28
+ space?: number | string
29
+ /** 图片的mode */
30
+ imgMode?: string
31
+ /** 显示图片小图标时的宽度 */
32
+ width?: string | number
33
+ /** 显示图片小图标时的高度 */
34
+ height?: string | number
35
+ /** 图标在垂直方向上的定位 用于解决某些情况下,让图标垂直居中的用途 */
36
+ top?: string | number
37
+ /** 是否阻止事件传播 */
38
+ stop?: boolean
39
+ /** 是否旋转 */
40
+ isRotate?: boolean
41
+ /** 图标圆角 */
42
+ round?: string | number
43
+ /** 定义需要用到的外部样式 */
44
+ customStyle?: CSSProperties
45
+ /** 自定义外部类名 */
46
+ customClass?: string
47
+ }
48
+
49
+ export interface IIconEmits {
50
+ /** 点击图标触发 */
51
+ (e: 'click', index: string, e: Event): void
52
+ }