ywana-core8 0.0.539 → 0.0.540

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.539",
3
+ "version": "0.0.540",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -8,7 +8,7 @@ import './tokenfield.css'
8
8
  * Token Field
9
9
  */
10
10
  export const TokenField = ({ id, label, tokens = [], readOnly, options, onChange }) => {
11
-
11
+
12
12
  const [value, setValue] = useState()
13
13
 
14
14
  function remove(index) {
@@ -49,7 +49,17 @@ export const TokenField = ({ id, label, tokens = [], readOnly, options, onChange
49
49
  return (
50
50
  <div className='tokenField'>
51
51
  <label>{label}</label>
52
- {tks.map((text, index) => <Token text={text} onDelete={() => remove(index)} />)}
52
+
53
+ {tks.map((text, index) => {
54
+ let text2 = text
55
+ if (options) {
56
+ const lbl = options.find(opt => opt.value == text)
57
+ if (lbl) text2 = lbl.label
58
+ console.log(text, lbl, text2, options)
59
+ }
60
+ return <Token text={text2} onDelete={() => remove(index)} />
61
+ })}
62
+
53
63
  {options ? (
54
64
  <DropDown onChange={changeDropDown} options={options} predictive={true} verbose={false} />
55
65
  ) : (