dtable-ui-component 6.0.24-beta1 → 6.0.25
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/lib/ActionSheet/index.js +194 -0
- package/lib/ActionSheet/style/index.css +365 -0
- package/lib/ActivityIndicator/index.css +108 -0
- package/lib/ActivityIndicator/index.js +76 -0
- package/lib/Badge/index.css +96 -0
- package/lib/Badge/index.js +65 -0
- package/lib/DateEditor/mb-date-editor-popover/index.js +3 -3
- package/lib/DatePicker/index.js +120 -0
- package/lib/DatePicker/locale/en_US.js +14 -0
- package/lib/DatePicker/locale/ru_RU.js +14 -0
- package/lib/DatePicker/locale/sv_SE.js +14 -0
- package/lib/DatePicker/locale/zh_CN.js +14 -0
- package/lib/DatePicker/style/index.css +290 -0
- package/lib/DatePicker/utils.js +36 -0
- package/lib/Drawer/index.css +142 -0
- package/lib/Drawer/index.js +21 -0
- package/lib/Icon/index.css +50 -0
- package/lib/Icon/index.js +34 -0
- package/lib/Icon/load-sprite.js +56 -0
- package/lib/InputItem/custom-input.js +321 -0
- package/lib/InputItem/custom-keyboard.js +162 -0
- package/lib/InputItem/index.js +388 -0
- package/lib/InputItem/input.js +45 -0
- package/lib/InputItem/locale/en_US.js +12 -0
- package/lib/InputItem/locale/ru_RU.js +12 -0
- package/lib/InputItem/locale/sv_SE.js +12 -0
- package/lib/InputItem/locale/zh_CN.js +12 -0
- package/lib/InputItem/portal.js +23 -0
- package/lib/InputItem/style/index.css +512 -0
- package/lib/List/index.css +381 -0
- package/lib/List/index.js +41 -0
- package/lib/List/list-item.js +169 -0
- package/lib/Modal/alert.js +82 -0
- package/lib/Modal/index.js +15 -0
- package/lib/Modal/modal.js +118 -0
- package/lib/Modal/operation.js +77 -0
- package/lib/Modal/prompt.js +207 -0
- package/lib/Picker/AbstractPicker.js +190 -0
- package/lib/Picker/index.js +28 -0
- package/lib/Picker/locale/en_US.js +12 -0
- package/lib/Picker/locale/ru_RU.js +12 -0
- package/lib/Picker/locale/sv_SE.js +12 -0
- package/lib/Picker/locale/zh_CN.js +12 -0
- package/lib/Picker/popupProps.js +12 -0
- package/lib/Picker/style/index.css +141 -0
- package/lib/Popover/index.js +62 -0
- package/lib/Popover/item.js +55 -0
- package/lib/Popover/style/index.css +229 -0
- package/lib/Progress/index.css +22 -0
- package/lib/Progress/index.js +65 -0
- package/lib/Radio/Radio.js +47 -0
- package/lib/Radio/RadioItem.js +57 -0
- package/lib/Radio/index.css +90 -0
- package/lib/Radio/index.js +12 -0
- package/lib/TabBar/Tab.js +76 -0
- package/lib/TabBar/index.css +138 -0
- package/lib/TabBar/index.js +128 -0
- package/lib/Tabs/index.css +443 -0
- package/lib/Tabs/index.js +38 -0
- package/lib/TextareaItem/index.css +231 -0
- package/lib/TextareaItem/index.js +231 -0
- package/lib/Toast/index.css +65 -0
- package/lib/Toast/index.js +131 -0
- package/lib/_util/class.js +34 -0
- package/lib/_util/closest.js +17 -0
- package/lib/_util/exenv.js +8 -0
- package/lib/_util/getDataAttr.js +15 -0
- package/lib/_util/getLocale.js +42 -0
- package/lib/index.js +103 -5
- package/lib/utils/utils.js +2 -3
- package/package.json +12 -3
- package/lib/BodyPortal/index.js +0 -29
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
.am-picker-popup {
|
|
2
|
+
left: 0;
|
|
3
|
+
bottom: 0;
|
|
4
|
+
position: fixed;
|
|
5
|
+
width: 100%;
|
|
6
|
+
background-color: #fff;
|
|
7
|
+
padding-bottom: env(safe-area-inset-bottom);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.am-picker-popup-wrap {
|
|
11
|
+
position: fixed;
|
|
12
|
+
overflow: auto;
|
|
13
|
+
top: 0;
|
|
14
|
+
right: 0;
|
|
15
|
+
bottom: 0;
|
|
16
|
+
left: 0;
|
|
17
|
+
z-index: 1000;
|
|
18
|
+
-webkit-overflow-scrolling: touch;
|
|
19
|
+
outline: 0;
|
|
20
|
+
-webkit-transform: translateZ(1px);
|
|
21
|
+
transform: translateZ(1px);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.am-picker-popup-mask {
|
|
25
|
+
position: fixed;
|
|
26
|
+
top: 0;
|
|
27
|
+
right: 0;
|
|
28
|
+
left: 0;
|
|
29
|
+
bottom: 0;
|
|
30
|
+
background-color: rgba(0, 0, 0, 0.4);
|
|
31
|
+
height: 100%;
|
|
32
|
+
z-index: 1000;
|
|
33
|
+
-webkit-transform: translateZ(1px);
|
|
34
|
+
transform: translateZ(1px);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.am-picker-popup-mask-hidden {
|
|
38
|
+
display: none;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.am-picker-popup-header {
|
|
42
|
+
background-image: -webkit-linear-gradient(top, #e7e7e7, #e7e7e7, transparent, transparent);
|
|
43
|
+
background-image: -webkit-gradient(linear, left top, left bottom, from(#e7e7e7), color-stop(#e7e7e7), color-stop(transparent), to(transparent));
|
|
44
|
+
background-image: linear-gradient(to bottom, #e7e7e7, #e7e7e7, transparent, transparent);
|
|
45
|
+
background-position: bottom;
|
|
46
|
+
background-size: 100% 1PX;
|
|
47
|
+
background-repeat: no-repeat;
|
|
48
|
+
display: -webkit-box;
|
|
49
|
+
display: -webkit-flex;
|
|
50
|
+
display: -ms-flexbox;
|
|
51
|
+
display: flex;
|
|
52
|
+
-webkit-box-align: center;
|
|
53
|
+
-webkit-align-items: center;
|
|
54
|
+
-ms-flex-align: center;
|
|
55
|
+
align-items: center;
|
|
56
|
+
position: relative;
|
|
57
|
+
border-bottom: 1PX solid #ddd;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
|
|
61
|
+
html:not([data-scale]) .am-picker-popup-header {
|
|
62
|
+
border-bottom: none;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
html:not([data-scale]) .am-picker-popup-header::after {
|
|
66
|
+
content: '';
|
|
67
|
+
position: absolute;
|
|
68
|
+
background-color: #ddd;
|
|
69
|
+
display: block;
|
|
70
|
+
z-index: 1;
|
|
71
|
+
top: auto;
|
|
72
|
+
right: auto;
|
|
73
|
+
bottom: 0;
|
|
74
|
+
left: 0;
|
|
75
|
+
width: 100%;
|
|
76
|
+
height: 1PX;
|
|
77
|
+
-webkit-transform-origin: 50% 100%;
|
|
78
|
+
-ms-transform-origin: 50% 100%;
|
|
79
|
+
transform-origin: 50% 100%;
|
|
80
|
+
-webkit-transform: scaleY(0.5);
|
|
81
|
+
-ms-transform: scaleY(0.5);
|
|
82
|
+
transform: scaleY(0.5);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@media (-webkit-min-device-pixel-ratio: 2) and (-webkit-min-device-pixel-ratio: 3), (min-resolution: 2dppx) and (min-resolution: 3dppx) {
|
|
87
|
+
html:not([data-scale]) .am-picker-popup-header::after {
|
|
88
|
+
-webkit-transform: scaleY(0.33);
|
|
89
|
+
-ms-transform: scaleY(0.33);
|
|
90
|
+
transform: scaleY(0.33);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.am-picker-popup-header .am-picker-popup-header-right {
|
|
95
|
+
text-align: right;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.am-picker-popup-item {
|
|
99
|
+
color: #108ee9;
|
|
100
|
+
font-size: 17px;
|
|
101
|
+
padding: 9px 15px;
|
|
102
|
+
height: 42px;
|
|
103
|
+
-webkit-box-sizing: border-box;
|
|
104
|
+
box-sizing: border-box;
|
|
105
|
+
display: -webkit-box;
|
|
106
|
+
display: -webkit-flex;
|
|
107
|
+
display: -ms-flexbox;
|
|
108
|
+
display: flex;
|
|
109
|
+
-webkit-box-align: center;
|
|
110
|
+
-webkit-align-items: center;
|
|
111
|
+
-ms-flex-align: center;
|
|
112
|
+
align-items: center;
|
|
113
|
+
-webkit-box-pack: center;
|
|
114
|
+
-webkit-justify-content: center;
|
|
115
|
+
-ms-flex-pack: center;
|
|
116
|
+
justify-content: center;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.am-picker-popup-item-active {
|
|
120
|
+
background-color: #ddd;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.am-picker-popup-title {
|
|
124
|
+
-webkit-box-flex: 1;
|
|
125
|
+
-webkit-flex: 1;
|
|
126
|
+
-ms-flex: 1;
|
|
127
|
+
flex: 1;
|
|
128
|
+
text-align: center;
|
|
129
|
+
color: #000;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.am-picker-popup .am-picker-popup-close {
|
|
133
|
+
display: none;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.am-picker-col {
|
|
137
|
+
-webkit-box-flex: 1;
|
|
138
|
+
-webkit-flex: 1;
|
|
139
|
+
-ms-flex: 1;
|
|
140
|
+
flex: 1;
|
|
141
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _rmcTooltip = _interopRequireDefault(require("rmc-tooltip"));
|
|
11
|
+
var _item = _interopRequireDefault(require("./item"));
|
|
12
|
+
function recursiveCloneChildren(children) {
|
|
13
|
+
let cb = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (ch, _) => ch;
|
|
14
|
+
return React.Children.map(children, (child, index) => {
|
|
15
|
+
const newChild = cb(child, index);
|
|
16
|
+
if (typeof newChild !== 'string' && typeof newChild !== 'number' && newChild && newChild.props && newChild.props.children) {
|
|
17
|
+
return /*#__PURE__*/React.cloneElement(newChild, {}, recursiveCloneChildren(newChild.props.children, cb));
|
|
18
|
+
}
|
|
19
|
+
return newChild;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
class Popover extends React.Component {
|
|
23
|
+
render() {
|
|
24
|
+
const {
|
|
25
|
+
overlay,
|
|
26
|
+
onSelect = () => {},
|
|
27
|
+
...restProps
|
|
28
|
+
} = this.props;
|
|
29
|
+
const overlayNode = recursiveCloneChildren(overlay, (child, index) => {
|
|
30
|
+
const extraProps = {
|
|
31
|
+
firstItem: false
|
|
32
|
+
};
|
|
33
|
+
if (child && typeof child !== 'string' && typeof child !== 'number' && child.type &&
|
|
34
|
+
// Fixme: not sure where the `myName` came from.
|
|
35
|
+
child.type.myName === 'PopoverItem' && !child.props.disabled) {
|
|
36
|
+
extraProps.onClick = () => onSelect(child, index);
|
|
37
|
+
extraProps.firstItem = index === 0;
|
|
38
|
+
return /*#__PURE__*/React.cloneElement(child, extraProps);
|
|
39
|
+
}
|
|
40
|
+
return child;
|
|
41
|
+
});
|
|
42
|
+
const wrapperNode = /*#__PURE__*/React.createElement("div", {
|
|
43
|
+
className: "".concat(this.props.prefixCls, "-inner-wrapper")
|
|
44
|
+
}, overlayNode);
|
|
45
|
+
return /*#__PURE__*/React.createElement(_rmcTooltip.default, Object.assign({}, restProps, {
|
|
46
|
+
overlay: wrapperNode
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.default = Popover;
|
|
51
|
+
Popover.defaultProps = {
|
|
52
|
+
prefixCls: 'am-popover',
|
|
53
|
+
placement: 'bottomRight',
|
|
54
|
+
align: {
|
|
55
|
+
overflow: {
|
|
56
|
+
adjustY: 0,
|
|
57
|
+
adjustX: 0
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
trigger: ['click']
|
|
61
|
+
};
|
|
62
|
+
Popover.Item = _item.default;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _rmcFeedback = _interopRequireDefault(require("rmc-feedback"));
|
|
12
|
+
class Item extends React.Component {
|
|
13
|
+
render() {
|
|
14
|
+
const {
|
|
15
|
+
children,
|
|
16
|
+
className,
|
|
17
|
+
prefixCls,
|
|
18
|
+
icon,
|
|
19
|
+
disabled,
|
|
20
|
+
firstItem,
|
|
21
|
+
activeStyle,
|
|
22
|
+
...restProps
|
|
23
|
+
} = this.props;
|
|
24
|
+
const cls = (0, _classnames.default)("".concat(prefixCls, "-item"), className, {
|
|
25
|
+
["".concat(prefixCls, "-item-disabled")]: disabled
|
|
26
|
+
});
|
|
27
|
+
let activeClass = "".concat(prefixCls, "-item-active ");
|
|
28
|
+
if (firstItem) {
|
|
29
|
+
activeClass += "".concat(prefixCls, "-item-fix-active-arrow");
|
|
30
|
+
}
|
|
31
|
+
return /*#__PURE__*/React.createElement(_rmcFeedback.default, {
|
|
32
|
+
disabled: disabled,
|
|
33
|
+
activeClassName: activeClass,
|
|
34
|
+
activeStyle: activeStyle
|
|
35
|
+
}, /*#__PURE__*/React.createElement("div", Object.assign({
|
|
36
|
+
className: cls
|
|
37
|
+
}, restProps), /*#__PURE__*/React.createElement("div", {
|
|
38
|
+
className: "".concat(prefixCls, "-item-container")
|
|
39
|
+
}, icon ?
|
|
40
|
+
/*#__PURE__*/
|
|
41
|
+
// tslint:disable-next-line:jsx-no-multiline-js
|
|
42
|
+
React.createElement("span", {
|
|
43
|
+
className: "".concat(prefixCls, "-item-icon"),
|
|
44
|
+
"aria-hidden": "true"
|
|
45
|
+
}, icon) : null, /*#__PURE__*/React.createElement("span", {
|
|
46
|
+
className: "".concat(prefixCls, "-item-content")
|
|
47
|
+
}, children))));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.default = Item;
|
|
51
|
+
Item.defaultProps = {
|
|
52
|
+
prefixCls: 'am-popover',
|
|
53
|
+
disabled: false
|
|
54
|
+
};
|
|
55
|
+
Item.myName = 'PopoverItem';
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
.am-popover {
|
|
2
|
+
position: absolute;
|
|
3
|
+
z-index: 1999;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.am-popover-hidden {
|
|
7
|
+
display: none;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.am-popover-mask {
|
|
11
|
+
position: fixed;
|
|
12
|
+
top: 0;
|
|
13
|
+
right: 0;
|
|
14
|
+
left: 0;
|
|
15
|
+
bottom: 0;
|
|
16
|
+
background-color: rgba(0, 0, 0, 0.4);
|
|
17
|
+
height: 100%;
|
|
18
|
+
z-index: 999;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.am-popover-mask-hidden {
|
|
22
|
+
display: none;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.am-popover-arrow {
|
|
26
|
+
position: absolute;
|
|
27
|
+
width: 7px;
|
|
28
|
+
height: 7px;
|
|
29
|
+
border-radius: 1PX;
|
|
30
|
+
background-color: #fff;
|
|
31
|
+
-webkit-transform: rotate(45deg);
|
|
32
|
+
-ms-transform: rotate(45deg);
|
|
33
|
+
transform: rotate(45deg);
|
|
34
|
+
z-index: 0;
|
|
35
|
+
-webkit-box-shadow: 0 0 2px rgba(0, 0, 0, 0.21);
|
|
36
|
+
box-shadow: 0 0 2px rgba(0, 0, 0, 0.21);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.am-popover-placement-top .am-popover-arrow,
|
|
40
|
+
.am-popover-placement-topLeft .am-popover-arrow,
|
|
41
|
+
.am-popover-placement-topRight .am-popover-arrow {
|
|
42
|
+
-webkit-transform: rotate(225deg);
|
|
43
|
+
-ms-transform: rotate(225deg);
|
|
44
|
+
transform: rotate(225deg);
|
|
45
|
+
bottom: -3.5px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.am-popover-placement-top .am-popover-arrow {
|
|
49
|
+
left: 50%;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.am-popover-placement-topLeft .am-popover-arrow {
|
|
53
|
+
left: 8px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.am-popover-placement-topRight .am-popover-arrow {
|
|
57
|
+
right: 8px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.am-popover-placement-right .am-popover-arrow,
|
|
61
|
+
.am-popover-placement-rightTop .am-popover-arrow,
|
|
62
|
+
.am-popover-placement-rightBottom .am-popover-arrow {
|
|
63
|
+
-webkit-transform: rotate(-45deg);
|
|
64
|
+
-ms-transform: rotate(-45deg);
|
|
65
|
+
transform: rotate(-45deg);
|
|
66
|
+
left: -3.5px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.am-popover-placement-right .am-popover-arrow {
|
|
70
|
+
top: 50%;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.am-popover-placement-rightTop .am-popover-arrow {
|
|
74
|
+
top: 8px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.am-popover-placement-rightBottom .am-popover-arrow {
|
|
78
|
+
bottom: 8px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.am-popover-placement-left .am-popover-arrow,
|
|
82
|
+
.am-popover-placement-leftTop .am-popover-arrow,
|
|
83
|
+
.am-popover-placement-leftBottom .am-popover-arrow {
|
|
84
|
+
-webkit-transform: rotate(135deg);
|
|
85
|
+
-ms-transform: rotate(135deg);
|
|
86
|
+
transform: rotate(135deg);
|
|
87
|
+
right: -3.5px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.am-popover-placement-left .am-popover-arrow {
|
|
91
|
+
top: 50%;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.am-popover-placement-leftTop .am-popover-arrow {
|
|
95
|
+
top: 8px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.am-popover-placement-leftBottom .am-popover-arrow {
|
|
99
|
+
bottom: 8px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.am-popover-placement-bottom .am-popover-arrow,
|
|
103
|
+
.am-popover-placement-bottomLeft .am-popover-arrow,
|
|
104
|
+
.am-popover-placement-bottomRight .am-popover-arrow {
|
|
105
|
+
top: -3.5px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.am-popover-placement-bottom .am-popover-arrow {
|
|
109
|
+
left: 50%;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.am-popover-placement-bottomLeft .am-popover-arrow {
|
|
113
|
+
left: 8px;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.am-popover-placement-bottomRight .am-popover-arrow {
|
|
117
|
+
right: 8px;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.am-popover-inner {
|
|
121
|
+
font-size: 15px;
|
|
122
|
+
color: #000;
|
|
123
|
+
background-color: #fff;
|
|
124
|
+
border-radius: 3px;
|
|
125
|
+
-webkit-box-shadow: 0 0 2px rgba(0, 0, 0, 0.21);
|
|
126
|
+
box-shadow: 0 0 2px rgba(0, 0, 0, 0.21);
|
|
127
|
+
overflow: hidden;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.am-popover-inner-wrapper {
|
|
131
|
+
position: relative;
|
|
132
|
+
background-color: #fff;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.am-popover .am-popover-item {
|
|
136
|
+
padding: 0 8px;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.am-popover .am-popover-item-container {
|
|
140
|
+
position: relative;
|
|
141
|
+
display: -webkit-box;
|
|
142
|
+
display: -webkit-flex;
|
|
143
|
+
display: -ms-flexbox;
|
|
144
|
+
display: flex;
|
|
145
|
+
-webkit-box-align: center;
|
|
146
|
+
-webkit-align-items: center;
|
|
147
|
+
-ms-flex-align: center;
|
|
148
|
+
align-items: center;
|
|
149
|
+
height: 39px;
|
|
150
|
+
-webkit-box-sizing: border-box;
|
|
151
|
+
box-sizing: border-box;
|
|
152
|
+
padding: 0 8px;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.am-popover .am-popover-item:not(:first-child) .am-popover-item-container {
|
|
156
|
+
border-top: 1PX solid #ddd;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
|
|
160
|
+
html:not([data-scale]) .am-popover .am-popover-item:not(:first-child) .am-popover-item-container {
|
|
161
|
+
border-top: none;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
html:not([data-scale]) .am-popover .am-popover-item:not(:first-child) .am-popover-item-container::before {
|
|
165
|
+
content: '';
|
|
166
|
+
position: absolute;
|
|
167
|
+
background-color: #ddd;
|
|
168
|
+
display: block;
|
|
169
|
+
z-index: 1;
|
|
170
|
+
top: 0;
|
|
171
|
+
right: auto;
|
|
172
|
+
bottom: auto;
|
|
173
|
+
left: 0;
|
|
174
|
+
width: 100%;
|
|
175
|
+
height: 1PX;
|
|
176
|
+
-webkit-transform-origin: 50% 50%;
|
|
177
|
+
-ms-transform-origin: 50% 50%;
|
|
178
|
+
transform-origin: 50% 50%;
|
|
179
|
+
-webkit-transform: scaleY(0.5);
|
|
180
|
+
-ms-transform: scaleY(0.5);
|
|
181
|
+
transform: scaleY(0.5);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
@media (-webkit-min-device-pixel-ratio: 2) and (-webkit-min-device-pixel-ratio: 3), (min-resolution: 2dppx) and (min-resolution: 3dppx) {
|
|
186
|
+
html:not([data-scale]) .am-popover .am-popover-item:not(:first-child) .am-popover-item-container::before {
|
|
187
|
+
-webkit-transform: scaleY(0.33);
|
|
188
|
+
-ms-transform: scaleY(0.33);
|
|
189
|
+
transform: scaleY(0.33);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.am-popover .am-popover-item.am-popover-item-active .am-popover-item-container {
|
|
194
|
+
border-top: 0;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.am-popover .am-popover-item.am-popover-item-active .am-popover-item-container:before {
|
|
198
|
+
display: none !important;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.am-popover .am-popover-item.am-popover-item-active+.am-popover-item .am-popover-item-container {
|
|
202
|
+
border-top: 0;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.am-popover .am-popover-item.am-popover-item-active+.am-popover-item .am-popover-item-container:before {
|
|
206
|
+
display: none !important;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.am-popover .am-popover-item.am-popover-item-active {
|
|
210
|
+
background-color: #ddd;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.am-popover .am-popover-item.am-popover-item-active.am-popover-item-fix-active-arrow {
|
|
214
|
+
position: relative;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.am-popover .am-popover-item.am-popover-item-disabled {
|
|
218
|
+
color: #bbb;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.am-popover .am-popover-item.am-popover-item-disabled.am-popover-item-active {
|
|
222
|
+
background-color: transparent;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.am-popover .am-popover-item-icon {
|
|
226
|
+
margin-right: 8px;
|
|
227
|
+
width: 18px;
|
|
228
|
+
height: 18px;
|
|
229
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.am-progress-outer {
|
|
2
|
+
background-color: #ddd;
|
|
3
|
+
display: block;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.am-progress-fixed-outer {
|
|
7
|
+
position: fixed;
|
|
8
|
+
width: 100%;
|
|
9
|
+
top: 0;
|
|
10
|
+
left: 0;
|
|
11
|
+
z-index: 2000;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.am-progress-hide-outer {
|
|
15
|
+
background-color: transparent;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.am-progress-bar {
|
|
19
|
+
border: 2px solid #108ee9;
|
|
20
|
+
-webkit-transition: all .3s linear 0s;
|
|
21
|
+
transition: all .3s linear 0s;
|
|
22
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
class Progress extends React.Component {
|
|
12
|
+
componentWillReceiveProps() {
|
|
13
|
+
this.noAppearTransition = true;
|
|
14
|
+
}
|
|
15
|
+
componentDidMount() {
|
|
16
|
+
if (this.props.appearTransition) {
|
|
17
|
+
setTimeout(() => {
|
|
18
|
+
if (this.barRef) {
|
|
19
|
+
this.barRef.style.width = "".concat(this.props.percent, "%");
|
|
20
|
+
}
|
|
21
|
+
}, 10);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
render() {
|
|
25
|
+
const {
|
|
26
|
+
className,
|
|
27
|
+
prefixCls,
|
|
28
|
+
position,
|
|
29
|
+
unfilled,
|
|
30
|
+
style = {},
|
|
31
|
+
barStyle = {}
|
|
32
|
+
} = this.props;
|
|
33
|
+
const percentStyle = {
|
|
34
|
+
width: this.noAppearTransition || !this.props.appearTransition ? "".concat(this.props.percent, "%") : 0,
|
|
35
|
+
height: 0
|
|
36
|
+
};
|
|
37
|
+
const wrapCls = (0, _classnames.default)("".concat(prefixCls, "-outer"), className, {
|
|
38
|
+
["".concat(prefixCls, "-fixed-outer")]: position === 'fixed',
|
|
39
|
+
["".concat(prefixCls, "-hide-outer")]: !unfilled
|
|
40
|
+
});
|
|
41
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
style: style,
|
|
43
|
+
className: wrapCls,
|
|
44
|
+
role: "progressbar",
|
|
45
|
+
"aria-valuenow": this.props.percent,
|
|
46
|
+
"aria-valuemin": 0,
|
|
47
|
+
"aria-valuemax": 100
|
|
48
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
49
|
+
ref: el => this.barRef = el,
|
|
50
|
+
className: "".concat(prefixCls, "-bar"),
|
|
51
|
+
style: {
|
|
52
|
+
...barStyle,
|
|
53
|
+
...percentStyle
|
|
54
|
+
}
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.default = Progress;
|
|
59
|
+
Progress.defaultProps = {
|
|
60
|
+
prefixCls: 'am-progress',
|
|
61
|
+
percent: 0,
|
|
62
|
+
position: 'fixed',
|
|
63
|
+
unfilled: true,
|
|
64
|
+
appearTransition: false
|
|
65
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
+
var _rcCheckbox = _interopRequireDefault(require("rc-checkbox"));
|
|
11
|
+
var React = _interopRequireWildcard(require("react"));
|
|
12
|
+
class Radio extends React.Component {
|
|
13
|
+
render() {
|
|
14
|
+
const {
|
|
15
|
+
className,
|
|
16
|
+
style,
|
|
17
|
+
...restProps
|
|
18
|
+
} = this.props;
|
|
19
|
+
const {
|
|
20
|
+
prefixCls,
|
|
21
|
+
children
|
|
22
|
+
} = restProps;
|
|
23
|
+
const wrapCls = (0, _classnames.default)("".concat(prefixCls, "-wrapper"), className);
|
|
24
|
+
if ('class' in restProps) {
|
|
25
|
+
// Todo https://github.com/developit/preact-compat/issues/422
|
|
26
|
+
/* tslint:disable:no-string-literal */
|
|
27
|
+
delete restProps['class'];
|
|
28
|
+
}
|
|
29
|
+
const mark = /*#__PURE__*/React.createElement("label", {
|
|
30
|
+
className: wrapCls,
|
|
31
|
+
style: style
|
|
32
|
+
}, /*#__PURE__*/React.createElement(_rcCheckbox.default, Object.assign({}, restProps, {
|
|
33
|
+
type: "radio"
|
|
34
|
+
})), children);
|
|
35
|
+
if (this.props.wrapLabel) {
|
|
36
|
+
return mark;
|
|
37
|
+
}
|
|
38
|
+
return /*#__PURE__*/React.createElement(_rcCheckbox.default, Object.assign({}, this.props, {
|
|
39
|
+
type: "radio"
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.default = Radio;
|
|
44
|
+
Radio.defaultProps = {
|
|
45
|
+
prefixCls: 'am-radio',
|
|
46
|
+
wrapLabel: true
|
|
47
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _List = _interopRequireDefault(require("../List"));
|
|
12
|
+
var _Radio = _interopRequireDefault(require("./Radio"));
|
|
13
|
+
const ListItem = _List.default.Item;
|
|
14
|
+
function noop() {}
|
|
15
|
+
class RadioItem extends React.Component {
|
|
16
|
+
render() {
|
|
17
|
+
const {
|
|
18
|
+
listPrefixCls,
|
|
19
|
+
onChange,
|
|
20
|
+
disabled,
|
|
21
|
+
radioProps,
|
|
22
|
+
onClick,
|
|
23
|
+
...otherProps
|
|
24
|
+
} = this.props;
|
|
25
|
+
const {
|
|
26
|
+
prefixCls,
|
|
27
|
+
className,
|
|
28
|
+
children
|
|
29
|
+
} = otherProps;
|
|
30
|
+
const wrapCls = (0, _classnames.default)("".concat(prefixCls, "-item"), className, {
|
|
31
|
+
["".concat(prefixCls, "-item-disabled")]: disabled === true
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// Note: if not omit `onChange`, it will trigger twice on check listitem
|
|
35
|
+
|
|
36
|
+
if (!disabled) {
|
|
37
|
+
otherProps.onClick = onClick || noop;
|
|
38
|
+
}
|
|
39
|
+
const extraProps = {};
|
|
40
|
+
['name', 'defaultChecked', 'checked', 'onChange', 'disabled'].forEach(i => {
|
|
41
|
+
if (i in this.props) {
|
|
42
|
+
extraProps[i] = this.props[i];
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
return /*#__PURE__*/React.createElement(ListItem, Object.assign({}, otherProps, {
|
|
46
|
+
prefixCls: listPrefixCls,
|
|
47
|
+
className: wrapCls,
|
|
48
|
+
extra: /*#__PURE__*/React.createElement(_Radio.default, Object.assign({}, radioProps, extraProps))
|
|
49
|
+
}), children);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.default = RadioItem;
|
|
53
|
+
RadioItem.defaultProps = {
|
|
54
|
+
prefixCls: 'am-radio',
|
|
55
|
+
listPrefixCls: 'am-list',
|
|
56
|
+
radioProps: {}
|
|
57
|
+
};
|