ywana-core8 0.0.148 → 0.0.152
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 +27 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +27 -14
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +27 -14
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/TablePage.js +7 -3
- package/src/html/table.js +2 -2
package/package.json
CHANGED
package/src/domain/TablePage.js
CHANGED
@@ -242,6 +242,7 @@ const TableFilters = (props) => {
|
|
242
242
|
*/
|
243
243
|
const TableEditor = (props) => {
|
244
244
|
|
245
|
+
const site = useContext(SiteContext)
|
245
246
|
const [pageContext, setPageContext] = useContext(PageContext)
|
246
247
|
const { all = [], filters } = pageContext
|
247
248
|
const { icon, title, schema, editable, canDelete, filter, actions } = props
|
@@ -252,9 +253,12 @@ const TableEditor = (props) => {
|
|
252
253
|
}
|
253
254
|
|
254
255
|
async function remove(id) {
|
255
|
-
|
256
|
-
|
257
|
-
|
256
|
+
const confirm = site.confirm("Are you sure ?")
|
257
|
+
if (confirm) {
|
258
|
+
await pageContext.remove(id)
|
259
|
+
pageContext.clear()
|
260
|
+
setPageContext(Object.assign({}, pageContext))
|
261
|
+
}
|
258
262
|
}
|
259
263
|
|
260
264
|
function change(rowID, cellID, value) {
|
package/src/html/table.js
CHANGED
@@ -77,7 +77,7 @@ export const DataTable = (props) => {
|
|
77
77
|
const sort = sortDir[id] ? sortDir[id] : null
|
78
78
|
return (
|
79
79
|
<th>
|
80
|
-
{id === "checked" ? <CheckBox onChange={checkAll} /> : <Text>{label}</Text>}
|
80
|
+
{id === "checked" ? <CheckBox onChange={checkAll} /> : <Text key={`th_${id}`}>{label}</Text>}
|
81
81
|
{sortable ? <Icon icon="arrow_up" size="small" clickable /> : null}
|
82
82
|
</th>
|
83
83
|
)
|
@@ -110,7 +110,7 @@ const DataTableRow = (props) => {
|
|
110
110
|
return (
|
111
111
|
<Fragment>
|
112
112
|
<tr onClick={ev => onSelect(row, ev)}>
|
113
|
-
{columns.map(column => <DataTableCell row={row} column={column} cell={row[column.id]} editable={editable} />)}
|
113
|
+
{columns.map((column,index) => <DataTableCell key={`${column.id}_${index}`} row={row} column={column} cell={row[column.id]} editable={editable} />)}
|
114
114
|
{row.info ? <td><Icon icon={infoIcon} clickable action={() => toggleInfo(!isInfoOpen)} /></td> : <td></td>}
|
115
115
|
</tr>
|
116
116
|
{row.info && isInfoOpen ? (
|