hy-app 0.5.0 → 0.5.2

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.
@@ -16,7 +16,7 @@ const avatarProps = {
16
16
  * @values large, medium, small
17
17
  * */
18
18
  size: {
19
- type: [String, Number] as PropType<string | number>,
19
+ type: [String, Number],
20
20
  default: 'medium'
21
21
  },
22
22
  /**
@@ -122,7 +122,7 @@ const buttonProps = {
122
122
  default: true
123
123
  },
124
124
  /** 定义需要用到的外部样式 */
125
- customStyle: Object as unknown as PropType<CSSProperties>,
125
+ customStyle: Object as PropType<CSSProperties>,
126
126
  /** 自定义外部类名 */
127
127
  customClass: String
128
128
  }
@@ -43,7 +43,7 @@ const calendarProps = {
43
43
  },
44
44
  /** 自定义列表 */
45
45
  customList: {
46
- type: Array as unknown as PropType<any[]>,
46
+ type: Array as PropType<any[]>,
47
47
  default: []
48
48
  },
49
49
  /** 主题色,对底部按钮和选中日期有效 */
@@ -141,12 +141,12 @@ const calendarProps = {
141
141
  },
142
142
  /** 星期文案 */
143
143
  weekText: {
144
- type: Array as unknown as PropType<string[]>,
144
+ type: Array as PropType<string[]>,
145
145
  default: () => ['一', '二', '三', '四', '五', '六', '日']
146
146
  },
147
147
  /** 单选与多选禁止选中的日期列表,mode!=range时有效。 */
148
148
  forbidDays: {
149
- type: Array as unknown as PropType<Date[]>,
149
+ type: Array as PropType<Date[]>,
150
150
  default: () => []
151
151
  },
152
152
  /** 单选与多选禁止选中的日期选择时提示 */
@@ -9,13 +9,13 @@ const checkboxProps = {
9
9
  },
10
10
  /** 选择列表数据 */
11
11
  columns: {
12
- type: Array as unknown as PropType<Array<CheckboxColumnsVo>>,
12
+ type: Array as PropType<Array<CheckboxColumnsVo>>,
13
13
  default: [],
14
14
  required: true
15
15
  },
16
16
  /** 自定义接收columns的键 */
