uview-plus 3.1.52 → 3.2.5

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 (134) hide show
  1. package/changelog.md +51 -0
  2. package/components/u-action-sheet/u-action-sheet.vue +1 -1
  3. package/components/u-album/u-album.vue +261 -261
  4. package/components/u-avatar/u-avatar.vue +3 -2
  5. package/components/u-avatar-group/u-avatar-group.vue +106 -106
  6. package/components/u-button/u-button.vue +6 -1
  7. package/components/u-calendar/u-calendar.vue +4 -3
  8. package/components/u-cell/u-cell.vue +4 -2
  9. package/components/u-checkbox/props.js +5 -0
  10. package/components/u-checkbox/u-checkbox.vue +29 -17
  11. package/components/u-code/u-code.vue +1 -1
  12. package/components/u-dropdown/props.js +8 -14
  13. package/components/u-dropdown/u-dropdown.vue +202 -77
  14. package/components/u-dropdown-item/props.js +45 -36
  15. package/components/u-dropdown-item/u-dropdown-item.vue +121 -148
  16. package/components/u-form/u-form.vue +1 -1
  17. package/components/u-form-item/props.js +6 -1
  18. package/components/u-form-item/u-form-item.vue +1 -1
  19. package/components/u-grid/u-grid.vue +4 -2
  20. package/components/u-grid-item/u-grid-item.vue +8 -7
  21. package/components/u-input/u-input.vue +1 -1
  22. package/components/u-lazy-load/u-lazy-load.vue +251 -0
  23. package/components/u-number-box/u-number-box.vue +4 -4
  24. package/components/u-picker/u-picker.vue +5 -2
  25. package/components/u-popup/u-popup.vue +1 -1
  26. package/components/u-radio/u-radio.vue +2 -2
  27. package/components/u-rate/u-rate.vue +1 -1
  28. package/components/u-read-more/u-read-more.vue +164 -160
  29. package/components/u-slider/u-slider.vue +6 -6
  30. package/components/u-steps-item/u-steps-item.vue +318 -318
  31. package/components/u-subsection/u-subsection.vue +35 -21
  32. package/components/u-swiper/u-swiper.vue +6 -8
  33. package/components/u-switch/u-switch.vue +1 -1
  34. package/components/u-tabbar-item/u-tabbar-item.vue +1 -1
  35. package/components/u-tabs/u-tabs.vue +1 -0
  36. package/components/u-tag/props.js +5 -2
  37. package/components/u-tag/u-tag.vue +1 -1
  38. package/components/u-text/u-text.vue +226 -226
  39. package/components/u-textarea/u-textarea.vue +275 -275
  40. package/components/u-transition/u-transition.vue +1 -1
  41. package/components/u-waterfall/u-waterfall.vue +225 -0
  42. package/index.js +5 -2
  43. package/libs/config/props/formItem.js +1 -0
  44. package/libs/config/props/tag.js +30 -29
  45. package/libs/css/common.scss +4 -1
  46. package/libs/css/components.scss +5 -5
  47. package/libs/css/flex.scss +45 -45
  48. package/libs/mixin/mixin.js +2 -2
  49. package/libs/mixin/mpShare.js +15 -13
  50. package/package.json +1 -1
  51. package/types/comps/_common.d.ts +9 -0
  52. package/types/comps/actionSheet.d.ts +121 -0
  53. package/types/comps/album.d.ts +72 -0
  54. package/types/comps/alert.d.ts +55 -0
  55. package/types/comps/avatar.d.ts +85 -0
  56. package/types/comps/avatarGroup.d.ts +62 -0
  57. package/types/comps/backTop.d.ts +74 -0
  58. package/types/comps/badge.d.ts +76 -0
  59. package/types/comps/button.d.ts +169 -0
  60. package/types/comps/calendar.d.ts +164 -0
  61. package/types/comps/cell.d.ts +133 -0
  62. package/types/comps/cellGroup.d.ts +27 -0
  63. package/types/comps/checkbox.d.ts +69 -0
  64. package/types/comps/checkboxGroup.d.ts +93 -0
  65. package/types/comps/code.d.ts +69 -0
  66. package/types/comps/codeInput.d.ts +98 -0
  67. package/types/comps/col.d.ts +43 -0
  68. package/types/comps/collapse.d.ts +52 -0
  69. package/types/comps/collapseItem.d.ts +83 -0
  70. package/types/comps/countDown.d.ts +60 -0
  71. package/types/comps/countTo.d.ts +88 -0
  72. package/types/comps/datetimePicker.d.ts +146 -0
  73. package/types/comps/divider.d.ts +58 -0
  74. package/types/comps/empty.d.ts +72 -0
  75. package/types/comps/form.d.ts +76 -0
  76. package/types/comps/formItem.d.ts +68 -0
  77. package/types/comps/gap.d.ts +35 -0
  78. package/types/comps/grid.d.ts +34 -0
  79. package/types/comps/gridItem.d.ts +28 -0
  80. package/types/comps/icon.d.ts +93 -0
  81. package/types/comps/image.d.ts +119 -0
  82. package/types/comps/indexAnchor.d.ts +38 -0
  83. package/types/comps/indexItem.d.ts +18 -0
  84. package/types/comps/indexList.d.ts +39 -0
  85. package/types/comps/input.d.ts +234 -0
  86. package/types/comps/keyboard.d.ts +125 -0
  87. package/types/comps/line.d.ts +44 -0
  88. package/types/comps/lineProgress.d.ts +51 -0
  89. package/types/comps/link.d.ts +51 -0
  90. package/types/comps/list.d.ts +92 -0
  91. package/types/comps/listItem.d.ts +18 -0
  92. package/types/comps/loadMore.d.ts +108 -0
  93. package/types/comps/loadingIcon.d.ts +68 -0
  94. package/types/comps/loadingPage.d.ts +58 -0
  95. package/types/comps/modal.d.ts +115 -0
  96. package/types/comps/navbar.d.ts +113 -0
  97. package/types/comps/noNetwork.d.ts +40 -0
  98. package/types/comps/noticeBar.d.ts +85 -0
  99. package/types/comps/notify.d.ts +73 -0
  100. package/types/comps/numberBox.d.ts +155 -0
  101. package/types/comps/overlay.d.ts +46 -0
  102. package/types/comps/parse.d.ts +101 -0
  103. package/types/comps/picker.d.ts +115 -0
  104. package/types/comps/popup.d.ts +103 -0
  105. package/types/comps/radio.d.ts +77 -0
  106. package/types/comps/radioGroup.d.ts +97 -0
  107. package/types/comps/rate.d.ts +85 -0
  108. package/types/comps/readMore.d.ts +80 -0
  109. package/types/comps/row.d.ts +34 -0
  110. package/types/comps/scrollList.d.ts +51 -0
  111. package/types/comps/search.d.ts +167 -0
  112. package/types/comps/skeleton.d.ts +70 -0
  113. package/types/comps/slider.d.ts +79 -0
  114. package/types/comps/steps.d.ts +48 -0
  115. package/types/comps/stepsItem.d.ts +41 -0
  116. package/types/comps/sticky.d.ts +48 -0
  117. package/types/comps/subsection.d.ts +64 -0
  118. package/types/comps/swipeAction.d.ts +24 -0
  119. package/types/comps/swipeActionItem.d.ts +58 -0
  120. package/types/comps/swiper.d.ts +142 -0
  121. package/types/comps/swiperIndicator.d.ts +37 -0
  122. package/types/comps/switch.d.ts +73 -0
  123. package/types/comps/tabbar.d.ts +54 -0
  124. package/types/comps/tabbarItem.d.ts +52 -0
  125. package/types/comps/tabs.d.ts +85 -0
  126. package/types/comps/tag.d.ts +93 -0
  127. package/types/comps/text.d.ts +110 -0
  128. package/types/comps/textarea.d.ts +158 -0
  129. package/types/comps/toast.d.ts +59 -0
  130. package/types/comps/tooltip.d.ts +71 -0
  131. package/types/comps/transition.d.ts +61 -0
  132. package/types/comps/upload.d.ts +163 -0
  133. package/types/comps.d.ts +99 -0
  134. package/types/index.d.ts +47 -0
