@chaoswise/ui 2.6.0 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/AbreastLayout/CollapsedIcon.js +1 -1
- package/lib/AbreastLayout/index.js +9 -9
- package/lib/Ace/ace.js +12 -13
- package/lib/Ace/diff.js +13 -14
- package/lib/Ace/split.js +12 -13
- package/lib/AdaptiveLayout/index.js +11 -11
- package/lib/Alert/index.js +3 -3
- package/lib/AlgorithmChart/index.js +3 -3
- package/lib/Antd/Drawer.js +9 -9
- package/lib/Antd4Form/FieldList.js +4 -4
- package/lib/Antd4Form/Form.js +7 -7
- package/lib/Antd4Form/FormItem.js +5 -5
- package/lib/Antd4Form/FormItemChildren.js +13 -14
- package/lib/Antd4Form/useForm.js +6 -6
- package/lib/Badge/index.js +1 -1
- package/lib/BasicLayout/Breadcrumb.js +5 -5
- package/lib/BasicLayout/Footer.js +3 -3
- package/lib/BasicLayout/Sider.js +5 -5
- package/lib/BasicLayout/index.js +7 -7
- package/lib/Button/index.js +3 -3
- package/lib/CWCascader/Cascader/index.js +10 -10
- package/lib/CWCascader/index.js +1 -1
- package/lib/CWCascader/rc-cascader/Cascader.js +10 -10
- package/lib/CWCascader/rc-cascader/OptionList/Checkbox.js +2 -2
- package/lib/CWCascader/rc-cascader/OptionList/Column.js +12 -12
- package/lib/CWCascader/rc-cascader/OptionList/index.js +10 -10
- package/lib/CWCascader/rc-cascader/OptionList/useActive.js +4 -4
- package/lib/CWCascader/rc-cascader/OptionList/useKeyboard.js +7 -7
- package/lib/CWCascader/rc-cascader/hooks/useDisplayValues.js +5 -5
- package/lib/CWCascader/rc-cascader/hooks/useEntities.js +2 -2
- package/lib/CWCascader/rc-cascader/hooks/useSearchConfig.js +2 -2
- package/lib/CWCascader/rc-cascader/hooks/useSearchOptions.js +7 -7
- package/lib/CWMessage/MessageContent/TabList/index.js +5 -5
- package/lib/CWMessage/MessageContent/index.js +10 -10
- package/lib/CWMessage/index.js +21 -18
- package/lib/CWRadioTabs/index.js +7 -7
- package/lib/CWRangePicker/DropdownMenu/index.js +11 -11
- package/lib/CWRangePicker/Refresh/index.js +8 -8
- package/lib/CWRangePicker/assets/Calendar.js +1 -1
- package/lib/CWRangePicker/assets/Calendar2.js +1 -1
- package/lib/CWRangePicker/assets/Recover.js +1 -1
- package/lib/CWRangePicker/assets/Refresh1.js +1 -1
- package/lib/CWRangePicker/assets/Refresh2.js +1 -1
- package/lib/CWRangePicker/assets/Refresh3.js +1 -1
- package/lib/CWRangePicker/assets/live.js +1 -1
- package/lib/CWRangePicker/assets/more.js +1 -1
- package/lib/CWRangePicker/index.js +12 -12
- package/lib/CWRangePicker/utils/index.js +6 -6
- package/lib/CWSelect/DragTag/index.js +4 -4
- package/lib/CWSelect/antd-select.js +17 -18
- package/lib/CWSelect/index.js +12 -12
- package/lib/CWTable/CWTable.js +16 -16
- package/lib/CWTable/EditLine.js +12 -12
- package/lib/CWTable/Filter.js +4 -4
- package/lib/CWTable/FormTable.js +2 -2
- package/lib/CWTable/header.js +7 -7
- package/lib/CWTable/icon/DownGraySvg.js +1 -1
- package/lib/CWTable/icon/DownLightSvg.js +1 -1
- package/lib/CWTable/icon/SortSvg.js +1 -1
- package/lib/CWTable/icon/SortingSvg.js +1 -1
- package/lib/CWTable/icon/UpGraySvg.js +1 -1
- package/lib/CWTable/icon/UpLightSvg.js +1 -1
- package/lib/CWTable/index.js +1 -1
- package/lib/CWTree/assets/Drag.js +1 -1
- package/lib/CWTree/index.js +9 -9
- package/lib/CWTree/utils/index.js +2 -2
- package/lib/CWUpload/index.js +1 -1
- package/lib/CWUpload/upload/DragList.js +6 -6
- package/lib/CWUpload/upload/Upload.js +19 -20
- package/lib/CWUpload/upload/UploadList.js +12 -13
- package/lib/CardSelect/index.js +7 -7
- package/lib/Cascader/index.js +1 -1
- package/lib/ChangeIcon/index.js +4 -4
- package/lib/Checkbox/Checkbox.js +20 -21
- package/lib/Checkbox/Group.js +27 -28
- package/lib/Checkbox/assets/duigou1.js +1 -1
- package/lib/Checkbox/assets/duigou2.js +1 -1
- package/lib/CitySelect/index.js +1 -1
- package/lib/Collapse/index.js +3 -3
- package/lib/ColorPicker/SketchPicker/components/common/Alpha.js +16 -17
- package/lib/ColorPicker/SketchPicker/components/common/Checkboard.js +2 -2
- package/lib/ColorPicker/SketchPicker/components/common/ColorWrap.js +15 -16
- package/lib/ColorPicker/SketchPicker/components/common/EditableInput.js +19 -20
- package/lib/ColorPicker/SketchPicker/components/common/Hue.js +15 -16
- package/lib/ColorPicker/SketchPicker/components/common/Saturation.js +15 -16
- package/lib/ColorPicker/SketchPicker/components/common/Swatch.js +3 -3
- package/lib/ColorPicker/SketchPicker/components/sketch/SketchPresetColors.js +1 -1
- package/lib/ColorPicker/SketchPicker/components/sketch/index.js +2 -2
- package/lib/ColorPicker/SketchPicker/helpers/interaction.js +16 -17
- package/lib/ColorPicker/index.js +7 -7
- package/lib/ConfigProvider/ConfigProvider.js +9 -9
- package/lib/CustomNotification/PurePanel.js +126 -0
- package/lib/CustomNotification/index.js +210 -0
- package/lib/CustomNotification/index.less +102 -0
- package/lib/CustomNotification/useNotification.js +195 -0
- package/lib/CustomNotification/util.js +58 -0
- package/lib/CustomScrollBar/index.js +5 -5
- package/lib/DatePicker/DatePicker.js +1 -1
- package/lib/DatePicker/MonthPicker.js +1 -1
- package/lib/DatePicker/QuarterPicker.js +1 -1
- package/lib/DatePicker/RangePicker.js +1 -1
- package/lib/DatePicker/TimePicker.js +1 -1
- package/lib/DatePicker/WeekPicker.js +1 -1
- package/lib/DatePicker/YearPicker.js +1 -1
- package/lib/DateRangePicker/RangeDatePicker.js +7 -7
- package/lib/DateRangePicker/RangeDateTimePicker.js +10 -10
- package/lib/DateRangePicker/components/ExtraTimeFooter.js +3 -3
- package/lib/DateRangePicker/index.js +3 -3
- package/lib/Documentation/Tocify.js +5 -6
- package/lib/Documentation/index.js +6 -6
- package/lib/Drawer/index.js +9 -9
- package/lib/DropdownDatePicker/DropdownMenu/index.js +4 -4
- package/lib/DropdownDatePicker/assets/Calendar2.js +1 -1
- package/lib/DropdownDatePicker/assets/Recover.js +1 -1
- package/lib/DropdownDatePicker/assets/live.js +1 -1
- package/lib/DropdownDatePicker/assets/more.js +1 -1
- package/lib/DropdownDatePicker/index.js +9 -9
- package/lib/DropdownDatePicker/utils/index.js +6 -6
- package/lib/EchartsArea/index.js +5 -5
- package/lib/EchartsBar/index.js +5 -5
- package/lib/EchartsBarRow/index.js +3 -3
- package/lib/EchartsBase/index.js +5 -5
- package/lib/EchartsLine/index.js +5 -5
- package/lib/EchartsPie/index.js +3 -3
- package/lib/EchartsRing/index.js +3 -3
- package/lib/EditableText/index.js +6 -6
- package/lib/Empty/index.js +3 -3
- package/lib/ErrorBoundary/history.js +6 -8
- package/lib/ErrorBoundary/index.js +15 -16
- package/lib/FilterDropDown/DragList.js +7 -7
- package/lib/FilterDropDown/assets/ShowSvgIcon.js +1 -1
- package/lib/FilterDropDown/index.js +7 -7
- package/lib/Flow/BasicLayout/Chain.js +5 -5
- package/lib/Flow/Flow.js +4 -4
- package/lib/Flow/components/PluginWrapper.js +2 -2
- package/lib/Flow/layouts/callChain.js +2 -2
- package/lib/Flow/plugins/CommandLifeCycle.js +5 -6
- package/lib/Flow/plugins/InitSideBarPlugin.js +5 -6
- package/lib/Flow/plugins/InitToolBarPlugin.js +5 -6
- package/lib/Footer/index.js +2 -2
- package/lib/Form/FormItem.js +5 -5
- package/lib/Form4/index.js +1 -1
- package/lib/FormItemWrapper/index.js +5 -5
- package/lib/Formily/FieldList/index.js +4 -4
- package/lib/Formily/FormItem/index.js +5 -5
- package/lib/Formily/FormItem/items/formItemWrapper.js +2 -2
- package/lib/Formily/MegaLayout/index.js +3 -3
- package/lib/Formily/formily/index.js +4 -4
- package/lib/Formily/subscribeFields/index.js +8 -8
- package/lib/GlobalTabs/TabPane.js +2 -2
- package/lib/GlobalTabs/index.js +5 -5
- package/lib/Header/CommonDropMenu.js +7 -7
- package/lib/Header/CommonIcon.js +2 -2
- package/lib/Header/LocaleSwitcher.js +3 -3
- package/lib/Header/Message/index.js +2 -2
- package/lib/Header/UserSetting/TenantList.js +1 -1
- package/lib/Header/UserSetting/TenantTree.js +1 -1
- package/lib/Header/UserSetting/index.js +4 -4
- package/lib/Header/UserSetting/utils.js +2 -2
- package/lib/Header/index.js +4 -4
- package/lib/IconSelect/components/SearchIcon/index.js +4 -4
- package/lib/IconSelect/index.js +4 -4
- package/lib/ImagePreview/index.js +3 -3
- package/lib/Input/InputComponent.js +9 -9
- package/lib/Input/index.js +2 -2
- package/lib/InputNumber/index.js +3 -3
- package/lib/IntersectionInput/index.js +9 -9
- package/lib/Joyride/index.js +9 -9
- package/lib/LayoutBreadcrumb/index.js +5 -5
- package/lib/LayoutWrapper/Footer.js +3 -3
- package/lib/LayoutWrapper/Header.js +3 -3
- package/lib/LayoutWrapper/LeftArrow.js +1 -1
- package/lib/LayoutWrapper/index.js +5 -5
- package/lib/LazyLoadingTreeSelect/index.js +12 -12
- package/lib/Menu/index.js +1 -1
- package/lib/Menu/menu/MenuItem.js +11 -12
- package/lib/Menu/menu/SubMenu.js +11 -12
- package/lib/Menu/menu/index.js +14 -16
- package/lib/Modal/Modal.js +19 -20
- package/lib/Modal/assets/Close.js +1 -1
- package/lib/Modal/custom-backup/entiretyDrag.js +3 -3
- package/lib/Modal/index.js +5 -5
- package/lib/ModuleFederation/ErrorBoundary/index.js +11 -12
- package/lib/ModuleFederation/react-dynamic-remote-component/RemoteComponent.js +12 -12
- package/lib/ModuleFederation/react-dynamic-remote-component/load-module.js +3 -3
- package/lib/ModuleTitle/index.js +3 -3
- package/lib/OutlineNumber/index.js +3 -3
- package/lib/Pagination/index.js +9 -9
- package/lib/PolymerizationSearch/index.js +8 -8
- package/lib/Popconfirm/index.js +3 -3
- package/lib/Progress/index.js +3 -3
- package/lib/QuickRangePicker/index.js +9 -9
- package/lib/QuickTransfer/Drag.js +5 -5
- package/lib/QuickTransfer/DragList.js +7 -7
- package/lib/QuickTransfer/assets/DragSvg.js +1 -1
- package/lib/QuickTransfer/assets/LockSvg.js +1 -1
- package/lib/QuickTransfer/index.js +12 -12
- package/lib/QuickTransfer/utils.js +7 -7
- package/lib/Radio/Group.js +16 -17
- package/lib/Radio/Radio.js +21 -22
- package/lib/RangePicker/components/ExtraTimeFooter.js +3 -3
- package/lib/RangePicker/index.js +10 -10
- package/lib/RangePicker/utils/index.js +5 -5
- package/lib/ReactSelect/CustomControl.js +2 -2
- package/lib/ReactSelect/CustomMultiValueLabel.js +2 -2
- package/lib/ReactSelect/CustomOption.js +2 -2
- package/lib/ReactSelect/CustomSingleValue.js +2 -2
- package/lib/ReactSelect/customStyles.js +2 -2
- package/lib/ReactSelect/index.js +9 -9
- package/lib/ScrollLoad/index.js +7 -7
- package/lib/SearchBar/index.js +12 -12
- package/lib/SelectBackup/index.js +9 -9
- package/lib/SiderMenu/Item.js +14 -15
- package/lib/SiderMenu/index.js +5 -5
- package/lib/SiderMenu/sub-menu.js +3 -3
- package/lib/SimpleCard/index.js +3 -3
- package/lib/SimplePagination/index.js +6 -6
- package/lib/SingleSpa/hooks/useErrorHandle.js +6 -6
- package/lib/SingleSpa/hooks/useModel.js +4 -4
- package/lib/SingleSpa/import-html/process-tpl.js +4 -4
- package/lib/SingleSpa/import-html/utils.js +4 -4
- package/lib/SingleSpa/index.js +8 -8
- package/lib/SingleSpa/singleSpa/single-spa.dev.js +2 -2
- package/lib/Table/index.js +1 -1
- package/lib/Tabs/index.js +5 -5
- package/lib/Tag/CheckableTag.js +3 -3
- package/lib/Tag/assets/LeftBottomCorner.js +1 -1
- package/lib/Tag/assets/LeftTopCorner.js +1 -1
- package/lib/Tag/assets/RightBottomCorner.js +1 -1
- package/lib/Tag/assets/RightTopCorner.js +1 -1
- package/lib/Tag/index.js +3 -3
- package/lib/ThemeProvider/main.js +9 -9
- package/lib/ThemeProvider/utils.js +4 -4
- package/lib/TimeRangeSlider/Refresh/index.js +8 -8
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/assets/Limit.js +1 -1
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/assets/LimitAreaSvg.js +1 -1
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/components/BottomSlider/BottomPlaceholder.js +4 -4
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/components/TopSlider/TopPlaceholder.js +4 -4
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/hooks/useHover.js +4 -4
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/hooks/useMouse.js +6 -6
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/utils/index.js +2 -2
- package/lib/TimeRangeSlider/assets/Calendar.js +1 -1
- package/lib/TimeRangeSlider/assets/Calendar2.js +1 -1
- package/lib/TimeRangeSlider/assets/Recover.js +1 -1
- package/lib/TimeRangeSlider/assets/Refresh1.js +1 -1
- package/lib/TimeRangeSlider/assets/Refresh2.js +1 -1
- package/lib/TimeRangeSlider/assets/Refresh3.js +1 -1
- package/lib/TimeRangeSlider/assets/live.js +1 -1
- package/lib/TimeRangeSlider/assets/more.js +1 -1
- package/lib/TimeRangeSlider/index.js +9 -9
- package/lib/TimeRangeSlider/utils/index.js +6 -6
- package/lib/Tooltip/index.js +3 -3
- package/lib/TooltipText/ResizeObserverManager.js +3 -3
- package/lib/TooltipText/index.js +7 -7
- package/lib/TreeList/index.js +6 -6
- package/lib/TreeSelect111/index.js +9 -9
- package/lib/TreeSelect111/utils/index.js +5 -5
- package/lib/Upload-back/index.js +7 -7
- package/lib/VerticalLayout/index.js +2 -2
- package/lib/WangEditor/editor4.js +2 -2
- package/lib/WangEditor/index.js +2 -2
- package/lib/WangEditor/usePreview.js +4 -4
- package/lib/Watermark/index.js +7 -7
- package/lib/Watermark/useClips.js +4 -4
- package/lib/Watermark/useWatermark.js +4 -4
- package/lib/configConsumer/index.js +1 -1
- package/lib/configHoc/index.js +3 -3
- package/lib/message/assets/Close.js +1 -1
- package/lib/message/index.js +2 -2
- package/lib/noticeManager/globalState.js +6 -7
- package/lib/portalNoticeManager/usePortalDispatchNotice.js +6 -6
- package/lib/portalNoticeManager/withPortalDispatchNotice.js +1 -1
- package/lib/useLocale/index.js +4 -4
- package/lib/usePreview/index.js +4 -4
- package/package.json +2 -1
package/lib/ColorPicker/index.js
CHANGED
|
@@ -9,18 +9,18 @@ import _Input from "@chaoswise/ui/lib/Input";
|
|
|
9
9
|
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
10
10
|
import "@chaoswise/ui/lib/Tabs/index.less";
|
|
11
11
|
import _Tabs from "@chaoswise/ui/lib/Tabs";
|
|
12
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
12
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
13
13
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
14
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
|
-
function _defineProperty(
|
|
16
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i :
|
|
15
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
17
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
18
|
-
function _slicedToArray(
|
|
18
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
19
19
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
20
|
-
function _unsupportedIterableToArray(
|
|
21
|
-
function _arrayLikeToArray(
|
|
20
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
21
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
22
22
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
23
|
-
function _arrayWithHoles(
|
|
23
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
24
24
|
import React, { useEffect, useState } from "react";
|
|
25
25
|
import SketchPicker from "./SketchPicker/components/sketch";
|
|
26
26
|
import classnames from "classnames";
|
|
@@ -2,20 +2,20 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2
2
|
import "antd/es/config-provider/style";
|
|
3
3
|
import _ConfigProvider from "antd/es/config-provider";
|
|
4
4
|
var _excluded = ["children", "locales", "defaultLocale", "messages"];
|
|
5
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
5
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
6
6
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
7
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
|
-
function _defineProperty(
|
|
9
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i :
|
|
8
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
9
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
10
10
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
11
|
-
function _slicedToArray(
|
|
11
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
12
12
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
13
|
-
function _unsupportedIterableToArray(
|
|
14
|
-
function _arrayLikeToArray(
|
|
13
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
14
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
15
15
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
16
|
-
function _arrayWithHoles(
|
|
17
|
-
function _objectWithoutProperties(
|
|
18
|
-
function _objectWithoutPropertiesLoose(
|
|
16
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
17
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
18
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
19
19
|
import React, { useEffect, useState } from 'react';
|
|
20
20
|
import Antd4ConfigProvider from '../Antd4/config-provider';
|
|
21
21
|
import { IntlProvider } from 'react-intl';
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
import _Icon from "@chaoswise/ui/lib/Icon";
|
|
3
|
+
var _excluded = ["prefixCls", "className", "icon", "type", "message", "description", "btn", "closable", "closeIcon", "className"];
|
|
4
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
5
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
6
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
7
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
8
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
9
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
|
+
import React from "react";
|
|
11
|
+
import classNames from "classnames";
|
|
12
|
+
import { Notice } from "rc-notification-v5";
|
|
13
|
+
import { ConfigContext } from "antd/es/config-provider/context";
|
|
14
|
+
export var TypeIcon = {
|
|
15
|
+
info: /*#__PURE__*/React.createElement(_Icon, {
|
|
16
|
+
type: "info-circle"
|
|
17
|
+
}),
|
|
18
|
+
success: /*#__PURE__*/React.createElement(_Icon, {
|
|
19
|
+
type: "check-circle"
|
|
20
|
+
}),
|
|
21
|
+
error: /*#__PURE__*/React.createElement(_Icon, {
|
|
22
|
+
type: "close-circle"
|
|
23
|
+
}),
|
|
24
|
+
warning: /*#__PURE__*/React.createElement(_Icon, {
|
|
25
|
+
type: "exclamation-circle"
|
|
26
|
+
}),
|
|
27
|
+
loading: /*#__PURE__*/React.createElement(_Icon, {
|
|
28
|
+
type: "loading",
|
|
29
|
+
theme: "outlined"
|
|
30
|
+
})
|
|
31
|
+
};
|
|
32
|
+
export function getCloseIcon(prefixCls, closeIcon) {
|
|
33
|
+
if (closeIcon === null || closeIcon === false) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
return closeIcon || /*#__PURE__*/React.createElement(_Icon, {
|
|
37
|
+
type: "close",
|
|
38
|
+
theme: "outlined",
|
|
39
|
+
className: "".concat(prefixCls, "-close-icon")
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
var typeToIcon = {
|
|
43
|
+
success: /*#__PURE__*/React.createElement(_Icon, {
|
|
44
|
+
type: "check-circle"
|
|
45
|
+
}),
|
|
46
|
+
info: /*#__PURE__*/React.createElement(_Icon, {
|
|
47
|
+
type: "info-circle"
|
|
48
|
+
}),
|
|
49
|
+
error: /*#__PURE__*/React.createElement(_Icon, {
|
|
50
|
+
type: "close-circle"
|
|
51
|
+
}),
|
|
52
|
+
warning: /*#__PURE__*/React.createElement(_Icon, {
|
|
53
|
+
type: "exclamation-circle"
|
|
54
|
+
})
|
|
55
|
+
};
|
|
56
|
+
export var PureContent = function PureContent(props) {
|
|
57
|
+
var prefixCls = props.prefixCls,
|
|
58
|
+
icon = props.icon,
|
|
59
|
+
type = props.type,
|
|
60
|
+
message = props.message,
|
|
61
|
+
description = props.description,
|
|
62
|
+
btn = props.btn,
|
|
63
|
+
_props$role = props.role,
|
|
64
|
+
role = _props$role === void 0 ? "alert" : _props$role;
|
|
65
|
+
var iconNode = null;
|
|
66
|
+
if (icon) {
|
|
67
|
+
iconNode = /*#__PURE__*/React.createElement("span", {
|
|
68
|
+
className: "".concat(prefixCls, "-icon")
|
|
69
|
+
}, icon);
|
|
70
|
+
} else if (type) {
|
|
71
|
+
iconNode = /*#__PURE__*/React.createElement(typeToIcon[type] || null, {
|
|
72
|
+
className: classNames("".concat(prefixCls, "-icon"), "".concat(prefixCls, "-icon-").concat(type))
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
76
|
+
className: classNames(_defineProperty({}, "".concat(prefixCls, "-with-icon"), iconNode)),
|
|
77
|
+
role: role
|
|
78
|
+
}, iconNode, /*#__PURE__*/React.createElement("div", {
|
|
79
|
+
className: "".concat(prefixCls, "-message")
|
|
80
|
+
}, message), /*#__PURE__*/React.createElement("div", {
|
|
81
|
+
className: "".concat(prefixCls, "-description")
|
|
82
|
+
}, description), btn && /*#__PURE__*/React.createElement("div", {
|
|
83
|
+
className: "".concat(prefixCls, "-btn")
|
|
84
|
+
}, btn));
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/** @private Internal Component. Do not use in your production. */
|
|
88
|
+
var PurePanel = function PurePanel(props) {
|
|
89
|
+
var staticPrefixCls = props.prefixCls,
|
|
90
|
+
className = props.className,
|
|
91
|
+
icon = props.icon,
|
|
92
|
+
type = props.type,
|
|
93
|
+
message = props.message,
|
|
94
|
+
description = props.description,
|
|
95
|
+
btn = props.btn,
|
|
96
|
+
_props$closable = props.closable,
|
|
97
|
+
closable = _props$closable === void 0 ? true : _props$closable,
|
|
98
|
+
closeIcon = props.closeIcon,
|
|
99
|
+
notificationClassName = props.className,
|
|
100
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
101
|
+
var _React$useContext = React.useContext(ConfigContext),
|
|
102
|
+
getPrefixCls = _React$useContext.getPrefixCls;
|
|
103
|
+
var prefixCls = staticPrefixCls || getPrefixCls("notification");
|
|
104
|
+
var noticePrefixCls = "".concat(prefixCls, "-notice");
|
|
105
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
106
|
+
className: classNames("".concat(noticePrefixCls, "-pure-panel"), className)
|
|
107
|
+
}, /*#__PURE__*/React.createElement(Notice, _extends({}, restProps, {
|
|
108
|
+
prefixCls: prefixCls,
|
|
109
|
+
eventKey: "pure",
|
|
110
|
+
duration: null,
|
|
111
|
+
closable: closable,
|
|
112
|
+
className: classNames({
|
|
113
|
+
notificationClassName: notificationClassName
|
|
114
|
+
}),
|
|
115
|
+
closeIcon: getCloseIcon(prefixCls, closeIcon),
|
|
116
|
+
content: /*#__PURE__*/React.createElement(PureContent, {
|
|
117
|
+
prefixCls: noticePrefixCls,
|
|
118
|
+
icon: icon,
|
|
119
|
+
type: type,
|
|
120
|
+
message: message,
|
|
121
|
+
description: description,
|
|
122
|
+
btn: btn
|
|
123
|
+
})
|
|
124
|
+
})));
|
|
125
|
+
};
|
|
126
|
+
export default PurePanel;
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
import _ConfigProvider from "@chaoswise/ui/lib/ConfigProvider";
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
9
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
11
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
12
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
13
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
14
|
+
import React, { useContext } from "react";
|
|
15
|
+
import { render } from "rc-util/lib/React/render";
|
|
16
|
+
import { ConfigContext } from "antd/es/config-provider/context";
|
|
17
|
+
import PurePanel from "./PurePanel";
|
|
18
|
+
import useNotification, { useInternalNotification } from "./useNotification";
|
|
19
|
+
import "antd/es/notification/style/index.less";
|
|
20
|
+
import "../Antd4/notification/style/index.less";
|
|
21
|
+
import "./index.less";
|
|
22
|
+
var notification = null;
|
|
23
|
+
var act = function act(callback) {
|
|
24
|
+
return callback();
|
|
25
|
+
};
|
|
26
|
+
var taskQueue = [];
|
|
27
|
+
var defaultGlobalConfig = {};
|
|
28
|
+
function getGlobalContext() {
|
|
29
|
+
var _defaultGlobalConfig = defaultGlobalConfig,
|
|
30
|
+
getContainer = _defaultGlobalConfig.getContainer,
|
|
31
|
+
rtl = _defaultGlobalConfig.rtl,
|
|
32
|
+
maxCount = _defaultGlobalConfig.maxCount,
|
|
33
|
+
top = _defaultGlobalConfig.top,
|
|
34
|
+
bottom = _defaultGlobalConfig.bottom;
|
|
35
|
+
var mergedContainer = (getContainer === null || getContainer === void 0 ? void 0 : getContainer()) || document.body;
|
|
36
|
+
return {
|
|
37
|
+
getContainer: function getContainer() {
|
|
38
|
+
return mergedContainer;
|
|
39
|
+
},
|
|
40
|
+
rtl: rtl,
|
|
41
|
+
maxCount: maxCount,
|
|
42
|
+
top: top,
|
|
43
|
+
bottom: bottom
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
var GlobalHolder = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
47
|
+
var notificationConfig = props.notificationConfig,
|
|
48
|
+
sync = props.sync;
|
|
49
|
+
var _useContext = useContext(ConfigContext),
|
|
50
|
+
getPrefixCls = _useContext.getPrefixCls;
|
|
51
|
+
var prefixCls = defaultGlobalConfig.prefixCls || getPrefixCls("notification");
|
|
52
|
+
var _useInternalNotificat = useInternalNotification(_objectSpread(_objectSpread({}, notificationConfig), {}, {
|
|
53
|
+
prefixCls: prefixCls
|
|
54
|
+
})),
|
|
55
|
+
_useInternalNotificat2 = _slicedToArray(_useInternalNotificat, 2),
|
|
56
|
+
api = _useInternalNotificat2[0],
|
|
57
|
+
holder = _useInternalNotificat2[1];
|
|
58
|
+
React.useEffect(sync, []);
|
|
59
|
+
React.useImperativeHandle(ref, function () {
|
|
60
|
+
var instance = _objectSpread({}, api);
|
|
61
|
+
Object.keys(instance).forEach(function (method) {
|
|
62
|
+
instance[method] = function () {
|
|
63
|
+
sync();
|
|
64
|
+
return api[method].apply(api, arguments);
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
return {
|
|
68
|
+
instance: instance,
|
|
69
|
+
sync: sync
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
return holder;
|
|
73
|
+
});
|
|
74
|
+
var GlobalHolderWrapper = /*#__PURE__*/React.forwardRef(function (_, ref) {
|
|
75
|
+
var _React$useState = React.useState(getGlobalContext),
|
|
76
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
77
|
+
notificationConfig = _React$useState2[0],
|
|
78
|
+
setNotificationConfig = _React$useState2[1];
|
|
79
|
+
var sync = function sync() {
|
|
80
|
+
setNotificationConfig(getGlobalContext);
|
|
81
|
+
};
|
|
82
|
+
React.useEffect(sync, []);
|
|
83
|
+
var dom = /*#__PURE__*/React.createElement(GlobalHolder, {
|
|
84
|
+
ref: ref,
|
|
85
|
+
sync: sync,
|
|
86
|
+
notificationConfig: notificationConfig
|
|
87
|
+
});
|
|
88
|
+
return /*#__PURE__*/React.createElement(_ConfigProvider, null, dom);
|
|
89
|
+
});
|
|
90
|
+
function flushNotice() {
|
|
91
|
+
if (!notification) {
|
|
92
|
+
var holderFragment = document.createDocumentFragment();
|
|
93
|
+
var newNotification = {
|
|
94
|
+
fragment: holderFragment
|
|
95
|
+
};
|
|
96
|
+
notification = newNotification;
|
|
97
|
+
// Delay render to avoid sync issue
|
|
98
|
+
act(function () {
|
|
99
|
+
render( /*#__PURE__*/React.createElement(GlobalHolderWrapper, {
|
|
100
|
+
ref: function ref(node) {
|
|
101
|
+
var _ref = node || {},
|
|
102
|
+
instance = _ref.instance,
|
|
103
|
+
sync = _ref.sync;
|
|
104
|
+
Promise.resolve().then(function () {
|
|
105
|
+
if (!newNotification.instance && instance) {
|
|
106
|
+
newNotification.instance = instance;
|
|
107
|
+
newNotification.sync = sync;
|
|
108
|
+
flushNotice();
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}), holderFragment);
|
|
113
|
+
});
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
// Notification not ready
|
|
117
|
+
if (!notification.instance) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// >>> Execute task
|
|
122
|
+
taskQueue.forEach(function (task) {
|
|
123
|
+
// eslint-disable-next-line default-case
|
|
124
|
+
switch (task.type) {
|
|
125
|
+
case "open":
|
|
126
|
+
{
|
|
127
|
+
act(function () {
|
|
128
|
+
notification.instance.open(_objectSpread(_objectSpread({}, defaultGlobalConfig), task.config));
|
|
129
|
+
});
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
case "destroy":
|
|
133
|
+
act(function () {
|
|
134
|
+
notification.instance.destroy(task.key);
|
|
135
|
+
});
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
// Clean up
|
|
141
|
+
taskQueue = [];
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// ==============================================================================
|
|
145
|
+
// == Export ==
|
|
146
|
+
// ==============================================================================
|
|
147
|
+
|
|
148
|
+
function setNotificationGlobalConfig(config) {
|
|
149
|
+
defaultGlobalConfig = _objectSpread(_objectSpread({}, defaultGlobalConfig), config);
|
|
150
|
+
|
|
151
|
+
// Trigger sync for it
|
|
152
|
+
act(function () {
|
|
153
|
+
var _notification, _notification$sync;
|
|
154
|
+
(_notification = notification) === null || _notification === void 0 || (_notification$sync = _notification.sync) === null || _notification$sync === void 0 || _notification$sync.call(_notification);
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
function open(config) {
|
|
158
|
+
taskQueue.push({
|
|
159
|
+
type: "open",
|
|
160
|
+
config: config
|
|
161
|
+
});
|
|
162
|
+
flushNotice();
|
|
163
|
+
}
|
|
164
|
+
var destroy = function destroy(key) {
|
|
165
|
+
taskQueue.push({
|
|
166
|
+
type: "destroy",
|
|
167
|
+
key: key
|
|
168
|
+
});
|
|
169
|
+
flushNotice();
|
|
170
|
+
};
|
|
171
|
+
var methods = ["success", "info", "warning", "error"];
|
|
172
|
+
var baseStaticMethods = {
|
|
173
|
+
open: open,
|
|
174
|
+
destroy: destroy,
|
|
175
|
+
config: setNotificationGlobalConfig,
|
|
176
|
+
useNotification: useNotification,
|
|
177
|
+
_InternalPanelDoNotUseOrYouWillBeFired: PurePanel
|
|
178
|
+
};
|
|
179
|
+
var staticMethods = baseStaticMethods;
|
|
180
|
+
methods.forEach(function (type) {
|
|
181
|
+
staticMethods[type] = function (config) {
|
|
182
|
+
return open(_objectSpread(_objectSpread({}, config), {}, {
|
|
183
|
+
type: type
|
|
184
|
+
}));
|
|
185
|
+
};
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
// ==============================================================================
|
|
189
|
+
// == Test ==
|
|
190
|
+
// ==============================================================================
|
|
191
|
+
var noop = function noop() {};
|
|
192
|
+
|
|
193
|
+
/** @internal Only Work in test env */
|
|
194
|
+
// eslint-disable-next-line import/no-mutable-exports
|
|
195
|
+
export var actWrapper = function actWrapper() {};
|
|
196
|
+
if (process.env.NODE_ENV === "test") {
|
|
197
|
+
actWrapper = function actWrapper(wrapper) {
|
|
198
|
+
act = wrapper;
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/** @internal Only Work in test env */
|
|
203
|
+
// eslint-disable-next-line import/no-mutable-exports
|
|
204
|
+
export var actDestroy = noop;
|
|
205
|
+
if (process.env.NODE_ENV === "test") {
|
|
206
|
+
actDestroy = function actDestroy() {
|
|
207
|
+
notification = null;
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
export default staticMethods;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
@notificationPrefixCls: ~'@{ant-prefix}-notification';
|
|
2
|
+
|
|
3
|
+
.@{notificationPrefixCls}.cw-message-custom-notification-wrapper{
|
|
4
|
+
// ====================== Notification ======================
|
|
5
|
+
position: fixed;
|
|
6
|
+
display: flex;
|
|
7
|
+
width: 404px;
|
|
8
|
+
max-height: ~"calc(100% - @{layout-header-height})";
|
|
9
|
+
align-items: flex-end;
|
|
10
|
+
overflow-x: hidden;
|
|
11
|
+
overflow-y: auto;
|
|
12
|
+
height: ~"calc(100% - @{layout-header-height})";
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
pointer-events: none;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
margin: 0;
|
|
17
|
+
// Position
|
|
18
|
+
&.@{notificationPrefixCls}-top,
|
|
19
|
+
&.@{notificationPrefixCls}-topLeft,
|
|
20
|
+
&.@{notificationPrefixCls}-topRight {
|
|
21
|
+
top: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&.@{notificationPrefixCls}-bottomRight,
|
|
25
|
+
&.@{notificationPrefixCls}-topRight {
|
|
26
|
+
right: 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// ========================= Notice =========================
|
|
30
|
+
.@{notificationPrefixCls}-notice {
|
|
31
|
+
position: relative;
|
|
32
|
+
display: block;
|
|
33
|
+
box-sizing: border-box;
|
|
34
|
+
line-height: 1.5;
|
|
35
|
+
width: 100%;
|
|
36
|
+
|
|
37
|
+
&-wrapper {
|
|
38
|
+
pointer-events: auto;
|
|
39
|
+
position: relative;
|
|
40
|
+
display: block;
|
|
41
|
+
box-sizing: border-box;
|
|
42
|
+
margin: 0;
|
|
43
|
+
width: 404px;
|
|
44
|
+
height: unset !important;
|
|
45
|
+
padding-left: 20px; // 滚动条出现情况&&展现盒子阴影
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.@{notificationPrefixCls}-fade {
|
|
51
|
+
overflow: hidden;
|
|
52
|
+
transition: all 0.3s;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.@{notificationPrefixCls}-fade-appear-prepare {
|
|
56
|
+
pointer-events: none;
|
|
57
|
+
opacity: 0 !important;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.@{notificationPrefixCls}-fade-appear-start {
|
|
61
|
+
transform: translateX(100%);
|
|
62
|
+
opacity: 0;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.@{notificationPrefixCls}-fade-appear-active {
|
|
66
|
+
transform: translateX(0);
|
|
67
|
+
opacity: 1;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
// ========================= Stack =========================
|
|
72
|
+
&.@{notificationPrefixCls}-stack {
|
|
73
|
+
& > .@{notificationPrefixCls}-notice {
|
|
74
|
+
&-wrapper {
|
|
75
|
+
transition: all 0.3s;
|
|
76
|
+
position: absolute;
|
|
77
|
+
top: 2px;
|
|
78
|
+
opacity: 1;
|
|
79
|
+
|
|
80
|
+
&:not(:nth-last-child(-n + 3)) {
|
|
81
|
+
opacity: 0;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&&-expanded {
|
|
87
|
+
& > .@{notificationPrefixCls}-notice {
|
|
88
|
+
&-wrapper {
|
|
89
|
+
&:not(:nth-last-child(-n + 1)) {
|
|
90
|
+
opacity: 1;
|
|
91
|
+
width: 404px;
|
|
92
|
+
overflow: unset;
|
|
93
|
+
color: inherit;
|
|
94
|
+
pointer-events: auto;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
}
|
|
102
|
+
}
|