ywana-core8 0.0.860 → 0.0.862

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.860",
3
+ "version": "0.0.862",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -18,6 +18,7 @@ export const FORMATS = {
18
18
  DATE: 'date',
19
19
  DATERANGE: 'DATERANGE',
20
20
  TIME: 'time',
21
+ DATETIME: 'datetime',
21
22
  EMAIL: 'email',
22
23
  HTML: 'HTML',
23
24
  URL: 'URL',
@@ -6,6 +6,7 @@ export const FORMATS = {
6
6
  DATE: 'date',
7
7
  DATERANGE: 'DATERANGE',
8
8
  TIME: 'time',
9
+ DATETIME: 'datetime',
9
10
  EMAIL: 'email',
10
11
  HTML: 'HTML',
11
12
  URL: 'URL',
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'
@@ -16,7 +16,7 @@ export const Section = (props) => {
16
16
  }, [open])
17
17
 
18
18
  const toggle = () => {
19
- setOpen(!open)
19
+ setOpen(!isOpen)
20
20
  }
21
21
 
22
22
  return (
@@ -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