ywana-core8 0.0.972 → 0.0.974

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.972",
3
+ "version": "0.0.974",
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
@@ -415,7 +415,7 @@ const StringCellViewer = ({ id, value, format, options, action }) => {
415
415
  const locale = window.navigator.userLanguage || window.navigator.language;
416
416
  switch (format) {
417
417
  case FORMATS.TOKENS:
418
- text = value && Array.isArray(value) ? value.map(token => <span className="token">{token}</span>).join(", ") : value
418
+ text = value && Array.isArray(value) ? value.join(", ") : value
419
419
  break;
420
420
  case FORMATS.COLOR:
421
421
  text = <input type="color" value={text} disabled />
@@ -47,6 +47,8 @@ export const TokenField = ({ id, label, tokens = [], readOnly, options, onChange
47
47
  }
48
48
 
49
49
  const tks = Array.isArray(tokens) ? tokens : []
50
+ const sortedOptions = options ? options.sort((a, b) => a.label.localeCompare(b.label)) : null
51
+
50
52
  return (
51
53
  <div className='tokenField'>
52
54
  <label>{label}</label>
@@ -61,7 +63,7 @@ export const TokenField = ({ id, label, tokens = [], readOnly, options, onChange
61
63
  })}
62
64
 
63
65
  {options ? (
64
- <DropDown onChange={changeDropDown} options={options} predictive={true} verbose={false} />
66
+ <DropDown onChange={changeDropDown} options={sortedOptions} predictive={true} verbose={false} />
65
67
  ) : (
66
68
  <input type='text' value={value} onChange={change} onKeyDown={onEnter} readOnly={readOnly} />)
67
69
  }
@@ -81,4 +83,4 @@ const Token = ({ text, onDelete }) => {
81
83
  <Icon icon='close' clickable action={onDelete} size="small" />
82
84
  </div>
83
85
  )
84
- }
86
+ }