17
17
  fieldNames: {
18
- type: Object as unknown as PropType<IFieldNames>,
18
+ type: Object as PropType<IFieldNames>,
19
19
  default: {
20
20
  label: 'label',
21
21
  value: 'value',
@@ -33,7 +33,7 @@ const datetimePickerProps = {
33
33
  * @values date,time,year-month,datetime
34
34
  * */
35
35
  mode: {
36
- type: String as PropType<DateModeEnum>,
36
+ type: String,
37
37
  default: DateModeEnum.DATETIME
38
38
  },
39
39
  /** 可选的最大时间 默认值为后10年 */
@@ -12,7 +12,7 @@ const flexProps = {
12
12
  * @values flex-start,flex-end,space-between,space-around,space-evenly,center
13
13
  * */
14
14
  justify: {
15
- type: String as PropType<FlexJustify>,
15
+ type: String,
16
16
  default: 'flex-start'
17
17
  },
18
18
  /**
@@ -20,7 +20,7 @@ const flexProps = {
20
20
  * @values flex-start,center,flex-end,stretch,baseline
21
21
  * */
22
22
  align: {
23
- type: String as PropType<FlexAlign>,
23
+ type: String,
24
24
  default: 'flex-start'
25
25
  },
26
26
  /**
@@ -28,7 +28,7 @@ const flexProps = {
28
28
  * @values nowrap,wrap,wrap-reverse
29
29
  * */
30
30
  wrap: {
31
- type: String as PropType<FlexWrap>,
31
+ type: String,
32
32
  default: 'nowrap'
33
33
  },
34
34
  /** flex 属性,支持数字或字符串。如 1 或 'none' */
@@ -5,7 +5,7 @@ import type { CSSProperties, PropType } from 'vue'
5
5
  const floatButtonProps = {
6
6
  /** 菜单栏集合 */
7
7
  menus: {
8
- type: Array as unknown as PropType<MenusType[]>,
8
+ type: Array as PropType<MenusType[]>,
9
9
  default: []
10
10
  },
11
11
  /**
@@ -27,7 +27,7 @@ const floatButtonProps = {
27
27
  iconColor: String,
28
28
  /** 到边框最小距离 */
29
29
  gap: {
30
- type: Object as unknown as PropType<IGap>,
30
+ type: Object as PropType<IGap>,
31
31
  default: { left: 16, right: 16, top: 16, bottom: 40 }
32
32
  },
33
33
  /** 层级 */
@@ -51,7 +51,7 @@ const floatButtonProps = {
51
51
  * @values small,medium,large
52
52
  * */
53
53
  size: {
54
- type: [String, Number] as PropType<string | number>,
54
+ type: [String, Number],
55
55
  default: 'medium'
56
56
  },
57
57
  /**
@@ -21,7 +21,7 @@ const formProps = {
21
21
  * @values left,top
22
22
  * */
23
23
  labelPosition: {
24
- type: String as PropType<HyApp.LabelPosition>,
24
+ type: String,
25
25
  default: 'left'
26
26
  },
27
27
  /**
@@ -29,7 +29,7 @@ const formProps = {
29
29
  * @values left,center,right
30
30
  * */
31
31
  labelAlign: {
32
- type: String as PropType<HyApp.ColumnCenterType>,
32
+ type: String,
33
33
  default: 'left'
34
34
  }
35
35
  }
@@ -1,5 +1,5 @@
1
1
  import type { CSSProperties, PropType } from 'vue'
2
- import type { InputConfirmType, InputType } from '@uni-helper/uni-types'
2
+ import type { InputConfirmType } from '@uni-helper/uni-types'
3
3
  import type HyIconProps from '../hy-icon/typing'
4
4
 
5
5
  const inputProps = {
@@ -13,7 +13,7 @@ const inputProps = {
13
13
  * @values text,idcard,number,digit,safe-password,tel,nickname
14
14
  * */
15
15
  type: {
16
- type: String as PropType<InputType>,
16
+ type: String,
17
17
  default: 'text'
18
18
  },
19
19
  /** 如果 textarea 是在一个 position:fixed 的区域,需要显示指定属性 fixed 为 true,兼容性:微信小程序、百度小程序、字节跳动小程序、QQ小程序 */
@@ -123,7 +123,7 @@ const inputProps = {
123
123
  * @values left,center,right
124
124
  * */
125
125
  inputAlign: {
126
- type: String as PropType<HyApp.RowCenterType>,
126
+ type: String,
127
127
  default: 'left'
128
128
  },
129
129
  /** 输入框字体的大小 */
@@ -21,7 +21,7 @@ const loadingProps = {
21
21
  * @values row,column
22
22
  * */
23
23
  direction: {
24
- type: String as PropType<HyApp.DirectionType>,
24
+ type: String,
25
25
  default: 'row'
26
26
  },
27
27
  /**
@@ -29,7 +29,7 @@ const loadingProps = {
29
29
  * @values spinner, circle, semicircle
30
30
  * */
31
31
  mode: {
32
- type: String as PropType<HyApp.LoadingMode>,
32
+ type: String,
33
33
  default: 'spinner'
34
34
  },
35
35
  /** 加载图标的大小,单位px */
@@ -30,7 +30,7 @@ const noticeBarProps = {
30
30
  * 通告模式,link-显示右箭头,closable-显示右侧关闭图标
31
31
  * @values link,closable
32
32
  * */
33
- mode: String as PropType<NoticeBarModeVo>,
33
+ mode: String,
34
34
  /** 文字颜色,各图标也会使用文字颜色 */
35
35
  color: String,
36
36
  /** 背景颜色 */
@@ -60,7 +60,7 @@ const noticeBarProps = {
60
60
  * @values flex-start,flex-start,center
61
61
  * */
62
62
  justifyContent: {
63
- type: String as PropType<HyApp.JustifyContentType>,
63
+ type: String,
64
64
  default: 'flex-start'
65
65
  },
66
66
  /**
@@ -68,7 +68,7 @@ const noticeBarProps = {
68
68
  * @values navigateTo,redirectTo,switchTab,reLaunch
69
69
  * */
70
70
  linkType: {
71
- type: String as PropType<HyApp.NavigationType>,
71
+ type: String,
72
72
  default: 'navigateTo'
73
73
  },
74
74
  /** 跳转地址 */
@@ -11,7 +11,7 @@ const notifyProps = {
11
11
  * @values primary,success,warning,error,info
12
12
  * */
13
13
  type: {
14
- type: String as PropType<HyApp.ThemeType>,
14
+ type: String,
15
15
  default: 'primary'
16
16
  },
17
17
  /** 字体颜色 */
@@ -16,7 +16,7 @@ const popoverProps = {
16
16
  * @values top,top-start,top-end,bottom,bottom-start,bottom-end,left,left-start,left-end,right,right-start,right-end
17
17
  * */
18
18
  placement: {
19
- type: String as PropType<IPlacementVo>,
19
+ type: String,
20
20
  default: 'bottom'
21
21
  },
22
22
  /** 控制 popover 的显示状态 */
@@ -16,7 +16,7 @@ const popupProps = {
16
16
  * @values left,right,top,bottom,center
17
17
  * */
18
18
  mode: {
19
- type: String as PropType<HyApp.LayoutType>,
19
+ type: String,
20
20
  default: 'bottom'
21
21
  },
22
22
  /** 动画时长,单位ms */
@@ -27,7 +27,7 @@ const radioProps = {
27
27
  * @values small,medium,large
28
28
  * */
29
29
  size: {
30
- type: String as PropType<HyApp.SizeType>,
30
+ type: String,
31
31
  default: 'medium'
32
32
  },
33
33
  /**
@@ -35,7 +35,7 @@ const radioProps = {
35
35
  * @values circle,square
36
36
  * */
37
37
  shape: {
38
- type: String as PropType<HyApp.ShapeType>,
38
+ type: String,
39
39
  default: 'square'
40
40
  },
41
41
  /** 是否禁用 */
@@ -29,7 +29,7 @@ const searchProps = {
29
29
  * @valuse send,search,next,go,done
30
30
  * */
31
31
  confirmType: {
32
- type: String as PropType<InputConfirmType>,
32
+ type: String,
33
33
  default: 'search'
34
34
  },
35
35
  /** 是否启用清除控件 */
@@ -65,7 +65,7 @@ const searchProps = {
65
65
  /** 右侧控件的样式,对象形式 */
66
66
  actionStyle: {
67
67
  type: Object as PropType<CSSProperties>,
68
- default: {}
68
+ default: () => {}
69
69
  },
70
70
  /** 输入框内容水平对齐方式 */
71
71
  inputAlign: {
@@ -75,7 +75,7 @@ const searchProps = {
75
75
  /** 自定义输入框样式,对象形式 */
76
76
  inputStyle: {
77
77
  type: Object as PropType<CSSProperties>,
78
- default: {}
78
+ default: () => {}
79
79
  },
80
80
  /** 是否启用输入框 */
81
81
  disabled: {
@@ -6,7 +6,7 @@ const swipeActionProps = {
6
6
  * 滑动按钮的状态,使用v-model进行双向绑定。
7
7
  * @values left,close,right
8
8
  * */
9
- modelValue: String as PropType<SwipeActionStatus>,
9
+ modelValue: String,
10
10
  /** 是否禁用滑动操作 */
11
11
  disabled: {
12
12
  type: Boolean,
@@ -35,7 +35,7 @@ const swiperProps = {
35
35
  * @values line,dot
36
36
  * */
37
37
  indicatorMode: {
38
- type: String as PropType<HyApp.SwiperIndicatorModeType>,
38
+ type: String,
39
39
  default: 'line'
40
40
  },
41
41
  /** 是否自动切换 */
@@ -90,7 +90,7 @@ const swiperProps = {
90
90
  * @values default,linear,easeInCubic,easeOutCubic,easeInOutCubic
91
91
  * */
92
92
  easingFunction: {
93
- type: String as PropType<SwiperEasingFunction>,
93
+ type: String,
94
94
  default: 'default'
95
95
  },
96
96
  /** 图片的裁剪模式 */
@@ -24,7 +24,7 @@ const tagProps = {
24
24
  * @values large,medium,small,mini
25
25
  * */
26
26
  size: {
27
- type: String as PropType<HyApp.SizeType | 'mini'>,
27
+ type: String,
28
28
  default: 'medium'
29
29
  },
30
30
  /**
@@ -32,7 +32,7 @@ const tagProps = {
32
32
  * @values circle,square,opposite
33
33
  * */
34
34
  shape: {
35
- type: String as PropType<HyApp.ShapeType | 'opposite'>,
35
+ type: String,
36
36
  default: 'square'
37
37
  },
38
38
  /** 背景颜色,默认为空字符串,即不处理 */
@@ -11,7 +11,7 @@ const textProps = {
11
11
  * 主题颜色
12
12
  * @values primary,success,error,warning,info
13
13
  * */
14
- type: String as PropType<HyApp.ThemeType>,
14
+ type: String,
15
15
  /** 是否显示 */
16
16
  show: {
17
17
  type: Boolean,
@@ -17,7 +17,7 @@ const tooltipProps = {
17
17
  * @values longpress,click
18
18
  * */
19
19
  triggerMode: {
20
- type: String as PropType<'longpress' | 'click'>,
20
+ type: String,
21
21
  default: 'longpress'
22
22
  },
23
23
  /**
@@ -25,7 +25,7 @@ const tooltipProps = {
25
25
  * @values top,top-start,top-end,bottom,bottom-start,bottom-end,left,left-start,left-end,right,right-start,right-end
26
26
  * */
27
27
  placement: {
28
- type: String as PropType<IPlacementVo>,
28
+ type: String,
29
29
  default: 'bottom'
30
30
  },
31
31
  /** 文本大小 */
@@ -25,7 +25,7 @@ const warnProps = {
25
25
  },
26
26
  /** 显示的暗色或者亮色 */
27
27
  theme: {
28
- type: String as PropType<HyApp.DarkModeType>,
28
+ type: String,
29
29
  default: 'dark'
30
30
  },
31
31
  /** 文字是否居中 */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hy-app",
3
- "version": "0.5.0",
4
- "description": "重构props属性放在外部文件上",
3
+ "version": "0.5.2",
4
+ "description": "fix: 加事件和插槽",
5
5
  "main": "./index.ts",
6
6
  "private": false,
7
7
  "scripts": {},