@trionesdev/antd-mobile-base-react 0.0.2-beta.0 → 0.0.2-beta.10
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/README.md +23 -23
- package/dist/Alert/style.scss +69 -69
- package/dist/Avatar/avatar.d.ts +4 -1
- package/dist/Avatar/avatar.js +19 -6
- package/dist/Avatar/style.scss +17 -16
- package/dist/Badge/style.scss +100 -100
- package/dist/Card/style.scss +35 -35
- package/dist/CascaderView/cascader-view.js +1 -1
- package/dist/CascaderView/style.scss +22 -22
- package/dist/Cell/CellGroup.js +39 -17
- package/dist/Cell/cell.js +70 -16
- package/dist/Cell/context.d.ts +17 -0
- package/dist/Cell/context.js +2 -0
- package/dist/Cell/styles.scss +51 -52
- package/dist/Cell/types.d.ts +28 -7
- package/dist/Checkbox/checkbox-button.d.ts +6 -2
- package/dist/Checkbox/checkbox-button.js +5 -17
- package/dist/Checkbox/checkbox-group.js +19 -3
- package/dist/Checkbox/checkbox-round.d.ts +8 -0
- package/dist/Checkbox/checkbox-round.js +35 -0
- package/dist/Checkbox/checkbox.js +49 -34
- package/dist/Checkbox/index.d.ts +0 -2
- package/dist/Checkbox/index.js +0 -2
- package/dist/Checkbox/index.scss +165 -151
- package/dist/Checkbox/types.d.ts +11 -1
- package/dist/DemoBlock/index.scss +20 -20
- package/dist/DemoDescription/index.scss +3 -3
- package/dist/Descriptions/style.scss +65 -65
- package/dist/Divider/style.scss +62 -62
- package/dist/Ellipsis/style.scss +13 -13
- package/dist/Empty/style.scss +29 -29
- package/dist/ErrorBlock/demo/base.js +2 -2
- package/dist/ErrorBlock/style.scss +62 -62
- package/dist/Footer/style.scss +55 -55
- package/dist/Form/context.d.ts +2 -1
- package/dist/Form/form.d.ts +2 -7
- package/dist/Form/form.js +4 -3
- package/dist/Form/index.d.ts +5 -3
- package/dist/Form/index.js +4 -2
- package/dist/Form/types.d.ts +7 -0
- package/dist/Grid/style.scss +17 -17
- package/dist/Icon/demo/base.js +3 -3
- package/dist/IndexedStack/IndexedStack.d.ts +9 -0
- package/dist/IndexedStack/IndexedStack.js +27 -0
- package/dist/IndexedStack/index.d.ts +3 -0
- package/dist/IndexedStack/index.js +2 -0
- package/dist/InputNumber/input-number.d.ts +3 -0
- package/dist/InputNumber/input-number.js +7 -3
- package/dist/InputNumber/style.scss +63 -43
- package/dist/NavBar/nav-bar.d.ts +1 -0
- package/dist/NavBar/nav-bar.js +2 -1
- package/dist/NavBar/style.scss +64 -61
- package/dist/NoticeBar/style.scss +130 -130
- package/dist/PageIndicator/style.scss +59 -59
- package/dist/Progress/Progress.d.ts +39 -0
- package/dist/Progress/Progress.js +56 -0
- package/dist/Progress/ProgressCircle.d.ts +15 -0
- package/dist/Progress/ProgressCircle.js +114 -0
- package/dist/Progress/ProgressLine.d.ts +15 -0
- package/dist/Progress/ProgressLine.js +87 -0
- package/dist/Progress/index.d.ts +3 -0
- package/dist/Progress/index.js +2 -0
- package/dist/Progress/style.scss +33 -0
- package/dist/Progress/types.d.ts +6 -0
- package/dist/Progress/types.js +2 -0
- package/dist/Radio/RadioGroup.js +3 -3
- package/dist/Radio/style.scss +141 -138
- package/dist/Radio/types.d.ts +6 -4
- package/dist/Rate/style.scss +37 -37
- package/dist/Result/demo/base.js +2 -2
- package/dist/Result/style.scss +73 -73
- package/dist/SafeArea/style.scss +20 -18
- package/dist/Scaffold/style.scss +17 -16
- package/dist/Skeleton/Skeleton.d.ts +27 -0
- package/dist/Skeleton/Skeleton.js +72 -0
- package/dist/Skeleton/index.d.ts +1 -0
- package/dist/Skeleton/index.js +1 -0
- package/dist/Skeleton/style.scss +48 -0
- package/dist/Space/space.d.ts +1 -0
- package/dist/Space/space.js +17 -6
- package/dist/Space/style.scss +80 -77
- package/dist/SpinLoading/spin-loading.scss +40 -40
- package/dist/Steps/HorizontalSteps.js +5 -1
- package/dist/Steps/style.scss +153 -146
- package/dist/Switch/style.scss +128 -128
- package/dist/TabBar/demo/base.js +2 -2
- package/dist/TabBar/index.js +2 -1
- package/dist/TabBar/index.scss +37 -36
- package/dist/TabBar/tab-bar.d.ts +1 -1
- package/dist/TabBar/tab-bar.js +3 -2
- package/dist/Tabs/style.scss +108 -108
- package/dist/Tabs/tabs.js +1 -1
- package/dist/Tag/style.scss +108 -86
- package/dist/Tag/tag.d.ts +3 -0
- package/dist/Tag/tag.js +8 -1
- package/dist/WaterMark/style.scss +17 -17
- package/dist/index.d.ts +6 -24
- package/dist/index.js +3 -12
- package/dist/style/css-variable.scss +6 -0
- package/dist/style/style.scss +52 -52
- package/dist/style/theme-dark.scss +24 -24
- package/dist/style/theme-default.scss +54 -54
- package/dist/style/variable.scss +173 -168
- package/dist/types.d.ts +5 -1
- package/dist/utils/type.js +36 -36
- package/dist/utils/with-default-props.js +4 -4
- package/package.json +7 -8
- package/dist/ActionSheet/ActionSheet.d.ts +0 -25
- package/dist/ActionSheet/ActionSheet.js +0 -77
- package/dist/ActionSheet/index.d.ts +0 -3
- package/dist/ActionSheet/index.js +0 -2
- package/dist/ActionSheet/style.scss +0 -51
- package/dist/CascaderPicker/cascader-picker.d.ts +0 -27
- package/dist/CascaderPicker/cascader-picker.js +0 -88
- package/dist/CascaderPicker/index.d.ts +0 -3
- package/dist/CascaderPicker/index.js +0 -2
- package/dist/CascaderPicker/style.scss +0 -42
- package/dist/Form/FormItem/form-item-input.d.ts +0 -15
- package/dist/Form/FormItem/form-item-input.js +0 -39
- package/dist/Form/FormItem/form-item-label.d.ts +0 -13
- package/dist/Form/FormItem/form-item-label.js +0 -25
- package/dist/Form/FormItem/form-item.d.ts +0 -21
- package/dist/Form/FormItem/form-item.js +0 -70
- package/dist/Form/FormItem/index.d.ts +0 -5
- package/dist/Form/FormItem/index.js +0 -3
- package/dist/Form/style.scss +0 -45
- package/dist/Input/base-input.d.ts +0 -14
- package/dist/Input/base-input.js +0 -63
- package/dist/Input/index.d.ts +0 -12
- package/dist/Input/index.js +0 -9
- package/dist/Input/index.scss +0 -173
- package/dist/Input/input-affix-wrapper.d.ts +0 -8
- package/dist/Input/input-affix-wrapper.js +0 -50
- package/dist/Input/input-opt.d.ts +0 -16
- package/dist/Input/input-opt.js +0 -93
- package/dist/Input/input-password.d.ts +0 -7
- package/dist/Input/input-password.js +0 -47
- package/dist/Input/input.d.ts +0 -15
- package/dist/Input/input.js +0 -47
- package/dist/Input/textarea.d.ts +0 -13
- package/dist/Input/textarea.js +0 -45
- package/dist/Input/types.d.ts +0 -1
- package/dist/Input/types.js +0 -1
- package/dist/Mask/index.d.ts +0 -3
- package/dist/Mask/index.js +0 -2
- package/dist/Mask/mask-modal.d.ts +0 -45
- package/dist/Mask/mask-modal.js +0 -32
- package/dist/Mask/mask.d.ts +0 -5
- package/dist/Mask/mask.js +0 -19
- package/dist/Mask/style.scss +0 -20
- package/dist/Picker/index.d.ts +0 -3
- package/dist/Picker/index.js +0 -2
- package/dist/Picker/picker.d.ts +0 -19
- package/dist/Picker/picker.js +0 -97
- package/dist/Picker/style.scss +0 -41
- package/dist/PickerView/index.d.ts +0 -4
- package/dist/PickerView/index.js +0 -2
- package/dist/PickerView/picker-view-column-item.d.ts +0 -7
- package/dist/PickerView/picker-view-column-item.js +0 -11
- package/dist/PickerView/picker-view-column.d.ts +0 -10
- package/dist/PickerView/picker-view-column.js +0 -117
- package/dist/PickerView/picker-view.d.ts +0 -12
- package/dist/PickerView/picker-view.js +0 -60
- package/dist/PickerView/style.scss +0 -72
- package/dist/PickerView/types.d.ts +0 -4
- package/dist/Popup/index.d.ts +0 -3
- package/dist/Popup/index.js +0 -2
- package/dist/Popup/popup-modal.d.ts +0 -52
- package/dist/Popup/popup-modal.js +0 -74
- package/dist/Popup/popup.d.ts +0 -4
- package/dist/Popup/popup.js +0 -56
- package/dist/Popup/style.scss +0 -53
- package/dist/ScrollView/index.d.ts +0 -4
- package/dist/ScrollView/index.js +0 -2
- package/dist/ScrollView/scroll-view.d.ts +0 -4
- package/dist/ScrollView/scroll-view.js +0 -55
- package/dist/ScrollView/style.scss +0 -19
- package/dist/ScrollView/types.d.ts +0 -26
- package/dist/ScrollView/types.js +0 -1
- package/dist/SideBar/SideBarContext.d.ts +0 -18
- package/dist/SideBar/SideBarContext.js +0 -2
- package/dist/SideBar/index.d.ts +0 -3
- package/dist/SideBar/index.js +0 -2
- package/dist/SideBar/side-bar.d.ts +0 -25
- package/dist/SideBar/side-bar.js +0 -351
- package/dist/SideBar/style.scss +0 -85
- package/dist/SideBar/types.d.ts +0 -7
- package/dist/SideBar/types.js +0 -1
- package/dist/Tag/demo/base.d.ts +0 -7
- package/dist/Tag/demo/base.js +0 -67
- package/dist/Tag/demo/style.scss +0 -8
- package/dist/Toast/index.d.ts +0 -5
- package/dist/Toast/index.js +0 -3
- package/dist/Toast/style.scss +0 -63
- package/dist/Toast/toast-modal.d.ts +0 -18
- package/dist/Toast/toast-modal.js +0 -112
- package/dist/Toast/toast.d.ts +0 -7
- package/dist/Toast/toast.js +0 -78
- package/dist/VerificationCodeInput/demo/base.d.ts +0 -3
- package/dist/VerificationCodeInput/demo/base.js +0 -11
- package/dist/VerificationCodeInput/index.d.ts +0 -3
- package/dist/VerificationCodeInput/index.js +0 -2
- package/dist/VerificationCodeInput/style.scss +0 -20
- package/dist/VerificationCodeInput/verification-code-input.d.ts +0 -24
- package/dist/VerificationCodeInput/verification-code-input.js +0 -99
- /package/dist/{PickerView → Form}/types.js +0 -0
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
@import "../style/variable";
|
|
2
|
-
$actionSheetCls: 'triones-antm-action-sheet';
|
|
3
|
-
|
|
4
|
-
.#{$actionSheetCls} {
|
|
5
|
-
display: flex;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
background-color: $trionesColorFill;
|
|
8
|
-
border-top-left-radius: $trionesBorderRadius;
|
|
9
|
-
border-top-right-radius: $trionesBorderRadius;
|
|
10
|
-
overflow: hidden;
|
|
11
|
-
gap: 2Px;
|
|
12
|
-
&-body{
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
&-title{
|
|
16
|
-
display: flex;
|
|
17
|
-
justify-content: center;
|
|
18
|
-
align-items: center;
|
|
19
|
-
min-height: 48Px;
|
|
20
|
-
background-color: white;
|
|
21
|
-
font-size: 18Px;
|
|
22
|
-
border-bottom: 1Px solid $trionesBorderColor;
|
|
23
|
-
}
|
|
24
|
-
&-actions{
|
|
25
|
-
&-item{
|
|
26
|
-
display: flex;
|
|
27
|
-
justify-content: center;
|
|
28
|
-
align-items: center;
|
|
29
|
-
min-height: 48Px;
|
|
30
|
-
background-color: white;
|
|
31
|
-
cursor: default;
|
|
32
|
-
position: relative;
|
|
33
|
-
font-size: 18Px;
|
|
34
|
-
&:hover{
|
|
35
|
-
opacity: 0.8;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
&-cancel{
|
|
40
|
-
display: flex;
|
|
41
|
-
justify-content: center;
|
|
42
|
-
align-items: center;
|
|
43
|
-
min-height: 48Px;
|
|
44
|
-
font-size: 18Px;
|
|
45
|
-
background-color: white;
|
|
46
|
-
cursor: default;
|
|
47
|
-
&:hover{
|
|
48
|
-
opacity: 0.8;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import React, { FC } from 'react';
|
|
2
|
-
import './style.scss';
|
|
3
|
-
export type CascaderPickerProps = {
|
|
4
|
-
className?: string;
|
|
5
|
-
style?: React.CSSProperties;
|
|
6
|
-
open?: boolean;
|
|
7
|
-
afterOpenChange?: (open: boolean) => void;
|
|
8
|
-
title?: React.ReactNode;
|
|
9
|
-
options?: any[];
|
|
10
|
-
/**
|
|
11
|
-
* @description 是否把每个选项的 label 包装到 value 中,会把 Select 的 value 类型从 string 变为 { value: string, label: ReactNode } 的格式
|
|
12
|
-
* @default false
|
|
13
|
-
*/
|
|
14
|
-
labelInValue?: boolean;
|
|
15
|
-
fieldNames?: {
|
|
16
|
-
value?: string;
|
|
17
|
-
label?: string;
|
|
18
|
-
children?: string;
|
|
19
|
-
};
|
|
20
|
-
columnsCount?: number;
|
|
21
|
-
value?: any[];
|
|
22
|
-
onOk?: (value?: any[]) => void;
|
|
23
|
-
onCancel?: () => void;
|
|
24
|
-
onClose?: () => void;
|
|
25
|
-
asyncRequest?: (parentValue?: any) => Promise<any>;
|
|
26
|
-
};
|
|
27
|
-
export declare const CascaderPicker: FC<CascaderPickerProps>;
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import classNames from 'classnames';
|
|
2
|
-
import { isEqual } from 'lodash';
|
|
3
|
-
import React, { useEffect, useRef } from 'react';
|
|
4
|
-
import CascaderView from "../CascaderView";
|
|
5
|
-
import ConfigProvider from "../ConfigProvider";
|
|
6
|
-
import Popup from "../Popup";
|
|
7
|
-
import "./style.scss";
|
|
8
|
-
var cascaderPickerCls = 'triones-antm-cascader-picker';
|
|
9
|
-
export var CascaderPicker = /*#__PURE__*/React.memo(function (_ref) {
|
|
10
|
-
var className = _ref.className,
|
|
11
|
-
style = _ref.style,
|
|
12
|
-
_ref$open = _ref.open,
|
|
13
|
-
open = _ref$open === void 0 ? false : _ref$open,
|
|
14
|
-
afterOpenChange = _ref.afterOpenChange,
|
|
15
|
-
title = _ref.title,
|
|
16
|
-
options = _ref.options,
|
|
17
|
-
_ref$labelInValue = _ref.labelInValue,
|
|
18
|
-
labelInValue = _ref$labelInValue === void 0 ? false : _ref$labelInValue,
|
|
19
|
-
fieldNames = _ref.fieldNames,
|
|
20
|
-
columnsCount = _ref.columnsCount,
|
|
21
|
-
value = _ref.value,
|
|
22
|
-
onOk = _ref.onOk,
|
|
23
|
-
onCancel = _ref.onCancel,
|
|
24
|
-
onClose = _ref.onClose,
|
|
25
|
-
asyncRequest = _ref.asyncRequest;
|
|
26
|
-
var _ConfigProvider$useCo = ConfigProvider.useConfig(),
|
|
27
|
-
locale = _ConfigProvider$useCo.locale;
|
|
28
|
-
var internalValueRf = useRef(value);
|
|
29
|
-
var handleClose = function handleClose() {
|
|
30
|
-
onClose === null || onClose === void 0 || onClose();
|
|
31
|
-
};
|
|
32
|
-
var handleOk = function handleOk() {
|
|
33
|
-
onOk === null || onOk === void 0 || onOk(internalValueRf.current);
|
|
34
|
-
};
|
|
35
|
-
var handelCancel = function handelCancel() {
|
|
36
|
-
onCancel === null || onCancel === void 0 || onCancel();
|
|
37
|
-
handleClose();
|
|
38
|
-
};
|
|
39
|
-
useEffect(function () {
|
|
40
|
-
if (value === undefined) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
if (isEqual(value, internalValueRf.current)) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
internalValueRf.current = value;
|
|
47
|
-
}, [value]);
|
|
48
|
-
return /*#__PURE__*/React.createElement(Popup, {
|
|
49
|
-
open: open,
|
|
50
|
-
onClose: handleClose,
|
|
51
|
-
styles: {
|
|
52
|
-
body: {
|
|
53
|
-
borderTopLeftRadius: 6,
|
|
54
|
-
borderTopRightRadius: 6
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
58
|
-
className: classNames(cascaderPickerCls, className),
|
|
59
|
-
style: style
|
|
60
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
61
|
-
className: classNames("".concat(cascaderPickerCls, "-header"))
|
|
62
|
-
}, /*#__PURE__*/React.createElement("a", {
|
|
63
|
-
className: classNames("".concat(cascaderPickerCls, "-header-button")),
|
|
64
|
-
onClick: handelCancel
|
|
65
|
-
}, locale.common.cancel), title && /*#__PURE__*/React.createElement("div", {
|
|
66
|
-
className: classNames("".concat(cascaderPickerCls, "-header-title"))
|
|
67
|
-
}, title), /*#__PURE__*/React.createElement("a", {
|
|
68
|
-
className: classNames("".concat(cascaderPickerCls, "-header-button"), "".concat(cascaderPickerCls, "-header-button-ok")),
|
|
69
|
-
onClick: handleOk
|
|
70
|
-
}, locale.common.confirm)), /*#__PURE__*/React.createElement("div", {
|
|
71
|
-
className: classNames("".concat(cascaderPickerCls, "-body"))
|
|
72
|
-
}, /*#__PURE__*/React.createElement(CascaderView
|
|
73
|
-
// open={ open}
|
|
74
|
-
, {
|
|
75
|
-
fieldNames: fieldNames,
|
|
76
|
-
options: options,
|
|
77
|
-
labelInValue: labelInValue,
|
|
78
|
-
columnsCount: columnsCount,
|
|
79
|
-
value: value,
|
|
80
|
-
onChange: function onChange(newVal) {
|
|
81
|
-
internalValueRf.current = newVal;
|
|
82
|
-
},
|
|
83
|
-
asyncRequest: asyncRequest,
|
|
84
|
-
style: {
|
|
85
|
-
height: '100%'
|
|
86
|
-
}
|
|
87
|
-
}))));
|
|
88
|
-
});
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
@import "../style/variable";
|
|
2
|
-
$cascaderPickerCls: 'triones-antm-cascader-picker';
|
|
3
|
-
|
|
4
|
-
.#{$cascaderPickerCls} {
|
|
5
|
-
width: 100%;
|
|
6
|
-
height: 300Px;
|
|
7
|
-
overflow: hidden;
|
|
8
|
-
position: relative;
|
|
9
|
-
display: flex;
|
|
10
|
-
flex-direction: column;
|
|
11
|
-
|
|
12
|
-
&-header {
|
|
13
|
-
display: flex;
|
|
14
|
-
justify-content: space-between;
|
|
15
|
-
align-items: center;
|
|
16
|
-
border-bottom: 1Px solid $trionesBorderColor;
|
|
17
|
-
padding: 4Px;
|
|
18
|
-
|
|
19
|
-
&-button {
|
|
20
|
-
|
|
21
|
-
padding: 8Px;
|
|
22
|
-
font-size: 12Px;
|
|
23
|
-
&-ok{
|
|
24
|
-
color: $trionesColorPrimary;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
&-title {
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
&-body {
|
|
33
|
-
flex: 1 1;
|
|
34
|
-
width: 100%;
|
|
35
|
-
pointer-events: unset;
|
|
36
|
-
overflow: hidden;
|
|
37
|
-
}
|
|
38
|
-
&-view{
|
|
39
|
-
--height: 100%;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Rule } from 'rc-field-form/lib/interface';
|
|
2
|
-
import React, { FC } from 'react';
|
|
3
|
-
type FormItemInputProps = {
|
|
4
|
-
children?: React.ReactElement;
|
|
5
|
-
className?: string;
|
|
6
|
-
name?: string;
|
|
7
|
-
rules?: Rule[];
|
|
8
|
-
initialValue?: any;
|
|
9
|
-
valuePropName?: string;
|
|
10
|
-
errors?: React.ReactNode[];
|
|
11
|
-
errorRender?: (errors?: any[]) => React.ReactNode;
|
|
12
|
-
hiddenError?: boolean;
|
|
13
|
-
};
|
|
14
|
-
export declare const FormItemInput: FC<FormItemInputProps>;
|
|
15
|
-
export {};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import classNames from 'classnames';
|
|
8
|
-
import { isEmpty } from 'lodash';
|
|
9
|
-
import { Field } from 'rc-field-form';
|
|
10
|
-
import React, { useState } from 'react';
|
|
11
|
-
export var FormItemInput = function FormItemInput(_ref) {
|
|
12
|
-
var children = _ref.children,
|
|
13
|
-
className = _ref.className,
|
|
14
|
-
name = _ref.name,
|
|
15
|
-
rules = _ref.rules,
|
|
16
|
-
initialValue = _ref.initialValue,
|
|
17
|
-
valuePropName = _ref.valuePropName,
|
|
18
|
-
errorRender = _ref.errorRender,
|
|
19
|
-
hiddenError = _ref.hiddenError;
|
|
20
|
-
var _useState = useState(),
|
|
21
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
22
|
-
meta = _useState2[0],
|
|
23
|
-
setMeta = _useState2[1];
|
|
24
|
-
var clsPrefix = 'triones-antm-form-item';
|
|
25
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
26
|
-
className: classNames(className)
|
|
27
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Field, {
|
|
28
|
-
name: name,
|
|
29
|
-
rules: rules,
|
|
30
|
-
valuePropName: valuePropName,
|
|
31
|
-
trigger: 'onChange',
|
|
32
|
-
onMetaChange: function onMetaChange(meta) {
|
|
33
|
-
setMeta(meta);
|
|
34
|
-
},
|
|
35
|
-
initialValue: initialValue
|
|
36
|
-
}, children)), !hiddenError && !isEmpty(meta === null || meta === void 0 ? void 0 : meta.errors) && /*#__PURE__*/React.createElement("div", {
|
|
37
|
-
className: classNames("".concat(clsPrefix, "-error"))
|
|
38
|
-
}, (errorRender === null || errorRender === void 0 ? void 0 : errorRender(meta === null || meta === void 0 ? void 0 : meta.errors)) || (meta === null || meta === void 0 ? void 0 : meta.errors.join(','))));
|
|
39
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React, { CSSProperties, FC } from "react";
|
|
2
|
-
import { NamePath } from "rc-field-form/lib/interface";
|
|
3
|
-
import { FormItemLayout } from "../form";
|
|
4
|
-
type FormItemLabelProps = {
|
|
5
|
-
className?: string;
|
|
6
|
-
style?: CSSProperties;
|
|
7
|
-
label?: React.ReactNode;
|
|
8
|
-
layout?: FormItemLayout;
|
|
9
|
-
name?: NamePath;
|
|
10
|
-
required?: boolean;
|
|
11
|
-
};
|
|
12
|
-
export declare const FormItemLabel: FC<FormItemLabelProps>;
|
|
13
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import classNames from "classnames";
|
|
3
|
-
import { useFormContext } from "../hooks/useFormContext";
|
|
4
|
-
import { isFunction } from "lodash";
|
|
5
|
-
export var FormItemLabel = function FormItemLabel(_ref) {
|
|
6
|
-
var className = _ref.className,
|
|
7
|
-
style = _ref.style,
|
|
8
|
-
label = _ref.label,
|
|
9
|
-
layout = _ref.layout,
|
|
10
|
-
required = _ref.required;
|
|
11
|
-
var _useFormContext = useFormContext(),
|
|
12
|
-
requiredMark = _useFormContext.requiredMark,
|
|
13
|
-
colon = _useFormContext.colon;
|
|
14
|
-
var clsPrefix = "triones-antm-form-item-label";
|
|
15
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
16
|
-
className: classNames(className, {
|
|
17
|
-
required: "".concat(clsPrefix, "-required")
|
|
18
|
-
}),
|
|
19
|
-
style: style
|
|
20
|
-
}, /*#__PURE__*/React.createElement("label", null, required && /*#__PURE__*/React.createElement("div", {
|
|
21
|
-
className: "".concat(clsPrefix, "-required-mark")
|
|
22
|
-
}, isFunction(requiredMark) ? requiredMark(label, {
|
|
23
|
-
required: required
|
|
24
|
-
}) : '*'), label, layout == 'horizontal' && colon && ':'));
|
|
25
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React, { CSSProperties, FC, ReactElement, ReactNode } from "react";
|
|
2
|
-
import { NamePath, Rule } from "rc-field-form/lib/interface";
|
|
3
|
-
import { FormItemLayout, FormLayoutAlign } from "../form";
|
|
4
|
-
export type FormItemProps = {
|
|
5
|
-
className?: string;
|
|
6
|
-
style?: CSSProperties;
|
|
7
|
-
children?: ReactElement;
|
|
8
|
-
layout?: FormItemLayout;
|
|
9
|
-
label?: ReactNode;
|
|
10
|
-
labelAlign?: FormLayoutAlign;
|
|
11
|
-
labelWidth?: number;
|
|
12
|
-
name?: NamePath;
|
|
13
|
-
required?: boolean;
|
|
14
|
-
hidden?: boolean;
|
|
15
|
-
noStyle?: boolean;
|
|
16
|
-
rules?: Rule[];
|
|
17
|
-
initialValue?: any;
|
|
18
|
-
valuePropName?: string;
|
|
19
|
-
errorRender?: (errors?: any[]) => React.ReactNode;
|
|
20
|
-
};
|
|
21
|
-
export declare const FormItem: FC<FormItemProps>;
|
|
@@ -1,70 +0,0 @@
|
|
|
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"];
|
|
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
|
-
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
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
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
|
-
import React from "react";
|
|
10
|
-
import { FormItemLabel } from "./form-item-label";
|
|
11
|
-
import { FormItemInput } from "./form-item-input";
|
|
12
|
-
import classNames from "classnames";
|
|
13
|
-
import { useFormContext } from "../hooks/useFormContext";
|
|
14
|
-
import { Field } from "rc-field-form";
|
|
15
|
-
export var FormItem = function FormItem(_ref) {
|
|
16
|
-
var className = _ref.className,
|
|
17
|
-
style = _ref.style,
|
|
18
|
-
children = _ref.children,
|
|
19
|
-
layout = _ref.layout,
|
|
20
|
-
label = _ref.label,
|
|
21
|
-
labelAlign = _ref.labelAlign,
|
|
22
|
-
labelWidth = _ref.labelWidth,
|
|
23
|
-
name = _ref.name,
|
|
24
|
-
required = _ref.required,
|
|
25
|
-
_ref$hidden = _ref.hidden,
|
|
26
|
-
hidden = _ref$hidden === void 0 ? false : _ref$hidden,
|
|
27
|
-
_ref$noStyle = _ref.noStyle,
|
|
28
|
-
noStyle = _ref$noStyle === void 0 ? false : _ref$noStyle,
|
|
29
|
-
rules = _ref.rules,
|
|
30
|
-
initialValue = _ref.initialValue,
|
|
31
|
-
valuePropName = _ref.valuePropName,
|
|
32
|
-
errorRender = _ref.errorRender,
|
|
33
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
34
|
-
var _useFormContext = useFormContext(),
|
|
35
|
-
formLayout = _useFormContext.layout,
|
|
36
|
-
formLayoutAlign = _useFormContext.labelAlign,
|
|
37
|
-
formLabelWidth = _useFormContext.labelWidth,
|
|
38
|
-
hiddenError = _useFormContext.hiddenError;
|
|
39
|
-
var formItemLayout = layout ? layout : formLayout === 'inline' ? 'horizontal' : formLayout;
|
|
40
|
-
var formItemAlign = labelAlign ? labelAlign : formLayoutAlign || 'left';
|
|
41
|
-
var formItemLabelWidth = labelWidth ? labelWidth : formLabelWidth;
|
|
42
|
-
var clsPrefix = "triones-antm-form-item";
|
|
43
|
-
if (noStyle) {
|
|
44
|
-
return /*#__PURE__*/React.createElement(Field, {
|
|
45
|
-
name: name,
|
|
46
|
-
rules: rules,
|
|
47
|
-
trigger: 'onChange',
|
|
48
|
-
initialValue: initialValue
|
|
49
|
-
}, children);
|
|
50
|
-
}
|
|
51
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
52
|
-
className: classNames(clsPrefix, "".concat(clsPrefix, "-").concat(formItemLayout), className, _defineProperty({}, "".concat(clsPrefix, "-hidden"), hidden)),
|
|
53
|
-
style: style
|
|
54
|
-
}, label && /*#__PURE__*/React.createElement(FormItemLabel, {
|
|
55
|
-
className: classNames("".concat(clsPrefix, "-label"), "".concat(clsPrefix, "-label-").concat(formItemAlign)),
|
|
56
|
-
style: {
|
|
57
|
-
width: formItemLabelWidth
|
|
58
|
-
},
|
|
59
|
-
label: label,
|
|
60
|
-
required: required
|
|
61
|
-
}), /*#__PURE__*/React.createElement(FormItemInput, _extends({
|
|
62
|
-
className: "".concat(clsPrefix, "-input")
|
|
63
|
-
}, props, {
|
|
64
|
-
name: name,
|
|
65
|
-
rules: rules,
|
|
66
|
-
errorRender: errorRender,
|
|
67
|
-
initialValue: initialValue,
|
|
68
|
-
hiddenError: hiddenError
|
|
69
|
-
}), children));
|
|
70
|
-
};
|
package/dist/Form/style.scss
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
$cls-prefix-form: 'triones-antm-form';
|
|
2
|
-
$cls-prefix-form-item: 'triones-antm-form-item';
|
|
3
|
-
|
|
4
|
-
.#{$cls-prefix-form}{
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.#{$cls-prefix-form-item}{
|
|
9
|
-
&-label{
|
|
10
|
-
font-size: 14Px;
|
|
11
|
-
//line-height: 1.5;
|
|
12
|
-
color: #6F6F6F;
|
|
13
|
-
&-left{}
|
|
14
|
-
&-right{
|
|
15
|
-
text-align: right;
|
|
16
|
-
}
|
|
17
|
-
&-required-mark{
|
|
18
|
-
display: inline-block;
|
|
19
|
-
color: red;
|
|
20
|
-
margin-right: 4Px;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
&-input{
|
|
24
|
-
.#{$cls-prefix-form-item}{
|
|
25
|
-
&-error{
|
|
26
|
-
font-size: 12Px;
|
|
27
|
-
color: red;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
&-horizontal{
|
|
32
|
-
display: flex;
|
|
33
|
-
.#{$cls-prefix-form-item}{
|
|
34
|
-
&-label{
|
|
35
|
-
padding: 4Px;
|
|
36
|
-
}
|
|
37
|
-
&-input{
|
|
38
|
-
flex: auto 1;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
&-hidden{
|
|
43
|
-
display: none;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export type BaseInputProps = {
|
|
3
|
-
className?: string;
|
|
4
|
-
style?: React.CSSProperties;
|
|
5
|
-
placeholder?: string;
|
|
6
|
-
type?: 'text' | 'password' | 'textarea';
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
value?: any;
|
|
9
|
-
onChange?: (e: any) => void;
|
|
10
|
-
};
|
|
11
|
-
export interface BaseInputHandle {
|
|
12
|
-
clear?: () => void;
|
|
13
|
-
}
|
|
14
|
-
export declare const BaseInput: React.ForwardRefExoticComponent<BaseInputProps & React.RefAttributes<BaseInputHandle>>;
|
package/dist/Input/base-input.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
var _excluded = ["className", "style", "placeholder", "type", "value", "onChange"];
|
|
2
|
-
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); }
|
|
3
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
7
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
8
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
9
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
|
-
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; }
|
|
11
|
-
import classNames from 'classnames';
|
|
12
|
-
import React, { forwardRef, useEffect, useImperativeHandle, useState } from 'react';
|
|
13
|
-
export var BaseInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
14
|
-
var className = _ref.className,
|
|
15
|
-
style = _ref.style,
|
|
16
|
-
placeholder = _ref.placeholder,
|
|
17
|
-
type = _ref.type,
|
|
18
|
-
value = _ref.value,
|
|
19
|
-
_onChange = _ref.onChange,
|
|
20
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
-
var _useState = useState(0),
|
|
22
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
23
|
-
keySequence = _useState2[0],
|
|
24
|
-
setKeySequence = _useState2[1];
|
|
25
|
-
var _useState3 = useState(value || ''),
|
|
26
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
27
|
-
innerValue = _useState4[0],
|
|
28
|
-
setInnerValue = _useState4[1];
|
|
29
|
-
useImperativeHandle(ref, function () {
|
|
30
|
-
return {
|
|
31
|
-
clear: function clear() {
|
|
32
|
-
setInnerValue('');
|
|
33
|
-
_onChange === null || _onChange === void 0 || _onChange('');
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
});
|
|
37
|
-
var cls = 'triones-antm-input';
|
|
38
|
-
useEffect(function () {
|
|
39
|
-
setKeySequence(keySequence + 1);
|
|
40
|
-
}, [type]);
|
|
41
|
-
useEffect(function () {
|
|
42
|
-
if (value === undefined) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
if (value === innerValue) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
setInnerValue(value);
|
|
49
|
-
}, [value]);
|
|
50
|
-
return /*#__PURE__*/React.createElement("input", _extends({
|
|
51
|
-
key: keySequence
|
|
52
|
-
}, props, {
|
|
53
|
-
className: classNames(["".concat(cls), className]),
|
|
54
|
-
style: style,
|
|
55
|
-
placeholder: placeholder,
|
|
56
|
-
type: type,
|
|
57
|
-
value: innerValue,
|
|
58
|
-
onChange: function onChange(e) {
|
|
59
|
-
setInnerValue(e.target.value);
|
|
60
|
-
_onChange === null || _onChange === void 0 || _onChange(e);
|
|
61
|
-
}
|
|
62
|
-
}));
|
|
63
|
-
});
|
package/dist/Input/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { InputProps, Input as InternalInput } from './input';
|
|
2
|
-
import { InputOPT, InputOPTProps } from './input-opt';
|
|
3
|
-
import { InputPassword, InputPasswordProps } from './input-password';
|
|
4
|
-
import { InputTextareaProps, Textarea } from './textarea';
|
|
5
|
-
type CompoundedComponent = typeof InternalInput & {
|
|
6
|
-
Password: typeof InputPassword;
|
|
7
|
-
TextArea: typeof Textarea;
|
|
8
|
-
OPT: typeof InputOPT;
|
|
9
|
-
};
|
|
10
|
-
declare const Input: CompoundedComponent;
|
|
11
|
-
export type { InputOPTProps, InputPasswordProps, InputProps, InputTextareaProps, };
|
|
12
|
-
export default Input;
|
package/dist/Input/index.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Input as InternalInput } from "./input";
|
|
2
|
-
import { InputOPT } from "./input-opt";
|
|
3
|
-
import { InputPassword } from "./input-password";
|
|
4
|
-
import { Textarea } from "./textarea";
|
|
5
|
-
var Input = InternalInput;
|
|
6
|
-
Input.Password = InputPassword;
|
|
7
|
-
Input.OPT = InputOPT;
|
|
8
|
-
Input.TextArea = Textarea;
|
|
9
|
-
export default Input;
|