linkmore-design 1.1.13-alpha.1 → 1.1.14
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/CHANGELOG.md +11 -0
- package/dist/Form/demos/disabled.d.ts +2 -0
- package/dist/LmEditTable/DndContainer.d.ts +3 -4
- package/dist/LmEditTable/EditTable.d.ts +0 -2
- package/dist/LmEditTable/sortableItem.d.ts +2 -3
- package/dist/LmEditTable/util.d.ts +0 -2
- package/dist/LmFilter/LmFilter.d.ts +2 -6
- package/dist/LmTable/expression.d.ts +1 -0
- package/dist/LmTable/hooks/useGroupDataSource.d.ts +7 -0
- package/dist/index.umd.js +364 -517
- package/dist/index.umd.min.js +17 -17
- package/dist/variables.css +3 -29
- package/es/Cascader/index.js +16 -2
- package/es/Form/style/index.css +3 -0
- package/es/Form/style/variables.css +3 -0
- package/es/IconFont/index.js +1 -1
- package/es/Input/index.js +20 -4
- package/es/InputNumber/index.js +9 -2
- package/es/LmEditTable/DndContainer.d.ts +3 -4
- package/es/LmEditTable/DndContainer.js +2 -2
- package/es/LmEditTable/EditTable.d.ts +0 -2
- package/es/LmEditTable/EditTable.js +150 -139
- package/es/LmEditTable/sortableItem.d.ts +2 -3
- package/es/LmEditTable/sortableItem.js +4 -15
- package/es/LmEditTable/style/index.css +0 -29
- package/es/LmEditTable/style/variables.css +0 -29
- package/es/LmEditTable/util.d.ts +0 -2
- package/es/LmEditTable/util.js +1 -47
- package/es/LmFilter/LmFilter.js +6 -6
- package/es/LmFilter/components/DropdownFIlter.js +5 -2
- package/es/LmFilter/index.js +0 -3
- package/es/LmTable/Table.js +10 -7
- package/es/LmTable/expression.d.ts +1 -0
- package/es/LmTable/expression.js +31 -0
- package/es/LmTable/hooks/useGroupDataSource.js +50 -0
- package/es/LmUpload/fns/index.js +8 -3
- package/es/Select/index.js +17 -7
- package/es/hooks/useEvent/index.js +1 -1
- package/es/styles/variables.css +3 -29
- package/lib/Cascader/index.js +16 -2
- package/lib/Form/style/index.css +3 -0
- package/lib/Form/style/variables.css +3 -0
- package/lib/IconFont/index.js +1 -1
- package/lib/Input/index.js +22 -4
- package/lib/InputNumber/index.js +11 -2
- package/lib/LmEditTable/DndContainer.d.ts +3 -4
- package/lib/LmEditTable/DndContainer.js +3 -4
- package/lib/LmEditTable/EditTable.d.ts +0 -2
- package/lib/LmEditTable/EditTable.js +146 -135
- package/lib/LmEditTable/sortableItem.d.ts +2 -3
- package/lib/LmEditTable/sortableItem.js +5 -18
- package/lib/LmEditTable/style/index.css +0 -29
- package/lib/LmEditTable/style/variables.css +0 -29
- package/lib/LmEditTable/util.d.ts +0 -2
- package/lib/LmEditTable/util.js +0 -50
- package/lib/LmFilter/LmFilter.js +6 -6
- package/lib/LmFilter/components/DropdownFIlter.js +5 -2
- package/lib/LmFilter/index.js +0 -3
- package/lib/LmTable/Table.js +10 -7
- package/lib/LmTable/expression.d.ts +1 -0
- package/lib/LmTable/expression.js +41 -0
- package/lib/LmTable/hooks/useGroupDataSource.js +50 -0
- package/lib/LmUpload/fns/index.js +8 -3
- package/lib/Select/index.js +19 -7
- package/lib/hooks/useEvent/index.js +1 -1
- package/lib/styles/variables.css +3 -29
- package/package.json +1 -1
- package/dist/LmEditTable/components/DraggableContainer.d.ts +0 -7
- package/dist/LmEditTable/components/index.d.ts +0 -11
- package/dist/LmEditTable/virtual/VirtualRow.d.ts +0 -6
- 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 -7
- package/es/LmEditTable/components/DraggableContainer.js +0 -32
- package/es/LmEditTable/components/index.d.ts +0 -11
- package/es/LmEditTable/components/index.js +0 -5
- package/es/LmEditTable/virtual/VirtualRow.d.ts +0 -6
- package/es/LmEditTable/virtual/VirtualRow.js +0 -60
- package/es/LmEditTable/virtual/VirtualRowBack.d.ts +0 -6
- package/es/LmEditTable/virtual/VirtualRowBack.js +0 -102
- 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 -7
- package/lib/LmEditTable/components/DraggableContainer.js +0 -45
- package/lib/LmEditTable/components/index.d.ts +0 -11
- package/lib/LmEditTable/components/index.js +0 -21
- package/lib/LmEditTable/virtual/VirtualRow.d.ts +0 -6
- package/lib/LmEditTable/virtual/VirtualRow.js +0 -73
- package/lib/LmEditTable/virtual/VirtualRowBack.d.ts +0 -6
- package/lib/LmEditTable/virtual/VirtualRowBack.js +0 -115
- 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
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
|
-
var _context = require("./context");
|
|
13
|
-
|
|
14
|
-
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
15
|
-
var t = {};
|
|
16
|
-
|
|
17
|
-
for (var p in s) {
|
|
18
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
23
|
-
}
|
|
24
|
-
return t;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
var VirtualWrapper = /*#__PURE__*/_react.default.memo(function (wrapperProps) {
|
|
28
|
-
var _a, _b;
|
|
29
|
-
|
|
30
|
-
var children = wrapperProps.children,
|
|
31
|
-
resetProps = __rest(wrapperProps, ["children"]);
|
|
32
|
-
|
|
33
|
-
var _useStore = (0, _context.useStore)(),
|
|
34
|
-
state = _useStore.state,
|
|
35
|
-
dispatch = _useStore.dispatch,
|
|
36
|
-
instance = _useStore.instance;
|
|
37
|
-
|
|
38
|
-
var _instance$rowVirtual = instance.rowVirtual,
|
|
39
|
-
virtualItems = _instance$rowVirtual.virtualItems,
|
|
40
|
-
totalSize = _instance$rowVirtual.totalSize;
|
|
41
|
-
var contents = (0, _react.useMemo)(function () {
|
|
42
|
-
return children[1];
|
|
43
|
-
}, [children]);
|
|
44
|
-
var contentsLen = (0, _react.useMemo)(function () {
|
|
45
|
-
var _a;
|
|
46
|
-
|
|
47
|
-
return (_a = contents === null || contents === void 0 ? void 0 : contents.length) !== null && _a !== void 0 ? _a : 0;
|
|
48
|
-
}, [contents]);
|
|
49
|
-
(0, _react.useEffect)(function () {
|
|
50
|
-
if (state.totalLen !== contentsLen) {
|
|
51
|
-
dispatch({
|
|
52
|
-
type: 'changeTotalLen',
|
|
53
|
-
totalLen: contentsLen !== null && contentsLen !== void 0 ? contentsLen : 0
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
}, [contentsLen, dispatch, state.totalLen]);
|
|
57
|
-
var paddingTop = virtualItems.length > 0 ? ((_a = virtualItems === null || virtualItems === void 0 ? void 0 : virtualItems[0]) === null || _a === void 0 ? void 0 : _a.start) || 0 : 0;
|
|
58
|
-
var paddingBottom = virtualItems.length > 0 ? totalSize - (((_b = virtualItems === null || virtualItems === void 0 ? void 0 : virtualItems[virtualItems.length - 1]) === null || _b === void 0 ? void 0 : _b.end) || 0) : 0;
|
|
59
|
-
return /*#__PURE__*/_react.default.createElement("tbody", Object.assign({}, resetProps), paddingTop > 0 && /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", {
|
|
60
|
-
style: {
|
|
61
|
-
height: "".concat(paddingTop, "px")
|
|
62
|
-
}
|
|
63
|
-
})), children[0], virtualItems.map(function (virtualRow) {
|
|
64
|
-
return contents[virtualRow.index];
|
|
65
|
-
}), paddingBottom > 0 && /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", {
|
|
66
|
-
style: {
|
|
67
|
-
height: "".concat(paddingBottom, "px")
|
|
68
|
-
}
|
|
69
|
-
})));
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
var _default = VirtualWrapper;
|
|
73
|
-
exports.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,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.useStore = exports.useRealive = exports.TableContext = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
|
|
10
|
-
// =============== context ============== //
|
|
11
|
-
var TableContext = /*#__PURE__*/(0, _react.createContext)({
|
|
12
|
-
state: null,
|
|
13
|
-
dispatch: null,
|
|
14
|
-
instance: {}
|
|
15
|
-
});
|
|
16
|
-
exports.TableContext = TableContext;
|
|
17
|
-
|
|
18
|
-
var useStore = function useStore() {
|
|
19
|
-
return (0, _react.useContext)(TableContext);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
exports.useStore = useStore;
|
|
23
|
-
var initialState = {
|
|
24
|
-
// 行高度
|
|
25
|
-
rowHeight: 0,
|
|
26
|
-
columnsLen: 0,
|
|
27
|
-
// 总行数
|
|
28
|
-
totalLen: 0
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
var reducer = function reducer(state, action) {
|
|
32
|
-
var totalLen = action.totalLen,
|
|
33
|
-
columnsLen = action.columnsLen,
|
|
34
|
-
rowHeight = action.rowHeight;
|
|
35
|
-
|
|
36
|
-
switch (action.type) {
|
|
37
|
-
// 数据数量
|
|
38
|
-
case 'changeTotalLen':
|
|
39
|
-
return Object.assign(Object.assign({}, state), {
|
|
40
|
-
totalLen: totalLen
|
|
41
|
-
});
|
|
42
|
-
// 列数量
|
|
43
|
-
|
|
44
|
-
case 'changeColumnsLen':
|
|
45
|
-
return Object.assign(Object.assign({}, state), {
|
|
46
|
-
columnsLen: columnsLen
|
|
47
|
-
});
|
|
48
|
-
// 初始化行高度
|
|
49
|
-
|
|
50
|
-
case 'initHeight':
|
|
51
|
-
return Object.assign(Object.assign({}, state), {
|
|
52
|
-
rowHeight: rowHeight
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
default:
|
|
56
|
-
throw new Error();
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
var useRealive = function useRealive() {
|
|
61
|
-
return (0, _react.useReducer)(reducer, initialState);
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
exports.useRealive = useRealive;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
Object.defineProperty(exports, "VirtualRow", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function get() {
|
|
11
|
-
return _VirtualRow.default;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
Object.defineProperty(exports, "VirtualTable", {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: function get() {
|
|
17
|
-
return _VirtualTable.default;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
Object.defineProperty(exports, "VirtualWrapper", {
|
|
21
|
-
enumerable: true,
|
|
22
|
-
get: function get() {
|
|
23
|
-
return _VirtualWrapper.default;
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
var _VirtualTable = _interopRequireDefault(require("./VirtualTable"));
|
|
28
|
-
|
|
29
|
-
var _VirtualWrapper = _interopRequireDefault(require("./VirtualWrapper"));
|
|
30
|
-
|
|
31
|
-
var _VirtualRow = _interopRequireDefault(require("./VirtualRow"));
|