ywana-core8 0.0.227 → 0.0.231

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.227",
3
+ "version": "0.0.231",
4
4
  "description": "ywana-core8",
5
5
  "author": "Ernesto Roldan Garcia",
6
6
  "license": "MIT",
@@ -16,6 +16,7 @@ export const TYPES = {
16
16
  export const FORMATS = {
17
17
  NONE: '',
18
18
  DATE: 'date',
19
+ TIME: 'time',
19
20
  EMAIL: 'email',
20
21
  HTML: 'HTML',
21
22
  URL: 'URL'
package/src/html/index.js CHANGED
@@ -17,4 +17,5 @@ export { TextField, DropDown } from './textfield'
17
17
  export { TokenField } from './tokenfield'
18
18
  export { Tree, TreeNode, TreeItem } from './tree'
19
19
  export { Switch } from './switch'
20
- export { Tooltip } from './tooltip'
20
+ export { Tooltip } from './tooltip'
21
+ export { Thumbnail } from './thumbnail'
package/src/html/table.js CHANGED
@@ -203,8 +203,18 @@ const BooleanCellViewer = ({ id, value = false }) => {
203
203
  const StringCellViewer = ({ id, value, format, options }) => {
204
204
  const option = options ? options.find(o => o.value === value) : null
205
205
  let text = option ? option.label : value
206
+ const locale = window.navigator.userLanguage || window.navigator.language;
206
207
  switch (format) {
207
- case FORMATS.DATE: text = new Date(text).toLocaleString(); break;
208
+ case FORMATS.DATE: text = new Date(text).toLocaleString( locale, {
209
+ year: 'numeric',
210
+ month: 'numeric',
211
+ day: 'numeric'
212
+ }); break;
213
+ case FORMATS.TIME: text = new Date(text).toLocaleString( locale, {
214
+ year: 'hour',
215
+ month: 'minute',
216
+ day: 'second'
217
+ }); break;
208
218
  }
209
219
  return (<div className="field-editor string-viewer">{text}</div>)
210
220
  }
@@ -0,0 +1,16 @@
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
+ }
12
+
13
+ .thumbnail>img {
14
+ width: 100%;
15
+ height: 100%;
16
+ }
@@ -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
+ }
@@ -2,4 +2,5 @@ export * from './login/LoginBox'
2
2
  export * from './login/ResetPasswordBox'
3
3
  export * from './viewer/Viewer'
4
4
  export * from './kanban/Kanban'
5
- export * from './avatar/avatar'
5
+ export * from './avatar/avatar'
6
+ export * from './waiter'
@@ -0,0 +1 @@
1
+ export * from './waiter'
@@ -0,0 +1,11 @@
1
+ .wait-screen {
2
+ position:absolute;
3
+ top:0px;
4
+ left:0px;
5
+ width: 100%;
6
+ height: 100%;
7
+ background-color: rgba(200,200,200,.5);
8
+ display: flex;
9
+ justify-content: center;
10
+ align-items: center;
11
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react'
2
+ import { CircularProgress } from '../../html'
3
+ import './waiter.css'
4
+
5
+ export const WaitScreen = () => {
6
+ return (
7
+ <div className="wait-screen">
8
+ <CircularProgress size="large"/>
9
+ </div>
10
+ )
11
+ }