ywana-core8 0.0.53 → 0.0.57
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 +17 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +4 -0
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +17 -3
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +17 -3
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/CollectionPage.css +4 -0
- package/src/domain/TablePage.js +7 -1
- package/src/html/button.js +1 -1
- package/src/html/icon.js +1 -1
package/package.json
CHANGED
package/src/domain/TablePage.js
CHANGED
@@ -203,6 +203,12 @@ const TableEditor = (props) => {
|
|
203
203
|
setPageContext(Object.assign({}, pageContext))
|
204
204
|
}
|
205
205
|
|
206
|
+
async function run(action) {
|
207
|
+
await action.action(item.id, pageContext)
|
208
|
+
await pageContext.load()
|
209
|
+
setPageContext(Object.assign({}, pageContext))
|
210
|
+
}
|
211
|
+
|
206
212
|
function renderGroups() {
|
207
213
|
|
208
214
|
const items = filter ? filter(all) : all
|
@@ -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/button.js
CHANGED
@@ -19,7 +19,7 @@ export const Button = ({ label, icon, action, disabled = false, outlined, raised
|
|
19
19
|
if (disabled) style = `${style} disabled`
|
20
20
|
return (
|
21
21
|
<button className={`btn ${style}`} onClick={click}>
|
22
|
-
{ icon ? <Icon icon={icon} size="small" /> : null }
|
22
|
+
{ icon ? <Icon icon={icon} size="small" clickable action={click} /> : null }
|
23
23
|
<span>{ label }</span>
|
24
24
|
</button>
|
25
25
|
)
|
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" : ""
|