@@ -0,0 +1,52 @@
1
+ import { AllowedComponentProps, VNodeProps } from './_common'
2
+
3
+ declare interface CollapseProps {
4
+ /**
5
+ * 当前展开面板的name,非手风琴模式:[<String | Number>],手风琴模式:String | Number
6
+ */
7
+ value: string | number | (string | number)[]
8
+ /**
9
+ * 是否手风琴模式
10
+ * @default false
11
+ */
12
+ accordion?: boolean
13
+ /**
14
+ * 是否显示外边框
15
+ * @default true
16
+ */
17
+ border?: boolean
18
+ /**
19
+ * 当前激活面板展开时触发(如果是手风琴模式,参数activeNames类型为String,否则为Array)
20
+ * @param activeNames 活动项
21
+ */
22
+ onChange?: (activeNames: string | any[]) => any
23
+ /**
24
+ * 当前激活面板展开时触发(如果是手风琴模式,参数activeNames类型为String,否则为Array)
25
+ * @param activeNames 活动项
26
+ */
27
+ onOpen?: (activeNames: string | any[]) => any
28
+ /**
29
+ * 当前激活面板关闭时触发(如果是手风琴模式,参数activeNames类型为String,否则为Array)
30
+ * @param activeNames 活动项
31
+ */
32
+ onClose?: (activeNames: string | any[]) => any
33
+ }
34
+
35
+ declare interface _Collapse {
36
+ new (): {
37
+ $props: AllowedComponentProps &
38
+ VNodeProps &
39
+ CollapseProps
40
+ }
41
+ }
42
+
43
+ declare interface _CollapseRef {
44
+ /**
45
+ * 重新初始化内部高度计算,用于异步获取内容的情形,请结合`this.$nextTick()`使用
46
+ */
47
+ init: () => void
48
+ }
49
+
50
+ export declare const Collapse: _Collapse
51
+
52
+ export declare const CollapseRef: _CollapseRef
@@ -0,0 +1,83 @@
1
+ import { AllowedComponentProps, VNodeProps } from './_common'
2
+
3
+ declare interface CollapseItemProps {
4
+ /**
5
+ * 面板标题
6
+ */
7
+ title?: string
8
+ /**
9
+ * 标题右侧内容
10
+ */
11
+ value?: string
12
+ /**
13
+ * 标题下方的描述信息
14
+ */
15
+ label?: string
16
+ /**
17
+ * 面板是否可以打开或收起
18
+ * @default false
19
+ */
20
+ disabled?: boolean
21
+ /**
22
+ * 是否展示右侧箭头并开启点击反馈
23
+ * @default true
24
+ */
25
+ isLink?: boolean
26
+ /**
27
+ * 是否开启点击反馈
28
+ * @default true
29
+ */
30
+ clickable?: boolean
31
+ /**
32
+ * 是否显示内边框
33
+ * @default true
34
+ */
35
+ border?: boolean
36
+ /**
37
+ * 唯一标识符,如不设置,默认用当前`collapse-item`的索引值
38
+ */
39
+ name?: string | number
40
+ /**
41
+ * 标题左侧图片,可为绝对路径的图片或内置图标
42
+ */
43
+ icon?: string
44
+ /**
45
+ * 面板展开收起的过渡时间,单位`ms`
46
+ * @default 300
47
+ */
48
+ duration?: number
49
+ }
50
+
51
+ declare interface CollapseItemSlots {
52
+ /**
53
+ * 主体部分的内容
54
+ */
55
+ ['default']?: () => any
56
+ /**
57
+ * 标题内容
58
+ */
59
+ ['title']?: () => any
60
+ /**
61
+ * icon
62
+ */
63
+ ['icon']?: () => any
64
+ /**
65
+ * 右侧value
66
+ */
67
+ ['value']?: () => any
68
+ /**
69
+ * 右侧icon
70
+ */
71
+ ['right-icon']?: () => any
72
+ }
73
+
74
+ declare interface _CollapseItem {
75
+ new (): {
76
+ $props: AllowedComponentProps &
77
+ VNodeProps &
78
+ CollapseItemProps
79
+ $slots: CollapseItemSlots
80
+ }
81
+ }
82
+
83
+ export declare const CollapseItem: _CollapseItem
@@ -0,0 +1,60 @@
1
+ import { AllowedComponentProps, VNodeProps } from './_common'
2
+
3
+ declare interface CountDownProps {
4
+ /**
5
+ * 倒计时时长,单位ms
6
+ * @default 0
7
+ */
8
+ time?: string | number
9
+ /**
10
+ * 时间格式,DD-日,HH-时,mm-分,ss-秒,SSS-毫秒
11
+ * @default "HH:mm:ss"
12
+ */
13
+ format?: string
14
+ /**
15
+ * 是否自动开始倒计时
16
+ * @default true
17
+ */
18
+ autoStart?: boolean
19
+ /**
20
+ * 是否展示毫秒倒计时
21
+ * @default false
22
+ */
23
+ millisecond?: boolean
24
+ /**
25
+ * 过程中,倒计时变化时触发
26
+ * @param time 剩余的时间
27
+ */
28
+ onChange?: (time: any) => any
29
+ /**
30
+ * 倒计时结束
31
+ */
32
+ onFinish?: () => any
33
+ }
34
+
35
+ declare interface _CountDownRef {
36
+ /**
37
+ * 开始倒计时
38
+ */
39
+ start: () => void
40
+ /**
41
+ * 暂停倒计时
42
+ */
43
+ pause: () => void
44
+ /**
45
+ * 重置倒计时
46
+ */
47
+ reset: () => void
48
+ }
49
+
50
+ declare interface _CountDown {
51
+ new (): {
52
+ $props: AllowedComponentProps &
53
+ VNodeProps &
54
+ CountDownProps
55
+ }
56
+ }
57
+
58
+ export declare const CountDown: _CountDown
59
+
60
+ export declare const CountDownRef: _CountDownRef
@@ -0,0 +1,88 @@
1
+ import { AllowedComponentProps, VNodeProps } from './_common'
2
+
3
+ declare interface CountToProps {
4
+ /**
5
+ * 开始值
6
+ * @default 0
7
+ */
8
+ startVal?: string | number
9
+ /**
10
+ * 结束值
11
+ * @default 0
12
+ */
13
+ endVal?: string | number
14
+ /**
15
+ * 滚动过程所需的时间,单位ms
16
+ * @default 2000
17
+ */
18
+ duration?: string | number
19
+ /**
20
+ * 是否自动开始滚动
21
+ * @default true
22
+ */
23
+ autoplay?: boolean
24
+ /**
25
+ * 要显示的小数位数,详细见[文档](https://www.uviewui.com/components/countTo.html#%E6%98%AF%E5%90%A6%E6%98%BE%E7%A4%BA%E5%B0%8F%E6%95%B0%E4%BD%8D)
26
+ * @default 0
27
+ */
28
+ decimals?: string | number
29
+ /**
30
+ * 滚动结束时,是否缓动结尾,详细见[文档](https://www.uviewui.com/components/countTo.html#%E8%AE%BE%E7%BD%AE%E6%BB%9A%E5%8A%A8%E7%9B%B8%E5%85%B3%E5%8F%82%E6%95%B0)
31
+ * @default true
32
+ */
33
+ useEasing?: boolean
34
+ /**
35
+ * 十进制分割
36
+ */
37
+ decimal?: string
38
+ /**
39
+ * 字体颜色
40
+ * @default #606266
41
+ */
42
+ color?: string
43
+ /**
44
+ * 字体大小,单位px
45
+ * @default 22
46
+ */
47
+ fontSize?: string | number
48
+ /**
49
+ * 字体是否加粗
50
+ * @default false
51
+ */
52
+ bold?: boolean
53
+ /**
54
+ * 千位分隔符,详细见[文档](https://www.uviewui.com/components/countTo.html#%E5%8D%83%E5%88%86%E4%BD%8D%E5%88%86%E9%9A%94%E7%AC%A6)
55
+ */
56
+ separator?: string
57
+ /**
58
+ * 数值滚动到目标值时触发
59
+ */
60
+ onEnd?: () => any
61
+ }
62
+
63
+ declare interface _CountToRef {
64
+ /**
65
+ * `autoplay`为`false`时,通过此方法启动滚动
66
+ */
67
+ start: () => void
68
+ /**
69
+ * 暂停后重新开始滚动(从暂停前的值开始滚动)
70
+ */
71
+ reStart: () => void
72
+ /**
73
+ * 暂停滚动
74
+ */
75
+ paused: () => void
76
+ }
77
+
78
+ declare interface _CountTo {
79
+ new (): {
80
+ $props: AllowedComponentProps &
81
+ VNodeProps &
82
+ CountToProps
83
+ }
84
+ }
85
+
86
+ export declare const CountTo: _CountTo
87
+
88
+ export declare const CountToRef: _CountToRef
@@ -0,0 +1,146 @@
1
+ import { AllowedComponentProps, VNodeProps } from './_common'
2
+
3
+ declare interface DatetimePickerProps {
4
+ /**
5
+ * 用于控制选择器的弹出与收起
6
+ * @default false
7
+ */
8
+ show?: boolean
9
+ /**
10
+ * 是否显示顶部的操作栏
11
+ * @default true
12
+ */
13
+ showToolbar?: boolean
14
+ /**
15
+ * 绑定值
16
+ */
17
+ ['v-model']?: string | number
18
+ /**
19
+ * 顶部标题
20
+ */
21
+ title?: string
22
+ /**
23
+ * 展示格式
24
+ * @default "datetime"
25
+ */
26
+ mode?: 'datetime' | 'date' | 'time' | 'year-month'
27
+ /**
28
+ * 可选的最大时间(时间戳毫秒)
29
+ * @default 最大默认值为后10年
30
+ */
31
+ maxDate?: number
32
+ /**
33
+ * 可选的最小时间(时间戳毫秒)
34
+ * @default 最小默认值为前10年
35
+ */
36
+ minDate?: number
37
+ /**
38
+ * 可选的最小小时,仅mode=time有效
39
+ * @default 0
40
+ */
41
+ minHour?: number
42
+ /**
43
+ * 可选的最大小时,仅mode=time有效
44
+ * @default 23
45
+ */
46
+ maxHour?: number
47
+ /**
48
+ * 可选的最小分钟,仅mode=time有效
49
+ * @default 0
50
+ */
51
+ minMinute?: number
52
+ /**
53
+ * 可选的最大分钟,仅mode=time有效
54
+ * @default 59
55
+ */
56
+ maxMinute?: number
57
+ /**
58
+ * 选项过滤函数
59
+ * @default null
60
+ */
61
+ filter?: (...args: any) => any
62
+ /**
63
+ * 输入过滤或格式化函数(如需兼容微信小程序,则只能通过`setFormatter`方法)
64
+ * @default null
65
+ */
66
+ formatter?: (...args: any) => any
67
+ /**
68
+ * 是否显示加载中状态
69
+ * @default false
70
+ */
71
+ loading?: boolean
72
+ /**
73
+ * 各列中,单个选项的高度
74
+ * @default 44
75
+ */
76
+ itemHeight?: string | number
77
+ /**
78
+ * 取消按钮的文字
79
+ * @default "取消"
80
+ */
81
+ cancelText?: string
82
+ /**
83
+ * 确认按钮的文字
84
+ * @default "确认"
85
+ */
86
+ confirmText?: string
87
+ /**
88
+ * 取消按钮的颜色
89
+ * @default "#909193"
90
+ */
91
+ cancelColor?: string
92
+ /**
93
+ * 确认按钮的颜色
94
+ * @default "#3c9cff"
95
+ */
96
+ confirmColor?: string
97
+ /**
98
+ * 每列中可见选项的数量
99
+ * @default 5
100
+ */
101
+ visibleItemCount?: string | number
102
+ /**
103
+ * 是否允许点击遮罩关闭选择器(注意:关闭事件需要自行处理,只会在开启closeOnClickOverlay后点击遮罩层执行close回调)
104
+ * @default false
105
+ */
106
+ closeOnClickOverlay?: boolean
107
+ /**
108
+ * 各列的默认索引
109
+ */
110
+ defaultIndex?: any[]
111
+ /**
112
+ * 关闭选择器时触发
113
+ */
114
+ onClose?: () => any
115
+ /**
116
+ * 点击确定按钮,返回当前选择的值
117
+ */
118
+ onConfirm?: () => any
119
+ /**
120
+ * 当选择值变化时触发
121
+ */
122
+ onChange?: () => any
123
+ /**
124
+ * 点击取消按钮
125
+ */
126
+ onCancel?: () => any
127
+ }
128
+
129
+ declare interface _DatetimePickerRef {
130
+ /**
131
+ * 为兼容微信小程序而暴露的内部方法,详见[文档](https://www.uviewui.com/components/datetimePicker.html#%E6%A0%BC%E5%BC%8F%E5%8C%96)
132
+ */
133
+ setFormatter: (type, value) => any
134
+ }
135
+
136
+ declare interface _DatetimePicker {
137
+ new (): {
138
+ $props: AllowedComponentProps &
139
+ VNodeProps &
140
+ DatetimePickerProps
141
+ }
142
+ }
143
+
144
+ export declare const DatetimePicker: _DatetimePicker
145
+
146
+ export declare const DatetimePickerRef: _DatetimePickerRef
@@ -0,0 +1,58 @@
1
+ import { AllowedComponentProps, VNodeProps } from './_common'
2
+
3
+ declare interface DividerProps {
4
+ /**
5
+ * 是否虚线
6
+ * @default false
7
+ */
8
+ dashed?: boolean
9
+ /**
10
+ * 是否细线
11
+ * @default true
12
+ */
13
+ hairline?: boolean
14
+ /**
15
+ * 是否以点替代文字,优先于text字段起作用
16
+ * @default false
17
+ */
18
+ dot?: boolean
19
+ /**
20
+ * 内容文本的位置
21
+ * @default "center"
22
+ */
23
+ textPosition?: 'left' | 'center' | 'right'
24
+ /**
25
+ * 文本内容
26
+ */
27
+ text?: string | number
28
+ /**
29
+ * 文本大小
30
+ * @default 14
31
+ */
32
+ textSize?: string | number
33
+ /**
34
+ * 文本颜色
35
+ * @default #909399
36
+ */
37
+ textColor?: string
38
+ /**
39
+ * 线条颜色
40
+ * @default #dcdfe6
41
+ */
42
+ lineColor?: string
43
+ /**
44
+ * divider组件被点击时触发
45
+ */
46
+ onClick?: () => any
47
+ }
48
+
49
+ declare interface _Divider {
50
+ new (): {
51
+ $props: AllowedComponentProps &
52
+ VNodeProps &
53
+ DividerProps
54
+ }
55
+ }
56
+
57
+ export declare const Divider: _Divider
58
+
@@ -0,0 +1,72 @@
1
+ import { AllowedComponentProps, VNodeProps } from './_common'
2
+
3
+ declare interface EmptyProps {
4
+ /**
5
+ * 内置图标名称,或图片路径,建议绝对路径
6
+ */
7
+ icon?: string
8
+ /**
9
+ * 文字提示
10
+ */
11
+ text?: string
12
+ /**
13
+ * 文字颜色
14
+ * @default "#c0c4cc"
15
+ */
16
+ textColor?: string
17
+ /**
18
+ * 文字大小
19
+ * @default 14
20
+ */
21
+ textSize?: string | number
22
+ /**
23
+ * 图标的颜色
24
+ * @default "#c0c4cc"
25
+ */
26
+ iconColor?: string
27
+ /**
28
+ * 图标的大小
29
+ * @default 90
30
+ */
31
+ iconSize?: string | number
32
+ /**
33
+ * 内置的图标,详细见[文档](https://www.uviewui.com/components/empty.html#%E5%86%85%E7%BD%AE%E5%9B%BE%E6%A0%87)
34
+ * @default "data"
35
+ */
36
+ mode?: string
37
+ /**
38
+ * 图标的宽度,单位px
39
+ * @default 160
40
+ */
41
+ width?: string | number
42
+ /**
43
+ * 图标的高度,单位px
44
+ * @default 160
45
+ */
46
+ height?: string | number
47
+ /**
48
+ * 是否显示组件
49
+ * @default true
50
+ */
51
+ show?: boolean
52
+ /**
53
+ * 组件到上一个元素的间距,单位px
54
+ * @default 0
55
+ */
56
+ marginTop?: string | number
57
+ }
58
+
59
+ declare interface EmptySlots {
60
+ ['default']?: () => any
61
+ }
62
+
63
+ declare interface _Empty {
64
+ new (): {
65
+ $props: AllowedComponentProps &
66
+ VNodeProps &
67
+ EmptyProps
68
+ $slots: EmptySlots
69
+ }
70
+ }
71
+
72
+ export declare const Empty: _Empty
@@ -0,0 +1,76 @@
1
+ import { AllowedComponentProps, VNodeProps } from './_common'
2
+
3
+ declare interface FormProps {
4
+ /**
5
+ * 表单数据对象
6
+ */
7
+ model?: Record<string, any>
8
+ /**
9
+ * 通过ref设置,如果rules中有自定义方法等,需要使用setRules方法设置规则,详见[文档](https://www.uviewui.com/components/form.html#%E9%AA%8C%E8%AF%81%E8%A7%84%E5%88%99)
10
+ */
11
+ rules?: Record<string, any>
12
+ /**
13
+ * 错误的提示方式
14
+ * @default "message"
15
+ */
16
+ errorType?: 'message' | 'none' | 'toast' | 'border-bottom' | 'none'
17
+ /**
18
+ * 是否显示表单域的下划线边框
19
+ * @default true
20
+ */
21
+ borderBottom?: boolean
22
+ /**
23
+ * 表单域提示文字的位置,left-左侧,top-上方
24
+ * @default "left"
25
+ */
26
+ labelPosition?: 'left' | 'top'
27
+ /**
28
+ * 提示文字的宽度,单位px
29
+ * @default 45
30
+ */
31
+ labelWidth?: string | number
32
+ /**
33
+ * lable字体的对齐方式
34
+ * @default "left"
35
+ */
36
+ labelAlign?: 'left' | 'center' | 'right'
37
+ /**
38
+ * lable的样式
39
+ */
40
+ labelStyle?: unknown
41
+ }
42
+
43
+ declare interface _FormRef {
44
+ /**
45
+ * 对整个表单进行校验的方法
46
+ */
47
+ validate: () => any
48
+ /**
49
+ * 如果`rules`中有自定义方法等,需要用此方法设置`rules`规则,否则微信小程序无效
50
+ */
51
+ setRules: (rules: any) => any
52
+ /**
53
+ * 对部分表单字段进行校验
54
+ */
55
+ validateField: (value, cb: ((errorsRes) => any)) => any
56
+ /**
57
+ * 对整个表单进行重置,将所有字段值重置为初始值并移除校验结果
58
+ */
59
+ resetFields: () => any
60
+ /**
61
+ * 清空校验结果
62
+ */
63
+ clearValidate: (props: any) => any
64
+ }
65
+
66
+ declare interface _Form {
67
+ new (): {
68
+ $props: AllowedComponentProps &
69
+ VNodeProps &
70
+ FormProps
71
+ }
72
+ }
73
+
74
+ export declare const Form: _Form
75
+
76
+ export declare const FormRef: _FormRef
@@ -0,0 +1,68 @@
1
+ import { AllowedComponentProps, VNodeProps } from './_common'
2
+
3
+ declare interface FormItemProps {
4
+ /**
5
+ * 左侧提示文字
6
+ */
7
+ label?: string
8
+ /**
9
+ * 表单域`model`对象的属性名,在使用 validate、resetFields 方法的情况下,该属性是必填的
10
+ */
11
+ prop?: string
12
+ /**
13
+ * 是否显示下边框,如不需要下边框,需同时将u-form的同名参数设置为false
14
+ * @default true
15
+ */
16
+ borderBottom?: boolean
17
+ /**
18
+ * 提示文字的宽度,单位rpx,如设置,将覆盖`u-form`的同名参数
19
+ */
20
+ labelWidth?: string | number
21
+ /**
22
+ * label的位置
23
+ */
24
+ labelPosition?: 'left' | 'top'
25
+ /**
26
+ * 右侧自定义字体图标(限uView内置图标)或图片地址
27
+ */
28
+ rightIcon?: string
29
+ /**
30
+ * 左侧自定义字体图标(限uView内置图标)或图片地址
31
+ */
32
+ leftIcon?: string
33
+ /**
34
+ * 左侧自定义字体图标的样式
35
+ */
36
+ leftIconStyle?: unknown
37
+ /**
38
+ * 是否显示左边的"*"号,这里仅起展示作用,如需校验必填,请通过rules配置必填规则,如需在swiper标签内显示星号,需要给予swiper-item内第一个根节点一定的margin样式
39
+ * @default false
40
+ */
41
+ required?: boolean
42
+ /**
43
+ * 点击时触发
44
+ */
45
+ onClick?: () => any
46
+ }
47
+
48
+ declare interface FormItemSlots {
49
+ /**
50
+ * Form Item 的内容
51
+ */
52
+ ['default']?: () => any
53
+ /**
54
+ * 右侧自定义内容,可以在此传入一个按钮,用于获取验证码等场景
55
+ */
56
+ ['right']?: () => any
57
+ }
58
+
59
+ declare interface _FormItem {
60
+ new (): {
61
+ $props: AllowedComponentProps &
62
+ VNodeProps &
63
+ FormItemProps
64
+ $slots: FormItemSlots
65
+ }
66
+ }
67
+
68
+ export declare const FormItem: _FormItem