ywana-core8 0.0.973 → 0.0.975

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.973",
3
+ "version": "0.0.975",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -47,6 +47,11 @@ 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) => {
51
+ if (!a.label || !b.label) return 0
52
+ a.label.localeCompare(b.label)
53
+ }) : null
54
+
50
55
  return (
51
56
  <div className='tokenField'>
52
57
  <label>{label}</label>
@@ -61,7 +66,7 @@ export const TokenField = ({ id, label, tokens = [], readOnly, options, onChange
61
66
  })}
62
67
 
63
68
  {options ? (
64
- <DropDown onChange={changeDropDown} options={options} predictive={true} verbose={false} />
69
+ <DropDown onChange={changeDropDown} options={sortedOptions} predictive={true} verbose={false} />
65
70
  ) : (
66
71
  <input type='text' value={value} onChange={change} onKeyDown={onEnter} readOnly={readOnly} />)
67
72
  }
@@ -81,4 +86,4 @@ const Token = ({ text, onDelete }) => {
81
86
  <Icon icon='close' clickable action={onDelete} size="small" />
82
87
  </div>
83
88
  )
84
- }
89
+ }