@tdesign/uniapp 0.7.2 → 0.8.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.
- package/CHANGELOG.md +31 -0
- package/README.md +32 -2
- package/dist/action-sheet/README.md +1 -1
- package/dist/action-sheet/action-sheet.vue +158 -150
- package/dist/action-sheet/props.ts +2 -2
- package/dist/action-sheet/type.ts +1 -1
- package/dist/avatar/avatar.vue +89 -87
- package/dist/avatar-group/avatar-group.vue +69 -67
- package/dist/back-top/back-top.vue +60 -58
- package/dist/badge/badge.vue +69 -59
- package/dist/button/button.vue +121 -116
- package/dist/button/props.ts +2 -2
- package/dist/button/type.ts +1 -1
- package/dist/calendar/calendar-header.vue +4 -4
- package/dist/calendar/calendar.vue +308 -297
- package/dist/calendar/template.vue +1 -1
- package/dist/cascader/README.en-US.md +2 -1
- package/dist/cascader/README.md +2 -1
- package/dist/cascader/cascader.vue +340 -328
- package/dist/cascader/props.ts +6 -1
- package/dist/cascader/type.ts +6 -0
- package/dist/cell/cell.vue +127 -121
- package/dist/cell-group/cell-group.vue +32 -30
- package/dist/check-tag/check-tag.vue +73 -71
- package/dist/checkbox/README.en-US.md +6 -6
- package/dist/checkbox/README.md +5 -5
- package/dist/checkbox/checkbox.vue +127 -127
- package/dist/checkbox/props.ts +6 -6
- package/dist/checkbox/type.ts +6 -4
- package/dist/checkbox-group/checkbox-group.vue +175 -173
- package/dist/checkbox-group/props.ts +6 -6
- package/dist/checkbox-group/type.ts +6 -4
- package/dist/col/col.vue +26 -24
- package/dist/collapse/collapse.vue +83 -81
- package/dist/collapse-panel/collapse-panel.vue +121 -119
- package/dist/collapse-panel/props.ts +4 -4
- package/dist/collapse-panel/type.ts +2 -2
- package/dist/color-picker/README.md +1 -1
- package/dist/color-picker/color-picker.vue +324 -322
- package/dist/color-picker/props.ts +2 -2
- package/dist/color-picker/template.vue +14 -10
- package/dist/common/common.ts +1 -0
- package/dist/common/style/theme/index.css +57 -61
- package/dist/common/utils.js +7 -2
- package/dist/common/validator.js +172 -0
- package/dist/config-provider/README.en-US.md +184 -0
- package/dist/config-provider/README.md +234 -0
- package/dist/config-provider/config-provider.vue +105 -0
- package/dist/config-provider/config-store.js +70 -0
- package/dist/config-provider/props.ts +16 -0
- package/dist/config-provider/reactive-state.js +39 -0
- package/dist/config-provider/type.ts +401 -0
- package/dist/config-provider/use-config.js +29 -0
- package/dist/config-provider/utils.js +29 -0
- package/dist/count-down/count-down.vue +98 -97
- package/dist/date-time-picker/date-time-picker.vue +410 -395
- package/dist/demo/demo.vue +1 -0
- package/dist/dialog/dialog.vue +176 -173
- package/dist/divider/divider.vue +38 -36
- package/dist/draggable/draggable.vue +60 -58
- package/dist/drawer/README.md +1 -1
- package/dist/drawer/drawer.vue +48 -46
- package/dist/dropdown-item/dropdown-item.vue +209 -207
- package/dist/dropdown-item/props.ts +4 -4
- package/dist/dropdown-item/type.ts +3 -3
- package/dist/dropdown-menu/dropdown-menu.vue +93 -99
- package/dist/empty/empty.vue +43 -42
- package/dist/fab/fab.vue +88 -86
- package/dist/footer/footer.vue +36 -34
- package/dist/form/README.en-US.md +17 -24
- package/dist/form/README.md +18 -25
- package/dist/form/form.css +1 -166
- package/dist/form/form.vue +251 -236
- package/dist/form/props.ts +2 -21
- package/dist/form/type.ts +7 -70
- package/dist/form-item/README.en-US.md +4 -5
- package/dist/form-item/README.md +4 -5
- package/dist/form-item/form-item.css +69 -96
- package/dist/form-item/form-item.vue +315 -336
- package/dist/form-item/form-model.ts +125 -173
- package/dist/form-item/props.ts +4 -17
- package/dist/form-item/type.ts +43 -1
- package/dist/grid/grid.vue +53 -51
- package/dist/grid-item/grid-item.vue +121 -119
- package/dist/guide/README.md +1 -1
- package/dist/guide/guide.vue +281 -277
- package/dist/icon/README.md +2 -4
- package/dist/icon/icon.vue +78 -76
- package/dist/image/README.md +1 -1
- package/dist/image/image.vue +103 -101
- package/dist/image-viewer/image-viewer.vue +160 -158
- package/dist/image-viewer/props.ts +2 -2
- package/dist/image-viewer/type.ts +1 -1
- package/dist/index.js +3 -0
- package/dist/indexes/indexes.vue +264 -267
- package/dist/indexes-anchor/indexes-anchor.vue +41 -41
- package/dist/input/input.vue +192 -192
- package/dist/input/props.ts +6 -6
- package/dist/input/type.ts +3 -3
- package/dist/link/link.vue +73 -71
- package/dist/loading/loading.vue +59 -59
- package/dist/locale/ar_KW.ts +157 -0
- package/dist/locale/en_US.ts +146 -0
- package/dist/locale/it_IT.ts +145 -0
- package/dist/locale/ja_JP.ts +132 -0
- package/dist/locale/ko_KR.ts +132 -0
- package/dist/locale/ru_RU.ts +157 -0
- package/dist/locale/zh_CN.ts +133 -0
- package/dist/locale/zh_TW.ts +132 -0
- package/dist/message/message.vue +181 -173
- package/dist/message/props.ts +2 -2
- package/dist/message/type.ts +1 -1
- package/dist/message-item/message-item.vue +192 -184
- package/dist/mixins/using-config.js +39 -0
- package/dist/navbar/navbar.vue +201 -199
- package/dist/notice-bar/notice-bar.vue +175 -171
- package/dist/notice-bar/props.ts +2 -2
- package/dist/notice-bar/type.ts +1 -1
- package/dist/npm/dayjs/esm/locale/ar.js +81 -0
- package/dist/npm/dayjs/esm/locale/it.js +39 -0
- package/dist/overlay/overlay.vue +50 -48
- package/dist/picker/picker.vue +168 -161
- package/dist/picker-item/picker-item.vue +269 -269
- package/dist/popover/README.md +1 -1
- package/dist/popover/popover.vue +262 -261
- package/dist/popover/props.ts +4 -4
- package/dist/popover/type.ts +2 -2
- package/dist/popup/popup.vue +46 -45
- package/dist/progress/README.md +1 -1
- package/dist/progress/progress.vue +76 -76
- package/dist/pull-down-refresh/props.ts +2 -2
- package/dist/pull-down-refresh/pull-down-refresh.vue +240 -234
- package/dist/pull-down-refresh/type.ts +1 -1
- package/dist/qrcode/README.md +1 -1
- package/dist/qrcode/components/qrcode-canvas/qrcode-canvas.vue +340 -338
- package/dist/qrcode/components/qrcode-status/qrcode-status.vue +6 -6
- package/dist/qrcode/qrcode.vue +93 -87
- package/dist/radio/props.ts +6 -6
- package/dist/radio/radio.vue +118 -120
- package/dist/radio/type.ts +3 -3
- package/dist/radio-group/props.ts +4 -4
- package/dist/radio-group/radio-group.vue +136 -134
- package/dist/radio-group/type.ts +4 -4
- package/dist/rate/computed.js +2 -2
- package/dist/rate/props.ts +4 -4
- package/dist/rate/rate.vue +155 -154
- package/dist/rate/type.ts +2 -2
- package/dist/result/result.vue +41 -39
- package/dist/row/row.vue +38 -36
- package/dist/scroll-view/scroll-view.vue +24 -22
- package/dist/search/props.ts +2 -2
- package/dist/search/search.vue +127 -125
- package/dist/search/type.ts +1 -1
- package/dist/side-bar/side-bar.vue +57 -55
- package/dist/side-bar-item/side-bar-item.vue +86 -86
- package/dist/skeleton/skeleton.vue +126 -124
- package/dist/slider/README.md +1 -1
- package/dist/slider/props.ts +2 -2
- package/dist/slider/slider.vue +457 -457
- package/dist/slider/type.ts +1 -1
- package/dist/step-item/step-item.vue +77 -75
- package/dist/stepper/props.ts +2 -2
- package/dist/stepper/stepper.vue +168 -149
- package/dist/stepper/type.ts +1 -1
- package/dist/steps/props.ts +2 -2
- package/dist/steps/steps.vue +83 -81
- package/dist/steps/type.ts +1 -1
- package/dist/sticky/sticky.vue +104 -102
- package/dist/swipe-cell/swipe-cell.vue +91 -89
- package/dist/swiper/README.md +1 -1
- package/dist/swiper/swiper.vue +91 -89
- package/dist/swiper-nav/swiper-nav.vue +38 -36
- package/dist/switch/props.ts +2 -2
- package/dist/switch/switch.vue +62 -62
- package/dist/switch/type.ts +1 -1
- package/dist/tab-bar/tab-bar.vue +88 -86
- package/dist/tab-bar-item/tab-bar-item.vue +85 -82
- package/dist/tab-panel/tab-panel.vue +66 -64
- package/dist/tabs/tabs.vue +294 -287
- package/dist/tag/tag.vue +79 -77
- package/dist/textarea/props.ts +6 -6
- package/dist/textarea/textarea.vue +127 -126
- package/dist/textarea/type.ts +3 -3
- package/dist/toast/toast.vue +107 -106
- package/dist/transition/transition.vue +30 -28
- package/dist/tree-select/tree-select.vue +151 -151
- package/dist/types/config-provider.d.ts +7 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/popover.d.ts +7 -0
- package/dist/upload/README.en-US.md +13 -14
- package/dist/upload/README.md +11 -12
- package/dist/upload/props.ts +2 -4
- package/dist/upload/type.ts +12 -11
- package/dist/upload/upload.css +1 -1
- package/dist/upload/upload.vue +672 -512
- package/dist/watermark/watermark.vue +151 -149
- package/global.d.ts +2 -0
- package/package.json +16 -2
- package/dist/form/form-item-props.ts +0 -56
|
@@ -22,17 +22,14 @@ name | type | default | description | required
|
|
|
22
22
|
-- | -- | -- | -- | --
|
|
23
23
|
custom-style | Object | - | CSS(Cascading Style Sheets) | N
|
|
24
24
|
colon | Boolean | false | \- | N
|
|
25
|
-
content-align | String | left | options: left/right | N
|
|
26
25
|
data | Object | {} | Typescript: `FormData` | N
|
|
27
|
-
disabled | Boolean | undefined | \- | N
|
|
28
26
|
error-message | Object | - | Typescript: `FormErrorMessage` | N
|
|
29
27
|
label-align | String | right | options: left/right/top | N
|
|
30
28
|
label-width | String / Number | '81px' | \- | N
|
|
31
|
-
|
|
32
|
-
required-mark |
|
|
33
|
-
required-mark-position | String | - | Display position of required symbols。options: left/right | N
|
|
29
|
+
required-mark | Boolean | true | \- | N
|
|
30
|
+
required-mark-position | String | left | Display position of required symbols。options: left/right | N
|
|
34
31
|
reset-type | String | empty | options: empty/initial | N
|
|
35
|
-
rules | Object | - | Typescript: `FormRules<FormData>` `type FormRules<T extends Data = any> = { [field in keyof T]?: Array<FormRule> }`。[see more ts definition](https://github.com/
|
|
32
|
+
rules | Object | - | Typescript: `FormRules<FormData>` `type FormRules<T extends Data = any> = { [field in keyof T]?: Array<FormRule> }`。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/form/type.ts) | N
|
|
36
33
|
scroll-to-first-error | String | - | options: ''/smooth/auto | N
|
|
37
34
|
show-error-message | Boolean | true | \- | N
|
|
38
35
|
submit-with-warning-message | Boolean | false | \- | N
|
|
@@ -41,19 +38,19 @@ submit-with-warning-message | Boolean | false | \- | N
|
|
|
41
38
|
|
|
42
39
|
name | params | description
|
|
43
40
|
-- | -- | --
|
|
44
|
-
reset | `(context: { e?: FormResetEvent })` | [see more ts definition](https://github.com/
|
|
45
|
-
submit | `(context: SubmitContext<FormData>)` | [see more ts definition](https://github.com/
|
|
46
|
-
validate | `(result: ValidateResultContext<FormData>)` | [see more ts definition](https://github.com/
|
|
41
|
+
reset | `(context: { e?: FormResetEvent })` | [see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/common/common.ts)
|
|
42
|
+
submit | `(context: SubmitContext<FormData>)` | [see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/form/type.ts)。<br/>`interface SubmitContext<T extends Data = Data> { e?: FormSubmitEvent; validateResult: FormValidateResult<T>; firstError?: string; fields?: any }`<br/><br/>`type FormValidateResult<T> = boolean \| ValidateResultObj<T>`<br/><br/>`type ValidateResultObj<T> = { [key in keyof T]: boolean \| ValidateResultList }`<br/><br/>`type ValidateResultList = Array<AllValidateResult>`<br/><br/>`type AllValidateResult = CustomValidateObj \| ValidateResultType`<br/><br/>`interface ValidateResultType extends FormRule { result: boolean }`<br/><br/>`type ValidateResult<T> = { [key in keyof T]: boolean \| ErrorList }`<br/><br/>`type ErrorList = Array<FormRule>`<br/>
|
|
43
|
+
validate | `(result: ValidateResultContext<FormData>)` | [see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/form/type.ts)。<br/>`type ValidateResultContext<T extends Data> = Omit<SubmitContext<T>, 'e'>`<br/>
|
|
47
44
|
|
|
48
45
|
### FormInstanceFunctions 组件实例方法
|
|
49
46
|
|
|
50
47
|
name | params | return | description
|
|
51
48
|
-- | -- | -- | --
|
|
52
49
|
clear-validate | `(fields?: Array<keyof FormData>)` | \- | required
|
|
53
|
-
reset | `(params?: FormResetParams<FormData>)` | \- | required。[see more ts definition](https://github.com/
|
|
54
|
-
set-validate-message | `(message: FormValidateMessage<FormData>)` | \- | required。[see more ts definition](https://github.com/
|
|
50
|
+
reset | `(params?: FormResetParams<FormData>)` | \- | required。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/form/type.ts)。<br/>`interface FormResetParams<FormData> { type?: 'initial' \| 'empty'; fields?: Array<keyof FormData> }`<br/>
|
|
51
|
+
set-validate-message | `(message: FormValidateMessage<FormData>)` | \- | required。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/form/type.ts)。<br/>`type FormValidateMessage<FormData> = { [field in keyof FormData]: FormItemValidateMessage[] }`<br/><br/>`interface FormItemValidateMessage { type: 'warning' \| 'error'; message: string }`<br/>
|
|
55
52
|
submit | `(params?: { showErrorMessage?: boolean })` | \- | required
|
|
56
|
-
validate | `(params?: FormValidateParams)` | `Promise<FormValidateResult<FormData
|
|
53
|
+
validate | `(params?: FormValidateParams)` | `Promise<FormValidateResult<FormData>> ` | required。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/form/type.ts)。<br/>`interface FormValidateParams { fields?: Array<string>; showErrorMessage?: boolean; trigger?: ValidateTriggerType }`<br/><br/>`type ValidateTriggerType = 'blur' \| 'change' \| 'submit' \| 'all'`<br/><br/>`type FormValidateResult<T> = boolean \| ValidateResultObj<T>`<br/><br/>`type ValidateResultObj<T> = { [key in keyof T]: boolean \| ValidateResultList }`<br/><br/>`type ValidateResultList = Array<AllValidateResult>`<br/><br/>`type AllValidateResult = CustomValidateObj \| ValidateResultType`<br/><br/>`interface ValidateResultType extends FormRule { result: boolean }`<br/>
|
|
57
54
|
|
|
58
55
|
|
|
59
56
|
### FormItem Props
|
|
@@ -62,15 +59,13 @@ name | type | default | description | required
|
|
|
62
59
|
-- | -- | -- | -- | --
|
|
63
60
|
custom-style | Object | - | CSS(Cascading Style Sheets) | N
|
|
64
61
|
arrow | Boolean | false | \- | N
|
|
65
|
-
content-align | String | - | options: left/right | N
|
|
66
|
-
for | String | - | \- | N
|
|
67
62
|
help | String | - | \- | N
|
|
68
63
|
label | String | '' | \- | N
|
|
69
64
|
label-align | String | - | options: left/right/top | N
|
|
70
65
|
label-width | String / Number | - | \- | N
|
|
71
66
|
name | String | - | \- | N
|
|
72
67
|
required-mark | Boolean | undefined | \- | N
|
|
73
|
-
rules | Array | - | Typescript: `Array<FormRule
|
|
68
|
+
rules | Array | - | Typescript: `Array<FormRule> `,[Form API Documents](./form?tab=api)。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/form-item/type.ts) | N
|
|
74
69
|
show-error-message | Boolean | undefined | \- | N
|
|
75
70
|
|
|
76
71
|
### FormItem Slots
|
|
@@ -85,8 +80,8 @@ label | \-
|
|
|
85
80
|
name | type | default | description | required
|
|
86
81
|
-- | -- | -- | -- | --
|
|
87
82
|
boolean | Boolean | - | \- | N
|
|
88
|
-
date | Boolean / Object | - | Typescript: `boolean \| IsDateOptions` `interface IsDateOptions { format: string; strictMode: boolean; delimiters: string[] }`。[see more ts definition](https://github.com/
|
|
89
|
-
email | Boolean / Object | - | Typescript: `boolean \| IsEmailOptions` `import
|
|
83
|
+
date | Boolean / Object | - | Typescript: `boolean \| IsDateOptions` `interface IsDateOptions { format: string; strictMode: boolean; delimiters: string[] }`。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/form/type.ts) | N
|
|
84
|
+
email | Boolean / Object | - | Typescript: `boolean \| IsEmailOptions` `import { IsEmailOptions } from 'validator/es/lib/isEmail'`。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/form/type.ts) | N
|
|
90
85
|
enum | Array | - | Typescript: `Array<string>` | N
|
|
91
86
|
idcard | Boolean | - | \- | N
|
|
92
87
|
len | Number / Boolean | - | \- | N
|
|
@@ -99,8 +94,8 @@ required | Boolean | - | \- | N
|
|
|
99
94
|
telnumber | Boolean | - | \- | N
|
|
100
95
|
trigger | String | change | Typescript: `ValidateTriggerType` | N
|
|
101
96
|
type | String | error | options: error/warning | N
|
|
102
|
-
url | Boolean / Object | - | Typescript: `boolean \| IsURLOptions` `import
|
|
103
|
-
validator | Function | - | Typescript: `CustomValidator` `type CustomValidator = (val: ValueType) => CustomValidateResolveType \| Promise<CustomValidateResolveType>` `type CustomValidateResolveType = boolean \| CustomValidateObj` `interface CustomValidateObj { result: boolean; message: string; type?: 'error' \| 'warning' \| 'success' }` `type ValueType = any`。[see more ts definition](https://github.com/
|
|
97
|
+
url | Boolean / Object | - | Typescript: `boolean \| IsURLOptions` `import { IsURLOptions } from 'validator/es/lib/isURL'`。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/form/type.ts) | N
|
|
98
|
+
validator | Function | - | Typescript: `CustomValidator` `type CustomValidator = (val: ValueType, context?: { formData: Data , name: string }) => CustomValidateResolveType \| Promise<CustomValidateResolveType>` `type CustomValidateResolveType = boolean \| CustomValidateObj` `interface CustomValidateObj { result: boolean; message: string; type?: 'error' \| 'warning' \| 'success' }` `type ValueType = any`。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/form/type.ts) | N
|
|
104
99
|
whitespace | Boolean | - | \- | N
|
|
105
100
|
|
|
106
101
|
### FormErrorMessage
|
|
@@ -128,10 +123,8 @@ The component provides the following CSS variables, which can be used to customi
|
|
|
128
123
|
Name | Default Value | Description
|
|
129
124
|
-- | -- | --
|
|
130
125
|
--td-form-bg-color | @bg-color-container | -
|
|
131
|
-
--td-form-border-
|
|
132
|
-
--td-form-
|
|
133
|
-
--td-form-
|
|
126
|
+
--td-form-item-border-color | @component-stroke | -
|
|
127
|
+
--td-form-item-border-left-space | @form-item-vertical-padding | -
|
|
128
|
+
--td-form-item-border-right-space | 0 | -
|
|
134
129
|
--td-form-item-horizontal-padding | 32rpx | -
|
|
135
|
-
--td-form-item-justify-content | space-between | -
|
|
136
|
-
--td-form-item-label-width | 160rpx | -
|
|
137
130
|
--td-form-item-vertical-padding | 32rpx | -
|
package/dist/form/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Form 表单
|
|
3
3
|
description: 用以收集、校验和提交数据,一般由输入框、单选框、复选框、选择器等控件组成。
|
|
4
|
-
spline:
|
|
4
|
+
spline: form
|
|
5
5
|
isComponent: true
|
|
6
6
|
toc: false
|
|
7
7
|
---
|
|
@@ -31,17 +31,14 @@ import TFormItem from '@tdesign/uniapp/form-item/form-item.vue';
|
|
|
31
31
|
-- | -- | -- | -- | --
|
|
32
32
|
custom-style | Object | - | 自定义样式 | N
|
|
33
33
|
colon | Boolean | false | 是否在表单标签字段右侧显示冒号 | N
|
|
34
|
-
content-align | String | left | 表单内容对齐方式:左对齐、右对齐。可选项:left/right | N
|
|
35
34
|
data | Object | {} | 表单数据。TS 类型:`FormData` | N
|
|
36
|
-
disabled | Boolean | undefined | 是否禁用整个表单 | N
|
|
37
35
|
error-message | Object | - | 表单错误信息配置,示例:`{ idcard: '请输入正确的身份证号码', max: '字符长度不能超过 ${max}' }`。TS 类型:`FormErrorMessage` | N
|
|
38
36
|
label-align | String | right | 表单字段标签对齐方式:左对齐、右对齐、顶部对齐。可选项:left/right/top | N
|
|
39
37
|
label-width | String / Number | '81px' | 可以整体设置label标签宽度,默认为81px | N
|
|
40
|
-
|
|
41
|
-
required-mark |
|
|
42
|
-
required-mark-position | String | - | 表单必填符号(*)显示位置。可选项:left/right | N
|
|
38
|
+
required-mark | Boolean | true | 是否显示必填符号(*),默认显示 | N
|
|
39
|
+
required-mark-position | String | left | 表单必填符号(*)显示位置。可选项:left/right | N
|
|
43
40
|
reset-type | String | empty | 重置表单的方式,值为 empty 表示重置表单为空,值为 initial 表示重置表单数据为初始值。可选项:empty/initial | N
|
|
44
|
-
rules | Object | - | 表单字段校验规则。TS 类型:`FormRules<FormData>` `type FormRules<T extends Data = any> = { [field in keyof T]?: Array<FormRule> }`。[详细类型定义](https://github.com/
|
|
41
|
+
rules | Object | - | 表单字段校验规则。TS 类型:`FormRules<FormData>` `type FormRules<T extends Data = any> = { [field in keyof T]?: Array<FormRule> }`。[详细类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/form/type.ts) | N
|
|
45
42
|
scroll-to-first-error | String | - | 表单校验不通过时,是否自动滚动到第一个校验不通过的字段,平滑滚动或是瞬间直达。值为空则表示不滚动。可选项:''/smooth/auto | N
|
|
46
43
|
show-error-message | Boolean | true | 校验不通过时,是否显示错误提示信息,统一控制全部表单项。如果希望控制单个表单项,请给 FormItem 设置该属性 | N
|
|
47
44
|
submit-with-warning-message | Boolean | false | 【讨论中】当校验结果只有告警信息时,是否触发 `submit` 提交事件 | N
|
|
@@ -50,19 +47,19 @@ submit-with-warning-message | Boolean | false | 【讨论中】当校验结果
|
|
|
50
47
|
|
|
51
48
|
名称 | 参数 | 描述
|
|
52
49
|
-- | -- | --
|
|
53
|
-
reset | `(context: { e?: FormResetEvent })` | 表单重置时触发。[通用类型定义](https://github.com/
|
|
54
|
-
submit | `(context: SubmitContext<FormData>)` | 表单提交时触发。其中 `context.validateResult` 表示校验结果,`context.firstError` 表示校验不通过的第一个规则提醒。`context.validateResult` 值为 `true` 表示校验通过;如果校验不通过,`context.validateResult` 值为校验结果列表。<br />【注意】⚠️ 默认情况,输入框按下 Enter 键会自动触发提交事件,如果希望禁用这个默认行为,可以给输入框添加 enter 事件,并在事件中设置 `e.preventDefault()`。[详细类型定义](https://github.com/
|
|
55
|
-
validate | `(result: ValidateResultContext<FormData>)` | 校验结束后触发,result 值为 true 表示校验通过;如果校验不通过,result 值为校验结果列表。[详细类型定义](https://github.com/
|
|
50
|
+
reset | `(context: { e?: FormResetEvent })` | 表单重置时触发。[通用类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/common/common.ts)
|
|
51
|
+
submit | `(context: SubmitContext<FormData>)` | 表单提交时触发。其中 `context.validateResult` 表示校验结果,`context.firstError` 表示校验不通过的第一个规则提醒。`context.validateResult` 值为 `true` 表示校验通过;如果校验不通过,`context.validateResult` 值为校验结果列表。<br />【注意】⚠️ 默认情况,输入框按下 Enter 键会自动触发提交事件,如果希望禁用这个默认行为,可以给输入框添加 enter 事件,并在事件中设置 `e.preventDefault()`。[详细类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/form/type.ts)。<br/>`interface SubmitContext<T extends Data = Data> { e?: FormSubmitEvent; validateResult: FormValidateResult<T>; firstError?: string; fields?: any }`<br/><br/>`type FormValidateResult<T> = boolean \| ValidateResultObj<T>`<br/><br/>`type ValidateResultObj<T> = { [key in keyof T]: boolean \| ValidateResultList }`<br/><br/>`type ValidateResultList = Array<AllValidateResult>`<br/><br/>`type AllValidateResult = CustomValidateObj \| ValidateResultType`<br/><br/>`interface ValidateResultType extends FormRule { result: boolean }`<br/><br/>`type ValidateResult<T> = { [key in keyof T]: boolean \| ErrorList }`<br/><br/>`type ErrorList = Array<FormRule>`<br/>
|
|
52
|
+
validate | `(result: ValidateResultContext<FormData>)` | 校验结束后触发,result 值为 true 表示校验通过;如果校验不通过,result 值为校验结果列表。[详细类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/form/type.ts)。<br/>`type ValidateResultContext<T extends Data> = Omit<SubmitContext<T>, 'e'>`<br/>
|
|
56
53
|
|
|
57
54
|
### FormInstanceFunctions 组件实例方法
|
|
58
55
|
|
|
59
56
|
名称 | 参数 | 返回值 | 描述
|
|
60
57
|
-- | -- | -- | --
|
|
61
58
|
clear-validate | `(fields?: Array<keyof FormData>)` | \- | 必需。清空校验结果。可使用 fields 指定清除部分字段的校验结果,fields 值为空则表示清除所有字段校验结果。清除邮箱校验结果示例:`clearValidate(['email'])`
|
|
62
|
-
reset | `(params?: FormResetParams<FormData>)` | \- | 必需。重置表单,表单里面没有重置按钮`<button type=\"reset\" />`时可以使用该方法,默认重置全部字段为空,该方法会触发 `reset` 事件。<br />如果表单属性 `resetType='empty'` 或者 `reset.type='empty'` 会重置为空;<br />如果表单属性 `resetType='initial'` 或者 `reset.type='initial'` 会重置为表单初始值。<br />`reset.fields` 用于设置具体重置哪些字段,示例:`reset({ type: 'initial', fields: ['name', 'age'] })`。[详细类型定义](https://github.com/
|
|
63
|
-
set-validate-message | `(message: FormValidateMessage<FormData>)` | \- | 必需。设置自定义校验结果,如远程校验信息直接呈现。注意需要在组件挂载结束后使用该方法。`FormData` 指表单数据泛型。[详细类型定义](https://github.com/
|
|
59
|
+
reset | `(params?: FormResetParams<FormData>)` | \- | 必需。重置表单,表单里面没有重置按钮`<button type=\"reset\" />`时可以使用该方法,默认重置全部字段为空,该方法会触发 `reset` 事件。<br />如果表单属性 `resetType='empty'` 或者 `reset.type='empty'` 会重置为空;<br />如果表单属性 `resetType='initial'` 或者 `reset.type='initial'` 会重置为表单初始值。<br />`reset.fields` 用于设置具体重置哪些字段,示例:`reset({ type: 'initial', fields: ['name', 'age'] })`。[详细类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/form/type.ts)。<br/>`interface FormResetParams<FormData> { type?: 'initial' \| 'empty'; fields?: Array<keyof FormData> }`<br/>
|
|
60
|
+
set-validate-message | `(message: FormValidateMessage<FormData>)` | \- | 必需。设置自定义校验结果,如远程校验信息直接呈现。注意需要在组件挂载结束后使用该方法。`FormData` 指表单数据泛型。[详细类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/form/type.ts)。<br/>`type FormValidateMessage<FormData> = { [field in keyof FormData]: FormItemValidateMessage[] }`<br/><br/>`interface FormItemValidateMessage { type: 'warning' \| 'error'; message: string }`<br/>
|
|
64
61
|
submit | `(params?: { showErrorMessage?: boolean })` | \- | 必需。提交表单,表单里面没有提交按钮`<button type=\"submit\" />`时可以使用该方法。`showErrorMessage` 表示是否在提交校验不通过时显示校验不通过的原因,默认显示。该方法会触发 `submit` 事件
|
|
65
|
-
validate | `(params?: FormValidateParams)` | `Promise<FormValidateResult<FormData
|
|
62
|
+
validate | `(params?: FormValidateParams)` | `Promise<FormValidateResult<FormData>> ` | 必需。校验函数,包含错误文本提示等功能。泛型 `FormData` 表示表单数据 TS 类型。<br/>【关于参数】`params.fields` 表示校验字段,如果设置了 `fields`,本次校验将仅对这些字段进行校验。`params.trigger` 表示本次触发校验的范围,'params.trigger = blur' 表示只触发校验规则设定为 trigger='blur' 的字段,'params.trigger = change' 表示只触发校验规则设定为 trigger='change' 的字段,默认触发全范围校验。`params.showErrorMessage` 表示校验结束后是否显示错误文本提示,默认显示。<br />【关于返回值】返回值为 true 表示校验通过;如果校验不通过,返回值为校验结果列表。[详细类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/form/type.ts)。<br/>`interface FormValidateParams { fields?: Array<string>; showErrorMessage?: boolean; trigger?: ValidateTriggerType }`<br/><br/>`type ValidateTriggerType = 'blur' \| 'change' \| 'submit' \| 'all'`<br/><br/>`type FormValidateResult<T> = boolean \| ValidateResultObj<T>`<br/><br/>`type ValidateResultObj<T> = { [key in keyof T]: boolean \| ValidateResultList }`<br/><br/>`type ValidateResultList = Array<AllValidateResult>`<br/><br/>`type AllValidateResult = CustomValidateObj \| ValidateResultType`<br/><br/>`interface ValidateResultType extends FormRule { result: boolean }`<br/>
|
|
66
63
|
|
|
67
64
|
|
|
68
65
|
### FormItem Props
|
|
@@ -71,15 +68,13 @@ validate | `(params?: FormValidateParams)` | `Promise<FormValidateResult<FormDat
|
|
|
71
68
|
-- | -- | -- | -- | --
|
|
72
69
|
custom-style | Object | - | 自定义样式 | N
|
|
73
70
|
arrow | Boolean | false | 是否显示右侧箭头 | N
|
|
74
|
-
content-align | String | - | 表单内容对齐方式,优先级高于 Form.contentAlign。可选项:left/right | N
|
|
75
|
-
for | String | - | label 原生属性 | N
|
|
76
71
|
help | String | - | 表单项说明内容 | N
|
|
77
72
|
label | String | '' | 字段标签名称 | N
|
|
78
73
|
label-align | String | - | 表单字段标签对齐方式:左对齐、右对齐、顶部对齐。默认使用 Form 的对齐方式,优先级高于 Form.labelAlign。可选项:left/right/top | N
|
|
79
74
|
label-width | String / Number | - | 可以整体设置标签宽度,优先级高于 Form.labelWidth | N
|
|
80
75
|
name | String | - | 表单字段名称 | N
|
|
81
76
|
required-mark | Boolean | undefined | 是否显示必填符号(*),优先级高于 Form.requiredMark | N
|
|
82
|
-
rules | Array | - | 表单字段校验规则。TS 类型:`Array<FormRule
|
|
77
|
+
rules | Array | - | 表单字段校验规则。TS 类型:`Array<FormRule> `,[Form API Documents](./form?tab=api)。[详细类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/form-item/type.ts) | N
|
|
83
78
|
show-error-message | Boolean | undefined | 校验不通过时,是否显示错误提示信息,优先级高于 `Form.showErrorMessage` | N
|
|
84
79
|
|
|
85
80
|
### FormItem Slots
|
|
@@ -94,8 +89,8 @@ label | 自定义 `label` 显示内容
|
|
|
94
89
|
名称 | 类型 | 默认值 | 描述 | 必传
|
|
95
90
|
-- | -- | -- | -- | --
|
|
96
91
|
boolean | Boolean | - | 内置校验方法,校验值类型是否为布尔类型,示例:`{ boolean: true, message: '数据类型必须是布尔类型' }` | N
|
|
97
|
-
date | Boolean / Object | - | 内置校验方法,校验值是否为日期格式,[参数文档](https://github.com/validatorjs/validator.js),示例:`{ date: { delimiters: '-' }, message: '日期分隔线必须是短横线(-)' }`。TS 类型:`boolean \| IsDateOptions` `interface IsDateOptions { format: string; strictMode: boolean; delimiters: string[] }`。[详细类型定义](https://github.com/
|
|
98
|
-
email | Boolean / Object | - | 内置校验方法,校验值是否为邮件格式,[参数文档](https://github.com/validatorjs/validator.js),示例:`{ email: { ignore_max_length: true }, message: '请输入正确的邮箱地址' }`。TS 类型:`boolean \| IsEmailOptions` `import
|
|
92
|
+
date | Boolean / Object | - | 内置校验方法,校验值是否为日期格式,[参数文档](https://github.com/validatorjs/validator.js),示例:`{ date: { delimiters: '-' }, message: '日期分隔线必须是短横线(-)' }`。TS 类型:`boolean \| IsDateOptions` `interface IsDateOptions { format: string; strictMode: boolean; delimiters: string[] }`。[详细类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/form/type.ts) | N
|
|
93
|
+
email | Boolean / Object | - | 内置校验方法,校验值是否为邮件格式,[参数文档](https://github.com/validatorjs/validator.js),示例:`{ email: { ignore_max_length: true }, message: '请输入正确的邮箱地址' }`。TS 类型:`boolean \| IsEmailOptions` `import { IsEmailOptions } from 'validator/es/lib/isEmail'`。[详细类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/form/type.ts) | N
|
|
99
94
|
enum | Array | - | 内置校验方法,校验值是否属于枚举值中的值。示例:`{ enum: ['primary', 'info', 'warning'], message: '值只能是 primary/info/warning 中的一种' }`。TS 类型:`Array<string>` | N
|
|
100
95
|
idcard | Boolean | - | 内置校验方法,校验值是否为身份证号码,组件校验正则为 `/^(\\d{18,18}\|\\d{15,15}\|\\d{17,17}x)$/i`,示例:`{ idcard: true, message: '请输入正确的身份证号码' }` | N
|
|
101
96
|
len | Number / Boolean | - | 内置校验方法,校验值固定长度,如:len: 10 表示值的字符长度只能等于 10 ,中文表示 2 个字符,英文为 1 个字符。示例:`{ len: 10, message: '内容长度不对' }`。<br />如果希望字母和中文都是同样的长度,示例:`{ validator: (val) => val.length === 10, message: '内容文本长度只能是 10 个字' }` | N
|
|
@@ -108,8 +103,8 @@ required | Boolean | - | 内置校验方法,校验值是否已经填写。该
|
|
|
108
103
|
telnumber | Boolean | - | 内置校验方法,校验值是否为手机号码,校验正则为 `/^1[3-9]\d{9}$/`,示例:`{ telnumber: true, message: '请输入正确的手机号码' }` | N
|
|
109
104
|
trigger | String | change | 校验触发方式。TS 类型:`ValidateTriggerType` | N
|
|
110
105
|
type | String | error | 校验未通过时呈现的错误信息类型,有 告警信息提示 和 错误信息提示 等两种。可选项:error/warning | N
|
|
111
|
-
url | Boolean / Object | - | 内置校验方法,校验值是否为网络链接地址,[参数文档](https://github.com/validatorjs/validator.js),示例:`{ url: { protocols: ['http','https','ftp'] }, message: '请输入正确的 Url 地址' }`。TS 类型:`boolean \| IsURLOptions` `import
|
|
112
|
-
validator | Function | - |
|
|
106
|
+
url | Boolean / Object | - | 内置校验方法,校验值是否为网络链接地址,[参数文档](https://github.com/validatorjs/validator.js),示例:`{ url: { protocols: ['http','https','ftp'] }, message: '请输入正确的 Url 地址' }`。TS 类型:`boolean \| IsURLOptions` `import { IsURLOptions } from 'validator/es/lib/isURL'`。[详细类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/form/type.ts) | N
|
|
107
|
+
validator | Function | - | 自定义校验规则,context 中 formData 为当前完整表单值,name为该字段的标识,示例:`{ validator: (val) => val.length > 0, message: '请输入内容'}`。TS 类型:`CustomValidator` `type CustomValidator = (val: ValueType, context?: { formData: Data , name: string }) => CustomValidateResolveType \| Promise<CustomValidateResolveType>` `type CustomValidateResolveType = boolean \| CustomValidateObj` `interface CustomValidateObj { result: boolean; message: string; type?: 'error' \| 'warning' \| 'success' }` `type ValueType = any`。[详细类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/form/type.ts) | N
|
|
113
108
|
whitespace | Boolean | - | 内置校验方法,校验值是否为空格。示例:`{ whitespace: true, message: '值不能为空' }` | N
|
|
114
109
|
|
|
115
110
|
### FormErrorMessage
|
|
@@ -137,10 +132,8 @@ whitespace | String | - | 值为空格校验不通过时表单项显示文案,
|
|
|
137
132
|
名称 | 默认值 | 描述
|
|
138
133
|
-- | -- | --
|
|
139
134
|
--td-form-bg-color | @bg-color-container | -
|
|
140
|
-
--td-form-border-
|
|
141
|
-
--td-form-
|
|
142
|
-
--td-form-
|
|
135
|
+
--td-form-item-border-color | @component-stroke | -
|
|
136
|
+
--td-form-item-border-left-space | @form-item-vertical-padding | -
|
|
137
|
+
--td-form-item-border-right-space | 0 | -
|
|
143
138
|
--td-form-item-horizontal-padding | 32rpx | -
|
|
144
|
-
--td-form-item-justify-content | space-between | -
|
|
145
|
-
--td-form-item-label-width | 160rpx | -
|
|
146
139
|
--td-form-item-vertical-padding | 32rpx | -
|
package/dist/form/form.css
CHANGED
|
@@ -1,169 +1,4 @@
|
|
|
1
1
|
.t-form {
|
|
2
|
-
|
|
3
|
-
width: 100%;
|
|
2
|
+
display: block;
|
|
4
3
|
background-color: var(--td-form-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
|
|
5
|
-
padding: var(--td-form-padding, 0);
|
|
6
|
-
border-radius: var(--td-form-border-radius, 0);
|
|
7
|
-
box-sizing: border-box;
|
|
8
|
-
min-height: 100%;
|
|
9
|
-
}
|
|
10
|
-
.t-form--label-left .t-form__item .t-form__label {
|
|
11
|
-
text-align: left;
|
|
12
|
-
justify-content: flex-start;
|
|
13
|
-
}
|
|
14
|
-
.t-form--label-right .t-form__item .t-form__label {
|
|
15
|
-
text-align: right;
|
|
16
|
-
justify-content: flex-end;
|
|
17
|
-
}
|
|
18
|
-
.t-form--label-top .t-form__item {
|
|
19
|
-
flex-direction: column;
|
|
20
|
-
align-items: flex-start;
|
|
21
|
-
}
|
|
22
|
-
.t-form--label-top .t-form__item .t-form__label {
|
|
23
|
-
width: 100%;
|
|
24
|
-
margin-bottom: var(--td-spacer, 16rpx);
|
|
25
|
-
text-align: left;
|
|
26
|
-
justify-content: flex-start;
|
|
27
|
-
}
|
|
28
|
-
.t-form--label-top .t-form__item .t-form__controls {
|
|
29
|
-
width: 100%;
|
|
30
|
-
margin-top: 0;
|
|
31
|
-
}
|
|
32
|
-
.t-form--disabled {
|
|
33
|
-
opacity: 0.6;
|
|
34
|
-
pointer-events: none;
|
|
35
|
-
cursor: not-allowed;
|
|
36
|
-
}
|
|
37
|
-
.t-form--disabled .t-form__item .t-form__label,
|
|
38
|
-
.t-form--disabled .t-form__item .t-form__controls,
|
|
39
|
-
.t-form--disabled .t-form__item .t-form__help,
|
|
40
|
-
.t-form--disabled .t-form__item .t-form__extra {
|
|
41
|
-
color: var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26)));
|
|
42
|
-
}
|
|
43
|
-
.t-form--readonly {
|
|
44
|
-
background-color: var(--td-form-readonly-bg-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
|
|
45
|
-
}
|
|
46
|
-
.t-form--readonly .t-form__item .t-form__label,
|
|
47
|
-
.t-form--readonly .t-form__item .t-form__controls,
|
|
48
|
-
.t-form--readonly .t-form__item .t-form__help,
|
|
49
|
-
.t-form--readonly .t-form__item .t-form__extra {
|
|
50
|
-
color: var(--td-text-color-secondary, var(--td-font-gray-2, rgba(0, 0, 0, 0.6)));
|
|
51
|
-
}
|
|
52
|
-
.t-form__item {
|
|
53
|
-
position: relative;
|
|
54
|
-
display: flex;
|
|
55
|
-
align-items: flex-start;
|
|
56
|
-
width: 100%;
|
|
57
|
-
margin-bottom: var(--td-spacer-2, 32rpx);
|
|
58
|
-
}
|
|
59
|
-
.t-form__item:last-child {
|
|
60
|
-
margin-bottom: 0;
|
|
61
|
-
}
|
|
62
|
-
.t-form__label {
|
|
63
|
-
position: relative;
|
|
64
|
-
display: flex;
|
|
65
|
-
align-items: center;
|
|
66
|
-
min-width: 160rpx;
|
|
67
|
-
max-width: 300rpx;
|
|
68
|
-
margin-right: var(--td-spacer-2, 32rpx);
|
|
69
|
-
font-size: var(--td-font-size-m, 32rpx);
|
|
70
|
-
color: var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)));
|
|
71
|
-
line-height: 1.5;
|
|
72
|
-
word-break: break-all;
|
|
73
|
-
box-sizing: border-box;
|
|
74
|
-
}
|
|
75
|
-
.t-form__label--required::before {
|
|
76
|
-
content: '*';
|
|
77
|
-
color: var(--td-error-color, var(--td-error-color-6, #d54941));
|
|
78
|
-
margin-right: 4rpx;
|
|
79
|
-
font-size: var(--td-font-size-m, 32rpx);
|
|
80
|
-
line-height: 1;
|
|
81
|
-
}
|
|
82
|
-
.t-form__label--colon::after {
|
|
83
|
-
content: ':';
|
|
84
|
-
margin-left: 4rpx;
|
|
85
|
-
color: var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)));
|
|
86
|
-
}
|
|
87
|
-
.t-form__label--required-mark-left::before {
|
|
88
|
-
content: '*';
|
|
89
|
-
color: var(--td-error-color, var(--td-error-color-6, #d54941));
|
|
90
|
-
margin-right: 4rpx;
|
|
91
|
-
font-size: var(--td-font-size-m, 32rpx);
|
|
92
|
-
line-height: 1;
|
|
93
|
-
}
|
|
94
|
-
.t-form__label--required-mark-right::after {
|
|
95
|
-
content: '*';
|
|
96
|
-
color: var(--td-error-color, var(--td-error-color-6, #d54941));
|
|
97
|
-
margin-left: 4rpx;
|
|
98
|
-
font-size: var(--td-font-size-m, 32rpx);
|
|
99
|
-
line-height: 1;
|
|
100
|
-
}
|
|
101
|
-
.t-form__controls {
|
|
102
|
-
flex: 1;
|
|
103
|
-
width: 100%;
|
|
104
|
-
min-width: 0;
|
|
105
|
-
display: flex;
|
|
106
|
-
flex-direction: column;
|
|
107
|
-
}
|
|
108
|
-
.t-form__help {
|
|
109
|
-
margin-top: var(--td-spacer, 16rpx);
|
|
110
|
-
font-size: var(--td-font-size-s, 24rpx);
|
|
111
|
-
color: var(--td-text-color-secondary, var(--td-font-gray-2, rgba(0, 0, 0, 0.6)));
|
|
112
|
-
line-height: 1.4;
|
|
113
|
-
}
|
|
114
|
-
.t-form__extra {
|
|
115
|
-
margin-left: var(--td-spacer-2, 32rpx);
|
|
116
|
-
font-size: var(--td-font-size-s, 24rpx);
|
|
117
|
-
color: var(--td-text-color-secondary, var(--td-font-gray-2, rgba(0, 0, 0, 0.6)));
|
|
118
|
-
line-height: 1.4;
|
|
119
|
-
}
|
|
120
|
-
.t-form--error .t-form__label {
|
|
121
|
-
color: var(--td-error-color, var(--td-error-color-6, #d54941));
|
|
122
|
-
}
|
|
123
|
-
.t-form--error .t-form__help {
|
|
124
|
-
color: var(--td-error-color, var(--td-error-color-6, #d54941));
|
|
125
|
-
}
|
|
126
|
-
.t-form--success .t-form__label {
|
|
127
|
-
color: var(--td-success-color, var(--td-success-color-5, #2ba471));
|
|
128
|
-
}
|
|
129
|
-
.t-form--success .t-form__help {
|
|
130
|
-
color: var(--td-success-color, var(--td-success-color-5, #2ba471));
|
|
131
|
-
}
|
|
132
|
-
.t-form--warning .t-form__label {
|
|
133
|
-
color: var(--td-warning-color, var(--td-warning-color-5, #e37318));
|
|
134
|
-
}
|
|
135
|
-
.t-form--warning .t-form__help {
|
|
136
|
-
color: var(--td-warning-color, var(--td-warning-color-5, #e37318));
|
|
137
|
-
}
|
|
138
|
-
@media (max-width: 750rpx) {
|
|
139
|
-
.t-form__label {
|
|
140
|
-
min-width: 120rpx;
|
|
141
|
-
max-width: 200rpx;
|
|
142
|
-
font-size: var(--td-font-size-base, 28rpx);
|
|
143
|
-
}
|
|
144
|
-
.t-form__item {
|
|
145
|
-
margin-bottom: var(--td-spacer, 16rpx);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
.t-form--compact .t-form__item {
|
|
149
|
-
margin-bottom: var(--td-spacer, 16rpx);
|
|
150
|
-
}
|
|
151
|
-
.t-form--compact .t-form__label {
|
|
152
|
-
min-width: 120rpx;
|
|
153
|
-
font-size: var(--td-font-size-base, 28rpx);
|
|
154
|
-
}
|
|
155
|
-
.t-form--compact .t-form__help {
|
|
156
|
-
margin-top: calc(var(--td-spacer, 16rpx) / 2);
|
|
157
|
-
font-size: var(--td-font-size-xs, var(--td-font-size, 20rpx));
|
|
158
|
-
}
|
|
159
|
-
.t-form--loose .t-form__item {
|
|
160
|
-
margin-bottom: var(--td-spacer-3, 48rpx);
|
|
161
|
-
}
|
|
162
|
-
.t-form--loose .t-form__label {
|
|
163
|
-
min-width: 200rpx;
|
|
164
|
-
font-size: var(--td-font-size-l, 36rpx);
|
|
165
|
-
}
|
|
166
|
-
.t-form--loose .t-form__help {
|
|
167
|
-
margin-top: var(--td-spacer-2, 32rpx);
|
|
168
|
-
font-size: var(--td-font-size-m, 32rpx);
|
|
169
4
|
}
|