linkmore-design 1.0.82 → 1.0.83

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 (88) hide show
  1. package/dist/Form/style/index.d.ts +0 -3
  2. package/dist/LmEditTable/EditTable.d.ts +6 -0
  3. package/dist/LmEditTable/util.d.ts +1 -0
  4. package/dist/LmTable/components/customRenderEmpty.d.ts +2 -0
  5. package/dist/LmTable/demos/virtual.d.ts +2 -0
  6. package/dist/LmTable/util.d.ts +16 -0
  7. package/dist/LmTable/virTual/VirtualRow.d.ts +6 -0
  8. package/dist/LmTable/virTual/VirtualTable.d.ts +3 -0
  9. package/dist/LmTable/virTual/VirtualWrapper.d.ts +3 -0
  10. package/dist/LmTable/virTual/context.d.ts +13 -0
  11. package/dist/LmTable/virTual/index.d.ts +4 -0
  12. package/dist/TestTable/LmBox.d.ts +12 -0
  13. package/dist/TestTable/demos/basic.d.ts +6 -0
  14. package/dist/TestTable/index.d.ts +2 -0
  15. package/dist/TestTable/style/index.d.ts +1 -0
  16. package/dist/index.umd.js +764 -369
  17. package/dist/index.umd.min.js +3 -3
  18. package/es/Form/style/form.css +603 -0
  19. package/es/Form/style/grid.css +5185 -0
  20. package/es/Form/style/index.css +6 -1
  21. package/es/Form/style/index.d.ts +0 -3
  22. package/es/Form/style/index.js +0 -4
  23. package/es/Form/style/tooltip.css +275 -0
  24. package/es/LmEditTable/EditTable.d.ts +6 -0
  25. package/es/LmEditTable/EditTable.js +63 -81
  26. package/es/LmEditTable/sortableItemCol.js +6 -3
  27. package/es/LmEditTable/style/index.css +7 -0
  28. package/es/LmEditTable/util.d.ts +1 -0
  29. package/es/LmEditTable/util.js +5 -0
  30. package/es/LmTable/Table.js +308 -173
  31. package/es/LmTable/components/customRenderEmpty.d.ts +2 -0
  32. package/es/LmTable/components/customRenderEmpty.js +15 -0
  33. package/es/LmTable/components/sheelTableCell.js +14 -8
  34. package/es/LmTable/style/index.css +177 -152
  35. package/es/LmTable/util.js +105 -0
  36. package/es/LmTable/virTual/VirtualRow.d.ts +6 -0
  37. package/es/LmTable/virTual/VirtualRow.js +102 -0
  38. package/es/LmTable/virTual/VirtualTable.d.ts +3 -0
  39. package/es/LmTable/virTual/VirtualTable.js +52 -0
  40. package/es/LmTable/virTual/VirtualWrapper.d.ts +3 -0
  41. package/es/LmTable/virTual/VirtualWrapper.js +61 -0
  42. package/es/LmTable/virTual/context.d.ts +13 -0
  43. package/es/LmTable/virTual/context.js +54 -0
  44. package/es/LmTable/virTual/index.d.ts +4 -0
  45. package/es/LmTable/virTual/index.js +4 -0
  46. package/es/TestTable/LmBox.d.ts +12 -0
  47. package/es/TestTable/LmBox.js +6 -0
  48. package/es/TestTable/index.d.ts +2 -0
  49. package/es/TestTable/index.js +2 -0
  50. package/es/TestTable/style/index.css +10 -0
  51. package/es/TestTable/style/index.js +3 -0
  52. package/es/hooks/useFullscreen/index.js +23 -2
  53. package/lib/Form/style/form.css +603 -0
  54. package/lib/Form/style/grid.css +5185 -0
  55. package/lib/Form/style/index.css +6 -1
  56. package/lib/Form/style/index.d.ts +0 -3
  57. package/lib/Form/style/index.js +0 -6
  58. package/lib/Form/style/tooltip.css +275 -0
  59. package/lib/LmEditTable/EditTable.d.ts +6 -0
  60. package/lib/LmEditTable/EditTable.js +64 -80
  61. package/lib/LmEditTable/sortableItemCol.js +6 -3
  62. package/lib/LmEditTable/style/index.css +7 -0
  63. package/lib/LmEditTable/util.d.ts +1 -0
  64. package/lib/LmEditTable/util.js +12 -0
  65. package/lib/LmTable/Table.js +308 -173
  66. package/lib/LmTable/components/customRenderEmpty.d.ts +2 -0
  67. package/lib/LmTable/components/customRenderEmpty.js +25 -0
  68. package/lib/LmTable/components/sheelTableCell.js +14 -8
  69. package/lib/LmTable/style/index.css +177 -152
  70. package/lib/LmTable/util.js +105 -0
  71. package/lib/LmTable/virTual/VirtualRow.d.ts +6 -0
  72. package/lib/LmTable/virTual/VirtualRow.js +115 -0
  73. package/lib/LmTable/virTual/VirtualTable.d.ts +3 -0
  74. package/lib/LmTable/virTual/VirtualTable.js +69 -0
  75. package/lib/LmTable/virTual/VirtualWrapper.d.ts +3 -0
  76. package/lib/LmTable/virTual/VirtualWrapper.js +74 -0
  77. package/lib/LmTable/virTual/context.d.ts +13 -0
  78. package/lib/LmTable/virTual/context.js +64 -0
  79. package/lib/LmTable/virTual/index.d.ts +4 -0
  80. package/lib/LmTable/virTual/index.js +31 -0
  81. package/lib/TestTable/LmBox.d.ts +12 -0
  82. package/lib/TestTable/LmBox.js +17 -0
  83. package/lib/TestTable/index.d.ts +2 -0
  84. package/lib/TestTable/index.js +13 -0
  85. package/lib/TestTable/style/index.css +10 -0
  86. package/lib/TestTable/style/index.js +3 -0
  87. package/lib/hooks/useFullscreen/index.js +23 -2
  88. package/package.json +1 -1
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.checkIsSelectd = checkIsSelectd;
9
+ exports.checkStatus = checkStatus;
10
+ exports.transformWithColGroup = transformWithColGroup;
11
+
12
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
13
+
14
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
15
+
16
+ /**
17
+ * 列分组数据转换
18
+ * @param columns 表格的columns属性值
19
+ * @param dataSource 表格数据源
20
+ * @param columnKeys 列分组的keys
21
+ * @returns
22
+ */
23
+ function transformWithColGroup(columns, dataSource, columnKeys) {
24
+ if (!Array.isArray(columnKeys) || !columnKeys.length) {
25
+ return {
26
+ columns: columns,
27
+ dataSource: dataSource
28
+ };
29
+ } // 去重
30
+
31
+
32
+ columnKeys = (0, _toConsumableArray2.default)(new Set(columnKeys));
33
+
34
+ var groupBy = function groupBy(lastFilter, columns, oGroup, markStr) {
35
+ if (!(oGroup === null || oGroup === void 0 ? void 0 : oGroup.length)) {
36
+ return columns.filter(function (c) {
37
+ return columnKeys.indexOf(c.dataIndex) === -1;
38
+ }).map(function (item) {
39
+ return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, item), {}, {
40
+ dataIndex: "".concat(markStr, "_").concat(item.dataIndex)
41
+ });
42
+ });
43
+ }
44
+
45
+ var group = oGroup.slice();
46
+ var filterKey = group.shift();
47
+ var map = lastFilter.reduce(function (acc, el) {
48
+ var value = el[filterKey];
49
+ acc[value] = [].concat((0, _toConsumableArray2.default)(acc[value] || []), [el]);
50
+ return acc;
51
+ }, {});
52
+ return Object.keys(map).map(function (item) {
53
+ return {
54
+ type: filterKey,
55
+ title: item,
56
+ key: "".concat(item, "_").concat(filterKey),
57
+ children: groupBy(map[item], columns, group, "".concat(markStr ? markStr + '_' : '').concat(filterKey, "_").concat(item))
58
+ };
59
+ });
60
+ };
61
+
62
+ var _columns = groupBy(dataSource, columns, columnKeys, null);
63
+
64
+ var _dataSource = [dataSource.reduce(function (prev, cur) {
65
+ var str = '';
66
+ columnKeys.forEach(function (dataIndex, i) {
67
+ if (i !== 0) {
68
+ str += '_';
69
+ }
70
+
71
+ str += "".concat(dataIndex, "_").concat(cur[dataIndex]);
72
+ });
73
+ Object.keys(cur).forEach(function (key) {
74
+ cur["".concat(str, "_").concat(key)] = cur[key];
75
+ });
76
+ return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, prev), cur);
77
+ }, {})];
78
+ return {
79
+ columns: _columns,
80
+ dataSource: _dataSource
81
+ };
82
+ }
83
+
84
+ function checkIsSelectd(i, j) {
85
+ var start = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
86
+ var end = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
87
+ var posX = j >= start.j && j <= end.j;
88
+ var negX = j <= start.j && j >= end.j;
89
+ var posY = i >= start.i && i <= end.i;
90
+ var negY = i <= start.i && i >= end.i;
91
+ return posX && posY || negX && posY || negX && negY || posX && negY;
92
+ }
93
+
94
+ function checkStatus(i, j, commiting) {
95
+ var start = commiting.start,
96
+ end = commiting.end;
97
+ var maxi = Math.max(start === null || start === void 0 ? void 0 : start.i, end.i);
98
+ var mini = Math.min(start === null || start === void 0 ? void 0 : start.i, end.i);
99
+ var maxj = Math.max(start === null || start === void 0 ? void 0 : start.j, end.j);
100
+ var minj = Math.min(start === null || start === void 0 ? void 0 : start.j, end.j);
101
+ return {
102
+ /** 是否有效拉伸 */
103
+ isVaildCommit: mini <= i && maxi >= i || minj <= j && maxj >= j
104
+ };
105
+ }
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface rowProps {
3
+ children: any;
4
+ }
5
+ declare const VirtualRow: React.NamedExoticComponent<rowProps>;
6
+ export default VirtualRow;
@@ -0,0 +1,102 @@
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
+ var VirtualRow = /*#__PURE__*/React.memo(function (_a, ref) {
17
+ var children = _a.children,
18
+ resetProps = __rest(_a, ["children"]);
19
+
20
+ var _useStore = useStore(),
21
+ state = _useStore.state,
22
+ dispatch = _useStore.dispatch,
23
+ instance = _useStore.instance;
24
+
25
+ var rowHeight = state.rowHeight,
26
+ totalLen = state.totalLen;
27
+ var virtualItems = instance.columnVirtual.virtualItems;
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(Object.prototype.hasOwnProperty.call(ref, 'current') ? ref : trRef);
57
+ }, [trRef, dispatch, rowHeight, totalLen, ref]); // return {fixedLeft: [], fixedRight: [], columns: []}
58
+
59
+ var fixedColumns = useMemo(function () {
60
+ return children === null || children === void 0 ? void 0 : children.reduce(function (pre, cur) {
61
+ var _a, _b;
62
+
63
+ if (typeof ((_a = cur.props) === null || _a === void 0 ? void 0 : _a.fixLeft) === 'number') {
64
+ pre.fixedLeft.push(cur);
65
+ return pre;
66
+ }
67
+
68
+ if (typeof ((_b = cur.props) === null || _b === void 0 ? void 0 : _b.fixRight) === 'number') {
69
+ pre.fixedRight.push(cur);
70
+ return pre;
71
+ }
72
+
73
+ pre.columns.push(cur);
74
+ return pre;
75
+ }, {
76
+ fixedLeft: [],
77
+ fixedRight: [],
78
+ columns: []
79
+ });
80
+ }, [children]); // 截取非固定列
81
+
82
+ var resetVirtualItems = useMemo(function () {
83
+ var fixedLeft = fixedColumns.fixedLeft,
84
+ columns = fixedColumns.columns;
85
+ return virtualItems.slice(fixedLeft.length, fixedLeft.length + columns.length);
86
+ }, [fixedColumns, virtualItems]); // 横线单元格合并
87
+
88
+ var colSpan = useMemo(function () {
89
+ var _a;
90
+
91
+ var startIndex = ((_a = resetVirtualItems === null || resetVirtualItems === void 0 ? void 0 : resetVirtualItems[0]) === null || _a === void 0 ? void 0 : _a.index) || 0;
92
+ return startIndex ? startIndex - fixedColumns.fixedLeft.length : startIndex;
93
+ }, [fixedColumns, resetVirtualItems]);
94
+ return /*#__PURE__*/React.createElement("tr", Object.assign({}, resetProps, {
95
+ ref: Object.prototype.hasOwnProperty.call(ref, 'current') ? ref : trRef
96
+ }), fixedColumns.fixedLeft, !!colSpan && /*#__PURE__*/React.createElement("td", {
97
+ colSpan: colSpan
98
+ }), resetVirtualItems.map(function (virtualCol) {
99
+ return children[virtualCol.index];
100
+ }), fixedColumns.fixedRight);
101
+ });
102
+ export default VirtualRow;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const VirtualTable: React.NamedExoticComponent<object>;
3
+ export default VirtualTable;
@@ -0,0 +1,52 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ import React, { useRef } from 'react';
3
+ import { useVirtual } from 'react-virtual';
4
+ import { TableContext, useRealive } from './context';
5
+ var VirtualTable = /*#__PURE__*/React.memo(function (tableProps) {
6
+ var _a, _b;
7
+
8
+ var bodyRef = useRef(null);
9
+
10
+ var _useRealive = useRealive(),
11
+ _useRealive2 = _slicedToArray(_useRealive, 2),
12
+ state = _useRealive2[0],
13
+ dispatch = _useRealive2[1]; // { totalSize, virtualItems }
14
+
15
+
16
+ var rowVirtual = useVirtual({
17
+ size: state.totalLen,
18
+ // 绑定父节点
19
+ parentRef: {
20
+ current: (_a = bodyRef === null || bodyRef === void 0 ? void 0 : bodyRef.current) === null || _a === void 0 ? void 0 : _a.parentNode
21
+ },
22
+ estimateSize: React.useCallback(function () {
23
+ return state.rowHeight;
24
+ }, [state.rowHeight]),
25
+ overscan: 5
26
+ });
27
+ var columnVirtual = useVirtual({
28
+ horizontal: true,
29
+ size: state.columnsLen,
30
+ parentRef: {
31
+ current: (_b = bodyRef === null || bodyRef === void 0 ? void 0 : bodyRef.current) === null || _b === void 0 ? void 0 : _b.parentNode
32
+ },
33
+ estimateSize: React.useCallback(function () {
34
+ return 200;
35
+ }, [200]),
36
+ overscan: 5
37
+ });
38
+ var instance = {
39
+ rowVirtual: rowVirtual,
40
+ columnVirtual: columnVirtual
41
+ };
42
+ return /*#__PURE__*/React.createElement(TableContext.Provider, {
43
+ value: {
44
+ state: state,
45
+ dispatch: dispatch,
46
+ instance: instance
47
+ }
48
+ }, /*#__PURE__*/React.createElement("table", Object.assign({
49
+ ref: bodyRef
50
+ }, tableProps)));
51
+ });
52
+ export default VirtualTable;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const VirtualWrapper: React.NamedExoticComponent<object>;
3
+ export default VirtualWrapper;
@@ -0,0 +1,61 @@
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, { useEffect, useMemo } from 'react';
15
+ import { useStore } from './context';
16
+ var VirtualWrapper = /*#__PURE__*/React.memo(function (wrapperProps) {
17
+ var _a, _b;
18
+
19
+ var _c = wrapperProps,
20
+ children = _c.children,
21
+ resetProps = __rest(_c, ["children"]);
22
+
23
+ var _useStore = useStore(),
24
+ state = _useStore.state,
25
+ dispatch = _useStore.dispatch,
26
+ instance = _useStore.instance;
27
+
28
+ var _instance$rowVirtual = instance.rowVirtual,
29
+ virtualItems = _instance$rowVirtual.virtualItems,
30
+ totalSize = _instance$rowVirtual.totalSize;
31
+ var contents = useMemo(function () {
32
+ return children[1];
33
+ }, [children]);
34
+ var contentsLen = useMemo(function () {
35
+ var _a;
36
+
37
+ return (_a = contents === null || contents === void 0 ? void 0 : contents.length) !== null && _a !== void 0 ? _a : 0;
38
+ }, [contents]);
39
+ useEffect(function () {
40
+ if (state.totalLen !== contentsLen) {
41
+ dispatch({
42
+ type: 'changeTotalLen',
43
+ totalLen: contentsLen !== null && contentsLen !== void 0 ? contentsLen : 0
44
+ });
45
+ }
46
+ }, [contentsLen, dispatch, state.totalLen]);
47
+ 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;
48
+ 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;
49
+ return /*#__PURE__*/React.createElement("tbody", Object.assign({}, resetProps), paddingTop > 0 && /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
50
+ style: {
51
+ height: "".concat(paddingTop, "px")
52
+ }
53
+ })), children[0], virtualItems.map(function (virtualRow) {
54
+ return contents[virtualRow.index];
55
+ }), paddingBottom > 0 && /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
56
+ style: {
57
+ height: "".concat(paddingBottom, "px")
58
+ }
59
+ })));
60
+ });
61
+ export default VirtualWrapper;
@@ -0,0 +1,13 @@
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 };
@@ -0,0 +1,54 @@
1
+ import { createContext, useContext, useReducer } from 'react'; // =============== context ============== //
2
+
3
+ var TableContext = /*#__PURE__*/createContext({
4
+ state: null,
5
+ dispatch: null,
6
+ instance: {}
7
+ });
8
+
9
+ var useStore = function useStore() {
10
+ return useContext(TableContext);
11
+ };
12
+
13
+ var initialState = {
14
+ // 行高度
15
+ rowHeight: 0,
16
+ columnsLen: 0,
17
+ // 总行数
18
+ totalLen: 0
19
+ };
20
+
21
+ var reducer = function reducer(state, action) {
22
+ var totalLen = action.totalLen,
23
+ columnsLen = action.columnsLen,
24
+ rowHeight = action.rowHeight;
25
+
26
+ switch (action.type) {
27
+ // 数据数量
28
+ case 'changeTotalLen':
29
+ return Object.assign(Object.assign({}, state), {
30
+ totalLen: totalLen
31
+ });
32
+ // 列数量
33
+
34
+ case 'changeColumnsLen':
35
+ return Object.assign(Object.assign({}, state), {
36
+ columnsLen: columnsLen
37
+ });
38
+ // 初始化行高度
39
+
40
+ case 'initHeight':
41
+ return Object.assign(Object.assign({}, state), {
42
+ rowHeight: rowHeight
43
+ });
44
+
45
+ default:
46
+ throw new Error();
47
+ }
48
+ };
49
+
50
+ var useRealive = function useRealive() {
51
+ return useReducer(reducer, initialState);
52
+ };
53
+
54
+ export { TableContext, useStore, useRealive };
@@ -0,0 +1,4 @@
1
+ import VirtualTable from './VirtualTable';
2
+ import VirtualWrapper from './VirtualWrapper';
3
+ import VirtualRow from './VirtualRow';
4
+ export { VirtualTable, VirtualWrapper, VirtualRow };
@@ -0,0 +1,4 @@
1
+ import VirtualTable from './VirtualTable';
2
+ import VirtualWrapper from './VirtualWrapper';
3
+ import VirtualRow from './VirtualRow';
4
+ export { VirtualTable, VirtualWrapper, VirtualRow };
@@ -0,0 +1,12 @@
1
+ import React, { ReactNode } from 'react';
2
+ export interface BoxProps {
3
+ ref?: any;
4
+ size?: string;
5
+ items?: any;
6
+ itemRender?: ({ cell, instance }: {
7
+ cell: any;
8
+ instance: any;
9
+ }) => ReactNode;
10
+ }
11
+ declare const LmBox: React.FC<BoxProps>;
12
+ export default LmBox;
@@ -0,0 +1,6 @@
1
+ import React, { useRef, forwardRef } from 'react';
2
+ var LmBox = /*#__PURE__*/forwardRef(function (props, ref) {
3
+ useRef(null);
4
+ return /*#__PURE__*/React.createElement("div", null, "333");
5
+ });
6
+ export default LmBox;
@@ -0,0 +1,2 @@
1
+ import TestTabel from './LmBox';
2
+ export default TestTabel;
@@ -0,0 +1,2 @@
1
+ import TestTabel from './LmBox';
2
+ export default TestTabel;
@@ -0,0 +1,10 @@
1
+ .lm_box_list .lm_box_menu {
2
+ display: flex;
3
+ flex-flow: wrap;
4
+ align-items: center;
5
+ }
6
+ .lm_box_list .lm_box_menu .lm_box_menu_item {
7
+ display: inline-flex;
8
+ align-items: center;
9
+ padding: 0 var(--gap);
10
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+
3
+ require("./index.css");
@@ -28,7 +28,7 @@ var getTargetElement = function getTargetElement(target, defaultElement) {
28
28
  return targetElement;
29
29
  };
30
30
 
31
- var fullScreenCssText = 'position: fixed;width: 100%;height:100%;top:0;left:0;z-index:1009;background-color: #fff;';
31
+ var fullScreenCssText = 'position: fixed;width: 100%;height:100%;top:0;left:0;z-index:1100;background-color: #fff;padding: 16px;';
32
32
 
33
33
  var useFullscreen = function useFullscreen(target, options) {
34
34
  var _ref = options || {},
@@ -42,8 +42,11 @@ var useFullscreen = function useFullscreen(target, options) {
42
42
 
43
43
  var originCssTextRef = useRef('');
44
44
  var eleRef = useRef(null);
45
+ var cloneEleRef = useRef(null);
45
46
 
46
47
  var enterFullscreen = function enterFullscreen() {
48
+ var _a;
49
+
47
50
  onEnter === null || onEnter === void 0 ? void 0 : onEnter();
48
51
  setIsFullscreen(true);
49
52
  var el = getTargetElement(target);
@@ -54,15 +57,32 @@ var useFullscreen = function useFullscreen(target, options) {
54
57
  originCssTextRef.current = originCssText;
55
58
  }
56
59
 
57
- eleRef.current.style.cssText = "".concat(originCssTextRef.current).concat(fullScreenCssText); // message.info({content: '使用 Esc 键可退出全屏模式', key: 'tip'})
60
+ eleRef.current.style.cssText = "".concat(originCssTextRef.current).concat(fullScreenCssText);
61
+
62
+ try {
63
+ cloneEleRef.current = (_a = eleRef.current) === null || _a === void 0 ? void 0 : _a.cloneNode(true);
64
+ document.body.appendChild(cloneEleRef.current);
65
+ eleRef.current.style.cssText = "".concat(originCssTextRef.current).concat(fullScreenCssText, "display: none;");
66
+ } catch (_b) {
67
+ console.log('fullScreen error');
68
+ } // message.info({content: '使用 Esc 键可退出全屏模式', key: 'tip'})
69
+
58
70
  };
59
71
 
60
72
  var exitFullscreen = function exitFullscreen() {
73
+ var _a, _b;
74
+
61
75
  onExit === null || onExit === void 0 ? void 0 : onExit();
62
76
  setIsFullscreen(false);
63
77
 
64
78
  if (eleRef.current) {
65
79
  eleRef.current.style.cssText = "".concat(originCssTextRef.current);
80
+
81
+ try {
82
+ (_b = (_a = document.body).removeChild) === null || _b === void 0 ? void 0 : _b.call(_a, cloneEleRef.current);
83
+ } catch (_c) {
84
+ console.log('fullScreen error');
85
+ }
66
86
  }
67
87
  };
68
88
 
@@ -77,6 +97,7 @@ var useFullscreen = function useFullscreen(target, options) {
77
97
  useEffect(function () {
78
98
  var fn = function fn(event) {
79
99
  if (event.keyCode === 27) {
100
+ console.log(1);
80
101
  exitFullscreen();
81
102
  }
82
103
  };