ywana-core8 0.0.139 → 0.0.140
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 +23 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +23 -11
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +23 -11
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/html/textfield.js +12 -12
package/package.json
CHANGED
package/src/html/textfield.js
CHANGED
@@ -96,23 +96,23 @@ export const DropDown = (props) => {
|
|
96
96
|
setOpen(false)
|
97
97
|
}
|
98
98
|
|
99
|
-
|
100
|
-
options
|
101
|
-
|
102
|
-
|
103
|
-
:
|
99
|
+
function renderOptions() {
|
100
|
+
const canShow = open == true && Array.isArray(options)
|
101
|
+
if (canShow) {
|
102
|
+
const filterActive = canFilter && label && label.length > 0
|
103
|
+
const items = filterActive ? options.filter(option => canFilter === false || filter.toUpperCase().indexOf(option.label.toUpperCase()) >= 0) : options
|
104
|
+
const lis = items.map(option => <li key={option.value} value={option.value}>{option.label}</li>)
|
105
|
+
return <menu><ul onClick={select}>{lis}</ul></menu>
|
106
|
+
} else {
|
107
|
+
return null
|
108
|
+
}
|
109
|
+
}
|
104
110
|
|
105
111
|
return (
|
106
112
|
<div className="dropdown">
|
107
113
|
<TextField {...props} onClick={toggle} value={label} onChange={change} />
|
108
114
|
<Icon icon="expand_more" clickable size="small" action={toggle} />
|
109
|
-
{
|
110
|
-
<menu>
|
111
|
-
<ul onClick={select}>
|
112
|
-
{items}
|
113
|
-
</ul>
|
114
|
-
</menu>
|
115
|
-
) : null}
|
115
|
+
{renderOptions()}
|
116
116
|
</div>
|
117
117
|
)
|
118
118
|
}
|