ywana-core8 0.0.752 → 0.0.753
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 +31 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +19 -19
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +31 -25
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +31 -25
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/html/icon.js +17 -2
- package/src/html/list.js +2 -2
package/package.json
CHANGED
package/src/html/icon.js
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import './icon.css'
|
3
|
+
import { Tooltip } from './tooltip';
|
3
4
|
|
4
5
|
/**
|
5
6
|
* Icon
|
6
7
|
*/
|
7
|
-
export const Icon = ({ icon, size = "normal", clickable = false, disabled = false, action, eventPropagation = false, className }) => {
|
8
|
+
export const Icon = ({ icon, size = "normal", tooltip, clickable = false, disabled = false, action, eventPropagation = false, className }) => {
|
8
9
|
|
9
10
|
function click (event) {
|
10
11
|
if (!eventPropagation) {
|
@@ -15,9 +16,23 @@ export const Icon = ({ icon, size = "normal", clickable = false, disabled = fals
|
|
15
16
|
}
|
16
17
|
|
17
18
|
const style = disabled ? "disabled" : clickable ? "clickable" : ""
|
18
|
-
return (
|
19
|
+
return tooltip ? (
|
20
|
+
<Tooltip {...tooltip}>
|
21
|
+
<i className={`icon ${size} ${style} ${className} material-icons`} onClick={click} >
|
22
|
+
{icon}
|
23
|
+
</i>
|
24
|
+
</Tooltip>
|
25
|
+
) : (
|
19
26
|
<i className={`icon ${size} ${style} ${className} material-icons`} onClick={click}>
|
20
27
|
{icon}
|
21
28
|
</i>
|
22
29
|
)
|
30
|
+
}
|
31
|
+
|
32
|
+
const IconTest = (props) => {
|
33
|
+
return (
|
34
|
+
<div>
|
35
|
+
<Icon icon="add" tooltip={{ text: 'add', top: '2rem', left: '2rem'}}/>
|
36
|
+
</div>
|
37
|
+
)
|
23
38
|
}
|
package/src/html/list.js
CHANGED
@@ -62,7 +62,7 @@ const GroupedList = (props) => {
|
|
62
62
|
* List Item
|
63
63
|
*/
|
64
64
|
const ListItem = ({ item, selected, onSelect }) => {
|
65
|
-
const { id, icon, line1, line2, meta } = item
|
65
|
+
const { id, icon, iconTooltip, line1, line2, meta } = item
|
66
66
|
|
67
67
|
function select() {
|
68
68
|
if (onSelect) onSelect(id)
|
@@ -72,7 +72,7 @@ const ListItem = ({ item, selected, onSelect }) => {
|
|
72
72
|
const style = isSelected ? "selected" : ""
|
73
73
|
return (
|
74
74
|
<li className={`${style}`} onClick={select}>
|
75
|
-
{icon ? <Icon icon={icon} size="small" /> : null}
|
75
|
+
{icon ? <Icon icon={icon} size="small" tooltip={iconTooltip} /> : null}
|
76
76
|
<main>
|
77
77
|
<div className="primary-line"><Text>{line1}</Text></div>
|
78
78
|
{line2 ? <div className="secondary-line"><Text>{line2}</Text></div> : null}
|