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.
Files changed (107) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/Form/demos/disabled.d.ts +2 -0
  3. package/dist/LmEditTable/DndContainer.d.ts +3 -4
  4. package/dist/LmEditTable/EditTable.d.ts +0 -2
  5. package/dist/LmEditTable/sortableItem.d.ts +2 -3
  6. package/dist/LmEditTable/util.d.ts +0 -2
  7. package/dist/LmFilter/LmFilter.d.ts +2 -6
  8. package/dist/LmTable/expression.d.ts +1 -0
  9. package/dist/LmTable/hooks/useGroupDataSource.d.ts +7 -0
  10. package/dist/index.umd.js +364 -517
  11. package/dist/index.umd.min.js +17 -17
  12. package/dist/variables.css +3 -29
  13. package/es/Cascader/index.js +16 -2
  14. package/es/Form/style/index.css +3 -0
  15. package/es/Form/style/variables.css +3 -0
  16. package/es/IconFont/index.js +1 -1
  17. package/es/Input/index.js +20 -4
  18. package/es/InputNumber/index.js +9 -2
  19. package/es/LmEditTable/DndContainer.d.ts +3 -4
  20. package/es/LmEditTable/DndContainer.js +2 -2
  21. package/es/LmEditTable/EditTable.d.ts +0 -2
  22. package/es/LmEditTable/EditTable.js +150 -139
  23. package/es/LmEditTable/sortableItem.d.ts +2 -3
  24. package/es/LmEditTable/sortableItem.js +4 -15
  25. package/es/LmEditTable/style/index.css +0 -29
  26. package/es/LmEditTable/style/variables.css +0 -29
  27. package/es/LmEditTable/util.d.ts +0 -2
  28. package/es/LmEditTable/util.js +1 -47
  29. package/es/LmFilter/LmFilter.js +6 -6
  30. package/es/LmFilter/components/DropdownFIlter.js +5 -2
  31. package/es/LmFilter/index.js +0 -3
  32. package/es/LmTable/Table.js +10 -7
  33. package/es/LmTable/expression.d.ts +1 -0
  34. package/es/LmTable/expression.js +31 -0
  35. package/es/LmTable/hooks/useGroupDataSource.js +50 -0
  36. package/es/LmUpload/fns/index.js +8 -3
  37. package/es/Select/index.js +17 -7
  38. package/es/hooks/useEvent/index.js +1 -1
  39. package/es/styles/variables.css +3 -29
  40. package/lib/Cascader/index.js +16 -2
  41. package/lib/Form/style/index.css +3 -0
  42. package/lib/Form/style/variables.css +3 -0
  43. package/lib/IconFont/index.js +1 -1
  44. package/lib/Input/index.js +22 -4
  45. package/lib/InputNumber/index.js +11 -2
  46. package/lib/LmEditTable/DndContainer.d.ts +3 -4
  47. package/lib/LmEditTable/DndContainer.js +3 -4
  48. package/lib/LmEditTable/EditTable.d.ts +0 -2
  49. package/lib/LmEditTable/EditTable.js +146 -135
  50. package/lib/LmEditTable/sortableItem.d.ts +2 -3
  51. package/lib/LmEditTable/sortableItem.js +5 -18
  52. package/lib/LmEditTable/style/index.css +0 -29
  53. package/lib/LmEditTable/style/variables.css +0 -29
  54. package/lib/LmEditTable/util.d.ts +0 -2
  55. package/lib/LmEditTable/util.js +0 -50
  56. package/lib/LmFilter/LmFilter.js +6 -6
  57. package/lib/LmFilter/components/DropdownFIlter.js +5 -2
  58. package/lib/LmFilter/index.js +0 -3
  59. package/lib/LmTable/Table.js +10 -7
  60. package/lib/LmTable/expression.d.ts +1 -0
  61. package/lib/LmTable/expression.js +41 -0
  62. package/lib/LmTable/hooks/useGroupDataSource.js +50 -0
  63. package/lib/LmUpload/fns/index.js +8 -3
  64. package/lib/Select/index.js +19 -7
  65. package/lib/hooks/useEvent/index.js +1 -1
  66. package/lib/styles/variables.css +3 -29
  67. package/package.json +1 -1
  68. package/dist/LmEditTable/components/DraggableContainer.d.ts +0 -7
  69. package/dist/LmEditTable/components/index.d.ts +0 -11
  70. package/dist/LmEditTable/virtual/VirtualRow.d.ts +0 -6
  71. package/dist/LmEditTable/virtual/VirtualRowBack.d.ts +0 -6
  72. package/dist/LmEditTable/virtual/VirtualTable.d.ts +0 -3
  73. package/dist/LmEditTable/virtual/VirtualWrapper.d.ts +0 -3
  74. package/dist/LmEditTable/virtual/context.d.ts +0 -13
  75. package/dist/LmEditTable/virtual/index.d.ts +0 -4
  76. package/es/LmEditTable/components/DraggableContainer.d.ts +0 -7
  77. package/es/LmEditTable/components/DraggableContainer.js +0 -32
  78. package/es/LmEditTable/components/index.d.ts +0 -11
  79. package/es/LmEditTable/components/index.js +0 -5
  80. package/es/LmEditTable/virtual/VirtualRow.d.ts +0 -6
  81. package/es/LmEditTable/virtual/VirtualRow.js +0 -60
  82. package/es/LmEditTable/virtual/VirtualRowBack.d.ts +0 -6
  83. package/es/LmEditTable/virtual/VirtualRowBack.js +0 -102
  84. package/es/LmEditTable/virtual/VirtualTable.d.ts +0 -3
  85. package/es/LmEditTable/virtual/VirtualTable.js +0 -54
  86. package/es/LmEditTable/virtual/VirtualWrapper.d.ts +0 -3
  87. package/es/LmEditTable/virtual/VirtualWrapper.js +0 -60
  88. package/es/LmEditTable/virtual/context.d.ts +0 -13
  89. package/es/LmEditTable/virtual/context.js +0 -54
  90. package/es/LmEditTable/virtual/index.d.ts +0 -4
  91. package/es/LmEditTable/virtual/index.js +0 -4
  92. package/lib/LmEditTable/components/DraggableContainer.d.ts +0 -7
  93. package/lib/LmEditTable/components/DraggableContainer.js +0 -45
  94. package/lib/LmEditTable/components/index.d.ts +0 -11
  95. package/lib/LmEditTable/components/index.js +0 -21
  96. package/lib/LmEditTable/virtual/VirtualRow.d.ts +0 -6
  97. package/lib/LmEditTable/virtual/VirtualRow.js +0 -73
  98. package/lib/LmEditTable/virtual/VirtualRowBack.d.ts +0 -6
  99. package/lib/LmEditTable/virtual/VirtualRowBack.js +0 -115
  100. package/lib/LmEditTable/virtual/VirtualTable.d.ts +0 -3
  101. package/lib/LmEditTable/virtual/VirtualTable.js +0 -71
  102. package/lib/LmEditTable/virtual/VirtualWrapper.d.ts +0 -3
  103. package/lib/LmEditTable/virtual/VirtualWrapper.js +0 -73
  104. package/lib/LmEditTable/virtual/context.d.ts +0 -13
  105. package/lib/LmEditTable/virtual/context.js +0 -64
  106. package/lib/LmEditTable/virtual/index.d.ts +0 -4
  107. package/lib/LmEditTable/virtual/index.js +0 -31
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const VirtualWrapper: React.MemoExoticComponent<(wrapperProps: React.PropsWithChildren<any>) => JSX.Element>;
3
- export default VirtualWrapper;
@@ -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,4 +0,0 @@
1
- import VirtualTable from './VirtualTable';
2
- import VirtualWrapper from './VirtualWrapper';
3
- import VirtualRow from './VirtualRow';
4
- export { VirtualTable, VirtualWrapper, VirtualRow };
@@ -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"));