@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/Signature.js
CHANGED
|
@@ -2,61 +2,63 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
4
|
var _excluded = ["type", "lineWidth", "strokeStyle", "unSupportTpl", "className", "confirm", "clear", "onConfirm", "onClear"];
|
|
5
|
-
function ownKeys(object, enumerableOnly) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
function ownKeys(object, enumerableOnly) {
|
|
6
|
+
var keys = Object.keys(object);
|
|
7
|
+
if (Object.getOwnPropertySymbols) {
|
|
8
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
9
|
+
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
10
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
11
|
+
})), keys.push.apply(keys, symbols);
|
|
12
|
+
}
|
|
13
|
+
return keys;
|
|
14
|
+
}
|
|
15
|
+
function _objectSpread(target) {
|
|
16
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
17
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
18
|
+
i % 2 ? ownKeys(Object(source), true).forEach(function(key) {
|
|
19
|
+
_defineProperty(target, key, source[key]);
|
|
20
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
21
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return target;
|
|
25
|
+
}
|
|
26
|
+
import React__default, { useRef, useState, useEffect } from "react";
|
|
27
|
+
import Button from "./Button.js";
|
|
28
|
+
import { c as cn } from "./bem.js";
|
|
29
|
+
import { useConfig } from "./ConfigProvider.js";
|
|
30
|
+
import "@bem-react/classname";
|
|
12
31
|
var defaultProps = {
|
|
13
|
-
type:
|
|
32
|
+
type: "png",
|
|
14
33
|
lineWidth: 2,
|
|
15
|
-
strokeStyle:
|
|
16
|
-
unSupportTpl:
|
|
17
|
-
className:
|
|
34
|
+
strokeStyle: "#000",
|
|
35
|
+
unSupportTpl: "对不起,当前浏览器不支持Canvas,无法使用本控件!",
|
|
36
|
+
className: ""
|
|
18
37
|
};
|
|
19
|
-
var Signature = function
|
|
20
|
-
var _useConfig = useConfig(),
|
|
21
|
-
|
|
22
|
-
var
|
|
23
|
-
type = _defaultProps$props.type,
|
|
24
|
-
lineWidth = _defaultProps$props.lineWidth,
|
|
25
|
-
strokeStyle = _defaultProps$props.strokeStyle,
|
|
26
|
-
unSupportTpl = _defaultProps$props.unSupportTpl,
|
|
27
|
-
className = _defaultProps$props.className,
|
|
28
|
-
confirm = _defaultProps$props.confirm,
|
|
29
|
-
clear = _defaultProps$props.clear,
|
|
30
|
-
onConfirm = _defaultProps$props.onConfirm,
|
|
31
|
-
onClear = _defaultProps$props.onClear,
|
|
32
|
-
rest = _objectWithoutProperties(_defaultProps$props, _excluded);
|
|
33
|
-
var b = cn('signature');
|
|
38
|
+
var Signature = function Signature2(props) {
|
|
39
|
+
var _useConfig = useConfig(), locale = _useConfig.locale;
|
|
40
|
+
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props), type = _defaultProps$props.type, lineWidth = _defaultProps$props.lineWidth, strokeStyle = _defaultProps$props.strokeStyle, unSupportTpl = _defaultProps$props.unSupportTpl, className = _defaultProps$props.className, confirm = _defaultProps$props.confirm, clear = _defaultProps$props.clear, onConfirm = _defaultProps$props.onConfirm, onClear = _defaultProps$props.onClear, rest = _objectWithoutProperties(_defaultProps$props, _excluded);
|
|
41
|
+
var b = cn("signature");
|
|
34
42
|
var canvasRef = useRef(null);
|
|
35
43
|
var wrapRef = useRef(null);
|
|
36
|
-
var _useState = useState(0),
|
|
37
|
-
|
|
38
|
-
canvasHeight = _useState2[0],
|
|
39
|
-
setCanvasHeight = _useState2[1];
|
|
40
|
-
var _useState3 = useState(0),
|
|
41
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
42
|
-
canvasWidth = _useState4[0],
|
|
43
|
-
setCanvasWidth = _useState4[1];
|
|
44
|
+
var _useState = useState(0), _useState2 = _slicedToArray(_useState, 2), canvasHeight = _useState2[0], setCanvasHeight = _useState2[1];
|
|
45
|
+
var _useState3 = useState(0), _useState4 = _slicedToArray(_useState3, 2), canvasWidth = _useState4[0], setCanvasWidth = _useState4[1];
|
|
44
46
|
var ctx = useRef(null);
|
|
45
|
-
var isCanvasSupported = function
|
|
46
|
-
var elem = document.createElement(
|
|
47
|
-
return !!(elem.getContext && elem.getContext(
|
|
47
|
+
var isCanvasSupported = function isCanvasSupported2() {
|
|
48
|
+
var elem = document.createElement("canvas");
|
|
49
|
+
return !!(elem.getContext && elem.getContext("2d"));
|
|
48
50
|
};
|
|
49
|
-
var isSupportTouch =
|
|
50
|
-
var events = isSupportTouch ? [
|
|
51
|
-
useEffect(function
|
|
51
|
+
var isSupportTouch = "ontouchstart" in window;
|
|
52
|
+
var events = isSupportTouch ? ["touchstart", "touchmove", "touchend", "touchleave"] : ["mousedown", "mousemove", "mouseup", "mouseleave"];
|
|
53
|
+
useEffect(function() {
|
|
52
54
|
if (isCanvasSupported() && canvasRef.current && wrapRef.current) {
|
|
53
|
-
ctx.current = canvasRef.current.getContext(
|
|
55
|
+
ctx.current = canvasRef.current.getContext("2d");
|
|
54
56
|
setCanvasWidth(wrapRef.current.offsetWidth);
|
|
55
57
|
setCanvasHeight(wrapRef.current.offsetHeight);
|
|
56
58
|
addEvent();
|
|
57
59
|
}
|
|
58
60
|
}, []);
|
|
59
|
-
var startEventHandler = function
|
|
61
|
+
var startEventHandler = function startEventHandler2(event) {
|
|
60
62
|
event.preventDefault();
|
|
61
63
|
if (ctx.current && canvasRef.current) {
|
|
62
64
|
ctx.current.beginPath();
|
|
@@ -67,12 +69,12 @@ var Signature = function Signature(props) {
|
|
|
67
69
|
canvasRef.current.addEventListener(events[3], leaveEventHandler, false);
|
|
68
70
|
}
|
|
69
71
|
};
|
|
70
|
-
var addEvent = function
|
|
72
|
+
var addEvent = function addEvent2() {
|
|
71
73
|
if (canvasRef.current) {
|
|
72
74
|
canvasRef.current.addEventListener(events[0], startEventHandler, false);
|
|
73
75
|
}
|
|
74
76
|
};
|
|
75
|
-
var moveEventHandler = function
|
|
77
|
+
var moveEventHandler = function moveEventHandler2(event) {
|
|
76
78
|
event.preventDefault();
|
|
77
79
|
var evt = isSupportTouch ? event.touches[0] : event;
|
|
78
80
|
if (canvasRef.current && ctx.current) {
|
|
@@ -83,21 +85,21 @@ var Signature = function Signature(props) {
|
|
|
83
85
|
ctx.current.stroke();
|
|
84
86
|
}
|
|
85
87
|
};
|
|
86
|
-
var endEventHandler = function
|
|
88
|
+
var endEventHandler = function endEventHandler2(event) {
|
|
87
89
|
event.preventDefault();
|
|
88
90
|
if (canvasRef.current) {
|
|
89
91
|
canvasRef.current.removeEventListener(events[1], moveEventHandler, false);
|
|
90
|
-
canvasRef.current.removeEventListener(events[2],
|
|
92
|
+
canvasRef.current.removeEventListener(events[2], endEventHandler2, false);
|
|
91
93
|
}
|
|
92
94
|
};
|
|
93
|
-
var leaveEventHandler = function
|
|
95
|
+
var leaveEventHandler = function leaveEventHandler2(event) {
|
|
94
96
|
event.preventDefault();
|
|
95
97
|
if (canvasRef.current) {
|
|
96
98
|
canvasRef.current.removeEventListener(events[1], moveEventHandler, false);
|
|
97
99
|
canvasRef.current.removeEventListener(events[2], endEventHandler, false);
|
|
98
100
|
}
|
|
99
101
|
};
|
|
100
|
-
var handleClearBtn = function
|
|
102
|
+
var handleClearBtn = function handleClearBtn2() {
|
|
101
103
|
if (canvasRef.current && ctx.current) {
|
|
102
104
|
canvasRef.current.addEventListener(events[2], endEventHandler, false);
|
|
103
105
|
ctx.current.clearRect(0, 0, canvasWidth, canvasHeight);
|
|
@@ -106,20 +108,20 @@ var Signature = function Signature(props) {
|
|
|
106
108
|
clear && clear();
|
|
107
109
|
onClear && onClear();
|
|
108
110
|
};
|
|
109
|
-
var handleConfirmBtn = function
|
|
111
|
+
var handleConfirmBtn = function handleConfirmBtn2() {
|
|
110
112
|
onSave(canvasRef.current);
|
|
111
113
|
};
|
|
112
|
-
var onSave = function
|
|
114
|
+
var onSave = function onSave2(canvas) {
|
|
113
115
|
var dataurl;
|
|
114
116
|
switch (type) {
|
|
115
|
-
case
|
|
116
|
-
dataurl = canvas.toDataURL(
|
|
117
|
+
case "png":
|
|
118
|
+
dataurl = canvas.toDataURL("image/png");
|
|
117
119
|
break;
|
|
118
|
-
case
|
|
119
|
-
dataurl = canvas.toDataURL(
|
|
120
|
+
case "jpg":
|
|
121
|
+
dataurl = canvas.toDataURL("image/jpeg", 0.8);
|
|
120
122
|
break;
|
|
121
123
|
default:
|
|
122
|
-
dataurl = canvas.toDataURL(
|
|
124
|
+
dataurl = canvas.toDataURL("image/png");
|
|
123
125
|
}
|
|
124
126
|
handleClearBtn();
|
|
125
127
|
confirm && confirm(canvas, dataurl);
|
|
@@ -128,22 +130,22 @@ var Signature = function Signature(props) {
|
|
|
128
130
|
return React__default.createElement("div", _objectSpread({
|
|
129
131
|
className: "".concat(b(), " ").concat(className)
|
|
130
132
|
}, rest), React__default.createElement("div", {
|
|
131
|
-
className: "".concat(b(
|
|
133
|
+
className: "".concat(b("inner")),
|
|
132
134
|
ref: wrapRef
|
|
133
135
|
}, isCanvasSupported() ? React__default.createElement("canvas", {
|
|
134
136
|
ref: canvasRef,
|
|
135
137
|
height: canvasHeight,
|
|
136
138
|
width: canvasWidth
|
|
137
139
|
}) : React__default.createElement("p", {
|
|
138
|
-
className: "".concat(b(
|
|
140
|
+
className: "".concat(b("unsopport"))
|
|
139
141
|
}, locale.signature.unSupportTpl || unSupportTpl)), React__default.createElement(Button, {
|
|
140
|
-
className: "".concat(b(
|
|
142
|
+
className: "".concat(b("btn")),
|
|
141
143
|
type: "default",
|
|
142
144
|
onClick: function onClick() {
|
|
143
145
|
return handleClearBtn();
|
|
144
146
|
}
|
|
145
147
|
}, locale.signature.reSign), React__default.createElement(Button, {
|
|
146
|
-
className: "".concat(b(
|
|
148
|
+
className: "".concat(b("btn")),
|
|
147
149
|
type: "primary",
|
|
148
150
|
onClick: function onClick() {
|
|
149
151
|
return handleConfirmBtn();
|
|
@@ -151,5 +153,7 @@ var Signature = function Signature(props) {
|
|
|
151
153
|
}, locale.confirm));
|
|
152
154
|
};
|
|
153
155
|
Signature.defaultProps = defaultProps;
|
|
154
|
-
Signature.displayName =
|
|
155
|
-
export {
|
|
156
|
+
Signature.displayName = "NutSignature";
|
|
157
|
+
export {
|
|
158
|
+
Signature as default
|
|
159
|
+
};
|
package/dist/esm/Skeleton.js
CHANGED
|
@@ -1,57 +1,63 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["className", "width", "height", "animated", "row", "title", "avatar", "avatarSize", "round", "loading", "children", "avatarShape"];
|
|
4
|
-
function ownKeys(object, enumerableOnly) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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 Avatar from "./Avatar.js";
|
|
28
|
+
import { c as cn } from "./bem.js";
|
|
29
|
+
import "@bem-react/classname";
|
|
11
30
|
var defaultProps = {
|
|
12
|
-
width:
|
|
13
|
-
height:
|
|
31
|
+
width: "100px",
|
|
32
|
+
height: "100px",
|
|
14
33
|
row: 1,
|
|
15
34
|
animated: false,
|
|
16
35
|
title: false,
|
|
17
36
|
avatar: false,
|
|
18
37
|
round: false,
|
|
19
|
-
avatarSize:
|
|
38
|
+
avatarSize: "50px",
|
|
20
39
|
loading: false,
|
|
21
|
-
avatarShape:
|
|
40
|
+
avatarShape: "round"
|
|
22
41
|
};
|
|
23
|
-
var Skeleton = function
|
|
24
|
-
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
25
|
-
|
|
26
|
-
width = _defaultProps$props.width,
|
|
27
|
-
height = _defaultProps$props.height,
|
|
28
|
-
animated = _defaultProps$props.animated,
|
|
29
|
-
row = _defaultProps$props.row,
|
|
30
|
-
title = _defaultProps$props.title,
|
|
31
|
-
avatar = _defaultProps$props.avatar,
|
|
32
|
-
avatarSize = _defaultProps$props.avatarSize,
|
|
33
|
-
round = _defaultProps$props.round,
|
|
34
|
-
loading = _defaultProps$props.loading,
|
|
35
|
-
children = _defaultProps$props.children,
|
|
36
|
-
avatarShape = _defaultProps$props.avatarShape,
|
|
37
|
-
restProps = _objectWithoutProperties(_defaultProps$props, _excluded);
|
|
38
|
-
var b = cn('skeleton');
|
|
42
|
+
var Skeleton = function Skeleton2(props) {
|
|
43
|
+
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props), className = _defaultProps$props.className, width = _defaultProps$props.width, height = _defaultProps$props.height, animated = _defaultProps$props.animated, row = _defaultProps$props.row, title = _defaultProps$props.title, avatar = _defaultProps$props.avatar, avatarSize = _defaultProps$props.avatarSize, round = _defaultProps$props.round, loading = _defaultProps$props.loading, children = _defaultProps$props.children, avatarShape = _defaultProps$props.avatarShape, restProps = _objectWithoutProperties(_defaultProps$props, _excluded);
|
|
44
|
+
var b = cn("skeleton");
|
|
39
45
|
var classes = classNames(className, b());
|
|
40
46
|
var blockClass = classNames({
|
|
41
47
|
blockClass: true,
|
|
42
|
-
|
|
48
|
+
"blockClass--round": round
|
|
43
49
|
});
|
|
44
50
|
var avatarClass = classNames(_defineProperty({
|
|
45
51
|
avatarClass: true
|
|
46
52
|
}, "avatarClass--".concat(avatarShape), avatarShape));
|
|
47
|
-
var repeatLines = function
|
|
53
|
+
var repeatLines = function repeatLines2(num) {
|
|
48
54
|
return Array.from({
|
|
49
55
|
length: num
|
|
50
|
-
}, function
|
|
56
|
+
}, function(v, i) {
|
|
51
57
|
return i;
|
|
52
58
|
});
|
|
53
59
|
};
|
|
54
|
-
var getStyle = function
|
|
60
|
+
var getStyle = function getStyle2() {
|
|
55
61
|
if (avatarSize) {
|
|
56
62
|
return {
|
|
57
63
|
width: avatarSize,
|
|
@@ -59,8 +65,8 @@ var Skeleton = function Skeleton(props) {
|
|
|
59
65
|
};
|
|
60
66
|
}
|
|
61
67
|
return {
|
|
62
|
-
width:
|
|
63
|
-
height:
|
|
68
|
+
width: "50px",
|
|
69
|
+
height: "50px"
|
|
64
70
|
};
|
|
65
71
|
};
|
|
66
72
|
return React__default.createElement(React__default.Fragment, null, loading ? React__default.createElement("div", null, children) : React__default.createElement("div", _objectSpread({
|
|
@@ -77,24 +83,26 @@ var Skeleton = function Skeleton(props) {
|
|
|
77
83
|
}), row === 1 && React__default.createElement("div", {
|
|
78
84
|
className: blockClass,
|
|
79
85
|
style: {
|
|
80
|
-
width
|
|
81
|
-
height
|
|
86
|
+
width,
|
|
87
|
+
height
|
|
82
88
|
}
|
|
83
89
|
}), React__default.createElement("div", {
|
|
84
90
|
className: "skeleton-content-line"
|
|
85
91
|
}, title && React__default.createElement("div", {
|
|
86
92
|
className: "skeleton-title"
|
|
87
|
-
}), repeatLines(row).map(function
|
|
93
|
+
}), repeatLines(row).map(function(item, index) {
|
|
88
94
|
return React__default.createElement("div", {
|
|
89
95
|
className: blockClass,
|
|
90
96
|
key: index,
|
|
91
97
|
style: {
|
|
92
|
-
width
|
|
93
|
-
height
|
|
98
|
+
width,
|
|
99
|
+
height
|
|
94
100
|
}
|
|
95
101
|
});
|
|
96
102
|
})))));
|
|
97
103
|
};
|
|
98
104
|
Skeleton.defaultProps = defaultProps;
|
|
99
|
-
Skeleton.displayName =
|
|
100
|
-
export {
|
|
105
|
+
Skeleton.displayName = "NutSkeleton";
|
|
106
|
+
export {
|
|
107
|
+
Skeleton as default
|
|
108
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
import '../../../packages/step/step.scss'
|
package/dist/esm/Step.js
CHANGED
|
@@ -1,59 +1,64 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
var _excluded = ["children", "title", "content", "activeIndex", "icon", "
|
|
4
|
-
function ownKeys(object, enumerableOnly) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
var _excluded = ["children", "title", "content", "activeIndex", "icon", "className", "renderContent"];
|
|
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, { useContext } from "react";
|
|
26
|
+
import classNames from "classnames";
|
|
27
|
+
import { D as DataContext } from "./UserContext2.js";
|
|
28
|
+
import { c as cn } from "./bem.js";
|
|
29
|
+
import { C as ComponentDefaults } from "./typings.js";
|
|
30
|
+
import "@bem-react/classname";
|
|
13
31
|
var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
|
|
14
|
-
title:
|
|
15
|
-
content:
|
|
32
|
+
title: "",
|
|
33
|
+
content: "",
|
|
16
34
|
activeIndex: 0,
|
|
17
|
-
icon:
|
|
18
|
-
iconColor: '',
|
|
19
|
-
size: '12px'
|
|
35
|
+
icon: ""
|
|
20
36
|
});
|
|
21
|
-
var Step = function
|
|
22
|
-
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
23
|
-
children = _defaultProps$props.children,
|
|
24
|
-
title = _defaultProps$props.title,
|
|
25
|
-
content = _defaultProps$props.content,
|
|
26
|
-
activeIndex = _defaultProps$props.activeIndex,
|
|
27
|
-
icon = _defaultProps$props.icon,
|
|
28
|
-
iconColor = _defaultProps$props.iconColor,
|
|
29
|
-
size = _defaultProps$props.size,
|
|
30
|
-
className = _defaultProps$props.className,
|
|
31
|
-
renderContent = _defaultProps$props.renderContent,
|
|
32
|
-
iconClassPrefix = _defaultProps$props.iconClassPrefix,
|
|
33
|
-
iconFontClassName = _defaultProps$props.iconFontClassName,
|
|
34
|
-
restProps = _objectWithoutProperties(_defaultProps$props, _excluded);
|
|
37
|
+
var Step = function Step2(props) {
|
|
38
|
+
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props), children = _defaultProps$props.children, title = _defaultProps$props.title, content = _defaultProps$props.content, activeIndex = _defaultProps$props.activeIndex, icon = _defaultProps$props.icon, className = _defaultProps$props.className, renderContent = _defaultProps$props.renderContent, restProps = _objectWithoutProperties(_defaultProps$props, _excluded);
|
|
35
39
|
var parent = useContext(DataContext);
|
|
36
40
|
var dot = parent.propSteps.progressDot;
|
|
37
|
-
var getCurrentStatus = function
|
|
41
|
+
var getCurrentStatus = function getCurrentStatus2() {
|
|
38
42
|
var index = activeIndex;
|
|
39
|
-
if (index < +parent.propSteps.current)
|
|
40
|
-
|
|
43
|
+
if (index < +parent.propSteps.current)
|
|
44
|
+
return "finish";
|
|
45
|
+
return index === +parent.propSteps.current ? "process" : "wait";
|
|
41
46
|
};
|
|
42
|
-
var handleClickStep = function
|
|
47
|
+
var handleClickStep = function handleClickStep2() {
|
|
43
48
|
var _parent$propSteps, _parent$propSteps2, _parent$propSteps3, _parent$propSteps4;
|
|
44
49
|
((_parent$propSteps = parent.propSteps) === null || _parent$propSteps === void 0 ? void 0 : _parent$propSteps.onClickStep) && ((_parent$propSteps2 = parent.propSteps) === null || _parent$propSteps2 === void 0 ? void 0 : _parent$propSteps2.onClickStep(activeIndex));
|
|
45
50
|
((_parent$propSteps3 = parent.propSteps) === null || _parent$propSteps3 === void 0 ? void 0 : _parent$propSteps3.clickStep) && ((_parent$propSteps4 = parent.propSteps) === null || _parent$propSteps4 === void 0 ? void 0 : _parent$propSteps4.clickStep(activeIndex));
|
|
46
51
|
};
|
|
47
|
-
var b = cn(
|
|
48
|
-
var classes = classNames(_defineProperty({}, "".concat(b(
|
|
49
|
-
var renderIconClass = function
|
|
52
|
+
var b = cn("step");
|
|
53
|
+
var classes = classNames(_defineProperty({}, "".concat(b(""), "-").concat(getCurrentStatus()), true), className, b(""));
|
|
54
|
+
var renderIconClass = function renderIconClass2() {
|
|
50
55
|
if (!dot && icon) {
|
|
51
|
-
return
|
|
56
|
+
return "nut-step-icon is-icon";
|
|
52
57
|
}
|
|
53
58
|
if (!dot && !icon) {
|
|
54
|
-
return
|
|
59
|
+
return "nut-step-icon is-text";
|
|
55
60
|
}
|
|
56
|
-
return
|
|
61
|
+
return "nut-step-icon";
|
|
57
62
|
};
|
|
58
63
|
return React__default.createElement("div", _objectSpread(_objectSpread({
|
|
59
64
|
className: classes
|
|
@@ -65,14 +70,7 @@ var Step = function Step(props) {
|
|
|
65
70
|
className: "nut-step-line"
|
|
66
71
|
}), React__default.createElement("div", {
|
|
67
72
|
className: renderIconClass()
|
|
68
|
-
}, icon ? React__default.createElement(
|
|
69
|
-
classPrefix: iconClassPrefix,
|
|
70
|
-
fontClassName: iconFontClassName,
|
|
71
|
-
className: "nut-step-icon-inner",
|
|
72
|
-
color: iconColor,
|
|
73
|
-
name: icon,
|
|
74
|
-
size: size
|
|
75
|
-
}) : !dot && React__default.createElement("span", {
|
|
73
|
+
}, React__default.isValidElement(icon) ? icon : !dot && React__default.createElement("span", {
|
|
76
74
|
className: "nut-step-inner"
|
|
77
75
|
}, activeIndex))), React__default.createElement("div", {
|
|
78
76
|
className: "nut-step-main"
|
|
@@ -85,5 +83,7 @@ var Step = function Step(props) {
|
|
|
85
83
|
}, renderContent())));
|
|
86
84
|
};
|
|
87
85
|
Step.defaultProps = defaultProps;
|
|
88
|
-
Step.displayName =
|
|
89
|
-
export {
|
|
86
|
+
Step.displayName = "NutStep";
|
|
87
|
+
export {
|
|
88
|
+
Step as default
|
|
89
|
+
};
|
package/dist/esm/Steps.js
CHANGED
|
@@ -1,40 +1,54 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
var _excluded = ["children", "current", "direction", "className", "progressDot", "clickStep", "onClickStep"];
|
|
4
|
-
function ownKeys(object, enumerableOnly) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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 { D as DataContext } from "./UserContext2.js";
|
|
28
|
+
import { c as cn } from "./bem.js";
|
|
29
|
+
import "@bem-react/classname";
|
|
11
30
|
var defaultProps = {
|
|
12
31
|
current: 0,
|
|
13
|
-
direction:
|
|
32
|
+
direction: "horizontal",
|
|
14
33
|
progressDot: false
|
|
15
34
|
};
|
|
16
|
-
var Steps = function
|
|
35
|
+
var Steps = function Steps2(props) {
|
|
17
36
|
var _classNames;
|
|
18
37
|
var propSteps = _objectSpread(_objectSpread({}, defaultProps), props);
|
|
19
|
-
var children = propSteps.children,
|
|
20
|
-
current = propSteps.current,
|
|
21
|
-
direction = propSteps.direction,
|
|
22
|
-
className = propSteps.className,
|
|
23
|
-
progressDot = propSteps.progressDot,
|
|
24
|
-
clickStep = propSteps.clickStep,
|
|
25
|
-
onClickStep = propSteps.onClickStep,
|
|
26
|
-
restProps = _objectWithoutProperties(propSteps, _excluded);
|
|
38
|
+
var children = propSteps.children, current = propSteps.current, direction = propSteps.direction, className = propSteps.className, progressDot = propSteps.progressDot, clickStep = propSteps.clickStep, onClickStep = propSteps.onClickStep, restProps = _objectWithoutProperties(propSteps, _excluded);
|
|
27
39
|
var parentSteps = {
|
|
28
|
-
propSteps
|
|
40
|
+
propSteps
|
|
29
41
|
};
|
|
30
|
-
var b = cn(
|
|
31
|
-
var classes = classNames((_classNames = {}, _defineProperty(_classNames, "".concat(b(
|
|
42
|
+
var b = cn("steps");
|
|
43
|
+
var classes = classNames((_classNames = {}, _defineProperty(_classNames, "".concat(b(""), "-").concat(direction), true), _defineProperty(_classNames, "".concat(b(""), "-dot"), !!props.progressDot), _classNames), className, b(""));
|
|
32
44
|
return React__default.createElement(DataContext.Provider, {
|
|
33
45
|
value: parentSteps
|
|
34
|
-
}, React__default.createElement(
|
|
46
|
+
}, React__default.createElement("div", _objectSpread({
|
|
35
47
|
className: classes
|
|
36
48
|
}, restProps), children));
|
|
37
49
|
};
|
|
38
50
|
Steps.defaultProps = defaultProps;
|
|
39
|
-
Steps.displayName =
|
|
40
|
-
export {
|
|
51
|
+
Steps.displayName = "NutSteps";
|
|
52
|
+
export {
|
|
53
|
+
Steps as default
|
|
54
|
+
};
|