@gm-pc/keyboard 1.24.0-beta.7 → 1.24.0-beta.9
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/package.json +4 -4
- package/src/core/wrap.tsx +2 -2
- package/src/hoc/keyboard_table_x.tsx +2 -2
- package/src/types.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gm-pc/keyboard",
|
|
3
|
-
"version": "1.24.0-beta.
|
|
3
|
+
"version": "1.24.0-beta.9",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "liyatang <liyatang@qq.com>",
|
|
6
6
|
"homepage": "https://github.com/gmfe/gm-pc#readme",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@gm-common/tool": "^2.10.0",
|
|
30
|
-
"@gm-pc/react": "^1.24.0-beta.
|
|
31
|
-
"@gm-pc/table-x": "^1.24.0-beta.
|
|
30
|
+
"@gm-pc/react": "^1.24.0-beta.9",
|
|
31
|
+
"@gm-pc/table-x": "^1.24.0-beta.9",
|
|
32
32
|
"classnames": "^2.2.5",
|
|
33
33
|
"lodash": "^4.17.19"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "4ff742ca6a0db4ea9406b41f1f0c52bae7df985f"
|
|
36
36
|
}
|
package/src/core/wrap.tsx
CHANGED
|
@@ -23,7 +23,7 @@ const Wrap: FC<WrapProps> = ({
|
|
|
23
23
|
id,
|
|
24
24
|
children,
|
|
25
25
|
onAddRow,
|
|
26
|
-
|
|
26
|
+
allowAddRowOnDownKey,
|
|
27
27
|
columnKeys,
|
|
28
28
|
dataLength,
|
|
29
29
|
fixedWidths,
|
|
@@ -88,7 +88,7 @@ const Wrap: FC<WrapProps> = ({
|
|
|
88
88
|
}
|
|
89
89
|
// 最后一行
|
|
90
90
|
else if (rowKey === dataLength - 1) {
|
|
91
|
-
if (
|
|
91
|
+
if (allowAddRowOnDownKey) {
|
|
92
92
|
onAddRow()
|
|
93
93
|
}
|
|
94
94
|
timer.current = window.setTimeout(() => {
|
|
@@ -21,7 +21,7 @@ function keyboardTableXHOC<Props extends TableXProps = TableXProps>(
|
|
|
21
21
|
id,
|
|
22
22
|
onAddRow,
|
|
23
23
|
onBeforeDispatch,
|
|
24
|
-
|
|
24
|
+
allowAddRowOnDownKey = false,
|
|
25
25
|
...tableProps
|
|
26
26
|
}) => {
|
|
27
27
|
const { data, columns } = tableProps
|
|
@@ -107,7 +107,7 @@ function keyboardTableXHOC<Props extends TableXProps = TableXProps>(
|
|
|
107
107
|
fixedWidths={{ leftFixedWidth, rightFixedWidth }}
|
|
108
108
|
dataLength={data.length}
|
|
109
109
|
onAddRow={onAddRow}
|
|
110
|
-
|
|
110
|
+
allowAddRowOnDownKey={allowAddRowOnDownKey}
|
|
111
111
|
onBeforeDispatch={onBeforeDispatch}
|
|
112
112
|
>
|
|
113
113
|
<Table {...(tableProps as Props)} id={id} columns={newColumns} />
|
package/src/types.ts
CHANGED
|
@@ -9,7 +9,7 @@ interface KeyboardTableXProps {
|
|
|
9
9
|
id: string
|
|
10
10
|
columns: KeyboardTableXColumn[]
|
|
11
11
|
/** 按下键是否允许增加一行数据 */
|
|
12
|
-
|
|
12
|
+
allowAddRowOnDownKey?: boolean
|
|
13
13
|
/* 增加一行数据 */
|
|
14
14
|
onAddRow(): void
|
|
15
15
|
onBeforeDispatch?(options: {
|
|
@@ -58,7 +58,7 @@ interface WrapProps {
|
|
|
58
58
|
}): boolean
|
|
59
59
|
|
|
60
60
|
/** 按下键是否允许增加一行数据 */
|
|
61
|
-
|
|
61
|
+
allowAddRowOnDownKey?: boolean
|
|
62
62
|
|
|
63
63
|
/** Wrap 需要知道字段集合,以便能找到相应的单元格,请确保表格的顺序一致 */
|
|
64
64
|
columnKeys: string[]
|