@nutui/nutui-react 1.5.1 → 2.0.0-alpha.1
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 +24 -664
- package/dist/esm/ActionSheet.js +62 -54
- package/dist/esm/Address/style/index.js +0 -1
- package/dist/esm/Address.js +235 -330
- package/dist/esm/Animate.js +43 -32
- package/dist/esm/AnimatingNumbers.js +88 -49
- package/dist/esm/Audio/style/index.js +0 -1
- package/dist/esm/Audio.js +108 -121
- package/dist/esm/Avatar.js +65 -78
- package/dist/esm/AvatarContext.js +5 -0
- package/dist/esm/AvatarGroup.js +46 -27
- package/dist/esm/BackTop/style/index.js +1 -1
- package/dist/esm/BackTop.js +74 -76
- package/dist/esm/Badge.js +57 -54
- package/dist/esm/Barrage.js +45 -32
- package/dist/esm/Button/style/index.js +1 -1
- package/dist/esm/Button.js +66 -87
- package/dist/esm/Calendar.js +80 -79
- package/dist/esm/CalendarItem.js +199 -231
- package/dist/esm/Card.js +44 -37
- package/dist/esm/Cascader.js +431 -434
- package/dist/esm/Cell/style/index.js +1 -1
- package/dist/esm/Cell.js +57 -87
- package/dist/esm/CellGroup.js +7 -5
- package/dist/esm/Checkbox/style/index.js +0 -1
- package/dist/esm/Checkbox.js +11 -8
- package/dist/esm/CheckboxGroup.js +78 -71
- package/dist/esm/CircleProgress.js +50 -40
- package/dist/esm/Col.js +49 -43
- package/dist/esm/Collapse.js +44 -44
- package/dist/esm/CollapseItem/style/index.js +1 -1
- package/dist/esm/CollapseItem.js +64 -104
- package/dist/esm/ConfigProvider.js +400 -101
- package/dist/esm/CountDown.js +90 -95
- package/dist/esm/DatePicker.js +104 -123
- package/dist/esm/Dialog.js +98 -104
- package/dist/esm/Divider.js +36 -27
- package/dist/esm/Drag.js +55 -59
- package/dist/esm/Elevator.js +77 -88
- package/dist/esm/Ellipsis.js +80 -79
- package/dist/esm/Empty.js +50 -44
- package/dist/esm/FixedNav/style/index.js +0 -1
- package/dist/esm/FixedNav.js +57 -65
- package/dist/esm/Form.js +1154 -123
- package/dist/esm/FormItem.js +7 -5
- package/dist/esm/Grid/style/index.js +1 -1
- package/dist/esm/Grid.js +51 -55
- package/dist/esm/GridItem.js +7 -124
- package/dist/esm/Icon.js +83 -5
- package/dist/esm/Image.js +123 -122
- package/dist/esm/ImagePreview.js +76 -94
- package/dist/esm/Indicator.js +41 -36
- package/dist/esm/Infiniteloading/style/index.js +1 -1
- package/dist/esm/Infiniteloading.js +77 -93
- package/dist/esm/Input/style/index.js +1 -1
- package/dist/esm/Input.js +120 -172
- package/dist/esm/InputNumber/style/index.js +1 -1
- package/dist/esm/InputNumber.js +133 -167
- package/dist/esm/Layout.js +27 -6
- package/dist/esm/Menu.js +84 -86
- package/dist/esm/MenuItem/style/index.js +0 -1
- package/dist/esm/MenuItem.js +76 -86
- package/dist/esm/NavBar/style/index.js +1 -1
- package/dist/esm/NavBar.js +59 -63
- package/dist/esm/NoticeBar/style/index.js +1 -1
- package/dist/esm/NoticeBar.js +173 -290
- package/dist/esm/Notify.js +112 -78
- package/dist/esm/NumberKeyboard.js +110 -109
- package/dist/esm/Overlay.js +7 -6
- package/dist/esm/Pagination.js +94 -135
- package/dist/esm/Picker.js +149 -201
- package/dist/esm/Popover/style/index.js +0 -1
- package/dist/esm/Popover.js +121 -116
- package/dist/esm/Popup/style/index.js +0 -1
- package/dist/esm/Popup.js +114 -131
- package/dist/esm/Price.js +51 -39
- package/dist/esm/Progress/style/index.js +1 -1
- package/dist/esm/Progress.js +59 -64
- package/dist/esm/PullToRefresh.js +173 -149
- package/dist/esm/Radio/style/index.js +0 -1
- package/dist/esm/Radio.js +8 -6
- package/dist/esm/RadioGroup.js +64 -84
- package/dist/esm/Range.js +93 -122
- package/dist/esm/Rate/style/index.js +1 -1
- package/dist/esm/Rate.js +77 -95
- package/dist/esm/Row.js +49 -37
- package/dist/esm/SearchBar/style/index.js +1 -1
- package/dist/esm/SearchBar.js +110 -120
- package/dist/esm/ShortPassword/style/index.js +0 -1
- package/dist/esm/ShortPassword.js +120 -116
- package/dist/esm/SideNavBar.js +38 -28
- package/dist/esm/SideNavBarItem.js +31 -14
- package/dist/esm/Signature.js +65 -61
- package/dist/esm/Skeleton.js +48 -40
- package/dist/esm/Step/style/index.js +1 -1
- package/dist/esm/Step.js +49 -49
- package/dist/esm/Steps.js +37 -23
- package/dist/esm/Sticky.js +111 -120
- package/dist/esm/SubSideNavBar.js +50 -38
- package/dist/esm/Swipe.js +75 -63
- package/dist/esm/Swiper.js +171 -206
- package/dist/esm/SwiperItem.js +39 -22
- package/dist/esm/Switch.js +46 -37
- package/dist/esm/TabPane.js +8 -6
- package/dist/esm/Tabbar.js +47 -39
- package/dist/esm/TabbarItem/style/index.js +1 -1
- package/dist/esm/TabbarItem.js +50 -52
- package/dist/esm/Table/style/index.js +1 -1
- package/dist/esm/Table.js +70 -70
- package/dist/esm/Tabs/style/index.js +1 -2
- package/dist/esm/Tabs.js +11 -9
- package/dist/esm/Tag/style/index.js +1 -1
- package/dist/esm/Tag.js +69 -70
- package/dist/esm/TextArea.js +70 -64
- package/dist/esm/TimeDetail.js +47 -38
- package/dist/esm/TimePannel.js +35 -19
- package/dist/esm/TimeSelect.js +60 -68
- package/dist/esm/Toast/style/index.js +1 -1
- package/dist/esm/Toast.js +126 -98
- package/dist/esm/TrendArrow/style/index.js +1 -1
- package/dist/esm/TrendArrow.js +59 -55
- package/dist/esm/Uploader/style/index.js +0 -1
- package/dist/esm/Uploader.js +195 -246
- package/dist/esm/UserContext.js +5 -0
- package/dist/esm/UserContext2.js +5 -0
- package/dist/esm/UserContext3.js +5 -0
- package/dist/esm/Video.js +49 -39
- package/dist/esm/VirtualList.js +111 -146
- package/dist/esm/WaterMark.js +57 -60
- package/dist/esm/bem.js +10 -0
- package/dist/esm/cellgroup2.js +49 -0
- package/dist/esm/checkbox2.js +145 -0
- package/dist/esm/{date-c7aad4c0.js → date.js} +13 -11
- package/dist/esm/{formitem-8a73a5fb.js → formitem2.js} +83 -50
- package/dist/esm/get-scroll-parent.js +26 -0
- package/dist/esm/griditem2.js +96 -0
- package/dist/esm/index.js +14 -0
- package/dist/esm/nutui-react.es.js +188 -94
- package/dist/esm/offsetContext.js +19 -0
- package/dist/esm/overlay2.js +98 -0
- package/dist/esm/px-check.js +6 -0
- package/dist/esm/radio2.js +129 -0
- package/dist/esm/render.js +95 -0
- package/dist/esm/tabpane2.js +44 -0
- package/dist/esm/tabs2.js +175 -0
- package/dist/esm/typings.js +7 -0
- package/dist/esm/use-client-rect.js +32 -0
- package/dist/esm/use-props-value.js +18 -0
- package/dist/esm/use-touch.js +74 -0
- package/dist/locales/base.d.ts +2 -2
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +3 -3
- package/dist/locales/id-ID.js +3 -3
- package/dist/locales/zh-CN.js +3 -3
- package/dist/locales/zh-TW.js +3 -3
- package/dist/locales/zh-UG.js +3 -3
- package/dist/nutui.react.mjs +8389 -4901
- package/dist/nutui.react.umd.js +8390 -4902
- package/dist/packages/actionsheet/actionsheet.scss +10 -2
- package/dist/packages/audio/audio.scss +2 -15
- package/dist/packages/backtop/backtop.scss +0 -8
- package/dist/packages/badge/badge.scss +3 -4
- package/dist/packages/button/button.scss +80 -93
- package/dist/packages/calendar/calendar.scss +0 -30
- package/dist/packages/cell/cell.scss +18 -90
- package/dist/packages/cellgroup/cellgroup.scss +26 -20
- package/dist/packages/collapseitem/collapseitem.scss +0 -1
- package/dist/packages/dialog/dialog.scss +1 -1
- package/dist/packages/divider/divider.scss +3 -17
- package/dist/packages/grid/grid.scss +1 -0
- package/dist/packages/griditem/griditem.scss +2 -17
- package/dist/packages/icon/icon.scss +0 -132
- package/dist/packages/image/image.scss +0 -12
- package/dist/packages/indicator/indicator.scss +21 -39
- package/dist/packages/infiniteloading/infiniteloading.scss +4 -12
- package/dist/packages/input/input.scss +4 -0
- package/dist/packages/inputnumber/inputnumber.scss +10 -26
- package/dist/packages/menuitem/menuitem.scss +2 -0
- package/dist/packages/navbar/navbar.scss +4 -5
- package/dist/packages/overlay/overlay.scss +0 -19
- package/dist/packages/picker/picker.scss +97 -103
- package/dist/packages/popup/popup.scss +0 -16
- package/dist/packages/progress/progress.scss +0 -1
- package/dist/packages/radio/radio.scss +8 -0
- package/dist/packages/rate/rate.scss +29 -6
- package/dist/packages/row/row.scss +13 -31
- package/dist/packages/searchbar/searchbar.scss +0 -1
- package/dist/packages/shortpassword/shortpassword.scss +4 -1
- package/dist/packages/sidenavbar/sidenavbar.scss +0 -19
- package/dist/packages/step/step.scss +0 -1
- package/dist/packages/sticky/sticky.scss +1 -1
- package/dist/packages/swiper/swiper.scss +8 -0
- package/dist/packages/tabbaritem/tabbaritem.scss +0 -1
- package/dist/packages/table/table.scss +0 -1
- package/dist/packages/tag/tag.scss +9 -2
- package/dist/packages/timedetail/timedetail.scss +9 -3
- package/dist/packages/timeselect/timeselect.scss +1 -1
- package/dist/packages/toast/toast.scss +0 -1
- package/dist/packages/uploader/uploader.scss +2 -28
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/styles/font-jmapp/config.json +175 -0
- package/dist/styles/font-jmapp/demo.css +539 -0
- package/dist/styles/font-jmapp/demo_index.html +1821 -0
- package/dist/styles/font-jmapp/iconfont.css +299 -0
- package/dist/styles/font-jmapp/iconfont.eot +0 -0
- package/dist/styles/font-jmapp/iconfont.js +68 -0
- package/dist/styles/font-jmapp/iconfont.json +506 -0
- package/dist/styles/font-jmapp/iconfont.svg +356 -0
- package/dist/styles/font-jmapp/iconfont.ttf +0 -0
- package/dist/styles/font-jmapp/iconfont.woff +0 -0
- package/dist/styles/font-jmapp/iconfont.woff2 +0 -0
- package/dist/styles/theme-default.scss +1 -0
- package/dist/styles/theme-jmapp.scss +41 -0
- package/dist/styles/themes/default.scss +0 -1
- package/dist/styles/variables-jmapp.scss +2601 -0
- package/dist/styles/variables.scss +49 -73
- package/dist/types/index.d.ts +169 -266
- package/package.json +23 -154
- package/dist/esm/AvatarContext-15733596.js +0 -3
- package/dist/esm/Icon/style/index.js +0 -4
- package/dist/esm/UserContext-101ad4a4.js +0 -3
- package/dist/esm/UserContext-2629d479.js +0 -3
- package/dist/esm/UserContext-b33bcf21.js +0 -3
- package/dist/esm/bem-3b438e61.js +0 -8
- package/dist/esm/cellgroup-fcc72767.js +0 -34
- package/dist/esm/checkbox-44e13cd0.js +0 -137
- package/dist/esm/get-scroll-parent-5f85dee8.js +0 -24
- package/dist/esm/grid.context-2ee27d95.js +0 -6
- package/dist/esm/icon-4ef1581c.js +0 -70
- package/dist/esm/index-030b7245.js +0 -11
- package/dist/esm/offsetContext-3ab00d40.js +0 -16
- package/dist/esm/overlay-de6c79d5.js +0 -83
- package/dist/esm/radio-9f141e6b.js +0 -118
- package/dist/esm/render-bbebb760.js +0 -79
- package/dist/esm/tabpane-01075e6c.js +0 -29
- package/dist/esm/tabs-e1b4e4b1.js +0 -181
- package/dist/esm/typings-f27b58f4.js +0 -8
- package/dist/esm/useClientRect-56bb675b.js +0 -39
- package/dist/esm/useTouch-cf73a407.js +0 -99
package/dist/esm/Price.js
CHANGED
|
@@ -1,63 +1,73 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["price", "needSymbol", "symbol", "decimalDigits", "thousands", "position", "size", "className"];
|
|
4
|
-
function ownKeys(object, enumerableOnly) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
function ownKeys(object, enumerableOnly) {
|
|
5
|
+
var keys = Object.keys(object);
|
|
6
|
+
if (Object.getOwnPropertySymbols) {
|
|
7
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
8
|
+
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
9
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
10
|
+
})), keys.push.apply(keys, symbols);
|
|
11
|
+
}
|
|
12
|
+
return keys;
|
|
13
|
+
}
|
|
14
|
+
function _objectSpread(target) {
|
|
15
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
16
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
17
|
+
i % 2 ? ownKeys(Object(source), true).forEach(function(key) {
|
|
18
|
+
_defineProperty(target, key, source[key]);
|
|
19
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
20
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return target;
|
|
24
|
+
}
|
|
25
|
+
import React__default from "react";
|
|
26
|
+
import { c as cn } from "./bem.js";
|
|
27
|
+
import "@bem-react/classname";
|
|
9
28
|
var defaultProps = {
|
|
10
29
|
price: 0,
|
|
11
30
|
needSymbol: true,
|
|
12
|
-
symbol:
|
|
31
|
+
symbol: "¥",
|
|
13
32
|
decimalDigits: 2,
|
|
14
33
|
thousands: false,
|
|
15
|
-
position:
|
|
16
|
-
size:
|
|
17
|
-
className:
|
|
34
|
+
position: "before",
|
|
35
|
+
size: "large",
|
|
36
|
+
className: ""
|
|
18
37
|
};
|
|
19
|
-
var Price = function
|
|
20
|
-
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
symbol = _defaultProps$props.symbol,
|
|
24
|
-
decimalDigits = _defaultProps$props.decimalDigits,
|
|
25
|
-
thousands = _defaultProps$props.thousands,
|
|
26
|
-
position = _defaultProps$props.position,
|
|
27
|
-
size = _defaultProps$props.size,
|
|
28
|
-
className = _defaultProps$props.className,
|
|
29
|
-
rest = _objectWithoutProperties(_defaultProps$props, _excluded);
|
|
30
|
-
var b = cn('price');
|
|
31
|
-
var showSymbol = function showSymbol() {
|
|
38
|
+
var Price = function Price2(props) {
|
|
39
|
+
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props), price = _defaultProps$props.price, needSymbol = _defaultProps$props.needSymbol, symbol = _defaultProps$props.symbol, decimalDigits = _defaultProps$props.decimalDigits, thousands = _defaultProps$props.thousands, position = _defaultProps$props.position, size = _defaultProps$props.size, className = _defaultProps$props.className, rest = _objectWithoutProperties(_defaultProps$props, _excluded);
|
|
40
|
+
var b = cn("price");
|
|
41
|
+
var showSymbol = function showSymbol2() {
|
|
32
42
|
return {
|
|
33
|
-
__html: needSymbol ? symbol :
|
|
43
|
+
__html: needSymbol ? symbol : ""
|
|
34
44
|
};
|
|
35
45
|
};
|
|
36
|
-
var checkPoint = function
|
|
37
|
-
return String(
|
|
46
|
+
var checkPoint = function checkPoint2(price2) {
|
|
47
|
+
return String(price2).indexOf(".") > 0;
|
|
38
48
|
};
|
|
39
|
-
var formatThousands = function
|
|
49
|
+
var formatThousands = function formatThousands2(num) {
|
|
40
50
|
if (Number(num) === 0) {
|
|
41
51
|
num = 0;
|
|
42
52
|
}
|
|
43
53
|
if (checkPoint(num)) {
|
|
44
54
|
num = Number(num).toFixed(decimalDigits);
|
|
45
|
-
num = typeof num.split(
|
|
55
|
+
num = typeof num.split(".") === "string" ? num.split(".") : num.split(".")[0];
|
|
46
56
|
} else {
|
|
47
57
|
num = num.toString();
|
|
48
58
|
}
|
|
49
59
|
if (thousands) {
|
|
50
|
-
return (num || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g,
|
|
60
|
+
return (num || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, "$1,");
|
|
51
61
|
}
|
|
52
62
|
return num;
|
|
53
63
|
};
|
|
54
|
-
var formatDecimal = function
|
|
64
|
+
var formatDecimal = function formatDecimal2(decimalNum) {
|
|
55
65
|
if (Number(decimalNum) === 0) {
|
|
56
66
|
decimalNum = 0;
|
|
57
67
|
}
|
|
58
68
|
if (checkPoint(decimalNum)) {
|
|
59
69
|
decimalNum = Number(decimalNum).toFixed(decimalDigits);
|
|
60
|
-
decimalNum = typeof decimalNum.split(
|
|
70
|
+
decimalNum = typeof decimalNum.split(".") === "string" ? 0 : decimalNum.split(".")[1] || 0;
|
|
61
71
|
} else {
|
|
62
72
|
decimalNum = 0;
|
|
63
73
|
}
|
|
@@ -65,22 +75,24 @@ var Price = function Price(props) {
|
|
|
65
75
|
var resultFixed = Number(result).toFixed(decimalDigits);
|
|
66
76
|
return String(resultFixed).substring(2, resultFixed.length);
|
|
67
77
|
};
|
|
68
|
-
var renderSymbol = function
|
|
78
|
+
var renderSymbol = function renderSymbol2() {
|
|
69
79
|
return React__default.createElement("div", {
|
|
70
|
-
className: "".concat(b(
|
|
80
|
+
className: "".concat(b("symbol"), " ").concat(b("symbol-".concat(size))),
|
|
71
81
|
dangerouslySetInnerHTML: showSymbol()
|
|
72
82
|
});
|
|
73
83
|
};
|
|
74
84
|
return React__default.createElement("div", _objectSpread({
|
|
75
85
|
className: "".concat(b(), " ").concat(className)
|
|
76
|
-
}, rest), needSymbol && position ===
|
|
77
|
-
className: "".concat(b(
|
|
86
|
+
}, rest), needSymbol && position === "before" ? renderSymbol() : null, React__default.createElement("div", {
|
|
87
|
+
className: "".concat(b("integer"), " ").concat(b("integer-".concat(size)))
|
|
78
88
|
}, formatThousands(price)), decimalDigits !== 0 ? React__default.createElement("div", {
|
|
79
|
-
className: "".concat(b(
|
|
89
|
+
className: "".concat(b("decimal"), " ").concat(b("decimal-".concat(size)))
|
|
80
90
|
}, ".") : null, React__default.createElement("div", {
|
|
81
|
-
className: "".concat(b(
|
|
82
|
-
}, formatDecimal(price)), needSymbol && position ===
|
|
91
|
+
className: "".concat(b("decimal"), " ").concat(b("decimal-".concat(size)))
|
|
92
|
+
}, formatDecimal(price)), needSymbol && position === "after" ? renderSymbol() : null);
|
|
83
93
|
};
|
|
84
94
|
Price.defaultProps = defaultProps;
|
|
85
|
-
Price.displayName =
|
|
86
|
-
export {
|
|
95
|
+
Price.displayName = "NutPrice";
|
|
96
|
+
export {
|
|
97
|
+
Price as default
|
|
98
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
import '../../../packages/progress/progress.scss'
|
package/dist/esm/Progress.js
CHANGED
|
@@ -1,66 +1,61 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
var _excluded = ["className", "style", "isShowPercentage", "percentage", "fillColor", "strokeColor", "strokeWidth", "size", "textColor", "textWidth", "showText", "textInside", "textBackground", "textType", "status", "
|
|
4
|
-
function ownKeys(object, enumerableOnly) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
var _excluded = ["className", "style", "isShowPercentage", "percentage", "fillColor", "strokeColor", "strokeWidth", "size", "textColor", "textWidth", "showText", "textInside", "textBackground", "textType", "status", "icon", "children"];
|
|
4
|
+
function ownKeys(object, enumerableOnly) {
|
|
5
|
+
var keys = Object.keys(object);
|
|
6
|
+
if (Object.getOwnPropertySymbols) {
|
|
7
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
8
|
+
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
9
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
10
|
+
})), keys.push.apply(keys, symbols);
|
|
11
|
+
}
|
|
12
|
+
return keys;
|
|
13
|
+
}
|
|
14
|
+
function _objectSpread(target) {
|
|
15
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
16
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
17
|
+
i % 2 ? ownKeys(Object(source), true).forEach(function(key) {
|
|
18
|
+
_defineProperty(target, key, source[key]);
|
|
19
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
20
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return target;
|
|
24
|
+
}
|
|
25
|
+
import React__default from "react";
|
|
26
|
+
import classNames from "classnames";
|
|
27
|
+
import { Checked } from "@nutui/icons-react";
|
|
28
|
+
import { c as cn } from "./bem.js";
|
|
29
|
+
import { C as ComponentDefaults } from "./typings.js";
|
|
30
|
+
import "@bem-react/classname";
|
|
12
31
|
var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
|
|
13
|
-
className:
|
|
32
|
+
className: "",
|
|
14
33
|
style: {},
|
|
15
34
|
isShowPercentage: true,
|
|
16
35
|
percentage: 0,
|
|
17
|
-
fillColor:
|
|
18
|
-
strokeColor:
|
|
19
|
-
strokeWidth:
|
|
20
|
-
textColor:
|
|
21
|
-
textWidth:
|
|
36
|
+
fillColor: "#f3f3f3",
|
|
37
|
+
strokeColor: "linear-gradient(135deg, #fa2c19 0%, #fa6419 100%)",
|
|
38
|
+
strokeWidth: "",
|
|
39
|
+
textColor: "",
|
|
40
|
+
textWidth: "",
|
|
22
41
|
showText: true,
|
|
23
42
|
textInside: false,
|
|
24
|
-
textBackground:
|
|
25
|
-
textType:
|
|
43
|
+
textBackground: "linear-gradient(135deg, #fa2c19 0%, #fa6419 100%)",
|
|
44
|
+
textType: "text",
|
|
26
45
|
status: false,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
iconSize: '16px',
|
|
30
|
-
children: undefined
|
|
46
|
+
icon: null,
|
|
47
|
+
children: void 0
|
|
31
48
|
});
|
|
32
|
-
var Progress = function
|
|
49
|
+
var Progress = function Progress2(props) {
|
|
33
50
|
var _classNames, _classNames2, _classNames4;
|
|
34
|
-
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
size = _defaultProps$props.size,
|
|
43
|
-
textColor = _defaultProps$props.textColor,
|
|
44
|
-
textWidth = _defaultProps$props.textWidth,
|
|
45
|
-
showText = _defaultProps$props.showText,
|
|
46
|
-
textInside = _defaultProps$props.textInside,
|
|
47
|
-
textBackground = _defaultProps$props.textBackground,
|
|
48
|
-
textType = _defaultProps$props.textType,
|
|
49
|
-
status = _defaultProps$props.status,
|
|
50
|
-
iconName = _defaultProps$props.iconName,
|
|
51
|
-
iconColor = _defaultProps$props.iconColor,
|
|
52
|
-
iconSize = _defaultProps$props.iconSize,
|
|
53
|
-
children = _defaultProps$props.children,
|
|
54
|
-
iconClassPrefix = _defaultProps$props.iconClassPrefix,
|
|
55
|
-
iconFontClassName = _defaultProps$props.iconFontClassName,
|
|
56
|
-
rest = _objectWithoutProperties(_defaultProps$props, _excluded);
|
|
57
|
-
var b = cn('progress');
|
|
58
|
-
var classes = classNames(b(''));
|
|
59
|
-
var classesOuter = classNames((_classNames = {}, _defineProperty(_classNames, "".concat(b(''), "-outer"), true), _defineProperty(_classNames, "".concat(b(''), "-").concat(size || 'base'), true), _classNames));
|
|
60
|
-
var classesInner = classNames((_classNames2 = {}, _defineProperty(_classNames2, "".concat(b(''), "-inner"), true), _defineProperty(_classNames2, "".concat(b(''), "-active"), status), _classNames2));
|
|
61
|
-
var classesText = classNames(_defineProperty({}, "".concat(b(''), "-text"), true));
|
|
62
|
-
var classesInsideText = classNames((_classNames4 = {}, _defineProperty(_classNames4, "".concat(b(''), "-text"), true), _defineProperty(_classNames4, "".concat(b(''), "-insidetext"), true), _classNames4));
|
|
63
|
-
var classesTextInner = classNames(_defineProperty({}, "".concat(b(''), "-text__inner"), true));
|
|
51
|
+
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props), className = _defaultProps$props.className, style = _defaultProps$props.style, isShowPercentage = _defaultProps$props.isShowPercentage, percentage = _defaultProps$props.percentage, fillColor = _defaultProps$props.fillColor, strokeColor = _defaultProps$props.strokeColor, strokeWidth = _defaultProps$props.strokeWidth, size = _defaultProps$props.size, textColor = _defaultProps$props.textColor, textWidth = _defaultProps$props.textWidth, showText = _defaultProps$props.showText, textInside = _defaultProps$props.textInside, textBackground = _defaultProps$props.textBackground, textType = _defaultProps$props.textType, status = _defaultProps$props.status, icon = _defaultProps$props.icon, children = _defaultProps$props.children, rest = _objectWithoutProperties(_defaultProps$props, _excluded);
|
|
52
|
+
var b = cn("progress");
|
|
53
|
+
var classes = classNames(b(""));
|
|
54
|
+
var classesOuter = classNames((_classNames = {}, _defineProperty(_classNames, "".concat(b(""), "-outer"), true), _defineProperty(_classNames, "".concat(b(""), "-").concat(size || "base"), true), _classNames));
|
|
55
|
+
var classesInner = classNames((_classNames2 = {}, _defineProperty(_classNames2, "".concat(b(""), "-inner"), true), _defineProperty(_classNames2, "".concat(b(""), "-active"), status), _classNames2));
|
|
56
|
+
var classesText = classNames(_defineProperty({}, "".concat(b(""), "-text"), true));
|
|
57
|
+
var classesInsideText = classNames((_classNames4 = {}, _defineProperty(_classNames4, "".concat(b(""), "-text"), true), _defineProperty(_classNames4, "".concat(b(""), "-insidetext"), true), _classNames4));
|
|
58
|
+
var classesTextInner = classNames(_defineProperty({}, "".concat(b(""), "-text__inner"), true));
|
|
64
59
|
var stylesOuter = {
|
|
65
60
|
height: "".concat(strokeWidth, "px"),
|
|
66
61
|
// eslint-disable-next-line no-nested-ternary
|
|
@@ -85,7 +80,7 @@ var Progress = function Progress(props) {
|
|
|
85
80
|
};
|
|
86
81
|
return React__default.createElement("div", _objectSpread({
|
|
87
82
|
className: "".concat(classes, " ").concat(className),
|
|
88
|
-
style
|
|
83
|
+
style
|
|
89
84
|
}, rest), React__default.createElement("div", {
|
|
90
85
|
className: classesOuter,
|
|
91
86
|
style: stylesOuter
|
|
@@ -103,22 +98,22 @@ var Progress = function Progress(props) {
|
|
|
103
98
|
style: {
|
|
104
99
|
color: textColor
|
|
105
100
|
}
|
|
106
|
-
}, percentage, isShowPercentage ?
|
|
101
|
+
}, percentage, isShowPercentage ? "%" : ""))))), showText && !textInside && React__default.createElement("div", {
|
|
107
102
|
className: classesText,
|
|
108
103
|
style: stylesText
|
|
109
|
-
}, textType ===
|
|
104
|
+
}, textType === "text" && React__default.createElement("span", {
|
|
110
105
|
className: classesTextInner,
|
|
111
106
|
style: {
|
|
112
107
|
color: textColor
|
|
113
108
|
}
|
|
114
|
-
}, percentage, isShowPercentage ?
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
color: iconColor
|
|
120
|
-
})));
|
|
109
|
+
}, percentage, isShowPercentage ? "%" : ""), textType === "icon" && React__default.createElement(React__default.Fragment, null, icon || React__default.createElement(Checked, {
|
|
110
|
+
width: 16,
|
|
111
|
+
height: 16,
|
|
112
|
+
color: "#439422"
|
|
113
|
+
}))));
|
|
121
114
|
};
|
|
122
115
|
Progress.defaultProps = defaultProps;
|
|
123
|
-
Progress.displayName =
|
|
124
|
-
export {
|
|
116
|
+
Progress.displayName = "NutProgress";
|
|
117
|
+
export {
|
|
118
|
+
Progress as default
|
|
119
|
+
};
|