ywana-core8 0.0.50 → 0.0.51
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 +18 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +18 -5
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +18 -5
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/TablePage.js +5 -4
package/package.json
CHANGED
package/src/domain/TablePage.js
CHANGED
@@ -16,7 +16,7 @@ const http = HTTPClient(window.API || process.env.REACT_APP_API, Session);
|
|
16
16
|
export const TablePage = (props) => {
|
17
17
|
|
18
18
|
const site = useContext(SiteContext)
|
19
|
-
const { id = "table", icon, title, name = "table 1", schema, url, field, delay = 1000, actions, editable, canAdd = true, dev = false, autosave = true, groupBy, validator, scenario, formFilter, tableFilter } = props
|
19
|
+
const { id = "table", icon, title, name = "table 1", schema, url, field, delay = 1000, actions, editable, canAdd = true, dev = false, autosave = true, groupBy, validator, scenario, formFilter, tableFilter, tableActions } = props
|
20
20
|
const [pageContext, setPageContext] = useContext(PageContext)
|
21
21
|
const { selected } = pageContext
|
22
22
|
const timer = useRef(null)
|
@@ -111,7 +111,7 @@ export const TablePage = (props) => {
|
|
111
111
|
<TableFilters schema={schema} />
|
112
112
|
</menu>
|
113
113
|
<main key={id} className="table-page">
|
114
|
-
<TableEditor icon={icon} title={name} schema={schema} delay={delay} editable={editable} groupBy={groupBy} filter={tableFilter} />
|
114
|
+
<TableEditor icon={icon} title={name} schema={schema} delay={delay} editable={editable} groupBy={groupBy} filter={tableFilter} actions={tableActions} />
|
115
115
|
</main>
|
116
116
|
{renderAside()}
|
117
117
|
</Fragment>
|
@@ -171,7 +171,7 @@ const TableEditor = (props) => {
|
|
171
171
|
|
172
172
|
const [pageContext, setPageContext] = useContext(PageContext)
|
173
173
|
const { all = [], filters } = pageContext
|
174
|
-
const { icon, title, schema, editable, filter } = props
|
174
|
+
const { icon, title, schema, editable, filter, actions } = props
|
175
175
|
const [groupBy, setGroupBy] = useState(props.groupBy)
|
176
176
|
|
177
177
|
function changeGroup(id, value) {
|
@@ -236,7 +236,8 @@ const TableEditor = (props) => {
|
|
236
236
|
}),
|
237
237
|
rows: groups[groupName]
|
238
238
|
.map(item => {
|
239
|
-
item.actions =
|
239
|
+
item.actions = actions ? actions.map(action => <Icon icon={action.icon} clickable size="small" action={() => { action.action(item.id) }}/>) : []
|
240
|
+
item.actions.push(<Icon icon="delete" size="small" clickable action={() => remove(item.id)} />)
|
240
241
|
return item
|
241
242
|
})
|
242
243
|
}
|