ywana-core8 0.0.437 → 0.0.438

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.437",
3
+ "version": "0.0.438",
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
@@ -5,6 +5,7 @@ import { Icon } from './icon'
5
5
  import { Text } from './text'
6
6
  import './table.css'
7
7
  import { FORMATS, TYPES } from '../domain/ContentType'
8
+ import { ColorField } from './color'
8
9
 
9
10
  const isFunction = value => value && (Object.prototype.toString.call(value) === "[object Function]" || "function" === typeof value || value instanceof Function);
10
11
 
@@ -212,6 +213,8 @@ const StringCellViewer = ({ id, value, format, options }) => {
212
213
  let text = option ? option.label : value
213
214
  const locale = window.navigator.userLanguage || window.navigator.language;
214
215
  switch (format) {
216
+ case FORMATS.COLOR:
217
+ text = <input type="color" value={text} disabled/>
215
218
  case FORMATS.URL:
216
219
  text = <a href={text} target="download" download >{text}</a>
217
220
  break;
@@ -1,4 +1,5 @@
1
1
  import React, { useState } from 'react'
2
+ import { FORMATS } from '../domain/ContentType'
2
3
  import { DataTable } from './table'
3
4
 
4
5
  const TableTest = (prop) => {
@@ -6,7 +7,7 @@ const TableTest = (prop) => {
6
7
  const [rows, setRows] = useState(
7
8
  [
8
9
  { id: 1, checked: false, name: "John Smith", thumb: "https://w7.pngwing.com/pngs/881/826/png-transparent-pikachu-ash-ketchum-pokemon-vrste-pikachu-leaf-flower-meme-thumbnail.png"},
9
- { id: 2, checked: false, name: "Ann Martin" }
10
+ { id: 2, checked: false, name: "Ann Martin", color: "#CCFFFF" }
10
11
  ]
11
12
  )
12
13
 
@@ -32,8 +33,8 @@ const TableTest = (prop) => {
32
33
  columns : [
33
34
  { id: "checked", onChange: check },
34
35
  { id: "name", label: "Name", type: "String", onChange: editCell},
35
- { id: "thumb", label: "Thumb", type: "String", format: "IMG" },
36
-
36
+ { id: "thumb", label: "Thumb", type: "String", format: FORMATS.IMG },
37
+ { id: "color", label: "Color", type: "String", format: FORMATS.COLOR },
37
38
  ],
38
39
  rows
39
40
  }