@chaoswise/ui 2.4.1 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/babel/index.js +1 -28
- package/config/swc.js +5 -0
- package/lib/AbreastLayout/CollapsedBtn.js +1 -1
- package/lib/AbreastLayout/NavTreeContainer.js +1 -1
- package/lib/AbreastLayout/index.js +2 -2
- package/lib/Ace/ace.js +2 -2
- package/lib/Ace/diff.js +2 -2
- package/lib/Ace/split.js +2 -2
- package/lib/AdaptiveLayout/index.js +2 -2
- package/lib/Alert/index.js +1 -1
- package/lib/AlgorithmChart/common/chart.option.js +0 -5
- package/lib/Anchor/index.js +3 -0
- package/lib/Antd/Drawer.js +2 -2
- package/lib/Antd3/es/cascader/index.js +0 -1
- package/lib/Antd3/es/message/index.js +0 -2
- package/lib/Antd4/message/index-copy.js +0 -2
- package/lib/Antd4/notification/index.js +0 -1
- package/lib/Antd4/statistic/utils.js +0 -1
- package/lib/Antd4/tabs/index.js +1 -1
- package/lib/Antd4/tooltip/index.js +0 -1
- package/lib/Antd4/tree/Tree.js +0 -1
- package/lib/Antd4Form/FieldList.js +2 -2
- package/lib/Antd4Form/FormItem.js +2 -2
- package/lib/Antd4Form/FormItemChildren.js +2 -2
- package/lib/Antd4Form/useForm.js +2 -2
- package/lib/AutoComplete/index.js +3 -0
- package/lib/Avatar/index.js +3 -0
- package/lib/BackTop/index.js +3 -0
- package/lib/Badge/index.less +5 -0
- package/lib/BasicLayout/Breadcrumb.js +3 -3
- package/lib/BasicLayout/Sider.js +5 -5
- package/lib/BasicLayout/index.js +2 -3
- package/lib/Breadcrumb/Breadcrumb.less +34 -0
- package/lib/Breadcrumb/index.js +2 -9
- package/lib/CWCascader/Cascader/index.js +2 -2
- package/lib/CWCascader/rc-cascader/OptionList/Checkbox.js +2 -2
- package/lib/CWCascader/rc-cascader/OptionList/Column.js +5 -5
- package/lib/CWCascader/rc-cascader/OptionList/index.js +2 -2
- 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 +2 -2
- package/lib/CWMessage/MessageContent/TabList/index.js +2 -2
- package/lib/CWMessage/MessageContent/index.js +4 -4
- package/lib/CWMessage/index.js +3 -3
- package/lib/CWRadioTabs/index.js +2 -2
- package/lib/CWRangePicker/DropdownMenu/MoreHistoryList/index.js +1 -1
- package/lib/CWRangePicker/DropdownMenu/MoreTimeList/index.js +2 -2
- package/lib/CWRangePicker/DropdownMenu/index.js +4 -4
- package/lib/CWRangePicker/Refresh/index.js +2 -2
- package/lib/CWRangePicker/index.js +4 -4
- package/lib/CWRangePicker/utils/index.js +2 -2
- package/lib/CWSelect/Tag.js +1 -1
- package/lib/CWSelect/antd-select.js +3 -4
- package/lib/CWSelect/index.js +2 -2
- package/lib/CWTable/CWTable.js +4 -6
- package/lib/CWTable/EditLine.js +4 -4
- package/lib/CWTable/Filter.js +1 -1
- package/lib/CWTable/FormTable.js +2 -2
- package/lib/CWTable/header.js +23 -22
- package/lib/CWTree/index.js +4 -5
- package/lib/CWTree/utils/index.js +2 -2
- package/lib/CWUpload/upload/DragList.js +2 -2
- package/lib/CWUpload/upload/Dragger.js +3 -3
- package/lib/CWUpload/upload/Upload.js +4 -4
- package/lib/CWUpload/upload/UploadList.js +28 -28
- package/lib/Calendar/index.js +3 -0
- package/lib/Card/index.js +3 -0
- package/lib/CardSelect/index.js +0 -1
- package/lib/Carousel/index.js +3 -0
- package/lib/ChangeIcon/index.js +1 -1
- package/lib/Checkbox/Checkbox.js +2 -2
- package/lib/Checkbox/Group.js +2 -2
- package/lib/Col/Collapse.less +129 -0
- package/lib/Col/index.js +3 -0
- package/lib/Collapse/index.js +1 -1
- package/lib/ColorPicker/index.js +4 -5
- package/lib/Comment/index.js +3 -0
- package/lib/ConfigProvider/ConfigProvider.js +2 -2
- package/lib/ConfigProvider/Switch.js +1 -1
- package/lib/CustomScrollBar/index.js +2 -2
- package/lib/DatePicker/DatePicker.js +1 -1
- package/lib/DatePicker/MonthPicker.js +1 -1
- package/lib/DatePicker/RangePicker.js +1 -1
- package/lib/DateRangePicker/components/ExtraTimeFooter.js +2 -2
- package/lib/Descriptions/index.js +3 -0
- package/lib/Divider/index.js +3 -0
- package/lib/Documentation/Tocify.js +2 -2
- package/lib/Documentation/index.js +2 -3
- package/lib/Drawer/Drawer.less +305 -0
- package/lib/Drawer/index.js +120 -0
- package/lib/Dropdown/Dropdown.less +124 -0
- package/lib/Dropdown/index.js +4 -0
- package/lib/DropdownDatePicker/DropdownMenu/MoreTimeList/index.js +2 -2
- package/lib/DropdownDatePicker/DropdownMenu/index.js +4 -4
- package/lib/DropdownDatePicker/index.js +3 -3
- package/lib/DropdownDatePicker/utils/index.js +2 -2
- package/lib/EchartsArea/index.js +2 -2
- package/lib/EchartsBar/index.js +2 -2
- package/lib/EchartsBase/index.js +2 -3
- package/lib/EchartsLine/index.js +2 -3
- package/lib/ErrorBoundary/history.js +2 -2
- package/lib/ErrorBoundary/index.js +2 -2
- package/lib/FilterDropDown/DragList.js +3 -4
- package/lib/FilterDropDown/index.js +1 -1
- package/lib/Flow/Flow.js +0 -2
- package/lib/Flow/commons/initCommands.js +0 -2
- package/lib/Flow/components/PluginWrapper.js +2 -2
- package/lib/Flow/layouts/callChain.js +2 -2
- package/lib/Flow/plugins/CommandLifeCycle.js +2 -2
- package/lib/Flow/plugins/InitSideBarPlugin.js +2 -2
- package/lib/Flow/plugins/InitToolBarPlugin.js +2 -2
- package/lib/Flow/shape/nodes/baseNode.js +0 -1
- package/lib/Form/FormItem.js +2 -2
- package/lib/FormItemWrapper/index.js +2 -2
- package/lib/Formily/FieldList/index.js +2 -2
- package/lib/Formily/FormItem/index.js +3 -3
- package/lib/Formily/FormItem/items/Password.js +2 -2
- package/lib/Formily/FormItem/items/Rating.js +1 -1
- package/lib/Formily/FormItem/items/Switch.js +1 -1
- package/lib/Formily/FormItem/items/Tansfer.js +1 -1
- package/lib/Formily/FormItem/items/TimePicker.js +1 -1
- package/lib/Formily/MegaLayout/index.js +2 -2
- package/lib/Formily/subscribeFields/index.js +2 -2
- package/lib/GlobalTabs/index.js +2 -2
- package/lib/Header/CommonDropMenu.js +2 -2
- package/lib/Header/CommonIcon.js +2 -2
- package/lib/Header/TopNavigationMenu/index.js +2 -2
- package/lib/Header/UserSetting/index.js +2 -2
- package/lib/Header/UserSetting/utils.js +2 -2
- package/lib/Header/index.js +2 -2
- package/lib/Icon/index.js +3 -0
- package/lib/IconSelect/components/CustomImg/index.js +0 -1
- package/lib/IconSelect/index.js +1 -1
- package/lib/Input/InputComponent.js +2 -2
- package/lib/IntersectionInput/index.js +2 -2
- package/lib/Joyride/List.js +2 -2
- package/lib/Joyride/index.js +3 -3
- package/lib/Layout/Layout.less +6 -0
- package/lib/Layout/index.js +4 -0
- package/lib/LayoutBreadcrumb/index.js +3 -3
- package/lib/LazyLoadingTreeSelect/index.js +2 -2
- package/lib/List/index.js +3 -0
- package/lib/LocaleProvider/index.js +3 -0
- package/lib/Mention/index.js +3 -0
- package/lib/Mentions/index.js +3 -0
- package/lib/Menu/menu/MenuItem.js +2 -3
- package/lib/Menu/menu/SubMenu.js +2 -2
- package/lib/Menu/menu/index.js +2 -2
- package/lib/Modal/Modal.js +2 -2
- package/lib/Modal/custom-backup/entiretyDrag.js +2 -2
- package/lib/Modal/index.js +3 -4
- package/lib/ModuleFederation/ErrorBoundary/index.js +2 -2
- package/lib/ModuleFederation/index.js +1 -1
- package/lib/ModuleFederation/react-dynamic-remote-component/RemoteComponent.js +3 -3
- package/lib/PageHeader/index.js +3 -0
- package/lib/Pagination/index.js +2 -2
- package/lib/PolymerizationSearch/index.js +2 -2
- package/lib/Popover/index.js +3 -0
- package/lib/Progress/index.js +1 -1
- package/lib/QuickRangePicker/index.js +5 -5
- package/lib/QuickTransfer/Drag.js +0 -1
- package/lib/QuickTransfer/DragList.js +1 -1
- package/lib/QuickTransfer/NotDragList.js +1 -1
- package/lib/QuickTransfer/index.js +2 -2
- package/lib/QuickTransfer/utils.js +2 -4
- package/lib/Radio/Group.js +2 -2
- package/lib/Radio/Radio.js +2 -2
- package/lib/RangePicker/components/ExtraTimeFooter.js +3 -3
- package/lib/Rate/index.js +3 -0
- package/lib/ReactSelect/CustomArrow.js +1 -1
- package/lib/ReactSelect/TagMore.js +1 -1
- package/lib/ReactSelect/customStyles.js +2 -2
- package/lib/ReactSelect/index.js +2 -2
- package/lib/Result/index.js +3 -0
- package/lib/Row/index.js +3 -0
- package/lib/SearchBar/index.js +6 -6
- package/lib/Select/TreeSelect.less +10 -0
- package/lib/Select/index.js +4 -0
- package/lib/SelectBackup/index.js +2 -2
- package/lib/SelectBackup/select/index.js +0 -1
- package/lib/SiderMenu/Item.js +2 -2
- package/lib/SiderMenu/index.js +3 -3
- package/lib/SimplePagination/index.js +3 -3
- package/lib/SingleSpa/import-html/process-tpl.js +0 -1
- package/lib/SingleSpa/index.js +2 -2
- package/lib/SingleSpa/singleSpa/single-spa.dev.js +2 -3
- package/lib/Skeleton/index.js +3 -0
- package/lib/Spin/Spin.less +16 -0
- package/lib/Spin/index.js +4 -0
- package/lib/Statistic/index.js +3 -0
- package/lib/Steps/Steps.less +502 -0
- package/lib/Steps/index.js +4 -0
- package/lib/Switch/Switch.less +62 -0
- package/lib/Switch/index.js +4 -0
- package/lib/Table/Table.less +306 -0
- package/lib/Table/index.js +4 -0
- package/lib/Tabs/index.js +2 -2
- package/lib/Tabs/index.less +3 -0
- package/lib/ThemeProvider/main.js +2 -2
- package/lib/TimePicker/index.js +3 -2
- package/lib/Transfer/index.js +3 -0
- package/lib/Tree/TreeSelect.less +10 -0
- package/lib/Tree/index.js +4 -0
- package/lib/TreeList/index.js +2 -2
- package/lib/TreeSelect/TreeSelect.less +10 -0
- package/lib/TreeSelect/index.js +4 -0
- package/lib/TreeSelect111/index.js +2 -2
- package/lib/TreeSelect111/utils/index.js +2 -2
- package/lib/Typography/index.js +3 -0
- package/lib/WangEditor/release/wangEditor.js +0 -6
- package/lib/WangEditor/wangEditor.js +0 -3
- package/lib/Watermark/index.js +2 -2
- package/lib/index.js +145 -0
- package/lib/message/index.js +3 -5
- package/lib/noticeManager/globalState.js +2 -2
- package/lib/portalNoticeManager/usePortalDispatchNotice.js +2 -2
- package/lib/useLocale/index.js +2 -2
- package/lib/version/index.js +3 -0
- package/package.json +2 -2
- /package/config/babel/{antdComs.js → antdComs-nouse.js} +0 -0
package/lib/ColorPicker/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
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 _Dropdown from "@chaoswise/ui/lib/
|
|
2
|
+
import _Dropdown from "@chaoswise/ui/lib/Dropdown";
|
|
3
3
|
import "@chaoswise/ui/lib/Button/index.less";
|
|
4
4
|
import _Button from "@chaoswise/ui/lib/Button";
|
|
5
5
|
import _Space from "@chaoswise/ui/lib/Space";
|
|
6
|
-
import _Icon from "@chaoswise/ui/lib/
|
|
6
|
+
import _Icon from "@chaoswise/ui/lib/Icon";
|
|
7
7
|
import "@chaoswise/ui/lib/Input/index.less";
|
|
8
8
|
import _Input from "@chaoswise/ui/lib/Input";
|
|
9
9
|
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
@@ -12,8 +12,8 @@ import _Tabs from "@chaoswise/ui/lib/Tabs";
|
|
|
12
12
|
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; }
|
|
13
13
|
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; }
|
|
14
14
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
|
-
function _toPropertyKey(
|
|
16
|
-
function _toPrimitive(
|
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
16
|
+
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); }
|
|
17
17
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
18
18
|
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."); }
|
|
19
19
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -257,7 +257,6 @@ var ColorPicker = function ColorPicker(_ref) {
|
|
|
257
257
|
ColorPicker.defaultProps = {
|
|
258
258
|
showGradient: false // 是否显示渐变tab
|
|
259
259
|
};
|
|
260
|
-
|
|
261
260
|
ColorPicker.propTypes = {
|
|
262
261
|
defaultValue: PropTypes.shape({
|
|
263
262
|
color: PropTypes.string,
|
|
@@ -6,8 +6,8 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
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
8
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
-
function _toPropertyKey(
|
|
10
|
-
function _toPrimitive(
|
|
9
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
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
11
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _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
13
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -6,8 +6,8 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
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
8
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
-
function _toPropertyKey(
|
|
10
|
-
function _toPrimitive(
|
|
9
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
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
11
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
12
12
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
13
13
|
import React, { useRef } from 'react';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _Icon from "@chaoswise/ui/lib/
|
|
1
|
+
import _Icon from "@chaoswise/ui/lib/Icon";
|
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
3
|
import DatePicker from '../Antd4/date-picker';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _Icon from "@chaoswise/ui/lib/
|
|
1
|
+
import _Icon from "@chaoswise/ui/lib/Icon";
|
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
3
|
import React, { forwardRef } from 'react';
|
|
4
4
|
import DatePicker from '../Antd4/date-picker';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _Icon from "@chaoswise/ui/lib/
|
|
1
|
+
import _Icon from "@chaoswise/ui/lib/Icon";
|
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
3
|
import React, { forwardRef } from 'react';
|
|
4
4
|
import DatePicker from '../Antd4/date-picker';
|
|
@@ -5,8 +5,8 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
5
5
|
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; }
|
|
6
6
|
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; }
|
|
7
7
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
-
function _toPropertyKey(
|
|
9
|
-
function _toPrimitive(
|
|
8
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(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
10
|
import React from 'react';
|
|
11
11
|
import moment from 'moment';
|
|
12
12
|
export default function ExtraTimeFooter(_ref) {
|
|
@@ -4,8 +4,8 @@ import _Anchor from "antd/es/anchor";
|
|
|
4
4
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
5
5
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
6
6
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
7
|
-
function _toPropertyKey(
|
|
8
|
-
function _toPrimitive(
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
8
|
+
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); }
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import { last } from 'lodash-es';
|
|
11
11
|
var Link = _Anchor.Link;
|
|
@@ -4,8 +4,8 @@ import _AbreastLayout from "@chaoswise/ui/lib/AbreastLayout";
|
|
|
4
4
|
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; }
|
|
5
5
|
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; }
|
|
6
6
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
7
|
-
function _toPropertyKey(
|
|
8
|
-
function _toPrimitive(
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
8
|
+
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); }
|
|
9
9
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
10
10
|
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."); }
|
|
11
11
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -102,7 +102,6 @@ var Documentation = function Documentation(_ref) {
|
|
|
102
102
|
// } catch { }
|
|
103
103
|
// }
|
|
104
104
|
};
|
|
105
|
-
|
|
106
105
|
return /*#__PURE__*/React.createElement("div", {
|
|
107
106
|
className: classNames('cw-documentation', className),
|
|
108
107
|
style: _objectSpread({
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
@dawer-prefix-cls: ~'@{ant-prefix}-drawer';
|
|
2
|
+
|
|
3
|
+
@drawer-prefix-cls: @dawer-prefix-cls;
|
|
4
|
+
|
|
5
|
+
.@{drawer-prefix-cls} {
|
|
6
|
+
position: fixed;
|
|
7
|
+
z-index: @zindex-modal;
|
|
8
|
+
width: 0%;
|
|
9
|
+
height: 100%;
|
|
10
|
+
transition: transform @animation-duration-slow @ease-base-out,
|
|
11
|
+
height 0s ease @animation-duration-slow, width 0s ease @animation-duration-slow;
|
|
12
|
+
|
|
13
|
+
>* {
|
|
14
|
+
transition: transform @animation-duration-slow @ease-base-out,
|
|
15
|
+
box-shadow @animation-duration-slow @ease-base-out;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&-content-wrapper {
|
|
19
|
+
position: absolute;
|
|
20
|
+
overflow: visible; // UI规范内容区滚动
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.@{drawer-prefix-cls}-content {
|
|
24
|
+
width: 100%;
|
|
25
|
+
height: 100%;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&-left,
|
|
29
|
+
&-right {
|
|
30
|
+
top: 0;
|
|
31
|
+
width: 0%;
|
|
32
|
+
height: 100%;
|
|
33
|
+
|
|
34
|
+
.@{drawer-prefix-cls}-content-wrapper {
|
|
35
|
+
height: 100%;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&.@{drawer-prefix-cls}-open {
|
|
39
|
+
width: 100%;
|
|
40
|
+
transition: transform @animation-duration-slow @ease-base-out;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&.@{drawer-prefix-cls}-open.no-mask {
|
|
44
|
+
width: 0%;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&-left {
|
|
49
|
+
&.@{drawer-prefix-cls}-open {
|
|
50
|
+
.@{drawer-prefix-cls}-content-wrapper {
|
|
51
|
+
box-shadow: @shadow-1-right;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&-right {
|
|
57
|
+
right: 0;
|
|
58
|
+
|
|
59
|
+
.@{drawer-prefix-cls} {
|
|
60
|
+
&-content-wrapper {
|
|
61
|
+
right: 0;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&.@{drawer-prefix-cls}-open {
|
|
66
|
+
.@{drawer-prefix-cls}-content-wrapper {
|
|
67
|
+
box-shadow: @shadow-1-left;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// https://github.com/ant-design/ant-design/issues/18607, Avoid edge alignment bug.
|
|
71
|
+
&.no-mask {
|
|
72
|
+
right: 1px;
|
|
73
|
+
transform: translateX(1px);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&-top,
|
|
79
|
+
&-bottom {
|
|
80
|
+
left: 0;
|
|
81
|
+
width: 100%;
|
|
82
|
+
height: 0%;
|
|
83
|
+
|
|
84
|
+
.@{drawer-prefix-cls}-content-wrapper {
|
|
85
|
+
width: 100%;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&.@{drawer-prefix-cls}-open {
|
|
89
|
+
height: 100%;
|
|
90
|
+
transition: transform @animation-duration-slow @ease-base-out;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&.@{drawer-prefix-cls}-open.no-mask {
|
|
94
|
+
height: 0%;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&-top {
|
|
99
|
+
top: 0;
|
|
100
|
+
|
|
101
|
+
&.@{drawer-prefix-cls}-open {
|
|
102
|
+
.@{drawer-prefix-cls}-content-wrapper {
|
|
103
|
+
box-shadow: @shadow-1-down;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&-bottom {
|
|
109
|
+
bottom: 0;
|
|
110
|
+
|
|
111
|
+
.@{drawer-prefix-cls} {
|
|
112
|
+
&-content-wrapper {
|
|
113
|
+
bottom: 0;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&.@{drawer-prefix-cls}-open {
|
|
118
|
+
.@{drawer-prefix-cls}-content-wrapper {
|
|
119
|
+
box-shadow: @shadow-1-up;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&.no-mask {
|
|
123
|
+
bottom: 1px;
|
|
124
|
+
transform: translateY(1px);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
&.@{drawer-prefix-cls}-open {
|
|
130
|
+
.@{drawer-prefix-cls} {
|
|
131
|
+
&-mask {
|
|
132
|
+
height: 100%;
|
|
133
|
+
opacity: 1;
|
|
134
|
+
transition: none;
|
|
135
|
+
animation: antdDrawerFadeIn @animation-duration-slow @ease-base-out;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&-title {
|
|
141
|
+
margin: 0;
|
|
142
|
+
color: @heading-color;
|
|
143
|
+
font-weight: 500;
|
|
144
|
+
font-size: 16px; // UI规范
|
|
145
|
+
line-height: 24px;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&-content {
|
|
149
|
+
position: relative;
|
|
150
|
+
z-index: 1;
|
|
151
|
+
overflow: visible; // UI规范 内容区域滚动
|
|
152
|
+
background-color: @component-background;
|
|
153
|
+
background-clip: padding-box;
|
|
154
|
+
border: 0;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&-close {
|
|
158
|
+
position: absolute;
|
|
159
|
+
top: 0;
|
|
160
|
+
right: 24px; // UI规范
|
|
161
|
+
z-index: @zindex-popup-close;
|
|
162
|
+
display: block;
|
|
163
|
+
width: 16px; // UI规范
|
|
164
|
+
height: 51px; // UI规范
|
|
165
|
+
padding: 0;
|
|
166
|
+
color: @text-color;
|
|
167
|
+
font-weight: 700;
|
|
168
|
+
font-size: 16px; // UI规范
|
|
169
|
+
font-style: normal;
|
|
170
|
+
line-height: 51px; // UI规范
|
|
171
|
+
text-align: center;
|
|
172
|
+
text-transform: none;
|
|
173
|
+
text-decoration: none;
|
|
174
|
+
background: transparent;
|
|
175
|
+
border: 0;
|
|
176
|
+
outline: 0;
|
|
177
|
+
cursor: pointer;
|
|
178
|
+
transition: color @animation-duration-slow;
|
|
179
|
+
text-rendering: auto;
|
|
180
|
+
|
|
181
|
+
&:focus,
|
|
182
|
+
&:hover {
|
|
183
|
+
color: @primary-5;
|
|
184
|
+
text-decoration: none;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
&-header {
|
|
189
|
+
position: relative;
|
|
190
|
+
padding: @drawer-header-padding;
|
|
191
|
+
color: @text-color;
|
|
192
|
+
background: @component-background;
|
|
193
|
+
border-bottom: @border-width-base @border-style-base @border-color-split; // 符合UI规范
|
|
194
|
+
border-radius: @border-radius-base @border-radius-base 0 0;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
&-header-no-title {
|
|
198
|
+
color: @text-color;
|
|
199
|
+
background: @component-background;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
&-body {
|
|
203
|
+
padding: @drawer-body-padding;
|
|
204
|
+
font-size: @font-size-base;
|
|
205
|
+
line-height: @line-height-base;
|
|
206
|
+
word-wrap: break-word;
|
|
207
|
+
|
|
208
|
+
.cw-drawer-footer {
|
|
209
|
+
position: absolute;
|
|
210
|
+
right: 0;
|
|
211
|
+
bottom: 0;
|
|
212
|
+
width: 100%;
|
|
213
|
+
border-top: @border-width-base @border-style-base @border-color-split;
|
|
214
|
+
padding: 12px 24px;
|
|
215
|
+
background: @component-background;
|
|
216
|
+
display: flex;
|
|
217
|
+
align-items: center;
|
|
218
|
+
z-index: 10;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
&-wrapper-body {
|
|
223
|
+
height: 100%;
|
|
224
|
+
overflow: visible; // UI规范内容区滚动
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
&-mask {
|
|
228
|
+
position: absolute;
|
|
229
|
+
top: 0;
|
|
230
|
+
left: 0;
|
|
231
|
+
width: 100%;
|
|
232
|
+
height: 0;
|
|
233
|
+
background-color: @modal-mask-bg;
|
|
234
|
+
opacity: 0;
|
|
235
|
+
filter: ~'alpha(opacity=45)';
|
|
236
|
+
transition: opacity @animation-duration-slow linear, height 0s ease @animation-duration-slow;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
&-open {
|
|
240
|
+
&-content {
|
|
241
|
+
box-shadow: @shadow-2;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// UIUE规范
|
|
246
|
+
&-header {
|
|
247
|
+
.cw-drawer-header {
|
|
248
|
+
display: flex;
|
|
249
|
+
position: relative;
|
|
250
|
+
height: 51px;
|
|
251
|
+
align-items: center;
|
|
252
|
+
justify-content: flex-end;
|
|
253
|
+
|
|
254
|
+
.cw-drawer-title {
|
|
255
|
+
margin-right: 16px;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.cw-drawer-extra {
|
|
259
|
+
display: flex;
|
|
260
|
+
flex: 1;
|
|
261
|
+
margin-right: 32px;
|
|
262
|
+
|
|
263
|
+
.cw-drawer-extra-left {
|
|
264
|
+
display: flex;
|
|
265
|
+
flex: 1;
|
|
266
|
+
align-items: center;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.cw-drawer-extra-right {
|
|
270
|
+
display: flex;
|
|
271
|
+
align-items: center;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.cw-drawer-extra-un-closable {
|
|
276
|
+
margin-right: 0;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// 修复width设置百分比定位元素存在问题
|
|
282
|
+
&:not(&-open) {
|
|
283
|
+
.@{drawer-prefix-cls}-header {
|
|
284
|
+
.cw-drawer-header {
|
|
285
|
+
display: none;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.@{drawer-prefix-cls}-body {
|
|
290
|
+
.cw-drawer-footer {
|
|
291
|
+
display: none;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
@keyframes antdDrawerFadeIn {
|
|
298
|
+
0% {
|
|
299
|
+
opacity: 0;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
100% {
|
|
303
|
+
opacity: 1;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
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 "antd/es/drawer/style";
|
|
3
|
+
import _Drawer from "antd/es/drawer";
|
|
4
|
+
var _excluded = ["size", "children", "footer", "bodyStyle", "title", "extraLeft", "extraRight", "visible", "closable"];
|
|
5
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
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
|
+
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(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
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(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
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(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
14
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
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(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
18
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
19
|
+
import React, { forwardRef, useRef, useState, useEffect, useMemo } from "react";
|
|
20
|
+
import PropTypes from "prop-types";
|
|
21
|
+
import classnames from "classnames";
|
|
22
|
+
import "./Drawer.less";
|
|
23
|
+
var DrawerFooter = function DrawerFooter(_ref) {
|
|
24
|
+
var footer = _ref.footer,
|
|
25
|
+
setHeight = _ref.setHeight;
|
|
26
|
+
var footerRef = useRef(null);
|
|
27
|
+
useEffect(function () {
|
|
28
|
+
// 延时解决初始化高度值绑定不上
|
|
29
|
+
setTimeout(function () {
|
|
30
|
+
var _footerRef$current;
|
|
31
|
+
setHeight(((_footerRef$current = footerRef.current) === null || _footerRef$current === void 0 ? void 0 : _footerRef$current.offsetHeight) || 0);
|
|
32
|
+
});
|
|
33
|
+
}, [footer]);
|
|
34
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
35
|
+
ref: footerRef,
|
|
36
|
+
className: "cw-drawer-footer"
|
|
37
|
+
}, footer);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* 基于antd Drawer封装,在原有api基础上增加以下api
|
|
42
|
+
*/
|
|
43
|
+
var CWDrawer = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
44
|
+
var _ref2$size = _ref2.size,
|
|
45
|
+
size = _ref2$size === void 0 ? "small" : _ref2$size,
|
|
46
|
+
children = _ref2.children,
|
|
47
|
+
footer = _ref2.footer,
|
|
48
|
+
bodyStyle = _ref2.bodyStyle,
|
|
49
|
+
title = _ref2.title,
|
|
50
|
+
extraLeft = _ref2.extraLeft,
|
|
51
|
+
extraRight = _ref2.extraRight,
|
|
52
|
+
visible = _ref2.visible,
|
|
53
|
+
_ref2$closable = _ref2.closable,
|
|
54
|
+
closable = _ref2$closable === void 0 ? true : _ref2$closable,
|
|
55
|
+
resP = _objectWithoutProperties(_ref2, _excluded);
|
|
56
|
+
var _useState = useState(0),
|
|
57
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
58
|
+
height = _useState2[0],
|
|
59
|
+
setHeight = _useState2[1];
|
|
60
|
+
var SIZE_MAP = {
|
|
61
|
+
small: "480",
|
|
62
|
+
middle: "660",
|
|
63
|
+
large: "920"
|
|
64
|
+
};
|
|
65
|
+
var headerHeight = useMemo(function () {
|
|
66
|
+
return title ? 52 : 0;
|
|
67
|
+
}, [title]);
|
|
68
|
+
var _bodyStyle = {
|
|
69
|
+
height: "calc(100% - ".concat(headerHeight, "px - ").concat(height, "px )"),
|
|
70
|
+
overflow: "auto"
|
|
71
|
+
};
|
|
72
|
+
var title_ = useMemo(function () {
|
|
73
|
+
if (title) {
|
|
74
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
75
|
+
className: "cw-drawer-header"
|
|
76
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
77
|
+
className: "cw-drawer-title"
|
|
78
|
+
}, title), /*#__PURE__*/React.createElement("div", {
|
|
79
|
+
className: classnames("cw-drawer-extra", {
|
|
80
|
+
"cw-drawer-extra-un-closable": !closable
|
|
81
|
+
})
|
|
82
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
83
|
+
className: "cw-drawer-extra-left"
|
|
84
|
+
}, extraLeft), /*#__PURE__*/React.createElement("div", {
|
|
85
|
+
className: "cw-drawer-extra-right"
|
|
86
|
+
}, extraRight)));
|
|
87
|
+
}
|
|
88
|
+
return null;
|
|
89
|
+
}, [title, extraLeft, extraRight]);
|
|
90
|
+
return /*#__PURE__*/React.createElement(_Drawer, _extends({
|
|
91
|
+
ref: ref,
|
|
92
|
+
visible: visible,
|
|
93
|
+
width: SIZE_MAP[size],
|
|
94
|
+
closable: closable,
|
|
95
|
+
bodyStyle: _objectSpread(_objectSpread({}, _bodyStyle), bodyStyle),
|
|
96
|
+
title: title_
|
|
97
|
+
}, resP), children, footer && /*#__PURE__*/React.createElement(DrawerFooter, {
|
|
98
|
+
footer: footer,
|
|
99
|
+
setHeight: setHeight
|
|
100
|
+
}));
|
|
101
|
+
});
|
|
102
|
+
CWDrawer.propTypes = {
|
|
103
|
+
/**
|
|
104
|
+
* 弹窗尺寸
|
|
105
|
+
*/
|
|
106
|
+
size: PropTypes.oneOf(["small", "middle", "large"]),
|
|
107
|
+
/**
|
|
108
|
+
* 抽屉左上角的操作区域(标题之后)
|
|
109
|
+
*/
|
|
110
|
+
extraLeft: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
111
|
+
/**
|
|
112
|
+
* 抽屉右上角的操作区域
|
|
113
|
+
*/
|
|
114
|
+
extraRight: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
115
|
+
/**
|
|
116
|
+
* 底部页脚
|
|
117
|
+
*/
|
|
118
|
+
footer: PropTypes.oneOfType([PropTypes.string, PropTypes.node])
|
|
119
|
+
};
|
|
120
|
+
export default CWDrawer;
|