linkmore-design 1.1.26 → 1.1.27-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LmEditTable/DndContainer.d.ts +6 -3
- package/dist/LmEditTable/EditTable.d.ts +10 -5
- package/dist/LmEditTable/components/DraggableContainer.d.ts +10 -0
- package/dist/LmEditTable/components/QuickOpetate.d.ts +12 -0
- package/dist/LmEditTable/components/bottomOpetateComponent.d.ts +13 -0
- package/dist/LmEditTable/components/customRenderEmpty.d.ts +2 -0
- package/dist/LmEditTable/components/index.d.ts +17 -0
- package/dist/LmEditTable/hooks/useForkRef.d.ts +2 -0
- package/dist/LmEditTable/rowSort/DndContainerRow.d.ts +10 -0
- package/dist/LmEditTable/sortableItem.d.ts +3 -2
- package/dist/LmEditTable/util.d.ts +8 -0
- package/dist/LmEditTable/virtual/VirtualRow.d.ts +7 -0
- package/dist/LmEditTable/virtual/VirtualRow2.d.ts +7 -0
- package/dist/LmEditTable/virtual/VirtualTable.d.ts +3 -0
- package/dist/LmEditTable/virtual/VirtualWrapper.d.ts +3 -0
- package/dist/LmEditTable/virtual/context.d.ts +13 -0
- package/dist/LmEditTable/virtual/index.d.ts +4 -0
- package/dist/LmTable/virTual/VirtualRow.d.ts +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.umd.js +1380 -576
- package/dist/index.umd.min.js +21 -21
- package/dist/variables.css +92 -0
- package/es/InputNumber/index.js +7 -9
- package/es/LmEditTable/DndContainer.d.ts +6 -3
- package/es/LmEditTable/DndContainer.js +70 -10
- package/es/LmEditTable/DragHandle.js +1 -1
- package/es/LmEditTable/EditTable.d.ts +10 -5
- package/es/LmEditTable/EditTable.js +364 -360
- package/es/LmEditTable/components/DraggableContainer.d.ts +10 -0
- package/es/LmEditTable/components/DraggableContainer.js +39 -0
- package/es/LmEditTable/components/QuickOpetate.d.ts +12 -0
- package/es/LmEditTable/components/QuickOpetate.js +82 -0
- package/es/LmEditTable/components/bottomOpetateComponent.d.ts +13 -0
- package/es/LmEditTable/components/bottomOpetateComponent.js +23 -0
- package/es/LmEditTable/components/customRenderEmpty.d.ts +2 -0
- package/es/LmEditTable/components/customRenderEmpty.js +20 -0
- package/es/LmEditTable/components/index.d.ts +17 -0
- package/es/LmEditTable/components/index.js +8 -0
- package/es/LmEditTable/hooks/useForkRef.d.ts +2 -0
- package/es/LmEditTable/hooks/useForkRef.js +22 -0
- package/es/LmEditTable/rowSort/DndContainerRow.d.ts +10 -0
- package/es/LmEditTable/rowSort/DndContainerRow.js +81 -0
- package/es/LmEditTable/sortableItem.d.ts +3 -2
- package/es/LmEditTable/sortableItem.js +16 -4
- package/es/LmEditTable/sortableItemCol.js +40 -10
- package/es/LmEditTable/style/index.css +92 -0
- package/es/LmEditTable/style/variables.css +92 -0
- package/es/LmEditTable/util.d.ts +8 -0
- package/es/LmEditTable/util.js +103 -7
- package/es/LmEditTable/virtual/VirtualRow.d.ts +7 -0
- package/es/LmEditTable/virtual/VirtualRow.js +140 -0
- package/es/LmEditTable/virtual/VirtualRow2.d.ts +7 -0
- package/es/LmEditTable/virtual/VirtualRow2.js +62 -0
- package/es/LmEditTable/virtual/VirtualTable.d.ts +3 -0
- package/es/LmEditTable/virtual/VirtualTable.js +62 -0
- package/es/LmEditTable/virtual/VirtualWrapper.d.ts +3 -0
- package/es/LmEditTable/virtual/VirtualWrapper.js +60 -0
- package/es/LmEditTable/virtual/context.d.ts +13 -0
- package/es/LmEditTable/virtual/context.js +66 -0
- package/es/LmEditTable/virtual/index.d.ts +4 -0
- package/es/LmEditTable/virtual/index.js +4 -0
- package/es/LmFilter/filterFns/index.js +7 -2
- package/es/LmTable/virTual/VirtualRow.d.ts +1 -1
- package/es/LmTable/virTual/VirtualRow.js +82 -48
- package/es/LmTable/virTual/VirtualTable.js +17 -9
- package/es/LmTable/virTual/context.js +14 -2
- package/es/hooks/useEvent/index.js +1 -1
- package/es/index.d.ts +1 -2
- package/es/styles/variables.css +92 -0
- package/lib/InputNumber/index.js +9 -9
- package/lib/LmEditTable/DndContainer.d.ts +6 -3
- package/lib/LmEditTable/DndContainer.js +74 -9
- package/lib/LmEditTable/DragHandle.js +1 -1
- package/lib/LmEditTable/EditTable.d.ts +10 -5
- package/lib/LmEditTable/EditTable.js +362 -357
- package/lib/LmEditTable/components/DraggableContainer.d.ts +10 -0
- package/lib/LmEditTable/components/DraggableContainer.js +52 -0
- package/lib/LmEditTable/components/QuickOpetate.d.ts +12 -0
- package/lib/LmEditTable/components/QuickOpetate.js +96 -0
- package/lib/LmEditTable/components/bottomOpetateComponent.d.ts +13 -0
- package/lib/LmEditTable/components/bottomOpetateComponent.js +34 -0
- package/lib/LmEditTable/components/customRenderEmpty.d.ts +2 -0
- package/lib/LmEditTable/components/customRenderEmpty.js +32 -0
- package/lib/LmEditTable/components/index.d.ts +17 -0
- package/lib/LmEditTable/components/index.js +45 -0
- package/lib/LmEditTable/hooks/useForkRef.d.ts +2 -0
- package/lib/LmEditTable/hooks/useForkRef.js +29 -0
- package/lib/LmEditTable/rowSort/DndContainerRow.d.ts +10 -0
- package/lib/LmEditTable/rowSort/DndContainerRow.js +99 -0
- package/lib/LmEditTable/sortableItem.d.ts +3 -2
- package/lib/LmEditTable/sortableItem.js +19 -5
- package/lib/LmEditTable/sortableItemCol.js +37 -8
- package/lib/LmEditTable/style/index.css +92 -0
- package/lib/LmEditTable/style/variables.css +92 -0
- package/lib/LmEditTable/util.d.ts +8 -0
- package/lib/LmEditTable/util.js +110 -6
- package/lib/LmEditTable/virtual/VirtualRow.d.ts +7 -0
- package/lib/LmEditTable/virtual/VirtualRow.js +155 -0
- package/lib/LmEditTable/virtual/VirtualRow2.d.ts +7 -0
- package/lib/LmEditTable/virtual/VirtualRow2.js +78 -0
- package/lib/LmEditTable/virtual/VirtualTable.d.ts +3 -0
- package/lib/LmEditTable/virtual/VirtualTable.js +79 -0
- package/lib/LmEditTable/virtual/VirtualWrapper.d.ts +3 -0
- package/lib/LmEditTable/virtual/VirtualWrapper.js +73 -0
- package/lib/LmEditTable/virtual/context.d.ts +13 -0
- package/lib/LmEditTable/virtual/context.js +76 -0
- package/lib/LmEditTable/virtual/index.d.ts +4 -0
- package/lib/LmEditTable/virtual/index.js +31 -0
- package/lib/LmFilter/filterFns/index.js +7 -2
- package/lib/LmTable/virTual/VirtualRow.d.ts +1 -1
- package/lib/LmTable/virTual/VirtualRow.js +81 -48
- package/lib/LmTable/virTual/VirtualTable.js +16 -8
- package/lib/LmTable/virTual/context.js +14 -2
- package/lib/hooks/useEvent/index.js +1 -1
- package/lib/index.d.ts +1 -2
- package/lib/styles/variables.css +92 -0
- package/package.json +7 -9
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
+
|
|
3
5
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
6
|
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -7,7 +9,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
9
|
});
|
|
8
10
|
exports.default = void 0;
|
|
9
11
|
|
|
10
|
-
var
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
15
|
|
|
12
16
|
var _core = require("@dnd-kit/core");
|
|
13
17
|
|
|
@@ -15,17 +19,60 @@ var _modifiers = require("@dnd-kit/modifiers");
|
|
|
15
19
|
|
|
16
20
|
var _sortable = require("@dnd-kit/sortable");
|
|
17
21
|
|
|
18
|
-
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
+
var DragOver = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
23
|
+
var instance = _ref.instance;
|
|
24
|
+
var isDragging = instance.isDragging,
|
|
25
|
+
activeId = instance.activeId,
|
|
26
|
+
options = instance.options;
|
|
27
|
+
var item = activeId && options.find(function (v) {
|
|
28
|
+
return v.dataIndex === activeId;
|
|
29
|
+
});
|
|
30
|
+
return /*#__PURE__*/_react.default.createElement(_core.DragOverlay, {
|
|
31
|
+
adjustScale: false
|
|
32
|
+
}, isDragging ? /*#__PURE__*/_react.default.createElement("div", {
|
|
33
|
+
className: "lm_editable_col_drag"
|
|
34
|
+
}, item === null || item === void 0 ? void 0 : item.title) : null);
|
|
35
|
+
}); // 可拖拽容器
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
var DndContainer = function DndContainer(_ref2) {
|
|
39
|
+
var children = _ref2.children,
|
|
40
|
+
move = _ref2.move,
|
|
41
|
+
options = _ref2.options,
|
|
42
|
+
rowKey = _ref2.rowKey;
|
|
43
|
+
|
|
44
|
+
var _React$useState = _react.default.useState(false),
|
|
45
|
+
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
46
|
+
isDragging = _React$useState2[0],
|
|
47
|
+
setIsDragging = _React$useState2[1]; // 是否拖拽中
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
var _React$useState3 = _react.default.useState(null),
|
|
51
|
+
_React$useState4 = (0, _slicedToArray2.default)(_React$useState3, 2),
|
|
52
|
+
activeId = _React$useState4[0],
|
|
53
|
+
setActiveId = _React$useState4[1]; // 是否拖拽中
|
|
54
|
+
|
|
55
|
+
|
|
22
56
|
var sensors = (0, _core.useSensors)((0, _core.useSensor)(_core.PointerSensor), (0, _core.useSensor)(_core.KeyboardSensor, {
|
|
23
57
|
coordinateGetter: _sortable.sortableKeyboardCoordinates
|
|
24
|
-
})); //
|
|
58
|
+
})); // 开始拖拽
|
|
59
|
+
|
|
60
|
+
var handleDragStart = function handleDragStart(_ref3) {
|
|
61
|
+
var active = _ref3.active;
|
|
62
|
+
setIsDragging(true);
|
|
63
|
+
|
|
64
|
+
if (!active) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
setActiveId(active.id);
|
|
69
|
+
}; // 拖拽结束
|
|
70
|
+
|
|
25
71
|
|
|
26
72
|
var handleDragEnd = function handleDragEnd(event) {
|
|
27
73
|
var active = event.active,
|
|
28
|
-
over = event.over;
|
|
74
|
+
over = event.over;
|
|
75
|
+
setActiveId(null); // 未移入时触发
|
|
29
76
|
|
|
30
77
|
if (!(over === null || over === void 0 ? void 0 : over.id)) {
|
|
31
78
|
return;
|
|
@@ -37,13 +84,31 @@ var DndContainer = function DndContainer(_ref) {
|
|
|
37
84
|
}
|
|
38
85
|
};
|
|
39
86
|
|
|
87
|
+
var instance = {
|
|
88
|
+
isDragging: isDragging,
|
|
89
|
+
activeId: activeId,
|
|
90
|
+
options: options,
|
|
91
|
+
rowKey: rowKey,
|
|
92
|
+
children: children,
|
|
93
|
+
move: move,
|
|
94
|
+
items: options === null || options === void 0 ? void 0 : options.map(function (v) {
|
|
95
|
+
return v[rowKey];
|
|
96
|
+
})
|
|
97
|
+
};
|
|
40
98
|
return /*#__PURE__*/_react.default.createElement(_core.DndContext, {
|
|
41
99
|
sensors: sensors,
|
|
42
100
|
collisionDetection: _core.closestCenter,
|
|
101
|
+
onDragStart: handleDragStart,
|
|
43
102
|
onDragEnd: handleDragEnd,
|
|
103
|
+
onDragCancel: function onDragCancel() {
|
|
104
|
+
return setActiveId(null);
|
|
105
|
+
},
|
|
44
106
|
modifiers: [_modifiers.restrictToParentElement]
|
|
45
|
-
}, children
|
|
107
|
+
}, children, /*#__PURE__*/_react.default.createElement(DragOver, {
|
|
108
|
+
instance: instance
|
|
109
|
+
}));
|
|
46
110
|
};
|
|
47
111
|
|
|
48
|
-
var _default = DndContainer;
|
|
112
|
+
var _default = /*#__PURE__*/(0, _react.memo)(DndContainer);
|
|
113
|
+
|
|
49
114
|
exports.default = _default;
|
|
@@ -5,6 +5,7 @@ interface ILmEditTable extends TableProps<any> {
|
|
|
5
5
|
isEdit?: boolean;
|
|
6
6
|
isAdd?: boolean;
|
|
7
7
|
rowKey?: string;
|
|
8
|
+
disabled?: boolean;
|
|
8
9
|
rowHoverEdit?: boolean;
|
|
9
10
|
isUseForm?: boolean;
|
|
10
11
|
isHoverEdit?: boolean;
|
|
@@ -13,6 +14,7 @@ interface ILmEditTable extends TableProps<any> {
|
|
|
13
14
|
sortOpen?: boolean;
|
|
14
15
|
size?: TableProps<any>['size'];
|
|
15
16
|
colSortOpen?: boolean;
|
|
17
|
+
indexCol?: boolean | Record<string, any>;
|
|
16
18
|
filterChange?: (data: TableProps<any>['columns']) => void;
|
|
17
19
|
recordCreatorProps?: {
|
|
18
20
|
creatorButtonText?: string;
|
|
@@ -31,7 +33,8 @@ export interface CountdownHandle {
|
|
|
31
33
|
getCheckboxRecords: () => any[];
|
|
32
34
|
clearSelect: () => void;
|
|
33
35
|
customSetCheckboxRecords: (data: any[]) => void;
|
|
34
|
-
|
|
36
|
+
deleteRowData: (record: string | Record<string, any>) => void;
|
|
37
|
+
addRowData: (record: string | Record<string, any>, defaultValue?: Record<string, any> | Record<string, any>[], addInChild?: boolean | 'replace') => void;
|
|
35
38
|
}
|
|
36
39
|
interface ILmColumns extends TableColumnType<any> {
|
|
37
40
|
editable?: 'input' | 'number' | 'inputRange' | 'date' | 'select' | 'multiple' | 'checkbox' | 'radio' | 'switch' | 'upload' | 'operate' | 'lm_edit_opetate' | 'render';
|
|
@@ -43,12 +46,14 @@ interface ILmColumns extends TableColumnType<any> {
|
|
|
43
46
|
componentProps?: Record<string, any>;
|
|
44
47
|
relevanceCols?: boolean;
|
|
45
48
|
}
|
|
46
|
-
export declare type TLmEditTable =
|
|
49
|
+
export declare type TLmEditTable = {
|
|
47
50
|
onChange?: (data: any[]) => void;
|
|
48
51
|
columns: ILmColumns[];
|
|
49
|
-
|
|
50
|
-
|
|
52
|
+
virtual?: boolean;
|
|
53
|
+
} & ILmEditTable;
|
|
54
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<{
|
|
51
55
|
onChange?: (data: any[]) => void;
|
|
52
56
|
columns: ILmColumns[];
|
|
53
|
-
|
|
57
|
+
virtual?: boolean;
|
|
58
|
+
} & ILmEditTable & React.RefAttributes<CountdownHandle>>>;
|
|
54
59
|
export default _default;
|