ywana-core8 0.0.535 → 0.0.536
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 +30 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +30 -11
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +30 -11
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/CollectionPage.js +18 -3
- package/src/site/site.test.js +1 -1
package/package.json
CHANGED
@@ -136,6 +136,7 @@ const CollectionList = (props) => {
|
|
136
136
|
const { groupBy, onSelect } = props
|
137
137
|
const [pageContext, setPageContext] = useContext(PageContext)
|
138
138
|
const { all = [] } = pageContext
|
139
|
+
const [filter, setFilter] = useState()
|
139
140
|
|
140
141
|
function clear() {
|
141
142
|
pageContext.clear()
|
@@ -149,15 +150,29 @@ const CollectionList = (props) => {
|
|
149
150
|
if (onSelect) onSelect(id)
|
150
151
|
}
|
151
152
|
|
152
|
-
|
153
|
+
function search(id, value) {
|
154
|
+
setFilter(value)
|
155
|
+
}
|
156
|
+
|
157
|
+
const items = filter ? all.filter(item => item.name.toUpperCase().indexOf(filter.toUpperCase()) >= 0) : all
|
158
|
+
const items2 = items.map(content => ({
|
153
159
|
id: content.id,
|
154
160
|
line1: content.name || content.centre || content.tag, // centre: Signflow legacy
|
155
161
|
line2: content.description,
|
156
162
|
content
|
157
|
-
}))
|
163
|
+
}))
|
158
164
|
|
159
165
|
return (
|
160
|
-
|
166
|
+
<>
|
167
|
+
<main>
|
168
|
+
<List items={items2} onSelect={select} groupBy={groupBy} />
|
169
|
+
</main>
|
170
|
+
<footer>
|
171
|
+
<div className='search-box'>
|
172
|
+
<TextField icon="search" label="Search" onChange={search} outlined className="search-box" />
|
173
|
+
</div>
|
174
|
+
</footer>
|
175
|
+
</>
|
161
176
|
)
|
162
177
|
}
|
163
178
|
|
package/src/site/site.test.js
CHANGED
@@ -214,7 +214,7 @@ const Page5 = (props) => {
|
|
214
214
|
|
215
215
|
return (
|
216
216
|
<Fragment>
|
217
|
-
<CollectionPage title="Referencias" schema={schema} host="http://localhost:3000" url="/references"
|
217
|
+
<CollectionPage title="Referencias" schema={schema} host="http://localhost:3000" url="/references" canAdd={true} />
|
218
218
|
</Fragment>
|
219
219
|
)
|
220
220
|
}
|