ywana-core8 0.0.106 → 0.0.110
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 +9 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +9 -8
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +9 -8
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/TablePage.js +8 -6
package/package.json
CHANGED
package/src/domain/TablePage.js
CHANGED
@@ -224,12 +224,15 @@ const TableEditor = (props) => {
|
|
224
224
|
setPageContext(Object.assign({}, pageContext))
|
225
225
|
}
|
226
226
|
|
227
|
-
async function check(
|
228
|
-
const ids = Array.isArray(id) ? id : [id]
|
227
|
+
async function check(ids, value) {
|
229
228
|
pageContext.check(ids, value)
|
230
229
|
setPageContext(Object.assign({}, pageContext))
|
231
230
|
}
|
232
231
|
|
232
|
+
async function checkOne(id, field, value) {
|
233
|
+
check([id], value)
|
234
|
+
}
|
235
|
+
|
233
236
|
function run(action, item) {
|
234
237
|
action.action(item.id, pageContext, async () => {
|
235
238
|
await pageContext.load()
|
@@ -263,13 +266,13 @@ const TableEditor = (props) => {
|
|
263
266
|
id: field.id,
|
264
267
|
label: field.label,
|
265
268
|
type: field.type,
|
266
|
-
onChange: field.id === "checked" ?
|
269
|
+
onChange: field.id === "checked" ? checkOne : field.editable ? change : null, /* checked has it´s own handler */
|
267
270
|
options
|
268
271
|
}
|
269
272
|
}),
|
270
273
|
rows: groups[groupName]
|
271
274
|
.map(item => {
|
272
|
-
item.checked = pageContext.checked.has(item.id)
|
275
|
+
item.checked = pageContext.checked ? pageContext.checked.has(item.id) : false
|
273
276
|
item.actions = actions ? actions.map(action => {
|
274
277
|
return action.filter ?
|
275
278
|
action.filter(item) ? <Icon icon={action.icon} clickable size="small" action={() => run(action, item)} /> : null
|
@@ -300,7 +303,6 @@ const TableEditor = (props) => {
|
|
300
303
|
.map(field => ({ label: field.label, value: field.id }))
|
301
304
|
}
|
302
305
|
|
303
|
-
console.log('table page checked', pageContext.checked)
|
304
306
|
return (
|
305
307
|
<Fragment>
|
306
308
|
<Header icon={icon} title={<Text>{title}</Text>}>
|
@@ -314,7 +316,7 @@ const TableEditor = (props) => {
|
|
314
316
|
}
|
315
317
|
|
316
318
|
/**
|
317
|
-
*
|
319
|
+
* Table Context
|
318
320
|
*/
|
319
321
|
const TableContext = (url, field) => {
|
320
322
|
|