ywana-core8 0.0.107 → 0.0.111
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 +13 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +13 -9
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +13 -9
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/TablePage.js +10 -9
package/package.json
CHANGED
package/src/domain/TablePage.js
CHANGED
@@ -23,7 +23,7 @@ export const TablePage = (props) => {
|
|
23
23
|
editable, canFilter = false, canQuery = false, canAdd = true, canDelete = true,
|
24
24
|
autosave = true, delay = 1000,
|
25
25
|
groupBy, validator, scenario,
|
26
|
-
formFilter, tableFilter,
|
26
|
+
formFilter, tableFilter, editorFilter
|
27
27
|
} = props
|
28
28
|
|
29
29
|
const [pageContext, setPageContext] = useContext(PageContext)
|
@@ -97,7 +97,7 @@ export const TablePage = (props) => {
|
|
97
97
|
<Header icon="local_offer" title={selected.name || "Propiedades"}>
|
98
98
|
<Icon icon="close" clickable action={closeAside} />
|
99
99
|
</Header>
|
100
|
-
<ContentEditor content={content} onChange={change} />
|
100
|
+
<ContentEditor content={content} onChange={change} filter={editorFilter}/>
|
101
101
|
</aside>
|
102
102
|
)
|
103
103
|
}
|
@@ -224,13 +224,15 @@ const TableEditor = (props) => {
|
|
224
224
|
setPageContext(Object.assign({}, pageContext))
|
225
225
|
}
|
226
226
|
|
227
|
-
async function check(
|
228
|
-
console.log('check() ',id, value, t)
|
229
|
-
const ids = Array.isArray(id) ? id : [id]
|
227
|
+
async function check(ids, value) {
|
230
228
|
pageContext.check(ids, value)
|
231
229
|
setPageContext(Object.assign({}, pageContext))
|
232
230
|
}
|
233
231
|
|
232
|
+
async function checkOne(id, field, value) {
|
233
|
+
check([id], value)
|
234
|
+
}
|
235
|
+
|
234
236
|
function run(action, item) {
|
235
237
|
action.action(item.id, pageContext, async () => {
|
236
238
|
await pageContext.load()
|
@@ -264,13 +266,13 @@ const TableEditor = (props) => {
|
|
264
266
|
id: field.id,
|
265
267
|
label: field.label,
|
266
268
|
type: field.type,
|
267
|
-
onChange: field.id === "checked" ?
|
269
|
+
onChange: field.id === "checked" ? checkOne : field.editable ? change : null, /* checked has it´s own handler */
|
268
270
|
options
|
269
271
|
}
|
270
272
|
}),
|
271
273
|
rows: groups[groupName]
|
272
274
|
.map(item => {
|
273
|
-
item.checked = pageContext.checked.has(item.id)
|
275
|
+
item.checked = pageContext.checked ? pageContext.checked.has(item.id) : false
|
274
276
|
item.actions = actions ? actions.map(action => {
|
275
277
|
return action.filter ?
|
276
278
|
action.filter(item) ? <Icon icon={action.icon} clickable size="small" action={() => run(action, item)} /> : null
|
@@ -301,7 +303,6 @@ const TableEditor = (props) => {
|
|
301
303
|
.map(field => ({ label: field.label, value: field.id }))
|
302
304
|
}
|
303
305
|
|
304
|
-
console.log('table page checked', pageContext.checked)
|
305
306
|
return (
|
306
307
|
<Fragment>
|
307
308
|
<Header icon={icon} title={<Text>{title}</Text>}>
|
@@ -315,7 +316,7 @@ const TableEditor = (props) => {
|
|
315
316
|
}
|
316
317
|
|
317
318
|
/**
|
318
|
-
*
|
319
|
+
* Table Context
|
319
320
|
*/
|
320
321
|
const TableContext = (url, field) => {
|
321
322
|
|