linkmore-design 1.1.27-alpha.0 → 1.1.27
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/LmEditTable/DndContainer.d.ts +3 -6
- package/dist/LmEditTable/EditTable.d.ts +5 -10
- package/dist/LmEditTable/sortableItem.d.ts +2 -3
- package/dist/LmEditTable/util.d.ts +0 -7
- package/dist/index.d.ts +2 -1
- package/dist/index.umd.js +527 -1133
- package/dist/index.umd.min.js +8 -8
- package/dist/variables.css +0 -65
- package/es/InputNumber/index.js +9 -7
- package/es/LmEditTable/DndContainer.d.ts +3 -6
- package/es/LmEditTable/DndContainer.js +10 -70
- package/es/LmEditTable/DragHandle.js +1 -1
- package/es/LmEditTable/EditTable.d.ts +5 -10
- package/es/LmEditTable/EditTable.js +360 -352
- package/es/LmEditTable/sortableItem.d.ts +2 -3
- package/es/LmEditTable/sortableItem.js +4 -16
- package/es/LmEditTable/sortableItemCol.js +10 -40
- package/es/LmEditTable/style/index.css +0 -65
- package/es/LmEditTable/style/variables.css +0 -65
- package/es/LmEditTable/util.d.ts +0 -7
- package/es/LmEditTable/util.js +7 -92
- package/es/LmTable/virTual/VirtualRow.js +14 -12
- package/es/hooks/useEvent/index.js +1 -1
- package/es/index.d.ts +2 -1
- package/es/styles/variables.css +0 -65
- package/lib/InputNumber/index.js +9 -9
- package/lib/LmEditTable/DndContainer.d.ts +3 -6
- package/lib/LmEditTable/DndContainer.js +9 -74
- package/lib/LmEditTable/DragHandle.js +1 -1
- package/lib/LmEditTable/EditTable.d.ts +5 -10
- package/lib/LmEditTable/EditTable.js +357 -349
- package/lib/LmEditTable/sortableItem.d.ts +2 -3
- package/lib/LmEditTable/sortableItem.js +5 -19
- package/lib/LmEditTable/sortableItemCol.js +8 -37
- package/lib/LmEditTable/style/index.css +0 -65
- package/lib/LmEditTable/style/variables.css +0 -65
- package/lib/LmEditTable/util.d.ts +0 -7
- package/lib/LmEditTable/util.js +6 -97
- package/lib/LmTable/virTual/VirtualRow.js +14 -12
- package/lib/hooks/useEvent/index.js +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/styles/variables.css +0 -65
- package/package.json +9 -7
- package/dist/LmEditTable/components/DraggableContainer.d.ts +0 -10
- package/dist/LmEditTable/components/QuickOpetate.d.ts +0 -12
- package/dist/LmEditTable/components/bottomOpetateComponent.d.ts +0 -13
- package/dist/LmEditTable/components/index.d.ts +0 -16
- package/dist/LmEditTable/hooks/useForkRef.d.ts +0 -2
- package/dist/LmEditTable/rowSort/DndContainerRow.d.ts +0 -10
- package/dist/LmEditTable/virtual/VirtualRow.d.ts +0 -7
- package/dist/LmEditTable/virtual/VirtualRowBack.d.ts +0 -6
- package/dist/LmEditTable/virtual/VirtualTable.d.ts +0 -3
- package/dist/LmEditTable/virtual/VirtualWrapper.d.ts +0 -3
- package/dist/LmEditTable/virtual/context.d.ts +0 -13
- package/dist/LmEditTable/virtual/index.d.ts +0 -4
- package/es/LmEditTable/components/DraggableContainer.d.ts +0 -10
- package/es/LmEditTable/components/DraggableContainer.js +0 -39
- package/es/LmEditTable/components/QuickOpetate.d.ts +0 -12
- package/es/LmEditTable/components/QuickOpetate.js +0 -82
- package/es/LmEditTable/components/bottomOpetateComponent.d.ts +0 -13
- package/es/LmEditTable/components/bottomOpetateComponent.js +0 -23
- package/es/LmEditTable/components/index.d.ts +0 -16
- package/es/LmEditTable/components/index.js +0 -7
- package/es/LmEditTable/hooks/useForkRef.d.ts +0 -2
- package/es/LmEditTable/hooks/useForkRef.js +0 -22
- package/es/LmEditTable/rowSort/DndContainerRow.d.ts +0 -10
- package/es/LmEditTable/rowSort/DndContainerRow.js +0 -81
- package/es/LmEditTable/virtual/VirtualRow.d.ts +0 -7
- package/es/LmEditTable/virtual/VirtualRow.js +0 -62
- package/es/LmEditTable/virtual/VirtualRowBack.d.ts +0 -6
- package/es/LmEditTable/virtual/VirtualRowBack.js +0 -100
- package/es/LmEditTable/virtual/VirtualTable.d.ts +0 -3
- package/es/LmEditTable/virtual/VirtualTable.js +0 -54
- package/es/LmEditTable/virtual/VirtualWrapper.d.ts +0 -3
- package/es/LmEditTable/virtual/VirtualWrapper.js +0 -60
- package/es/LmEditTable/virtual/context.d.ts +0 -13
- package/es/LmEditTable/virtual/context.js +0 -54
- package/es/LmEditTable/virtual/index.d.ts +0 -4
- package/es/LmEditTable/virtual/index.js +0 -4
- package/lib/LmEditTable/components/DraggableContainer.d.ts +0 -10
- package/lib/LmEditTable/components/DraggableContainer.js +0 -52
- package/lib/LmEditTable/components/QuickOpetate.d.ts +0 -12
- package/lib/LmEditTable/components/QuickOpetate.js +0 -96
- package/lib/LmEditTable/components/bottomOpetateComponent.d.ts +0 -13
- package/lib/LmEditTable/components/bottomOpetateComponent.js +0 -34
- package/lib/LmEditTable/components/index.d.ts +0 -16
- package/lib/LmEditTable/components/index.js +0 -37
- package/lib/LmEditTable/hooks/useForkRef.d.ts +0 -2
- package/lib/LmEditTable/hooks/useForkRef.js +0 -29
- package/lib/LmEditTable/rowSort/DndContainerRow.d.ts +0 -10
- package/lib/LmEditTable/rowSort/DndContainerRow.js +0 -99
- package/lib/LmEditTable/virtual/VirtualRow.d.ts +0 -7
- package/lib/LmEditTable/virtual/VirtualRow.js +0 -78
- package/lib/LmEditTable/virtual/VirtualRowBack.d.ts +0 -6
- package/lib/LmEditTable/virtual/VirtualRowBack.js +0 -113
- package/lib/LmEditTable/virtual/VirtualTable.d.ts +0 -3
- package/lib/LmEditTable/virtual/VirtualTable.js +0 -71
- package/lib/LmEditTable/virtual/VirtualWrapper.d.ts +0 -3
- package/lib/LmEditTable/virtual/VirtualWrapper.js +0 -73
- package/lib/LmEditTable/virtual/context.d.ts +0 -13
- package/lib/LmEditTable/virtual/context.js +0 -64
- package/lib/LmEditTable/virtual/index.d.ts +0 -4
- package/lib/LmEditTable/virtual/index.js +0 -31
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "linkmore-design",
|
|
3
|
-
"version": "1.1.27
|
|
3
|
+
"version": "1.1.27",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "nowthen",
|
|
6
6
|
"email": "rnlvwyx@gmail.com"
|
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"@dnd-kit/core": "^5.0.3",
|
|
69
69
|
"@dnd-kit/modifiers": "^5.0.0",
|
|
70
70
|
"@dnd-kit/sortable": "^6.0.1",
|
|
71
|
+
"@react-hook/resize-observer": "^1.2.6",
|
|
71
72
|
"@typescript-eslint/eslint-plugin": "^5.28.0",
|
|
72
73
|
"@typescript-eslint/parser": "^5.28.0",
|
|
73
74
|
"ahooks": "^3.6.2",
|
|
@@ -76,8 +77,6 @@
|
|
|
76
77
|
"antd-img-crop": "^4.2.5",
|
|
77
78
|
"axios": "^0.21.0",
|
|
78
79
|
"classnames": "^2.3.1",
|
|
79
|
-
"conventional-changelog": "^3.1.25",
|
|
80
|
-
"conventional-changelog-cli": "^2.2.2",
|
|
81
80
|
"dayjs": "^1.9.7",
|
|
82
81
|
"echarts": "^5.4.0",
|
|
83
82
|
"hex-to-rgba": "^2.0.1",
|
|
@@ -96,11 +95,12 @@
|
|
|
96
95
|
"react-virtualized-auto-sizer": "^1.0.6",
|
|
97
96
|
"react-window": "^1.8.6",
|
|
98
97
|
"readline-sync": "^1.4.10",
|
|
99
|
-
"scrollama": "^3.2.0"
|
|
98
|
+
"scrollama": "^3.2.0",
|
|
99
|
+
"use-resize-observer": "^9.0.2"
|
|
100
100
|
},
|
|
101
101
|
"peerDependencies": {
|
|
102
|
-
"react": "17.0.1",
|
|
103
|
-
"react-dom": "17.0.1"
|
|
102
|
+
"react": ">= 17.0.1",
|
|
103
|
+
"react-dom": ">= 17.0.1"
|
|
104
104
|
},
|
|
105
105
|
"browserslist": [
|
|
106
106
|
"> 1%",
|
|
@@ -141,6 +141,8 @@
|
|
|
141
141
|
"react-copy-to-clipboard": "^5.1.0",
|
|
142
142
|
"stylelint": "^13.8.0",
|
|
143
143
|
"stylelint-config-prettier": "^8.0.2",
|
|
144
|
-
"stylelint-config-standard": "^20.0.0"
|
|
144
|
+
"stylelint-config-standard": "^20.0.0",
|
|
145
|
+
"conventional-changelog": "^3.1.25",
|
|
146
|
+
"conventional-changelog-cli": "^2.2.2"
|
|
145
147
|
}
|
|
146
148
|
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
declare const DraggableContainer: ({ keys, onSortEnd, virtual, rowKey, options, tableWidth, ...props }: {
|
|
2
|
-
[x: string]: any;
|
|
3
|
-
keys: any;
|
|
4
|
-
onSortEnd: any;
|
|
5
|
-
virtual: any;
|
|
6
|
-
rowKey: any;
|
|
7
|
-
options: any;
|
|
8
|
-
tableWidth: any;
|
|
9
|
-
}) => JSX.Element;
|
|
10
|
-
export default DraggableContainer;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
interface IOpetateProps {
|
|
3
|
-
record: Record<string, any>;
|
|
4
|
-
rowKey?: string;
|
|
5
|
-
handleAdd?: (row?: any, addInChildren?: boolean) => void;
|
|
6
|
-
handleDelete?: (rowKey?: string) => void;
|
|
7
|
-
options?: string[];
|
|
8
|
-
getLength?: number;
|
|
9
|
-
quickOpetateClearAll?: boolean;
|
|
10
|
-
}
|
|
11
|
-
declare const QuickOpetate: FC<IOpetateProps>;
|
|
12
|
-
export default QuickOpetate;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
interface IBottomOpetateCompoentProps {
|
|
2
|
-
isShowAddAction?: boolean;
|
|
3
|
-
handleAdd?: () => void;
|
|
4
|
-
recordCreatorProps?: {
|
|
5
|
-
creatorButtonText?: string;
|
|
6
|
-
style?: Record<string, any>;
|
|
7
|
-
initData?: Record<string, any> | (() => Record<string, any>);
|
|
8
|
-
customAddClick?: () => void;
|
|
9
|
-
};
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
}
|
|
12
|
-
declare const BottomOpetateComponent: (props: IBottomOpetateCompoentProps) => JSX.Element;
|
|
13
|
-
export default BottomOpetateComponent;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import DraggableContainer from './DraggableContainer';
|
|
2
|
-
import BottomOpetateComponent from './bottomOpetateComponent';
|
|
3
|
-
import QuickOpetate from './QuickOpetate';
|
|
4
|
-
export { DraggableContainer, BottomOpetateComponent, QuickOpetate };
|
|
5
|
-
declare const _default: {
|
|
6
|
-
DraggableContainer: ({ keys, onSortEnd, virtual, rowKey, options, tableWidth, ...props }: {
|
|
7
|
-
[x: string]: any;
|
|
8
|
-
keys: any;
|
|
9
|
-
onSortEnd: any;
|
|
10
|
-
virtual: any;
|
|
11
|
-
rowKey: any;
|
|
12
|
-
options: any;
|
|
13
|
-
tableWidth: any;
|
|
14
|
-
}) => JSX.Element;
|
|
15
|
-
};
|
|
16
|
-
export default _default;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
declare const _default: React.MemoExoticComponent<({ children, options, move, rowKey, items, tableWidth }: {
|
|
3
|
-
children: any;
|
|
4
|
-
options: any;
|
|
5
|
-
move: any;
|
|
6
|
-
rowKey: any;
|
|
7
|
-
items: any;
|
|
8
|
-
tableWidth: any;
|
|
9
|
-
}) => JSX.Element>;
|
|
10
|
-
export default _default;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
declare const TableContext: import("react").Context<{
|
|
3
|
-
state: any;
|
|
4
|
-
dispatch: any;
|
|
5
|
-
instance: any;
|
|
6
|
-
}>;
|
|
7
|
-
declare const useStore: () => {
|
|
8
|
-
state: any;
|
|
9
|
-
dispatch: any;
|
|
10
|
-
instance: any;
|
|
11
|
-
};
|
|
12
|
-
declare const useRealive: () => [any, import("react").Dispatch<any>];
|
|
13
|
-
export { TableContext, useStore, useRealive };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
declare const DraggableContainer: ({ keys, onSortEnd, virtual, rowKey, options, tableWidth, ...props }: {
|
|
2
|
-
[x: string]: any;
|
|
3
|
-
keys: any;
|
|
4
|
-
onSortEnd: any;
|
|
5
|
-
virtual: any;
|
|
6
|
-
rowKey: any;
|
|
7
|
-
options: any;
|
|
8
|
-
tableWidth: any;
|
|
9
|
-
}) => JSX.Element;
|
|
10
|
-
export default DraggableContainer;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
var __rest = this && this.__rest || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
|
|
4
|
-
for (var p in s) {
|
|
5
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
9
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
import React from 'react';
|
|
15
|
-
import DndContainer from '../rowSort/DndContainerRow';
|
|
16
|
-
import SortableBox from '../sortableBox';
|
|
17
|
-
import { VirtualWrapper } from '../virtual';
|
|
18
|
-
|
|
19
|
-
var DraggableContainer = function DraggableContainer(_a) {
|
|
20
|
-
var keys = _a.keys,
|
|
21
|
-
onSortEnd = _a.onSortEnd,
|
|
22
|
-
virtual = _a.virtual,
|
|
23
|
-
rowKey = _a.rowKey,
|
|
24
|
-
options = _a.options,
|
|
25
|
-
tableWidth = _a.tableWidth,
|
|
26
|
-
props = __rest(_a, ["keys", "onSortEnd", "virtual", "rowKey", "options", "tableWidth"]);
|
|
27
|
-
|
|
28
|
-
return /*#__PURE__*/React.createElement(DndContainer, {
|
|
29
|
-
move: onSortEnd,
|
|
30
|
-
items: keys,
|
|
31
|
-
rowKey: rowKey,
|
|
32
|
-
options: options,
|
|
33
|
-
tableWidth: tableWidth
|
|
34
|
-
}, /*#__PURE__*/React.createElement(SortableBox, {
|
|
35
|
-
items: keys
|
|
36
|
-
}, virtual ? /*#__PURE__*/React.createElement(VirtualWrapper, Object.assign({}, props)) : /*#__PURE__*/React.createElement("tbody", Object.assign({}, props))));
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export default DraggableContainer;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
interface IOpetateProps {
|
|
3
|
-
record: Record<string, any>;
|
|
4
|
-
rowKey?: string;
|
|
5
|
-
handleAdd?: (row?: any, addInChildren?: boolean) => void;
|
|
6
|
-
handleDelete?: (rowKey?: string) => void;
|
|
7
|
-
options?: string[];
|
|
8
|
-
getLength?: number;
|
|
9
|
-
quickOpetateClearAll?: boolean;
|
|
10
|
-
}
|
|
11
|
-
declare const QuickOpetate: FC<IOpetateProps>;
|
|
12
|
-
export default QuickOpetate;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import Button from '../../Button';
|
|
3
|
-
import IconFont from '../../IconFont';
|
|
4
|
-
import Popover from '../../Popover';
|
|
5
|
-
import DisabledContext from '../../ConfigProvider/DisabledContext';
|
|
6
|
-
|
|
7
|
-
var QuickOpetate = function QuickOpetate(_ref) {
|
|
8
|
-
var record = _ref.record,
|
|
9
|
-
rowKey = _ref.rowKey,
|
|
10
|
-
handleAdd = _ref.handleAdd,
|
|
11
|
-
handleDelete = _ref.handleDelete,
|
|
12
|
-
_ref$options = _ref.options,
|
|
13
|
-
options = _ref$options === void 0 ? ['add', 'delete'] : _ref$options,
|
|
14
|
-
getLength = _ref.getLength,
|
|
15
|
-
quickOpetateClearAll = _ref.quickOpetateClearAll;
|
|
16
|
-
var disabled = React.useContext(DisabledContext) || false;
|
|
17
|
-
|
|
18
|
-
var appendChildren = function appendChildren() {
|
|
19
|
-
handleAdd === null || handleAdd === void 0 ? void 0 : handleAdd(record, true);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
var appendAdd = function appendAdd() {
|
|
23
|
-
handleAdd === null || handleAdd === void 0 ? void 0 : handleAdd(record);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
27
|
-
style: {
|
|
28
|
-
display: 'flex',
|
|
29
|
-
alignItems: 'center',
|
|
30
|
-
justifyContent: 'flex-start',
|
|
31
|
-
marginLeft: '-4px'
|
|
32
|
-
}
|
|
33
|
-
}, options.includes('delete') && /*#__PURE__*/React.createElement(Button, {
|
|
34
|
-
type: "link",
|
|
35
|
-
size: "small",
|
|
36
|
-
disabled: !quickOpetateClearAll && getLength < 2 || disabled,
|
|
37
|
-
icon: /*#__PURE__*/React.createElement(IconFont, {
|
|
38
|
-
type: "lmweb-minus-circle",
|
|
39
|
-
style: {
|
|
40
|
-
fontSize: 16
|
|
41
|
-
}
|
|
42
|
-
}),
|
|
43
|
-
onClick: function onClick() {
|
|
44
|
-
return handleDelete(record[rowKey]);
|
|
45
|
-
}
|
|
46
|
-
}), (options === null || options === void 0 ? void 0 : options.includes('add')) && (options === null || options === void 0 ? void 0 : options.includes('addInChildren')) ? /*#__PURE__*/React.createElement(Popover, {
|
|
47
|
-
placement: "bottom",
|
|
48
|
-
overlayClassName: "lm_table_append_add_popover",
|
|
49
|
-
open: open,
|
|
50
|
-
title: null,
|
|
51
|
-
content: /*#__PURE__*/React.createElement("ul", null, /*#__PURE__*/React.createElement("li", {
|
|
52
|
-
onClick: appendAdd
|
|
53
|
-
}, "\u6DFB\u52A0\u5E73\u7EA7"), /*#__PURE__*/React.createElement("li", {
|
|
54
|
-
onClick: appendChildren
|
|
55
|
-
}, "\u6DFB\u52A0\u5B50\u7EA7")),
|
|
56
|
-
trigger: "hover"
|
|
57
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
58
|
-
type: "link",
|
|
59
|
-
size: "small",
|
|
60
|
-
icon: /*#__PURE__*/React.createElement(IconFont, {
|
|
61
|
-
type: "lmweb-plus-circle-fill",
|
|
62
|
-
style: {
|
|
63
|
-
fontSize: 16
|
|
64
|
-
}
|
|
65
|
-
})
|
|
66
|
-
})) : (options === null || options === void 0 ? void 0 : options.includes('add')) || (options === null || options === void 0 ? void 0 : options.includes('addInChildren')) ? /*#__PURE__*/React.createElement(Button, {
|
|
67
|
-
type: "link",
|
|
68
|
-
size: "small",
|
|
69
|
-
disabled: disabled,
|
|
70
|
-
icon: /*#__PURE__*/React.createElement(IconFont, {
|
|
71
|
-
type: "lmweb-plus-circle-fill",
|
|
72
|
-
style: {
|
|
73
|
-
fontSize: 16
|
|
74
|
-
}
|
|
75
|
-
}),
|
|
76
|
-
onClick: function onClick() {
|
|
77
|
-
return handleAdd(record, !!(options === null || options === void 0 ? void 0 : options.includes('addInChildren')));
|
|
78
|
-
}
|
|
79
|
-
}) : null);
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export default QuickOpetate;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
interface IBottomOpetateCompoentProps {
|
|
2
|
-
isShowAddAction?: boolean;
|
|
3
|
-
handleAdd?: () => void;
|
|
4
|
-
recordCreatorProps?: {
|
|
5
|
-
creatorButtonText?: string;
|
|
6
|
-
style?: Record<string, any>;
|
|
7
|
-
initData?: Record<string, any> | (() => Record<string, any>);
|
|
8
|
-
customAddClick?: () => void;
|
|
9
|
-
};
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
}
|
|
12
|
-
declare const BottomOpetateComponent: (props: IBottomOpetateCompoentProps) => JSX.Element;
|
|
13
|
-
export default BottomOpetateComponent;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Button, IconFont } from '../../index';
|
|
3
|
-
|
|
4
|
-
var BottomOpetateComponent = function BottomOpetateComponent(props) {
|
|
5
|
-
var isShowAddAction = props.isShowAddAction,
|
|
6
|
-
recordCreatorProps = props.recordCreatorProps,
|
|
7
|
-
handleAdd = props.handleAdd,
|
|
8
|
-
_props$disabled = props.disabled,
|
|
9
|
-
disabled = _props$disabled === void 0 ? false : _props$disabled;
|
|
10
|
-
return isShowAddAction ? /*#__PURE__*/React.createElement(Button, {
|
|
11
|
-
className: "lm_editTable_add_bar",
|
|
12
|
-
type: "dashed",
|
|
13
|
-
disabled: disabled,
|
|
14
|
-
onClick: (recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.customAddClick) || handleAdd,
|
|
15
|
-
style: Object.assign({
|
|
16
|
-
marginTop: 8
|
|
17
|
-
}, (recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.style) || {})
|
|
18
|
-
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
19
|
-
type: "lmweb-plus"
|
|
20
|
-
}), (recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.creatorButtonText) || '新增') : null;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export default BottomOpetateComponent;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import DraggableContainer from './DraggableContainer';
|
|
2
|
-
import BottomOpetateComponent from './bottomOpetateComponent';
|
|
3
|
-
import QuickOpetate from './QuickOpetate';
|
|
4
|
-
export { DraggableContainer, BottomOpetateComponent, QuickOpetate };
|
|
5
|
-
declare const _default: {
|
|
6
|
-
DraggableContainer: ({ keys, onSortEnd, virtual, rowKey, options, tableWidth, ...props }: {
|
|
7
|
-
[x: string]: any;
|
|
8
|
-
keys: any;
|
|
9
|
-
onSortEnd: any;
|
|
10
|
-
virtual: any;
|
|
11
|
-
rowKey: any;
|
|
12
|
-
options: any;
|
|
13
|
-
tableWidth: any;
|
|
14
|
-
}) => JSX.Element;
|
|
15
|
-
};
|
|
16
|
-
export default _default;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import DraggableContainer from './DraggableContainer';
|
|
2
|
-
import BottomOpetateComponent from './bottomOpetateComponent';
|
|
3
|
-
import QuickOpetate from './QuickOpetate';
|
|
4
|
-
export { DraggableContainer, BottomOpetateComponent, QuickOpetate };
|
|
5
|
-
export default {
|
|
6
|
-
DraggableContainer: DraggableContainer
|
|
7
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
|
-
|
|
3
|
-
function setRef(ref, value) {
|
|
4
|
-
if (typeof ref === 'function') {
|
|
5
|
-
ref(value);
|
|
6
|
-
} else if (ref) {
|
|
7
|
-
ref.current = value;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export default function useForkRef(refA, refB) {
|
|
12
|
-
return useMemo(function () {
|
|
13
|
-
if (refA == null && refB == null) {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
return function (refValue) {
|
|
18
|
-
setRef(refA, refValue);
|
|
19
|
-
setRef(refB, refValue);
|
|
20
|
-
};
|
|
21
|
-
}, [refA, refB]);
|
|
22
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
declare const _default: React.MemoExoticComponent<({ children, options, move, rowKey, items, tableWidth }: {
|
|
3
|
-
children: any;
|
|
4
|
-
options: any;
|
|
5
|
-
move: any;
|
|
6
|
-
rowKey: any;
|
|
7
|
-
items: any;
|
|
8
|
-
tableWidth: any;
|
|
9
|
-
}) => JSX.Element>;
|
|
10
|
-
export default _default;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import React, { memo } from 'react';
|
|
3
|
-
import { DndContext, closestCenter, KeyboardSensor, PointerSensor, useSensor, useSensors } from '@dnd-kit/core';
|
|
4
|
-
import { restrictToParentElement, restrictToVerticalAxis } from '@dnd-kit/modifiers';
|
|
5
|
-
import { sortableKeyboardCoordinates } from '@dnd-kit/sortable'; // 可拖拽容器
|
|
6
|
-
|
|
7
|
-
var DndContainer = function DndContainer(_ref) {
|
|
8
|
-
var children = _ref.children,
|
|
9
|
-
options = _ref.options,
|
|
10
|
-
move = _ref.move,
|
|
11
|
-
rowKey = _ref.rowKey,
|
|
12
|
-
items = _ref.items,
|
|
13
|
-
tableWidth = _ref.tableWidth;
|
|
14
|
-
|
|
15
|
-
var _React$useState = React.useState(false),
|
|
16
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
17
|
-
isDragging = _React$useState2[0],
|
|
18
|
-
setIsDragging = _React$useState2[1]; // 是否拖拽中
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var _React$useState3 = React.useState(null),
|
|
22
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
23
|
-
activeId = _React$useState4[0],
|
|
24
|
-
setActiveId = _React$useState4[1]; // 是否拖拽中
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
var sensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, {
|
|
28
|
-
coordinateGetter: sortableKeyboardCoordinates
|
|
29
|
-
})); // 开始拖拽
|
|
30
|
-
|
|
31
|
-
var handleDragStart = function handleDragStart(_ref2) {
|
|
32
|
-
var active = _ref2.active;
|
|
33
|
-
setIsDragging(true);
|
|
34
|
-
|
|
35
|
-
if (!active) {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
setActiveId(active.id);
|
|
40
|
-
}; // 拖拽结束
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
var handleDragEnd = function handleDragEnd(event) {
|
|
44
|
-
var active = event.active,
|
|
45
|
-
over = event.over;
|
|
46
|
-
setActiveId(null); // 未移入时触发
|
|
47
|
-
|
|
48
|
-
if (!(over === null || over === void 0 ? void 0 : over.id)) {
|
|
49
|
-
return;
|
|
50
|
-
} // 移入时触发更新数据
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
if (active.id !== over.id) {
|
|
54
|
-
move(active.id, over.id);
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
var instance = {
|
|
59
|
-
isDragging: isDragging,
|
|
60
|
-
activeId: activeId,
|
|
61
|
-
options: options,
|
|
62
|
-
rowKey: rowKey,
|
|
63
|
-
children: children,
|
|
64
|
-
move: move,
|
|
65
|
-
items: items,
|
|
66
|
-
tableWidth: tableWidth
|
|
67
|
-
};
|
|
68
|
-
console.log('instance', instance);
|
|
69
|
-
return /*#__PURE__*/React.createElement(DndContext, {
|
|
70
|
-
sensors: sensors,
|
|
71
|
-
onDragStart: handleDragStart,
|
|
72
|
-
onDragCancel: function onDragCancel() {
|
|
73
|
-
return setActiveId(null);
|
|
74
|
-
},
|
|
75
|
-
collisionDetection: closestCenter,
|
|
76
|
-
onDragEnd: handleDragEnd,
|
|
77
|
-
modifiers: [restrictToParentElement, restrictToVerticalAxis]
|
|
78
|
-
}, children);
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
export default /*#__PURE__*/memo(DndContainer);
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
var __rest = this && this.__rest || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
|
|
4
|
-
for (var p in s) {
|
|
5
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
9
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
import React, { useRef, useMemo, useEffect } from 'react';
|
|
15
|
-
import { useStore } from './context';
|
|
16
|
-
import useForkRef from '../hooks/useForkRef';
|
|
17
|
-
var VirtualRow = /*#__PURE__*/React.memo(function (_a, ref) {
|
|
18
|
-
var children = _a.children,
|
|
19
|
-
pref = _a.pref,
|
|
20
|
-
resetProps = __rest(_a, ["children", "pref"]);
|
|
21
|
-
|
|
22
|
-
var _useStore = useStore(),
|
|
23
|
-
state = _useStore.state,
|
|
24
|
-
dispatch = _useStore.dispatch;
|
|
25
|
-
|
|
26
|
-
var rowHeight = state.rowHeight,
|
|
27
|
-
totalLen = state.totalLen;
|
|
28
|
-
var trRef = useRef(null); // 列长度
|
|
29
|
-
|
|
30
|
-
var columnsLen = useMemo(function () {
|
|
31
|
-
var _a;
|
|
32
|
-
|
|
33
|
-
return (_a = children === null || children === void 0 ? void 0 : children.length) !== null && _a !== void 0 ? _a : 0;
|
|
34
|
-
}, [children]);
|
|
35
|
-
useEffect(function () {
|
|
36
|
-
if (state.columnsLen !== columnsLen) {
|
|
37
|
-
dispatch({
|
|
38
|
-
type: 'changeColumnsLen',
|
|
39
|
-
columnsLen: columnsLen !== null && columnsLen !== void 0 ? columnsLen : 0
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
}, [columnsLen, dispatch, state.columnsLen]);
|
|
43
|
-
useEffect(function () {
|
|
44
|
-
var initHeight = function initHeight(tempRef) {
|
|
45
|
-
var _a, _b, _c;
|
|
46
|
-
|
|
47
|
-
if (((_a = tempRef === null || tempRef === void 0 ? void 0 : tempRef.current) === null || _a === void 0 ? void 0 : _a.offsetHeight) && !rowHeight && totalLen) {
|
|
48
|
-
var tempRowHeight = (_c = (_b = tempRef === null || tempRef === void 0 ? void 0 : tempRef.current) === null || _b === void 0 ? void 0 : _b.offsetHeight) !== null && _c !== void 0 ? _c : 0;
|
|
49
|
-
dispatch({
|
|
50
|
-
type: 'initHeight',
|
|
51
|
-
rowHeight: tempRowHeight
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
initHeight(trRef);
|
|
57
|
-
}, [trRef, dispatch, rowHeight, totalLen, ref]);
|
|
58
|
-
return /*#__PURE__*/React.createElement("tr", Object.assign({}, resetProps, {
|
|
59
|
-
ref: useForkRef(pref, trRef)
|
|
60
|
-
}), children);
|
|
61
|
-
});
|
|
62
|
-
export default VirtualRow;
|