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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ywana-core8",
3
- "version": "0.0.224",
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
- {actions}
56
+ {renderActions()}
49
57
  </Header>
50
58
  <menu className="collection-page">
51
59
  <Header title={<Text>Lista de {name}</Text>} >
@@ -17,7 +17,7 @@ main.table-page>header {
17
17
  }
18
18
 
19
19
  aside.table-page {
20
- width: 25rem;
20
+ min-width: 25rem;
21
21
  }
22
22
 
23
23
  main.table-editor {
@@ -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,17 @@
1
+ .thumbnail {
2
+ width: 100%;
3
+ min-width: 3rem;
4
+ max-width: 6rem;
5
+
6
+ height: 100%;
7
+ min-height: 3rem;
8
+ max-height: 6rem;
9
+
10
+ overflow: hidden;
11
+ border: solid 1px red;
12
+ }
13
+
14
+ .thumbnail>img {
15
+ width: 100%;
16
+ height: 100%;
17
+ }
@@ -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,3 @@
1
+ .tooltip {
2
+
3
+ }
@@ -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
+ }