@nutui/nutui-react 0.1.0 → 1.0.0
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/dist/esm/ActionSheet/style/css.js +1 -0
- package/dist/esm/ActionSheet/style/index.js +1 -1
- package/dist/esm/Address/style/css.js +1 -0
- package/dist/esm/Address/style/index.js +1 -1
- package/dist/esm/AnimatingNumbers/style/css.js +1 -0
- package/dist/esm/AnimatingNumbers/style/index.js +1 -1
- package/dist/esm/Avatar/style/css.js +1 -0
- package/dist/esm/Avatar/style/index.js +1 -1
- package/dist/esm/BackTop/style/css.js +1 -0
- package/dist/esm/BackTop/style/index.js +1 -1
- package/dist/esm/Badge/style/css.js +1 -0
- package/dist/esm/Badge/style/index.js +1 -1
- package/dist/esm/Barrage/style/css.js +1 -0
- package/dist/esm/Barrage/style/index.js +1 -1
- package/dist/esm/Button/style/css.js +1 -0
- package/dist/esm/Button/style/index.js +1 -1
- package/dist/esm/Button.js +110 -4
- package/dist/esm/Calendar/style/css.js +1 -0
- package/dist/esm/Calendar/style/index.js +1 -1
- package/dist/esm/CalendarItem/style/css.js +1 -0
- package/dist/esm/CalendarItem/style/index.js +1 -1
- package/dist/esm/Cell/style/css.js +1 -0
- package/dist/esm/Cell/style/index.js +1 -1
- package/dist/esm/Cell.js +1 -1
- package/dist/esm/CellGroup/style/css.js +1 -0
- package/dist/esm/CellGroup/style/index.js +1 -1
- package/dist/esm/Checkbox/style/css.js +1 -0
- package/dist/esm/Checkbox/style/index.js +1 -1
- package/dist/esm/Checkbox.js +1 -1
- package/dist/esm/CheckboxGroup/style/css.js +1 -0
- package/dist/esm/CheckboxGroup/style/index.js +1 -1
- package/dist/esm/CircleProgress/style/css.js +1 -0
- package/dist/esm/CircleProgress/style/index.js +1 -1
- package/dist/esm/Col/style/css.js +1 -0
- package/dist/esm/Col/style/index.js +1 -1
- package/dist/esm/Collapse/style/css.js +1 -0
- package/dist/esm/Collapse/style/index.js +1 -1
- package/dist/esm/CollapseItem/style/css.js +1 -0
- package/dist/esm/CollapseItem/style/index.js +1 -1
- package/dist/esm/CollapseItem.js +1 -1
- package/dist/esm/Dialog/style/css.js +1 -0
- package/dist/esm/Dialog/style/index.js +1 -1
- package/dist/esm/Divider/style/css.js +1 -0
- package/dist/esm/Divider/style/index.js +1 -1
- package/dist/esm/Drag/style/css.js +1 -0
- package/dist/esm/Drag/style/index.js +1 -1
- package/dist/esm/Drag.js +11 -30
- package/dist/esm/Elevator/style/css.js +1 -0
- package/dist/esm/Elevator/style/index.js +1 -1
- package/dist/esm/FixedNav/style/css.js +1 -0
- package/dist/esm/FixedNav/style/index.js +1 -1
- package/dist/esm/FixedNav.js +2 -2
- package/dist/esm/Icon/style/css.js +1 -0
- package/dist/esm/Icon/style/index.js +1 -1
- package/dist/esm/Icon.js +70 -4
- package/dist/esm/Infiniteloading/style/css.js +1 -0
- package/dist/esm/Infiniteloading/style/index.js +1 -1
- package/dist/esm/Input/style/css.js +1 -0
- package/dist/esm/Input/style/index.js +1 -1
- package/dist/esm/InputNumber/style/css.js +1 -0
- package/dist/esm/InputNumber/style/index.js +1 -1
- package/dist/esm/Layout/style/css.js +1 -0
- package/dist/esm/Layout/style/index.js +1 -1
- package/dist/esm/NavBar/style/css.js +1 -0
- package/dist/esm/NavBar/style/index.js +1 -1
- package/dist/esm/NavBar.js +1 -1
- package/dist/esm/NoticeBar/style/css.js +1 -0
- package/dist/esm/NoticeBar/style/index.js +1 -1
- package/dist/esm/NoticeBar.js +1 -1
- package/dist/esm/Notify/style/css.js +1 -0
- package/dist/esm/Notify/style/index.js +1 -1
- package/dist/esm/Overlay/style/css.js +1 -0
- package/dist/esm/Overlay/style/index.js +1 -1
- package/dist/esm/Pagination/style/css.js +1 -0
- package/dist/esm/Pagination/style/index.js +1 -1
- package/dist/esm/Picker/style/css.js +1 -0
- package/dist/esm/Picker/style/index.js +1 -1
- package/dist/esm/Popover/style/css.js +1 -0
- package/dist/esm/Popover/style/index.js +1 -1
- package/dist/esm/Popup/style/css.js +1 -0
- package/dist/esm/Popup/style/index.js +1 -1
- package/dist/esm/Price/style/css.js +1 -0
- package/dist/esm/Price/style/index.js +1 -1
- package/dist/esm/Radio/style/css.js +1 -0
- package/dist/esm/Radio/style/index.js +1 -1
- package/dist/esm/Radio.js +2 -3
- package/dist/esm/RadioGroup/style/css.js +1 -0
- package/dist/esm/RadioGroup/style/index.js +1 -1
- package/dist/esm/Range/style/css.js +1 -0
- package/dist/esm/Range/style/index.js +1 -1
- package/dist/esm/Range.js +1 -4
- package/dist/esm/Rate/style/css.js +1 -0
- package/dist/esm/Rate/style/index.js +1 -1
- package/dist/esm/Rate.js +1 -1
- package/dist/esm/Row/style/css.js +1 -0
- package/dist/esm/Row/style/index.js +1 -1
- package/dist/esm/ShortPassword/style/css.js +1 -0
- package/dist/esm/ShortPassword/style/index.js +1 -1
- package/dist/esm/Signature/style/css.js +1 -0
- package/dist/esm/Signature/style/index.js +1 -1
- package/dist/esm/Signature.js +1 -2
- package/dist/esm/Step/style/css.js +1 -0
- package/dist/esm/Step/style/index.js +1 -1
- package/dist/esm/Steps/style/css.js +1 -0
- package/dist/esm/Steps/style/index.js +1 -1
- package/dist/esm/Swiper/style/css.js +1 -0
- package/dist/esm/Swiper/style/index.js +1 -1
- package/dist/esm/SwiperItem/style/css.js +1 -0
- package/dist/esm/SwiperItem/style/index.js +1 -1
- package/dist/esm/Switch/style/css.js +1 -0
- package/dist/esm/Switch/style/index.js +1 -1
- package/dist/esm/Tabbar/style/css.js +1 -0
- package/dist/esm/Tabbar/style/index.js +1 -1
- package/dist/esm/Tabbar.js +1 -4
- package/dist/esm/TabbarItem/style/css.js +1 -0
- package/dist/esm/TabbarItem/style/index.js +1 -1
- package/dist/esm/TabbarItem.js +1 -1
- package/dist/esm/Tag/style/css.js +1 -0
- package/dist/esm/Tag/style/index.js +1 -1
- package/dist/esm/TextArea/style/css.js +1 -0
- package/dist/esm/TextArea/style/index.js +1 -1
- package/dist/esm/Toast/style/css.js +1 -0
- package/dist/esm/Toast/style/index.js +1 -1
- package/dist/esm/Toast.js +294 -7
- package/dist/esm/Uploader/style/css.js +1 -0
- package/dist/esm/Uploader/style/index.js +1 -1
- package/dist/esm/nutui-react.es.js +22 -22
- package/dist/esm/types/src/packages/nutui.react.build.d.ts +23 -23
- package/dist/esm/types/src/packages/nutui.react.d.ts +23 -23
- package/dist/esm/types/src/packages/tabbaritem/index.d.ts +1 -1
- package/dist/esm/types/src/packages/tabbaritem/{tabbarItem.d.ts → tabbaritem.d.ts} +0 -0
- package/dist/nutui.react.es.js +10461 -10479
- package/dist/nutui.react.umd.js +21 -21
- package/dist/packages/animatingnumbers/animatingnumbers.scss +1 -1
- package/dist/packages/calendar/calendar.scss +2 -1
- package/dist/packages/cell/cell.scss +2 -0
- package/dist/packages/checkbox/checkbox.scss +1 -1
- package/dist/packages/collapse/collapse.scss +1 -1
- package/dist/packages/collapseitem/collapseitem.scss +2 -0
- package/dist/packages/dialog/dialog.scss +8 -0
- package/dist/packages/fixednav/fixednav.scss +2 -0
- package/dist/packages/infiniteloading/infiniteloading.scss +1 -0
- package/dist/packages/input/input.scss +1 -0
- package/dist/packages/inputnumber/inputnumber.scss +1 -0
- package/dist/packages/navbar/navbar.scss +2 -0
- package/dist/packages/noticebar/noticebar.scss +2 -0
- package/dist/packages/popover/popover.scss +1 -1
- package/dist/packages/radio/radio.scss +2 -0
- package/dist/packages/range/range.scss +1 -0
- package/dist/packages/rate/rate.scss +2 -0
- package/dist/packages/signature/signature.scss +1 -0
- package/dist/packages/step/step.scss +1 -0
- package/dist/packages/tabbaritem/{tabbarItem.scss → tabbaritem.scss} +2 -0
- package/dist/packages/tag/tag.scss +1 -0
- package/dist/packages/toast/toast.scss +2 -0
- package/dist/packages/uploader/uploader.scss +2 -0
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/themes/default.scss +22 -22
- package/dist/styles/variables.scss +3 -3
- package/package.json +18 -13
- package/dist/esm/button-345fb015.js +0 -110
- package/dist/esm/icon-63c0d58f.js +0 -70
- package/dist/esm/toast-420b65b7.js +0 -294
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
require('../../../packages/price/price.scss')
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../../../packages/radio/radio.css')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
require('../../../packages/radio/radio.scss')
|
package/dist/esm/Radio.js
CHANGED
|
@@ -8,11 +8,9 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
8
8
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9
9
|
|
|
10
10
|
import React__default, { useState, useContext, useEffect } from 'react';
|
|
11
|
-
import
|
|
11
|
+
import Icon from './Icon.js';
|
|
12
12
|
import { R as RadioContext } from './context-aa058329.js';
|
|
13
13
|
import RadioGroup from './RadioGroup.js';
|
|
14
|
-
import './bem-893ad28d.js';
|
|
15
|
-
import '@bem-react/classname';
|
|
16
14
|
var defaultProps = {
|
|
17
15
|
disabled: false,
|
|
18
16
|
checked: false,
|
|
@@ -93,6 +91,7 @@ var Radio = function Radio(props) {
|
|
|
93
91
|
};
|
|
94
92
|
|
|
95
93
|
var handleClick = function handleClick(e) {
|
|
94
|
+
if (disabledStatement) return;
|
|
96
95
|
setCheckedStatement(!checkedStatement);
|
|
97
96
|
props.onChange && props.onChange(e);
|
|
98
97
|
context && context.onChange(valueStatement);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../../../packages/radiogroup/radiogroup.css')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
require('../../../packages/radiogroup/radiogroup.scss')
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../../../packages/range/range.css')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
require('../../../packages/range/range.scss')
|
package/dist/esm/Range.js
CHANGED
|
@@ -7,11 +7,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
7
7
|
|
|
8
8
|
import React__default, { useState, useRef, useEffect } from 'react';
|
|
9
9
|
import { c as cn } from './bem-893ad28d.js';
|
|
10
|
-
import
|
|
10
|
+
import Toast from './Toast.js';
|
|
11
11
|
import '@bem-react/classname';
|
|
12
|
-
import 'react-dom';
|
|
13
|
-
import './icon-63c0d58f.js';
|
|
14
|
-
import 'classnames';
|
|
15
12
|
var MIN_DISTANCE = 10;
|
|
16
13
|
|
|
17
14
|
function getDirection(x, y) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../../../packages/rate/rate.css')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
require('../../../packages/rate/rate.scss')
|
package/dist/esm/Rate.js
CHANGED
|
@@ -7,7 +7,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
7
7
|
|
|
8
8
|
import React__default, { useState, useEffect } from 'react';
|
|
9
9
|
import { c as cn } from './bem-893ad28d.js';
|
|
10
|
-
import
|
|
10
|
+
import Icon from './Icon.js';
|
|
11
11
|
import '@bem-react/classname';
|
|
12
12
|
var defaultProps = {
|
|
13
13
|
count: 5,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../../../packages/row/row.css')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
require('../../../packages/row/row.scss')
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../../../packages/shortpassword/shortpassword.css')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
require('../../../packages/shortpassword/shortpassword.scss')
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../../../packages/signature/signature.css')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
require('../../../packages/signature/signature.scss')
|
package/dist/esm/Signature.js
CHANGED
|
@@ -8,9 +8,8 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
8
8
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9
9
|
|
|
10
10
|
import React__default, { useRef, useState, useEffect } from 'react';
|
|
11
|
-
import
|
|
11
|
+
import Button from './Button.js';
|
|
12
12
|
import { c as cn } from './bem-893ad28d.js';
|
|
13
|
-
import './Icon.js';
|
|
14
13
|
import '@bem-react/classname';
|
|
15
14
|
var defaultProps = {
|
|
16
15
|
type: 'png',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../../../packages/step/step.css')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
require('../../../packages/step/step.scss')
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../../../packages/steps/steps.css')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
require('../../../packages/steps/steps.scss')
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../../../packages/swiper/swiper.css')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
require('../../../packages/swiper/swiper.scss')
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../../../packages/swiperitem/swiperitem.css')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
require('../../../packages/swiperitem/swiperitem.scss')
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../../../packages/switch/switch.css')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
require('../../../packages/switch/switch.scss')
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../../../packages/tabbar/tabbar.css')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
require('../../../packages/tabbar/tabbar.scss')
|
package/dist/esm/Tabbar.js
CHANGED
|
@@ -7,7 +7,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
7
7
|
|
|
8
8
|
import React__default, { useState } from 'react';
|
|
9
9
|
import { c as cn } from './bem-893ad28d.js';
|
|
10
|
-
import TabbarItem from './TabbarItem.js';
|
|
11
10
|
import '@bem-react/classname';
|
|
12
11
|
var defaultProps = {
|
|
13
12
|
visible: 0,
|
|
@@ -65,10 +64,8 @@ var Tabbar = function Tabbar(props) {
|
|
|
65
64
|
|
|
66
65
|
return React__default.cloneElement(child, childProps);
|
|
67
66
|
}));
|
|
68
|
-
};
|
|
69
|
-
|
|
67
|
+
};
|
|
70
68
|
|
|
71
|
-
Tabbar.TabbarItem = TabbarItem;
|
|
72
69
|
Tabbar.defaultProps = defaultProps;
|
|
73
70
|
Tabbar.displayName = 'NutTabbar';
|
|
74
71
|
export { Tabbar as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../../../packages/tabbaritem/tabbaritem.css')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
require('../../../packages/tabbaritem/tabbaritem.scss')
|
package/dist/esm/TabbarItem.js
CHANGED
|
@@ -6,7 +6,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
6
6
|
|
|
7
7
|
import React__default, { useEffect } from 'react';
|
|
8
8
|
import { c as cn } from './bem-893ad28d.js';
|
|
9
|
-
import
|
|
9
|
+
import Icon from './Icon.js';
|
|
10
10
|
import '@bem-react/classname';
|
|
11
11
|
var defaultProps = {
|
|
12
12
|
tabTitle: '',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../../../packages/tag/tag.css')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
require('../../../packages/tag/tag.scss')
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../../../packages/textarea/textarea.css')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
require('../../../packages/textarea/textarea.scss')
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../../../packages/toast/toast.css')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
require('../../../packages/toast/toast.scss')
|
package/dist/esm/Toast.js
CHANGED
|
@@ -1,8 +1,295 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
+
|
|
9
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10
|
+
|
|
11
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12
|
+
|
|
13
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
14
|
+
|
|
15
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
16
|
+
|
|
17
|
+
import * as React from 'react';
|
|
18
|
+
import * as ReactDOM from 'react-dom';
|
|
19
|
+
import { c as cn } from './bem-893ad28d.js';
|
|
20
|
+
import Icon from './Icon.js';
|
|
21
|
+
import classNames from 'classnames';
|
|
6
22
|
import '@bem-react/classname';
|
|
7
|
-
|
|
8
|
-
|
|
23
|
+
|
|
24
|
+
var Notification = /*#__PURE__*/function (_React$PureComponent) {
|
|
25
|
+
_inherits(Notification, _React$PureComponent);
|
|
26
|
+
|
|
27
|
+
var _super = _createSuper(Notification);
|
|
28
|
+
|
|
29
|
+
function Notification(props) {
|
|
30
|
+
var _this;
|
|
31
|
+
|
|
32
|
+
_classCallCheck(this, Notification);
|
|
33
|
+
|
|
34
|
+
_this = _super.call(this, props);
|
|
35
|
+
|
|
36
|
+
_defineProperty(_assertThisInitialized(_this), "closeTimer", void 0);
|
|
37
|
+
|
|
38
|
+
_this.close = _this.close.bind(_assertThisInitialized(_this));
|
|
39
|
+
_this.startCloseTimer = _this.startCloseTimer.bind(_assertThisInitialized(_this));
|
|
40
|
+
_this.clearCloseTimer = _this.clearCloseTimer.bind(_assertThisInitialized(_this));
|
|
41
|
+
_this.close = _this.close.bind(_assertThisInitialized(_this));
|
|
42
|
+
_this.clickCover = _this.clickCover.bind(_assertThisInitialized(_this));
|
|
43
|
+
_this.state = {
|
|
44
|
+
show: true
|
|
45
|
+
};
|
|
46
|
+
return _this;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
_createClass(Notification, [{
|
|
50
|
+
key: "close",
|
|
51
|
+
value: function close() {
|
|
52
|
+
this.setState({
|
|
53
|
+
show: false
|
|
54
|
+
});
|
|
55
|
+
this.clearCloseTimer();
|
|
56
|
+
this.props.onClose();
|
|
57
|
+
}
|
|
58
|
+
}, {
|
|
59
|
+
key: "startCloseTimer",
|
|
60
|
+
value: function startCloseTimer() {
|
|
61
|
+
var _this2 = this;
|
|
62
|
+
|
|
63
|
+
var duration = this.props.duration;
|
|
64
|
+
|
|
65
|
+
if (duration) {
|
|
66
|
+
this.closeTimer = window.setTimeout(function () {
|
|
67
|
+
_this2.close();
|
|
68
|
+
}, duration * 1000);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}, {
|
|
72
|
+
key: "clearCloseTimer",
|
|
73
|
+
value: function clearCloseTimer() {
|
|
74
|
+
if (this.closeTimer) {
|
|
75
|
+
clearTimeout(this.closeTimer);
|
|
76
|
+
this.closeTimer = -1;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}, {
|
|
80
|
+
key: "clickCover",
|
|
81
|
+
value: function clickCover() {
|
|
82
|
+
var closeOnClickOverlay = this.props.closeOnClickOverlay;
|
|
83
|
+
|
|
84
|
+
if (closeOnClickOverlay) {
|
|
85
|
+
this.close();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}, {
|
|
89
|
+
key: "componentDidMount",
|
|
90
|
+
value: function componentDidMount() {
|
|
91
|
+
this.startCloseTimer();
|
|
92
|
+
}
|
|
93
|
+
}, {
|
|
94
|
+
key: "componentWillUnmount",
|
|
95
|
+
value: function componentWillUnmount() {
|
|
96
|
+
this.clearCloseTimer();
|
|
97
|
+
}
|
|
98
|
+
}, {
|
|
99
|
+
key: "render",
|
|
100
|
+
value: function render() {
|
|
101
|
+
var _classNames,
|
|
102
|
+
_this3 = this;
|
|
103
|
+
|
|
104
|
+
var _this$props = this.props,
|
|
105
|
+
style = _this$props.style,
|
|
106
|
+
icon = _this$props.icon,
|
|
107
|
+
msg = _this$props.msg,
|
|
108
|
+
bottom = _this$props.bottom,
|
|
109
|
+
center = _this$props.center,
|
|
110
|
+
bgColor = _this$props.bgColor,
|
|
111
|
+
coverColor = _this$props.coverColor,
|
|
112
|
+
textAlignCenter = _this$props.textAlignCenter,
|
|
113
|
+
size = _this$props.size,
|
|
114
|
+
customClass = _this$props.customClass,
|
|
115
|
+
cover = _this$props.cover,
|
|
116
|
+
type = _this$props.type;
|
|
117
|
+
this.state;
|
|
118
|
+
var toastBem = cn('toast');
|
|
119
|
+
var classes = classNames((_classNames = {}, _defineProperty(_classNames, 'nut-toast-center', center), _defineProperty(_classNames, 'nut-toast-has-icon', icon), _defineProperty(_classNames, 'nut-toast-cover', cover), _defineProperty(_classNames, 'nut-toast-loading', type === 'loading'), _defineProperty(_classNames, "customClass", customClass), _defineProperty(_classNames, 'nut-toast-' + size, true), _classNames));
|
|
120
|
+
return React.createElement(React.Fragment, null, React.createElement("div", {
|
|
121
|
+
className: "".concat(toastBem(), " ").concat(classes),
|
|
122
|
+
style: {
|
|
123
|
+
bottom: center ? 'auto' : bottom + 'px',
|
|
124
|
+
backgroundColor: cover ? coverColor : ''
|
|
125
|
+
},
|
|
126
|
+
onClick: function onClick() {
|
|
127
|
+
_this3.clickCover();
|
|
128
|
+
}
|
|
129
|
+
}, React.createElement("div", {
|
|
130
|
+
className: toastBem('inner'),
|
|
131
|
+
style: {
|
|
132
|
+
textAlign: textAlignCenter ? 'center' : 'left',
|
|
133
|
+
backgroundColor: bgColor
|
|
134
|
+
}
|
|
135
|
+
}, icon ? React.createElement("p", {
|
|
136
|
+
className: toastBem('icon-wrapper')
|
|
137
|
+
}, React.createElement(Icon, {
|
|
138
|
+
name: icon ? icon : '',
|
|
139
|
+
size: "20"
|
|
140
|
+
})) : null, React.createElement("span", {
|
|
141
|
+
className: toastBem('text')
|
|
142
|
+
}, msg))));
|
|
143
|
+
}
|
|
144
|
+
}]);
|
|
145
|
+
|
|
146
|
+
return Notification;
|
|
147
|
+
}(React.PureComponent);
|
|
148
|
+
|
|
149
|
+
_defineProperty(Notification, "newInstance", void 0);
|
|
150
|
+
|
|
151
|
+
Notification.newInstance = function (properties, callback) {
|
|
152
|
+
var element = document.createElement('div');
|
|
153
|
+
|
|
154
|
+
if (properties.id) {
|
|
155
|
+
element.setAttribute('id', "".concat(properties.id));
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
document.body.appendChild(element);
|
|
159
|
+
var called = false;
|
|
160
|
+
|
|
161
|
+
function ref(instance) {
|
|
162
|
+
if (called) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
called = true;
|
|
167
|
+
callback({
|
|
168
|
+
component: instance,
|
|
169
|
+
destroy: function destroy() {
|
|
170
|
+
ReactDOM.unmountComponentAtNode(element);
|
|
171
|
+
element && element.parentNode && element.parentNode.removeChild(element);
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
ReactDOM.render(React.createElement(Notification, _objectSpread(_objectSpread({}, properties), {}, {
|
|
177
|
+
ref: ref
|
|
178
|
+
})), element);
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
var messageInstance = null;
|
|
182
|
+
var options = {
|
|
183
|
+
msg: '',
|
|
184
|
+
id: '',
|
|
185
|
+
duration: 1.5,
|
|
186
|
+
center: true,
|
|
187
|
+
type: 'text',
|
|
188
|
+
customClass: '',
|
|
189
|
+
bottom: 30,
|
|
190
|
+
size: 'base',
|
|
191
|
+
icon: '',
|
|
192
|
+
textAlignCenter: true,
|
|
193
|
+
loadingRotate: true,
|
|
194
|
+
bgColor: 'rgba(0, 0, 0, .8)',
|
|
195
|
+
onClose: function onClose() {},
|
|
196
|
+
cover: false,
|
|
197
|
+
coverColor: 'rgba(0, 0, 0, 0)',
|
|
198
|
+
closeOnClickOverlay: false // 是否点击遮罩可关闭
|
|
199
|
+
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
function getInstance(props, callback) {
|
|
203
|
+
if (messageInstance) {
|
|
204
|
+
messageInstance.destroy();
|
|
205
|
+
messageInstance = null;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
Notification.newInstance(props, function (notification) {
|
|
209
|
+
return callback && callback(notification);
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
function notice(opts) {
|
|
214
|
+
function close() {
|
|
215
|
+
if (messageInstance) {
|
|
216
|
+
messageInstance.destroy();
|
|
217
|
+
messageInstance = null;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
opts = _objectSpread(_objectSpread(_objectSpread({}, options), opts), {}, {
|
|
222
|
+
onClose: close
|
|
223
|
+
});
|
|
224
|
+
getInstance(opts, function (notification) {
|
|
225
|
+
messageInstance = notification;
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
var errorMsg = function errorMsg(msg) {
|
|
230
|
+
if (!msg) {
|
|
231
|
+
console.warn('[NutUI Toast]: msg不能为空');
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
var Toast = {
|
|
237
|
+
text: function text(msg) {
|
|
238
|
+
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
239
|
+
errorMsg(msg);
|
|
240
|
+
return notice(_objectSpread({
|
|
241
|
+
msg: msg,
|
|
242
|
+
type: 'text'
|
|
243
|
+
}, option));
|
|
244
|
+
},
|
|
245
|
+
success: function success(msg) {
|
|
246
|
+
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
247
|
+
errorMsg(msg);
|
|
248
|
+
return notice(_objectSpread({
|
|
249
|
+
msg: msg,
|
|
250
|
+
icon: 'success',
|
|
251
|
+
type: 'success'
|
|
252
|
+
}, option));
|
|
253
|
+
},
|
|
254
|
+
fail: function fail(msg) {
|
|
255
|
+
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
256
|
+
errorMsg(msg);
|
|
257
|
+
return notice(_objectSpread({
|
|
258
|
+
msg: msg,
|
|
259
|
+
icon: 'failure',
|
|
260
|
+
type: 'fail'
|
|
261
|
+
}, option));
|
|
262
|
+
},
|
|
263
|
+
loading: function loading(msg) {
|
|
264
|
+
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
265
|
+
errorMsg(msg);
|
|
266
|
+
return notice(_objectSpread({
|
|
267
|
+
msg: msg,
|
|
268
|
+
icon: 'loading',
|
|
269
|
+
type: 'loading'
|
|
270
|
+
}, option));
|
|
271
|
+
},
|
|
272
|
+
warn: function warn(msg) {
|
|
273
|
+
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
274
|
+
errorMsg(msg);
|
|
275
|
+
return notice(_objectSpread({
|
|
276
|
+
msg: msg,
|
|
277
|
+
icon: 'tips',
|
|
278
|
+
type: 'warn'
|
|
279
|
+
}, option));
|
|
280
|
+
},
|
|
281
|
+
customIcon: function customIcon(msg) {
|
|
282
|
+
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
283
|
+
errorMsg(msg);
|
|
284
|
+
return notice(_objectSpread({
|
|
285
|
+
msg: msg
|
|
286
|
+
}, option));
|
|
287
|
+
},
|
|
288
|
+
hide: function hide() {
|
|
289
|
+
if (messageInstance) {
|
|
290
|
+
messageInstance.destroy();
|
|
291
|
+
messageInstance = null;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
export { Toast as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../../../packages/uploader/uploader.css')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
require('../../../packages/uploader/uploader.scss')
|
|
@@ -9,47 +9,47 @@ export { default as Divider } from './Divider.js';
|
|
|
9
9
|
export { default as Layout } from './Layout.js';
|
|
10
10
|
export { default as Row } from './Row.js';
|
|
11
11
|
export { default as Col } from './Col.js';
|
|
12
|
-
export { default as Drag } from './Drag.js';
|
|
13
|
-
export { default as Collapse } from './Collapse.js';
|
|
14
12
|
export { default as Toast } from './Toast.js';
|
|
15
|
-
export { default as
|
|
16
|
-
export { default as Range } from './Range.js';
|
|
17
|
-
export { default as Infiniteloading } from './Infiniteloading.js';
|
|
18
|
-
export { default as Steps } from './Steps.js';
|
|
19
|
-
export { default as Step } from './Step.js';
|
|
20
|
-
export { default as CircleProgress } from './CircleProgress.js';
|
|
13
|
+
export { default as Dialog } from './Dialog.js';
|
|
21
14
|
export { default as Popup } from './Popup.js';
|
|
22
15
|
export { default as ActionSheet } from './ActionSheet.js';
|
|
16
|
+
export { default as Picker } from './Picker.js';
|
|
17
|
+
export { default as Infiniteloading } from './Infiniteloading.js';
|
|
18
|
+
export { default as Popover } from './Popover.js';
|
|
19
|
+
export { default as Collapse } from './Collapse.js';
|
|
20
|
+
export { default as CollapseItem } from './CollapseItem.js';
|
|
21
|
+
export { default as Range } from './Range.js';
|
|
22
|
+
export { default as CircleProgress } from './CircleProgress.js';
|
|
23
23
|
export { default as NoticeBar } from './NoticeBar.js';
|
|
24
24
|
export { default as Notify } from './Notify.js';
|
|
25
|
-
export { default as Dialog } from './Dialog.js';
|
|
26
25
|
export { default as Switch } from './Switch.js';
|
|
27
|
-
export { default as CollapseItem } from './CollapseItem.js';
|
|
28
|
-
export { default as Swiper } from './Swiper.js';
|
|
29
|
-
export { default as SwiperItem } from './SwiperItem.js';
|
|
30
26
|
export { default as NavBar } from './NavBar.js';
|
|
31
27
|
export { default as Tabbar } from './Tabbar.js';
|
|
32
28
|
export { default as TabbarItem } from './TabbarItem.js';
|
|
33
|
-
export { default as InputNumber } from './InputNumber.js';
|
|
34
29
|
export { default as Elevator } from './Elevator.js';
|
|
35
30
|
export { default as FixedNav } from './FixedNav.js';
|
|
36
31
|
export { default as Pagination } from './Pagination.js';
|
|
32
|
+
export { default as Steps } from './Steps.js';
|
|
33
|
+
export { default as Step } from './Step.js';
|
|
34
|
+
export { default as Swiper } from './Swiper.js';
|
|
35
|
+
export { default as SwiperItem } from './SwiperItem.js';
|
|
36
|
+
export { default as BackTop } from './BackTop.js';
|
|
37
37
|
export { default as Rate } from './Rate.js';
|
|
38
|
-
export { default as Uploader } from './Uploader.js';
|
|
39
38
|
export { default as Input } from './Input.js';
|
|
40
39
|
export { default as TextArea } from './TextArea.js';
|
|
40
|
+
export { default as InputNumber } from './InputNumber.js';
|
|
41
|
+
export { default as ShortPassword } from './ShortPassword.js';
|
|
42
|
+
export { default as Radio } from './Radio.js';
|
|
43
|
+
export { default as RadioGroup } from './RadioGroup.js';
|
|
41
44
|
export { default as Checkbox } from './Checkbox.js';
|
|
42
45
|
export { default as CheckboxGroup } from './CheckboxGroup.js';
|
|
43
46
|
export { default as Tag } from './Tag.js';
|
|
44
|
-
export { default as Popover } from './Popover.js';
|
|
45
47
|
export { default as Badge } from './Badge.js';
|
|
46
|
-
export { default as
|
|
47
|
-
export { default as Radio } from './Radio.js';
|
|
48
|
-
export { default as RadioGroup } from './RadioGroup.js';
|
|
49
|
-
export { default as ShortPassword } from './ShortPassword.js';
|
|
48
|
+
export { default as Uploader } from './Uploader.js';
|
|
50
49
|
export { default as Calendar } from './Calendar.js';
|
|
51
50
|
export { default as CalendarItem } from './CalendarItem.js';
|
|
52
|
-
export { default as Picker } from './Picker.js';
|
|
53
|
-
export { default as Signature } from './Signature.js';
|
|
54
|
-
export { default as Barrage } from './Barrage.js';
|
|
55
51
|
export { default as Address } from './Address.js';
|
|
52
|
+
export { default as Barrage } from './Barrage.js';
|
|
53
|
+
export { default as Signature } from './Signature.js';
|
|
54
|
+
export { default as Drag } from './Drag.js';
|
|
55
|
+
export { default as AnimatingNumbers } from './AnimatingNumbers.js';
|