ywana-core8 0.0.224 → 0.0.228
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 +105 -49
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +21 -1
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +103 -49
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +105 -49
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -1
- package/src/domain/CollectionPage.js +9 -1
- package/src/domain/TablePage.css +1 -1
- package/src/domain/TablePage.js +1 -1
- package/src/html/index.js +3 -1
- package/src/html/thumbnail.css +17 -0
- package/src/html/thumbnail.js +22 -0
- package/src/html/tooltip.css +3 -0
- package/src/html/tooltip.js +17 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "ywana-core8",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.228",
|
4
4
|
"description": "ywana-core8",
|
5
5
|
"author": "Ernesto Roldan Garcia",
|
6
6
|
"license": "MIT",
|
@@ -35,6 +35,7 @@
|
|
35
35
|
"react-error-overlay": "^6.0.10",
|
36
36
|
"react-notifications": "^1.7.3",
|
37
37
|
"react-switch": "^6.0.0",
|
38
|
+
"react-tooltip": "^4.2.21",
|
38
39
|
"resumablejs": "^1.1.0"
|
39
40
|
}
|
40
41
|
}
|
@@ -40,12 +40,20 @@ export const CollectionPage = (props) => {
|
|
40
40
|
site.openDialog(<CreateContentDialog label={`${name}`} type={schema} onOK={onOK} />);
|
41
41
|
}
|
42
42
|
|
43
|
+
function renderActions() {
|
44
|
+
return actions.map(element => {
|
45
|
+
const action = () => element.props.action(pageContext)
|
46
|
+
const clone = React.cloneElement(element, { action })
|
47
|
+
return clone
|
48
|
+
})
|
49
|
+
}
|
50
|
+
|
43
51
|
return (
|
44
52
|
<Fragment>
|
45
53
|
<Header className="collection-page" title={<Text>{title}</Text>}>
|
46
54
|
<Button icon="add" label="Add" action={add} />
|
47
55
|
<Button icon="refresh" label="Reload" action={reload} />
|
48
|
-
{
|
56
|
+
{renderActions()}
|
49
57
|
</Header>
|
50
58
|
<menu className="collection-page">
|
51
59
|
<Header title={<Text>Lista de {name}</Text>} >
|
package/src/domain/TablePage.css
CHANGED
package/src/domain/TablePage.js
CHANGED
@@ -23,7 +23,7 @@ export const TablePage = (props) => {
|
|
23
23
|
autosave = true, delay = 1000,
|
24
24
|
editable,
|
25
25
|
actions = [], dev = false, tableActions, selectionActions = [],
|
26
|
-
canFilter = false, canQuery = false, canAdd = true, canDelete = true, canEdit = true
|
26
|
+
canFilter = false, canQuery = false, canAdd = true, canDelete = true, canEdit = true,
|
27
27
|
groupBy, validator, scenario,
|
28
28
|
formFilter, tableFilter, editorFilter = false
|
29
29
|
} = props
|
package/src/html/index.js
CHANGED
@@ -16,4 +16,6 @@ export { Text } from './text'
|
|
16
16
|
export { TextField, DropDown } from './textfield'
|
17
17
|
export { TokenField } from './tokenfield'
|
18
18
|
export { Tree, TreeNode, TreeItem } from './tree'
|
19
|
-
export { Switch } from './switch'
|
19
|
+
export { Switch } from './switch'
|
20
|
+
export { Tooltip } from './tooltip'
|
21
|
+
export { Thumbnail } from './thumbnail'
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import './thumbnail.css'
|
3
|
+
|
4
|
+
/**
|
5
|
+
* Thumbnail
|
6
|
+
*/
|
7
|
+
export const Thumbnail = (props) => {
|
8
|
+
|
9
|
+
const {
|
10
|
+
src = "https://www.w3schools.com/howto/img_forest.jpg",
|
11
|
+
empty = "",
|
12
|
+
objectFit = "cover"
|
13
|
+
} = props
|
14
|
+
|
15
|
+
const image = src ? src : empty
|
16
|
+
const style = { objectFit }
|
17
|
+
return (
|
18
|
+
<div className="thumbnail" >
|
19
|
+
<img src={image} style={style} />
|
20
|
+
</div>
|
21
|
+
)
|
22
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import './tooltip.css'
|
3
|
+
|
4
|
+
/**
|
5
|
+
* Tooltip
|
6
|
+
*/
|
7
|
+
export const Tooltip = (props) => {
|
8
|
+
|
9
|
+
const { text = "..." } = props
|
10
|
+
|
11
|
+
return (
|
12
|
+
<ReactTooltip id="filters" effect="solid" className="tooltip">
|
13
|
+
<Text use="body2">{text}</Text>
|
14
|
+
</ReactTooltip>
|
15
|
+
)
|
16
|
+
|
17
|
+
}
|