ywana-core8 0.0.140 → 0.0.144
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 +7 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +7 -8
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +7 -8
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/html/table.js +2 -1
- package/src/html/textfield.js +3 -3
package/package.json
CHANGED
package/src/html/table.js
CHANGED
@@ -173,9 +173,10 @@ const BooleanCellViewer = ({ id, value = false }) => {
|
|
173
173
|
* String Cell Viewer
|
174
174
|
*/
|
175
175
|
const StringCellViewer = ({ id, value, options }) => {
|
176
|
+
console.log('string-cell-viewer', id, value, options)
|
176
177
|
const option = options ? options.find(o => o.value === value) : null
|
177
178
|
const text = option ? option.label : value
|
178
|
-
return (<div className="field-editor string-
|
179
|
+
return (<div className="field-editor string-viewer">{text}</div>)
|
179
180
|
}
|
180
181
|
|
181
182
|
/**
|
package/src/html/textfield.js
CHANGED
@@ -59,7 +59,6 @@ export const DropDown = (props) => {
|
|
59
59
|
const { id, options = [], value, onChange, canFilter = false } = props
|
60
60
|
const [open, setOpen] = useState(false)
|
61
61
|
const [label, setLabel] = useState()
|
62
|
-
const [filter, setFilter] = useState()
|
63
62
|
|
64
63
|
useEffect(() => {
|
65
64
|
if (Array.isArray(options)) {
|
@@ -71,7 +70,7 @@ export const DropDown = (props) => {
|
|
71
70
|
function change(id, value) {
|
72
71
|
console.log('dropdown change > canFilter:', canFilter, id, value)
|
73
72
|
if (canFilter) {
|
74
|
-
|
73
|
+
setLabel(value)
|
75
74
|
} else {
|
76
75
|
if (onChange) onChange(id, value)
|
77
76
|
}
|
@@ -100,7 +99,8 @@ export const DropDown = (props) => {
|
|
100
99
|
const canShow = open == true && Array.isArray(options)
|
101
100
|
if (canShow) {
|
102
101
|
const filterActive = canFilter && label && label.length > 0
|
103
|
-
const items = filterActive ? options.filter(option =>
|
102
|
+
const items = filterActive ? options.filter(option => option.label.toUpperCase().indexOf(label.toUpperCase()) >= 0) : options
|
103
|
+
console.log('filterActive: ',filterActive, label, items.length)
|
104
104
|
const lis = items.map(option => <li key={option.value} value={option.value}>{option.label}</li>)
|
105
105
|
return <menu><ul onClick={select}>{lis}</ul></menu>
|
106
106
|
} else {
|