linkmore-design 1.0.49 → 1.0.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Button/style/index.d.ts +1 -1
- package/dist/CardTable/fns/index.d.ts +9 -0
- package/dist/CardTable/hooks/usePagination.d.ts +19 -0
- package/dist/CardTable/toolbar/TablePagination.d.ts +4 -0
- package/dist/CardTable/toolbar/ToolBarBottom.d.ts +3 -0
- package/dist/List/demos/basic.d.ts +2 -0
- package/dist/List/index.d.ts +2 -0
- package/dist/List/style/index.d.ts +1 -0
- package/dist/LmEditTable/DndContainer.d.ts +5 -0
- package/dist/LmEditTable/DragHandle.d.ts +4 -0
- package/dist/LmEditTable/EditTable.d.ts +31 -0
- package/dist/LmEditTable/demos/Editbasic.d.ts +2 -0
- package/dist/LmEditTable/demos/basic.d.ts +2 -0
- package/dist/LmEditTable/demos/formEditTable.d.ts +2 -0
- package/dist/LmEditTable/demos/hoverEdit.d.ts +2 -0
- package/dist/LmEditTable/index.d.ts +2 -0
- package/dist/LmEditTable/sortableBox.d.ts +5 -0
- package/dist/LmEditTable/sortableItem.d.ts +2 -0
- package/dist/LmEditTable/style/index.d.ts +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.umd.js +3853 -689
- package/dist/index.umd.min.js +6 -6
- package/dist/message/hooks/useMessage.d.ts +7 -0
- package/dist/message/index.d.ts +63 -4
- package/es/Button/style/{style.css → index.css} +0 -0
- package/es/Button/style/index.d.ts +1 -1
- package/es/Button/style/index.js +1 -1
- package/es/ButtonTags/style/{style.css → index.css} +0 -0
- package/es/ButtonTags/style/index.js +1 -1
- package/es/CardTable/card/PictureTextColumn.js +11 -6
- package/es/CardTable/card/PictureTextRow.js +11 -6
- package/es/CardTable/fns/index.js +106 -0
- package/es/CardTable/hooks/usePagination.js +128 -0
- package/es/CardTable/index.js +3 -0
- package/{lib/CardTable/style/style.css → es/CardTable/style/index.css} +13 -1
- package/es/CardTable/style/index.js +1 -1
- package/es/CardTable/table/TableRoot.js +43 -64
- package/es/CardTable/table/TableWrapper.js +4 -0
- package/es/CardTable/toolbar/TablePagination.js +62 -0
- package/es/CardTable/toolbar/ToolBarBottom.js +47 -0
- 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/CustomTableOption/columnsSort.js +5 -5
- package/es/CustomTableOption/filterSort.js +3 -3
- package/es/CustomTableOption/index.js +1 -2
- package/es/CustomerService/style/{style.css → index.css} +0 -0
- package/es/CustomerService/style/index.js +1 -1
- package/es/EditTable/style/{style.css → index.css} +0 -0
- package/es/EditTable/style/index.js +1 -1
- package/es/EnlargeImg/style/{style.css → index.css} +0 -0
- package/es/EnlargeImg/style/index.js +1 -1
- package/es/Filter/style/{style.css → index.css} +0 -0
- package/es/Filter/style/index.js +1 -1
- package/es/IconSelect/style/{style.css → index.css} +0 -0
- package/es/IconSelect/style/index.js +1 -1
- package/{lib/Input/style/style.css → es/Input/style/index.css} +21 -1
- 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/List/index.d.ts +2 -0
- package/es/List/index.js +3 -0
- package/es/List/style/index.css +505 -0
- package/es/List/style/index.d.ts +1 -0
- package/es/List/style/index.js +1 -0
- package/es/LmEditTable/DndContainer.d.ts +5 -0
- package/es/LmEditTable/DndContainer.js +35 -0
- package/es/LmEditTable/DragHandle.d.ts +4 -0
- package/es/LmEditTable/DragHandle.js +22 -0
- package/es/LmEditTable/EditTable.d.ts +31 -0
- package/es/LmEditTable/EditTable.js +892 -0
- package/es/LmEditTable/index.d.ts +2 -0
- package/es/LmEditTable/index.js +2 -0
- package/es/LmEditTable/sortableBox.d.ts +5 -0
- package/es/LmEditTable/sortableBox.js +13 -0
- package/es/LmEditTable/sortableItem.d.ts +2 -0
- package/es/LmEditTable/sortableItem.js +43 -0
- package/es/LmEditTable/style/index.css +574 -0
- package/es/LmEditTable/style/index.d.ts +1 -0
- package/es/LmEditTable/style/index.js +1 -0
- package/es/LmTable/Table.js +16 -6
- package/{lib/LmTable/style/style.css → es/LmTable/style/index.css} +6 -0
- package/es/LmTable/style/index.js +1 -1
- package/es/OldModal/style/{style.css → index.css} +0 -0
- package/es/OldModal/style/index.js +1 -1
- package/es/PopTable/style/{style.css → index.css} +0 -0
- package/es/PopTable/style/index.js +1 -1
- package/es/ProTable/style/{style.css → index.css} +0 -0
- package/es/ProTable/style/index.js +1 -1
- package/es/Radio/style/{style.css → index.css} +0 -0
- package/es/Radio/style/index.js +1 -1
- package/es/Select/style/index.css +3 -0
- package/es/TableRender/style/{style.css → index.css} +0 -0
- package/es/TableRender/style/index.js +1 -1
- package/es/UploadOss/style/{style.css → index.css} +0 -0
- package/es/UploadOss/style/index.js +1 -1
- package/es/VirtualList/style/{style.css → index.css} +0 -0
- package/es/VirtualList/style/index.js +1 -1
- package/es/index.d.ts +2 -0
- package/es/index.js +3 -1
- package/es/message/hooks/useMessage.d.ts +7 -0
- package/es/message/hooks/useMessage.js +83 -0
- package/es/message/index.d.ts +63 -4
- package/es/message/index.js +241 -12
- package/es/message/style/index.css +27 -1
- package/lib/Button/style/{style.css → index.css} +0 -0
- package/lib/Button/style/index.d.ts +1 -1
- package/lib/Button/style/index.js +1 -1
- package/lib/ButtonTags/style/{style.css → index.css} +0 -0
- package/lib/ButtonTags/style/index.js +1 -1
- package/lib/CardTable/card/PictureTextColumn.js +11 -6
- package/lib/CardTable/card/PictureTextRow.js +11 -6
- package/lib/CardTable/fns/index.js +106 -0
- package/lib/CardTable/hooks/usePagination.js +128 -0
- package/lib/CardTable/index.js +3 -0
- package/{es/CardTable/style/style.css → lib/CardTable/style/index.css} +13 -1
- package/lib/CardTable/style/index.js +1 -1
- package/lib/CardTable/table/TableRoot.js +43 -64
- package/lib/CardTable/table/TableWrapper.js +4 -0
- package/lib/CardTable/toolbar/TablePagination.js +62 -0
- package/lib/CardTable/toolbar/ToolBarBottom.js +47 -0
- 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/CustomTableOption/columnsSort.js +5 -5
- package/lib/CustomTableOption/filterSort.js +3 -3
- package/lib/CustomTableOption/index.js +1 -2
- package/lib/CustomerService/style/{style.css → index.css} +0 -0
- package/lib/CustomerService/style/index.js +1 -1
- package/lib/EditTable/style/{style.css → index.css} +0 -0
- package/lib/EditTable/style/index.js +1 -1
- package/lib/EnlargeImg/style/{style.css → index.css} +0 -0
- package/lib/EnlargeImg/style/index.js +1 -1
- package/lib/Filter/style/{style.css → index.css} +0 -0
- package/lib/Filter/style/index.js +1 -1
- package/lib/IconSelect/style/{style.css → index.css} +0 -0
- package/lib/IconSelect/style/index.js +1 -1
- package/{es/Input/style/style.css → lib/Input/style/index.css} +21 -1
- 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/List/index.d.ts +2 -0
- package/lib/List/index.js +15 -0
- package/lib/List/style/index.css +505 -0
- package/lib/List/style/index.d.ts +1 -0
- package/lib/List/style/index.js +3 -0
- package/lib/LmEditTable/DndContainer.d.ts +5 -0
- package/lib/LmEditTable/DndContainer.js +49 -0
- package/lib/LmEditTable/DragHandle.d.ts +4 -0
- package/lib/LmEditTable/DragHandle.js +37 -0
- package/lib/LmEditTable/EditTable.d.ts +31 -0
- package/lib/LmEditTable/EditTable.js +925 -0
- package/lib/LmEditTable/index.d.ts +2 -0
- package/lib/LmEditTable/index.js +13 -0
- package/lib/LmEditTable/sortableBox.d.ts +5 -0
- package/lib/LmEditTable/sortableBox.js +24 -0
- package/lib/LmEditTable/sortableItem.d.ts +2 -0
- package/lib/LmEditTable/sortableItem.js +55 -0
- package/lib/LmEditTable/style/index.css +574 -0
- package/lib/LmEditTable/style/index.d.ts +1 -0
- package/lib/LmEditTable/style/index.js +3 -0
- package/lib/LmTable/Table.js +16 -6
- package/{es/LmTable/style/style.css → lib/LmTable/style/index.css} +6 -0
- package/lib/LmTable/style/index.js +1 -1
- package/lib/OldModal/style/{style.css → index.css} +0 -0
- package/lib/OldModal/style/index.js +1 -1
- package/lib/PopTable/style/{style.css → index.css} +0 -0
- package/lib/PopTable/style/index.js +1 -1
- package/lib/ProTable/style/{style.css → index.css} +0 -0
- package/lib/ProTable/style/index.js +1 -1
- package/lib/Radio/style/{style.css → index.css} +0 -0
- package/lib/Radio/style/index.js +1 -1
- package/lib/Select/style/index.css +3 -0
- package/lib/TableRender/style/{style.css → index.css} +0 -0
- package/lib/TableRender/style/index.js +1 -1
- package/lib/UploadOss/style/{style.css → index.css} +0 -0
- package/lib/UploadOss/style/index.js +1 -1
- package/lib/VirtualList/style/{style.css → index.css} +0 -0
- package/lib/VirtualList/style/index.js +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +17 -1
- package/lib/message/hooks/useMessage.d.ts +7 -0
- package/lib/message/hooks/useMessage.js +101 -0
- package/lib/message/index.d.ts +63 -4
- package/lib/message/index.js +262 -16
- package/lib/message/style/index.css +27 -1
- package/package.json +2 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,18 +1,39 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('antd/es/button/style'), require('antd/es/button'), require('react'), require('antd/es/card/style'), require('antd/es/card'), require('antd/es/cascader/style'), require('antd/es/cascader'), require('antd/es/checkbox/style'), require('antd/es/checkbox'), require('antd/es/date-picker/style'), require('antd/es/date-picker'), require('react-dom'), require('antd/es/drawer/style'), require('antd/es/drawer'), require('antd/es/space/style'), require('antd/es/space'), require('antd/es/tag/style'), require('antd/es/tag'), require('antd/es/form/style'), require('antd/es/form'), require('antd/es/input/style'), require('antd/es/input'), require('antd/es/dropdown/style'), require('antd/es/dropdown'), require('antd/es/table/style'), require('antd/es/table'), require('antd/es/radio/style'), require('antd/es/radio'), require('antd/es/select/style'), require('antd/es/select'), require('antd/es/input-number/style'), require('antd/es/input-number'), require('antd/es/spin/style'), require('antd/es/spin'), require('antd/es/message/style'), require('antd/es/message'), require('antd/es/image/style'), require('antd/es/image'), require('antd/es/empty/style'), require('antd/es/empty'), require('antd/es/modal/style'), require('antd/es/modal'), require('antd/es/row/style'), require('antd/es/row'), require('antd/es/col/style'), require('antd/es/col'), require('antd/es/divider/style'), require('antd/es/divider'), require('antd/es/list/style'), require('antd/es/list'), require('antd/es/popover/style'), require('antd/es/popover'), require('antd/es/tree/style'), require('antd/es/tree'), require('antd/es/time-picker/style'), require('antd/es/time-picker'), require('antd/es/config-provider/style'), require('antd/es/config-provider'), require('antd/es/avatar/style'), require('antd/es/avatar'), require('react/jsx-runtime'), require('antd/es/locale/zh_CN'), require('antd/es/result/style'), require('antd/es/result'), require('antd/es/tooltip/style'), require('antd/es/tooltip'), require('antd/es/typography/style'), require('antd/es/typography'), require('antd/es/popconfirm/style'), require('antd/es/popconfirm'), require('antd/es/table/hooks/useLazyKVMap'), require('antd/es/badge/style'), require('antd/es/badge'), require('antd/es/progress/style'), require('antd/es/progress'), require('antd/es/rate/style'), require('antd/es/rate'), require('antd/es/switch/style'), require('antd/es/switch'), require('antd/es/tree-select/style'), require('antd/es/tree-select'), require('antd/es/tabs/style'), require('antd/es/tabs'), require('antd/es/grid/style'), require('antd/es/grid'), require('antd/es/steps/style'), require('antd/es/steps'), require('antd/es/upload/style'), require('antd/es/upload'), require('antd/es/alert/style'), require('antd/es/alert'), require('antd/es/menu/style'), require('antd/es/menu'), require('antd/es/notification/style'), require('antd/es/notification'), require('antd/es/pagination/style'), require('antd/es/pagination'), require('antd/lib/form/hooks/useFormInstance'), require('antd/lib/form/context'), require('antd/lib/form/Form')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define(['exports', 'antd/es/button/style', 'antd/es/button', 'react', 'antd/es/card/style', 'antd/es/card', 'antd/es/cascader/style', 'antd/es/cascader', 'antd/es/checkbox/style', 'antd/es/checkbox', 'antd/es/date-picker/style', 'antd/es/date-picker', 'react-dom', 'antd/es/drawer/style', 'antd/es/drawer', 'antd/es/space/style', 'antd/es/space', 'antd/es/tag/style', 'antd/es/tag', 'antd/es/form/style', 'antd/es/form', 'antd/es/input/style', 'antd/es/input', 'antd/es/dropdown/style', 'antd/es/dropdown', 'antd/es/table/style', 'antd/es/table', 'antd/es/radio/style', 'antd/es/radio', 'antd/es/select/style', 'antd/es/select', 'antd/es/input-number/style', 'antd/es/input-number', 'antd/es/spin/style', 'antd/es/spin', 'antd/es/message/style', 'antd/es/message', 'antd/es/image/style', 'antd/es/image', 'antd/es/empty/style', 'antd/es/empty', 'antd/es/modal/style', 'antd/es/modal', 'antd/es/row/style', 'antd/es/row', 'antd/es/col/style', 'antd/es/col', 'antd/es/divider/style', 'antd/es/divider', 'antd/es/list/style', 'antd/es/list', 'antd/es/popover/style', 'antd/es/popover', 'antd/es/tree/style', 'antd/es/tree', 'antd/es/time-picker/style', 'antd/es/time-picker', 'antd/es/config-provider/style', 'antd/es/config-provider', 'antd/es/avatar/style', 'antd/es/avatar', 'react/jsx-runtime', 'antd/es/locale/zh_CN', 'antd/es/result/style', 'antd/es/result', 'antd/es/tooltip/style', 'antd/es/tooltip', 'antd/es/typography/style', 'antd/es/typography', 'antd/es/popconfirm/style', 'antd/es/popconfirm', 'antd/es/table/hooks/useLazyKVMap', 'antd/es/badge/style', 'antd/es/badge', 'antd/es/progress/style', 'antd/es/progress', 'antd/es/rate/style', 'antd/es/rate', 'antd/es/switch/style', 'antd/es/switch', 'antd/es/tree-select/style', 'antd/es/tree-select', 'antd/es/tabs/style', 'antd/es/tabs', 'antd/es/grid/style', 'antd/es/grid', 'antd/es/steps/style', 'antd/es/steps', 'antd/es/upload/style', 'antd/es/upload', 'antd/es/alert/style', 'antd/es/alert', 'antd/es/menu/style', 'antd/es/menu', 'antd/es/notification/style', 'antd/es/notification', 'antd/es/pagination/style', 'antd/es/pagination', 'antd/lib/form/hooks/useFormInstance', 'antd/lib/form/context', 'antd/lib/form/Form'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.linkmoreDesign = {}, null, global._Button, global.React, null, global._Card, null, global._Cascader, null, global._Checkbox, null, global._DatePicker, global.
|
|
5
|
-
}(this, (function (exports, style, _Button, React, style$
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.linkmoreDesign = {}, null, global._Button, global.React, null, global._Card, null, global._Cascader, null, global._Checkbox, null, global._DatePicker, global.ReactDOM, null, global._Drawer, null, global._Space, null, global._Tag, null, global._Form, null, global._Input, null, global._Dropdown, null, global._Table, null, global._Radio, null, global._Select, null, global._InputNumber, null, global._Spin, null, global._message, null, global._Image, null, global._Empty, null, global._Modal, null, global._Row, null, global._Col, null, global._Divider, null, global._List, null, global._Popover, null, global._Tree, null, global._TimePicker, null, global._ConfigProvider, null, global._Avatar, global.jsxRuntime, global.zh_CN, null, global._Result, null, global._Tooltip, null, global._Typography, null, global._Popconfirm, global.useLazyKVMap, null, global._Badge, null, global._Progress, null, global._Rate, null, global._Switch, null, global._TreeSelect, null, global._Tabs, null, global._Grid, null, global._Steps, null, global._Upload, null, global._Alert, null, global._Menu, null, global._notification, null, global._Pagination, global.useFormInstance, global.context$2, global.Form$2));
|
|
5
|
+
}(this, (function (exports, style$1, _Button, React, style$2, _Card, style$3, _Cascader, style$4, _Checkbox, style$5, _DatePicker, ReactDOM, style$6, _Drawer, style$7, _Space, style$8, _Tag, style$9, _Form, style$a, _Input, style$b, _Dropdown, style$c, _Table, style$d, _Radio, style$e, _Select, style$f, _InputNumber, style$g, _Spin, style$h, _message, style$i, _Image, style$j, _Empty, style$k, _Modal, style$l, _Row, style$m, _Col, style$n, _Divider, style$o, _List, style$p, _Popover, style$q, _Tree, style$r, _TimePicker, style$s, _ConfigProvider, style$t, _Avatar, jsxRuntime, zh_CN, style$u, _Result, style$v, _Tooltip, style$w, _Typography, style$x, _Popconfirm, useLazyKVMap, style$y, _Badge, style$z, _Progress, style$A, _Rate, style$B, _Switch, style$C, _TreeSelect, style$D, _Tabs, style$E, _Grid, style$F, _Steps, style$G, _Upload, style$H, _Alert, style$I, _Menu, style$J, _notification, style$K, _Pagination, useFormInstance, context$2, Form$2) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
9
|
+
function _interopNamespace(e) {
|
|
10
|
+
if (e && e.__esModule) return e;
|
|
11
|
+
var n = Object.create(null);
|
|
12
|
+
if (e) {
|
|
13
|
+
Object.keys(e).forEach(function (k) {
|
|
14
|
+
if (k !== 'default') {
|
|
15
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () {
|
|
19
|
+
return e[k];
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
n['default'] = e;
|
|
26
|
+
return Object.freeze(n);
|
|
27
|
+
}
|
|
28
|
+
|
|
9
29
|
var _Button__default = /*#__PURE__*/_interopDefaultLegacy(_Button);
|
|
10
30
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
11
31
|
var _Card__default = /*#__PURE__*/_interopDefaultLegacy(_Card);
|
|
12
32
|
var _Cascader__default = /*#__PURE__*/_interopDefaultLegacy(_Cascader);
|
|
13
33
|
var _Checkbox__default = /*#__PURE__*/_interopDefaultLegacy(_Checkbox);
|
|
14
34
|
var _DatePicker__default = /*#__PURE__*/_interopDefaultLegacy(_DatePicker);
|
|
15
|
-
var
|
|
35
|
+
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
36
|
+
var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
|
|
16
37
|
var _Drawer__default = /*#__PURE__*/_interopDefaultLegacy(_Drawer);
|
|
17
38
|
var _Space__default = /*#__PURE__*/_interopDefaultLegacy(_Space);
|
|
18
39
|
var _Tag__default = /*#__PURE__*/_interopDefaultLegacy(_Tag);
|
|
@@ -2017,6 +2038,19 @@
|
|
|
2017
2038
|
ClockCircleFilled$1.displayName = 'ClockCircleFilled';
|
|
2018
2039
|
var ClockCircleFilled$2 = /*#__PURE__*/React.forwardRef(ClockCircleFilled$1);
|
|
2019
2040
|
|
|
2041
|
+
// This icon file is generated automatically.
|
|
2042
|
+
var CloseCircleFilled = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z" } }] }, "name": "close-circle", "theme": "filled" };
|
|
2043
|
+
|
|
2044
|
+
var CloseCircleFilled$1 = function CloseCircleFilled$1(props, ref) {
|
|
2045
|
+
return /*#__PURE__*/React.createElement(Icon, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
2046
|
+
ref: ref,
|
|
2047
|
+
icon: CloseCircleFilled
|
|
2048
|
+
}));
|
|
2049
|
+
};
|
|
2050
|
+
|
|
2051
|
+
CloseCircleFilled$1.displayName = 'CloseCircleFilled';
|
|
2052
|
+
var CloseCircleFilled$2 = /*#__PURE__*/React.forwardRef(CloseCircleFilled$1);
|
|
2053
|
+
|
|
2020
2054
|
// This icon file is generated automatically.
|
|
2021
2055
|
var CloseOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z" } }] }, "name": "close", "theme": "outlined" };
|
|
2022
2056
|
|
|
@@ -2108,6 +2142,19 @@
|
|
|
2108
2142
|
EllipsisOutlined$1.displayName = 'EllipsisOutlined';
|
|
2109
2143
|
var EllipsisOutlined$2 = /*#__PURE__*/React.forwardRef(EllipsisOutlined$1);
|
|
2110
2144
|
|
|
2145
|
+
// This icon file is generated automatically.
|
|
2146
|
+
var ExclamationCircleFilled = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, "name": "exclamation-circle", "theme": "filled" };
|
|
2147
|
+
|
|
2148
|
+
var ExclamationCircleFilled$1 = function ExclamationCircleFilled$1(props, ref) {
|
|
2149
|
+
return /*#__PURE__*/React.createElement(Icon, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
2150
|
+
ref: ref,
|
|
2151
|
+
icon: ExclamationCircleFilled
|
|
2152
|
+
}));
|
|
2153
|
+
};
|
|
2154
|
+
|
|
2155
|
+
ExclamationCircleFilled$1.displayName = 'ExclamationCircleFilled';
|
|
2156
|
+
var ExclamationCircleFilled$2 = /*#__PURE__*/React.forwardRef(ExclamationCircleFilled$1);
|
|
2157
|
+
|
|
2111
2158
|
// This icon file is generated automatically.
|
|
2112
2159
|
var ExportOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M888.3 757.4h-53.8c-4.2 0-7.7 3.5-7.7 7.7v61.8H197.1V197.1h629.8v61.8c0 4.2 3.5 7.7 7.7 7.7h53.8c4.2 0 7.7-3.4 7.7-7.7V158.7c0-17-13.7-30.7-30.7-30.7H158.7c-17 0-30.7 13.7-30.7 30.7v706.6c0 17 13.7 30.7 30.7 30.7h706.6c17 0 30.7-13.7 30.7-30.7V765.1c0-4.3-3.5-7.7-7.7-7.7zm18.6-251.7L765 393.7c-5.3-4.2-13-.4-13 6.3v76H438c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h314v76c0 6.7 7.8 10.5 13 6.3l141.9-112a8 8 0 000-12.6z" } }] }, "name": "export", "theme": "outlined" };
|
|
2113
2160
|
|
|
@@ -2199,6 +2246,19 @@
|
|
|
2199
2246
|
HolderOutlined$1.displayName = 'HolderOutlined';
|
|
2200
2247
|
var HolderOutlined$2 = /*#__PURE__*/React.forwardRef(HolderOutlined$1);
|
|
2201
2248
|
|
|
2249
|
+
// This icon file is generated automatically.
|
|
2250
|
+
var InfoCircleFilled = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, "name": "info-circle", "theme": "filled" };
|
|
2251
|
+
|
|
2252
|
+
var InfoCircleFilled$1 = function InfoCircleFilled$1(props, ref) {
|
|
2253
|
+
return /*#__PURE__*/React.createElement(Icon, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
2254
|
+
ref: ref,
|
|
2255
|
+
icon: InfoCircleFilled
|
|
2256
|
+
}));
|
|
2257
|
+
};
|
|
2258
|
+
|
|
2259
|
+
InfoCircleFilled$1.displayName = 'InfoCircleFilled';
|
|
2260
|
+
var InfoCircleFilled$2 = /*#__PURE__*/React.forwardRef(InfoCircleFilled$1);
|
|
2261
|
+
|
|
2202
2262
|
// This icon file is generated automatically.
|
|
2203
2263
|
var InfoCircleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { "tag": "path", "attrs": { "d": "M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z" } }] }, "name": "info-circle", "theme": "outlined" };
|
|
2204
2264
|
|
|
@@ -26766,7 +26826,7 @@
|
|
|
26766
26826
|
}
|
|
26767
26827
|
|
|
26768
26828
|
}), [announce, announcements]));
|
|
26769
|
-
return mounted ?
|
|
26829
|
+
return mounted ? ReactDOM.createPortal(React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(HiddenText, {
|
|
26770
26830
|
id: hiddenTextDescribedById,
|
|
26771
26831
|
value: screenReaderInstructions.draggable
|
|
26772
26832
|
}), React__default['default'].createElement(LiveRegion, {
|
|
@@ -28708,7 +28768,7 @@
|
|
|
28708
28768
|
rect: activeRects
|
|
28709
28769
|
}
|
|
28710
28770
|
};
|
|
28711
|
-
|
|
28771
|
+
ReactDOM.unstable_batchedUpdates(() => {
|
|
28712
28772
|
dispatch({
|
|
28713
28773
|
type: Action.DragStart,
|
|
28714
28774
|
initialCoordinates,
|
|
@@ -28732,7 +28792,7 @@
|
|
|
28732
28792
|
onEnd: createHandler(Action.DragEnd),
|
|
28733
28793
|
onCancel: createHandler(Action.DragCancel)
|
|
28734
28794
|
});
|
|
28735
|
-
|
|
28795
|
+
ReactDOM.unstable_batchedUpdates(() => {
|
|
28736
28796
|
setActiveSensor(sensorInstance);
|
|
28737
28797
|
setActivatorEvent(event.nativeEvent);
|
|
28738
28798
|
});
|
|
@@ -28768,7 +28828,7 @@
|
|
|
28768
28828
|
}
|
|
28769
28829
|
|
|
28770
28830
|
activeRef.current = null;
|
|
28771
|
-
|
|
28831
|
+
ReactDOM.unstable_batchedUpdates(() => {
|
|
28772
28832
|
dispatch({
|
|
28773
28833
|
type
|
|
28774
28834
|
});
|
|
@@ -28893,7 +28953,7 @@
|
|
|
28893
28953
|
},
|
|
28894
28954
|
over
|
|
28895
28955
|
};
|
|
28896
|
-
|
|
28956
|
+
ReactDOM.unstable_batchedUpdates(() => {
|
|
28897
28957
|
setOver(over);
|
|
28898
28958
|
setMonitorState({
|
|
28899
28959
|
type: Action.DragOver,
|
|
@@ -58398,7 +58458,7 @@
|
|
|
58398
58458
|
_createClass(WithSortableHandle, [{
|
|
58399
58459
|
key: "componentDidMount",
|
|
58400
58460
|
value: function componentDidMount() {
|
|
58401
|
-
var node =
|
|
58461
|
+
var node = ReactDOM.findDOMNode(this);
|
|
58402
58462
|
node.sortableHandle = true;
|
|
58403
58463
|
}
|
|
58404
58464
|
}, {
|
|
@@ -59458,7 +59518,7 @@
|
|
|
59458
59518
|
var getContainer = this.props.getContainer;
|
|
59459
59519
|
|
|
59460
59520
|
if (typeof getContainer !== 'function') {
|
|
59461
|
-
return
|
|
59521
|
+
return ReactDOM.findDOMNode(this);
|
|
59462
59522
|
}
|
|
59463
59523
|
|
|
59464
59524
|
return getContainer(config.withRef ? this.getWrappedInstance() : undefined);
|
|
@@ -59583,7 +59643,7 @@
|
|
|
59583
59643
|
collection = _this$props.collection,
|
|
59584
59644
|
disabled = _this$props.disabled,
|
|
59585
59645
|
index = _this$props.index;
|
|
59586
|
-
var node =
|
|
59646
|
+
var node = ReactDOM.findDOMNode(this);
|
|
59587
59647
|
node.sortableInfo = {
|
|
59588
59648
|
collection: collection,
|
|
59589
59649
|
disabled: disabled,
|
|
@@ -68012,7 +68072,7 @@
|
|
|
68012
68072
|
}, [(_context$locale3 = context.locale) === null || _context$locale3 === void 0 ? void 0 : (_context$locale3$Moda = _context$locale3.Modal) === null || _context$locale3$Moda === void 0 ? void 0 : _context$locale3$Moda.cancelText, (_context$locale4 = context.locale) === null || _context$locale4 === void 0 ? void 0 : (_context$locale4$Moda = _context$locale4.Modal) === null || _context$locale4$Moda === void 0 ? void 0 : _context$locale4$Moda.okText, drawerProps, rest.submitter, setVisible, loading, submitTimeout]);
|
|
68013
68073
|
var contentRender = React.useCallback(function (formDom, submitter) {
|
|
68014
68074
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
68015
|
-
children: [formDom, footerRef.current && submitter ? /*#__PURE__*/
|
|
68075
|
+
children: [formDom, footerRef.current && submitter ? /*#__PURE__*/ReactDOM.createPortal(submitter, footerRef.current) : submitter]
|
|
68016
68076
|
});
|
|
68017
68077
|
}, []);
|
|
68018
68078
|
var onFinishHandle = useRefFunction( /*#__PURE__*/function () {
|
|
@@ -68487,7 +68547,7 @@
|
|
|
68487
68547
|
}, [(_context$locale3 = context.locale) === null || _context$locale3 === void 0 ? void 0 : (_context$locale3$Moda = _context$locale3.Modal) === null || _context$locale3$Moda === void 0 ? void 0 : _context$locale3$Moda.cancelText, (_context$locale4 = context.locale) === null || _context$locale4 === void 0 ? void 0 : (_context$locale4$Moda = _context$locale4.Modal) === null || _context$locale4$Moda === void 0 ? void 0 : _context$locale4$Moda.okText, modalProps, rest.submitter, setVisible, loading, submitTimeout]);
|
|
68488
68548
|
var contentRender = React.useCallback(function (formDom, submitter) {
|
|
68489
68549
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
68490
|
-
children: [formDom, footerRef.current && submitter ? /*#__PURE__*/
|
|
68550
|
+
children: [formDom, footerRef.current && submitter ? /*#__PURE__*/ReactDOM.createPortal(submitter, footerRef.current) : submitter]
|
|
68491
68551
|
});
|
|
68492
68552
|
}, []);
|
|
68493
68553
|
var onFinishHandle = React.useCallback( /*#__PURE__*/function () {
|
|
@@ -68662,7 +68722,7 @@
|
|
|
68662
68722
|
return node;
|
|
68663
68723
|
}
|
|
68664
68724
|
|
|
68665
|
-
return
|
|
68725
|
+
return ReactDOM__default['default'].findDOMNode(node);
|
|
68666
68726
|
}
|
|
68667
68727
|
|
|
68668
68728
|
/**
|
|
@@ -76605,7 +76665,7 @@
|
|
|
76605
76665
|
|
|
76606
76666
|
var _propTypes = _interopRequireDefault(propTypes);
|
|
76607
76667
|
|
|
76608
|
-
var _reactDom = _interopRequireDefault(
|
|
76668
|
+
var _reactDom = _interopRequireDefault(ReactDOM__default['default']);
|
|
76609
76669
|
|
|
76610
76670
|
|
|
76611
76671
|
|
|
@@ -77184,7 +77244,7 @@
|
|
|
77184
77244
|
|
|
77185
77245
|
var _propTypes = _interopRequireDefault(propTypes);
|
|
77186
77246
|
|
|
77187
|
-
var _reactDom = _interopRequireDefault(
|
|
77247
|
+
var _reactDom = _interopRequireDefault(ReactDOM__default['default']);
|
|
77188
77248
|
|
|
77189
77249
|
var _clsx2 = _interopRequireDefault(require$$3);
|
|
77190
77250
|
|
|
@@ -78243,7 +78303,7 @@
|
|
|
78243
78303
|
editConfig: editConfig
|
|
78244
78304
|
};
|
|
78245
78305
|
|
|
78246
|
-
var _excluded$$ = ["dataSource", "autoSize", "columns", "rowClick", "onDoubleClick", "checkConfig", "summary", "pagination", "hiddenPage", "loading", "virtual", "sortOpen", "resizeable", "customCheck", "rowSelection", "columnsState", "onChange", "filterChange", "tableRowType", "size"],
|
|
78306
|
+
var _excluded$$ = ["dataSource", "autoSize", "columns", "rowClick", "onDoubleClick", "checkConfig", "summary", "pagination", "hiddenPage", "loading", "virtual", "sortOpen", "resizeable", "customCheck", "components", "rowSelection", "columnsState", "onChange", "filterChange", "tableRowType", "size"],
|
|
78247
78307
|
_excluded2$h = ["className", "style"],
|
|
78248
78308
|
_excluded3$4 = ["onResize", "width", "onResizeStop"];
|
|
78249
78309
|
var Summary = ProviderWarp.Summary;
|
|
@@ -78281,6 +78341,7 @@
|
|
|
78281
78341
|
_props$resizeable = props.resizeable,
|
|
78282
78342
|
resizeable = _props$resizeable === void 0 ? false : _props$resizeable,
|
|
78283
78343
|
customCheck = props.customCheck,
|
|
78344
|
+
components = props.components,
|
|
78284
78345
|
rowSelection = props.rowSelection,
|
|
78285
78346
|
columnsState = props.columnsState,
|
|
78286
78347
|
onChange = props.onChange,
|
|
@@ -78354,7 +78415,6 @@
|
|
|
78354
78415
|
var index = dataSource.findIndex(function (x) {
|
|
78355
78416
|
return x[rowKey || 'index'] === restProps['data-row-key'];
|
|
78356
78417
|
});
|
|
78357
|
-
console.log(dataSource, restProps, 222, index);
|
|
78358
78418
|
return /*#__PURE__*/React__default['default'].createElement(SortableItem, _extends({
|
|
78359
78419
|
index: index
|
|
78360
78420
|
}, restProps));
|
|
@@ -78430,8 +78490,6 @@
|
|
|
78430
78490
|
trigger = _Object$assign.trigger,
|
|
78431
78491
|
highlight = _Object$assign.highlight;
|
|
78432
78492
|
|
|
78433
|
-
console.log(trigger, highlight, 'rowclick');
|
|
78434
|
-
|
|
78435
78493
|
if (highlight) {
|
|
78436
78494
|
setActiveKey(record[rowKey]);
|
|
78437
78495
|
}
|
|
@@ -78610,7 +78668,10 @@
|
|
|
78610
78668
|
});
|
|
78611
78669
|
rowClick === null || rowClick === void 0 ? void 0 : rowClick(value);
|
|
78612
78670
|
},
|
|
78613
|
-
checkboxRecords: useSelectedRows.selectedRows
|
|
78671
|
+
checkboxRecords: useSelectedRows.selectedRows,
|
|
78672
|
+
columns: useColumns.map(function (item) {
|
|
78673
|
+
return lodash.omit(item, ['render', 'sorter', 'onFilter', 'filters']);
|
|
78674
|
+
})
|
|
78614
78675
|
};
|
|
78615
78676
|
}); // loading触发清空选中状态
|
|
78616
78677
|
|
|
@@ -78693,8 +78754,17 @@
|
|
|
78693
78754
|
};
|
|
78694
78755
|
}
|
|
78695
78756
|
|
|
78757
|
+
if (components) {
|
|
78758
|
+
var _components$body = components.body,
|
|
78759
|
+
body = _components$body === void 0 ? {} : _components$body,
|
|
78760
|
+
_components$header = components.header,
|
|
78761
|
+
header = _components$header === void 0 ? {} : _components$header;
|
|
78762
|
+
obj['body'] = _objectSpread(_objectSpread({}, obj['body']), body);
|
|
78763
|
+
obj['header'] = _objectSpread(_objectSpread({}, obj['header']), header);
|
|
78764
|
+
}
|
|
78765
|
+
|
|
78696
78766
|
return obj;
|
|
78697
|
-
}, [sortOpen, resizeable]);
|
|
78767
|
+
}, [sortOpen, resizeable, components]);
|
|
78698
78768
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
78699
78769
|
style: {
|
|
78700
78770
|
height: '100%',
|
|
@@ -84045,786 +84115,3878 @@
|
|
|
84045
84115
|
});
|
|
84046
84116
|
LmTag.CheckableTag = _Tag__default['default'].CheckableTag;
|
|
84047
84117
|
|
|
84048
|
-
var
|
|
84049
|
-
var prefixCls$a = 'lm_tabs';
|
|
84118
|
+
var fullClone = _objectSpread2({}, ReactDOM__namespace);
|
|
84050
84119
|
|
|
84051
|
-
var
|
|
84052
|
-
|
|
84053
|
-
|
|
84054
|
-
|
|
84055
|
-
_props$noBorder = props.noBorder,
|
|
84056
|
-
noBorder = _props$noBorder === void 0 ? false : _props$noBorder,
|
|
84057
|
-
others = _objectWithoutProperties(props, _excluded$1m);
|
|
84120
|
+
var version = fullClone.version,
|
|
84121
|
+
reactRender = fullClone.render,
|
|
84122
|
+
unmountComponentAtNode = fullClone.unmountComponentAtNode;
|
|
84123
|
+
var createRoot;
|
|
84058
84124
|
|
|
84059
|
-
|
|
84060
|
-
|
|
84061
|
-
|
|
84062
|
-
|
|
84125
|
+
try {
|
|
84126
|
+
var mainVersion = Number((version || '').split('.')[0]);
|
|
84127
|
+
|
|
84128
|
+
if (mainVersion >= 18) {
|
|
84129
|
+
createRoot = fullClone.createRoot;
|
|
84130
|
+
}
|
|
84131
|
+
} catch (e) {// Do nothing;
|
|
84132
|
+
}
|
|
84133
|
+
|
|
84134
|
+
function toggleWarning(skip) {
|
|
84135
|
+
var __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = fullClone.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
84136
|
+
|
|
84137
|
+
if (__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED && _typeof$1(__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === 'object') {
|
|
84138
|
+
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.usingClientEntryPoint = skip;
|
|
84139
|
+
}
|
|
84140
|
+
}
|
|
84141
|
+
|
|
84142
|
+
var MARK = '__rc_react_root__';
|
|
84143
|
+
|
|
84144
|
+
function modernRender(node, container) {
|
|
84145
|
+
toggleWarning(true);
|
|
84146
|
+
var root = container[MARK] || createRoot(container);
|
|
84147
|
+
toggleWarning(false);
|
|
84148
|
+
root.render(node);
|
|
84149
|
+
container[MARK] = root;
|
|
84150
|
+
}
|
|
84151
|
+
|
|
84152
|
+
function legacyRender(node, container) {
|
|
84153
|
+
reactRender(node, container);
|
|
84154
|
+
}
|
|
84155
|
+
function render$3(node, container) {
|
|
84156
|
+
if (createRoot) {
|
|
84157
|
+
modernRender(node, container);
|
|
84158
|
+
return;
|
|
84159
|
+
}
|
|
84160
|
+
|
|
84161
|
+
legacyRender(node, container);
|
|
84162
|
+
} // ========================= Unmount ==========================
|
|
84163
|
+
|
|
84164
|
+
function modernUnmount(_x) {
|
|
84165
|
+
return _modernUnmount.apply(this, arguments);
|
|
84166
|
+
}
|
|
84167
|
+
|
|
84168
|
+
function _modernUnmount() {
|
|
84169
|
+
_modernUnmount = _asyncToGenerator$1( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(container) {
|
|
84170
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
84171
|
+
while (1) {
|
|
84172
|
+
switch (_context.prev = _context.next) {
|
|
84173
|
+
case 0:
|
|
84174
|
+
return _context.abrupt("return", Promise.resolve().then(function () {
|
|
84175
|
+
var _container$MARK;
|
|
84176
|
+
|
|
84177
|
+
(_container$MARK = container[MARK]) === null || _container$MARK === void 0 ? void 0 : _container$MARK.unmount();
|
|
84178
|
+
delete container[MARK];
|
|
84179
|
+
}));
|
|
84180
|
+
|
|
84181
|
+
case 1:
|
|
84182
|
+
case "end":
|
|
84183
|
+
return _context.stop();
|
|
84184
|
+
}
|
|
84185
|
+
}
|
|
84186
|
+
}, _callee);
|
|
84063
84187
|
}));
|
|
84064
|
-
|
|
84188
|
+
return _modernUnmount.apply(this, arguments);
|
|
84189
|
+
}
|
|
84065
84190
|
|
|
84066
|
-
|
|
84191
|
+
function legacyUnmount(container) {
|
|
84192
|
+
unmountComponentAtNode(container);
|
|
84193
|
+
}
|
|
84194
|
+
function unmount(_x2) {
|
|
84195
|
+
return _unmount.apply(this, arguments);
|
|
84196
|
+
}
|
|
84067
84197
|
|
|
84068
|
-
|
|
84198
|
+
function _unmount() {
|
|
84199
|
+
_unmount = _asyncToGenerator$1( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(container) {
|
|
84200
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
84201
|
+
while (1) {
|
|
84202
|
+
switch (_context2.prev = _context2.next) {
|
|
84203
|
+
case 0:
|
|
84204
|
+
if (!(createRoot !== undefined)) {
|
|
84205
|
+
_context2.next = 2;
|
|
84206
|
+
break;
|
|
84207
|
+
}
|
|
84069
84208
|
|
|
84070
|
-
|
|
84071
|
-
var _props$item, _props$item2, _props$item3, _props$item4;
|
|
84209
|
+
return _context2.abrupt("return", modernUnmount(container));
|
|
84072
84210
|
|
|
84073
|
-
|
|
84074
|
-
|
|
84075
|
-
}),
|
|
84076
|
-
attributes = _useSortable.attributes,
|
|
84077
|
-
listeners = _useSortable.listeners,
|
|
84078
|
-
setNodeRef = _useSortable.setNodeRef,
|
|
84079
|
-
transform = _useSortable.transform,
|
|
84080
|
-
transition = _useSortable.transition;
|
|
84211
|
+
case 2:
|
|
84212
|
+
legacyUnmount(container);
|
|
84081
84213
|
|
|
84082
|
-
|
|
84083
|
-
|
|
84084
|
-
|
|
84214
|
+
case 3:
|
|
84215
|
+
case "end":
|
|
84216
|
+
return _context2.stop();
|
|
84217
|
+
}
|
|
84218
|
+
}
|
|
84219
|
+
}, _callee2);
|
|
84220
|
+
}));
|
|
84221
|
+
return _unmount.apply(this, arguments);
|
|
84222
|
+
}
|
|
84223
|
+
|
|
84224
|
+
// Event wrapper. Copy from react source code
|
|
84225
|
+
|
|
84226
|
+
function makePrefixMap(styleProp, eventName) {
|
|
84227
|
+
var prefixes = {};
|
|
84228
|
+
prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
|
|
84229
|
+
prefixes["Webkit".concat(styleProp)] = "webkit".concat(eventName);
|
|
84230
|
+
prefixes["Moz".concat(styleProp)] = "moz".concat(eventName);
|
|
84231
|
+
prefixes["ms".concat(styleProp)] = "MS".concat(eventName);
|
|
84232
|
+
prefixes["O".concat(styleProp)] = "o".concat(eventName.toLowerCase());
|
|
84233
|
+
return prefixes;
|
|
84234
|
+
}
|
|
84235
|
+
|
|
84236
|
+
function getVendorPrefixes(domSupport, win) {
|
|
84237
|
+
var prefixes = {
|
|
84238
|
+
animationend: makePrefixMap('Animation', 'AnimationEnd'),
|
|
84239
|
+
transitionend: makePrefixMap('Transition', 'TransitionEnd')
|
|
84085
84240
|
};
|
|
84086
|
-
|
|
84087
|
-
|
|
84088
|
-
|
|
84089
|
-
|
|
84090
|
-
}, attributes), /*#__PURE__*/React__default['default'].createElement(LMCheckBox, {
|
|
84091
|
-
checked: ((_props$item = props.item) === null || _props$item === void 0 ? void 0 : _props$item.show) === false ? false : true,
|
|
84092
|
-
onChange: function onChange(e) {
|
|
84093
|
-
return props.toggleShow(e.target.checked, props.id);
|
|
84094
|
-
},
|
|
84095
|
-
className: "filter_item-content"
|
|
84096
|
-
}, (_props$item2 = props.item) === null || _props$item2 === void 0 ? void 0 : _props$item2.title), /*#__PURE__*/React__default['default'].createElement("div", null, ((_props$item3 = props.item) === null || _props$item3 === void 0 ? void 0 : _props$item3.fixed) && /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
84097
|
-
type: "lmweb-vertical-align-middl",
|
|
84098
|
-
className: "lm_custom_icon hover_show",
|
|
84099
|
-
onClick: function onClick(e) {
|
|
84100
|
-
e.stopPropagation();
|
|
84101
|
-
props.clearFiexd(props.id);
|
|
84102
|
-
}
|
|
84103
|
-
}), !((_props$item4 = props.item) === null || _props$item4 === void 0 ? void 0 : _props$item4.fixed) && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
84104
|
-
type: "lmweb-vertical-align-top",
|
|
84105
|
-
className: "lm_custom_icon hover_show icon_top",
|
|
84106
|
-
onClick: function onClick(e) {
|
|
84107
|
-
console.log(e, 'eee');
|
|
84108
|
-
e.stopPropagation();
|
|
84109
|
-
props.addFiexd(props.id, 'left');
|
|
84110
|
-
}
|
|
84111
|
-
}), /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
84112
|
-
type: "lmweb-vertical-align-botto",
|
|
84113
|
-
className: "lm_custom_icon hover_show icon_bottom",
|
|
84114
|
-
onClick: function onClick(e) {
|
|
84115
|
-
e.stopPropagation();
|
|
84116
|
-
props.addFiexd(props.id, 'right');
|
|
84241
|
+
|
|
84242
|
+
if (domSupport) {
|
|
84243
|
+
if (!('AnimationEvent' in win)) {
|
|
84244
|
+
delete prefixes.animationend.animation;
|
|
84117
84245
|
}
|
|
84118
|
-
|
|
84119
|
-
|
|
84120
|
-
|
|
84121
|
-
color: 'var(--tip-text-color)'
|
|
84246
|
+
|
|
84247
|
+
if (!('TransitionEvent' in win)) {
|
|
84248
|
+
delete prefixes.transitionend.transition;
|
|
84122
84249
|
}
|
|
84123
|
-
}
|
|
84124
|
-
};
|
|
84125
|
-
/** order show fixed */
|
|
84250
|
+
}
|
|
84126
84251
|
|
|
84252
|
+
return prefixes;
|
|
84253
|
+
}
|
|
84254
|
+
var vendorPrefixes = getVendorPrefixes(canUseDom(), typeof window !== 'undefined' ? window : {});
|
|
84255
|
+
var style = {};
|
|
84127
84256
|
|
|
84128
|
-
|
|
84129
|
-
var
|
|
84257
|
+
if (canUseDom()) {
|
|
84258
|
+
var _document$createEleme = document.createElement('div');
|
|
84130
84259
|
|
|
84131
|
-
|
|
84132
|
-
|
|
84133
|
-
_ref$ColumnsStateValu = _ref.ColumnsStateValue,
|
|
84134
|
-
ColumnsStateValue = _ref$ColumnsStateValu === void 0 ? {} : _ref$ColumnsStateValu;
|
|
84260
|
+
style = _document$createEleme.style;
|
|
84261
|
+
}
|
|
84135
84262
|
|
|
84136
|
-
|
|
84137
|
-
|
|
84138
|
-
|
|
84139
|
-
|
|
84263
|
+
var prefixedEventNames = {};
|
|
84264
|
+
function getVendorPrefixedEventName(eventName) {
|
|
84265
|
+
if (prefixedEventNames[eventName]) {
|
|
84266
|
+
return prefixedEventNames[eventName];
|
|
84267
|
+
}
|
|
84140
84268
|
|
|
84141
|
-
var
|
|
84142
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
84143
|
-
colStateValue = _useState4[0],
|
|
84144
|
-
setColStateValue = _useState4[1];
|
|
84145
|
-
/** 正在输入的查询条件 */
|
|
84269
|
+
var prefixMap = vendorPrefixes[eventName];
|
|
84146
84270
|
|
|
84271
|
+
if (prefixMap) {
|
|
84272
|
+
var stylePropList = Object.keys(prefixMap);
|
|
84273
|
+
var len = stylePropList.length;
|
|
84147
84274
|
|
|
84148
|
-
|
|
84149
|
-
|
|
84150
|
-
searchIngValue = _useState6[0],
|
|
84151
|
-
setSearchIngValue = _useState6[1];
|
|
84275
|
+
for (var i = 0; i < len; i += 1) {
|
|
84276
|
+
var styleProp = stylePropList[i];
|
|
84152
84277
|
|
|
84153
|
-
|
|
84154
|
-
|
|
84155
|
-
|
|
84156
|
-
|
|
84278
|
+
if (Object.prototype.hasOwnProperty.call(prefixMap, styleProp) && styleProp in style) {
|
|
84279
|
+
prefixedEventNames[eventName] = prefixMap[styleProp];
|
|
84280
|
+
return prefixedEventNames[eventName];
|
|
84281
|
+
}
|
|
84282
|
+
}
|
|
84283
|
+
}
|
|
84157
84284
|
|
|
84158
|
-
|
|
84159
|
-
|
|
84285
|
+
return '';
|
|
84286
|
+
}
|
|
84287
|
+
var internalAnimationEndName = getVendorPrefixedEventName('animationend');
|
|
84288
|
+
var internalTransitionEndName = getVendorPrefixedEventName('transitionend');
|
|
84289
|
+
var supportTransition = !!(internalAnimationEndName && internalTransitionEndName);
|
|
84290
|
+
var animationEndName = internalAnimationEndName || 'animationend';
|
|
84291
|
+
var transitionEndName = internalTransitionEndName || 'transitionend';
|
|
84292
|
+
function getTransitionName(transitionName, transitionType) {
|
|
84293
|
+
if (!transitionName) return null;
|
|
84294
|
+
|
|
84295
|
+
if (_typeof$1(transitionName) === 'object') {
|
|
84296
|
+
var type = transitionType.replace(/-\w/g, function (match) {
|
|
84297
|
+
return match[1].toUpperCase();
|
|
84298
|
+
});
|
|
84299
|
+
return transitionName[type];
|
|
84300
|
+
}
|
|
84160
84301
|
|
|
84161
|
-
|
|
84162
|
-
|
|
84302
|
+
return "".concat(transitionName, "-").concat(transitionType);
|
|
84303
|
+
}
|
|
84163
84304
|
|
|
84164
|
-
|
|
84165
|
-
|
|
84166
|
-
|
|
84167
|
-
|
|
84168
|
-
|
|
84305
|
+
var STATUS_NONE = 'none';
|
|
84306
|
+
var STATUS_APPEAR = 'appear';
|
|
84307
|
+
var STATUS_ENTER = 'enter';
|
|
84308
|
+
var STATUS_LEAVE = 'leave';
|
|
84309
|
+
var STEP_NONE = 'none';
|
|
84310
|
+
var STEP_PREPARE = 'prepare';
|
|
84311
|
+
var STEP_START = 'start';
|
|
84312
|
+
var STEP_ACTIVE = 'active';
|
|
84313
|
+
var STEP_ACTIVATED = 'end';
|
|
84169
84314
|
|
|
84170
|
-
|
|
84171
|
-
|
|
84172
|
-
|
|
84173
|
-
item.show = ((_ColumnsStateValue$it3 = ColumnsStateValue[item.dataIndex]) === null || _ColumnsStateValue$it3 === void 0 ? void 0 : _ColumnsStateValue$it3.show) === false ? false : true;
|
|
84174
|
-
}
|
|
84175
|
-
});
|
|
84176
|
-
var leftSortItem = [];
|
|
84177
|
-
var rigthSortItem = [];
|
|
84178
|
-
var items = [];
|
|
84179
|
-
cloneCol === null || cloneCol === void 0 ? void 0 : cloneCol.forEach(function (item) {
|
|
84180
|
-
if ((item === null || item === void 0 ? void 0 : item.fixed) === 'right') {
|
|
84181
|
-
rigthSortItem.push(item);
|
|
84182
|
-
} else if (!(item === null || item === void 0 ? void 0 : item.fixed)) {
|
|
84183
|
-
items.push(item);
|
|
84184
|
-
} else {
|
|
84185
|
-
leftSortItem.push(item);
|
|
84186
|
-
}
|
|
84187
|
-
});
|
|
84188
|
-
return {
|
|
84189
|
-
leftSortItem: leftSortItem,
|
|
84190
|
-
rigthSortItem: rigthSortItem,
|
|
84191
|
-
items: items
|
|
84192
|
-
};
|
|
84193
|
-
}, [localColumns, colStateValue, searchValue]);
|
|
84194
|
-
var isCheckAll = React.useMemo(function () {
|
|
84195
|
-
var showLength = localColumns.filter(function (item) {
|
|
84196
|
-
return item.show !== false;
|
|
84197
|
-
});
|
|
84198
|
-
return {
|
|
84199
|
-
indeterminate: (showLength === null || showLength === void 0 ? void 0 : showLength.length) && showLength.length !== localColumns.length ? true : false,
|
|
84200
|
-
checkAll: showLength.length === localColumns.length
|
|
84201
|
-
};
|
|
84202
|
-
}, [localColumns]);
|
|
84203
|
-
/** 将当前输入的值,进行最后赋值,作自动计算使用 */
|
|
84315
|
+
var raf = function raf(callback) {
|
|
84316
|
+
return +setTimeout(callback, 16);
|
|
84317
|
+
};
|
|
84204
84318
|
|
|
84205
|
-
|
|
84206
|
-
|
|
84319
|
+
var caf = function caf(num) {
|
|
84320
|
+
return clearTimeout(num);
|
|
84321
|
+
};
|
|
84322
|
+
|
|
84323
|
+
if (typeof window !== 'undefined' && 'requestAnimationFrame' in window) {
|
|
84324
|
+
raf = function raf(callback) {
|
|
84325
|
+
return window.requestAnimationFrame(callback);
|
|
84207
84326
|
};
|
|
84208
84327
|
|
|
84209
|
-
|
|
84210
|
-
|
|
84211
|
-
|
|
84212
|
-
|
|
84213
|
-
var leftSensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, {
|
|
84214
|
-
coordinateGetter: sortableKeyboardCoordinates
|
|
84215
|
-
}));
|
|
84216
|
-
var sensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, {
|
|
84217
|
-
coordinateGetter: sortableKeyboardCoordinates
|
|
84218
|
-
}));
|
|
84219
|
-
var rightSensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, {
|
|
84220
|
-
coordinateGetter: sortableKeyboardCoordinates
|
|
84221
|
-
}));
|
|
84222
|
-
/** 排序结束回调 */
|
|
84328
|
+
caf = function caf(handle) {
|
|
84329
|
+
return window.cancelAnimationFrame(handle);
|
|
84330
|
+
};
|
|
84331
|
+
}
|
|
84223
84332
|
|
|
84224
|
-
|
|
84225
|
-
|
|
84226
|
-
over = event.over;
|
|
84333
|
+
var rafUUID = 0;
|
|
84334
|
+
var rafIds = new Map();
|
|
84227
84335
|
|
|
84228
|
-
|
|
84229
|
-
|
|
84230
|
-
|
|
84231
|
-
|
|
84232
|
-
|
|
84233
|
-
|
|
84234
|
-
|
|
84235
|
-
|
|
84236
|
-
|
|
84237
|
-
|
|
84238
|
-
|
|
84239
|
-
|
|
84240
|
-
|
|
84241
|
-
|
|
84242
|
-
|
|
84336
|
+
function cleanup(id) {
|
|
84337
|
+
rafIds.delete(id);
|
|
84338
|
+
}
|
|
84339
|
+
|
|
84340
|
+
function wrapperRaf(callback) {
|
|
84341
|
+
var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
84342
|
+
rafUUID += 1;
|
|
84343
|
+
var id = rafUUID;
|
|
84344
|
+
|
|
84345
|
+
function callRef(leftTimes) {
|
|
84346
|
+
if (leftTimes === 0) {
|
|
84347
|
+
// Clean up
|
|
84348
|
+
cleanup(id); // Trigger
|
|
84349
|
+
|
|
84350
|
+
callback();
|
|
84351
|
+
} else {
|
|
84352
|
+
// Next raf
|
|
84353
|
+
var realId = raf(function () {
|
|
84354
|
+
callRef(leftTimes - 1);
|
|
84355
|
+
}); // Bind real raf id
|
|
84356
|
+
|
|
84357
|
+
rafIds.set(id, realId);
|
|
84243
84358
|
}
|
|
84244
|
-
}
|
|
84245
|
-
/** 取消固定 */
|
|
84359
|
+
}
|
|
84246
84360
|
|
|
84361
|
+
callRef(times);
|
|
84362
|
+
return id;
|
|
84363
|
+
}
|
|
84247
84364
|
|
|
84248
|
-
|
|
84249
|
-
|
|
84250
|
-
|
|
84251
|
-
|
|
84252
|
-
|
|
84253
|
-
});
|
|
84254
|
-
}
|
|
84365
|
+
wrapperRaf.cancel = function (id) {
|
|
84366
|
+
var realId = rafIds.get(id);
|
|
84367
|
+
cleanup(realId);
|
|
84368
|
+
return caf(realId);
|
|
84369
|
+
};
|
|
84255
84370
|
|
|
84256
|
-
|
|
84257
|
-
|
|
84258
|
-
setLocalColumns(resultColumns);
|
|
84259
|
-
};
|
|
84260
|
-
/** 添加是否显示 */
|
|
84371
|
+
var useNextFrame = (function () {
|
|
84372
|
+
var nextFrameRef = React.useRef(null);
|
|
84261
84373
|
|
|
84374
|
+
function cancelNextFrame() {
|
|
84375
|
+
wrapperRaf.cancel(nextFrameRef.current);
|
|
84376
|
+
}
|
|
84262
84377
|
|
|
84263
|
-
|
|
84264
|
-
var
|
|
84265
|
-
|
|
84266
|
-
|
|
84267
|
-
|
|
84378
|
+
function nextFrame(callback) {
|
|
84379
|
+
var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
84380
|
+
cancelNextFrame();
|
|
84381
|
+
var nextFrameId = wrapperRaf(function () {
|
|
84382
|
+
if (delay <= 1) {
|
|
84383
|
+
callback({
|
|
84384
|
+
isCanceled: function isCanceled() {
|
|
84385
|
+
return nextFrameId !== nextFrameRef.current;
|
|
84386
|
+
}
|
|
84268
84387
|
});
|
|
84388
|
+
} else {
|
|
84389
|
+
nextFrame(callback, delay - 1);
|
|
84269
84390
|
}
|
|
84270
|
-
|
|
84271
|
-
return _objectSpread({}, item);
|
|
84272
84391
|
});
|
|
84273
|
-
|
|
84274
|
-
}
|
|
84275
|
-
/** 添加左右固定 */
|
|
84392
|
+
nextFrameRef.current = nextFrameId;
|
|
84393
|
+
}
|
|
84276
84394
|
|
|
84395
|
+
React.useEffect(function () {
|
|
84396
|
+
return function () {
|
|
84397
|
+
cancelNextFrame();
|
|
84398
|
+
};
|
|
84399
|
+
}, []);
|
|
84400
|
+
return [nextFrame, cancelNextFrame];
|
|
84401
|
+
});
|
|
84277
84402
|
|
|
84278
|
-
|
|
84279
|
-
var resultColumns = localColumns.map(function (item) {
|
|
84280
|
-
if (item.dataIndex === id) {
|
|
84281
|
-
return _objectSpread(_objectSpread({}, item), {}, {
|
|
84282
|
-
fixed: type
|
|
84283
|
-
});
|
|
84284
|
-
}
|
|
84403
|
+
var useIsomorphicLayoutEffect$3 = canUseDom() ? React.useLayoutEffect : React.useEffect;
|
|
84285
84404
|
|
|
84286
|
-
|
|
84287
|
-
|
|
84288
|
-
setLocalColumns(resultColumns);
|
|
84289
|
-
};
|
|
84290
|
-
/** 切换是否全选 */
|
|
84405
|
+
var STEP_QUEUE = [STEP_PREPARE, STEP_START, STEP_ACTIVE, STEP_ACTIVATED];
|
|
84406
|
+
/** Skip current step */
|
|
84291
84407
|
|
|
84408
|
+
var SkipStep = false;
|
|
84409
|
+
/** Current step should be update in */
|
|
84292
84410
|
|
|
84293
|
-
|
|
84294
|
-
|
|
84295
|
-
|
|
84296
|
-
|
|
84297
|
-
|
|
84298
|
-
|
|
84299
|
-
|
|
84300
|
-
|
|
84411
|
+
var DoStep = true;
|
|
84412
|
+
function isActive(step) {
|
|
84413
|
+
return step === STEP_ACTIVE || step === STEP_ACTIVATED;
|
|
84414
|
+
}
|
|
84415
|
+
var useStepQueue = (function (status, callback) {
|
|
84416
|
+
var _useState = useSafeState(STEP_NONE),
|
|
84417
|
+
_useState2 = _slicedToArray$1(_useState, 2),
|
|
84418
|
+
step = _useState2[0],
|
|
84419
|
+
setStep = _useState2[1];
|
|
84301
84420
|
|
|
84302
|
-
|
|
84303
|
-
|
|
84304
|
-
|
|
84305
|
-
|
|
84306
|
-
},
|
|
84307
|
-
getColStateValue: function getColStateValue() {
|
|
84308
|
-
var obj = {};
|
|
84309
|
-
localColumns.forEach(function (item) {
|
|
84310
|
-
obj[item.dataIndex] = {};
|
|
84421
|
+
var _useNextFrame = useNextFrame(),
|
|
84422
|
+
_useNextFrame2 = _slicedToArray$1(_useNextFrame, 2),
|
|
84423
|
+
nextFrame = _useNextFrame2[0],
|
|
84424
|
+
cancelNextFrame = _useNextFrame2[1];
|
|
84311
84425
|
|
|
84312
|
-
|
|
84313
|
-
|
|
84314
|
-
|
|
84426
|
+
function startQueue() {
|
|
84427
|
+
setStep(STEP_PREPARE, true);
|
|
84428
|
+
}
|
|
84315
84429
|
|
|
84316
|
-
|
|
84317
|
-
|
|
84430
|
+
useIsomorphicLayoutEffect$3(function () {
|
|
84431
|
+
if (step !== STEP_NONE && step !== STEP_ACTIVATED) {
|
|
84432
|
+
var index = STEP_QUEUE.indexOf(step);
|
|
84433
|
+
var nextStep = STEP_QUEUE[index + 1];
|
|
84434
|
+
var result = callback(step);
|
|
84435
|
+
|
|
84436
|
+
if (result === SkipStep) {
|
|
84437
|
+
// Skip when no needed
|
|
84438
|
+
setStep(nextStep, true);
|
|
84439
|
+
} else {
|
|
84440
|
+
// Do as frame for step update
|
|
84441
|
+
nextFrame(function (info) {
|
|
84442
|
+
function doNext() {
|
|
84443
|
+
// Skip since current queue is ood
|
|
84444
|
+
if (info.isCanceled()) return;
|
|
84445
|
+
setStep(nextStep, true);
|
|
84318
84446
|
}
|
|
84319
84447
|
|
|
84320
|
-
if (
|
|
84321
|
-
|
|
84448
|
+
if (result === true) {
|
|
84449
|
+
doNext();
|
|
84450
|
+
} else {
|
|
84451
|
+
// Only promise should be async
|
|
84452
|
+
Promise.resolve(result).then(doNext);
|
|
84322
84453
|
}
|
|
84323
84454
|
});
|
|
84324
|
-
return obj;
|
|
84325
84455
|
}
|
|
84326
|
-
};
|
|
84327
|
-
});
|
|
84328
|
-
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
84329
|
-
className: 'lm_custom_option_columns'
|
|
84330
|
-
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
84331
|
-
className: 'global_search'
|
|
84332
|
-
}, /*#__PURE__*/React__default['default'].createElement(Search, {
|
|
84333
|
-
value: searchIngValue,
|
|
84334
|
-
onChange: function onChange(e) {
|
|
84335
|
-
return setSearchIngValue(e.target.value);
|
|
84336
|
-
},
|
|
84337
|
-
onSearch: handleSearch
|
|
84338
|
-
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
84339
|
-
className: 'global_setting'
|
|
84340
|
-
}, /*#__PURE__*/React__default['default'].createElement(LMCheckBox, {
|
|
84341
|
-
indeterminate: isCheckAll.indeterminate,
|
|
84342
|
-
onChange: onCheckAllChange,
|
|
84343
|
-
checked: isCheckAll.checkAll
|
|
84344
|
-
}, "\u5168\u9009"), /*#__PURE__*/React__default['default'].createElement("span", {
|
|
84345
|
-
onClick: function onClick() {
|
|
84346
|
-
return setLocalColumns(columns);
|
|
84347
84456
|
}
|
|
84348
|
-
},
|
|
84349
|
-
|
|
84350
|
-
|
|
84351
|
-
|
|
84352
|
-
|
|
84353
|
-
|
|
84354
|
-
|
|
84355
|
-
items: (_sortMenu$leftSortIte2 = sortMenu.leftSortItem) === null || _sortMenu$leftSortIte2 === void 0 ? void 0 : _sortMenu$leftSortIte2.map(function (v) {
|
|
84356
|
-
return "".concat(v.dataIndex);
|
|
84357
|
-
}),
|
|
84358
|
-
strategy: verticalListSortingStrategy
|
|
84359
|
-
}, sortMenu.leftSortItem.map(function (item) {
|
|
84360
|
-
return /*#__PURE__*/React__default['default'].createElement(SortItem, {
|
|
84361
|
-
key: item.dataIndex,
|
|
84362
|
-
item: item,
|
|
84363
|
-
toggleShow: toggleShow,
|
|
84364
|
-
clearFiexd: clearFiexd,
|
|
84365
|
-
id: item.dataIndex
|
|
84366
|
-
});
|
|
84367
|
-
})))), !!((_sortMenu$items = sortMenu.items) === null || _sortMenu$items === void 0 ? void 0 : _sortMenu$items.length) && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("label", {
|
|
84368
|
-
className: 'fixed_title'
|
|
84369
|
-
}, " \u4E0D\u56FA\u5B9A "), /*#__PURE__*/React__default['default'].createElement(DndContext, {
|
|
84370
|
-
sensors: sensors,
|
|
84371
|
-
collisionDetection: closestCenter,
|
|
84372
|
-
onDragEnd: handleDragEnd
|
|
84373
|
-
}, /*#__PURE__*/React__default['default'].createElement(SortableContext, {
|
|
84374
|
-
items: (_sortMenu$items2 = sortMenu.items) === null || _sortMenu$items2 === void 0 ? void 0 : _sortMenu$items2.map(function (v) {
|
|
84375
|
-
return "".concat(v.dataIndex);
|
|
84376
|
-
}),
|
|
84377
|
-
strategy: verticalListSortingStrategy
|
|
84378
|
-
}, (_sortMenu$items3 = sortMenu.items) === null || _sortMenu$items3 === void 0 ? void 0 : _sortMenu$items3.map(function (item) {
|
|
84379
|
-
return /*#__PURE__*/React__default['default'].createElement(SortItem, {
|
|
84380
|
-
key: item.dataIndex,
|
|
84381
|
-
addFiexd: addFiexd,
|
|
84382
|
-
toggleShow: toggleShow,
|
|
84383
|
-
item: item,
|
|
84384
|
-
id: item.dataIndex
|
|
84385
|
-
});
|
|
84386
|
-
})))), !!((_sortMenu$rigthSortIt = sortMenu.rigthSortItem) === null || _sortMenu$rigthSortIt === void 0 ? void 0 : _sortMenu$rigthSortIt.length) && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("label", {
|
|
84387
|
-
className: 'fixed_title'
|
|
84388
|
-
}, "\u56FA\u5B9A\u5728\u53F3\u4FA7"), /*#__PURE__*/React__default['default'].createElement(DndContext, {
|
|
84389
|
-
sensors: rightSensors,
|
|
84390
|
-
collisionDetection: closestCenter,
|
|
84391
|
-
onDragEnd: handleDragEnd
|
|
84392
|
-
}, /*#__PURE__*/React__default['default'].createElement(SortableContext, {
|
|
84393
|
-
items: (_sortMenu$rigthSortIt2 = sortMenu.rigthSortItem) === null || _sortMenu$rigthSortIt2 === void 0 ? void 0 : _sortMenu$rigthSortIt2.map(function (v) {
|
|
84394
|
-
return "".concat(v.dataIndex);
|
|
84395
|
-
}),
|
|
84396
|
-
strategy: verticalListSortingStrategy
|
|
84397
|
-
}, sortMenu.rigthSortItem.map(function (item) {
|
|
84398
|
-
return /*#__PURE__*/React__default['default'].createElement(SortItem, {
|
|
84399
|
-
key: item.dataIndex,
|
|
84400
|
-
toggleShow: toggleShow,
|
|
84401
|
-
clearFiexd: clearFiexd,
|
|
84402
|
-
item: item,
|
|
84403
|
-
id: item.dataIndex
|
|
84404
|
-
});
|
|
84405
|
-
})))));
|
|
84457
|
+
}, [status, step]);
|
|
84458
|
+
React.useEffect(function () {
|
|
84459
|
+
return function () {
|
|
84460
|
+
cancelNextFrame();
|
|
84461
|
+
};
|
|
84462
|
+
}, []);
|
|
84463
|
+
return [startQueue, step];
|
|
84406
84464
|
});
|
|
84407
84465
|
|
|
84408
|
-
var
|
|
84409
|
-
|
|
84466
|
+
var useDomMotionEvents = (function (callback) {
|
|
84467
|
+
var cacheElementRef = React.useRef(); // Cache callback
|
|
84410
84468
|
|
|
84411
|
-
|
|
84412
|
-
|
|
84469
|
+
var callbackRef = React.useRef(callback);
|
|
84470
|
+
callbackRef.current = callback; // Internal motion event handler
|
|
84413
84471
|
|
|
84414
|
-
var
|
|
84415
|
-
|
|
84416
|
-
})
|
|
84417
|
-
attributes = _useSortable.attributes,
|
|
84418
|
-
listeners = _useSortable.listeners,
|
|
84419
|
-
setNodeRef = _useSortable.setNodeRef,
|
|
84420
|
-
transform = _useSortable.transform,
|
|
84421
|
-
transition = _useSortable.transition;
|
|
84472
|
+
var onInternalMotionEnd = React.useCallback(function (event) {
|
|
84473
|
+
callbackRef.current(event);
|
|
84474
|
+
}, []); // Remove events
|
|
84422
84475
|
|
|
84423
|
-
|
|
84424
|
-
|
|
84425
|
-
|
|
84426
|
-
|
|
84427
|
-
|
|
84428
|
-
|
|
84429
|
-
className: 'lm_custom_item',
|
|
84430
|
-
style: style
|
|
84431
|
-
}, attributes), /*#__PURE__*/React__default['default'].createElement(LMCheckBox, {
|
|
84432
|
-
checked: ((_props$item = props.item) === null || _props$item === void 0 ? void 0 : _props$item.show) === false ? false : true,
|
|
84433
|
-
onChange: function onChange(e) {
|
|
84434
|
-
return props.toggleShow(e.target.checked, props.id);
|
|
84435
|
-
},
|
|
84436
|
-
className: "filter_item-content"
|
|
84437
|
-
}, (_props$item2 = props.item) === null || _props$item2 === void 0 ? void 0 : _props$item2.title), /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(HolderOutlined$2, _objectSpread(_objectSpread({}, listeners), {}, {
|
|
84438
|
-
className: 'lm_custom_icon sort_item'
|
|
84439
|
-
}))));
|
|
84440
|
-
};
|
|
84441
|
-
/** order show fixed */
|
|
84476
|
+
function removeMotionEvents(element) {
|
|
84477
|
+
if (element) {
|
|
84478
|
+
element.removeEventListener(transitionEndName, onInternalMotionEnd);
|
|
84479
|
+
element.removeEventListener(animationEndName, onInternalMotionEnd);
|
|
84480
|
+
}
|
|
84481
|
+
} // Patch events
|
|
84442
84482
|
|
|
84443
84483
|
|
|
84444
|
-
|
|
84445
|
-
|
|
84446
|
-
|
|
84447
|
-
|
|
84448
|
-
filterStateValue = _ref$filterStateValue === void 0 ? {} : _ref$filterStateValue;
|
|
84484
|
+
function patchMotionEvents(element) {
|
|
84485
|
+
if (cacheElementRef.current && cacheElementRef.current !== element) {
|
|
84486
|
+
removeMotionEvents(cacheElementRef.current);
|
|
84487
|
+
}
|
|
84449
84488
|
|
|
84450
|
-
|
|
84451
|
-
|
|
84452
|
-
|
|
84453
|
-
setLocalFilter = _useState2[1];
|
|
84489
|
+
if (element && element !== cacheElementRef.current) {
|
|
84490
|
+
element.addEventListener(transitionEndName, onInternalMotionEnd);
|
|
84491
|
+
element.addEventListener(animationEndName, onInternalMotionEnd); // Save as cache in case dom removed trigger by `motionDeadline`
|
|
84454
84492
|
|
|
84455
|
-
|
|
84456
|
-
|
|
84457
|
-
|
|
84458
|
-
setColStateValue = _useState4[1];
|
|
84459
|
-
/** 正在输入的查询条件 */
|
|
84493
|
+
cacheElementRef.current = element;
|
|
84494
|
+
}
|
|
84495
|
+
} // Clean up when removed
|
|
84460
84496
|
|
|
84461
84497
|
|
|
84462
|
-
|
|
84463
|
-
|
|
84464
|
-
|
|
84465
|
-
|
|
84498
|
+
React.useEffect(function () {
|
|
84499
|
+
return function () {
|
|
84500
|
+
removeMotionEvents(cacheElementRef.current);
|
|
84501
|
+
};
|
|
84502
|
+
}, []);
|
|
84503
|
+
return [patchMotionEvents, removeMotionEvents];
|
|
84504
|
+
});
|
|
84466
84505
|
|
|
84467
|
-
|
|
84468
|
-
|
|
84469
|
-
|
|
84470
|
-
|
|
84506
|
+
function useStatus(supportMotion, visible, getElement, _ref) {
|
|
84507
|
+
var _ref$motionEnter = _ref.motionEnter,
|
|
84508
|
+
motionEnter = _ref$motionEnter === void 0 ? true : _ref$motionEnter,
|
|
84509
|
+
_ref$motionAppear = _ref.motionAppear,
|
|
84510
|
+
motionAppear = _ref$motionAppear === void 0 ? true : _ref$motionAppear,
|
|
84511
|
+
_ref$motionLeave = _ref.motionLeave,
|
|
84512
|
+
motionLeave = _ref$motionLeave === void 0 ? true : _ref$motionLeave,
|
|
84513
|
+
motionDeadline = _ref.motionDeadline,
|
|
84514
|
+
motionLeaveImmediately = _ref.motionLeaveImmediately,
|
|
84515
|
+
onAppearPrepare = _ref.onAppearPrepare,
|
|
84516
|
+
onEnterPrepare = _ref.onEnterPrepare,
|
|
84517
|
+
onLeavePrepare = _ref.onLeavePrepare,
|
|
84518
|
+
onAppearStart = _ref.onAppearStart,
|
|
84519
|
+
onEnterStart = _ref.onEnterStart,
|
|
84520
|
+
onLeaveStart = _ref.onLeaveStart,
|
|
84521
|
+
onAppearActive = _ref.onAppearActive,
|
|
84522
|
+
onEnterActive = _ref.onEnterActive,
|
|
84523
|
+
onLeaveActive = _ref.onLeaveActive,
|
|
84524
|
+
onAppearEnd = _ref.onAppearEnd,
|
|
84525
|
+
onEnterEnd = _ref.onEnterEnd,
|
|
84526
|
+
onLeaveEnd = _ref.onLeaveEnd,
|
|
84527
|
+
onVisibleChanged = _ref.onVisibleChanged;
|
|
84528
|
+
|
|
84529
|
+
// Used for outer render usage to avoid `visible: false & status: none` to render nothing
|
|
84530
|
+
var _useState = useSafeState(),
|
|
84531
|
+
_useState2 = _slicedToArray$1(_useState, 2),
|
|
84532
|
+
asyncVisible = _useState2[0],
|
|
84533
|
+
setAsyncVisible = _useState2[1];
|
|
84471
84534
|
|
|
84472
|
-
var
|
|
84473
|
-
|
|
84474
|
-
|
|
84475
|
-
|
|
84535
|
+
var _useState3 = useSafeState(STATUS_NONE),
|
|
84536
|
+
_useState4 = _slicedToArray$1(_useState3, 2),
|
|
84537
|
+
status = _useState4[0],
|
|
84538
|
+
setStatus = _useState4[1];
|
|
84476
84539
|
|
|
84477
|
-
|
|
84478
|
-
|
|
84479
|
-
|
|
84480
|
-
|
|
84481
|
-
return cloneCol.filter(function (item) {
|
|
84482
|
-
var _item$title;
|
|
84540
|
+
var _useState5 = useSafeState(null),
|
|
84541
|
+
_useState6 = _slicedToArray$1(_useState5, 2),
|
|
84542
|
+
style = _useState6[0],
|
|
84543
|
+
setStyle = _useState6[1];
|
|
84483
84544
|
|
|
84484
|
-
|
|
84485
|
-
|
|
84486
|
-
|
|
84487
|
-
|
|
84488
|
-
|
|
84489
|
-
|
|
84545
|
+
var mountedRef = React.useRef(false);
|
|
84546
|
+
var deadlineRef = React.useRef(null); // =========================== Dom Node ===========================
|
|
84547
|
+
|
|
84548
|
+
function getDomElement() {
|
|
84549
|
+
return getElement();
|
|
84550
|
+
} // ========================== Motion End ==========================
|
|
84551
|
+
|
|
84552
|
+
|
|
84553
|
+
var activeRef = React.useRef(false);
|
|
84554
|
+
|
|
84555
|
+
function onInternalMotionEnd(event) {
|
|
84556
|
+
var element = getDomElement();
|
|
84557
|
+
|
|
84558
|
+
if (event && !event.deadline && event.target !== element) {
|
|
84559
|
+
// event exists
|
|
84560
|
+
// not initiated by deadline
|
|
84561
|
+
// transitionEnd not fired by inner elements
|
|
84562
|
+
return;
|
|
84563
|
+
}
|
|
84564
|
+
|
|
84565
|
+
var currentActive = activeRef.current;
|
|
84566
|
+
var canEnd;
|
|
84567
|
+
|
|
84568
|
+
if (status === STATUS_APPEAR && currentActive) {
|
|
84569
|
+
canEnd = onAppearEnd === null || onAppearEnd === void 0 ? void 0 : onAppearEnd(element, event);
|
|
84570
|
+
} else if (status === STATUS_ENTER && currentActive) {
|
|
84571
|
+
canEnd = onEnterEnd === null || onEnterEnd === void 0 ? void 0 : onEnterEnd(element, event);
|
|
84572
|
+
} else if (status === STATUS_LEAVE && currentActive) {
|
|
84573
|
+
canEnd = onLeaveEnd === null || onLeaveEnd === void 0 ? void 0 : onLeaveEnd(element, event);
|
|
84574
|
+
} // Only update status when `canEnd` and not destroyed
|
|
84575
|
+
|
|
84576
|
+
|
|
84577
|
+
if (status !== STATUS_NONE && currentActive && canEnd !== false) {
|
|
84578
|
+
setStatus(STATUS_NONE, true);
|
|
84579
|
+
setStyle(null, true);
|
|
84580
|
+
}
|
|
84581
|
+
}
|
|
84582
|
+
|
|
84583
|
+
var _useDomMotionEvents = useDomMotionEvents(onInternalMotionEnd),
|
|
84584
|
+
_useDomMotionEvents2 = _slicedToArray$1(_useDomMotionEvents, 1),
|
|
84585
|
+
patchMotionEvents = _useDomMotionEvents2[0]; // ============================= Step =============================
|
|
84586
|
+
|
|
84587
|
+
|
|
84588
|
+
var eventHandlers = React.useMemo(function () {
|
|
84589
|
+
var _ref2, _ref3, _ref4;
|
|
84590
|
+
|
|
84591
|
+
switch (status) {
|
|
84592
|
+
case STATUS_APPEAR:
|
|
84593
|
+
return _ref2 = {}, _defineProperty$1(_ref2, STEP_PREPARE, onAppearPrepare), _defineProperty$1(_ref2, STEP_START, onAppearStart), _defineProperty$1(_ref2, STEP_ACTIVE, onAppearActive), _ref2;
|
|
84594
|
+
|
|
84595
|
+
case STATUS_ENTER:
|
|
84596
|
+
return _ref3 = {}, _defineProperty$1(_ref3, STEP_PREPARE, onEnterPrepare), _defineProperty$1(_ref3, STEP_START, onEnterStart), _defineProperty$1(_ref3, STEP_ACTIVE, onEnterActive), _ref3;
|
|
84597
|
+
|
|
84598
|
+
case STATUS_LEAVE:
|
|
84599
|
+
return _ref4 = {}, _defineProperty$1(_ref4, STEP_PREPARE, onLeavePrepare), _defineProperty$1(_ref4, STEP_START, onLeaveStart), _defineProperty$1(_ref4, STEP_ACTIVE, onLeaveActive), _ref4;
|
|
84600
|
+
|
|
84601
|
+
default:
|
|
84602
|
+
return {};
|
|
84603
|
+
}
|
|
84604
|
+
}, [status]);
|
|
84605
|
+
|
|
84606
|
+
var _useStepQueue = useStepQueue(status, function (newStep) {
|
|
84607
|
+
// Only prepare step can be skip
|
|
84608
|
+
if (newStep === STEP_PREPARE) {
|
|
84609
|
+
var onPrepare = eventHandlers[STEP_PREPARE];
|
|
84610
|
+
|
|
84611
|
+
if (!onPrepare) {
|
|
84612
|
+
return SkipStep;
|
|
84613
|
+
}
|
|
84614
|
+
|
|
84615
|
+
return onPrepare(getDomElement());
|
|
84616
|
+
} // Rest step is sync update
|
|
84617
|
+
|
|
84618
|
+
|
|
84619
|
+
// Rest step is sync update
|
|
84620
|
+
if (step in eventHandlers) {
|
|
84621
|
+
var _eventHandlers$step;
|
|
84622
|
+
|
|
84623
|
+
setStyle(((_eventHandlers$step = eventHandlers[step]) === null || _eventHandlers$step === void 0 ? void 0 : _eventHandlers$step.call(eventHandlers, getDomElement(), null)) || null);
|
|
84624
|
+
}
|
|
84625
|
+
|
|
84626
|
+
if (step === STEP_ACTIVE) {
|
|
84627
|
+
// Patch events when motion needed
|
|
84628
|
+
patchMotionEvents(getDomElement());
|
|
84629
|
+
|
|
84630
|
+
if (motionDeadline > 0) {
|
|
84631
|
+
clearTimeout(deadlineRef.current);
|
|
84632
|
+
deadlineRef.current = setTimeout(function () {
|
|
84633
|
+
onInternalMotionEnd({
|
|
84634
|
+
deadline: true
|
|
84635
|
+
});
|
|
84636
|
+
}, motionDeadline);
|
|
84637
|
+
}
|
|
84638
|
+
}
|
|
84639
|
+
|
|
84640
|
+
return DoStep;
|
|
84641
|
+
}),
|
|
84642
|
+
_useStepQueue2 = _slicedToArray$1(_useStepQueue, 2),
|
|
84643
|
+
startStep = _useStepQueue2[0],
|
|
84644
|
+
step = _useStepQueue2[1];
|
|
84645
|
+
|
|
84646
|
+
var active = isActive(step);
|
|
84647
|
+
activeRef.current = active; // ============================ Status ============================
|
|
84648
|
+
// Update with new status
|
|
84649
|
+
|
|
84650
|
+
useIsomorphicLayoutEffect$3(function () {
|
|
84651
|
+
setAsyncVisible(visible);
|
|
84652
|
+
var isMounted = mountedRef.current;
|
|
84653
|
+
mountedRef.current = true;
|
|
84654
|
+
|
|
84655
|
+
if (!supportMotion) {
|
|
84656
|
+
return;
|
|
84657
|
+
}
|
|
84658
|
+
|
|
84659
|
+
var nextStatus; // Appear
|
|
84660
|
+
|
|
84661
|
+
if (!isMounted && visible && motionAppear) {
|
|
84662
|
+
nextStatus = STATUS_APPEAR;
|
|
84663
|
+
} // Enter
|
|
84664
|
+
|
|
84665
|
+
|
|
84666
|
+
if (isMounted && visible && motionEnter) {
|
|
84667
|
+
nextStatus = STATUS_ENTER;
|
|
84668
|
+
} // Leave
|
|
84669
|
+
|
|
84670
|
+
|
|
84671
|
+
if (isMounted && !visible && motionLeave || !isMounted && motionLeaveImmediately && !visible && motionLeave) {
|
|
84672
|
+
nextStatus = STATUS_LEAVE;
|
|
84673
|
+
} // Update to next status
|
|
84674
|
+
|
|
84675
|
+
|
|
84676
|
+
if (nextStatus) {
|
|
84677
|
+
setStatus(nextStatus);
|
|
84678
|
+
startStep();
|
|
84679
|
+
}
|
|
84680
|
+
}, [visible]); // ============================ Effect ============================
|
|
84681
|
+
// Reset when motion changed
|
|
84682
|
+
|
|
84683
|
+
React.useEffect(function () {
|
|
84684
|
+
if ( // Cancel appear
|
|
84685
|
+
status === STATUS_APPEAR && !motionAppear || // Cancel enter
|
|
84686
|
+
status === STATUS_ENTER && !motionEnter || // Cancel leave
|
|
84687
|
+
status === STATUS_LEAVE && !motionLeave) {
|
|
84688
|
+
setStatus(STATUS_NONE);
|
|
84689
|
+
}
|
|
84690
|
+
}, [motionAppear, motionEnter, motionLeave]);
|
|
84691
|
+
React.useEffect(function () {
|
|
84692
|
+
return function () {
|
|
84693
|
+
mountedRef.current = false;
|
|
84694
|
+
clearTimeout(deadlineRef.current);
|
|
84695
|
+
};
|
|
84696
|
+
}, []); // Trigger `onVisibleChanged`
|
|
84697
|
+
|
|
84698
|
+
React.useEffect(function () {
|
|
84699
|
+
if (asyncVisible !== undefined && status === STATUS_NONE) {
|
|
84700
|
+
onVisibleChanged === null || onVisibleChanged === void 0 ? void 0 : onVisibleChanged(asyncVisible);
|
|
84701
|
+
}
|
|
84702
|
+
}, [asyncVisible, status]); // ============================ Styles ============================
|
|
84703
|
+
|
|
84704
|
+
var mergedStyle = style;
|
|
84705
|
+
|
|
84706
|
+
if (eventHandlers[STEP_PREPARE] && step === STEP_START) {
|
|
84707
|
+
mergedStyle = _objectSpread2({
|
|
84708
|
+
transition: 'none'
|
|
84709
|
+
}, mergedStyle);
|
|
84710
|
+
}
|
|
84711
|
+
|
|
84712
|
+
return [status, step, mergedStyle, asyncVisible !== null && asyncVisible !== void 0 ? asyncVisible : visible];
|
|
84713
|
+
}
|
|
84714
|
+
|
|
84715
|
+
var DomWrapper$1 = /*#__PURE__*/function (_React$Component) {
|
|
84716
|
+
_inherits(DomWrapper, _React$Component);
|
|
84717
|
+
|
|
84718
|
+
var _super = _createSuper(DomWrapper);
|
|
84719
|
+
|
|
84720
|
+
function DomWrapper() {
|
|
84721
|
+
_classCallCheck(this, DomWrapper);
|
|
84722
|
+
|
|
84723
|
+
return _super.apply(this, arguments);
|
|
84724
|
+
}
|
|
84725
|
+
|
|
84726
|
+
_createClass(DomWrapper, [{
|
|
84727
|
+
key: "render",
|
|
84728
|
+
value: function render() {
|
|
84729
|
+
return this.props.children;
|
|
84730
|
+
}
|
|
84731
|
+
}]);
|
|
84732
|
+
|
|
84733
|
+
return DomWrapper;
|
|
84734
|
+
}(React.Component);
|
|
84735
|
+
|
|
84736
|
+
/**
|
|
84737
|
+
* `transitionSupport` is used for none transition test case.
|
|
84738
|
+
* Default we use browser transition event support check.
|
|
84739
|
+
*/
|
|
84740
|
+
|
|
84741
|
+
function genCSSMotion(config) {
|
|
84742
|
+
var transitionSupport = config;
|
|
84743
|
+
|
|
84744
|
+
if (_typeof$1(config) === 'object') {
|
|
84745
|
+
transitionSupport = config.transitionSupport;
|
|
84746
|
+
}
|
|
84747
|
+
|
|
84748
|
+
function isSupportTransition(props) {
|
|
84749
|
+
return !!(props.motionName && transitionSupport);
|
|
84750
|
+
}
|
|
84751
|
+
|
|
84752
|
+
var CSSMotion = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
84753
|
+
var _props$visible = props.visible,
|
|
84754
|
+
visible = _props$visible === void 0 ? true : _props$visible,
|
|
84755
|
+
_props$removeOnLeave = props.removeOnLeave,
|
|
84756
|
+
removeOnLeave = _props$removeOnLeave === void 0 ? true : _props$removeOnLeave,
|
|
84757
|
+
forceRender = props.forceRender,
|
|
84758
|
+
children = props.children,
|
|
84759
|
+
motionName = props.motionName,
|
|
84760
|
+
leavedClassName = props.leavedClassName,
|
|
84761
|
+
eventProps = props.eventProps;
|
|
84762
|
+
var supportMotion = isSupportTransition(props); // Ref to the react node, it may be a HTMLElement
|
|
84763
|
+
|
|
84764
|
+
var nodeRef = React.useRef(); // Ref to the dom wrapper in case ref can not pass to HTMLElement
|
|
84765
|
+
|
|
84766
|
+
var wrapperNodeRef = React.useRef();
|
|
84767
|
+
|
|
84768
|
+
function getDomElement() {
|
|
84769
|
+
try {
|
|
84770
|
+
// Here we're avoiding call for findDOMNode since it's deprecated
|
|
84771
|
+
// in strict mode. We're calling it only when node ref is not
|
|
84772
|
+
// an instance of DOM HTMLElement. Otherwise use
|
|
84773
|
+
// findDOMNode as a final resort
|
|
84774
|
+
return nodeRef.current instanceof HTMLElement ? nodeRef.current : findDOMNode(wrapperNodeRef.current);
|
|
84775
|
+
} catch (e) {
|
|
84776
|
+
// Only happen when `motionDeadline` trigger but element removed.
|
|
84777
|
+
return null;
|
|
84778
|
+
}
|
|
84779
|
+
}
|
|
84780
|
+
|
|
84781
|
+
var _useStatus = useStatus(supportMotion, visible, getDomElement, props),
|
|
84782
|
+
_useStatus2 = _slicedToArray$1(_useStatus, 4),
|
|
84783
|
+
status = _useStatus2[0],
|
|
84784
|
+
statusStep = _useStatus2[1],
|
|
84785
|
+
statusStyle = _useStatus2[2],
|
|
84786
|
+
mergedVisible = _useStatus2[3]; // Record whether content has rendered
|
|
84787
|
+
// Will return null for un-rendered even when `removeOnLeave={false}`
|
|
84788
|
+
|
|
84789
|
+
|
|
84790
|
+
var renderedRef = React.useRef(mergedVisible);
|
|
84791
|
+
|
|
84792
|
+
if (mergedVisible) {
|
|
84793
|
+
renderedRef.current = true;
|
|
84794
|
+
} // ====================== Refs ======================
|
|
84795
|
+
|
|
84796
|
+
|
|
84797
|
+
var setNodeRef = React.useCallback(function (node) {
|
|
84798
|
+
nodeRef.current = node;
|
|
84799
|
+
fillRef(ref, node);
|
|
84800
|
+
}, [ref]); // ===================== Render =====================
|
|
84801
|
+
|
|
84802
|
+
var motionChildren;
|
|
84803
|
+
|
|
84804
|
+
var mergedProps = _objectSpread2(_objectSpread2({}, eventProps), {}, {
|
|
84805
|
+
visible: visible
|
|
84806
|
+
});
|
|
84807
|
+
|
|
84808
|
+
if (!children) {
|
|
84809
|
+
// No children
|
|
84810
|
+
motionChildren = null;
|
|
84811
|
+
} else if (status === STATUS_NONE || !isSupportTransition(props)) {
|
|
84812
|
+
// Stable children
|
|
84813
|
+
if (mergedVisible) {
|
|
84814
|
+
motionChildren = children(_objectSpread2({}, mergedProps), setNodeRef);
|
|
84815
|
+
} else if (!removeOnLeave && renderedRef.current) {
|
|
84816
|
+
motionChildren = children(_objectSpread2(_objectSpread2({}, mergedProps), {}, {
|
|
84817
|
+
className: leavedClassName
|
|
84818
|
+
}), setNodeRef);
|
|
84819
|
+
} else if (forceRender) {
|
|
84820
|
+
motionChildren = children(_objectSpread2(_objectSpread2({}, mergedProps), {}, {
|
|
84821
|
+
style: {
|
|
84822
|
+
display: 'none'
|
|
84823
|
+
}
|
|
84824
|
+
}), setNodeRef);
|
|
84825
|
+
} else {
|
|
84826
|
+
motionChildren = null;
|
|
84827
|
+
}
|
|
84828
|
+
} else {
|
|
84829
|
+
var _classNames;
|
|
84830
|
+
|
|
84831
|
+
// In motion
|
|
84832
|
+
var statusSuffix;
|
|
84833
|
+
|
|
84834
|
+
if (statusStep === STEP_PREPARE) {
|
|
84835
|
+
statusSuffix = 'prepare';
|
|
84836
|
+
} else if (isActive(statusStep)) {
|
|
84837
|
+
statusSuffix = 'active';
|
|
84838
|
+
} else if (statusStep === STEP_START) {
|
|
84839
|
+
statusSuffix = 'start';
|
|
84840
|
+
}
|
|
84841
|
+
|
|
84842
|
+
motionChildren = children(_objectSpread2(_objectSpread2({}, mergedProps), {}, {
|
|
84843
|
+
className: classnames(getTransitionName(motionName, status), (_classNames = {}, _defineProperty$1(_classNames, getTransitionName(motionName, "".concat(status, "-").concat(statusSuffix)), statusSuffix), _defineProperty$1(_classNames, motionName, typeof motionName === 'string'), _classNames)),
|
|
84844
|
+
style: statusStyle
|
|
84845
|
+
}), setNodeRef);
|
|
84846
|
+
} // Auto inject ref if child node not have `ref` props
|
|
84847
|
+
|
|
84848
|
+
|
|
84849
|
+
if ( /*#__PURE__*/React.isValidElement(motionChildren) && supportRef(motionChildren)) {
|
|
84850
|
+
var _motionChildren = motionChildren,
|
|
84851
|
+
originNodeRef = _motionChildren.ref;
|
|
84852
|
+
|
|
84853
|
+
if (!originNodeRef) {
|
|
84854
|
+
motionChildren = /*#__PURE__*/React.cloneElement(motionChildren, {
|
|
84855
|
+
ref: setNodeRef
|
|
84856
|
+
});
|
|
84857
|
+
}
|
|
84858
|
+
}
|
|
84859
|
+
|
|
84860
|
+
return /*#__PURE__*/React.createElement(DomWrapper$1, {
|
|
84861
|
+
ref: wrapperNodeRef
|
|
84862
|
+
}, motionChildren);
|
|
84863
|
+
});
|
|
84864
|
+
CSSMotion.displayName = 'CSSMotion';
|
|
84865
|
+
return CSSMotion;
|
|
84866
|
+
}
|
|
84867
|
+
var CSSMotion = genCSSMotion(supportTransition);
|
|
84868
|
+
|
|
84869
|
+
var STATUS_ADD = 'add';
|
|
84870
|
+
var STATUS_KEEP = 'keep';
|
|
84871
|
+
var STATUS_REMOVE = 'remove';
|
|
84872
|
+
var STATUS_REMOVED = 'removed';
|
|
84873
|
+
function wrapKeyToObject(key) {
|
|
84874
|
+
var keyObj;
|
|
84875
|
+
|
|
84876
|
+
if (key && _typeof$1(key) === 'object' && 'key' in key) {
|
|
84877
|
+
keyObj = key;
|
|
84878
|
+
} else {
|
|
84879
|
+
keyObj = {
|
|
84880
|
+
key: key
|
|
84881
|
+
};
|
|
84882
|
+
}
|
|
84883
|
+
|
|
84884
|
+
return _objectSpread2(_objectSpread2({}, keyObj), {}, {
|
|
84885
|
+
key: String(keyObj.key)
|
|
84886
|
+
});
|
|
84887
|
+
}
|
|
84888
|
+
function parseKeys() {
|
|
84889
|
+
var keys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
84890
|
+
return keys.map(wrapKeyToObject);
|
|
84891
|
+
}
|
|
84892
|
+
function diffKeys() {
|
|
84893
|
+
var prevKeys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
84894
|
+
var currentKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
84895
|
+
var list = [];
|
|
84896
|
+
var currentIndex = 0;
|
|
84897
|
+
var currentLen = currentKeys.length;
|
|
84898
|
+
var prevKeyObjects = parseKeys(prevKeys);
|
|
84899
|
+
var currentKeyObjects = parseKeys(currentKeys); // Check prev keys to insert or keep
|
|
84900
|
+
|
|
84901
|
+
prevKeyObjects.forEach(function (keyObj) {
|
|
84902
|
+
var hit = false;
|
|
84903
|
+
|
|
84904
|
+
for (var i = currentIndex; i < currentLen; i += 1) {
|
|
84905
|
+
var currentKeyObj = currentKeyObjects[i];
|
|
84906
|
+
|
|
84907
|
+
if (currentKeyObj.key === keyObj.key) {
|
|
84908
|
+
// New added keys should add before current key
|
|
84909
|
+
if (currentIndex < i) {
|
|
84910
|
+
list = list.concat(currentKeyObjects.slice(currentIndex, i).map(function (obj) {
|
|
84911
|
+
return _objectSpread2(_objectSpread2({}, obj), {}, {
|
|
84912
|
+
status: STATUS_ADD
|
|
84913
|
+
});
|
|
84914
|
+
}));
|
|
84915
|
+
currentIndex = i;
|
|
84916
|
+
}
|
|
84917
|
+
|
|
84918
|
+
list.push(_objectSpread2(_objectSpread2({}, currentKeyObj), {}, {
|
|
84919
|
+
status: STATUS_KEEP
|
|
84920
|
+
}));
|
|
84921
|
+
currentIndex += 1;
|
|
84922
|
+
hit = true;
|
|
84923
|
+
break;
|
|
84924
|
+
}
|
|
84925
|
+
} // If not hit, it means key is removed
|
|
84926
|
+
|
|
84927
|
+
|
|
84928
|
+
if (!hit) {
|
|
84929
|
+
list.push(_objectSpread2(_objectSpread2({}, keyObj), {}, {
|
|
84930
|
+
status: STATUS_REMOVE
|
|
84931
|
+
}));
|
|
84932
|
+
}
|
|
84933
|
+
}); // Add rest to the list
|
|
84934
|
+
|
|
84935
|
+
if (currentIndex < currentLen) {
|
|
84936
|
+
list = list.concat(currentKeyObjects.slice(currentIndex).map(function (obj) {
|
|
84937
|
+
return _objectSpread2(_objectSpread2({}, obj), {}, {
|
|
84938
|
+
status: STATUS_ADD
|
|
84939
|
+
});
|
|
84940
|
+
}));
|
|
84941
|
+
}
|
|
84942
|
+
/**
|
|
84943
|
+
* Merge same key when it remove and add again:
|
|
84944
|
+
* [1 - add, 2 - keep, 1 - remove] -> [1 - keep, 2 - keep]
|
|
84945
|
+
*/
|
|
84946
|
+
|
|
84947
|
+
|
|
84948
|
+
var keys = {};
|
|
84949
|
+
list.forEach(function (_ref) {
|
|
84950
|
+
var key = _ref.key;
|
|
84951
|
+
keys[key] = (keys[key] || 0) + 1;
|
|
84952
|
+
});
|
|
84953
|
+
var duplicatedKeys = Object.keys(keys).filter(function (key) {
|
|
84954
|
+
return keys[key] > 1;
|
|
84955
|
+
});
|
|
84956
|
+
duplicatedKeys.forEach(function (matchKey) {
|
|
84957
|
+
// Remove `STATUS_REMOVE` node.
|
|
84958
|
+
list = list.filter(function (_ref2) {
|
|
84959
|
+
var key = _ref2.key,
|
|
84960
|
+
status = _ref2.status;
|
|
84961
|
+
return key !== matchKey || status !== STATUS_REMOVE;
|
|
84962
|
+
}); // Update `STATUS_ADD` to `STATUS_KEEP`
|
|
84963
|
+
|
|
84964
|
+
list.forEach(function (node) {
|
|
84965
|
+
if (node.key === matchKey) {
|
|
84966
|
+
// eslint-disable-next-line no-param-reassign
|
|
84967
|
+
node.status = STATUS_KEEP;
|
|
84968
|
+
}
|
|
84969
|
+
});
|
|
84970
|
+
});
|
|
84971
|
+
return list;
|
|
84972
|
+
}
|
|
84973
|
+
|
|
84974
|
+
var _excluded$1m = ["component", "children", "onVisibleChanged", "onAllRemoved"],
|
|
84975
|
+
_excluded2$l = ["status"];
|
|
84976
|
+
var MOTION_PROP_NAMES = ['eventProps', 'visible', 'children', 'motionName', 'motionAppear', 'motionEnter', 'motionLeave', 'motionLeaveImmediately', 'motionDeadline', 'removeOnLeave', 'leavedClassName', 'onAppearStart', 'onAppearActive', 'onAppearEnd', 'onEnterStart', 'onEnterActive', 'onEnterEnd', 'onLeaveStart', 'onLeaveActive', 'onLeaveEnd'];
|
|
84977
|
+
/**
|
|
84978
|
+
* Generate a CSSMotionList component with config
|
|
84979
|
+
* @param transitionSupport No need since CSSMotionList no longer depends on transition support
|
|
84980
|
+
* @param CSSMotion CSSMotion component
|
|
84981
|
+
*/
|
|
84982
|
+
|
|
84983
|
+
function genCSSMotionList(transitionSupport) {
|
|
84984
|
+
var CSSMotion$1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : CSSMotion;
|
|
84985
|
+
|
|
84986
|
+
var CSSMotionList = /*#__PURE__*/function (_React$Component) {
|
|
84987
|
+
_inherits(CSSMotionList, _React$Component);
|
|
84988
|
+
|
|
84989
|
+
var _super = _createSuper(CSSMotionList);
|
|
84990
|
+
|
|
84991
|
+
function CSSMotionList() {
|
|
84992
|
+
var _this;
|
|
84993
|
+
|
|
84994
|
+
_classCallCheck(this, CSSMotionList);
|
|
84995
|
+
|
|
84996
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
84997
|
+
args[_key] = arguments[_key];
|
|
84998
|
+
}
|
|
84999
|
+
|
|
85000
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
85001
|
+
_this.state = {
|
|
85002
|
+
keyEntities: []
|
|
85003
|
+
};
|
|
85004
|
+
|
|
85005
|
+
_this.removeKey = function (removeKey) {
|
|
85006
|
+
var keyEntities = _this.state.keyEntities;
|
|
85007
|
+
var nextKeyEntities = keyEntities.map(function (entity) {
|
|
85008
|
+
if (entity.key !== removeKey) return entity;
|
|
85009
|
+
return _objectSpread2(_objectSpread2({}, entity), {}, {
|
|
85010
|
+
status: STATUS_REMOVED
|
|
85011
|
+
});
|
|
85012
|
+
});
|
|
85013
|
+
|
|
85014
|
+
_this.setState({
|
|
85015
|
+
keyEntities: nextKeyEntities
|
|
85016
|
+
});
|
|
85017
|
+
|
|
85018
|
+
return nextKeyEntities.filter(function (_ref) {
|
|
85019
|
+
var status = _ref.status;
|
|
85020
|
+
return status !== STATUS_REMOVED;
|
|
85021
|
+
}).length;
|
|
85022
|
+
};
|
|
85023
|
+
|
|
85024
|
+
return _this;
|
|
85025
|
+
}
|
|
85026
|
+
|
|
85027
|
+
_createClass(CSSMotionList, [{
|
|
85028
|
+
key: "render",
|
|
85029
|
+
value: function render() {
|
|
85030
|
+
var _this2 = this;
|
|
85031
|
+
|
|
85032
|
+
var keyEntities = this.state.keyEntities;
|
|
85033
|
+
|
|
85034
|
+
var _this$props = this.props,
|
|
85035
|
+
component = _this$props.component,
|
|
85036
|
+
children = _this$props.children,
|
|
85037
|
+
_onVisibleChanged = _this$props.onVisibleChanged,
|
|
85038
|
+
onAllRemoved = _this$props.onAllRemoved,
|
|
85039
|
+
restProps = _objectWithoutProperties$1(_this$props, _excluded$1m);
|
|
85040
|
+
|
|
85041
|
+
var Component = component || React.Fragment;
|
|
85042
|
+
var motionProps = {};
|
|
85043
|
+
MOTION_PROP_NAMES.forEach(function (prop) {
|
|
85044
|
+
motionProps[prop] = restProps[prop];
|
|
85045
|
+
delete restProps[prop];
|
|
85046
|
+
});
|
|
85047
|
+
delete restProps.keys;
|
|
85048
|
+
return /*#__PURE__*/React.createElement(Component, restProps, keyEntities.map(function (_ref2) {
|
|
85049
|
+
var status = _ref2.status,
|
|
85050
|
+
eventProps = _objectWithoutProperties$1(_ref2, _excluded2$l);
|
|
85051
|
+
|
|
85052
|
+
var visible = status === STATUS_ADD || status === STATUS_KEEP;
|
|
85053
|
+
return /*#__PURE__*/React.createElement(CSSMotion$1, _extends$5({}, motionProps, {
|
|
85054
|
+
key: eventProps.key,
|
|
85055
|
+
visible: visible,
|
|
85056
|
+
eventProps: eventProps,
|
|
85057
|
+
onVisibleChanged: function onVisibleChanged(changedVisible) {
|
|
85058
|
+
_onVisibleChanged === null || _onVisibleChanged === void 0 ? void 0 : _onVisibleChanged(changedVisible, {
|
|
85059
|
+
key: eventProps.key
|
|
85060
|
+
});
|
|
85061
|
+
|
|
85062
|
+
if (!changedVisible) {
|
|
85063
|
+
var restKeysCount = _this2.removeKey(eventProps.key);
|
|
85064
|
+
|
|
85065
|
+
if (restKeysCount === 0 && onAllRemoved) {
|
|
85066
|
+
onAllRemoved();
|
|
85067
|
+
}
|
|
85068
|
+
}
|
|
85069
|
+
}
|
|
85070
|
+
}), children);
|
|
85071
|
+
}));
|
|
85072
|
+
}
|
|
85073
|
+
}], [{
|
|
85074
|
+
key: "getDerivedStateFromProps",
|
|
85075
|
+
value: function getDerivedStateFromProps(_ref3, _ref4) {
|
|
85076
|
+
var keys = _ref3.keys;
|
|
85077
|
+
var keyEntities = _ref4.keyEntities;
|
|
85078
|
+
var parsedKeyObjects = parseKeys(keys);
|
|
85079
|
+
var mixedKeyEntities = diffKeys(keyEntities, parsedKeyObjects);
|
|
85080
|
+
return {
|
|
85081
|
+
keyEntities: mixedKeyEntities.filter(function (entity) {
|
|
85082
|
+
var prevEntity = keyEntities.find(function (_ref5) {
|
|
85083
|
+
var key = _ref5.key;
|
|
85084
|
+
return entity.key === key;
|
|
85085
|
+
}); // Remove if already mark as removed
|
|
85086
|
+
|
|
85087
|
+
if (prevEntity && prevEntity.status === STATUS_REMOVED && entity.status === STATUS_REMOVE) {
|
|
85088
|
+
return false;
|
|
85089
|
+
}
|
|
85090
|
+
|
|
85091
|
+
return true;
|
|
85092
|
+
})
|
|
85093
|
+
};
|
|
85094
|
+
} // ZombieJ: Return the count of rest keys. It's safe to refactor if need more info.
|
|
85095
|
+
|
|
85096
|
+
}]);
|
|
85097
|
+
|
|
85098
|
+
return CSSMotionList;
|
|
85099
|
+
}(React.Component);
|
|
85100
|
+
|
|
85101
|
+
CSSMotionList.defaultProps = {
|
|
85102
|
+
component: 'div'
|
|
85103
|
+
};
|
|
85104
|
+
return CSSMotionList;
|
|
85105
|
+
}
|
|
85106
|
+
var CSSMotionList = genCSSMotionList(supportTransition);
|
|
85107
|
+
|
|
85108
|
+
var Notice = /*#__PURE__*/function (_Component) {
|
|
85109
|
+
_inherits(Notice, _Component);
|
|
85110
|
+
|
|
85111
|
+
var _super = _createSuper(Notice);
|
|
85112
|
+
|
|
85113
|
+
function Notice() {
|
|
85114
|
+
var _this;
|
|
85115
|
+
|
|
85116
|
+
_classCallCheck(this, Notice);
|
|
85117
|
+
|
|
85118
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
85119
|
+
args[_key] = arguments[_key];
|
|
85120
|
+
}
|
|
85121
|
+
|
|
85122
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
85123
|
+
_this.closeTimer = null;
|
|
85124
|
+
|
|
85125
|
+
_this.close = function (e) {
|
|
85126
|
+
if (e) {
|
|
85127
|
+
e.stopPropagation();
|
|
85128
|
+
}
|
|
85129
|
+
|
|
85130
|
+
_this.clearCloseTimer();
|
|
85131
|
+
|
|
85132
|
+
var _this$props = _this.props,
|
|
85133
|
+
onClose = _this$props.onClose,
|
|
85134
|
+
noticeKey = _this$props.noticeKey;
|
|
85135
|
+
|
|
85136
|
+
if (onClose) {
|
|
85137
|
+
onClose(noticeKey);
|
|
85138
|
+
}
|
|
85139
|
+
};
|
|
85140
|
+
|
|
85141
|
+
_this.startCloseTimer = function () {
|
|
85142
|
+
if (_this.props.duration) {
|
|
85143
|
+
_this.closeTimer = window.setTimeout(function () {
|
|
85144
|
+
_this.close();
|
|
85145
|
+
}, _this.props.duration * 1000);
|
|
85146
|
+
}
|
|
85147
|
+
};
|
|
85148
|
+
|
|
85149
|
+
_this.clearCloseTimer = function () {
|
|
85150
|
+
if (_this.closeTimer) {
|
|
85151
|
+
clearTimeout(_this.closeTimer);
|
|
85152
|
+
_this.closeTimer = null;
|
|
85153
|
+
}
|
|
85154
|
+
};
|
|
85155
|
+
|
|
85156
|
+
return _this;
|
|
85157
|
+
}
|
|
85158
|
+
|
|
85159
|
+
_createClass(Notice, [{
|
|
85160
|
+
key: "componentDidMount",
|
|
85161
|
+
value: function componentDidMount() {
|
|
85162
|
+
this.startCloseTimer();
|
|
85163
|
+
}
|
|
85164
|
+
}, {
|
|
85165
|
+
key: "componentDidUpdate",
|
|
85166
|
+
value: function componentDidUpdate(prevProps) {
|
|
85167
|
+
if (this.props.duration !== prevProps.duration || this.props.updateMark !== prevProps.updateMark || // Visible again need reset timer
|
|
85168
|
+
this.props.visible !== prevProps.visible && this.props.visible) {
|
|
85169
|
+
this.restartCloseTimer();
|
|
85170
|
+
}
|
|
85171
|
+
}
|
|
85172
|
+
}, {
|
|
85173
|
+
key: "componentWillUnmount",
|
|
85174
|
+
value: function componentWillUnmount() {
|
|
85175
|
+
this.clearCloseTimer();
|
|
85176
|
+
}
|
|
85177
|
+
}, {
|
|
85178
|
+
key: "restartCloseTimer",
|
|
85179
|
+
value: function restartCloseTimer() {
|
|
85180
|
+
this.clearCloseTimer();
|
|
85181
|
+
this.startCloseTimer();
|
|
85182
|
+
}
|
|
85183
|
+
}, {
|
|
85184
|
+
key: "render",
|
|
85185
|
+
value: function render() {
|
|
85186
|
+
var _this2 = this;
|
|
85187
|
+
|
|
85188
|
+
var _this$props2 = this.props,
|
|
85189
|
+
prefixCls = _this$props2.prefixCls,
|
|
85190
|
+
className = _this$props2.className,
|
|
85191
|
+
closable = _this$props2.closable,
|
|
85192
|
+
closeIcon = _this$props2.closeIcon,
|
|
85193
|
+
style = _this$props2.style,
|
|
85194
|
+
onClick = _this$props2.onClick,
|
|
85195
|
+
children = _this$props2.children,
|
|
85196
|
+
holder = _this$props2.holder;
|
|
85197
|
+
var componentClass = "".concat(prefixCls, "-notice");
|
|
85198
|
+
var dataOrAriaAttributeProps = Object.keys(this.props).reduce(function (acc, key) {
|
|
85199
|
+
if (key.substr(0, 5) === 'data-' || key.substr(0, 5) === 'aria-' || key === 'role') {
|
|
85200
|
+
acc[key] = _this2.props[key];
|
|
85201
|
+
}
|
|
85202
|
+
|
|
85203
|
+
return acc;
|
|
85204
|
+
}, {});
|
|
85205
|
+
var node = /*#__PURE__*/React.createElement("div", _extends$5({
|
|
85206
|
+
className: classnames(componentClass, className, _defineProperty$1({}, "".concat(componentClass, "-closable"), closable)),
|
|
85207
|
+
style: style,
|
|
85208
|
+
onMouseEnter: this.clearCloseTimer,
|
|
85209
|
+
onMouseLeave: this.startCloseTimer,
|
|
85210
|
+
onClick: onClick
|
|
85211
|
+
}, dataOrAriaAttributeProps), /*#__PURE__*/React.createElement("div", {
|
|
85212
|
+
className: "".concat(componentClass, "-content")
|
|
85213
|
+
}, children), closable ? /*#__PURE__*/React.createElement("a", {
|
|
85214
|
+
tabIndex: 0,
|
|
85215
|
+
onClick: this.close,
|
|
85216
|
+
className: "".concat(componentClass, "-close")
|
|
85217
|
+
}, closeIcon || /*#__PURE__*/React.createElement("span", {
|
|
85218
|
+
className: "".concat(componentClass, "-close-x")
|
|
85219
|
+
})) : null);
|
|
85220
|
+
|
|
85221
|
+
if (holder) {
|
|
85222
|
+
return /*#__PURE__*/ReactDOM__default['default'].createPortal(node, holder);
|
|
85223
|
+
}
|
|
85224
|
+
|
|
85225
|
+
return node;
|
|
85226
|
+
}
|
|
85227
|
+
}]);
|
|
85228
|
+
|
|
85229
|
+
return Notice;
|
|
85230
|
+
}(React.Component);
|
|
85231
|
+
|
|
85232
|
+
Notice.defaultProps = {
|
|
85233
|
+
onClose: function onClose() {},
|
|
85234
|
+
duration: 1.5
|
|
85235
|
+
};
|
|
85236
|
+
|
|
85237
|
+
function useNotification(notificationInstance) {
|
|
85238
|
+
var createdRef = React.useRef({});
|
|
85239
|
+
|
|
85240
|
+
var _React$useState = React.useState([]),
|
|
85241
|
+
_React$useState2 = _slicedToArray$1(_React$useState, 2),
|
|
85242
|
+
elements = _React$useState2[0],
|
|
85243
|
+
setElements = _React$useState2[1];
|
|
85244
|
+
|
|
85245
|
+
function notify(noticeProps) {
|
|
85246
|
+
var firstMount = true;
|
|
85247
|
+
notificationInstance.add(noticeProps, function (div, props) {
|
|
85248
|
+
var key = props.key;
|
|
85249
|
+
|
|
85250
|
+
if (div && (!createdRef.current[key] || firstMount)) {
|
|
85251
|
+
var noticeEle = /*#__PURE__*/React.createElement(Notice, _extends$5({}, props, {
|
|
85252
|
+
holder: div
|
|
85253
|
+
}));
|
|
85254
|
+
createdRef.current[key] = noticeEle;
|
|
85255
|
+
setElements(function (originElements) {
|
|
85256
|
+
var index = originElements.findIndex(function (ele) {
|
|
85257
|
+
return ele.key === props.key;
|
|
85258
|
+
});
|
|
85259
|
+
|
|
85260
|
+
if (index === -1) {
|
|
85261
|
+
return [].concat(_toConsumableArray$1(originElements), [noticeEle]);
|
|
85262
|
+
}
|
|
85263
|
+
|
|
85264
|
+
var cloneList = _toConsumableArray$1(originElements);
|
|
85265
|
+
|
|
85266
|
+
cloneList[index] = noticeEle;
|
|
85267
|
+
return cloneList;
|
|
85268
|
+
});
|
|
85269
|
+
}
|
|
85270
|
+
|
|
85271
|
+
firstMount = false;
|
|
85272
|
+
});
|
|
85273
|
+
}
|
|
85274
|
+
|
|
85275
|
+
return [notify, /*#__PURE__*/React.createElement(React.Fragment, null, elements)];
|
|
85276
|
+
}
|
|
85277
|
+
|
|
85278
|
+
var _excluded$1n = ["getContainer"];
|
|
85279
|
+
var seed = 0;
|
|
85280
|
+
var now$3 = Date.now();
|
|
85281
|
+
|
|
85282
|
+
function getUuid() {
|
|
85283
|
+
var id = seed;
|
|
85284
|
+
seed += 1;
|
|
85285
|
+
return "rcNotification_".concat(now$3, "_").concat(id);
|
|
85286
|
+
}
|
|
85287
|
+
|
|
85288
|
+
var Notification = /*#__PURE__*/function (_Component) {
|
|
85289
|
+
_inherits(Notification, _Component);
|
|
85290
|
+
|
|
85291
|
+
var _super = _createSuper(Notification);
|
|
85292
|
+
|
|
85293
|
+
function Notification() {
|
|
85294
|
+
var _this;
|
|
85295
|
+
|
|
85296
|
+
_classCallCheck(this, Notification);
|
|
85297
|
+
|
|
85298
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
85299
|
+
args[_key] = arguments[_key];
|
|
85300
|
+
}
|
|
85301
|
+
|
|
85302
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
85303
|
+
_this.state = {
|
|
85304
|
+
notices: []
|
|
85305
|
+
};
|
|
85306
|
+
_this.hookRefs = new Map();
|
|
85307
|
+
|
|
85308
|
+
_this.add = function (originNotice, holderCallback) {
|
|
85309
|
+
var key = originNotice.key || getUuid();
|
|
85310
|
+
|
|
85311
|
+
var notice = _objectSpread2(_objectSpread2({}, originNotice), {}, {
|
|
85312
|
+
key: key
|
|
85313
|
+
});
|
|
85314
|
+
|
|
85315
|
+
var maxCount = _this.props.maxCount;
|
|
85316
|
+
|
|
85317
|
+
_this.setState(function (previousState) {
|
|
85318
|
+
var notices = previousState.notices;
|
|
85319
|
+
var noticeIndex = notices.map(function (v) {
|
|
85320
|
+
return v.notice.key;
|
|
85321
|
+
}).indexOf(key);
|
|
85322
|
+
var updatedNotices = notices.concat();
|
|
85323
|
+
|
|
85324
|
+
if (noticeIndex !== -1) {
|
|
85325
|
+
updatedNotices.splice(noticeIndex, 1, {
|
|
85326
|
+
notice: notice,
|
|
85327
|
+
holderCallback: holderCallback
|
|
85328
|
+
});
|
|
85329
|
+
} else {
|
|
85330
|
+
if (maxCount && notices.length >= maxCount) {
|
|
85331
|
+
// XXX, use key of first item to update new added (let React to move exsiting
|
|
85332
|
+
// instead of remove and mount). Same key was used before for both a) external
|
|
85333
|
+
// manual control and b) internal react 'key' prop , which is not that good.
|
|
85334
|
+
// eslint-disable-next-line no-param-reassign
|
|
85335
|
+
// zombieJ: Not know why use `updateKey`. This makes Notice infinite loop in jest.
|
|
85336
|
+
// Change to `updateMark` for compare instead.
|
|
85337
|
+
// https://github.com/react-component/notification/commit/32299e6be396f94040bfa82517eea940db947ece
|
|
85338
|
+
notice.key = updatedNotices[0].notice.key;
|
|
85339
|
+
notice.updateMark = getUuid(); // zombieJ: That's why. User may close by key directly.
|
|
85340
|
+
// We need record this but not re-render to avoid upper issue
|
|
85341
|
+
// https://github.com/react-component/notification/issues/129
|
|
85342
|
+
|
|
85343
|
+
notice.userPassKey = key;
|
|
85344
|
+
updatedNotices.shift();
|
|
85345
|
+
}
|
|
85346
|
+
|
|
85347
|
+
updatedNotices.push({
|
|
85348
|
+
notice: notice,
|
|
85349
|
+
holderCallback: holderCallback
|
|
85350
|
+
});
|
|
85351
|
+
}
|
|
85352
|
+
|
|
85353
|
+
return {
|
|
85354
|
+
notices: updatedNotices
|
|
85355
|
+
};
|
|
85356
|
+
});
|
|
85357
|
+
};
|
|
85358
|
+
|
|
85359
|
+
_this.remove = function (removeKey) {
|
|
85360
|
+
_this.setState(function (_ref) {
|
|
85361
|
+
var notices = _ref.notices;
|
|
85362
|
+
return {
|
|
85363
|
+
notices: notices.filter(function (_ref2) {
|
|
85364
|
+
var _ref2$notice = _ref2.notice,
|
|
85365
|
+
key = _ref2$notice.key,
|
|
85366
|
+
userPassKey = _ref2$notice.userPassKey;
|
|
85367
|
+
var mergedKey = userPassKey || key;
|
|
85368
|
+
return mergedKey !== removeKey;
|
|
85369
|
+
})
|
|
85370
|
+
};
|
|
85371
|
+
});
|
|
85372
|
+
};
|
|
85373
|
+
|
|
85374
|
+
_this.noticePropsMap = {};
|
|
85375
|
+
return _this;
|
|
85376
|
+
}
|
|
85377
|
+
|
|
85378
|
+
_createClass(Notification, [{
|
|
85379
|
+
key: "getTransitionName",
|
|
85380
|
+
value: function getTransitionName() {
|
|
85381
|
+
var _this$props = this.props,
|
|
85382
|
+
prefixCls = _this$props.prefixCls,
|
|
85383
|
+
animation = _this$props.animation;
|
|
85384
|
+
var transitionName = this.props.transitionName;
|
|
85385
|
+
|
|
85386
|
+
if (!transitionName && animation) {
|
|
85387
|
+
transitionName = "".concat(prefixCls, "-").concat(animation);
|
|
85388
|
+
}
|
|
85389
|
+
|
|
85390
|
+
return transitionName;
|
|
85391
|
+
}
|
|
85392
|
+
}, {
|
|
85393
|
+
key: "render",
|
|
85394
|
+
value: function render() {
|
|
85395
|
+
var _this2 = this;
|
|
85396
|
+
|
|
85397
|
+
var notices = this.state.notices;
|
|
85398
|
+
var _this$props2 = this.props,
|
|
85399
|
+
prefixCls = _this$props2.prefixCls,
|
|
85400
|
+
className = _this$props2.className,
|
|
85401
|
+
closeIcon = _this$props2.closeIcon,
|
|
85402
|
+
style = _this$props2.style;
|
|
85403
|
+
var noticeKeys = [];
|
|
85404
|
+
notices.forEach(function (_ref3, index) {
|
|
85405
|
+
var notice = _ref3.notice,
|
|
85406
|
+
holderCallback = _ref3.holderCallback;
|
|
85407
|
+
var updateMark = index === notices.length - 1 ? notice.updateMark : undefined;
|
|
85408
|
+
var key = notice.key,
|
|
85409
|
+
userPassKey = notice.userPassKey;
|
|
85410
|
+
|
|
85411
|
+
var noticeProps = _objectSpread2(_objectSpread2(_objectSpread2({
|
|
85412
|
+
prefixCls: prefixCls,
|
|
85413
|
+
closeIcon: closeIcon
|
|
85414
|
+
}, notice), notice.props), {}, {
|
|
85415
|
+
key: key,
|
|
85416
|
+
noticeKey: userPassKey || key,
|
|
85417
|
+
updateMark: updateMark,
|
|
85418
|
+
onClose: function onClose(noticeKey) {
|
|
85419
|
+
var _notice$onClose;
|
|
85420
|
+
|
|
85421
|
+
_this2.remove(noticeKey);
|
|
85422
|
+
|
|
85423
|
+
(_notice$onClose = notice.onClose) === null || _notice$onClose === void 0 ? void 0 : _notice$onClose.call(notice);
|
|
85424
|
+
},
|
|
85425
|
+
onClick: notice.onClick,
|
|
85426
|
+
children: notice.content
|
|
85427
|
+
}); // Give to motion
|
|
85428
|
+
|
|
85429
|
+
|
|
85430
|
+
noticeKeys.push(key);
|
|
85431
|
+
_this2.noticePropsMap[key] = {
|
|
85432
|
+
props: noticeProps,
|
|
85433
|
+
holderCallback: holderCallback
|
|
85434
|
+
};
|
|
85435
|
+
});
|
|
85436
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
85437
|
+
className: classnames(prefixCls, className),
|
|
85438
|
+
style: style
|
|
85439
|
+
}, /*#__PURE__*/React.createElement(CSSMotionList, {
|
|
85440
|
+
keys: noticeKeys,
|
|
85441
|
+
motionName: this.getTransitionName(),
|
|
85442
|
+
onVisibleChanged: function onVisibleChanged(changedVisible, _ref4) {
|
|
85443
|
+
var key = _ref4.key;
|
|
85444
|
+
|
|
85445
|
+
if (!changedVisible) {
|
|
85446
|
+
delete _this2.noticePropsMap[key];
|
|
85447
|
+
}
|
|
85448
|
+
}
|
|
85449
|
+
}, function (_ref5) {
|
|
85450
|
+
var key = _ref5.key,
|
|
85451
|
+
motionClassName = _ref5.className,
|
|
85452
|
+
motionStyle = _ref5.style,
|
|
85453
|
+
visible = _ref5.visible;
|
|
85454
|
+
var _this2$noticePropsMap = _this2.noticePropsMap[key],
|
|
85455
|
+
noticeProps = _this2$noticePropsMap.props,
|
|
85456
|
+
holderCallback = _this2$noticePropsMap.holderCallback;
|
|
85457
|
+
|
|
85458
|
+
if (holderCallback) {
|
|
85459
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
85460
|
+
key: key,
|
|
85461
|
+
className: classnames(motionClassName, "".concat(prefixCls, "-hook-holder")),
|
|
85462
|
+
style: _objectSpread2({}, motionStyle),
|
|
85463
|
+
ref: function ref(div) {
|
|
85464
|
+
if (typeof key === 'undefined') {
|
|
85465
|
+
return;
|
|
85466
|
+
}
|
|
85467
|
+
|
|
85468
|
+
if (div) {
|
|
85469
|
+
_this2.hookRefs.set(key, div);
|
|
85470
|
+
|
|
85471
|
+
holderCallback(div, noticeProps);
|
|
85472
|
+
} else {
|
|
85473
|
+
_this2.hookRefs.delete(key);
|
|
85474
|
+
}
|
|
85475
|
+
}
|
|
85476
|
+
});
|
|
85477
|
+
}
|
|
85478
|
+
|
|
85479
|
+
return /*#__PURE__*/React.createElement(Notice, _extends$5({}, noticeProps, {
|
|
85480
|
+
className: classnames(motionClassName, noticeProps === null || noticeProps === void 0 ? void 0 : noticeProps.className),
|
|
85481
|
+
style: _objectSpread2(_objectSpread2({}, motionStyle), noticeProps === null || noticeProps === void 0 ? void 0 : noticeProps.style),
|
|
85482
|
+
visible: visible
|
|
85483
|
+
}));
|
|
85484
|
+
}));
|
|
85485
|
+
}
|
|
85486
|
+
}]);
|
|
85487
|
+
|
|
85488
|
+
return Notification;
|
|
85489
|
+
}(React.Component);
|
|
85490
|
+
|
|
85491
|
+
Notification.newInstance = void 0;
|
|
85492
|
+
Notification.defaultProps = {
|
|
85493
|
+
prefixCls: 'rc-notification',
|
|
85494
|
+
animation: 'fade',
|
|
85495
|
+
style: {
|
|
85496
|
+
top: 65,
|
|
85497
|
+
left: '50%'
|
|
85498
|
+
}
|
|
85499
|
+
};
|
|
85500
|
+
|
|
85501
|
+
Notification.newInstance = function newNotificationInstance(properties, callback) {
|
|
85502
|
+
var _ref6 = properties || {},
|
|
85503
|
+
getContainer = _ref6.getContainer,
|
|
85504
|
+
props = _objectWithoutProperties$1(_ref6, _excluded$1n);
|
|
85505
|
+
|
|
85506
|
+
var div = document.createElement('div');
|
|
85507
|
+
|
|
85508
|
+
if (getContainer) {
|
|
85509
|
+
var root = getContainer();
|
|
85510
|
+
root.appendChild(div);
|
|
85511
|
+
} else {
|
|
85512
|
+
document.body.appendChild(div);
|
|
85513
|
+
}
|
|
85514
|
+
|
|
85515
|
+
var called = false;
|
|
85516
|
+
|
|
85517
|
+
function ref(notification) {
|
|
85518
|
+
if (called) {
|
|
85519
|
+
return;
|
|
85520
|
+
}
|
|
85521
|
+
|
|
85522
|
+
called = true;
|
|
85523
|
+
callback({
|
|
85524
|
+
notice: function notice(noticeProps) {
|
|
85525
|
+
notification.add(noticeProps);
|
|
85526
|
+
},
|
|
85527
|
+
removeNotice: function removeNotice(key) {
|
|
85528
|
+
notification.remove(key);
|
|
85529
|
+
},
|
|
85530
|
+
component: notification,
|
|
85531
|
+
destroy: function destroy() {
|
|
85532
|
+
unmount(div);
|
|
85533
|
+
|
|
85534
|
+
if (div.parentNode) {
|
|
85535
|
+
div.parentNode.removeChild(div);
|
|
85536
|
+
}
|
|
85537
|
+
},
|
|
85538
|
+
// Hooks
|
|
85539
|
+
useNotification: function useNotification$1() {
|
|
85540
|
+
return useNotification(notification);
|
|
85541
|
+
}
|
|
84490
85542
|
});
|
|
85543
|
+
} // Only used for test case usage
|
|
85544
|
+
|
|
85545
|
+
render$3( /*#__PURE__*/React.createElement(Notification, _extends$5({}, props, {
|
|
85546
|
+
ref: ref
|
|
85547
|
+
})), div);
|
|
85548
|
+
};
|
|
85549
|
+
|
|
85550
|
+
var interopRequireWildcard = createCommonjsModule(function (module) {
|
|
85551
|
+
var _typeof = _typeof_1["default"];
|
|
85552
|
+
|
|
85553
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
85554
|
+
if (typeof WeakMap !== "function") return null;
|
|
85555
|
+
var cacheBabelInterop = new WeakMap();
|
|
85556
|
+
var cacheNodeInterop = new WeakMap();
|
|
85557
|
+
return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) {
|
|
85558
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
85559
|
+
})(nodeInterop);
|
|
85560
|
+
}
|
|
85561
|
+
|
|
85562
|
+
function _interopRequireWildcard(obj, nodeInterop) {
|
|
85563
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
85564
|
+
return obj;
|
|
85565
|
+
}
|
|
85566
|
+
|
|
85567
|
+
if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
|
|
84491
85568
|
return {
|
|
84492
|
-
|
|
84493
|
-
checkAll: showLength.length === localFilter.length
|
|
85569
|
+
"default": obj
|
|
84494
85570
|
};
|
|
84495
|
-
}
|
|
84496
|
-
|
|
85571
|
+
}
|
|
85572
|
+
|
|
85573
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
85574
|
+
|
|
85575
|
+
if (cache && cache.has(obj)) {
|
|
85576
|
+
return cache.get(obj);
|
|
85577
|
+
}
|
|
85578
|
+
|
|
85579
|
+
var newObj = {};
|
|
85580
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
85581
|
+
|
|
85582
|
+
for (var key in obj) {
|
|
85583
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
85584
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
85585
|
+
|
|
85586
|
+
if (desc && (desc.get || desc.set)) {
|
|
85587
|
+
Object.defineProperty(newObj, key, desc);
|
|
85588
|
+
} else {
|
|
85589
|
+
newObj[key] = obj[key];
|
|
85590
|
+
}
|
|
85591
|
+
}
|
|
85592
|
+
}
|
|
85593
|
+
|
|
85594
|
+
newObj["default"] = obj;
|
|
85595
|
+
|
|
85596
|
+
if (cache) {
|
|
85597
|
+
cache.set(obj, newObj);
|
|
85598
|
+
}
|
|
85599
|
+
|
|
85600
|
+
return newObj;
|
|
85601
|
+
}
|
|
85602
|
+
|
|
85603
|
+
module.exports = _interopRequireWildcard, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
85604
|
+
});
|
|
85605
|
+
|
|
85606
|
+
var interopRequireDefault = createCommonjsModule(function (module) {
|
|
85607
|
+
function _interopRequireDefault(obj) {
|
|
85608
|
+
return obj && obj.__esModule ? obj : {
|
|
85609
|
+
"default": obj
|
|
85610
|
+
};
|
|
85611
|
+
}
|
|
85612
|
+
|
|
85613
|
+
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
85614
|
+
});
|
|
85615
|
+
|
|
85616
|
+
var classCallCheck$1 = createCommonjsModule(function (module) {
|
|
85617
|
+
function _classCallCheck(instance, Constructor) {
|
|
85618
|
+
if (!(instance instanceof Constructor)) {
|
|
85619
|
+
throw new TypeError("Cannot call a class as a function");
|
|
85620
|
+
}
|
|
85621
|
+
}
|
|
85622
|
+
|
|
85623
|
+
module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
85624
|
+
});
|
|
85625
|
+
|
|
85626
|
+
var createClass$1 = createCommonjsModule(function (module) {
|
|
85627
|
+
function _defineProperties(target, props) {
|
|
85628
|
+
for (var i = 0; i < props.length; i++) {
|
|
85629
|
+
var descriptor = props[i];
|
|
85630
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
85631
|
+
descriptor.configurable = true;
|
|
85632
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
85633
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
85634
|
+
}
|
|
85635
|
+
}
|
|
85636
|
+
|
|
85637
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
85638
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
85639
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
85640
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
85641
|
+
writable: false
|
|
85642
|
+
});
|
|
85643
|
+
return Constructor;
|
|
85644
|
+
}
|
|
85645
|
+
|
|
85646
|
+
module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
85647
|
+
});
|
|
85648
|
+
|
|
85649
|
+
var setPrototypeOf = createCommonjsModule(function (module) {
|
|
85650
|
+
function _setPrototypeOf(o, p) {
|
|
85651
|
+
module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
85652
|
+
o.__proto__ = p;
|
|
85653
|
+
return o;
|
|
85654
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
85655
|
+
return _setPrototypeOf(o, p);
|
|
85656
|
+
}
|
|
85657
|
+
|
|
85658
|
+
module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
85659
|
+
});
|
|
85660
|
+
|
|
85661
|
+
var inherits$1 = createCommonjsModule(function (module) {
|
|
85662
|
+
function _inherits(subClass, superClass) {
|
|
85663
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
85664
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
85665
|
+
}
|
|
85666
|
+
|
|
85667
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
85668
|
+
constructor: {
|
|
85669
|
+
value: subClass,
|
|
85670
|
+
writable: true,
|
|
85671
|
+
configurable: true
|
|
85672
|
+
}
|
|
85673
|
+
});
|
|
85674
|
+
Object.defineProperty(subClass, "prototype", {
|
|
85675
|
+
writable: false
|
|
85676
|
+
});
|
|
85677
|
+
if (superClass) setPrototypeOf(subClass, superClass);
|
|
85678
|
+
}
|
|
85679
|
+
|
|
85680
|
+
module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
85681
|
+
});
|
|
85682
|
+
|
|
85683
|
+
var getPrototypeOf = createCommonjsModule(function (module) {
|
|
85684
|
+
function _getPrototypeOf(o) {
|
|
85685
|
+
module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
85686
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
85687
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
85688
|
+
return _getPrototypeOf(o);
|
|
85689
|
+
}
|
|
85690
|
+
|
|
85691
|
+
module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
85692
|
+
});
|
|
85693
|
+
|
|
85694
|
+
var isNativeReflectConstruct = createCommonjsModule(function (module) {
|
|
85695
|
+
function _isNativeReflectConstruct() {
|
|
85696
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
85697
|
+
if (Reflect.construct.sham) return false;
|
|
85698
|
+
if (typeof Proxy === "function") return true;
|
|
85699
|
+
|
|
85700
|
+
try {
|
|
85701
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
85702
|
+
return true;
|
|
85703
|
+
} catch (e) {
|
|
85704
|
+
return false;
|
|
85705
|
+
}
|
|
85706
|
+
}
|
|
85707
|
+
|
|
85708
|
+
module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
85709
|
+
});
|
|
85710
|
+
|
|
85711
|
+
var assertThisInitialized = createCommonjsModule(function (module) {
|
|
85712
|
+
function _assertThisInitialized(self) {
|
|
85713
|
+
if (self === void 0) {
|
|
85714
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
85715
|
+
}
|
|
85716
|
+
|
|
85717
|
+
return self;
|
|
85718
|
+
}
|
|
85719
|
+
|
|
85720
|
+
module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
85721
|
+
});
|
|
85722
|
+
|
|
85723
|
+
var possibleConstructorReturn$1 = createCommonjsModule(function (module) {
|
|
85724
|
+
var _typeof = _typeof_1["default"];
|
|
85725
|
+
|
|
85726
|
+
|
|
85727
|
+
|
|
85728
|
+
function _possibleConstructorReturn(self, call) {
|
|
85729
|
+
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
85730
|
+
return call;
|
|
85731
|
+
} else if (call !== void 0) {
|
|
85732
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
85733
|
+
}
|
|
85734
|
+
|
|
85735
|
+
return assertThisInitialized(self);
|
|
85736
|
+
}
|
|
85737
|
+
|
|
85738
|
+
module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
85739
|
+
});
|
|
85740
|
+
|
|
85741
|
+
var createSuper = createCommonjsModule(function (module) {
|
|
85742
|
+
function _createSuper(Derived) {
|
|
85743
|
+
var hasNativeReflectConstruct = isNativeReflectConstruct();
|
|
85744
|
+
return function _createSuperInternal() {
|
|
85745
|
+
var Super = getPrototypeOf(Derived),
|
|
85746
|
+
result;
|
|
85747
|
+
|
|
85748
|
+
if (hasNativeReflectConstruct) {
|
|
85749
|
+
var NewTarget = getPrototypeOf(this).constructor;
|
|
85750
|
+
result = Reflect.construct(Super, arguments, NewTarget);
|
|
85751
|
+
} else {
|
|
85752
|
+
result = Super.apply(this, arguments);
|
|
85753
|
+
}
|
|
85754
|
+
|
|
85755
|
+
return possibleConstructorReturn$1(this, result);
|
|
85756
|
+
};
|
|
85757
|
+
}
|
|
85758
|
+
|
|
85759
|
+
module.exports = _createSuper, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
85760
|
+
});
|
|
85761
|
+
|
|
85762
|
+
var Notice_1 = createCommonjsModule(function (module, exports) {
|
|
85763
|
+
|
|
85764
|
+
|
|
85765
|
+
|
|
85766
|
+
|
|
85767
|
+
|
|
85768
|
+
Object.defineProperty(exports, "__esModule", {
|
|
85769
|
+
value: true
|
|
85770
|
+
});
|
|
85771
|
+
exports.default = void 0;
|
|
85772
|
+
|
|
85773
|
+
var _extends2 = interopRequireDefault(_extends_1);
|
|
85774
|
+
|
|
85775
|
+
var _defineProperty2 = interopRequireDefault(defineProperty);
|
|
85776
|
+
|
|
85777
|
+
var _classCallCheck2 = interopRequireDefault(classCallCheck$1);
|
|
85778
|
+
|
|
85779
|
+
var _createClass2 = interopRequireDefault(createClass$1);
|
|
85780
|
+
|
|
85781
|
+
var _inherits2 = interopRequireDefault(inherits$1);
|
|
85782
|
+
|
|
85783
|
+
var _createSuper2 = interopRequireDefault(createSuper);
|
|
85784
|
+
|
|
85785
|
+
var React = interopRequireWildcard(React__default['default']);
|
|
85786
|
+
|
|
85787
|
+
var _reactDom = interopRequireDefault(ReactDOM__default['default']);
|
|
85788
|
+
|
|
85789
|
+
var _classnames = interopRequireDefault(classnames);
|
|
85790
|
+
|
|
85791
|
+
var Notice = /*#__PURE__*/function (_Component) {
|
|
85792
|
+
(0, _inherits2.default)(Notice, _Component);
|
|
85793
|
+
|
|
85794
|
+
var _super = (0, _createSuper2.default)(Notice);
|
|
85795
|
+
|
|
85796
|
+
function Notice() {
|
|
85797
|
+
var _this;
|
|
85798
|
+
|
|
85799
|
+
(0, _classCallCheck2.default)(this, Notice);
|
|
85800
|
+
|
|
85801
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
85802
|
+
args[_key] = arguments[_key];
|
|
85803
|
+
}
|
|
85804
|
+
|
|
85805
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
85806
|
+
_this.closeTimer = null;
|
|
85807
|
+
|
|
85808
|
+
_this.close = function (e) {
|
|
85809
|
+
if (e) {
|
|
85810
|
+
e.stopPropagation();
|
|
85811
|
+
}
|
|
85812
|
+
|
|
85813
|
+
_this.clearCloseTimer();
|
|
85814
|
+
|
|
85815
|
+
var _this$props = _this.props,
|
|
85816
|
+
onClose = _this$props.onClose,
|
|
85817
|
+
noticeKey = _this$props.noticeKey;
|
|
85818
|
+
|
|
85819
|
+
if (onClose) {
|
|
85820
|
+
onClose(noticeKey);
|
|
85821
|
+
}
|
|
85822
|
+
};
|
|
85823
|
+
|
|
85824
|
+
_this.startCloseTimer = function () {
|
|
85825
|
+
if (_this.props.duration) {
|
|
85826
|
+
_this.closeTimer = window.setTimeout(function () {
|
|
85827
|
+
_this.close();
|
|
85828
|
+
}, _this.props.duration * 1000);
|
|
85829
|
+
}
|
|
85830
|
+
};
|
|
85831
|
+
|
|
85832
|
+
_this.clearCloseTimer = function () {
|
|
85833
|
+
if (_this.closeTimer) {
|
|
85834
|
+
clearTimeout(_this.closeTimer);
|
|
85835
|
+
_this.closeTimer = null;
|
|
85836
|
+
}
|
|
85837
|
+
};
|
|
85838
|
+
|
|
85839
|
+
return _this;
|
|
85840
|
+
}
|
|
85841
|
+
|
|
85842
|
+
(0, _createClass2.default)(Notice, [{
|
|
85843
|
+
key: "componentDidMount",
|
|
85844
|
+
value: function componentDidMount() {
|
|
85845
|
+
this.startCloseTimer();
|
|
85846
|
+
}
|
|
85847
|
+
}, {
|
|
85848
|
+
key: "componentDidUpdate",
|
|
85849
|
+
value: function componentDidUpdate(prevProps) {
|
|
85850
|
+
if (this.props.duration !== prevProps.duration || this.props.updateMark !== prevProps.updateMark || // Visible again need reset timer
|
|
85851
|
+
this.props.visible !== prevProps.visible && this.props.visible) {
|
|
85852
|
+
this.restartCloseTimer();
|
|
85853
|
+
}
|
|
85854
|
+
}
|
|
85855
|
+
}, {
|
|
85856
|
+
key: "componentWillUnmount",
|
|
85857
|
+
value: function componentWillUnmount() {
|
|
85858
|
+
this.clearCloseTimer();
|
|
85859
|
+
}
|
|
85860
|
+
}, {
|
|
85861
|
+
key: "restartCloseTimer",
|
|
85862
|
+
value: function restartCloseTimer() {
|
|
85863
|
+
this.clearCloseTimer();
|
|
85864
|
+
this.startCloseTimer();
|
|
85865
|
+
}
|
|
85866
|
+
}, {
|
|
85867
|
+
key: "render",
|
|
85868
|
+
value: function render() {
|
|
85869
|
+
var _this2 = this;
|
|
85870
|
+
|
|
85871
|
+
var _this$props2 = this.props,
|
|
85872
|
+
prefixCls = _this$props2.prefixCls,
|
|
85873
|
+
className = _this$props2.className,
|
|
85874
|
+
closable = _this$props2.closable,
|
|
85875
|
+
closeIcon = _this$props2.closeIcon,
|
|
85876
|
+
style = _this$props2.style,
|
|
85877
|
+
onClick = _this$props2.onClick,
|
|
85878
|
+
children = _this$props2.children,
|
|
85879
|
+
holder = _this$props2.holder;
|
|
85880
|
+
var componentClass = "".concat(prefixCls, "-notice");
|
|
85881
|
+
var dataOrAriaAttributeProps = Object.keys(this.props).reduce(function (acc, key) {
|
|
85882
|
+
if (key.substr(0, 5) === 'data-' || key.substr(0, 5) === 'aria-' || key === 'role') {
|
|
85883
|
+
acc[key] = _this2.props[key];
|
|
85884
|
+
}
|
|
85885
|
+
|
|
85886
|
+
return acc;
|
|
85887
|
+
}, {});
|
|
85888
|
+
var node = /*#__PURE__*/React.createElement("div", (0, _extends2.default)({
|
|
85889
|
+
className: (0, _classnames.default)(componentClass, className, (0, _defineProperty2.default)({}, "".concat(componentClass, "-closable"), closable)),
|
|
85890
|
+
style: style,
|
|
85891
|
+
onMouseEnter: this.clearCloseTimer,
|
|
85892
|
+
onMouseLeave: this.startCloseTimer,
|
|
85893
|
+
onClick: onClick
|
|
85894
|
+
}, dataOrAriaAttributeProps), /*#__PURE__*/React.createElement("div", {
|
|
85895
|
+
className: "".concat(componentClass, "-content")
|
|
85896
|
+
}, children), closable ? /*#__PURE__*/React.createElement("a", {
|
|
85897
|
+
tabIndex: 0,
|
|
85898
|
+
onClick: this.close,
|
|
85899
|
+
className: "".concat(componentClass, "-close")
|
|
85900
|
+
}, closeIcon || /*#__PURE__*/React.createElement("span", {
|
|
85901
|
+
className: "".concat(componentClass, "-close-x")
|
|
85902
|
+
})) : null);
|
|
85903
|
+
|
|
85904
|
+
if (holder) {
|
|
85905
|
+
return /*#__PURE__*/_reactDom.default.createPortal(node, holder);
|
|
85906
|
+
}
|
|
85907
|
+
|
|
85908
|
+
return node;
|
|
85909
|
+
}
|
|
85910
|
+
}]);
|
|
85911
|
+
return Notice;
|
|
85912
|
+
}(React.Component);
|
|
85913
|
+
|
|
85914
|
+
exports.default = Notice;
|
|
85915
|
+
Notice.defaultProps = {
|
|
85916
|
+
onClose: function onClose() {},
|
|
85917
|
+
duration: 1.5
|
|
85918
|
+
};
|
|
85919
|
+
});
|
|
85920
|
+
|
|
85921
|
+
var useNotification_1 = createCommonjsModule(function (module, exports) {
|
|
85922
|
+
|
|
85923
|
+
|
|
85924
|
+
|
|
85925
|
+
|
|
85926
|
+
|
|
85927
|
+
Object.defineProperty(exports, "__esModule", {
|
|
85928
|
+
value: true
|
|
85929
|
+
});
|
|
85930
|
+
exports.default = useNotification;
|
|
85931
|
+
|
|
85932
|
+
var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
|
|
85933
|
+
|
|
85934
|
+
var _extends2 = interopRequireDefault(_extends_1);
|
|
85935
|
+
|
|
85936
|
+
var _slicedToArray2 = interopRequireDefault(slicedToArray);
|
|
85937
|
+
|
|
85938
|
+
var React = interopRequireWildcard(React__default['default']);
|
|
85939
|
+
|
|
85940
|
+
var _Notice = interopRequireDefault(Notice_1);
|
|
85941
|
+
|
|
85942
|
+
function useNotification(notificationInstance) {
|
|
85943
|
+
var createdRef = React.useRef({});
|
|
85944
|
+
|
|
85945
|
+
var _React$useState = React.useState([]),
|
|
85946
|
+
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
85947
|
+
elements = _React$useState2[0],
|
|
85948
|
+
setElements = _React$useState2[1];
|
|
85949
|
+
|
|
85950
|
+
function notify(noticeProps) {
|
|
85951
|
+
var firstMount = true;
|
|
85952
|
+
notificationInstance.add(noticeProps, function (div, props) {
|
|
85953
|
+
var key = props.key;
|
|
85954
|
+
|
|
85955
|
+
if (div && (!createdRef.current[key] || firstMount)) {
|
|
85956
|
+
var noticeEle = /*#__PURE__*/React.createElement(_Notice.default, (0, _extends2.default)({}, props, {
|
|
85957
|
+
holder: div
|
|
85958
|
+
}));
|
|
85959
|
+
createdRef.current[key] = noticeEle;
|
|
85960
|
+
setElements(function (originElements) {
|
|
85961
|
+
var index = originElements.findIndex(function (ele) {
|
|
85962
|
+
return ele.key === props.key;
|
|
85963
|
+
});
|
|
85964
|
+
|
|
85965
|
+
if (index === -1) {
|
|
85966
|
+
return [].concat((0, _toConsumableArray2.default)(originElements), [noticeEle]);
|
|
85967
|
+
}
|
|
85968
|
+
|
|
85969
|
+
var cloneList = (0, _toConsumableArray2.default)(originElements);
|
|
85970
|
+
cloneList[index] = noticeEle;
|
|
85971
|
+
return cloneList;
|
|
85972
|
+
});
|
|
85973
|
+
}
|
|
85974
|
+
|
|
85975
|
+
firstMount = false;
|
|
85976
|
+
});
|
|
85977
|
+
}
|
|
85978
|
+
|
|
85979
|
+
return [notify, /*#__PURE__*/React.createElement(React.Fragment, null, elements)];
|
|
85980
|
+
}
|
|
85981
|
+
});
|
|
85982
|
+
|
|
85983
|
+
var useRCNotification = /*@__PURE__*/getDefaultExportFromCjs(useNotification_1);
|
|
85984
|
+
|
|
85985
|
+
function createUseMessage(getRcNotificationInstance, getRCNoticeProps) {
|
|
85986
|
+
var useMessage = function useMessage() {
|
|
85987
|
+
// We can only get content by render
|
|
85988
|
+
var getPrefixCls;
|
|
85989
|
+
var getPopupContainer; // We create a proxy to handle delay created instance
|
|
85990
|
+
|
|
85991
|
+
var innerInstance = null;
|
|
85992
|
+
var proxy = {
|
|
85993
|
+
add: function add(noticeProps, holderCallback) {
|
|
85994
|
+
var _innerInstance;
|
|
85995
|
+
|
|
85996
|
+
(_innerInstance = innerInstance) === null || _innerInstance === void 0 ? void 0 : _innerInstance.component.add(noticeProps, holderCallback);
|
|
85997
|
+
}
|
|
85998
|
+
};
|
|
85999
|
+
|
|
86000
|
+
var _useRCNotification = useRCNotification(proxy),
|
|
86001
|
+
_useRCNotification2 = _slicedToArray(_useRCNotification, 2),
|
|
86002
|
+
hookNotify = _useRCNotification2[0],
|
|
86003
|
+
holder = _useRCNotification2[1];
|
|
86004
|
+
|
|
86005
|
+
function notify(args) {
|
|
86006
|
+
var customizePrefixCls = args.prefixCls;
|
|
86007
|
+
var mergedPrefixCls = getPrefixCls('message', customizePrefixCls);
|
|
86008
|
+
var rootPrefixCls = getPrefixCls();
|
|
86009
|
+
var target = args.key || getKeyThenIncreaseKey();
|
|
86010
|
+
var closePromise = new Promise(function (resolve) {
|
|
86011
|
+
var callback = function callback() {
|
|
86012
|
+
if (typeof args.onClose === 'function') {
|
|
86013
|
+
args.onClose();
|
|
86014
|
+
}
|
|
86015
|
+
|
|
86016
|
+
return resolve(true);
|
|
86017
|
+
};
|
|
86018
|
+
|
|
86019
|
+
getRcNotificationInstance(_objectSpread(_objectSpread({}, args), {}, {
|
|
86020
|
+
prefixCls: mergedPrefixCls,
|
|
86021
|
+
rootPrefixCls: rootPrefixCls,
|
|
86022
|
+
getPopupContainer: getPopupContainer
|
|
86023
|
+
}), function (_ref) {
|
|
86024
|
+
var prefixCls = _ref.prefixCls,
|
|
86025
|
+
instance = _ref.instance;
|
|
86026
|
+
innerInstance = instance;
|
|
86027
|
+
hookNotify(getRCNoticeProps(_objectSpread(_objectSpread({}, args), {}, {
|
|
86028
|
+
key: target,
|
|
86029
|
+
onClose: callback
|
|
86030
|
+
}), prefixCls));
|
|
86031
|
+
});
|
|
86032
|
+
});
|
|
86033
|
+
|
|
86034
|
+
var result = function result() {
|
|
86035
|
+
if (innerInstance) {
|
|
86036
|
+
innerInstance.removeNotice(target);
|
|
86037
|
+
}
|
|
86038
|
+
};
|
|
86039
|
+
|
|
86040
|
+
result.then = function (filled, rejected) {
|
|
86041
|
+
return closePromise.then(filled, rejected);
|
|
86042
|
+
};
|
|
86043
|
+
|
|
86044
|
+
result.promise = closePromise;
|
|
86045
|
+
return result;
|
|
86046
|
+
} // Fill functions
|
|
86047
|
+
|
|
86048
|
+
|
|
86049
|
+
var hookApiRef = React.useRef({});
|
|
86050
|
+
hookApiRef.current.open = notify;
|
|
86051
|
+
typeList.forEach(function (type) {
|
|
86052
|
+
return attachTypeApi(hookApiRef.current, type);
|
|
86053
|
+
});
|
|
86054
|
+
return [hookApiRef.current, /*#__PURE__*/React.createElement(_ConfigProvider.ConfigConsumer, {
|
|
86055
|
+
key: "holder"
|
|
86056
|
+
}, function (context) {
|
|
86057
|
+
getPrefixCls = context.getPrefixCls;
|
|
86058
|
+
getPopupContainer = context.getPopupContainer;
|
|
86059
|
+
return holder;
|
|
86060
|
+
})];
|
|
86061
|
+
};
|
|
86062
|
+
|
|
86063
|
+
return useMessage;
|
|
86064
|
+
}
|
|
86065
|
+
|
|
86066
|
+
var messageInstance;
|
|
86067
|
+
var defaultDuration = 3;
|
|
86068
|
+
var defaultTop;
|
|
86069
|
+
var key = 1;
|
|
86070
|
+
var localPrefixCls = '';
|
|
86071
|
+
var transitionName = 'move-up';
|
|
86072
|
+
var hasTransitionName = false;
|
|
86073
|
+
var getContainer$1;
|
|
86074
|
+
var maxCount;
|
|
86075
|
+
var rtl = false;
|
|
86076
|
+
function getKeyThenIncreaseKey() {
|
|
86077
|
+
return key++;
|
|
86078
|
+
}
|
|
86079
|
+
|
|
86080
|
+
function setMessageConfig(options) {
|
|
86081
|
+
if (options.top !== undefined) {
|
|
86082
|
+
defaultTop = options.top;
|
|
86083
|
+
messageInstance = null; // delete messageInstance for new defaultTop
|
|
86084
|
+
}
|
|
86085
|
+
|
|
86086
|
+
if (options.duration !== undefined) {
|
|
86087
|
+
defaultDuration = options.duration;
|
|
86088
|
+
}
|
|
86089
|
+
|
|
86090
|
+
if (options.prefixCls !== undefined) {
|
|
86091
|
+
localPrefixCls = options.prefixCls;
|
|
86092
|
+
}
|
|
86093
|
+
|
|
86094
|
+
if (options.getContainer !== undefined) {
|
|
86095
|
+
getContainer$1 = options.getContainer;
|
|
86096
|
+
messageInstance = null; // delete messageInstance for new getContainer
|
|
86097
|
+
}
|
|
86098
|
+
|
|
86099
|
+
if (options.transitionName !== undefined) {
|
|
86100
|
+
transitionName = options.transitionName;
|
|
86101
|
+
messageInstance = null; // delete messageInstance for new transitionName
|
|
86102
|
+
|
|
86103
|
+
hasTransitionName = true;
|
|
86104
|
+
}
|
|
86105
|
+
|
|
86106
|
+
if (options.maxCount !== undefined) {
|
|
86107
|
+
maxCount = options.maxCount;
|
|
86108
|
+
messageInstance = null;
|
|
86109
|
+
}
|
|
86110
|
+
|
|
86111
|
+
if (options.rtl !== undefined) {
|
|
86112
|
+
rtl = options.rtl;
|
|
86113
|
+
}
|
|
86114
|
+
}
|
|
86115
|
+
|
|
86116
|
+
function getRCNotificationInstance(args, callback) {
|
|
86117
|
+
var customizePrefixCls = args.prefixCls,
|
|
86118
|
+
getContextPopupContainer = args.getPopupContainer;
|
|
86119
|
+
|
|
86120
|
+
var _globalConfig = _ConfigProvider.globalConfig(),
|
|
86121
|
+
getPrefixCls = _globalConfig.getPrefixCls,
|
|
86122
|
+
getRootPrefixCls = _globalConfig.getRootPrefixCls,
|
|
86123
|
+
getIconPrefixCls = _globalConfig.getIconPrefixCls;
|
|
86124
|
+
|
|
86125
|
+
var prefixCls = getPrefixCls('message', customizePrefixCls || localPrefixCls);
|
|
86126
|
+
var rootPrefixCls = getRootPrefixCls(args.rootPrefixCls, prefixCls);
|
|
86127
|
+
var iconPrefixCls = getIconPrefixCls();
|
|
86128
|
+
|
|
86129
|
+
if (messageInstance) {
|
|
86130
|
+
callback({
|
|
86131
|
+
prefixCls: prefixCls,
|
|
86132
|
+
rootPrefixCls: rootPrefixCls,
|
|
86133
|
+
iconPrefixCls: iconPrefixCls,
|
|
86134
|
+
instance: messageInstance
|
|
86135
|
+
});
|
|
86136
|
+
return;
|
|
86137
|
+
}
|
|
86138
|
+
|
|
86139
|
+
var instanceConfig = {
|
|
86140
|
+
prefixCls: prefixCls,
|
|
86141
|
+
transitionName: hasTransitionName ? transitionName : "".concat(rootPrefixCls, "-").concat(transitionName),
|
|
86142
|
+
style: {
|
|
86143
|
+
top: defaultTop
|
|
86144
|
+
},
|
|
86145
|
+
getContainer: getContainer$1 || getContextPopupContainer,
|
|
86146
|
+
maxCount: maxCount
|
|
86147
|
+
};
|
|
86148
|
+
Notification.newInstance(instanceConfig, function (instance) {
|
|
86149
|
+
if (messageInstance) {
|
|
86150
|
+
callback({
|
|
86151
|
+
prefixCls: prefixCls,
|
|
86152
|
+
rootPrefixCls: rootPrefixCls,
|
|
86153
|
+
iconPrefixCls: iconPrefixCls,
|
|
86154
|
+
instance: messageInstance
|
|
86155
|
+
});
|
|
86156
|
+
return;
|
|
86157
|
+
}
|
|
86158
|
+
|
|
86159
|
+
messageInstance = instance;
|
|
86160
|
+
|
|
86161
|
+
callback({
|
|
86162
|
+
prefixCls: prefixCls,
|
|
86163
|
+
rootPrefixCls: rootPrefixCls,
|
|
86164
|
+
iconPrefixCls: iconPrefixCls,
|
|
86165
|
+
instance: instance
|
|
86166
|
+
});
|
|
86167
|
+
});
|
|
86168
|
+
}
|
|
86169
|
+
|
|
86170
|
+
var typeToIcon = {
|
|
86171
|
+
info: InfoCircleFilled$2,
|
|
86172
|
+
success: CheckCircleFilled$2,
|
|
86173
|
+
error: CloseCircleFilled$2,
|
|
86174
|
+
warning: ExclamationCircleFilled$2,
|
|
86175
|
+
loading: LoadingOutlined$2
|
|
86176
|
+
};
|
|
86177
|
+
var typeList = Object.keys(typeToIcon);
|
|
86178
|
+
|
|
86179
|
+
function getRCNoticeProps(args, prefixCls, iconPrefixCls) {
|
|
86180
|
+
var _classNames;
|
|
86181
|
+
|
|
86182
|
+
var duration = args.duration !== undefined ? args.duration : defaultDuration;
|
|
86183
|
+
var progress = args.progress === false ? false : true;
|
|
86184
|
+
var IconComponent = typeToIcon[args.type];
|
|
86185
|
+
var messageClass = classnames("".concat(prefixCls, "-custom-content"), (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-").concat(args.type), args.type), _defineProperty(_classNames, "".concat(prefixCls, "-rtl"), rtl === true), _classNames));
|
|
86186
|
+
return {
|
|
86187
|
+
key: args.key,
|
|
86188
|
+
duration: duration,
|
|
86189
|
+
style: args.style || {},
|
|
86190
|
+
className: classnames(args.className, 'lm_message'),
|
|
86191
|
+
content: /*#__PURE__*/React__default['default'].createElement(_ConfigProvider__default['default'], {
|
|
86192
|
+
iconPrefixCls: iconPrefixCls
|
|
86193
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
86194
|
+
className: messageClass
|
|
86195
|
+
}, args.icon || IconComponent && /*#__PURE__*/React__default['default'].createElement(IconComponent, null), /*#__PURE__*/React__default['default'].createElement("span", null, args.content), progress && duration > 0 && /*#__PURE__*/React__default['default'].createElement("div", {
|
|
86196
|
+
className: 'message_progress',
|
|
86197
|
+
style: {
|
|
86198
|
+
animationDuration: "".concat(duration, "s")
|
|
86199
|
+
}
|
|
86200
|
+
}))),
|
|
86201
|
+
onClose: args.onClose,
|
|
86202
|
+
onClick: args.onClick
|
|
86203
|
+
};
|
|
86204
|
+
}
|
|
86205
|
+
|
|
86206
|
+
function notice(args) {
|
|
86207
|
+
var target = args.key || getKeyThenIncreaseKey();
|
|
86208
|
+
var closePromise = new Promise(function (resolve) {
|
|
86209
|
+
var callback = function callback() {
|
|
86210
|
+
if (typeof args.onClose === 'function') {
|
|
86211
|
+
args.onClose();
|
|
86212
|
+
}
|
|
86213
|
+
|
|
86214
|
+
return resolve(true);
|
|
86215
|
+
};
|
|
86216
|
+
|
|
86217
|
+
getRCNotificationInstance(args, function (_ref) {
|
|
86218
|
+
var prefixCls = _ref.prefixCls,
|
|
86219
|
+
iconPrefixCls = _ref.iconPrefixCls,
|
|
86220
|
+
instance = _ref.instance;
|
|
86221
|
+
instance.notice(getRCNoticeProps(_objectSpread(_objectSpread({}, args), {}, {
|
|
86222
|
+
key: target,
|
|
86223
|
+
onClose: callback
|
|
86224
|
+
}), prefixCls, iconPrefixCls));
|
|
86225
|
+
});
|
|
86226
|
+
});
|
|
86227
|
+
|
|
86228
|
+
var result = function result() {
|
|
86229
|
+
if (messageInstance) {
|
|
86230
|
+
messageInstance.removeNotice(target);
|
|
86231
|
+
}
|
|
86232
|
+
};
|
|
86233
|
+
|
|
86234
|
+
result.then = function (filled, rejected) {
|
|
86235
|
+
return closePromise.then(filled, rejected);
|
|
86236
|
+
};
|
|
86237
|
+
|
|
86238
|
+
result.promise = closePromise;
|
|
86239
|
+
return result;
|
|
86240
|
+
}
|
|
86241
|
+
|
|
86242
|
+
function isArgsProps(content) {
|
|
86243
|
+
return Object.prototype.toString.call(content) === '[object Object]' && !!content.content;
|
|
86244
|
+
}
|
|
86245
|
+
|
|
86246
|
+
var api = {
|
|
86247
|
+
open: notice,
|
|
86248
|
+
config: setMessageConfig,
|
|
86249
|
+
destroy: function destroy(messageKey) {
|
|
86250
|
+
if (messageInstance) {
|
|
86251
|
+
if (messageKey) {
|
|
86252
|
+
var _messageInstance = messageInstance,
|
|
86253
|
+
removeNotice = _messageInstance.removeNotice;
|
|
86254
|
+
removeNotice(messageKey);
|
|
86255
|
+
} else {
|
|
86256
|
+
var _messageInstance2 = messageInstance,
|
|
86257
|
+
destroy = _messageInstance2.destroy;
|
|
86258
|
+
destroy();
|
|
86259
|
+
messageInstance = null;
|
|
86260
|
+
}
|
|
86261
|
+
}
|
|
86262
|
+
}
|
|
86263
|
+
};
|
|
86264
|
+
function attachTypeApi(originalApi, type) {
|
|
86265
|
+
originalApi[type] = function (content, duration, onClose) {
|
|
86266
|
+
if (isArgsProps(content)) {
|
|
86267
|
+
return originalApi.open(_objectSpread(_objectSpread({}, content), {}, {
|
|
86268
|
+
type: type
|
|
86269
|
+
}));
|
|
86270
|
+
}
|
|
86271
|
+
|
|
86272
|
+
if (typeof duration === 'function') {
|
|
86273
|
+
onClose = duration;
|
|
86274
|
+
duration = undefined;
|
|
86275
|
+
}
|
|
86276
|
+
|
|
86277
|
+
return originalApi.open({
|
|
86278
|
+
content: content,
|
|
86279
|
+
duration: duration,
|
|
86280
|
+
type: type,
|
|
86281
|
+
onClose: onClose
|
|
86282
|
+
});
|
|
86283
|
+
};
|
|
86284
|
+
}
|
|
86285
|
+
typeList.forEach(function (type) {
|
|
86286
|
+
return attachTypeApi(api, type);
|
|
86287
|
+
});
|
|
86288
|
+
api.warn = api.warning;
|
|
86289
|
+
api.useMessage = createUseMessage(getRCNotificationInstance, getRCNoticeProps);
|
|
86290
|
+
|
|
86291
|
+
var _excluded$1o = ["className", "size", "noBorder"];
|
|
86292
|
+
var prefixCls$a = 'lm_tabs';
|
|
86293
|
+
|
|
86294
|
+
var LMTabs = function LMTabs(props) {
|
|
86295
|
+
var className = props.className,
|
|
86296
|
+
_props$size = props.size,
|
|
86297
|
+
size = _props$size === void 0 ? "middle" : _props$size,
|
|
86298
|
+
_props$noBorder = props.noBorder,
|
|
86299
|
+
noBorder = _props$noBorder === void 0 ? false : _props$noBorder,
|
|
86300
|
+
others = _objectWithoutProperties(props, _excluded$1o);
|
|
86301
|
+
|
|
86302
|
+
return /*#__PURE__*/React__default['default'].createElement(_Tabs__default['default'], _objectSpread(_objectSpread({
|
|
86303
|
+
size: size
|
|
86304
|
+
}, others), {}, {
|
|
86305
|
+
className: classnames(className, prefixCls$a, noBorder && 'lm_tabs_noborder')
|
|
86306
|
+
}));
|
|
86307
|
+
};
|
|
86308
|
+
|
|
86309
|
+
LMTabs.TabPane = _Tabs__default['default'].TabPane;
|
|
86310
|
+
|
|
86311
|
+
var Search = LmInput.Search;
|
|
86312
|
+
|
|
86313
|
+
var SortItem = function SortItem(props) {
|
|
86314
|
+
var _props$item, _props$item2, _props$item3, _props$item4;
|
|
86315
|
+
|
|
86316
|
+
var _useSortable = useSortable({
|
|
86317
|
+
id: "".concat(props.id)
|
|
86318
|
+
}),
|
|
86319
|
+
attributes = _useSortable.attributes,
|
|
86320
|
+
listeners = _useSortable.listeners,
|
|
86321
|
+
setNodeRef = _useSortable.setNodeRef,
|
|
86322
|
+
transform = _useSortable.transform,
|
|
86323
|
+
transition = _useSortable.transition;
|
|
86324
|
+
|
|
86325
|
+
var style = {
|
|
86326
|
+
transform: CSS.Transform.toString(transform),
|
|
86327
|
+
transition: transition
|
|
86328
|
+
};
|
|
86329
|
+
return /*#__PURE__*/React__default['default'].createElement("div", _objectSpread({
|
|
86330
|
+
ref: setNodeRef,
|
|
86331
|
+
className: 'lm_custom_item',
|
|
86332
|
+
style: style
|
|
86333
|
+
}, attributes), /*#__PURE__*/React__default['default'].createElement(LMCheckBox, {
|
|
86334
|
+
checked: ((_props$item = props.item) === null || _props$item === void 0 ? void 0 : _props$item.show) === false ? false : true,
|
|
86335
|
+
onChange: function onChange(e) {
|
|
86336
|
+
return props.toggleShow(e.target.checked, props.id);
|
|
86337
|
+
},
|
|
86338
|
+
className: "filter_item-content"
|
|
86339
|
+
}, (_props$item2 = props.item) === null || _props$item2 === void 0 ? void 0 : _props$item2.title), /*#__PURE__*/React__default['default'].createElement("div", null, ((_props$item3 = props.item) === null || _props$item3 === void 0 ? void 0 : _props$item3.fixed) && /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
86340
|
+
type: "lmweb-vertical-align-middl",
|
|
86341
|
+
className: "lm_custom_icon hover_show",
|
|
86342
|
+
onClick: function onClick(e) {
|
|
86343
|
+
e.stopPropagation();
|
|
86344
|
+
props.clearFiexd(props.id);
|
|
86345
|
+
}
|
|
86346
|
+
}), !((_props$item4 = props.item) === null || _props$item4 === void 0 ? void 0 : _props$item4.fixed) && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
86347
|
+
type: "lmweb-vertical-align-top",
|
|
86348
|
+
className: "lm_custom_icon hover_show icon_top",
|
|
86349
|
+
onClick: function onClick(e) {
|
|
86350
|
+
console.log(e, 'eee');
|
|
86351
|
+
e.stopPropagation();
|
|
86352
|
+
props.addFiexd(props.id, 'left');
|
|
86353
|
+
}
|
|
86354
|
+
}), /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
86355
|
+
type: "lmweb-vertical-align-botto",
|
|
86356
|
+
className: "lm_custom_icon hover_show icon_bottom",
|
|
86357
|
+
onClick: function onClick(e) {
|
|
86358
|
+
e.stopPropagation();
|
|
86359
|
+
props.addFiexd(props.id, 'right');
|
|
86360
|
+
}
|
|
86361
|
+
})), /*#__PURE__*/React__default['default'].createElement(HolderOutlined$2, _objectSpread(_objectSpread({}, listeners), {}, {
|
|
86362
|
+
className: 'lm_custom_icon sort_item',
|
|
86363
|
+
style: {
|
|
86364
|
+
color: 'var(--tip-text-color)'
|
|
86365
|
+
}
|
|
86366
|
+
}))));
|
|
86367
|
+
};
|
|
86368
|
+
/** order show fixed */
|
|
86369
|
+
|
|
86370
|
+
|
|
86371
|
+
var ColumnsSort = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
86372
|
+
var _sortMenu$leftSortIte, _sortMenu$leftSortIte2, _sortMenu$items, _sortMenu$items2, _sortMenu$items3, _sortMenu$rigthSortIt, _sortMenu$rigthSortIt2;
|
|
86373
|
+
|
|
86374
|
+
var _ref$columns = _ref.columns,
|
|
86375
|
+
columns = _ref$columns === void 0 ? [] : _ref$columns,
|
|
86376
|
+
_ref$ColumnsStateValu = _ref.ColumnsStateValue,
|
|
86377
|
+
ColumnsStateValue = _ref$ColumnsStateValu === void 0 ? {} : _ref$ColumnsStateValu;
|
|
86378
|
+
|
|
86379
|
+
var _useState = React.useState([]),
|
|
86380
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
86381
|
+
localColumns = _useState2[0],
|
|
86382
|
+
setLocalColumns = _useState2[1];
|
|
86383
|
+
|
|
86384
|
+
var _useState3 = React.useState({}),
|
|
86385
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
86386
|
+
colStateValue = _useState4[0],
|
|
86387
|
+
setColStateValue = _useState4[1];
|
|
86388
|
+
/** 正在输入的查询条件 */
|
|
86389
|
+
|
|
86390
|
+
|
|
86391
|
+
var _useState5 = React.useState(''),
|
|
86392
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
86393
|
+
searchIngValue = _useState6[0],
|
|
86394
|
+
setSearchIngValue = _useState6[1];
|
|
86395
|
+
|
|
86396
|
+
var _useState7 = React.useState(''),
|
|
86397
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
86398
|
+
searchValue = _useState8[0],
|
|
86399
|
+
setSearchValue = _useState8[1];
|
|
86400
|
+
|
|
86401
|
+
var sortMenu = React.useMemo(function () {
|
|
86402
|
+
var _cloneDeep;
|
|
86403
|
+
|
|
86404
|
+
var cloneCol = (_cloneDeep = lodash.cloneDeep(localColumns)) === null || _cloneDeep === void 0 ? void 0 : _cloneDeep.filter(function (item) {
|
|
86405
|
+
var _item$title;
|
|
86406
|
+
|
|
86407
|
+
return ((_item$title = item.title) === null || _item$title === void 0 ? void 0 : _item$title.indexOf(searchValue)) > -1;
|
|
86408
|
+
});
|
|
86409
|
+
cloneCol.forEach(function (item, index) {
|
|
86410
|
+
if (colStateValue === null || colStateValue === void 0 ? void 0 : colStateValue.hasOwnProperty(item.dataIndex)) {
|
|
86411
|
+
var _colStateValue$item$d, _colStateValue$item$d2, _colStateValue$item$d3;
|
|
86412
|
+
|
|
86413
|
+
var order = (_colStateValue$item$d = colStateValue[item.dataIndex]) === null || _colStateValue$item$d === void 0 ? void 0 : _colStateValue$item$d.order;
|
|
86414
|
+
item.fixed = ((_colStateValue$item$d2 = colStateValue[item.dataIndex]) === null || _colStateValue$item$d2 === void 0 ? void 0 : _colStateValue$item$d2.fixed) || undefined;
|
|
86415
|
+
item.order = [undefined, null].includes(order) ? index : order;
|
|
86416
|
+
item.show = ((_colStateValue$item$d3 = colStateValue[item.dataIndex]) === null || _colStateValue$item$d3 === void 0 ? void 0 : _colStateValue$item$d3.show) === false ? false : true;
|
|
86417
|
+
}
|
|
86418
|
+
});
|
|
86419
|
+
var leftSortItem = [];
|
|
86420
|
+
var rigthSortItem = [];
|
|
86421
|
+
var items = [];
|
|
86422
|
+
cloneCol === null || cloneCol === void 0 ? void 0 : cloneCol.forEach(function (item) {
|
|
86423
|
+
if ((item === null || item === void 0 ? void 0 : item.fixed) === 'right') {
|
|
86424
|
+
rigthSortItem.push(item);
|
|
86425
|
+
} else if (!(item === null || item === void 0 ? void 0 : item.fixed)) {
|
|
86426
|
+
items.push(item);
|
|
86427
|
+
} else {
|
|
86428
|
+
leftSortItem.push(item);
|
|
86429
|
+
}
|
|
86430
|
+
});
|
|
86431
|
+
return {
|
|
86432
|
+
leftSortItem: leftSortItem,
|
|
86433
|
+
rigthSortItem: rigthSortItem,
|
|
86434
|
+
items: items
|
|
86435
|
+
};
|
|
86436
|
+
}, [localColumns, colStateValue, searchValue]);
|
|
86437
|
+
var isCheckAll = React.useMemo(function () {
|
|
86438
|
+
var showLength = localColumns.filter(function (item) {
|
|
86439
|
+
return item.show !== false;
|
|
86440
|
+
});
|
|
86441
|
+
return {
|
|
86442
|
+
indeterminate: (showLength === null || showLength === void 0 ? void 0 : showLength.length) && showLength.length !== localColumns.length ? true : false,
|
|
86443
|
+
checkAll: showLength.length === localColumns.length
|
|
86444
|
+
};
|
|
86445
|
+
}, [localColumns]);
|
|
86446
|
+
/** 将当前输入的值,进行最后赋值,作自动计算使用 */
|
|
86447
|
+
|
|
86448
|
+
var handleSearch = function handleSearch() {
|
|
86449
|
+
setSearchValue(searchIngValue);
|
|
86450
|
+
};
|
|
86451
|
+
|
|
86452
|
+
React.useEffect(function () {
|
|
86453
|
+
setLocalColumns(columns);
|
|
86454
|
+
setColStateValue(ColumnsStateValue);
|
|
86455
|
+
}, [columns]);
|
|
86456
|
+
var leftSensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, {
|
|
86457
|
+
coordinateGetter: sortableKeyboardCoordinates
|
|
86458
|
+
}));
|
|
86459
|
+
var sensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, {
|
|
86460
|
+
coordinateGetter: sortableKeyboardCoordinates
|
|
86461
|
+
}));
|
|
86462
|
+
var rightSensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, {
|
|
86463
|
+
coordinateGetter: sortableKeyboardCoordinates
|
|
86464
|
+
}));
|
|
86465
|
+
/** 排序结束回调 */
|
|
86466
|
+
|
|
86467
|
+
var handleDragEnd = function handleDragEnd(event) {
|
|
86468
|
+
var active = event.active,
|
|
86469
|
+
over = event.over;
|
|
86470
|
+
|
|
86471
|
+
if (active.id !== over.id) {
|
|
86472
|
+
setLocalColumns(function (items) {
|
|
86473
|
+
var oldIndex = items.findIndex(function (s) {
|
|
86474
|
+
return s.dataIndex === active.id;
|
|
86475
|
+
});
|
|
86476
|
+
var newIndex = items.findIndex(function (s) {
|
|
86477
|
+
return s.dataIndex === over.id;
|
|
86478
|
+
});
|
|
86479
|
+
console.log(arrayMove(items, oldIndex, newIndex), 77);
|
|
86480
|
+
return arrayMove(items, oldIndex, newIndex).map(function (item, index) {
|
|
86481
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
86482
|
+
order: index
|
|
86483
|
+
});
|
|
86484
|
+
});
|
|
86485
|
+
});
|
|
86486
|
+
}
|
|
86487
|
+
};
|
|
86488
|
+
/** 取消固定 */
|
|
86489
|
+
|
|
86490
|
+
|
|
86491
|
+
var clearFiexd = function clearFiexd(id) {
|
|
86492
|
+
var resultColumns = localColumns.map(function (item) {
|
|
86493
|
+
if (item.dataIndex === id) {
|
|
86494
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
86495
|
+
fixed: undefined
|
|
86496
|
+
});
|
|
86497
|
+
}
|
|
86498
|
+
|
|
86499
|
+
return _objectSpread({}, item);
|
|
86500
|
+
});
|
|
86501
|
+
setLocalColumns(resultColumns);
|
|
86502
|
+
};
|
|
86503
|
+
/** 添加是否显示 */
|
|
86504
|
+
|
|
86505
|
+
|
|
86506
|
+
var toggleShow = function toggleShow(value, id) {
|
|
86507
|
+
var resultColumns = localColumns.map(function (item) {
|
|
86508
|
+
if (item.dataIndex === id) {
|
|
86509
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
86510
|
+
show: item.show === false ? true : false
|
|
86511
|
+
});
|
|
86512
|
+
}
|
|
86513
|
+
|
|
86514
|
+
return _objectSpread({}, item);
|
|
86515
|
+
});
|
|
86516
|
+
setLocalColumns(resultColumns);
|
|
86517
|
+
};
|
|
86518
|
+
/** 添加左右固定 */
|
|
86519
|
+
|
|
86520
|
+
|
|
86521
|
+
var addFiexd = function addFiexd(id, type) {
|
|
86522
|
+
var resultColumns = localColumns.map(function (item) {
|
|
86523
|
+
if (item.dataIndex === id) {
|
|
86524
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
86525
|
+
fixed: type
|
|
86526
|
+
});
|
|
86527
|
+
}
|
|
86528
|
+
|
|
86529
|
+
return _objectSpread({}, item);
|
|
86530
|
+
});
|
|
86531
|
+
setLocalColumns(resultColumns);
|
|
86532
|
+
};
|
|
86533
|
+
/** 切换是否全选 */
|
|
86534
|
+
|
|
86535
|
+
|
|
86536
|
+
var onCheckAllChange = function onCheckAllChange() {
|
|
86537
|
+
var resultColumns = localColumns.map(function (item) {
|
|
86538
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
86539
|
+
show: isCheckAll.checkAll ? false : true
|
|
86540
|
+
});
|
|
86541
|
+
});
|
|
86542
|
+
setLocalColumns(resultColumns);
|
|
86543
|
+
};
|
|
86544
|
+
|
|
86545
|
+
React.useImperativeHandle(ref, function () {
|
|
86546
|
+
return {
|
|
86547
|
+
getColumns: function getColumns() {
|
|
86548
|
+
return localColumns;
|
|
86549
|
+
},
|
|
86550
|
+
getColStateValue: function getColStateValue() {
|
|
86551
|
+
var obj = {};
|
|
86552
|
+
localColumns.forEach(function (item) {
|
|
86553
|
+
obj[item.dataIndex] = {};
|
|
86554
|
+
|
|
86555
|
+
if (![undefined, null].includes(item.order)) {
|
|
86556
|
+
obj[item.dataIndex]['order'] = item.order;
|
|
86557
|
+
}
|
|
86558
|
+
|
|
86559
|
+
if (![undefined, null].includes(item.show)) {
|
|
86560
|
+
obj[item.dataIndex]['show'] = item.show;
|
|
86561
|
+
}
|
|
86562
|
+
|
|
86563
|
+
if (![undefined, null].includes(item.fixed)) {
|
|
86564
|
+
obj[item.dataIndex]['fixed'] = item.fixed;
|
|
86565
|
+
}
|
|
86566
|
+
});
|
|
86567
|
+
return obj;
|
|
86568
|
+
}
|
|
86569
|
+
};
|
|
86570
|
+
});
|
|
86571
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
86572
|
+
className: 'lm_custom_option_columns'
|
|
86573
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
86574
|
+
className: 'global_search'
|
|
86575
|
+
}, /*#__PURE__*/React__default['default'].createElement(Search, {
|
|
86576
|
+
value: searchIngValue,
|
|
86577
|
+
onChange: function onChange(e) {
|
|
86578
|
+
return setSearchIngValue(e.target.value);
|
|
86579
|
+
},
|
|
86580
|
+
onSearch: handleSearch
|
|
86581
|
+
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
86582
|
+
className: 'global_setting'
|
|
86583
|
+
}, /*#__PURE__*/React__default['default'].createElement(LMCheckBox, {
|
|
86584
|
+
indeterminate: isCheckAll.indeterminate,
|
|
86585
|
+
onChange: onCheckAllChange,
|
|
86586
|
+
checked: isCheckAll.checkAll
|
|
86587
|
+
}, "\u5168\u9009"), /*#__PURE__*/React__default['default'].createElement("span", {
|
|
86588
|
+
onClick: function onClick() {
|
|
86589
|
+
return setLocalColumns(columns);
|
|
86590
|
+
}
|
|
86591
|
+
}, "\u91CD\u7F6E")), !!((_sortMenu$leftSortIte = sortMenu.leftSortItem) === null || _sortMenu$leftSortIte === void 0 ? void 0 : _sortMenu$leftSortIte.length) && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("label", {
|
|
86592
|
+
className: 'fixed_title'
|
|
86593
|
+
}, "\u56FA\u5B9A\u5728\u5DE6\u4FA7"), /*#__PURE__*/React__default['default'].createElement(DndContext, {
|
|
86594
|
+
sensors: leftSensors,
|
|
86595
|
+
collisionDetection: closestCenter,
|
|
86596
|
+
onDragEnd: handleDragEnd
|
|
86597
|
+
}, /*#__PURE__*/React__default['default'].createElement(SortableContext, {
|
|
86598
|
+
items: (_sortMenu$leftSortIte2 = sortMenu.leftSortItem) === null || _sortMenu$leftSortIte2 === void 0 ? void 0 : _sortMenu$leftSortIte2.map(function (v) {
|
|
86599
|
+
return "".concat(v.dataIndex);
|
|
86600
|
+
}),
|
|
86601
|
+
strategy: verticalListSortingStrategy
|
|
86602
|
+
}, sortMenu.leftSortItem.map(function (item) {
|
|
86603
|
+
return /*#__PURE__*/React__default['default'].createElement(SortItem, {
|
|
86604
|
+
key: item.dataIndex,
|
|
86605
|
+
item: item,
|
|
86606
|
+
toggleShow: toggleShow,
|
|
86607
|
+
clearFiexd: clearFiexd,
|
|
86608
|
+
id: item.dataIndex
|
|
86609
|
+
});
|
|
86610
|
+
})))), !!((_sortMenu$items = sortMenu.items) === null || _sortMenu$items === void 0 ? void 0 : _sortMenu$items.length) && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("label", {
|
|
86611
|
+
className: 'fixed_title'
|
|
86612
|
+
}, " \u4E0D\u56FA\u5B9A "), /*#__PURE__*/React__default['default'].createElement(DndContext, {
|
|
86613
|
+
sensors: sensors,
|
|
86614
|
+
collisionDetection: closestCenter,
|
|
86615
|
+
onDragEnd: handleDragEnd
|
|
86616
|
+
}, /*#__PURE__*/React__default['default'].createElement(SortableContext, {
|
|
86617
|
+
items: (_sortMenu$items2 = sortMenu.items) === null || _sortMenu$items2 === void 0 ? void 0 : _sortMenu$items2.map(function (v) {
|
|
86618
|
+
return "".concat(v.dataIndex);
|
|
86619
|
+
}),
|
|
86620
|
+
strategy: verticalListSortingStrategy
|
|
86621
|
+
}, (_sortMenu$items3 = sortMenu.items) === null || _sortMenu$items3 === void 0 ? void 0 : _sortMenu$items3.map(function (item) {
|
|
86622
|
+
return /*#__PURE__*/React__default['default'].createElement(SortItem, {
|
|
86623
|
+
key: item.dataIndex,
|
|
86624
|
+
addFiexd: addFiexd,
|
|
86625
|
+
toggleShow: toggleShow,
|
|
86626
|
+
item: item,
|
|
86627
|
+
id: item.dataIndex
|
|
86628
|
+
});
|
|
86629
|
+
})))), !!((_sortMenu$rigthSortIt = sortMenu.rigthSortItem) === null || _sortMenu$rigthSortIt === void 0 ? void 0 : _sortMenu$rigthSortIt.length) && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("label", {
|
|
86630
|
+
className: 'fixed_title'
|
|
86631
|
+
}, "\u56FA\u5B9A\u5728\u53F3\u4FA7"), /*#__PURE__*/React__default['default'].createElement(DndContext, {
|
|
86632
|
+
sensors: rightSensors,
|
|
86633
|
+
collisionDetection: closestCenter,
|
|
86634
|
+
onDragEnd: handleDragEnd
|
|
86635
|
+
}, /*#__PURE__*/React__default['default'].createElement(SortableContext, {
|
|
86636
|
+
items: (_sortMenu$rigthSortIt2 = sortMenu.rigthSortItem) === null || _sortMenu$rigthSortIt2 === void 0 ? void 0 : _sortMenu$rigthSortIt2.map(function (v) {
|
|
86637
|
+
return "".concat(v.dataIndex);
|
|
86638
|
+
}),
|
|
86639
|
+
strategy: verticalListSortingStrategy
|
|
86640
|
+
}, sortMenu.rigthSortItem.map(function (item) {
|
|
86641
|
+
return /*#__PURE__*/React__default['default'].createElement(SortItem, {
|
|
86642
|
+
key: item.dataIndex,
|
|
86643
|
+
toggleShow: toggleShow,
|
|
86644
|
+
clearFiexd: clearFiexd,
|
|
86645
|
+
item: item,
|
|
86646
|
+
id: item.dataIndex
|
|
86647
|
+
});
|
|
86648
|
+
})))));
|
|
86649
|
+
});
|
|
86650
|
+
|
|
86651
|
+
var UNLLVALUE = [null, undefined];
|
|
86652
|
+
var Search$1 = LmInput.Search;
|
|
86653
|
+
|
|
86654
|
+
var SortItem$1 = function SortItem(props) {
|
|
86655
|
+
var _props$item, _props$item2;
|
|
86656
|
+
|
|
86657
|
+
var _useSortable = useSortable({
|
|
86658
|
+
id: "".concat(props.id)
|
|
86659
|
+
}),
|
|
86660
|
+
attributes = _useSortable.attributes,
|
|
86661
|
+
listeners = _useSortable.listeners,
|
|
86662
|
+
setNodeRef = _useSortable.setNodeRef,
|
|
86663
|
+
transform = _useSortable.transform,
|
|
86664
|
+
transition = _useSortable.transition;
|
|
86665
|
+
|
|
86666
|
+
var style = {
|
|
86667
|
+
transform: CSS.Transform.toString(transform),
|
|
86668
|
+
transition: transition
|
|
86669
|
+
};
|
|
86670
|
+
return /*#__PURE__*/React__default['default'].createElement("div", _objectSpread({
|
|
86671
|
+
ref: setNodeRef,
|
|
86672
|
+
className: 'lm_custom_item',
|
|
86673
|
+
style: style
|
|
86674
|
+
}, attributes), /*#__PURE__*/React__default['default'].createElement(LMCheckBox, {
|
|
86675
|
+
checked: ((_props$item = props.item) === null || _props$item === void 0 ? void 0 : _props$item.show) === false ? false : true,
|
|
86676
|
+
onChange: function onChange(e) {
|
|
86677
|
+
return props.toggleShow(e.target.checked, props.id);
|
|
86678
|
+
},
|
|
86679
|
+
className: "filter_item-content"
|
|
86680
|
+
}, (_props$item2 = props.item) === null || _props$item2 === void 0 ? void 0 : _props$item2.title), /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(HolderOutlined$2, _objectSpread(_objectSpread({}, listeners), {}, {
|
|
86681
|
+
className: 'lm_custom_icon sort_item'
|
|
86682
|
+
}))));
|
|
86683
|
+
};
|
|
86684
|
+
/** order show fixed */
|
|
86685
|
+
|
|
86686
|
+
|
|
86687
|
+
var FilterSort = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
86688
|
+
var _ref$filter = _ref.filter,
|
|
86689
|
+
filter = _ref$filter === void 0 ? [] : _ref$filter,
|
|
86690
|
+
_ref$filterStateValue = _ref.filterStateValue,
|
|
86691
|
+
filterStateValue = _ref$filterStateValue === void 0 ? {} : _ref$filterStateValue;
|
|
86692
|
+
|
|
86693
|
+
var _useState = React.useState([]),
|
|
86694
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
86695
|
+
localFilter = _useState2[0],
|
|
86696
|
+
setLocalFilter = _useState2[1];
|
|
86697
|
+
|
|
86698
|
+
var _useState3 = React.useState({}),
|
|
86699
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
86700
|
+
colStateValue = _useState4[0],
|
|
86701
|
+
setColStateValue = _useState4[1];
|
|
86702
|
+
/** 正在输入的查询条件 */
|
|
86703
|
+
|
|
86704
|
+
|
|
86705
|
+
var _useState5 = React.useState(''),
|
|
86706
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
86707
|
+
searchIngValue = _useState6[0],
|
|
86708
|
+
setSearchIngValue = _useState6[1];
|
|
86709
|
+
|
|
86710
|
+
var _useState7 = React.useState(''),
|
|
86711
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
86712
|
+
searchValue = _useState8[0],
|
|
86713
|
+
setSearchValue = _useState8[1];
|
|
86714
|
+
|
|
86715
|
+
var sortMenu = React.useMemo(function () {
|
|
86716
|
+
var cloneCol = lodash.cloneDeep(localFilter);
|
|
86717
|
+
cloneCol.forEach(function (item, index) {
|
|
86718
|
+
var _colStateValue$item$f, _colStateValue$item$f2;
|
|
86719
|
+
|
|
86720
|
+
var order = (_colStateValue$item$f = colStateValue[item.field]) === null || _colStateValue$item$f === void 0 ? void 0 : _colStateValue$item$f.order;
|
|
86721
|
+
item.order = order !== undefined && order !== null ? order : UNLLVALUE.includes(item.order) ? index : item.order;
|
|
86722
|
+
item.show = ((_colStateValue$item$f2 = colStateValue[item.field]) === null || _colStateValue$item$f2 === void 0 ? void 0 : _colStateValue$item$f2.show) === false ? false : UNLLVALUE.includes(item.show) ? true : !!item.show;
|
|
86723
|
+
});
|
|
86724
|
+
return cloneCol.filter(function (item) {
|
|
86725
|
+
var _item$title;
|
|
86726
|
+
|
|
86727
|
+
return ((_item$title = item.title) === null || _item$title === void 0 ? void 0 : _item$title.indexOf(searchValue)) > -1;
|
|
86728
|
+
});
|
|
86729
|
+
}, [localFilter, colStateValue, searchValue]);
|
|
86730
|
+
var isCheckAll = React.useMemo(function () {
|
|
86731
|
+
var showLength = localFilter.filter(function (item) {
|
|
86732
|
+
return item.show !== false;
|
|
86733
|
+
});
|
|
86734
|
+
return {
|
|
86735
|
+
indeterminate: (showLength === null || showLength === void 0 ? void 0 : showLength.length) && showLength.length !== localFilter.length ? true : false,
|
|
86736
|
+
checkAll: showLength.length === localFilter.length
|
|
86737
|
+
};
|
|
86738
|
+
}, [localFilter]);
|
|
86739
|
+
/** 将当前输入的值,进行最后赋值,作自动计算使用 */
|
|
86740
|
+
|
|
86741
|
+
var handleSearch = function handleSearch() {
|
|
86742
|
+
setSearchValue(searchIngValue);
|
|
86743
|
+
};
|
|
86744
|
+
|
|
86745
|
+
React.useEffect(function () {
|
|
86746
|
+
console.log(localFilter, 'localFilter');
|
|
86747
|
+
}, [localFilter]);
|
|
86748
|
+
React.useEffect(function () {
|
|
86749
|
+
setLocalFilter(filter);
|
|
86750
|
+
setColStateValue(filterStateValue);
|
|
86751
|
+
}, [filter]);
|
|
86752
|
+
var sensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, {
|
|
86753
|
+
coordinateGetter: sortableKeyboardCoordinates
|
|
86754
|
+
}));
|
|
86755
|
+
/** 排序结束回调 */
|
|
86756
|
+
|
|
86757
|
+
var handleDragEnd = function handleDragEnd(event) {
|
|
86758
|
+
var active = event.active,
|
|
86759
|
+
over = event.over;
|
|
86760
|
+
|
|
86761
|
+
if (active.id !== over.id) {
|
|
86762
|
+
setLocalFilter(function (items) {
|
|
86763
|
+
var oldIndex = items.findIndex(function (s) {
|
|
86764
|
+
return s.field === active.id;
|
|
86765
|
+
});
|
|
86766
|
+
var newIndex = items.findIndex(function (s) {
|
|
86767
|
+
return s.field === over.id;
|
|
86768
|
+
});
|
|
86769
|
+
return arrayMove(items, oldIndex, newIndex).map(function (item, index) {
|
|
86770
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
86771
|
+
order: index
|
|
86772
|
+
});
|
|
86773
|
+
});
|
|
86774
|
+
});
|
|
86775
|
+
}
|
|
86776
|
+
};
|
|
86777
|
+
/** 添加是否显示 */
|
|
86778
|
+
|
|
86779
|
+
|
|
86780
|
+
var toggleShow = function toggleShow(value, id) {
|
|
86781
|
+
var resultColumns = localFilter.map(function (item) {
|
|
86782
|
+
if (item.field === id) {
|
|
86783
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
86784
|
+
show: item.show === false ? true : false
|
|
86785
|
+
});
|
|
86786
|
+
}
|
|
86787
|
+
|
|
86788
|
+
return _objectSpread({}, item);
|
|
86789
|
+
});
|
|
86790
|
+
setLocalFilter(resultColumns);
|
|
86791
|
+
};
|
|
86792
|
+
/** 切换是否全选 */
|
|
86793
|
+
|
|
86794
|
+
|
|
86795
|
+
var onCheckAllChange = function onCheckAllChange() {
|
|
86796
|
+
var resultColumns = localFilter.map(function (item) {
|
|
86797
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
86798
|
+
show: isCheckAll.checkAll ? false : true
|
|
86799
|
+
});
|
|
86800
|
+
});
|
|
86801
|
+
console.log(resultColumns, 'resultColumns');
|
|
86802
|
+
setLocalFilter(resultColumns);
|
|
86803
|
+
};
|
|
86804
|
+
|
|
86805
|
+
React.useImperativeHandle(ref, function () {
|
|
86806
|
+
return {
|
|
86807
|
+
getLocalFilter: function getLocalFilter() {
|
|
86808
|
+
return localFilter;
|
|
86809
|
+
},
|
|
86810
|
+
getFilterStateValue: function getFilterStateValue() {
|
|
86811
|
+
var obj = {};
|
|
86812
|
+
localFilter.forEach(function (item) {
|
|
86813
|
+
obj[item.field] = {};
|
|
86814
|
+
|
|
86815
|
+
if (![undefined, null].includes(item.order)) {
|
|
86816
|
+
obj[item.field]['order'] = item.order;
|
|
86817
|
+
}
|
|
86818
|
+
|
|
86819
|
+
if (![undefined, null].includes(item.show)) {
|
|
86820
|
+
obj[item.field]['show'] = item.show;
|
|
86821
|
+
}
|
|
86822
|
+
});
|
|
86823
|
+
return obj;
|
|
86824
|
+
}
|
|
86825
|
+
};
|
|
86826
|
+
});
|
|
86827
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
86828
|
+
className: 'lm_custom_option_columns'
|
|
86829
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
86830
|
+
className: 'global_search'
|
|
86831
|
+
}, /*#__PURE__*/React__default['default'].createElement(Search$1, {
|
|
86832
|
+
value: searchIngValue,
|
|
86833
|
+
onChange: function onChange(e) {
|
|
86834
|
+
return setSearchIngValue(e.target.value);
|
|
86835
|
+
},
|
|
86836
|
+
onSearch: handleSearch
|
|
86837
|
+
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
86838
|
+
className: 'global_setting'
|
|
86839
|
+
}, /*#__PURE__*/React__default['default'].createElement(LMCheckBox, {
|
|
86840
|
+
indeterminate: isCheckAll.indeterminate,
|
|
86841
|
+
onChange: onCheckAllChange,
|
|
86842
|
+
checked: isCheckAll.checkAll
|
|
86843
|
+
}, "\u5168\u9009"), /*#__PURE__*/React__default['default'].createElement("span", {
|
|
86844
|
+
onClick: function onClick() {
|
|
86845
|
+
return setLocalFilter(filter);
|
|
86846
|
+
}
|
|
86847
|
+
}, "\u91CD\u7F6E")), !!(sortMenu === null || sortMenu === void 0 ? void 0 : sortMenu.length) && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(DndContext, {
|
|
86848
|
+
sensors: sensors,
|
|
86849
|
+
collisionDetection: closestCenter,
|
|
86850
|
+
onDragEnd: handleDragEnd
|
|
86851
|
+
}, /*#__PURE__*/React__default['default'].createElement(SortableContext, {
|
|
86852
|
+
items: sortMenu === null || sortMenu === void 0 ? void 0 : sortMenu.map(function (v) {
|
|
86853
|
+
return "".concat(v.field);
|
|
86854
|
+
}),
|
|
86855
|
+
strategy: verticalListSortingStrategy
|
|
86856
|
+
}, sortMenu === null || sortMenu === void 0 ? void 0 : sortMenu.map(function (item) {
|
|
86857
|
+
return /*#__PURE__*/React__default['default'].createElement(SortItem$1, {
|
|
86858
|
+
key: item.field,
|
|
86859
|
+
toggleShow: toggleShow,
|
|
86860
|
+
item: item,
|
|
86861
|
+
id: item.field
|
|
86862
|
+
});
|
|
86863
|
+
})))));
|
|
86864
|
+
});
|
|
86865
|
+
|
|
86866
|
+
var SmallImg = require('./assets/option1.png');
|
|
86867
|
+
|
|
86868
|
+
var DefaultImg = require('./assets/option2.png');
|
|
86869
|
+
|
|
86870
|
+
var MiddleImg = require('./assets/option3.png');
|
|
86871
|
+
|
|
86872
|
+
var TabPane$1 = LMTabs.TabPane;
|
|
86873
|
+
var optionsWithDisabled = [{
|
|
86874
|
+
label: '默认',
|
|
86875
|
+
value: 'default',
|
|
86876
|
+
imgUrl: DefaultImg
|
|
86877
|
+
}, {
|
|
86878
|
+
label: '紧凑',
|
|
86879
|
+
value: 'small',
|
|
86880
|
+
imgUrl: SmallImg
|
|
86881
|
+
}, {
|
|
86882
|
+
label: '宽松',
|
|
86883
|
+
value: 'middle',
|
|
86884
|
+
imgUrl: MiddleImg
|
|
86885
|
+
}];
|
|
86886
|
+
var prefixCls$b = 'lm_custom-table-option';
|
|
86887
|
+
var LMCustomTableOption = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
86888
|
+
var className = props.className,
|
|
86889
|
+
_props$tooltip = props.tooltip,
|
|
86890
|
+
tooltip = _props$tooltip === void 0 ? {} : _props$tooltip;
|
|
86891
|
+
var filterRef = React.useRef(null);
|
|
86892
|
+
var columnsRef = React.useRef(null); // const sizeRef = useRef(null)
|
|
86893
|
+
|
|
86894
|
+
var _useState = React.useState(false),
|
|
86895
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
86896
|
+
visible = _useState2[0],
|
|
86897
|
+
setVisible = _useState2[1];
|
|
86898
|
+
/** 是否记住页面使用状态 */
|
|
86899
|
+
|
|
86900
|
+
|
|
86901
|
+
var _useState3 = React.useState(true),
|
|
86902
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
86903
|
+
saveSetting = _useState4[0],
|
|
86904
|
+
setSaveSetting = _useState4[1];
|
|
86905
|
+
|
|
86906
|
+
var _useState5 = React.useState({
|
|
86907
|
+
filter: [],
|
|
86908
|
+
columns: [],
|
|
86909
|
+
size: 'default'
|
|
86910
|
+
}),
|
|
86911
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
86912
|
+
lmOptions = _useState6[0],
|
|
86913
|
+
setLmOptions = _useState6[1];
|
|
86914
|
+
|
|
86915
|
+
var openSetting = function openSetting() {
|
|
86916
|
+
setVisible(true);
|
|
86917
|
+
};
|
|
86918
|
+
|
|
86919
|
+
React.useEffect(function () {
|
|
86920
|
+
setLmOptions({
|
|
86921
|
+
filter: props.filter,
|
|
86922
|
+
columns: props.columns,
|
|
86923
|
+
size: props.size || 'default'
|
|
86924
|
+
});
|
|
86925
|
+
}, [props.filter, props.columns, props.size]);
|
|
86926
|
+
/** 提交按钮 */
|
|
86927
|
+
|
|
86928
|
+
var onOk = function onOk() {
|
|
86929
|
+
var _columnsRef$current, _columnsRef$current2, _filterRef$current, _filterRef$current2, _props$onSave;
|
|
86930
|
+
|
|
86931
|
+
/** tableInfo */
|
|
86932
|
+
var columnsData = (_columnsRef$current = columnsRef.current) === null || _columnsRef$current === void 0 ? void 0 : _columnsRef$current.getColumns();
|
|
86933
|
+
var ColStateValue = (_columnsRef$current2 = columnsRef.current) === null || _columnsRef$current2 === void 0 ? void 0 : _columnsRef$current2.getColStateValue();
|
|
86934
|
+
/** filterInfo */
|
|
86935
|
+
|
|
86936
|
+
var filterData = (_filterRef$current = filterRef.current) === null || _filterRef$current === void 0 ? void 0 : _filterRef$current.getLocalFilter();
|
|
86937
|
+
var filterStateValue = (_filterRef$current2 = filterRef.current) === null || _filterRef$current2 === void 0 ? void 0 : _filterRef$current2.getFilterStateValue();
|
|
86938
|
+
console.log('--columnsData:', columnsData, ColStateValue, '--filterData:', filterData, filterStateValue, 'size:', lmOptions.size);
|
|
86939
|
+
(_props$onSave = props.onSave) === null || _props$onSave === void 0 ? void 0 : _props$onSave.call(props, {
|
|
86940
|
+
columnsData: columnsData,
|
|
86941
|
+
ColStateValue: ColStateValue,
|
|
86942
|
+
filterData: filterData,
|
|
86943
|
+
filterStateValue: filterStateValue,
|
|
86944
|
+
size: lmOptions.size,
|
|
86945
|
+
saveSetting: saveSetting
|
|
86946
|
+
});
|
|
86947
|
+
setVisible(false);
|
|
86948
|
+
};
|
|
86949
|
+
|
|
86950
|
+
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(_Tooltip__default['default'], _objectSpread({}, tooltip), /*#__PURE__*/React__default['default'].createElement(LMButton, {
|
|
86951
|
+
onClick: openSetting,
|
|
86952
|
+
icon: /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
86953
|
+
type: 'lmweb-setting'
|
|
86954
|
+
})
|
|
86955
|
+
})), /*#__PURE__*/React__default['default'].createElement(LMDrawer, {
|
|
86956
|
+
className: classnames(className, prefixCls$b),
|
|
86957
|
+
title: "\u7B5B\u9009\u8BBE\u7F6E",
|
|
86958
|
+
visible: visible,
|
|
86959
|
+
extra: /*#__PURE__*/React__default['default'].createElement(_Space__default['default'], null, /*#__PURE__*/React__default['default'].createElement(LMButton, {
|
|
86960
|
+
size: "small",
|
|
86961
|
+
onClick: function onClick() {
|
|
86962
|
+
return setVisible(false);
|
|
86963
|
+
}
|
|
86964
|
+
}, "\u53D6\u6D88"), /*#__PURE__*/React__default['default'].createElement(LMButton, {
|
|
86965
|
+
size: "small",
|
|
86966
|
+
onClick: onOk,
|
|
86967
|
+
type: "primary"
|
|
86968
|
+
}, "\u786E\u8BA4")),
|
|
86969
|
+
onClose: function onClose() {
|
|
86970
|
+
return setVisible(false);
|
|
86971
|
+
}
|
|
86972
|
+
}, /*#__PURE__*/React__default['default'].createElement(LMTabs, {
|
|
86973
|
+
defaultActiveKey: "1"
|
|
86974
|
+
}, /*#__PURE__*/React__default['default'].createElement(TabPane$1, {
|
|
86975
|
+
tab: "\u4E2A\u6027\u5316\u7B5B\u9009",
|
|
86976
|
+
key: "1",
|
|
86977
|
+
forceRender: true
|
|
86978
|
+
}, /*#__PURE__*/React__default['default'].createElement(FilterSort, {
|
|
86979
|
+
ref: filterRef,
|
|
86980
|
+
filter: lmOptions.filter
|
|
86981
|
+
})), /*#__PURE__*/React__default['default'].createElement(TabPane$1, {
|
|
86982
|
+
tab: "\u5217\u8868\u5B57\u6BB5\u8BBE\u7F6E",
|
|
86983
|
+
key: "2",
|
|
86984
|
+
forceRender: true
|
|
86985
|
+
}, /*#__PURE__*/React__default['default'].createElement(ColumnsSort, {
|
|
86986
|
+
ref: columnsRef,
|
|
86987
|
+
columns: lmOptions.columns
|
|
86988
|
+
})), /*#__PURE__*/React__default['default'].createElement(TabPane$1, {
|
|
86989
|
+
tab: "\u5176\u4ED6",
|
|
86990
|
+
key: "3",
|
|
86991
|
+
forceRender: true
|
|
86992
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", null, "\u5217\u8868\u6837\u5F0F"), /*#__PURE__*/React__default['default'].createElement(LMRadio.Group, {
|
|
86993
|
+
onChange: function onChange(e) {
|
|
86994
|
+
return setLmOptions(_objectSpread(_objectSpread({}, lmOptions), {}, {
|
|
86995
|
+
size: e.target.value
|
|
86996
|
+
}));
|
|
86997
|
+
},
|
|
86998
|
+
className: 'lm_size_radio_group',
|
|
86999
|
+
value: lmOptions.size
|
|
87000
|
+
}, optionsWithDisabled.map(function (item) {
|
|
87001
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
87002
|
+
className: 'lm_custom_size_warp',
|
|
87003
|
+
key: item.value
|
|
87004
|
+
}, /*#__PURE__*/React__default['default'].createElement("img", {
|
|
87005
|
+
onClick: function onClick() {
|
|
87006
|
+
return setLmOptions(_objectSpread(_objectSpread({}, lmOptions), {}, {
|
|
87007
|
+
size: item.value
|
|
87008
|
+
}));
|
|
87009
|
+
},
|
|
87010
|
+
src: item.imgUrl
|
|
87011
|
+
}), /*#__PURE__*/React__default['default'].createElement(LMRadio, {
|
|
87012
|
+
value: item.value
|
|
87013
|
+
}, item.label));
|
|
87014
|
+
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
87015
|
+
className: 'save_setting'
|
|
87016
|
+
}, /*#__PURE__*/React__default['default'].createElement("span", null, "\u662F\u5426\u8BB0\u4F4F\u9875\u9762\u4F7F\u7528\u72B6\u6001"), /*#__PURE__*/React__default['default'].createElement(_Switch__default['default'], {
|
|
87017
|
+
checked: saveSetting,
|
|
87018
|
+
onChange: setSaveSetting
|
|
87019
|
+
}))))));
|
|
87020
|
+
});
|
|
87021
|
+
|
|
87022
|
+
var LMUpload = function LMUpload(props) {
|
|
87023
|
+
var listType = props.listType;
|
|
87024
|
+
|
|
87025
|
+
var renderUploadItem = function renderUploadItem(originNode, file) {
|
|
87026
|
+
return !listType ? /*#__PURE__*/React__default['default'].createElement(_Tooltip__default['default'], {
|
|
87027
|
+
placement: 'bottom',
|
|
87028
|
+
title: file.name
|
|
87029
|
+
}, originNode.props.children) : originNode;
|
|
87030
|
+
};
|
|
87031
|
+
|
|
87032
|
+
return /*#__PURE__*/React__default['default'].createElement(_Upload__default['default'], _objectSpread({
|
|
87033
|
+
itemRender: renderUploadItem,
|
|
87034
|
+
listType: listType
|
|
87035
|
+
}, props));
|
|
87036
|
+
};
|
|
87037
|
+
|
|
87038
|
+
var _excluded$1p = ["children", "className"];
|
|
87039
|
+
var classNamePrefix = 'lm_form';
|
|
87040
|
+
|
|
87041
|
+
var LMForm = function LMForm(props, ref) {
|
|
87042
|
+
var children = props.children,
|
|
87043
|
+
className = props.className,
|
|
87044
|
+
restProps = _objectWithoutProperties(props, _excluded$1p);
|
|
87045
|
+
|
|
87046
|
+
return /*#__PURE__*/React__default['default'].createElement(_Form__default['default'], _objectSpread({
|
|
87047
|
+
ref: ref,
|
|
87048
|
+
className: classnames(classNamePrefix, className),
|
|
87049
|
+
colon: false
|
|
87050
|
+
}, restProps), children);
|
|
87051
|
+
};
|
|
87052
|
+
|
|
87053
|
+
var Reform = /*#__PURE__*/React__default['default'].forwardRef(LMForm);
|
|
87054
|
+
var Form$1 = Reform;
|
|
87055
|
+
Form$1.Item = _Form__default['default'].Item;
|
|
87056
|
+
Form$1.List = _List__default['default'];
|
|
87057
|
+
Form$1.ErrorList = _Form__default['default'].ErrorList;
|
|
87058
|
+
Form$1.useForm = Form$2.useForm;
|
|
87059
|
+
Form$1.useFormInstance = useFormInstance__default['default'];
|
|
87060
|
+
Form$1.useWatch = Form$2.useWatch;
|
|
87061
|
+
Form$1.Provider = context$2.FormProvider;
|
|
87062
|
+
|
|
87063
|
+
Form$1.create = function () {
|
|
87064
|
+
warning$3();
|
|
87065
|
+
};
|
|
87066
|
+
|
|
87067
|
+
function warning$3(arg0, arg1, arg2) {
|
|
87068
|
+
throw new Error('Function not implemented.');
|
|
87069
|
+
}
|
|
87070
|
+
|
|
87071
|
+
function n(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];{var i=Y[n],o=i?"function"==typeof i?i.apply(null,t):i:"unknown error nr: "+n;throw Error("[Immer] "+o)}}function r(n){return !!n&&!!n[Q]}function t(n){return !!n&&(function(n){if(!n||"object"!=typeof n)return !1;var r=Object.getPrototypeOf(n);if(null===r)return !0;var t=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return t===Object||"function"==typeof t&&Function.toString.call(t)===Z}(n)||Array.isArray(n)||!!n[L]||!!n.constructor[L]||s(n)||v(n))}function i(n,r,t){void 0===t&&(t=!1),0===o(n)?(t?Object.keys:nn)(n).forEach((function(e){t&&"symbol"==typeof e||r(e,n[e],n);})):n.forEach((function(t,e){return r(e,t,n)}));}function o(n){var r=n[Q];return r?r.i>3?r.i-4:r.i:Array.isArray(n)?1:s(n)?2:v(n)?3:0}function u(n,r){return 2===o(n)?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function a(n,r){return 2===o(n)?n.get(r):n[r]}function f(n,r,t){var e=o(n);2===e?n.set(r,t):3===e?(n.delete(r),n.add(t)):n[r]=t;}function c(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}function s(n){return X&&n instanceof Map}function v(n){return q&&n instanceof Set}function p(n){return n.o||n.t}function l(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var r=rn(n);delete r[Q];for(var t=nn(r),e=0;e<t.length;e++){var i=t[e],o=r[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:n[i]});}return Object.create(Object.getPrototypeOf(n),r)}function d(n,e){return void 0===e&&(e=!1),y(n)||r(n)||!t(n)?n:(o(n)>1&&(n.set=n.add=n.clear=n.delete=h),Object.freeze(n),e&&i(n,(function(n,r){return d(r,!0)}),!0),n)}function h(){n(2);}function y(n){return null==n||"object"!=typeof n||Object.isFrozen(n)}function b(r){var t=tn[r];return t||n(18,r),t}function _(){return U||n(0),U}function j(n,r){r&&(b("Patches"),n.u=[],n.s=[],n.v=r);}function O(n){g(n),n.p.forEach(S),n.p=null;}function g(n){n===U&&(U=n.l);}function w(n){return U={p:[],l:U,h:n,m:!0,_:0}}function S(n){var r=n[Q];0===r.i||1===r.i?r.j():r.O=!0;}function P(r,e){e._=e.p.length;var i=e.p[0],o=void 0!==r&&r!==i;return e.h.g||b("ES5").S(e,r,o),o?(i[Q].P&&(O(e),n(4)),t(r)&&(r=M(e,r),e.l||x(e,r)),e.u&&b("Patches").M(i[Q].t,r,e.u,e.s)):r=M(e,i,[]),O(e),e.u&&e.v(e.u,e.s),r!==H?r:void 0}function M(n,r,t){if(y(r))return r;var e=r[Q];if(!e)return i(r,(function(i,o){return A(n,e,r,i,o,t)}),!0),r;if(e.A!==n)return r;if(!e.P)return x(n,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var o=4===e.i||5===e.i?e.o=l(e.k):e.o;i(3===e.i?new Set(o):o,(function(r,i){return A(n,e,o,r,i,t)})),x(n,o,!1),t&&n.u&&b("Patches").R(e,t,n.u,n.s);}return e.o}function A(e,i,o,a,c,s){if(c===o&&n(5),r(c)){var v=M(e,c,s&&i&&3!==i.i&&!u(i.D,a)?s.concat(a):void 0);if(f(o,a,v),!r(v))return;e.m=!1;}if(t(c)&&!y(c)){if(!e.h.F&&e._<1)return;M(e,c),i&&i.A.l||x(e,c);}}function x(n,r,t){void 0===t&&(t=!1),n.h.F&&n.m&&d(r,t);}function z(n,r){var t=n[Q];return (t?p(t):n)[r]}function I(n,r){if(r in n)for(var t=Object.getPrototypeOf(n);t;){var e=Object.getOwnPropertyDescriptor(t,r);if(e)return e;t=Object.getPrototypeOf(t);}}function k(n){n.P||(n.P=!0,n.l&&k(n.l));}function E(n){n.o||(n.o=l(n.t));}function R(n,r,t){var e=s(r)?b("MapSet").N(r,t):v(r)?b("MapSet").T(r,t):n.g?function(n,r){var t=Array.isArray(n),e={i:t?1:0,A:r?r.A:_(),P:!1,I:!1,D:{},l:r,t:n,k:null,o:null,j:null,C:!1},i=e,o=en;t&&(i=[e],o=on);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(r,t):b("ES5").J(r,t);return (t?t.A:_()).p.push(e),e}function D(e){return r(e)||n(22,e),function n(r){if(!t(r))return r;var e,u=r[Q],c=o(r);if(u){if(!u.P&&(u.i<4||!b("ES5").K(u)))return u.t;u.I=!0,e=F(r,c),u.I=!1;}else e=F(r,c);return i(e,(function(r,t){u&&a(u.t,r)===t||f(e,r,n(t));})),3===c?new Set(e):e}(e)}function F(n,r){switch(r){case 2:return new Map(n);case 3:return Array.from(n)}return l(n)}var G,U,W="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,q="undefined"!=typeof Set,B="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H=W?Symbol.for("immer-nothing"):((G={})["immer-nothing"]=!0,G),L=W?Symbol.for("immer-draftable"):"__$immer_draftable",Q=W?Symbol.for("immer-state"):"__$immer_state",Y={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(n){return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+n},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(n){return "Cannot apply patch, path doesn't resolve: "+n},16:'Sets cannot have "replace" patches.',17:function(n){return "Unsupported patch operation: "+n},18:function(n){return "The plugin for '"+n+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+n+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(n){return "produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+n+"'"},22:function(n){return "'current' expects a draft, got: "+n},23:function(n){return "'original' expects a draft, got: "+n},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Z=""+Object.prototype.constructor,nn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(n){var r={};return nn(n).forEach((function(t){r[t]=Object.getOwnPropertyDescriptor(n,t);})),r},tn={},en={get:function(n,r){if(r===Q)return n;var e=p(n);if(!u(e,r))return function(n,r,t){var e,i=I(r,t);return i?"value"in i?i.value:null===(e=i.get)||void 0===e?void 0:e.call(n.k):void 0}(n,e,r);var i=e[r];return n.I||!t(i)?i:i===z(n.t,r)?(E(n),n.o[r]=R(n.A.h,i,n)):i},has:function(n,r){return r in p(n)},ownKeys:function(n){return Reflect.ownKeys(p(n))},set:function(n,r,t){var e=I(p(n),r);if(null==e?void 0:e.set)return e.set.call(n.k,t),!0;if(!n.P){var i=z(p(n),r),o=null==i?void 0:i[Q];if(o&&o.t===t)return n.o[r]=t,n.D[r]=!1,!0;if(c(t,i)&&(void 0!==t||u(n.t,r)))return !0;E(n),k(n);}return n.o[r]===t&&"number"!=typeof t&&(void 0!==t||r in n.o)||(n.o[r]=t,n.D[r]=!0,!0)},deleteProperty:function(n,r){return void 0!==z(n.t,r)||r in n.t?(n.D[r]=!1,E(n),k(n)):delete n.D[r],n.o&&delete n.o[r],!0},getOwnPropertyDescriptor:function(n,r){var t=p(n),e=Reflect.getOwnPropertyDescriptor(t,r);return e?{writable:!0,configurable:1!==n.i||"length"!==r,enumerable:e.enumerable,value:t[r]}:e},defineProperty:function(){n(11);},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n(12);}},on={};i(en,(function(n,r){on[n]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)};})),on.deleteProperty=function(r,t){return isNaN(parseInt(t))&&n(13),on.set.call(this,r,t,void 0)},on.set=function(r,t,e){return "length"!==t&&isNaN(parseInt(t))&&n(14),en.set.call(this,r[0],t,e,r[0])};var un=function(){function e(r){var e=this;this.g=B,this.F=!0,this.produce=function(r,i,o){if("function"==typeof r&&"function"!=typeof i){var u=i;i=r;var a=e;return function(n){var r=this;void 0===n&&(n=u);for(var t=arguments.length,e=Array(t>1?t-1:0),o=1;o<t;o++)e[o-1]=arguments[o];return a.produce(n,(function(n){var t;return (t=i).call.apply(t,[r,n].concat(e))}))}}var f;if("function"!=typeof i&&n(6),void 0!==o&&"function"!=typeof o&&n(7),t(r)){var c=w(e),s=R(e,r,void 0),v=!0;try{f=i(s),v=!1;}finally{v?O(c):g(c);}return "undefined"!=typeof Promise&&f instanceof Promise?f.then((function(n){return j(c,o),P(n,c)}),(function(n){throw O(c),n})):(j(c,o),P(f,c))}if(!r||"object"!=typeof r){if(void 0===(f=i(r))&&(f=r),f===H&&(f=void 0),e.F&&d(f,!0),o){var p=[],l=[];b("Patches").M(r,f,p,l),o(p,l);}return f}n(21,r);},this.produceWithPatches=function(n,r){if("function"==typeof n)return function(r){for(var t=arguments.length,i=Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];return e.produceWithPatches(r,(function(r){return n.apply(void 0,[r].concat(i))}))};var t,i,o=e.produce(n,r,(function(n,r){t=n,i=r;}));return "undefined"!=typeof Promise&&o instanceof Promise?o.then((function(n){return [n,t,i]})):[o,t,i]},"boolean"==typeof(null==r?void 0:r.useProxies)&&this.setUseProxies(r.useProxies),"boolean"==typeof(null==r?void 0:r.autoFreeze)&&this.setAutoFreeze(r.autoFreeze);}var i=e.prototype;return i.createDraft=function(e){t(e)||n(8),r(e)&&(e=D(e));var i=w(this),o=R(this,e,void 0);return o[Q].C=!0,g(i),o},i.finishDraft=function(r,t){var e=r&&r[Q];(e&&e.C||n(9),e.I&&n(10));var i=e.A;return j(i,t),P(void 0,i)},i.setAutoFreeze=function(n){this.F=n;},i.setUseProxies=function(r){r&&!B&&n(20),this.g=r;},i.applyPatches=function(n,t){var e;for(e=t.length-1;e>=0;e--){var i=t[e];if(0===i.path.length&&"replace"===i.op){n=i.value;break}}e>-1&&(t=t.slice(e+1));var o=b("Patches").$;return r(n)?o(n,t):this.produce(n,(function(n){return o(n,t)}))},e}(),an=new un,fn=an.produce,cn=an.produceWithPatches.bind(an),sn=an.setAutoFreeze.bind(an),vn=an.setUseProxies.bind(an),pn=an.applyPatches.bind(an),ln=an.createDraft.bind(an),dn=an.finishDraft.bind(an);
|
|
87072
|
+
|
|
87073
|
+
var DndContainer$1 = function DndContainer(_ref) {
|
|
87074
|
+
var children = _ref.children,
|
|
87075
|
+
move = _ref.move;
|
|
87076
|
+
var sensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, {
|
|
87077
|
+
coordinateGetter: sortableKeyboardCoordinates
|
|
87078
|
+
})); // 拖拽结束
|
|
87079
|
+
|
|
87080
|
+
var handleDragEnd = function handleDragEnd(event) {
|
|
87081
|
+
var active = event.active,
|
|
87082
|
+
over = event.over; // 未移入时触发
|
|
87083
|
+
|
|
87084
|
+
if (!(over === null || over === void 0 ? void 0 : over.id)) {
|
|
87085
|
+
return;
|
|
87086
|
+
} // 移入时触发更新数据
|
|
87087
|
+
|
|
87088
|
+
|
|
87089
|
+
if (active.id !== over.id) {
|
|
87090
|
+
move(active.id, over.id);
|
|
87091
|
+
}
|
|
87092
|
+
};
|
|
87093
|
+
|
|
87094
|
+
return /*#__PURE__*/React__default['default'].createElement(DndContext, {
|
|
87095
|
+
sensors: sensors,
|
|
87096
|
+
collisionDetection: closestCenter,
|
|
87097
|
+
onDragEnd: handleDragEnd,
|
|
87098
|
+
modifiers: [restrictToParentElement]
|
|
87099
|
+
}, children);
|
|
87100
|
+
};
|
|
87101
|
+
|
|
87102
|
+
var SortableBox$1 = function SortableBox(_ref) {
|
|
87103
|
+
var items = _ref.items,
|
|
87104
|
+
children = _ref.children;
|
|
87105
|
+
return /*#__PURE__*/React__default['default'].createElement(SortableContext, {
|
|
87106
|
+
items: items,
|
|
87107
|
+
strategy: verticalListSortingStrategy
|
|
87108
|
+
}, children);
|
|
87109
|
+
};
|
|
87110
|
+
|
|
87111
|
+
var _excluded$1q = ["data-row-key", "children", "className"];
|
|
87112
|
+
|
|
87113
|
+
var SortableItem$1 = function SortableItem(props) {
|
|
87114
|
+
var key = props['data-row-key'],
|
|
87115
|
+
children = props.children,
|
|
87116
|
+
className = props.className,
|
|
87117
|
+
resetField = _objectWithoutProperties(props, _excluded$1q);
|
|
87118
|
+
|
|
87119
|
+
var _useSortable = useSortable({
|
|
87120
|
+
id: key
|
|
87121
|
+
}),
|
|
87122
|
+
attributes = _useSortable.attributes,
|
|
87123
|
+
setNodeRef = _useSortable.setNodeRef,
|
|
87124
|
+
transform = _useSortable.transform,
|
|
87125
|
+
transition = _useSortable.transition;
|
|
87126
|
+
|
|
87127
|
+
var style = {
|
|
87128
|
+
transform: CSS.Transform.toString(transform),
|
|
87129
|
+
transition: transition
|
|
87130
|
+
};
|
|
87131
|
+
return /*#__PURE__*/React__default['default'].createElement("tr", _objectSpread(_objectSpread({}, resetField), {}, {
|
|
87132
|
+
ref: setNodeRef,
|
|
87133
|
+
key: key,
|
|
87134
|
+
style: style
|
|
87135
|
+
}, attributes), children);
|
|
87136
|
+
};
|
|
87137
|
+
|
|
87138
|
+
var Dragger = function Dragger(_ref) {
|
|
87139
|
+
var id = _ref.id;
|
|
87140
|
+
|
|
87141
|
+
var _useSortable = useSortable({
|
|
87142
|
+
id: id
|
|
87143
|
+
}),
|
|
87144
|
+
listeners = _useSortable.listeners,
|
|
87145
|
+
isDragging = _useSortable.isDragging;
|
|
87146
|
+
|
|
87147
|
+
return /*#__PURE__*/React__default['default'].createElement(IconFont, _objectSpread(_objectSpread({
|
|
87148
|
+
type: "lmweb-icon-m-receipt"
|
|
87149
|
+
}, listeners), {}, {
|
|
87150
|
+
style: {
|
|
87151
|
+
touchAction: 'none'
|
|
87152
|
+
},
|
|
87153
|
+
className: 'icon_drag' + (isDragging ? 'bing' : '')
|
|
87154
|
+
}));
|
|
87155
|
+
};
|
|
87156
|
+
|
|
87157
|
+
var _excluded$1r = ["index"],
|
|
87158
|
+
_excluded2$m = ["index"],
|
|
87159
|
+
_excluded3$7 = ["value", "onChange"],
|
|
87160
|
+
_excluded4$3 = ["record", "rowKey", "isEdit", "col", "handleTableRowDelete", "handleTableRowAdd", "getLength", "isHoverEdit", "editEnum", "valueType", "children", "handleSave", "handleAdd", "handleDelete", "itemProps", "setValid", "reWriteOriginSource"],
|
|
87161
|
+
_excluded5$2 = ["onMouseEnter", "onMouseLeave"],
|
|
87162
|
+
_excluded6$1 = ["value", "columns", "isEdit", "isAdd", "onChange", "rowKey", "rowHoverEdit", "isUseForm", "isHoverEdit", "useQuickOpetate", "rowSelection", "sortOpen", "size"];
|
|
87163
|
+
var UploadBtn$1 = UploadOss.UploadBtn;
|
|
87164
|
+
var EditableContext$1 = /*#__PURE__*/React__default['default'].createContext(null); // 表格行
|
|
87165
|
+
|
|
87166
|
+
var EditableRow$1 = function EditableRow(_ref) {
|
|
87167
|
+
var index = _ref.index,
|
|
87168
|
+
props = _objectWithoutProperties(_ref, _excluded$1r);
|
|
87169
|
+
|
|
87170
|
+
var _Form$useForm = _Form__default['default'].useForm(),
|
|
87171
|
+
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
87172
|
+
form = _Form$useForm2[0];
|
|
87173
|
+
|
|
87174
|
+
return /*#__PURE__*/React__default['default'].createElement(_Form__default['default'], {
|
|
87175
|
+
form: form,
|
|
87176
|
+
component: false
|
|
87177
|
+
}, /*#__PURE__*/React__default['default'].createElement(EditableContext$1.Provider, {
|
|
87178
|
+
value: form
|
|
87179
|
+
}, /*#__PURE__*/React__default['default'].createElement("tr", _objectSpread({}, props))));
|
|
87180
|
+
};
|
|
87181
|
+
|
|
87182
|
+
var EditableSortRow = function EditableSortRow(_ref2) {
|
|
87183
|
+
var index = _ref2.index,
|
|
87184
|
+
props = _objectWithoutProperties(_ref2, _excluded2$m);
|
|
87185
|
+
|
|
87186
|
+
var _Form$useForm3 = _Form__default['default'].useForm(),
|
|
87187
|
+
_Form$useForm4 = _slicedToArray(_Form$useForm3, 1),
|
|
87188
|
+
form = _Form$useForm4[0];
|
|
87189
|
+
|
|
87190
|
+
return /*#__PURE__*/React__default['default'].createElement(_Form__default['default'], {
|
|
87191
|
+
form: form,
|
|
87192
|
+
component: false
|
|
87193
|
+
}, /*#__PURE__*/React__default['default'].createElement(EditableContext$1.Provider, {
|
|
87194
|
+
value: form
|
|
87195
|
+
}, /*#__PURE__*/React__default['default'].createElement(SortableItem$1, _objectSpread({}, props))));
|
|
87196
|
+
};
|
|
87197
|
+
|
|
87198
|
+
var UploadSingle$1 = function UploadSingle(props) {
|
|
87199
|
+
var value = props.value,
|
|
87200
|
+
onChange = props.onChange,
|
|
87201
|
+
editEnum = props.editEnum;
|
|
87202
|
+
|
|
87203
|
+
var handleDelete = function handleDelete() {
|
|
87204
|
+
onChange === null || onChange === void 0 ? void 0 : onChange();
|
|
87205
|
+
};
|
|
87206
|
+
|
|
87207
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
87208
|
+
className: "upload_single"
|
|
87209
|
+
}, value ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
87210
|
+
type: "lmweb-link",
|
|
87211
|
+
style: {
|
|
87212
|
+
fontSize: 14,
|
|
87213
|
+
color: '#1890ff'
|
|
87214
|
+
}
|
|
87215
|
+
}), /*#__PURE__*/React__default['default'].createElement("a", {
|
|
87216
|
+
href: "".concat(value === null || value === void 0 ? void 0 : value.externalUrl, "/").concat(value === null || value === void 0 ? void 0 : value.filePath).concat(value === null || value === void 0 ? void 0 : value.realFileName),
|
|
87217
|
+
target: "_blank",
|
|
87218
|
+
rel: "noreferrer"
|
|
87219
|
+
}, value === null || value === void 0 ? void 0 : value.fileName), /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
87220
|
+
type: "lmweb-delete",
|
|
87221
|
+
style: {
|
|
87222
|
+
fontSize: 14,
|
|
87223
|
+
color: '#1890ff'
|
|
87224
|
+
},
|
|
87225
|
+
onClick: handleDelete
|
|
87226
|
+
})) : /*#__PURE__*/React__default['default'].createElement(UploadBtn$1, _objectSpread(_objectSpread({}, editEnum), {}, {
|
|
87227
|
+
value: value,
|
|
87228
|
+
onChange: onChange
|
|
87229
|
+
})));
|
|
87230
|
+
};
|
|
87231
|
+
|
|
87232
|
+
var InputRange$1 = function InputRange(_ref3) {
|
|
87233
|
+
var _ref3$value = _ref3.value,
|
|
87234
|
+
value = _ref3$value === void 0 ? ['', ''] : _ref3$value,
|
|
87235
|
+
onChange = _ref3.onChange,
|
|
87236
|
+
editEnum = _objectWithoutProperties(_ref3, _excluded3$7);
|
|
87237
|
+
|
|
87238
|
+
// 输入值改变
|
|
87239
|
+
var handleInput = function handleInput(e, type) {
|
|
87240
|
+
var v = e.target.value;
|
|
87241
|
+
|
|
87242
|
+
var nValue = _toConsumableArray(value);
|
|
87243
|
+
|
|
87244
|
+
if (type === 'prev') {
|
|
87245
|
+
nValue[0] = v;
|
|
87246
|
+
}
|
|
87247
|
+
|
|
87248
|
+
if (type === 'next') {
|
|
87249
|
+
nValue[1] = v;
|
|
87250
|
+
}
|
|
87251
|
+
|
|
87252
|
+
onChange(nValue);
|
|
87253
|
+
};
|
|
87254
|
+
|
|
87255
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
87256
|
+
className: "lm_editTable_wrapperRange"
|
|
87257
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
87258
|
+
className: "inputRange"
|
|
87259
|
+
}, /*#__PURE__*/React__default['default'].createElement(LmInput, _objectSpread({
|
|
87260
|
+
value: value === null || value === void 0 ? void 0 : value[0],
|
|
87261
|
+
placeholder: "\u8BF7\u8F93\u5165",
|
|
87262
|
+
onChange: function onChange(e) {
|
|
87263
|
+
return handleInput(e, 'prev');
|
|
87264
|
+
}
|
|
87265
|
+
}, editEnum)), "~", /*#__PURE__*/React__default['default'].createElement(LmInput, _objectSpread({
|
|
87266
|
+
value: value === null || value === void 0 ? void 0 : value[1],
|
|
87267
|
+
placeholder: "\u8BF7\u8F93\u5165",
|
|
87268
|
+
onChange: function onChange(e) {
|
|
87269
|
+
return handleInput(e, 'next');
|
|
87270
|
+
}
|
|
87271
|
+
}, editEnum))));
|
|
87272
|
+
}; // 操作列
|
|
87273
|
+
|
|
87274
|
+
|
|
87275
|
+
var Opetate$1 = function Opetate(_ref4) {
|
|
87276
|
+
var record = _ref4.record,
|
|
87277
|
+
rowKey = _ref4.rowKey,
|
|
87278
|
+
handleAdd = _ref4.handleAdd,
|
|
87279
|
+
handleDelete = _ref4.handleDelete;
|
|
87280
|
+
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(LMButton, {
|
|
87281
|
+
type: "link",
|
|
87282
|
+
size: "small",
|
|
87283
|
+
icon: /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
87284
|
+
type: "lmweb-minus-circle",
|
|
87285
|
+
style: {
|
|
87286
|
+
fontSize: 16
|
|
87287
|
+
}
|
|
87288
|
+
}),
|
|
87289
|
+
onClick: function onClick() {
|
|
87290
|
+
return handleDelete(record[rowKey]);
|
|
87291
|
+
}
|
|
87292
|
+
}), /*#__PURE__*/React__default['default'].createElement(LMButton, {
|
|
87293
|
+
type: "link",
|
|
87294
|
+
size: "small",
|
|
87295
|
+
icon: /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
87296
|
+
type: "lmweb-plus-circle",
|
|
87297
|
+
style: {
|
|
87298
|
+
fontSize: 16
|
|
87299
|
+
}
|
|
87300
|
+
}),
|
|
87301
|
+
onClick: function onClick() {
|
|
87302
|
+
return handleAdd(record);
|
|
87303
|
+
}
|
|
87304
|
+
}));
|
|
87305
|
+
}; // const isValidValue = (verifyValue) => {
|
|
87306
|
+
// const toStringValue = JSON.stringify(verifyValue);
|
|
87307
|
+
// if (verifyValue === undefined || verifyValue === null || verifyValue === '' || toStringValue === '[]' || toStringValue === '{}') {
|
|
87308
|
+
// return false;
|
|
87309
|
+
// }
|
|
87310
|
+
// return true;
|
|
87311
|
+
// }
|
|
87312
|
+
|
|
87313
|
+
/*
|
|
87314
|
+
表格单元格
|
|
87315
|
+
editEnum: 下拉框时的数据数组(非数组时是配置设置)
|
|
87316
|
+
valueType: 编辑框配置(多选)
|
|
87317
|
+
*/
|
|
87318
|
+
|
|
87319
|
+
|
|
87320
|
+
var EditableCell$1 = function EditableCell(props) {
|
|
87321
|
+
var _props$record = props.record,
|
|
87322
|
+
record = _props$record === void 0 ? {} : _props$record,
|
|
87323
|
+
rowKey = props.rowKey,
|
|
87324
|
+
isEdit = props.isEdit,
|
|
87325
|
+
_props$col = props.col,
|
|
87326
|
+
col = _props$col === void 0 ? {} : _props$col,
|
|
87327
|
+
handleTableRowDelete = props.handleTableRowDelete,
|
|
87328
|
+
handleTableRowAdd = props.handleTableRowAdd,
|
|
87329
|
+
getLength = props.getLength,
|
|
87330
|
+
isHoverEdit = props.isHoverEdit,
|
|
87331
|
+
editEnum = props.editEnum,
|
|
87332
|
+
valueType = props.valueType,
|
|
87333
|
+
children = props.children,
|
|
87334
|
+
handleSave = props.handleSave,
|
|
87335
|
+
handleAdd = props.handleAdd,
|
|
87336
|
+
handleDelete = props.handleDelete,
|
|
87337
|
+
itemProps = props.itemProps,
|
|
87338
|
+
setValid = props.setValid,
|
|
87339
|
+
reWriteOriginSource = props.reWriteOriginSource,
|
|
87340
|
+
restProps = _objectWithoutProperties(props, _excluded4$3);
|
|
87341
|
+
/** 去除移入移出功能,保留最纯粹的功能,优化性能 */
|
|
87342
|
+
|
|
87343
|
+
|
|
87344
|
+
var onMouseEnter = restProps.onMouseEnter,
|
|
87345
|
+
onMouseLeave = restProps.onMouseLeave,
|
|
87346
|
+
clearProps = _objectWithoutProperties(restProps, _excluded5$2);
|
|
87347
|
+
|
|
87348
|
+
var _col$componentProps = col.componentProps,
|
|
87349
|
+
componentProps = _col$componentProps === void 0 ? {} : _col$componentProps;
|
|
87350
|
+
var checkCellRef = React.useRef(null); // const focusCapturedRef = useRef(false);
|
|
87351
|
+
// const curValue = useMemo(() => {
|
|
87352
|
+
// return record?.dataIndex
|
|
87353
|
+
// }, [record])
|
|
87354
|
+
// const curValueIsValid = isValidValue(curValue);
|
|
87355
|
+
// 校验保存
|
|
87356
|
+
|
|
87357
|
+
var save = /*#__PURE__*/function () {
|
|
87358
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(row) {
|
|
87359
|
+
var values;
|
|
87360
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
87361
|
+
while (1) {
|
|
87362
|
+
switch (_context.prev = _context.next) {
|
|
87363
|
+
case 0:
|
|
87364
|
+
console.log(row, 'rrr', form.getFieldsValue(), record);
|
|
87365
|
+
_context.prev = 1;
|
|
87366
|
+
_context.t0 = row;
|
|
87367
|
+
|
|
87368
|
+
if (_context.t0) {
|
|
87369
|
+
_context.next = 7;
|
|
87370
|
+
break;
|
|
87371
|
+
}
|
|
87372
|
+
|
|
87373
|
+
_context.next = 6;
|
|
87374
|
+
return form.getFieldsValue();
|
|
87375
|
+
|
|
87376
|
+
case 6:
|
|
87377
|
+
_context.t0 = _context.sent;
|
|
87378
|
+
|
|
87379
|
+
case 7:
|
|
87380
|
+
values = _context.t0;
|
|
87381
|
+
console.log(_objectSpread(_objectSpread({}, values), {}, _defineProperty({}, rowKey, record === null || record === void 0 ? void 0 : record[rowKey])), 'vvvv');
|
|
87382
|
+
console.time('testForEach');
|
|
87383
|
+
handleSave(_objectSpread(_objectSpread({}, values), {}, _defineProperty({}, rowKey, record === null || record === void 0 ? void 0 : record[rowKey])));
|
|
87384
|
+
console.timeEnd('testForEach');
|
|
87385
|
+
_context.next = 14;
|
|
87386
|
+
return form.validateFields();
|
|
87387
|
+
|
|
87388
|
+
case 14:
|
|
87389
|
+
_context.next = 18;
|
|
87390
|
+
break;
|
|
87391
|
+
|
|
87392
|
+
case 16:
|
|
87393
|
+
_context.prev = 16;
|
|
87394
|
+
_context.t1 = _context["catch"](1);
|
|
87395
|
+
|
|
87396
|
+
case 18:
|
|
87397
|
+
case "end":
|
|
87398
|
+
return _context.stop();
|
|
87399
|
+
}
|
|
87400
|
+
}
|
|
87401
|
+
}, _callee, null, [[1, 16]]);
|
|
87402
|
+
}));
|
|
87403
|
+
|
|
87404
|
+
return function save(_x) {
|
|
87405
|
+
return _ref5.apply(this, arguments);
|
|
87406
|
+
};
|
|
87407
|
+
}(); // 触发保存
|
|
87408
|
+
|
|
87409
|
+
|
|
87410
|
+
var handleFormItemChange = function handleFormItemChange(e) {
|
|
87411
|
+
save === null || save === void 0 ? void 0 : save();
|
|
87412
|
+
};
|
|
87413
|
+
|
|
87414
|
+
var Control = function Control(con) {
|
|
87415
|
+
switch (con) {
|
|
87416
|
+
case 'input':
|
|
87417
|
+
return /*#__PURE__*/React__default['default'].createElement(LmInput, _objectSpread(_objectSpread({
|
|
87418
|
+
onPressEnter: handleFormItemChange,
|
|
87419
|
+
onBlur: handleFormItemChange,
|
|
87420
|
+
ref: checkCellRef,
|
|
87421
|
+
placeholder: "\u8BF7\u8F93\u5165"
|
|
87422
|
+
}, componentProps), {}, {
|
|
87423
|
+
addonBefore: componentProps.addonBefore ? /*#__PURE__*/React__default['default'].createElement(_Form__default['default'].Item, {
|
|
87424
|
+
name: [col.dataIndex, 'addonBeforeValue'],
|
|
87425
|
+
noStyle: true
|
|
87426
|
+
}, /*#__PURE__*/React__default['default'].cloneElement(componentProps.addonBefore, {
|
|
87427
|
+
onChange: handleFormItemChange
|
|
87428
|
+
})) : null,
|
|
87429
|
+
addonAfter: componentProps.addonAfter ? /*#__PURE__*/React__default['default'].createElement(_Form__default['default'].Item, {
|
|
87430
|
+
name: [col.dataIndex, 'addonAfterValue'],
|
|
87431
|
+
noStyle: true
|
|
87432
|
+
}, /*#__PURE__*/React__default['default'].cloneElement(componentProps.addonAfter, {
|
|
87433
|
+
onChange: handleFormItemChange
|
|
87434
|
+
})) : null
|
|
87435
|
+
}));
|
|
87436
|
+
|
|
87437
|
+
case 'inputRange':
|
|
87438
|
+
return /*#__PURE__*/React__default['default'].createElement(InputRange$1, _objectSpread({
|
|
87439
|
+
onChange: handleFormItemChange,
|
|
87440
|
+
ref: checkCellRef
|
|
87441
|
+
}, componentProps));
|
|
84497
87442
|
|
|
84498
|
-
|
|
84499
|
-
|
|
84500
|
-
|
|
87443
|
+
case 'number':
|
|
87444
|
+
return /*#__PURE__*/React__default['default'].createElement(CInputNumber, _objectSpread({
|
|
87445
|
+
onPressEnter: handleFormItemChange,
|
|
87446
|
+
onBlur: handleFormItemChange,
|
|
87447
|
+
style: {
|
|
87448
|
+
width: (editEnum === null || editEnum === void 0 ? void 0 : editEnum.width) || '100%'
|
|
87449
|
+
},
|
|
87450
|
+
placeholder: "\u8BF7\u8F93\u5165",
|
|
87451
|
+
ref: checkCellRef
|
|
87452
|
+
}, componentProps));
|
|
84501
87453
|
|
|
84502
|
-
|
|
84503
|
-
|
|
84504
|
-
|
|
84505
|
-
|
|
84506
|
-
|
|
84507
|
-
|
|
84508
|
-
}, []);
|
|
84509
|
-
var sensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, {
|
|
84510
|
-
coordinateGetter: sortableKeyboardCoordinates
|
|
84511
|
-
}));
|
|
84512
|
-
/** 排序结束回调 */
|
|
87454
|
+
case 'date':
|
|
87455
|
+
// @ts-ignore
|
|
87456
|
+
return /*#__PURE__*/React__default['default'].createElement(_DatePicker__default['default'], _objectSpread({
|
|
87457
|
+
onChange: handleFormItemChange,
|
|
87458
|
+
ref: checkCellRef
|
|
87459
|
+
}, componentProps));
|
|
84513
87460
|
|
|
84514
|
-
|
|
84515
|
-
|
|
84516
|
-
|
|
87461
|
+
case 'select':
|
|
87462
|
+
return /*#__PURE__*/React__default['default'].createElement(LMSelect$1, _objectSpread(_objectSpread({
|
|
87463
|
+
showSearch: true,
|
|
87464
|
+
allowClear: true,
|
|
87465
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
|
87466
|
+
ref: checkCellRef,
|
|
87467
|
+
filterOption: function filterOption(input, option) {
|
|
87468
|
+
var _option$children, _option$children$toLo;
|
|
84517
87469
|
|
|
84518
|
-
|
|
84519
|
-
|
|
84520
|
-
|
|
84521
|
-
|
|
84522
|
-
});
|
|
84523
|
-
|
|
84524
|
-
|
|
87470
|
+
return ((_option$children = option.children) === null || _option$children === void 0 ? void 0 : (_option$children$toLo = _option$children.toLowerCase()) === null || _option$children$toLo === void 0 ? void 0 : _option$children$toLo.indexOf(input.toLowerCase())) >= 0;
|
|
87471
|
+
}
|
|
87472
|
+
}, componentProps), {}, {
|
|
87473
|
+
onChange: handleFormItemChange
|
|
87474
|
+
}));
|
|
87475
|
+
|
|
87476
|
+
case 'multiple':
|
|
87477
|
+
return /*#__PURE__*/React__default['default'].createElement(LMSelect$1, _objectSpread({
|
|
87478
|
+
mode: "multiple",
|
|
87479
|
+
showSearch: true,
|
|
87480
|
+
allowClear: true,
|
|
87481
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
|
87482
|
+
ref: checkCellRef,
|
|
87483
|
+
filterOption: function filterOption(input, option) {
|
|
87484
|
+
var _option$children2;
|
|
87485
|
+
|
|
87486
|
+
return ((_option$children2 = option.children) === null || _option$children2 === void 0 ? void 0 : _option$children2.toLowerCase().indexOf(input.toLowerCase())) >= 0;
|
|
87487
|
+
},
|
|
87488
|
+
onChange: handleFormItemChange,
|
|
87489
|
+
onDeselect: handleFormItemChange
|
|
87490
|
+
}, componentProps));
|
|
87491
|
+
|
|
87492
|
+
case 'checkbox':
|
|
87493
|
+
return /*#__PURE__*/React__default['default'].createElement(LMCheckBox.Group, _objectSpread({
|
|
87494
|
+
onChange: handleFormItemChange,
|
|
87495
|
+
ref: checkCellRef
|
|
87496
|
+
}, componentProps));
|
|
87497
|
+
|
|
87498
|
+
case 'radio':
|
|
87499
|
+
return /*#__PURE__*/React__default['default'].createElement(LMRadio.Group, _objectSpread({
|
|
87500
|
+
onChange: handleFormItemChange,
|
|
87501
|
+
ref: checkCellRef
|
|
87502
|
+
}, componentProps), editEnum === null || editEnum === void 0 ? void 0 : editEnum.map(function (v) {
|
|
87503
|
+
return /*#__PURE__*/React__default['default'].createElement(LMRadio, {
|
|
87504
|
+
key: v.value,
|
|
87505
|
+
value: v.value
|
|
87506
|
+
}, v.label);
|
|
87507
|
+
}));
|
|
87508
|
+
|
|
87509
|
+
case 'switch':
|
|
87510
|
+
return /*#__PURE__*/React__default['default'].createElement(_Switch__default['default'], {
|
|
87511
|
+
onChange: handleFormItemChange
|
|
84525
87512
|
});
|
|
84526
|
-
|
|
84527
|
-
|
|
84528
|
-
|
|
84529
|
-
|
|
87513
|
+
|
|
87514
|
+
case 'upload':
|
|
87515
|
+
return /*#__PURE__*/React__default['default'].createElement(UploadSingle$1, {
|
|
87516
|
+
editEnum: componentProps,
|
|
87517
|
+
ref: checkCellRef,
|
|
87518
|
+
onChange: handleFormItemChange
|
|
84530
87519
|
});
|
|
84531
|
-
|
|
87520
|
+
|
|
87521
|
+
case 'operate':
|
|
87522
|
+
case 'lm_edit_opetate':
|
|
87523
|
+
return /*#__PURE__*/React__default['default'].createElement(Opetate$1, _objectSpread({
|
|
87524
|
+
record: record,
|
|
87525
|
+
rowKey: rowKey,
|
|
87526
|
+
ref: checkCellRef,
|
|
87527
|
+
handleAdd: handleTableRowAdd,
|
|
87528
|
+
handleDelete: handleTableRowDelete,
|
|
87529
|
+
getLength: getLength
|
|
87530
|
+
}, componentProps));
|
|
87531
|
+
|
|
87532
|
+
case 'render':
|
|
87533
|
+
{
|
|
87534
|
+
var render = componentProps.render;
|
|
87535
|
+
return render === null || render === void 0 ? void 0 : render(_objectSpread(_objectSpread({}, record), {}, {
|
|
87536
|
+
onChange: save
|
|
87537
|
+
}));
|
|
87538
|
+
}
|
|
87539
|
+
|
|
87540
|
+
default:
|
|
87541
|
+
return /*#__PURE__*/React__default['default'].createElement(LmInput, _objectSpread({
|
|
87542
|
+
onPressEnter: handleFormItemChange,
|
|
87543
|
+
onBlur: handleFormItemChange,
|
|
87544
|
+
ref: checkCellRef
|
|
87545
|
+
}, componentProps));
|
|
84532
87546
|
}
|
|
84533
87547
|
};
|
|
84534
|
-
/** 添加是否显示 */
|
|
84535
87548
|
|
|
87549
|
+
var getMemoChildNode = React.useMemo(function () {
|
|
87550
|
+
var editable = col.editable,
|
|
87551
|
+
dataIndex = col.dataIndex,
|
|
87552
|
+
formProps = col.formProps,
|
|
87553
|
+
componentProps = col.componentProps;
|
|
87554
|
+
var childNode = children;
|
|
84536
87555
|
|
|
84537
|
-
|
|
84538
|
-
|
|
84539
|
-
|
|
84540
|
-
|
|
84541
|
-
|
|
84542
|
-
|
|
87556
|
+
if (isEdit && editable) {
|
|
87557
|
+
childNode = /*#__PURE__*/React__default['default'].createElement(_Form__default['default'].Item, _objectSpread(_objectSpread({
|
|
87558
|
+
style: {
|
|
87559
|
+
margin: 0
|
|
87560
|
+
}
|
|
87561
|
+
}, formProps), {}, {
|
|
87562
|
+
name: dataIndex
|
|
87563
|
+
}), Control(editable));
|
|
87564
|
+
|
|
87565
|
+
if (editable === 'input' && ((componentProps === null || componentProps === void 0 ? void 0 : componentProps.addonBefore) || (componentProps === null || componentProps === void 0 ? void 0 : componentProps.addonAfter))) {
|
|
87566
|
+
childNode = /*#__PURE__*/React__default['default'].createElement(_Form__default['default'].Item, _objectSpread(_objectSpread({
|
|
87567
|
+
style: {
|
|
87568
|
+
margin: 0
|
|
87569
|
+
}
|
|
87570
|
+
}, formProps), {}, {
|
|
87571
|
+
name: [dataIndex, 'value']
|
|
87572
|
+
}), Control(editable));
|
|
84543
87573
|
}
|
|
87574
|
+
}
|
|
84544
87575
|
|
|
84545
|
-
|
|
87576
|
+
return childNode;
|
|
87577
|
+
}, [col, isEdit]); // const [childNode, setChildNode] = useState(getMemoChildNode);
|
|
87578
|
+
|
|
87579
|
+
var form = React.useContext(EditableContext$1); // 出现死循环找我
|
|
87580
|
+
|
|
87581
|
+
React.useEffect(function () {
|
|
87582
|
+
var editable = col.editable,
|
|
87583
|
+
dataIndex = col.dataIndex;
|
|
87584
|
+
|
|
87585
|
+
if (isEdit && editable && record[dataIndex] || isHoverEdit && editable && record[dataIndex]) {
|
|
87586
|
+
form.setFieldsValue(_defineProperty({}, dataIndex, editable === 'date' ? dayjs_min(record[dataIndex]) : record[dataIndex]));
|
|
87587
|
+
}
|
|
87588
|
+
}, [record]); // const isOpenEdit = (isEdit && focusCapturedRef.current) || (isHoverEdit && focusCapturedRef.current);
|
|
87589
|
+
// const classNames = cx({
|
|
87590
|
+
// 'lm_base_editTable_cell': true,
|
|
87591
|
+
// 'lm_base_editTable_cell_edit': isOpenEdit || (isHoverEdit && !curValueIsValid),
|
|
87592
|
+
// });
|
|
87593
|
+
// const extensionConfig = {};
|
|
87594
|
+
// const mouseEnterCell = () => {
|
|
87595
|
+
// focusCapturedRef.current = true;
|
|
87596
|
+
// const newChildNode = getMemoChildNode;
|
|
87597
|
+
// setChildNode(newChildNode);
|
|
87598
|
+
// };
|
|
87599
|
+
// const mouseLeaveCell = () => {
|
|
87600
|
+
// focusCapturedRef.current = false;
|
|
87601
|
+
// const nextValue = form.getFieldValue(dataIndex);
|
|
87602
|
+
// const prevValue = get(record, dataIndex);
|
|
87603
|
+
// if (!eq(prevValue, nextValue)) {
|
|
87604
|
+
// const rowValue = get(record, rowKey);
|
|
87605
|
+
// reWriteOriginSource(rowKey, rowValue, dataIndex, nextValue);
|
|
87606
|
+
// } else {
|
|
87607
|
+
// const newChildNode = getDefaultChildNode(false);
|
|
87608
|
+
// setChildNode(newChildNode);
|
|
87609
|
+
// }
|
|
87610
|
+
// };
|
|
87611
|
+
// if (isHoverEdit && record?.editable) {
|
|
87612
|
+
// console.log('ssssbbb')
|
|
87613
|
+
// set(extensionConfig, 'onMouseEnter', mouseEnterCell);
|
|
87614
|
+
// set(extensionConfig, 'onMouseLeave', mouseLeaveCell);
|
|
87615
|
+
// }
|
|
87616
|
+
|
|
87617
|
+
return /*#__PURE__*/React__default['default'].createElement("td", _objectSpread(_objectSpread({}, clearProps), {}, {
|
|
87618
|
+
key: "".concat(record[rowKey], "_").concat(record.dataIndex)
|
|
87619
|
+
}), getMemoChildNode); // return <td {...restProps} className={classNames} {...extensionConfig} key={`${get(record, rowKey)}_${dataIndex}`}>{childNode}</td>
|
|
87620
|
+
};
|
|
87621
|
+
|
|
87622
|
+
var EditTable$1 = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
87623
|
+
var defaultData = props.value,
|
|
87624
|
+
columns = props.columns,
|
|
87625
|
+
isEdit = props.isEdit,
|
|
87626
|
+
_props$isAdd = props.isAdd,
|
|
87627
|
+
isAdd = _props$isAdd === void 0 ? false : _props$isAdd,
|
|
87628
|
+
onChange = props.onChange,
|
|
87629
|
+
_props$rowKey = props.rowKey,
|
|
87630
|
+
_rowKey = _props$rowKey === void 0 ? '_ID' : _props$rowKey,
|
|
87631
|
+
rowHoverEdit = props.rowHoverEdit,
|
|
87632
|
+
_props$isUseForm = props.isUseForm,
|
|
87633
|
+
isHoverEdit = props.isHoverEdit,
|
|
87634
|
+
useQuickOpetate = props.useQuickOpetate,
|
|
87635
|
+
rowSelection = props.rowSelection,
|
|
87636
|
+
sortOpen = props.sortOpen,
|
|
87637
|
+
_props$size = props.size,
|
|
87638
|
+
size = _props$size === void 0 ? 'small' : _props$size,
|
|
87639
|
+
resetProps = _objectWithoutProperties(props, _excluded6$1);
|
|
87640
|
+
|
|
87641
|
+
var _useState = React.useState([]),
|
|
87642
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
87643
|
+
dataSource = _useState2[0],
|
|
87644
|
+
setDataSource = _useState2[1]; // const [count, setCount] = useState(0);
|
|
87645
|
+
|
|
87646
|
+
|
|
87647
|
+
var _useState3 = React.useState({}),
|
|
87648
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
87649
|
+
_valid = _useState4[0],
|
|
87650
|
+
setValid = _useState4[1];
|
|
87651
|
+
|
|
87652
|
+
var _useState5 = React.useState([]),
|
|
87653
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
87654
|
+
localRowSelectList = _useState6[0],
|
|
87655
|
+
setLocalRowSelectList = _useState6[1];
|
|
87656
|
+
|
|
87657
|
+
var _useState7 = React.useState([]),
|
|
87658
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
87659
|
+
sortEditTable = _useState8[0],
|
|
87660
|
+
setCallBackFalg = _useState8[1];
|
|
87661
|
+
|
|
87662
|
+
var dataSourceRef = React.useRef([]);
|
|
87663
|
+
var sortDataSorceRef = React.useRef([]);
|
|
87664
|
+
|
|
87665
|
+
var onSortEnd = function onSortEnd(active, over) {
|
|
87666
|
+
var cloneArr = _toConsumableArray(dataSourceRef.current);
|
|
87667
|
+
|
|
87668
|
+
var oldIndex = cloneArr.findIndex(function (v) {
|
|
87669
|
+
return v[_rowKey] === active;
|
|
84546
87670
|
});
|
|
84547
|
-
|
|
87671
|
+
var newIndex = cloneArr.findIndex(function (v) {
|
|
87672
|
+
return v[_rowKey] === over;
|
|
87673
|
+
});
|
|
87674
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(arrayMove(cloneArr, oldIndex, newIndex));
|
|
87675
|
+
}; // 删除
|
|
87676
|
+
|
|
87677
|
+
|
|
87678
|
+
var handleDelete = function handleDelete(key) {
|
|
87679
|
+
var nValue = dataSource.filter(function (item) {
|
|
87680
|
+
return item[_rowKey] !== key;
|
|
87681
|
+
});
|
|
87682
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(nValue);
|
|
84548
87683
|
};
|
|
84549
|
-
/**
|
|
87684
|
+
/** 点击添加按钮添加 */
|
|
84550
87685
|
|
|
84551
87686
|
|
|
84552
|
-
var
|
|
84553
|
-
var
|
|
84554
|
-
|
|
84555
|
-
show: isCheckAll.checkAll ? false : true
|
|
84556
|
-
});
|
|
87687
|
+
var handleAdd = function handleAdd(row) {
|
|
87688
|
+
var res = fn(dataSourceRef.current, function (draft) {
|
|
87689
|
+
draft.push(_defineProperty({}, _rowKey, "".concat(Date.now())));
|
|
84557
87690
|
});
|
|
84558
|
-
|
|
84559
|
-
|
|
87691
|
+
setDataSource(res);
|
|
87692
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(res);
|
|
84560
87693
|
};
|
|
84561
87694
|
|
|
84562
|
-
React.
|
|
84563
|
-
|
|
84564
|
-
getLocalFilter: function getLocalFilter() {
|
|
84565
|
-
return localFilter;
|
|
84566
|
-
},
|
|
84567
|
-
getFilterStateValue: function getFilterStateValue() {
|
|
84568
|
-
var obj = {};
|
|
84569
|
-
localFilter.forEach(function (item) {
|
|
84570
|
-
obj[item.field] = {};
|
|
87695
|
+
React.useEffect(function () {
|
|
87696
|
+
dataSourceRef.current = dataSource;
|
|
84571
87697
|
|
|
84572
|
-
|
|
84573
|
-
|
|
84574
|
-
}
|
|
87698
|
+
if (sortOpen) {
|
|
87699
|
+
var _sortDataSorceRef$cur;
|
|
84575
87700
|
|
|
84576
|
-
|
|
84577
|
-
|
|
84578
|
-
|
|
84579
|
-
|
|
84580
|
-
return
|
|
87701
|
+
var dataSourceKeys = dataSource.map(function (item) {
|
|
87702
|
+
return item[_rowKey];
|
|
87703
|
+
}).join(',');
|
|
87704
|
+
var setCallBackFalgKeys = ((_sortDataSorceRef$cur = sortDataSorceRef.current) === null || _sortDataSorceRef$cur === void 0 ? void 0 : _sortDataSorceRef$cur.map(function (item) {
|
|
87705
|
+
return item[_rowKey];
|
|
87706
|
+
}).join(',')) || '';
|
|
87707
|
+
|
|
87708
|
+
if (dataSourceKeys !== setCallBackFalgKeys) {
|
|
87709
|
+
setCallBackFalg(dataSource);
|
|
87710
|
+
sortDataSorceRef.current = dataSource;
|
|
84581
87711
|
}
|
|
84582
|
-
};
|
|
84583
|
-
});
|
|
84584
|
-
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
84585
|
-
className: 'lm_custom_option_columns'
|
|
84586
|
-
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
84587
|
-
className: 'global_search'
|
|
84588
|
-
}, /*#__PURE__*/React__default['default'].createElement(Search$1, {
|
|
84589
|
-
value: searchIngValue,
|
|
84590
|
-
onChange: function onChange(e) {
|
|
84591
|
-
return setSearchIngValue(e.target.value);
|
|
84592
|
-
},
|
|
84593
|
-
onSearch: handleSearch
|
|
84594
|
-
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
84595
|
-
className: 'global_setting'
|
|
84596
|
-
}, /*#__PURE__*/React__default['default'].createElement(LMCheckBox, {
|
|
84597
|
-
indeterminate: isCheckAll.indeterminate,
|
|
84598
|
-
onChange: onCheckAllChange,
|
|
84599
|
-
checked: isCheckAll.checkAll
|
|
84600
|
-
}, "\u5168\u9009"), /*#__PURE__*/React__default['default'].createElement("span", {
|
|
84601
|
-
onClick: function onClick() {
|
|
84602
|
-
return setLocalFilter(filter);
|
|
84603
87712
|
}
|
|
84604
|
-
},
|
|
84605
|
-
|
|
84606
|
-
collisionDetection: closestCenter,
|
|
84607
|
-
onDragEnd: handleDragEnd
|
|
84608
|
-
}, /*#__PURE__*/React__default['default'].createElement(SortableContext, {
|
|
84609
|
-
items: sortMenu === null || sortMenu === void 0 ? void 0 : sortMenu.map(function (v) {
|
|
84610
|
-
return "".concat(v.field);
|
|
84611
|
-
}),
|
|
84612
|
-
strategy: verticalListSortingStrategy
|
|
84613
|
-
}, sortMenu === null || sortMenu === void 0 ? void 0 : sortMenu.map(function (item) {
|
|
84614
|
-
return /*#__PURE__*/React__default['default'].createElement(SortItem$1, {
|
|
84615
|
-
key: item.field,
|
|
84616
|
-
toggleShow: toggleShow,
|
|
84617
|
-
item: item,
|
|
84618
|
-
id: item.field
|
|
84619
|
-
});
|
|
84620
|
-
})))));
|
|
84621
|
-
});
|
|
84622
|
-
|
|
84623
|
-
var SmallImg = require('./assets/option1.png');
|
|
87713
|
+
}, [dataSource]);
|
|
87714
|
+
/** 本地缓存一个选择数据 */
|
|
84624
87715
|
|
|
84625
|
-
|
|
87716
|
+
React.useEffect(function () {
|
|
87717
|
+
if (rowSelection) {
|
|
87718
|
+
var selectedRowKeys = rowSelection.selectedRowKeys;
|
|
84626
87719
|
|
|
84627
|
-
|
|
87720
|
+
if (selectedRowKeys) {
|
|
87721
|
+
setLocalRowSelectList(localRowSelectList || []);
|
|
87722
|
+
}
|
|
87723
|
+
}
|
|
87724
|
+
}, [rowSelection]);
|
|
84628
87725
|
|
|
84629
|
-
|
|
84630
|
-
|
|
84631
|
-
label: '默认',
|
|
84632
|
-
value: 'default',
|
|
84633
|
-
imgUrl: DefaultImg
|
|
84634
|
-
}, {
|
|
84635
|
-
label: '紧凑',
|
|
84636
|
-
value: 'small',
|
|
84637
|
-
imgUrl: SmallImg
|
|
84638
|
-
}, {
|
|
84639
|
-
label: '宽松',
|
|
84640
|
-
value: 'middle',
|
|
84641
|
-
imgUrl: MiddleImg
|
|
84642
|
-
}];
|
|
84643
|
-
var prefixCls$b = 'lm_custom-table-option';
|
|
84644
|
-
var LMCustomTableOption = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
84645
|
-
var className = props.className,
|
|
84646
|
-
_props$tooltip = props.tooltip,
|
|
84647
|
-
tooltip = _props$tooltip === void 0 ? {} : _props$tooltip;
|
|
84648
|
-
var filterRef = React.useRef(null);
|
|
84649
|
-
var columnsRef = React.useRef(null); // const sizeRef = useRef(null)
|
|
87726
|
+
var editTableRowChange = function editTableRowChange(selectRows) {
|
|
87727
|
+
var _rowSelection$onChang;
|
|
84650
87728
|
|
|
84651
|
-
|
|
84652
|
-
|
|
84653
|
-
|
|
84654
|
-
setVisible = _useState2[1];
|
|
84655
|
-
/** 是否记住页面使用状态 */
|
|
87729
|
+
setLocalRowSelectList(selectRows);
|
|
87730
|
+
rowSelection === null || rowSelection === void 0 ? void 0 : (_rowSelection$onChang = rowSelection.onChange) === null || _rowSelection$onChang === void 0 ? void 0 : _rowSelection$onChang.call(rowSelection, selectRows);
|
|
87731
|
+
};
|
|
84656
87732
|
|
|
87733
|
+
var handleSave = function handleSave(row) {
|
|
87734
|
+
var res = fn(dataSourceRef.current, function (draft) {
|
|
87735
|
+
var index = draft.findIndex(function (item) {
|
|
87736
|
+
return row[_rowKey] === item[_rowKey];
|
|
87737
|
+
});
|
|
84657
87738
|
|
|
84658
|
-
|
|
84659
|
-
|
|
84660
|
-
|
|
84661
|
-
|
|
87739
|
+
if (index !== -1) {
|
|
87740
|
+
draft[index] = row;
|
|
87741
|
+
}
|
|
87742
|
+
});
|
|
87743
|
+
console.time('b');
|
|
84662
87744
|
|
|
84663
|
-
|
|
84664
|
-
|
|
84665
|
-
|
|
84666
|
-
|
|
84667
|
-
|
|
84668
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
84669
|
-
lmOptions = _useState6[0],
|
|
84670
|
-
setLmOptions = _useState6[1];
|
|
87745
|
+
if (onChange) {
|
|
87746
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(res);
|
|
87747
|
+
} else {
|
|
87748
|
+
setDataSource(res);
|
|
87749
|
+
}
|
|
84671
87750
|
|
|
84672
|
-
|
|
84673
|
-
setVisible(true);
|
|
87751
|
+
console.timeEnd('b');
|
|
84674
87752
|
};
|
|
84675
87753
|
|
|
84676
|
-
|
|
84677
|
-
|
|
84678
|
-
|
|
84679
|
-
|
|
84680
|
-
|
|
87754
|
+
var reWriteOriginSource = function reWriteOriginSource(rowKey, rowValue, dataIndex, nextValue) {
|
|
87755
|
+
setDataSource(function (prevDataSource) {
|
|
87756
|
+
return prevDataSource.map(function (item) {
|
|
87757
|
+
if (lodash.get(item, rowKey) === rowValue) {
|
|
87758
|
+
lodash.set(item, dataIndex, nextValue);
|
|
87759
|
+
}
|
|
87760
|
+
|
|
87761
|
+
return item;
|
|
87762
|
+
});
|
|
84681
87763
|
});
|
|
84682
|
-
}
|
|
84683
|
-
|
|
87764
|
+
}; // 校验保存
|
|
87765
|
+
// const save = async (row) => {
|
|
87766
|
+
// try {
|
|
87767
|
+
// const values = row || (await form.getFieldsValue())
|
|
87768
|
+
// handleSave({ ...record, ...values })
|
|
87769
|
+
// await form.validateFields()
|
|
87770
|
+
// // 清空异常校验
|
|
87771
|
+
// setValid((old) => {
|
|
87772
|
+
// const obj = { ...old }
|
|
87773
|
+
// delete obj[record[rowKey]]
|
|
87774
|
+
// return obj
|
|
87775
|
+
// })
|
|
87776
|
+
// } catch (errInfo) {
|
|
87777
|
+
// // 加入异常校验
|
|
87778
|
+
// setValid((old) => ({ ...old, [record[rowKey]]: errInfo.errorFields }))
|
|
87779
|
+
// }
|
|
87780
|
+
// }
|
|
84684
87781
|
|
|
84685
|
-
var onOk = function onOk() {
|
|
84686
|
-
var _columnsRef$current, _columnsRef$current2, _filterRef$current, _filterRef$current2, _props$onSave;
|
|
84687
87782
|
|
|
84688
|
-
|
|
84689
|
-
var
|
|
84690
|
-
|
|
84691
|
-
|
|
87783
|
+
var handleTableRowDelete = function handleTableRowDelete(key) {
|
|
87784
|
+
var res = fn(dataSourceRef.current, function (draft) {
|
|
87785
|
+
var index = draft.findIndex(function (item) {
|
|
87786
|
+
return key === item[_rowKey];
|
|
87787
|
+
});
|
|
84692
87788
|
|
|
84693
|
-
|
|
84694
|
-
|
|
84695
|
-
|
|
84696
|
-
(_props$onSave = props.onSave) === null || _props$onSave === void 0 ? void 0 : _props$onSave.call(props, {
|
|
84697
|
-
columnsData: columnsData,
|
|
84698
|
-
ColStateValue: ColStateValue,
|
|
84699
|
-
filterData: filterData,
|
|
84700
|
-
filterStateValue: filterStateValue,
|
|
84701
|
-
size: lmOptions.size,
|
|
84702
|
-
saveSetting: saveSetting
|
|
87789
|
+
if (index !== -1) {
|
|
87790
|
+
draft.splice(index, 1);
|
|
87791
|
+
}
|
|
84703
87792
|
});
|
|
84704
|
-
|
|
87793
|
+
|
|
87794
|
+
if (onChange) {
|
|
87795
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(res);
|
|
87796
|
+
} else {
|
|
87797
|
+
setDataSource(res);
|
|
87798
|
+
} // setDataSource(res)
|
|
87799
|
+
// onChange?.(res)
|
|
87800
|
+
|
|
84705
87801
|
};
|
|
84706
87802
|
|
|
84707
|
-
|
|
84708
|
-
|
|
84709
|
-
|
|
84710
|
-
|
|
84711
|
-
|
|
84712
|
-
})), /*#__PURE__*/React__default['default'].createElement(LMDrawer, {
|
|
84713
|
-
className: classnames(className, prefixCls$b),
|
|
84714
|
-
title: "\u7B5B\u9009\u8BBE\u7F6E",
|
|
84715
|
-
visible: visible,
|
|
84716
|
-
extra: /*#__PURE__*/React__default['default'].createElement(_Space__default['default'], null, /*#__PURE__*/React__default['default'].createElement(LMButton, {
|
|
84717
|
-
size: "small",
|
|
84718
|
-
onClick: function onClick() {
|
|
84719
|
-
return setVisible(false);
|
|
84720
|
-
}
|
|
84721
|
-
}, "\u53D6\u6D88"), /*#__PURE__*/React__default['default'].createElement(LMButton, {
|
|
84722
|
-
size: "small",
|
|
84723
|
-
onClick: onOk,
|
|
84724
|
-
type: "primary"
|
|
84725
|
-
}, "\u786E\u8BA4")),
|
|
84726
|
-
onClose: function onClose() {
|
|
84727
|
-
return setVisible(false);
|
|
84728
|
-
}
|
|
84729
|
-
}, /*#__PURE__*/React__default['default'].createElement(LMTabs, {
|
|
84730
|
-
defaultActiveKey: "1",
|
|
84731
|
-
destroyInactiveTabPane: true
|
|
84732
|
-
}, /*#__PURE__*/React__default['default'].createElement(TabPane$1, {
|
|
84733
|
-
tab: "\u4E2A\u6027\u5316\u7B5B\u9009",
|
|
84734
|
-
key: "1",
|
|
84735
|
-
forceRender: true
|
|
84736
|
-
}, /*#__PURE__*/React__default['default'].createElement(FilterSort, {
|
|
84737
|
-
ref: filterRef,
|
|
84738
|
-
filter: lmOptions.filter
|
|
84739
|
-
})), /*#__PURE__*/React__default['default'].createElement(TabPane$1, {
|
|
84740
|
-
tab: "\u5217\u8868\u5B57\u6BB5\u8BBE\u7F6E",
|
|
84741
|
-
key: "2",
|
|
84742
|
-
forceRender: true
|
|
84743
|
-
}, /*#__PURE__*/React__default['default'].createElement(ColumnsSort, {
|
|
84744
|
-
ref: columnsRef,
|
|
84745
|
-
columns: lmOptions.columns
|
|
84746
|
-
})), /*#__PURE__*/React__default['default'].createElement(TabPane$1, {
|
|
84747
|
-
tab: "\u5176\u4ED6",
|
|
84748
|
-
key: "3",
|
|
84749
|
-
forceRender: true
|
|
84750
|
-
}, /*#__PURE__*/React__default['default'].createElement("div", null, "\u5217\u8868\u6837\u5F0F"), /*#__PURE__*/React__default['default'].createElement(LMRadio.Group, {
|
|
84751
|
-
onChange: function onChange(e) {
|
|
84752
|
-
return setLmOptions(_objectSpread(_objectSpread({}, lmOptions), {}, {
|
|
84753
|
-
size: e.target.value
|
|
84754
|
-
}));
|
|
84755
|
-
},
|
|
84756
|
-
className: 'lm_size_radio_group',
|
|
84757
|
-
value: lmOptions.size
|
|
84758
|
-
}, optionsWithDisabled.map(function (item) {
|
|
84759
|
-
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
84760
|
-
className: 'lm_custom_size_warp',
|
|
84761
|
-
key: item.value
|
|
84762
|
-
}, /*#__PURE__*/React__default['default'].createElement("img", {
|
|
84763
|
-
onClick: function onClick() {
|
|
84764
|
-
return setLmOptions(_objectSpread(_objectSpread({}, lmOptions), {}, {
|
|
84765
|
-
size: item.value
|
|
84766
|
-
}));
|
|
84767
|
-
},
|
|
84768
|
-
src: item.imgUrl
|
|
84769
|
-
}), /*#__PURE__*/React__default['default'].createElement(LMRadio, {
|
|
84770
|
-
value: item.value
|
|
84771
|
-
}, item.label));
|
|
84772
|
-
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
84773
|
-
className: 'save_setting'
|
|
84774
|
-
}, /*#__PURE__*/React__default['default'].createElement("span", null, "\u662F\u5426\u8BB0\u4F4F\u9875\u9762\u4F7F\u7528\u72B6\u6001"), /*#__PURE__*/React__default['default'].createElement(_Switch__default['default'], {
|
|
84775
|
-
checked: saveSetting,
|
|
84776
|
-
onChange: setSaveSetting
|
|
84777
|
-
}))))));
|
|
84778
|
-
});
|
|
87803
|
+
var handleTableRowAdd = function handleTableRowAdd(record) {
|
|
87804
|
+
var res = fn(dataSourceRef.current, function (draft) {
|
|
87805
|
+
var index = draft.findIndex(function (item) {
|
|
87806
|
+
return record[_rowKey] === item[_rowKey];
|
|
87807
|
+
});
|
|
84779
87808
|
|
|
84780
|
-
|
|
84781
|
-
|
|
87809
|
+
if (index !== -1) {
|
|
87810
|
+
draft.splice(index + 1, 0, _defineProperty({}, _rowKey, "".concat(Date.now())));
|
|
87811
|
+
}
|
|
87812
|
+
});
|
|
84782
87813
|
|
|
84783
|
-
|
|
84784
|
-
|
|
84785
|
-
|
|
84786
|
-
|
|
84787
|
-
}
|
|
87814
|
+
if (onChange) {
|
|
87815
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(res);
|
|
87816
|
+
} else {
|
|
87817
|
+
setDataSource(res);
|
|
87818
|
+
}
|
|
84788
87819
|
};
|
|
84789
87820
|
|
|
84790
|
-
|
|
84791
|
-
|
|
84792
|
-
|
|
84793
|
-
|
|
84794
|
-
|
|
87821
|
+
var resultColumns = React.useMemo(function () {
|
|
87822
|
+
var localColumns = [sortOpen ? {
|
|
87823
|
+
title: '',
|
|
87824
|
+
dataIndex: 'sort',
|
|
87825
|
+
width: 32,
|
|
87826
|
+
maxWidth: 32,
|
|
87827
|
+
render: function render(_, record) {
|
|
87828
|
+
return /*#__PURE__*/React__default['default'].createElement(Dragger, {
|
|
87829
|
+
id: record[_rowKey] || record.id
|
|
87830
|
+
});
|
|
87831
|
+
}
|
|
87832
|
+
} : null].concat(_toConsumableArray(columns), [useQuickOpetate ? {
|
|
87833
|
+
title: '操作',
|
|
87834
|
+
dataIndex: 'lm_edit_opetate',
|
|
87835
|
+
width: 68,
|
|
87836
|
+
fixed: 'right',
|
|
87837
|
+
editable: 'lm_edit_opetate'
|
|
87838
|
+
} : null]).filter(function (item) {
|
|
87839
|
+
return item;
|
|
87840
|
+
});
|
|
87841
|
+
localColumns = localColumns.map(function (item, index) {
|
|
87842
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
87843
|
+
order: [null, undefined].includes(item.order) ? index : item.order
|
|
87844
|
+
});
|
|
87845
|
+
}).sort(function (a, b) {
|
|
87846
|
+
return a.order - b.order;
|
|
87847
|
+
});
|
|
87848
|
+
var leftColumns = [];
|
|
87849
|
+
var mainColumns = [];
|
|
87850
|
+
var rightColumns = [];
|
|
87851
|
+
localColumns.forEach(function (item) {
|
|
87852
|
+
if ((item === null || item === void 0 ? void 0 : item.fixed) === 'left') {
|
|
87853
|
+
leftColumns.push(item);
|
|
87854
|
+
} else if ((item === null || item === void 0 ? void 0 : item.fixed) === 'right') {
|
|
87855
|
+
rightColumns.push(item);
|
|
87856
|
+
} else {
|
|
87857
|
+
mainColumns.push(item);
|
|
87858
|
+
}
|
|
87859
|
+
});
|
|
87860
|
+
localColumns = [].concat(leftColumns, mainColumns, rightColumns);
|
|
87861
|
+
var res = localColumns.map(function (col) {
|
|
87862
|
+
if (!col.editable) {
|
|
87863
|
+
return col;
|
|
87864
|
+
}
|
|
84795
87865
|
|
|
84796
|
-
|
|
84797
|
-
|
|
87866
|
+
return _objectSpread(_objectSpread({}, col), {}, {
|
|
87867
|
+
shouldCellUpdate: function shouldCellUpdate(record, prevRecord) {
|
|
87868
|
+
var dataIndex = col.dataIndex;
|
|
84798
87869
|
|
|
84799
|
-
|
|
84800
|
-
|
|
84801
|
-
|
|
84802
|
-
restProps = _objectWithoutProperties(props, _excluded$1n);
|
|
87870
|
+
if (col === null || col === void 0 ? void 0 : col.fixed) {
|
|
87871
|
+
return true;
|
|
87872
|
+
}
|
|
84803
87873
|
|
|
84804
|
-
|
|
84805
|
-
|
|
84806
|
-
|
|
84807
|
-
|
|
84808
|
-
|
|
84809
|
-
|
|
87874
|
+
return record[dataIndex] === prevRecord[dataIndex] ? false : true;
|
|
87875
|
+
},
|
|
87876
|
+
onCell: function onCell(record) {
|
|
87877
|
+
return {
|
|
87878
|
+
getLength: function getLength() {
|
|
87879
|
+
return dataSource.length;
|
|
87880
|
+
},
|
|
87881
|
+
rowKey: _rowKey,
|
|
87882
|
+
record: record,
|
|
87883
|
+
col: col,
|
|
87884
|
+
handleTableRowDelete: handleTableRowDelete,
|
|
87885
|
+
handleTableRowAdd: handleTableRowAdd,
|
|
87886
|
+
editable: col.editable,
|
|
87887
|
+
dataIndex: col.dataIndex,
|
|
87888
|
+
itemProps: col.itemProps,
|
|
87889
|
+
setValid: setValid,
|
|
87890
|
+
isEdit: isEdit,
|
|
87891
|
+
isHoverEdit: isHoverEdit,
|
|
87892
|
+
handleAdd: handleAdd,
|
|
87893
|
+
handleDelete: handleDelete,
|
|
87894
|
+
editEnum: typeof col.editEnum === 'function' ? col.editEnum(record) : col.editEnum,
|
|
87895
|
+
valueType: typeof col.valueType === 'function' ? col.valueType(record) : col.valueType,
|
|
87896
|
+
handleSave: handleSave,
|
|
87897
|
+
reWriteOriginSource: reWriteOriginSource
|
|
87898
|
+
};
|
|
87899
|
+
}
|
|
87900
|
+
});
|
|
87901
|
+
});
|
|
87902
|
+
return res;
|
|
87903
|
+
}, [columns, isAdd, sortOpen, useQuickOpetate, sortEditTable]);
|
|
87904
|
+
var DraggableContainer = React.useCallback(function (_ref6) {
|
|
87905
|
+
var _dataSourceRef$curren;
|
|
84810
87906
|
|
|
84811
|
-
|
|
84812
|
-
var Form$1 = Reform;
|
|
84813
|
-
Form$1.Item = _Form__default['default'].Item;
|
|
84814
|
-
Form$1.List = _List__default['default'];
|
|
84815
|
-
Form$1.ErrorList = _Form__default['default'].ErrorList;
|
|
84816
|
-
Form$1.useForm = Form$2.useForm;
|
|
84817
|
-
Form$1.useFormInstance = useFormInstance__default['default'];
|
|
84818
|
-
Form$1.useWatch = Form$2.useWatch;
|
|
84819
|
-
Form$1.Provider = context$2.FormProvider;
|
|
87907
|
+
var props = _extends({}, _ref6);
|
|
84820
87908
|
|
|
84821
|
-
|
|
84822
|
-
|
|
84823
|
-
|
|
87909
|
+
return /*#__PURE__*/React__default['default'].createElement(DndContainer$1, {
|
|
87910
|
+
move: onSortEnd
|
|
87911
|
+
}, /*#__PURE__*/React__default['default'].createElement(SortableBox$1, {
|
|
87912
|
+
items: (_dataSourceRef$curren = dataSourceRef.current) === null || _dataSourceRef$curren === void 0 ? void 0 : _dataSourceRef$curren.map(function (item) {
|
|
87913
|
+
return item[_rowKey];
|
|
87914
|
+
})
|
|
87915
|
+
}, /*#__PURE__*/React__default['default'].createElement("tbody", _objectSpread({}, props)))) // <tbody {...props} />
|
|
87916
|
+
;
|
|
87917
|
+
}, [sortEditTable]);
|
|
87918
|
+
var config = React.useMemo(function () {
|
|
87919
|
+
return _objectSpread({
|
|
87920
|
+
pagination: false,
|
|
87921
|
+
tableLayout: 'fixed',
|
|
87922
|
+
scroll: {
|
|
87923
|
+
x: '100%'
|
|
87924
|
+
},
|
|
87925
|
+
rowKey: function rowKey(record) {
|
|
87926
|
+
return record[_rowKey] || record.index || Math.random();
|
|
87927
|
+
},
|
|
87928
|
+
components: {
|
|
87929
|
+
body: Object.assign({
|
|
87930
|
+
row: sortOpen ? EditableSortRow : EditableRow$1,
|
|
87931
|
+
cell: EditableCell$1 // wrapper: DraggableContainer
|
|
84824
87932
|
|
|
84825
|
-
|
|
84826
|
-
|
|
84827
|
-
|
|
87933
|
+
}, sortOpen ? {
|
|
87934
|
+
wrapper: DraggableContainer
|
|
87935
|
+
} : {})
|
|
87936
|
+
}
|
|
87937
|
+
}, resetProps);
|
|
87938
|
+
}, [resultColumns, dataSource, sortOpen, size]);
|
|
87939
|
+
React.useEffect(function () {
|
|
87940
|
+
setDataSource(defaultData === null || defaultData === void 0 ? void 0 : defaultData.map(function (v, idx) {
|
|
87941
|
+
return _objectSpread(_objectSpread({}, v), {}, _defineProperty({}, _rowKey, v[_rowKey] || "v".concat(idx + 1)));
|
|
87942
|
+
}));
|
|
87943
|
+
}, [defaultData]);
|
|
87944
|
+
React.useImperativeHandle(ref, function () {
|
|
87945
|
+
return {
|
|
87946
|
+
setRow: handleSave,
|
|
87947
|
+
valid: function valid() {
|
|
87948
|
+
return _valid;
|
|
87949
|
+
}
|
|
87950
|
+
};
|
|
87951
|
+
});
|
|
87952
|
+
var isShowAddAction = React.useMemo(function () {
|
|
87953
|
+
return isEdit && isAdd || isHoverEdit && isAdd;
|
|
87954
|
+
}, [isEdit, isAdd, isHoverEdit]); // @ts-ignore
|
|
87955
|
+
|
|
87956
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
87957
|
+
className: "lm_editTable_warpper"
|
|
87958
|
+
}, /*#__PURE__*/React__default['default'].createElement(_Table__default['default'], _objectSpread(_objectSpread({}, config), {}, {
|
|
87959
|
+
size: size || 'small',
|
|
87960
|
+
columns: resultColumns,
|
|
87961
|
+
rowClassName: "editable-row",
|
|
87962
|
+
bordered: true,
|
|
87963
|
+
pagination: false,
|
|
87964
|
+
// components={tableComponents}
|
|
87965
|
+
rowSelection: !rowSelection ? undefined : {
|
|
87966
|
+
fixed: true,
|
|
87967
|
+
type: 'checkbox',
|
|
87968
|
+
columnWidth: 36,
|
|
87969
|
+
selectedRowKeys: localRowSelectList.map(function (v) {
|
|
87970
|
+
return v[_rowKey];
|
|
87971
|
+
}),
|
|
87972
|
+
onChange: function onChange(selectedRowKeys, selectedRows) {
|
|
87973
|
+
editTableRowChange(selectedRows);
|
|
87974
|
+
}
|
|
87975
|
+
},
|
|
87976
|
+
dataSource: dataSource
|
|
87977
|
+
})), isShowAddAction && /*#__PURE__*/React__default['default'].createElement(LMButton, {
|
|
87978
|
+
className: "lm_editTable_add_bar",
|
|
87979
|
+
type: "dashed",
|
|
87980
|
+
block: true,
|
|
87981
|
+
onClick: handleAdd,
|
|
87982
|
+
style: {
|
|
87983
|
+
marginTop: 8
|
|
87984
|
+
}
|
|
87985
|
+
}, /*#__PURE__*/React__default['default'].createElement(PlusCircleOutlined$2, {
|
|
87986
|
+
className: "lm_editTable_add_icon"
|
|
87987
|
+
}), "\u65B0\u589E"));
|
|
87988
|
+
});
|
|
87989
|
+
var LmEditTable = /*#__PURE__*/React.memo(EditTable$1);
|
|
84828
87990
|
|
|
84829
87991
|
Object.defineProperty(exports, 'Card', {
|
|
84830
87992
|
enumerable: true,
|
|
@@ -84850,12 +88012,6 @@
|
|
|
84850
88012
|
return _Spin__default['default'];
|
|
84851
88013
|
}
|
|
84852
88014
|
});
|
|
84853
|
-
Object.defineProperty(exports, 'message', {
|
|
84854
|
-
enumerable: true,
|
|
84855
|
-
get: function () {
|
|
84856
|
-
return _message__default['default'];
|
|
84857
|
-
}
|
|
84858
|
-
});
|
|
84859
88015
|
Object.defineProperty(exports, 'Image', {
|
|
84860
88016
|
enumerable: true,
|
|
84861
88017
|
get: function () {
|
|
@@ -84868,6 +88024,12 @@
|
|
|
84868
88024
|
return _Empty__default['default'];
|
|
84869
88025
|
}
|
|
84870
88026
|
});
|
|
88027
|
+
Object.defineProperty(exports, 'List', {
|
|
88028
|
+
enumerable: true,
|
|
88029
|
+
get: function () {
|
|
88030
|
+
return _List__default['default'];
|
|
88031
|
+
}
|
|
88032
|
+
});
|
|
84871
88033
|
Object.defineProperty(exports, 'Tooltip', {
|
|
84872
88034
|
enumerable: true,
|
|
84873
88035
|
get: function () {
|
|
@@ -84911,6 +88073,7 @@
|
|
|
84911
88073
|
exports.Input = LmInput;
|
|
84912
88074
|
exports.InputNumber = CInputNumber;
|
|
84913
88075
|
exports.LeftTable = LeftSide;
|
|
88076
|
+
exports.LmEditTable = LmEditTable;
|
|
84914
88077
|
exports.LmSelect = LMSelect;
|
|
84915
88078
|
exports.LmTable = Table;
|
|
84916
88079
|
exports.LoadingPage = LoadingPage;
|
|
@@ -84928,6 +88091,7 @@
|
|
|
84928
88091
|
exports.Upload = LMUpload;
|
|
84929
88092
|
exports.UploadOss = UploadOss;
|
|
84930
88093
|
exports.VirtualList = VirList;
|
|
88094
|
+
exports.message = api;
|
|
84931
88095
|
|
|
84932
88096
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
84933
88097
|
|