ywana-core8 0.0.955 → 0.0.957

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ywana-core8",
3
- "version": "0.0.955",
3
+ "version": "0.0.957",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
package/src/html/table.js CHANGED
@@ -260,24 +260,23 @@ const DataTableCell = ({ index, row, column, cell, editable }) => {
260
260
  /**
261
261
  * Image Cell Viewer
262
262
  */
263
- const ImageCellViewer = ({ id, value, uploadURL, onUpload }) => {
264
-
265
- const canUpload = uploadURL ? true : false
263
+ const ImageCellViewer = ({ id, value, uploadURL, onChange }) => {
266
264
 
267
265
  function success(file, message) {
268
- if (onUpload) onUpload(id, file, message)
266
+ if (onChange) onChange(id, file, message)
269
267
  }
270
268
 
271
269
  function error(file, message) {
272
- if (onUpload) onUpload(id, file, message)
270
+ if (onChange) onChange(id, file, message)
273
271
  console.error(message)
274
272
  }
275
273
 
276
- return canUpload ? (
277
- <Uploader view="icon" icon="cloud_upload" target={uploadURL} onSuccess={success} onError={error} />
278
- ) : (
279
- <img src={value} />
280
- )
274
+ return (
275
+ <div className="image-cell">
276
+ <img src={value} />
277
+ { uploadURL ? <Uploader icon="cloud_upload" target={uploadURL} onSuccess={success} onError={error} /> : null }
278
+ </div>
279
+ )
281
280
  }
282
281
 
283
282
  /**