ywana-core8 0.0.418 → 0.0.421

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.418",
3
+ "version": "0.0.421",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -236,7 +236,6 @@ export const StringEditor = ({ field, value = '', onChange, content, outlined })
236
236
  const { id, format, label, options, editable = true, predictive = false, multivalue = false, Editor } = field
237
237
 
238
238
  function change(id, value) {
239
- console.log(id,value)
240
239
  if (onChange) onChange(id, value)
241
240
  }
242
241
 
@@ -21,7 +21,6 @@ const schema = {
21
21
 
22
22
  const value = {
23
23
  name: "John Smith",
24
- field3 : ["1","2","4"]
25
24
  }
26
25
 
27
26
  const ContentEditorTest = (prop) => {
package/src/html/table.js CHANGED
@@ -146,10 +146,8 @@ const DataTableRow = (props) => {
146
146
  */
147
147
  const DataTableCell = ({ row, column, cell, editable }) => {
148
148
 
149
-
150
149
  const render = (type) => {
151
150
  const { id, disabled = false, min, max, onChange, format, options, item } = column
152
-
153
151
  if (id === "checked") {
154
152
  return <CheckBox id={id} value={cell} onChange={(id, value) => onChange(row.id, id, value)} />
155
153
  } else if (editable && onChange) {
@@ -10,6 +10,10 @@ const TableTest = (prop) => {
10
10
  ]
11
11
  )
12
12
 
13
+ function editCell(row, cell, value) {
14
+ console.log(row, cell, value)
15
+ }
16
+
13
17
  function select(row) {
14
18
  console.log('select',row)
15
19
  }
@@ -24,9 +28,10 @@ const TableTest = (prop) => {
24
28
  }
25
29
 
26
30
  const table = {
31
+ editable: true,
27
32
  columns : [
28
33
  { id: "checked", onChange: check },
29
- { id: "name", label: "Name" },
34
+ { id: "name", label: "Name", type: "String", onChange: editCell},
30
35
  { id: "thumb", label: "Thumb", type: "String", format: "IMG" },
31
36
 
32
37
  ],
@@ -10,7 +10,6 @@ import './tokenfield.css'
10
10
  export const TokenField = ({ id, label, tokens = [], readOnly, options, onChange }) => {
11
11
 
12
12
  const [value, setValue] = useState()
13
- const [open, setOpen] = useState(false)
14
13
 
15
14
  function remove(index) {
16
15
  const next = tokens.slice()
@@ -24,7 +23,7 @@ export const TokenField = ({ id, label, tokens = [], readOnly, options, onChange
24
23
  }
25
24
 
26
25
  function changeDropDown(fid, value) {
27
- const next = tokens.concat(value)
26
+ const next = Array.isArray(tokens) ? tokens.concat(value) : [value]
28
27
  if (onChange) onChange(id, next)
29
28
  setValue('')
30
29
  }
@@ -45,10 +44,12 @@ export const TokenField = ({ id, label, tokens = [], readOnly, options, onChange
45
44
  }
46
45
  }
47
46
 
47
+ const tks = Array.isArray(tokens) ? tokens : []
48
+
48
49
  return (
49
50
  <div className='tokenField'>
50
51
  <label>{label}</label>
51
- {tokens.map((text, index) => <Token text={text} onDelete={() => remove(index)} />)}
52
+ {tks.map((text, index) => <Token text={text} onDelete={() => remove(index)} />)}
52
53
  {options ? (
53
54
  <DropDown onChange={changeDropDown} options={options} predictive={true} verbose={false} />
54
55
  ) : (
@@ -6,7 +6,7 @@ import { SiteContext, Dialog } from '../../site';
6
6
  /**
7
7
  * Upload Dialog
8
8
  */
9
- export const UploadDialog = ({ label, target, accept, onSuccess, onComplete, onClose }) => {
9
+ export const UploadDialog = ({ label, target, accept, onSuccess, onComplete, onClose, children }) => {
10
10
 
11
11
  const site = useContext(SiteContext);
12
12
 
@@ -35,6 +35,7 @@ export const UploadDialog = ({ label, target, accept, onSuccess, onComplete, onC
35
35
  return (
36
36
  <Dialog title={title} open={true} onAction={onAction} actions={actions}>
37
37
  <Uploader label={label} accept={accept} target={target} onSuccess={success} onComplete={complete} />
38
+ {children}
38
39
  </Dialog>
39
40
  )
40
41
  }