@trionesdev/antd-taro-react 0.0.2-beta.16 → 0.0.2-beta.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/dist/ActionSheet/style.scss +52 -52
- package/dist/Button/button.d.ts +2 -2
- package/dist/Button/button.js +2 -3
- package/dist/Button/style.scss +246 -235
- package/dist/Calendar/style.scss +88 -88
- package/dist/Calendar/touchable-calendar-grid.js +9 -9
- package/dist/CalendarDatetimePicker/style.scss +62 -62
- package/dist/CalendarDatetimePickerCell/CalendarDatetimePickerCell.d.ts +2 -2
- package/dist/CalendarDatetimePickerCell/CalendarDatetimePickerCell.js +3 -3
- package/dist/CalendarPicker/style.scss +32 -32
- package/dist/CalendarPickerCell/CalendarPickerCell.d.ts +2 -2
- package/dist/CalendarPickerCell/CalendarPickerCell.js +3 -3
- package/dist/CalendarPickerCell/CalendarRangePickerCell.d.ts +2 -2
- package/dist/CalendarPickerCell/CalendarRangePickerCell.js +3 -3
- package/dist/CascaderPicker/style.scss +45 -45
- package/dist/CascaderPickerCell/CascaderPickerCell.d.ts +2 -2
- package/dist/CascaderPickerCell/CascaderPickerCell.js +3 -3
- package/dist/DatePicker/style.scss +41 -41
- package/dist/FetchPicker/FetchPicker.d.ts +113 -0
- package/dist/FetchPicker/FetchPicker.js +322 -0
- package/dist/FetchPicker/index.d.ts +4 -0
- package/dist/FetchPicker/index.js +3 -0
- package/dist/FetchPicker/styles.scss +118 -0
- package/dist/FloatButton/style.scss +126 -126
- package/dist/Form/FormItem/{form-item-input.d.ts → form-item-content.d.ts} +3 -1
- package/dist/Form/FormItem/{form-item-input.js → form-item-content.js} +2 -2
- package/dist/Form/FormItem/form-item-label.js +2 -8
- package/dist/Form/FormItem/form-item.d.ts +3 -2
- package/dist/Form/FormItem/form-item.js +23 -19
- package/dist/Form/index.d.ts +2 -2
- package/dist/Form/style.scss +100 -78
- package/dist/FormCell/index.d.ts +3 -0
- package/dist/FormCell/index.js +2 -0
- package/dist/ImagesPreview/style.scss +34 -34
- package/dist/ImagesWall/style.scss +70 -70
- package/dist/Input/index.scss +282 -267
- package/dist/Input/input-affix-wrapper.js +1 -1
- package/dist/Input/taro-input.js +16 -3
- package/dist/Input/types.d.ts +3 -3
- package/dist/Loading/index.d.ts +4 -0
- package/dist/Loading/index.js +3 -0
- package/dist/Overlay/style.scss +20 -20
- package/dist/Picker/Picker.d.ts +8 -0
- package/dist/Picker/Picker.js +6 -7
- package/dist/Picker/style.scss +41 -41
- package/dist/PickerView/style.scss +13 -13
- package/dist/PickerView/types.d.ts +2 -2
- package/dist/Popup/style.scss +126 -124
- package/dist/SideBar/side-bar.js +6 -6
- package/dist/SideBar/style.scss +85 -85
- package/dist/Toast/style.scss +63 -63
- package/dist/VerificationCodeInput/style.scss +20 -20
- package/dist/index.d.ts +8 -3
- package/dist/index.js +3 -1
- package/dist/style/variable.scss +34 -20
- package/package.json +20 -24
- package/readme.md +23 -23
- package/dist/SpinLoading/index.d.ts +0 -3
- package/dist/SpinLoading/index.js +0 -2
|
@@ -1,126 +1,126 @@
|
|
|
1
|
-
@use "../style/variable" as variable;
|
|
2
|
-
|
|
3
|
-
$floatButtonCls: "triones-antm-float-button";
|
|
4
|
-
$floatButtonGroupCls: "triones-antm-float-button-group";
|
|
5
|
-
|
|
6
|
-
$floatButtonSize: 48Px;
|
|
7
|
-
$floatButtonShadow: 0 6Px 16Px 0 rgba(0, 0, 0, 0.08),
|
|
8
|
-
0 3Px 6Px -4Px rgba(0, 0, 0, 0.12), 0 9Px 28Px 8Px rgba(0, 0, 0, 0.05);
|
|
9
|
-
|
|
10
|
-
.#{$floatButtonCls} {
|
|
11
|
-
position: fixed;
|
|
12
|
-
display: inline-flex;
|
|
13
|
-
flex-shrink: 0;
|
|
14
|
-
box-sizing: border-box;
|
|
15
|
-
|
|
16
|
-
&--embedded {
|
|
17
|
-
position: relative;
|
|
18
|
-
right: auto;
|
|
19
|
-
bottom: auto;
|
|
20
|
-
z-index: auto;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
&-body {
|
|
24
|
-
box-sizing: border-box;
|
|
25
|
-
margin: 0;
|
|
26
|
-
padding: 0;
|
|
27
|
-
display: inline-flex;
|
|
28
|
-
align-items: center;
|
|
29
|
-
justify-content: center;
|
|
30
|
-
gap: 8Px;
|
|
31
|
-
min-width: $floatButtonSize;
|
|
32
|
-
min-height: $floatButtonSize;
|
|
33
|
-
border: none;
|
|
34
|
-
border-radius: 50%;
|
|
35
|
-
cursor: pointer;
|
|
36
|
-
font-size: 20Px;
|
|
37
|
-
line-height: 1;
|
|
38
|
-
color: rgba(0, 0, 0, 0.88);
|
|
39
|
-
background: #fff;
|
|
40
|
-
box-shadow: $floatButtonShadow;
|
|
41
|
-
transition: color 0.2s, background 0.2s, box-shadow 0.2s;
|
|
42
|
-
-webkit-tap-highlight-color: transparent;
|
|
43
|
-
text-decoration: none;
|
|
44
|
-
|
|
45
|
-
&:active {
|
|
46
|
-
filter: brightness(0.95);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
&--shape-square &-body {
|
|
51
|
-
border-radius: variable.$trionesBorderRadius;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
&--has-content &-body {
|
|
55
|
-
min-height: $floatButtonSize;
|
|
56
|
-
display: inline-flex;
|
|
57
|
-
flex-direction: column;
|
|
58
|
-
align-items: center;
|
|
59
|
-
justify-content: center;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
&--type-primary &-body {
|
|
63
|
-
color: #fff;
|
|
64
|
-
background: variable.$trionesColorPrimary;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
&-icon {
|
|
68
|
-
display: inline-flex;
|
|
69
|
-
align-items: center;
|
|
70
|
-
justify-content: center;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
&-content {
|
|
74
|
-
font-size: variable.$trionesFontSizeSm;
|
|
75
|
-
font-weight: 500;
|
|
76
|
-
white-space: nowrap;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.#{$floatButtonGroupCls} {
|
|
81
|
-
position: fixed;
|
|
82
|
-
display: flex;
|
|
83
|
-
gap: 12Px;
|
|
84
|
-
align-items: flex-end;
|
|
85
|
-
box-sizing: border-box;
|
|
86
|
-
|
|
87
|
-
&--placement {
|
|
88
|
-
&-top {
|
|
89
|
-
flex-direction: column;
|
|
90
|
-
}
|
|
91
|
-
&-bottom {
|
|
92
|
-
flex-direction: column;
|
|
93
|
-
}
|
|
94
|
-
&-left {
|
|
95
|
-
flex-direction: row;
|
|
96
|
-
}
|
|
97
|
-
&-right {
|
|
98
|
-
flex-direction: row;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
&--menu {
|
|
103
|
-
align-items: center;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
&-list {
|
|
107
|
-
display: flex;
|
|
108
|
-
flex-direction: column;
|
|
109
|
-
gap: 12Px;
|
|
110
|
-
align-items: flex-end;
|
|
111
|
-
|
|
112
|
-
&--hidden {
|
|
113
|
-
display: none;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
&--placement-left &-list,
|
|
118
|
-
&--placement-right &-list {
|
|
119
|
-
flex-direction: column;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/** 小程序点击外部关闭:全屏遮罩;极淡背景避免部分机型不响应 tap */
|
|
123
|
-
&-weapp-outside-mask {
|
|
124
|
-
background: rgba(0, 0, 0, 0.001);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
1
|
+
@use "../style/variable" as variable;
|
|
2
|
+
|
|
3
|
+
$floatButtonCls: "triones-antm-float-button";
|
|
4
|
+
$floatButtonGroupCls: "triones-antm-float-button-group";
|
|
5
|
+
|
|
6
|
+
$floatButtonSize: 48Px;
|
|
7
|
+
$floatButtonShadow: 0 6Px 16Px 0 rgba(0, 0, 0, 0.08),
|
|
8
|
+
0 3Px 6Px -4Px rgba(0, 0, 0, 0.12), 0 9Px 28Px 8Px rgba(0, 0, 0, 0.05);
|
|
9
|
+
|
|
10
|
+
.#{$floatButtonCls} {
|
|
11
|
+
position: fixed;
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
flex-shrink: 0;
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
|
|
16
|
+
&--embedded {
|
|
17
|
+
position: relative;
|
|
18
|
+
right: auto;
|
|
19
|
+
bottom: auto;
|
|
20
|
+
z-index: auto;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&-body {
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
margin: 0;
|
|
26
|
+
padding: 0;
|
|
27
|
+
display: inline-flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
gap: 8Px;
|
|
31
|
+
min-width: $floatButtonSize;
|
|
32
|
+
min-height: $floatButtonSize;
|
|
33
|
+
border: none;
|
|
34
|
+
border-radius: 50%;
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
font-size: 20Px;
|
|
37
|
+
line-height: 1;
|
|
38
|
+
color: rgba(0, 0, 0, 0.88);
|
|
39
|
+
background: #fff;
|
|
40
|
+
box-shadow: $floatButtonShadow;
|
|
41
|
+
transition: color 0.2s, background 0.2s, box-shadow 0.2s;
|
|
42
|
+
-webkit-tap-highlight-color: transparent;
|
|
43
|
+
text-decoration: none;
|
|
44
|
+
|
|
45
|
+
&:active {
|
|
46
|
+
filter: brightness(0.95);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&--shape-square &-body {
|
|
51
|
+
border-radius: variable.$trionesBorderRadius;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&--has-content &-body {
|
|
55
|
+
min-height: $floatButtonSize;
|
|
56
|
+
display: inline-flex;
|
|
57
|
+
flex-direction: column;
|
|
58
|
+
align-items: center;
|
|
59
|
+
justify-content: center;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&--type-primary &-body {
|
|
63
|
+
color: #fff;
|
|
64
|
+
background: variable.$trionesColorPrimary;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&-icon {
|
|
68
|
+
display: inline-flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
justify-content: center;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&-content {
|
|
74
|
+
font-size: variable.$trionesFontSizeSm;
|
|
75
|
+
font-weight: 500;
|
|
76
|
+
white-space: nowrap;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.#{$floatButtonGroupCls} {
|
|
81
|
+
position: fixed;
|
|
82
|
+
display: flex;
|
|
83
|
+
gap: 12Px;
|
|
84
|
+
align-items: flex-end;
|
|
85
|
+
box-sizing: border-box;
|
|
86
|
+
|
|
87
|
+
&--placement {
|
|
88
|
+
&-top {
|
|
89
|
+
flex-direction: column;
|
|
90
|
+
}
|
|
91
|
+
&-bottom {
|
|
92
|
+
flex-direction: column;
|
|
93
|
+
}
|
|
94
|
+
&-left {
|
|
95
|
+
flex-direction: row;
|
|
96
|
+
}
|
|
97
|
+
&-right {
|
|
98
|
+
flex-direction: row;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&--menu {
|
|
103
|
+
align-items: center;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&-list {
|
|
107
|
+
display: flex;
|
|
108
|
+
flex-direction: column;
|
|
109
|
+
gap: 12Px;
|
|
110
|
+
align-items: flex-end;
|
|
111
|
+
|
|
112
|
+
&--hidden {
|
|
113
|
+
display: none;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&--placement-left &-list,
|
|
118
|
+
&--placement-right &-list {
|
|
119
|
+
flex-direction: column;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/** 小程序点击外部关闭:全屏遮罩;极淡背景避免部分机型不响应 tap */
|
|
123
|
+
&-weapp-outside-mask {
|
|
124
|
+
background: rgba(0, 0, 0, 0.001);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { Rule } from 'rc-field-form/lib/interface';
|
|
2
2
|
import React, { FC } from 'react';
|
|
3
|
+
import { FormHorizontalAlign } from "@trionesdev/antd-mobile-base-react";
|
|
3
4
|
type FormItemInputProps = {
|
|
4
5
|
children?: React.ReactElement;
|
|
5
6
|
className?: string;
|
|
6
7
|
name?: string;
|
|
7
8
|
rules?: Rule[];
|
|
8
9
|
initialValue?: any;
|
|
10
|
+
wrapperAlign?: FormHorizontalAlign;
|
|
9
11
|
valuePropName?: string;
|
|
10
12
|
errors?: React.ReactNode[];
|
|
11
13
|
errorRender?: (errors?: any[]) => React.ReactNode;
|
|
12
14
|
hiddenError?: boolean;
|
|
13
15
|
};
|
|
14
|
-
export declare const
|
|
16
|
+
export declare const FormItemContent: FC<FormItemInputProps>;
|
|
15
17
|
export {};
|
|
@@ -6,9 +6,9 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import classNames from 'classnames';
|
|
8
8
|
import { isEmpty } from 'lodash-es';
|
|
9
|
-
import { Field } from 'rc-field-form';
|
|
10
9
|
import React, { useState } from 'react';
|
|
11
|
-
|
|
10
|
+
import { Field } from "@trionesdev/antd-mobile-base-react";
|
|
11
|
+
export var FormItemContent = function FormItemContent(_ref) {
|
|
12
12
|
var children = _ref.children,
|
|
13
13
|
className = _ref.className,
|
|
14
14
|
name = _ref.name,
|
|
@@ -6,27 +6,21 @@ import React from "react";
|
|
|
6
6
|
import classNames from "classnames";
|
|
7
7
|
import { isFunction } from "lodash-es";
|
|
8
8
|
import { useFormContext } from "@trionesdev/antd-mobile-base-react";
|
|
9
|
-
import { useTaro } from "../../hooks";
|
|
10
9
|
export var FormItemLabel = function FormItemLabel(_ref) {
|
|
11
10
|
var className = _ref.className,
|
|
12
11
|
style = _ref.style,
|
|
13
12
|
label = _ref.label,
|
|
14
13
|
layout = _ref.layout,
|
|
15
14
|
required = _ref.required;
|
|
16
|
-
var _useTaro = useTaro(),
|
|
17
|
-
isTaroWeApp = _useTaro.isTaroWeApp,
|
|
18
|
-
isTaroWeb = _useTaro.isTaroWeb;
|
|
19
15
|
var _useFormContext = useFormContext(),
|
|
20
16
|
requiredMark = _useFormContext.requiredMark,
|
|
21
17
|
colon = _useFormContext.colon;
|
|
22
18
|
var clsPrefix = "triones-antm-form-item-label";
|
|
23
19
|
return /*#__PURE__*/React.createElement("div", {
|
|
24
|
-
className: classNames(className, {
|
|
25
|
-
required: "".concat(clsPrefix, "-required")
|
|
26
|
-
}),
|
|
20
|
+
className: classNames(className, _defineProperty({}, "".concat(clsPrefix, "-required"), required)),
|
|
27
21
|
style: style
|
|
28
22
|
}, /*#__PURE__*/React.createElement("div", {
|
|
29
|
-
className: classNames("".concat(clsPrefix, "-wrapper")
|
|
23
|
+
className: classNames("".concat(clsPrefix, "-wrapper"))
|
|
30
24
|
}, required && /*#__PURE__*/React.createElement("div", {
|
|
31
25
|
className: "".concat(clsPrefix, "-required-mark")
|
|
32
26
|
}, isFunction(requiredMark) ? requiredMark(label, {
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import React, { CSSProperties, FC, ReactElement, ReactNode } from "react";
|
|
2
2
|
import { NamePath, Rule } from "rc-field-form/lib/interface";
|
|
3
|
-
import { FormItemLayout,
|
|
3
|
+
import { FormItemLayout, FormHorizontalAlign } from "@trionesdev/antd-mobile-base-react";
|
|
4
4
|
export type FormItemProps = {
|
|
5
5
|
className?: string;
|
|
6
6
|
style?: CSSProperties;
|
|
7
7
|
children?: ReactElement;
|
|
8
8
|
layout?: FormItemLayout;
|
|
9
9
|
label?: ReactNode;
|
|
10
|
-
labelAlign?:
|
|
10
|
+
labelAlign?: FormHorizontalAlign;
|
|
11
11
|
labelWidth?: number;
|
|
12
|
+
contentAlign?: FormHorizontalAlign;
|
|
12
13
|
name?: NamePath;
|
|
13
14
|
required?: boolean;
|
|
14
15
|
hidden?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["className", "style", "children", "layout", "label", "labelAlign", "labelWidth", "name", "required", "hidden", "noStyle", "rules", "initialValue", "valuePropName", "errorRender", "extra"];
|
|
2
|
+
var _excluded = ["className", "style", "children", "layout", "label", "labelAlign", "labelWidth", "contentAlign", "name", "required", "hidden", "noStyle", "rules", "initialValue", "valuePropName", "errorRender", "extra"];
|
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
@@ -8,10 +8,10 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
8
8
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
9
9
|
import React from "react";
|
|
10
10
|
import { FormItemLabel } from "./form-item-label";
|
|
11
|
-
import {
|
|
11
|
+
import { FormItemContent } from "./form-item-content";
|
|
12
12
|
import classNames from "classnames";
|
|
13
|
-
import { Field } from "
|
|
14
|
-
import {
|
|
13
|
+
import { Field, useFormContext } from "@trionesdev/antd-mobile-base-react";
|
|
14
|
+
import { useTaro } from "../../hooks";
|
|
15
15
|
export var FormItem = function FormItem(_ref) {
|
|
16
16
|
var className = _ref.className,
|
|
17
17
|
style = _ref.style,
|
|
@@ -20,6 +20,7 @@ export var FormItem = function FormItem(_ref) {
|
|
|
20
20
|
label = _ref.label,
|
|
21
21
|
labelAlign = _ref.labelAlign,
|
|
22
22
|
labelWidth = _ref.labelWidth,
|
|
23
|
+
contentAlign = _ref.contentAlign,
|
|
23
24
|
name = _ref.name,
|
|
24
25
|
required = _ref.required,
|
|
25
26
|
_ref$hidden = _ref.hidden,
|
|
@@ -32,42 +33,45 @@ export var FormItem = function FormItem(_ref) {
|
|
|
32
33
|
errorRender = _ref.errorRender,
|
|
33
34
|
extra = _ref.extra,
|
|
34
35
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
35
|
-
var
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
var
|
|
42
|
-
var
|
|
43
|
-
var
|
|
44
|
-
var
|
|
36
|
+
var _useTaro = useTaro(),
|
|
37
|
+
isTaroWeApp = _useTaro.isTaroWeApp,
|
|
38
|
+
isTaroWeb = _useTaro.isTaroWeb;
|
|
39
|
+
// const { layout: formLayout, labelAlign: formLayoutAlign, labelWidth: formLabelWidth, hiddenError, extra: formExtra } = useFormContext()
|
|
40
|
+
var ctx = useFormContext();
|
|
41
|
+
var formItemLayout = layout ? layout : ctx.layout === 'inline' ? 'horizontal' : ctx.layout;
|
|
42
|
+
var formItemAlign = labelAlign ? labelAlign : ctx.labelAlign || 'left';
|
|
43
|
+
var formItemLabelWidth = labelWidth ? labelWidth : ctx.labelWidth;
|
|
44
|
+
var formItemExtra = extra !== undefined ? extra : ctx.extra;
|
|
45
|
+
var formItemWrapperAlign = contentAlign ? contentAlign : ctx.contentAlign;
|
|
45
46
|
var clsPrefix = "triones-antm-form-item";
|
|
46
47
|
if (noStyle) {
|
|
47
48
|
return /*#__PURE__*/React.createElement(Field, {
|
|
48
49
|
name: name,
|
|
49
50
|
rules: rules,
|
|
51
|
+
valuePropName: valuePropName,
|
|
50
52
|
trigger: 'onChange',
|
|
51
53
|
initialValue: initialValue
|
|
52
54
|
}, children);
|
|
53
55
|
}
|
|
54
56
|
return /*#__PURE__*/React.createElement("div", {
|
|
55
|
-
className: classNames(clsPrefix, "".concat(clsPrefix, "-").concat(formItemLayout), className, _defineProperty({}, "".concat(clsPrefix, "-hidden"), hidden)),
|
|
57
|
+
className: classNames(clsPrefix, "".concat(clsPrefix, "-").concat(formItemLayout), className, _defineProperty(_defineProperty(_defineProperty({}, "".concat(clsPrefix, "-hidden"), hidden), "h5", isTaroWeb), "wx", isTaroWeApp)),
|
|
56
58
|
style: style
|
|
57
59
|
}, label && /*#__PURE__*/React.createElement(FormItemLabel, {
|
|
58
60
|
className: classNames("".concat(clsPrefix, "-label"), "".concat(clsPrefix, "-label-").concat(formItemAlign)),
|
|
59
61
|
style: {
|
|
60
62
|
width: formItemLabelWidth
|
|
61
63
|
},
|
|
64
|
+
layout: formItemLayout,
|
|
62
65
|
label: label,
|
|
63
66
|
required: required
|
|
64
|
-
}), /*#__PURE__*/React.createElement(
|
|
65
|
-
className: "".concat(clsPrefix, "-
|
|
67
|
+
}), /*#__PURE__*/React.createElement(FormItemContent, _extends({
|
|
68
|
+
className: classNames("".concat(clsPrefix, "-content"), "".concat(clsPrefix, "-content-").concat(formItemWrapperAlign))
|
|
66
69
|
}, props, {
|
|
67
70
|
name: name,
|
|
68
71
|
rules: rules,
|
|
69
72
|
errorRender: errorRender,
|
|
70
73
|
initialValue: initialValue,
|
|
71
|
-
|
|
72
|
-
|
|
74
|
+
valuePropName: valuePropName,
|
|
75
|
+
hiddenError: ctx.hiddenError
|
|
76
|
+
}), children), formItemExtra);
|
|
73
77
|
};
|
package/dist/Form/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Form as InternalForm, FormProps } from "@trionesdev/antd-mobile-base-react";
|
|
1
|
+
import { Form as InternalForm, FormProps, FormInstance } from "@trionesdev/antd-mobile-base-react";
|
|
2
2
|
import FormItem, { FormItemProps } from "./FormItem";
|
|
3
3
|
import "./style.scss";
|
|
4
4
|
type InternalFormType = typeof InternalForm;
|
|
@@ -6,5 +6,5 @@ type CompoundedComponent = InternalFormType & {
|
|
|
6
6
|
Item: typeof FormItem;
|
|
7
7
|
};
|
|
8
8
|
declare const Form: CompoundedComponent;
|
|
9
|
-
export type { FormProps, FormItemProps };
|
|
9
|
+
export type { FormProps, FormItemProps, FormInstance };
|
|
10
10
|
export default Form;
|
package/dist/Form/style.scss
CHANGED
|
@@ -1,78 +1,100 @@
|
|
|
1
|
-
@use "../style/variable" as variable;
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
$cls-prefix-form-item: 'triones-antm-form-item';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
1
|
+
@use "../style/variable" as variable;
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
$cls-prefix-form-item: 'triones-antm-form-item';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
.#{$cls-prefix-form-item} {
|
|
8
|
+
&.h5 {
|
|
9
|
+
@include variable.h5-line-height;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&.wx {
|
|
13
|
+
@include variable.wx-input-size;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&-label {
|
|
17
|
+
font-size: variable.$trionesFontSize;
|
|
18
|
+
color: #6F6F6F;
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
&-wrapper {
|
|
22
|
+
//display: flex;
|
|
23
|
+
//align-items: center;
|
|
24
|
+
height: 100%;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&-required-mark {
|
|
28
|
+
display: inline-block;
|
|
29
|
+
color: variable.$trionesColorError;
|
|
30
|
+
width: 8Px;
|
|
31
|
+
margin-left: -8Px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&-content {
|
|
37
|
+
|
|
38
|
+
&-end {
|
|
39
|
+
text-align: end;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.#{$cls-prefix-form-item} {
|
|
43
|
+
&-error {
|
|
44
|
+
font-size: variable.$trionesFontSizeSm;
|
|
45
|
+
color: variable.$trionesColorError;
|
|
46
|
+
line-height: normal;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&-horizontal {
|
|
52
|
+
display: flex;
|
|
53
|
+
|
|
54
|
+
.#{$cls-prefix-form-item} {
|
|
55
|
+
&-label {
|
|
56
|
+
padding-block: 12Px;
|
|
57
|
+
flex-shrink: 1;
|
|
58
|
+
min-width: 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&-content {
|
|
62
|
+
padding-block: 12Px;
|
|
63
|
+
flex: 1;
|
|
64
|
+
flex-shrink: 1;
|
|
65
|
+
min-width: 0;
|
|
66
|
+
|
|
67
|
+
&-end {
|
|
68
|
+
text-align: end;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&.#{$cls-prefix-form-item} {
|
|
74
|
+
&-start {
|
|
75
|
+
align-items: flex-start;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&-center {
|
|
79
|
+
//align-items: center;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&-vertical {
|
|
85
|
+
.#{$cls-prefix-form-item} {
|
|
86
|
+
&-label {
|
|
87
|
+
margin-bottom: 4Px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&-content {
|
|
91
|
+
padding-block-end: 8Px;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&-hidden {
|
|
98
|
+
display: none;
|
|
99
|
+
}
|
|
100
|
+
}
|