linkmore-design 1.0.51 → 1.0.55
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/{Notification → Affix}/demos/basic.d.ts +0 -0
- package/dist/Affix/index.d.ts +54 -0
- package/dist/{Notification → Affix}/style/index.d.ts +0 -0
- package/dist/Affix/utils.d.ts +15 -0
- package/dist/Alert/ErrorBoundary.d.ts +22 -0
- package/dist/{Notification/demos/button.d.ts → Alert/demos/basic.d.ts} +0 -0
- package/dist/{Notification/demos/icon.d.ts → Alert/demos/visible.d.ts} +0 -0
- package/dist/Alert/index.d.ts +41 -0
- package/dist/Alert/style/index.d.ts +1 -0
- package/dist/Button/style/index.d.ts +1 -1
- package/dist/CardTable/fns/index.d.ts +3 -3
- package/dist/CardTable/{toolbar → pager}/TablePagination.d.ts +0 -0
- package/dist/CardTable/pager/index.d.ts +3 -0
- package/dist/IconFont/index.d.ts +1 -1
- package/dist/LmEditTable/style/index.d.ts +1 -1
- package/dist/LmFilter/LmFilter.d.ts +3 -0
- package/dist/LmFilter/baseFilter/fuzzySearch.d.ts +4 -0
- package/dist/LmFilter/baseFilter/index.d.ts +3 -0
- package/dist/LmFilter/clearFilter/index.d.ts +3 -0
- package/dist/LmFilter/complexFilter/index.d.ts +2 -0
- package/dist/LmFilter/components/CascaderFilter.d.ts +5 -0
- package/dist/LmFilter/components/CheckboxFilter.d.ts +5 -0
- package/dist/LmFilter/components/DateFilter.d.ts +5 -0
- package/dist/LmFilter/components/DropdownFIlter.d.ts +3 -0
- package/dist/LmFilter/components/EmptyFilter.d.ts +2 -0
- package/dist/LmFilter/components/InputFilter.d.ts +4 -0
- package/dist/LmFilter/components/InputSearchClose.d.ts +3 -0
- package/dist/LmFilter/components/SelectFilter.d.ts +5 -0
- package/dist/LmFilter/components/index.d.ts +3 -0
- package/dist/LmFilter/customFilter/index.d.ts +2 -0
- package/dist/LmFilter/demos/basic.d.ts +2 -0
- package/dist/LmFilter/filterFns/index.d.ts +12 -0
- package/dist/LmFilter/hooks/index.d.ts +1 -0
- package/dist/LmFilter/hooks/useDelayedFn.d.ts +2 -0
- package/dist/LmFilter/index.d.ts +2 -0
- package/dist/LmFilter/style/index.d.ts +1 -0
- package/dist/LmFilter/utils.d.ts +9 -0
- package/dist/LmFilter/wrapper/Filter.d.ts +3 -0
- package/dist/LmFilter/wrapper/FilterContainer.d.ts +3 -0
- package/dist/LmFilter/wrapper/FilterRoot.d.ts +3 -0
- package/dist/LmFilter/wrapper/FilterWrapper.d.ts +3 -0
- package/dist/QuickMenu/demos/basic.d.ts +2 -0
- package/dist/QuickMenu/index.d.ts +14 -0
- package/dist/QuickMenu/style/index.d.ts +1 -0
- package/dist/Tag/demos/ExigencyTag.d.ts +2 -0
- package/dist/Tag/index.d.ts +4 -0
- package/dist/Upload/demos/picture-little.d.ts +3 -0
- package/dist/Upload/index.d.ts +5 -1
- package/dist/_util/domTarget.d.ts +7 -0
- package/dist/_util/getDataOrAriaProps.d.ts +1 -0
- package/dist/_util/reactNode.d.ts +7 -0
- package/dist/_util/throttleByAnimationFrame.d.ts +8 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.umd.js +3453 -317
- 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/dist/notification/demos/basic.d.ts +2 -0
- package/dist/notification/demos/button.d.ts +2 -0
- package/dist/notification/demos/icon.d.ts +2 -0
- package/dist/notification/hooks/useNotification.d.ts +7 -0
- package/dist/notification/index.d.ts +54 -0
- package/dist/notification/style/index.d.ts +1 -0
- package/es/Affix/index.d.ts +54 -0
- package/es/Affix/index.js +326 -0
- package/{lib/Notification → es/Affix}/style/index.css +0 -3
- package/es/{Notification → Affix}/style/index.d.ts +0 -0
- package/es/{Notification → Affix}/style/index.js +0 -0
- package/es/Affix/utils.d.ts +15 -0
- package/es/Affix/utils.js +83 -0
- package/es/Alert/ErrorBoundary.d.ts +22 -0
- package/es/Alert/ErrorBoundary.js +65 -0
- package/es/Alert/index.d.ts +41 -0
- package/es/Alert/index.js +192 -0
- package/es/Alert/style/index.css +531 -0
- package/{lib/Notification → es/Alert}/style/index.d.ts +0 -0
- package/es/Alert/style/index.js +1 -0
- 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/card/PictureTextColumn.js +8 -6
- package/es/CardTable/card/PictureTextRow.js +1 -1
- package/es/CardTable/fns/index.js +38 -8
- package/es/CardTable/{toolbar → pager}/TablePagination.js +0 -0
- package/es/CardTable/pager/index.js +48 -0
- package/{lib/CardTable/style/style.css → es/CardTable/style/index.css} +2 -2
- package/es/CardTable/style/index.js +1 -1
- package/es/CardTable/table/TableRoot.js +20 -18
- package/es/CardTable/table/TableWrapper.js +4 -0
- package/es/CardTable/toolbar/ToolBarBottom.js +8 -27
- 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/Descriptions/style/index.css +10 -8
- 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/IconFont/index.js +3 -2
- 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/LmFilter/LmFilter.js +27 -0
- package/es/LmFilter/baseFilter/fuzzySearch.js +53 -0
- package/es/LmFilter/baseFilter/index.js +34 -0
- package/es/LmFilter/clearFilter/index.js +35 -0
- package/es/LmFilter/complexFilter/index.js +17 -0
- package/es/LmFilter/components/CascaderFilter.js +159 -0
- package/es/LmFilter/components/CheckboxFilter.js +197 -0
- package/es/LmFilter/components/DateFilter.js +139 -0
- package/es/LmFilter/components/DropdownFIlter.js +230 -0
- package/es/LmFilter/components/EmptyFilter.js +27 -0
- package/es/LmFilter/components/InputFilter.js +52 -0
- package/es/LmFilter/components/InputSearchClose.js +74 -0
- package/es/LmFilter/components/SelectFilter.js +113 -0
- package/es/LmFilter/components/index.js +140 -0
- package/es/LmFilter/customFilter/index.js +17 -0
- package/es/LmFilter/filterFns/index.js +54 -0
- package/es/LmFilter/hooks/index.js +18 -0
- package/es/LmFilter/hooks/useDelayedFn.js +29 -0
- package/es/LmFilter/icon_placeholder.png +0 -0
- package/es/LmFilter/index.js +16 -0
- package/es/LmFilter/style/index.js +3 -0
- package/es/LmFilter/style/style.css +205 -0
- package/es/LmFilter/utils.js +71 -0
- package/es/LmFilter/wrapper/Filter.js +33 -0
- package/es/LmFilter/wrapper/FilterContainer.js +29 -0
- package/es/LmFilter/wrapper/FilterRoot.js +120 -0
- package/es/LmFilter/wrapper/FilterWrapper.js +25 -0
- 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/QuickMenu/index.d.ts +14 -0
- package/es/QuickMenu/index.js +169 -0
- package/es/QuickMenu/style/index.css +560 -0
- package/es/QuickMenu/style/index.d.ts +1 -0
- package/es/QuickMenu/style/index.js +1 -0
- 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/Tag/index.d.ts +4 -0
- package/es/Tag/index.js +48 -2
- package/es/Tag/style/index.css +4 -1
- package/es/Upload/index.d.ts +5 -1
- package/es/Upload/index.js +7 -2
- package/es/Upload/style/index.css +35 -0
- 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/_util/domTarget.d.ts +7 -0
- package/es/_util/domTarget.js +20 -0
- package/es/_util/getDataOrAriaProps.d.ts +1 -0
- package/es/_util/getDataOrAriaProps.js +9 -0
- package/es/_util/reactNode.d.ts +7 -0
- package/es/_util/reactNode.js +10 -0
- package/es/_util/throttleByAnimationFrame.d.ts +8 -0
- package/es/_util/throttleByAnimationFrame.js +58 -0
- package/es/index.d.ts +2 -1
- package/es/index.js +3 -2
- 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 +28 -1
- package/es/notification/hooks/useNotification.d.ts +7 -0
- package/es/notification/hooks/useNotification.js +54 -0
- package/es/notification/index.d.ts +54 -0
- package/es/notification/index.js +342 -0
- package/es/notification/style/index.css +546 -0
- package/es/notification/style/index.d.ts +1 -0
- package/es/notification/style/index.js +1 -0
- package/lib/Affix/index.d.ts +54 -0
- package/lib/Affix/index.js +349 -0
- package/{es/Notification → lib/Affix}/style/index.css +0 -3
- package/lib/Affix/style/index.d.ts +1 -0
- package/lib/{Notification → Affix}/style/index.js +0 -0
- package/lib/Affix/utils.d.ts +15 -0
- package/lib/Affix/utils.js +104 -0
- package/lib/Alert/ErrorBoundary.d.ts +22 -0
- package/lib/Alert/ErrorBoundary.js +79 -0
- package/lib/Alert/index.d.ts +41 -0
- package/lib/Alert/index.js +215 -0
- package/lib/Alert/style/index.css +531 -0
- package/lib/Alert/style/index.d.ts +1 -0
- package/lib/Alert/style/index.js +3 -0
- 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/card/PictureTextColumn.js +8 -6
- package/lib/CardTable/card/PictureTextRow.js +1 -1
- package/lib/CardTable/fns/index.js +38 -8
- package/lib/CardTable/{toolbar → pager}/TablePagination.js +0 -0
- package/lib/CardTable/pager/index.js +48 -0
- package/{es/CardTable/style/style.css → lib/CardTable/style/index.css} +2 -2
- package/lib/CardTable/style/index.js +1 -1
- package/lib/CardTable/table/TableRoot.js +20 -18
- package/lib/CardTable/table/TableWrapper.js +4 -0
- package/lib/CardTable/toolbar/ToolBarBottom.js +8 -27
- 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/Descriptions/style/index.css +10 -8
- 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/IconFont/index.js +3 -2
- 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/LmFilter/LmFilter.js +27 -0
- package/lib/LmFilter/baseFilter/fuzzySearch.js +53 -0
- package/lib/LmFilter/baseFilter/index.js +34 -0
- package/lib/LmFilter/clearFilter/index.js +35 -0
- package/lib/LmFilter/complexFilter/index.js +17 -0
- package/lib/LmFilter/components/CascaderFilter.js +159 -0
- package/lib/LmFilter/components/CheckboxFilter.js +197 -0
- package/lib/LmFilter/components/DateFilter.js +139 -0
- package/lib/LmFilter/components/DropdownFIlter.js +230 -0
- package/lib/LmFilter/components/EmptyFilter.js +27 -0
- package/lib/LmFilter/components/InputFilter.js +52 -0
- package/lib/LmFilter/components/InputSearchClose.js +74 -0
- package/lib/LmFilter/components/SelectFilter.js +113 -0
- package/lib/LmFilter/components/index.js +140 -0
- package/lib/LmFilter/customFilter/index.js +17 -0
- package/lib/LmFilter/filterFns/index.js +54 -0
- package/lib/LmFilter/hooks/index.js +18 -0
- package/lib/LmFilter/hooks/useDelayedFn.js +29 -0
- package/lib/LmFilter/icon_placeholder.png +0 -0
- package/lib/LmFilter/index.js +16 -0
- package/lib/LmFilter/style/index.js +3 -0
- package/lib/LmFilter/style/style.css +205 -0
- package/lib/LmFilter/utils.js +71 -0
- package/lib/LmFilter/wrapper/Filter.js +33 -0
- package/lib/LmFilter/wrapper/FilterContainer.js +29 -0
- package/lib/LmFilter/wrapper/FilterRoot.js +120 -0
- package/lib/LmFilter/wrapper/FilterWrapper.js +25 -0
- 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/QuickMenu/index.d.ts +14 -0
- package/lib/QuickMenu/index.js +187 -0
- package/lib/QuickMenu/style/index.css +560 -0
- package/lib/QuickMenu/style/index.d.ts +1 -0
- package/lib/QuickMenu/style/index.js +3 -0
- 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/Tag/index.d.ts +4 -0
- package/lib/Tag/index.js +48 -1
- package/lib/Tag/style/index.css +4 -1
- package/lib/Upload/index.d.ts +5 -1
- package/lib/Upload/index.js +8 -2
- package/lib/Upload/style/index.css +35 -0
- 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/_util/domTarget.d.ts +7 -0
- package/lib/_util/domTarget.js +31 -0
- package/lib/_util/getDataOrAriaProps.d.ts +1 -0
- package/lib/_util/getDataOrAriaProps.js +16 -0
- package/lib/_util/reactNode.d.ts +7 -0
- package/lib/_util/reactNode.js +24 -0
- package/lib/_util/throttleByAnimationFrame.d.ts +8 -0
- package/lib/_util/throttleByAnimationFrame.js +72 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +11 -3
- 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 +28 -1
- package/lib/notification/hooks/useNotification.d.ts +7 -0
- package/lib/notification/hooks/useNotification.js +69 -0
- package/lib/notification/index.d.ts +54 -0
- package/lib/notification/index.js +365 -0
- package/lib/notification/style/index.css +546 -0
- package/lib/notification/style/index.d.ts +1 -0
- package/lib/notification/style/index.js +3 -0
- package/package.json +5 -2
- package/dist/Notification/index.d.ts +0 -7
- package/es/Notification/index.d.ts +0 -7
- package/es/Notification/index.js +0 -10
- package/lib/Notification/index.d.ts +0 -7
- package/lib/Notification/index.js +0 -23
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.default = void 0;
|
|
11
|
+
|
|
12
|
+
require("antd/es/alert/style");
|
|
13
|
+
|
|
14
|
+
var _alert = _interopRequireDefault(require("antd/es/alert"));
|
|
15
|
+
|
|
16
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
17
|
+
|
|
18
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
19
|
+
|
|
20
|
+
var _icons = require("@ant-design/icons");
|
|
21
|
+
|
|
22
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
23
|
+
|
|
24
|
+
var _rcMotion = _interopRequireDefault(require("rc-motion"));
|
|
25
|
+
|
|
26
|
+
var React = _interopRequireWildcard(require("react"));
|
|
27
|
+
|
|
28
|
+
var _configProvider = require("antd/es/config-provider");
|
|
29
|
+
|
|
30
|
+
var _getDataOrAriaProps = _interopRequireDefault(require("../_util/getDataOrAriaProps"));
|
|
31
|
+
|
|
32
|
+
var _reactNode = require("../_util/reactNode");
|
|
33
|
+
|
|
34
|
+
var _ErrorBoundary = _interopRequireDefault(require("./ErrorBoundary"));
|
|
35
|
+
|
|
36
|
+
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
37
|
+
var t = {};
|
|
38
|
+
|
|
39
|
+
for (var p in s) {
|
|
40
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
44
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
45
|
+
}
|
|
46
|
+
return t;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
var iconMapFilled = {
|
|
50
|
+
success: _icons.CheckCircleFilled,
|
|
51
|
+
info: _icons.InfoCircleFilled,
|
|
52
|
+
error: _icons.CloseCircleFilled,
|
|
53
|
+
warning: _icons.ExclamationCircleFilled
|
|
54
|
+
};
|
|
55
|
+
var iconMapOutlined = {
|
|
56
|
+
success: _icons.CheckCircleOutlined,
|
|
57
|
+
info: _icons.InfoCircleOutlined,
|
|
58
|
+
error: _icons.CloseCircleOutlined,
|
|
59
|
+
warning: _icons.ExclamationCircleOutlined
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
var IconNode = function IconNode(props) {
|
|
63
|
+
var description = props.description,
|
|
64
|
+
icon = props.icon,
|
|
65
|
+
prefixCls = props.prefixCls,
|
|
66
|
+
type = props.type;
|
|
67
|
+
var iconType = (description ? iconMapOutlined : iconMapFilled)[type] || null;
|
|
68
|
+
|
|
69
|
+
if (icon) {
|
|
70
|
+
return (0, _reactNode.replaceElement)(icon, /*#__PURE__*/React.createElement("span", {
|
|
71
|
+
className: "".concat(prefixCls, "-icon")
|
|
72
|
+
}, icon), function () {
|
|
73
|
+
return {
|
|
74
|
+
className: (0, _classnames.default)("".concat(prefixCls, "-icon"), (0, _defineProperty2.default)({}, icon.props.className, icon.props.className))
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return /*#__PURE__*/React.createElement(iconType, {
|
|
80
|
+
className: "".concat(prefixCls, "-icon")
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
var CloseIcon = function CloseIcon(props) {
|
|
85
|
+
var isClosable = props.isClosable,
|
|
86
|
+
closeText = props.closeText,
|
|
87
|
+
prefixCls = props.prefixCls,
|
|
88
|
+
closeIcon = props.closeIcon,
|
|
89
|
+
handleClose = props.handleClose;
|
|
90
|
+
return isClosable ? /*#__PURE__*/React.createElement("button", {
|
|
91
|
+
type: "button",
|
|
92
|
+
onClick: handleClose,
|
|
93
|
+
className: "".concat(prefixCls, "-close-icon"),
|
|
94
|
+
tabIndex: 0
|
|
95
|
+
}, closeText ? /*#__PURE__*/React.createElement("span", {
|
|
96
|
+
className: "".concat(prefixCls, "-close-text")
|
|
97
|
+
}, closeText) : closeIcon) : null;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
var Alert = function Alert(_a) {
|
|
101
|
+
var _classNames2;
|
|
102
|
+
|
|
103
|
+
var description = _a.description,
|
|
104
|
+
customizePrefixCls = _a.prefixCls,
|
|
105
|
+
message = _a.message,
|
|
106
|
+
banner = _a.banner,
|
|
107
|
+
_a$className = _a.className,
|
|
108
|
+
className = _a$className === void 0 ? '' : _a$className,
|
|
109
|
+
style = _a.style,
|
|
110
|
+
onMouseEnter = _a.onMouseEnter,
|
|
111
|
+
onMouseLeave = _a.onMouseLeave,
|
|
112
|
+
onClick = _a.onClick,
|
|
113
|
+
afterClose = _a.afterClose,
|
|
114
|
+
showIcon = _a.showIcon,
|
|
115
|
+
closable = _a.closable,
|
|
116
|
+
closeText = _a.closeText,
|
|
117
|
+
_a$closeIcon = _a.closeIcon,
|
|
118
|
+
closeIcon = _a$closeIcon === void 0 ? /*#__PURE__*/React.createElement(_icons.CloseOutlined, null) : _a$closeIcon,
|
|
119
|
+
action = _a.action,
|
|
120
|
+
duration = _a.duration,
|
|
121
|
+
props = __rest(_a, ["description", "prefixCls", "message", "banner", "className", "style", "onMouseEnter", "onMouseLeave", "onClick", "afterClose", "showIcon", "closable", "closeText", "closeIcon", "action", "duration"]);
|
|
122
|
+
|
|
123
|
+
var _React$useState = React.useState(false),
|
|
124
|
+
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
125
|
+
closed = _React$useState2[0],
|
|
126
|
+
setClosed = _React$useState2[1];
|
|
127
|
+
|
|
128
|
+
var ref = React.useRef();
|
|
129
|
+
|
|
130
|
+
var _React$useContext = React.useContext(_configProvider.ConfigContext),
|
|
131
|
+
getPrefixCls = _React$useContext.getPrefixCls,
|
|
132
|
+
direction = _React$useContext.direction;
|
|
133
|
+
|
|
134
|
+
var prefixCls = getPrefixCls('alert', customizePrefixCls);
|
|
135
|
+
|
|
136
|
+
var handleClose = function handleClose(e) {
|
|
137
|
+
var _a;
|
|
138
|
+
|
|
139
|
+
setClosed(true);
|
|
140
|
+
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
var getType = function getType() {
|
|
144
|
+
var type = props.type;
|
|
145
|
+
|
|
146
|
+
if (type !== undefined) {
|
|
147
|
+
return type;
|
|
148
|
+
} // banner 模式默认为警告
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
return banner ? 'warning' : 'info';
|
|
152
|
+
}; // closeable when closeText is assigned
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
var isClosable = closeText ? true : closable;
|
|
156
|
+
var type = getType(); // banner 模式默认有 Icon
|
|
157
|
+
|
|
158
|
+
var isShowIcon = banner && showIcon === undefined ? true : showIcon;
|
|
159
|
+
var alertCls = (0, _classnames.default)(prefixCls, "".concat(prefixCls, "-").concat(type), (_classNames2 = {}, (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-with-description"), !!description), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-no-icon"), !isShowIcon), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-banner"), !!banner), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-rtl"), direction === 'rtl'), _classNames2), className, 'lm_alert');
|
|
160
|
+
var dataOrAriaProps = (0, _getDataOrAriaProps.default)(props);
|
|
161
|
+
return /*#__PURE__*/React.createElement(_rcMotion.default, {
|
|
162
|
+
visible: !closed,
|
|
163
|
+
motionName: "".concat(prefixCls, "-motion"),
|
|
164
|
+
motionAppear: false,
|
|
165
|
+
motionEnter: false,
|
|
166
|
+
onLeaveStart: function onLeaveStart(node) {
|
|
167
|
+
return {
|
|
168
|
+
maxHeight: node.offsetHeight
|
|
169
|
+
};
|
|
170
|
+
},
|
|
171
|
+
onLeaveEnd: afterClose
|
|
172
|
+
}, function (_ref) {
|
|
173
|
+
var motionClassName = _ref.className,
|
|
174
|
+
motionStyle = _ref.style;
|
|
175
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
176
|
+
ref: ref,
|
|
177
|
+
"data-show": !closed,
|
|
178
|
+
className: (0, _classnames.default)(alertCls, motionClassName),
|
|
179
|
+
style: Object.assign(Object.assign({}, style), motionStyle),
|
|
180
|
+
onMouseEnter: onMouseEnter,
|
|
181
|
+
onMouseLeave: onMouseLeave,
|
|
182
|
+
onClick: onClick,
|
|
183
|
+
role: "alert"
|
|
184
|
+
}, dataOrAriaProps), isShowIcon ? /*#__PURE__*/React.createElement(IconNode, {
|
|
185
|
+
description: description,
|
|
186
|
+
icon: props.icon,
|
|
187
|
+
prefixCls: prefixCls,
|
|
188
|
+
type: type
|
|
189
|
+
}) : null, /*#__PURE__*/React.createElement("div", {
|
|
190
|
+
className: "".concat(prefixCls, "-content")
|
|
191
|
+
}, message ? /*#__PURE__*/React.createElement("div", {
|
|
192
|
+
className: "".concat(prefixCls, "-message")
|
|
193
|
+
}, message) : null, description ? /*#__PURE__*/React.createElement("div", {
|
|
194
|
+
className: "".concat(prefixCls, "-description")
|
|
195
|
+
}, description) : null), action ? /*#__PURE__*/React.createElement("div", {
|
|
196
|
+
className: "".concat(prefixCls, "-action")
|
|
197
|
+
}, action) : null, /*#__PURE__*/React.createElement(CloseIcon, {
|
|
198
|
+
isClosable: !!isClosable,
|
|
199
|
+
closeText: closeText,
|
|
200
|
+
prefixCls: prefixCls,
|
|
201
|
+
closeIcon: closeIcon,
|
|
202
|
+
handleClose: handleClose
|
|
203
|
+
}), duration > 0 && /*#__PURE__*/React.createElement("div", {
|
|
204
|
+
className: 'alert_progress',
|
|
205
|
+
style: {
|
|
206
|
+
animationDuration: "".concat(duration, "s")
|
|
207
|
+
}
|
|
208
|
+
}));
|
|
209
|
+
});
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
Alert.ErrorBoundary = _ErrorBoundary.default;
|
|
213
|
+
Alert.AntdAlert = _alert.default;
|
|
214
|
+
var _default = Alert;
|
|
215
|
+
exports.default = _default;
|