ywana-core8 0.0.895 → 0.0.896
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 +9 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +9 -4
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +9 -4
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/widgets/explorer/Explorer.js +6 -5
- package/src/widgets/explorer/Explorer.test.js +4 -0
package/package.json
CHANGED
@@ -7,7 +7,7 @@ import './Explorer.css'
|
|
7
7
|
*/
|
8
8
|
export const FileExplorer = (props) => {
|
9
9
|
|
10
|
-
const { files = [], onSelectFile, folders = [], onSelectFolder, defaultView = "grid", defaultFolder } = props
|
10
|
+
const { columns, files = [], onSelectFile, folders = [], onSelectFolder, defaultView = "grid", defaultFolder } = props
|
11
11
|
const [selectedFolder, setSelectedFolder] = useState()
|
12
12
|
const [selectedFile, setSelectedFile] = useState()
|
13
13
|
const [search, setSearch] = useState()
|
@@ -45,6 +45,7 @@ export const FileExplorer = (props) => {
|
|
45
45
|
files={selectedFiles} selectedFile={selectedFile} onSelectFile={selectFile}
|
46
46
|
search={search} onSearch={searchChanged}
|
47
47
|
selectedView={defaultView}
|
48
|
+
columns={columns}
|
48
49
|
/>
|
49
50
|
)
|
50
51
|
}
|
@@ -54,7 +55,7 @@ export const FileExplorer = (props) => {
|
|
54
55
|
*/
|
55
56
|
export const FileExplorerView = (props) => {
|
56
57
|
|
57
|
-
const { folders = [], selectedFolder, onSelectFolder, files = [], selectedFile, onSelectFile, search, onSearch, selectedView = "grid" } = props
|
58
|
+
const { folders = [], selectedFolder, onSelectFolder, columns, files = [], selectedFile, onSelectFile, search, onSearch, selectedView = "grid" } = props
|
58
59
|
|
59
60
|
const [view, setView] = useState(selectedView)
|
60
61
|
|
@@ -82,7 +83,7 @@ export const FileExplorerView = (props) => {
|
|
82
83
|
</menu>
|
83
84
|
<main>
|
84
85
|
{view === 'grid' ? <FilesGridView files={files} selected={selectedFile} onSelect={onSelectFile} /> : null}
|
85
|
-
{view === 'list' ? <FilesTableView files={files} selected={selectedFile} onSelect={onSelectFile} /> : null}
|
86
|
+
{view === 'list' ? <FilesTableView columns={columns} files={files} selected={selectedFile} onSelect={onSelectFile} /> : null}
|
86
87
|
</main>
|
87
88
|
</div>
|
88
89
|
)
|
@@ -176,14 +177,14 @@ export const FileGridItem = (props) => {
|
|
176
177
|
|
177
178
|
export const FilesTableView = (props) => {
|
178
179
|
|
179
|
-
const { files = [], selected, onSelect } = props
|
180
|
+
const { columns, files = [], selected, onSelect } = props
|
180
181
|
|
181
182
|
function isSelected(id) {
|
182
183
|
return selected === id
|
183
184
|
}
|
184
185
|
|
185
186
|
const table = {
|
186
|
-
columns: [
|
187
|
+
columns: columns ? columns : [
|
187
188
|
{ id: "icon", type: "ICON" },
|
188
189
|
{ id: "title", label: "Title" },
|
189
190
|
{ id: "subtitle", label: "Subtitle" },
|
@@ -106,6 +106,10 @@ const FileExplorerTest = (props) => {
|
|
106
106
|
files={files}
|
107
107
|
onSelectFile={props.onSelectFile}
|
108
108
|
onSelectFolder={props.onSelectFolder}
|
109
|
+
columns ={[
|
110
|
+
{ id: 'icon', label: 'Icon', minWidth: 100 },
|
111
|
+
{ id: 'title', label: 'Titlcccce', minWidth: 100 },
|
112
|
+
]}
|
109
113
|
/>
|
110
114
|
)
|
111
115
|
}
|