linkmore-design 1.0.51 → 1.0.53
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/Button/style/index.d.ts +1 -1
- package/dist/LmEditTable/style/index.d.ts +1 -1
- package/dist/index.umd.js +2260 -32
- package/dist/index.umd.min.js +6 -6
- package/dist/message/hooks/useMessage.d.ts +7 -0
- package/dist/message/index.d.ts +63 -4
- package/es/Button/style/{style.css → index.css} +0 -0
- package/es/Button/style/index.d.ts +1 -1
- package/es/Button/style/index.js +1 -1
- package/es/ButtonTags/style/{style.css → index.css} +0 -0
- package/es/ButtonTags/style/index.js +1 -1
- package/es/CardTable/style/{style.css → index.css} +0 -0
- package/es/CardTable/style/index.js +1 -1
- package/es/Checkbox/style/{style.css → index.css} +0 -0
- package/es/Checkbox/style/index.js +1 -1
- package/es/CkFilter/style/{style.css → index.css} +0 -0
- package/es/CkFilter/style/index.js +1 -1
- package/es/CustomerService/style/{style.css → index.css} +0 -0
- package/es/CustomerService/style/index.js +1 -1
- package/es/EditTable/style/{style.css → index.css} +0 -0
- package/es/EditTable/style/index.js +1 -1
- package/es/EnlargeImg/style/{style.css → index.css} +0 -0
- package/es/EnlargeImg/style/index.js +1 -1
- package/es/Filter/style/{style.css → index.css} +0 -0
- package/es/Filter/style/index.js +1 -1
- package/es/IconSelect/style/{style.css → index.css} +0 -0
- package/es/IconSelect/style/index.js +1 -1
- package/es/Input/style/{style.css → index.css} +0 -0
- package/es/Input/style/index.js +1 -1
- package/es/LeftTable/style/{style.css → index.css} +0 -0
- package/es/LeftTable/style/index.js +1 -1
- package/es/LmEditTable/style/{style.css → index.css} +0 -0
- package/es/LmEditTable/style/index.d.ts +1 -1
- package/es/LmEditTable/style/index.js +1 -1
- package/es/LmTable/style/{style.css → index.css} +0 -0
- package/es/LmTable/style/index.js +1 -1
- package/es/OldModal/style/{style.css → index.css} +0 -0
- package/es/OldModal/style/index.js +1 -1
- package/es/PopTable/style/{style.css → index.css} +0 -0
- package/es/PopTable/style/index.js +1 -1
- package/es/ProTable/style/{style.css → index.css} +0 -0
- package/es/ProTable/style/index.js +1 -1
- package/es/Radio/style/{style.css → index.css} +0 -0
- package/es/Radio/style/index.js +1 -1
- package/es/TableRender/style/{style.css → index.css} +0 -0
- package/es/TableRender/style/index.js +1 -1
- package/es/UploadOss/style/{style.css → index.css} +0 -0
- package/es/UploadOss/style/index.js +1 -1
- package/es/VirtualList/style/{style.css → index.css} +0 -0
- package/es/VirtualList/style/index.js +1 -1
- package/es/message/hooks/useMessage.d.ts +7 -0
- package/es/message/hooks/useMessage.js +83 -0
- package/es/message/index.d.ts +63 -4
- package/es/message/index.js +241 -12
- package/es/message/style/index.css +27 -1
- package/lib/Button/style/{style.css → index.css} +0 -0
- package/lib/Button/style/index.d.ts +1 -1
- package/lib/Button/style/index.js +1 -1
- package/lib/ButtonTags/style/{style.css → index.css} +0 -0
- package/lib/ButtonTags/style/index.js +1 -1
- package/lib/CardTable/style/{style.css → index.css} +0 -0
- package/lib/CardTable/style/index.js +1 -1
- package/lib/Checkbox/style/{style.css → index.css} +0 -0
- package/lib/Checkbox/style/index.js +1 -1
- package/lib/CkFilter/style/{style.css → index.css} +0 -0
- package/lib/CkFilter/style/index.js +1 -1
- package/lib/CustomerService/style/{style.css → index.css} +0 -0
- package/lib/CustomerService/style/index.js +1 -1
- package/lib/EditTable/style/{style.css → index.css} +0 -0
- package/lib/EditTable/style/index.js +1 -1
- package/lib/EnlargeImg/style/{style.css → index.css} +0 -0
- package/lib/EnlargeImg/style/index.js +1 -1
- package/lib/Filter/style/{style.css → index.css} +0 -0
- package/lib/Filter/style/index.js +1 -1
- package/lib/IconSelect/style/{style.css → index.css} +0 -0
- package/lib/IconSelect/style/index.js +1 -1
- package/lib/Input/style/{style.css → index.css} +0 -0
- package/lib/Input/style/index.js +1 -1
- package/lib/LeftTable/style/{style.css → index.css} +0 -0
- package/lib/LeftTable/style/index.js +1 -1
- package/lib/LmEditTable/style/{style.css → index.css} +0 -0
- package/lib/LmEditTable/style/index.d.ts +1 -1
- package/lib/LmEditTable/style/index.js +1 -1
- package/lib/LmTable/style/{style.css → index.css} +0 -0
- package/lib/LmTable/style/index.js +1 -1
- package/lib/OldModal/style/{style.css → index.css} +0 -0
- package/lib/OldModal/style/index.js +1 -1
- package/lib/PopTable/style/{style.css → index.css} +0 -0
- package/lib/PopTable/style/index.js +1 -1
- package/lib/ProTable/style/{style.css → index.css} +0 -0
- package/lib/ProTable/style/index.js +1 -1
- package/lib/Radio/style/{style.css → index.css} +0 -0
- package/lib/Radio/style/index.js +1 -1
- package/lib/TableRender/style/{style.css → index.css} +0 -0
- package/lib/TableRender/style/index.js +1 -1
- package/lib/UploadOss/style/{style.css → index.css} +0 -0
- package/lib/UploadOss/style/index.js +1 -1
- package/lib/VirtualList/style/{style.css → index.css} +0 -0
- package/lib/VirtualList/style/index.js +1 -1
- package/lib/message/hooks/useMessage.d.ts +7 -0
- package/lib/message/hooks/useMessage.js +101 -0
- package/lib/message/index.d.ts +63 -4
- package/lib/message/index.js +262 -16
- package/lib/message/style/index.css +27 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,18 +1,39 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('antd/es/button/style'), require('antd/es/button'), require('react'), require('antd/es/card/style'), require('antd/es/card'), require('antd/es/cascader/style'), require('antd/es/cascader'), require('antd/es/checkbox/style'), require('antd/es/checkbox'), require('antd/es/date-picker/style'), require('antd/es/date-picker'), require('react-dom'), require('antd/es/drawer/style'), require('antd/es/drawer'), require('antd/es/space/style'), require('antd/es/space'), require('antd/es/tag/style'), require('antd/es/tag'), require('antd/es/form/style'), require('antd/es/form'), require('antd/es/input/style'), require('antd/es/input'), require('antd/es/dropdown/style'), require('antd/es/dropdown'), require('antd/es/table/style'), require('antd/es/table'), require('antd/es/radio/style'), require('antd/es/radio'), require('antd/es/select/style'), require('antd/es/select'), require('antd/es/input-number/style'), require('antd/es/input-number'), require('antd/es/spin/style'), require('antd/es/spin'), require('antd/es/message/style'), require('antd/es/message'), require('antd/es/image/style'), require('antd/es/image'), require('antd/es/empty/style'), require('antd/es/empty'), require('antd/es/modal/style'), require('antd/es/modal'), require('antd/es/row/style'), require('antd/es/row'), require('antd/es/col/style'), require('antd/es/col'), require('antd/es/divider/style'), require('antd/es/divider'), require('antd/es/list/style'), require('antd/es/list'), require('antd/es/popover/style'), require('antd/es/popover'), require('antd/es/tree/style'), require('antd/es/tree'), require('antd/es/time-picker/style'), require('antd/es/time-picker'), require('antd/es/config-provider/style'), require('antd/es/config-provider'), require('antd/es/avatar/style'), require('antd/es/avatar'), require('react/jsx-runtime'), require('antd/es/locale/zh_CN'), require('antd/es/result/style'), require('antd/es/result'), require('antd/es/tooltip/style'), require('antd/es/tooltip'), require('antd/es/typography/style'), require('antd/es/typography'), require('antd/es/popconfirm/style'), require('antd/es/popconfirm'), require('antd/es/table/hooks/useLazyKVMap'), require('antd/es/badge/style'), require('antd/es/badge'), require('antd/es/progress/style'), require('antd/es/progress'), require('antd/es/rate/style'), require('antd/es/rate'), require('antd/es/switch/style'), require('antd/es/switch'), require('antd/es/tree-select/style'), require('antd/es/tree-select'), require('antd/es/tabs/style'), require('antd/es/tabs'), require('antd/es/grid/style'), require('antd/es/grid'), require('antd/es/steps/style'), require('antd/es/steps'), require('antd/es/upload/style'), require('antd/es/upload'), require('antd/es/alert/style'), require('antd/es/alert'), require('antd/es/menu/style'), require('antd/es/menu'), require('antd/es/notification/style'), require('antd/es/notification'), require('antd/es/pagination/style'), require('antd/es/pagination'), require('antd/lib/form/hooks/useFormInstance'), require('antd/lib/form/context'), require('antd/lib/form/Form')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define(['exports', 'antd/es/button/style', 'antd/es/button', 'react', 'antd/es/card/style', 'antd/es/card', 'antd/es/cascader/style', 'antd/es/cascader', 'antd/es/checkbox/style', 'antd/es/checkbox', 'antd/es/date-picker/style', 'antd/es/date-picker', 'react-dom', 'antd/es/drawer/style', 'antd/es/drawer', 'antd/es/space/style', 'antd/es/space', 'antd/es/tag/style', 'antd/es/tag', 'antd/es/form/style', 'antd/es/form', 'antd/es/input/style', 'antd/es/input', 'antd/es/dropdown/style', 'antd/es/dropdown', 'antd/es/table/style', 'antd/es/table', 'antd/es/radio/style', 'antd/es/radio', 'antd/es/select/style', 'antd/es/select', 'antd/es/input-number/style', 'antd/es/input-number', 'antd/es/spin/style', 'antd/es/spin', 'antd/es/message/style', 'antd/es/message', 'antd/es/image/style', 'antd/es/image', 'antd/es/empty/style', 'antd/es/empty', 'antd/es/modal/style', 'antd/es/modal', 'antd/es/row/style', 'antd/es/row', 'antd/es/col/style', 'antd/es/col', 'antd/es/divider/style', 'antd/es/divider', 'antd/es/list/style', 'antd/es/list', 'antd/es/popover/style', 'antd/es/popover', 'antd/es/tree/style', 'antd/es/tree', 'antd/es/time-picker/style', 'antd/es/time-picker', 'antd/es/config-provider/style', 'antd/es/config-provider', 'antd/es/avatar/style', 'antd/es/avatar', 'react/jsx-runtime', 'antd/es/locale/zh_CN', 'antd/es/result/style', 'antd/es/result', 'antd/es/tooltip/style', 'antd/es/tooltip', 'antd/es/typography/style', 'antd/es/typography', 'antd/es/popconfirm/style', 'antd/es/popconfirm', 'antd/es/table/hooks/useLazyKVMap', 'antd/es/badge/style', 'antd/es/badge', 'antd/es/progress/style', 'antd/es/progress', 'antd/es/rate/style', 'antd/es/rate', 'antd/es/switch/style', 'antd/es/switch', 'antd/es/tree-select/style', 'antd/es/tree-select', 'antd/es/tabs/style', 'antd/es/tabs', 'antd/es/grid/style', 'antd/es/grid', 'antd/es/steps/style', 'antd/es/steps', 'antd/es/upload/style', 'antd/es/upload', 'antd/es/alert/style', 'antd/es/alert', 'antd/es/menu/style', 'antd/es/menu', 'antd/es/notification/style', 'antd/es/notification', 'antd/es/pagination/style', 'antd/es/pagination', 'antd/lib/form/hooks/useFormInstance', 'antd/lib/form/context', 'antd/lib/form/Form'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.linkmoreDesign = {}, null, global._Button, global.React, null, global._Card, null, global._Cascader, null, global._Checkbox, null, global._DatePicker, global.
|
|
5
|
-
}(this, (function (exports, style, _Button, React, style$
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.linkmoreDesign = {}, null, global._Button, global.React, null, global._Card, null, global._Cascader, null, global._Checkbox, null, global._DatePicker, global.ReactDOM, null, global._Drawer, null, global._Space, null, global._Tag, null, global._Form, null, global._Input, null, global._Dropdown, null, global._Table, null, global._Radio, null, global._Select, null, global._InputNumber, null, global._Spin, null, global._message, null, global._Image, null, global._Empty, null, global._Modal, null, global._Row, null, global._Col, null, global._Divider, null, global._List, null, global._Popover, null, global._Tree, null, global._TimePicker, null, global._ConfigProvider, null, global._Avatar, global.jsxRuntime, global.zh_CN, null, global._Result, null, global._Tooltip, null, global._Typography, null, global._Popconfirm, global.useLazyKVMap, null, global._Badge, null, global._Progress, null, global._Rate, null, global._Switch, null, global._TreeSelect, null, global._Tabs, null, global._Grid, null, global._Steps, null, global._Upload, null, global._Alert, null, global._Menu, null, global._notification, null, global._Pagination, global.useFormInstance, global.context$2, global.Form$2));
|
|
5
|
+
}(this, (function (exports, style$1, _Button, React, style$2, _Card, style$3, _Cascader, style$4, _Checkbox, style$5, _DatePicker, ReactDOM, style$6, _Drawer, style$7, _Space, style$8, _Tag, style$9, _Form, style$a, _Input, style$b, _Dropdown, style$c, _Table, style$d, _Radio, style$e, _Select, style$f, _InputNumber, style$g, _Spin, style$h, _message, style$i, _Image, style$j, _Empty, style$k, _Modal, style$l, _Row, style$m, _Col, style$n, _Divider, style$o, _List, style$p, _Popover, style$q, _Tree, style$r, _TimePicker, style$s, _ConfigProvider, style$t, _Avatar, jsxRuntime, zh_CN, style$u, _Result, style$v, _Tooltip, style$w, _Typography, style$x, _Popconfirm, useLazyKVMap, style$y, _Badge, style$z, _Progress, style$A, _Rate, style$B, _Switch, style$C, _TreeSelect, style$D, _Tabs, style$E, _Grid, style$F, _Steps, style$G, _Upload, style$H, _Alert, style$I, _Menu, style$J, _notification, style$K, _Pagination, useFormInstance, context$2, Form$2) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
9
|
+
function _interopNamespace(e) {
|
|
10
|
+
if (e && e.__esModule) return e;
|
|
11
|
+
var n = Object.create(null);
|
|
12
|
+
if (e) {
|
|
13
|
+
Object.keys(e).forEach(function (k) {
|
|
14
|
+
if (k !== 'default') {
|
|
15
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () {
|
|
19
|
+
return e[k];
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
n['default'] = e;
|
|
26
|
+
return Object.freeze(n);
|
|
27
|
+
}
|
|
28
|
+
|
|
9
29
|
var _Button__default = /*#__PURE__*/_interopDefaultLegacy(_Button);
|
|
10
30
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
11
31
|
var _Card__default = /*#__PURE__*/_interopDefaultLegacy(_Card);
|
|
12
32
|
var _Cascader__default = /*#__PURE__*/_interopDefaultLegacy(_Cascader);
|
|
13
33
|
var _Checkbox__default = /*#__PURE__*/_interopDefaultLegacy(_Checkbox);
|
|
14
34
|
var _DatePicker__default = /*#__PURE__*/_interopDefaultLegacy(_DatePicker);
|
|
15
|
-
var
|
|
35
|
+
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
36
|
+
var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
|
|
16
37
|
var _Drawer__default = /*#__PURE__*/_interopDefaultLegacy(_Drawer);
|
|
17
38
|
var _Space__default = /*#__PURE__*/_interopDefaultLegacy(_Space);
|
|
18
39
|
var _Tag__default = /*#__PURE__*/_interopDefaultLegacy(_Tag);
|
|
@@ -2017,6 +2038,19 @@
|
|
|
2017
2038
|
ClockCircleFilled$1.displayName = 'ClockCircleFilled';
|
|
2018
2039
|
var ClockCircleFilled$2 = /*#__PURE__*/React.forwardRef(ClockCircleFilled$1);
|
|
2019
2040
|
|
|
2041
|
+
// This icon file is generated automatically.
|
|
2042
|
+
var CloseCircleFilled = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z" } }] }, "name": "close-circle", "theme": "filled" };
|
|
2043
|
+
|
|
2044
|
+
var CloseCircleFilled$1 = function CloseCircleFilled$1(props, ref) {
|
|
2045
|
+
return /*#__PURE__*/React.createElement(Icon, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
2046
|
+
ref: ref,
|
|
2047
|
+
icon: CloseCircleFilled
|
|
2048
|
+
}));
|
|
2049
|
+
};
|
|
2050
|
+
|
|
2051
|
+
CloseCircleFilled$1.displayName = 'CloseCircleFilled';
|
|
2052
|
+
var CloseCircleFilled$2 = /*#__PURE__*/React.forwardRef(CloseCircleFilled$1);
|
|
2053
|
+
|
|
2020
2054
|
// This icon file is generated automatically.
|
|
2021
2055
|
var CloseOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z" } }] }, "name": "close", "theme": "outlined" };
|
|
2022
2056
|
|
|
@@ -2108,6 +2142,19 @@
|
|
|
2108
2142
|
EllipsisOutlined$1.displayName = 'EllipsisOutlined';
|
|
2109
2143
|
var EllipsisOutlined$2 = /*#__PURE__*/React.forwardRef(EllipsisOutlined$1);
|
|
2110
2144
|
|
|
2145
|
+
// This icon file is generated automatically.
|
|
2146
|
+
var ExclamationCircleFilled = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, "name": "exclamation-circle", "theme": "filled" };
|
|
2147
|
+
|
|
2148
|
+
var ExclamationCircleFilled$1 = function ExclamationCircleFilled$1(props, ref) {
|
|
2149
|
+
return /*#__PURE__*/React.createElement(Icon, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
2150
|
+
ref: ref,
|
|
2151
|
+
icon: ExclamationCircleFilled
|
|
2152
|
+
}));
|
|
2153
|
+
};
|
|
2154
|
+
|
|
2155
|
+
ExclamationCircleFilled$1.displayName = 'ExclamationCircleFilled';
|
|
2156
|
+
var ExclamationCircleFilled$2 = /*#__PURE__*/React.forwardRef(ExclamationCircleFilled$1);
|
|
2157
|
+
|
|
2111
2158
|
// This icon file is generated automatically.
|
|
2112
2159
|
var ExportOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M888.3 757.4h-53.8c-4.2 0-7.7 3.5-7.7 7.7v61.8H197.1V197.1h629.8v61.8c0 4.2 3.5 7.7 7.7 7.7h53.8c4.2 0 7.7-3.4 7.7-7.7V158.7c0-17-13.7-30.7-30.7-30.7H158.7c-17 0-30.7 13.7-30.7 30.7v706.6c0 17 13.7 30.7 30.7 30.7h706.6c17 0 30.7-13.7 30.7-30.7V765.1c0-4.3-3.5-7.7-7.7-7.7zm18.6-251.7L765 393.7c-5.3-4.2-13-.4-13 6.3v76H438c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h314v76c0 6.7 7.8 10.5 13 6.3l141.9-112a8 8 0 000-12.6z" } }] }, "name": "export", "theme": "outlined" };
|
|
2113
2160
|
|
|
@@ -2199,6 +2246,19 @@
|
|
|
2199
2246
|
HolderOutlined$1.displayName = 'HolderOutlined';
|
|
2200
2247
|
var HolderOutlined$2 = /*#__PURE__*/React.forwardRef(HolderOutlined$1);
|
|
2201
2248
|
|
|
2249
|
+
// This icon file is generated automatically.
|
|
2250
|
+
var InfoCircleFilled = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, "name": "info-circle", "theme": "filled" };
|
|
2251
|
+
|
|
2252
|
+
var InfoCircleFilled$1 = function InfoCircleFilled$1(props, ref) {
|
|
2253
|
+
return /*#__PURE__*/React.createElement(Icon, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
2254
|
+
ref: ref,
|
|
2255
|
+
icon: InfoCircleFilled
|
|
2256
|
+
}));
|
|
2257
|
+
};
|
|
2258
|
+
|
|
2259
|
+
InfoCircleFilled$1.displayName = 'InfoCircleFilled';
|
|
2260
|
+
var InfoCircleFilled$2 = /*#__PURE__*/React.forwardRef(InfoCircleFilled$1);
|
|
2261
|
+
|
|
2202
2262
|
// This icon file is generated automatically.
|
|
2203
2263
|
var InfoCircleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { "tag": "path", "attrs": { "d": "M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z" } }] }, "name": "info-circle", "theme": "outlined" };
|
|
2204
2264
|
|
|
@@ -26766,7 +26826,7 @@
|
|
|
26766
26826
|
}
|
|
26767
26827
|
|
|
26768
26828
|
}), [announce, announcements]));
|
|
26769
|
-
return mounted ?
|
|
26829
|
+
return mounted ? ReactDOM.createPortal(React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(HiddenText, {
|
|
26770
26830
|
id: hiddenTextDescribedById,
|
|
26771
26831
|
value: screenReaderInstructions.draggable
|
|
26772
26832
|
}), React__default['default'].createElement(LiveRegion, {
|
|
@@ -28708,7 +28768,7 @@
|
|
|
28708
28768
|
rect: activeRects
|
|
28709
28769
|
}
|
|
28710
28770
|
};
|
|
28711
|
-
|
|
28771
|
+
ReactDOM.unstable_batchedUpdates(() => {
|
|
28712
28772
|
dispatch({
|
|
28713
28773
|
type: Action.DragStart,
|
|
28714
28774
|
initialCoordinates,
|
|
@@ -28732,7 +28792,7 @@
|
|
|
28732
28792
|
onEnd: createHandler(Action.DragEnd),
|
|
28733
28793
|
onCancel: createHandler(Action.DragCancel)
|
|
28734
28794
|
});
|
|
28735
|
-
|
|
28795
|
+
ReactDOM.unstable_batchedUpdates(() => {
|
|
28736
28796
|
setActiveSensor(sensorInstance);
|
|
28737
28797
|
setActivatorEvent(event.nativeEvent);
|
|
28738
28798
|
});
|
|
@@ -28768,7 +28828,7 @@
|
|
|
28768
28828
|
}
|
|
28769
28829
|
|
|
28770
28830
|
activeRef.current = null;
|
|
28771
|
-
|
|
28831
|
+
ReactDOM.unstable_batchedUpdates(() => {
|
|
28772
28832
|
dispatch({
|
|
28773
28833
|
type
|
|
28774
28834
|
});
|
|
@@ -28893,7 +28953,7 @@
|
|
|
28893
28953
|
},
|
|
28894
28954
|
over
|
|
28895
28955
|
};
|
|
28896
|
-
|
|
28956
|
+
ReactDOM.unstable_batchedUpdates(() => {
|
|
28897
28957
|
setOver(over);
|
|
28898
28958
|
setMonitorState({
|
|
28899
28959
|
type: Action.DragOver,
|
|
@@ -58398,7 +58458,7 @@
|
|
|
58398
58458
|
_createClass(WithSortableHandle, [{
|
|
58399
58459
|
key: "componentDidMount",
|
|
58400
58460
|
value: function componentDidMount() {
|
|
58401
|
-
var node =
|
|
58461
|
+
var node = ReactDOM.findDOMNode(this);
|
|
58402
58462
|
node.sortableHandle = true;
|
|
58403
58463
|
}
|
|
58404
58464
|
}, {
|
|
@@ -59458,7 +59518,7 @@
|
|
|
59458
59518
|
var getContainer = this.props.getContainer;
|
|
59459
59519
|
|
|
59460
59520
|
if (typeof getContainer !== 'function') {
|
|
59461
|
-
return
|
|
59521
|
+
return ReactDOM.findDOMNode(this);
|
|
59462
59522
|
}
|
|
59463
59523
|
|
|
59464
59524
|
return getContainer(config.withRef ? this.getWrappedInstance() : undefined);
|
|
@@ -59583,7 +59643,7 @@
|
|
|
59583
59643
|
collection = _this$props.collection,
|
|
59584
59644
|
disabled = _this$props.disabled,
|
|
59585
59645
|
index = _this$props.index;
|
|
59586
|
-
var node =
|
|
59646
|
+
var node = ReactDOM.findDOMNode(this);
|
|
59587
59647
|
node.sortableInfo = {
|
|
59588
59648
|
collection: collection,
|
|
59589
59649
|
disabled: disabled,
|
|
@@ -68012,7 +68072,7 @@
|
|
|
68012
68072
|
}, [(_context$locale3 = context.locale) === null || _context$locale3 === void 0 ? void 0 : (_context$locale3$Moda = _context$locale3.Modal) === null || _context$locale3$Moda === void 0 ? void 0 : _context$locale3$Moda.cancelText, (_context$locale4 = context.locale) === null || _context$locale4 === void 0 ? void 0 : (_context$locale4$Moda = _context$locale4.Modal) === null || _context$locale4$Moda === void 0 ? void 0 : _context$locale4$Moda.okText, drawerProps, rest.submitter, setVisible, loading, submitTimeout]);
|
|
68013
68073
|
var contentRender = React.useCallback(function (formDom, submitter) {
|
|
68014
68074
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
68015
|
-
children: [formDom, footerRef.current && submitter ? /*#__PURE__*/
|
|
68075
|
+
children: [formDom, footerRef.current && submitter ? /*#__PURE__*/ReactDOM.createPortal(submitter, footerRef.current) : submitter]
|
|
68016
68076
|
});
|
|
68017
68077
|
}, []);
|
|
68018
68078
|
var onFinishHandle = useRefFunction( /*#__PURE__*/function () {
|
|
@@ -68487,7 +68547,7 @@
|
|
|
68487
68547
|
}, [(_context$locale3 = context.locale) === null || _context$locale3 === void 0 ? void 0 : (_context$locale3$Moda = _context$locale3.Modal) === null || _context$locale3$Moda === void 0 ? void 0 : _context$locale3$Moda.cancelText, (_context$locale4 = context.locale) === null || _context$locale4 === void 0 ? void 0 : (_context$locale4$Moda = _context$locale4.Modal) === null || _context$locale4$Moda === void 0 ? void 0 : _context$locale4$Moda.okText, modalProps, rest.submitter, setVisible, loading, submitTimeout]);
|
|
68488
68548
|
var contentRender = React.useCallback(function (formDom, submitter) {
|
|
68489
68549
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
68490
|
-
children: [formDom, footerRef.current && submitter ? /*#__PURE__*/
|
|
68550
|
+
children: [formDom, footerRef.current && submitter ? /*#__PURE__*/ReactDOM.createPortal(submitter, footerRef.current) : submitter]
|
|
68491
68551
|
});
|
|
68492
68552
|
}, []);
|
|
68493
68553
|
var onFinishHandle = React.useCallback( /*#__PURE__*/function () {
|
|
@@ -68662,7 +68722,7 @@
|
|
|
68662
68722
|
return node;
|
|
68663
68723
|
}
|
|
68664
68724
|
|
|
68665
|
-
return
|
|
68725
|
+
return ReactDOM__default['default'].findDOMNode(node);
|
|
68666
68726
|
}
|
|
68667
68727
|
|
|
68668
68728
|
/**
|
|
@@ -76605,7 +76665,7 @@
|
|
|
76605
76665
|
|
|
76606
76666
|
var _propTypes = _interopRequireDefault(propTypes);
|
|
76607
76667
|
|
|
76608
|
-
var _reactDom = _interopRequireDefault(
|
|
76668
|
+
var _reactDom = _interopRequireDefault(ReactDOM__default['default']);
|
|
76609
76669
|
|
|
76610
76670
|
|
|
76611
76671
|
|
|
@@ -77184,7 +77244,7 @@
|
|
|
77184
77244
|
|
|
77185
77245
|
var _propTypes = _interopRequireDefault(propTypes);
|
|
77186
77246
|
|
|
77187
|
-
var _reactDom = _interopRequireDefault(
|
|
77247
|
+
var _reactDom = _interopRequireDefault(ReactDOM__default['default']);
|
|
77188
77248
|
|
|
77189
77249
|
var _clsx2 = _interopRequireDefault(require$$3);
|
|
77190
77250
|
|
|
@@ -84055,7 +84115,2180 @@
|
|
|
84055
84115
|
});
|
|
84056
84116
|
LmTag.CheckableTag = _Tag__default['default'].CheckableTag;
|
|
84057
84117
|
|
|
84058
|
-
var
|
|
84118
|
+
var fullClone = _objectSpread2({}, ReactDOM__namespace);
|
|
84119
|
+
|
|
84120
|
+
var version = fullClone.version,
|
|
84121
|
+
reactRender = fullClone.render,
|
|
84122
|
+
unmountComponentAtNode = fullClone.unmountComponentAtNode;
|
|
84123
|
+
var createRoot;
|
|
84124
|
+
|
|
84125
|
+
try {
|
|
84126
|
+
var mainVersion = Number((version || '').split('.')[0]);
|
|
84127
|
+
|
|
84128
|
+
if (mainVersion >= 18) {
|
|
84129
|
+
createRoot = fullClone.createRoot;
|
|
84130
|
+
}
|
|
84131
|
+
} catch (e) {// Do nothing;
|
|
84132
|
+
}
|
|
84133
|
+
|
|
84134
|
+
function toggleWarning(skip) {
|
|
84135
|
+
var __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = fullClone.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
84136
|
+
|
|
84137
|
+
if (__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED && _typeof$1(__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === 'object') {
|
|
84138
|
+
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.usingClientEntryPoint = skip;
|
|
84139
|
+
}
|
|
84140
|
+
}
|
|
84141
|
+
|
|
84142
|
+
var MARK = '__rc_react_root__';
|
|
84143
|
+
|
|
84144
|
+
function modernRender(node, container) {
|
|
84145
|
+
toggleWarning(true);
|
|
84146
|
+
var root = container[MARK] || createRoot(container);
|
|
84147
|
+
toggleWarning(false);
|
|
84148
|
+
root.render(node);
|
|
84149
|
+
container[MARK] = root;
|
|
84150
|
+
}
|
|
84151
|
+
|
|
84152
|
+
function legacyRender(node, container) {
|
|
84153
|
+
reactRender(node, container);
|
|
84154
|
+
}
|
|
84155
|
+
function render$3(node, container) {
|
|
84156
|
+
if (createRoot) {
|
|
84157
|
+
modernRender(node, container);
|
|
84158
|
+
return;
|
|
84159
|
+
}
|
|
84160
|
+
|
|
84161
|
+
legacyRender(node, container);
|
|
84162
|
+
} // ========================= Unmount ==========================
|
|
84163
|
+
|
|
84164
|
+
function modernUnmount(_x) {
|
|
84165
|
+
return _modernUnmount.apply(this, arguments);
|
|
84166
|
+
}
|
|
84167
|
+
|
|
84168
|
+
function _modernUnmount() {
|
|
84169
|
+
_modernUnmount = _asyncToGenerator$1( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(container) {
|
|
84170
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
84171
|
+
while (1) {
|
|
84172
|
+
switch (_context.prev = _context.next) {
|
|
84173
|
+
case 0:
|
|
84174
|
+
return _context.abrupt("return", Promise.resolve().then(function () {
|
|
84175
|
+
var _container$MARK;
|
|
84176
|
+
|
|
84177
|
+
(_container$MARK = container[MARK]) === null || _container$MARK === void 0 ? void 0 : _container$MARK.unmount();
|
|
84178
|
+
delete container[MARK];
|
|
84179
|
+
}));
|
|
84180
|
+
|
|
84181
|
+
case 1:
|
|
84182
|
+
case "end":
|
|
84183
|
+
return _context.stop();
|
|
84184
|
+
}
|
|
84185
|
+
}
|
|
84186
|
+
}, _callee);
|
|
84187
|
+
}));
|
|
84188
|
+
return _modernUnmount.apply(this, arguments);
|
|
84189
|
+
}
|
|
84190
|
+
|
|
84191
|
+
function legacyUnmount(container) {
|
|
84192
|
+
unmountComponentAtNode(container);
|
|
84193
|
+
}
|
|
84194
|
+
function unmount(_x2) {
|
|
84195
|
+
return _unmount.apply(this, arguments);
|
|
84196
|
+
}
|
|
84197
|
+
|
|
84198
|
+
function _unmount() {
|
|
84199
|
+
_unmount = _asyncToGenerator$1( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(container) {
|
|
84200
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
84201
|
+
while (1) {
|
|
84202
|
+
switch (_context2.prev = _context2.next) {
|
|
84203
|
+
case 0:
|
|
84204
|
+
if (!(createRoot !== undefined)) {
|
|
84205
|
+
_context2.next = 2;
|
|
84206
|
+
break;
|
|
84207
|
+
}
|
|
84208
|
+
|
|
84209
|
+
return _context2.abrupt("return", modernUnmount(container));
|
|
84210
|
+
|
|
84211
|
+
case 2:
|
|
84212
|
+
legacyUnmount(container);
|
|
84213
|
+
|
|
84214
|
+
case 3:
|
|
84215
|
+
case "end":
|
|
84216
|
+
return _context2.stop();
|
|
84217
|
+
}
|
|
84218
|
+
}
|
|
84219
|
+
}, _callee2);
|
|
84220
|
+
}));
|
|
84221
|
+
return _unmount.apply(this, arguments);
|
|
84222
|
+
}
|
|
84223
|
+
|
|
84224
|
+
// Event wrapper. Copy from react source code
|
|
84225
|
+
|
|
84226
|
+
function makePrefixMap(styleProp, eventName) {
|
|
84227
|
+
var prefixes = {};
|
|
84228
|
+
prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
|
|
84229
|
+
prefixes["Webkit".concat(styleProp)] = "webkit".concat(eventName);
|
|
84230
|
+
prefixes["Moz".concat(styleProp)] = "moz".concat(eventName);
|
|
84231
|
+
prefixes["ms".concat(styleProp)] = "MS".concat(eventName);
|
|
84232
|
+
prefixes["O".concat(styleProp)] = "o".concat(eventName.toLowerCase());
|
|
84233
|
+
return prefixes;
|
|
84234
|
+
}
|
|
84235
|
+
|
|
84236
|
+
function getVendorPrefixes(domSupport, win) {
|
|
84237
|
+
var prefixes = {
|
|
84238
|
+
animationend: makePrefixMap('Animation', 'AnimationEnd'),
|
|
84239
|
+
transitionend: makePrefixMap('Transition', 'TransitionEnd')
|
|
84240
|
+
};
|
|
84241
|
+
|
|
84242
|
+
if (domSupport) {
|
|
84243
|
+
if (!('AnimationEvent' in win)) {
|
|
84244
|
+
delete prefixes.animationend.animation;
|
|
84245
|
+
}
|
|
84246
|
+
|
|
84247
|
+
if (!('TransitionEvent' in win)) {
|
|
84248
|
+
delete prefixes.transitionend.transition;
|
|
84249
|
+
}
|
|
84250
|
+
}
|
|
84251
|
+
|
|
84252
|
+
return prefixes;
|
|
84253
|
+
}
|
|
84254
|
+
var vendorPrefixes = getVendorPrefixes(canUseDom(), typeof window !== 'undefined' ? window : {});
|
|
84255
|
+
var style = {};
|
|
84256
|
+
|
|
84257
|
+
if (canUseDom()) {
|
|
84258
|
+
var _document$createEleme = document.createElement('div');
|
|
84259
|
+
|
|
84260
|
+
style = _document$createEleme.style;
|
|
84261
|
+
}
|
|
84262
|
+
|
|
84263
|
+
var prefixedEventNames = {};
|
|
84264
|
+
function getVendorPrefixedEventName(eventName) {
|
|
84265
|
+
if (prefixedEventNames[eventName]) {
|
|
84266
|
+
return prefixedEventNames[eventName];
|
|
84267
|
+
}
|
|
84268
|
+
|
|
84269
|
+
var prefixMap = vendorPrefixes[eventName];
|
|
84270
|
+
|
|
84271
|
+
if (prefixMap) {
|
|
84272
|
+
var stylePropList = Object.keys(prefixMap);
|
|
84273
|
+
var len = stylePropList.length;
|
|
84274
|
+
|
|
84275
|
+
for (var i = 0; i < len; i += 1) {
|
|
84276
|
+
var styleProp = stylePropList[i];
|
|
84277
|
+
|
|
84278
|
+
if (Object.prototype.hasOwnProperty.call(prefixMap, styleProp) && styleProp in style) {
|
|
84279
|
+
prefixedEventNames[eventName] = prefixMap[styleProp];
|
|
84280
|
+
return prefixedEventNames[eventName];
|
|
84281
|
+
}
|
|
84282
|
+
}
|
|
84283
|
+
}
|
|
84284
|
+
|
|
84285
|
+
return '';
|
|
84286
|
+
}
|
|
84287
|
+
var internalAnimationEndName = getVendorPrefixedEventName('animationend');
|
|
84288
|
+
var internalTransitionEndName = getVendorPrefixedEventName('transitionend');
|
|
84289
|
+
var supportTransition = !!(internalAnimationEndName && internalTransitionEndName);
|
|
84290
|
+
var animationEndName = internalAnimationEndName || 'animationend';
|
|
84291
|
+
var transitionEndName = internalTransitionEndName || 'transitionend';
|
|
84292
|
+
function getTransitionName(transitionName, transitionType) {
|
|
84293
|
+
if (!transitionName) return null;
|
|
84294
|
+
|
|
84295
|
+
if (_typeof$1(transitionName) === 'object') {
|
|
84296
|
+
var type = transitionType.replace(/-\w/g, function (match) {
|
|
84297
|
+
return match[1].toUpperCase();
|
|
84298
|
+
});
|
|
84299
|
+
return transitionName[type];
|
|
84300
|
+
}
|
|
84301
|
+
|
|
84302
|
+
return "".concat(transitionName, "-").concat(transitionType);
|
|
84303
|
+
}
|
|
84304
|
+
|
|
84305
|
+
var STATUS_NONE = 'none';
|
|
84306
|
+
var STATUS_APPEAR = 'appear';
|
|
84307
|
+
var STATUS_ENTER = 'enter';
|
|
84308
|
+
var STATUS_LEAVE = 'leave';
|
|
84309
|
+
var STEP_NONE = 'none';
|
|
84310
|
+
var STEP_PREPARE = 'prepare';
|
|
84311
|
+
var STEP_START = 'start';
|
|
84312
|
+
var STEP_ACTIVE = 'active';
|
|
84313
|
+
var STEP_ACTIVATED = 'end';
|
|
84314
|
+
|
|
84315
|
+
var raf = function raf(callback) {
|
|
84316
|
+
return +setTimeout(callback, 16);
|
|
84317
|
+
};
|
|
84318
|
+
|
|
84319
|
+
var caf = function caf(num) {
|
|
84320
|
+
return clearTimeout(num);
|
|
84321
|
+
};
|
|
84322
|
+
|
|
84323
|
+
if (typeof window !== 'undefined' && 'requestAnimationFrame' in window) {
|
|
84324
|
+
raf = function raf(callback) {
|
|
84325
|
+
return window.requestAnimationFrame(callback);
|
|
84326
|
+
};
|
|
84327
|
+
|
|
84328
|
+
caf = function caf(handle) {
|
|
84329
|
+
return window.cancelAnimationFrame(handle);
|
|
84330
|
+
};
|
|
84331
|
+
}
|
|
84332
|
+
|
|
84333
|
+
var rafUUID = 0;
|
|
84334
|
+
var rafIds = new Map();
|
|
84335
|
+
|
|
84336
|
+
function cleanup(id) {
|
|
84337
|
+
rafIds.delete(id);
|
|
84338
|
+
}
|
|
84339
|
+
|
|
84340
|
+
function wrapperRaf(callback) {
|
|
84341
|
+
var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
84342
|
+
rafUUID += 1;
|
|
84343
|
+
var id = rafUUID;
|
|
84344
|
+
|
|
84345
|
+
function callRef(leftTimes) {
|
|
84346
|
+
if (leftTimes === 0) {
|
|
84347
|
+
// Clean up
|
|
84348
|
+
cleanup(id); // Trigger
|
|
84349
|
+
|
|
84350
|
+
callback();
|
|
84351
|
+
} else {
|
|
84352
|
+
// Next raf
|
|
84353
|
+
var realId = raf(function () {
|
|
84354
|
+
callRef(leftTimes - 1);
|
|
84355
|
+
}); // Bind real raf id
|
|
84356
|
+
|
|
84357
|
+
rafIds.set(id, realId);
|
|
84358
|
+
}
|
|
84359
|
+
}
|
|
84360
|
+
|
|
84361
|
+
callRef(times);
|
|
84362
|
+
return id;
|
|
84363
|
+
}
|
|
84364
|
+
|
|
84365
|
+
wrapperRaf.cancel = function (id) {
|
|
84366
|
+
var realId = rafIds.get(id);
|
|
84367
|
+
cleanup(realId);
|
|
84368
|
+
return caf(realId);
|
|
84369
|
+
};
|
|
84370
|
+
|
|
84371
|
+
var useNextFrame = (function () {
|
|
84372
|
+
var nextFrameRef = React.useRef(null);
|
|
84373
|
+
|
|
84374
|
+
function cancelNextFrame() {
|
|
84375
|
+
wrapperRaf.cancel(nextFrameRef.current);
|
|
84376
|
+
}
|
|
84377
|
+
|
|
84378
|
+
function nextFrame(callback) {
|
|
84379
|
+
var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
84380
|
+
cancelNextFrame();
|
|
84381
|
+
var nextFrameId = wrapperRaf(function () {
|
|
84382
|
+
if (delay <= 1) {
|
|
84383
|
+
callback({
|
|
84384
|
+
isCanceled: function isCanceled() {
|
|
84385
|
+
return nextFrameId !== nextFrameRef.current;
|
|
84386
|
+
}
|
|
84387
|
+
});
|
|
84388
|
+
} else {
|
|
84389
|
+
nextFrame(callback, delay - 1);
|
|
84390
|
+
}
|
|
84391
|
+
});
|
|
84392
|
+
nextFrameRef.current = nextFrameId;
|
|
84393
|
+
}
|
|
84394
|
+
|
|
84395
|
+
React.useEffect(function () {
|
|
84396
|
+
return function () {
|
|
84397
|
+
cancelNextFrame();
|
|
84398
|
+
};
|
|
84399
|
+
}, []);
|
|
84400
|
+
return [nextFrame, cancelNextFrame];
|
|
84401
|
+
});
|
|
84402
|
+
|
|
84403
|
+
var useIsomorphicLayoutEffect$3 = canUseDom() ? React.useLayoutEffect : React.useEffect;
|
|
84404
|
+
|
|
84405
|
+
var STEP_QUEUE = [STEP_PREPARE, STEP_START, STEP_ACTIVE, STEP_ACTIVATED];
|
|
84406
|
+
/** Skip current step */
|
|
84407
|
+
|
|
84408
|
+
var SkipStep = false;
|
|
84409
|
+
/** Current step should be update in */
|
|
84410
|
+
|
|
84411
|
+
var DoStep = true;
|
|
84412
|
+
function isActive(step) {
|
|
84413
|
+
return step === STEP_ACTIVE || step === STEP_ACTIVATED;
|
|
84414
|
+
}
|
|
84415
|
+
var useStepQueue = (function (status, callback) {
|
|
84416
|
+
var _useState = useSafeState(STEP_NONE),
|
|
84417
|
+
_useState2 = _slicedToArray$1(_useState, 2),
|
|
84418
|
+
step = _useState2[0],
|
|
84419
|
+
setStep = _useState2[1];
|
|
84420
|
+
|
|
84421
|
+
var _useNextFrame = useNextFrame(),
|
|
84422
|
+
_useNextFrame2 = _slicedToArray$1(_useNextFrame, 2),
|
|
84423
|
+
nextFrame = _useNextFrame2[0],
|
|
84424
|
+
cancelNextFrame = _useNextFrame2[1];
|
|
84425
|
+
|
|
84426
|
+
function startQueue() {
|
|
84427
|
+
setStep(STEP_PREPARE, true);
|
|
84428
|
+
}
|
|
84429
|
+
|
|
84430
|
+
useIsomorphicLayoutEffect$3(function () {
|
|
84431
|
+
if (step !== STEP_NONE && step !== STEP_ACTIVATED) {
|
|
84432
|
+
var index = STEP_QUEUE.indexOf(step);
|
|
84433
|
+
var nextStep = STEP_QUEUE[index + 1];
|
|
84434
|
+
var result = callback(step);
|
|
84435
|
+
|
|
84436
|
+
if (result === SkipStep) {
|
|
84437
|
+
// Skip when no needed
|
|
84438
|
+
setStep(nextStep, true);
|
|
84439
|
+
} else {
|
|
84440
|
+
// Do as frame for step update
|
|
84441
|
+
nextFrame(function (info) {
|
|
84442
|
+
function doNext() {
|
|
84443
|
+
// Skip since current queue is ood
|
|
84444
|
+
if (info.isCanceled()) return;
|
|
84445
|
+
setStep(nextStep, true);
|
|
84446
|
+
}
|
|
84447
|
+
|
|
84448
|
+
if (result === true) {
|
|
84449
|
+
doNext();
|
|
84450
|
+
} else {
|
|
84451
|
+
// Only promise should be async
|
|
84452
|
+
Promise.resolve(result).then(doNext);
|
|
84453
|
+
}
|
|
84454
|
+
});
|
|
84455
|
+
}
|
|
84456
|
+
}
|
|
84457
|
+
}, [status, step]);
|
|
84458
|
+
React.useEffect(function () {
|
|
84459
|
+
return function () {
|
|
84460
|
+
cancelNextFrame();
|
|
84461
|
+
};
|
|
84462
|
+
}, []);
|
|
84463
|
+
return [startQueue, step];
|
|
84464
|
+
});
|
|
84465
|
+
|
|
84466
|
+
var useDomMotionEvents = (function (callback) {
|
|
84467
|
+
var cacheElementRef = React.useRef(); // Cache callback
|
|
84468
|
+
|
|
84469
|
+
var callbackRef = React.useRef(callback);
|
|
84470
|
+
callbackRef.current = callback; // Internal motion event handler
|
|
84471
|
+
|
|
84472
|
+
var onInternalMotionEnd = React.useCallback(function (event) {
|
|
84473
|
+
callbackRef.current(event);
|
|
84474
|
+
}, []); // Remove events
|
|
84475
|
+
|
|
84476
|
+
function removeMotionEvents(element) {
|
|
84477
|
+
if (element) {
|
|
84478
|
+
element.removeEventListener(transitionEndName, onInternalMotionEnd);
|
|
84479
|
+
element.removeEventListener(animationEndName, onInternalMotionEnd);
|
|
84480
|
+
}
|
|
84481
|
+
} // Patch events
|
|
84482
|
+
|
|
84483
|
+
|
|
84484
|
+
function patchMotionEvents(element) {
|
|
84485
|
+
if (cacheElementRef.current && cacheElementRef.current !== element) {
|
|
84486
|
+
removeMotionEvents(cacheElementRef.current);
|
|
84487
|
+
}
|
|
84488
|
+
|
|
84489
|
+
if (element && element !== cacheElementRef.current) {
|
|
84490
|
+
element.addEventListener(transitionEndName, onInternalMotionEnd);
|
|
84491
|
+
element.addEventListener(animationEndName, onInternalMotionEnd); // Save as cache in case dom removed trigger by `motionDeadline`
|
|
84492
|
+
|
|
84493
|
+
cacheElementRef.current = element;
|
|
84494
|
+
}
|
|
84495
|
+
} // Clean up when removed
|
|
84496
|
+
|
|
84497
|
+
|
|
84498
|
+
React.useEffect(function () {
|
|
84499
|
+
return function () {
|
|
84500
|
+
removeMotionEvents(cacheElementRef.current);
|
|
84501
|
+
};
|
|
84502
|
+
}, []);
|
|
84503
|
+
return [patchMotionEvents, removeMotionEvents];
|
|
84504
|
+
});
|
|
84505
|
+
|
|
84506
|
+
function useStatus(supportMotion, visible, getElement, _ref) {
|
|
84507
|
+
var _ref$motionEnter = _ref.motionEnter,
|
|
84508
|
+
motionEnter = _ref$motionEnter === void 0 ? true : _ref$motionEnter,
|
|
84509
|
+
_ref$motionAppear = _ref.motionAppear,
|
|
84510
|
+
motionAppear = _ref$motionAppear === void 0 ? true : _ref$motionAppear,
|
|
84511
|
+
_ref$motionLeave = _ref.motionLeave,
|
|
84512
|
+
motionLeave = _ref$motionLeave === void 0 ? true : _ref$motionLeave,
|
|
84513
|
+
motionDeadline = _ref.motionDeadline,
|
|
84514
|
+
motionLeaveImmediately = _ref.motionLeaveImmediately,
|
|
84515
|
+
onAppearPrepare = _ref.onAppearPrepare,
|
|
84516
|
+
onEnterPrepare = _ref.onEnterPrepare,
|
|
84517
|
+
onLeavePrepare = _ref.onLeavePrepare,
|
|
84518
|
+
onAppearStart = _ref.onAppearStart,
|
|
84519
|
+
onEnterStart = _ref.onEnterStart,
|
|
84520
|
+
onLeaveStart = _ref.onLeaveStart,
|
|
84521
|
+
onAppearActive = _ref.onAppearActive,
|
|
84522
|
+
onEnterActive = _ref.onEnterActive,
|
|
84523
|
+
onLeaveActive = _ref.onLeaveActive,
|
|
84524
|
+
onAppearEnd = _ref.onAppearEnd,
|
|
84525
|
+
onEnterEnd = _ref.onEnterEnd,
|
|
84526
|
+
onLeaveEnd = _ref.onLeaveEnd,
|
|
84527
|
+
onVisibleChanged = _ref.onVisibleChanged;
|
|
84528
|
+
|
|
84529
|
+
// Used for outer render usage to avoid `visible: false & status: none` to render nothing
|
|
84530
|
+
var _useState = useSafeState(),
|
|
84531
|
+
_useState2 = _slicedToArray$1(_useState, 2),
|
|
84532
|
+
asyncVisible = _useState2[0],
|
|
84533
|
+
setAsyncVisible = _useState2[1];
|
|
84534
|
+
|
|
84535
|
+
var _useState3 = useSafeState(STATUS_NONE),
|
|
84536
|
+
_useState4 = _slicedToArray$1(_useState3, 2),
|
|
84537
|
+
status = _useState4[0],
|
|
84538
|
+
setStatus = _useState4[1];
|
|
84539
|
+
|
|
84540
|
+
var _useState5 = useSafeState(null),
|
|
84541
|
+
_useState6 = _slicedToArray$1(_useState5, 2),
|
|
84542
|
+
style = _useState6[0],
|
|
84543
|
+
setStyle = _useState6[1];
|
|
84544
|
+
|
|
84545
|
+
var mountedRef = React.useRef(false);
|
|
84546
|
+
var deadlineRef = React.useRef(null); // =========================== Dom Node ===========================
|
|
84547
|
+
|
|
84548
|
+
function getDomElement() {
|
|
84549
|
+
return getElement();
|
|
84550
|
+
} // ========================== Motion End ==========================
|
|
84551
|
+
|
|
84552
|
+
|
|
84553
|
+
var activeRef = React.useRef(false);
|
|
84554
|
+
|
|
84555
|
+
function onInternalMotionEnd(event) {
|
|
84556
|
+
var element = getDomElement();
|
|
84557
|
+
|
|
84558
|
+
if (event && !event.deadline && event.target !== element) {
|
|
84559
|
+
// event exists
|
|
84560
|
+
// not initiated by deadline
|
|
84561
|
+
// transitionEnd not fired by inner elements
|
|
84562
|
+
return;
|
|
84563
|
+
}
|
|
84564
|
+
|
|
84565
|
+
var currentActive = activeRef.current;
|
|
84566
|
+
var canEnd;
|
|
84567
|
+
|
|
84568
|
+
if (status === STATUS_APPEAR && currentActive) {
|
|
84569
|
+
canEnd = onAppearEnd === null || onAppearEnd === void 0 ? void 0 : onAppearEnd(element, event);
|
|
84570
|
+
} else if (status === STATUS_ENTER && currentActive) {
|
|
84571
|
+
canEnd = onEnterEnd === null || onEnterEnd === void 0 ? void 0 : onEnterEnd(element, event);
|
|
84572
|
+
} else if (status === STATUS_LEAVE && currentActive) {
|
|
84573
|
+
canEnd = onLeaveEnd === null || onLeaveEnd === void 0 ? void 0 : onLeaveEnd(element, event);
|
|
84574
|
+
} // Only update status when `canEnd` and not destroyed
|
|
84575
|
+
|
|
84576
|
+
|
|
84577
|
+
if (status !== STATUS_NONE && currentActive && canEnd !== false) {
|
|
84578
|
+
setStatus(STATUS_NONE, true);
|
|
84579
|
+
setStyle(null, true);
|
|
84580
|
+
}
|
|
84581
|
+
}
|
|
84582
|
+
|
|
84583
|
+
var _useDomMotionEvents = useDomMotionEvents(onInternalMotionEnd),
|
|
84584
|
+
_useDomMotionEvents2 = _slicedToArray$1(_useDomMotionEvents, 1),
|
|
84585
|
+
patchMotionEvents = _useDomMotionEvents2[0]; // ============================= Step =============================
|
|
84586
|
+
|
|
84587
|
+
|
|
84588
|
+
var eventHandlers = React.useMemo(function () {
|
|
84589
|
+
var _ref2, _ref3, _ref4;
|
|
84590
|
+
|
|
84591
|
+
switch (status) {
|
|
84592
|
+
case STATUS_APPEAR:
|
|
84593
|
+
return _ref2 = {}, _defineProperty$1(_ref2, STEP_PREPARE, onAppearPrepare), _defineProperty$1(_ref2, STEP_START, onAppearStart), _defineProperty$1(_ref2, STEP_ACTIVE, onAppearActive), _ref2;
|
|
84594
|
+
|
|
84595
|
+
case STATUS_ENTER:
|
|
84596
|
+
return _ref3 = {}, _defineProperty$1(_ref3, STEP_PREPARE, onEnterPrepare), _defineProperty$1(_ref3, STEP_START, onEnterStart), _defineProperty$1(_ref3, STEP_ACTIVE, onEnterActive), _ref3;
|
|
84597
|
+
|
|
84598
|
+
case STATUS_LEAVE:
|
|
84599
|
+
return _ref4 = {}, _defineProperty$1(_ref4, STEP_PREPARE, onLeavePrepare), _defineProperty$1(_ref4, STEP_START, onLeaveStart), _defineProperty$1(_ref4, STEP_ACTIVE, onLeaveActive), _ref4;
|
|
84600
|
+
|
|
84601
|
+
default:
|
|
84602
|
+
return {};
|
|
84603
|
+
}
|
|
84604
|
+
}, [status]);
|
|
84605
|
+
|
|
84606
|
+
var _useStepQueue = useStepQueue(status, function (newStep) {
|
|
84607
|
+
// Only prepare step can be skip
|
|
84608
|
+
if (newStep === STEP_PREPARE) {
|
|
84609
|
+
var onPrepare = eventHandlers[STEP_PREPARE];
|
|
84610
|
+
|
|
84611
|
+
if (!onPrepare) {
|
|
84612
|
+
return SkipStep;
|
|
84613
|
+
}
|
|
84614
|
+
|
|
84615
|
+
return onPrepare(getDomElement());
|
|
84616
|
+
} // Rest step is sync update
|
|
84617
|
+
|
|
84618
|
+
|
|
84619
|
+
// Rest step is sync update
|
|
84620
|
+
if (step in eventHandlers) {
|
|
84621
|
+
var _eventHandlers$step;
|
|
84622
|
+
|
|
84623
|
+
setStyle(((_eventHandlers$step = eventHandlers[step]) === null || _eventHandlers$step === void 0 ? void 0 : _eventHandlers$step.call(eventHandlers, getDomElement(), null)) || null);
|
|
84624
|
+
}
|
|
84625
|
+
|
|
84626
|
+
if (step === STEP_ACTIVE) {
|
|
84627
|
+
// Patch events when motion needed
|
|
84628
|
+
patchMotionEvents(getDomElement());
|
|
84629
|
+
|
|
84630
|
+
if (motionDeadline > 0) {
|
|
84631
|
+
clearTimeout(deadlineRef.current);
|
|
84632
|
+
deadlineRef.current = setTimeout(function () {
|
|
84633
|
+
onInternalMotionEnd({
|
|
84634
|
+
deadline: true
|
|
84635
|
+
});
|
|
84636
|
+
}, motionDeadline);
|
|
84637
|
+
}
|
|
84638
|
+
}
|
|
84639
|
+
|
|
84640
|
+
return DoStep;
|
|
84641
|
+
}),
|
|
84642
|
+
_useStepQueue2 = _slicedToArray$1(_useStepQueue, 2),
|
|
84643
|
+
startStep = _useStepQueue2[0],
|
|
84644
|
+
step = _useStepQueue2[1];
|
|
84645
|
+
|
|
84646
|
+
var active = isActive(step);
|
|
84647
|
+
activeRef.current = active; // ============================ Status ============================
|
|
84648
|
+
// Update with new status
|
|
84649
|
+
|
|
84650
|
+
useIsomorphicLayoutEffect$3(function () {
|
|
84651
|
+
setAsyncVisible(visible);
|
|
84652
|
+
var isMounted = mountedRef.current;
|
|
84653
|
+
mountedRef.current = true;
|
|
84654
|
+
|
|
84655
|
+
if (!supportMotion) {
|
|
84656
|
+
return;
|
|
84657
|
+
}
|
|
84658
|
+
|
|
84659
|
+
var nextStatus; // Appear
|
|
84660
|
+
|
|
84661
|
+
if (!isMounted && visible && motionAppear) {
|
|
84662
|
+
nextStatus = STATUS_APPEAR;
|
|
84663
|
+
} // Enter
|
|
84664
|
+
|
|
84665
|
+
|
|
84666
|
+
if (isMounted && visible && motionEnter) {
|
|
84667
|
+
nextStatus = STATUS_ENTER;
|
|
84668
|
+
} // Leave
|
|
84669
|
+
|
|
84670
|
+
|
|
84671
|
+
if (isMounted && !visible && motionLeave || !isMounted && motionLeaveImmediately && !visible && motionLeave) {
|
|
84672
|
+
nextStatus = STATUS_LEAVE;
|
|
84673
|
+
} // Update to next status
|
|
84674
|
+
|
|
84675
|
+
|
|
84676
|
+
if (nextStatus) {
|
|
84677
|
+
setStatus(nextStatus);
|
|
84678
|
+
startStep();
|
|
84679
|
+
}
|
|
84680
|
+
}, [visible]); // ============================ Effect ============================
|
|
84681
|
+
// Reset when motion changed
|
|
84682
|
+
|
|
84683
|
+
React.useEffect(function () {
|
|
84684
|
+
if ( // Cancel appear
|
|
84685
|
+
status === STATUS_APPEAR && !motionAppear || // Cancel enter
|
|
84686
|
+
status === STATUS_ENTER && !motionEnter || // Cancel leave
|
|
84687
|
+
status === STATUS_LEAVE && !motionLeave) {
|
|
84688
|
+
setStatus(STATUS_NONE);
|
|
84689
|
+
}
|
|
84690
|
+
}, [motionAppear, motionEnter, motionLeave]);
|
|
84691
|
+
React.useEffect(function () {
|
|
84692
|
+
return function () {
|
|
84693
|
+
mountedRef.current = false;
|
|
84694
|
+
clearTimeout(deadlineRef.current);
|
|
84695
|
+
};
|
|
84696
|
+
}, []); // Trigger `onVisibleChanged`
|
|
84697
|
+
|
|
84698
|
+
React.useEffect(function () {
|
|
84699
|
+
if (asyncVisible !== undefined && status === STATUS_NONE) {
|
|
84700
|
+
onVisibleChanged === null || onVisibleChanged === void 0 ? void 0 : onVisibleChanged(asyncVisible);
|
|
84701
|
+
}
|
|
84702
|
+
}, [asyncVisible, status]); // ============================ Styles ============================
|
|
84703
|
+
|
|
84704
|
+
var mergedStyle = style;
|
|
84705
|
+
|
|
84706
|
+
if (eventHandlers[STEP_PREPARE] && step === STEP_START) {
|
|
84707
|
+
mergedStyle = _objectSpread2({
|
|
84708
|
+
transition: 'none'
|
|
84709
|
+
}, mergedStyle);
|
|
84710
|
+
}
|
|
84711
|
+
|
|
84712
|
+
return [status, step, mergedStyle, asyncVisible !== null && asyncVisible !== void 0 ? asyncVisible : visible];
|
|
84713
|
+
}
|
|
84714
|
+
|
|
84715
|
+
var DomWrapper$1 = /*#__PURE__*/function (_React$Component) {
|
|
84716
|
+
_inherits(DomWrapper, _React$Component);
|
|
84717
|
+
|
|
84718
|
+
var _super = _createSuper(DomWrapper);
|
|
84719
|
+
|
|
84720
|
+
function DomWrapper() {
|
|
84721
|
+
_classCallCheck(this, DomWrapper);
|
|
84722
|
+
|
|
84723
|
+
return _super.apply(this, arguments);
|
|
84724
|
+
}
|
|
84725
|
+
|
|
84726
|
+
_createClass(DomWrapper, [{
|
|
84727
|
+
key: "render",
|
|
84728
|
+
value: function render() {
|
|
84729
|
+
return this.props.children;
|
|
84730
|
+
}
|
|
84731
|
+
}]);
|
|
84732
|
+
|
|
84733
|
+
return DomWrapper;
|
|
84734
|
+
}(React.Component);
|
|
84735
|
+
|
|
84736
|
+
/**
|
|
84737
|
+
* `transitionSupport` is used for none transition test case.
|
|
84738
|
+
* Default we use browser transition event support check.
|
|
84739
|
+
*/
|
|
84740
|
+
|
|
84741
|
+
function genCSSMotion(config) {
|
|
84742
|
+
var transitionSupport = config;
|
|
84743
|
+
|
|
84744
|
+
if (_typeof$1(config) === 'object') {
|
|
84745
|
+
transitionSupport = config.transitionSupport;
|
|
84746
|
+
}
|
|
84747
|
+
|
|
84748
|
+
function isSupportTransition(props) {
|
|
84749
|
+
return !!(props.motionName && transitionSupport);
|
|
84750
|
+
}
|
|
84751
|
+
|
|
84752
|
+
var CSSMotion = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
84753
|
+
var _props$visible = props.visible,
|
|
84754
|
+
visible = _props$visible === void 0 ? true : _props$visible,
|
|
84755
|
+
_props$removeOnLeave = props.removeOnLeave,
|
|
84756
|
+
removeOnLeave = _props$removeOnLeave === void 0 ? true : _props$removeOnLeave,
|
|
84757
|
+
forceRender = props.forceRender,
|
|
84758
|
+
children = props.children,
|
|
84759
|
+
motionName = props.motionName,
|
|
84760
|
+
leavedClassName = props.leavedClassName,
|
|
84761
|
+
eventProps = props.eventProps;
|
|
84762
|
+
var supportMotion = isSupportTransition(props); // Ref to the react node, it may be a HTMLElement
|
|
84763
|
+
|
|
84764
|
+
var nodeRef = React.useRef(); // Ref to the dom wrapper in case ref can not pass to HTMLElement
|
|
84765
|
+
|
|
84766
|
+
var wrapperNodeRef = React.useRef();
|
|
84767
|
+
|
|
84768
|
+
function getDomElement() {
|
|
84769
|
+
try {
|
|
84770
|
+
// Here we're avoiding call for findDOMNode since it's deprecated
|
|
84771
|
+
// in strict mode. We're calling it only when node ref is not
|
|
84772
|
+
// an instance of DOM HTMLElement. Otherwise use
|
|
84773
|
+
// findDOMNode as a final resort
|
|
84774
|
+
return nodeRef.current instanceof HTMLElement ? nodeRef.current : findDOMNode(wrapperNodeRef.current);
|
|
84775
|
+
} catch (e) {
|
|
84776
|
+
// Only happen when `motionDeadline` trigger but element removed.
|
|
84777
|
+
return null;
|
|
84778
|
+
}
|
|
84779
|
+
}
|
|
84780
|
+
|
|
84781
|
+
var _useStatus = useStatus(supportMotion, visible, getDomElement, props),
|
|
84782
|
+
_useStatus2 = _slicedToArray$1(_useStatus, 4),
|
|
84783
|
+
status = _useStatus2[0],
|
|
84784
|
+
statusStep = _useStatus2[1],
|
|
84785
|
+
statusStyle = _useStatus2[2],
|
|
84786
|
+
mergedVisible = _useStatus2[3]; // Record whether content has rendered
|
|
84787
|
+
// Will return null for un-rendered even when `removeOnLeave={false}`
|
|
84788
|
+
|
|
84789
|
+
|
|
84790
|
+
var renderedRef = React.useRef(mergedVisible);
|
|
84791
|
+
|
|
84792
|
+
if (mergedVisible) {
|
|
84793
|
+
renderedRef.current = true;
|
|
84794
|
+
} // ====================== Refs ======================
|
|
84795
|
+
|
|
84796
|
+
|
|
84797
|
+
var setNodeRef = React.useCallback(function (node) {
|
|
84798
|
+
nodeRef.current = node;
|
|
84799
|
+
fillRef(ref, node);
|
|
84800
|
+
}, [ref]); // ===================== Render =====================
|
|
84801
|
+
|
|
84802
|
+
var motionChildren;
|
|
84803
|
+
|
|
84804
|
+
var mergedProps = _objectSpread2(_objectSpread2({}, eventProps), {}, {
|
|
84805
|
+
visible: visible
|
|
84806
|
+
});
|
|
84807
|
+
|
|
84808
|
+
if (!children) {
|
|
84809
|
+
// No children
|
|
84810
|
+
motionChildren = null;
|
|
84811
|
+
} else if (status === STATUS_NONE || !isSupportTransition(props)) {
|
|
84812
|
+
// Stable children
|
|
84813
|
+
if (mergedVisible) {
|
|
84814
|
+
motionChildren = children(_objectSpread2({}, mergedProps), setNodeRef);
|
|
84815
|
+
} else if (!removeOnLeave && renderedRef.current) {
|
|
84816
|
+
motionChildren = children(_objectSpread2(_objectSpread2({}, mergedProps), {}, {
|
|
84817
|
+
className: leavedClassName
|
|
84818
|
+
}), setNodeRef);
|
|
84819
|
+
} else if (forceRender) {
|
|
84820
|
+
motionChildren = children(_objectSpread2(_objectSpread2({}, mergedProps), {}, {
|
|
84821
|
+
style: {
|
|
84822
|
+
display: 'none'
|
|
84823
|
+
}
|
|
84824
|
+
}), setNodeRef);
|
|
84825
|
+
} else {
|
|
84826
|
+
motionChildren = null;
|
|
84827
|
+
}
|
|
84828
|
+
} else {
|
|
84829
|
+
var _classNames;
|
|
84830
|
+
|
|
84831
|
+
// In motion
|
|
84832
|
+
var statusSuffix;
|
|
84833
|
+
|
|
84834
|
+
if (statusStep === STEP_PREPARE) {
|
|
84835
|
+
statusSuffix = 'prepare';
|
|
84836
|
+
} else if (isActive(statusStep)) {
|
|
84837
|
+
statusSuffix = 'active';
|
|
84838
|
+
} else if (statusStep === STEP_START) {
|
|
84839
|
+
statusSuffix = 'start';
|
|
84840
|
+
}
|
|
84841
|
+
|
|
84842
|
+
motionChildren = children(_objectSpread2(_objectSpread2({}, mergedProps), {}, {
|
|
84843
|
+
className: classnames(getTransitionName(motionName, status), (_classNames = {}, _defineProperty$1(_classNames, getTransitionName(motionName, "".concat(status, "-").concat(statusSuffix)), statusSuffix), _defineProperty$1(_classNames, motionName, typeof motionName === 'string'), _classNames)),
|
|
84844
|
+
style: statusStyle
|
|
84845
|
+
}), setNodeRef);
|
|
84846
|
+
} // Auto inject ref if child node not have `ref` props
|
|
84847
|
+
|
|
84848
|
+
|
|
84849
|
+
if ( /*#__PURE__*/React.isValidElement(motionChildren) && supportRef(motionChildren)) {
|
|
84850
|
+
var _motionChildren = motionChildren,
|
|
84851
|
+
originNodeRef = _motionChildren.ref;
|
|
84852
|
+
|
|
84853
|
+
if (!originNodeRef) {
|
|
84854
|
+
motionChildren = /*#__PURE__*/React.cloneElement(motionChildren, {
|
|
84855
|
+
ref: setNodeRef
|
|
84856
|
+
});
|
|
84857
|
+
}
|
|
84858
|
+
}
|
|
84859
|
+
|
|
84860
|
+
return /*#__PURE__*/React.createElement(DomWrapper$1, {
|
|
84861
|
+
ref: wrapperNodeRef
|
|
84862
|
+
}, motionChildren);
|
|
84863
|
+
});
|
|
84864
|
+
CSSMotion.displayName = 'CSSMotion';
|
|
84865
|
+
return CSSMotion;
|
|
84866
|
+
}
|
|
84867
|
+
var CSSMotion = genCSSMotion(supportTransition);
|
|
84868
|
+
|
|
84869
|
+
var STATUS_ADD = 'add';
|
|
84870
|
+
var STATUS_KEEP = 'keep';
|
|
84871
|
+
var STATUS_REMOVE = 'remove';
|
|
84872
|
+
var STATUS_REMOVED = 'removed';
|
|
84873
|
+
function wrapKeyToObject(key) {
|
|
84874
|
+
var keyObj;
|
|
84875
|
+
|
|
84876
|
+
if (key && _typeof$1(key) === 'object' && 'key' in key) {
|
|
84877
|
+
keyObj = key;
|
|
84878
|
+
} else {
|
|
84879
|
+
keyObj = {
|
|
84880
|
+
key: key
|
|
84881
|
+
};
|
|
84882
|
+
}
|
|
84883
|
+
|
|
84884
|
+
return _objectSpread2(_objectSpread2({}, keyObj), {}, {
|
|
84885
|
+
key: String(keyObj.key)
|
|
84886
|
+
});
|
|
84887
|
+
}
|
|
84888
|
+
function parseKeys() {
|
|
84889
|
+
var keys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
84890
|
+
return keys.map(wrapKeyToObject);
|
|
84891
|
+
}
|
|
84892
|
+
function diffKeys() {
|
|
84893
|
+
var prevKeys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
84894
|
+
var currentKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
84895
|
+
var list = [];
|
|
84896
|
+
var currentIndex = 0;
|
|
84897
|
+
var currentLen = currentKeys.length;
|
|
84898
|
+
var prevKeyObjects = parseKeys(prevKeys);
|
|
84899
|
+
var currentKeyObjects = parseKeys(currentKeys); // Check prev keys to insert or keep
|
|
84900
|
+
|
|
84901
|
+
prevKeyObjects.forEach(function (keyObj) {
|
|
84902
|
+
var hit = false;
|
|
84903
|
+
|
|
84904
|
+
for (var i = currentIndex; i < currentLen; i += 1) {
|
|
84905
|
+
var currentKeyObj = currentKeyObjects[i];
|
|
84906
|
+
|
|
84907
|
+
if (currentKeyObj.key === keyObj.key) {
|
|
84908
|
+
// New added keys should add before current key
|
|
84909
|
+
if (currentIndex < i) {
|
|
84910
|
+
list = list.concat(currentKeyObjects.slice(currentIndex, i).map(function (obj) {
|
|
84911
|
+
return _objectSpread2(_objectSpread2({}, obj), {}, {
|
|
84912
|
+
status: STATUS_ADD
|
|
84913
|
+
});
|
|
84914
|
+
}));
|
|
84915
|
+
currentIndex = i;
|
|
84916
|
+
}
|
|
84917
|
+
|
|
84918
|
+
list.push(_objectSpread2(_objectSpread2({}, currentKeyObj), {}, {
|
|
84919
|
+
status: STATUS_KEEP
|
|
84920
|
+
}));
|
|
84921
|
+
currentIndex += 1;
|
|
84922
|
+
hit = true;
|
|
84923
|
+
break;
|
|
84924
|
+
}
|
|
84925
|
+
} // If not hit, it means key is removed
|
|
84926
|
+
|
|
84927
|
+
|
|
84928
|
+
if (!hit) {
|
|
84929
|
+
list.push(_objectSpread2(_objectSpread2({}, keyObj), {}, {
|
|
84930
|
+
status: STATUS_REMOVE
|
|
84931
|
+
}));
|
|
84932
|
+
}
|
|
84933
|
+
}); // Add rest to the list
|
|
84934
|
+
|
|
84935
|
+
if (currentIndex < currentLen) {
|
|
84936
|
+
list = list.concat(currentKeyObjects.slice(currentIndex).map(function (obj) {
|
|
84937
|
+
return _objectSpread2(_objectSpread2({}, obj), {}, {
|
|
84938
|
+
status: STATUS_ADD
|
|
84939
|
+
});
|
|
84940
|
+
}));
|
|
84941
|
+
}
|
|
84942
|
+
/**
|
|
84943
|
+
* Merge same key when it remove and add again:
|
|
84944
|
+
* [1 - add, 2 - keep, 1 - remove] -> [1 - keep, 2 - keep]
|
|
84945
|
+
*/
|
|
84946
|
+
|
|
84947
|
+
|
|
84948
|
+
var keys = {};
|
|
84949
|
+
list.forEach(function (_ref) {
|
|
84950
|
+
var key = _ref.key;
|
|
84951
|
+
keys[key] = (keys[key] || 0) + 1;
|
|
84952
|
+
});
|
|
84953
|
+
var duplicatedKeys = Object.keys(keys).filter(function (key) {
|
|
84954
|
+
return keys[key] > 1;
|
|
84955
|
+
});
|
|
84956
|
+
duplicatedKeys.forEach(function (matchKey) {
|
|
84957
|
+
// Remove `STATUS_REMOVE` node.
|
|
84958
|
+
list = list.filter(function (_ref2) {
|
|
84959
|
+
var key = _ref2.key,
|
|
84960
|
+
status = _ref2.status;
|
|
84961
|
+
return key !== matchKey || status !== STATUS_REMOVE;
|
|
84962
|
+
}); // Update `STATUS_ADD` to `STATUS_KEEP`
|
|
84963
|
+
|
|
84964
|
+
list.forEach(function (node) {
|
|
84965
|
+
if (node.key === matchKey) {
|
|
84966
|
+
// eslint-disable-next-line no-param-reassign
|
|
84967
|
+
node.status = STATUS_KEEP;
|
|
84968
|
+
}
|
|
84969
|
+
});
|
|
84970
|
+
});
|
|
84971
|
+
return list;
|
|
84972
|
+
}
|
|
84973
|
+
|
|
84974
|
+
var _excluded$1m = ["component", "children", "onVisibleChanged", "onAllRemoved"],
|
|
84975
|
+
_excluded2$l = ["status"];
|
|
84976
|
+
var MOTION_PROP_NAMES = ['eventProps', 'visible', 'children', 'motionName', 'motionAppear', 'motionEnter', 'motionLeave', 'motionLeaveImmediately', 'motionDeadline', 'removeOnLeave', 'leavedClassName', 'onAppearStart', 'onAppearActive', 'onAppearEnd', 'onEnterStart', 'onEnterActive', 'onEnterEnd', 'onLeaveStart', 'onLeaveActive', 'onLeaveEnd'];
|
|
84977
|
+
/**
|
|
84978
|
+
* Generate a CSSMotionList component with config
|
|
84979
|
+
* @param transitionSupport No need since CSSMotionList no longer depends on transition support
|
|
84980
|
+
* @param CSSMotion CSSMotion component
|
|
84981
|
+
*/
|
|
84982
|
+
|
|
84983
|
+
function genCSSMotionList(transitionSupport) {
|
|
84984
|
+
var CSSMotion$1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : CSSMotion;
|
|
84985
|
+
|
|
84986
|
+
var CSSMotionList = /*#__PURE__*/function (_React$Component) {
|
|
84987
|
+
_inherits(CSSMotionList, _React$Component);
|
|
84988
|
+
|
|
84989
|
+
var _super = _createSuper(CSSMotionList);
|
|
84990
|
+
|
|
84991
|
+
function CSSMotionList() {
|
|
84992
|
+
var _this;
|
|
84993
|
+
|
|
84994
|
+
_classCallCheck(this, CSSMotionList);
|
|
84995
|
+
|
|
84996
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
84997
|
+
args[_key] = arguments[_key];
|
|
84998
|
+
}
|
|
84999
|
+
|
|
85000
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
85001
|
+
_this.state = {
|
|
85002
|
+
keyEntities: []
|
|
85003
|
+
};
|
|
85004
|
+
|
|
85005
|
+
_this.removeKey = function (removeKey) {
|
|
85006
|
+
var keyEntities = _this.state.keyEntities;
|
|
85007
|
+
var nextKeyEntities = keyEntities.map(function (entity) {
|
|
85008
|
+
if (entity.key !== removeKey) return entity;
|
|
85009
|
+
return _objectSpread2(_objectSpread2({}, entity), {}, {
|
|
85010
|
+
status: STATUS_REMOVED
|
|
85011
|
+
});
|
|
85012
|
+
});
|
|
85013
|
+
|
|
85014
|
+
_this.setState({
|
|
85015
|
+
keyEntities: nextKeyEntities
|
|
85016
|
+
});
|
|
85017
|
+
|
|
85018
|
+
return nextKeyEntities.filter(function (_ref) {
|
|
85019
|
+
var status = _ref.status;
|
|
85020
|
+
return status !== STATUS_REMOVED;
|
|
85021
|
+
}).length;
|
|
85022
|
+
};
|
|
85023
|
+
|
|
85024
|
+
return _this;
|
|
85025
|
+
}
|
|
85026
|
+
|
|
85027
|
+
_createClass(CSSMotionList, [{
|
|
85028
|
+
key: "render",
|
|
85029
|
+
value: function render() {
|
|
85030
|
+
var _this2 = this;
|
|
85031
|
+
|
|
85032
|
+
var keyEntities = this.state.keyEntities;
|
|
85033
|
+
|
|
85034
|
+
var _this$props = this.props,
|
|
85035
|
+
component = _this$props.component,
|
|
85036
|
+
children = _this$props.children,
|
|
85037
|
+
_onVisibleChanged = _this$props.onVisibleChanged,
|
|
85038
|
+
onAllRemoved = _this$props.onAllRemoved,
|
|
85039
|
+
restProps = _objectWithoutProperties$1(_this$props, _excluded$1m);
|
|
85040
|
+
|
|
85041
|
+
var Component = component || React.Fragment;
|
|
85042
|
+
var motionProps = {};
|
|
85043
|
+
MOTION_PROP_NAMES.forEach(function (prop) {
|
|
85044
|
+
motionProps[prop] = restProps[prop];
|
|
85045
|
+
delete restProps[prop];
|
|
85046
|
+
});
|
|
85047
|
+
delete restProps.keys;
|
|
85048
|
+
return /*#__PURE__*/React.createElement(Component, restProps, keyEntities.map(function (_ref2) {
|
|
85049
|
+
var status = _ref2.status,
|
|
85050
|
+
eventProps = _objectWithoutProperties$1(_ref2, _excluded2$l);
|
|
85051
|
+
|
|
85052
|
+
var visible = status === STATUS_ADD || status === STATUS_KEEP;
|
|
85053
|
+
return /*#__PURE__*/React.createElement(CSSMotion$1, _extends$5({}, motionProps, {
|
|
85054
|
+
key: eventProps.key,
|
|
85055
|
+
visible: visible,
|
|
85056
|
+
eventProps: eventProps,
|
|
85057
|
+
onVisibleChanged: function onVisibleChanged(changedVisible) {
|
|
85058
|
+
_onVisibleChanged === null || _onVisibleChanged === void 0 ? void 0 : _onVisibleChanged(changedVisible, {
|
|
85059
|
+
key: eventProps.key
|
|
85060
|
+
});
|
|
85061
|
+
|
|
85062
|
+
if (!changedVisible) {
|
|
85063
|
+
var restKeysCount = _this2.removeKey(eventProps.key);
|
|
85064
|
+
|
|
85065
|
+
if (restKeysCount === 0 && onAllRemoved) {
|
|
85066
|
+
onAllRemoved();
|
|
85067
|
+
}
|
|
85068
|
+
}
|
|
85069
|
+
}
|
|
85070
|
+
}), children);
|
|
85071
|
+
}));
|
|
85072
|
+
}
|
|
85073
|
+
}], [{
|
|
85074
|
+
key: "getDerivedStateFromProps",
|
|
85075
|
+
value: function getDerivedStateFromProps(_ref3, _ref4) {
|
|
85076
|
+
var keys = _ref3.keys;
|
|
85077
|
+
var keyEntities = _ref4.keyEntities;
|
|
85078
|
+
var parsedKeyObjects = parseKeys(keys);
|
|
85079
|
+
var mixedKeyEntities = diffKeys(keyEntities, parsedKeyObjects);
|
|
85080
|
+
return {
|
|
85081
|
+
keyEntities: mixedKeyEntities.filter(function (entity) {
|
|
85082
|
+
var prevEntity = keyEntities.find(function (_ref5) {
|
|
85083
|
+
var key = _ref5.key;
|
|
85084
|
+
return entity.key === key;
|
|
85085
|
+
}); // Remove if already mark as removed
|
|
85086
|
+
|
|
85087
|
+
if (prevEntity && prevEntity.status === STATUS_REMOVED && entity.status === STATUS_REMOVE) {
|
|
85088
|
+
return false;
|
|
85089
|
+
}
|
|
85090
|
+
|
|
85091
|
+
return true;
|
|
85092
|
+
})
|
|
85093
|
+
};
|
|
85094
|
+
} // ZombieJ: Return the count of rest keys. It's safe to refactor if need more info.
|
|
85095
|
+
|
|
85096
|
+
}]);
|
|
85097
|
+
|
|
85098
|
+
return CSSMotionList;
|
|
85099
|
+
}(React.Component);
|
|
85100
|
+
|
|
85101
|
+
CSSMotionList.defaultProps = {
|
|
85102
|
+
component: 'div'
|
|
85103
|
+
};
|
|
85104
|
+
return CSSMotionList;
|
|
85105
|
+
}
|
|
85106
|
+
var CSSMotionList = genCSSMotionList(supportTransition);
|
|
85107
|
+
|
|
85108
|
+
var Notice = /*#__PURE__*/function (_Component) {
|
|
85109
|
+
_inherits(Notice, _Component);
|
|
85110
|
+
|
|
85111
|
+
var _super = _createSuper(Notice);
|
|
85112
|
+
|
|
85113
|
+
function Notice() {
|
|
85114
|
+
var _this;
|
|
85115
|
+
|
|
85116
|
+
_classCallCheck(this, Notice);
|
|
85117
|
+
|
|
85118
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
85119
|
+
args[_key] = arguments[_key];
|
|
85120
|
+
}
|
|
85121
|
+
|
|
85122
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
85123
|
+
_this.closeTimer = null;
|
|
85124
|
+
|
|
85125
|
+
_this.close = function (e) {
|
|
85126
|
+
if (e) {
|
|
85127
|
+
e.stopPropagation();
|
|
85128
|
+
}
|
|
85129
|
+
|
|
85130
|
+
_this.clearCloseTimer();
|
|
85131
|
+
|
|
85132
|
+
var _this$props = _this.props,
|
|
85133
|
+
onClose = _this$props.onClose,
|
|
85134
|
+
noticeKey = _this$props.noticeKey;
|
|
85135
|
+
|
|
85136
|
+
if (onClose) {
|
|
85137
|
+
onClose(noticeKey);
|
|
85138
|
+
}
|
|
85139
|
+
};
|
|
85140
|
+
|
|
85141
|
+
_this.startCloseTimer = function () {
|
|
85142
|
+
if (_this.props.duration) {
|
|
85143
|
+
_this.closeTimer = window.setTimeout(function () {
|
|
85144
|
+
_this.close();
|
|
85145
|
+
}, _this.props.duration * 1000);
|
|
85146
|
+
}
|
|
85147
|
+
};
|
|
85148
|
+
|
|
85149
|
+
_this.clearCloseTimer = function () {
|
|
85150
|
+
if (_this.closeTimer) {
|
|
85151
|
+
clearTimeout(_this.closeTimer);
|
|
85152
|
+
_this.closeTimer = null;
|
|
85153
|
+
}
|
|
85154
|
+
};
|
|
85155
|
+
|
|
85156
|
+
return _this;
|
|
85157
|
+
}
|
|
85158
|
+
|
|
85159
|
+
_createClass(Notice, [{
|
|
85160
|
+
key: "componentDidMount",
|
|
85161
|
+
value: function componentDidMount() {
|
|
85162
|
+
this.startCloseTimer();
|
|
85163
|
+
}
|
|
85164
|
+
}, {
|
|
85165
|
+
key: "componentDidUpdate",
|
|
85166
|
+
value: function componentDidUpdate(prevProps) {
|
|
85167
|
+
if (this.props.duration !== prevProps.duration || this.props.updateMark !== prevProps.updateMark || // Visible again need reset timer
|
|
85168
|
+
this.props.visible !== prevProps.visible && this.props.visible) {
|
|
85169
|
+
this.restartCloseTimer();
|
|
85170
|
+
}
|
|
85171
|
+
}
|
|
85172
|
+
}, {
|
|
85173
|
+
key: "componentWillUnmount",
|
|
85174
|
+
value: function componentWillUnmount() {
|
|
85175
|
+
this.clearCloseTimer();
|
|
85176
|
+
}
|
|
85177
|
+
}, {
|
|
85178
|
+
key: "restartCloseTimer",
|
|
85179
|
+
value: function restartCloseTimer() {
|
|
85180
|
+
this.clearCloseTimer();
|
|
85181
|
+
this.startCloseTimer();
|
|
85182
|
+
}
|
|
85183
|
+
}, {
|
|
85184
|
+
key: "render",
|
|
85185
|
+
value: function render() {
|
|
85186
|
+
var _this2 = this;
|
|
85187
|
+
|
|
85188
|
+
var _this$props2 = this.props,
|
|
85189
|
+
prefixCls = _this$props2.prefixCls,
|
|
85190
|
+
className = _this$props2.className,
|
|
85191
|
+
closable = _this$props2.closable,
|
|
85192
|
+
closeIcon = _this$props2.closeIcon,
|
|
85193
|
+
style = _this$props2.style,
|
|
85194
|
+
onClick = _this$props2.onClick,
|
|
85195
|
+
children = _this$props2.children,
|
|
85196
|
+
holder = _this$props2.holder;
|
|
85197
|
+
var componentClass = "".concat(prefixCls, "-notice");
|
|
85198
|
+
var dataOrAriaAttributeProps = Object.keys(this.props).reduce(function (acc, key) {
|
|
85199
|
+
if (key.substr(0, 5) === 'data-' || key.substr(0, 5) === 'aria-' || key === 'role') {
|
|
85200
|
+
acc[key] = _this2.props[key];
|
|
85201
|
+
}
|
|
85202
|
+
|
|
85203
|
+
return acc;
|
|
85204
|
+
}, {});
|
|
85205
|
+
var node = /*#__PURE__*/React.createElement("div", _extends$5({
|
|
85206
|
+
className: classnames(componentClass, className, _defineProperty$1({}, "".concat(componentClass, "-closable"), closable)),
|
|
85207
|
+
style: style,
|
|
85208
|
+
onMouseEnter: this.clearCloseTimer,
|
|
85209
|
+
onMouseLeave: this.startCloseTimer,
|
|
85210
|
+
onClick: onClick
|
|
85211
|
+
}, dataOrAriaAttributeProps), /*#__PURE__*/React.createElement("div", {
|
|
85212
|
+
className: "".concat(componentClass, "-content")
|
|
85213
|
+
}, children), closable ? /*#__PURE__*/React.createElement("a", {
|
|
85214
|
+
tabIndex: 0,
|
|
85215
|
+
onClick: this.close,
|
|
85216
|
+
className: "".concat(componentClass, "-close")
|
|
85217
|
+
}, closeIcon || /*#__PURE__*/React.createElement("span", {
|
|
85218
|
+
className: "".concat(componentClass, "-close-x")
|
|
85219
|
+
})) : null);
|
|
85220
|
+
|
|
85221
|
+
if (holder) {
|
|
85222
|
+
return /*#__PURE__*/ReactDOM__default['default'].createPortal(node, holder);
|
|
85223
|
+
}
|
|
85224
|
+
|
|
85225
|
+
return node;
|
|
85226
|
+
}
|
|
85227
|
+
}]);
|
|
85228
|
+
|
|
85229
|
+
return Notice;
|
|
85230
|
+
}(React.Component);
|
|
85231
|
+
|
|
85232
|
+
Notice.defaultProps = {
|
|
85233
|
+
onClose: function onClose() {},
|
|
85234
|
+
duration: 1.5
|
|
85235
|
+
};
|
|
85236
|
+
|
|
85237
|
+
function useNotification(notificationInstance) {
|
|
85238
|
+
var createdRef = React.useRef({});
|
|
85239
|
+
|
|
85240
|
+
var _React$useState = React.useState([]),
|
|
85241
|
+
_React$useState2 = _slicedToArray$1(_React$useState, 2),
|
|
85242
|
+
elements = _React$useState2[0],
|
|
85243
|
+
setElements = _React$useState2[1];
|
|
85244
|
+
|
|
85245
|
+
function notify(noticeProps) {
|
|
85246
|
+
var firstMount = true;
|
|
85247
|
+
notificationInstance.add(noticeProps, function (div, props) {
|
|
85248
|
+
var key = props.key;
|
|
85249
|
+
|
|
85250
|
+
if (div && (!createdRef.current[key] || firstMount)) {
|
|
85251
|
+
var noticeEle = /*#__PURE__*/React.createElement(Notice, _extends$5({}, props, {
|
|
85252
|
+
holder: div
|
|
85253
|
+
}));
|
|
85254
|
+
createdRef.current[key] = noticeEle;
|
|
85255
|
+
setElements(function (originElements) {
|
|
85256
|
+
var index = originElements.findIndex(function (ele) {
|
|
85257
|
+
return ele.key === props.key;
|
|
85258
|
+
});
|
|
85259
|
+
|
|
85260
|
+
if (index === -1) {
|
|
85261
|
+
return [].concat(_toConsumableArray$1(originElements), [noticeEle]);
|
|
85262
|
+
}
|
|
85263
|
+
|
|
85264
|
+
var cloneList = _toConsumableArray$1(originElements);
|
|
85265
|
+
|
|
85266
|
+
cloneList[index] = noticeEle;
|
|
85267
|
+
return cloneList;
|
|
85268
|
+
});
|
|
85269
|
+
}
|
|
85270
|
+
|
|
85271
|
+
firstMount = false;
|
|
85272
|
+
});
|
|
85273
|
+
}
|
|
85274
|
+
|
|
85275
|
+
return [notify, /*#__PURE__*/React.createElement(React.Fragment, null, elements)];
|
|
85276
|
+
}
|
|
85277
|
+
|
|
85278
|
+
var _excluded$1n = ["getContainer"];
|
|
85279
|
+
var seed = 0;
|
|
85280
|
+
var now$3 = Date.now();
|
|
85281
|
+
|
|
85282
|
+
function getUuid() {
|
|
85283
|
+
var id = seed;
|
|
85284
|
+
seed += 1;
|
|
85285
|
+
return "rcNotification_".concat(now$3, "_").concat(id);
|
|
85286
|
+
}
|
|
85287
|
+
|
|
85288
|
+
var Notification = /*#__PURE__*/function (_Component) {
|
|
85289
|
+
_inherits(Notification, _Component);
|
|
85290
|
+
|
|
85291
|
+
var _super = _createSuper(Notification);
|
|
85292
|
+
|
|
85293
|
+
function Notification() {
|
|
85294
|
+
var _this;
|
|
85295
|
+
|
|
85296
|
+
_classCallCheck(this, Notification);
|
|
85297
|
+
|
|
85298
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
85299
|
+
args[_key] = arguments[_key];
|
|
85300
|
+
}
|
|
85301
|
+
|
|
85302
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
85303
|
+
_this.state = {
|
|
85304
|
+
notices: []
|
|
85305
|
+
};
|
|
85306
|
+
_this.hookRefs = new Map();
|
|
85307
|
+
|
|
85308
|
+
_this.add = function (originNotice, holderCallback) {
|
|
85309
|
+
var key = originNotice.key || getUuid();
|
|
85310
|
+
|
|
85311
|
+
var notice = _objectSpread2(_objectSpread2({}, originNotice), {}, {
|
|
85312
|
+
key: key
|
|
85313
|
+
});
|
|
85314
|
+
|
|
85315
|
+
var maxCount = _this.props.maxCount;
|
|
85316
|
+
|
|
85317
|
+
_this.setState(function (previousState) {
|
|
85318
|
+
var notices = previousState.notices;
|
|
85319
|
+
var noticeIndex = notices.map(function (v) {
|
|
85320
|
+
return v.notice.key;
|
|
85321
|
+
}).indexOf(key);
|
|
85322
|
+
var updatedNotices = notices.concat();
|
|
85323
|
+
|
|
85324
|
+
if (noticeIndex !== -1) {
|
|
85325
|
+
updatedNotices.splice(noticeIndex, 1, {
|
|
85326
|
+
notice: notice,
|
|
85327
|
+
holderCallback: holderCallback
|
|
85328
|
+
});
|
|
85329
|
+
} else {
|
|
85330
|
+
if (maxCount && notices.length >= maxCount) {
|
|
85331
|
+
// XXX, use key of first item to update new added (let React to move exsiting
|
|
85332
|
+
// instead of remove and mount). Same key was used before for both a) external
|
|
85333
|
+
// manual control and b) internal react 'key' prop , which is not that good.
|
|
85334
|
+
// eslint-disable-next-line no-param-reassign
|
|
85335
|
+
// zombieJ: Not know why use `updateKey`. This makes Notice infinite loop in jest.
|
|
85336
|
+
// Change to `updateMark` for compare instead.
|
|
85337
|
+
// https://github.com/react-component/notification/commit/32299e6be396f94040bfa82517eea940db947ece
|
|
85338
|
+
notice.key = updatedNotices[0].notice.key;
|
|
85339
|
+
notice.updateMark = getUuid(); // zombieJ: That's why. User may close by key directly.
|
|
85340
|
+
// We need record this but not re-render to avoid upper issue
|
|
85341
|
+
// https://github.com/react-component/notification/issues/129
|
|
85342
|
+
|
|
85343
|
+
notice.userPassKey = key;
|
|
85344
|
+
updatedNotices.shift();
|
|
85345
|
+
}
|
|
85346
|
+
|
|
85347
|
+
updatedNotices.push({
|
|
85348
|
+
notice: notice,
|
|
85349
|
+
holderCallback: holderCallback
|
|
85350
|
+
});
|
|
85351
|
+
}
|
|
85352
|
+
|
|
85353
|
+
return {
|
|
85354
|
+
notices: updatedNotices
|
|
85355
|
+
};
|
|
85356
|
+
});
|
|
85357
|
+
};
|
|
85358
|
+
|
|
85359
|
+
_this.remove = function (removeKey) {
|
|
85360
|
+
_this.setState(function (_ref) {
|
|
85361
|
+
var notices = _ref.notices;
|
|
85362
|
+
return {
|
|
85363
|
+
notices: notices.filter(function (_ref2) {
|
|
85364
|
+
var _ref2$notice = _ref2.notice,
|
|
85365
|
+
key = _ref2$notice.key,
|
|
85366
|
+
userPassKey = _ref2$notice.userPassKey;
|
|
85367
|
+
var mergedKey = userPassKey || key;
|
|
85368
|
+
return mergedKey !== removeKey;
|
|
85369
|
+
})
|
|
85370
|
+
};
|
|
85371
|
+
});
|
|
85372
|
+
};
|
|
85373
|
+
|
|
85374
|
+
_this.noticePropsMap = {};
|
|
85375
|
+
return _this;
|
|
85376
|
+
}
|
|
85377
|
+
|
|
85378
|
+
_createClass(Notification, [{
|
|
85379
|
+
key: "getTransitionName",
|
|
85380
|
+
value: function getTransitionName() {
|
|
85381
|
+
var _this$props = this.props,
|
|
85382
|
+
prefixCls = _this$props.prefixCls,
|
|
85383
|
+
animation = _this$props.animation;
|
|
85384
|
+
var transitionName = this.props.transitionName;
|
|
85385
|
+
|
|
85386
|
+
if (!transitionName && animation) {
|
|
85387
|
+
transitionName = "".concat(prefixCls, "-").concat(animation);
|
|
85388
|
+
}
|
|
85389
|
+
|
|
85390
|
+
return transitionName;
|
|
85391
|
+
}
|
|
85392
|
+
}, {
|
|
85393
|
+
key: "render",
|
|
85394
|
+
value: function render() {
|
|
85395
|
+
var _this2 = this;
|
|
85396
|
+
|
|
85397
|
+
var notices = this.state.notices;
|
|
85398
|
+
var _this$props2 = this.props,
|
|
85399
|
+
prefixCls = _this$props2.prefixCls,
|
|
85400
|
+
className = _this$props2.className,
|
|
85401
|
+
closeIcon = _this$props2.closeIcon,
|
|
85402
|
+
style = _this$props2.style;
|
|
85403
|
+
var noticeKeys = [];
|
|
85404
|
+
notices.forEach(function (_ref3, index) {
|
|
85405
|
+
var notice = _ref3.notice,
|
|
85406
|
+
holderCallback = _ref3.holderCallback;
|
|
85407
|
+
var updateMark = index === notices.length - 1 ? notice.updateMark : undefined;
|
|
85408
|
+
var key = notice.key,
|
|
85409
|
+
userPassKey = notice.userPassKey;
|
|
85410
|
+
|
|
85411
|
+
var noticeProps = _objectSpread2(_objectSpread2(_objectSpread2({
|
|
85412
|
+
prefixCls: prefixCls,
|
|
85413
|
+
closeIcon: closeIcon
|
|
85414
|
+
}, notice), notice.props), {}, {
|
|
85415
|
+
key: key,
|
|
85416
|
+
noticeKey: userPassKey || key,
|
|
85417
|
+
updateMark: updateMark,
|
|
85418
|
+
onClose: function onClose(noticeKey) {
|
|
85419
|
+
var _notice$onClose;
|
|
85420
|
+
|
|
85421
|
+
_this2.remove(noticeKey);
|
|
85422
|
+
|
|
85423
|
+
(_notice$onClose = notice.onClose) === null || _notice$onClose === void 0 ? void 0 : _notice$onClose.call(notice);
|
|
85424
|
+
},
|
|
85425
|
+
onClick: notice.onClick,
|
|
85426
|
+
children: notice.content
|
|
85427
|
+
}); // Give to motion
|
|
85428
|
+
|
|
85429
|
+
|
|
85430
|
+
noticeKeys.push(key);
|
|
85431
|
+
_this2.noticePropsMap[key] = {
|
|
85432
|
+
props: noticeProps,
|
|
85433
|
+
holderCallback: holderCallback
|
|
85434
|
+
};
|
|
85435
|
+
});
|
|
85436
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
85437
|
+
className: classnames(prefixCls, className),
|
|
85438
|
+
style: style
|
|
85439
|
+
}, /*#__PURE__*/React.createElement(CSSMotionList, {
|
|
85440
|
+
keys: noticeKeys,
|
|
85441
|
+
motionName: this.getTransitionName(),
|
|
85442
|
+
onVisibleChanged: function onVisibleChanged(changedVisible, _ref4) {
|
|
85443
|
+
var key = _ref4.key;
|
|
85444
|
+
|
|
85445
|
+
if (!changedVisible) {
|
|
85446
|
+
delete _this2.noticePropsMap[key];
|
|
85447
|
+
}
|
|
85448
|
+
}
|
|
85449
|
+
}, function (_ref5) {
|
|
85450
|
+
var key = _ref5.key,
|
|
85451
|
+
motionClassName = _ref5.className,
|
|
85452
|
+
motionStyle = _ref5.style,
|
|
85453
|
+
visible = _ref5.visible;
|
|
85454
|
+
var _this2$noticePropsMap = _this2.noticePropsMap[key],
|
|
85455
|
+
noticeProps = _this2$noticePropsMap.props,
|
|
85456
|
+
holderCallback = _this2$noticePropsMap.holderCallback;
|
|
85457
|
+
|
|
85458
|
+
if (holderCallback) {
|
|
85459
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
85460
|
+
key: key,
|
|
85461
|
+
className: classnames(motionClassName, "".concat(prefixCls, "-hook-holder")),
|
|
85462
|
+
style: _objectSpread2({}, motionStyle),
|
|
85463
|
+
ref: function ref(div) {
|
|
85464
|
+
if (typeof key === 'undefined') {
|
|
85465
|
+
return;
|
|
85466
|
+
}
|
|
85467
|
+
|
|
85468
|
+
if (div) {
|
|
85469
|
+
_this2.hookRefs.set(key, div);
|
|
85470
|
+
|
|
85471
|
+
holderCallback(div, noticeProps);
|
|
85472
|
+
} else {
|
|
85473
|
+
_this2.hookRefs.delete(key);
|
|
85474
|
+
}
|
|
85475
|
+
}
|
|
85476
|
+
});
|
|
85477
|
+
}
|
|
85478
|
+
|
|
85479
|
+
return /*#__PURE__*/React.createElement(Notice, _extends$5({}, noticeProps, {
|
|
85480
|
+
className: classnames(motionClassName, noticeProps === null || noticeProps === void 0 ? void 0 : noticeProps.className),
|
|
85481
|
+
style: _objectSpread2(_objectSpread2({}, motionStyle), noticeProps === null || noticeProps === void 0 ? void 0 : noticeProps.style),
|
|
85482
|
+
visible: visible
|
|
85483
|
+
}));
|
|
85484
|
+
}));
|
|
85485
|
+
}
|
|
85486
|
+
}]);
|
|
85487
|
+
|
|
85488
|
+
return Notification;
|
|
85489
|
+
}(React.Component);
|
|
85490
|
+
|
|
85491
|
+
Notification.newInstance = void 0;
|
|
85492
|
+
Notification.defaultProps = {
|
|
85493
|
+
prefixCls: 'rc-notification',
|
|
85494
|
+
animation: 'fade',
|
|
85495
|
+
style: {
|
|
85496
|
+
top: 65,
|
|
85497
|
+
left: '50%'
|
|
85498
|
+
}
|
|
85499
|
+
};
|
|
85500
|
+
|
|
85501
|
+
Notification.newInstance = function newNotificationInstance(properties, callback) {
|
|
85502
|
+
var _ref6 = properties || {},
|
|
85503
|
+
getContainer = _ref6.getContainer,
|
|
85504
|
+
props = _objectWithoutProperties$1(_ref6, _excluded$1n);
|
|
85505
|
+
|
|
85506
|
+
var div = document.createElement('div');
|
|
85507
|
+
|
|
85508
|
+
if (getContainer) {
|
|
85509
|
+
var root = getContainer();
|
|
85510
|
+
root.appendChild(div);
|
|
85511
|
+
} else {
|
|
85512
|
+
document.body.appendChild(div);
|
|
85513
|
+
}
|
|
85514
|
+
|
|
85515
|
+
var called = false;
|
|
85516
|
+
|
|
85517
|
+
function ref(notification) {
|
|
85518
|
+
if (called) {
|
|
85519
|
+
return;
|
|
85520
|
+
}
|
|
85521
|
+
|
|
85522
|
+
called = true;
|
|
85523
|
+
callback({
|
|
85524
|
+
notice: function notice(noticeProps) {
|
|
85525
|
+
notification.add(noticeProps);
|
|
85526
|
+
},
|
|
85527
|
+
removeNotice: function removeNotice(key) {
|
|
85528
|
+
notification.remove(key);
|
|
85529
|
+
},
|
|
85530
|
+
component: notification,
|
|
85531
|
+
destroy: function destroy() {
|
|
85532
|
+
unmount(div);
|
|
85533
|
+
|
|
85534
|
+
if (div.parentNode) {
|
|
85535
|
+
div.parentNode.removeChild(div);
|
|
85536
|
+
}
|
|
85537
|
+
},
|
|
85538
|
+
// Hooks
|
|
85539
|
+
useNotification: function useNotification$1() {
|
|
85540
|
+
return useNotification(notification);
|
|
85541
|
+
}
|
|
85542
|
+
});
|
|
85543
|
+
} // Only used for test case usage
|
|
85544
|
+
|
|
85545
|
+
render$3( /*#__PURE__*/React.createElement(Notification, _extends$5({}, props, {
|
|
85546
|
+
ref: ref
|
|
85547
|
+
})), div);
|
|
85548
|
+
};
|
|
85549
|
+
|
|
85550
|
+
var interopRequireWildcard = createCommonjsModule(function (module) {
|
|
85551
|
+
var _typeof = _typeof_1["default"];
|
|
85552
|
+
|
|
85553
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
85554
|
+
if (typeof WeakMap !== "function") return null;
|
|
85555
|
+
var cacheBabelInterop = new WeakMap();
|
|
85556
|
+
var cacheNodeInterop = new WeakMap();
|
|
85557
|
+
return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) {
|
|
85558
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
85559
|
+
})(nodeInterop);
|
|
85560
|
+
}
|
|
85561
|
+
|
|
85562
|
+
function _interopRequireWildcard(obj, nodeInterop) {
|
|
85563
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
85564
|
+
return obj;
|
|
85565
|
+
}
|
|
85566
|
+
|
|
85567
|
+
if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
|
|
85568
|
+
return {
|
|
85569
|
+
"default": obj
|
|
85570
|
+
};
|
|
85571
|
+
}
|
|
85572
|
+
|
|
85573
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
85574
|
+
|
|
85575
|
+
if (cache && cache.has(obj)) {
|
|
85576
|
+
return cache.get(obj);
|
|
85577
|
+
}
|
|
85578
|
+
|
|
85579
|
+
var newObj = {};
|
|
85580
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
85581
|
+
|
|
85582
|
+
for (var key in obj) {
|
|
85583
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
85584
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
85585
|
+
|
|
85586
|
+
if (desc && (desc.get || desc.set)) {
|
|
85587
|
+
Object.defineProperty(newObj, key, desc);
|
|
85588
|
+
} else {
|
|
85589
|
+
newObj[key] = obj[key];
|
|
85590
|
+
}
|
|
85591
|
+
}
|
|
85592
|
+
}
|
|
85593
|
+
|
|
85594
|
+
newObj["default"] = obj;
|
|
85595
|
+
|
|
85596
|
+
if (cache) {
|
|
85597
|
+
cache.set(obj, newObj);
|
|
85598
|
+
}
|
|
85599
|
+
|
|
85600
|
+
return newObj;
|
|
85601
|
+
}
|
|
85602
|
+
|
|
85603
|
+
module.exports = _interopRequireWildcard, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
85604
|
+
});
|
|
85605
|
+
|
|
85606
|
+
var interopRequireDefault = createCommonjsModule(function (module) {
|
|
85607
|
+
function _interopRequireDefault(obj) {
|
|
85608
|
+
return obj && obj.__esModule ? obj : {
|
|
85609
|
+
"default": obj
|
|
85610
|
+
};
|
|
85611
|
+
}
|
|
85612
|
+
|
|
85613
|
+
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
85614
|
+
});
|
|
85615
|
+
|
|
85616
|
+
var classCallCheck$1 = createCommonjsModule(function (module) {
|
|
85617
|
+
function _classCallCheck(instance, Constructor) {
|
|
85618
|
+
if (!(instance instanceof Constructor)) {
|
|
85619
|
+
throw new TypeError("Cannot call a class as a function");
|
|
85620
|
+
}
|
|
85621
|
+
}
|
|
85622
|
+
|
|
85623
|
+
module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
85624
|
+
});
|
|
85625
|
+
|
|
85626
|
+
var createClass$1 = createCommonjsModule(function (module) {
|
|
85627
|
+
function _defineProperties(target, props) {
|
|
85628
|
+
for (var i = 0; i < props.length; i++) {
|
|
85629
|
+
var descriptor = props[i];
|
|
85630
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
85631
|
+
descriptor.configurable = true;
|
|
85632
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
85633
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
85634
|
+
}
|
|
85635
|
+
}
|
|
85636
|
+
|
|
85637
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
85638
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
85639
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
85640
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
85641
|
+
writable: false
|
|
85642
|
+
});
|
|
85643
|
+
return Constructor;
|
|
85644
|
+
}
|
|
85645
|
+
|
|
85646
|
+
module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
85647
|
+
});
|
|
85648
|
+
|
|
85649
|
+
var setPrototypeOf = createCommonjsModule(function (module) {
|
|
85650
|
+
function _setPrototypeOf(o, p) {
|
|
85651
|
+
module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
85652
|
+
o.__proto__ = p;
|
|
85653
|
+
return o;
|
|
85654
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
85655
|
+
return _setPrototypeOf(o, p);
|
|
85656
|
+
}
|
|
85657
|
+
|
|
85658
|
+
module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
85659
|
+
});
|
|
85660
|
+
|
|
85661
|
+
var inherits$1 = createCommonjsModule(function (module) {
|
|
85662
|
+
function _inherits(subClass, superClass) {
|
|
85663
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
85664
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
85665
|
+
}
|
|
85666
|
+
|
|
85667
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
85668
|
+
constructor: {
|
|
85669
|
+
value: subClass,
|
|
85670
|
+
writable: true,
|
|
85671
|
+
configurable: true
|
|
85672
|
+
}
|
|
85673
|
+
});
|
|
85674
|
+
Object.defineProperty(subClass, "prototype", {
|
|
85675
|
+
writable: false
|
|
85676
|
+
});
|
|
85677
|
+
if (superClass) setPrototypeOf(subClass, superClass);
|
|
85678
|
+
}
|
|
85679
|
+
|
|
85680
|
+
module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
85681
|
+
});
|
|
85682
|
+
|
|
85683
|
+
var getPrototypeOf = createCommonjsModule(function (module) {
|
|
85684
|
+
function _getPrototypeOf(o) {
|
|
85685
|
+
module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
85686
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
85687
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
85688
|
+
return _getPrototypeOf(o);
|
|
85689
|
+
}
|
|
85690
|
+
|
|
85691
|
+
module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
85692
|
+
});
|
|
85693
|
+
|
|
85694
|
+
var isNativeReflectConstruct = createCommonjsModule(function (module) {
|
|
85695
|
+
function _isNativeReflectConstruct() {
|
|
85696
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
85697
|
+
if (Reflect.construct.sham) return false;
|
|
85698
|
+
if (typeof Proxy === "function") return true;
|
|
85699
|
+
|
|
85700
|
+
try {
|
|
85701
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
85702
|
+
return true;
|
|
85703
|
+
} catch (e) {
|
|
85704
|
+
return false;
|
|
85705
|
+
}
|
|
85706
|
+
}
|
|
85707
|
+
|
|
85708
|
+
module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
85709
|
+
});
|
|
85710
|
+
|
|
85711
|
+
var assertThisInitialized = createCommonjsModule(function (module) {
|
|
85712
|
+
function _assertThisInitialized(self) {
|
|
85713
|
+
if (self === void 0) {
|
|
85714
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
85715
|
+
}
|
|
85716
|
+
|
|
85717
|
+
return self;
|
|
85718
|
+
}
|
|
85719
|
+
|
|
85720
|
+
module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
85721
|
+
});
|
|
85722
|
+
|
|
85723
|
+
var possibleConstructorReturn$1 = createCommonjsModule(function (module) {
|
|
85724
|
+
var _typeof = _typeof_1["default"];
|
|
85725
|
+
|
|
85726
|
+
|
|
85727
|
+
|
|
85728
|
+
function _possibleConstructorReturn(self, call) {
|
|
85729
|
+
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
85730
|
+
return call;
|
|
85731
|
+
} else if (call !== void 0) {
|
|
85732
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
85733
|
+
}
|
|
85734
|
+
|
|
85735
|
+
return assertThisInitialized(self);
|
|
85736
|
+
}
|
|
85737
|
+
|
|
85738
|
+
module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
85739
|
+
});
|
|
85740
|
+
|
|
85741
|
+
var createSuper = createCommonjsModule(function (module) {
|
|
85742
|
+
function _createSuper(Derived) {
|
|
85743
|
+
var hasNativeReflectConstruct = isNativeReflectConstruct();
|
|
85744
|
+
return function _createSuperInternal() {
|
|
85745
|
+
var Super = getPrototypeOf(Derived),
|
|
85746
|
+
result;
|
|
85747
|
+
|
|
85748
|
+
if (hasNativeReflectConstruct) {
|
|
85749
|
+
var NewTarget = getPrototypeOf(this).constructor;
|
|
85750
|
+
result = Reflect.construct(Super, arguments, NewTarget);
|
|
85751
|
+
} else {
|
|
85752
|
+
result = Super.apply(this, arguments);
|
|
85753
|
+
}
|
|
85754
|
+
|
|
85755
|
+
return possibleConstructorReturn$1(this, result);
|
|
85756
|
+
};
|
|
85757
|
+
}
|
|
85758
|
+
|
|
85759
|
+
module.exports = _createSuper, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
85760
|
+
});
|
|
85761
|
+
|
|
85762
|
+
var Notice_1 = createCommonjsModule(function (module, exports) {
|
|
85763
|
+
|
|
85764
|
+
|
|
85765
|
+
|
|
85766
|
+
|
|
85767
|
+
|
|
85768
|
+
Object.defineProperty(exports, "__esModule", {
|
|
85769
|
+
value: true
|
|
85770
|
+
});
|
|
85771
|
+
exports.default = void 0;
|
|
85772
|
+
|
|
85773
|
+
var _extends2 = interopRequireDefault(_extends_1);
|
|
85774
|
+
|
|
85775
|
+
var _defineProperty2 = interopRequireDefault(defineProperty);
|
|
85776
|
+
|
|
85777
|
+
var _classCallCheck2 = interopRequireDefault(classCallCheck$1);
|
|
85778
|
+
|
|
85779
|
+
var _createClass2 = interopRequireDefault(createClass$1);
|
|
85780
|
+
|
|
85781
|
+
var _inherits2 = interopRequireDefault(inherits$1);
|
|
85782
|
+
|
|
85783
|
+
var _createSuper2 = interopRequireDefault(createSuper);
|
|
85784
|
+
|
|
85785
|
+
var React = interopRequireWildcard(React__default['default']);
|
|
85786
|
+
|
|
85787
|
+
var _reactDom = interopRequireDefault(ReactDOM__default['default']);
|
|
85788
|
+
|
|
85789
|
+
var _classnames = interopRequireDefault(classnames);
|
|
85790
|
+
|
|
85791
|
+
var Notice = /*#__PURE__*/function (_Component) {
|
|
85792
|
+
(0, _inherits2.default)(Notice, _Component);
|
|
85793
|
+
|
|
85794
|
+
var _super = (0, _createSuper2.default)(Notice);
|
|
85795
|
+
|
|
85796
|
+
function Notice() {
|
|
85797
|
+
var _this;
|
|
85798
|
+
|
|
85799
|
+
(0, _classCallCheck2.default)(this, Notice);
|
|
85800
|
+
|
|
85801
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
85802
|
+
args[_key] = arguments[_key];
|
|
85803
|
+
}
|
|
85804
|
+
|
|
85805
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
85806
|
+
_this.closeTimer = null;
|
|
85807
|
+
|
|
85808
|
+
_this.close = function (e) {
|
|
85809
|
+
if (e) {
|
|
85810
|
+
e.stopPropagation();
|
|
85811
|
+
}
|
|
85812
|
+
|
|
85813
|
+
_this.clearCloseTimer();
|
|
85814
|
+
|
|
85815
|
+
var _this$props = _this.props,
|
|
85816
|
+
onClose = _this$props.onClose,
|
|
85817
|
+
noticeKey = _this$props.noticeKey;
|
|
85818
|
+
|
|
85819
|
+
if (onClose) {
|
|
85820
|
+
onClose(noticeKey);
|
|
85821
|
+
}
|
|
85822
|
+
};
|
|
85823
|
+
|
|
85824
|
+
_this.startCloseTimer = function () {
|
|
85825
|
+
if (_this.props.duration) {
|
|
85826
|
+
_this.closeTimer = window.setTimeout(function () {
|
|
85827
|
+
_this.close();
|
|
85828
|
+
}, _this.props.duration * 1000);
|
|
85829
|
+
}
|
|
85830
|
+
};
|
|
85831
|
+
|
|
85832
|
+
_this.clearCloseTimer = function () {
|
|
85833
|
+
if (_this.closeTimer) {
|
|
85834
|
+
clearTimeout(_this.closeTimer);
|
|
85835
|
+
_this.closeTimer = null;
|
|
85836
|
+
}
|
|
85837
|
+
};
|
|
85838
|
+
|
|
85839
|
+
return _this;
|
|
85840
|
+
}
|
|
85841
|
+
|
|
85842
|
+
(0, _createClass2.default)(Notice, [{
|
|
85843
|
+
key: "componentDidMount",
|
|
85844
|
+
value: function componentDidMount() {
|
|
85845
|
+
this.startCloseTimer();
|
|
85846
|
+
}
|
|
85847
|
+
}, {
|
|
85848
|
+
key: "componentDidUpdate",
|
|
85849
|
+
value: function componentDidUpdate(prevProps) {
|
|
85850
|
+
if (this.props.duration !== prevProps.duration || this.props.updateMark !== prevProps.updateMark || // Visible again need reset timer
|
|
85851
|
+
this.props.visible !== prevProps.visible && this.props.visible) {
|
|
85852
|
+
this.restartCloseTimer();
|
|
85853
|
+
}
|
|
85854
|
+
}
|
|
85855
|
+
}, {
|
|
85856
|
+
key: "componentWillUnmount",
|
|
85857
|
+
value: function componentWillUnmount() {
|
|
85858
|
+
this.clearCloseTimer();
|
|
85859
|
+
}
|
|
85860
|
+
}, {
|
|
85861
|
+
key: "restartCloseTimer",
|
|
85862
|
+
value: function restartCloseTimer() {
|
|
85863
|
+
this.clearCloseTimer();
|
|
85864
|
+
this.startCloseTimer();
|
|
85865
|
+
}
|
|
85866
|
+
}, {
|
|
85867
|
+
key: "render",
|
|
85868
|
+
value: function render() {
|
|
85869
|
+
var _this2 = this;
|
|
85870
|
+
|
|
85871
|
+
var _this$props2 = this.props,
|
|
85872
|
+
prefixCls = _this$props2.prefixCls,
|
|
85873
|
+
className = _this$props2.className,
|
|
85874
|
+
closable = _this$props2.closable,
|
|
85875
|
+
closeIcon = _this$props2.closeIcon,
|
|
85876
|
+
style = _this$props2.style,
|
|
85877
|
+
onClick = _this$props2.onClick,
|
|
85878
|
+
children = _this$props2.children,
|
|
85879
|
+
holder = _this$props2.holder;
|
|
85880
|
+
var componentClass = "".concat(prefixCls, "-notice");
|
|
85881
|
+
var dataOrAriaAttributeProps = Object.keys(this.props).reduce(function (acc, key) {
|
|
85882
|
+
if (key.substr(0, 5) === 'data-' || key.substr(0, 5) === 'aria-' || key === 'role') {
|
|
85883
|
+
acc[key] = _this2.props[key];
|
|
85884
|
+
}
|
|
85885
|
+
|
|
85886
|
+
return acc;
|
|
85887
|
+
}, {});
|
|
85888
|
+
var node = /*#__PURE__*/React.createElement("div", (0, _extends2.default)({
|
|
85889
|
+
className: (0, _classnames.default)(componentClass, className, (0, _defineProperty2.default)({}, "".concat(componentClass, "-closable"), closable)),
|
|
85890
|
+
style: style,
|
|
85891
|
+
onMouseEnter: this.clearCloseTimer,
|
|
85892
|
+
onMouseLeave: this.startCloseTimer,
|
|
85893
|
+
onClick: onClick
|
|
85894
|
+
}, dataOrAriaAttributeProps), /*#__PURE__*/React.createElement("div", {
|
|
85895
|
+
className: "".concat(componentClass, "-content")
|
|
85896
|
+
}, children), closable ? /*#__PURE__*/React.createElement("a", {
|
|
85897
|
+
tabIndex: 0,
|
|
85898
|
+
onClick: this.close,
|
|
85899
|
+
className: "".concat(componentClass, "-close")
|
|
85900
|
+
}, closeIcon || /*#__PURE__*/React.createElement("span", {
|
|
85901
|
+
className: "".concat(componentClass, "-close-x")
|
|
85902
|
+
})) : null);
|
|
85903
|
+
|
|
85904
|
+
if (holder) {
|
|
85905
|
+
return /*#__PURE__*/_reactDom.default.createPortal(node, holder);
|
|
85906
|
+
}
|
|
85907
|
+
|
|
85908
|
+
return node;
|
|
85909
|
+
}
|
|
85910
|
+
}]);
|
|
85911
|
+
return Notice;
|
|
85912
|
+
}(React.Component);
|
|
85913
|
+
|
|
85914
|
+
exports.default = Notice;
|
|
85915
|
+
Notice.defaultProps = {
|
|
85916
|
+
onClose: function onClose() {},
|
|
85917
|
+
duration: 1.5
|
|
85918
|
+
};
|
|
85919
|
+
});
|
|
85920
|
+
|
|
85921
|
+
var useNotification_1 = createCommonjsModule(function (module, exports) {
|
|
85922
|
+
|
|
85923
|
+
|
|
85924
|
+
|
|
85925
|
+
|
|
85926
|
+
|
|
85927
|
+
Object.defineProperty(exports, "__esModule", {
|
|
85928
|
+
value: true
|
|
85929
|
+
});
|
|
85930
|
+
exports.default = useNotification;
|
|
85931
|
+
|
|
85932
|
+
var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
|
|
85933
|
+
|
|
85934
|
+
var _extends2 = interopRequireDefault(_extends_1);
|
|
85935
|
+
|
|
85936
|
+
var _slicedToArray2 = interopRequireDefault(slicedToArray);
|
|
85937
|
+
|
|
85938
|
+
var React = interopRequireWildcard(React__default['default']);
|
|
85939
|
+
|
|
85940
|
+
var _Notice = interopRequireDefault(Notice_1);
|
|
85941
|
+
|
|
85942
|
+
function useNotification(notificationInstance) {
|
|
85943
|
+
var createdRef = React.useRef({});
|
|
85944
|
+
|
|
85945
|
+
var _React$useState = React.useState([]),
|
|
85946
|
+
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
85947
|
+
elements = _React$useState2[0],
|
|
85948
|
+
setElements = _React$useState2[1];
|
|
85949
|
+
|
|
85950
|
+
function notify(noticeProps) {
|
|
85951
|
+
var firstMount = true;
|
|
85952
|
+
notificationInstance.add(noticeProps, function (div, props) {
|
|
85953
|
+
var key = props.key;
|
|
85954
|
+
|
|
85955
|
+
if (div && (!createdRef.current[key] || firstMount)) {
|
|
85956
|
+
var noticeEle = /*#__PURE__*/React.createElement(_Notice.default, (0, _extends2.default)({}, props, {
|
|
85957
|
+
holder: div
|
|
85958
|
+
}));
|
|
85959
|
+
createdRef.current[key] = noticeEle;
|
|
85960
|
+
setElements(function (originElements) {
|
|
85961
|
+
var index = originElements.findIndex(function (ele) {
|
|
85962
|
+
return ele.key === props.key;
|
|
85963
|
+
});
|
|
85964
|
+
|
|
85965
|
+
if (index === -1) {
|
|
85966
|
+
return [].concat((0, _toConsumableArray2.default)(originElements), [noticeEle]);
|
|
85967
|
+
}
|
|
85968
|
+
|
|
85969
|
+
var cloneList = (0, _toConsumableArray2.default)(originElements);
|
|
85970
|
+
cloneList[index] = noticeEle;
|
|
85971
|
+
return cloneList;
|
|
85972
|
+
});
|
|
85973
|
+
}
|
|
85974
|
+
|
|
85975
|
+
firstMount = false;
|
|
85976
|
+
});
|
|
85977
|
+
}
|
|
85978
|
+
|
|
85979
|
+
return [notify, /*#__PURE__*/React.createElement(React.Fragment, null, elements)];
|
|
85980
|
+
}
|
|
85981
|
+
});
|
|
85982
|
+
|
|
85983
|
+
var useRCNotification = /*@__PURE__*/getDefaultExportFromCjs(useNotification_1);
|
|
85984
|
+
|
|
85985
|
+
function createUseMessage(getRcNotificationInstance, getRCNoticeProps) {
|
|
85986
|
+
var useMessage = function useMessage() {
|
|
85987
|
+
// We can only get content by render
|
|
85988
|
+
var getPrefixCls;
|
|
85989
|
+
var getPopupContainer; // We create a proxy to handle delay created instance
|
|
85990
|
+
|
|
85991
|
+
var innerInstance = null;
|
|
85992
|
+
var proxy = {
|
|
85993
|
+
add: function add(noticeProps, holderCallback) {
|
|
85994
|
+
var _innerInstance;
|
|
85995
|
+
|
|
85996
|
+
(_innerInstance = innerInstance) === null || _innerInstance === void 0 ? void 0 : _innerInstance.component.add(noticeProps, holderCallback);
|
|
85997
|
+
}
|
|
85998
|
+
};
|
|
85999
|
+
|
|
86000
|
+
var _useRCNotification = useRCNotification(proxy),
|
|
86001
|
+
_useRCNotification2 = _slicedToArray(_useRCNotification, 2),
|
|
86002
|
+
hookNotify = _useRCNotification2[0],
|
|
86003
|
+
holder = _useRCNotification2[1];
|
|
86004
|
+
|
|
86005
|
+
function notify(args) {
|
|
86006
|
+
var customizePrefixCls = args.prefixCls;
|
|
86007
|
+
var mergedPrefixCls = getPrefixCls('message', customizePrefixCls);
|
|
86008
|
+
var rootPrefixCls = getPrefixCls();
|
|
86009
|
+
var target = args.key || getKeyThenIncreaseKey();
|
|
86010
|
+
var closePromise = new Promise(function (resolve) {
|
|
86011
|
+
var callback = function callback() {
|
|
86012
|
+
if (typeof args.onClose === 'function') {
|
|
86013
|
+
args.onClose();
|
|
86014
|
+
}
|
|
86015
|
+
|
|
86016
|
+
return resolve(true);
|
|
86017
|
+
};
|
|
86018
|
+
|
|
86019
|
+
getRcNotificationInstance(_objectSpread(_objectSpread({}, args), {}, {
|
|
86020
|
+
prefixCls: mergedPrefixCls,
|
|
86021
|
+
rootPrefixCls: rootPrefixCls,
|
|
86022
|
+
getPopupContainer: getPopupContainer
|
|
86023
|
+
}), function (_ref) {
|
|
86024
|
+
var prefixCls = _ref.prefixCls,
|
|
86025
|
+
instance = _ref.instance;
|
|
86026
|
+
innerInstance = instance;
|
|
86027
|
+
hookNotify(getRCNoticeProps(_objectSpread(_objectSpread({}, args), {}, {
|
|
86028
|
+
key: target,
|
|
86029
|
+
onClose: callback
|
|
86030
|
+
}), prefixCls));
|
|
86031
|
+
});
|
|
86032
|
+
});
|
|
86033
|
+
|
|
86034
|
+
var result = function result() {
|
|
86035
|
+
if (innerInstance) {
|
|
86036
|
+
innerInstance.removeNotice(target);
|
|
86037
|
+
}
|
|
86038
|
+
};
|
|
86039
|
+
|
|
86040
|
+
result.then = function (filled, rejected) {
|
|
86041
|
+
return closePromise.then(filled, rejected);
|
|
86042
|
+
};
|
|
86043
|
+
|
|
86044
|
+
result.promise = closePromise;
|
|
86045
|
+
return result;
|
|
86046
|
+
} // Fill functions
|
|
86047
|
+
|
|
86048
|
+
|
|
86049
|
+
var hookApiRef = React.useRef({});
|
|
86050
|
+
hookApiRef.current.open = notify;
|
|
86051
|
+
typeList.forEach(function (type) {
|
|
86052
|
+
return attachTypeApi(hookApiRef.current, type);
|
|
86053
|
+
});
|
|
86054
|
+
return [hookApiRef.current, /*#__PURE__*/React.createElement(_ConfigProvider.ConfigConsumer, {
|
|
86055
|
+
key: "holder"
|
|
86056
|
+
}, function (context) {
|
|
86057
|
+
getPrefixCls = context.getPrefixCls;
|
|
86058
|
+
getPopupContainer = context.getPopupContainer;
|
|
86059
|
+
return holder;
|
|
86060
|
+
})];
|
|
86061
|
+
};
|
|
86062
|
+
|
|
86063
|
+
return useMessage;
|
|
86064
|
+
}
|
|
86065
|
+
|
|
86066
|
+
var messageInstance;
|
|
86067
|
+
var defaultDuration = 3;
|
|
86068
|
+
var defaultTop;
|
|
86069
|
+
var key = 1;
|
|
86070
|
+
var localPrefixCls = '';
|
|
86071
|
+
var transitionName = 'move-up';
|
|
86072
|
+
var hasTransitionName = false;
|
|
86073
|
+
var getContainer$1;
|
|
86074
|
+
var maxCount;
|
|
86075
|
+
var rtl = false;
|
|
86076
|
+
function getKeyThenIncreaseKey() {
|
|
86077
|
+
return key++;
|
|
86078
|
+
}
|
|
86079
|
+
|
|
86080
|
+
function setMessageConfig(options) {
|
|
86081
|
+
if (options.top !== undefined) {
|
|
86082
|
+
defaultTop = options.top;
|
|
86083
|
+
messageInstance = null; // delete messageInstance for new defaultTop
|
|
86084
|
+
}
|
|
86085
|
+
|
|
86086
|
+
if (options.duration !== undefined) {
|
|
86087
|
+
defaultDuration = options.duration;
|
|
86088
|
+
}
|
|
86089
|
+
|
|
86090
|
+
if (options.prefixCls !== undefined) {
|
|
86091
|
+
localPrefixCls = options.prefixCls;
|
|
86092
|
+
}
|
|
86093
|
+
|
|
86094
|
+
if (options.getContainer !== undefined) {
|
|
86095
|
+
getContainer$1 = options.getContainer;
|
|
86096
|
+
messageInstance = null; // delete messageInstance for new getContainer
|
|
86097
|
+
}
|
|
86098
|
+
|
|
86099
|
+
if (options.transitionName !== undefined) {
|
|
86100
|
+
transitionName = options.transitionName;
|
|
86101
|
+
messageInstance = null; // delete messageInstance for new transitionName
|
|
86102
|
+
|
|
86103
|
+
hasTransitionName = true;
|
|
86104
|
+
}
|
|
86105
|
+
|
|
86106
|
+
if (options.maxCount !== undefined) {
|
|
86107
|
+
maxCount = options.maxCount;
|
|
86108
|
+
messageInstance = null;
|
|
86109
|
+
}
|
|
86110
|
+
|
|
86111
|
+
if (options.rtl !== undefined) {
|
|
86112
|
+
rtl = options.rtl;
|
|
86113
|
+
}
|
|
86114
|
+
}
|
|
86115
|
+
|
|
86116
|
+
function getRCNotificationInstance(args, callback) {
|
|
86117
|
+
var customizePrefixCls = args.prefixCls,
|
|
86118
|
+
getContextPopupContainer = args.getPopupContainer;
|
|
86119
|
+
|
|
86120
|
+
var _globalConfig = _ConfigProvider.globalConfig(),
|
|
86121
|
+
getPrefixCls = _globalConfig.getPrefixCls,
|
|
86122
|
+
getRootPrefixCls = _globalConfig.getRootPrefixCls,
|
|
86123
|
+
getIconPrefixCls = _globalConfig.getIconPrefixCls;
|
|
86124
|
+
|
|
86125
|
+
var prefixCls = getPrefixCls('message', customizePrefixCls || localPrefixCls);
|
|
86126
|
+
var rootPrefixCls = getRootPrefixCls(args.rootPrefixCls, prefixCls);
|
|
86127
|
+
var iconPrefixCls = getIconPrefixCls();
|
|
86128
|
+
|
|
86129
|
+
if (messageInstance) {
|
|
86130
|
+
callback({
|
|
86131
|
+
prefixCls: prefixCls,
|
|
86132
|
+
rootPrefixCls: rootPrefixCls,
|
|
86133
|
+
iconPrefixCls: iconPrefixCls,
|
|
86134
|
+
instance: messageInstance
|
|
86135
|
+
});
|
|
86136
|
+
return;
|
|
86137
|
+
}
|
|
86138
|
+
|
|
86139
|
+
var instanceConfig = {
|
|
86140
|
+
prefixCls: prefixCls,
|
|
86141
|
+
transitionName: hasTransitionName ? transitionName : "".concat(rootPrefixCls, "-").concat(transitionName),
|
|
86142
|
+
style: {
|
|
86143
|
+
top: defaultTop
|
|
86144
|
+
},
|
|
86145
|
+
getContainer: getContainer$1 || getContextPopupContainer,
|
|
86146
|
+
maxCount: maxCount
|
|
86147
|
+
};
|
|
86148
|
+
Notification.newInstance(instanceConfig, function (instance) {
|
|
86149
|
+
if (messageInstance) {
|
|
86150
|
+
callback({
|
|
86151
|
+
prefixCls: prefixCls,
|
|
86152
|
+
rootPrefixCls: rootPrefixCls,
|
|
86153
|
+
iconPrefixCls: iconPrefixCls,
|
|
86154
|
+
instance: messageInstance
|
|
86155
|
+
});
|
|
86156
|
+
return;
|
|
86157
|
+
}
|
|
86158
|
+
|
|
86159
|
+
messageInstance = instance;
|
|
86160
|
+
|
|
86161
|
+
callback({
|
|
86162
|
+
prefixCls: prefixCls,
|
|
86163
|
+
rootPrefixCls: rootPrefixCls,
|
|
86164
|
+
iconPrefixCls: iconPrefixCls,
|
|
86165
|
+
instance: instance
|
|
86166
|
+
});
|
|
86167
|
+
});
|
|
86168
|
+
}
|
|
86169
|
+
|
|
86170
|
+
var typeToIcon = {
|
|
86171
|
+
info: InfoCircleFilled$2,
|
|
86172
|
+
success: CheckCircleFilled$2,
|
|
86173
|
+
error: CloseCircleFilled$2,
|
|
86174
|
+
warning: ExclamationCircleFilled$2,
|
|
86175
|
+
loading: LoadingOutlined$2
|
|
86176
|
+
};
|
|
86177
|
+
var typeList = Object.keys(typeToIcon);
|
|
86178
|
+
|
|
86179
|
+
function getRCNoticeProps(args, prefixCls, iconPrefixCls) {
|
|
86180
|
+
var _classNames;
|
|
86181
|
+
|
|
86182
|
+
var duration = args.duration !== undefined ? args.duration : defaultDuration;
|
|
86183
|
+
var progress = args.progress === false ? false : true;
|
|
86184
|
+
var IconComponent = typeToIcon[args.type];
|
|
86185
|
+
var messageClass = classnames("".concat(prefixCls, "-custom-content"), (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-").concat(args.type), args.type), _defineProperty(_classNames, "".concat(prefixCls, "-rtl"), rtl === true), _classNames));
|
|
86186
|
+
return {
|
|
86187
|
+
key: args.key,
|
|
86188
|
+
duration: duration,
|
|
86189
|
+
style: args.style || {},
|
|
86190
|
+
className: classnames(args.className, 'lm_message'),
|
|
86191
|
+
content: /*#__PURE__*/React__default['default'].createElement(_ConfigProvider__default['default'], {
|
|
86192
|
+
iconPrefixCls: iconPrefixCls
|
|
86193
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
86194
|
+
className: messageClass
|
|
86195
|
+
}, args.icon || IconComponent && /*#__PURE__*/React__default['default'].createElement(IconComponent, null), /*#__PURE__*/React__default['default'].createElement("span", null, args.content), progress && duration > 0 && /*#__PURE__*/React__default['default'].createElement("div", {
|
|
86196
|
+
className: 'message_progress',
|
|
86197
|
+
style: {
|
|
86198
|
+
animationDuration: "".concat(duration, "s")
|
|
86199
|
+
}
|
|
86200
|
+
}))),
|
|
86201
|
+
onClose: args.onClose,
|
|
86202
|
+
onClick: args.onClick
|
|
86203
|
+
};
|
|
86204
|
+
}
|
|
86205
|
+
|
|
86206
|
+
function notice(args) {
|
|
86207
|
+
var target = args.key || getKeyThenIncreaseKey();
|
|
86208
|
+
var closePromise = new Promise(function (resolve) {
|
|
86209
|
+
var callback = function callback() {
|
|
86210
|
+
if (typeof args.onClose === 'function') {
|
|
86211
|
+
args.onClose();
|
|
86212
|
+
}
|
|
86213
|
+
|
|
86214
|
+
return resolve(true);
|
|
86215
|
+
};
|
|
86216
|
+
|
|
86217
|
+
getRCNotificationInstance(args, function (_ref) {
|
|
86218
|
+
var prefixCls = _ref.prefixCls,
|
|
86219
|
+
iconPrefixCls = _ref.iconPrefixCls,
|
|
86220
|
+
instance = _ref.instance;
|
|
86221
|
+
instance.notice(getRCNoticeProps(_objectSpread(_objectSpread({}, args), {}, {
|
|
86222
|
+
key: target,
|
|
86223
|
+
onClose: callback
|
|
86224
|
+
}), prefixCls, iconPrefixCls));
|
|
86225
|
+
});
|
|
86226
|
+
});
|
|
86227
|
+
|
|
86228
|
+
var result = function result() {
|
|
86229
|
+
if (messageInstance) {
|
|
86230
|
+
messageInstance.removeNotice(target);
|
|
86231
|
+
}
|
|
86232
|
+
};
|
|
86233
|
+
|
|
86234
|
+
result.then = function (filled, rejected) {
|
|
86235
|
+
return closePromise.then(filled, rejected);
|
|
86236
|
+
};
|
|
86237
|
+
|
|
86238
|
+
result.promise = closePromise;
|
|
86239
|
+
return result;
|
|
86240
|
+
}
|
|
86241
|
+
|
|
86242
|
+
function isArgsProps(content) {
|
|
86243
|
+
return Object.prototype.toString.call(content) === '[object Object]' && !!content.content;
|
|
86244
|
+
}
|
|
86245
|
+
|
|
86246
|
+
var api = {
|
|
86247
|
+
open: notice,
|
|
86248
|
+
config: setMessageConfig,
|
|
86249
|
+
destroy: function destroy(messageKey) {
|
|
86250
|
+
if (messageInstance) {
|
|
86251
|
+
if (messageKey) {
|
|
86252
|
+
var _messageInstance = messageInstance,
|
|
86253
|
+
removeNotice = _messageInstance.removeNotice;
|
|
86254
|
+
removeNotice(messageKey);
|
|
86255
|
+
} else {
|
|
86256
|
+
var _messageInstance2 = messageInstance,
|
|
86257
|
+
destroy = _messageInstance2.destroy;
|
|
86258
|
+
destroy();
|
|
86259
|
+
messageInstance = null;
|
|
86260
|
+
}
|
|
86261
|
+
}
|
|
86262
|
+
}
|
|
86263
|
+
};
|
|
86264
|
+
function attachTypeApi(originalApi, type) {
|
|
86265
|
+
originalApi[type] = function (content, duration, onClose) {
|
|
86266
|
+
if (isArgsProps(content)) {
|
|
86267
|
+
return originalApi.open(_objectSpread(_objectSpread({}, content), {}, {
|
|
86268
|
+
type: type
|
|
86269
|
+
}));
|
|
86270
|
+
}
|
|
86271
|
+
|
|
86272
|
+
if (typeof duration === 'function') {
|
|
86273
|
+
onClose = duration;
|
|
86274
|
+
duration = undefined;
|
|
86275
|
+
}
|
|
86276
|
+
|
|
86277
|
+
return originalApi.open({
|
|
86278
|
+
content: content,
|
|
86279
|
+
duration: duration,
|
|
86280
|
+
type: type,
|
|
86281
|
+
onClose: onClose
|
|
86282
|
+
});
|
|
86283
|
+
};
|
|
86284
|
+
}
|
|
86285
|
+
typeList.forEach(function (type) {
|
|
86286
|
+
return attachTypeApi(api, type);
|
|
86287
|
+
});
|
|
86288
|
+
api.warn = api.warning;
|
|
86289
|
+
api.useMessage = createUseMessage(getRCNotificationInstance, getRCNoticeProps);
|
|
86290
|
+
|
|
86291
|
+
var _excluded$1o = ["className", "size", "noBorder"];
|
|
84059
86292
|
var prefixCls$a = 'lm_tabs';
|
|
84060
86293
|
|
|
84061
86294
|
var LMTabs = function LMTabs(props) {
|
|
@@ -84064,7 +86297,7 @@
|
|
|
84064
86297
|
size = _props$size === void 0 ? "middle" : _props$size,
|
|
84065
86298
|
_props$noBorder = props.noBorder,
|
|
84066
86299
|
noBorder = _props$noBorder === void 0 ? false : _props$noBorder,
|
|
84067
|
-
others = _objectWithoutProperties(props, _excluded$
|
|
86300
|
+
others = _objectWithoutProperties(props, _excluded$1o);
|
|
84068
86301
|
|
|
84069
86302
|
return /*#__PURE__*/React__default['default'].createElement(_Tabs__default['default'], _objectSpread(_objectSpread({
|
|
84070
86303
|
size: size
|
|
@@ -84802,13 +87035,13 @@
|
|
|
84802
87035
|
}, props));
|
|
84803
87036
|
};
|
|
84804
87037
|
|
|
84805
|
-
var _excluded$
|
|
87038
|
+
var _excluded$1p = ["children", "className"];
|
|
84806
87039
|
var classNamePrefix = 'lm_form';
|
|
84807
87040
|
|
|
84808
87041
|
var LMForm = function LMForm(props, ref) {
|
|
84809
87042
|
var children = props.children,
|
|
84810
87043
|
className = props.className,
|
|
84811
|
-
restProps = _objectWithoutProperties(props, _excluded$
|
|
87044
|
+
restProps = _objectWithoutProperties(props, _excluded$1p);
|
|
84812
87045
|
|
|
84813
87046
|
return /*#__PURE__*/React__default['default'].createElement(_Form__default['default'], _objectSpread({
|
|
84814
87047
|
ref: ref,
|
|
@@ -84875,13 +87108,13 @@
|
|
|
84875
87108
|
}, children);
|
|
84876
87109
|
};
|
|
84877
87110
|
|
|
84878
|
-
var _excluded$
|
|
87111
|
+
var _excluded$1q = ["data-row-key", "children", "className"];
|
|
84879
87112
|
|
|
84880
87113
|
var SortableItem$1 = function SortableItem(props) {
|
|
84881
87114
|
var key = props['data-row-key'],
|
|
84882
87115
|
children = props.children,
|
|
84883
87116
|
className = props.className,
|
|
84884
|
-
resetField = _objectWithoutProperties(props, _excluded$
|
|
87117
|
+
resetField = _objectWithoutProperties(props, _excluded$1q);
|
|
84885
87118
|
|
|
84886
87119
|
var _useSortable = useSortable({
|
|
84887
87120
|
id: key
|
|
@@ -84921,8 +87154,8 @@
|
|
|
84921
87154
|
}));
|
|
84922
87155
|
};
|
|
84923
87156
|
|
|
84924
|
-
var _excluded$
|
|
84925
|
-
_excluded2$
|
|
87157
|
+
var _excluded$1r = ["index"],
|
|
87158
|
+
_excluded2$m = ["index"],
|
|
84926
87159
|
_excluded3$7 = ["value", "onChange"],
|
|
84927
87160
|
_excluded4$3 = ["record", "rowKey", "isEdit", "col", "handleTableRowDelete", "handleTableRowAdd", "getLength", "isHoverEdit", "editEnum", "valueType", "children", "handleSave", "handleAdd", "handleDelete", "itemProps", "setValid", "reWriteOriginSource"],
|
|
84928
87161
|
_excluded5$2 = ["onMouseEnter", "onMouseLeave"],
|
|
@@ -84932,7 +87165,7 @@
|
|
|
84932
87165
|
|
|
84933
87166
|
var EditableRow$1 = function EditableRow(_ref) {
|
|
84934
87167
|
var index = _ref.index,
|
|
84935
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
87168
|
+
props = _objectWithoutProperties(_ref, _excluded$1r);
|
|
84936
87169
|
|
|
84937
87170
|
var _Form$useForm = _Form__default['default'].useForm(),
|
|
84938
87171
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
@@ -84948,7 +87181,7 @@
|
|
|
84948
87181
|
|
|
84949
87182
|
var EditableSortRow = function EditableSortRow(_ref2) {
|
|
84950
87183
|
var index = _ref2.index,
|
|
84951
|
-
props = _objectWithoutProperties(_ref2, _excluded2$
|
|
87184
|
+
props = _objectWithoutProperties(_ref2, _excluded2$m);
|
|
84952
87185
|
|
|
84953
87186
|
var _Form$useForm3 = _Form__default['default'].useForm(),
|
|
84954
87187
|
_Form$useForm4 = _slicedToArray(_Form$useForm3, 1),
|
|
@@ -85779,12 +88012,6 @@
|
|
|
85779
88012
|
return _Spin__default['default'];
|
|
85780
88013
|
}
|
|
85781
88014
|
});
|
|
85782
|
-
Object.defineProperty(exports, 'message', {
|
|
85783
|
-
enumerable: true,
|
|
85784
|
-
get: function () {
|
|
85785
|
-
return _message__default['default'];
|
|
85786
|
-
}
|
|
85787
|
-
});
|
|
85788
88015
|
Object.defineProperty(exports, 'Image', {
|
|
85789
88016
|
enumerable: true,
|
|
85790
88017
|
get: function () {
|
|
@@ -85864,6 +88091,7 @@
|
|
|
85864
88091
|
exports.Upload = LMUpload;
|
|
85865
88092
|
exports.UploadOss = UploadOss;
|
|
85866
88093
|
exports.VirtualList = VirList;
|
|
88094
|
+
exports.message = api;
|
|
85867
88095
|
|
|
85868
88096
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
85869
88097
|
|