@gmfe/table-x 2.13.0-beta.6 → 2.14.0
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gmfe/table-x",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.14.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "liyatang <liyatang@qq.com>",
|
|
6
6
|
"homepage": "https://github.com/gmfe/gmfe#readme",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@gm-common/tool": "^1.0.0",
|
|
30
|
-
"@gmfe/locales": "^2.
|
|
31
|
-
"@gmfe/react": "^2.
|
|
30
|
+
"@gmfe/locales": "^2.14.0",
|
|
31
|
+
"@gmfe/react": "^2.14.0",
|
|
32
32
|
"classnames": "^2.2.5",
|
|
33
33
|
"lodash": "^4.17.14",
|
|
34
34
|
"prop-types": "^15.7.2",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"react-window": "^1.8.5",
|
|
37
37
|
"sortablejs": "^1.10.1"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "265a37a2d09f4bf43412f667d8f6c8ec60c6e0de"
|
|
40
40
|
}
|
|
@@ -16,14 +16,14 @@ function sortableTableX(Component) {
|
|
|
16
16
|
onStart: () => {
|
|
17
17
|
target.classList.add('gm-table-x-sortable-active')
|
|
18
18
|
},
|
|
19
|
-
onEnd: (
|
|
19
|
+
onEnd: () => {
|
|
20
20
|
target.classList.remove('gm-table-x-sortable-active')
|
|
21
21
|
},
|
|
22
22
|
onUpdate: evt => {
|
|
23
23
|
const newIds = sortable.toArray()
|
|
24
|
-
const newData = _.sortBy(data.slice(), v =>
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
const newData = _.sortBy(data.slice(), v =>
|
|
25
|
+
newIds.indexOf(v[keyField])
|
|
26
|
+
)
|
|
27
27
|
onSortChange(newData)
|
|
28
28
|
}
|
|
29
29
|
})
|
|
@@ -165,7 +165,7 @@ const columns = [
|
|
|
165
165
|
accessor: 'index',
|
|
166
166
|
fixed: 'left',
|
|
167
167
|
width: TABLE_X.WIDTH_NO,
|
|
168
|
-
Cell: ({ row }) =>
|
|
168
|
+
Cell: ({ row }) => row.index + 1
|
|
169
169
|
},
|
|
170
170
|
// 常规用法
|
|
171
171
|
{
|
|
@@ -396,8 +396,7 @@ storiesOf('TableX|HOC', module)
|
|
|
396
396
|
keyField='id'
|
|
397
397
|
onSortChange={newData => {
|
|
398
398
|
console.log(newData.map(v => v.id))
|
|
399
|
-
|
|
400
|
-
// store.setData(newData)
|
|
399
|
+
store.setData(newData)
|
|
401
400
|
}}
|
|
402
401
|
/>
|
|
403
402
|
))
|