ywana-core8 0.0.55 → 0.0.59
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/dist/index.cjs +14 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +14 -2
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +14 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/TablePage.js +8 -2
- package/src/html/icon.js +1 -1
package/package.json
CHANGED
package/src/domain/TablePage.js
CHANGED
@@ -203,6 +203,13 @@ const TableEditor = (props) => {
|
|
203
203
|
setPageContext(Object.assign({}, pageContext))
|
204
204
|
}
|
205
205
|
|
206
|
+
function run(action) {
|
207
|
+
action.action(item.id, pageContext, async () => {
|
208
|
+
await pageContext.load()
|
209
|
+
setPageContext(Object.assign({}, pageContext))
|
210
|
+
})
|
211
|
+
}
|
212
|
+
|
206
213
|
function renderGroups() {
|
207
214
|
|
208
215
|
const items = filter ? filter(all) : all
|
@@ -215,7 +222,6 @@ const TableEditor = (props) => {
|
|
215
222
|
return groups
|
216
223
|
}, {})
|
217
224
|
|
218
|
-
|
219
225
|
return Object.keys(groups).map(groupName => {
|
220
226
|
|
221
227
|
const table = {
|
@@ -236,7 +242,7 @@ const TableEditor = (props) => {
|
|
236
242
|
}),
|
237
243
|
rows: groups[groupName]
|
238
244
|
.map(item => {
|
239
|
-
item.actions = actions ? actions.map(action => <Icon icon={action.icon} clickable size="small" action={() =>
|
245
|
+
item.actions = actions ? actions.map(action => <Icon icon={action.icon} clickable size="small" action={() => run(action) }/>) : []
|
240
246
|
item.actions.push(<Icon icon="delete" size="small" clickable action={() => remove(item.id)} />)
|
241
247
|
return item
|
242
248
|
})
|
package/src/html/icon.js
CHANGED
@@ -9,7 +9,7 @@ export const Icon = ({ icon, size = "normal", clickable = false, action }) => {
|
|
9
9
|
function click (event) {
|
10
10
|
event.stopPropagation()
|
11
11
|
event.preventDefault();
|
12
|
-
if (action) action()
|
12
|
+
if (action) action(event)
|
13
13
|
}
|
14
14
|
|
15
15
|
const clicker = clickable ? "clickable" : ""
|