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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ywana-core8",
3
- "version": "0.0.535",
3
+ "version": "0.0.536",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -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
- const items = all ? all.map(content => ({
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
- <List items={items} onSelect={select} groupBy={groupBy} />
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
 
@@ -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" levels={["color"]} canAdd={true} />
217
+ <CollectionPage title="Referencias" schema={schema} host="http://localhost:3000" url="/references" canAdd={true} />
218
218
  </Fragment>
219
219
  )
220
220
  }