ywana-core8 0.0.860 → 0.0.861
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 +28 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +28 -2
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +28 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain2/FORMATS.js +1 -0
- package/src/html/index.js +1 -1
- package/src/html/section.js +1 -1
- package/src/html/switch.js +17 -0
- package/src/html/table.js +3 -0
package/package.json
CHANGED
package/src/domain2/FORMATS.js
CHANGED
package/src/html/index.js
CHANGED
@@ -17,7 +17,7 @@ export { Text, TEXTFORMATS } from './text'
|
|
17
17
|
export { TextField, DropDown, TextArea, DateRange, PasswordField } from './textfield'
|
18
18
|
export { TokenField } from './tokenfield'
|
19
19
|
export { Tree, TreeNode, TreeItem } from './tree'
|
20
|
-
export { Switch } from './switch'
|
20
|
+
export { Switch, Switch2 } from './switch'
|
21
21
|
export { Tooltip } from './tooltip'
|
22
22
|
export { Thumbnail } from './thumbnail'
|
23
23
|
export { ColorField } from './color'
|
package/src/html/section.js
CHANGED
package/src/html/switch.js
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import RSwitch from 'react-switch'
|
3
|
+
import { Icon } from './icon'
|
3
4
|
|
4
5
|
export const Switch = (props) => {
|
5
6
|
|
@@ -20,4 +21,20 @@ export const Switch = (props) => {
|
|
20
21
|
className="react-switch"
|
21
22
|
/>
|
22
23
|
)
|
24
|
+
}
|
25
|
+
|
26
|
+
export const Switch2 = (props) => {
|
27
|
+
|
28
|
+
const { checked, onChange } = props
|
29
|
+
|
30
|
+
function toggle() {
|
31
|
+
onChange(!checked)
|
32
|
+
}
|
33
|
+
|
34
|
+
const icon = checked ? "toggle_on" : "toggle_off"
|
35
|
+
return (
|
36
|
+
<div className="switch">
|
37
|
+
<Icon icon={icon} clickable action={toggle} />
|
38
|
+
</div>
|
39
|
+
)
|
23
40
|
}
|
package/src/html/table.js
CHANGED
@@ -242,6 +242,9 @@ const EntityCellViewer = ({ id, item, value }) => {
|
|
242
242
|
case FORMATS.TIME:
|
243
243
|
text = new Date(text).toLocaleString(locale, { year: 'hour', month: 'minute', day: 'second' });
|
244
244
|
break;
|
245
|
+
case FORMATS.DATETIME:
|
246
|
+
text = new Date(text).toLocaleString(locale, { year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric' });
|
247
|
+
break;
|
245
248
|
}
|
246
249
|
}
|
247
250
|
|