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/dist/index.cjs +11 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +11 -1
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +11 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/html/tokenfield.js +12 -2
package/package.json
CHANGED
package/src/html/tokenfield.js
CHANGED
@@ -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
|
-
|
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
|
) : (
|