ywana-core8 0.0.902 → 0.0.903

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.902",
3
+ "version": "0.0.903",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -6,9 +6,6 @@ import './ContentViewer.css'
6
6
 
7
7
  /**
8
8
  * Content Viewer
9
- *
10
- * @param {*} props
11
- * @returns
12
9
  */
13
10
  export const ContentViewer = (props) => {
14
11
 
@@ -39,9 +36,6 @@ export const ContentViewer = (props) => {
39
36
 
40
37
  /**
41
38
  * Field Viewer
42
- *
43
- * @param {} props
44
- * @returns
45
39
  */
46
40
  const FieldViewer = (props) => {
47
41
 
@@ -7,7 +7,7 @@ import './Explorer.css'
7
7
  */
8
8
  export const FileExplorer = (props) => {
9
9
 
10
- const { columns, files = [], onSelectFile, folders = [], onSelectFolder, defaultView = "grid", defaultFolder, filterableColumns = false } = props
10
+ const { columns, files = [], onSelectFile, folders = [], onSelectFolder, defaultView = "grid", defaultFolder, filterableColumns = false, searchBy=[] } = props
11
11
  const [selectedFolder, setSelectedFolder] = useState()
12
12
  const [selectedFile, setSelectedFile] = useState()
13
13
  const [search, setSearch] = useState()
@@ -36,7 +36,12 @@ export const FileExplorer = (props) => {
36
36
  setSearch(value)
37
37
  }
38
38
 
39
- const filteredFiles = search ? files.filter(file => file.title.toLowerCase().includes(search.toLowerCase())) : files
39
+ const filteredFiles = search ? files.filter(file => {
40
+ const serchByValues = searchBy.map(key => file[key])
41
+ const searchByString = serchByValues.join(' ')
42
+ return searchByString.toLowerCase().includes(search.toLowerCase())
43
+ }) : files
44
+
40
45
  const selectedFiles = filteredFiles.filter(file => file.folder === selectedFolder)
41
46
 
42
47
  return (
@@ -110,6 +110,7 @@ const FileExplorerTest = (props) => {
110
110
  { id: 'icon', label: 'Icon', minWidth: 100 },
111
111
  { id: 'title', label: 'Titlcccce', minWidth: 100 },
112
112
  ]}
113
+ searchBy={['title', 'subtitle']}
113
114
  />
114
115
  )
115
- }
116
+ }